? -dup
? cvschk
? dondiff
? kdelibs.diff
? up
? admin/foo.pl
? admin/mychanges
? kdecore/h
? kdefx/kimageeffect.cpp.bk
? kioslave/data/Makefile.in
Index: configure.in.in
===================================================================
RCS file: /home/kde/kdelibs/configure.in.in,v
retrieving revision 1.105
diff -d -u -p -r1.105 configure.in.in
--- configure.in.in	13 Feb 2003 19:15:09 -0000	1.105
+++ configure.in.in	5 Mar 2003 05:56:39 -0000
@@ -43,7 +43,7 @@ dnl Checks for header files.
 KDE_CHECK_STL
 AC_HEADER_DIRENT
 AC_HEADER_STDC
-AC_CHECK_HEADERS(sys/param.h sys/mman.h sys/time.h sysent.h strings.h sys/stat.h sys/select.h paths.h malloc.h limits.h sys/soundcard.h dlfcn.h termios.h)
+AC_CHECK_HEADERS(alloc.h sys/param.h sys/mman.h sys/time.h sysent.h strings.h sys/stat.h sys/select.h paths.h malloc.h limits.h sys/soundcard.h dlfcn.h termios.h)
 
 DCOPIDL2CPP="compiled"
 DCOPIDL="compiled"
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:56:47 -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:56:57 -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:57: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: arts/kde/kvideowidget.cpp
===================================================================
RCS file: /home/kde/kdelibs/arts/kde/kvideowidget.cpp,v
retrieving revision 1.14
diff -d -u -p -r1.14 kvideowidget.cpp
--- arts/kde/kvideowidget.cpp	5 Feb 2003 19:17:01 -0000	1.14
+++ arts/kde/kvideowidget.cpp	5 Mar 2003 05:57:06 -0000
@@ -18,8 +18,10 @@
 #endif
 #include <qaccel.h>
 #include <qcursor.h>
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
+#endif
 #include <kaction.h>
 #include <klocale.h>
 #include "kvideowidget.h"
@@ -32,7 +34,9 @@ public:
 
 protected:
     virtual void windowActivationChange( bool );
+#ifdef Q_WS_X11
     virtual bool x11Event( XEvent *event );
+#endif
 
 private:
     KVideoWidget *videoWidget;
@@ -54,6 +58,7 @@ void KFullscreenVideoWidget::windowActiv
     }
 }
 
+#ifdef Q_WS_X11
 bool KFullscreenVideoWidget::x11Event( XEvent *event )
 {
     if (event->type == ClientMessage &&
@@ -64,6 +69,7 @@ bool KFullscreenVideoWidget::x11Event( X
     }
     return false;
 }
+#endif
 
 KVideoWidget::KVideoWidget( KXMLGUIClient *clientParent, QWidget *parent, const char *name, WFlags f )
     : QWidget( parent, name, f )
@@ -186,6 +192,7 @@ void KVideoWidget::embed( Arts::VideoPla
 
 QImage KVideoWidget::snapshot( Arts::VideoPlayObject vpo )
 {
+#ifdef Q_WS_X11
     Window root;
     Pixmap pixmap;
     XImage *xImage;
@@ -214,6 +221,10 @@ QImage KVideoWidget::snapshot( Arts::Vid
     XFreePixmap( qt_xdisplay(), pixmap );
 
     return qImage;
+#else
+    //FIXME: Implement (for QWS & MAC)
+    return QImage();
+#endif
 }
 
 bool KVideoWidget::isEmbedded()
@@ -337,6 +348,7 @@ void KVideoWidget::resizeNotify( int wid
     updateGeometry();
 }
 
+#ifdef Q_WS_X11
 bool KVideoWidget::x11Event( XEvent *event )
 {
     if (event->type == ClientMessage &&
@@ -347,6 +359,7 @@ bool KVideoWidget::x11Event( XEvent *eve
     }
     return false;
 }
+#endif
 
 void KVideoWidget::fullscreenActivated()
 {
Index: arts/kde/kvideowidget.h
===================================================================
RCS file: /home/kde/kdelibs/arts/kde/kvideowidget.h,v
retrieving revision 1.7
diff -d -u -p -r1.7 kvideowidget.h
--- arts/kde/kvideowidget.h	6 Sep 2002 17:47:15 -0000	1.7
+++ arts/kde/kvideowidget.h	5 Mar 2003 05:57:06 -0000
@@ -43,7 +43,9 @@ public:
 protected:
     virtual void mousePressEvent( QMouseEvent *event );
     virtual void resizeEvent( QResizeEvent *event );
+#ifdef Q_WS_X11
     virtual bool x11Event( XEvent *event );
+#endif
 
 public slots:
     void setFullscreen();
Index: dcop/dcopclient.cpp
===================================================================
RCS file: /home/kde/kdelibs/dcop/dcopclient.cpp,v
retrieving revision 1.156
diff -d -u -p -r1.156 dcopclient.cpp
--- dcop/dcopclient.cpp	11 Feb 2003 15:55:56 -0000	1.156
+++ dcop/dcopclient.cpp	5 Mar 2003 05:57:08 -0000
@@ -191,6 +191,8 @@ static QCString dcopServerFile(const QCS
    }
 #ifdef Q_WS_X11
    QCString disp = getenv("DISPLAY");
+#elif defined(Q_WS_MAC)
+   QCString disp; //wtf? ##Sam
 #elif defined(Q_WS_QWS)
    QCString disp = getenv("QWS_DISPLAY");
 #endif
Index: dcop/dcopserver_shutdown.c
===================================================================
RCS file: /home/kde/kdelibs/dcop/dcopserver_shutdown.c,v
retrieving revision 1.8
diff -d -u -p -r1.8 dcopserver_shutdown.c
--- dcop/dcopserver_shutdown.c	12 Dec 2002 14:23:30 -0000	1.8
+++ dcop/dcopserver_shutdown.c	5 Mar 2003 05:57:09 -0000
@@ -52,10 +52,12 @@ static char *getDisplay()
  but we don't want to include that here) (Simon)
 #ifdef Q_WS_X11
  */
-#if !defined(QWS)
-   display = getenv("DISPLAY");
-#else
+#if defined(QWS)
    display = getenv("QWS_DISPLAY");
+#elif defined(QT_MAC)
+   display = NULL; //Wtf? ##Sam
+#else
+   display = getenv("DISPLAY");
 #endif
    if (!display || !*display)
    {
Index: dcop/KDE-ICE/ICElibint.h
===================================================================
RCS file: /home/kde/kdelibs/dcop/KDE-ICE/ICElibint.h,v
retrieving revision 1.5
diff -d -u -p -r1.5 ICElibint.h
--- dcop/KDE-ICE/ICElibint.h	28 Jan 2002 09:59:17 -0000	1.5
+++ dcop/KDE-ICE/ICElibint.h	5 Mar 2003 05:57:09 -0000
@@ -26,13 +26,13 @@ Author: Ralph Mor, X Consortium
 #ifndef _ICELIBINT_H_
 #define _ICELIBINT_H_
 
-#ifndef QWS
+#if defined( QWS ) || defined( QT_MAC )
+#define _SIZEOF(x) sz_##x
+#define SIZEOF(x) _SIZEOF(x)
+#else
 #include <X11/Xos.h>
 #include <X11/Xfuncs.h>
 #include <X11/Xmd.h>
-#else
-#define _SIZEOF(x) sz_##x
-#define SIZEOF(x) _SIZEOF(x)
 #endif
 #include <KDE-ICE/ICEproto.h>
 #include <KDE-ICE/ICEconn.h>
Index: dcop/KDE-ICE/ICEproto.h
===================================================================
RCS file: /home/kde/kdelibs/dcop/KDE-ICE/ICEproto.h,v
retrieving revision 1.5
diff -d -u -p -r1.5 ICEproto.h
--- dcop/KDE-ICE/ICEproto.h	28 Jan 2002 09:59:17 -0000	1.5
+++ dcop/KDE-ICE/ICEproto.h	5 Mar 2003 05:57:10 -0000
@@ -26,9 +26,7 @@ Author: Ralph Mor, X Consortium
 #ifndef _ICEPROTO_H_
 #define _ICEPROTO_H_
 
-#ifndef QWS
-#include <X11/Xmd.h>
-#else
+#if defined( QWS ) || defined( QT_MAC )
 #if defined(__alpha__) || defined(__ia64__) || defined(__s390x__)
 typedef unsigned int CARD32;
 #else
@@ -39,6 +37,8 @@ typedef unsigned char CARD8;
 #define B32 :32
 #define B16 :16
 #include <unistd.h>
+#else
+#include <X11/Xmd.h>
 #endif
 
 typedef struct {
Index: dcop/KDE-ICE/Xtrans.h
===================================================================
RCS file: /home/kde/kdelibs/dcop/KDE-ICE/Xtrans.h,v
retrieving revision 1.4
diff -d -u -p -r1.4 Xtrans.h
--- dcop/KDE-ICE/Xtrans.h	28 Jan 2002 09:59:17 -0000	1.4
+++ dcop/KDE-ICE/Xtrans.h	5 Mar 2003 05:57:13 -0000
@@ -50,12 +50,12 @@ from The Open Group.
 #ifndef _XTRANS_H_
 #define _XTRANS_H_
 
-#ifndef QWS
-#include <X11/Xfuncproto.h>
-#include <X11/Xos.h>
-#else
+#if defined( QWS ) || defined( QT_MAC )
 #include <KDE-ICE/Xfuncproto.h>
 #include <fcntl.h>
+#else
+#include <X11/Xfuncproto.h>
+#include <X11/Xos.h>
 #endif
 
 /*
Index: kabc/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kabc/Makefile.am,v
retrieving revision 1.75
diff -d -u -p -r1.75 Makefile.am
--- kabc/Makefile.am	19 Feb 2003 19:46:35 -0000	1.75
+++ kabc/Makefile.am	5 Mar 2003 05:57:14 -0000
@@ -16,7 +16,8 @@ COMPILE_FIRST = addressee.h
 
 lib_LTLIBRARIES   = libkabc.la
 libkabc_la_COMPILE_FIRST = addressee.h
-libkabc_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 3:0:2 -module
+#why is this a -module? We cannot do that on Mac OS X
+libkabc_la_LDFLAGS = $(all_libraries) -no-undefined -version-info 3:0:2
 libkabc_la_LIBADD  = vcard/libvcard.la ../kdeui/libkdeui.la ../kio/libkio.la \
   ../kresources/libkderesources.la
 
Index: kate/part/katecodecompletion.cpp
===================================================================
RCS file: /home/kde/kdelibs/kate/part/katecodecompletion.cpp,v
retrieving revision 1.12
diff -d -u -p -r1.12 katecodecompletion.cpp
--- kate/part/katecodecompletion.cpp	28 Feb 2003 05:43:06 -0000	1.12
+++ kate/part/katecodecompletion.cpp	5 Mar 2003 05:57:16 -0000
@@ -297,7 +297,7 @@ void KateCodeCompletion::showComment()
 
   QPoint rightPoint = m_completionPopup->mapToGlobal(QPoint(m_completionPopup->width(),0));
   QPoint leftPoint = m_completionPopup->mapToGlobal(QPoint(0,0));
-  QRect screen = QApplication::desktop()->screenGeometry( m_commentLabel->x11Screen() );
+  QRect screen = QApplication::desktop()->screenGeometry( QApplication::desktop()->screenNumber(m_commentLabel));
   QPoint finalPoint;
   if (rightPoint.x()+m_commentLabel->width() > screen.x() + screen.width())
     finalPoint.setX(leftPoint.x()-m_commentLabel->width());
Index: kate/part/katedocument.cpp
===================================================================
RCS file: /home/kde/kdelibs/kate/part/katedocument.cpp,v
retrieving revision 1.429
diff -d -u -p -r1.429 katedocument.cpp
--- kate/part/katedocument.cpp	28 Feb 2003 04:12:55 -0000	1.429
+++ kate/part/katedocument.cpp	5 Mar 2003 05:57:21 -0000
@@ -1817,15 +1817,15 @@ void KateDocument::writeSessionConfig(KC
 
 void KateDocument::configDialog()
 {
-  KWin kwin;
-
   KDialogBase *kd = new KDialogBase(KDialogBase::IconList,
                                     i18n("Configure"),
                                     KDialogBase::Ok | KDialogBase::Cancel |
                                     KDialogBase::Help ,
                                     KDialogBase::Ok, kapp->mainWidget());
 
-  kwin.setIcons(kd->winId(), kapp->icon(), kapp->miniIcon());
+#ifdef Q_WS_X11
+  KWin::setIcons(kd->winId(), kapp->icon(), kapp->miniIcon());
+#endif
 
   QPtrList<KTextEditor::ConfigPage> editorPages;
 
Index: kdecore/kaccel.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kaccel.cpp,v
retrieving revision 1.139
diff -d -u -p -r1.139 kaccel.cpp
--- kdecore/kaccel.cpp	8 Jan 2003 21:44:15 -0000	1.139
+++ kdecore/kaccel.cpp	5 Mar 2003 05:57:22 -0000
@@ -306,7 +306,7 @@ bool KAccelPrivate::eventFilter( QObject
 		int keyCodeQt = key.keyCodeQt();
 		QMap<int, int>::iterator it = m_mapIDToKey.begin();
 		for( ; it != m_mapIDToKey.end(); ++it ) {
-			if( (*it) == keyCodeQt ) {
+			if( !key.isNull() && (*it) == keyCodeQt ) {
 				int nID = it.key();
 				kdDebug(125) << "shortcut found!" << endl;
 				if( m_mapIDToAction.contains( nID ) ) {
Index: kdecore/kapplication.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kapplication.cpp,v
retrieving revision 1.571
diff -d -u -p -r1.571 kapplication.cpp
--- kdecore/kapplication.cpp	24 Feb 2003 05:26:26 -0000	1.571
+++ kdecore/kapplication.cpp	5 Mar 2003 05:57:26 -0000
@@ -95,7 +95,7 @@
 #include <errno.h>
 #include <string.h>
 #include <netdb.h>
-#ifndef Q_WS_QWS //FIXME(E): NetWM should talk to QWS...
+#ifdef Q_WS_X11 //FIXME(E): NetWM should talk to QWS & MAC...
 #include <netwm.h>
 #endif
 
@@ -124,6 +124,8 @@ const int XKeyRelease = KeyRelease;
 #define DISPLAY "DISPLAY"
 #elif defined(Q_WS_QWS)
 #define DISPLAY "QWS_DISPLAY"
+#else
+#define DISPLAY "MAC_DISPLAY_FILLER" //Bleh --Sam
 #endif
 
 #include <kipc.h>
@@ -137,9 +139,11 @@ bool KApplication::loadedByKdeinit = fal
 DCOPClient *KApplication::s_DCOPClient = 0L;
 bool KApplication::s_dcopClientNeedsPostInit = false;
 
+#ifdef Q_WS_X11
 static Atom atom_DesktopWindow;
 static Atom atom_NetSupported;
 static Atom atom_KdeNetUserTime;
+#endif
 
 template class QPtrList<KSessionManaged>;
 
@@ -381,6 +385,12 @@ extern bool g_bKillAccelOverride;
 
 bool KApplication::notify(QObject *receiver, QEvent *event)
 {
+#ifdef Q_WS_MAC
+    //for now..
+    return QApplication::notify(receiver, event);
+#endif
+
+
     QEvent::Type t = event->type();
     if (g_bKillAccelOverride)
     {
@@ -404,7 +414,7 @@ bool KApplication::notify(QObject *recei
           // We have a keypress for a lineedit...
           QKeyEvent *kevent = static_cast<QKeyEvent *>(event);
           KKey key(kevent);
-          if (_selectAll.contains(key))
+          if (!key.isNull() && _selectAll.contains(key))
           {
              if (t == QEvent::KeyPress)
              {
@@ -417,7 +427,7 @@ bool KApplication::notify(QObject *recei
              }
           }
           // Ctrl-U deletes from start of line.
-          if (key == KKey(Qt::CTRL + Qt::Key_U))
+          if (!key.isNull() && key == KKey(Qt::CTRL + Qt::Key_U))
           {
              if (t == QEvent::KeyPress)
              {
@@ -433,7 +443,6 @@ bool KApplication::notify(QObject *recei
              {
                 kevent->accept();
              }
-
           }
        }
        if (receiver && receiver->inherits("QTextEdit"))
@@ -441,7 +450,8 @@ bool KApplication::notify(QObject *recei
           QTextEdit *medit = static_cast<QTextEdit *>(receiver);
           // We have a keypress for a multilineedit...
           QKeyEvent *kevent = static_cast<QKeyEvent *>(event);
-          if (_selectAll.contains(KKey(kevent)))
+	  KKey key(kevent);
+          if (!key.isNull() && _selectAll.contains(key))
           {
              if (t == QEvent::KeyPress)
              {
@@ -485,11 +495,11 @@ QString KApplication::sessionConfigName(
 #endif
 }
 
-#ifndef Q_WS_QWS
+#ifdef Q_WS_X11
 static SmcConn mySmcConnection = 0;
 static SmcConn tmpSmcConnection = 0;
 #else
-// FIXME(E): Implement for Qt Embedded
+// FIXME(E): Implement for QWS & MAC
 // Possibly "steal" XFree86's libSM?
 #endif
 static QTime* smModificationTime = 0;
@@ -1012,7 +1022,7 @@ void KApplication::commitData( QSessionM
 void KApplication::saveState( QSessionManager& sm )
 {
     d->session_save = true;
-#ifndef Q_WS_QWS
+#ifdef Q_WS_X11
     static bool firstTime = true;
     mySmcConnection = (SmcConn) sm.handle();
 
@@ -1162,7 +1172,7 @@ static const KCmdLineOptions qt_options[
   //FIXME: Check if other options are specific to Qt/X11
 #ifdef Q_WS_X11
    { "display <displayname>", I18N_NOOP("Use the X-server display 'displayname'."), 0},
-#else
+#elif defined(Q_WS_QWS)
    { "display <displayname>", I18N_NOOP("Use the QWS display 'displayname'."), 0},
 #endif
    { "session <sessionId>", I18N_NOOP("Restore the application for the given 'sessionId'."), 0},
@@ -1376,7 +1386,7 @@ KApplication::~KApplication()
   delete d;
   KApp = 0;
 
-#ifndef Q_WS_QWS
+#ifdef Q_WS_X11
   mySmcConnection = 0;
   delete smModificationTime;
   smModificationTime = 0;
@@ -1736,6 +1746,16 @@ QPalette KApplication::createApplication
 
 void KApplication::kdisplaySetPalette()
 {
+#ifdef Q_WS_MAC
+    //Can I have this on other platforms, please!? --Sam
+    {
+	KConfig *config = KGlobal::config();
+	KConfigGroupSaver saver( config, "General" );
+	bool do_not_set_palette = FALSE;
+	if(config->readBoolEntry("nopaletteChange", &do_not_set_palette))
+	    return;
+    }
+#endif
     QApplication::setPalette( createApplicationPalette(), true);
     emit kdisplayPaletteChanged();
     emit appearanceChanged();
@@ -2286,7 +2306,7 @@ void KApplication::setTopWidget( QWidget
 {
   if( topWidget != 0 )
   {
-#ifdef Q_WS_X11 // FIXME(E): Implement for Qt/Embedded
+#ifdef Q_WS_X11
     Window leader = topWidget->winId();
     char* argv = const_cast< char* >( KCmdLineArgs::appName());
     XSetCommand(display, leader, &argv, 1);
@@ -2307,20 +2327,23 @@ void KApplication::setTopWidget( QWidget
         XSetWMHints(display, topWidget->winId(), hints);
         XFree(reinterpret_cast<char *>(hints));
     }
-
+#else
+    // FIXME(E): Implement for QWS & MAC
 #endif
     // set the specified caption
     if ( !topWidget->inherits("KMainWindow") ) { // KMainWindow does this already for us
         topWidget->setCaption( caption() );
-#ifndef Q_WS_QWS // FIXME(E): Implement for Qt/Embedded
+#ifdef Q_WS_X11
         NETWinInfo info(qt_xdisplay(), topWidget->winId(), qt_xrootwin(), NET::WMName );
         info.setName( caption().utf8().data() );
+#else
+	// FIXME(E): Implement for QWS & MAC
 #endif
     }
 
     // set the specified icons
     topWidget->setIcon( icon() ); //standard X11
-#ifdef Q_WS_X11 // FIXME(E): Implement for Qt/Embedded
+#ifdef Q_WS_X11 
     KWin::setIcons(topWidget->winId(), icon(), miniIcon() ); // NET_WM hints for KWin
 
     // set a short icon text
@@ -2328,6 +2351,8 @@ void KApplication::setTopWidget( QWidget
 
     // set the app startup notification window property
     KStartupInfo::setWindowStartupId( topWidget->winId(), startupId());
+#else
+    // FIXME(E): Implement for QWS & MAC
 #endif
   }
 }
@@ -2518,6 +2543,7 @@ bool KApplication::authorizeURLAction(co
 
 uint KApplication::keyboardModifiers()
 {
+#ifdef Q_WS_X11
     Window root;
     Window child;
     int root_x, root_y, win_x, win_y;
@@ -2525,10 +2551,15 @@ uint KApplication::keyboardModifiers()
     XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child,
                    &root_x, &root_y, &win_x, &win_y, &keybstate );
     return keybstate & 0x00ff;
+#else
+    //FIXME: Implement on QWS & MAC
+    return 0;
+#endif
 }
 
 uint KApplication::mouseState()
 {
+#ifdef Q_WS_X11
     Window root;
     Window child;
     int root_x, root_y, win_x, win_y;
@@ -2536,6 +2567,10 @@ uint KApplication::mouseState()
     XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child,
                    &root_x, &root_y, &win_x, &win_y, &keybstate );
     return keybstate & 0xff00;
+#else
+    //FIXME: Implement on QWS & MAC
+    return 0;
+#endif
 }
 
 void KApplication::virtual_hook( int id, void* data )
Index: kdecore/kapplication.h
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kapplication.h,v
retrieving revision 1.285
diff -d -u -p -r1.285 kapplication.h
--- kdecore/kapplication.h	24 Feb 2003 20:43:05 -0000	1.285
+++ kdecore/kapplication.h	5 Mar 2003 05:57:28 -0000
@@ -32,7 +32,7 @@ class DCOPClient;
 class DCOPObject;
 
 typedef unsigned long Atom;
-#ifdef Q_WS_QWS
+#if defined( Q_WS_QWS ) || defined( Q_WS_MAC )
 typedef void Display;
 #endif
 
@@ -110,7 +110,7 @@ public:
    */
   KApplication( bool allowStyles=true, bool GUIenabled=true);
 
-#ifndef Q_WS_QWS
+#if !defined( Q_WS_QWS ) && !defined( Q_WS_MAC )
   /**
    * Constructor. Parses command-line arguments. Use this constructor to use KApplication
    * in a Motif or Xt program.
Index: kdecore/kcheckaccelerators.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kcheckaccelerators.cpp,v
retrieving revision 1.5
diff -d -u -p -r1.5 kcheckaccelerators.cpp
--- kdecore/kcheckaccelerators.cpp	19 Oct 2002 14:55:33 -0000	1.5
+++ kdecore/kcheckaccelerators.cpp	5 Mar 2003 05:57:28 -0000
@@ -95,7 +95,7 @@ bool KCheckAccelerators::eventFilter( QO
     if ( block )
         return false;
     if ( e->type() == QEvent::Accel ) {
-        if ( ( static_cast<QKeyEvent *>(e) )->key() == key ) {
+        if (( static_cast<QKeyEvent *>(e) )->key() == key ) {
     	    block = true;
 	    checkAccelerators( false );
 	    block = false;
Index: kdecore/kcmdlineargs.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kcmdlineargs.cpp,v
retrieving revision 1.75
diff -d -u -p -r1.75 kcmdlineargs.cpp
--- kdecore/kcmdlineargs.cpp	7 Feb 2003 14:52:00 -0000	1.75
+++ kdecore/kcmdlineargs.cpp	5 Mar 2003 05:57:30 -0000
@@ -46,6 +46,8 @@
 #define DISPLAY "DISPLAY"
 #elif defined(Q_WS_QWS)
 #define DISPLAY "QWS_DISPLAY"
+#elif defined(Q_WS_MAC)
+#define DISPLAY "MAC_DISPLAY_FILLER" //Bleh --Sam
 #endif
 
 template class QAsciiDict<QCString>;
@@ -170,12 +172,14 @@ KCmdLineArgs::init(int _argc, char **_ar
       exit(255);
    }
 
+#ifndef Q_WS_MAC
    // Strip path from argv[0]
    if (argc) {
      char *p = strrchr( argv[0], '/');
      if (p)
        argv[0] = p+1;
    }
+#endif
 
    about = _about;
    parsed = false;
Index: kdecore/kglobalaccel.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kglobalaccel.cpp,v
retrieving revision 1.89
diff -d -u -p -r1.89 kglobalaccel.cpp
--- kdecore/kglobalaccel.cpp	8 Jan 2003 21:44:15 -0000	1.89
+++ kdecore/kglobalaccel.cpp	5 Mar 2003 05:57:30 -0000
@@ -16,83 +16,254 @@
 KGlobalAccel::KGlobalAccel( QObject* pParent, const char* psName )
 : QObject( pParent, psName )
 {
-	kdDebug(125) << "KGlobalAccel(): this = " << this << endl;
-	d = new KGlobalAccelPrivate();
+    kdDebug(125) << "KGlobalAccel(): this = " << this << endl;
+    d = new KGlobalAccelPrivate();
 }
 
 KGlobalAccel::~KGlobalAccel()
 {
-	kdDebug(125) << "~KGlobalAccel(): this = " << this << endl;
-	delete d;
+    kdDebug(125) << "~KGlobalAccel(): this = " << this << endl;
+    delete d;
 }
 
 /*
 void KGlobalAccel::clear()
-	{ d->clearActions(); }
+{ 
+#ifdef Q_WS_X11
+    d->clearActions(); 
+#endif
+}
 */
+
 KAccelActions& KGlobalAccel::actions()
-	{ return d->actions(); }
+{ 
+#ifdef Q_WS_X11
+    return d->actions(); 
+#else
+    static KAccelActions ret;
+    return ret;
+#endif
+}
 
 const KAccelActions& KGlobalAccel::actions() const
-	{ return d->actions(); }
+{ 
+#ifdef Q_WS_X11
+    return d->actions(); 
+#else
+    static KAccelActions ret;
+    return ret;
+#endif
+}
 
 bool KGlobalAccel::isEnabled()
-	{ return ((KAccelBase*)d)->isEnabled(); }
+{ 
+#ifdef Q_WS_X11
+    return ((KAccelBase*)d)->isEnabled(); 
+#else
+    return false;
+#endif
+}
 
 void KGlobalAccel::setEnabled( bool bEnabled )
-	{ d->setEnabled( bEnabled ); }
+{ 
+#ifdef Q_WS_X11
+    d->setEnabled( bEnabled ); 
+#endif
+}
 
 KAccelAction* KGlobalAccel::insert( const QString& sAction, const QString& sDesc, const QString& sHelp,
 		const KShortcut& cutDef3, const KShortcut& cutDef4,
 		const QObject* pObjSlot, const char* psMethodSlot,
 		bool bConfigurable, bool bEnabled )
 {
-	return d->insert( sAction, sDesc, sHelp,
-		cutDef3, cutDef4,
-		pObjSlot, psMethodSlot,
-		bConfigurable, bEnabled );
+#ifdef Q_WS_X11
+    return d->insert( sAction, sDesc, sHelp, cutDef3, cutDef4, pObjSlot, psMethodSlot,
+		      bConfigurable, bEnabled );
+#else
+	return NULL;
+#endif
 }
 
 KAccelAction* KGlobalAccel::insert( const QString& sName, const QString& sDesc )
-	{ return d->insert( sName, sDesc ); }
+{ 
+#ifdef Q_WS_X11
+    return d->insert( sName, sDesc ); 
+#else
+    return NULL;
+#endif
+}
+
 bool KGlobalAccel::updateConnections()
-	{ return d->updateConnections(); }
+{ 
+#ifdef Q_WS_X11
+    return d->updateConnections(); 
+#else
+    return false;
+#endif
+}
 
 bool KGlobalAccel::remove( const QString& sAction )
-        { return d->remove( sAction ); }
+{ 
+#ifdef Q_WS_X11
+    return d->remove( sAction ); 
+#else
+    return false;
+#endif
+}
 
 const KShortcut& KGlobalAccel::shortcut( const QString& sAction ) const
 {
-	const KAccelAction* pAction = d->actions().actionPtr( sAction );
-	return (pAction) ? pAction->shortcut() : KShortcut::null();
+#ifdef Q_WS_X11
+    const KAccelAction* pAction = d->actions().actionPtr( sAction );
+    return (pAction) ? pAction->shortcut() : KShortcut::null();
+#else
+    return KShortcut::null();
+#endif
 }
 
 bool KGlobalAccel::setShortcut( const QString& sAction, const KShortcut& cut )
-	{ return d->setShortcut( sAction, cut ); }
+{ 
+#ifdef Q_WS_X11
+    return d->setShortcut( sAction, cut ); 
+#else
+    return false;
+#endif
+}
+
 bool KGlobalAccel::setSlot( const QString& sAction, const QObject* pObjSlot, const char* psMethodSlot )
-	{ return d->setActionSlot( sAction, pObjSlot, psMethodSlot ); }
+{ 
+#ifdef Q_WS_X11
+    return d->setActionSlot( sAction, pObjSlot, psMethodSlot ); 
+#else
+    return false;
+#endif
+}
 
 const QString& KGlobalAccel::configGroup() const
-	{ return d->configGroup(); }
+{ 
+#ifdef Q_WS_X11
+    return d->configGroup(); 
+#else
+    return "";
+#endif
+}
+
 // for kdemultimedia/kmix
 void KGlobalAccel::setConfigGroup( const QString& s )
-	{ d->setConfigGroup( s ); }
+{ 
+#ifdef Q_WS_X11
+    d->setConfigGroup( s ); 
+#endif
+}
 
 bool KGlobalAccel::readSettings( KConfigBase* pConfig )
-	{ d->readSettings( pConfig ); return true; }
+{ 
+#ifdef Q_WS_X11
+    d->readSettings( pConfig ); 
+    return true; 
+#else
+    return false;
+#endif
+}
 bool KGlobalAccel::writeSettings( KConfigBase* pConfig ) const
-	{ d->writeSettings( pConfig ); return true; }
+{ 
+#ifdef Q_WS_X11
+    d->writeSettings( pConfig );
+    return true; 
+#else
+    return false;
+#endif
+}
 bool KGlobalAccel::writeSettings( KConfigBase* pConfig, bool bGlobal ) const
 {
-	d->setConfigGlobal( bGlobal );
-	d->writeSettings( pConfig );
-	return true;
+#ifdef Q_WS_X11
+    d->setConfigGlobal( bGlobal );
+    d->writeSettings( pConfig );
+#endif
+    return true;
 }
 
 bool KGlobalAccel::useFourModifierKeys()
-	{ return KAccelAction::useFourModifierKeys(); }
+{ 
+    return KAccelAction::useFourModifierKeys(); 
+}
 
 void KGlobalAccel::virtual_hook( int, void* )
 { /*BASE::virtual_hook( id, data );*/ }
+
+
+#ifdef Q_WS_MAC
+/* This is all temporary, I've just placed some stubs here to get things building,
+   I will come back and implement these (and in the appropriate files) later. --Sam Magnuson
+*/
+KKeySequence::KKeySequence(const KKeyNative &)
+{
+    clear();
+}
+KKeyNative::KKeyNative(const KKey &)
+{
+}
+KKeyNative::KKeyNative()
+{
+}
+KKeyNative::~KKeyNative()
+{
+}
+void
+KKey::simplify()
+{
+}
+KKey
+KKeyNative::key() const
+{
+    return KKey();
+}
+int
+KKeyNative::keyCodeQt() const
+{
+    return 0;
+}
+bool
+KKeyNative::keyboardHasWinKey()
+{
+    return false;
+}
+KGlobalAccelPrivate::KGlobalAccelPrivate()
+{
+}
+void 
+KGlobalAccelPrivate::setEnabled( bool )
+{
+}
+bool 
+KGlobalAccelPrivate::connectKey( KAccelAction&, KKeySequence )
+{
+    return false;
+}
+bool 
+KGlobalAccelPrivate::disconnectKey( KAccelAction&, KKeySequence )
+{
+    return false;
+}
+bool
+KKeyServer::Key::init(const KKey &, bool)
+{
+    return false;
+}
+int 
+KKeyServer::Key::compare( const Key& key ) const
+{
+    return 0;
+}
+KKey
+KKeyServer::Key::key() const
+{
+    return KKey();
+}
+void
+KKeyServer::Variations::init(const KKey &, bool)
+{
+}
+#endif
 
 #include "kglobalaccel.moc"
Index: kdecore/kglobalaccel_emb.h
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kglobalaccel_emb.h,v
retrieving revision 1.2
diff -d -u -p -r1.2 kglobalaccel_emb.h
--- kdecore/kglobalaccel_emb.h	30 Dec 2001 22:31:54 -0000	1.2
+++ kdecore/kglobalaccel_emb.h	5 Mar 2003 05:57:30 -0000
@@ -10,7 +10,7 @@ public:
 	KGlobalAccelPrivate();
 
 	virtual void setEnabled( bool );
-
+ 
 	virtual bool connectKey( KAccelAction&, KKeySequence );
 	virtual bool disconnectKey( KAccelAction&, KKeySequence );
 };
Index: kdecore/kiconeffect.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kiconeffect.cpp,v
retrieving revision 1.44
diff -d -u -p -r1.44 kiconeffect.cpp
--- kdecore/kiconeffect.cpp	21 Nov 2002 19:18:51 -0000	1.44
+++ kdecore/kiconeffect.cpp	5 Mar 2003 05:57:31 -0000
@@ -360,7 +360,11 @@ void KIconEffect::semiTransparent(QImage
 	int width  = img.width();
 	int height = img.height();
 	
+#ifdef Q_WS_X11
 	if (qt_use_xrender && qt_has_xft )
+#else
+	if (true)
+#endif
 	  for (y=0; y<height; y++)
 	  {
 #ifdef WORDS_BIGENDIAN
@@ -426,7 +430,11 @@ void KIconEffect::semiTransparent(QImage
 
 void KIconEffect::semiTransparent(QPixmap &pix)
 {
+#ifdef Q_WS_X11
     if ( qt_use_xrender && qt_has_xft )
+#else
+    if ( true )
+#endif
     {
 	QImage img=pix.convertToImage();
 	semiTransparent(img);
Index: kdecore/kiconloader.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kiconloader.cpp,v
retrieving revision 1.208
diff -d -u -p -r1.208 kiconloader.cpp
--- kdecore/kiconloader.cpp	30 Dec 2002 06:32:43 -0000	1.208
+++ kdecore/kiconloader.cpp	5 Mar 2003 05:57:32 -0000
@@ -488,7 +488,6 @@ QString KIconLoader::iconPath(const QStr
     if (group_or_size == KIcon::User)
     {
 	static const QString &png_ext = KGlobal::staticQString(".png");
-	static const QString &xpm_ext = KGlobal::staticQString(".xpm");
 	path = d->mpDirs->findResource("appicon", name + png_ext);
 
 #ifdef HAVE_LIBART
@@ -499,6 +498,7 @@ QString KIconLoader::iconPath(const QStr
 	if (path.isEmpty())
 	   path = d->mpDirs->findResource("appicon", name + svg_ext);
 #endif
+	static const QString &xpm_ext = KGlobal::staticQString(".xpm");
 	if (path.isEmpty())
 	     path = d->mpDirs->findResource("appicon", name + xpm_ext);
 	return path;
Index: kdecore/kipc.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kipc.cpp,v
retrieving revision 1.11
diff -d -u -p -r1.11 kipc.cpp
--- kdecore/kipc.cpp	29 Aug 2001 15:25:38 -0000	1.11
+++ kdecore/kipc.cpp	5 Mar 2003 05:57:33 -0000
@@ -36,7 +36,7 @@
 #include <kipc.h>
 
 
-#ifndef Q_WS_QWS
+#ifdef Q_WS_X11
 static int dropError(Display *, XErrorEvent *)
 {
     return 0;
@@ -113,5 +113,8 @@ void KIPC::sendMessageAll(Message msg, i
     XFree((char *) rootwins);
 }
 #else
-	// FIXME(E): Implement in Qt Embedded
+void KIPC::sendMessageAll(Message msg, int data)
+{
+}
+// FIXME(E): Implement in QWS & MAC
 #endif
Index: kdecore/klibloader.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/klibloader.cpp,v
retrieving revision 1.61
diff -d -u -p -r1.61 klibloader.cpp
--- kdecore/klibloader.cpp	26 Feb 2003 17:59:32 -0000	1.61
+++ kdecore/klibloader.cpp	5 Mar 2003 05:57:33 -0000
@@ -539,7 +539,7 @@ void KLibLoader::close_pending(KLibWrapP
 
 //    kdDebug(150) << "try to dlclose " << wrap->name << ": yes, done." << endl;
 
-#ifndef Q_WS_QWS
+#ifdef Q_WS_X11
     if ( !deleted_one ) {
       /* Only do the hack once in this loop.
          WABA: *HACK*
@@ -565,7 +565,7 @@ void KLibLoader::close_pending(KLibWrapP
       delete widgetlist;
     }
 #else
-    // FIXME(E): Implement in Qt Embedded
+    // FIXME(E): Implement in QWS & MAC
 #endif
 
     deleted_one = true;
Index: kdecore/kprocess.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kprocess.cpp,v
retrieving revision 1.119
diff -d -u -p -r1.119 kprocess.cpp
--- kdecore/kprocess.cpp	24 Feb 2003 21:23:34 -0000	1.119
+++ kdecore/kprocess.cpp	5 Mar 2003 05:57:34 -0000
@@ -69,6 +69,7 @@
 #include <pwd.h>
 #include <grp.h>
 
+#include <qdir.h>
 #include <qfile.h>
 #include <qsocketnotifier.h>
 #include <qapplication.h>
@@ -372,7 +373,23 @@ bool KProcess::start(RunMode runmode, Co
         const char *executable = arglist[0];
         if (!d->executable.isEmpty())
            executable = d->executable.data();
-        execvp(executable, arglist);
+#ifdef Q_OS_MACX
+	/* This tries to find the executable in an application bundle */
+	{
+	    QString bundle = executable;
+	    bundle += ".app/Contents/MacOS/" + bundle.section('/', -1);
+	    if(QFile::exists(bundle)) {
+		QFileInfo fileInfo(bundle);
+		if(fileInfo.isExecutable()) {
+		    QCString cstr(fileInfo.absFilePath().local8Bit());
+		    execvp(cstr.data(), arglist);
+		    executable = NULL;
+		}
+	    }
+	}
+#endif
+	if(executable) 
+	    execvp(executable, arglist);
 
         char resultByte = 1;
         write(fd[1], &resultByte, 1);
Index: kdecore/krootprop.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/krootprop.cpp,v
retrieving revision 1.29
diff -d -u -p -r1.29 krootprop.cpp
--- kdecore/krootprop.cpp	28 Oct 2001 11:59:58 -0000	1.29
+++ kdecore/krootprop.cpp	5 Mar 2003 05:57:35 -0000
@@ -18,7 +18,7 @@
 */
 
 #include <qwidget.h>
-#ifndef Q_WS_QWS
+#ifdef Q_WS_X11
 #include "krootprop.h"
 #include "kglobal.h"
 #include "klocale.h"
@@ -295,4 +295,6 @@ QStringList KRootProp::listEntries() con
 	
     return list;
 }
+#else
+    // FIXME(E): Implement in QWS & MAC
 #endif
Index: kdecore/kshortcut.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kshortcut.cpp,v
retrieving revision 1.20
diff -d -u -p -r1.20 kshortcut.cpp
--- kdecore/kshortcut.cpp	25 Feb 2003 16:59:50 -0000	1.20
+++ kdecore/kshortcut.cpp	5 Mar 2003 05:57:35 -0000
@@ -68,6 +68,7 @@ bool KKey::init( uint key, uint modFlags
 
 bool KKey::init( int keyQt )
 {
+#ifdef Q_WS_X11
 	//KKeyServer::Sym sym;
 
 	//if( sym.initQt( keyQt )
@@ -79,6 +80,12 @@ bool KKey::init( int keyQt )
 		m_mod = 0;
 		return false;
 	}
+#else
+	// FIXME: Implement on QWS & MAC
+	m_sym = keyQt | Qt::MODIFIER_MASK;
+	m_mod = keyQt & Qt::MODIFIER_MASK;
+#endif
+	return true;
 }
 
 bool KKey::init( const QKeySequence& key )
@@ -105,6 +112,7 @@ bool KKey::init( const KKey& key )
 
 bool KKey::init( const QString& sSpec )
 {
+#ifdef Q_WS_X11
 	clear();
 
 	QString sKey = sSpec.stripWhiteSpace();
@@ -140,6 +148,9 @@ bool KKey::init( const QString& sSpec )
 		<< ", m_mod = " << QString::number(m_mod, 16) << endl;
 
 	return m_sym != 0;
+#else
+	return init(QKeySequence(sSpec));
+#endif
 }
 
 bool KKey::isNull() const          { return m_sym == 0; }
@@ -163,12 +174,14 @@ int KKey::keyCodeQt() const
 QString KKey::toString() const
 {
 	QString s;
-
+#ifdef Q_WS_X11
 	s = KKeyServer::modToStringUser( m_mod );
 	if( !s.isEmpty() )
 		s += '+';
 	s += KKeyServer::Sym(m_sym).toString();
-
+#else
+	s += (QString)QKeySequence(m_mod | m_sym);
+#endif
 	return s;
 }
 
@@ -178,11 +191,14 @@ QString KKey::toStringInternal() const
 	//	<< " mod = " << QString::number(m_mod, 16)
 	//	<< " key = " << QString::number(m_sym, 16) << endl;
 	QString s;
-
+#ifdef Q_WS_X11
 	s = KKeyServer::modToStringInternal( m_mod );
 	if( !s.isEmpty() )
 		s += '+';
 	s += KKeyServer::Sym(m_sym).toStringInternal();
+#else
+	s += toString();
+#endif
 	return s;
 }
 
@@ -197,7 +213,12 @@ KKey& KKey::null()
 
 QString KKey::modFlagLabel( ModFlag modFlag )
 {
+#ifdef Q_WS_X11
 	return KKeyServer::modToStringUser( modFlag );
+#else
+	// FIXME: Implement on QWS & MAC
+	return QString();
+#endif
 }
 
 //---------------------------------------------------------------------
@@ -312,8 +333,9 @@ bool KKeySequence::setKey( uint iKey, co
 {
 	if( iKey <= m_nKeys && iKey < MAX_KEYS ) {
 		m_rgvar[iKey].init( key );
-		if( iKey == m_nKeys )
+		if( iKey == m_nKeys ) {
 			m_nKeys++;
+		}
 		return true;
 	} else
 		return false;
@@ -471,39 +493,25 @@ bool KShortcut::init( const KShortcut& c
 
 bool KShortcut::init( const QString& s )
 {
+
 	bool bRet = true;
 	QStringList rgs = QStringList::split( ';', s );
 
-	if( s == "none" || rgs.size() == 0 )
-		clear();
-	else if( rgs.size() <= MAX_SEQUENCES ) {
-		m_nSeqs = rgs.size();
-		for( uint i = 0; i < m_nSeqs; i++ ) {
-			QString& sSeq = rgs[i];
-			if( sSeq.startsWith( "default(" ) )
-				sSeq = sSeq.mid( 8, sSeq.length() - 9 );
-			m_rgseq[i].init( sSeq );
-			//kdDebug(125) << "*\t'" << sSeq << "' => " << m_rgseq[i].toStringInternal() << endl;
-		}
+	if( s == "none" || rgs.size() == 0 ) {
+	    clear();
+	} else if( rgs.size() <= MAX_SEQUENCES ) {
+	    m_nSeqs = rgs.size();
+	    for( uint i = 0; i < m_nSeqs; i++ ) {
+		QString& sSeq = rgs[i];
+		if( sSeq.startsWith( "default(" ) )
+		    sSeq = sSeq.mid( 8, sSeq.length() - 9 );
+		m_rgseq[i].init( sSeq );
+		//kdDebug(125) << "*\t'" << sSeq << "' => " << m_rgseq[i].toStringInternal() << endl;
+	    }
 	} else {
-		clear();
-		bRet = false;
-	}
-
-	if( !s.isEmpty() ) {
-		QString sDebug;
-		QTextStream os( &sDebug, IO_WriteOnly );
-		os << "KShortcut::init( \"" << s << "\" ): ";
-		for( uint i = 0; i < m_nSeqs; i++ ) {
-			os << " m_rgseq[" << i << "]: ";
-			KKeyServer::Variations vars;
-			vars.init( m_rgseq[i].key(0), true );
-			for( uint j = 0; j < vars.count(); j++ )
-				os << QString::number(vars.m_rgkey[j].keyCodeQt(),16) << ',';
-		}
-		kdDebug(125) << sDebug << endl;
+	    clear();
+	    bRet = false;
 	}
-
 	return bRet;
 }
 
@@ -572,7 +580,7 @@ bool KShortcut::setSeq( uint iSeq, const
 	// TODO: check if seq is null, and act accordingly.
 	if( iSeq <= m_nSeqs && iSeq < MAX_SEQUENCES ) {
 		m_rgseq[iSeq] = seq;
-		if( iSeq == m_nSeqs )
+		if( iSeq == m_nSeqs ) 
 			m_nSeqs++;
 		return true;
 	} else
Index: kdecore/kuniqueapplication.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kuniqueapplication.cpp,v
retrieving revision 1.52
diff -d -u -p -r1.52 kuniqueapplication.cpp
--- kdecore/kuniqueapplication.cpp	15 Apr 2002 19:20:04 -0000	1.52
+++ kdecore/kuniqueapplication.cpp	5 Mar 2003 05:57:36 -0000
@@ -45,8 +45,10 @@
 #ifdef Q_WS_X11
 #include <X11/Xlib.h>
 #define DISPLAY "DISPLAY"
-#else
+#elif defined(Q_WS_QWS)
 #define DISPLAY "QWS_DISPLAY"
+#elif defined(Q_WS_MAC)
+//We don't use DISPLAY on Qt/Mac!! --Sam
 #endif
 
 bool KUniqueApplication::s_nofork = false;
@@ -112,7 +114,15 @@ KUniqueApplication::start()
      kdError() << "KUniqueApplication: pipe() failed!" << endl;
      ::exit(255);
   }
+#ifdef Q_OS_MAC
+  /* I don't have a complete explanation of why vfork is neccesary here (for Mac OS X only).
+     What I was experiencing was the fork would cause the stack to be copied, and since this
+     happens from the constructor it lead to some evil recursion that resulted in a call to
+     Carbon (creating the desktop widgets I believe) that then caused the child process to crash */
+  int fork_result = vfork();
+#else
   int fork_result = fork();
+#endif
   switch(fork_result) {
   case -1:
      kdError() << "KUniqueApplication: fork() failed!" << endl;
@@ -132,6 +142,7 @@ KUniqueApplication::start()
         QCString regName = dc->registerAs(appName, false);
         if (regName.isEmpty())
         {
+#ifndef Q_WS_MAC
            // Check DISPLAY
            if (QCString(getenv(DISPLAY)).isEmpty())
            {
@@ -140,6 +151,7 @@ KUniqueApplication::start()
               ::write(fd[1], &result, 1);
               ::exit(255);
            }
+#endif
 
            // Try to launch kdeinit.
            startKdeinit();
@@ -176,7 +188,7 @@ KUniqueApplication::start()
                    XCloseDisplay( disp );
                }
            }
-#else //FIXME(E): implement
+#else //FIXME(E): implement on QWS & MAC
 #endif
            return false;
         }
@@ -200,7 +212,7 @@ KUniqueApplication::start()
                XCloseDisplay( disp );
                }
          }
-#else //FIXME(E): Implement
+#else //FIXME(E): Implement on QWS & MAC
 #endif
      }
      result = 0;
@@ -260,6 +272,7 @@ KUniqueApplication::start()
         delete dc;	// Clean up DCOP commmunication
         ::exit(255);
      }
+
      if (replyType != "int")
      {
         kdError() << "KUniqueApplication: DCOP communication error!" << endl;
@@ -376,9 +389,11 @@ int KUniqueApplication::newInstance()
 {
   if (!d->firstInstance)
   {
-#ifndef Q_WS_QWS // FIXME(E): Implement for Qt/Embedded
+#ifdef Q_WS_X11
      if ( mainWidget() )
         KWin::setActiveWindow(mainWidget()->winId());
+#else
+     // FIXME(E): Implement for QWS & MAC
 #endif
   }
   d->firstInstance = false;
Index: kdecore/kwin.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdecore/kwin.cpp,v
retrieving revision 1.60
diff -d -u -p -r1.60 kwin.cpp
--- kdecore/kwin.cpp	21 Feb 2003 16:01:54 -0000	1.60
+++ kdecore/kwin.cpp	5 Mar 2003 05:57:37 -0000
@@ -32,7 +32,7 @@
 #include <qwhatsthis.h>
 #include <qcstring.h>
 
-#ifndef Q_WS_QWS
+#ifdef Q_WS_X11
 #include "kwin.h"
 #include "kapplication.h"
 
@@ -479,4 +479,6 @@ void KWin::appStarted()
 
 // Fix for --enable-final. This gets defined at the top of this file.
 #undef	None
+#else
+     // FIXME(E): Implement for QWS & MAC
 #endif
Index: kdefx/kstyle.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdefx/kstyle.cpp,v
retrieving revision 1.34
diff -d -u -p -r1.34 kstyle.cpp
--- kdefx/kstyle.cpp	23 Feb 2003 16:23:26 -0000	1.34
+++ kdefx/kstyle.cpp	5 Mar 2003 05:57:40 -0000
@@ -51,11 +51,15 @@
 #include <kimageeffect.h>
 #include "kstyle.h"
 
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
 #ifdef HAVE_XRENDER
 #include <X11/extensions/Xrender.h>
 extern bool qt_use_xrender;
 #endif
+#else
+#define qt_xrootwin QApplication::desktop()->winId
+#endif
 
 #include <limits.h>
 
@@ -1899,8 +1903,10 @@ void TransparencyHandler::createShadowWi
 	se.w2 = new QWidget(0, 0, WStyle_Customize | WType_Popup | WX11BypassWM );
 	se.w1->setGeometry(shadow1);
 	se.w2->setGeometry(shadow2);
+#ifdef Q_WS_X11
 	XSelectInput(qt_xdisplay(), se.w1->winId(), StructureNotifyMask );
 	XSelectInput(qt_xdisplay(), se.w2->winId(), StructureNotifyMask );
+#endif
 
 	// Insert a new ShadowMap entry
 	shadowMap()[p] = se;
@@ -1923,10 +1929,15 @@ void TransparencyHandler::createShadowWi
 	se.w1->setErasePixmap(pix_shadow1);
 	se.w2->setErasePixmap(pix_shadow2);
 
+#ifdef Q_WS_X11
 	// Show the 'shadow' just before showing the popup menu window
 	// Don't use QWidget::show() so we don't confuse QEffects, thus causing broken focus.
 	XMapWindow(qt_xdisplay(), se.w1->winId());
 	XMapWindow(qt_xdisplay(), se.w2->winId());
+#else
+	se.w1->show();
+	se.w2->show();
+#endif
 }
 
 void TransparencyHandler::removeShadowWindows(const QPopupMenu* p)
@@ -1935,9 +1946,14 @@ void TransparencyHandler::removeShadowWi
 	if (it != shadowMap().end())
 	{
 		ShadowElements se = it.data();
+#ifdef Q_WS_X11
 		XUnmapWindow(qt_xdisplay(), se.w1->winId());	// hide
 		XUnmapWindow(qt_xdisplay(), se.w2->winId());
 		XFlush(qt_xdisplay());							// try to hide faster
+#else
+		se.w1->hide();
+		se.w2->hide();
+#endif
 		delete se.w1;
 		delete se.w2;
 		shadowMap().erase(it);
@@ -1962,15 +1978,13 @@ bool TransparencyHandler::eventFilter( Q
 					p->x(), p->y(), p->width(), p->height());
 
 			switch (te) {
-#ifdef HAVE_XRENDER
 				case XRender:
+#ifdef HAVE_XRENDER
 					if (qt_use_xrender) {
 						XRenderBlendToPixmap(p);
 						break;
 					}
 					// Fall through intended
-#else
-				case XRender:
 #endif
 				case SoftwareBlend:
 					blendToPixmap(p->colorGroup(), p);
Index: kdeprint/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kdeprint/Makefile.am,v
retrieving revision 1.64
diff -d -u -p -r1.64 Makefile.am
--- kdeprint/Makefile.am	29 Dec 2002 13:27:47 -0000	1.64
+++ kdeprint/Makefile.am	5 Mar 2003 05:57:40 -0000
@@ -10,7 +10,7 @@ INCLUDES= -I$(top_srcdir)/kdefx -I$(top_
 kde_module_LTLIBRARIES = kded_kdeprintd.la
 
 kded_kdeprintd_la_SOURCES = kdeprintd.skel kdeprintd.cpp kprintprocess.cpp
-kded_kdeprintd_la_LIBADD = $(LIB_KIO)
+kded_kdeprintd_la_LIBADD = $(LIB_KIO) $(top_builddir)/kded/kded.la
 kded_kdeprintd_la_LDFLAGS = $(all_libraries) -module -avoid-version
 #kded_kdeprintd_la_METASOURCES = AUTO
 
Index: kdeprint/kdeprintd.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeprint/kdeprintd.cpp,v
retrieving revision 1.13
diff -d -u -p -r1.13 kdeprintd.cpp
--- kdeprint/kdeprintd.cpp	10 Feb 2003 15:54:02 -0000	1.13
+++ kdeprint/kdeprintd.cpp	5 Mar 2003 05:57:40 -0000
@@ -72,7 +72,9 @@ StatusWindow::StatusWindow(int pid)
 	m_icon = new QLabel(this);
 	m_icon->setPixmap(DesktopIcon("fileprint"));
 	m_icon->setAlignment(AlignCenter);
+#ifdef Q_WS_X11
 	KWin::setIcons(winId(), *(m_icon->pixmap()), SmallIcon("fileprint"));
+#endif
 	QGridLayout	*l0 = new QGridLayout(this, 2, 3, 10, 10);
 	l0->setRowStretch(0, 1);
 	l0->setColStretch(1, 1);
Index: kdeprint/management/kmjobviewer.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeprint/management/kmjobviewer.cpp,v
retrieving revision 1.38
diff -d -u -p -r1.38 kmjobviewer.cpp
--- kdeprint/management/kmjobviewer.cpp	1 Oct 2002 09:10:44 -0000	1.38
+++ kdeprint/management/kmjobviewer.cpp	5 Mar 2003 05:57:42 -0000
@@ -148,7 +148,9 @@ void KMJobViewer::updateCaption()
 	{
 		setCaption(i18n("No Printer"));
 	}
+#ifdef Q_WS_X11
 	KWin::setIcons(winId(), DesktopIcon(pixname), SmallIcon(pixname));
+#endif
 }
 
 void KMJobViewer::updateStatusBar()
Index: kdeui/kcolorbutton.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kcolorbutton.cpp,v
retrieving revision 1.33
diff -d -u -p -r1.33 kcolorbutton.cpp
--- kdeui/kcolorbutton.cpp	10 Jan 2003 01:29:45 -0000	1.33
+++ kdeui/kcolorbutton.cpp	5 Mar 2003 05:57:43 -0000
@@ -154,6 +154,7 @@ void KColorButton::mouseMoveEvent( QMous
 void KColorButton::chooseColor()
 {
   QColor c = color();
+#ifdef Q_WS_X11
   if ( d->m_bdefaultColor )
   {
       if( KColorDialog::getColor( c, d->m_defaultColor, this ) != QDialog::Rejected ) {
@@ -161,6 +162,7 @@ void KColorButton::chooseColor()
       }
   }
   else
+#endif
   {
       if( KColorDialog::getColor( c, this ) != QDialog::Rejected ) {
           setColor( c );
Index: kdeui/kcolordialog.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kcolordialog.cpp,v
retrieving revision 1.95
diff -d -u -p -r1.95 kcolordialog.cpp
--- kdeui/kcolordialog.cpp	27 Feb 2003 20:59:19 -0000	1.95
+++ kdeui/kcolordialog.cpp	5 Mar 2003 05:57:45 -0000
@@ -64,12 +64,16 @@
 #include <config.h>
 #include <kdebug.h>
 
+#ifndef Q_WS_QWS
 #ifdef Q_WS_X11
 #include <X11/Xlib.h>
 
 // defined in qapplication_x11.cpp
 typedef int (*QX11EventFilter) (XEvent*);
 extern QX11EventFilter qt_set_x11_event_filter (QX11EventFilter filter);
+#elif defined(Q_WS_MAC)
+# include "qcolordialog.h"
+#endif
 
 #define HSV_X 305
 #define RGB_X 385
@@ -890,7 +894,9 @@ public:
     QCheckBox *cbDefaultColor;
     KColor defaultColor;
     KColor selColor;
+#ifdef Q_WS_X11
     QX11EventFilter oldfilter;
+#endif
 };
 
 
@@ -902,7 +908,9 @@ KColorDialog::KColorDialog( QWidget *par
   d = new KColorDialogPrivate;
   d->bRecursion = true;
   d->bColorPicking = false;
+#ifdef Q_WS_X11
   d->oldfilter = 0;
+#endif
   d->cbDefaultColor = 0L;
   setHelp( QString::fromLatin1("kcolordialog.html"), QString::null );
   connect( this, SIGNAL(okClicked(void)),this,SLOT(slotWriteSettings(void)));
@@ -1125,8 +1133,10 @@ KColorDialog::KColorDialog( QWidget *par
 
 KColorDialog::~KColorDialog()
 {
+#ifdef Q_WS_X11
     if (d->bColorPicking)
         qt_set_x11_event_filter(d->oldfilter);
+#endif
     delete d;
 }
 
@@ -1233,6 +1243,16 @@ void KColorDialog::setColor( const QColo
 //
 int KColorDialog::getColor( QColor &theColor, QWidget *parent )
 {
+#ifdef Q_WS_MAC
+    //I want mac's color dialog because it will look like a native app!
+    QColor ret = QColorDialog::getColor(theColor, parent);
+    if(ret.isValid()) {
+	theColor = ret;
+	return Accepted;
+    }
+    return Rejected;
+#endif
+
   KColorDialog dlg( parent, "Color Selector", TRUE );
   if ( theColor.isValid() )
     dlg.setColor( theColor );
@@ -1251,6 +1271,16 @@ int KColorDialog::getColor( QColor &theC
 //
 int KColorDialog::getColor( QColor &theColor, const QColor& defaultCol, QWidget *parent )
 {
+#ifdef Q_WS_MAC
+    //I want mac's color dialog because it will look like a native app!
+    QColor ret = QColorDialog::getColor(theColor, parent);
+    if(ret.isValid()) {
+	theColor = ret;
+	return Accepted;
+    }
+    return Rejected;
+#endif
+
   KColorDialog dlg( parent, "Color Selector", TRUE );
   dlg.setDefaultColor( defaultCol );
   dlg.setColor( theColor );
@@ -1404,6 +1434,7 @@ void KColorDialog::showColor( const KCol
 
 static QWidget *kde_color_dlg_widget = 0;
 
+#ifdef Q_WS_X11
 int kde_color_dlg_handler(XEvent *event)
 {
     if (event->type == ButtonRelease)
@@ -1415,12 +1446,15 @@ int kde_color_dlg_handler(XEvent *event)
     }
     return FALSE;
 }
+#endif
 
 void
 KColorDialog::slotColorPicker()
 {
     d->bColorPicking = true;
+#ifdef Q_WS_X11
     d->oldfilter = qt_set_x11_event_filter(kde_color_dlg_handler);
+#endif
     kde_color_dlg_widget = this;
     grabMouse( crossCursor );
     grabKeyboard();
@@ -1432,8 +1466,10 @@ KColorDialog::mouseReleaseEvent( QMouseE
   if (d->bColorPicking)
   {
      d->bColorPicking = false;
+#ifdef Q_WS_X11
      qt_set_x11_event_filter(d->oldfilter);
      d->oldfilter = 0;
+#endif
      releaseMouse();
      releaseKeyboard();
      _setColor( grabColor( e->globalPos() ) );
@@ -1459,8 +1495,10 @@ KColorDialog::keyPressEvent( QKeyEvent *
      if (e->key() == Key_Escape)
      {
         d->bColorPicking = false;
+#ifdef Q_WS_X11
         qt_set_x11_event_filter(d->oldfilter);
         d->oldfilter = 0;
+#endif
         releaseMouse();
         releaseKeyboard();
      }
@@ -1522,6 +1560,5 @@ void KColorPatch::virtual_hook( int, voi
 void KColorDialog::virtual_hook( int id, void* data )
 { KDialogBase::virtual_hook( id, data ); }
 
-
 #include "kcolordialog.moc"
-#endif
+#endif //Q_WS_QWS
Index: kdeui/kcolordialog.h
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kcolordialog.h,v
retrieving revision 1.50
diff -d -u -p -r1.50 kcolordialog.h
--- kdeui/kcolordialog.h	1 Aug 2002 14:19:52 -0000	1.50
+++ kdeui/kcolordialog.h	5 Mar 2003 05:57:46 -0000
@@ -25,11 +25,12 @@
 #ifndef __KCOLORDIALOG_H__
 #define __KCOLORDIALOG_H__
 
-#ifdef Q_WS_QWS
+#if defined( Q_WS_QWS )
 // FIXME(E): Do we need the KColorDialog extra functionality in Qt Embedded?
 #include <qcolordialog.h>
 #define KColorDialog QColorDialog
 #else
+
 #include <kdialogbase.h>
 #include <qframe.h>
 #include <qpixmap.h>
Index: kdeui/khelpmenu.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/khelpmenu.cpp,v
retrieving revision 1.52
diff -d -u -p -r1.52 khelpmenu.cpp
--- kdeui/khelpmenu.cpp	19 Feb 2003 15:27:41 -0000	1.52
+++ kdeui/khelpmenu.cpp	5 Mar 2003 05:57:47 -0000
@@ -277,7 +277,7 @@ void KHelpMenu::contextHelpActivated()
   QWidget* w = QApplication::widgetAt( QCursor::pos(), TRUE );
   while ( w && !w->isTopLevel() && !w->inherits("QXEmbed")  )
       w = w->parentWidget();
-#ifndef Q_WS_QWS
+#if !defined( Q_WS_QWS ) && !defined( Q_WS_MAC )
    if ( w && w->inherits("QXEmbed") )
 	  (( QXEmbed*) w )->enterWhatsThisMode();
 #endif
Index: kdeui/kiconview.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kiconview.cpp,v
retrieving revision 1.57
diff -d -u -p -r1.57 kiconview.cpp
--- kdeui/kiconview.cpp	4 Mar 2002 00:51:49 -0000	1.57
+++ kdeui/kiconview.cpp	5 Mar 2003 05:57:47 -0000
@@ -160,13 +160,14 @@ void KIconView::slotAutoSelect()
     setFocus();
 
 #ifdef Q_WS_X11
-  //FIXME(E): Implement for Qt Embedded
   Window root;
   Window child;
   int root_x, root_y, win_x, win_y;
   uint keybstate;
   XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child,
 		 &root_x, &root_y, &win_x, &win_y, &keybstate );
+#else
+      //FIXME: Implement (QWS & MAC) 
 #endif
 
   QIconViewItem* previousItem = currentItem();
@@ -557,9 +558,11 @@ void KIconViewItem::paintItem( QPainter 
                 QPixmap selectedPix = kview->selectedIconPixmap( pix, cg.highlight() );
                 p->drawPixmap( iconX, iconY, selectedPix );
             }
+
         } else {
             p->drawPixmap( iconX, iconY, *pix );
         }
+
     }
 
     if ( isSelected() ) {
Index: kdeui/klistbox.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/klistbox.cpp,v
retrieving revision 1.18
diff -d -u -p -r1.18 klistbox.cpp
--- kdeui/klistbox.cpp	4 Mar 2002 00:51:50 -0000	1.18
+++ kdeui/klistbox.cpp	5 Mar 2003 05:57:48 -0000
@@ -131,14 +131,14 @@ void KListBox::slotAutoSelect()
   setCurrentItem( m_pCurrentItem );
 
   if( m_pCurrentItem ) {
-#ifndef Q_WS_QWS //FIXME
+#ifdef Q_WS_X11 //FIXME
     //Shift pressed?
     if( (keybstate & ShiftMask) ) {
 #endif
       bool block = signalsBlocked();
       blockSignals( true );
 
-#ifndef Q_WS_QWS //FIXME
+#ifdef Q_WS_X11 //FIXME
       //No Ctrl? Then clear before!
       if( !(keybstate & ControlMask) )  
 	clearSelection(); 
@@ -171,7 +171,7 @@ void KListBox::slotAutoSelect()
       if( selectionMode() == QListBox::Single )
 	emit selectionChanged( m_pCurrentItem );
     }
-#ifndef Q_WS_QWS //FIXME
+#ifdef Q_WS_X11 //FIXME
     else if( (keybstate & ControlMask) )
       setSelected( m_pCurrentItem, !m_pCurrentItem->isSelected() );
 #endif
@@ -186,7 +186,7 @@ void KListBox::slotAutoSelect()
 
       setSelected( m_pCurrentItem, true );
     }
-#ifndef Q_WS_QWS //FIXME
+#ifdef Q_WS_X11 //FIXME
   }
   else
     kdDebug() << "That´s not supposed to happen!!!!" << endl;
@@ -206,15 +206,14 @@ void KListBox::emitExecute( QListBoxItem
     
   m_pAutoSelect->stop();
   
-#ifndef Q_WS_QWS //FIXME
-  //Don´t emit executed if in SC mode and Shift or Ctrl are pressed
-  if( !( m_bUseSingle && ((keybstate & ShiftMask) || (keybstate & ControlMask)) ) ) {
+#ifdef Q_WS_X11 //FIXME
+  //Don't emit executed if in SC mode and Shift or Ctrl are pressed
+  if( !( m_bUseSingle && ((keybstate & ShiftMask) || (keybstate & ControlMask)) ) ) 
 #endif
+  {
     emit executed( item );
     emit executed( item, pos );
-#ifndef Q_WS_QWS //FIXME
   }
-#endif
 }
 
 //
Index: kdeui/klistview.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/klistview.cpp,v
retrieving revision 1.194
diff -d -u -p -r1.194 klistview.cpp
--- kdeui/klistview.cpp	25 Feb 2003 17:51:11 -0000	1.194
+++ kdeui/klistview.cpp	5 Mar 2003 05:57:50 -0000
@@ -545,20 +545,20 @@ void KListView::slotAutoSelect()
     setFocus();
 
 #ifdef Q_WS_X11
-  // FIXME(E): Implement for Qt Embedded
   Window root;
   Window child;
   int root_x, root_y, win_x, win_y;
   uint keybstate;
   XQueryPointer( qt_xdisplay(), qt_xrootwin(), &root, &child,
                                  &root_x, &root_y, &win_x, &win_y, &keybstate );
+#else
+      //FIXME: Implement (QWS & MAC) 
 #endif
 
   QListViewItem* previousItem = currentItem();
   setCurrentItem( d->pCurrentItem );
 
-#ifndef Q_WS_QWS
-  // FIXME(E): Implement for Qt Embedded
+#ifdef Q_WS_X11
   if( d->pCurrentItem ) {
     //Shift pressed?
     if( (keybstate & ShiftMask) ) {
@@ -612,6 +612,8 @@ void KListView::slotAutoSelect()
   }
   else
     kdDebug() << "KListView::slotAutoSelect: That´s not supposed to happen!!!!" << endl;
+#else
+      //FIXME: Implement (QWS & MAC) 
 #endif
 }
 
@@ -637,8 +639,7 @@ void KListView::emitExecute( QListViewIt
         }
         else
         {
-#ifndef Q_WS_QWS
-	    // FIXME(E): Implement for Qt Embedded
+#ifdef Q_WS_X11
             Window root;
             Window child;
             int root_x, root_y, win_x, win_y;
@@ -653,6 +654,8 @@ void KListView::emitExecute( QListViewIt
                 emit executed( item );
                 emit executed( item, pos, c );
             }
+#else
+	    //FIXME: Implement (QWS & MAC) 
 #endif
         }
     }
Index: kdeui/kmainwindow.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kmainwindow.cpp,v
retrieving revision 1.91
diff -d -u -p -r1.91 kmainwindow.cpp
--- kdeui/kmainwindow.cpp	22 Jan 2003 13:12:05 -0000	1.91
+++ kdeui/kmainwindow.cpp	5 Mar 2003 05:57:52 -0000
@@ -44,8 +44,8 @@
 #include <klocale.h>
 #include <kstandarddirs.h>
 #include <kstaticdeleter.h>
-#ifndef Q_WS_QWS
-#include <netwm.h>
+#ifdef Q_WS_X11
+# include <netwm.h>
 #endif
 
 #include <stdlib.h>
@@ -254,8 +254,7 @@ void KMainWindow::parseGeometry(bool par
     assert ( !kapp->geometryArgument().isNull() );
     assert ( d->care_about_geometry );
 
-#ifndef Q_WS_QWS
-    // FIXME: (E) Implement something similar for Qt Embedded (or decide we don't need it)
+#ifdef Q_WS_X11
     int x, y;
     int w, h;
     int m = XParseGeometry( kapp->geometryArgument().latin1(), &x, &y, (unsigned int*)&w, (unsigned int*)&h);
@@ -282,6 +281,8 @@ void KMainWindow::parseGeometry(bool par
             y = KApplication::desktop()->height() + y - h;
         move(x, y);
     }
+#else
+      //FIXME: Implement (QWS & MAC) 
 #endif
 }
 
@@ -472,7 +473,7 @@ void KMainWindow::setCaption( const QStr
 void KMainWindow::setPlainCaption( const QString &caption )
 {
     QMainWindow::setCaption( caption );
-#ifndef Q_WS_QWS
+#ifdef Q_WS_X11
     NETWinInfo info( qt_xdisplay(), winId(), qt_xrootwin(), 0 );
     info.setName( caption.utf8().data() );
 #endif
Index: kdeui/kmenubar.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kmenubar.cpp,v
retrieving revision 1.164
diff -d -u -p -r1.164 kmenubar.cpp
--- kdeui/kmenubar.cpp	5 Feb 2003 12:46:04 -0000	1.164
+++ kdeui/kmenubar.cpp	5 Mar 2003 05:57:52 -0000
@@ -37,7 +37,7 @@
 #include <kwinmodule.h>
 #include <kglobal.h>
 
-#ifndef Q_WS_QWS
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
 #include <X11/Xutil.h>
 #include <X11/Xatom.h>
@@ -122,8 +122,10 @@ void KMenuBar::setTopLevelMenuInternal(b
       d->frameStyle = frameStyle();
       removeEventFilter( topLevelWidget() );
       reparent( parentWidget(), WType_TopLevel | WType_Dialog | WStyle_NoBorder, QPoint(0,0), false );
-#ifndef Q_WS_QWS //FIXME
+#ifdef Q_WS_X11
       KWin::setType( winId(), NET::TopMenu );
+#else
+      //FIXME (QWS & MAC)
 #endif
       setFrameStyle( MenuBarPanel );
       installEventFilter( parentWidget()->topLevelWidget() );
@@ -212,11 +214,13 @@ void KMenuBar::updateKMenubarSize()
             QApplication::desktop()->screenNumber(QPoint(0,0)) );
         QRect area = QApplication::desktop()->screenGeometry(screen);
         QMenuBar::setGeometry(area.left(), area.top()-frameWidth()-2, area.width(), heightForWidth( area.width() ) );
-#ifndef Q_WS_QWS //FIXME
+#ifdef Q_WS_X11 //FIXME
         int strut_height = height()-frameWidth()-2;
         if( strut_height < 0 )
             strut_height = 0;
         KWin::setStrut( winId(), 0, 0, strut_height, 0 );
+#else
+	//FIXME: Implement (QWS & MAC) 
 #endif
     }
 }
Index: kdeui/kpassivepopup.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kpassivepopup.cpp,v
retrieving revision 1.21
diff -d -u -p -r1.21 kpassivepopup.cpp
--- kdeui/kpassivepopup.cpp	20 Feb 2003 06:39:20 -0000	1.21
+++ kdeui/kpassivepopup.cpp	5 Mar 2003 05:57:52 -0000
@@ -162,6 +162,7 @@ void KPassivePopup::hideEvent( QHideEven
 
 QRect KPassivePopup::defaultArea() const
 {
+#ifdef Q_WS_X11
     NETRootInfo info( qt_xdisplay(),
                       NET::NumberOfDesktops |
                       NET::CurrentDesktop |
@@ -172,17 +173,20 @@ QRect KPassivePopup::defaultArea() const
     QRect r;
     r.setRect( workArea.pos.x, workArea.pos.y, 0, 0 ); // top left
     return r;
+#else
+    QPoint pt = QApplication::desktop()->availableGeometry(0).topLeft();
+    return QRect(pt, QSize(0, 0));
+#endif
 }
 
 void KPassivePopup::positionSelf()
 {
     QRect target;
 
+#ifdef Q_WS_X11
     if ( window == 0L ) {
         target = defaultArea();
-    }
-
-    else {
+    } else {
         NETWinInfo ni( qt_xdisplay(), window, qt_xrootwin(),
                        NET::WMIconGeometry | NET::WMKDESystemTrayWinFor );
 
@@ -208,7 +212,9 @@ void KPassivePopup::positionSelf()
                 }
         }
     }
-
+#else
+    target = defaultArea();
+#endif
     moveNear( target );
 }
 
Index: kdeui/kpixmapio.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kpixmapio.cpp,v
retrieving revision 1.27
diff -d -u -p -r1.27 kpixmapio.cpp
--- kdeui/kpixmapio.cpp	28 Feb 2003 19:13:14 -0000	1.27
+++ kdeui/kpixmapio.cpp	5 Mar 2003 05:57:53 -0000
@@ -27,12 +27,12 @@
 #include <kdebug.h>
 #include "kpixmapio.h"
 
-#ifndef Q_WS_QWS
-#include <X11/X.h>
-#include <X11/Xlib.h>
-#include <X11/Xutil.h>
-#ifdef HAVE_MITSHM
-#include <X11/extensions/XShm.h>
+#ifdef Q_WS_X11
+# include <X11/X.h>
+# include <X11/Xlib.h>
+# include <X11/Xutil.h>
+# ifdef HAVE_MITSHM
+# include <X11/extensions/XShm.h>
 #endif
 #ifdef __osf__
 extern "C" int XShmQueryExtension(Display *display);
@@ -50,7 +50,7 @@ struct KPixmapIOPrivate
     int threshold;
     int bpp;
     int byteorder;
-#ifndef Q_WS_QWS
+#ifdef Q_WS_X11
     XImage *ximage;
 #ifdef HAVE_MITSHM
     XShmSegmentInfo *shminfo;
Index: kdeui/kprogress.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kprogress.cpp,v
retrieving revision 1.45
diff -d -u -p -r1.45 kprogress.cpp
--- kdeui/kprogress.cpp	18 Feb 2003 03:19:49 -0000	1.45
+++ kdeui/kprogress.cpp	5 Mar 2003 05:57:54 -0000
@@ -165,7 +165,9 @@ KProgressDialog::KProgressDialog(QWidget
       mShown(false),
       mMinDuration(2000)
 {
+#ifdef Q_WS_X11
     KWin::setIcons(winId(), kapp->icon(), kapp->miniIcon());
+#endif
     mShowTimer = new QTimer(this);
     
     showButton(KDialogBase::Close, false);
Index: kdeui/krootpixmap.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/krootpixmap.cpp,v
retrieving revision 1.18
diff -d -u -p -r1.18 krootpixmap.cpp
--- kdeui/krootpixmap.cpp	4 Aug 2002 14:07:53 -0000	1.18
+++ kdeui/krootpixmap.cpp	5 Mar 2003 05:57:54 -0000
@@ -15,7 +15,7 @@
 #include <qrect.h>
 #include <qimage.h>
 
-#ifndef Q_WS_QWS //FIXME
+#ifndef Q_WS_QWS
 #include <kapplication.h>
 #include <kimageeffect.h>
 #include <kpixmapio.h>
@@ -67,9 +67,13 @@ KRootPixmap::~KRootPixmap()
 
 int KRootPixmap::currentDesktop() const
 {
+#ifdef Q_WS_X11
     NETRootInfo rinfo( qt_xdisplay(), NET::CurrentDesktop );
     rinfo.activate();
     return rinfo.currentDesktop();
+#else
+    return 0;
+#endif
 }
 
 
Index: kdeui/ksharedpixmap.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/ksharedpixmap.cpp,v
retrieving revision 1.16
diff -d -u -p -r1.16 ksharedpixmap.cpp
--- kdeui/ksharedpixmap.cpp	15 Feb 2003 23:38:09 -0000	1.16
+++ kdeui/ksharedpixmap.cpp	5 Mar 2003 05:57:54 -0000
@@ -29,13 +29,14 @@
 #include <kdebug.h>
 #include <stdlib.h> // for abs
 
-#include <X11/Xlib.h>
-
+#ifdef Q_WS_X11
+# include <X11/Xlib.h>
 // Make sure to include all this X-based shit before we clean up the mess.
 // Needed for --enable-final. Not needed by this file itself!
-#include <X11/Xutil.h>
-#ifdef HAVE_MITSHM
-#include <X11/extensions/XShm.h>
+# include <X11/Xutil.h>
+# ifdef HAVE_MITSHM
+# include <X11/extensions/XShm.h>
+# endif
 #endif
 
 #include <netwm.h>
@@ -56,9 +57,11 @@
 class KSharedPixmapPrivate
 {
 public:
+#ifdef Q_WS_X11
   Atom pixmap;
   Atom target;
   Atom selection;
+#endif
   QRect rect;
 };
 
@@ -78,26 +81,33 @@ KSharedPixmap::~KSharedPixmap()
 
 void KSharedPixmap::init()
 {
+#ifdef Q_WS_X11
     d->pixmap = XInternAtom(qt_xdisplay(), "PIXMAP", false);
     QCString atom;
     atom.sprintf("target prop for window %lx", static_cast<unsigned long int>(winId()));
     d->target = XInternAtom(qt_xdisplay(), atom.data(), false);
     d->selection = None;
+#endif
 }
 
 
 bool KSharedPixmap::isAvailable(const QString & name) const
 {
+#ifdef Q_WS_X11
     QString str = QString("KDESHPIXMAP:%1").arg(name);
     Atom sel = XInternAtom(qt_xdisplay(), str.latin1(), true);
     if (sel == None)
 	return false;
     return XGetSelectionOwner(qt_xdisplay(), sel) != None;
+#else
+    return FALSE;
+#endif
 }
 
 
 bool KSharedPixmap::loadFromShared(const QString & name, const QRect & rect)
 {
+#ifdef Q_WS_X11
     if (d->selection != None)
 	// already active
 	return false;
@@ -118,9 +128,12 @@ bool KSharedPixmap::loadFromShared(const
     XConvertSelection(qt_xdisplay(), d->selection, d->pixmap, d->target,
 	    winId(), CurrentTime);
     return true;
+#else
+    return FALSE;
+#endif
 }
 
-
+#ifdef Q_WS_X11
 bool KSharedPixmap::x11Event(XEvent *event)
 {
     if (event->type != SelectionNotify)
@@ -218,6 +231,7 @@ bool KSharedPixmap::x11Event(XEvent *eve
     emit done(true);
     return true;
 }
+#endif
 
 
 #include "ksharedpixmap.moc"
Index: kdeui/ksharedpixmap.h
===================================================================
RCS file: /home/kde/kdelibs/kdeui/ksharedpixmap.h,v
retrieving revision 1.8
diff -d -u -p -r1.8 ksharedpixmap.h
--- kdeui/ksharedpixmap.h	18 Feb 2003 06:46:45 -0000	1.8
+++ kdeui/ksharedpixmap.h	5 Mar 2003 05:57:55 -0000
@@ -98,7 +98,9 @@ signals:
     void done(bool success);
 
 protected:
+#ifdef Q_WS_X11
     bool x11Event(XEvent *);
+#endif
     
 private:
     bool copy(const QString & id, const QRect & rect);
Index: kdeui/ksystemtray.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/ksystemtray.cpp,v
retrieving revision 1.23
diff -d -u -p -r1.23 ksystemtray.cpp
--- kdeui/ksystemtray.cpp	27 Dec 2002 20:11:11 -0000	1.23
+++ kdeui/ksystemtray.cpp	5 Mar 2003 05:57:55 -0000
@@ -29,7 +29,7 @@
 #include <kiconloader.h>
 
 #include <qapplication.h>
-#ifndef Q_WS_QWS
+#ifdef Q_WS_X11
 #include <X11/Xlib.h>
 #ifndef KDE_USE_FINAL
 const int XFocusOut = FocusOut;
@@ -65,10 +65,11 @@ KSystemTray::KSystemTray( QWidget* paren
     d = new KSystemTrayPrivate;
     d->actionCollection = new KActionCollection(this);
 
-#ifndef Q_WS_QWS
-    // FIXME(E): Talk with QWS
+#ifdef Q_WS_X11
     KWin::setSystemTrayWindowFor( winId(), parent?parent->topLevelWidget()->winId(): qt_xrootwin() );
     setBackgroundMode(X11ParentRelative);
+#else
+    // FIXME(E): Talk with QWS & MAC
 #endif
     hasQuit = 0;
     menu = new KPopupMenu( this );
@@ -114,8 +115,7 @@ void KSystemTray::showEvent( QShowEvent 
 
 void KSystemTray::enterEvent( QEvent* )
 {
-#ifndef Q_WS_QWS
-    // FIXME(E): Implement for Qt Embedded
+#ifdef Q_WS_X11
     if ( !qApp->focusWidget() ) {
 	XEvent ev;
 	memset(&ev, 0, sizeof(ev));
@@ -129,6 +129,8 @@ void KSystemTray::enterEvent( QEvent* )
 	qApp->x11ProcessEvent( &ev );
 	qt_x_time = time;
     }
+#else
+      //FIXME: Implement (QWS & MAC) 
 #endif
 }
 
@@ -185,6 +187,7 @@ void KSystemTray::toggleMinimizeRestore(
     if ( !pw )
 	return;
 
+#ifdef Q_WS_X11
     KWin::Info info = KWin::info( pw->winId() );
     bool visible = (info.mappingState == NET::Visible);
     if ( visible && !pw->isActiveWindow() ) // may be obscured -> raise it
@@ -201,20 +204,29 @@ void KSystemTray::toggleMinimizeRestore(
                 visible = false;
         }
     }
+#else
+    bool visible = FALSE;
+#endif
 
     if ( !visible )
     {
+#ifdef Q_WS_X11
         if ( info.mappingState != NET::Iconic )
+#endif
         {
             pw->hide(); // KWin::setOnDesktop( parentWidget()->winId(), KWin::currentDesktop() );
-#ifndef Q_WS_QWS //FIXME
+#ifdef Q_WS_X11
             pw->move( info.geometry.topLeft() );
+#else
+	    //FIXME: Implement (QWS & MAC) 
 #endif
             pw->show();
-#ifndef Q_WS_QWS //FIXME
         }
+#ifdef Q_WS_X11
         KWin::deIconifyWindow( pw->winId() );
 	KWin::setActiveWindow( pw->winId() );
+#else
+	//FIXME: Implement (QWS & MAC) 
 #endif
     } else {
 	pw->hide();
Index: kdeui/kwindowinfo.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kwindowinfo.cpp,v
retrieving revision 1.3
diff -d -u -p -r1.3 kwindowinfo.cpp
--- kdeui/kwindowinfo.cpp	21 Jun 2002 13:01:22 -0000	1.3
+++ kdeui/kwindowinfo.cpp	5 Mar 2003 05:57:55 -0000
@@ -72,12 +72,13 @@ void KWindowInfo::message( const QString
 
 void KWindowInfo::permanent( const QString &text )
 {
+#ifdef Q_WS_X11
     oldMiniIcon = KWin::icon( win->winId(), 16, 16, true );
     oldIcon = KWin::icon( win->winId(), 34, 34, false );
     if ( oldIcon.isNull() )
 	oldIcon = KWin::icon( win->winId(), 32, 32, true );
-
     permanent( text, oldIcon );
+#endif
 }
 
 void KWindowInfo::permanent( const QString &text, const QPixmap &pix )
@@ -115,11 +116,14 @@ void KWindowInfo::display( const QString
 
     win->setCaption( text );
     win->setIcon( icon );
+#ifdef Q_WS_X11
     KWin::setIcons( win->winId(), icon, icon );
+#endif
 }
 
 void KWindowInfo::save()
 {
+#ifdef Q_WS_X11
     if ( !oldText.isNull() )
 	return;
 
@@ -143,6 +147,7 @@ void KWindowInfo::save()
 	else
 	    oldIcon.resize( 0, 0 );
     }
+#endif
 }
 
 void KWindowInfo::restore()
@@ -156,7 +161,9 @@ void KWindowInfo::restore()
     }
 
     win->setIcon( oldIcon );
+#ifdef Q_WS_X11
     KWin::setIcons( win->winId(), oldIcon, oldMiniIcon );
+#endif
     win->setCaption( oldText );
     oldText = QString::null;
 
Index: kdeui/kwindowlistmenu.cpp
===================================================================
RCS file: /home/kde/kdelibs/kdeui/kwindowlistmenu.cpp,v
retrieving revision 1.14
diff -d -u -p -r1.14 kwindowlistmenu.cpp
--- kdeui/kwindowlistmenu.cpp	18 Feb 2003 03:19:49 -0000	1.14
+++ kdeui/kwindowlistmenu.cpp	5 Mar 2003 05:57:55 -0000
@@ -28,7 +28,7 @@ CONNECTION WITH THE SOFTWARE OR THE USE 
 #include <kwinmodule.h>
 #include <klocale.h>
 #include <kstringhandler.h>
-#ifndef Q_WS_QWS //FIXME
+#ifdef Q_WS_X11 //FIXME
 #include <netwm.h>
 #endif
 #include <kapplication.h>
@@ -51,7 +51,7 @@ private:
 
 int NameSortedInfoList::compareItems( QPtrCollection::Item s1, QPtrCollection::Item s2 )
 {
-#ifndef Q_WS_QWS //FIXME
+#ifdef Q_WS_X11 //FIXME
     KWin::Info *i1 = static_cast<KWin::Info *>(s1);
     KWin::Info *i2 = static_cast<KWin::Info *>(s2);
     QString title1, title2;
@@ -60,14 +60,19 @@ int NameSortedInfoList::compareItems( QP
     if (i2)
         title2 = i2->visibleNameWithState().lower();
     return title1.compare(title2);
+#else
+    //FIXME: Implement (QWS & MAC) 
 #endif
+    return 0;
 }
 
 KWindowListMenu::KWindowListMenu(QWidget *parent, const char *name)
   : KPopupMenu(parent, name)
 {
-#ifndef Q_WS_QWS //FIXME
+#ifdef Q_WS_X11
     kwin_module = new KWinModule(this);
+#else
+    //FIXME: Implement (QWS & MAC) 
 #endif
 
     connect(this, SIGNAL(activated(int)), SLOT(slotExec(int)));
@@ -83,7 +88,7 @@ void KWindowListMenu::init()
     int i, d;
     i = 0;
 
-#ifndef Q_WS_QWS //FIXME
+#ifdef Q_WS_X11
     int nd = kwin_module->numberOfDesktops();
     int cd = kwin_module->currentDesktop();
     WId active_window = kwin_module->activeWindow();
@@ -137,17 +142,21 @@ void KWindowListMenu::init()
         if (d < nd)
             insertSeparator();
     }
+#else
+    //FIXME: Implement (QWS & MAC) 
 #endif
     adjustSize();
 }
 
 void KWindowListMenu::slotExec(int id)
 {
-#ifndef Q_WS_QWS //FIXME
+#ifdef Q_WS_X11
     if (id > 1000)
         KWin::setCurrentDesktop(id - 1000);
     else if ( id >= 0 )
 	KWin::setActiveWindow(map[id]);
+#else
+    //FIXME: Implement (QWS & MAC) 
 #endif
 }
 
Index: kdeui/qxembed.h
===================================================================
RCS file: /home/kde/kdelibs/kdeui/qxembed.h,v
retrieving revision 1.15
diff -d -u -p -r1.15 qxembed.h
--- kdeui/qxembed.h	22 Feb 2003 02:35:10 -0000	1.15
+++ kdeui/qxembed.h	5 Mar 2003 05:57:56 -0000
@@ -24,7 +24,7 @@
 
 #include <qwidget.h>
 
-#ifndef Q_WS_QWS
+#if !defined( Q_WS_QWS ) && !defined( Q_WS_MAC )
 
 /*
   Documentation for this class is in the cpp-file!
Index: khtml/ecma/kjs_window.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/ecma/kjs_window.cpp,v
retrieving revision 1.327
diff -d -u -p -r1.327 kjs_window.cpp
--- khtml/ecma/kjs_window.cpp	27 Feb 2003 22:42:51 -0000	1.327
+++ khtml/ecma/kjs_window.cpp	5 Mar 2003 05:58:10 -0000
@@ -130,7 +130,9 @@ Value Screen::get(ExecState *exec, const
 
 Value Screen::getValueProperty(ExecState *exec, int token) const
 {
+#ifdef Q_WS_X11
   KWinModule info;
+#endif
   QWidget *thisWidget = Window::retrieveActive(exec)->part()->view();
   QRect sg = KGlobalSettings::desktopGeometry(thisWidget);
 
@@ -145,20 +147,36 @@ Value Screen::getValueProperty(ExecState
     return Number(m.depth());
   }
   case AvailLeft: {
+#ifdef Q_WS_X11
     QRect clipped = info.workArea().intersect(sg);
     return Number(clipped.x()-sg.x());
+#else
+    return Number(sg.x());
+#endif
   }
   case AvailTop: {
+#ifdef Q_WS_X11
     QRect clipped = info.workArea().intersect(sg);
     return Number(clipped.y()-sg.y());
+#else
+    return Number(sg.y());
+#endif
   }
   case AvailHeight: {
+#ifdef Q_WS_X11
     QRect clipped = info.workArea().intersect(sg);
     return Number(clipped.height());
+#else
+    return Number(sg.height());
+#endif
   }
   case AvailWidth: {
+#ifdef Q_WS_X11
     QRect clipped = info.workArea().intersect(sg);
     return Number(clipped.width());
+#else
+    return Number(sg.width());
+#endif
   }
   default:
     kdWarning(6070) << "Screen::getValueProperty unhandled token " << token << endl;
@@ -522,9 +540,15 @@ Value Window::get(ExecState *exec, const
     {
       if (!m_part->widget())
         return Number(0);
+#ifdef Q_WS_X11
       KWin::Info inf = KWin::info(m_part->widget()->topLevelWidget()->winId());
       return Number(entry->value == OuterHeight ?
                     inf.geometry.height() : inf.geometry.width());
+#else
+      return Number(entry->value == OuterHeight ?
+                    m_part->widget()->topLevelWidget()->height() : 
+                    m_part->widget()->topLevelWidget()->width());
+#endif
     }
     case PageXOffset:
       return Number(m_part->view()->contentsX());
Index: khtml/java/javaembed.h
===================================================================
RCS file: /home/kde/kdelibs/khtml/java/javaembed.h,v
retrieving revision 1.9
diff -d -u -p -r1.9 javaembed.h
--- khtml/java/javaembed.h	17 Jun 2002 22:09:50 -0000	1.9
+++ khtml/java/javaembed.h	5 Mar 2003 05:58:10 -0000
@@ -28,7 +28,7 @@
 
 #include <qwidget.h>
 
-#ifndef Q_WS_QWS // FIXME(E)? I don't think this is possible with Qt Embedded.
+#ifdef Q_WS_X11
 class KJavaEmbedPrivate;
 class KJavaEmbed : public QWidget
 {
@@ -72,6 +72,7 @@ private:
     void sendSyntheticConfigureNotifyEvent();
 };
 
-
+#else
+// FIXME: Implement in QWS & MAC
 #endif
 #endif
Index: khtml/java/kjavaappletwidget.cpp
===================================================================
RCS file: /home/kde/kdelibs/khtml/java/kjavaappletwidget.cpp,v
retrieving revision 1.53
diff -d -u -p -r1.53 kjavaappletwidget.cpp
--- khtml/java/kjavaappletwidget.cpp	27 Feb 2003 18:15:43 -0000	1.53
+++ khtml/java/kjavaappletwidget.cpp	5 Mar 2003 05:58:10 -0000
@@ -28,7 +28,6 @@
 
 #include <qlabel.h>
 
-
 // For future expansion
 class KJavaAppletWidgetPrivate
 {
@@ -43,11 +42,15 @@ KJavaAppletWidget::KJavaAppletWidget( KJ
                                       QWidget* parent, const char* name )
    : QXEmbed ( parent, name)
 {
+#ifdef Q_WS_X11
     setProtocol(QXEmbed::XPLAIN);
+#endif
 
     m_applet = new KJavaApplet( this, context );
     d        = new KJavaAppletWidgetPrivate;
+#ifdef Q_WS_X11
     m_kwm    = new KWinModule( this );
+#endif
 
     d->tmplabel = new QLabel( this );
     d->tmplabel->setText( KJavaAppletServer::getAppletLabel() );
@@ -67,10 +70,12 @@ KJavaAppletWidget::~KJavaAppletWidget()
 
 void KJavaAppletWidget::showApplet()
 {
+#ifdef Q_WS_X11
     connect( m_kwm, SIGNAL( windowAdded( WId ) ),
 	         this,  SLOT( setWindow( WId ) ) );
 
     m_kwm->doNotManage( m_swallowTitle );
+#endif
 
     //Now we send applet info to the applet server
     if ( !m_applet->isCreated() )
@@ -79,6 +84,7 @@ void KJavaAppletWidget::showApplet()
 
 void KJavaAppletWidget::setWindow( WId w )
 {
+#ifdef Q_WS_X11
     //make sure that this window has the right name, if so, embed it...
     KWin::Info w_info = KWin::info( w );
     if ( m_swallowTitle == w_info.name ||
@@ -97,6 +103,7 @@ void KJavaAppletWidget::setWindow( WId w
         embed( w );
         setFocus();
     }
+#endif
 }
 
 QSize KJavaAppletWidget::sizeHint() const
Index: khtml/java/kjavaappletwidget.h
===================================================================
RCS file: /home/kde/kdelibs/khtml/java/kjavaappletwidget.h,v
retrieving revision 1.34
diff -d -u -p -r1.34 kjavaappletwidget.h
--- khtml/java/kjavaappletwidget.h	27 Feb 2003 18:15:43 -0000	1.34
+++ khtml/java/kjavaappletwidget.h	5 Mar 2003 05:58:10 -0000
@@ -25,10 +25,12 @@
 #define KJAVAAPPLETWIDGET_H
 
 #include <qwidget.h>
-#ifndef Q_WS_QWS //FIXME(?) I don't think this is possible with Qt Embedded
+#ifndef Q_WS_QWS
 #include "java/kjavaappletcontext.h"
 #include "java/kjavaapplet.h"
-#include <qxembed.h>
+#ifdef Q_WS_X11
+# include <qxembed.h>
+#endif
 #include <kwinmodule.h>
 
 /**
@@ -75,6 +77,10 @@
 
 class KJavaAppletWidgetPrivate;
 
+#ifndef Q_WS_X11
+# define QXEmbed QWidget
+#endif
+
 class KJavaAppletWidget : public QXEmbed
 {
     Q_OBJECT
@@ -115,11 +121,15 @@ private:
     KJavaAppletWidgetPrivate* d;
 
     KJavaApplet* m_applet;
+#ifdef Q_WS_X11
     KWinModule*  m_kwm;
+#endif
     QString      m_swallowTitle;
 
 };
 
+#else
+// FIXME: Implement in QWS
 #endif
 #endif // KJAVAAPPLETWIDGET_H
 
Index: kinit/kinit.cpp
===================================================================
RCS file: /home/kde/kdelibs/kinit/kinit.cpp,v
retrieving revision 1.116
diff -d -u -p -r1.116 kinit.cpp
--- kinit/kinit.cpp	25 Feb 2003 08:40:39 -0000	1.116
+++ kinit/kinit.cpp	5 Mar 2003 05:58:13 -0000
@@ -37,7 +37,9 @@
 
 #include <errno.h>
 #include <fcntl.h>
-#include <setproctitle.h>
+#ifndef Q_WS_MAC
+# include <setproctitle.h>
+#endif
 #include <signal.h>
 #include <stdio.h>
 #include <stdlib.h>
@@ -105,6 +107,8 @@ static Atom net_current_desktop;
 #define DISPLAY "DISPLAY"
 #elif defined(Q_WS_QWS)
 #define DISPLAY "QWS_DISPLAY"
+#elif defined(Q_WS_MAC)
+//we don't use DISPLAY on Qt/Mac !! --Sam
 #else
 #error Use QT/X11 or QT/Embedded
 #endif
@@ -190,8 +194,10 @@ static void close_fds()
    }
 #endif
 
+#ifndef Q_WS_MAC
    signal(SIGCHLD, SIG_DFL);
    signal(SIGPIPE, SIG_DFL);
+#endif
 }
 
 static void exitWithErrorMsg(const QString &errorMsg)
@@ -401,7 +407,11 @@ static pid_t launch(int argc, const char
 #endif
 
   d.errorMsg = 0;
+#ifdef Q_WS_MAC
   d.fork = fork();
+#else
+  d.fork = vfork();
+#endif
   switch(d.fork) {
   case -1:
      perror("kdeinit: fork() failed!\n");
@@ -474,8 +484,10 @@ static pid_t launch(int argc, const char
        }
        d.argv[argc] = 0;
 
+#ifndef Q_WS_MACX
        /** Give the process a new name **/
        kdeinit_setproctitle( "%s", procTitle.data() );
+#endif
      }
 
      d.handle = 0;
@@ -868,6 +880,11 @@ static int read_socket(int sock, char *b
 
 static void WaitPid( pid_t waitForPid)
 {
+#ifdef QT_MAC
+    /* right now I need this because apps don't run with fork mode on right now!! I will
+       remove this when I fix that! */
+    return;
+#endif
   int result;
   while(1)
   {
@@ -1003,23 +1020,31 @@ static void handle_launcher_request(int 
      }
 
       // support for the old a bit broken way of setting DISPLAY for multihead
+#ifndef Q_WS_MAC
       QCString olddisplay = getenv(DISPLAY);
+#else
+      QCString olddisplay = "0";
+#endif
       QCString kdedisplay = getenv("KDE_DISPLAY");
       bool reset_display = (! olddisplay.isEmpty() &&
                             ! kdedisplay.isEmpty() &&
                             olddisplay != kdedisplay);
 
+#ifndef Q_WS_MAC
       if (reset_display)
           setenv(DISPLAY, kdedisplay, true);
+#endif
 
       pid = launch( argc, name, args, cwd, envc, envs,
           request_header.cmd == LAUNCHER_SHELL || request_header.cmd == LAUNCHER_KWRAPPER,
           tty, avoid_loops, startup_id_str );
 
+#ifndef Q_WS_MAC
       if (reset_display) {
           unsetenv("KDE_DISPLAY");
           setenv(DISPLAY, olddisplay, true);
       }
+#endif
 
       if (pid && (d.result == 0))
       {
@@ -1204,8 +1229,13 @@ static void kdeinit_library_path()
 {
    QStringList ltdl_library_path =
      QStringList::split(':', QFile::decodeName(getenv("LTDL_LIBRARY_PATH")));
+#ifndef Q_WS_MAC
    QStringList ld_library_path =
      QStringList::split(':', QFile::decodeName(getenv("LD_LIBRARY_PATH")));
+#else
+   QStringList ld_library_path =
+     QStringList::split(':', QFile::decodeName(getenv("DYLD_LIBRARY_PATH")));
+#endif
 
    QCString extra_path;
    QStringList candidates = s_instance->dirs()->resourceDirs("lib");
@@ -1247,6 +1277,7 @@ static void kdeinit_library_path()
    if (!extra_path.isEmpty())
       lt_dlsetsearchpath(extra_path.data());
 
+#ifndef Q_WS_MAC
    QCString display = getenv(DISPLAY);
    if (display.isEmpty())
    {
@@ -1256,6 +1287,9 @@ static void kdeinit_library_path()
    int i;
    if((i = display.findRev('.')) > display.findRev(':') && i >= 0)
      display.truncate(i);
+#else
+   const char *display = "0";
+#endif
 
    QCString socketName = QFile::encodeName(locateLocal("socket", QString("kdeinit-%1").arg(display), s_instance));
    if (socketName.length() >= MAX_SOCK_FILE)
@@ -1426,11 +1460,15 @@ int main(int argc, char **argv, char **e
    KGlobal::_instance = 0L;
 
    /** Prepare to change process name **/
+#ifndef Q_WS_MAC
    kdeinit_initsetproctitle(argc, argv, envp);
    kdeinit_setproctitle("Starting up...");
+#endif
    kdeinit_library_path();
+#ifndef Q_WS_APPLE
    // don't change envvars before kdeinit_initsetproctitle()
    unsetenv("LD_BIND_NOW");
+#endif
    if (!suicide)
       setenv("KDE_FULL_SESSION", "true", true);
    KApplication::loadedByKdeinit = true;
@@ -1528,7 +1566,9 @@ int main(int argc, char **argv, char **e
    }
    free (safe_argv);
 
+#ifndef Q_WS_MAC
    kdeinit_setproctitle("Running...");
+#endif
 
    if (!keep_running)
       return 0;
Index: kinit/klauncher.cpp
===================================================================
RCS file: /home/kde/kdelibs/kinit/klauncher.cpp,v
retrieving revision 1.85
diff -d -u -p -r1.85 klauncher.cpp
--- kinit/klauncher.cpp	20 Feb 2003 15:35:09 -0000	1.85
+++ kinit/klauncher.cpp	5 Mar 2003 05:58:15 -0000
@@ -742,9 +742,13 @@ KLauncher::requestStart(KLaunchRequest *
       length += (*it).length() + 1; // Envs...
    }
    length += sizeof( long ); // avoid_loops
+#ifdef Q_WS_X11 
    bool startup_notify = !request->startup_id.isNull() && request->startup_id != "0";
    if( startup_notify )
        length += request->startup_id.length() + 1;
+#else
+   bool startup_notify = FALSE;
+#endif
        
    requestData.resize( length );
 
@@ -774,11 +778,13 @@ KLauncher::requestStart(KLaunchRequest *
    l = 0; // avoid_loops, always false here
    memcpy(p, &l, sizeof(long));
    p += sizeof(long);
+#ifdef Q_WS_X11 
    if( startup_notify )
    {
        strcpy(p, request->startup_id.data());
        p += strlen( p ) + 1;
    }
+#endif
    request_header.cmd = startup_notify ? LAUNCHER_EXT_EXEC : LAUNCHER_EXEC_NEW;
    request_header.arg_length = length;
    write(kdeinitSocket, &request_header, sizeof(request_header));
@@ -1087,7 +1093,9 @@ KLauncher::kdeinit_exec(const QString &a
       request->dcop_service_type = KService::DCOP_None;
    request->dcop_name = 0;
    request->pid = 0;
+#ifdef Q_WS_X11 
    request->startup_id = "0";
+#endif
    request->envs = envs;
    request->transaction = dcopClient()->beginTransaction();
    queueRequest(request);
@@ -1224,7 +1232,9 @@ KLauncher::requestSlave(const QString &p
     request->dcop_name = 0;
     request->dcop_service_type = KService::DCOP_None;
     request->pid = 0;
+#ifdef Q_WS_X11 
     request->startup_id = "0";
+#endif
     request->status = KLaunchRequest::Launching;
     request->transaction = 0; // No confirmation is send
     requestStart(request);
Index: kinit/klauncher_main.cpp
===================================================================
RCS file: /home/kde/kdelibs/kinit/klauncher_main.cpp,v
retrieving revision 1.30
diff -d -u -p -r1.30 klauncher_main.cpp
--- kinit/klauncher_main.cpp	6 Jan 2003 20:11:19 -0000	1.30
+++ kinit/klauncher_main.cpp	5 Mar 2003 05:58:15 -0000
@@ -83,6 +83,7 @@ start_launcher(int socket)
    signal( SIGPIPE, SIG_IGN);
    signal( SIGTERM, sig_handler);
 
+   
    launcher->exec();
    return 0;
 }
Index: kio/kio/kprotocolmanager.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kio/kprotocolmanager.cpp,v
retrieving revision 1.126
diff -d -u -p -r1.126 kprotocolmanager.cpp
--- kio/kio/kprotocolmanager.cpp	28 Feb 2003 21:40:01 -0000	1.126
+++ kio/kio/kprotocolmanager.cpp	5 Mar 2003 05:58:16 -0000
@@ -428,7 +428,17 @@ QString KProtocolManager::defaultUserAge
     }
     if( modifiers.contains('p') )
     {
-      supp += QString::fromLatin1("; X11");  // TODO: determine this valye instead of hardcoding...
+#ifdef Q_WS_X11
+      supp += QString::fromLatin1("; X11");
+#elif defined(Q_WS_MACX)
+      supp += QString::fromLatin1("; Mac OS X");
+#elif defined(Q_WS_QWS)
+      supp += QString::fromLatin1("; Embedded");
+#elif defined(Q_WS_WIN)
+      supp += QString::fromLatin1("; Windows");
+#else
+      supp += QString::fromLatin1("; Unknown");
+#endif
     }
     if( modifiers.contains('m') )
     {
Index: kio/kio/kzip.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kio/kzip.cpp,v
retrieving revision 1.30
diff -d -u -p -r1.30 kzip.cpp
--- kio/kio/kzip.cpp	28 Feb 2003 21:40:01 -0000	1.30
+++ kio/kio/kzip.cpp	5 Mar 2003 05:58:18 -0000
@@ -38,6 +38,9 @@
 */
 
 #include <sys/time.h>
+#ifdef HAVE_ALLOC_H
+# include <alloca.h>
+#endif
 #include <stdlib.h>
 
 #include <qasciidict.h>
Index: kio/kio/renamedlg.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kio/renamedlg.cpp,v
retrieving revision 1.61
diff -d -u -p -r1.61 renamedlg.cpp
--- kio/kio/renamedlg.cpp	25 Feb 2003 13:41:11 -0000	1.61
+++ kio/kio/renamedlg.cpp	5 Mar 2003 05:58:19 -0000
@@ -93,9 +93,11 @@ RenameDlg::RenameDlg(QWidget *parent, co
     // Set "StaysOnTop", because this dialog is typically used in kio_uiserver,
     // i.e. in a separate process.
     // ####### This isn't the case anymore - remove?
-#ifndef Q_WS_QWS //FIXME(E): Implement for QT Embedded
+#ifdef Q_WS_X11 
     if (d->modal)
         KWin::setState( winId(), NET::StaysOnTop );
+#else
+    //FIXME(E): Implement for QWS & MAC
 #endif
 
     d->src = _src;
Index: kio/kio/skipdlg.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kio/skipdlg.cpp,v
retrieving revision 1.22
diff -d -u -p -r1.22 skipdlg.cpp
--- kio/kio/skipdlg.cpp	25 Sep 2001 12:04:11 -0000	1.22
+++ kio/kio/skipdlg.cpp	5 Mar 2003 05:58:19 -0000
@@ -42,9 +42,11 @@ SkipDlg::SkipDlg(QWidget *parent, bool _
 
   // Set "StaysOnTop", because this dialog is typically used in kio_uiserver,
   // i.e. in a separate process.
-#ifndef Q_WS_QWS //FIXME(E): Implement for QT Embedded
+#ifdef Q_WS_X11
   if (modal)
     KWin::setState( winId(), NET::StaysOnTop );
+#else
+  //FIXME(E): Implement for QWS & MAC
 #endif
 
   b0 = b1 = b2 = 0L;
Index: kio/kpasswdserver/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kio/kpasswdserver/Makefile.am,v
retrieving revision 1.2
diff -d -u -p -r1.2 Makefile.am
--- kio/kpasswdserver/Makefile.am	12 Sep 2002 01:28:33 -0000	1.2
+++ kio/kpasswdserver/Makefile.am	5 Mar 2003 05:58:20 -0000
@@ -10,4 +10,4 @@ kde_module_LTLIBRARIES = kded_kpasswdser
 kded_kpasswdserver_la_SOURCES = kpasswdserver.cpp kpasswdserver.skel 
 kded_kpasswdserver_la_METASOURCES = AUTO
 kded_kpasswdserver_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kded_kpasswdserver_la_LIBADD = $(LIB_KIO)
+kded_kpasswdserver_la_LIBADD = $(LIB_KIO) $(top_builddir)/kded/kded.la
Index: kio/kpasswdserver/kpasswdserver.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/kpasswdserver/kpasswdserver.cpp,v
retrieving revision 1.6
diff -d -u -p -r1.6 kpasswdserver.cpp
--- kio/kpasswdserver/kpasswdserver.cpp	26 Jan 2003 13:30:13 -0000	1.6
+++ kio/kpasswdserver/kpasswdserver.cpp	5 Mar 2003 05:58:20 -0000
@@ -217,7 +217,9 @@ KPasswdServer::processRequest()
             if (info.readOnly)
                dlg.setUserReadOnly( true );
               
+#ifdef Q_WS_X11
             XSetTransientForHint( qt_xdisplay(), dlg.winId(), request->windowId);
+#endif
             
             dlgResult = dlg.exec();
             
Index: kio/misc/uiserver.cpp
===================================================================
RCS file: /home/kde/kdelibs/kio/misc/uiserver.cpp,v
retrieving revision 1.95
diff -d -u -p -r1.95 uiserver.cpp
--- kio/misc/uiserver.cpp	21 Feb 2003 11:10:25 -0000	1.95
+++ kio/misc/uiserver.cpp	5 Mar 2003 05:58:22 -0000
@@ -985,8 +985,10 @@ void UIServer::killJob( QCString observe
 
 
 void UIServer::closeEvent( QCloseEvent * e){
-#ifndef Q_WS_QWS //FIXME(E): Implement for QT Embedded
+#ifdef Q_WS_X11
    KWin::iconifyWindow(winId());
+#else
+   //FIXME(E): Implement for QWS & MAC
 #endif
    e->accept();
 }
Index: kio/misc/kpac/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kio/misc/kpac/Makefile.am,v
retrieving revision 1.10
diff -d -u -p -r1.10 Makefile.am
--- kio/misc/kpac/Makefile.am	20 Jan 2003 12:55:24 -0000	1.10
+++ kio/misc/kpac/Makefile.am	5 Mar 2003 05:58:22 -0000
@@ -10,7 +10,7 @@ KDE_CXXFLAGS = $(USE_EXCEPTIONS)
 kded_proxyscout_la_SOURCES = proxyscout.skel proxyscout.cpp script.cpp \
                              downloader.cpp discovery.cpp
 kded_proxyscout_la_LDFLAGS = $(all_libraries) -module -avoid_version
-kded_proxyscout_la_LIBADD = $(LIB_KIO) $(top_builddir)/kjs/libkjs.la
+kded_proxyscout_la_LIBADD = $(LIB_KIO) $(top_builddir)/kjs/libkjs.la $(top_builddir)/kded/kded.la
 
 kpac_dhcp_helper_SOURCES = kpac_dhcp_helper.c
 kpac_dhcp_helper_LDADD = $(LIBSOCKET)
Index: kio/misc/kpac/kpac_dhcp_helper.c
===================================================================
RCS file: /home/kde/kdelibs/kio/misc/kpac/kpac_dhcp_helper.c,v
retrieving revision 1.8
diff -d -u -p -r1.8 kpac_dhcp_helper.c
--- kio/misc/kpac/kpac_dhcp_helper.c	20 Apr 2002 13:42:02 -0000	1.8
+++ kio/misc/kpac/kpac_dhcp_helper.c	5 Mar 2003 05:58:23 -0000
@@ -19,6 +19,7 @@
 /* $Id: kpac_dhcp_helper.c,v 1.8 2002/04/20 13:42:02 hausmann Exp $ */
 
 #include <config.h>
+#include <sys/types.h>
 #include <grp.h>
 
 #include <unistd.h>
Index: kio/misc/kssld/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kio/misc/kssld/Makefile.am,v
retrieving revision 1.10
diff -d -u -p -r1.10 Makefile.am
--- kio/misc/kssld/Makefile.am	10 Dec 2002 09:45:40 -0000	1.10
+++ kio/misc/kssld/Makefile.am	5 Mar 2003 05:58:23 -0000
@@ -21,7 +21,7 @@ INCLUDES= -I$(srcdir)/.. -I$(top_srcdir)
 kde_module_LTLIBRARIES = kded_kssld.la
 
 kded_kssld_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kded_kssld_la_LIBADD = $(LIB_KIO)
+kded_kssld_la_LIBADD = $(LIB_KIO) $(top_builddir)/kded/kded.la
 kded_kssld_la_SOURCES = kssld.cpp kssld.skel
 
 METASOURCES = AUTO
Index: kioslave/http/kcookiejar/Makefile.am
===================================================================
RCS file: /home/kde/kdelibs/kioslave/http/kcookiejar/Makefile.am,v
retrieving revision 1.19
diff -d -u -p -r1.19 Makefile.am
--- kioslave/http/kcookiejar/Makefile.am	13 Sep 2002 15:41:55 -0000	1.19
+++ kioslave/http/kcookiejar/Makefile.am	5 Mar 2003 05:58:23 -0000
@@ -17,7 +17,7 @@ kcookiejar_la_LIBADD = $(LIB_KDECORE)
 kded_kcookiejar_la_SOURCES = kcookiejar.cpp kcookieserver.cpp \
 			kcookieserver.skel kcookiewin.cpp 
 kded_kcookiejar_la_LDFLAGS = $(all_libraries) -module -avoid-version
-kded_kcookiejar_la_LIBADD = $(LIB_KIO)
+kded_kcookiejar_la_LIBADD = $(LIB_KIO) $(top_builddir)/kded/kded.la
 
 kcookiejar_SOURCES = dummy.cpp
 kcookiejar_LDADD = kcookiejar.la
Index: kioslave/http/kcookiejar/kcookiewin.cpp
===================================================================
RCS file: /home/kde/kdelibs/kioslave/http/kcookiejar/kcookiewin.cpp,v
retrieving revision 1.46
diff -d -u -p -r1.46 kcookiewin.cpp
--- kioslave/http/kcookiejar/kcookiewin.cpp	21 Feb 2003 17:37:48 -0000	1.46
+++ kioslave/http/kcookiejar/kcookiewin.cpp	5 Mar 2003 05:58:24 -0000
@@ -72,11 +72,13 @@ KCookieWin::KCookieWin( QWidget *parent,
                         int defaultButton, bool showDetails )
            :KDialog( parent, "cookiealert", true )
 {
-#ifndef Q_WS_QWS //FIXME(E): Implement for Qt Embedded
+#ifdef Q_WS_X11
     KWin::setState( winId(), NET::StaysOnTop );
     KWin::setOnDesktop(winId(), KWin::currentDesktop());
     setCaption( i18n("Cookie Alert") );
     setIcon( SmallIcon("cookie") );
+#else
+    //FIXME(E): Implement for QWS & MAC
 #endif
     // Main widget's layout manager...
     QVBoxLayout* vlayout = new QVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );
Index: libkscreensaver/main.cpp
===================================================================
RCS file: /home/kde/kdelibs/libkscreensaver/main.cpp,v
retrieving revision 1.11
diff -d -u -p -r1.11 main.cpp
--- libkscreensaver/main.cpp	2 Dec 2002 11:41:18 -0000	1.11
+++ libkscreensaver/main.cpp	5 Mar 2003 05:58:26 -0000
@@ -87,7 +87,7 @@ protected:
 
 
 //----------------------------------------------------------------------------
-#ifdef Q_WS_QWS
+#if defined( Q_WS_QWS ) || defined( Q_WS_MAC )
 typedef WId Window;
 #endif
 
Index: libltdl/ltdl.m4
===================================================================
RCS file: /home/kde/kdelibs/libltdl/ltdl.m4,v
retrieving revision 1.8
diff -d -u -p -r1.8 ltdl.m4
--- libltdl/ltdl.m4	22 May 2002 15:37:48 -0000	1.8
+++ libltdl/ltdl.m4	5 Mar 2003 05:58:27 -0000
@@ -100,6 +100,9 @@ AC_CACHE_CHECK([whether deplibs are load
 	hpux*|irix*)
 	  libltdl_cv_sys_dlopen_deplibs=yes
 	  ;;
+	darwin* | rhapsody*)
+	  libltdl_cv_sys_dlopen_deplibs=yes
+	  ;;
 	osf*)
 	  libltdl_cv_sys_dlopen_deplibs=yes
 	  ;;
