? -dup
? cvschk
? kdebase.diff
? up
? konqueror/keditbookmarks/core.cpp.mine
Index: configure.in.in
===================================================================
RCS file: /home/kde/kdebase/configure.in.in,v
retrieving revision 1.52
diff -d -u -p -r1.52 configure.in.in
--- configure.in.in	18 Dec 2002 09:19:21 -0000	1.52
+++ configure.in.in	5 Mar 2003 05:52:41 -0000
@@ -19,7 +19,7 @@ AC_CHECK_HEADERS(sys/time.h crypt.h \
 	sys/m_wait.h ncurses.h paths.h login_cap.h syslog.h \
 	sys/wait.h sys/ucred.h sys/mount.h floatingpoint.h fstab.h mntent.h \
 	Alib.h libutil.h util.h time.h limits.h vfork.h string.h float.h \
-	math.h nan.h ieeefp.h
+	math.h nan.h ieeefp.h libintl.h
 )
 AC_CHECK_HEADER(pty.h)
 AC_CHECK_FUNC(ptsname,,)
Index: admin/acinclude.m4.in
===================================================================
RCS file: /home/kde/kde-common/admin/acinclude.m4.in,v
retrieving revision 2.344
diff -d -u -p -r2.344 acinclude.m4.in
--- admin/acinclude.m4.in	1 Mar 2003 16:29:48 -0000	2.344
+++ admin/acinclude.m4.in	5 Mar 2003 05:52:48 -0000
@@ -817,7 +817,14 @@ AC_ARG_ENABLE(
   kde_use_qt_emb_palm=no
 )
 
-if test "$kde_use_qt_emb" = "no"; then
+AC_ARG_ENABLE(
+  mac,
+  [  --enable-mac       link to Qt/Mac (don't use X)],
+  kde_use_qt_mac=$enableval,
+  kde_use_qt_mac=no
+)
+
+if test "$kde_use_qt_emb" = "no" && test "$kde_use_qt_mac" = "no"; then
 
 AC_MSG_CHECKING(for X)
 AC_LANG_SAVE
@@ -976,7 +983,7 @@ fi
 LIB_XEXT="-lXext"
 QTE_NORTTI=""
 
-else
+elif test "$kde_use_qt_emb" = "yes"; then
   dnl We're using QT Embedded
   CPPFLAGS=-DQWS
   CXXFLAGS="$CXXFLAGS -fno-rtti"
@@ -996,6 +1003,26 @@ else
   AC_SUBST(X_LDFLAGS)
   AC_SUBST(x_includes)
   AC_SUBST(x_libraries)
+elif test "$kde_use_qt_mac" = "yes"; then
+  dnl We're using QT/Mac (I use QT_MAC so that qglobal.h doesn't *have* to
+  dnl be included to get the information) --Sam
+  CXXFLAGS="$CXXFLAGS -DQT_MAC -no-cpp-precomp"
+  CFLAGS="$CFLAGS -DQT_MAC -no-cpp-precomp"
+  X_PRE_LIBS=""
+  LIB_X11=""
+  LIB_XEXT=""
+  LIBSM=""
+  X_INCLUDES=""
+  X_LDFLAGS=""
+  x_includes=""
+  x_libraries=""
+  AC_SUBST(X_PRE_LIBS)
+  AC_SUBST(LIB_X11)
+  AC_SUBST(LIBSM)
+  AC_SUBST(X_INCLUDES)
+  AC_SUBST(X_LDFLAGS)
+  AC_SUBST(x_includes)
+  AC_SUBST(x_libraries)
 fi
 AC_SUBST(QTE_NORTTI)
 AC_SUBST(LIB_XEXT)
@@ -1157,7 +1184,7 @@ ac_libs_safe="$LIBS"
 
 CXXFLAGS="$CXXFLAGS -I$qt_includes"
 LDFLAGS="$LDFLAGS $X_LDFLAGS"
-if test "x$kde_use_qt_emb" != "xyes"; then
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 LIBS="$LIBQT -lXext -lX11 $LIBSOCKET"
 else
 LIBS="$LIBQT $LIBSOCKET"
@@ -1324,7 +1351,7 @@ fi
 
 AC_MSG_CHECKING([for Qt])
 
-if test "x$kde_use_qt_emb" != "xyes"; then
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 LIBQT="$LIBQT $X_PRE_LIBS -lXext -lX11 $LIBSM $LIBSOCKET"
 fi
 ac_qt_includes=NO ac_qt_libraries=NO ac_qt_bindir=NO
@@ -1388,6 +1415,12 @@ else
     if test -n "`$try 2> /dev/null`"; then qt_libdir=$dir; break; else echo "tried $dir" >&AC_FD_CC ; fi
   done
 fi
+for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
+  if test -e "$a"; then
+    LIBQT="$LIBQT ${kde_int_qt}_incremental"
+    break
+  fi
+done
 
 ac_qt_libraries="$qt_libdir"
 
@@ -1485,12 +1518,18 @@ AC_PATH_QT_MOC_UIC
 
 KDE_CHECK_QT_JPEG
 
-if test "x$kde_use_qt_emb" != "xyes"; then
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG) -lXext $(LIB_X11) $(LIBSM)'
 else
 LIB_QT="$kde_int_qt $LIBJPEG_QT "'$(LIBPNG)'
 fi
 test -z "$KDE_MT_LIBS" || LIB_QT="$LIB_QT $KDE_MT_LIBS"
+for a in $qt_libdir/lib`echo ${kde_int_qt} | sed 's,^-l,,'`_incremental.*; do
+  if test -e "$a"; then
+     LIB_QT="$LIB_QT ${kde_int_qt}_incremental"
+     break
+  fi
+done
 
 AC_SUBST(LIB_QT)
 AC_SUBST(LIB_QPE)
@@ -2265,7 +2304,7 @@ AC_DEFUN(AC_FIND_GIF,
    [AC_MSG_CHECKING([for giflib])
 AC_CACHE_VAL(ac_cv_lib_gif,
 [ac_save_LIBS="$LIBS"
-if test "x$kde_use_qt_emb" != "xyes"; then
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 LIBS="$all_libraries -lgif -lX11 $LIBSOCKET"
 else
 LIBS="$all_libraries -lgif"
@@ -2469,7 +2508,7 @@ AC_CACHE_VAL(kde_cv_libtiff_$1,
 AC_LANG_SAVE
 AC_LANG_CPLUSPLUS
 kde_save_LIBS="$LIBS"
-if test "x$kde_use_qt_emb" != "xyes"; then
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lX11 $LIBSOCKET -lm"
 else
 LIBS="$all_libraries $USER_LDFLAGS -l$1 $LIBJPEG $LIBZ -lm"
@@ -2528,7 +2567,7 @@ AC_MSG_CHECKING([for libpng])
 AC_CACHE_VAL(ac_cv_lib_png,
 [
 kde_save_LIBS="$LIBS"
-if test "x$kde_use_qt_emb" != "xyes"; then
+if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm -lX11 $LIBSOCKET"
 else
 LIBS="$LIBS $all_libraries $USER_LDFLAGS -lpng $LIBZ -lm"
@@ -3302,7 +3341,7 @@ AC_DEFUN(AC_HAVE_XPM,
     AC_LANG_C
     ac_save_ldflags="$LDFLAGS"
     ac_save_cflags="$CFLAGS"
-    if test "x$kde_use_qt_emb" != "xyes"; then
+    if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
       LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm -lX11 -lXext $LIBZ $LIBSOCKET"
     else
       LDFLAGS="$LDFLAGS $X_LDFLAGS $USER_LDFLAGS $LDFLAGS $XPM_LDFLAGS $all_libraries -lXpm $LIBZ $LIBSOCKET"
@@ -3358,7 +3397,7 @@ AC_DEFUN(AC_HAVE_DPMS,
    dnl 'yes' means DPMS_LIB="", '-lXdpms' means DPMS_LIB="-lXdpms".
    AC_CACHE_VAL(ac_cv_have_dpms,
    [
-    if test "x$kde_use_qt_emb" = "xyes"; then
+    if test "x$kde_use_qt_emb" != "xyes" && test "x$kde_use_qt_mac" != "xyes"; then
       AC_MSG_RESULT(no)
       ac_cv_have_dpms="no"
     else
@@ -3451,7 +3490,7 @@ AC_DEFUN(AC_HAVE_GL,
     ac_save_ldflags="$LDFLAGS"
     ac_save_cxxflags="$CXXFLAGS"
     LDFLAGS="$LDFLAGS $GL_LDFLAGS $X_LDFLAGS $all_libraries -lMesaGL -lMesaGLU"
-    test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
+    test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
     LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
     CXXFLAGS="$CFLAGS $X_INCLUDES"
     test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
@@ -3461,7 +3500,7 @@ AC_DEFUN(AC_HAVE_GL,
 	ac_cv_have_gl="mesa", ac_cv_have_gl="no")
     if test "x$ac_cv_have_gl" = "xno"; then
       LDFLAGS="$ac_save_ldflags $X_LDFLAGS $GL_LDFLAGS $all_libraries -lGLU -lGL"
-      test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
+      test "x$kde_use_qt_mac" != xyes && test "x$kde_use_qt_emb" != xyes && LDFLAGS="$LDFLAGS -lX11"
       LDFLAGS="$LDFLAGS $LIB_XEXT -lm $LIBSOCKET"
       CXXFLAGS="$ac_save_cflags $X_INCLUDES"
       test -n "$GL_INCLUDE" && CFLAGS="-I$GL_INCLUDE $CFLAGS"
Index: admin/libtool.m4.in
===================================================================
RCS file: /home/kde/kde-common/admin/libtool.m4.in,v
retrieving revision 1.76
diff -d -u -p -r1.76 libtool.m4.in
--- admin/libtool.m4.in	11 Feb 2003 08:22:01 -0000	1.76
+++ admin/libtool.m4.in	5 Mar 2003 05:52:56 -0000
@@ -609,6 +609,12 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [d
     lt_cv_sys_max_cmd_len=-1;
     ;;
 
+  darwin*)
+    # this should be enough... the length test freaks out some versions
+    # of OSX's `expr`
+    lt_cv_sys_max_cmd_len=16384;
+    ;;
+
   *)
     # If test is not a shell built-in, we'll probably end up computing a
     # maximum length that is only half of the actual maximum length, but
@@ -1138,10 +1144,17 @@ darwin* | rhapsody*)
   # FIXME: Relying on posixy $() will cause problems for
   #        cross-compilation, but unfortunately the echo tests do not
   #        yet detect zsh echo's removal of \ escapes.
-  library_names_spec='${libname}${release}${versuffix}.$(test .$module = .yes && echo so || echo dylib) ${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib) ${libname}.$(test .$module = .yes && echo so || echo dylib)'
+  library_names_spec='${libname}${release}${versuffix}$(test .$module = .yes && echo .so).dylib $(test .$module != .yes && echo ${libname}${release}${major}.dylib ${libname}.dylib)'
   soname_spec='${libname}${release}${major}.$(test .$module = .yes && echo so || echo dylib)'
   shlibpath_overrides_runpath=yes
   shlibpath_var=DYLD_LIBRARY_PATH
+  postinstall_cmds='dlpath=`bash 2>&1 -c '\''. $dir/${file}i;echo \$dlname'\''`~
+    dldir=$destdir/`dirname \$dlpath`~
+    test -d \$dldir || mkdir -p \$dldir~
+    echo \$dlname | grep .so$ && $install_prog .libs/$dlname \$dldir/$dlname || true'
+  postuninstall_cmds='dldll=`bash 2>&1 -c '\''. $file; echo \$dlname'\''`~
+    dlpath=$dir/\$dldll~
+     echo \$dlname | grep .so$ && $rm \$dlpath || true'
   ;;
 
 dgux*)
@@ -1909,7 +1922,8 @@ darwin* | rhapsody*)
     lt_cv_file_magic_test_file=`/System/Library/Frameworks/System.framework/System`
     ;;
   *) # Darwin 1.3 on
-    lt_cv_file_magic_test_file='/usr/lib/libSystem.dylib'
+    lt_cv_deplibs_check_method='pass_all'
+       lt_cv_file_magic_cmd=''
     ;;
   esac
   ;;
@@ -2561,6 +2575,27 @@ case $host_os in
 	;;
     esac
     ;;
+  darwin*)
+    shared_flag='-dynamiclib'
+    CCT=""
+    for ENTRY in `what /usr/bin/ld`; do 
+      case $ENTRY in
+        PROJECT:*)
+          CCT=`expr "$ENTRY" : 'PROJECT:cctools-\([[:digit:]]*\)'`
+          ;;
+      esac
+    done
+
+    test -n "$CCT" || CCT=0
+    if true || test "$CCT" -ge 446; then
+      export MACOSX_DEPLOYMENT_TARGET=10.2
+      _LT_AC_TAGVAR(archive_cmds, $1)='$(test .$module = .yes && echo $CC -dynamiclib -single_module -undefined suppress -flat_namespace -o ${lib} $libobjs || echo true) && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib -single_module) $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $(test .$module = .yes && echo .libs/$soname || echo $lib ) $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
+    else
+      # this may cause problems with some libraries!
+      _LT_AC_TAGVAR(archive_cmds, $1)='$(test .$module = .yes && echo $CC -dynamiclib -undefined suppress -flat_namespace -o ${lib} $libobjs || echo true) && $CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $(test .$module = .yes && echo .libs/$soname || echo $lib ) $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
+    fi
+    output_verbose_link_cmd='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $CFLAGS -v conftest.$objext 2>&1 | egrep "\-L"'
+    ;;
   dgux*)
     case $cc_basename in
       ec++)
@@ -4751,7 +4786,9 @@ EOF
 	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-undefined suppress'
 	;;
       *) # Darwin 1.3 on
-	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+	#_LT_AC_TAGVAR(allow_undefined_flag, $1)='-flat_namespace -undefined suppress'
+        # testing with twolevel namespaces
+	_LT_AC_TAGVAR(allow_undefined_flag, $1)='-multiply_defined suppress'
 	;;
       esac
 
@@ -4759,7 +4796,16 @@ EOF
       #        cross-compilation, but unfortunately the echo tests do not
       #        yet detect zsh echo's removal of \ escapes.  Also zsh mangles
       #	       `"' quotes if we put them in here... so don't!
-      _LT_AC_TAGVAR(archive_cmds, $1)='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linker_flags -install_name $rpath/$soname $verstring'
+      BUILD=`gcc -v 2>&1 | grep 'GCC version'`
+      BUILD=`expr "$BUILD" : '.*GCC version \(.*\), based.*'`
+      test -n "$BUILD" || BUILD=0
+      if test "$BUILD" -ge 1173; then
+        export MACOSX_DEPLOYMENT_TARGET=10.2
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib -single_module) $allow_undefined_flag -o $lib $libobjs $deplibs $linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
+      else
+        # this may cause problems with some libraries!
+        _LT_AC_TAGVAR(archive_cmds, $1)='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs $linker_flags $(test .$module != .yes && echo -install_name $rpath/$soname $verstring)'
+      fi
       # We need to add '_' to the symbols in $export_symbols first
       #_LT_AC_TAGVAR(archive_expsym_cmds, $1)="$_LT_AC_TAGVAR(archive_cmds, $1)"' && strip -s $export_symbols'
       _LT_AC_TAGVAR(hardcode_direct, $1)=yes
Index: admin/ltmain.sh
===================================================================
RCS file: /home/kde/kde-common/admin/ltmain.sh,v
retrieving revision 1.61
diff -d -u -p -r1.61 ltmain.sh
--- admin/ltmain.sh	2 Jun 2002 20:54:46 -0000	1.61
+++ admin/ltmain.sh	5 Mar 2003 05:53:05 -0000
@@ -659,7 +659,20 @@ EOF
       $run $rm "$lobj" "$output_obj"
 
       $show "$command"
-      if $run eval "$command"; then :
+      if $run eval "$command"; then 
+        case $host in
+        *darwin*)
+              BUILD=`gcc -v 2>&1 | grep 'GCC version'`
+              BUILD=`expr "$BUILD" : '.*GCC version \(.*\), based.*'`
+              test -n "$BUILD" || BUILD=0
+              if test "$BUILD" -lt 1173; then
+		 $show "ld -r -d $lobj"
+	         if ld -r -d "$lobj" -o "${lobj}.ld"; then
+		     mv "${lobj}.ld" "$lobj"
+		 fi
+	      fi
+	      ;;
+        esac
       else
 	test -n "$output_obj" && $run $rm $removelist
 	exit 1
@@ -729,7 +742,20 @@ EOF
       command="$command$suppress_output"
       $run $rm "$obj" "$output_obj"
       $show "$command"
-      if $run eval "$command"; then :
+      if $run eval "$command"; then
+        case $host in
+        *darwin*)
+              BUILD=`gcc -v 2>&1 | grep 'GCC version'`
+              BUILD=`expr "$BUILD" : '.*GCC version \(.*\), based.*'`
+              test -n "$BUILD" || BUILD=0
+              if test "$BUILD" -lt 1173; then
+		 $show "ld -r -d $lobj"
+	         if ld -r -d "$lobj" -o "${lobj}.ld"; then
+		     mv "${lobj}.ld" "$lobj"
+		 fi
+	      fi
+	      ;;
+        esac
       else
 	$run $rm $removelist
 	exit 1
@@ -2532,11 +2558,11 @@ EOF
 	eval libname=\"$libname_spec\"
 	;;
       *)
-	if test "$module" = no; then
-	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
-	  $echo "$help" 1>&2
-	  exit 1
-	fi
+#	if test "$module" = no; then
+#	  $echo "$modename: libtool library \`$output' must begin with \`lib'" 1>&2
+#	  $echo "$help" 1>&2
+#	  exit 1
+#	fi
 	if test "$need_lib_prefix" != no; then
 	  # Add the "lib" prefix for modules if required
 	  name=`$echo "X$outputname" | $Xsed -e 's/\.la$//'`
@@ -3321,7 +3347,23 @@ EOF
 	if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
 	  eval cmds=\"$archive_expsym_cmds\"
 	else
+          if test "x$verstring" = "x0.0"; then
+                tmp_verstring=
+          else
+                tmp_verstring="$verstring"
+          fi
+ 	  save_deplibs="$deplibs"
+ 	  for conv in $convenience; do
+            tmp_deplibs=
+            for test_deplib in $deplibs; do
+              if test "$test_deplib" != "$conv"; then
+                tmp_deplibs="$tmp_deplibs $test_deplib"
+              fi
+            done
+            deplibs="$tmp_deplibs"
+ 	  done
 	  eval cmds=\"$archive_cmds\"
+ 	  deplibs="$save_deplibs"
 	fi
 
 	if len=`expr "X$cmds" : ".*"` &&
@@ -3419,7 +3461,12 @@ EOF
 	  if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
 	    eval cmds=\"$archive_expsym_cmds\"
 	  else
-	    eval cmds=\"$archive_cmds\"
+            save_deplibs="$deplibs"
+            for conv in $convenience; do
+              deplibs="${deplibs%$conv*} ${deplibs#*$conv}"
+            done
+            eval cmds=\"$archive_cmds\"
+            deplibs="$save_deplibs"
 	  fi
 
 	  # Append the command to remove the reloadable object files
@@ -3634,6 +3681,14 @@ EOF
 	;;
       esac
 
+      case $host in
+      *darwin*)
+        # Don't allow lazy linking, it breaks C++ global constructors
+        compile_command="$compile_command ${wl}-bind_at_load -undefined suppress -flat_namespace"
+        finalize_command="$finalize_command ${wl}-bind_at_load"
+        ;;
+      esac
+
       compile_command="$compile_command $compile_deplibs"
       finalize_command="$finalize_command $finalize_deplibs"
 
@@ -4024,9 +4079,10 @@ static const void *lt_preloaded_setup() 
 	    # fast_install is set to needless
 	    relink_command=
 	  fi
+          relink_command=
 	else
 	  link_command="$compile_var$compile_command$compile_rpath"
-	  relink_command="$finalize_var$finalize_command$finalize_rpath"
+	  #relink_command="$finalize_var$finalize_command$finalize_rpath"
 	fi
       fi
 
@@ -4549,6 +4605,7 @@ relink_command=\"$relink_command\""
     prev=
     install_type=
     isdir=no
+    bundle=no
     stripme=
     for arg
     do
@@ -4564,6 +4621,9 @@ relink_command=\"$relink_command\""
       -g) prev="-g" ;;
       -m) prev="-m" ;;
       -o) prev="-o" ;;
+      -bundle) 
+        bundle=yes 
+        continue ;;
       -s)
 	stripme=" -s"
 	continue
@@ -4916,6 +4976,13 @@ relink_command=\"$relink_command\""
 	  esac
 	  ;;
 	esac
+	case $host in
+        *darwin*)
+           if [ "x$bundle" = "xyes" ]; then # Put executables into an application bundle
+	     echo $destfile | grep '\.app' >/dev/null 2>&1 || destfile="${destfile}.app/Contents/MacOS/$(basename $destfile)"
+           fi
+           ;;
+        esac
 	$show "$install_prog$stripme $file $destfile"
 	$run eval "$install_prog\$stripme \$file \$destfile" || exit $?
 	test -n "$outputname" && ${rm}r "$tmpdir"
Index: kate/app/Makefile.am
===================================================================
RCS file: /home/kde/kdebase/kate/app/Makefile.am,v
retrieving revision 1.37
diff -d -u -p -r1.37 Makefile.am
--- kate/app/Makefile.am	2 Mar 2003 16:47:07 -0000	1.37
+++ kate/app/Makefile.am	5 Mar 2003 05:53:08 -0000
@@ -9,7 +9,7 @@ libkateinterfaces_la_SOURCES = kateapp.c
         kbookmarkhandler.cpp kactionselector.cpp katedockcontainer.cpp kateprojectlist.cpp \
         kateprojecttreeview.cpp kateprojectviews.cpp kateprojectdirview.cpp
 
-libkateinterfaces_la_LIBADD   = ../interfaces/libkateinterfacesprivate.la -lkscript ../lib/libkmultitabbar.la ../utils/libkateutils.la
+libkateinterfaces_la_LIBADD   = ../interfaces/libkateinterfacesprivate.la -lkscript ../lib/libkmultitabbar.la ../utils/libkateutils.la $(LIB_KPARTS)
 libkateinterfaces_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -no-undefined
 
 kate_la_SOURCES = katemain.cpp
@@ -17,7 +17,7 @@ kate_la_LIBADD = libkateinterfaces.la
 kate_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module -avoid-version 
 
 kwrite_la_SOURCES = kwritemain.cpp kwritedialogs.cpp
-kwrite_la_LIBADD   = -lktexteditor  ../utils/libkateutils.la
+kwrite_la_LIBADD   = -lktexteditor  ../utils/libkateutils.la $(LIB_KPARTS)
 kwrite_la_LDFLAGS = $(all_libraries) $(KDE_RPATH) -module -avoid-version
 
 kate_SOURCES = dummy_kate.cpp
Index: kate/app/kateapp.cpp
===================================================================
RCS file: /home/kde/kdebase/kate/app/kateapp.cpp,v
retrieving revision 1.56
diff -d -u -p -r1.56 kateapp.cpp
--- kate/app/kateapp.cpp	25 Jan 2003 14:26:05 -0000	1.56
+++ kate/app/kateapp.cpp	5 Mar 2003 05:53:09 -0000
@@ -213,7 +213,9 @@ KateMainWindow *KateApp::newMainWindow (
 
   mainWindow->show ();
   mainWindow->raise();
+#ifdef Q_WS_X11
   KWin::setActiveWindow (mainWindow->winId());
+#endif
   
   return mainWindow;
 }
@@ -233,7 +235,9 @@ void KateApp::openURL (const QString &na
   m_mainWindows.at(n)->kateViewManager()->openURL (KURL(name));
 
   m_mainWindows.at(n)->raise();
+#ifdef Q_WS_X11
   KWin::setActiveWindow (m_mainWindows.at(n)->winId());
+#endif
 }
 
 void KateApp::raiseCurrentMainWindow ()
@@ -244,7 +248,9 @@ void KateApp::raiseCurrentMainWindow ()
     n=0;
 
   m_mainWindows.at(n)->raise();
+#ifdef Q_WS_X11
   KWin::setActiveWindow (m_mainWindows.at(n)->winId());
+#endif
 }    
 
 Kate::MainWindow *KateApp::activeMainWindow ()
Index: kate/app/kateconfigdialog.cpp
===================================================================
RCS file: /home/kde/kdebase/kate/app/kateconfigdialog.cpp,v
retrieving revision 1.55
diff -d -u -p -r1.55 kateconfigdialog.cpp
--- kate/app/kateconfigdialog.cpp	9 Feb 2003 09:54:06 -0000	1.55
+++ kate/app/kateconfigdialog.cpp	5 Mar 2003 05:53:09 -0000
@@ -79,8 +79,10 @@ KateConfigDialog::KateConfigDialog (Kate
   pluginPages.setAutoDelete (false);
   editorPages.setAutoDelete (false);
 
+#ifdef Q_WS_X11
   KWin kwin;
   kwin.setIcons(winId(), kapp->icon(), kapp->miniIcon());
+#endif
 
   QStringList path;
 
Index: kate/app/kategrepdialog.cpp
===================================================================
RCS file: /home/kde/kdebase/kate/app/kategrepdialog.cpp,v
retrieving revision 1.18
diff -d -u -p -r1.18 kategrepdialog.cpp
--- kate/app/kategrepdialog.cpp	1 Mar 2003 02:48:56 -0000	1.18
+++ kate/app/kategrepdialog.cpp	5 Mar 2003 05:53:10 -0000
@@ -64,7 +64,9 @@ GrepDialog::GrepDialog(const QString &di
     : KDialog(parent, name, false), childproc(0)
 {
     setCaption(i18n("Find in Files"));
+#ifdef Q_WS_X11
     KWin::setType(winId(),NET::Tool);
+#endif
     config = KGlobal::config();
     config->setGroup("GrepDialog");
     lastSearchItems = config->readListEntry("LastSearchItems");
Index: kcontrol/background/bgadvanced.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/background/bgadvanced.cpp,v
retrieving revision 1.4
diff -d -u -p -r1.4 bgadvanced.cpp
--- kcontrol/background/bgadvanced.cpp	1 Feb 2003 08:21:12 -0000	1.4
+++ kcontrol/background/bgadvanced.cpp	5 Mar 2003 05:53:11 -0000
@@ -31,6 +31,7 @@
 #include <qslider.h>
 #include <qspinbox.h>
 #include <qwhatsthis.h>
+#include <qapplication.h>
 
 #include <kconfig.h>
 #include <kcolorbutton.h>
@@ -44,15 +45,21 @@
 #include "bgadvanced.h"
 #include "bgadvanced_ui.h"
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 
 /**** BGAdvancedDialog ****/
 
 static QCString desktopConfigname()
 {
     int desktop=0;
+#ifdef Q_WS_X11
     if (qt_xdisplay())
         desktop = DefaultScreen(qt_xdisplay());
+#else
+    desktop = QApplication::desktop()->primaryScreen();
+#endif
     QCString name;
     if (desktop == 0)
         name = "kdesktoprc";
Index: kcontrol/background/bgdialog.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/background/bgdialog.cpp,v
retrieving revision 1.7
diff -d -u -p -r1.7 bgdialog.cpp
--- kcontrol/background/bgdialog.cpp	11 Feb 2003 16:23:36 -0000	1.7
+++ kcontrol/background/bgdialog.cpp	5 Mar 2003 05:53:12 -0000
@@ -58,8 +58,12 @@ BGDialog::BGDialog(QWidget* parent, KCon
    m_multidesktop = _multidesktop;
    m_previewUpdates = true;
 
+#ifdef Q_WS_X11
    m_Max = m_multidesktop ? KWin::numberOfDesktops() : 1;
    m_Desk = m_multidesktop ? KWin::currentDesktop() : 1;
+#else
+   m_Desk = m_Max = 1;
+#endif
    m_eDesk = m_pGlobals->commonBackground() ? 0 : m_Desk;
    m_copyAllDesktops = true;
 
Index: kcontrol/background/bgrender.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/background/bgrender.cpp,v
retrieving revision 1.2
diff -d -u -p -r1.2 bgrender.cpp
--- kcontrol/background/bgrender.cpp	5 Feb 2003 15:46:28 -0000	1.2
+++ kcontrol/background/bgrender.cpp	5 Mar 2003 05:53:13 -0000
@@ -27,7 +27,9 @@
 
 #include "bgrender.h"
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 
 
 /**** KBackgroundRenderer ****/
@@ -168,9 +170,11 @@ int KBackgroundRenderer::doBackground(bo
     // some dithering may be needed even with bpb==15/16, so don't use tileWidth==1
     // for them
     // with tileWidth>2, repainting the desktop causes nasty effect (XFree86 4.1.0 )
+#ifdef Q_WS_X11
         if( XQueryBestTile( qt_xdisplay(), qt_xrootwin(), tile_val, tile_val,
             &tileWidth, &tileHeight ) != Success )
             tileWidth = tileHeight = tile_val; // some defaults
+#endif
     }
     switch (bgmode) {
 
@@ -385,7 +389,11 @@ wp_out:
     return retval;
 }
 
+#ifdef Q_WS_X11
 extern bool qt_use_xrender; // in Qt ( qapplication_x11.cpp )
+#else
+static bool qt_use_xrender = FALSE;
+#endif
 
 void KBackgroundRenderer::wallpaperBlend( const QRect& d, QImage& wp, int ww, int wh )
 {
Index: kcontrol/background/bgsettings.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/background/bgsettings.cpp,v
retrieving revision 1.3
diff -d -u -p -r1.3 bgsettings.cpp
--- kcontrol/background/bgsettings.cpp	1 Feb 2003 08:21:12 -0000	1.3
+++ kcontrol/background/bgsettings.cpp	5 Mar 2003 05:53:15 -0000
@@ -500,8 +500,12 @@ KBackgroundSettings::KBackgroundSettings
 
     if (!config) {
         int screen_number = 0;
+#ifdef Q_WS_X11
         if (qt_xdisplay())
             screen_number = DefaultScreen(qt_xdisplay());
+#else
+	screen_number = QApplication::desktop()->primaryScreen();
+#endif
         QCString configname;
         if (screen_number == 0)
             configname = "kdesktoprc";
@@ -1071,9 +1075,11 @@ void KGlobalBackgroundSettings::readSett
     m_TextBackgroundColor = m_pConfig->readColorEntry("ItemTextBackground");
 
     m_Names.clear();
+#ifdef Q_WS_X11
     NETRootInfo info( qt_xdisplay(), NET::DesktopNames | NET::NumberOfDesktops );
     for ( int i = 0 ; i < info.numberOfDesktops() ; ++i )
       m_Names.append( QString::fromUtf8(info.desktopName(i+1)) );
+#endif
 
     dirty = false;
 }
Index: kcontrol/background/main.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/background/main.cpp,v
retrieving revision 1.7
diff -d -u -p -r1.7 main.cpp
--- kcontrol/background/main.cpp	24 Jan 2003 21:12:57 -0000	1.7
+++ kcontrol/background/main.cpp	5 Mar 2003 05:53:15 -0000
@@ -28,8 +28,10 @@
 
 #include "main.h"
 
+#ifdef Q_WS_X11
 /* as late as possible, as it includes some X headers without protecting them */
 #include <X11/Xlib.h>
+#endif
 
 /**** DLL Interface ****/
 typedef KGenericFactory<KBackground, QWidget> KBackGndFactory;
@@ -45,8 +47,12 @@ KBackground::KBackground(QWidget *parent
     : KCModule(KBackGndFactory::instance(), parent, name)
 {
     int screen_number = 0;
+#ifdef Q_WS_X11
     if (qt_xdisplay())
 	screen_number = DefaultScreen(qt_xdisplay());
+#else
+    screen_number = QApplication::desktop()->primaryScreen();
+#endif
     QCString configname;
     if (screen_number == 0)
 	configname = "kdesktoprc";
@@ -84,8 +90,12 @@ void KBackground::save()
 	client->attach();
 
     int screen_number = 0;
+#ifdef Q_WS_X11
     if (qt_xdisplay())
 	screen_number = DefaultScreen(qt_xdisplay());
+#else
+    screen_number = QApplication::desktop()->primaryScreen();
+#endif
     QCString appname;
     if (screen_number == 0)
 	appname = "kdesktop";
Index: kcontrol/bell/bell.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/bell/bell.cpp,v
retrieving revision 1.44
diff -d -u -p -r1.44 bell.cpp
--- kcontrol/bell/bell.cpp	3 Sep 2002 10:10:08 -0000	1.44
+++ kcontrol/bell/bell.cpp	5 Mar 2003 05:53:16 -0000
@@ -36,7 +36,9 @@
 #include "bell.h"
 #include "bell.moc"
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 #include <kaboutdata.h>
 
 extern "C"
@@ -48,20 +50,24 @@ extern "C"
 
   void init_bell()
   {
+#ifdef Q_WS_X11
     XKeyboardState kbd;
     XKeyboardControl kbdc;
 
     XGetKeyboardControl(kapp->getDisplay(), &kbd);
+#endif
 
     KConfig config("kcmbellrc", true, false);
     config.setGroup("General");
 
+#ifdef Q_WS_X11
     kbdc.bell_percent = config.readNumEntry("Volume", kbd.bell_percent);
     kbdc.bell_pitch = config.readNumEntry("Pitch", kbd.bell_pitch);
     kbdc.bell_duration = config.readNumEntry("Duration", kbd.bell_duration);
     XChangeKeyboardControl(kapp->getDisplay(),
                            KBBellPercent | KBBellPitch | KBBellDuration,
                            &kbdc);
+#endif
   }
 }
 
@@ -135,12 +141,18 @@ KBellConfig::KBellConfig(QWidget *parent
 
 void KBellConfig::load()
 {
+#ifdef Q_WS_X11
   XKeyboardState kbd;
   XGetKeyboardControl(kapp->getDisplay(), &kbd);
 
   m_volume->setValue(kbd.bell_percent);
   m_pitch->setValue(kbd.bell_pitch);
   m_duration->setValue(kbd.bell_duration);
+#else
+  m_volume->setValue(0);
+  m_pitch->setValue(0);
+  m_duration->setValue(0);
+#endif
 
   KConfig cfg("kdeglobals", false, false);
   cfg.setGroup("General");
@@ -150,18 +162,22 @@ void KBellConfig::load()
 
 void KBellConfig::save()
 {
+#ifdef Q_WS_X11
   XKeyboardControl kbd;
+#endif
 
   int bellVolume = m_volume->value();
   int bellPitch = m_pitch->value();
   int bellDuration = m_duration->value();
 
+#ifdef Q_WS_X11
   kbd.bell_percent = bellVolume;
   kbd.bell_pitch = bellPitch;
   kbd.bell_duration = bellDuration;
   XChangeKeyboardControl(kapp->getDisplay(),
                          KBBellPercent | KBBellPitch | KBBellDuration,
                          &kbd);
+#endif
 
   KConfig config("kcmbellrc", false, false);
   config.setGroup("General");
@@ -195,6 +211,7 @@ void KBellConfig::ringBell()
   }
 
   // store the old state
+#ifdef Q_WS_X11
   XKeyboardState old_state;
   XGetKeyboardControl(kapp->getDisplay(), &old_state);
 
@@ -219,6 +236,9 @@ void KBellConfig::ringBell()
   XChangeKeyboardControl(kapp->getDisplay(),
                          KBBellPercent | KBBellPitch | KBBellDuration,
                          &kbd);
+#else
+  QApplication::beep();
+#endif
 }
 
 void KBellConfig::defaults()
Index: kcontrol/colors/colorscm.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/colors/colorscm.cpp,v
retrieving revision 1.72
diff -d -u -p -r1.72 colorscm.cpp
--- kcontrol/colors/colorscm.cpp	13 Feb 2003 18:37:55 -0000	1.72
+++ kcontrol/colors/colorscm.cpp	5 Mar 2003 05:53:17 -0000
@@ -45,8 +45,10 @@
 
 #include <kio/netaccess.h>
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
+#endif
 
 #include "../krdb/krdb.h"
 
@@ -365,9 +367,11 @@ void KColorScheme::save()
         flags |= KRdbExportColors;
     else
     {
+#ifdef Q_WS_X11
         // Undo the property xrdb has placed on the root window (if any),
         // i.e. remove all entries, including ours
         XDeleteProperty( qt_xdisplay(), qt_xrootwin(), XA_RESOURCE_MANAGER );
+#endif
     }
     runRdb( flags );	// Save the palette to qtrc for KStyles
 
Index: kcontrol/energy/energy.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/energy/energy.cpp,v
retrieving revision 1.19
diff -d -u -p -r1.19 energy.cpp
--- kcontrol/energy/energy.cpp	25 Jan 2003 23:39:17 -0000	1.19
+++ kcontrol/energy/energy.cpp	5 Mar 2003 05:53:19 -0000
@@ -40,15 +40,15 @@
 #include <klocale.h>
 #include <kcmodule.h>
 
+#include "energy.h"
+
+#ifdef Q_WS_X11
 #include <X11/X.h>
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
 #include <X11/Xutil.h>
 #include <X11/Xos.h>
 
-#include "energy.h"
-
-
 #ifdef HAVE_DPMS
 #include <X11/Xmd.h>
 extern "C" {
@@ -67,6 +67,7 @@ extern "C" {
 }
 #endif
 #endif
+#endif
 
 
 static const int DFLT_STANDBY   = 0;
@@ -296,6 +297,7 @@ void KEnergy::showSettings()
 }
 
 
+#ifdef Q_WS_X11
 extern "C" {
   int dropError(Display *, XErrorEvent *);
   typedef int (*XErrFunc) (Display *, XErrorEvent *);
@@ -305,10 +307,12 @@ int dropError(Display *, XErrorEvent *)
 {
     return 0;
 }
+#endif
 
 /* static */
 void KEnergy::applySettings(bool enable, int standby, int suspend, int off)
 {
+#ifdef Q_WS_X11
 #ifdef HAVE_DPMS
     XErrFunc defaultHandler;
     defaultHandler = XSetErrorHandler(dropError);
@@ -332,6 +336,7 @@ void KEnergy::applySettings(bool enable,
     /* keep gcc silent */
     if (enable | standby | suspend | off)
     /* nothing */ ;
+#endif
 #endif
 }
 
Index: kcontrol/fonts/fonts.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/fonts/fonts.cpp,v
retrieving revision 1.72
diff -d -u -p -r1.72 fonts.cpp
--- kcontrol/fonts/fonts.cpp	29 Dec 2002 22:28:58 -0000	1.72
+++ kcontrol/fonts/fonts.cpp	5 Mar 2003 05:53:19 -0000
@@ -37,12 +37,14 @@
 #include <kdebug.h>
 #include <qpushbutton.h>
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
 
 // X11 headers
 #undef Bool
 #undef Unsorted
 #undef None
+#endif
 
 static const char *aa_rgb_xpm[]={
 "12 12 3 1",
@@ -237,8 +239,12 @@ void FontUseItem::updateLabel()
 static QCString desktopConfigName()
 {
   int desktop=0;
+#ifdef Q_WS_X11
   if (qt_xdisplay())
     desktop = DefaultScreen(qt_xdisplay());
+#else
+  desktop = QApplication::desktop()->primaryScreen();
+#endif
   QCString name;
   if (desktop == 0)
     name = "kdesktoprc";
Index: kcontrol/info/info.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/info/info.cpp,v
retrieving revision 1.59
diff -d -u -p -r1.59 info.cpp
--- kcontrol/info/info.cpp	8 Jan 2003 00:25:28 -0000	1.59
+++ kcontrol/info/info.cpp	5 Mar 2003 05:53:20 -0000
@@ -38,7 +38,9 @@
 #include <klocale.h>
 #include "info.h"		/* include the forward declares... */
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 
 /* All Functions GetInfo_xyz() can set GetInfo_ErrorString, when a special
    error-message should be shown to the user....
@@ -50,8 +52,6 @@ static QString *GetInfo_ErrorString;	/* 
 					    KInfoListWidget::ErrorString */
 static bool	sorting_allowed;	/* is sorting allowed by user ? */
 
-
-
 #if defined(__linux__)
 # define DEFAULT_ERRORSTRING QString("") /* i18n("Maybe the proc-filesystem is not enabled in Linux-Kernel.") */
 #elif defined(hpux)
@@ -60,10 +60,7 @@ static bool	sorting_allowed;	/* is sorti
 #define DEFAULT_ERRORSTRING  i18n("Maybe this system is not completely supported yet :-(")
 #endif
 
-
-
-
-
+#ifdef Q_WS_X11
 /* easier to read with such a define ! */
 #define I18N_MAX(txt,in,fm,maxw) \
     { int n = fm.width(txt=in); if (n>maxw) maxw=n; }
@@ -119,7 +116,6 @@ static struct _event_table {
     { "OwnerGrabButtonMask",	OwnerGrabButtonMask },
     { 0L, 0 }};
 
-
 static QListViewItem* XServer_fill_screen_info( QListViewItem *lBox, QListViewItem *last,
 	    Display *dpy, int scr, int default_scr)
 {
@@ -128,7 +124,9 @@ static QListViewItem* XServer_fill_scree
     int 	i,
 		ndepths,
 		*depths;
+#ifdef Q_WS_X11
     Screen 	*s = ScreenOfDisplay(dpy,scr);  /* opaque structure */
+#endif
     QListViewItem *item;
 
     /*
@@ -210,6 +208,7 @@ static QListViewItem* XServer_fill_scree
     last = new QListViewItem(item, last, i18n("Current Input Event Mask"),
 		HexStr((unsigned long)EventMaskOfScreen(s),HEXDIGITS));
     item = last;
+#ifdef Q_WS_X11
     struct _event_table *etp;
     for (etp=event_table; etp->name; etp++) {
 	if (EventMaskOfScreen(s) & etp->value)
@@ -217,6 +216,7 @@ static QListViewItem* XServer_fill_scree
 		i18n("Event = %1").arg(HexStr(etp->value,HEXDIGITS)),
 		etp->name );
     }
+#endif
 
     return item;
 }
@@ -242,6 +242,7 @@ static QString ByteString( unsigned long
     return i18n("%1 Bytes")  // plural form: "%1 Bytes"
 		.arg(KGlobal::locale()->formatNumber(n,0));
 }
+#endif
 
 static bool GetInfo_XServer_Generic( QListView *lBox )
 {
@@ -250,16 +251,16 @@ static bool GetInfo_XServer_Generic( QLi
     int i,n;
     long req_size;
 
-    Display *dpy;
+#ifdef Q_WS_X11
+    Display *dpy = XOpenDisplay(0);
+    if (!dpy)
+        return false;
     XPixmapFormatValues *pmf;
+#endif
 
     QString str,txt;
     QListViewItem *last, *item, *next;
 
-    dpy = XOpenDisplay(0);
-    if (!dpy)
-        return false;
-
     lBox->addColumn(i18n("Information") );
     lBox->addColumn(i18n("Value") );
     sorting_allowed = false;
@@ -270,6 +271,7 @@ static bool GetInfo_XServer_Generic( QLi
     next->setSelectable(false);
     next->setExpandable(false);
 
+#ifdef Q_WS_X11
     last = new QListViewItem(next, i18n("Name of the Display"),
 		DisplayString(dpy));
 
@@ -334,6 +336,9 @@ static bool GetInfo_XServer_Generic( QLi
 		Order(ImageByteOrder(dpy)));
 
     XCloseDisplay (dpy);
+#else
+    //Need to impelement on QWS & MAC
+#endif
     return true;
 }
 
Index: kcontrol/input/main.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/input/main.cpp,v
retrieving revision 1.22
diff -d -u -p -r1.22 main.cpp
--- kcontrol/input/main.cpp	28 Jun 2002 11:50:49 -0000	1.22
+++ kcontrol/input/main.cpp	5 Mar 2003 05:53:21 -0000
@@ -27,7 +27,9 @@
 #include <kconfig.h>
 
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 
 
 #include "mouse.h"
Index: kcontrol/input/mouse.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/input/mouse.cpp,v
retrieving revision 1.78
diff -d -u -p -r1.78 mouse.cpp
--- kcontrol/input/mouse.cpp	23 Jan 2003 07:18:29 -0000	1.78
+++ kcontrol/input/mouse.cpp	5 Mar 2003 05:53:22 -0000
@@ -68,12 +68,14 @@
 
 #include "mouse.h"
 
+#ifdef Q_WS_X11
 #include <X11/X.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <kipc.h>
 
 #undef Below
+#endif
 
 MouseConfig::MouseConfig (QWidget * parent, const char *name)
   : KCModule(parent, name)
@@ -573,12 +575,17 @@ void MouseConfig::slotHandedChanged(int 
 void MouseSettings::load(KConfig *config)
 {
   int accel_num, accel_den, threshold;
+#ifdef Q_WS_X11
   XGetPointerControl( kapp->getDisplay(),
               &accel_num, &accel_den, &threshold );
+#else
+  accel_num = accel_den = threshold = 0;
+#endif
   accel_num /= accel_den;   // integer acceleration only
 
   // get settings from X server
   int h = RIGHT_HANDED;
+#ifdef Q_WS_X11
   unsigned char map[5];
   num_buttons = XGetPointerMapping(kapp->getDisplay(), map, 5);
 
@@ -618,6 +625,7 @@ void MouseSettings::load(KConfig *config
       handedEnabled = false;
       break;
     }
+#endif
 
   config->setGroup("Mouse");
   int a = config->readNumEntry("Acceleration",-1);
@@ -658,6 +666,7 @@ void MouseSettings::load(KConfig *config
 
 void MouseSettings::apply()
 {
+#ifdef Q_WS_X11
   XChangePointerControl( kapp->getDisplay(),
                          true, true, accelRate, 1, thresholdMove);
 
@@ -725,6 +734,7 @@ void MouseSettings::apply()
           { };
       m_handedNeedsApply = false;
   }
+#endif
 
   // Make sure we have the 'font' resource dir registered and can find the
   // override dir.
@@ -785,7 +795,9 @@ void MouseSettings::save(KConfig *config
   config->writeEntry("LargeCursor", largeCursor );
   config->writeEntry("WhiteCursor", whiteCursor );
   config->sync();
+#ifdef Q_WS_X11
   KIPC::sendMessageAll(KIPC::SettingsChanged, KApplication::SETTINGS_MOUSE);
+#endif
 }
 
 #include "mouse.moc"
Index: kcontrol/kcontrol/Makefile.am
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kcontrol/Makefile.am,v
retrieving revision 1.64
diff -d -u -p -r1.64 Makefile.am
--- kcontrol/kcontrol/Makefile.am	10 Jan 2003 22:36:44 -0000	1.64
+++ kcontrol/kcontrol/Makefile.am	5 Mar 2003 05:53:22 -0000
@@ -33,16 +33,15 @@ kcontrol_la_SOURCES = main.cpp toplevel.
 	quickhelp.cpp moduletreeview.cpp moduleiconview.cpp \
 	kcrootonly.cpp moduleIface.cpp moduleIface.skel
 
-kcontrol_la_LIBADD  = $(LIB_KDEUI) $(LIB_KSYCOCA) -lkutils 
+kcontrol_la_LIBADD  = $(LIB_KDEUI) $(LIB_KSYCOCA) $(LIB_KDECORE) $(LIB_QT) -lkutils -lDCOP -lkdefx
 kcontrol_la_LDFLAGS = $(all_libraries) -module -avoid-version
 kcmshell_la_SOURCES = kcmshell.cpp proxywidget.cpp \
 	                  kcdialog.cpp global.cpp kcdialog.skel
-kcmshell_la_LIBADD = $(LIB_KDEUI) $(LIB_KSYCOCA) -lkutils 
+kcmshell_la_LIBADD = $(LIB_KDEUI) $(LIB_KSYCOCA) -lkutils $(LIB_KDECORE) $(LIB_QT) -lDCOP
 kcmshell_la_LDFLAGS = $(all_libraries) -module -avoid-version
 
-
 kcminit_la_SOURCES = kcminit.cpp global.cpp
-kcminit_la_LIBADD   = $(LIB_KDEUI) $(LIB_KSYCOCA) -lkutils
+kcminit_la_LIBADD   = $(LIB_KDEUI) $(LIB_KSYCOCA) $(LIB_KDECORE) $(LIB_QT) -lkutils -lDCOP
 kcminit_la_LDFLAGS = $(all_libraries) -module -avoid-version
 
 kcontrol_SOURCES = dummy.cpp
Index: kcontrol/kcontrol/kcdialog.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kcontrol/kcdialog.cpp,v
retrieving revision 1.18
diff -d -u -p -r1.18 kcdialog.cpp
--- kcontrol/kcontrol/kcdialog.cpp	9 Jan 2003 01:54:22 -0000	1.18
+++ kcontrol/kcontrol/kcdialog.cpp	5 Mar 2003 05:53:23 -0000
@@ -86,6 +86,8 @@ void KCDialog::slotHelp()
 
 void KCDialog::activate()
 {
+#ifdef Q_WS_X11
     KWin::setOnDesktop(winId(), KWin::currentDesktop());
     KWin::setActiveWindow(winId());
+#endif
 }
Index: kcontrol/kcontrol/kcmshell.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kcontrol/kcmshell.cpp,v
retrieving revision 1.62
diff -d -u -p -r1.62 kcmshell.cpp
--- kcontrol/kcontrol/kcmshell.cpp	21 Feb 2003 07:21:18 -0000	1.62
+++ kcontrol/kcontrol/kcmshell.cpp	5 Mar 2003 05:53:23 -0000
@@ -243,8 +243,9 @@ int main(int _argc, char *_argv[])
                 // Needed for modules that use d'n'd (not really the right
                 // solution for this though, I guess)
                 dlg->setAcceptDrops(true);
-
+#ifdef Q_WS_X11
                 QXEmbed::embedClientIntoWindow(dlg, id);
+#endif
                 kapp->exec();
                 delete dlg;
              }
@@ -289,8 +290,10 @@ int main(int _argc, char *_argv[])
         int id = embed.toInt(&ok);
         if (ok)
         {
+#ifdef Q_WS_X11
             // NOTE: This has to be changed for QT 3.0. See above!
             QXEmbed::embedClientIntoWindow(dlg, id);
+#endif
             delete dlg;
           return 0;
         }
Index: kcontrol/kcontrol/modules.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kcontrol/modules.cpp,v
retrieving revision 1.46
diff -d -u -p -r1.46 modules.cpp
--- kcontrol/kcontrol/modules.cpp	10 Jan 2003 22:36:44 -0000	1.46
+++ kcontrol/kcontrol/modules.cpp	5 Mar 2003 05:53:23 -0000
@@ -40,14 +40,19 @@
 #include <kcmoduleloader.h>
 #include "kcrootonly.h"
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 
 
 template class QPtrList<ConfigModule>;
 
 
 ConfigModule::ConfigModule(const QString& desktopFile, const QString& baseGroup)
-  : KCModuleInfo(desktopFile, baseGroup), _changed(false), _module(0), _embedWidget(0),
+  : KCModuleInfo(desktopFile, baseGroup), _changed(false), _module(0), 
+#ifdef Q_WS_X11
+    _embedWidget(0),
+#endif
     _rootProcess(0), _embedLayout(0), _embedFrame(0)
 {
 }
@@ -88,14 +93,15 @@ ProxyWidget *ConfigModule::module()
 
 void ConfigModule::deleteClient()
 {
-  if (_embedWidget)
-    XKillClient(qt_xdisplay(), _embedWidget->embeddedWinId());
-
   delete _rootProcess;
   _rootProcess = 0;
 
+#ifdef Q_WS_X11
+  if (_embedWidget)
+    XKillClient(qt_xdisplay(), _embedWidget->embeddedWinId());
   delete _embedWidget;
   _embedWidget = 0;
+#endif
   delete _embedFrame;
   _embedFrame = 0;
   kapp->syncX();
@@ -132,7 +138,9 @@ void ConfigModule::runAsRoot()
     return;
 
   delete _rootProcess;
+#ifdef Q_WS_X11
   delete _embedWidget;
+#endif
   delete _embedLayout;
 
   // create an embed widget that will embed the
@@ -147,14 +155,18 @@ void ConfigModule::runAsRoot()
   _embedFrame->setLineWidth( 2 );
   _embedFrame->setMidLineWidth( 2 );
   _embedLayout->addWidget(_embedFrame,1);
+#ifdef Q_WS_X11
   _embedWidget = new QXEmbed(_embedFrame );
+#endif
   _module->hide();
   _embedFrame->show();
+#ifdef Q_WS_X11
   QLabel *_busy = new QLabel(i18n("<big>Loading...</big>"), _embedWidget);
   _busy->setAlignment(AlignCenter);
   _busy->setTextFormat(RichText);
   _busy->setGeometry(0,0, _module->width(), _module->height());
   _busy->show();
+#endif
 
   // prepare the process to run the kcmshell
   QString cmd = service()->exec().stripWhiteSpace();
@@ -179,12 +191,16 @@ void ConfigModule::runAsRoot()
       // returns before the module is running and that doesn't work.
       // We also don't have a way to close the module in that case.
       *_rootProcess << "--n"; // Don't keep password.
+#ifdef Q_WS_X11
       if (kdeshell) {
          *_rootProcess << QString("kcmshell %1 --embed %2 --lang %3").arg(cmd).arg(_embedWidget->winId()).arg(KGlobal::locale()->language());
       }
       else {
          *_rootProcess << QString("%1 --embed %2 --lang %3").arg(cmd).arg(_embedWidget->winId()).arg( KGlobal::locale()->language() );
       }
+#else
+      //FIXME: need to implement for MAC and QWS
+#endif
 
       connect(_rootProcess, SIGNAL(processExited(KProcess*)), this, SLOT(rootExited(KProcess*)));
 
@@ -195,7 +211,9 @@ void ConfigModule::runAsRoot()
 
   // clean up in case of failure
   delete _embedFrame;
+#ifdef Q_WS_X11
   _embedWidget = 0;
+#endif
   delete _embedLayout;
   _embedLayout = 0;
   _module->show();
@@ -204,11 +222,13 @@ void ConfigModule::runAsRoot()
 
 void ConfigModule::rootExited(KProcess *)
 {
+#ifdef Q_WS_X11
   if (_embedWidget->embeddedWinId())
     XDestroyWindow(qt_xdisplay(), _embedWidget->embeddedWinId());
 
   delete _embedWidget;
   _embedWidget = 0;
+#endif
 
   delete _rootProcess;
   _rootProcess = 0;
Index: kcontrol/kcontrol/modules.h
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kcontrol/modules.h,v
retrieving revision 1.18
diff -d -u -p -r1.18 modules.h
--- kcontrol/kcontrol/modules.h	11 Jan 2003 13:18:51 -0000	1.18
+++ kcontrol/kcontrol/modules.h	5 Mar 2003 05:53:23 -0000
@@ -74,7 +74,9 @@ private:
   
   bool         _changed;
   ProxyWidget *_module;
+#ifdef Q_WS_X11
   QXEmbed     *_embedWidget;
+#endif
   KProcess    *_rootProcess;
   QVBoxLayout *_embedLayout;
   QVBox       *_embedFrame;
Index: kcontrol/kdm/background.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kdm/background.cpp,v
retrieving revision 1.7
diff -d -u -p -r1.7 background.cpp
--- kcontrol/kdm/background.cpp	24 Jan 2003 21:31:52 -0000	1.7
+++ kcontrol/kdm/background.cpp	5 Mar 2003 05:53:24 -0000
@@ -40,6 +40,10 @@
 #include <ksimpleconfig.h>
 #include <kdialog.h>
 
+#ifndef KDE_CONFDIR
+#define KDE_CONFDIR ""
+#endif
+
 extern KSimpleConfig *config;
 
 KBackground::KBackground(QWidget *parent, const char *name)
Index: kcontrol/kdm/main.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kdm/main.cpp,v
retrieving revision 1.59
diff -d -u -p -r1.59 main.cpp
--- kcontrol/kdm/main.cpp	24 Jan 2003 21:31:52 -0000	1.59
+++ kcontrol/kdm/main.cpp	5 Mar 2003 05:53:24 -0000
@@ -49,6 +49,10 @@
 typedef KGenericFactory<KDModule, QWidget> KDMFactory;
 K_EXPORT_COMPONENT_FACTORY( kcm_kdm, KDMFactory("kdmconfig") );
 
+#ifndef KDE_CONFDIR
+#define KDE_CONFDIR ""
+#endif
+
 KURL *decodeImgDrop(QDropEvent *e, QWidget *wdg)
 {
     QStringList uris;
Index: kcontrol/keys/modifiers.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/keys/modifiers.cpp,v
retrieving revision 1.12
diff -d -u -p -r1.12 modifiers.cpp
--- kcontrol/keys/modifiers.cpp	3 Sep 2002 00:30:07 -0000	1.12
+++ kcontrol/keys/modifiers.cpp	5 Mar 2003 05:53:25 -0000
@@ -19,6 +19,7 @@
 #include <klocale.h>
 #include <kmessagebox.h>
 
+#ifdef Q_WS_X11
 #define XK_MISCELLANY
 #define XK_XKB_KEYS
 #include <X11/X.h>
@@ -50,6 +51,7 @@ Extra1		[]		[] User definable
 	Mod4	Super_L, Super_R
 	Mod5	Scroll_Lock
 */
+#endif
 
 //For Mac keyboards:
 //1) labels: Shift | Ctrl | Option | Command
@@ -141,14 +143,17 @@ void ModifiersModule::defaults()
 	updateWidgetData();
 }
 
+#ifdef Q_WS_X11
 #define SET_CODE_SYM( iCode, sym ) \
 	if( iCode >= keyCodeMin && iCode <= keyCodeMax ) \
 		rgKeySyms[(iCode-keyCodeMin) * nSymsPerCode] = sym;
 #define SET_MOD_CODE( iMod, code1, code2 ) \
 	xmk->modifiermap[iMod * xmk->max_keypermod + 0] = code1; \
 	xmk->modifiermap[iMod * xmk->max_keypermod + 1] = code2;
+#endif
 void ModifiersModule::setupMacModifierKeys()
 {
+#ifdef QWS_X11
 	const int CODE_Ctrl_L = 0x25, CODE_Ctrl_R = 0x6d;
 	const int CODE_Win_L  = 0x73, CODE_Win_R  = 0x74;
 	//const int CODE_Alt_L  = 0x40, CODE_Alt_R  = 0x71;
@@ -178,6 +183,7 @@ void ModifiersModule::setupMacModifierKe
 	XChangeKeyboardMapping( qt_xdisplay(), keyCodeMin, nSymsPerCode, rgKeySyms, nKeyCodes );
 	XFree( rgKeySyms );
 	XFreeModifiermap( xmk );
+#endif
 }
 #undef SET_CODE_SYM
 
@@ -306,6 +312,7 @@ void ModifiersModule::updateWidgets()
 		m_pchkMacSwap->setEnabled( false );
 	}
 
+#ifdef Q_WS_X11
 	XModifierKeymap* xmk = XGetModifierMapping( qt_xdisplay() );
 
 	for( int iKey = m_plstXMods->columns()-1; iKey < xmk->max_keypermod; iKey++ )
@@ -342,6 +349,7 @@ void ModifiersModule::updateWidgets()
 	if( i != 0 )
 		m_plblWinModX->setText( "mod" + QString::number(i) );
 	else
+#endif
 		m_plblWinModX->setText( "<" + i18n("None") + ">" );
 }
 
Index: kcontrol/kicker/lookandfeeltab_kcm.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kicker/lookandfeeltab_kcm.cpp,v
retrieving revision 1.3
diff -d -u -p -r1.3 lookandfeeltab_kcm.cpp
--- kcontrol/kicker/lookandfeeltab_kcm.cpp	18 Feb 2003 22:48:16 -0000	1.3
+++ kcontrol/kicker/lookandfeeltab_kcm.cpp	5 Mar 2003 05:53:25 -0000
@@ -24,7 +24,9 @@
 #include "lookandfeeltab_kcm.moc"
 #include "lookandfeeltab_impl.h"
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 #include <kaboutdata.h>
 
 LookAndFeelConfig::LookAndFeelConfig(QWidget *parent, const char *name)
Index: kcontrol/kicker/main.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kicker/main.cpp,v
retrieving revision 1.40
diff -d -u -p -r1.40 main.cpp
--- kcontrol/kicker/main.cpp	21 Feb 2003 11:13:22 -0000	1.40
+++ kcontrol/kicker/main.cpp	5 Mar 2003 05:53:26 -0000
@@ -35,7 +35,9 @@
 
 #include "lookandfeeltab_kcm.h"
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 #include <kaboutdata.h>
 
 // for multihead
@@ -97,8 +99,12 @@ KickerConfig::KickerConfig(QWidget *pare
 
 void KickerConfig::initScreenNumber()
 {
+#ifdef Q_WS_X11
     if (qt_xdisplay())
         kickerconfig_screen_number = DefaultScreen(qt_xdisplay());
+#else
+    kickerconfig_screen_number = QApplication::desktop()->primaryScreen();
+#endif
 }
 
 void KickerConfig::configChanged()
Index: kcontrol/kicker/positiontab_impl.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/kicker/positiontab_impl.cpp,v
retrieving revision 1.24
diff -d -u -p -r1.24 positiontab_impl.cpp
--- kcontrol/kicker/positiontab_impl.cpp	18 Feb 2003 22:48:16 -0000	1.24
+++ kcontrol/kicker/positiontab_impl.cpp	5 Mar 2003 05:53:27 -0000
@@ -616,8 +616,10 @@ void PositionTab::showIdentify()
 
         QLabel *screenLabel = new QLabel(0,"Screen Identify", WStyle_StaysOnTop | WDestructiveClose | WStyle_Customize | WStyle_NoBorder);
 
+#ifdef Q_WS_X11
         KWin::setState( screenLabel->winId(), NET::Modal | NET::Sticky | NET::StaysOnTop | NET::SkipTaskbar | NET::SkipPager );
         KWin::setType( screenLabel->winId(), NET::Override );
+#endif
 
         QFont identifyFont(KGlobalSettings::generalFont());
         identifyFont.setPixelSize(100);
Index: kcontrol/konq/desktop.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/konq/desktop.cpp,v
retrieving revision 1.19
diff -d -u -p -r1.19 desktop.cpp
--- kcontrol/konq/desktop.cpp	9 Feb 2003 09:50:10 -0000	1.19
+++ kcontrol/konq/desktop.cpp	5 Mar 2003 05:53:28 -0000
@@ -117,23 +117,25 @@ KDesktopConfig::KDesktopConfig(QWidget *
 
 void KDesktopConfig::load()
 {
+#ifdef Q_WS_X11
   // get number of desktops
   NETRootInfo info( qt_xdisplay(), NET::NumberOfDesktops | NET::DesktopNames );
   int n = info.numberOfDesktops();
-
-  _numInput->setValue(n);
-
   for(int i = 1; i <= 16; i++)
   {
     QString name = QString::fromUtf8(info.desktopName(i));
     _nameInput[i-1]->setText(name);
   }
+#else
+  int n = QApplication::desktop()->numScreens();
+#endif
+
+  _numInput->setValue(n);
 
   for(int i = 1; i <= 16; i++)
     _nameInput[i-1]->setEnabled(i <= n);
   emit changed(false);
 
-
   KConfig *config = new KConfig("kdesktoprc", true);
   config->setGroup("Mouse Buttons");
   _wheelOption->setChecked(config->readBoolEntry("WheelSwitchesWorkspace",false));
@@ -142,6 +144,7 @@ void KDesktopConfig::load()
 
 void KDesktopConfig::save()
 {
+#ifdef Q_WS_X11
   NETRootInfo info( qt_xdisplay(), NET::NumberOfDesktops | NET::DesktopNames );
   // set desktop names
   for(int i = 1; i <= 16; i++)
@@ -154,6 +157,7 @@ void KDesktopConfig::save()
   info.activate();
 
   XSync(qt_xdisplay(), FALSE);
+#endif
 
   KConfig *config = new KConfig("kdesktoprc");
   config->setGroup("Mouse Buttons");
@@ -166,8 +170,12 @@ void KDesktopConfig::save()
   QByteArray data;
 
   int konq_screen_number = 0;
+#ifdef Q_WS_X11
   if (qt_xdisplay())
      konq_screen_number = DefaultScreen(qt_xdisplay());
+#else
+  konq_screen_number = QApplication::desktop()->primaryScreen();
+#endif
 
   QCString appname;
   if (konq_screen_number == 0)
Index: kcontrol/konqhtml/appearance.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/konqhtml/appearance.cpp,v
retrieving revision 1.38
diff -d -u -p -r1.38 appearance.cpp
--- kcontrol/konqhtml/appearance.cpp	11 Jan 2003 05:37:59 -0000	1.38
+++ kcontrol/konqhtml/appearance.cpp	5 Mar 2003 05:53:28 -0000
@@ -7,7 +7,9 @@
 #include <qlabel.h>
 #include <kcharsets.h>
 #include <kdebug.h>
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 #include <kfontcombo.h>
 #include <knuminput.h>
 
Index: kcontrol/konqhtml/jsopts.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/konqhtml/jsopts.cpp,v
retrieving revision 1.42
diff -d -u -p -r1.42 jsopts.cpp
--- kcontrol/konqhtml/jsopts.cpp	21 Feb 2003 11:13:22 -0000	1.42
+++ kcontrol/konqhtml/jsopts.cpp	5 Mar 2003 05:53:29 -0000
@@ -18,7 +18,9 @@
 #include <klistview.h>
 #include <kdebug.h>
 #include <kurlrequester.h>
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 
 #include "htmlopts.h"
 #include "policydlg.h"
Index: kcontrol/konqhtml/pluginopts.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/konqhtml/pluginopts.cpp,v
retrieving revision 1.21
diff -d -u -p -r1.21 pluginopts.cpp
--- kcontrol/konqhtml/pluginopts.cpp	21 Feb 2003 11:13:22 -0000	1.21
+++ kcontrol/konqhtml/pluginopts.cpp	5 Mar 2003 05:53:29 -0000
@@ -17,7 +17,9 @@
 #include <qwhatsthis.h>
 #include <qvgroupbox.h>
 #include <kdebug.h>
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 
 #include <kapplication.h>
 #include <dcopclient.h>
Index: kcontrol/krdb/krdb.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/krdb/krdb.cpp,v
retrieving revision 1.47
diff -d -u -p -r1.47 krdb.cpp
--- kcontrol/krdb/krdb.cpp	14 Feb 2003 18:34:20 -0000	1.47
+++ kcontrol/krdb/krdb.cpp	5 Mar 2003 05:53:30 -0000
@@ -40,7 +40,9 @@
 
 #include "krdb.h"
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 
 
 // -----------------------------------------------------------------------------
@@ -472,6 +474,7 @@ void runRdb( uint flags )
     // Cheat and use the current timestamp, since we just saved to qtrc.
     QDateTime settingsstamp = QDateTime::currentDateTime();
 
+#ifdef Q_WS_X11
     static Atom qt_settings_timestamp = 0;
     if (!qt_settings_timestamp) {
 	 QString atomname("_QT_SETTINGS_TIMESTAMP_");
@@ -487,6 +490,7 @@ void runRdb( uint flags )
 		     (unsigned char*) stamp.buffer().data(),
 		     stamp.buffer().size() );
     QApplication::flushX();
+#endif
   }
 }
 
Index: kcontrol/screensaver/scrnsave.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/screensaver/scrnsave.cpp,v
retrieving revision 1.61
diff -d -u -p -r1.61 scrnsave.cpp
--- kcontrol/screensaver/scrnsave.cpp	17 Feb 2003 05:00:59 -0000	1.61
+++ kcontrol/screensaver/scrnsave.cpp	5 Mar 2003 05:53:33 -0000
@@ -50,7 +50,9 @@
 #include <kgenericfactory.h>
 #include <kwin.h>
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 
 #include "scrnsave.h"
 
@@ -61,12 +63,34 @@
 
 template class QPtrList<SaverConfig>;
 
+#ifdef Q_WS_X11
 const uint widgetEventMask =                 // X event mask
 (uint)(
        ExposureMask |
        PropertyChangeMask |
        StructureNotifyMask
       );
+#endif
+
+#ifdef Q_WS_X11
+//===========================================================================
+class TestWin : public QXEmbed
+{
+public:
+    TestWin();
+};
+
+//===========================================================================
+class KSSMonitor : public QXEmbed
+{
+public:
+    KSSMonitor( QWidget *parent ) : QXEmbed( parent ) {}
+
+    // we don't want no steenking palette change
+    virtual void setPalette( const QPalette & ) {}
+};
+#endif
+
 
 //===========================================================================
 // DLL Interface for kcontrol
@@ -126,6 +150,7 @@ int SaverList::compareItems(QPtrCollecti
     return s1->name().localeAwareCompare(s2->name());
 }
 
+#ifdef Q_WS_X11
 //===========================================================================
 //
 TestWin::TestWin()
@@ -134,6 +159,7 @@ TestWin::TestWin()
     setFocusPolicy(StrongFocus);
     KWin::setState( winId(), NET::StaysOnTop );
 }
+#endif
 
 //===========================================================================
 //
@@ -143,10 +169,14 @@ KScreenSaver::KScreenSaver(QWidget *pare
 {
     mSetupProc = 0;
     mPreviewProc = 0;
+#ifdef Q_WS_X11
     mTestWin = 0;
+#endif
     mTestProc = 0;
     mPrevSelected = -2;
+#ifdef Q_WS_X11
     mMonitor = 0;
+#endif
     mTesting = false;
 
     // Add non-KDE path
@@ -335,12 +365,13 @@ KScreenSaver::KScreenSaver(QWidget *pare
 //
 void KScreenSaver::resizeEvent( QResizeEvent * )
 {
-
+#ifdef Q_WS_X11
   if (mMonitor)
     {
       mMonitor->setGeometry( (mMonitorLabel->width()-200)/2+23,
                  (mMonitorLabel->height()-186)/2+14, 151, 115 );
     }
+#endif
 }
 
 //---------------------------------------------------------------------------
@@ -383,7 +414,9 @@ KScreenSaver::~KScreenSaver()
 
     delete mTestProc;
     delete mSetupProc;
+#ifdef Q_WS_X11
     delete mTestWin;
+#endif
 }
 
 //---------------------------------------------------------------------------
@@ -623,6 +656,7 @@ void KScreenSaver::slotPreviewExited(KPr
     if ( mSaverList.isEmpty() ) // safety check
         return;
 
+#ifdef Q_WS_X11
     // Some xscreensaver hacks do something nasty to the window that
     // requires a new one to be created (or proper investigation of the
     // problem).
@@ -635,6 +669,7 @@ void KScreenSaver::slotPreviewExited(KPr
     mMonitor->show();
     // So that hacks can XSelectInput ButtonPressMask
     XSelectInput(qt_xdisplay(), mMonitor->winId(), widgetEventMask );
+#endif
 
     if (mSelected >= 0) {
         mPreviewProc->clearArguments();
@@ -655,7 +690,11 @@ void KScreenSaver::slotPreviewExited(KPr
                 ts >> word;
                 if (word == "%w")
                 {
+#ifdef Q_WS_X11
                     word = word.setNum(mMonitor->winId());
+#else
+		    word = word.setNum(1);
+#endif
                 }
                 (*mPreviewProc) << word;
             }
@@ -794,6 +833,7 @@ void KScreenSaver::slotTest()
     {
         (*mTestProc) << path;
 
+#ifdef Q_WS_X11
         if (!mTestWin)
         {
             mTestWin = new TestWin();
@@ -807,6 +847,7 @@ void KScreenSaver::slotTest()
         mTestWin->setFocus();
 	// So that hacks can XSelectInput ButtonPressMask
 	XSelectInput(qt_xdisplay(), mTestWin->winId(), widgetEventMask );
+#endif
 
 	grabMouse();
 	grabKeyboard();
@@ -819,7 +860,11 @@ void KScreenSaver::slotTest()
             ts >> word;
             if (word == "%w")
             {
+#ifdef Q_WS_X11
                 word = word.setNum(mTestWin->winId());
+#else
+                word = word.setNum(1);
+#endif
             }
             (*mTestProc) << word;
         }
@@ -838,7 +883,9 @@ void KScreenSaver::slotStopTest()
     }
     releaseMouse();
     releaseKeyboard();
+#ifdef Q_WS_X11
     mTestWin->hide();
+#endif
     mTestBt->setEnabled(true);
     mPrevSelected = -1;
     setMonitor();
Index: kcontrol/screensaver/scrnsave.h
===================================================================
RCS file: /home/kde/kdebase/kcontrol/screensaver/scrnsave.h,v
retrieving revision 1.16
diff -d -u -p -r1.16 scrnsave.h
--- kcontrol/screensaver/scrnsave.h	17 Feb 2003 05:00:59 -0000	1.16
+++ kcontrol/screensaver/scrnsave.h	5 Mar 2003 05:53:33 -0000
@@ -22,17 +22,8 @@ class QListViewItem;
 class QPushButton;
 class KIntNumInput;
 class KProcess;
-
-//===========================================================================
-class KSSMonitor : public QXEmbed
-{
-    Q_OBJECT
-public:
-    KSSMonitor( QWidget *parent ) : QXEmbed( parent ) {}
-
-    // we don't want no steenking palette change
-    virtual void setPalette( const QPalette & ) {}
-};
+class KSSMonitor;
+class TestWin;
 
 //===========================================================================
 class SaverConfig
@@ -65,13 +56,6 @@ protected:
     virtual int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2);
 };
 
-//===========================================================================
-class TestWin : public QXEmbed
-{
-    Q_OBJECT
-public:
-    TestWin();
-};
 
 //===========================================================================
 class KScreenSaver : public KCModule
@@ -118,11 +102,15 @@ protected:
     void keyPressEvent(QKeyEvent *);
 
 protected:
+#ifdef Q_WS_X11
     TestWin     *mTestWin;
+#endif
     KProcess    *mTestProc;
     KProcess    *mSetupProc;
     KProcess    *mPreviewProc;
+#ifdef Q_WS_X11
     KSSMonitor  *mMonitor;
+#endif
     QPushButton *mSetupBt;
     QPushButton *mTestBt;
     QListView   *mSaverListView;
Index: kcontrol/style/kcmstyle.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/style/kcmstyle.cpp,v
retrieving revision 1.51
diff -d -u -p -r1.51 kcmstyle.cpp
--- kcontrol/style/kcmstyle.cpp	18 Feb 2003 22:14:45 -0000	1.51
+++ kcontrol/style/kcmstyle.cpp	5 Mar 2003 05:53:35 -0000
@@ -57,12 +57,13 @@
 
 #include "kcmstyle.h"
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
 // X11 namespace cleanup
 #undef Below
 #undef KeyPress
 #undef KeyRelease
-
+#endif
 
 /**** DLL Interface for kcontrol ****/
 
@@ -101,9 +102,14 @@ extern "C"
 
         // This key has no GUI apparently
         bool isActive = !config.readBoolEntry( "disableMultihead", false) &&
+#ifdef Q_WS_X11
                         (ScreenCount(qt_xdisplay()) > 1);
+#else
+           	        QApplication::desktop()->numScreens() > 1;
+#endif
         applyMultiHead( isActive );
 
+#ifdef Q_WS_X11
         // Write some Qt root property.
 #ifndef __osf__      // this crashes under Tru64 randomly -- will fix later
         QByteArray properties;
@@ -118,6 +124,7 @@ extern "C"
             XChangeProperty(qt_xdisplay(),  RootWindow(qt_xdisplay(), i),
                             a, a, 8, PropModeReplace,
                             (unsigned char*) properties.data(), properties.size());
+#endif
 #endif
     }
 }
Index: kcontrol/thememgr/newthemedlg.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/thememgr/newthemedlg.cpp,v
retrieving revision 1.11
diff -d -u -p -r1.11 newthemedlg.cpp
--- kcontrol/thememgr/newthemedlg.cpp	9 Feb 2003 00:09:46 -0000	1.11
+++ kcontrol/thememgr/newthemedlg.cpp	5 Mar 2003 05:53:35 -0000
@@ -118,7 +118,11 @@ QLineEdit* NewThemeDlg::newLine(const QS
 
 void NewThemeDlg::slotSnapshot()
 {
+#ifdef Q_WS_X11
   int desktop = KWin::currentDesktop();
+#else
+  int desktop = 0;
+#endif
   SnapshotDlg *dlg = new SnapshotDlg(this);
   int result = dlg->exec();
   delete dlg;
@@ -131,12 +135,18 @@ void NewThemeDlg::slotSnapshot()
   kapp->processEvents();
 #endif  
 
+#ifdef Q_WS_X11
   mPreview = QPixmap::grabWindow( qt_xrootwin()).convertToImage().smoothScale(320,240);
+#else
+  mPreview = QPixmap::grabWidget(QApplication::desktop()).convertToImage().smoothScale(320,240);
+#endif
   QPixmap snapshot;
   snapshot.convertFromImage(mPreview.smoothScale(160,120));
   mPreviewLabel->setPixmap(snapshot);
+#ifdef Q_WS_X11
   KWin::setCurrentDesktop(desktop);
   KWin::deIconifyWindow(winId(), false);  
+#endif
 }
 
 SnapshotDlg::SnapshotDlg(QWidget *parent)
Index: kcontrol/thememgr/theme.cpp
===================================================================
RCS file: /home/kde/kdebase/kcontrol/thememgr/theme.cpp,v
retrieving revision 1.79
diff -d -u -p -r1.79 theme.cpp
--- kcontrol/thememgr/theme.cpp	9 Feb 2003 09:50:11 -0000	1.79
+++ kcontrol/thememgr/theme.cpp	5 Mar 2003 05:53:37 -0000
@@ -48,14 +48,18 @@
 
 #include <kio/netaccess.h>
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
 #include <X11/X.h>
 #include <X11/Xlib.h>
 #include <X11/Xatom.h>
 #include <X11/Xutil.h>
 #include <X11/Xos.h>
+#endif
 
+#ifdef Q_WS_X11
 extern int dropError(Display *, XErrorEvent *);
+#endif
 
 //-----------------------------------------------------------------------------
 Theme::Theme()
Index: kdm/configure.in.in
===================================================================
RCS file: /home/kde/kdebase/kdm/configure.in.in,v
retrieving revision 1.67
diff -d -u -p -r1.67 configure.in.in
--- kdm/configure.in.in	5 Dec 2002 01:30:26 -0000	1.67
+++ kdm/configure.in.in	5 Mar 2003 05:53:39 -0000
@@ -1,3 +1,4 @@
+if test "$kde_use_qt_mac" != "yes"; then
 
 dnl this is for kdm:
 
@@ -266,3 +267,5 @@ if test "x$with_krb4" != xno; then
 fi
 AC_MSG_RESULT([xdm CFLAGS: $XDM_CFLAGS])
 AC_SUBST(XDM_CFLAGS)
+
+fi
Index: kicker/core/container_applet.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/core/container_applet.cpp,v
retrieving revision 1.43
diff -d -u -p -r1.43 container_applet.cpp
--- kicker/core/container_applet.cpp	22 Jan 2003 23:52:29 -0000	1.43
+++ kicker/core/container_applet.cpp	5 Mar 2003 05:53:41 -0000
@@ -322,10 +322,12 @@ ExternalAppletContainer::ExternalAppletC
     _deskFile = info.desktopFile();
     _configFile = info.configFile();
 
+#ifdef Q_WS_X11
     // init QXEmbed
     _embed = new QXEmbed( _appletframe );
     connect ( _embed, SIGNAL( embeddedWindowDestroyed() ),
 	      this, SIGNAL( embeddedWindowDestroyed() ) );
+#endif
 
     KProcess process;
     process << "appletproxy"
@@ -459,7 +461,12 @@ bool ExternalAppletContainer::process(co
 	{
 	    QDataStream reply( replyData, IO_WriteOnly );
 	    replyType = "WId";
+#ifdef Q_WS_X11
 	    reply << _embed->winId();
+#else
+	    //Fixme, need something better for QWS & MAC
+	    reply << 0;
+#endif
 
 	    QDataStream sdata( data, IO_ReadOnly );
 	    int actions, type;
Index: kicker/core/container_applet.h
===================================================================
RCS file: /home/kde/kdebase/kicker/core/container_applet.h,v
retrieving revision 1.21
diff -d -u -p -r1.21 container_applet.h
--- kicker/core/container_applet.h	5 Nov 2002 22:48:49 -0000	1.21
+++ kicker/core/container_applet.h	5 Mar 2003 05:53:41 -0000
@@ -149,7 +149,9 @@ private slots:
     void slotAlignmentChange( Alignment a );
 
 private:
+#ifdef Q_WS_X11
     QXEmbed  *_embed;
+#endif
     QCString  _app;
     bool      _isdocked;
 };
Index: kicker/core/container_extension.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/core/container_extension.cpp,v
retrieving revision 1.52
diff -d -u -p -r1.52 container_extension.cpp
--- kicker/core/container_extension.cpp	26 Feb 2003 13:07:17 -0000	1.52
+++ kicker/core/container_extension.cpp	5 Mar 2003 05:53:42 -0000
@@ -258,11 +258,12 @@ ExternalExtensionContainer::ExternalExte
     QVBox* box = new QVBox( this );
     setMainWidget( box );
 
+#ifdef Q_WS_X11
     // init QXEmbed
     _embed = new QXEmbed( box );
-    
     connect (_embed, SIGNAL(embeddedWindowDestroyed()),
              this, SIGNAL(embeddedWindowDestroyed()));
+#endif
 
     KProcess process;
     process << "extensionproxy"
@@ -371,7 +372,12 @@ bool ExternalExtensionContainer::process
         {
             QDataStream reply( replyData, IO_WriteOnly );
             replyType = "WId";
+#ifdef Q_WS_X11
             reply << _embed->winId();
+#else
+	    //Fixme, need something better for QWS & MAC
+	    reply << 0;
+#endif
 
             QDataStream sdata( data, IO_ReadOnly );
             int actions, type;
Index: kicker/core/container_extension.h
===================================================================
RCS file: /home/kde/kdebase/kicker/core/container_extension.h,v
retrieving revision 1.24
diff -d -u -p -r1.24 container_extension.h
--- kicker/core/container_extension.h	26 Feb 2003 13:07:17 -0000	1.24
+++ kicker/core/container_extension.h	5 Mar 2003 05:53:42 -0000
@@ -137,7 +137,9 @@ private slots:
    void slotAlignmentChange( Alignment a );
 
 private:
+#ifdef Q_WS_X11
     QXEmbed  *_embed;
+#endif
     QCString  _app;
     bool      _isdocked;
 };
Index: kicker/core/container_panel.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/core/container_panel.cpp,v
retrieving revision 1.77
diff -d -u -p -r1.77 container_panel.cpp
--- kicker/core/container_panel.cpp	18 Feb 2003 05:46:20 -0000	1.77
+++ kicker/core/container_panel.cpp	5 Mar 2003 05:53:44 -0000
@@ -49,6 +49,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE 
 #include "container_panel.h"
 #include "container_panel.moc"
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
 const int XFocusOut = FocusOut;
 const int XFocusIn = FocusIn;
@@ -60,6 +61,7 @@ const int XFocusIn = FocusIn;
 extern Time qt_x_time;
 
 KWinModule* PanelContainer::kWinModule = 0;
+#endif
 
 PanelSettings::PanelSettings()
 {
@@ -158,6 +160,7 @@ PanelContainer::PanelContainer(QWidget *
   , _is_lmb_down(false)
   , _in_autohide(false)
 {
+#ifdef Q_WS_X11
     if( kWinModule == 0 ) {
          kWinModule = new KWinModule();
     }
@@ -170,6 +173,7 @@ PanelContainer::PanelContainer(QWidget *
     connect( kWinModule, SIGNAL( strutChanged() ), this, SLOT( strutChanged() ) );
     connect( kWinModule, SIGNAL( currentDesktopChanged(int) ),
 	     this, SLOT( currentDesktopChanged(int) ) );
+#endif
 
     setFrameStyle( NoFrame );
     setLineWidth( 0 );
@@ -246,8 +250,12 @@ PanelSettings PanelContainer::defaultSet
 
 static bool isnetwm12_below()
 {
+#ifdef Q_WS_X11
     NETRootInfo info( qt_xdisplay(), NET::Supported );
     return info.supportedProperties()[ NETRootInfo::STATES ] & NET::KeepBelow;
+#else
+    return FALSE;
+#endif
 }
 
 void PanelContainer::readConfig( KConfig* config )
@@ -270,19 +278,27 @@ void PanelContainer::readConfig( KConfig
     if( netwm12 ) // new netwm1.2 compliant way
     {
     if( _settings._hideMode == PanelSettings::Background ) {
+#ifdef Q_WS_X11
 	KWin::setState( winId(), NET::KeepBelow );
+#endif
 	UnhideTrigger::the()->setEnabled( true );
     } else {
+#ifdef Q_WS_X11
 	KWin::clearState( winId(), NET::KeepBelow );
+#endif
     }
     }
     else // old way
     {
     if( _settings._hideMode == PanelSettings::Background ) {
+#ifdef Q_WS_X11
 	KWin::clearState( winId(), NET::StaysOnTop );
+#endif
 	UnhideTrigger::the()->setEnabled( true );
     } else {
+#ifdef Q_WS_X11
 	KWin::setState( winId(), NET::StaysOnTop );
+#endif
     }
     }
     maybeStartAutoHideTimer();
@@ -508,8 +524,10 @@ void PanelContainer::unhideTriggered( Un
 	return;
 
     if( _settings._hideMode == PanelSettings::Background ) {
+#ifdef Q_WS_X11
 	if( _settings._unhideLocation == tr )
 	    KWin::setActiveWindow( winId() );
+#endif
 	return;
     }
 
@@ -653,6 +671,7 @@ bool PanelContainer::eventFilter( QObjec
     // get the mouse pointer and QApplication does not have an active window.
     case QEvent::Enter:
 	if  ( !qApp->activeWindow() ) {
+#ifdef Q_WS_X11
 	    XEvent ev;
 	    memset(&ev, 0, sizeof(ev));
 	    ev.xfocus.display = qt_xdisplay();
@@ -664,6 +683,7 @@ bool PanelContainer::eventFilter( QObjec
 	    qt_x_time = 1;
 	    qApp->x11ProcessEvent( &ev );
 	    qt_x_time = time;
+#endif
 	    setFocus(); // to avoid having a blinking cursor or a focus rectangle somewhere else
 	}
 	break;
@@ -918,6 +938,7 @@ void PanelContainer::updateWindowManager
 		    break;
     }
 
+#ifdef Q_WS_X11
     // only call KWin::setStrut when the strut is really changed
     if ( strut.left   != _strut.left  ||
          strut.right  != _strut.right ||
@@ -929,6 +950,7 @@ void PanelContainer::updateWindowManager
 //	kdDebug(1210) << strut.top << " " << strut.bottom << " " << strut.right << " " << strut.left << endl;
 	KWin::setStrut( winId(), strut.left, strut.right,  strut.top, strut.bottom );
     }
+#endif
 }
 
 QSize PanelContainer::sizeHint( Position p, const QSize &maxSize )
@@ -1197,10 +1219,12 @@ QRect PanelContainer::workArea(int Xiner
 	list.append((*it)->winId());
     }
 
+#ifdef Q_WS_X11
     if(XineramaScreen == -2) /* special value for all screens */
 	return kWinModule->workArea(list);
     else
 	return kWinModule->workArea(list).intersect(QApplication::desktop()->screenGeometry(XineramaScreen));
+#endif
 }
 
 PopupWidgetFilter::PopupWidgetFilter( QObject *parent )
Index: kicker/core/container_panel.h
===================================================================
RCS file: /home/kde/kdebase/kicker/core/container_panel.h,v
retrieving revision 1.34
diff -d -u -p -r1.34 container_panel.h
--- kicker/core/container_panel.h	27 Nov 2002 21:50:31 -0000	1.34
+++ kicker/core/container_panel.h	5 Mar 2003 05:53:44 -0000
@@ -125,7 +125,9 @@ protected:
     virtual bool vetoAutoHide() const { return false; }
     QRect workArea(int XineramaScreen);
 
+#ifdef Q_WS_X11
     static KWinModule* kWinModule;
+#endif
 
 protected slots:
     virtual void showPanelMenu( const QPoint& /* globalPos */ ) {};
Index: kicker/core/main.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/core/main.cpp,v
retrieving revision 1.31
diff -d -u -p -r1.31 main.cpp
--- kicker/core/main.cpp	14 Jul 2002 12:49:57 -0000	1.31
+++ kicker/core/main.cpp	5 Mar 2003 05:53:44 -0000
@@ -29,7 +29,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE 
 #include <kconfig.h>
 #include <dcopclient.h>
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 
 #include <stdio.h>
 #include <stdlib.h>
@@ -57,9 +59,11 @@ static void sighandler(int)
 
 int main( int argc, char ** argv )
 {
+#ifdef Q_WS_X11
     {
         QCString multiHead = getenv("KDE_MULTIHEAD");
         if (multiHead.lower() == "true") {
+
 	    Display *dpy = XOpenDisplay(NULL);
 	    if (! dpy) {
 		fprintf(stderr, "%s: FATAL ERROR: couldn't open display %s\n",
@@ -73,7 +77,7 @@ int main( int argc, char ** argv )
 	    QCString display_name = XDisplayString(dpy);
 	    XCloseDisplay(dpy);
 	    dpy = 0;
-
+	    
 	    if ((pos = display_name.findRev('.')) != -1)
 		display_name.remove(pos, 10);
 
@@ -99,6 +103,7 @@ int main( int argc, char ** argv )
 	    }
 	}
     }
+#endif
 
     QCString appname;
     if (kicker_screen_number == 0)
Index: kicker/core/showdesktop.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/core/showdesktop.cpp,v
retrieving revision 1.2
diff -d -u -p -r1.2 showdesktop.cpp
--- kicker/core/showdesktop.cpp	29 Oct 2002 13:20:38 -0000	1.2
+++ kicker/core/showdesktop.cpp	5 Mar 2003 05:53:45 -0000
@@ -37,8 +37,8 @@ ShowDesktop* ShowDesktop::the()
 ShowDesktop::ShowDesktop()
   : QObject()
   , showingDesktop( false )
-  , kWinModule( 0 )
 {
+#ifdef Q_WS_X11
     kWinModule = new KWinModule( this );
 
     // on desktop changes or when a window is deiconified, we abort the show desktop mode
@@ -46,6 +46,7 @@ ShowDesktop::ShowDesktop()
              SLOT(slotCurrentDesktopChanged(int)));
     connect( kWinModule, SIGNAL(windowChanged(WId,unsigned int)),
              SLOT(slotWindowChanged(WId,unsigned int)));
+#endif
 }
 
 void ShowDesktop::slotCurrentDesktopChanged(int)
@@ -55,6 +56,7 @@ void ShowDesktop::slotCurrentDesktopChan
 
 void ShowDesktop::slotWindowChanged(WId w, unsigned int dirty)
 {
+#ifdef Q_WS_X11
     if ( !showingDesktop )
 	return;
 
@@ -69,6 +71,7 @@ void ShowDesktop::slotWindowChanged(WId 
 	    emit desktopShown( false );
 	}
     }
+#endif
 }
 
 void ShowDesktop::showDesktop( bool b )
@@ -79,6 +82,8 @@ void ShowDesktop::showDesktop( bool b )
     if ( b ) {
         // this code should move to KWin after supporting NETWM1.2
 	iconifiedList.clear();
+
+#ifdef Q_WS_X11
 	const QValueList<WId> windows = kWinModule->windows();
 	QValueList<WId>::ConstIterator it;
 
@@ -98,11 +103,14 @@ void ShowDesktop::showDesktop( bool b )
         for ( it=iconifiedList.begin(); it!=iconifiedList.end(); ++it ) {
             KWin::iconifyWindow( *it, false );
         }
+#endif
     } else {
+#ifdef Q_WS_X11
 	QValueList<WId>::ConstIterator it;
 	for ( it=iconifiedList.begin(); it!=iconifiedList.end(); ++it ) {
 	    KWin::deIconifyWindow( *it, false  );
 	}
+#endif
     }
 
     emit desktopShown( showingDesktop );
Index: kicker/core/showdesktop.h
===================================================================
RCS file: /home/kde/kdebase/kicker/core/showdesktop.h,v
retrieving revision 1.1
diff -d -u -p -r1.1 showdesktop.h
--- kicker/core/showdesktop.h	26 Feb 2002 18:42:45 -0000	1.1
+++ kicker/core/showdesktop.h	5 Mar 2003 05:53:45 -0000
@@ -52,7 +52,9 @@ private:
     ShowDesktop();
 
     bool              showingDesktop;
+#ifdef Q_WS_X11
     KWinModule*       kWinModule;
+#endif
     QValueList<WId>   iconifiedList;
 
 };
Index: kicker/proxy/appletproxy.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/proxy/appletproxy.cpp,v
retrieving revision 1.22
diff -d -u -p -r1.22 appletproxy.cpp
--- kicker/proxy/appletproxy.cpp	23 Jan 2003 07:11:24 -0000	1.22
+++ kicker/proxy/appletproxy.cpp	5 Mar 2003 05:53:46 -0000
@@ -45,7 +45,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE 
 #include "appletproxy.h"
 #include "appletproxy.moc"
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 
 // FIXME: Ugly, remove when cleaning up
 KPanelApplet::Position directionToPosition( int d )
@@ -211,8 +213,12 @@ void AppletProxy::dock(const QCString& c
 	// we use "call" to know whether it was sucessful
 
 	int screen_number = 0;
+#ifdef Q_WS_X11
 	if (qt_xdisplay())
 	    screen_number = DefaultScreen(qt_xdisplay());
+#else
+	screen_number = QApplication::desktop()->primaryScreen();
+#endif
 	QCString appname;
 	if (screen_number == 0)
 	    appname = "kicker";
@@ -233,8 +239,12 @@ void AppletProxy::dock(const QCString& c
 
     if (win) {
         _applet->hide();
+#ifdef Q_WS_X11
         QXEmbed::initialize();
         QXEmbed::embedClientIntoWindow( _applet, win );
+#else
+	//FIXME: port to QWS & MAC
+#endif
     }
     else {
         kdError() << "Failed to dock into the panel." << endl;
@@ -352,8 +362,12 @@ void AppletProxy::slotUpdateLayout()
 
     QByteArray data;
     int screen_number = 0;
+#ifdef Q_WS_X11
     if (qt_xdisplay())
 	screen_number = DefaultScreen(qt_xdisplay());
+#else
+    screen_number = QApplication::desktop()->primaryScreen();
+#endif
     QCString appname;
     if (screen_number == 0)
 	appname = "kicker";
@@ -369,8 +383,12 @@ void AppletProxy::slotRequestFocus()
 
     QByteArray data;
     int screen_number = 0;
+#ifdef Q_WS_X11
     if (qt_xdisplay())
 	screen_number = DefaultScreen(qt_xdisplay());
+#else
+    screen_number = QApplication::desktop()->primaryScreen();
+#endif
     QCString appname;
     if (screen_number == 0)
 	appname = "kicker";
@@ -383,8 +401,12 @@ void AppletProxy::slotRequestFocus()
 void AppletProxy::slotApplicationRemoved(const QCString& appId)
 {
     int screen_number = 0;
+#ifdef Q_WS_X11
     if (qt_xdisplay())
 	screen_number = DefaultScreen(qt_xdisplay());
+#else
+    screen_number = QApplication::desktop()->primaryScreen();
+#endif
     QCString appname;
     if (screen_number == 0)
 	appname = "kicker";
@@ -402,7 +424,9 @@ void AppletProxy::showStandalone()
     _applet->resize( _applet->widthForHeight( 48 ), 48 );
     _applet->setMinimumSize( _applet->size() );
     _applet->setCaption( _info->name() );
+#ifdef Q_WS_X1
     KWin::setType( _applet->winId(), NET::Tool );
+#endif
     kapp->setMainWidget( _applet );
     _applet->show();
 }
Index: kicker/proxy/extensionproxy.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/proxy/extensionproxy.cpp,v
retrieving revision 1.17
diff -d -u -p -r1.17 extensionproxy.cpp
--- kicker/proxy/extensionproxy.cpp	23 Jan 2003 07:11:24 -0000	1.17
+++ kicker/proxy/extensionproxy.cpp	5 Mar 2003 05:53:47 -0000
@@ -43,7 +43,9 @@ CONNECTION WITH THE SOFTWARE OR THE USE 
 #include "extensionproxy.h"
 #include "extensionproxy.moc"
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 
 
 static KCmdLineOptions options[] =
@@ -196,8 +198,12 @@ void ExtensionProxy::dock(const QCString
 	// we use "call" to know whether it was sucessful
 
 	int screen_number = 0;
+#ifdef Q_WS_X11
 	if (qt_xdisplay())
 	    screen_number = DefaultScreen(qt_xdisplay());
+#else
+	screen_number = QApplication::desktop()->primaryScreen();
+#endif
 	QCString appname;
 	if (screen_number == 0)
 	    appname = "kicker";
@@ -218,8 +224,12 @@ void ExtensionProxy::dock(const QCString
 
     if (win) {
         _extension->hide();
+#ifdef Q_WS_X11
         QXEmbed::initialize();
         QXEmbed::embedClientIntoWindow( _extension, win );
+#else
+	//FIXME: port to QWS & MAC
+#endif
     }
     else {
         kdError() << "Failed to dock into the panel." << endl;
@@ -333,8 +343,12 @@ void ExtensionProxy::slotUpdateLayout()
 
     QByteArray data;
     int screen_number = 0;
+#ifdef Q_WS_X11
     if (qt_xdisplay())
 	screen_number = DefaultScreen(qt_xdisplay());
+#else
+    screen_number = QApplication::desktop()->primaryScreen();
+#endif
     QCString appname;
     if (screen_number == 0)
 	appname = "kicker";
@@ -347,8 +361,13 @@ void ExtensionProxy::slotUpdateLayout()
 void ExtensionProxy::slotApplicationRemoved(const QCString& appId)
 {
     int screen_number = 0;
+#ifdef Q_WS_X11
     if (qt_xdisplay())
 	screen_number = DefaultScreen(qt_xdisplay());
+#else
+    screen_number = QApplication::desktop()->primaryScreen();
+#endif
+
     QCString appname;
     if (screen_number == 0)
 	appname = "kicker";
Index: kicker/share/fittslawframe.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/share/fittslawframe.cpp,v
retrieving revision 1.9
diff -d -u -p -r1.9 fittslawframe.cpp
--- kicker/share/fittslawframe.cpp	29 Jul 2002 04:21:04 -0000	1.9
+++ kicker/share/fittslawframe.cpp	5 Mar 2003 05:53:47 -0000
@@ -34,9 +34,11 @@ CONNECTION WITH THE SOFTWARE OR THE USE 
 #include "fittslawframe.h"
 #include "fittslawframe.moc"
 
+#ifdef Q_WS_X11
 #include <X11/X.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
+#endif
 
 FittsLawFrame::FittsLawFrame( QWidget* parent, const char* name, WFlags f )
     : QFrame( parent, name, f )
@@ -49,6 +51,7 @@ FittsLawFrame::FittsLawFrame( QWidget* p
     pos_x = pos_y = 0;
 }
 
+#ifdef Q_WS_X11
 bool FittsLawFrame::x11Event( XEvent* e )
 {
     // "Catch" XEvents which occur on the panel's edges, and redirect them
@@ -322,6 +325,7 @@ bool FittsLawFrame::x11Event( XEvent* e 
 
     return false;
 }
+#endif
 
 FittsLawFrame::Position FittsLawFrame::mousePosition( const QPoint& p ) const
 {
Index: kicker/share/fittslawframe.h
===================================================================
RCS file: /home/kde/kdebase/kicker/share/fittslawframe.h,v
retrieving revision 1.8
diff -d -u -p -r1.8 fittslawframe.h
--- kicker/share/fittslawframe.h	11 Dec 2001 01:23:47 -0000	1.8
+++ kicker/share/fittslawframe.h	5 Mar 2003 05:53:47 -0000
@@ -50,7 +50,9 @@ signals:
     void resizeRequest( int dx, int dy );
 
 protected:
+#ifdef Q_WS_X11
     bool x11Event( XEvent* );
+#endif
     Position mousePosition( const QPoint& ) const;
     void setMouseCursor( Position m );
 
Index: kicker/taskmanager/taskmanager.cpp
===================================================================
RCS file: /home/kde/kdebase/kicker/taskmanager/taskmanager.cpp,v
retrieving revision 1.58
diff -d -u -p -r1.58 taskmanager.cpp
--- kicker/taskmanager/taskmanager.cpp	24 Feb 2003 15:50:35 -0000	1.58
+++ kicker/taskmanager/taskmanager.cpp	5 Mar 2003 05:53:49 -0000
@@ -31,15 +31,18 @@ CONNECTION WITH THE SOFTWARE OR THE USE 
 #include <qtimer.h>
 #include <qimage.h>
 
+#ifdef Q_WS_X11
 #include <X11/X.h>
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
+#endif
 
 #include "taskmanager.h"
 #include "taskmanager.moc"
 
 template class QPtrList<Task>;
 
+#ifdef Q_WS_X11
 // Hack: create a global KWinModule without a parent. We
 // can't make it a child of TaskManager because more than one
 // TaskManager might be created. We can't make it a class
@@ -47,11 +50,13 @@ template class QPtrList<Task>;
 // So, we'll leak a little memory, but it's better than crashing.
 // The real problem is that KWinModule should be a singleton.
 KWinModule* kwin_module = new KWinModule();
+#endif
 
 TaskManager::TaskManager(QObject *parent, const char *name)
     : QObject(parent, name), _active(0), _startup_info( NULL )
 {
     KGlobal::locale()->insertCatalogue("libtaskmanager");
+#ifdef Q_WS_X11
     connect(kwin_module, SIGNAL(windowAdded(WId)), SLOT(windowAdded(WId)));
     connect(kwin_module, SIGNAL(windowRemoved(WId)), SLOT(windowRemoved(WId)));
     connect(kwin_module, SIGNAL(activeWindowChanged(WId)), SLOT(activeWindowChanged(WId)));
@@ -66,6 +71,7 @@ TaskManager::TaskManager(QObject *parent
     // set active window
     WId win = kwin_module->activeWindow();
     activeWindowChanged(win);
+#endif
 
     configure_startup();
 }
@@ -104,6 +110,7 @@ Task* TaskManager::findTask(WId w)
 
 void TaskManager::windowAdded(WId w )
 {
+#ifdef Q_WS_X11
     NETWinInfo info (qt_xdisplay(),  w, qt_xrootwin(),
 		     NET::WMWindowType | NET::WMPid | NET::WMState );
 
@@ -142,6 +149,7 @@ void TaskManager::windowAdded(WId w )
             }
 	}
     }
+#endif
 
     Task* t = new Task(w, this);
     _tasks.append(t);
@@ -175,6 +183,7 @@ void TaskManager::windowRemoved(WId w )
 
 void TaskManager::windowChanged(WId w, unsigned int dirty)
 {
+#ifdef Q_WS_X11
     if( dirty & NET::WMState ) {
         NETWinInfo info ( qt_xdisplay(),  w, qt_xrootwin(), NET::WMState );
         if ( (info.state() & NET::SkipTaskbar) != 0 ) {
@@ -192,6 +201,7 @@ void TaskManager::windowChanged(WId w, u
     // check if any state we are interested in is marked dirty
     if(!(dirty & (NET::WMVisibleName|NET::WMName|NET::WMState|NET::WMIcon|NET::XAWMState|NET::WMDesktop)) )
         return;
+#endif
 
     // find task
     Task* t = findTask( w );
@@ -283,18 +293,27 @@ void TaskManager::killStartup(Startup* s
 
 QString TaskManager::desktopName(int desk) const
 {
+#ifdef Q_WS_X11
     return kwin_module->desktopName(desk);
+#else
+    return "";
+#endif
 }
 
 int TaskManager::numberOfDesktops() const
 {
+#ifdef Q_WS_X11
     return kwin_module->numberOfDesktops();
+#else
+    return QApplication::desktop->numScreens();
+#endif
 }
 
 bool TaskManager::isOnTop(const Task* task)
 {
     if(!task) return false;
 
+#ifdef Q_WS_X11
     for (QValueList<WId>::ConstIterator it = kwin_module->stackingOrder().fromLast();
          it != kwin_module->stackingOrder().end(); --it ) {
 	for (Task* t = _tasks.first(); t != 0; t = _tasks.next() ) {
@@ -307,6 +326,7 @@ bool TaskManager::isOnTop(const Task* ta
 	    }
 	}
     }
+#endif
     return false;
 }
 
@@ -392,7 +412,11 @@ bool Task::isShaded() const
 
 bool Task::isOnCurrentDesktop() const
 {
+#ifdef Q_WS_X11
     return (_info.onAllDesktops || _info.desktop == kwin_module->currentDesktop());
+#else
+    return TRUE;
+#endif
 }
 
 bool Task::isOnAllDesktops() const
@@ -625,6 +649,7 @@ void Task::activateRaiseOrIconify()
 
 void Task::toDesktop(int desk)
 {
+#ifdef Q_WS_X11
     NETWinInfo ni(qt_xdisplay(), _win, qt_xrootwin(), NET::WMDesktop);
     if (desk == 0) {
         if (_info.onAllDesktops) {
@@ -638,20 +663,25 @@ void Task::toDesktop(int desk)
     ni.setDesktop(desk);
     if(desk == kwin_module->currentDesktop())
         KWin::setActiveWindow(_win);
+#endif
 }
 
 void Task::toCurrentDesktop()
 {
+#ifdef Q_WS_X11
     toDesktop(kwin_module->currentDesktop());
+#endif
 }
 
 void Task::setAlwaysOnTop(bool stay)
 {
+#ifdef Q_WS_X11
     NETWinInfo ni( qt_xdisplay(),  _win, qt_xrootwin(), NET::WMState);
     if(stay)
         ni.setState( NET::StaysOnTop, NET::StaysOnTop );
     else
         ni.setState( 0, NET::StaysOnTop );
+#endif
 }
 
 void Task::toggleAlwaysOnTop()
@@ -746,5 +776,7 @@ void Startup::update( const KStartupInfo
 
 int TaskManager::currentDesktop() const
 {
+#ifdef Q_WS_X11
     return kwin_module->currentDesktop();
+#endif
 }
Index: kmenuedit/Makefile.am
===================================================================
RCS file: /home/kde/kdebase/kmenuedit/Makefile.am,v
retrieving revision 1.33
diff -d -u -p -r1.33 Makefile.am
--- kmenuedit/Makefile.am	12 Jul 2002 17:52:04 -0000	1.33
+++ kmenuedit/Makefile.am	5 Mar 2003 05:53:50 -0000
@@ -7,7 +7,7 @@ CLEANFILES = dummy.cpp
 
 kmenuedit_la_SOURCES = basictab.cpp treeview.cpp desktopfileeditor.cpp menueditview.cpp kmenuedit.cpp main.cpp khotkeys.cpp
 
-kmenuedit_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO)
+kmenuedit_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO) $(LIB_KDECORE) $(LIB_QT) -lDCOP
 kmenuedit_la_LDFLAGS = $(all_libraries) -module -avoid-version
 
 kmenuedit_SOURCES = dummy.cpp
Index: konqueror/konq_combo.cc
===================================================================
RCS file: /home/kde/kdebase/konqueror/konq_combo.cc,v
retrieving revision 1.34
diff -d -u -p -r1.34 konq_combo.cc
--- konqueror/konq_combo.cc	15 Jan 2003 00:03:34 -0000	1.34
+++ konqueror/konq_combo.cc	5 Mar 2003 05:53:51 -0000
@@ -297,8 +297,8 @@ bool KonqCombo::eventFilter( QObject *o,
         if ( type == QEvent::KeyPress ) {
             QKeyEvent *e = static_cast<QKeyEvent *>( ev );
 
-            if ( KStdAccel::isEqual( e, KStdAccel::deleteWordBack() ) ||
-                 KStdAccel::isEqual( e, KStdAccel::deleteWordForward() ) ||
+            if ( (!KStdAccel::deleteWordBack().isNull() && KStdAccel::isEqual( e, KStdAccel::deleteWordBack() )) ||
+                 (!KStdAccel::deleteWordForward().isNull() && KStdAccel::isEqual( e, KStdAccel::deleteWordForward()) ) ||
                  ((e->state() & ControlButton) &&
                    (e->key() == Key_Left || e->key() == Key_Right) ) ) {
                 selectWord(e);
Index: konqueror/konq_mainwindow.cc
===================================================================
RCS file: /home/kde/kdebase/konqueror/konq_mainwindow.cc,v
retrieving revision 1.1138
diff -d -u -p -r1.1138 konq_mainwindow.cc
--- konqueror/konq_mainwindow.cc	1 Mar 2003 14:15:33 -0000	1.1138
+++ konqueror/konq_mainwindow.cc	5 Mar 2003 05:53:59 -0000
@@ -2843,7 +2843,9 @@ void KonqMainWindow::slotToggleFullScree
     setWFlags( WDestructiveClose );
     // Qt bug (see below)
     setAcceptDrops( FALSE );
+#ifndef Q_WS_MAC
     topData()->dnd = 0;
+#endif
     setAcceptDrops( TRUE );
 
     m_ptaFullScreen->setText( i18n( "Exit Full-Screen Mode" ) );
@@ -2862,7 +2864,9 @@ void KonqMainWindow::slotToggleFullScree
     setWFlags( WType_TopLevel | WDestructiveClose );
     // Other Qt bug
     setAcceptDrops( FALSE );
+#ifndef Q_WS_MAC
     topData()->dnd = 0;
+#endif
     setAcceptDrops( TRUE );
 
     m_ptaFullScreen->setText( i18n( "Full-Screen Mode" ) );
@@ -4152,7 +4156,9 @@ void KonqMainWindow::setIcon( const QPix
   if ( !url.isEmpty() )
     big = KonqPixmapProvider::self()->pixmapFor( url, KIcon::SizeMedium );
 
+#ifdef Q_WS_X11
   KWin::setIcons( winId(), big, pix );
+#endif
 }
 
 void KonqMainWindow::slotIntro()
Index: konqueror/konq_misc.cc
===================================================================
RCS file: /home/kde/kdebase/konqueror/konq_misc.cc,v
retrieving revision 1.42
diff -d -u -p -r1.42 konq_misc.cc
--- konqueror/konq_misc.cc	19 Dec 2002 10:57:14 -0000	1.42
+++ konqueror/konq_misc.cc	5 Mar 2003 05:53:59 -0000
@@ -47,6 +47,7 @@
 // Terminates fullscreen-mode for any full-screen window on the current desktop
 void KonqMisc::abortFullScreenMode()
 {
+#ifdef Q_WS_X11
   QPtrList<KonqMainWindow> *mainWindows = KonqMainWindow::mainWindowList();
   if ( mainWindows )
   {
@@ -62,6 +63,7 @@ void KonqMisc::abortFullScreenMode()
       }
     }
   }
+#endif
 }
 
 KonqMainWindow * KonqMisc::createSimpleWindow( const KURL & _url, const QString &frameName )
@@ -122,7 +124,9 @@ KonqMainWindow * KonqMisc::createBrowser
   else if( KonqMainWindow::isPreloaded() && KonqMainWindow::preloadedWindow() != NULL )
   {
       mainWindow = KonqMainWindow::preloadedWindow();
+#ifdef Q_WS_X11
       KStartupInfo::setWindowStartupId( mainWindow->winId(), kapp->startupId());
+#endif
       KonqMainWindow::setPreloadedWindow( NULL );
       mainWindow->resetWindow();
       mainWindow->setShowHTML( !forbidUseHTML );
Index: konqueror/client/Makefile.am
===================================================================
RCS file: /home/kde/kdebase/konqueror/client/Makefile.am,v
retrieving revision 1.38
diff -d -u -p -r1.38 Makefile.am
--- konqueror/client/Makefile.am	6 Jan 2003 16:23:49 -0000	1.38
+++ konqueror/client/Makefile.am	5 Mar 2003 05:53:59 -0000
@@ -5,7 +5,7 @@ lib_LTLIBRARIES = kfmclient.la
 
 INCLUDES= -I.. $(all_includes)
 kfmclient_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kfmclient_la_LIBADD =  $(LIB_KIO)
+kfmclient_la_LIBADD =  $(LIB_KIO) $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_QT) -lDCOP
 kfmclient_la_SOURCES = kfmclient.cc KonquerorIface.stub KDesktopIface.stub
 
 noinst_HEADERS = kfmclient.h
Index: konqueror/client/kfmclient.cc
===================================================================
RCS file: /home/kde/kdebase/konqueror/client/kfmclient.cc,v
retrieving revision 1.98
diff -d -u -p -r1.98 kfmclient.cc
--- konqueror/client/kfmclient.cc	11 Feb 2003 16:54:38 -0000	1.98
+++ konqueror/client/kfmclient.cc	5 Mar 2003 05:54:00 -0000
@@ -48,7 +48,9 @@
 #include "KonquerorIface_stub.h"
 #include "KDesktopIface_stub.h"
 
-#include <X11/Xlib.h>
+#ifdef Q_WS_X11
+# include <X11/Xlib.h>
+#endif
 
 static const char appName[] = "kfmclient";
 
@@ -269,6 +271,7 @@ bool clientApp::createNewWindow(const KU
         kdDebug() << "clientApp::createNewWindow using existing konqueror" << endl;
         KonquerorIface_stub konqy( appId, "KonquerorIface" );
         konqy.createNewWindowASN( url.url(), mimetype, startup_id_str );
+#ifdef Q_WS_X11
         KStartupInfoId id;
         id.initId( startup_id_str );
         KStartupInfoData data;
@@ -281,6 +284,7 @@ bool clientApp::createNewWindow(const KU
             KStartupInfo::sendChangeX( dpy, id, data );
         if( dpy != NULL && dpy != qt_xdisplay())
             XCloseDisplay( dpy );
+#endif
     }
     else
     {
@@ -292,16 +296,20 @@ bool clientApp::createNewWindow(const KU
             kdError() << "Couldn't start konqueror from konqueror.desktop: " << error << endl;
             */
             // pass kfmclient's startup id to konqueror using kshell
+#ifdef Q_WS_X11
             KStartupInfoId id;
             id.initId( startup_id_str );
             id.setupStartupEnv();
+#endif
             KProcess proc;
             if ( mimetype.isEmpty() )
                 proc << QString::fromLatin1("kshell") << QString::fromLatin1("konqueror") << url.url();
             else
                 proc << QString::fromLatin1("kshell") << QString::fromLatin1("konqueror") << QString::fromLatin1("-mimetype") << mimetype << url.url();
             proc.start( KProcess::DontCare );
+#ifdef Q_WS_X11
             KStartupInfo::resetStartupEnv();
+#endif
             kdDebug() << "clientApp::createNewWindow KProcess started" << endl;
         //}
     }
@@ -338,6 +346,7 @@ bool clientApp::openProfile( const QStri
   else
       konqy.createBrowserWindowFromProfileAndURLASN( profile, profileName, url, mimetype, startup_id_str );
   sleep(2); // Martin Schenk <martin@schenk.com> says this is necessary to let the server read from the socket
+#ifdef Q_WS_X11
   KStartupInfoId id;
   id.initId( startup_id_str );
   KStartupInfoData sidata;
@@ -350,6 +359,7 @@ bool clientApp::openProfile( const QStri
       KStartupInfo::sendChangeX( dpy, id, sidata );
   if( dpy != NULL && dpy != qt_xdisplay())
       XCloseDisplay( dpy );
+#endif
   return true;
 }
 
@@ -382,8 +392,10 @@ bool clientApp::doIt()
 
   QCString command = args->arg(0);
 
+#ifdef Q_WS_X11
   // read ASN env. variable for non-KApp cases
   startup_id_str = KStartupInfo::currentStartupIdEnv().id();
+#endif
 
   if ( command == "openURL" )
   {
Index: konqueror/keditbookmarks/main.cpp
===================================================================
RCS file: /home/kde/kdebase/konqueror/keditbookmarks/main.cpp,v
retrieving revision 1.27
diff -d -u -p -r1.27 main.cpp
--- konqueror/keditbookmarks/main.cpp	2 Mar 2003 19:19:13 -0000	1.27
+++ konqueror/keditbookmarks/main.cpp	5 Mar 2003 05:54:01 -0000
@@ -64,7 +64,9 @@ static void continueInWindow(QString _wn
       }
    }
 
+#ifdef Q_WS_X11
    KWin::setActiveWindow(id);
+#endif
 }
 
 // TODO - make this register() or something like that and move dialog into main
Index: konqueror/kfmexec/main.cpp
===================================================================
RCS file: /home/kde/kdebase/konqueror/kfmexec/main.cpp,v
retrieving revision 1.31
diff -d -u -p -r1.31 main.cpp
--- konqueror/kfmexec/main.cpp	23 Jan 2003 07:11:24 -0000	1.31
+++ konqueror/kfmexec/main.cpp	5 Mar 2003 05:54:01 -0000
@@ -185,15 +185,19 @@ void KFMExec::slotRunApp()
     kdDebug() << "EXEC '" << params.join(" ") << "'" << endl;
 
     // propagate the startup indentification to the started process
+#ifdef Q_WS_X11
     KStartupInfoId id;
     id.initId( kapp->startupId());
     id.setupStartupEnv();
+#endif
 
     KProcess proc;
     proc << params;
     proc.start( KProcess::Block );
 
+#ifdef Q_WS_X11
     KStartupInfo::resetStartupEnv();
+#endif
 
     kdDebug() << "EXEC done" << endl;
 
Index: konqueror/preloader/Makefile.am
===================================================================
RCS file: /home/kde/kdebase/konqueror/preloader/Makefile.am,v
retrieving revision 1.2
diff -d -u -p -r1.2 Makefile.am
--- konqueror/preloader/Makefile.am	26 Feb 2003 18:04:10 -0000	1.2
+++ konqueror/preloader/Makefile.am	5 Mar 2003 05:54:02 -0000
@@ -5,7 +5,7 @@ kde_module_LTLIBRARIES = kded_konqy_prel
 INCLUDES= -I.. $(all_includes)
 kded_konqy_preloader_la_SOURCES = preloader.cc preloader.skel
 kded_konqy_preloader_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kded_konqy_preloader_la_LIBADD = $(LIB_KSYCOCA)
+kded_konqy_preloader_la_LIBADD = $(LIB_KSYCOCA) $(LIB_KDECORE) $(LIB_QT) -lDCOP $(prefix)/lib/kded.la
 
 METASOURCES = AUTO
 
Index: konsole/konsole/Makefile.am
===================================================================
RCS file: /home/kde/kdebase/konsole/konsole/Makefile.am,v
retrieving revision 1.54
diff -d -u -p -r1.54 Makefile.am
--- konsole/konsole/Makefile.am	27 Feb 2003 12:41:23 -0000	1.54
+++ konsole/konsole/Makefile.am	5 Mar 2003 05:54:02 -0000
@@ -26,7 +26,7 @@ libkonsolepart_la_LIBADD = $(XTESTLIB) $
 
 # kwrited kdeinit module
 kwrited_la_SOURCES = kwrited.cpp TEPty.cpp
-kwrited_la_LIBADD  = $(LIB_KDECORE) 
+kwrited_la_LIBADD  = $(LIB_KDECORE) $(LIB_QT) -lDCOP
 kwrited_la_LDFLAGS = $(all_libraries) -module -avoid-version
 
 # kwrited executable
@@ -41,7 +41,7 @@ konsole_la_SOURCES = TEPty.cpp BlockArra
      konsole_wcwidth.cpp konsolebookmarkhandler.cpp konsolebookmarkmenu.cpp konsole_child.cpp \
      zmodem_dialog.cpp
 konsole_la_LDFLAGS = $(all_libraries) -module -avoid-version
-konsole_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO) $(LIBUTIL) $(XTESTLIB)
+konsole_la_LIBADD = $(LIB_KDEUI) $(LIB_KIO) $(LIBUTIL) $(XTESTLIB) $(LIB_QT) $(LIB_KDECORE) -lDCOP
 
 # konsole executable
 konsole_SOURCES = dummy.cpp
Index: konsole/konsole/konsole.cpp
===================================================================
RCS file: /home/kde/kdebase/konsole/konsole/konsole.cpp,v
retrieving revision 1.363
diff -d -u -p -r1.363 konsole.cpp
--- konsole/konsole/konsole.cpp	20 Feb 2003 21:23:08 -0000	1.363
+++ konsole/konsole/konsole.cpp	5 Mar 2003 05:54:07 -0000
@@ -188,7 +188,9 @@ DCOPObject( "konsole" )
 ,m_initialSession(0)
 ,colors(0)
 ,rootxpm(0)
+#ifdef Q_WS_X11
 ,kWinModule(0)
+#endif
 ,menubar(0)
 ,statusbar(0)
 ,m_session(0)
@@ -361,13 +363,17 @@ Konsole::~Konsole()
     delete colors;
     colors=0;
 
+#ifdef Q_WS_X11
     delete kWinModule;
     kWinModule = 0;
+#endif
 }
 
 void Konsole::run() {
+#ifdef Q_WS_X11
    kWinModule = new KWinModule();
    connect( kWinModule,SIGNAL(currentDesktopChanged(int)), this,SLOT(currentDesktopChanged(int)) );
+#endif
 }
 
 void Konsole::setAutoClose(bool on)
@@ -3104,6 +3110,7 @@ bool KonsoleFind::reg_exp() const
 
 void Konsole::slotBackgroundChanged(int desk)
 {
+#ifdef Q_WS_X11
   ColorSchema* s = colors->find(curr_schema);
   if (s==0) return;
 
@@ -3129,9 +3136,11 @@ void Konsole::slotBackgroundChanged(int 
        wallpaperSource = 0;
     }
   }
+#endif
 }
 
 void Konsole::currentDesktopChanged(int desk) {
+#ifdef Q_WS_X11
    //Get window info
    NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), NET::WMDesktop );
    bool bNeedUpdate = false;
@@ -3158,6 +3167,7 @@ void Konsole::currentDesktopChanged(int 
       wallpaperSource = desk;
       rootxpm->repaint(true);
    }
+#endif
 }
 
 ///////////////////////////////////////////////////////////
Index: konsole/konsole/konsole.h
===================================================================
RCS file: /home/kde/kdebase/konsole/konsole/konsole.h,v
retrieving revision 1.144
diff -d -u -p -r1.144 konsole.h
--- konsole/konsole/konsole.h	20 Feb 2003 21:23:08 -0000	1.144
+++ konsole/konsole/konsole.h	5 Mar 2003 05:54:08 -0000
@@ -251,7 +251,9 @@ private:
   ColorSchemaList* colors;
 
   KRootPixmap*   rootxpm;
+#ifdef Q_WS_X11
   KWinModule*    kWinModule;
+#endif
 
   KMenuBar*   menubar;
   KStatusBar* statusbar;
Index: konsole/konsole/konsole_child.cpp
===================================================================
RCS file: /home/kde/kdebase/konsole/konsole/konsole_child.cpp,v
retrieving revision 1.20
diff -d -u -p -r1.20 konsole_child.cpp
--- konsole/konsole/konsole_child.cpp	31 Dec 2002 13:55:33 -0000	1.20
+++ konsole/konsole/konsole_child.cpp	5 Mar 2003 05:54:08 -0000
@@ -115,8 +115,10 @@ void KonsoleChild::run() {
    se->changeWidget(te);
    se->setConnect(true);
 
+#ifdef Q_WS_X11
    kWinModule = new KWinModule();
    connect( kWinModule,SIGNAL(currentDesktopChanged(int)), this,SLOT(currentDesktopChanged(int)) );
+#endif
 }
 
 void KonsoleChild::setSchema(ColorSchema* _schema) {
@@ -187,9 +189,11 @@ KonsoleChild::~KonsoleChild()
   }
   emit doneChild(this,se);
 
+#ifdef Q_WS_X11
   if( kWinModule )
     delete kWinModule;
   kWinModule = 0;
+#endif
 }
 
 void KonsoleChild::configureRequest(TEWidget* te, int, int x, int y)
@@ -272,6 +276,7 @@ void KonsoleChild::pixmap_menu_activated
 
 void KonsoleChild::slotBackgroundChanged(int desk)
 {
+#ifdef Q_WS_X11
   // Only update rootxpm if window is visible on current desktop
   NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), NET::WMDesktop );
 
@@ -294,9 +299,11 @@ void KonsoleChild::slotBackgroundChanged
        wallpaperSource = 0;
     }
   }
+#endif
 }
 
 void KonsoleChild::currentDesktopChanged(int desk) {
+#ifdef Q_WS_X11
    //Get window info
    NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), NET::WMDesktop );
    bool bNeedUpdate = false;
@@ -318,6 +325,7 @@ void KonsoleChild::currentDesktopChanged
       wallpaperSource = desk;
       rootxpm->repaint(true);
    }
+#endif
 }
 
 #include "konsole_child.moc"
Index: konsole/konsole/konsole_child.h
===================================================================
RCS file: /home/kde/kdebase/konsole/konsole/konsole_child.h,v
retrieving revision 1.8
diff -d -u -p -r1.8 konsole_child.h
--- konsole/konsole/konsole_child.h	31 Dec 2002 13:27:42 -0000	1.8
+++ konsole/konsole/konsole_child.h	5 Mar 2003 05:54:09 -0000
@@ -74,7 +74,9 @@ private:
   TEWidget*      te;
   KPopupMenu*    m_rightButton;
   KRootPixmap*   rootxpm;
+#ifdef Q_WS_X11
   KWinModule*    kWinModule;
+#endif
  };
 
 #endif
Index: konsole/konsole/kwrited.cpp
===================================================================
RCS file: /home/kde/kdebase/konsole/konsole/kwrited.cpp,v
retrieving revision 1.36
diff -d -u -p -r1.36 kwrited.cpp
--- konsole/konsole/kwrited.cpp	4 Feb 2003 16:27:43 -0000	1.36
+++ konsole/konsole/kwrited.cpp	5 Mar 2003 05:54:09 -0000
@@ -16,7 +16,9 @@
 #include <unistd.h>
 #include <stdio.h>
 #include <signal.h>
-#include <X11/Xlib.h>
+#ifdef Q_WS_X11
+# include <X11/Xlib.h>
+#endif
 
 #include <config.h>
 
Index: kpersonalizer/ksysinfo.cpp
===================================================================
RCS file: /home/kde/kdebase/kpersonalizer/ksysinfo.cpp,v
retrieving revision 1.10
diff -d -u -p -r1.10 ksysinfo.cpp
--- kpersonalizer/ksysinfo.cpp	10 Feb 2003 17:07:41 -0000	1.10
+++ kpersonalizer/ksysinfo.cpp	5 Mar 2003 05:54:09 -0000
@@ -26,7 +26,9 @@
 
 #include <kdebug.h>
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
+#endif
 
 #include "ksysinfo.h"
 
@@ -53,6 +55,7 @@ KSysInfo::~KSysInfo() {
  */
 
 void KSysInfo::initXInfo() {
+#ifdef Q_WS_X11
 	Display *dpy = XOpenDisplay(0);
 	// vendor
 	m_xvendor = !dpy ? QString::null : (QString)ServerVendor(dpy);
@@ -72,6 +75,7 @@ void KSysInfo::initXInfo() {
 			m_xrender=true;
 	}
 	XCloseDisplay (dpy);
+#endif
 }
 
 bool KSysInfo::isXfromXFreeInc() {
Index: kstart/kstart.cpp
===================================================================
RCS file: /home/kde/kdebase/kstart/kstart.cpp,v
retrieving revision 1.43
diff -d -u -p -r1.43 kstart.cpp
--- kstart/kstart.cpp	23 Jan 2003 07:11:24 -0000	1.43
+++ kstart/kstart.cpp	5 Mar 2003 05:54:10 -0000
@@ -49,12 +49,15 @@ static bool toSysTray = false;
 static bool fullscreen = false;
 static unsigned long state = 0;
 static unsigned long mask = 0;
+#ifdef Q_WS_X11
 static NET::WindowType windowtype = NET::Unknown;
 static KWinModule* kwinmodule;
+#endif
 
 KStart::KStart()
     :QObject()
 {
+#ifdef Q_WS_X11
     // connect to window add to get the NEW windows
     connect(kwinmodule, SIGNAL(windowAdded(WId)), SLOT(windowAdded(WId)));
 
@@ -65,10 +68,12 @@ KStart::KStart()
     KStartupInfoId id;
     id.initId( kapp->startupId());
     id.setupStartupEnv();
+#endif
 
     //finally execute the comand
     pid_t pid = execute(command);
 
+#ifdef Q_WS_X11
     if( pid >= 0 ) {
         KStartupInfoData data;
         data.addPid( pid );
@@ -82,10 +87,11 @@ KStart::KStart()
     }
     else
         KStartupInfo::sendFinish( id ); // failed to start
+#endif
 }
 
 void KStart::windowAdded(WId w){
-
+#ifdef Q_WS_X11
     KWin::Info info = KWin::info( w );
 
     // always ignore these window types
@@ -108,9 +114,10 @@ void KStart::windowAdded(WId w){
     }
     applyStyle( w );
     QApplication::exit();
+#endif
 }
 
-
+#ifdef Q_WS_X11
 extern Atom qt_wm_state; // defined in qapplication_x11.cpp
 static bool wstate_withdrawn( WId winid )
 {
@@ -129,10 +136,11 @@ static bool wstate_withdrawn( WId winid 
     }
     return withdrawn;
 }
+#endif
 
 
 void KStart::applyStyle(WId w ) {
-
+#ifdef Q_WS_X11
     if ( toSysTray || state || iconify || windowtype != NET::Unknown || desktop >= 1 ) {
 
 	XWithdrawWindow(qt_xdisplay(), w, qt_xscreen());
@@ -185,6 +193,7 @@ void KStart::applyStyle(WId w ) {
       KWin::setActiveWindow( w );
 
     QApplication::flushX();
+#endif
 }
 
 // David, 05/03/2000
@@ -241,6 +250,7 @@ int main( int argc, char *argv[] )
   for(int i=0; i < args->count(); i++)
       command += QCString(args->arg(i)) + " ";
 
+#ifdef Q_WS_X11
   kwinmodule = new KWinModule;
 
   desktop = args->getOption( "desktop" ).toInt();
@@ -248,9 +258,11 @@ int main( int argc, char *argv[] )
       desktop = NETWinInfo::OnAllDesktops;
   if ( args->isSet ( "currentdesktop")  )
       desktop = kwinmodule->currentDesktop();
+#endif
 
   window = args->getOption( "window" );
 
+#ifdef Q_WS_X11
   QCString s = args->getOption( "type" );
   if ( !s.isEmpty() ) {
       s = s.lower();
@@ -271,6 +283,7 @@ int main( int argc, char *argv[] )
       else
 	  windowtype = NET::Normal;
   }
+#endif
 
   if ( args->isSet( "ontop" ) ) {
       state |= NET::StaysOnTop;
@@ -295,10 +308,12 @@ int main( int argc, char *argv[] )
 
   iconify = args->isSet("iconify");
   toSysTray = args->isSet("tosystray");
+#ifdef Q_WS_X11
   if ( fullscreen = args->isSet("fullscreen") )
       windowtype = NET::Override;
 
   fcntl(ConnectionNumber(qt_xdisplay()), F_SETFD, 1);
+#endif
   args->clear();
 
   KStart start;
Index: ksystraycmd/ksystraycmd.cpp
===================================================================
RCS file: /home/kde/kdebase/ksystraycmd/ksystraycmd.cpp,v
retrieving revision 1.10
diff -d -u -p -r1.10 ksystraycmd.cpp
--- ksystraycmd/ksystraycmd.cpp	29 Jul 2002 00:13:45 -0000	1.10
+++ ksystraycmd/ksystraycmd.cpp	5 Mar 2003 05:54:11 -0000
@@ -13,6 +13,7 @@
 
 #include <netwm.h>
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
 const int XFocusOut = FocusOut;
 const int XFocusIn = FocusIn;
@@ -22,6 +23,7 @@ const int XFocusIn = FocusIn;
 #undef KeyRelease
 
 extern Time qt_x_time;
+#endif
 
 
 #include "ksystraycmd.h"
@@ -31,10 +33,15 @@ extern Time qt_x_time;
 KSysTrayCmd::KSysTrayCmd()
   : QLabel( 0, "systray_cmd" ),
     isVisible(true), lazyStart( false ), noquit( false ), quitOnHide( false ),
-    win(0), client(0), kwinmodule(0)
+    win(0), client(0)
+#ifdef Q_WS_X11
+  , kwinmodule(0)
+#endif
 {
   setAlignment( AlignCenter );
+#ifdef Q_WS_X11
   kwinmodule = new KWinModule( this );
+#endif
   refresh();
 }
 
@@ -49,8 +56,10 @@ KSysTrayCmd::~KSysTrayCmd()
 
 bool KSysTrayCmd::start()
 {
+#ifdef Q_WS_X11
   if ( !window.isEmpty() )
     kwinmodule->doNotManage( window );
+#endif
 
   // If we have no command we must catching an existing window
   if ( !command ) {
@@ -87,8 +96,10 @@ void KSysTrayCmd::showWindow()
   isVisible = true;
   if ( !win )
     return;
+#ifdef Q_WS_X11
   XMapWindow( qt_xdisplay(), win );
   KWin::setActiveWindow( win );
+#endif
 }
 
 void KSysTrayCmd::hideWindow()
@@ -96,27 +107,39 @@ void KSysTrayCmd::hideWindow()
   isVisible = false;
   if ( !win )
     return;
+#ifdef Q_WS_X11
   XUnmapWindow( qt_xdisplay(), win );
+#endif
 }
 
 void KSysTrayCmd::setTargetWindow( WId w )
 {
+#ifdef Q_WS_X11
   setTargetWindow( KWin::info( w ) );
+#endif
 }
 
 void KSysTrayCmd::setTargetWindow( const KWin::Info &info )
 {
+#ifdef Q_WS_X11
   disconnect( kwinmodule, SIGNAL(windowAdded(WId)), this, SLOT(windowAdded(WId)) );
   connect( kwinmodule, SIGNAL(windowChanged(WId)), SLOT(windowChanged(WId)) );
+#endif
   win = info.win;
+#ifdef Q_WS_X11
   KWin::setSystemTrayWindowFor( winId(), win );
+#endif
+
   refresh();
   show();
 
-  if ( isVisible )
+  if ( isVisible ) {
+#ifdef Q_WS_X11
     KWin::setActiveWindow( win );
-  else
+#endif
+  } else {
     hideWindow();
+  }
 }
 
 //
@@ -125,6 +148,7 @@ void KSysTrayCmd::setTargetWindow( const
 
 void KSysTrayCmd::refresh()
 {
+#ifdef Q_WS_X11
   KWin::setSystemTrayWindowFor( winId(), win ? win : winId() );
 
   if ( win ) {
@@ -146,6 +170,7 @@ void KSysTrayCmd::refresh()
     pix = img;
     setPixmap( pix );
   }
+#endif
 }
 
 //
@@ -156,9 +181,11 @@ bool KSysTrayCmd::startClient()
 {
   client = new KShellProcess();
   *client << command;
+#ifdef Q_WS_X11
   connect( kwinmodule, SIGNAL(windowAdded(WId)), SLOT(windowAdded(WId)) );
   connect( client, SIGNAL( processExited(KProcess *) ),
 	   this, SLOT( clientExited() ) );
+#endif
 
   return client->start();
 }
@@ -178,8 +205,10 @@ void KSysTrayCmd::clientExited()
 void KSysTrayCmd::quitClient()
 {
   if ( win ) {
+#ifdef Q_WS_X11
     NETRootInfo ri( qt_xdisplay(), NET::CloseWindow );
     ri.closeWindowRequest( win );
+#endif
     noquit = false;
   }
   else {
@@ -217,12 +246,14 @@ void KSysTrayCmd::execContextMenu( const
 
 void KSysTrayCmd::checkExistingWindows()
 {
+#ifdef Q_WS_X11
   QValueList<WId>::ConstIterator it;
   for ( it = kwinmodule->windows().begin(); it != kwinmodule->windows().end(); ++it ) {
     windowAdded( *it );
     if ( win )
       break;
   }
+#endif
 }
 
 void KSysTrayCmd::windowAdded(WId w)
@@ -251,8 +282,10 @@ void KSysTrayCmd::mousePressEvent( QMous
     start();
   else if ( quitOnHide && ( hasRunningClient() ) && isVisible )
   {
+#ifdef Q_WS_X11
     NETRootInfo ri( qt_xdisplay(), NET::CloseWindow );
     ri.closeWindowRequest( win );
+#endif
   }
   else
     toggleWindow();
@@ -260,6 +293,7 @@ void KSysTrayCmd::mousePressEvent( QMous
 
 void KSysTrayCmd::enterEvent( QEvent * )
 {
+#ifdef Q_WS_X11
   // Fake a focus event when the mouse points at our tray icon. This is
   // needed for our tooltips to work.
   if ( !qApp->focusWidget() ) {
@@ -275,6 +309,7 @@ void KSysTrayCmd::enterEvent( QEvent * )
     qApp->x11ProcessEvent( &ev );
 	qt_x_time = time;
   }
+#endif
 }
 
 
Index: ksystraycmd/ksystraycmd.h
===================================================================
RCS file: /home/kde/kdebase/ksystraycmd/ksystraycmd.h,v
retrieving revision 1.4
diff -d -u -p -r1.4 ksystraycmd.h
--- ksystraycmd/ksystraycmd.h	29 Jul 2002 00:13:45 -0000	1.4
+++ ksystraycmd/ksystraycmd.h	5 Mar 2003 05:54:11 -0000
@@ -73,7 +73,9 @@ private:
 
   WId win;
   KShellProcess *client;
+#ifdef Q_WS_X11
   KWinModule *kwinmodule;
+#endif
   QString errStr;
 };
 
Index: ksystraycmd/main.cpp
===================================================================
RCS file: /home/kde/kdebase/ksystraycmd/main.cpp,v
retrieving revision 1.7
diff -d -u -p -r1.7 main.cpp
--- ksystraycmd/main.cpp	23 Jan 2003 07:11:25 -0000	1.7
+++ ksystraycmd/main.cpp	5 Mar 2003 05:54:14 -0000
@@ -8,6 +8,7 @@
 
 #include "ksystraycmd.h"
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
 #ifndef KDE_USE_FINAL
 const int XFocusOut = FocusOut;
@@ -17,6 +18,7 @@ const int XFocusIn = FocusIn;
 #undef FocusIn
 #undef KeyPress
 #undef KeyRelease
+#endif
 
 
 static KCmdLineOptions options[] =
@@ -123,7 +125,9 @@ int main( int argc, char *argv[] )
       return 1;
   }
 
+#ifdef Q_WS_X11
   fcntl(ConnectionNumber(qt_xdisplay()), F_SETFD, 1);
+#endif
   args->clear();
 
   return app.exec();
Index: libkonq/Makefile.am
===================================================================
RCS file: /home/kde/kdebase/libkonq/Makefile.am,v
retrieving revision 1.108
diff -d -u -p -r1.108 Makefile.am
--- libkonq/Makefile.am	22 Feb 2003 11:40:46 -0000	1.108
+++ libkonq/Makefile.am	5 Mar 2003 05:54:16 -0000
@@ -21,7 +21,7 @@ SUBDIRS = pics favicons
 
 lib_LTLIBRARIES = libkonq.la
 libkonq_la_LDFLAGS = $(all_libraries) -version-info 6:0:2 -no-undefined
-libkonq_la_LIBADD = $(LIB_KPARTS)
+libkonq_la_LIBADD = $(LIB_KPARTS) $(LIB_KDECORE)
 
 libkonq_la_SOURCES = konq_popupmenu.cc knewmenu.cc \
    konq_xmlguiclient.cc\
Index: libkonq/konq_operations.cc
===================================================================
RCS file: /home/kde/kdebase/libkonq/konq_operations.cc,v
retrieving revision 1.109
diff -d -u -p -r1.109 konq_operations.cc
--- libkonq/konq_operations.cc	21 Feb 2003 01:17:45 -0000	1.109
+++ libkonq/konq_operations.cc	5 Mar 2003 05:54:18 -0000
@@ -50,7 +50,9 @@
 #include <kstringhandler.h>
 #include <qpopupmenu.h>
 #include <unistd.h>
-#include <X11/Xlib.h>
+#ifdef Q_WS_X11
+# include <X11/Xlib.h>
+#endif
 
 KBookmarkManager * KonqBookmarkManager::s_bookmarkManager;
 
@@ -389,6 +391,8 @@ void KonqOperations::doDrop( const KFile
             }
         }
 
+        KonqOperations * op = new KonqOperations(parent);
+#ifdef Q_WS_X11
         // Check the state of the modifiers key at the time of the drop
         Window root;
         Window child;
@@ -406,8 +410,8 @@ void KonqOperations::doDrop( const KFile
             kdDebug(1203) << "KonqOperations::doDrop Bookmark -> emulating Link" << endl;
         }
 
-        KonqOperations * op = new KonqOperations(parent);
         op->setDropInfo( new DropInfo( keybstate, lst, metaData, win_x, win_y, action ) );
+#endif
 
         // Ok, now we need destItem.
         if ( destItem )
@@ -563,7 +567,11 @@ void KonqOperations::doFileCopy()
             return;
         }
     }
+#ifdef Q_WS_X11
     else if ( ((m_info->keybstate & ControlMask) == 0) && ((m_info->keybstate & ShiftMask) == 0) )
+#else
+    else
+#endif
     {
         KonqIconViewWidget *iconView = dynamic_cast<KonqIconViewWidget*>(parent());
         bool bSetWallpaper = false;
Index: libkonq/konq_popupmenu.cc
===================================================================
RCS file: /home/kde/kdebase/libkonq/konq_popupmenu.cc,v
retrieving revision 1.141
diff -d -u -p -r1.141 konq_popupmenu.cc
--- libkonq/konq_popupmenu.cc	28 Jan 2003 23:24:18 -0000	1.141
+++ libkonq/konq_popupmenu.cc	5 Mar 2003 05:54:19 -0000
@@ -38,7 +38,10 @@
 
 #include <kfileshare.h>
 #include <kprocess.h>
-#include <libintl.h>
+#include <config.h>
+#ifdef HAVE_LIBINTL
+# include <libintl.h>
+#endif
 
 #include "kpropertiesdialog.h"
 #include "knewmenu.h"
Index: libkonq/favicons/Makefile.am
===================================================================
RCS file: /home/kde/kdebase/libkonq/favicons/Makefile.am,v
retrieving revision 1.3
diff -d -u -p -r1.3 Makefile.am
--- libkonq/favicons/Makefile.am	17 Mar 2002 20:25:19 -0000	1.3
+++ libkonq/favicons/Makefile.am	5 Mar 2003 05:54:19 -0000
@@ -3,7 +3,7 @@ kde_module_LTLIBRARIES = kded_favicons.l
 INCLUDES = $(all_includes)
 kded_favicons_la_SOURCES = favicons.cpp favicons.skel
 kded_favicons_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kded_favicons_la_LIBADD = $(LIB_KSYCOCA)
+kded_favicons_la_LIBADD = $(LIB_KSYCOCA) $(LIB_KDECORE) -lDCOP $(LIB_QT) $(prefix)/lib/kded.la
 
 METASOURCES = AUTO
 
