[ooo-build-commit] 8 commits - bin/create-gitignores.sh configure.in download.in patches/dev300

Jan Holesovsky kendy at kemper.freedesktop.org
Fri Jun 12 08:14:23 PDT 2009


 bin/create-gitignores.sh                       |    2 
 configure.in                                   |   23 
 download.in                                    |    2 
 patches/dev300/apply                           |   28 
 patches/dev300/kde4-buildfix-connectivity.diff |   21 
 patches/dev300/kde4-configure.diff             |  255 ++-
 patches/dev300/kde4-fpicker-prj.diff           |   25 
 patches/dev300/kde4-fpicker-source.diff        | 1190 +++++++++++++++
 patches/dev300/kde4-plugin-detection.diff      |    2 
 patches/dev300/kde4-scp2.diff                  |  136 +
 patches/dev300/kde4-shell-prj.diff             |   12 
 patches/dev300/kde4-shell-source.diff          | 1586 ++++++++++++++++++++
 patches/dev300/kde4-vcl-prj.diff               |   34 
 patches/dev300/kde4-vcl.diff                   | 1933 +++++++++++++++++++++++++
 14 files changed, 5175 insertions(+), 74 deletions(-)

New commits:
commit 6718a925f8211ac5e8eaa708ee60598c87f2c75e
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Jun 12 17:05:45 2009 +0200

    Fix installation of the KDE4 pieces.
    
    The KDE4 stuff is now separated from KDE3, so we can move it from
    [Experimental] to [LinuxCommon] section.
    
    * patches/dev300/apply: Enable KDE4 in [LinuxCommon].
    * patches/dev300/kde4-configure.diff: Fix typo.
    * patches/dev300/kde4-fpicker-prj.diff: Fix registration stuff.
    * patches/dev300/kde4-fpicker-source.diff: Fix registration stuff.
    * patches/dev300/kde4-scp2.diff: Fix installation bits.
    * patches/dev300/kde4-buildfix-connectivity.diff: Fix KDE3 build in
      connectivity after the recent changes.

diff --git a/patches/dev300/apply b/patches/dev300/apply
index 61afc48..9898fee 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -24,7 +24,7 @@ Common : PreprocessPatches, BuildBits, TemporaryHacks, FixesNotForUpstream, \
 LinuxCommon : Common, Defaults, TangoIcons, FontConfigTemporaryHacks, \
 	      FedoraLinuxOnlyFixes, LinuxOnly, SystemBits, \
 	      msaccess, OpenGLTransitions, \
-	      Fpickers, Mono, AddressBooks, QuickStarter
+	      Fpickers, Mono, AddressBooks, QuickStarter, KDE4
 MacOSXCommon : Common, Defaults, TangoIcons, SystemBits
 Win32Common : Common, Defaults, TangoIcons, \
 	      Win32Only, NotDebian
@@ -33,7 +33,7 @@ Experimental: VBAUntested, ArkOnlyExperimental, \
 	      UnUsedButNotYetRemovedFromSVN, WebDAVUpstream, \
 	      PostgreSQL, SELinux, VOSremoval, Glib2, \
 	      UnitBootstrap, RadioButtons, UnstableLibwpd, WWInProgress, \
-	      KDE4, MinGW, CalcExperimental, Mono24
+	      MinGW, CalcExperimental, Mono24
 DebianLooseSections: DebianBaseNoHelpContent
 # Optional sections
 Optional : DejaVuFonts, NovellOnlyExtensionFixes, Win32OnlyExtensionFixes, Linux32OnlyExtensionFixes
@@ -2761,7 +2761,7 @@ SectionIssue => i#90618
 
 # KDE4 support by Eric Bischoff, Bernhard Rosenkraenzer and Roman Shtylman
 kde4-configure.diff
-kde4-plugin-detection.diff
+kde4-buildfix-connectivity.diff
 
 kde4-shell-prj.diff
 kde4-shell-source.diff
@@ -2771,6 +2771,7 @@ kde4-fpicker-source.diff
 
 kde4-scp2.diff
 
+kde4-plugin-detection.diff
 kde4-vcl-prj.diff
 kde4-vcl.diff
 
diff --git a/patches/dev300/kde4-buildfix-connectivity.diff b/patches/dev300/kde4-buildfix-connectivity.diff
new file mode 100644
index 0000000..bd008d4
--- /dev/null
+++ b/patches/dev300/kde4-buildfix-connectivity.diff
@@ -0,0 +1,21 @@
+diff --git connectivity/source/drivers/kab/makefile.mk connectivity/source/drivers/kab/makefile.mk
+index 87228f8..6705917 100644
+--- connectivity/source/drivers/kab/makefile.mk
++++ connectivity/source/drivers/kab/makefile.mk
+@@ -109,14 +109,14 @@ SHL2VERSIONMAP=$(TARGET2).map
+ 
+ SHL2TARGET= $(TARGET2)$(KAB_MAJOR)
+ SHL2OBJS=$(SLO2FILES)
++SHL2LINKFLAGS+=$(KAB_LIB)
+ SHL2STDLIBS=\
+     $(CPPULIB)                  \
+     $(CPPUHELPERLIB)            \
+     $(VOSLIB)                   \
+     $(SALLIB)                   \
+     $(DBTOOLSLIB)               \
+-    $(COMPHELPERLIB)            \
+-    $(KAB_LIB)
++    $(COMPHELPERLIB)
+ 
+ SHL2DEPN=
+ SHL2IMPLIB= i$(TARGET2)
diff --git a/patches/dev300/kde4-configure.diff b/patches/dev300/kde4-configure.diff
index de9ae40..5c628f7 100644
--- a/patches/dev300/kde4-configure.diff
+++ b/patches/dev300/kde4-configure.diff
@@ -169,7 +169,7 @@ index d2d8406..3a878bb 100644
 +   fi
 +
 +   dnl Check for KDE4 libraries
-+   AC_MSG_CHECKING([for KDE libraries])
++   AC_MSG_CHECKING([for KDE4 libraries])
 +   kde_libdir="no"
 +   for kde_check in $kde_libdirs ; do
 +      if test -r "$kde_check/$kde_test_library" ; then
diff --git a/patches/dev300/kde4-fpicker-prj.diff b/patches/dev300/kde4-fpicker-prj.diff
index 4fb633f..34f6b4f 100644
--- a/patches/dev300/kde4-fpicker-prj.diff
+++ b/patches/dev300/kde4-fpicker-prj.diff
@@ -22,4 +22,4 @@ index 05ab72c..2a5db19 100644
  ..\source\unx\gnome\fps-gnome-ucd.txt %_DEST%\bin%_EXT%\fps-gnome-ucd.txt
  ..\source\aqua\fps-aqua-ucd.txt %_DEST%\bin%_EXT%\fps-aqua-ucd.txt
  ..\source\unx\kde_unx\fps-kde-ucd.txt %_DEST%\bin%_EXT%\fps-kde-ucd.txt
-+..\source\unx\kde4\fps-kde-ucd.txt %_DEST%\bin%_EXT%\fps-kde-ucd.txt
++..\source\unx\kde4\fps-kde4-ucd.txt %_DEST%\bin%_EXT%\fps-kde4-ucd.txt
diff --git a/patches/dev300/kde4-fpicker-source.diff b/patches/dev300/kde4-fpicker-source.diff
index 7c114e5..b46c327 100644
--- a/patches/dev300/kde4-fpicker-source.diff
+++ b/patches/dev300/kde4-fpicker-source.diff
@@ -980,11 +980,11 @@ index 0000000..8505ff8
 +}; 
 +
 +#endif // _UNXFILEPICKER_HXX_
-diff --git fpicker/source/unx/kde4/fps-kde-ucd.txt fpicker/source/unx/kde4/fps-kde-ucd.txt
+diff --git fpicker/source/unx/kde4/fps-kde4-ucd.txt fpicker/source/unx/kde4/fps-kde4-ucd.txt
 new file mode 100644
 index 0000000..28aa49d
 --- /dev/null
-+++ fpicker/source/unx/kde4/fps-kde-ucd.txt
++++ fpicker/source/unx/kde4/fps-kde4-ucd.txt
 @@ -0,0 +1,6 @@
 +[ComponentDescriptor]
 +ImplementationName=com.sun.star.ui.dialogs.KDE4UnxFilePicker
diff --git a/patches/dev300/kde4-scp2.diff b/patches/dev300/kde4-scp2.diff
index 23f5dfc..c0447ca 100644
--- a/patches/dev300/kde4-scp2.diff
+++ b/patches/dev300/kde4-scp2.diff
@@ -1,8 +1,77 @@
+diff --git scp2/source/kde/file_kde.scp scp2/source/kde/file_kde.scp
+index a6d6db4..9860f29 100644
+--- scp2/source/kde/file_kde.scp
++++ scp2/source/kde/file_kde.scp
+@@ -38,3 +38,12 @@ File gid_File_Lib_Kdebe
+     Regmergefile = "kdebe1-ucd.txt";
+ End
+ 
++File gid_File_Lib_Kde4be
++    TXT_FILE_BODY;
++    Styles = (PACKED);
++    Dir = gid_Dir_Program;
++    Name = STRING(CONCAT2(kde4be1.uno,UNXSUFFIX));
++    RegistryID = gid_Starregistry_Services_Rdb;
++    Regmergefile = "kde4be1-ucd.txt";
++End
++
+diff --git scp2/source/kde/makefile.mk scp2/source/kde/makefile.mk
+index 0cbf6a4..6ddb301 100644
+--- scp2/source/kde/makefile.mk
++++ scp2/source/kde/makefile.mk
+@@ -43,7 +43,16 @@ TARGETTYPE=CUI
+ 
+ SCP_PRODUCT_TYPE=osl
+ 
+-.IF "$(ENABLE_KDE)" == "TRUE"
++.IF "$(ENABLE_KDE)" == "TRUE" || "$(ENABLE_KDE4)" == "TRUE"
++
++.IF "$(ENABLE_KDE)" != ""
++SCPDEFS+=-DENABLE_KDE
++.ENDIF
++
++.IF "$(ENABLE_KDE4)" != ""
++SCPDEFS+=-DENABLE_KDE4
++.ENDIF
++
+ PARFILES =                   \
+         module_kde.par     \
+         file_kde.par
+diff --git scp2/source/kde/module_kde.scp scp2/source/kde/module_kde.scp
+index 1dce456..28dacbe 100644
+--- scp2/source/kde/module_kde.scp
++++ scp2/source/kde/module_kde.scp
+@@ -30,12 +30,24 @@
+ 
+ #include "macros.inc"
+ 
++#if defined( ENABLE_KDE ) || defined( ENABLE_KDE4 )
+ Module gid_Module_Optional_Kde
+     ParentID = gid_Module_Optional;
+     Default = YES;
+     PackageInfo = "packinfo_office.txt";
+     MOD_NAME_DESC(MODULE_OPTIONAL_KDE);
+     Styles = (DONTSHOWINUSERINSTALL);
+-    Files = (gid_File_Lib_Kdebe);
++    Files = (
++#ifdef ENABLE_KDE
++    gid_File_Lib_Kdebe
++#ifdef ENABLE_KDE4
++    ,
++#endif // ENABLE_KDE4
++#endif // ENABLE_KDE
++#ifdef ENABLE_KDE4
++    gid_File_Lib_Kde4be
++#endif // ENABLE_KDE4
++    );
+ End
++#endif
+ 
 diff --git scp2/source/ooo/file_library_ooo.scp scp2/source/ooo/file_library_ooo.scp
-index 184e8f1..571378e 100644
+index eeba4ff..9242bae 100644
 --- scp2/source/ooo/file_library_ooo.scp
 +++ scp2/source/ooo/file_library_ooo.scp
-@@ -612,6 +612,18 @@ File gid_File_Lib_Fps_Gnome
+@@ -630,6 +630,18 @@ File gid_File_Bin_KdeFilePicker
  End
  #endif
  #endif
@@ -14,7 +83,7 @@ index 184e8f1..571378e 100644
 +    RegistryID = gid_Starregistry_Services_Rdb;
 +    Dir = gid_Dir_Program;
 +    Name = SPECIAL_COMPONENT_LIB_NAME(fps_kde4.uno);
-+    Regmergefile = "fps-kde-ucd.txt";
++    Regmergefile = "fps-kde4-ucd.txt";
 +End
 +#endif
 +#endif
@@ -38,11 +107,26 @@ index 184e8f1..571378e 100644
  #endif
  
  #if defined(QUARTZ)
+diff --git scp2/source/ooo/makefile.mk scp2/source/ooo/makefile.mk
+index 3140056..6b289e5 100644
+--- scp2/source/ooo/makefile.mk
++++ scp2/source/ooo/makefile.mk
+@@ -79,6 +79,10 @@ SCPDEFS+=-DENABLE_SYSTRAY_GTK
+ SCPDEFS+=-DENABLE_KDE
+ .ENDIF
+ 
++.IF "$(ENABLE_KDE4)" != ""
++SCPDEFS+=-DENABLE_KDE4
++.ENDIF
++
+ .IF "$(ENABLE_KAB)" != ""
+ SCPDEFS+=-DENABLE_KAB
+ .ENDIF
 diff --git scp2/source/ooo/module_hidden_ooo.scp scp2/source/ooo/module_hidden_ooo.scp
-index a365910..c0e29bb 100644
+index 2b93f24..51942be 100644
 --- scp2/source/ooo/module_hidden_ooo.scp
 +++ scp2/source/ooo/module_hidden_ooo.scp
-@@ -240,6 +241,7 @@ Module gid_Module_Root_Files_4
+@@ -242,6 +242,7 @@ Module gid_Module_Root_Files_4
  	gid_File_Lib_Vclplug_Gen,
  	gid_File_Lib_Vclplug_Gtk,
  	gid_File_Lib_Vclplug_Kde,
@@ -50,43 +134,3 @@ index a365910..c0e29bb 100644
  	gid_File_Lib_Vclplug_Svp,
  	gid_File_Lib_Basctl,
  	gid_File_Lib_CanvasTools,
---- scp2/source/kde/file_kde.scp	2009-06-10 18:17:35.016187781 -0400
-+++ scp2/source/kde/file_kde.scp	2009-06-10 18:17:59.143438694 -0400
-@@ -38,3 +38,12 @@
-     Regmergefile = "kdebe1-ucd.txt";
- End
- 
-+File gid_File_Lib_Kde4be
-+    TXT_FILE_BODY;
-+    Styles = (PACKED);
-+    Dir = gid_Dir_Program;
-+    Name = STRING(CONCAT2(kde4be1.uno,UNXSUFFIX));
-+    RegistryID = gid_Starregistry_Services_Rdb;
-+    Regmergefile = "kde4be1-ucd.txt";
-+End
-+
---- scp2/source/kde/module_kde.scp	2008-04-10 05:26:32.000000000 -0400
-+++ scp2/source/kde/module_kde.scp	2009-06-10 18:18:49.028067947 -0400
-@@ -30,6 +30,16 @@
- 
- #include "macros.inc"
- 
-+#ifdef ENABLE_KDE4
-+Module gid_Module_Optional_Kde
-+    ParentID = gid_Module_Optional;
-+    Default = YES;
-+    PackageInfo = "packinfo_office.txt";
-+    MOD_NAME_DESC(MODULE_OPTIONAL_KDE);
-+    Styles = (DONTSHOWINUSERINSTALL);
-+    Files = (gid_File_Lib_Kde4be);
-+End
-+#else
- Module gid_Module_Optional_Kde
-     ParentID = gid_Module_Optional;
-     Default = YES;
-@@ -38,4 +48,5 @@
-     Styles = (DONTSHOWINUSERINSTALL);
-     Files = (gid_File_Lib_Kdebe);
- End
-+#endif
- 
commit a7b7a06163d7ad462a0172ca67662876e723def0
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Jun 12 15:48:41 2009 +0200

    Build KDE4 fpicker.
    
    * patches/dev300/kde4-configure.diff: We have to distinguish between Qt3 'moc'
      and Qt4 one.
    * patches/dev300/kde4-fpicker-source.diff: Rename the files so that they do
      not conflict with KDE3 ones.

diff --git a/patches/dev300/kde4-configure.diff b/patches/dev300/kde4-configure.diff
index 85b30f1..de9ae40 100644
--- a/patches/dev300/kde4-configure.diff
+++ b/patches/dev300/kde4-configure.diff
@@ -1,5 +1,5 @@
 diff --git configure.in configure.in
-index d2d8406..d253a8a 100644
+index d2d8406..3a878bb 100644
 --- configure.in
 +++ configure.in
 @@ -269,6 +269,10 @@ AC_ARG_ENABLE(kde,
@@ -59,15 +59,7 @@ index d2d8406..d253a8a 100644
  if test -z "$R"; then
  	AC_MSG_RESULT([none])
  else
-@@ -5999,7 +6014,6 @@ dnl ===================================================================
- 
- KDE_CFLAGS=""
- KDE_LIBS=""
--MOC="moc"
- if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
-     dnl Search paths for Qt and KDE
-     if test "$build_cpu" != "x86_64" ; then
-@@ -6018,11 +6032,11 @@ if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
+@@ -6018,11 +6033,11 @@ if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
          fi
      fi
      if test "$build_cpu" != "x86_64" ; then
@@ -83,30 +75,32 @@ index d2d8406..d253a8a 100644
      fi
      if test -n "$KDEDIR" ; then
          kde_incdirs="$KDEDIR/include $kde_incdirs"
-@@ -6069,12 +6083,6 @@ your Qt installation by exporting QTDIR before running "configure".])
+@@ -6069,12 +6084,13 @@ your Qt installation by exporting QTDIR before running "configure".])
  your Qt installation by exporting QTDIR before running "configure".])
      fi
  
--    AC_PATH_PROG( MOC, moc, no, [$QTDIR/bin:$PATH] )
--    if test "$MOC" = "no" ; then
--        AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
--the root of your Qt installation by exporting QTDIR before running "configure".])
++    dnl Check for Meta Object Compiler
+     AC_PATH_PROG( MOC, moc, no, [$QTDIR/bin:$PATH] )
+     if test "$MOC" = "no" ; then
+         AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
+ the root of your Qt installation by exporting QTDIR before running "configure".])
 -     fi
 -     
++    fi
++
      dnl Check for KDE headers
      AC_MSG_CHECKING([for KDE headers])
      kde_incdir="no"
-@@ -6111,6 +6119,107 @@ your KDE installation by exporting KDEDIR before running "configure".])
- fi
- AC_SUBST(KDE_CFLAGS)
- AC_SUBST(KDE_LIBS)
-+
-+dnl ===================================================================
+@@ -6114,6 +6130,102 @@ AC_SUBST(KDE_LIBS)
+ AC_SUBST(MOC)
+ 
+ dnl ===================================================================
 +dnl KDE4 Integration
 +dnl ===================================================================
 +
 +KDE4_CFLAGS=""
 +KDE4_LIBS=""
++MOC4="moc"
 +if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then
 +   qt_incdirs="$QTINC $QTDIR /usr/include/qt4 /usr/include $x_includes"
 +   qt_libdirs="$QTLIB /usr/lib $x_libraries"
@@ -153,6 +147,13 @@ index d2d8406..d253a8a 100644
 +      AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QTDIR before running "configure".])
 +   fi
 +
++   dnl Check for Meta Object Compiler
++   AC_PATH_PROG( MOC4, moc, no, [$PATH:$QTDIR/bin] )
++   if test "$MOC4" = "no" ; then
++      AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
++the root of your Qt installation by exporting QTDIR before running "configure".])
++   fi
++
 +   dnl Check for KDE4 headers
 +   AC_MSG_CHECKING([for KDE4 headers])
 +   kde_incdir="no"
@@ -187,34 +188,27 @@ index d2d8406..d253a8a 100644
 +fi
 +AC_SUBST(KDE4_CFLAGS)
 +AC_SUBST(KDE4_LIBS)
++AC_SUBST(MOC4)
 +
 +dnl ===================================================================
-+dnl Common for KDE3 and KDE4 Integration
-+dnl ===================================================================
-+
-+MOC="moc"
-+if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ||
-+   test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then
-+   AC_PATH_PROG( MOC, moc, no, [$PATH:$QTDIR/bin] )
-+   if test "$MOC" = "no" ; then
-+      AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
-+the root of your Qt installation by exporting QTDIR before running "configure".])
-+   fi
-+fi
- AC_SUBST(MOC)
- 
+ dnl Test for the enabling the lockdown pieces
  dnl ===================================================================
+ AC_MSG_CHECKING([whether to enable the lockdown pieces])
 diff --git set_soenv.in set_soenv.in
-index 9bc71be..3e6c663 100644
+index 9bc71be..e3bc624 100644
 --- set_soenv.in
 +++ set_soenv.in
-@@ -1757,6 +1757,9 @@ ToFile( "ENABLE_GIO",        "@ENABLE_GIO@",       "e" );
+@@ -1757,8 +1757,12 @@ ToFile( "ENABLE_GIO",        "@ENABLE_GIO@",       "e" );
  ToFile( "ENABLE_KDE",        "@ENABLE_KDE@",       "e" );
  ToFile( "KDE_CFLAGS",        "@KDE_CFLAGS@",       "e" );
  ToFile( "KDE_LIBS",          "@KDE_LIBS@",         "e" );
+-ToFile( "ENABLE_KAB",        "@ENABLE_KAB@",       "e" );
+ ToFile( "MOC",               "@MOC@",              "e" );
 +ToFile( "ENABLE_KDE4",       "@ENABLE_KDE4@",      "e" );
 +ToFile( "KDE4_CFLAGS",       "@KDE4_CFLAGS@",      "e" );
 +ToFile( "KDE4_LIBS",         "@KDE4_LIBS@",        "e" );
- ToFile( "ENABLE_KAB",        "@ENABLE_KAB@",       "e" );
- ToFile( "MOC",               "@MOC@",              "e" );
++ToFile( "MOC4",              "@MOC4@",             "e" );
++ToFile( "ENABLE_KAB",        "@ENABLE_KAB@",       "e" );
  ToFile( "PSPRINT",           "TRUE",             "e" );
+ ToFile( "MKDEPENDSOLVER",    "TRUE",             "e" );
+ #
diff --git a/patches/dev300/kde4-fpicker-source.diff b/patches/dev300/kde4-fpicker-source.diff
index 7f15b20..7c114e5 100644
--- a/patches/dev300/kde4-fpicker-source.diff
+++ b/patches/dev300/kde4-fpicker-source.diff
@@ -69,23 +69,23 @@ index 0000000..85214a1
 +#define _FPSERVICEINFO_HXX_
 +
 +// the service names
-+#define FILE_PICKER_SERVICE_NAME "com.sun.star.ui.dialogs.KDEFilePicker"
++#define FILE_PICKER_SERVICE_NAME "com.sun.star.ui.dialogs.KDE4FilePicker"
 +
 +// the implementation names		
-+#define FILE_PICKER_IMPL_NAME    "com.sun.star.ui.dialogs.UnxFilePicker"
++#define FILE_PICKER_IMPL_NAME    "com.sun.star.ui.dialogs.KDE4FilePickerImpl"
 +
 +// the registry key names
 +// a key under which this service will be registered,
 +// Format: -> "/ImplName/UNO/SERVICES/ServiceName"
 +//  <Implementation-Name></UNO/SERVICES/><Service-Name> 
-+#define FILE_PICKER_REGKEY_NAME  "/com.sun.star.ui.dialogs.UnxFilePicker/UNO/SERVICES/com.sun.star.ui.dialogs.KDEFilePicker"
++#define FILE_PICKER_REGKEY_NAME  "/com.sun.star.ui.dialogs.KDE4FilePickerImpl/UNO/SERVICES/com.sun.star.ui.dialogs.KDE4FilePicker"
 +
 +#endif
-diff --git fpicker/source/unx/kde4/UnxFPentry.cxx fpicker/source/unx/kde4/UnxFPentry.cxx
+diff --git fpicker/source/unx/kde4/KDE4FPEntry.cxx fpicker/source/unx/kde4/KDE4FPEntry.cxx
 new file mode 100644
 index 0000000..4d95264
 --- /dev/null
-+++ fpicker/source/unx/kde4/UnxFPentry.cxx
++++ fpicker/source/unx/kde4/KDE4FPEntry.cxx
 @@ -0,0 +1,169 @@
 +/*************************************************************************
 + *
@@ -161,7 +161,7 @@ index 0000000..4d95264
 +#endif
 +
 +#ifndef _UNXFILEPICKER_HXX_
-+#include "UnxFilePicker.hxx"
++#include "KDE4FilePicker.hxx"
 +#endif
 +
 +#ifndef _FPSERVICEINFO_HXX_
@@ -183,7 +183,7 @@ index 0000000..4d95264
 +static Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager )
 +{
 +    return Reference< XInterface >( 
-+            static_cast< XFilePicker* >( new UnxFilePicker( rServiceManager ) ) );
++            static_cast< XFilePicker* >( new KDE4FilePicker( rServiceManager ) ) );
 +}
 +
 +//////////////////////////////////////////////////////////////////////////
@@ -256,11 +256,11 @@ index 0000000..4d95264
 +}
 +
 +} // extern "C"
-diff --git fpicker/source/unx/kde4/UnxFilePicker.cxx fpicker/source/unx/kde4/UnxFilePicker.cxx
+diff --git fpicker/source/unx/kde4/KDE4FilePicker.cxx fpicker/source/unx/kde4/KDE4FilePicker.cxx
 new file mode 100644
 index 0000000..ce3a01f
 --- /dev/null
-+++ fpicker/source/unx/kde4/UnxFilePicker.cxx
++++ fpicker/source/unx/kde4/KDE4FilePicker.cxx
 @@ -0,0 +1,489 @@
 +/*************************************************************************
 + *
@@ -380,7 +380,7 @@ index 0000000..ce3a01f
 +#endif
 +
 +#ifndef _UNXFILEOPENIMPL_HXX_
-+#include "UnxFilePicker.hxx"
++#include "KDE4FilePicker.hxx"
 +#endif
 +
 +#include <vos/mutex.hxx>
@@ -433,16 +433,16 @@ index 0000000..ce3a01f
 +        uno::Sequence<rtl::OUString> aRet(3);
 +        aRet[0] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FilePicker");
 +        aRet[1] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFilePicker");
-+        aRet[2] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.KDEFilePicker");
++        aRet[2] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.KDE4FilePicker");
 +        return aRet;
 +    }
 +}
 +
 +//////////////////////////////////////////////////////////////////////////
-+// UnxFilePicker
++// KDE4FilePicker
 +//////////////////////////////////////////////////////////////////////////
 +
-+UnxFilePicker::UnxFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr )
++KDE4FilePicker::KDE4FilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr )
 +    : cppu::WeakComponentImplHelper8< 		
 +          XFilterManager, 
 +          XFilterGroupManager,
@@ -458,32 +458,32 @@ index 0000000..ce3a01f
 +	_dialog = new KFileDialog(KUrl("/home/shtylman/Desktop"), QString(""), 0);
 +}
 +
-+UnxFilePicker::~UnxFilePicker()
++KDE4FilePicker::~KDE4FilePicker()
 +{
 +	delete _dialog;
 +}
 +
-+void SAL_CALL UnxFilePicker::addFilePickerListener( const uno::Reference<XFilePickerListener>& xListener )
++void SAL_CALL KDE4FilePicker::addFilePickerListener( const uno::Reference<XFilePickerListener>& xListener )
 +	throw( uno::RuntimeException )
 +{
 +    ::vos::OGuard aGuard( Application::GetSolarMutex() );
 +    m_xListener = xListener;
 +}
 +
-+void SAL_CALL UnxFilePicker::removeFilePickerListener( const uno::Reference<XFilePickerListener>& )
++void SAL_CALL KDE4FilePicker::removeFilePickerListener( const uno::Reference<XFilePickerListener>& )
 +	throw( uno::RuntimeException )
 +{
 +    ::vos::OGuard aGuard( Application::GetSolarMutex() );
 +    m_xListener.clear();
 +}
 +
-+void SAL_CALL UnxFilePicker::setTitle( const rtl::OUString &rTitle )
++void SAL_CALL KDE4FilePicker::setTitle( const rtl::OUString &rTitle )
 +    throw( uno::RuntimeException )
 +{
 +	fprintf(stderr, "set title fp\n");
 +}
 +
-+sal_Int16 SAL_CALL UnxFilePicker::execute()
++sal_Int16 SAL_CALL KDE4FilePicker::execute()
 +    throw( uno::RuntimeException )
 +{
 +	fprintf(stderr, "execute fp\n");
@@ -522,25 +522,25 @@ index 0000000..ce3a01f
 +	return false;
 +}
 +
-+void SAL_CALL UnxFilePicker::setMultiSelectionMode( sal_Bool bMode )
++void SAL_CALL KDE4FilePicker::setMultiSelectionMode( sal_Bool bMode )
 +    throw( uno::RuntimeException )
 +{
 +	fprintf(stderr, "set multi sel mode fp\n");
 +}
 +
-+void SAL_CALL UnxFilePicker::setDefaultName( const ::rtl::OUString &rName )
++void SAL_CALL KDE4FilePicker::setDefaultName( const ::rtl::OUString &rName )
 +    throw( uno::RuntimeException )
 +{
 +	fprintf(stderr, "set def name fp\n");
 +}
 +
-+void SAL_CALL UnxFilePicker::setDisplayDirectory( const rtl::OUString &rDirectory )
++void SAL_CALL KDE4FilePicker::setDisplayDirectory( const rtl::OUString &rDirectory )
 +    throw( uno::RuntimeException )
 +{
 +	fprintf(stderr, "set disp dir fp\n");
 +}
 +
-+rtl::OUString SAL_CALL UnxFilePicker::getDisplayDirectory()
++rtl::OUString SAL_CALL KDE4FilePicker::getDisplayDirectory()
 +    throw( uno::RuntimeException )
 +{
 +	fprintf(stderr, "get disp dir fp\n");
@@ -549,7 +549,7 @@ index 0000000..ce3a01f
 +	return rtl::OUString(s, strlen(s), RTL_TEXTENCODING_UTF8);
 +}
 +
-+uno::Sequence< ::rtl::OUString > SAL_CALL UnxFilePicker::getFiles()
++uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getFiles()
 +    throw( uno::RuntimeException )
 +{
 +	QStringList files = _dialog->selectedFiles();
@@ -570,19 +570,19 @@ index 0000000..ce3a01f
 +	return seq;
 +}
 +
-+void SAL_CALL UnxFilePicker::appendFilter( const ::rtl::OUString &rTitle, const ::rtl::OUString &rFilter )
++void SAL_CALL KDE4FilePicker::appendFilter( const ::rtl::OUString &rTitle, const ::rtl::OUString &rFilter )
 +    throw( lang::IllegalArgumentException, uno::RuntimeException )
 +{
 +	fprintf(stderr, "append filter fp\n");
 +}
 +
-+void SAL_CALL UnxFilePicker::setCurrentFilter( const rtl::OUString &rTitle )
++void SAL_CALL KDE4FilePicker::setCurrentFilter( const rtl::OUString &rTitle )
 +    throw( lang::IllegalArgumentException, uno::RuntimeException )
 +{
 +	fprintf(stderr, "set current filter fp\n");
 +}
 +
-+rtl::OUString SAL_CALL UnxFilePicker::getCurrentFilter()
++rtl::OUString SAL_CALL KDE4FilePicker::getCurrentFilter()
 +    throw( uno::RuntimeException )
 +{
 +	fprintf(stderr, "get current filter fp\n");
@@ -590,36 +590,36 @@ index 0000000..ce3a01f
 +	return rtl::OUString(s, strlen(s), RTL_TEXTENCODING_UTF8);
 +}
 +
-+void SAL_CALL UnxFilePicker::appendFilterGroup( const rtl::OUString &rGroupTitle, const uno::Sequence<beans::StringPair> &rFilters )
++void SAL_CALL KDE4FilePicker::appendFilterGroup( const rtl::OUString &rGroupTitle, const uno::Sequence<beans::StringPair> &rFilters )
 +    throw( lang::IllegalArgumentException, uno::RuntimeException )
 +{
 +	fprintf(stderr, "append filter group fp\n");
 +}
 +
-+void SAL_CALL UnxFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlAction, const uno::Any &rValue )
++void SAL_CALL KDE4FilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlAction, const uno::Any &rValue )
 +    throw( uno::RuntimeException )
 +{
 +	fprintf(stderr, "set value fp\n");
 +}
 +
-+uno::Any SAL_CALL UnxFilePicker::getValue( sal_Int16 nControlId, sal_Int16 nControlAction )
++uno::Any SAL_CALL KDE4FilePicker::getValue( sal_Int16 nControlId, sal_Int16 nControlAction )
 +    throw( uno::RuntimeException )
 +{
 +	fprintf(stderr, "get value fp\n");
 +}
 +
-+void SAL_CALL UnxFilePicker::enableControl( sal_Int16 nControlId, sal_Bool bEnable )
++void SAL_CALL KDE4FilePicker::enableControl( sal_Int16 nControlId, sal_Bool bEnable )
 +    throw( uno::RuntimeException )
 +{
 +}
 +
-+void SAL_CALL UnxFilePicker::setLabel( sal_Int16 nControlId, const ::rtl::OUString &rLabel )
++void SAL_CALL KDE4FilePicker::setLabel( sal_Int16 nControlId, const ::rtl::OUString &rLabel )
 +    throw( uno::RuntimeException )
 +{
 +	fprintf(stderr, "set label fp\n");
 +}
 +
-+rtl::OUString SAL_CALL UnxFilePicker::getLabel(sal_Int16 /*nControlId*/) 
++rtl::OUString SAL_CALL KDE4FilePicker::getLabel(sal_Int16 /*nControlId*/) 
 +    throw ( uno::RuntimeException )
 +{
 +	fprintf(stderr, "get label fp\n");
@@ -628,7 +628,7 @@ index 0000000..ce3a01f
 +}
 +
 +/* TODO
-+uno::Sequence<sal_Int16> SAL_CALL UnxFilePicker::getSupportedImageFormats()
++uno::Sequence<sal_Int16> SAL_CALL KDE4FilePicker::getSupportedImageFormats()
 +    throw( uno::RuntimeException )
 +{
 +    checkFilePicker();
@@ -637,7 +637,7 @@ index 0000000..ce3a01f
 +    return m_pImpl->getSupportedImageFormats();
 +}
 +
-+sal_Int32 SAL_CALL UnxFilePicker::getTargetColorDepth()
++sal_Int32 SAL_CALL KDE4FilePicker::getTargetColorDepth()
 +    throw( uno::RuntimeException )
 +{
 +    checkFilePicker();
@@ -646,7 +646,7 @@ index 0000000..ce3a01f
 +    return m_pImpl->getTargetColorDepth();
 +}
 +
-+sal_Int32 SAL_CALL UnxFilePicker::getAvailableWidth()
++sal_Int32 SAL_CALL KDE4FilePicker::getAvailableWidth()
 +    throw( uno::RuntimeException )
 +{
 +    checkFilePicker();
@@ -655,7 +655,7 @@ index 0000000..ce3a01f
 +    return m_pImpl->getAvailableWidth();
 +}
 +
-+sal_Int32 SAL_CALL UnxFilePicker::getAvailableHeight()
++sal_Int32 SAL_CALL KDE4FilePicker::getAvailableHeight()
 +    throw( uno::RuntimeException )
 +{
 +    checkFilePicker();
@@ -664,7 +664,7 @@ index 0000000..ce3a01f
 +    return m_pImpl->getAvailableHeight();
 +}
 +
-+void SAL_CALL UnxFilePicker::setImage( sal_Int16 aImageFormat, const uno::Any &rImage ) 
++void SAL_CALL KDE4FilePicker::setImage( sal_Int16 aImageFormat, const uno::Any &rImage ) 
 +    throw( lang::IllegalArgumentException, uno::RuntimeException )
 +{
 +    checkFilePicker();
@@ -673,7 +673,7 @@ index 0000000..ce3a01f
 +    m_pImpl->setImage( aImageFormat, aImage );
 +}
 +
-+sal_Bool SAL_CALL UnxFilePicker::setShowState( sal_Bool bShowState )
++sal_Bool SAL_CALL KDE4FilePicker::setShowState( sal_Bool bShowState )
 +    throw( uno::RuntimeException )
 +{
 +    checkFilePicker();
@@ -682,7 +682,7 @@ index 0000000..ce3a01f
 +    return m_pImpl->setShowState( bShowState );
 +}
 +
-+sal_Bool SAL_CALL UnxFilePicker::getShowState()
++sal_Bool SAL_CALL KDE4FilePicker::getShowState()
 +    throw( uno::RuntimeException )
 +{
 +    checkFilePicker();
@@ -692,7 +692,7 @@ index 0000000..ce3a01f
 +}
 +*/
 +
-+void SAL_CALL UnxFilePicker::initialize( const uno::Sequence<uno::Any> &rArguments ) 
++void SAL_CALL KDE4FilePicker::initialize( const uno::Sequence<uno::Any> &rArguments ) 
 +    throw( uno::Exception, uno::RuntimeException )
 +{
 +	fprintf(stderr, "initialize fp\n");
@@ -700,13 +700,13 @@ index 0000000..ce3a01f
 +	fprintf(stderr, "initialize end fp\n");
 +}
 +
-+void SAL_CALL UnxFilePicker::cancel()
++void SAL_CALL KDE4FilePicker::cancel()
 +    throw ( uno::RuntimeException )
 +{
 +	fprintf(stderr, "calcel fp\n");
 +}
 +
-+void SAL_CALL UnxFilePicker::disposing( const lang::EventObject &rEvent )
++void SAL_CALL KDE4FilePicker::disposing( const lang::EventObject &rEvent )
 +    throw( uno::RuntimeException )
 +{
 +    uno::Reference<XFilePickerListener> xFilePickerListener( rEvent.Source, uno::UNO_QUERY );
@@ -717,13 +717,13 @@ index 0000000..ce3a01f
 +	fprintf(stderr, "disposed fp\n");
 +}
 +
-+rtl::OUString SAL_CALL UnxFilePicker::getImplementationName() 
++rtl::OUString SAL_CALL KDE4FilePicker::getImplementationName() 
 +    throw( uno::RuntimeException )
 +{
 +    return rtl::OUString::createFromAscii( FILE_PICKER_IMPL_NAME );
 +}
 +
-+sal_Bool SAL_CALL UnxFilePicker::supportsService( const rtl::OUString& ServiceName ) 
++sal_Bool SAL_CALL KDE4FilePicker::supportsService( const rtl::OUString& ServiceName ) 
 +    throw( uno::RuntimeException )
 +{
 +    uno::Sequence< ::rtl::OUString > SupportedServicesNames = FilePicker_getSupportedServiceNames();
@@ -737,25 +737,25 @@ index 0000000..ce3a01f
 +    return sal_False;
 +}
 +
-+uno::Sequence< ::rtl::OUString > SAL_CALL UnxFilePicker::getSupportedServiceNames() 
++uno::Sequence< ::rtl::OUString > SAL_CALL KDE4FilePicker::getSupportedServiceNames() 
 +    throw( uno::RuntimeException )
 +{
 +    return FilePicker_getSupportedServiceNames();
 +}
 +
-+void UnxFilePicker::initFilePicker()
++void KDE4FilePicker::initFilePicker()
 +{
 +}
 +
-+void UnxFilePicker::checkFilePicker() throw( ::com::sun::star::uno::RuntimeException )
++void KDE4FilePicker::checkFilePicker() throw( ::com::sun::star::uno::RuntimeException )
 +{
 +	fprintf(stderr, "check fp\n");
 +}
-diff --git fpicker/source/unx/kde4/UnxFilePicker.hxx fpicker/source/unx/kde4/UnxFilePicker.hxx
+diff --git fpicker/source/unx/kde4/KDE4FilePicker.hxx fpicker/source/unx/kde4/KDE4FilePicker.hxx
 new file mode 100644
 index 0000000..8505ff8
 --- /dev/null
-+++ fpicker/source/unx/kde4/UnxFilePicker.hxx
++++ fpicker/source/unx/kde4/KDE4FilePicker.hxx
 @@ -0,0 +1,223 @@
 +/*************************************************************************
 + *
@@ -877,7 +877,7 @@ index 0000000..8505ff8
 +class UnxFilePickerNotifyThread;
 +class ResMgr;
 +
-+class UnxFilePicker : 
++class KDE4FilePicker : 
 +    public cppu::WeakComponentImplHelper8<
 +        ::com::sun::star::ui::dialogs::XFilterManager,
 +        ::com::sun::star::ui::dialogs::XFilterGroupManager,
@@ -900,8 +900,8 @@ index 0000000..8505ff8
 +	osl::Mutex                  m_rbHelperMtx;
 +
 +public:
-+    UnxFilePicker( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceMgr );
-+    virtual ~UnxFilePicker();
++    KDE4FilePicker( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceMgr );
++    virtual ~KDE4FilePicker();
 +
 +    // XFilePickerNotifier
 +
@@ -970,8 +970,8 @@ index 0000000..8505ff8
 +
 +private:
 +    // prevent copy and assignment
-+    UnxFilePicker( const UnxFilePicker& );           
-+    UnxFilePicker& operator=( const UnxFilePicker& );
++    KDE4FilePicker( const KDE4FilePicker& );           
++    KDE4FilePicker& operator=( const KDE4FilePicker& );
 +
 +protected:
 +    void                        initFilePicker();
@@ -987,21 +987,21 @@ index 0000000..28aa49d
 +++ fpicker/source/unx/kde4/fps-kde-ucd.txt
 @@ -0,0 +1,6 @@
 +[ComponentDescriptor]
-+ImplementationName=com.sun.star.ui.dialogs.UnxFilePicker
-+ComponentName=fps_kde.uno.so
++ImplementationName=com.sun.star.ui.dialogs.KDE4UnxFilePicker
++ComponentName=fps_kde4.uno.so
 +LoaderName=com.sun.star.loader.SharedLibrary
 +[SupportedServices]
-+com.sun.star.ui.dialogs.KDEFilePicker
-diff --git fpicker/source/unx/kde4/fps_kde.xml fpicker/source/unx/kde4/fps_kde.xml
++com.sun.star.ui.dialogs.KDE4FilePicker
+diff --git fpicker/source/unx/kde4/fps_kde4.xml fpicker/source/unx/kde4/fps_kde4.xml
 new file mode 100644
 index 0000000..fb967fd
 --- /dev/null
-+++ fpicker/source/unx/kde4/fps_kde.xml
++++ fpicker/source/unx/kde4/fps_kde4.xml
 @@ -0,0 +1,51 @@
 +<?xml version="1.0" encoding="UTF-8"?>
 +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
 +<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
-+    <module-name>fps_kde</module-name>
++    <module-name>fps_kde4</module-name>
 +    <component-description>
 +        <author> Jan Holesovsky </author>
 +        <name>    com.sun.star.comp.ui.dialogs.FilePicker </name>
@@ -1144,9 +1144,9 @@ index 0000000..e148d81
 +# --- Files --------------------------------------------------------
 +
 +SLOFILES =\
-+		$(SLO)$/UnxFilePicker.obj		\
-+		$(SLO)$/UnxFilePicker.moc.obj \
-+		$(SLO)$/UnxFPentry.obj
++		$(SLO)$/KDE4FilePicker.obj		\
++		$(SLO)$/KDE4FilePicker.moc.obj \
++		$(SLO)$/KDE4FPEntry.obj
 +
 +SHL1NOCHECK=TRUE
 +SHL1TARGET=$(TARGET)
@@ -1170,5 +1170,21 @@ index 0000000..e148d81
 +
 +.INCLUDE :	target.mk
 +
-+$(MISC)$/UnxFilePicker.moc.cxx : UnxFilePicker.hxx
-+	$(MOC) $< -o $@
++$(MISC)$/KDE4FilePicker.moc.cxx : KDE4FilePicker.hxx
++	$(MOC4) $< -o $@
+diff --git fpicker/source/unx/kde/makefile.mk fpicker/source/unx/kde/makefile.mk
+index 680e0f6..f4a113a 100644
+--- fpicker/source/unx/kde/makefile.mk
++++ fpicker/source/unx/kde/makefile.mk
+@@ -96,9 +96,10 @@ SLOFILES =\
+ APP1TARGET=$(TARGET)
+ APP1OBJS=$(SLOFILES)
+ APP1RPATH=BRAND
++APP1LINKFLAGS+=$(KDE_LIBS)
+ APP1STDLIBS=\
+ 			$(SALLIB) \
+-			$(KDE_LIBS) -lkio
++			-lkio
+ 
+ 
+ .ENDIF # "$(GUIBASE)" != "unx" || "$(ENABLE_KDE)" != "TRUE"
commit 405b64ff001d4733ddc051aa44bb95978d9830f7
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Jun 12 15:05:08 2009 +0200

    Build KDE4 configuration backend.
    
    * patches/dev300/kde4-shell-source.diff: The files for KDE4 backend have to
      have different names, otherwise we might have link time problems.

diff --git a/patches/dev300/kde4-shell-source.diff b/patches/dev300/kde4-shell-source.diff
index eee478c..f485bdf 100644
--- a/patches/dev300/kde4-shell-source.diff
+++ b/patches/dev300/kde4-shell-source.diff
@@ -23,15 +23,15 @@ index 0000000..16b8cc0
 +<?xml version="1.0" encoding="UTF-8"?>
 +<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
 +<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
-+    <module-name>kdebe</module-name>
++    <module-name>kde4be</module-name>
 +    <component-description>
 +        <author> Éric Bischoff </author>
-+        <name>com.sun.star.comp.configuration.backend.KDEBackend</name>
++        <name>com.sun.star.comp.configuration.backend.KDE4Backend</name>
 +        <description> The KDE4 configuration backend </description>
 +        <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
 +        <language>c++</language>
 +        <status value="beta"/>        
-+        <supported-service>com.sun.star.comp.configuration.backend.KDEBackend</supported-service>		
++        <supported-service>com.sun.star.comp.configuration.backend.KDE4Backend</supported-service>		
 +        <service-dependency>...</service-dependency>
 +        <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
 +        <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
@@ -62,16 +62,16 @@ index 0000000..adf7e17
 +++ shell/source/backends/kde4be/kde4be1-ucd.txt
 @@ -0,0 +1,6 @@
 +[ComponentDescriptor]
-+ImplementationName=com.sun.star.comp.configuration.backend.KDEBackend
-+ComponentName=kdebe1.uno.so
++ImplementationName=com.sun.star.comp.configuration.backend.KDE4Backend
++ComponentName=kde4be1.uno.so
 +LoaderName=com.sun.star.loader.SharedLibrary
 +[SupportedServices]
-+com.sun.star.configuration.backend.KDEBackend
-diff --git shell/source/backends/kde4be/kdebackend.cxx shell/source/backends/kde4be/kdebackend.cxx
++com.sun.star.configuration.backend.KDE4Backend
+diff --git shell/source/backends/kde4be/kde4backend.cxx shell/source/backends/kde4be/kde4backend.cxx
 new file mode 100644
 index 0000000..904db3e
 --- /dev/null
-+++ shell/source/backends/kde4be/kdebackend.cxx
++++ shell/source/backends/kde4be/kde4backend.cxx
 @@ -0,0 +1,158 @@
 +/*************************************************************************
 + *
@@ -81,7 +81,7 @@ index 0000000..904db3e
 + *
 + * OpenOffice.org - a multi-platform office productivity suite
 + *
-+ * $RCSfile: kdebackend.cxx,v $
++ * $RCSfile: kde4backend.cxx,v $
 + * $Revision: 1.7 $
 + *
 + * This file is part of OpenOffice.org.
@@ -106,11 +106,11 @@ index 0000000..904db3e
 +// MARKER(update_precomp.py): autogen include statement, do not remove
 +#include "precompiled_shell.hxx"
 +
-+#include "kdebackend.hxx"
-+#include "kdecommonlayer.hxx"
-+#include "kdeinetlayer.hxx"
-+#include "kdevcllayer.hxx"
-+#include "kdepathslayer.hxx"
++#include "kde4backend.hxx"
++#include "kde4commonlayer.hxx"
++#include "kde4inetlayer.hxx"
++#include "kde4vcllayer.hxx"
++#include "kde4pathslayer.hxx"
 +
 +//------------------------------------------------------------------------------
 +
@@ -185,7 +185,7 @@ index 0000000..904db3e
 +rtl::OUString SAL_CALL KDEBackend::getBackendName(void)
 +{
 +    return rtl::OUString( 
-+        RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.KDEBackend") );
++        RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.KDE4Backend") );
 +}
 +
 +//------------------------------------------------------------------------------
@@ -202,7 +202,7 @@ index 0000000..904db3e
 +{
 +    uno::Sequence<rtl::OUString> aServices(1) ;
 +    aServices[0] = rtl::OUString( 
-+        RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.KDEBackend")) ;
++        RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.KDE4Backend")) ;
 +
 +    return aServices ;
 +}
@@ -231,11 +231,11 @@ index 0000000..904db3e
 +}
 +
 +// ---------------------------------------------------------------------------------------
-diff --git shell/source/backends/kde4be/kdebackend.hxx shell/source/backends/kde4be/kdebackend.hxx
+diff --git shell/source/backends/kde4be/kde4backend.hxx shell/source/backends/kde4be/kde4backend.hxx
 new file mode 100644
 index 0000000..cf44b3d
 --- /dev/null
-+++ shell/source/backends/kde4be/kdebackend.hxx
++++ shell/source/backends/kde4be/kde4backend.hxx
 @@ -0,0 +1,128 @@
 +/*************************************************************************
 + *
@@ -245,7 +245,7 @@ index 0000000..cf44b3d
 + *
 + * OpenOffice.org - a multi-platform office productivity suite
 + *
-+ * $RCSfile: kdebackend.hxx,v $
++ * $RCSfile: kde4backend.hxx,v $
 + * $Revision: 1.4 $
 + *
 + * This file is part of OpenOffice.org.
@@ -365,11 +365,11 @@ index 0000000..cf44b3d
 +};
 +
 +#endif // CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_
-diff --git shell/source/backends/kde4be/kdebecdef.cxx shell/source/backends/kde4be/kdebecdef.cxx
+diff --git shell/source/backends/kde4be/kde4becdef.cxx shell/source/backends/kde4be/kde4becdef.cxx
 new file mode 100644
 index 0000000..7bd481f
 --- /dev/null
-+++ shell/source/backends/kde4be/kdebecdef.cxx
++++ shell/source/backends/kde4be/kde4becdef.cxx
 @@ -0,0 +1,143 @@
 +/*************************************************************************
 + *
@@ -379,7 +379,7 @@ index 0000000..7bd481f
 + *
 + * OpenOffice.org - a multi-platform office productivity suite
 + *
-+ * $RCSfile: kdebecdef.cxx,v $
++ * $RCSfile: kde4becdef.cxx,v $
 + * $Revision: 1.8 $
 + *
 + * This file is part of OpenOffice.org.
@@ -403,7 +403,7 @@ index 0000000..7bd481f
 +
 +// MARKER(update_precomp.py): autogen include statement, do not remove
 +#include "precompiled_shell.hxx"
-+#include "kdebackend.hxx"
++#include "kde4backend.hxx"
 +#include <com/sun/star/registry/XRegistryKey.hpp>
 +
 +#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
@@ -514,11 +514,11 @@ index 0000000..7bd481f
 +        kImplementations_entries) ;
 +}
 +//------------------------------------------------------------------------------
-diff --git shell/source/backends/kde4be/kdecommonlayer.cxx shell/source/backends/kde4be/kdecommonlayer.cxx
+diff --git shell/source/backends/kde4be/kde4commonlayer.cxx shell/source/backends/kde4be/kde4commonlayer.cxx
 new file mode 100644
 index 0000000..f598211
 --- /dev/null
-+++ shell/source/backends/kde4be/kdecommonlayer.cxx
++++ shell/source/backends/kde4be/kde4commonlayer.cxx
 @@ -0,0 +1,153 @@
 +/*************************************************************************
 + *
@@ -528,7 +528,7 @@ index 0000000..f598211
 + *
 + * OpenOffice.org - a multi-platform office productivity suite
 + *
-+ * $RCSfile: kdecommonlayer.cxx,v $
++ * $RCSfile: kde4commonlayer.cxx,v $
 + * $Revision: 1.7 $
 + *
 + * This file is part of OpenOffice.org.
@@ -552,7 +552,7 @@ index 0000000..f598211
 +
 +// MARKER(update_precomp.py): autogen include statement, do not remove
 +#include "precompiled_shell.hxx"
-+#include "kdecommonlayer.hxx"
++#include "kde4commonlayer.hxx"
 +#include <vcl/kde4_headers.h>
 +#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
 +#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
@@ -673,16 +673,16 @@ index 0000000..f598211
 +
 +    return sTimeStamp;
 +}
-diff --git shell/source/backends/kde4be/kdecommonlayer.hxx shell/source/backends/kde4be/kdecommonlayer.hxx
+diff --git shell/source/backends/kde4be/kde4commonlayer.hxx shell/source/backends/kde4be/kde4commonlayer.hxx
 new file mode 100644
 index 0000000..84bcf35
 --- /dev/null
-+++ shell/source/backends/kde4be/kdecommonlayer.hxx
++++ shell/source/backends/kde4be/kde4commonlayer.hxx
 @@ -0,0 +1,56 @@
 +#ifndef KDECOMMONLAYER_HXX_
 +#define KDECOMMONLAYER_HXX_
 +
-+#include "kdebackend.hxx"
++#include "kde4backend.hxx"
 +#include <com/sun/star/uno/XComponentContext.hpp>
 +#include <com/sun/star/configuration/backend/XLayer.hpp>
 +#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
@@ -735,11 +735,11 @@ index 0000000..84bcf35
 +  } ;
 +
 +#endif // KDECOMMONLAYER
-diff --git shell/source/backends/kde4be/kdeinetlayer.cxx shell/source/backends/kde4be/kdeinetlayer.cxx
+diff --git shell/source/backends/kde4be/kde4inetlayer.cxx shell/source/backends/kde4be/kde4inetlayer.cxx
 new file mode 100644
 index 0000000..15e9e58
 --- /dev/null
-+++ shell/source/backends/kde4be/kdeinetlayer.cxx
++++ shell/source/backends/kde4be/kde4inetlayer.cxx
 @@ -0,0 +1,254 @@
 +/*************************************************************************
 + *
@@ -749,7 +749,7 @@ index 0000000..15e9e58
 + *
 + * OpenOffice.org - a multi-platform office productivity suite
 + *
-+ * $RCSfile: kdeinetlayer.cxx,v $
++ * $RCSfile: kde4inetlayer.cxx,v $
 + * $Revision: 1.7 $
 + *
 + * This file is part of OpenOffice.org.
@@ -773,7 +773,7 @@ index 0000000..15e9e58
 +
 +// MARKER(update_precomp.py): autogen include statement, do not remove
 +#include "precompiled_shell.hxx"
-+#include "kdeinetlayer.hxx"
++#include "kde4inetlayer.hxx"
 +#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
 +#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
 +#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
@@ -995,16 +995,16 @@ index 0000000..15e9e58
 +    }
 +}
 +
-diff --git shell/source/backends/kde4be/kdeinetlayer.hxx shell/source/backends/kde4be/kdeinetlayer.hxx
+diff --git shell/source/backends/kde4be/kde4inetlayer.hxx shell/source/backends/kde4be/kde4inetlayer.hxx
 new file mode 100644
 index 0000000..333117b
 --- /dev/null
-+++ shell/source/backends/kde4be/kdeinetlayer.hxx
++++ shell/source/backends/kde4be/kde4inetlayer.hxx
 @@ -0,0 +1,62 @@
 +#ifndef KDEINETLAYER_HXX_
 +#define KDEINETLAYER_HXX_
 +
-+#include "kdebackend.hxx"
++#include "kde4backend.hxx"
 +#include <com/sun/star/uno/XComponentContext.hpp>
 +#include <com/sun/star/configuration/backend/XLayer.hpp>
 +#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
@@ -1063,11 +1063,11 @@ index 0000000..333117b
 +  } ;
 +
 +#endif // KDEINETLAYER
-diff --git shell/source/backends/kde4be/kdepathslayer.cxx shell/source/backends/kde4be/kdepathslayer.cxx
+diff --git shell/source/backends/kde4be/kde4pathslayer.cxx shell/source/backends/kde4be/kde4pathslayer.cxx
 new file mode 100644
 index 0000000..858decf
 --- /dev/null
-+++ shell/source/backends/kde4be/kdepathslayer.cxx
++++ shell/source/backends/kde4be/kde4pathslayer.cxx
 @@ -0,0 +1,121 @@
 +/*************************************************************************
 + *
@@ -1077,7 +1077,7 @@ index 0000000..858decf
 + *
 + * OpenOffice.org - a multi-platform office productivity suite
 + *
-+ * $RCSfile: kdepathslayer.cxx,v $
++ * $RCSfile: kde4pathslayer.cxx,v $
 + * $Revision: 1.5 $
 + *
 + * This file is part of OpenOffice.org.
@@ -1101,7 +1101,7 @@ index 0000000..858decf
 +
 +// MARKER(update_precomp.py): autogen include statement, do not remove
 +#include "precompiled_shell.hxx"
-+#include "kdepathslayer.hxx"
++#include "kde4pathslayer.hxx"
 +#include <vcl/kde4_headers.h>
 +#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
 +#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
@@ -1190,11 +1190,11 @@ index 0000000..858decf
 +
 +    return sTimeStamp;
 +}
-diff --git shell/source/backends/kde4be/kdepathslayer.hxx shell/source/backends/kde4be/kdepathslayer.hxx
+diff --git shell/source/backends/kde4be/kde4pathslayer.hxx shell/source/backends/kde4be/kde4pathslayer.hxx
 new file mode 100644
 index 0000000..fe88206
 --- /dev/null
-+++ shell/source/backends/kde4be/kdepathslayer.hxx
++++ shell/source/backends/kde4be/kde4pathslayer.hxx
 @@ -0,0 +1,86 @@
 +/*************************************************************************
 + *
@@ -1204,7 +1204,7 @@ index 0000000..fe88206
 + *
 + * OpenOffice.org - a multi-platform office productivity suite
 + *
-+ * $RCSfile: kdepathslayer.hxx,v $
++ * $RCSfile: kde4pathslayer.hxx,v $
 + * $Revision: 1.3 $
 + *
 + * This file is part of OpenOffice.org.
@@ -1229,7 +1229,7 @@ index 0000000..fe88206
 +#ifndef KDEPATHSLAYER_HXX_
 +#define KDEPATHSLAYER_HXX_
 +
-+#include "kdebackend.hxx"
++#include "kde4backend.hxx"
 +#include <com/sun/star/uno/XComponentContext.hpp>
 +#include <com/sun/star/configuration/backend/XLayer.hpp>
 +#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
@@ -1282,11 +1282,11 @@ index 0000000..fe88206
 +  } ;
 +
 +#endif // KDEPATHSLAYER
-diff --git shell/source/backends/kde4be/kdevcllayer.cxx shell/source/backends/kde4be/kdevcllayer.cxx
+diff --git shell/source/backends/kde4be/kde4vcllayer.cxx shell/source/backends/kde4be/kde4vcllayer.cxx
 new file mode 100644
 index 0000000..ce36a23
 --- /dev/null
-+++ shell/source/backends/kde4be/kdevcllayer.cxx
++++ shell/source/backends/kde4be/kde4vcllayer.cxx
 @@ -0,0 +1,116 @@
 +/*************************************************************************
 + *
@@ -1296,7 +1296,7 @@ index 0000000..ce36a23
 + *
 + * OpenOffice.org - a multi-platform office productivity suite
 + *
-+ * $RCSfile: kdevcllayer.cxx,v $
++ * $RCSfile: kde4vcllayer.cxx,v $
 + * $Revision: 1.5 $
 + *
 + * This file is part of OpenOffice.org.
@@ -1320,7 +1320,7 @@ index 0000000..ce36a23
 +
 +// MARKER(update_precomp.py): autogen include statement, do not remove
 +#include "precompiled_shell.hxx"
-+#include "kdevcllayer.hxx"
++#include "kde4vcllayer.hxx"
 +#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
 +#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
 +#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
@@ -1404,16 +1404,16 @@ index 0000000..ce36a23
 +
 +    return sTimeStamp;
 +}
-diff --git shell/source/backends/kde4be/kdevcllayer.hxx shell/source/backends/kde4be/kdevcllayer.hxx
+diff --git shell/source/backends/kde4be/kde4vcllayer.hxx shell/source/backends/kde4be/kde4vcllayer.hxx
 new file mode 100644
 index 0000000..32b541a
 --- /dev/null
-+++ shell/source/backends/kde4be/kdevcllayer.hxx
++++ shell/source/backends/kde4be/kde4vcllayer.hxx
 @@ -0,0 +1,56 @@
 +#ifndef KDEVCLLAYER_HXX_
 +#define KDEVCLLAYER_HXX_
 +
-+#include "kdebackend.hxx"
++#include "kde4backend.hxx"
 +#include <com/sun/star/uno/XComponentContext.hpp>
 +#include <com/sun/star/configuration/backend/XLayer.hpp>
 +#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
@@ -1538,12 +1538,12 @@ index 0000000..48d5c8d
 +# --- Files ---
 +
 +SLOFILES=\
-+	$(SLO)$/kdebackend.obj \
-+	$(SLO)$/kdecommonlayer.obj \
-+	$(SLO)$/kdeinetlayer.obj \
-+	$(SLO)$/kdevcllayer.obj \
-+	$(SLO)$/kdepathslayer.obj \
-+	$(SLO)$/kdebecdef.obj
++	$(SLO)$/kde4backend.obj \
++	$(SLO)$/kde4commonlayer.obj \
++	$(SLO)$/kde4inetlayer.obj \
++	$(SLO)$/kde4vcllayer.obj \
++	$(SLO)$/kde4pathslayer.obj \
++	$(SLO)$/kde4becdef.obj
 +
 +SHL1NOCHECK=TRUE
 +SHL1TARGET=$(TARGET)1.uno   
@@ -1566,3 +1566,21 @@ index 0000000..48d5c8d
 +# --- Targets ---
 +
 +.INCLUDE : target.mk
+diff --git shell/source/backends/kdebe/makefile.mk shell/source/backends/kdebe/makefile.mk
+index 8bc0b47..b630f41 100644
+--- shell/source/backends/kdebe/makefile.mk
++++ shell/source/backends/kdebe/makefile.mk
+@@ -77,11 +77,12 @@ SHL1OBJS=$(SLOFILES)
+ SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+ 
+ SHL1IMPLIB=i$(SHL1TARGET)
++SHL1LINKFLAGS+=$(KDE_LIBS)
+ SHL1STDLIBS=    \
+         $(CPPUHELPERLIB) \
+         $(CPPULIB) \
+         $(SALLIB) \
+-        $(KDE_LIBS) -lkio
++        -lkio
+         
+ SHL1VERSIONMAP=exports.map
+ SHL1DEF=$(MISC)$/$(SHL1TARGET).def
commit a58a746465b34af62a26a2e3ef2decd3774c68a1
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Jun 12 14:31:24 2009 +0200

    Build KDE4 vclplug.
    
    Also fix building the KDE3 one along with KDE4.
    
    * patches/dev300/kde4-configure.diff: Test /usr/lib as the last possibility.
    * patches/dev300/kde4-plugin-detection.diff: The KDE4 plugin is named 'kde4'.
    * patches/dev300/kde4-vcl.diff: Build bits for libvclplug_kde4.

diff --git a/patches/dev300/kde4-configure.diff b/patches/dev300/kde4-configure.diff
index a4c47dc..85b30f1 100644
--- a/patches/dev300/kde4-configure.diff
+++ b/patches/dev300/kde4-configure.diff
@@ -1,5 +1,5 @@
 diff --git configure.in configure.in
-index d2d8406..9751f3d 100644
+index d2d8406..d253a8a 100644
 --- configure.in
 +++ configure.in
 @@ -269,6 +269,10 @@ AC_ARG_ENABLE(kde,
@@ -67,19 +67,22 @@ index d2d8406..9751f3d 100644
  if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
      dnl Search paths for Qt and KDE
      if test "$build_cpu" != "x86_64" ; then
-@@ -6018,10 +6032,10 @@ if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
+@@ -6018,11 +6032,11 @@ if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
          fi
      fi
      if test "$build_cpu" != "x86_64" ; then
 -        kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes"
+-        kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib $x_libraries"
 +        kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /opt/kde3/include /opt/kde/include $x_includes"
-         kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib $x_libraries"
++        kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib /usr/lib $x_libraries"
      else
 -        kde_incdirs="/usr/lib64/kde/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes"
+-        kde_libdirs="/usr/lib64/kde/lib64 /usr/local/kde/lib64 /usr/kde/lib64 /usr/lib64/kde /usr/lib64/kde3 /usr/lib64 /usr/X11R6/lib64 /usr/local/lib64 /opt/kde3/lib64 /opt/kde/lib64 /usr/X11R6/kde/lib64 /usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib $x_libraries"
 +        kde_incdirs="/usr/lib64/kde/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /opt/kde3/include /opt/kde/include $x_includes"
-         kde_libdirs="/usr/lib64/kde/lib64 /usr/local/kde/lib64 /usr/kde/lib64 /usr/lib64/kde /usr/lib64/kde3 /usr/lib64 /usr/X11R6/lib64 /usr/local/lib64 /opt/kde3/lib64 /opt/kde/lib64 /usr/X11R6/kde/lib64 /usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib $x_libraries"
++        kde_libdirs="/usr/lib64/kde/lib64 /usr/local/kde/lib64 /usr/kde/lib64 /usr/lib64/kde /usr/lib64/kde3 /usr/X11R6/lib64 /usr/local/lib64 /opt/kde3/lib64 /opt/kde/lib64 /usr/X11R6/kde/lib64 /usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib /usr/lib64 $x_libraries"
      fi
      if test -n "$KDEDIR" ; then
+         kde_incdirs="$KDEDIR/include $kde_incdirs"
 @@ -6069,12 +6083,6 @@ your Qt installation by exporting QTDIR before running "configure".])
  your Qt installation by exporting QTDIR before running "configure".])
      fi
diff --git a/patches/dev300/kde4-plugin-detection.diff b/patches/dev300/kde4-plugin-detection.diff
index 80f442b..15dbbd7 100644
--- a/patches/dev300/kde4-plugin-detection.diff
+++ b/patches/dev300/kde4-plugin-detection.diff
@@ -88,7 +88,7 @@ index 335bb8f..da10725 100644
      else if( desktop == desktop_strings[DESKTOP_KDE] )
          pRet = "kde";
 +    else if( desktop == desktop_strings[DESKTOP_KDE4] )
-+        pRet = "kde";
++        pRet = "kde4";
      else
          pRet = "gen";
          
diff --git a/patches/dev300/kde4-vcl.diff b/patches/dev300/kde4-vcl.diff
index 5442c26..4a1bf03 100644
--- a/patches/dev300/kde4-vcl.diff
+++ b/patches/dev300/kde4-vcl.diff
@@ -1,8 +1,8 @@
-diff --git vcl/unx/kde4/kdedata.cxx vcl/unx/kde4/kdedata.cxx
+diff --git vcl/unx/kde4/kde4data.cxx vcl/unx/kde4/kde4data.cxx
 new file mode 100644
 index 0000000..bfc0d2c
 --- /dev/null
-+++ vcl/unx/kde4/kdedata.cxx
++++ vcl/unx/kde4/kde4data.cxx
 @@ -0,0 +1,291 @@
 +/*************************************************************************
 + *
@@ -12,7 +12,7 @@ index 0000000..bfc0d2c
 + *
 + * OpenOffice.org - a multi-platform office productivity suite
 + *
-+ * $RCSfile: kdedata.cxx,v $
++ * $RCSfile: kde4data.cxx,v $
 + * $Revision: 1.21 $
 + *
 + * This file is part of OpenOffice.org.
@@ -54,7 +54,7 @@ index 0000000..bfc0d2c
 +#include <sys/time.h>
 +#include <unistd.h>
 +#endif
-+#include <plugins/kde4/kdedata.hxx>
++#include <plugins/kde4/kde4data.hxx>
 +#include <osl/thread.h>
 +#include <osl/process.h>
 +#include <osl/module.h>
@@ -371,8 +371,8 @@ index 0000000..fe78901
 +.ENDIF
 +
 +SLOFILES=\
-+	$(SLO)$/kdedata.obj	\
-+	$(SLO)$/salnativewidgets-kde.obj
++	$(SLO)$/kde4data.obj	\
++	$(SLO)$/salnativewidgets-kde4.obj
 +
 +.ELSE # "$(ENABLE_KDE4)" != ""
 +
@@ -386,11 +386,11 @@ index 0000000..fe78901
 +.INCLUDE :  target.mk
 +
 +.INCLUDE :  $(PRJ)$/util$/target.pmk
-diff --git vcl/unx/kde4/salnativewidgets-kde.cxx vcl/unx/kde4/salnativewidgets-kde.cxx
+diff --git vcl/unx/kde4/salnativewidgets-kde4.cxx vcl/unx/kde4/salnativewidgets-kde4.cxx
 new file mode 100644
 index 0000000..ac91b21
 --- /dev/null
-+++ vcl/unx/kde4/salnativewidgets-kde.cxx
++++ vcl/unx/kde4/salnativewidgets-kde4.cxx
 @@ -0,0 +1,1261 @@
 +/*************************************************************************
 + *
@@ -400,7 +400,7 @@ index 0000000..ac91b21
 + *
 + * OpenOffice.org - a multi-platform office productivity suite
 + *
-+ * $RCSfile: salnativewidgets-kde.cxx,v $
++ * $RCSfile: salnativewidgets-kde4.cxx,v $
 + * $Revision: 1.26.86.1 $
 + *
 + * This file is part of OpenOffice.org.
@@ -441,7 +441,7 @@ index 0000000..ac91b21
 +#endif
 +#include <vcl/settings.hxx>
 +#include <rtl/ustrbuf.hxx>
-+#include <plugins/kde4/kdedata.hxx>
++#include <plugins/kde4/kde4data.hxx>
 +#include <iostream>
 +
 +#include <pspgraphics.h>
@@ -1761,11 +1761,11 @@ index 0000000..e9b87d7
 +
 +
 +#endif
-diff --git vcl/unx/inc/plugins/kde4/kdedata.hxx vcl/unx/inc/plugins/kde4/kdedata.hxx
+diff --git vcl/unx/inc/plugins/kde4/kde4data.hxx vcl/unx/inc/plugins/kde4/kde4data.hxx
 new file mode 100644
 index 0000000..e25c97a
 --- /dev/null
-+++ vcl/unx/inc/plugins/kde4/kdedata.hxx
++++ vcl/unx/inc/plugins/kde4/kde4data.hxx
 @@ -0,0 +1,115 @@
 +/*************************************************************************
 + *
@@ -1775,7 +1775,7 @@ index 0000000..e25c97a
 + *
 + * OpenOffice.org - a multi-platform office productivity suite
 + *
-+ * $RCSfile: kdedata.hxx,v $
++ * $RCSfile: kde4data.hxx,v $
 + * $Revision: 1.8 $
 + *
 + * This file is part of OpenOffice.org.
@@ -1882,3 +1882,52 @@ index 0000000..e25c97a
 +};
 +
 +#endif // _VCL_KDEDATA_HXX
+diff --git vcl/util/makefile.mk vcl/util/makefile.mk
+index f41aae8..a842fa9 100644
+--- vcl/util/makefile.mk
++++ vcl/util/makefile.mk
+@@ -387,7 +387,7 @@ SHL5IMPLIB=ikde_plug_
+ SHL5LIBS=$(LIB5TARGET)
+ SHL5DEPN=$(SHL2TARGETN)
+ # libs for KDE plugin
+-SHL5STDLIBS=$(KDE_LIBS)
++SHL5LINKFLAGS+=$(KDE_LIBS)
+ SHL5STDLIBS+=-l$(SHL2TARGET)
+ SHL5STDLIBS+=\
+         $(VCLLIB)       \
+@@ -404,6 +404,35 @@ SHL5STDLIBS+= $(XRANDR_LIBS)
+ 
+ .ENDIF # "$(ENABLE_KDE)" != ""
+ 
++# KDE4 plugin
++.IF "$(ENABLE_KDE4)" != ""
++.IF "$(KDE4_ROOT)"!=""
++EXTRALIBPATHS+=-L$(KDE4_ROOT)$/lib
++.ENDIF
++LIB6TARGET=$(SLB)$/ikde4_plug_
++LIB6FILES=$(SLB)$/kde4plug.lib
++SHL6TARGET=vclplug_kde4$(DLLPOSTFIX)
++SHL6IMPLIB=ikde4_plug_
++SHL6LIBS=$(LIB6TARGET)
++SHL6DEPN=$(SHL2TARGETN)
++# libs for KDE4 plugin
++SHL6LINKFLAGS+=$(KDE4_LIBS)
++SHL6STDLIBS+=-l$(SHL2TARGET)
++SHL6STDLIBS+=\
++        $(VCLLIB)       \
++        $(PSPLIB)	\
++        $(TOOLSLIB)     \
++        $(VOSLIB)       \
++        $(SALLIB)
++
++.IF "$(ENABLE_RANDR)" != ""
++.IF "$(XRANDR_DLOPEN)" == "FALSE"
++SHL6STDLIBS+= $(XRANDR_LIBS)
++.ENDIF
++.ENDIF
++
++.ENDIF # "$(ENABLE_KDE4)" != ""
++
+ .ENDIF # UNX
+ 
+ # --- Allgemein ----------------------------------------------------------
commit bb34313cf0939740fa8e426743291ad03aefc054
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Jun 12 14:09:42 2009 +0200

    create-gitignores.sh should call git init when no .git exists.

diff --git a/bin/create-gitignores.sh b/bin/create-gitignores.sh
index fd36c64..c244d28 100755
--- a/bin/create-gitignores.sh
+++ b/bin/create-gitignores.sh
@@ -3,6 +3,8 @@
 # create .gitignores for the the OOo tree
 # run in build/xyz680-mABC
 
+[ -d .git ] || git init
+
 chmod a+x solenv/bin/build.pl
 chmod a+x solenv/bin/gccinstlib.pl
 
commit 71f15eb77ca2fe988116221c8b9393f0f4290f78
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Fri Jun 12 10:44:45 2009 +0200

    Several fixes of the KDE4 integration build.
    
    * configure.in: Correctly recognize --enable-kde4.
    * patches/dev300/apply: Apply Roman's stuff.
    * patches/dev300/kde4-configure.diff: Fix to build OK together with KDE3.

diff --git a/configure.in b/configure.in
index 9ce0145..daad851 100644
--- a/configure.in
+++ b/configure.in
@@ -251,6 +251,11 @@ AC_ARG_ENABLE(kde,
   --disable-kde           Disables KDE native widgets.],
 ,)
 
+AC_ARG_ENABLE(kde4,
+[
+  --disable-kde4           Disables KDE4 native widgets.],
+,)
+
 AC_ARG_ENABLE(strip,
 [
   --disable-strip
@@ -723,12 +728,6 @@ if test "z$with_max_jobs" != "z"; then
 fi
 AC_SUBST(MAX_JOBS)
 
-if test "z$with_distro" = "zKDE"; then
-   if test "z$enable_kde" = "z" ; then
-        enable_kde=true
-   fi
-fi
-
 OOOP_FONTS_PACK=
 OOOP_GALLERY_PACK=
 OOOP_SAMPLES_PACK=
@@ -749,9 +748,19 @@ AC_MSG_CHECKING([for widget sets])
 OOO_WIDGET_FLAGS=
 if test "$enable_kde" != "no"; then
    if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin"; then
-      OOO_WIDGET_FLAGS="--enable-kde "
+      OOO_WIDGET_FLAGS="--enable-kde"
       widget_sets="kde"
    fi
+else
+   OOO_WIDGET_FLAGS="--disable-kde"
+fi
+if test "$enable_kde4" != "no"; then
+   if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin"; then
+      OOO_WIDGET_FLAGS="$OOO_WIDGET_FLAGS --enable-kde4"
+      widget_sets="$widget_sets kde4"
+   fi
+else
+   OOO_WIDGET_FLAGS="$OOO_WIDGET_FLAGS --disable-kde4"
 fi
 if test "$enable_gtk" != "no"; then
    if test "z$with_win32" = "z" -a "z`uname -s`" != "zDarwin"; then
diff --git a/patches/dev300/apply b/patches/dev300/apply
index 1c1aa26..61afc48 100644
--- a/patches/dev300/apply
+++ b/patches/dev300/apply
@@ -2759,18 +2759,25 @@ chart2-es-eje-Y.diff, i#83821, rengelha
 SectionOwner => jholesov
 SectionIssue => i#90618
 
-# Initial KDE4 support by Eric Bischoff
+# KDE4 support by Eric Bischoff, Bernhard Rosenkraenzer and Roman Shtylman
 kde4-configure.diff
-kde4-kab.diff
-kde4-kdebe.diff
-kde4-kdedata.cxx.diff
-kde4-kde_headers.diff
-kde4-salnativewidgets-kde.diff
-
 kde4-plugin-detection.diff
 
-# More KDE4 bits by Bernhard Rosenkraenzer
-kde4-fpicker.diff, i#90618, brosenk
+kde4-shell-prj.diff
+kde4-shell-source.diff
+
+kde4-fpicker-prj.diff
+kde4-fpicker-source.diff
+
+kde4-scp2.diff
+
+kde4-vcl-prj.diff
+kde4-vcl.diff
+
+# Not yet ported to co-exist with KDE3 stuff
+#kde4-kab.diff
+#kde4-kdebe.diff
+
 
 [ UnstableLibwpd ]
 config_office-testing.diff
diff --git a/patches/dev300/kde4-configure.diff b/patches/dev300/kde4-configure.diff
index c9086d9..a4c47dc 100644
--- a/patches/dev300/kde4-configure.diff
+++ b/patches/dev300/kde4-configure.diff
@@ -1,5 +1,5 @@
 diff --git configure.in configure.in
-index c57821b..decc90a 100644
+index d2d8406..9751f3d 100644
 --- configure.in
 +++ configure.in
 @@ -269,6 +269,10 @@ AC_ARG_ENABLE(kde,
@@ -59,7 +59,41 @@ index c57821b..decc90a 100644
  if test -z "$R"; then
  	AC_MSG_RESULT([none])
  else
-@@ -6111,8 +6126,102 @@ your KDE installation by exporting KDEDIR before running "configure".])
+@@ -5999,7 +6014,6 @@ dnl ===================================================================
+ 
+ KDE_CFLAGS=""
+ KDE_LIBS=""
+-MOC="moc"
+ if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
+     dnl Search paths for Qt and KDE
+     if test "$build_cpu" != "x86_64" ; then
+@@ -6018,10 +6032,10 @@ if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
+         fi
+     fi
+     if test "$build_cpu" != "x86_64" ; then
+-        kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes"
++        kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /opt/kde3/include /opt/kde/include $x_includes"
+         kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib $x_libraries"
+     else
+-        kde_incdirs="/usr/lib64/kde/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes"
++        kde_incdirs="/usr/lib64/kde/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /opt/kde3/include /opt/kde/include $x_includes"
+         kde_libdirs="/usr/lib64/kde/lib64 /usr/local/kde/lib64 /usr/kde/lib64 /usr/lib64/kde /usr/lib64/kde3 /usr/lib64 /usr/X11R6/lib64 /usr/local/lib64 /opt/kde3/lib64 /opt/kde/lib64 /usr/X11R6/kde/lib64 /usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib $x_libraries"
+     fi
+     if test -n "$KDEDIR" ; then
+@@ -6069,12 +6083,6 @@ your Qt installation by exporting QTDIR before running "configure".])
+ your Qt installation by exporting QTDIR before running "configure".])
+     fi
+ 
+-    AC_PATH_PROG( MOC, moc, no, [$QTDIR/bin:$PATH] )
+-    if test "$MOC" = "no" ; then
+-        AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
+-the root of your Qt installation by exporting QTDIR before running "configure".])
+-     fi
+-     
+     dnl Check for KDE headers
+     AC_MSG_CHECKING([for KDE headers])
+     kde_incdir="no"
+@@ -6111,6 +6119,107 @@ your KDE installation by exporting KDEDIR before running "configure".])
  fi
  AC_SUBST(KDE_CFLAGS)
  AC_SUBST(KDE_LIBS)
@@ -71,94 +105,113 @@ index c57821b..decc90a 100644
 +KDE4_CFLAGS=""
 +KDE4_LIBS=""
 +if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then
-+	
-+	qt_incdirs="$QTINC $QTDIR /usr/include/qt4 /usr/include $x_includes"
-+	qt_libdirs="$QTLIB /usr/lib $x_libraries"
-+	
-+	kde_incdirs="/usr/include $x_includes"
-+	kde_libdirs="/usr/lib $x_libraries"
-+	
-+	if test "$build_cpu" == "x86_64" ; then
-+        qt_libdirs="$qt_libdirs /usr/lib64/qt /usr/lib64"
-+		kde_libdirs="$kde_libdirs /usr/lib64/kde4"
-+	fi
++   qt_incdirs="$QTINC $QTDIR /usr/include/qt4 /usr/include $x_includes"
++   qt_libdirs="$QTLIB /usr/lib $x_libraries"
++   
++   kde_incdirs="/usr/include $x_includes"
++   kde_libdirs="/usr/lib $x_libraries"
++   
++   if test "$build_cpu" == "x86_64" ; then
++      qt_libdirs="$qt_libdirs /usr/lib64/qt /usr/lib64"
++      kde_libdirs="$kde_libdirs /usr/lib64 /usr/lib64/kde4"
++   fi
 +
-+	qt_test_include="Qt/qobject.h"
-+	qt_test_library="libQtCore.so"
-+	kde_test_include="ksharedptr.h"
-+	kde_test_library="libkdeui.so"
-+	
-+	AC_MSG_CHECKING([for Qt headers])
-+	qt_header_dir="no"
-+	for inc_dir in $qt_incdirs ; do
-+		if test -r "$inc_dir/$qt_test_include" ; then
-+			qt_header_dir="$inc_dir"
-+			break
-+		fi
-+	done
-+	
-+	AC_MSG_RESULT([$qt_header_dir])
-+	if test "x$qt_header_dir" = "xno" ; then
-+		AC_MSG_ERROR([Qt headers not found.  Please specify the root of your Qt installation by exporting QTDIR before running "configure".])
-+	fi
-+	
-+	AC_MSG_CHECKING([for Qt libraries])
-+	qt_lib_dir="no"
-+	for lib_dir in $qt_libdirs ; do
-+		if test -r "$lib_dir/$qt_test_library" ; then
-+			qt_lib_dir="$lib_dir"
-+			break
-+		fi
-+	done
-+	
-+	AC_MSG_RESULT([$qt_lib_dir])
-+	
-+	if test "x$qt_lib_dir" = "xno" ; then
-+		AC_MSG_ERROR([Qt libraries not found.  Please specify the root of your Qt installation by exporting QTDIR before running "configure".])
-+	fi
++   qt_test_include="Qt/qobject.h"
++   qt_test_library="libQtCore.so"
++   kde_test_include="ksharedptr.h"
++   kde_test_library="libkdeui.so"
++   
++   AC_MSG_CHECKING([for Qt4 headers])
++   qt_header_dir="no"
++   for inc_dir in $qt_incdirs ; do
++      if test -r "$inc_dir/$qt_test_include" ; then
++         qt_header_dir="$inc_dir"
++         break
++      fi
++   done
++   
++   AC_MSG_RESULT([$qt_header_dir])
++   if test "x$qt_header_dir" = "xno" ; then
++      AC_MSG_ERROR([Qt4 headers not found.  Please specify the root of your Qt4 installation by exporting QTDIR before running "configure".])
++   fi
++   
++   AC_MSG_CHECKING([for Qt4 libraries])
++   qt_lib_dir="no"
++   for lib_dir in $qt_libdirs ; do
++      if test -r "$lib_dir/$qt_test_library" ; then
++         qt_lib_dir="$lib_dir"
++         break
++      fi
++   done
++   
++   AC_MSG_RESULT([$qt_lib_dir])
++   
++   if test "x$qt_lib_dir" = "xno" ; then
++      AC_MSG_ERROR([Qt4 libraries not found.  Please specify the root of your Qt4 installation by exporting QTDIR before running "configure".])
++   fi
 +
-+	AC_PATH_PROG( MOC, moc, no, [$QTDIR/bin:$PATH] )
-+	if test "$MOC" = "no" ; then
-+		AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify the root of your Qt installation by exporting QTDIR before running "configure".])
-+	fi
-+	
-+	dnl Check for KDE headers
-+	AC_MSG_CHECKING([for KDE headers])
-+	kde_incdir="no"
-+	for kde_check in $kde_incdirs ; do
-+		if test -r "$kde_check/$kde_test_include" ; then
-+			kde_incdir="$kde_check"
-+			break
-+		fi
-+	done
-+	AC_MSG_RESULT([$kde_incdir])
-+	if test "x$kde_incdir" = "xno" ; then
-+		AC_MSG_ERROR([KDE headers not found.  Please specify the root of your KDE installation by exporting KDEDIR before running "configure".])
-+	fi
++   dnl Check for KDE4 headers
++   AC_MSG_CHECKING([for KDE4 headers])
++   kde_incdir="no"
++   for kde_check in $kde_incdirs ; do
++      if test -r "$kde_check/$kde_test_include" ; then
++         kde_incdir="$kde_check"
++         break
++      fi
++   done
++   AC_MSG_RESULT([$kde_incdir])
++   if test "x$kde_incdir" = "xno" ; then
++      AC_MSG_ERROR([KDE4 headers not found.  Please specify the root of your KDE4 installation by exporting KDEDIR before running "configure".])
++   fi
 +
-+	dnl Check for KDE libraries
-+	AC_MSG_CHECKING([for KDE libraries])
-+	kde_libdir="no"
-+	for kde_check in $kde_libdirs ; do
-+		if test -r "$kde_check/$kde_test_library" ; then
-+			kde_libdir="$kde_check"
-+			break
-+		fi
-+	done
-+	
-+	AC_MSG_RESULT([$kde_libdir])
-+	if test "x$kde_libdir" = "xno" ; then
-+		AC_MSG_ERROR([KDE libraries not found.  Please specify the root of your KDE installation by exporting KDEDIR before running "configure".])
-+	fi
++   dnl Check for KDE4 libraries
++   AC_MSG_CHECKING([for KDE libraries])
++   kde_libdir="no"
++   for kde_check in $kde_libdirs ; do
++      if test -r "$kde_check/$kde_test_library" ; then
++         kde_libdir="$kde_check"
++         break
++      fi
++   done
++   
++   AC_MSG_RESULT([$kde_libdir])
++   if test "x$kde_libdir" = "xno" ; then
++      AC_MSG_ERROR([KDE4 libraries not found.  Please specify the root of your KDE4 installation by exporting KDEDIR before running "configure".])
++   fi
 +
-+	KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
-+	KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkdeui -lkdecore -lQtCore -lQtGui"
++   KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
++   KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkdeui -lkdecore -lQtCore -lQtGui"
 +fi
 +AC_SUBST(KDE4_CFLAGS)
 +AC_SUBST(KDE4_LIBS)
++
++dnl ===================================================================
++dnl Common for KDE3 and KDE4 Integration
++dnl ===================================================================
++
++MOC="moc"
++if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ||
++   test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then
++   AC_PATH_PROG( MOC, moc, no, [$PATH:$QTDIR/bin] )
++   if test "$MOC" = "no" ; then
++      AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify
++the root of your Qt installation by exporting QTDIR before running "configure".])
++   fi
++fi
  AC_SUBST(MOC)
  
-+
- dnl ===================================================================
- dnl Test for the enabling the lockdown pieces
  dnl ===================================================================
+diff --git set_soenv.in set_soenv.in
+index 9bc71be..3e6c663 100644
+--- set_soenv.in
++++ set_soenv.in
+@@ -1757,6 +1757,9 @@ ToFile( "ENABLE_GIO",        "@ENABLE_GIO@",       "e" );
+ ToFile( "ENABLE_KDE",        "@ENABLE_KDE@",       "e" );
+ ToFile( "KDE_CFLAGS",        "@KDE_CFLAGS@",       "e" );
+ ToFile( "KDE_LIBS",          "@KDE_LIBS@",         "e" );
++ToFile( "ENABLE_KDE4",       "@ENABLE_KDE4@",      "e" );
++ToFile( "KDE4_CFLAGS",       "@KDE4_CFLAGS@",      "e" );
++ToFile( "KDE4_LIBS",         "@KDE4_LIBS@",        "e" );
+ ToFile( "ENABLE_KAB",        "@ENABLE_KAB@",       "e" );
+ ToFile( "MOC",               "@MOC@",              "e" );
+ ToFile( "PSPRINT",           "TRUE",             "e" );
commit 08a13e3c816e6051f3fac1f459485e632eaea6d9
Author: Jan Holesovsky <kendy at suse.cz>
Date:   Thu Jun 11 17:53:23 2009 +0200

    Add a missing \n in cloning/updating message in download.in.

diff --git a/download.in b/download.in
index 0df66b4..b6ba24b 100755
--- a/download.in
+++ b/download.in
@@ -152,7 +152,7 @@ sub source_file($)
     if ( '@OOO_GIT@' ne "" ) {
         $op = "cloning";
         $op = "updating" if ( -d "@SRCDIR@/clone/$what" );
-        print "* $op from @OOO_GIT@/$what";
+        print "* $op from @OOO_GIT@/$what\n";
 
         system( "cd @SRCDIR@/clone ; if [ -d $what ] ; then cd $what ; git fetch -t origin ; else git clone -n @OOO_GIT@/$what ; fi" );
     }
commit 1ffad9c9704a19e598860bd3787666d03bb0888e
Author: Roman Shtylman <shtylman at gmail.com>
Date:   Fri Jun 12 10:42:59 2009 +0200

    Experimental KDE4 vcl plugin and file picker.
    
    This should co-exist with the existing KDE3 stuff.
    
    * patches/dev300/kde4-configure.diff: Add.
    * patches/dev300/kde4-fpicker-prj.diff:
    * patches/dev300/kde4-fpicker-source.diff:
    * patches/dev300/kde4-plugin-detection.diff:
    * patches/dev300/kde4-scp2.diff:
    * patches/dev300/kde4-shell-prj.diff:
    * patches/dev300/kde4-shell-source.diff:
    * patches/dev300/kde4-vcl-prj.diff:
    * patches/dev300/kde4-vcl.diff:

diff --git a/patches/dev300/kde4-configure.diff b/patches/dev300/kde4-configure.diff
index 95db5bd..c9086d9 100644
--- a/patches/dev300/kde4-configure.diff
+++ b/patches/dev300/kde4-configure.diff
@@ -1,69 +1,164 @@
---- configure.in.kde4~	2008-06-13 12:38:16.341775201 +0200
-+++ configure.in	2008-06-13 13:56:00.377150979 +0200
-@@ -5552,11 +5552,11 @@ MOC="moc"
- if test "$test_kde" = "yes" -a "$ENABLE_KDE" = "TRUE" ; then
-     dnl Search paths for Qt and KDE
-     if test "$build_cpu" != "x86_64" ; then
--        qt_incdirs="$QTINC /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib/qt3/include /usr/lib/qt/include /usr/share/qt3/include $x_includes"
--        qt_libdirs="$QTLIB /usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt3/lib /usr/lib/qt/lib /usr/share/qt3/lib $x_libraries"
-+        qt_incdirs="$QTINC /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib/qt4/include /usr/lib/qt/include /usr/share/qt4/include $x_includes"
-+        qt_libdirs="$QTLIB /usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt4/lib /usr/lib/qt/lib /usr/share/qt4/lib $x_libraries"
-     else
--        qt_incdirs="$QTINC /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib64/qt3/include /usr/lib64/qt/include /usr/share/qt3/include /usr/lib/qt3/include /usr/lib/qt/include $x_includes"
--        qt_libdirs="$QTLIB /usr/local/qt/lib64 /usr/lib64/qt /usr/lib64 /usr/X11R6/lib64/X11/qt /usr/X11R6/lib64/qt /usr/lib64/qt3/lib64 /usr/lib64/qt/lib64 /usr/share/qt3/lib64 /usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt3/lib /usr/lib/qt/lib /usr/share/qt3/lib $x_libraries"
-+        qt_incdirs="$QTINC /usr/local/qt/include /usr/include/qt /usr/include /usr/X11R6/include/X11/qt /usr/X11R6/include/qt /usr/lib64/qt4/include /usr/lib64/qt/include /usr/share/qt4/include /usr/lib/qt4/include /usr/lib/qt/include $x_includes"
-+        qt_libdirs="$QTLIB /usr/local/qt/lib64 /usr/lib64/qt /usr/lib64 /usr/X11R6/lib64/X11/qt /usr/X11R6/lib64/qt /usr/lib64/qt4/lib64 /usr/lib64/qt/lib64 /usr/share/qt4/lib64 /usr/local/qt/lib /usr/lib/qt /usr/lib /usr/X11R6/lib/X11/qt /usr/X11R6/lib/qt /usr/lib/qt4/lib /usr/lib/qt/lib /usr/share/qt4/lib $x_libraries"
-     fi
-     if test -n "$QTDIR" ; then
-         qt_incdirs="$QTDIR/include $qt_incdirs"
-@@ -5567,11 +5567,11 @@ if test "$test_kde" = "yes" -a "$ENABLE_
-         fi
-     fi
-     if test "$build_cpu" != "x86_64" ; then
--        kde_incdirs="/usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes"
--        kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib $x_libraries"
-+        kde_incdirs="/usr/lib/kde/include /usr/lib/kde4/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde4/include /opt/kde/include $x_includes"
-+        kde_libdirs="/usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde4 /usr/lib/kde4/lib /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde4/lib /opt/kde/lib /usr/X11R6/kde/lib $x_libraries"
-     else
--        kde_incdirs="/usr/lib64/kde/include /usr/lib/kde/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde3/include /opt/kde/include $x_includes"
--        kde_libdirs="/usr/lib64/kde/lib64 /usr/local/kde/lib64 /usr/kde/lib64 /usr/lib64/kde /usr/lib64/kde3 /usr/lib64 /usr/X11R6/lib64 /usr/local/lib64 /opt/kde3/lib64 /opt/kde/lib64 /usr/X11R6/kde/lib64 /usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde3 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde3/lib /opt/kde/lib /usr/X11R6/kde/lib $x_libraries"
-+        kde_incdirs="/usr/lib64/kde/include /usr/lib/kde/include /usr/lib/kde4/include /usr/local/kde/include /usr/local/include /usr/kde/include /usr/include/kde /usr/include /opt/kde4/include /opt/kde/include $x_includes"
-+        kde_libdirs="/usr/lib64/kde/lib64 /usr/local/kde/lib64 /usr/kde/lib64 /usr/lib64/kde /usr/lib64/kde3 /usr/lib64 /usr/X11R6/lib64 /usr/local/lib64 /opt/kde3/lib64 /opt/kde/lib64 /usr/X11R6/kde/lib64 /usr/lib/kde/lib /usr/local/kde/lib /usr/kde/lib /usr/lib/kde /usr/lib/kde4 /usr/lib /usr/X11R6/lib /usr/local/lib /opt/kde4/lib /opt/kde/lib /usr/X11R6/kde/lib $x_libraries"
-     fi
-     if test -n "$KDEDIR" ; then
-         kde_incdirs="$KDEDIR/include $kde_incdirs"
-@@ -5583,8 +5583,8 @@ if test "$test_kde" = "yes" -a "$ENABLE_
-     fi
- 
-     dnl What to test
--    qt_test_include="qstyle.h"
--    qt_test_library="libqt-mt.so"
-+    qt_test_include="Qt/qstyle.h"
-+    qt_test_library="libQtCore.so"
-     kde_test_include="ksharedptr.h"
-     kde_test_library="libkdeui.so"
- 
-@@ -5656,7 +5656,7 @@ your KDE installation by exporting KDEDI
+diff --git configure.in configure.in
+index c57821b..decc90a 100644
+--- configure.in
++++ configure.in
+@@ -269,6 +269,10 @@ AC_ARG_ENABLE(kde,
+ AC_ARG_ENABLE(kdeab,
+ [  --disable-kdeab         Disable the KDE address book support
+ ],,if test "$enable_kde" = "yes"; then enable_kdeab=yes; fi)
++AC_ARG_ENABLE(kde,
++[  --enable-kde4            Determines whether to use Qt4/KDE4 vclplug on platforms
++                          where Qt4 and KDE4 are available. Should not be used with --enable-kde.
++],,)
+ AC_ARG_ENABLE(binfilter,
+ [  --disable-binfilter     Disable legacy binary file formats filters
+ ],,if ! test -d ./binfilter; then enable_binfilter=no; fi)
+@@ -912,6 +916,7 @@ case "$build_os" in
+ 		test_cairo=yes
+ 		build_gstreamer=yes
+ 		test_kde=yes
++		test_kde4=yes
+ 		test_cups=yes
+         test_randr=yes
+ 		test_freetype=yes
+@@ -941,6 +946,7 @@ case "$build_os" in
+ 		test_cairo=yes
+ 		build_gstreamer=yes
+ 		test_kde=yes
++		test_kde4=yes
+ 		test_cups=yes
+         test_randr=yes
+ 		test_freetype=yes
+@@ -985,6 +991,7 @@ case "$build_os" in
+ 		test_cairo=yes
+ 		build_gstreamer=yes
+ 		test_kde=yes
++		test_kde4=yes
+ 		test_cups=yes
+         test_randr=yes
+ 		test_freetype=yes
+@@ -1019,6 +1026,7 @@ case "$build_os" in
+ 		test_cairo=yes
+ 		build_gstreamer=yes
+ 		test_kde=yes
++		test_kde4=yes
+ 		test_cups=no
+         test_randr=yes
+ 		test_freetype=yes
+@@ -5447,6 +5455,13 @@ if test "x$enable_kde" = "xyes"; then
+ fi
+ AC_SUBST(ENABLE_KDE)
  
-     dnl Set the variables
-     KDE_CFLAGS="-I$qt_incdir -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
--    KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lqt-mt"
-+    KDE_LIBS="-L$kde_libdir -L$qt_libdir -lkdeui -lkdecore -lQtCore -lQtGui"
++ENABLE_KDE4=""
++if test "x$enable_kde4" = "xyes"; then
++    ENABLE_KDE4="TRUE"
++    R="$R kde4"
++fi
++AC_SUBST(ENABLE_KDE4)
++
+ if test -z "$R"; then
+ 	AC_MSG_RESULT([none])
+ else
+@@ -6111,8 +6126,102 @@ your KDE installation by exporting KDEDIR before running "configure".])
  fi
  AC_SUBST(KDE_CFLAGS)
  AC_SUBST(KDE_LIBS)
-@@ -5700,12 +5700,13 @@ if test "$enable_kdeab" = "yes" && test 
-    AC_LANG_PUSH([C++])
-    save_CXXFLAGS=$CXXFLAGS
-    CXXFLAGS="$CXXFLAGS $KDE_CFLAGS"
--   AC_MSG_CHECKING([whether KDE is between 3.2 and 3.6])
-+   AC_MSG_CHECKING([whether KDE is between 3.2 and 4.79])
-        AC_TRY_RUN([
- #include <kdeversion.h>
++
++dnl ===================================================================
++dnl KDE4 Integration
++dnl ===================================================================
++
++KDE4_CFLAGS=""
++KDE4_LIBS=""
++if test "$test_kde4" = "yes" -a "$ENABLE_KDE4" = "TRUE" ; then
++	
++	qt_incdirs="$QTINC $QTDIR /usr/include/qt4 /usr/include $x_includes"
++	qt_libdirs="$QTLIB /usr/lib $x_libraries"
++	
++	kde_incdirs="/usr/include $x_includes"
++	kde_libdirs="/usr/lib $x_libraries"
++	
++	if test "$build_cpu" == "x86_64" ; then
++        qt_libdirs="$qt_libdirs /usr/lib64/qt /usr/lib64"
++		kde_libdirs="$kde_libdirs /usr/lib64/kde4"
++	fi
++
++	qt_test_include="Qt/qobject.h"
++	qt_test_library="libQtCore.so"
++	kde_test_include="ksharedptr.h"
++	kde_test_library="libkdeui.so"
++	
++	AC_MSG_CHECKING([for Qt headers])
++	qt_header_dir="no"
++	for inc_dir in $qt_incdirs ; do
++		if test -r "$inc_dir/$qt_test_include" ; then
++			qt_header_dir="$inc_dir"
++			break
++		fi
++	done
++	
++	AC_MSG_RESULT([$qt_header_dir])
++	if test "x$qt_header_dir" = "xno" ; then
++		AC_MSG_ERROR([Qt headers not found.  Please specify the root of your Qt installation by exporting QTDIR before running "configure".])
++	fi
++	
++	AC_MSG_CHECKING([for Qt libraries])
++	qt_lib_dir="no"
++	for lib_dir in $qt_libdirs ; do
++		if test -r "$lib_dir/$qt_test_library" ; then
++			qt_lib_dir="$lib_dir"
++			break
++		fi
++	done
++	
++	AC_MSG_RESULT([$qt_lib_dir])
++	
++	if test "x$qt_lib_dir" = "xno" ; then
++		AC_MSG_ERROR([Qt libraries not found.  Please specify the root of your Qt installation by exporting QTDIR before running "configure".])
++	fi
++
++	AC_PATH_PROG( MOC, moc, no, [$QTDIR/bin:$PATH] )
++	if test "$MOC" = "no" ; then
++		AC_MSG_ERROR([Qt Meta Object Compiler not found.  Please specify the root of your Qt installation by exporting QTDIR before running "configure".])
++	fi
++	
++	dnl Check for KDE headers
++	AC_MSG_CHECKING([for KDE headers])
++	kde_incdir="no"
++	for kde_check in $kde_incdirs ; do
++		if test -r "$kde_check/$kde_test_include" ; then
++			kde_incdir="$kde_check"
++			break
++		fi
++	done
++	AC_MSG_RESULT([$kde_incdir])
++	if test "x$kde_incdir" = "xno" ; then
++		AC_MSG_ERROR([KDE headers not found.  Please specify the root of your KDE installation by exporting KDEDIR before running "configure".])
++	fi
++
++	dnl Check for KDE libraries
++	AC_MSG_CHECKING([for KDE libraries])
++	kde_libdir="no"
++	for kde_check in $kde_libdirs ; do
++		if test -r "$kde_check/$kde_test_library" ; then
++			kde_libdir="$kde_check"
++			break
++		fi
++	done
++	
++	AC_MSG_RESULT([$kde_libdir])
++	if test "x$kde_libdir" = "xno" ; then
++		AC_MSG_ERROR([KDE libraries not found.  Please specify the root of your KDE installation by exporting KDEDIR before running "configure".])
++	fi
++
++	KDE4_CFLAGS="`pkg-config --cflags QtCore` `pkg-config --cflags QtGui` -I$kde_incdir -DQT_CLEAN_NAMESPACE -DQT_THREAD_SUPPORT"
++	KDE4_LIBS="-L$kde_libdir -L$qt_lib_dir -lkdeui -lkdecore -lQtCore -lQtGui"
++fi
++AC_SUBST(KDE4_CFLAGS)
++AC_SUBST(KDE4_LIBS)
+ AC_SUBST(MOC)
  
- int main(int argc, char **argv) {
-        if (KDE_VERSION_MAJOR == 3 && 2 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 6) return 0;
-+       else if (KDE_VERSION_MAJOR == 4 && 0 <= KDE_VERSION_MINOR && KDE_VERSION_MINOR <= 79) return 0;
-        else return 1;
- }
-        ], [AC_MSG_RESULT([yes])], [AC_MSG_ERROR([KDE version too old or too recent, please use another version of KDE or disable KDE address book support])])
++
+ dnl ===================================================================
+ dnl Test for the enabling the lockdown pieces
+ dnl ===================================================================
diff --git a/patches/dev300/kde4-fpicker-prj.diff b/patches/dev300/kde4-fpicker-prj.diff
new file mode 100644
index 0000000..4fb633f
--- /dev/null
+++ b/patches/dev300/kde4-fpicker-prj.diff
@@ -0,0 +1,25 @@
+diff --git fpicker/prj/build.lst fpicker/prj/build.lst
+index fd08f95..9bea040 100644
+--- fpicker/prj/build.lst
++++ fpicker/prj/build.lst
+@@ -6,8 +6,9 @@ fp      fpicker\source\odma                             nmake   -       w       fp_odma NULL
+ fp     fpicker\source\unx\gnome                        nmake   -       u       fp_gnome_filepicker fp_inc NULL
+ fp     fpicker\source\unx\kde_unx                      nmake   -       u       fp_unx_common fp_inc NULL
+ fp     fpicker\source\unx\kde                          nmake   -       u       fp_unx_kde_filepicker fp_inc NULL
++fp	fpicker\source\unx\kde4                         nmake   -       u       fp_unx_kde4 fp_inc NULL
+ fp     fpicker\source\aqua                                     nmake   -       u       fp_macosx_filepicker NULL
+ fp     fpicker\source\win32\filepicker         nmake   -       w       fp_win32_filepicker fp_inc NULL
+ fp     fpicker\source\win32\folderpicker       nmake   -       w       fp_win32_folderpicker fp_inc NULL
+ fp  fpicker\source\win32\misc                  nmake   -       w       fp_win32_misc fp_win32_filepicker.w fp_win32_folderpicker.w fp_inc NULL
+-fp     fpicker\util                            nmake   -       all     fp_util fp_gnome_filepicker.u fp_unx_common.u fp_unx_kde_filepicker.u fp_win32_filepicker.w fp_win32_misc.w fp_win32_folderpicker.w NULL
++fp	fpicker\util                            nmake   -       all     fp_util fp_gnome_filepicker.u fp_unx_common.u fp_unx_kde_filepicker.u fp_unx_kde4.u fp_win32_filepicker.w fp_win32_misc.w fp_win32_folderpicker.w NULL
+diff --git fpicker/prj/d.lst fpicker/prj/d.lst
+index 05ab72c..2a5db19 100644
+--- fpicker/prj/d.lst
++++ fpicker/prj/d.lst
+@@ -11,4 +11,5 @@ mkdir: %COMMON_DEST%\bin%_EXT%\hid
+ ..\source\win32\folderpicker\*.xml %_DEST%\xml%_EXT%\*.xml
+ ..\source\unx\gnome\fps-gnome-ucd.txt %_DEST%\bin%_EXT%\fps-gnome-ucd.txt
+ ..\source\aqua\fps-aqua-ucd.txt %_DEST%\bin%_EXT%\fps-aqua-ucd.txt
+ ..\source\unx\kde_unx\fps-kde-ucd.txt %_DEST%\bin%_EXT%\fps-kde-ucd.txt
++..\source\unx\kde4\fps-kde-ucd.txt %_DEST%\bin%_EXT%\fps-kde-ucd.txt
diff --git a/patches/dev300/kde4-fpicker-source.diff b/patches/dev300/kde4-fpicker-source.diff
new file mode 100644
index 0000000..7f15b20
--- /dev/null
+++ b/patches/dev300/kde4-fpicker-source.diff
@@ -0,0 +1,1174 @@
+diff --git fpicker/source/unx/kde4/FPServiceInfo.hxx fpicker/source/unx/kde4/FPServiceInfo.hxx
+new file mode 100644
+index 0000000..85214a1
+--- /dev/null
++++ fpicker/source/unx/kde4/FPServiceInfo.hxx
+@@ -0,0 +1,77 @@
++/*************************************************************************
++ *
++ *
++ *
++ *
++ *
++ *
++ *
++ *  The Contents of this file are made available subject to the terms of
++ *  either of the following licenses
++ *
++ *         - GNU Lesser General Public License Version 2.1
++ *         - Sun Industry Standards Source License Version 1.1
++ *
++ *  Sun Microsystems Inc., October, 2000
++ *
++ *  GNU Lesser General Public License Version 2.1
++ *  =============================================
++ *  Copyright 2000 by Sun Microsystems, Inc.
++ *  901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *  This library is free software; you can redistribute it and/or
++ *  modify it under the terms of the GNU Lesser General Public
++ *  License version 2.1, as published by the Free Software Foundation.
++ *
++ *  This library is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *  Lesser General Public License for more details.
++ *
++ *  You should have received a copy of the GNU Lesser General Public
++ *  License along with this library; if not, write to the Free Software
++ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *  MA  02111-1307  USA
++ *
++ *
++ *  Sun Industry Standards Source License Version 1.1
++ *  =================================================
++ *  The contents of this file are subject to the Sun Industry Standards
++ *  Source License Version 1.1 (the "License"); You may not use this file
++ *  except in compliance with the License. You may obtain a copy of the
++ *  License at http://www.openoffice.org/license.html.
++ *
++ *  Software provided under this License is provided on an "AS IS" basis,
++ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ *  See the License for the specific provisions governing your rights and
++ *  obligations concerning the Software.
++ *
++ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
++ *
++ *  Copyright: 2000 by Sun Microsystems, Inc.
++ *
++ *  All Rights Reserved.
++ *
++ *  Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++
++#ifndef _FPSERVICEINFO_HXX_
++#define _FPSERVICEINFO_HXX_
++
++// the service names
++#define FILE_PICKER_SERVICE_NAME "com.sun.star.ui.dialogs.KDEFilePicker"
++
++// the implementation names		
++#define FILE_PICKER_IMPL_NAME    "com.sun.star.ui.dialogs.UnxFilePicker"
++
++// the registry key names
++// a key under which this service will be registered,
++// Format: -> "/ImplName/UNO/SERVICES/ServiceName"
++//  <Implementation-Name></UNO/SERVICES/><Service-Name> 
++#define FILE_PICKER_REGKEY_NAME  "/com.sun.star.ui.dialogs.UnxFilePicker/UNO/SERVICES/com.sun.star.ui.dialogs.KDEFilePicker"
++
++#endif
+diff --git fpicker/source/unx/kde4/UnxFPentry.cxx fpicker/source/unx/kde4/UnxFPentry.cxx
+new file mode 100644
+index 0000000..4d95264
+--- /dev/null
++++ fpicker/source/unx/kde4/UnxFPentry.cxx
+@@ -0,0 +1,169 @@
++/*************************************************************************
++ *
++ *
++ *
++ *
++ *
++ *
++ *
++ *  The Contents of this file are made available subject to the terms of
++ *  either of the following licenses
++ *
++ *         - GNU Lesser General Public License Version 2.1
++ *         - Sun Industry Standards Source License Version 1.1
++ *
++ *  Sun Microsystems Inc., October, 2000
++ *
++ *  GNU Lesser General Public License Version 2.1
++ *  =============================================
++ *  Copyright 2000 by Sun Microsystems, Inc.
++ *  901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *  This library is free software; you can redistribute it and/or
++ *  modify it under the terms of the GNU Lesser General Public
++ *  License version 2.1, as published by the Free Software Foundation.
++ *
++ *  This library is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *  Lesser General Public License for more details.
++ *
++ *  You should have received a copy of the GNU Lesser General Public
++ *  License along with this library; if not, write to the Free Software
++ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *  MA  02111-1307  USA
++ *
++ *
++ *  Sun Industry Standards Source License Version 1.1
++ *  =================================================
++ *  The contents of this file are subject to the Sun Industry Standards
++ *  Source License Version 1.1 (the "License"); You may not use this file
++ *  except in compliance with the License. You may obtain a copy of the
++ *  License at http://www.openoffice.org/license.html.
++ *
++ *  Software provided under this License is provided on an "AS IS" basis,
++ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ *  See the License for the specific provisions governing your rights and
++ *  obligations concerning the Software.
++ *
++ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
++ *
++ *  Copyright: 2000 by Sun Microsystems, Inc.
++ *
++ *  All Rights Reserved.
++ *
++ *  Contributor(s): _______________________________________
++ *
++ *
++ ************************************************************************/
++
++#ifndef _CPPUHELPER_FACTORY_HXX_
++#include <cppuhelper/factory.hxx>
++#endif
++
++#ifndef _COM_SUN_STAR_CONTAINER_XSET_HPP_
++#include <com/sun/star/container/XSet.hpp>
++#endif
++
++#ifndef _OSL_DIAGNOSE_H_
++#include <osl/diagnose.h>
++#endif
++
++#ifndef _UNXFILEPICKER_HXX_
++#include "UnxFilePicker.hxx"
++#endif
++
++#ifndef _FPSERVICEINFO_HXX_
++#include "FPServiceInfo.hxx"
++#endif
++
++using namespace ::rtl;
++using namespace ::com::sun::star::uno;
++using namespace ::com::sun::star::container;
++using namespace ::com::sun::star::lang;
++using namespace ::com::sun::star::registry;
++using namespace ::cppu;
++using ::com::sun::star::ui::dialogs::XFilePicker;
++
++//////////////////////////////////////////////////////////////////////////
++// 
++//////////////////////////////////////////////////////////////////////////
++
++static Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager )
++{
++    return Reference< XInterface >( 
++            static_cast< XFilePicker* >( new UnxFilePicker( rServiceManager ) ) );
++}
++
++//////////////////////////////////////////////////////////////////////////
++// the three uno functions that will be exported
++//////////////////////////////////////////////////////////////////////////
++
++extern "C" 
++{
++
++//////////////////////////////////////////////////////////////////////////
++// component_getImplementationEnvironment
++//////////////////////////////////////////////////////////////////////////
++
++void SAL_CALL component_getImplementationEnvironment( const sal_Char ** ppEnvTypeName, uno_Environment ** ppEnv )
++{
++    *ppEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
++}
++
++//////////////////////////////////////////////////////////////////////////
++//
++//////////////////////////////////////////////////////////////////////////
++
++sal_Bool SAL_CALL component_writeInfo( void* pServiceManager, void* pRegistryKey )
++{
++    sal_Bool bRetVal = sal_True;
++
++    if ( pRegistryKey )
++    {
++        try
++        {
++            Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );				
++            pXNewKey->createKey( OUString::createFromAscii( FILE_PICKER_REGKEY_NAME ) );
++        }
++        catch( InvalidRegistryException& )
++        {			
++            OSL_ENSURE( sal_False, "InvalidRegistryException caught" );			
++            bRetVal = sal_False;
++        }
++    }
++
++    return bRetVal;
++}
++
++//////////////////////////////////////////////////////////////////////////
++//
++//////////////////////////////////////////////////////////////////////////
++
++void* SAL_CALL component_getFactory( const sal_Char* pImplName, uno_Interface* pSrvManager, uno_Interface* pRegistryKey )
++{
++    void* pRet = 0;
++
++    if ( pSrvManager && ( 0 == rtl_str_compare( pImplName, FILE_PICKER_IMPL_NAME ) ) )
++    {
++        Sequence< OUString > aSNS( 1 );
++        aSNS.getArray( )[0] = OUString::createFromAscii( FILE_PICKER_SERVICE_NAME );		
++
++        Reference< XSingleServiceFactory > xFactory ( createSingleFactory(
++                    reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
++                    OUString::createFromAscii( pImplName ),
++                    createInstance,
++                    aSNS ) );
++        if ( xFactory.is() )
++        {
++            xFactory->acquire();
++            pRet = xFactory.get();
++        }			
++    }
++
++    return pRet;
++}
++
++} // extern "C"
+diff --git fpicker/source/unx/kde4/UnxFilePicker.cxx fpicker/source/unx/kde4/UnxFilePicker.cxx
+new file mode 100644
+index 0000000..ce3a01f
+--- /dev/null
++++ fpicker/source/unx/kde4/UnxFilePicker.cxx
+@@ -0,0 +1,489 @@
++/*************************************************************************
++ *
++ *
++ *
++ *
++ *
++ *
++ *
++ *  The Contents of this file are made available subject to the terms of
++ *  either of the following licenses
++ *
++ *         - GNU Lesser General Public License Version 2.1
++ *         - Sun Industry Standards Source License Version 1.1
++ *
++ *  Sun Microsystems Inc., October, 2000
++ *
++ *  GNU Lesser General Public License Version 2.1
++ *  =============================================
++ *  Copyright 2000 by Sun Microsystems, Inc.
++ *  901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *  This library is free software; you can redistribute it and/or
++ *  modify it under the terms of the GNU Lesser General Public
++ *  License version 2.1, as published by the Free Software Foundation.
++ *
++ *  This library is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *  Lesser General Public License for more details.
++ *
++ *  You should have received a copy of the GNU Lesser General Public
++ *  License along with this library; if not, write to the Free Software
++ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *  MA  02111-1307  USA
++ *
++ *
++ *  Sun Industry Standards Source License Version 1.1
++ *  =================================================
++ *  The contents of this file are subject to the Sun Industry Standards
++ *  Source License Version 1.1 (the "License"); You may not use this file
++ *  except in compliance with the License. You may obtain a copy of the
++ *  License at http://www.openoffice.org/license.html.
++ *
++ *  Software provided under this License is provided on an "AS IS" basis,
++ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ *  See the License for the specific provisions governing your rights and
++ *  obligations concerning the Software.
++ *
++ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
++ *
++ *  Copyright: 2000 by Sun Microsystems, Inc.
++ *
++ *  All Rights Reserved.
++ *
++ *  Contributor(s): Jan Holesovsky <kendy at openoffice.org>
++ *
++ *
++ ************************************************************************/
++
++//////////////////////////////////////////////////////////////////////////
++// includes
++//////////////////////////////////////////////////////////////////////////
++
++#ifndef _COM_SUN_STAR_LANG_DISPOSEDEXCEPTION_HPP_
++#include <com/sun/star/lang/DisposedException.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
++#include <com/sun/star/lang/XMultiServiceFactory.hpp>
++#endif
++
++#ifndef _CPPUHELPER_INTERFACECONTAINER_H_
++#include <cppuhelper/interfacecontainer.h>
++#endif
++
++#ifndef _OSL_DIAGNOSE_H_
++#include <osl/diagnose.h>
++#endif
++
++#ifndef _COM_SUN_STAR_UI_DIALOGS_TEMPLATEDESCRIPTION_HPP_
++#include <com/sun/star/ui/dialogs/TemplateDescription.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_UI_DIALOGS_COMMONFILEPICKERELEMENTIDS_HPP_
++#include <com/sun/star/ui/dialogs/CommonFilePickerElementIds.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_UI_DIALOGS_EXTENDEDFILEPICKERELEMENTIDS_HPP_
++#include <com/sun/star/ui/dialogs/ExtendedFilePickerElementIds.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_UI_DIALOGS_CONTROLACTIONS_HPP_
++#include <com/sun/star/ui/dialogs/ControlActions.hpp>
++#endif
++
++#ifndef _RTL_USTRING_H_
++#include <rtl/ustring.hxx>
++#endif
++
++#ifndef _RTL_USTRBUF_HXX_
++#include <rtl/ustrbuf.hxx>
++#endif
++
++#ifndef _FPSERVICEINFO_HXX_
++#include "FPServiceInfo.hxx"
++#endif
++
++#ifndef _TOOLS_RESMGR_HXX
++#include <tools/resmgr.hxx>
++#endif
++
++#ifndef _SVTOOLS_HRC
++#include <svtools/svtools.hrc>
++#endif
++
++#ifndef _UNXFILEOPENIMPL_HXX_
++#include "UnxFilePicker.hxx"
++#endif
++
++#include <vos/mutex.hxx>
++
++#include <vcl/svapp.hxx>
++#include <vcl/sysdata.hxx>
++#include <vcl/syswin.hxx>
++#include <vcl/window.hxx>
++
++#include <sys/wait.h>
++#include <unistd.h>
++#include <fcntl.h>
++#include <stdio.h>
++
++/* ********* Hack, but needed because of conflicting types... */
++#define Region QtXRegion
++
++#include <kfiledialog.h>
++#include <kwindowsystem.h>
++#include <kapplication.h>
++
++#undef Region
++
++using namespace ::com::sun::star;
++
++using namespace ::com::sun::star::ui::dialogs;
++using namespace ::com::sun::star::ui::dialogs::TemplateDescription;
++
++using namespace ::com::sun::star;
++using namespace ::com::sun::star::ui::dialogs;
++using namespace ::com::sun::star::ui::dialogs::TemplateDescription;
++using namespace ::com::sun::star::ui::dialogs::ExtendedFilePickerElementIds;
++using namespace ::com::sun::star::ui::dialogs::CommonFilePickerElementIds;
++using namespace ::com::sun::star::lang;
++using namespace ::com::sun::star::beans;
++using namespace ::com::sun::star::uno;
++
++//////////////////////////////////////////////////////////////////////////
++// helper functions
++//////////////////////////////////////////////////////////////////////////
++
++namespace
++{
++    // controling event notifications    
++    const bool STARTUP_SUSPENDED = true;
++    const bool STARTUP_ALIVE     = false;
++
++    uno::Sequence<rtl::OUString> SAL_CALL FilePicker_getSupportedServiceNames()
++    {
++        uno::Sequence<rtl::OUString> aRet(3);
++        aRet[0] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.FilePicker");
++        aRet[1] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.SystemFilePicker");
++        aRet[2] = rtl::OUString::createFromAscii("com.sun.star.ui.dialogs.KDEFilePicker");
++        return aRet;
++    }
++}
++
++//////////////////////////////////////////////////////////////////////////
++// UnxFilePicker
++//////////////////////////////////////////////////////////////////////////
++
++UnxFilePicker::UnxFilePicker( const uno::Reference<lang::XMultiServiceFactory>& xServiceMgr )
++    : cppu::WeakComponentImplHelper8< 		
++          XFilterManager, 
++          XFilterGroupManager,
++          XFilePickerControlAccess,
++          XFilePickerNotifier,
++// TODO   XFilePreview,
++          lang::XInitialization,
++          util::XCancellable,
++          lang::XEventListener, 
++          lang::XServiceInfo>( m_rbHelperMtx ),
++          m_xServiceMgr( xServiceMgr )
++{
++	_dialog = new KFileDialog(KUrl("/home/shtylman/Desktop"), QString(""), 0);
++}
++
++UnxFilePicker::~UnxFilePicker()
++{
++	delete _dialog;
++}
++
++void SAL_CALL UnxFilePicker::addFilePickerListener( const uno::Reference<XFilePickerListener>& xListener )
++	throw( uno::RuntimeException )
++{
++    ::vos::OGuard aGuard( Application::GetSolarMutex() );
++    m_xListener = xListener;
++}
++
++void SAL_CALL UnxFilePicker::removeFilePickerListener( const uno::Reference<XFilePickerListener>& )
++	throw( uno::RuntimeException )
++{
++    ::vos::OGuard aGuard( Application::GetSolarMutex() );
++    m_xListener.clear();
++}
++
++void SAL_CALL UnxFilePicker::setTitle( const rtl::OUString &rTitle )
++    throw( uno::RuntimeException )
++{
++	fprintf(stderr, "set title fp\n");
++}
++
++sal_Int16 SAL_CALL UnxFilePicker::execute()
++    throw( uno::RuntimeException )
++{
++	fprintf(stderr, "execute fp\n");
++	
++	//get the window id of the main OO window to set it for the dialog as a parent
++	Window *pParentWin = Application::GetDefDialogParent();
++	if ( pParentWin )
++	{
++		const SystemEnvData* pSysData = ((SystemWindow *)pParentWin)->GetSystemData();
++		if ( pSysData )
++		{
++			KWindowSystem::setMainWindow( _dialog, pSysData->aWindow); // unx only
++		}
++	}
++	
++	_dialog->setMode( KFile::File | KFile::LocalOnly | KFile::ExistingOnly );
++	_dialog->setOperationMode(KFileDialog::Opening);
++	
++	_dialog->exec();
++	
++	//nasty hack to get a local qt event loop going to process the dialog
++	//otherwise the dialog returns immediately
++	while (_dialog->isVisible())
++	{
++		kapp->processEvents(QEventLoop::WaitForMoreEvents);
++	}
++	
++	fprintf(stderr, "exec ret\n");
++	
++	//block and wait for user input
++	if (_dialog->result() == KFileDialog::Accepted)
++	{
++		return true;
++	}
++	
++	return false;
++}
++
++void SAL_CALL UnxFilePicker::setMultiSelectionMode( sal_Bool bMode )
++    throw( uno::RuntimeException )
++{
++	fprintf(stderr, "set multi sel mode fp\n");
++}
++
++void SAL_CALL UnxFilePicker::setDefaultName( const ::rtl::OUString &rName )
++    throw( uno::RuntimeException )
++{
++	fprintf(stderr, "set def name fp\n");
++}
++
++void SAL_CALL UnxFilePicker::setDisplayDirectory( const rtl::OUString &rDirectory )
++    throw( uno::RuntimeException )
++{
++	fprintf(stderr, "set disp dir fp\n");
++}
++
++rtl::OUString SAL_CALL UnxFilePicker::getDisplayDirectory()
++    throw( uno::RuntimeException )
++{
++	fprintf(stderr, "get disp dir fp\n");
++	
++	const char* s = "/home/shtylman/Desktop";
++	return rtl::OUString(s, strlen(s), RTL_TEXTENCODING_UTF8);
++}
++
++uno::Sequence< ::rtl::OUString > SAL_CALL UnxFilePicker::getFiles()
++    throw( uno::RuntimeException )
++{
++	QStringList files = _dialog->selectedFiles();
++	
++	fprintf(stderr, "get files %d\n", files.size());
++	
++	//uno::Sequence< ::rtl::OUString > seq(files.size());
++	uno::Sequence< ::rtl::OUString > seq(1);
++	
++	////seq[0] = rtl::OUString("file:/home/shtylman/Desktop/test.cpp", strlen("file:/home/shtylman/Desktop/test.cpp"), RTL_TEXTENCODING_UTF8);
++	for (int i=0 ; i<files.size() ; ++i)
++	{
++		const QString fileName = "file:" + files[i];
++		fprintf(stderr, "%s\n", fileName.toUtf8().data());
++		seq[i] = rtl::OUString(fileName.toUtf8().data(), fileName.size(), RTL_TEXTENCODING_UTF8);
++	}
++	
++	return seq;
++}
++
++void SAL_CALL UnxFilePicker::appendFilter( const ::rtl::OUString &rTitle, const ::rtl::OUString &rFilter )
++    throw( lang::IllegalArgumentException, uno::RuntimeException )
++{
++	fprintf(stderr, "append filter fp\n");
++}
++
++void SAL_CALL UnxFilePicker::setCurrentFilter( const rtl::OUString &rTitle )
++    throw( lang::IllegalArgumentException, uno::RuntimeException )
++{
++	fprintf(stderr, "set current filter fp\n");
++}
++
++rtl::OUString SAL_CALL UnxFilePicker::getCurrentFilter()
++    throw( uno::RuntimeException )
++{
++	fprintf(stderr, "get current filter fp\n");
++	const char* s = "";
++	return rtl::OUString(s, strlen(s), RTL_TEXTENCODING_UTF8);
++}
++
++void SAL_CALL UnxFilePicker::appendFilterGroup( const rtl::OUString &rGroupTitle, const uno::Sequence<beans::StringPair> &rFilters )
++    throw( lang::IllegalArgumentException, uno::RuntimeException )
++{
++	fprintf(stderr, "append filter group fp\n");
++}
++
++void SAL_CALL UnxFilePicker::setValue( sal_Int16 nControlId, sal_Int16 nControlAction, const uno::Any &rValue )
++    throw( uno::RuntimeException )
++{
++	fprintf(stderr, "set value fp\n");
++}
++
++uno::Any SAL_CALL UnxFilePicker::getValue( sal_Int16 nControlId, sal_Int16 nControlAction )
++    throw( uno::RuntimeException )
++{
++	fprintf(stderr, "get value fp\n");
++}
++
++void SAL_CALL UnxFilePicker::enableControl( sal_Int16 nControlId, sal_Bool bEnable )
++    throw( uno::RuntimeException )
++{
++}
++
++void SAL_CALL UnxFilePicker::setLabel( sal_Int16 nControlId, const ::rtl::OUString &rLabel )
++    throw( uno::RuntimeException )
++{
++	fprintf(stderr, "set label fp\n");
++}
++
++rtl::OUString SAL_CALL UnxFilePicker::getLabel(sal_Int16 /*nControlId*/) 
++    throw ( uno::RuntimeException )
++{
++	fprintf(stderr, "get label fp\n");
++	const char* s = "";
++	return rtl::OUString(s, strlen(s), RTL_TEXTENCODING_UTF8);
++}
++
++/* TODO
++uno::Sequence<sal_Int16> SAL_CALL UnxFilePicker::getSupportedImageFormats()
++    throw( uno::RuntimeException )
++{
++    checkFilePicker();
++    ::osl::MutexGuard aGuard( m_aMutex );
++
++    return m_pImpl->getSupportedImageFormats();
++}
++
++sal_Int32 SAL_CALL UnxFilePicker::getTargetColorDepth()
++    throw( uno::RuntimeException )
++{
++    checkFilePicker();
++    ::osl::MutexGuard aGuard( m_aMutex );
++
++    return m_pImpl->getTargetColorDepth();
++}
++
++sal_Int32 SAL_CALL UnxFilePicker::getAvailableWidth()
++    throw( uno::RuntimeException )
++{
++    checkFilePicker();
++    ::osl::MutexGuard aGuard( m_aMutex );
++
++    return m_pImpl->getAvailableWidth();
++}
++
++sal_Int32 SAL_CALL UnxFilePicker::getAvailableHeight()
++    throw( uno::RuntimeException )
++{
++    checkFilePicker();
++    ::osl::MutexGuard aGuard( m_aMutex );
++
++    return m_pImpl->getAvailableHeight();
++}
++
++void SAL_CALL UnxFilePicker::setImage( sal_Int16 aImageFormat, const uno::Any &rImage ) 
++    throw( lang::IllegalArgumentException, uno::RuntimeException )
++{
++    checkFilePicker();
++    ::osl::MutexGuard aGuard( m_aMutex );
++
++    m_pImpl->setImage( aImageFormat, aImage );
++}
++
++sal_Bool SAL_CALL UnxFilePicker::setShowState( sal_Bool bShowState )
++    throw( uno::RuntimeException )
++{
++    checkFilePicker();
++    ::osl::MutexGuard aGuard( m_aMutex );   
++
++    return m_pImpl->setShowState( bShowState );
++}
++
++sal_Bool SAL_CALL UnxFilePicker::getShowState()
++    throw( uno::RuntimeException )
++{
++    checkFilePicker();
++    ::osl::MutexGuard aGuard( m_aMutex );
++
++    return m_pImpl->getShowState();
++}
++*/
++
++void SAL_CALL UnxFilePicker::initialize( const uno::Sequence<uno::Any> &rArguments ) 
++    throw( uno::Exception, uno::RuntimeException )
++{
++	fprintf(stderr, "initialize fp\n");
++    initFilePicker();
++	fprintf(stderr, "initialize end fp\n");
++}
++
++void SAL_CALL UnxFilePicker::cancel()
++    throw ( uno::RuntimeException )
++{
++	fprintf(stderr, "calcel fp\n");
++}
++
++void SAL_CALL UnxFilePicker::disposing( const lang::EventObject &rEvent )
++    throw( uno::RuntimeException )
++{
++    uno::Reference<XFilePickerListener> xFilePickerListener( rEvent.Source, uno::UNO_QUERY );
++
++    if ( xFilePickerListener.is() )
++        removeFilePickerListener( xFilePickerListener );
++	
++	fprintf(stderr, "disposed fp\n");
++}
++
++rtl::OUString SAL_CALL UnxFilePicker::getImplementationName() 
++    throw( uno::RuntimeException )
++{
++    return rtl::OUString::createFromAscii( FILE_PICKER_IMPL_NAME );
++}
++
++sal_Bool SAL_CALL UnxFilePicker::supportsService( const rtl::OUString& ServiceName ) 
++    throw( uno::RuntimeException )
++{
++    uno::Sequence< ::rtl::OUString > SupportedServicesNames = FilePicker_getSupportedServiceNames();
++
++    for ( sal_Int32 n = SupportedServicesNames.getLength(); n--; )
++    {
++        if ( SupportedServicesNames[n].compareTo( ServiceName ) == 0 )
++            return sal_True;
++    }
++
++    return sal_False;
++}
++
++uno::Sequence< ::rtl::OUString > SAL_CALL UnxFilePicker::getSupportedServiceNames() 
++    throw( uno::RuntimeException )
++{
++    return FilePicker_getSupportedServiceNames();
++}
++
++void UnxFilePicker::initFilePicker()
++{
++}
++
++void UnxFilePicker::checkFilePicker() throw( ::com::sun::star::uno::RuntimeException )
++{
++	fprintf(stderr, "check fp\n");
++}
+diff --git fpicker/source/unx/kde4/UnxFilePicker.hxx fpicker/source/unx/kde4/UnxFilePicker.hxx
+new file mode 100644
+index 0000000..8505ff8
+--- /dev/null
++++ fpicker/source/unx/kde4/UnxFilePicker.hxx
+@@ -0,0 +1,223 @@
++/*************************************************************************
++ *
++ *
++ *
++ *
++ *
++ *
++ *
++ *  The Contents of this file are made available subject to the terms of
++ *  either of the following licenses
++ *
++ *         - GNU Lesser General Public License Version 2.1
++ *         - Sun Industry Standards Source License Version 1.1
++ *
++ *  Sun Microsystems Inc., October, 2000
++ *
++ *  GNU Lesser General Public License Version 2.1
++ *  =============================================
++ *  Copyright 2000 by Sun Microsystems, Inc.
++ *  901 San Antonio Road, Palo Alto, CA 94303, USA
++ *
++ *  This library is free software; you can redistribute it and/or
++ *  modify it under the terms of the GNU Lesser General Public
++ *  License version 2.1, as published by the Free Software Foundation.
++ *
++ *  This library is distributed in the hope that it will be useful,
++ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
++ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++ *  Lesser General Public License for more details.
++ *
++ *  You should have received a copy of the GNU Lesser General Public
++ *  License along with this library; if not, write to the Free Software
++ *  Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++ *  MA  02111-1307  USA
++ *
++ *
++ *  Sun Industry Standards Source License Version 1.1
++ *  =================================================
++ *  The contents of this file are subject to the Sun Industry Standards
++ *  Source License Version 1.1 (the "License"); You may not use this file
++ *  except in compliance with the License. You may obtain a copy of the
++ *  License at http://www.openoffice.org/license.html.
++ *
++ *  Software provided under this License is provided on an "AS IS" basis,
++ *  WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++ *  WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++ *  MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++ *  See the License for the specific provisions governing your rights and
++ *  obligations concerning the Software.
++ *
++ *  The Initial Developer of the Original Code is: Sun Microsystems, Inc.
++ *
++ *  Copyright: 2000 by Sun Microsystems, Inc.
++ *
++ *  All Rights Reserved.
++ *
++ *  Contributor(s): Jan Holesovsky <kendy at openoffice.org>
++ *
++ *
++ ************************************************************************/
++
++#ifndef _UNXFILEPICKER_HXX_
++#define _UNXFILEPICKER_HXX_
++
++#ifndef _CPPUHELPER_COMPBASE8_HXX_
++#include <cppuhelper/compbase8.hxx>
++#endif
++
++#ifndef _OSL_CONDITN_HXX_
++#include <osl/conditn.hxx>
++#endif
++
++#ifndef _OSL_MUTEX_HXX_
++#include <osl/mutex.hxx>
++#endif
++
++#ifndef _COM_SUN_STAR_LANG_XINITIALIZATION_HPP_
++#include <com/sun/star/lang/XInitialization.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
++#include <com/sun/star/lang/XServiceInfo.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERNOTIFIER_HPP_
++#include <com/sun/star/ui/dialogs/XFilePickerNotifier.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILTERMANAGER_HPP_
++#include <com/sun/star/ui/dialogs/XFilterManager.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILTERGROUPMANAGER_HPP_
++#include <com/sun/star/ui/dialogs/XFilterGroupManager.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPICKERCONTROLACCESS_HPP_
++#include <com/sun/star/ui/dialogs/XFilePickerControlAccess.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_UI_DIALOGS_XFILEPREVIEW_HPP_
++#include <com/sun/star/ui/dialogs/XFilePreview.hpp>
++#endif
++
++#ifndef _COM_SUN_STAR_UTIL_XCANCELLABLE_HPP_
++#include <com/sun/star/util/XCancellable.hpp>
++#endif
++
++#ifndef _RTL_USTRBUF_HXX_
++#include <rtl/ustrbuf.hxx>
++#endif
++
++#include <list>
++
++class KFileDialog;
++
++class UnxFilePickerCommandThread;
++class UnxFilePickerNotifyThread;
++class ResMgr;
++
++class UnxFilePicker : 
++    public cppu::WeakComponentImplHelper8<
++        ::com::sun::star::ui::dialogs::XFilterManager,
++        ::com::sun::star::ui::dialogs::XFilterGroupManager,
++        ::com::sun::star::ui::dialogs::XFilePickerControlAccess,
++        ::com::sun::star::ui::dialogs::XFilePickerNotifier,
++// TODO ::com::sun::star::ui::dialogs::XFilePreview,
++        ::com::sun::star::lang::XInitialization,
++        ::com::sun::star::util::XCancellable,
++        ::com::sun::star::lang::XEventListener,
++        ::com::sun::star::lang::XServiceInfo >		
++{
++protected:
++    ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory > m_xServiceMgr;   // to instanciate own services		
++
++	::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener > m_xListener;
++    //ResMgr                     *m_pResMgr;
++	
++	KFileDialog* _dialog;
++	
++	osl::Mutex                  m_rbHelperMtx;
++
++public:
++    UnxFilePicker( const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >& xServiceMgr );
++    virtual ~UnxFilePicker();
++
++    // XFilePickerNotifier
++
++    virtual void SAL_CALL       addFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener ) throw( ::com::sun::star::uno::RuntimeException );
++    virtual void SAL_CALL       removeFilePickerListener( const ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFilePickerListener >& xListener ) throw( ::com::sun::star::uno::RuntimeException );
++
++    // XExecutableDialog functions
++
++    virtual void SAL_CALL       setTitle( const ::rtl::OUString &rTitle ) throw( ::com::sun::star::uno::RuntimeException );
++    virtual sal_Int16 SAL_CALL  execute() throw( ::com::sun::star::uno::RuntimeException );
++
++    // XFilePicker functions
++
++    virtual void SAL_CALL       setMultiSelectionMode( sal_Bool bMode ) throw( ::com::sun::star::uno::RuntimeException );
++    virtual void SAL_CALL       setDefaultName( const ::rtl::OUString &rName ) throw( ::com::sun::star::uno::RuntimeException );
++    virtual void SAL_CALL       setDisplayDirectory( const ::rtl::OUString &rDirectory ) throw( ::com::sun::star::uno::RuntimeException );
++    virtual ::rtl::OUString SAL_CALL getDisplayDirectory() throw( ::com::sun::star::uno::RuntimeException );
++    virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getFiles() throw( ::com::sun::star::uno::RuntimeException );
++
++    // XFilterManager functions
++
++    virtual void SAL_CALL       appendFilter( const ::rtl::OUString &rTitle, const ::rtl::OUString &rFilter ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
++    virtual void SAL_CALL       setCurrentFilter( const ::rtl::OUString &rTitle ) throw( ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException );
++    virtual ::rtl::OUString SAL_CALL getCurrentFilter() throw( ::com::sun::star::uno::RuntimeException );
++
++    // XFilterGroupManager functions
++
++    virtual void SAL_CALL       appendFilterGroup( const ::rtl::OUString &rGroupTitle, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::StringPair > &rFilters ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
++
++    // XFilePickerControlAccess functions
++
++    virtual void SAL_CALL       setValue( sal_Int16 nControlId, sal_Int16 nControlAction, const ::com::sun::star::uno::Any &rValue ) throw (::com::sun::star::uno::RuntimeException);
++    virtual ::com::sun::star::uno::Any SAL_CALL getValue( sal_Int16 nControlId, sal_Int16 nControlAction ) throw (::com::sun::star::uno::RuntimeException);
++    virtual void SAL_CALL       enableControl( sal_Int16 nControlId, sal_Bool bEnable ) throw( ::com::sun::star::uno::RuntimeException );
++    virtual void SAL_CALL       setLabel( sal_Int16 nControlId, const ::rtl::OUString &rLabel ) throw (::com::sun::star::uno::RuntimeException);
++    virtual ::rtl::OUString SAL_CALL getLabel( sal_Int16 nControlId ) throw (::com::sun::star::uno::RuntimeException);
++
++    /* TODO XFilePreview
++
++    virtual ::com::sun::star::uno::Sequence< sal_Int16 > SAL_CALL getSupportedImageFormats(  ) throw (::com::sun::star::uno::RuntimeException);
++    virtual sal_Int32 SAL_CALL  getTargetColorDepth(  ) throw (::com::sun::star::uno::RuntimeException);
++    virtual sal_Int32 SAL_CALL  getAvailableWidth(  ) throw (::com::sun::star::uno::RuntimeException);
++    virtual sal_Int32 SAL_CALL  getAvailableHeight(  ) throw (::com::sun::star::uno::RuntimeException);
++    virtual void SAL_CALL       setImage( sal_Int16 aImageFormat, const ::com::sun::star::uno::Any &rImage ) throw (::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::uno::RuntimeException);
++    virtual sal_Bool SAL_CALL   setShowState( sal_Bool bShowState ) throw (::com::sun::star::uno::RuntimeException);
++    virtual sal_Bool SAL_CALL   getShowState(  ) throw (::com::sun::star::uno::RuntimeException);
++    */
++
++    // XInitialization
++
++    virtual void SAL_CALL       initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > &rArguments ) throw( ::com::sun::star::uno::Exception, ::com::sun::star::uno::RuntimeException );
++
++    // XCancellable
++
++    virtual void SAL_CALL       cancel( ) throw( ::com::sun::star::uno::RuntimeException );
++
++    // XEventListener
++
++    virtual void SAL_CALL       disposing( const ::com::sun::star::lang::EventObject &rEvent ) throw( ::com::sun::star::uno::RuntimeException );
++
++    // XServiceInfo
++
++    virtual ::rtl::OUString SAL_CALL getImplementationName() throw( ::com::sun::star::uno::RuntimeException );
++    virtual sal_Bool SAL_CALL   supportsService( const ::rtl::OUString &rServiceName ) throw( ::com::sun::star::uno::RuntimeException );
++    virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames() throw( ::com::sun::star::uno::RuntimeException );
++
++private:
++    // prevent copy and assignment
++    UnxFilePicker( const UnxFilePicker& );           
++    UnxFilePicker& operator=( const UnxFilePicker& );
++
++protected:
++    void                        initFilePicker();
++    void                        checkFilePicker() throw( ::com::sun::star::uno::RuntimeException );
++	
++}; 
++
++#endif // _UNXFILEPICKER_HXX_
+diff --git fpicker/source/unx/kde4/fps-kde-ucd.txt fpicker/source/unx/kde4/fps-kde-ucd.txt
+new file mode 100644
+index 0000000..28aa49d
+--- /dev/null
++++ fpicker/source/unx/kde4/fps-kde-ucd.txt
+@@ -0,0 +1,6 @@
++[ComponentDescriptor]
++ImplementationName=com.sun.star.ui.dialogs.UnxFilePicker
++ComponentName=fps_kde.uno.so
++LoaderName=com.sun.star.loader.SharedLibrary
++[SupportedServices]
++com.sun.star.ui.dialogs.KDEFilePicker
+diff --git fpicker/source/unx/kde4/fps_kde.xml fpicker/source/unx/kde4/fps_kde.xml
+new file mode 100644
+index 0000000..fb967fd
+--- /dev/null
++++ fpicker/source/unx/kde4/fps_kde.xml
+@@ -0,0 +1,51 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
++<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
++    <module-name>fps_kde</module-name>
++    <component-description>
++        <author> Jan Holesovsky </author>
++        <name>    com.sun.star.comp.ui.dialogs.FilePicker </name>
++        <description>
++            The KDE implementation of the FilePicker service.
++        </description>
++        <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
++        <language>    c++    </language>
++        <status value="beta"/>
++        <supported-service>    com.sun.star.ui.dialogs.FilePicker </supported-service>        
++        <service-dependency>...</service-dependency>
++        <type>    com.sun.star.ui.dialogs.XExecutableDialog            </type>
++        <type>    com.sun.star.ui.dialogs.XFilePicker                  </type>
++        <type>    com.sun.star.ui.dialogs.XFilterManager               </type>
++        <type>    com.sun.star.ui.dialogs.XFilterGroupManager          </type>
++        <type>    com.sun.star.ui.dialogs.XFilePickerListener          </type>
++        <type>    com.sun.star.ui.dialogs.ExecutableDialogException    </type>
++        <type>    com.sun.star.ui.dialogs.XFilePickerNotifier          </type>
++        <type>    com.sun.star.ui.dialogs.XFilePickerControlAccess     </type>
++        <type>    com.sun.star.ui.dialogs.XFilePreview                 </type>
++        <type>    com.sun.star.ui.dialogs.ExtendedFilePickerElementIds </type>
++        <type>    com.sun.star.ui.dialogs.ExecutableDialogResults      </type>        
++        <type>    com.sun.star.ui.dialogs.FilePickerEvent              </type>
++        <type>    com.sun.star.ui.dialogs.CommonFilePickerElementIds   </type>
++        <type>    com.sun.star.ui.dialogs.ListboxControlActions        </type>
++        <type>    com.sun.star.ui.dialogs.TemplateDescription          </type>        
++        <type>    com.sun.star.ui.dialogs.FilePreviewImageFormats      </type>    
++        <type>    com.sun.star.util.XCancellable                       </type>
++        <type>    com.sun.star.lang.XComponent                         </type>
++        <type>    com.sun.star.lang.XMultiServiceFactory               </type>
++        <type>    com.sun.star.lang.XSingleServiceFactory              </type>
++        <type>    com.sun.star.lang.XServiceInfo                       </type>
++        <type>    com.sun.star.lang.XTypeProvider                      </type>
++        <type>    com.sun.star.lang.IllegalArgumentException           </type>
++        <type>    com.sun.star.uno.TypeClass                           </type>
++        <type>    com.sun.star.uno.XWeak                               </type>
++        <type>    com.sun.star.uno.XAggregation                        </type>
++        <type>    com.sun.star.registry.XRegistryKey                   </type>
++        <type>    com.sun.star.container.XSet                          </type>
++    </component-description>
++    <project-build-dependency>     cppuhelper  </project-build-dependency>
++    <project-build-dependency>     cppu        </project-build-dependency>
++    <project-build-dependency>     sal         </project-build-dependency>
++    <runtime-module-dependency>    cppuhelper  </runtime-module-dependency>
++    <runtime-module-dependency>    cppu2       </runtime-module-dependency>
++    <runtime-module-dependency>    sal2        </runtime-module-dependency>
++</module-description>
+diff --git fpicker/source/unx/kde4/makefile.mk fpicker/source/unx/kde4/makefile.mk
+new file mode 100644
+index 0000000..e148d81
+--- /dev/null
++++ fpicker/source/unx/kde4/makefile.mk
+@@ -0,0 +1,117 @@
++#*************************************************************************
++#
++#
++#
++#
++#
++#
++#
++#   The Contents of this file are made available subject to the terms of
++#   either of the following licenses
++#
++#          - GNU Lesser General Public License Version 2.1
++#          - Sun Industry Standards Source License Version 1.1
++#
++#   Sun Microsystems Inc., October, 2000
++#
++#   GNU Lesser General Public License Version 2.1
++#   =============================================
++#   Copyright 2000 by Sun Microsystems, Inc.
++#   901 San Antonio Road, Palo Alto, CA 94303, USA
++#
++#   This library is free software; you can redistribute it and/or
++#   modify it under the terms of the GNU Lesser General Public
++#   License version 2.1, as published by the Free Software Foundation.
++#
++#   This library is distributed in the hope that it will be useful,
++#   but WITHOUT ANY WARRANTY; without even the implied warranty of
++#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
++#   Lesser General Public License for more details.
++#
++#   You should have received a copy of the GNU Lesser General Public
++#   License along with this library; if not, write to the Free Software
++#   Foundation, Inc., 59 Temple Place, Suite 330, Boston,
++#   MA  02111-1307  USA
++#
++#
++#   Sun Industry Standards Source License Version 1.1
++#   =================================================
++#   The contents of this file are subject to the Sun Industry Standards
++#   Source License Version 1.1 (the "License"); You may not use this file
++#   except in compliance with the License. You may obtain a copy of the
++#   License at http://www.openoffice.org/license.html.
++#
++#   Software provided under this License is provided on an "AS IS" basis,
++#   WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
++#   WITHOUT LIMITATION, WARRANTIES THAT THE SOFTWARE IS FREE OF DEFECTS,
++#   MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE, OR NON-INFRINGING.
++#   See the License for the specific provisions governing your rights and
++#   obligations concerning the Software.
++#
++#   The Initial Developer of the Original Code is: Sun Microsystems, Inc.
++#
++#   Copyright: 2000 by Sun Microsystems, Inc.
++#
++#   All Rights Reserved.
++#
++#   Contributor(s): _______________________________________
++#
++#
++#
++#*************************************************************************
++
++PRJ=..$/..$/..
++
++PRJNAME=fpicker
++TARGET=fps_kde4.uno
++LIBTARGET=NO
++ENABLE_EXCEPTIONS=TRUE
++
++# --- Settings -----------------------------------------------------
++
++.INCLUDE :  settings.mk
++DLLPRE=
++
++# ------------------------------------------------------------------
++
++# Currently just KDE is supported...
++.IF "$(GUIBASE)" != "unx" || "$(ENABLE_KDE4)" != "TRUE"
++
++dummy:
++	@echo "Nothing to build. GUIBASE == $(GUIBASE), ENABLE_KDE4 is not set"
++
++.ELSE # we build for KDE
++
++CFLAGS+= $(KDE4_CFLAGS)
++
++# --- Files --------------------------------------------------------
++
++SLOFILES =\
++		$(SLO)$/UnxFilePicker.obj		\
++		$(SLO)$/UnxFilePicker.moc.obj \
++		$(SLO)$/UnxFPentry.obj
++
++SHL1NOCHECK=TRUE
++SHL1TARGET=$(TARGET)
++SHL1STDLIBS=$(CPPULIB)\
++		$(CPPUHELPERLIB)\
++		$(SALLIB)\
++		$(VCLLIB)\
++		$(TOOLSLIB) \
++		$(KDE4_LIBS) -lkio
++
++
++SHL1OBJS=$(SLOFILES)
++SHL1DEF=$(MISC)$/$(SHL1TARGET).def
++
++DEF1NAME=$(SHL1TARGET)
++DEF1VERSIONMAP=exports.map
++
++.ENDIF
++
++# --- Targets ------------------------------------------------------
++
++.INCLUDE :	target.mk
++
++$(MISC)$/UnxFilePicker.moc.cxx : UnxFilePicker.hxx
++	$(MOC) $< -o $@
diff --git a/patches/dev300/kde4-plugin-detection.diff b/patches/dev300/kde4-plugin-detection.diff
index 004cdde..80f442b 100644
--- a/patches/dev300/kde4-plugin-detection.diff
+++ b/patches/dev300/kde4-plugin-detection.diff
@@ -88,7 +88,7 @@ index 335bb8f..da10725 100644
      else if( desktop == desktop_strings[DESKTOP_KDE] )
          pRet = "kde";
 +    else if( desktop == desktop_strings[DESKTOP_KDE4] )
-+        pRet = "kde"; // TODO no kde4 vclplugin yet :-(
++        pRet = "kde";
      else
          pRet = "gen";
          
diff --git a/patches/dev300/kde4-scp2.diff b/patches/dev300/kde4-scp2.diff
new file mode 100644
index 0000000..23f5dfc
--- /dev/null
+++ b/patches/dev300/kde4-scp2.diff
@@ -0,0 +1,92 @@
+diff --git scp2/source/ooo/file_library_ooo.scp scp2/source/ooo/file_library_ooo.scp
+index 184e8f1..571378e 100644
+--- scp2/source/ooo/file_library_ooo.scp
++++ scp2/source/ooo/file_library_ooo.scp
+@@ -612,6 +612,18 @@ File gid_File_Lib_Fps_Gnome
+ End
+ #endif
+ #endif
++#ifdef ENABLE_KDE4
++#ifndef MACOSX
++File gid_File_Lib_Fps_Kde4
++    TXT_FILE_BODY;
++    Styles = (PACKED,UNO_COMPONENT);
++    RegistryID = gid_Starregistry_Services_Rdb;
++    Dir = gid_Dir_Program;
++    Name = SPECIAL_COMPONENT_LIB_NAME(fps_kde4.uno);
++    Regmergefile = "fps-kde-ucd.txt";
++End
++#endif
++#endif
+ #endif
+ 
+ #ifdef MACOSX
+@@ -1202,6 +1214,16 @@ File gid_File_Lib_Vclplug_Kde
+ End
+ #endif
+ #endif
++#ifdef ENABLE_KDE4
++#ifndef MACOSX
++File gid_File_Lib_Vclplug_Kde4
++    Name = LIBNAME(vclplug_kde4);
++    TXT_FILE_BODY;
++    Styles = (PACKED);
++    Dir = gid_Dir_Program;
++End
++#endif
++#endif
+ #endif
+ 
+ #if defined(QUARTZ)
+diff --git scp2/source/ooo/module_hidden_ooo.scp scp2/source/ooo/module_hidden_ooo.scp
+index a365910..c0e29bb 100644
+--- scp2/source/ooo/module_hidden_ooo.scp
++++ scp2/source/ooo/module_hidden_ooo.scp
+@@ -240,6 +241,7 @@ Module gid_Module_Root_Files_4
+ 	gid_File_Lib_Vclplug_Gen,
+ 	gid_File_Lib_Vclplug_Gtk,
+ 	gid_File_Lib_Vclplug_Kde,
++	gid_File_Lib_Vclplug_Kde4,
+ 	gid_File_Lib_Vclplug_Svp,
+ 	gid_File_Lib_Basctl,
+ 	gid_File_Lib_CanvasTools,
+--- scp2/source/kde/file_kde.scp	2009-06-10 18:17:35.016187781 -0400
++++ scp2/source/kde/file_kde.scp	2009-06-10 18:17:59.143438694 -0400
+@@ -38,3 +38,12 @@
+     Regmergefile = "kdebe1-ucd.txt";
+ End
+ 
++File gid_File_Lib_Kde4be
++    TXT_FILE_BODY;
++    Styles = (PACKED);
++    Dir = gid_Dir_Program;
++    Name = STRING(CONCAT2(kde4be1.uno,UNXSUFFIX));
++    RegistryID = gid_Starregistry_Services_Rdb;
++    Regmergefile = "kde4be1-ucd.txt";
++End
++
+--- scp2/source/kde/module_kde.scp	2008-04-10 05:26:32.000000000 -0400
++++ scp2/source/kde/module_kde.scp	2009-06-10 18:18:49.028067947 -0400
+@@ -30,6 +30,16 @@
+ 
+ #include "macros.inc"
+ 
++#ifdef ENABLE_KDE4
++Module gid_Module_Optional_Kde
++    ParentID = gid_Module_Optional;
++    Default = YES;
++    PackageInfo = "packinfo_office.txt";
++    MOD_NAME_DESC(MODULE_OPTIONAL_KDE);
++    Styles = (DONTSHOWINUSERINSTALL);
++    Files = (gid_File_Lib_Kde4be);
++End
++#else
+ Module gid_Module_Optional_Kde
+     ParentID = gid_Module_Optional;
+     Default = YES;
+@@ -38,4 +48,5 @@
+     Styles = (DONTSHOWINUSERINSTALL);
+     Files = (gid_File_Lib_Kdebe);
+ End
++#endif
+ 
diff --git a/patches/dev300/kde4-shell-prj.diff b/patches/dev300/kde4-shell-prj.diff
new file mode 100644
index 0000000..f537458
--- /dev/null
+++ b/patches/dev300/kde4-shell-prj.diff
@@ -0,0 +1,12 @@
+diff --git shell/prj/build.lst shell/prj/build.lst
+index 510071c..e9c8a29 100644
+--- shell/prj/build.lst
++++ shell/prj/build.lst
+@@ -30,6 +30,7 @@ sl    shell\source\backends\wininetbe              nmake   -   w   sl_backends_w
+ sl    shell\source\backends\macbe                  nmake   -   u   sl_backends_macbe sl_inc NULL
+ sl    shell\source\backends\gconfbe                nmake   -   u   sl_backends_gconfbe sl_inc NULL
+ sl    shell\source\backends\kdebe                  nmake   -   u   sl_backends_kdebe sl_inc NULL
++sl    shell\source\backends\kde4be                 nmake   -   u   sl_backends_kde4be sl_inc NULL
+ sl    shell\source\backends\desktopbe              nmake   -   u   sl_backends_desktopbe sl_inc NULL
+ sl    shell\source\win32\shlxthandler\ooofilt      nmake   -   w   sl_win32_shlxthandler_ooofilt sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_util.w sl_all sl_inc NULL
+ sl    shell\source\win32\shlxthandler\ooofilt\proxy nmake   -   w   sl_win32_ooofiltproxy sl_inc NULL 
diff --git a/patches/dev300/kde4-shell-source.diff b/patches/dev300/kde4-shell-source.diff
new file mode 100644
index 0000000..eee478c
--- /dev/null
+++ b/patches/dev300/kde4-shell-source.diff
@@ -0,0 +1,1568 @@
+diff --git shell/source/backends/kde4be/exports.map shell/source/backends/kde4be/exports.map
+new file mode 100644
+index 0000000..cc40b40
+--- /dev/null
++++ shell/source/backends/kde4be/exports.map
+@@ -0,0 +1,10 @@
++UDK_3_0_0 {
++	global:
++		GetVersionInfo;
++		component_getImplementationEnvironment;
++		component_getFactory;
++		component_writeInfo;
++
++	local:
++		*;
++};
+diff --git shell/source/backends/kde4be/kde4be.xml shell/source/backends/kde4be/kde4be.xml
+new file mode 100644
+index 0000000..16b8cc0
+--- /dev/null
++++ shell/source/backends/kde4be/kde4be.xml
+@@ -0,0 +1,35 @@
++<?xml version="1.0" encoding="UTF-8"?>
++<!DOCTYPE module-description PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "module-description.dtd">
++<module-description xmlns:xlink="http://www.w3.org/1999/xlink">
++    <module-name>kdebe</module-name>
++    <component-description>
++        <author> Éric Bischoff </author>
++        <name>com.sun.star.comp.configuration.backend.KDEBackend</name>
++        <description> The KDE4 configuration backend </description>
++        <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
++        <language>c++</language>
++        <status value="beta"/>        
++        <supported-service>com.sun.star.comp.configuration.backend.KDEBackend</supported-service>		
++        <service-dependency>...</service-dependency>
++        <type>com.sun.star.configuration.backend.XBackendChangesListener</type>
++        <type>com.sun.star.configuration.backend.XBackendChangesNotifier</type>
++        <type>com.sun.star.configuration.backend.XLayerHandler</type>
++        <type>com.sun.star.configuration.backend.XSingleLayerStratum</type>
++        <type>com.sun.star.lang.XMultiComponentFactory</type>
++        <type>com.sun.star.lang.XServiceInfo</type>
++        <type>com.sun.star.lang.XSingleComponentFactory</type>
++        <type>com.sun.star.lang.XTypeProvider</type>
++        <type>com.sun.star.uno.TypeClass</type>
++        <type>com.sun.star.uno.XAggregation</type>
++        <type>com.sun.star.uno.XComponentContext</type>
++        <type>com.sun.star.uno.XCurrentContext</type>
++        <type>com.sun.star.uno.XWeak</type>
++        <type>com.sun.star.registry.XRegistryKey</type>
++    </component-description>
++    <project-build-dependency>cppuhelper</project-build-dependency>
++    <project-build-dependency>cppu</project-build-dependency>
++    <project-build-dependency>sal</project-build-dependency>
++    <runtime-module-dependency>cppuhelper3$(COM)</runtime-module-dependency>
++    <runtime-module-dependency>cppu3</runtime-module-dependency>
++    <runtime-module-dependency>sal3</runtime-module-dependency>
++</module-description>
+diff --git shell/source/backends/kde4be/kde4be1-ucd.txt shell/source/backends/kde4be/kde4be1-ucd.txt
+new file mode 100644
+index 0000000..adf7e17
+--- /dev/null
++++ shell/source/backends/kde4be/kde4be1-ucd.txt
+@@ -0,0 +1,6 @@
++[ComponentDescriptor]
++ImplementationName=com.sun.star.comp.configuration.backend.KDEBackend
++ComponentName=kdebe1.uno.so
++LoaderName=com.sun.star.loader.SharedLibrary
++[SupportedServices]
++com.sun.star.configuration.backend.KDEBackend
+diff --git shell/source/backends/kde4be/kdebackend.cxx shell/source/backends/kde4be/kdebackend.cxx
+new file mode 100644
+index 0000000..904db3e
+--- /dev/null
++++ shell/source/backends/kde4be/kdebackend.cxx
+@@ -0,0 +1,158 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: kdebackend.cxx,v $
++ * $Revision: 1.7 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_shell.hxx"
++
++#include "kdebackend.hxx"
++#include "kdecommonlayer.hxx"
++#include "kdeinetlayer.hxx"
++#include "kdevcllayer.hxx"
++#include "kdepathslayer.hxx"
++
++//------------------------------------------------------------------------------
++
++KDEBackend* KDEBackend::mInstance= 0;
++
++KDEBackend* KDEBackend::createInstance(const uno::Reference<uno::XComponentContext>& xContext)
++{
++    if (mInstance == 0)
++    {
++        mInstance = new KDEBackend (xContext);
++    }
++    
++    return mInstance;
++}
++
++//------------------------------------------------------------------------------
++
++KDEBackend::KDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
++        throw (backend::BackendAccessException)
++    : BackendBase(mMutex), m_xContext(xContext)
++{
++}
++
++//------------------------------------------------------------------------------
++
++KDEBackend::~KDEBackend(void)
++{
++}
++
++//------------------------------------------------------------------------------
++
++uno::Reference<backend::XLayer> SAL_CALL KDEBackend::getLayer(
++    const rtl::OUString& aComponent, const rtl::OUString& /* aTimestamp */)
++    throw (backend::BackendAccessException, lang::IllegalArgumentException)
++{
++    uno::Reference<backend::XLayer> xLayer;
++    
++    if( aComponent.equalsAscii("org.openoffice.Office.Common" ) )
++    {
++        xLayer = new KDECommonLayer(m_xContext);
++    }
++    else if( aComponent.equalsAscii("org.openoffice.Inet" ) )
++    {
++        xLayer = new KDEInetLayer(m_xContext);
++    }
++    else if( aComponent.equalsAscii("org.openoffice.VCL" ) )
++    {
++        xLayer = new KDEVCLLayer(m_xContext);
++    }
++    else if( aComponent.equalsAscii("org.openoffice.Office.Paths" ) )
++    {
++        xLayer = new KDEPathsLayer(m_xContext);
++    }
++    
++    return xLayer;
++}
++
++//------------------------------------------------------------------------------
++
++uno::Reference<backend::XUpdatableLayer> SAL_CALL
++KDEBackend::getUpdatableLayer(const rtl::OUString& /* aComponent */) 
++    throw (backend::BackendAccessException,lang::NoSupportException,	   
++		   lang::IllegalArgumentException)
++{
++    throw lang::NoSupportException( rtl::OUString(
++        RTL_CONSTASCII_USTRINGPARAM("KDEBackend: No Update Operation allowed, Read Only access") ),
++        *this) ; 
++}
++
++//------------------------------------------------------------------------------
++
++rtl::OUString SAL_CALL KDEBackend::getBackendName(void)
++{
++    return rtl::OUString( 
++        RTL_CONSTASCII_USTRINGPARAM("com.sun.star.comp.configuration.backend.KDEBackend") );
++}
++
++//------------------------------------------------------------------------------
++
++rtl::OUString SAL_CALL KDEBackend::getImplementationName(void) 
++    throw (uno::RuntimeException) 
++{
++    return getBackendName() ;
++}
++
++//------------------------------------------------------------------------------
++
++uno::Sequence<rtl::OUString> SAL_CALL KDEBackend::getBackendServiceNames(void) 
++{
++    uno::Sequence<rtl::OUString> aServices(1) ;
++    aServices[0] = rtl::OUString( 
++        RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.KDEBackend")) ;
++
++    return aServices ;
++}
++
++//------------------------------------------------------------------------------
++
++sal_Bool SAL_CALL KDEBackend::supportsService(const rtl::OUString& aServiceName) 
++    throw (uno::RuntimeException) 
++{
++    uno::Sequence< rtl::OUString > const svc = getBackendServiceNames();
++
++    for(sal_Int32 i = 0; i < svc.getLength(); ++i )
++        if(svc[i] == aServiceName)
++            return true;
++
++    return false;
++}
++
++//------------------------------------------------------------------------------
++
++uno::Sequence<rtl::OUString> 
++SAL_CALL KDEBackend::getSupportedServiceNames(void) 
++    throw (uno::RuntimeException) 
++{
++    return getBackendServiceNames() ;
++}
++
++// ---------------------------------------------------------------------------------------
+diff --git shell/source/backends/kde4be/kdebackend.hxx shell/source/backends/kde4be/kdebackend.hxx
+new file mode 100644
+index 0000000..cf44b3d
+--- /dev/null
++++ shell/source/backends/kde4be/kdebackend.hxx
+@@ -0,0 +1,128 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: kdebackend.hxx,v $
++ * $Revision: 1.4 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++#ifndef KDEBACKEND_HXX_
++#define KDEBACKEND_HXX_
++
++#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XSCHEMASUPPLIER_HPP_
++#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
++#endif
++#include <com/sun/star/lang/XInitialization.hpp>
++#include <com/sun/star/uno/XComponentContext.hpp>
++#include <com/sun/star/lang/XServiceInfo.hpp>
++#include <com/sun/star/configuration/InvalidBootstrapFileException.hpp>
++#include <com/sun/star/configuration/backend/CannotConnectException.hpp>
++#include <cppuhelper/compbase2.hxx>
++
++#ifndef INCLUDED_MAP
++#include <map>
++#define INCLUDED_MAP
++#endif
++
++namespace css = com::sun::star ;
++namespace uno = css::uno ;
++namespace lang = css::lang ;
++namespace backend = css::configuration::backend ;
++
++
++//------------------------------------------------------------------------------
++typedef cppu::WeakComponentImplHelper2<backend::XSingleLayerStratum,
++				       lang::XServiceInfo> BackendBase ;
++
++/**
++  Implements the SingleLayerStratum service for KDE access.
++  */
++class KDEBackend : public BackendBase {
++    public :
++        
++	static KDEBackend* createInstance(const uno::Reference<uno::XComponentContext>& xContext);
++
++        // XServiceInfo
++        virtual rtl::OUString SAL_CALL getImplementationName(  ) 
++            throw (uno::RuntimeException) ;
++        
++        virtual sal_Bool SAL_CALL supportsService( const rtl::OUString& aServiceName ) 
++            throw (uno::RuntimeException) ;
++
++        virtual uno::Sequence<rtl::OUString> SAL_CALL getSupportedServiceNames(  ) 
++            throw (uno::RuntimeException) ;
++
++        /**
++          Provides the implementation name.
++
++          @return   implementation name
++          */
++        static rtl::OUString SAL_CALL getBackendName(void) ;
++
++        /**
++          Provides the supported services names
++
++          @return   service names
++          */
++        static uno::Sequence<rtl::OUString> SAL_CALL getBackendServiceNames(void) ;
++
++        //XSingleLayerStratum
++        virtual uno::Reference<backend::XLayer> SAL_CALL 
++            getLayer( const rtl::OUString& aLayerId, const rtl::OUString& aTimestamp )
++                throw (backend::BackendAccessException, lang::IllegalArgumentException) ;
++
++        virtual uno::Reference<backend::XUpdatableLayer> SAL_CALL
++            getUpdatableLayer( const rtl::OUString& aLayerId ) 
++                throw (backend::BackendAccessException, lang::NoSupportException,	   
++                       lang::IllegalArgumentException) ;
++
++    protected:
++        /**
++          Service constructor from a service factory.
++
++          @param xContext   component context
++          */
++         KDEBackend(const uno::Reference<uno::XComponentContext>& xContext) 
++            throw (backend::BackendAccessException);
++                        
++        /** Destructor */
++        ~KDEBackend(void) ;
++
++    private:
++     
++        /** Build KDE/OO mapping table */ 
++		void initializeMappingTable ();
++
++        
++        /** The component context */		
++        uno::Reference<uno::XComponentContext> m_xContext;
++		
++        /** Mutex for reOOurces protection */
++        osl::Mutex mMutex ;
++
++        static KDEBackend* mInstance;
++};
++
++#endif // CONFIGMGR_LOCALBE_LOCALSINGLESTRATUM_HXX_
+diff --git shell/source/backends/kde4be/kdebecdef.cxx shell/source/backends/kde4be/kdebecdef.cxx
+new file mode 100644
+index 0000000..7bd481f
+--- /dev/null
++++ shell/source/backends/kde4be/kdebecdef.cxx
+@@ -0,0 +1,143 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: kdebecdef.cxx,v $
++ * $Revision: 1.8 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_shell.hxx"
++#include "kdebackend.hxx"
++#include <com/sun/star/registry/XRegistryKey.hpp>
++
++#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
++#include <cppuhelper/implementationentry.hxx>
++#endif
++#include <com/sun/star/uno/XComponentContext.hpp>
++#include <vcl/kde4_headers.h>
++
++#include "uno/current_context.hxx"
++
++namespace css = com::sun::star ;
++namespace uno = css::uno ;
++namespace lang = css::lang ;
++namespace backend = css::configuration::backend ;
++
++//==============================================================================
++
++static uno::Reference<uno::XInterface> SAL_CALL createKDEBackend(const uno::Reference<uno::XComponentContext>& xContext)
++{
++    try {
++        uno::Reference< uno::XCurrentContext > xCurrentContext(uno::getCurrentContext());
++        
++        if (xCurrentContext.is())
++        {
++            uno::Any aValue = xCurrentContext->getValueByName(
++                rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( "system.desktop-environment" ) ) );
++        
++            rtl::OUString aDesktopEnvironment;
++            if ( (aValue >>= aDesktopEnvironment) && (aDesktopEnvironment.equalsAscii("KDE")) && (KApplication::kApplication() != NULL) )
++                return * KDEBackend::createInstance(xContext);
++        }
++        
++        return uno::Reference<uno::XInterface>(); 
++        
++    } catch (uno::RuntimeException e) {
++        return uno::Reference<uno::XInterface>();    
++    }    
++    
++}
++
++//==============================================================================
++
++static const cppu::ImplementationEntry kImplementations_entries[] = 
++{
++    {
++        createKDEBackend,
++        KDEBackend::getBackendName,
++        KDEBackend::getBackendServiceNames,
++        cppu::createSingleComponentFactory,
++        NULL,
++        0
++    },
++	{ NULL, NULL, NULL, NULL, NULL, 0 }
++} ;
++//------------------------------------------------------------------------------
++
++extern "C" void SAL_CALL component_getImplementationEnvironment(
++                                            const sal_Char **aEnvTypeName,
++                                            uno_Environment **) {
++    *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME ;
++}
++
++//------------------------------------------------------------------------------
++
++extern "C" sal_Bool SAL_CALL component_writeInfo(void *,
++                                                 void *pRegistryKey) {
++    
++    using namespace ::com::sun::star::registry;
++    if (pRegistryKey)
++    {
++        try
++        {
++            uno::Reference< XRegistryKey > xImplKey = static_cast< XRegistryKey* >( pRegistryKey )->createKey(
++                rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/") ) + KDEBackend::getBackendName()
++            );
++            
++	    // Register associated service names
++            uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey( 
++                rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
++            );
++            
++            uno::Sequence<rtl::OUString> sServiceNames = KDEBackend::getBackendServiceNames();
++            for (sal_Int32 i = 0 ; i < sServiceNames.getLength() ; ++ i)
++                xServicesKey->createKey(sServiceNames[i]);
++
++            return sal_True;
++        }
++        
++        catch( InvalidRegistryException& )
++        {                       
++            OSL_ENSURE(sal_False, "InvalidRegistryException caught");           
++        }
++    }
++    
++    return sal_False;
++}
++
++//------------------------------------------------------------------------------
++
++extern "C" void *component_getFactory(const sal_Char *aImplementationName,
++                                      void *aServiceManager,
++                                      void *aRegistryKey) {
++                                      
++    return cppu::component_getFactoryHelper(
++        aImplementationName,
++        aServiceManager,
++        aRegistryKey,
++        kImplementations_entries) ;
++}
++//------------------------------------------------------------------------------
+diff --git shell/source/backends/kde4be/kdecommonlayer.cxx shell/source/backends/kde4be/kdecommonlayer.cxx
+new file mode 100644
+index 0000000..f598211
+--- /dev/null
++++ shell/source/backends/kde4be/kdecommonlayer.cxx
+@@ -0,0 +1,153 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: kdecommonlayer.cxx,v $
++ * $Revision: 1.7 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_shell.hxx"
++#include "kdecommonlayer.hxx"
++#include <vcl/kde4_headers.h>
++#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
++#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
++#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
++#endif
++#include <com/sun/star/uno/Sequence.hxx>
++
++#define SPACE      ' '
++
++//==============================================================================
++
++KDECommonLayer::KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext)
++{
++    //Create instance of LayerContentDescriber Service
++    rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
++        "com.sun.star.comp.configuration.backend.LayerDescriber"));
++
++    typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber; 
++    uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
++    if( xServiceManager.is() )
++    {
++        m_xLayerContentDescriber = LayerDescriber::query(
++            xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
++    }
++    else
++    {
++        OSL_TRACE("Could not retrieve ServiceManager");
++    }
++}
++
++//------------------------------------------------------------------------------
++
++void SAL_CALL KDECommonLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler) 
++    throw ( backend::MalformedDataException, lang::NullPointerException, 
++            lang::WrappedTargetException, uno::RuntimeException)
++{
++    if( ! m_xLayerContentDescriber.is() )
++    {
++        throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
++            "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
++        ) ), static_cast < backend::XLayer * > (this) );
++    }
++    
++    uno::Sequence<backend::PropertyInfo> aPropInfoList(3);
++    sal_Int32 nProperties = 0;
++
++    // Email client settings
++    KEMailSettings aEmailSettings;
++    QString aClientProgram;
++    ::rtl::OUString sClientProgram;
++
++    aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
++    if ( aClientProgram.isEmpty() )
++        aClientProgram = "kmail";
++    else
++        aClientProgram = aClientProgram.section(SPACE, 0, 0);
++    sClientProgram = (const sal_Unicode *) aClientProgram.utf16();
++
++    aPropInfoList[nProperties].Name = rtl::OUString(
++        RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/ExternalMailer/Program") );
++    aPropInfoList[nProperties].Type = rtl::OUString( 
++        RTL_CONSTASCII_USTRINGPARAM( "string" ) );
++    aPropInfoList[nProperties].Protected = sal_False;
++    aPropInfoList[nProperties++].Value = uno::makeAny( sClientProgram );
++
++    // Source code font settings
++    QFont aFixedFont;
++    QString aFontName;
++    :: rtl::OUString sFontName;
++    short nFontHeight;
++
++    aFixedFont = KGlobalSettings::fixedFont();
++    aFontName = aFixedFont.family();
++    sFontName = (const sal_Unicode *) aFontName.utf16();
++    nFontHeight = aFixedFont.pointSize();
++
++    aPropInfoList[nProperties].Name = rtl::OUString(
++        RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontName") );
++    aPropInfoList[nProperties].Type = rtl::OUString( 
++        RTL_CONSTASCII_USTRINGPARAM( "string" ) );
++    aPropInfoList[nProperties].Protected = sal_False;
++    aPropInfoList[nProperties++].Value = uno::makeAny( sFontName );
++
++    aPropInfoList[nProperties].Name = rtl::OUString(
++        RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Common/Font/SourceViewFont/FontHeight") );
++    aPropInfoList[nProperties].Type = rtl::OUString( 
++        RTL_CONSTASCII_USTRINGPARAM( "short" ) );
++    aPropInfoList[nProperties].Protected = sal_False;
++    aPropInfoList[nProperties++].Value = uno::makeAny( nFontHeight );
++
++    if( nProperties > 0 )
++    {
++        aPropInfoList.realloc(nProperties);
++        m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
++    }
++}
++
++//------------------------------------------------------------------------------
++
++rtl::OUString SAL_CALL KDECommonLayer::getTimestamp(void) 
++    throw (uno::RuntimeException)
++{
++    // Return the value as timestamp to avoid regenerating the binary cache
++    // on each office launch.
++
++    KEMailSettings aEmailSettings;
++    QString aClientProgram = aEmailSettings.getSetting( KEMailSettings::ClientProgram );
++    aClientProgram = aClientProgram.section(SPACE, 0, 0);
++
++    QString aFixedFont = KGlobalSettings::fixedFont().toString();
++
++    ::rtl::OUString sTimeStamp,
++                    sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
++
++    sTimeStamp = (const sal_Unicode *) aClientProgram.utf16();
++    sTimeStamp += sep;
++    sTimeStamp += (const sal_Unicode *) aFixedFont.utf16();
++
++    return sTimeStamp;
++}
+diff --git shell/source/backends/kde4be/kdecommonlayer.hxx shell/source/backends/kde4be/kdecommonlayer.hxx
+new file mode 100644
+index 0000000..84bcf35
+--- /dev/null
++++ shell/source/backends/kde4be/kdecommonlayer.hxx
+@@ -0,0 +1,56 @@
++#ifndef KDECOMMONLAYER_HXX_
++#define KDECOMMONLAYER_HXX_
++
++#include "kdebackend.hxx"
++#include <com/sun/star/uno/XComponentContext.hpp>
++#include <com/sun/star/configuration/backend/XLayer.hpp>
++#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
++#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
++#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
++#endif
++#include <com/sun/star/util/XTimeStamped.hpp>
++#include <cppuhelper/implbase2.hxx>
++
++namespace css = com::sun::star ;
++namespace uno = css::uno ;
++namespace lang = css::lang ;
++namespace backend = css::configuration::backend ;
++namespace util = css::util ;
++
++/**
++  Implementation of the XLayer interface for the KDE values mapped into
++  the org.openoffice.Office.Common configuration component.
++  */
++class KDECommonLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped> 
++{
++public :
++    /**
++      Constructor given the component context
++
++      @param xContext       The component context
++    */
++    
++    KDECommonLayer(const uno::Reference<uno::XComponentContext>& xContext);
++
++    // XLayer
++    virtual void SAL_CALL readData(
++        const uno::Reference<backend::XLayerHandler>& xHandler) 
++        throw ( backend::MalformedDataException,
++            lang::NullPointerException, 
++            lang::WrappedTargetException, 
++            uno::RuntimeException) ;
++
++    // XTimeStamped
++    virtual rtl::OUString SAL_CALL getTimestamp(void) 
++        throw (uno::RuntimeException);
++
++    protected:
++
++    /** Destructor */
++    ~KDECommonLayer(void) {}
++              
++    private :
++        uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
++  } ;
++
++#endif // KDECOMMONLAYER
+diff --git shell/source/backends/kde4be/kdeinetlayer.cxx shell/source/backends/kde4be/kdeinetlayer.cxx
+new file mode 100644
+index 0000000..15e9e58
+--- /dev/null
++++ shell/source/backends/kde4be/kdeinetlayer.cxx
+@@ -0,0 +1,254 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: kdeinetlayer.cxx,v $
++ * $Revision: 1.7 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_shell.hxx"
++#include "kdeinetlayer.hxx"
++#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
++#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
++#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
++#endif
++#include <com/sun/star/uno/Sequence.hxx>
++
++#define COMMA      ','
++#define SEMI_COLON ';'
++
++//==============================================================================
++
++KDEInetLayer::KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext)
++{
++    //Create instance of LayerContentDescriber Service
++    rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
++        "com.sun.star.comp.configuration.backend.LayerDescriber"));
++
++    typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber; 
++    uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
++    if( xServiceManager.is() )
++    {
++        m_xLayerContentDescriber = LayerDescriber::query(
++            xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
++    }
++    else
++    {
++        OSL_TRACE("Could not retrieve ServiceManager");
++    }
++}
++
++//------------------------------------------------------------------------------
++
++void SAL_CALL KDEInetLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler) 
++    throw ( backend::MalformedDataException, lang::NullPointerException, 
++            lang::WrappedTargetException, uno::RuntimeException)
++{
++    if( ! m_xLayerContentDescriber.is() )
++    {
++        throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
++            "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
++        ) ), static_cast < backend::XLayer * > (this) );
++    }
++
++    uno::Sequence<backend::PropertyInfo> aPropInfoList(8);
++    sal_Int32 nProperties = 0;
++
++    switch ( KProtocolManager::proxyType() )
++    {
++        case KProtocolManager::ManualProxy: // Proxies are manually configured
++            setProxy(aPropInfoList, nProperties, 1,
++                     KProtocolManager::noProxyFor(),
++                     KProtocolManager::proxyFor( "HTTP" ),
++                     KProtocolManager::proxyFor( "FTP" ),
++					 KProtocolManager::proxyFor( "HTTPS" ));
++            break;
++        case KProtocolManager::PACProxy:    // A proxy configuration URL has been given
++        case KProtocolManager::WPADProxy:   // A proxy should be automatically discovered
++        case KProtocolManager::EnvVarProxy: // Use the proxy values set through environment variables
++// In such cases, the proxy address is not stored in KDE, but determined dynamically.
++// The proxy address may depend on the requested address, on the time of the day, on the speed of the wind...
++// The best we can do here is to ask the current value for a given address.
++            setProxy(aPropInfoList, nProperties, 1,
++                     KProtocolManager::noProxyFor(),
++                     KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") ),
++                     KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") ),
++					 KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") ));
++            break;
++        default:                            // No proxy is used
++            setProxy(aPropInfoList, nProperties, 0);
++    }
++
++    if ( nProperties > 0 )
++    {
++      aPropInfoList.realloc(nProperties);
++      m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
++    }
++}
++
++//------------------------------------------------------------------------------
++
++rtl::OUString SAL_CALL KDEInetLayer::getTimestamp(void) 
++    throw (uno::RuntimeException)
++{
++    // Return the value as timestamp to avoid regenerating the binary cache
++    // on each office launch.
++
++    QString aProxyType, aNoProxyFor, aHTTPProxy, aHTTPSProxy, aFTPProxy;
++
++    switch ( KProtocolManager::proxyType() )
++    {
++        case KProtocolManager::ManualProxy:
++            aProxyType = '1';
++            aNoProxyFor = KProtocolManager::noProxyFor();
++            aHTTPProxy = KProtocolManager::proxyFor( "HTTP" );
++			aHTTPProxy = KProtocolManager::proxyFor( "HTTPS" );
++            aFTPProxy = KProtocolManager::proxyFor( "FTP" );
++            break;
++        case KProtocolManager::PACProxy:
++        case KProtocolManager::WPADProxy:
++        case KProtocolManager::EnvVarProxy:
++            aProxyType = '1';
++            aNoProxyFor = KProtocolManager::noProxyFor();
++            aHTTPProxy = KProtocolManager::proxyForUrl( KUrl("http://www.openoffice.org") );
++			aHTTPSProxy = KProtocolManager::proxyForUrl( KUrl("https://www.openoffice.org") );
++            aFTPProxy = KProtocolManager::proxyForUrl( KUrl("ftp://ftp.openoffice.org") );
++            break;
++        default:
++            aProxyType = '0';
++    }
++
++    ::rtl::OUString sTimeStamp,
++                    sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
++
++    sTimeStamp = (const sal_Unicode *) aProxyType.utf16();
++    sTimeStamp += sep;
++    sTimeStamp += (const sal_Unicode *) aNoProxyFor.utf16();
++    sTimeStamp += sep;
++    sTimeStamp += (const sal_Unicode *) aHTTPProxy.utf16();
++    sTimeStamp += sep;
++	sTimeStamp += (const sal_Unicode *) aHTTPSProxy.utf16();
++    sTimeStamp += sep;
++    sTimeStamp += (const sal_Unicode *) aFTPProxy.utf16();
++
++    return sTimeStamp;
++}
++
++//------------------------------------------------------------------------------
++
++void SAL_CALL KDEInetLayer::setProxy
++    (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
++     int nProxyType, const QString &aNoProxy, const QString &aHTTPProxy, const QString &aFTPProxy, const QString &aHTTPSProxy ) const
++{
++    aPropInfoList[nProperties].Name = rtl::OUString(
++        RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") );
++    aPropInfoList[nProperties].Type = rtl::OUString( 
++        RTL_CONSTASCII_USTRINGPARAM( "int" ) );
++    aPropInfoList[nProperties].Protected = sal_False;
++    aPropInfoList[nProperties++].Value = uno::makeAny( (sal_Int32) nProxyType );
++
++    if (nProxyType == 0) return;
++
++    if ( !aNoProxy.isEmpty() )
++    {
++        QString aNoProxyFor(aNoProxy);
++        ::rtl::OUString sNoProxyFor;
++
++        aNoProxyFor = aNoProxyFor.replace( COMMA, SEMI_COLON );
++        sNoProxyFor = (const sal_Unicode *) aNoProxyFor.utf16();
++
++        aPropInfoList[nProperties].Name = rtl::OUString( 
++        RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetNoProxy") );
++        aPropInfoList[nProperties].Type = rtl::OUString( 
++        RTL_CONSTASCII_USTRINGPARAM( "string" ) );
++        aPropInfoList[nProperties].Protected = sal_False;
++        aPropInfoList[nProperties++].Value = uno::makeAny( sNoProxyFor );
++    }
++
++    if ( !aHTTPProxy.isEmpty() )
++    {
++        KUrl aProxy(aHTTPProxy);
++        ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
++        sal_Int32 nPort = aProxy.port();
++
++        aPropInfoList[nProperties].Name = rtl::OUString(
++            RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyName") );
++        aPropInfoList[nProperties].Type = rtl::OUString( 
++            RTL_CONSTASCII_USTRINGPARAM( "string" ) );
++        aPropInfoList[nProperties].Protected = sal_False;
++        aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
++
++        aPropInfoList[nProperties].Name = rtl::OUString(
++            RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPProxyPort") );
++        aPropInfoList[nProperties].Type = rtl::OUString( 
++            RTL_CONSTASCII_USTRINGPARAM( "int" ) );
++        aPropInfoList[nProperties].Protected = sal_False;
++        aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
++    }
++
++	if ( !aHTTPSProxy.isEmpty() )
++    {
++        KUrl aProxy(aHTTPSProxy);
++        ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
++        sal_Int32 nPort = aProxy.port();
++
++        aPropInfoList[nProperties].Name = rtl::OUString(
++            RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyName") );
++        aPropInfoList[nProperties].Type = rtl::OUString( 
++            RTL_CONSTASCII_USTRINGPARAM( "string" ) );
++        aPropInfoList[nProperties].Protected = sal_False;
++        aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
++
++        aPropInfoList[nProperties].Name = rtl::OUString(
++            RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetHTTPSProxyPort") );
++        aPropInfoList[nProperties].Type = rtl::OUString( 
++            RTL_CONSTASCII_USTRINGPARAM( "int" ) );
++        aPropInfoList[nProperties].Protected = sal_False;
++        aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
++    }
++
++    if ( !aFTPProxy.isEmpty() )
++    {
++        KUrl aProxy(aFTPProxy);
++        ::rtl::OUString sProxy = (const sal_Unicode *) aProxy.host().utf16();
++        sal_Int32 nPort = aProxy.port();
++
++        aPropInfoList[nProperties].Name = rtl::OUString(
++            RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyName") );
++        aPropInfoList[nProperties].Type = rtl::OUString( 
++            RTL_CONSTASCII_USTRINGPARAM( "string" ) );
++        aPropInfoList[nProperties].Protected = sal_False;
++        aPropInfoList[nProperties++].Value = uno::makeAny( sProxy );
++
++        aPropInfoList[nProperties].Name = rtl::OUString(
++            RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetFTPProxyPort") );
++        aPropInfoList[nProperties].Type = rtl::OUString( 
++            RTL_CONSTASCII_USTRINGPARAM( "int" ) );
++        aPropInfoList[nProperties].Protected = sal_False;
++        aPropInfoList[nProperties++].Value = uno::makeAny( nPort );
++    }
++}
++
+diff --git shell/source/backends/kde4be/kdeinetlayer.hxx shell/source/backends/kde4be/kdeinetlayer.hxx
+new file mode 100644
+index 0000000..333117b
+--- /dev/null
++++ shell/source/backends/kde4be/kdeinetlayer.hxx
+@@ -0,0 +1,62 @@
++#ifndef KDEINETLAYER_HXX_
++#define KDEINETLAYER_HXX_
++
++#include "kdebackend.hxx"
++#include <com/sun/star/uno/XComponentContext.hpp>
++#include <com/sun/star/configuration/backend/XLayer.hpp>
++#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
++#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
++#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
++#endif
++#include <com/sun/star/util/XTimeStamped.hpp>
++#include <cppuhelper/implbase2.hxx>
++#include <vcl/kde4_headers.h>
++
++namespace css = com::sun::star ;
++namespace uno = css::uno ;
++namespace lang = css::lang ;
++namespace backend = css::configuration::backend ;
++namespace util = css::util ;
++
++/**
++  Implementation of the XLayer interface for the KDE values mapped into
++  the org.openoffice.Inet configuration component.
++  */
++class KDEInetLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped> 
++{
++public :
++    /**
++      Constructor given the component context
++
++      @param xContext       The component context
++    */
++
++    KDEInetLayer(const uno::Reference<uno::XComponentContext>& xContext);
++
++    // XLayer
++    virtual void SAL_CALL readData(
++        const uno::Reference<backend::XLayerHandler>& xHandler) 
++        throw ( backend::MalformedDataException,
++                lang::NullPointerException, 
++                lang::WrappedTargetException, 
++                uno::RuntimeException) ;
++    
++    // XTimeStamped
++    virtual rtl::OUString SAL_CALL getTimestamp(void) 
++        throw (uno::RuntimeException);
++
++    protected:
++
++    /** Destructor */
++    ~KDEInetLayer(void) {}
++              
++private :
++    uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
++
++    void SAL_CALL setProxy
++        (uno::Sequence<backend::PropertyInfo> &aPropInfoList, sal_Int32 &nProperties,
++         int nProxyType, const QString &aNoProxyfor = QString(),
++         const QString &aHTTPProxy = QString(), const QString &aFTPProxy = QString(), const QString &aHTTPSProxy = QString()) const;
++  } ;
++
++#endif // KDEINETLAYER
+diff --git shell/source/backends/kde4be/kdepathslayer.cxx shell/source/backends/kde4be/kdepathslayer.cxx
+new file mode 100644
+index 0000000..858decf
+--- /dev/null
++++ shell/source/backends/kde4be/kdepathslayer.cxx
+@@ -0,0 +1,121 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: kdepathslayer.cxx,v $
++ * $Revision: 1.5 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_shell.hxx"
++#include "kdepathslayer.hxx"
++#include <vcl/kde4_headers.h>
++#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
++#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
++#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
++#endif
++#include <osl/security.hxx>
++#include <osl/file.hxx>
++#include <com/sun/star/uno/Sequence.hxx>
++
++#define SPACE      ' '
++
++//==============================================================================
++
++KDEPathsLayer::KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext)
++{
++    //Create instance of LayerContentDescriber Service
++    rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
++        "com.sun.star.comp.configuration.backend.LayerDescriber"));
++
++    typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber; 
++    uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
++    if( xServiceManager.is() )
++    {
++        m_xLayerContentDescriber = LayerDescriber::query(
++            xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
++    }
++    else
++    {
++        OSL_TRACE("Could not retrieve ServiceManager");
++    }
++}
++
++//------------------------------------------------------------------------------
++
++void SAL_CALL KDEPathsLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler) 
++    throw ( backend::MalformedDataException, lang::NullPointerException, 
++            lang::WrappedTargetException, uno::RuntimeException)
++{
++    if( ! m_xLayerContentDescriber.is() )
++    {
++        throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
++            "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
++        ) ), static_cast < backend::XLayer * > (this) );
++    }
++    
++    uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
++    sal_Int32 nProperties = 0;
++
++    QString aDocumentsDir( KGlobalSettings::documentPath() );
++    rtl::OUString sDocumentsDir;
++    rtl::OUString sDocumentsURL;
++    if ( aDocumentsDir.endsWith(QChar('/')) )
++        aDocumentsDir.truncate ( aDocumentsDir.length() - 1 );
++    sDocumentsDir = (const sal_Unicode *) aDocumentsDir.utf16();
++    osl_getFileURLFromSystemPath( sDocumentsDir.pData, &sDocumentsURL.pData );
++
++    aPropInfoList[nProperties].Name = rtl::OUString(
++        RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Office.Paths/Variables/Work") );
++    aPropInfoList[nProperties].Type = rtl::OUString( 
++        RTL_CONSTASCII_USTRINGPARAM( "string" ) );
++    aPropInfoList[nProperties].Protected = sal_False;
++    aPropInfoList[nProperties++].Value = uno::makeAny( sDocumentsURL );
++
++    if( nProperties > 0 )
++    {
++        aPropInfoList.realloc(nProperties);
++        m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
++    }
++}
++
++//------------------------------------------------------------------------------
++
++rtl::OUString SAL_CALL KDEPathsLayer::getTimestamp(void) 
++    throw (uno::RuntimeException)
++{
++    // Return the value as timestamp to avoid regenerating the binary cache
++    // on each office launch.
++
++    ::rtl::OUString sTimeStamp,
++                    sep( RTL_CONSTASCII_USTRINGPARAM( "$" ) );
++
++    QString aDocumentsDir;
++    aDocumentsDir = KGlobalSettings::documentPath();
++
++    sTimeStamp += (const sal_Unicode *) aDocumentsDir.utf16();
++
++    return sTimeStamp;
++}
+diff --git shell/source/backends/kde4be/kdepathslayer.hxx shell/source/backends/kde4be/kdepathslayer.hxx
+new file mode 100644
+index 0000000..fe88206
+--- /dev/null
++++ shell/source/backends/kde4be/kdepathslayer.hxx
+@@ -0,0 +1,86 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: kdepathslayer.hxx,v $
++ * $Revision: 1.3 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++#ifndef KDEPATHSLAYER_HXX_
++#define KDEPATHSLAYER_HXX_
++
++#include "kdebackend.hxx"
++#include <com/sun/star/uno/XComponentContext.hpp>
++#include <com/sun/star/configuration/backend/XLayer.hpp>
++#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
++#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
++#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
++#endif
++#include <com/sun/star/util/XTimeStamped.hpp>
++#include <cppuhelper/implbase2.hxx>
++
++namespace css = com::sun::star ;
++namespace uno = css::uno ;
++namespace lang = css::lang ;
++namespace backend = css::configuration::backend ;
++namespace util = css::util ;
++
++/**
++  Implementation of the XLayer interface for the KDE values mapped into
++  the org.openoffice.Office.Paths configuration component.
++  */
++class KDEPathsLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped> 
++{
++public :
++    /**
++      Constructor given the component context
++
++      @param xContext       The component context
++    */
++    
++    KDEPathsLayer(const uno::Reference<uno::XComponentContext>& xContext);
++
++    // XLayer
++    virtual void SAL_CALL readData(
++        const uno::Reference<backend::XLayerHandler>& xHandler) 
++        throw ( backend::MalformedDataException,
++            lang::NullPointerException, 
++            lang::WrappedTargetException, 
++            uno::RuntimeException) ;
++
++    // XTimeStamped
++    virtual rtl::OUString SAL_CALL getTimestamp(void) 
++        throw (uno::RuntimeException);
++
++    protected:
++
++    /** Destructor */
++    ~KDEPathsLayer(void) {}
++              
++    private :
++        uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
++  } ;
++
++#endif // KDEPATHSLAYER
+diff --git shell/source/backends/kde4be/kdevcllayer.cxx shell/source/backends/kde4be/kdevcllayer.cxx
+new file mode 100644
+index 0000000..ce36a23
+--- /dev/null
++++ shell/source/backends/kde4be/kdevcllayer.cxx
+@@ -0,0 +1,116 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: kdevcllayer.cxx,v $
++ * $Revision: 1.5 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_shell.hxx"
++#include "kdevcllayer.hxx"
++#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
++#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
++#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
++#endif
++#include <com/sun/star/uno/Sequence.hxx>
++#include <vcl/kde4_headers.h>
++
++//==============================================================================
++
++KDEVCLLayer::KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext)
++{
++    //Create instance of LayerContentDescriber Service
++    rtl::OUString const k_sLayerDescriberService(RTL_CONSTASCII_USTRINGPARAM(
++        "com.sun.star.comp.configuration.backend.LayerDescriber"));
++
++    typedef uno::Reference<backend::XLayerContentDescriber> LayerDescriber; 
++    uno::Reference< lang::XMultiComponentFactory > xServiceManager = xContext->getServiceManager();
++    if( xServiceManager.is() )
++    {
++        m_xLayerContentDescriber = LayerDescriber::query(
++            xServiceManager->createInstanceWithContext(k_sLayerDescriberService, xContext));
++    }
++    else
++    {
++        OSL_TRACE("Could not retrieve ServiceManager");
++    }
++}
++
++//------------------------------------------------------------------------------
++
++void SAL_CALL KDEVCLLayer::readData( const uno::Reference<backend::XLayerHandler>& xHandler) 
++    throw ( backend::MalformedDataException, lang::NullPointerException, 
++            lang::WrappedTargetException, uno::RuntimeException)
++{
++    if( ! m_xLayerContentDescriber.is() )
++    {
++        throw uno::RuntimeException( rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
++            "Could not create com.sun.star.configuration.backend.LayerContentDescriber Service"
++        ) ), static_cast < backend::XLayer * > (this) );
++    }
++    
++    uno::Sequence<backend::PropertyInfo> aPropInfoList(1);
++
++/*
++   Commenting out, does not make much sense without an accessibility bridge
++===========================================================================
++#if defined(QT_ACCESSIBILITY_SUPPORT)
++// Accessibility tools under Qt for UNIX are available starting with Qt 4.0
++    int nVersionMajor = 0;
++    const char *q = qVersion();     // "3.1.0" for example
++    while ('0' <= *q && *q <= '9')
++        nVersionMajor = nVersionMajor * 10 + *q++ - '0';
++    sal_Bool ATToolSupport = (sal_Bool) (nVersionMajor >= 4);
++#else
++    sal_Bool ATToolSupport = sal_False;
++#endif
++===========================================================================
++   End of commented out section
++*/  sal_Bool ATToolSupport = sal_False;
++
++    aPropInfoList[0].Name = rtl::OUString(
++        RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.VCL/Settings/Accessibility/EnableATToolSupport") );
++    aPropInfoList[0].Type = rtl::OUString( 
++        RTL_CONSTASCII_USTRINGPARAM( "string" ) );
++    aPropInfoList[0].Protected = sal_False;
++    aPropInfoList[0].Value = uno::makeAny( rtl::OUString::valueOf( ATToolSupport ) );
++
++    m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
++}
++
++//------------------------------------------------------------------------------
++
++rtl::OUString SAL_CALL KDEVCLLayer::getTimestamp(void) 
++    throw (uno::RuntimeException)
++{
++    // Return the value as timestamp to avoid regenerating the binary cache
++    // on each office launch.
++
++    ::rtl::OUString sTimeStamp(
++                RTL_CONSTASCII_USTRINGPARAM( "FALSE" ) );
++
++    return sTimeStamp;
++}
+diff --git shell/source/backends/kde4be/kdevcllayer.hxx shell/source/backends/kde4be/kdevcllayer.hxx
+new file mode 100644
+index 0000000..32b541a
+--- /dev/null
++++ shell/source/backends/kde4be/kdevcllayer.hxx
+@@ -0,0 +1,56 @@
++#ifndef KDEVCLLAYER_HXX_
++#define KDEVCLLAYER_HXX_
++
++#include "kdebackend.hxx"
++#include <com/sun/star/uno/XComponentContext.hpp>
++#include <com/sun/star/configuration/backend/XLayer.hpp>
++#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
++#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
++#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
++#endif
++#include <com/sun/star/util/XTimeStamped.hpp>
++#include <cppuhelper/implbase2.hxx>
++
++namespace css = com::sun::star ;
++namespace uno = css::uno ;
++namespace lang = css::lang ;
++namespace backend = css::configuration::backend ;
++namespace util = css::util ;
++
++/**
++  Implementation of the XLayer interface for the KDE values mapped into
++  the org.openoffice.VCL configuration component.
++  */
++class KDEVCLLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped> 
++{
++public :
++    /**
++      Constructor given the component context
++
++      @param xContext       The component context
++    */
++    
++    KDEVCLLayer(const uno::Reference<uno::XComponentContext>& xContext);
++
++    // XLayer
++    virtual void SAL_CALL readData(
++        const uno::Reference<backend::XLayerHandler>& xHandler) 
++        throw ( backend::MalformedDataException,
++            lang::NullPointerException, 
++            lang::WrappedTargetException, 
++            uno::RuntimeException) ;
++
++    // XTimeStamped
++    virtual rtl::OUString SAL_CALL getTimestamp(void) 
++        throw (uno::RuntimeException);
++
++    protected:
++
++    /** Destructor */
++    ~KDEVCLLayer(void) {}
++              
++    private :
++        uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber ;
++  } ;
++
++#endif // KDEVCLLAYER
+diff --git shell/source/backends/kde4be/makefile.mk shell/source/backends/kde4be/makefile.mk
+new file mode 100644
+index 0000000..48d5c8d
+--- /dev/null
++++ shell/source/backends/kde4be/makefile.mk
+@@ -0,0 +1,94 @@
++#*************************************************************************
++#
++# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++# 
++# Copyright 2008 by Sun Microsystems, Inc.
++#
++# OpenOffice.org - a multi-platform office productivity suite
++#
++# $RCSfile: makefile.mk,v $
++#
++# $Revision: 1.5 $
++#
++# This file is part of OpenOffice.org.
++#
++# OpenOffice.org is free software: you can redistribute it and/or modify
++# it under the terms of the GNU Lesser General Public License version 3
++# only, as published by the Free Software Foundation.
++#
++# OpenOffice.org is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU Lesser General Public License version 3 for more details
++# (a copy is included in the LICENSE file that accompanied this code).
++#
++# You should have received a copy of the GNU Lesser General Public License
++# version 3 along with OpenOffice.org.  If not, see
++# <http://www.openoffice.org/license.html>
++# for a copy of the LGPLv3 License.
++#
++#*************************************************************************
++PRJ=..$/..$/..
++
++PRJNAME=shell
++TARGET=kde4be
++
++LIBTARGET=NO
++ENABLE_EXCEPTIONS=TRUE
++
++COMP1TYPELIST=$(TARGET)
++COMPRDB=$(SOLARBINDIR)$/types.rdb
++UNOUCROUT=$(OUT)$/inc$/$(TARGET)
++INCPRE=$(UNOUCROUT)
++
++# --- Settings ---
++
++.INCLUDE : settings.mk
++
++# For some of the included external KDE headers, GCC complains about shadowed
++# symbols in instantiated template code only at the end of a compilation unit,
++# so the only solution is to disable that warning here:
++.IF "$(COM)" == "GCC"
++CFLAGSCXX+=-Wno-shadow
++.ENDIF
++
++UNIXTEXT=$(MISC)/$(TARGET)1-ucd.txt
++
++# no "lib" prefix
++DLLPRE =
++
++.IF "$(ENABLE_KDE4)" == "TRUE"
++
++CFLAGS+=$(KDE4_CFLAGS)
++
++# --- Files ---
++
++SLOFILES=\
++	$(SLO)$/kdebackend.obj \
++	$(SLO)$/kdecommonlayer.obj \
++	$(SLO)$/kdeinetlayer.obj \
++	$(SLO)$/kdevcllayer.obj \
++	$(SLO)$/kdepathslayer.obj \
++	$(SLO)$/kdebecdef.obj
++
++SHL1NOCHECK=TRUE
++SHL1TARGET=$(TARGET)1.uno   
++SHL1OBJS=$(SLOFILES)
++SHL1DEF=$(MISC)$/$(SHL1TARGET).def
++
++SHL1IMPLIB=i$(SHL1TARGET)
++SHL1STDLIBS=    \
++        $(CPPUHELPERLIB) \
++        $(CPPULIB) \
++        $(SALLIB) \
++        $(KDE4_LIBS) -lkio
++        
++SHL1VERSIONMAP=exports.map
++SHL1DEF=$(MISC)$/$(SHL1TARGET).def
++DEF1NAME=$(SHL1TARGET)
++
++.ENDIF
++
++# --- Targets ---
++
++.INCLUDE : target.mk
diff --git a/patches/dev300/kde4-vcl-prj.diff b/patches/dev300/kde4-vcl-prj.diff
new file mode 100644
index 0000000..3cc467e
--- /dev/null
+++ b/patches/dev300/kde4-vcl-prj.diff
@@ -0,0 +1,34 @@
+diff --git vcl/prj/build.lst vcl/prj/build.lst
+index eeda7e6..e60416f 100644
+--- vcl/prj/build.lst
++++ vcl/prj/build.lst
+@@ -7,15 +7,16 @@ vc  vcl\unx\gtk\app							nmake   -   u   vc__gtka vc_inc NULL
+ vc  vcl\unx\gtk\window						nmake   -   u   vc__gtkw vc_inc NULL
+ vc  vcl\unx\gtk\gdi 						nmake   -   u   vc__gtkg vc_inc NULL
+ vc  vcl\unx\headless						nmake   -   u   vc__hl   vc_inc NULL
+ vc  vcl\unx\kde							nmake   -   u   vc__kde  vc_inc NULL
++vc  vcl\unx\kde4							nmake   -   u   vc__kde4  vc_inc NULL
+ vc	vcl\aqua\source\a11y					nmake	-	u	vc__aquy vc_inc NULL
+ vc	vcl\aqua\source\app						nmake	-	u	vc__appa vc_inc NULL
+ vc	vcl\aqua\source\gdi						nmake	-	u	vc__gdia vc_inc NULL
+ vc	vcl\aqua\source\res                 nmake   -   u   vc__resa NULL
+ vc	vcl\aqua\source\window					nmake	-	u	vc__wina vc_inc NULL
+ vc	vcl\mac\source\app						nmake	-	m	vc__appm vc_inc NULL
+ vc	vcl\mac\source\gdi						nmake	-	m	vc__gdim vc_inc NULL
+ vc	vcl\mac\source\window					nmake	-	m	vc__winm vc_inc NULL
+ vc	vcl\mac\source\src						nmake	-	m	vc__srcm vc_inc NULL
+-vc	vcl\util								nmake	-	all	vc_util vc__plug.u vc__aquy.u vc__appa.u vc__appm.m vc__appu.u vc__appw.w vc__appp.p vc__gdia.u vc__gdim.m vc__gdiu.u vc__gdiw.w vc__gdip.p vc__srcm.m vc__srcw.w vc__srcp.p vc__wina.u vc__winm.m vc__winu.u vc__winw.w vc__winp.p vc__gtka.u vc__gtky.u vc__gtkw.u vc__gtkg.u vc__kde.u vc__hl.u vc_app vc_ctrl vc_gdi vc_hlp vc_src vc_win vc_glyphs vc_components NULL
++vc	vcl\util								nmake	-	all	vc_util vc__plug.u vc__aquy.u vc__appa.u vc__appm.m vc__appu.u vc__appw.w vc__appp.p vc__gdia.u vc__gdim.m vc__gdiu.u vc__gdiw.w vc__gdip.p vc__srcm.m vc__srcw.w vc__srcp.p vc__wina.u vc__winm.m vc__winu.u vc__winw.w vc__winp.p vc__gtka.u vc__gtky.u vc__gtkw.u vc__gtkg.u vc__kde.u vc__kde4.u vc__hl.u vc_app vc_ctrl vc_gdi vc_hlp vc_src vc_win vc_glyphs vc_components NULL
+ vc  vcl\util\linksvp                        nmake   -   u   vc_lsvp vc_util NULL
+diff --git vcl/prj/d.lst vcl/prj/d.lst
+index c7a5f71..d476228 100644
+--- vcl/prj/d.lst
++++ vcl/prj/d.lst
+@@ -64,6 +64,7 @@ mkdir: %_DEST%\inc%_EXT%\vcl\plug\vcl
+ ..\inc\vcl\javachild.hxx %_DEST%\inc%_EXT%\vcl\javachild.hxx
+ ..\inc\vcl\jobset.hxx %_DEST%\inc%_EXT%\vcl\jobset.hxx
+ ..\unx\inc\kde_headers.h %_DEST%\inc%_EXT%\vcl\kde_headers.h
++..\unx\inc\kde4_headers.h %_DEST%\inc%_EXT%\vcl\kde4_headers.h
+ ..\inc\vcl\keycod.hxx %_DEST%\inc%_EXT%\vcl\keycod.hxx
+ ..\inc\vcl\keycodes.hxx %_DEST%\inc%_EXT%\vcl\keycodes.hxx
+ ..\inc\vcl\lineinfo.hxx %_DEST%\inc%_EXT%\vcl\lineinfo.hxx
diff --git a/patches/dev300/kde4-vcl.diff b/patches/dev300/kde4-vcl.diff
new file mode 100644
index 0000000..5442c26
--- /dev/null
+++ b/patches/dev300/kde4-vcl.diff
@@ -0,0 +1,1884 @@
+diff --git vcl/unx/kde4/kdedata.cxx vcl/unx/kde4/kdedata.cxx
+new file mode 100644
+index 0000000..bfc0d2c
+--- /dev/null
++++ vcl/unx/kde4/kdedata.cxx
+@@ -0,0 +1,291 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: kdedata.cxx,v $
++ * $Revision: 1.21 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_vcl.hxx"
++
++#define _SV_SALDATA_CXX
++#include "kde4_headers.h"
++
++#include <unistd.h>
++#include <fcntl.h>
++
++#include <stdio.h>
++#include <string.h>
++#include <stdlib.h>
++#include <limits.h>
++#include <errno.h>
++#include <poll.h>
++#ifdef FREEBSD
++#include <sys/types.h>
++#include <sys/time.h>
++#include <unistd.h>
++#endif
++#include <plugins/kde4/kdedata.hxx>
++#include <osl/thread.h>
++#include <osl/process.h>
++#include <osl/module.h>
++
++#include <tools/debug.hxx>
++#include "i18n_im.hxx"
++#include "i18n_xkb.hxx"
++#include <vos/process.hxx>
++#ifndef _VOS_MUTEX_HXX
++#include <vos/mutex.hxx>
++#endif
++
++/* #i59042# override KApplications method for session management
++ * since it will interfere badly with our own.
++ */
++class VCLKDEApplication : public KApplication
++{
++    public:
++		VCLKDEApplication() : 
++			KApplication()
++		{
++			disp = 0;
++		}
++		
++		virtual void commitData(QSessionManager &sm);
++		
++		virtual bool x11EventFilter(XEvent* event);
++		
++		SalKDEDisplay* disp;
++};
++
++void VCLKDEApplication::commitData(QSessionManager&)
++{
++}
++
++bool VCLKDEApplication::x11EventFilter(XEvent* event)
++{	
++	//if we have a display and the display consumes the event
++	//do not process the event in qt
++	if (disp && disp->Dispatch(event) > 0)
++	{
++		return true;
++	}
++	
++	return false;
++}
++
++/***************************************************************************
++ * class SalKDEDisplay                                                     *
++ ***************************************************************************/
++
++SalKDEDisplay::SalKDEDisplay( Display* pDisp )
++    : SalX11Display( pDisp )
++{
++}
++
++SalKDEDisplay::~SalKDEDisplay()
++{
++    // in case never a frame opened
++    static_cast<KDEXLib*>(GetXLib())->doStartup();
++    // clean up own members
++    doDestruct();
++    // prevent SalDisplay from closing KApplication's display
++    pDisp_ = NULL;
++}
++
++/***************************************************************************
++ * class KDEXLib                                                           *
++ ***************************************************************************/
++
++KDEXLib::~KDEXLib()
++{
++	delete (VCLKDEApplication*)m_pApplication;
++	
++    // free the faked cmdline arguments no longer needed by KApplication
++    for( int i = 0; i < m_nFakeCmdLineArgs; i++ )
++	{
++        free( m_pFreeCmdLineArgs[i] );
++	}
++	
++    delete [] m_pFreeCmdLineArgs;
++    delete [] m_pAppCmdLineArgs;
++}
++
++void KDEXLib::Init()
++{
++	SalI18N_InputMethod* pInputMethod = new SalI18N_InputMethod;
++	pInputMethod->SetLocale();
++	XrmInitialize();
++
++	KAboutData *kAboutData = new KAboutData( "OpenOffice.org",
++			"OpenOffice.org",
++			ki18n( "OpenOffice.org" ),
++			"3.0.0",
++			ki18n( "OpenOffice.org with KDE Native Widget Support." ),
++			KAboutData::License_LGPL,
++			ki18n( "Copyright (c) 2003, 2004, 2005, 2006, 2007, 2008 Novell, Inc"),
++			ki18n( "OpenOffice.org is an office suite.\n" ),
++			"http://kde.openoffice.org/index.html",
++			"dev at kde.openoffice.org" );
++	kAboutData->addAuthor( ki18n( "Jan Holesovsky" ),
++			ki18n( "Original author and maintainer of the KDE NWF." ),
++			"kendy at artax.karlin.mff.cuni.cz",
++			"http://artax.karlin.mff.cuni.cz/~kendy" );
++	kAboutData->addAuthor( ki18n("Eric Bischoff"),
++			ki18n( "Accessibility fixes, porting to KDE 4." ),
++			"bischoff at kde.org" );
++
++    m_nFakeCmdLineArgs = 1;
++	USHORT nIdx;
++	vos::OExtCommandLine aCommandLine;
++	int nParams = aCommandLine.getCommandArgCount();
++	rtl::OString aDisplay;
++	rtl::OUString aParam, aBin;
++
++	for ( nIdx = 0; nIdx < nParams; ++nIdx ) 
++	{
++		aCommandLine.getCommandArg( nIdx, aParam );
++		if ( !m_pFreeCmdLineArgs && aParam.equalsAscii( "-display" ) && nIdx + 1 < nParams )
++		{
++			aCommandLine.getCommandArg( nIdx + 1, aParam );
++			aDisplay = rtl::OUStringToOString( aParam, osl_getThreadTextEncoding() );
++
++			m_nFakeCmdLineArgs = 3;
++			m_pFreeCmdLineArgs = new char*[ m_nFakeCmdLineArgs ];
++			m_pFreeCmdLineArgs[ 1 ] = strdup( "-display" );
++			m_pFreeCmdLineArgs[ 2 ] = strdup( aDisplay.getStr() );
++		}
++	}
++	if ( !m_pFreeCmdLineArgs )
++		m_pFreeCmdLineArgs = new char*[ m_nFakeCmdLineArgs ];
++
++    osl_getExecutableFile( &aParam.pData );
++    osl_getSystemPathFromFileURL( aParam.pData, &aBin.pData );
++    rtl::OString aExec = rtl::OUStringToOString( aBin, osl_getThreadTextEncoding() );
++	m_pFreeCmdLineArgs[0] = strdup( aExec.getStr() );
++
++    // make a copy of the string list for freeing it since
++    // KApplication manipulates the pointers inside the argument vector
++    // note: KApplication bad !
++    m_pAppCmdLineArgs = new char*[ m_nFakeCmdLineArgs ];
++    for( int i = 0; i < m_nFakeCmdLineArgs; i++ )
++        m_pAppCmdLineArgs[i] = m_pFreeCmdLineArgs[i];
++
++	KCmdLineArgs::init( m_nFakeCmdLineArgs, m_pAppCmdLineArgs, kAboutData );
++	
++	m_pApplication = new VCLKDEApplication();
++	kapp->disableSessionManagement();
++	
++	Display* pDisp = QX11Info::display();
++	SalKDEDisplay *pSalDisplay = new SalKDEDisplay(pDisp);
++	
++	((VCLKDEApplication*)m_pApplication)->disp = pSalDisplay;
++
++	XSetIOErrorHandler	  ( (XIOErrorHandler)X11SalData::XIOErrorHdl );
++	XSetErrorHandler	  ( (XErrorHandler)X11SalData::XErrorHdl );
++	
++	pInputMethod->CreateMethod( pDisp );
++	pInputMethod->AddConnectionWatch( pDisp, (void*)this );
++	pSalDisplay->SetInputMethod( pInputMethod );
++
++    PushXErrorLevel( true );
++	SalI18N_KeyboardExtension *pKbdExtension = new SalI18N_KeyboardExtension( pDisp );
++	XSync( pDisp, False );
++
++	pKbdExtension->UseExtension( ! HasXErrorOccured() );
++	PopXErrorLevel();
++
++	pSalDisplay->SetKbdExtension( pKbdExtension );
++}
++
++void KDEXLib::doStartup()
++{
++    if( ! m_bStartupDone )
++    {
++        KStartupInfo::appStarted();
++        m_bStartupDone = true;
++        #if OSL_DEBUG_LEVEL > 1
++        fprintf( stderr, "called KStartupInfo::appStarted()\n" );
++        #endif
++    }
++}
++
++/**********************************************************************
++ * class KDEData                                                      *
++ **********************************************************************/
++
++KDEData::~KDEData()
++{
++}
++
++void KDEData::Init()
++{
++    pXLib_ = new KDEXLib();
++    pXLib_->Init();
++}
++
++/**********************************************************************
++ * plugin entry point                                                 *
++ **********************************************************************/
++
++extern "C" {
++    VCL_DLLPUBLIC SalInstance* create_SalInstance( oslModule )
++    {
++#if QT_VERSION < 0x040000
++	// Qt 3.x support needs >= 3.2.2 - any 4.x should be ok
++        rtl::OString aVersion( qVersion() );
++#if OSL_DEBUG_LEVEL > 1
++        fprintf( stderr, "qt version string is \"%s\"\n", aVersion.getStr() );
++#endif
++        sal_Int32 nIndex = 0, nMajor = 0, nMinor = 0, nMicro = 0;
++        nMajor = aVersion.getToken( 0, '.', nIndex ).toInt32();
++        if( nIndex > 0 )
++            nMinor = aVersion.getToken( 0, '.', nIndex ).toInt32();
++        if( nIndex > 0 )
++            nMicro = aVersion.getToken( 0, '.', nIndex ).toInt32();
++        if( nMajor != 3 || nMinor < 2 || (nMinor == 2 && nMicro < 2) )
++        {
++#if OSL_DEBUG_LEVEL > 1
++            fprintf( stderr, "unsuitable qt version %d.%d.%d\n", nMajor, nMinor, nMicro );
++#endif
++            return NULL;
++        }
++#endif
++        
++        KDESalInstance* pInstance = new KDESalInstance( new SalYieldMutex() );
++#if OSL_DEBUG_LEVEL > 1
++        fprintf( stderr, "created KDESalInstance 0x%p\n", pInstance );
++#endif
++
++        // initialize SalData
++        KDEData *pSalData = new KDEData();
++        SetSalData( pSalData );
++        pSalData->m_pInstance = pInstance;
++        pSalData->Init();
++        pSalData->initNWF();
++
++        return pInstance;
++    }
++}
+diff --git vcl/unx/kde4/makefile.mk vcl/unx/kde4/makefile.mk
+new file mode 100644
+index 0000000..fe78901
+--- /dev/null
++++ vcl/unx/kde4/makefile.mk
+@@ -0,0 +1,85 @@
++#*************************************************************************
++#
++# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++# 
++# Copyright 2008 by Sun Microsystems, Inc.
++#
++# OpenOffice.org - a multi-platform office productivity suite
++#
++# $RCSfile: makefile.mk,v $
++#
++# $Revision: 1.10 $
++#
++# This file is part of OpenOffice.org.
++#
++# OpenOffice.org is free software: you can redistribute it and/or modify
++# it under the terms of the GNU Lesser General Public License version 3
++# only, as published by the Free Software Foundation.
++#
++# OpenOffice.org is distributed in the hope that it will be useful,
++# but WITHOUT ANY WARRANTY; without even the implied warranty of
++# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++# GNU Lesser General Public License version 3 for more details
++# (a copy is included in the LICENSE file that accompanied this code).
++#
++# You should have received a copy of the GNU Lesser General Public License
++# version 3 along with OpenOffice.org.  If not, see
++# <http://www.openoffice.org/license.html>
++# for a copy of the LGPLv3 License.
++#
++#*************************************************************************
++
++PRJ=..$/..
++
++PRJNAME=vcl
++TARGET=kde4plug
++.INCLUDE :  $(PRJ)$/util$/makefile.pmk
++
++# workaround for makedepend hang
++MKDEPENDSOLVER=
++
++# --- Settings -----------------------------------------------------
++
++.INCLUDE :  settings.mk
++.INCLUDE :  $(PRJ)$/util$/makefile2.pmk
++
++# For some of the included external KDE headers, GCC complains about shadowed
++# symbols in instantiated template code only at the end of a compilation unit,
++# so the only solution is to disable that warning here:
++.IF "$(COM)" == "GCC"
++CFLAGSCXX+=-Wno-shadow
++.ENDIF
++
++# --- Files --------------------------------------------------------
++
++.IF "$(GUIBASE)"!="unx"
++
++dummy:
++	@echo "Nothing to build for GUIBASE $(GUIBASE)"
++
++.ELSE		# "$(GUIBASE)"!="unx"
++
++.IF "$(ENABLE_KDE4)" != ""
++
++CFLAGS+=$(KDE4_CFLAGS)
++
++.IF "$(ENABLE_RANDR)" != ""
++CDEFS+=-DUSE_RANDR
++.ENDIF
++
++SLOFILES=\
++	$(SLO)$/kdedata.obj	\
++	$(SLO)$/salnativewidgets-kde.obj
++
++.ELSE # "$(ENABLE_KDE4)" != ""
++
++dummy:
++	@echo KDE disabled - nothing to build
++.ENDIF
++.ENDIF		# "$(GUIBASE)"!="unx"
++
++# --- Targets ------------------------------------------------------
++
++.INCLUDE :  target.mk
++
++.INCLUDE :  $(PRJ)$/util$/target.pmk
+diff --git vcl/unx/kde4/salnativewidgets-kde.cxx vcl/unx/kde4/salnativewidgets-kde.cxx
+new file mode 100644
+index 0000000..ac91b21
+--- /dev/null
++++ vcl/unx/kde4/salnativewidgets-kde.cxx
+@@ -0,0 +1,1261 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: salnativewidgets-kde.cxx,v $
++ * $Revision: 1.26.86.1 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++// MARKER(update_precomp.py): autogen include statement, do not remove
++#include "precompiled_vcl.hxx"
++
++#define _SV_SALNATIVEWIDGETS_KDE_CXX
++#include "kde4_headers.h"
++
++#include <salunx.h>
++#include <saldata.hxx>
++#include <saldisp.hxx>
++
++#ifndef _SV_SALGDI_HXX
++#include <salgdi.h>
++#endif
++
++#ifndef _SV_SALGDI_HXX
++#include <salframe.h>
++#endif
++#include <vcl/settings.hxx>
++#include <rtl/ustrbuf.hxx>
++#include <plugins/kde4/kdedata.hxx>
++#include <iostream>
++
++#include <pspgraphics.h>
++
++using namespace ::rtl;
++
++/** 
++  Conversion function between VCL ControlState together with
++  ImplControlValue and Qt state flags.
++  @param nControlState State of the widget (default, focused, ...) in Native Widget Framework.
++  @param aValue Value held by the widget (on, off, ...)
++*/
++QStyle::State vclStateValue2StateFlag( ControlState nControlState,
++	const ImplControlValue& aValue )
++{
++    QStyle::State nState =
++		( (nControlState & CTRL_STATE_DEFAULT)?  QStyle::State_None:      QStyle::State_None ) |
++		( (nControlState & CTRL_STATE_ENABLED)?  QStyle::State_Enabled:   QStyle::State_None ) |
++		( (nControlState & CTRL_STATE_FOCUSED)?  QStyle::State_HasFocus:  QStyle::State_None ) |
++		( (nControlState & CTRL_STATE_PRESSED)?  QStyle::State_Sunken:    QStyle::State_None ) |
++		( (nControlState & CTRL_STATE_SELECTED)? QStyle::State_Selected : QStyle::State_None ) |
++		( (nControlState & CTRL_STATE_ROLLOVER)? QStyle::State_MouseOver: QStyle::State_None );
++		//TODO ( (nControlState & CTRL_STATE_HIDDEN)?   QStyle::State_:   QStyle::State_None ) |
++
++    switch ( aValue.getTristateVal() )
++    {
++		case BUTTONVALUE_ON:    nState |= QStyle::State_On;       break;
++		case BUTTONVALUE_OFF:   nState |= QStyle::State_Off;      break;
++		case BUTTONVALUE_MIXED: nState |= QStyle::State_NoChange; break;
++		default: break;
++    }
++
++    return nState;
++}
++
++/** 
++ Convert VCL Region to QRect.
++ @param rControlRegion The region to convert.
++ @return The bounding box of the region.
++*/
++QRect region2QRect( const Region& rControlRegion )
++{
++    Rectangle aRect = rControlRegion.GetBoundRect();
++
++    return QRect( QPoint( aRect.Left(), aRect.Top() ),
++		  QPoint( aRect.Right(), aRect.Bottom() ) );
++}
++
++/** handles graphics drawings requests and performs the needed drawing operations */
++class KDESalGraphics : public X11SalGraphics
++{
++	public:
++		KDESalGraphics() {}
++		virtual ~KDESalGraphics() {}
++		
++		/**
++			What widgets can be drawn the native way.
++			@param type Type of the widget.
++			@param part Specification of the widget's part if it consists of more than one.
++			@return true if the platform supports native drawing of the widget type defined by part.
++		*/
++		virtual BOOL IsNativeControlSupported( ControlType type, ControlPart part );
++		
++		virtual BOOL hitTestNativeControl( ControlType type, ControlPart part,
++										const Region& rControlRegion, const Point& aPos,
++										SalControlHandle& rControlHandle, BOOL& rIsInside );
++										
++		virtual BOOL drawNativeControl( ControlType type, ControlPart part,
++										const Region& rControlRegion, ControlState nControlState,
++										const ImplControlValue& aValue, SalControlHandle& rControlHandle,
++										const OUString& aCaption );
++										
++		
++		/** Draw text on the widget.
++			OPTIONAL. Draws the requested text for the control described by part/nControlState.
++			Used if text is not drawn by DrawNativeControl().
++		
++			@param rControlRegion The bounding region of the complete control in VCL frame coordinates.
++			@param aValue An optional value (tristate/numerical/string)
++			@param rControlHandle Carries platform dependent data and is maintained by the SalFrame implementation.
++			@param aCaption	A caption or title string (like button text etc.)
++		*/
++		virtual BOOL drawNativeControlText( ControlType type, ControlPart part,
++											const Region& rControlRegion, ControlState nControlState,
++											const ImplControlValue& aValue, SalControlHandle& rControlHandle,
++											const OUString& aCaption ) { return false; }
++											
++		virtual BOOL getNativeControlRegion( ControlType type, ControlPart part,
++											const Region& rControlRegion, ControlState nControlState,
++											const ImplControlValue& aValue, SalControlHandle& rControlHandle,
++											const OUString& aCaption,
++											Region &rNativeBoundingRegion, Region &rNativeContentRegion );
++};
++
++BOOL KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart part )
++{
++	if (type == CTRL_PUSHBUTTON) return true;
++	
++	if (type == CTRL_MENUBAR) return true;
++	
++	if (type == CTRL_MENU_POPUP) return true;
++	
++	//if ((type == CTRL_MENU_POPUP) && ((part == PART_MENU_ITEM) || (part == PART_ENTIRE_CONTROL))) return true;
++
++	if (type == CTRL_EDITBOX) return true;
++	
++	if (type == CTRL_COMBOBOX) return true;
++	
++	if (type == CTRL_TOOLBAR) return true;
++	
++	if (type == CTRL_CHECKBOX) return true;
++	
++	if (type == CTRL_LISTBOX) return true;
++	
++	if (type == CTRL_LISTNODE) return true;
++	
++	if (type == CTRL_FRAME) return true;
++	
++	if (type == CTRL_SCROLLBAR) return true;
++	
++	if (type == CTRL_WINDOW_BACKGROUND) return true;
++	
++	if (type == CTRL_SPINBOX) return true;
++	
++	if (type == CTRL_SPINBUTTONS) return true;
++	
++	if (type == CTRL_GROUPBOX) return true;
++	
++	if (type == CTRL_FIXEDLINE) return true;
++	
++	if (type == CTRL_FIXEDBORDER) return true;
++	
++	if (type == CTRL_TOOLTIP) return true;
++	
++	if (type == CTRL_RADIOBUTTON) return true;
++	
++	return false;
++	
++	if ( (type == CTRL_TAB_ITEM) && (part == PART_ENTIRE_CONTROL) ) return true;
++	if ( (type == CTRL_TAB_PANE) && (part == PART_ENTIRE_CONTROL) ) return true;
++	// no CTRL_TAB_BODY for KDE
++	if ( (type == CTRL_PROGRESS)    && (part == PART_ENTIRE_CONTROL) ) return true;
++		
++	return false;
++}
++
++
++/** Test whether the position is in the native widget.
++
++    If the return value is TRUE, bIsInside contains information whether
++    aPos was or was not inside the native widget specified by the
++    type/part combination.
++*/
++BOOL KDESalGraphics::hitTestNativeControl( ControlType type, ControlPart part,
++										   const Region& rControlRegion, const Point& rPos,
++										   SalControlHandle&, BOOL& rIsInside )
++{
++    return FALSE;
++}
++
++
++/** Draw the requested control described by part/nControlState.
++ 
++    @param rControlRegion
++    The bounding region of the complete control in VCL frame coordinates.
++    
++    @param aValue
++    An optional value (tristate/numerical/string).
++    
++    @param rControlHandle
++    Carries platform dependent data and is maintained by the SalFrame implementation.
++    
++    @param aCaption
++    A caption or title string (like button text etc.)
++*/
++BOOL KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
++										const Region& rControlRegion, ControlState nControlState,
++										const ImplControlValue& value, SalControlHandle&,
++										const OUString& )
++{
++    BOOL returnVal = true;
++
++    Display* dpy = GetXDisplay();
++    XLIB_Window drawable = GetDrawable();
++    GC gc = SelectPen();
++	
++	QRect widgetRect = region2QRect(rControlRegion);
++	
++	//draw right onto the window
++	QPixmap pixmap(widgetRect.width(), widgetRect.height());
++	
++	if (pixmap.isNull())
++	{
++		return false;
++	}
++	
++	QPainter painter(&pixmap);
++	painter.setBackgroundMode(Qt::OpaqueMode);
++	
++	//copy previous screen contents for proper blending
++	QPixmap screen = QPixmap::fromX11Pixmap(drawable);
++	painter.drawPixmap(0,0, screen, widgetRect.left(), widgetRect.top(), widgetRect.width(), widgetRect.height());
++	
++    if (type == CTRL_PUSHBUTTON)
++    {
++		QStyleOptionButton styleOption;
++		
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state =vclStateValue2StateFlag( nControlState, value );
++		
++		kapp->style()->drawControl( QStyle::CE_PushButton, &styleOption, &painter);
++    }
++	else if ( (type == CTRL_MENUBAR))
++	{
++		if (part == PART_MENU_ITEM) 
++		{
++			QStyleOptionMenuItem styleOption;
++			
++			styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++			styleOption.state = vclStateValue2StateFlag( nControlState, value );
++			
++			kapp->style()->drawControl( QStyle::CE_MenuBarItem, &styleOption, &painter);
++		}
++		else
++		{
++			pixmap.fill(KApplication::palette().color(QPalette::Window));
++		}
++	}
++	else if (type == CTRL_MENU_POPUP)
++	{		
++		if (part == PART_MENU_ITEM)
++		{
++			QStyleOptionMenuItem styleOption;
++			
++			styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++			styleOption.state = vclStateValue2StateFlag( nControlState, value );
++			
++			kapp->style()->drawControl( QStyle::CE_MenuItem, &styleOption, &painter);
++		}
++		else if (part == PART_MENU_ITEM_CHECK_MARK)
++		{
++			QStyleOptionButton styleOption;
++			
++			styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++			styleOption.state = vclStateValue2StateFlag( nControlState, value );
++			
++			if (nControlState & CTRL_STATE_PRESSED)
++			{
++				kapp->style()->drawPrimitive( QStyle::PE_IndicatorMenuCheckMark, &styleOption, &painter);
++			}
++		}
++		else if (part == PART_MENU_ITEM_RADIO_MARK)
++		{
++			QStyleOptionButton styleOption;
++			
++			styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++			styleOption.state = vclStateValue2StateFlag( nControlState, value );
++			
++			if (nControlState & CTRL_STATE_PRESSED)
++			{
++				kapp->style()->drawPrimitive( QStyle::PE_IndicatorRadioButton, &styleOption, &painter);
++			}
++		}
++		else
++		{
++			pixmap.fill(KApplication::palette().color(QPalette::Window));
++			
++			QStyleOptionFrameV3 styleOption;
++		
++			styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++			styleOption.state = vclStateValue2StateFlag( nControlState, value );
++			styleOption.frameShape = QFrame::StyledPanel;
++			
++			kapp->style()->drawPrimitive( QStyle::PE_FrameMenu, &styleOption, &painter);
++		}
++	}
++	else if ( (type == CTRL_TOOLBAR) && (part == PART_BUTTON) )
++    {
++		QStyleOptionToolButton styleOption;
++		
++		styleOption.arrowType = Qt::NoArrow;
++		styleOption.subControls = QStyle::SC_ToolButton;
++		
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		styleOption.state |= QStyle::State_Raised | QStyle::State_Enabled | QStyle::State_AutoRaise;
++		
++		kapp->style()->drawComplexControl( QStyle::CC_ToolButton, &styleOption, &painter);
++    }
++	else if ( (type == CTRL_TOOLBAR) && (part == PART_ENTIRE_CONTROL) )
++    {
++		QStyleOptionToolBar styleOption;
++		
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		
++		kapp->style()->drawControl( QStyle::CE_ToolBar, &styleOption, &painter);
++    }
++	else if ( (type == CTRL_TOOLBAR) && (part == PART_THUMB_VERT) )
++    {
++        QStyleOption styleOption;
++		
++		int width = kapp->style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
++		
++		styleOption.rect = QRect(0, 0, width, widgetRect.height());
++		styleOption.state = QStyle::State_Horizontal;
++		
++		kapp->style()->drawPrimitive( QStyle::PE_IndicatorToolBarHandle, &styleOption, &painter);
++    }
++	else if (type == CTRL_EDITBOX)
++	{
++		pixmap.fill(KApplication::palette().color(QPalette::Window));
++		
++		//TODO hover?? OO does not seem to do this for line edits
++		
++		QStyleOptionFrameV3 styleOption;
++		
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		
++		//TODO...how does the line edit draw itself internally??
++		styleOption.rect = QRect(2, 2, widgetRect.width()-4, widgetRect.height()-4);
++		kapp->style()->drawPrimitive( QStyle::PE_PanelLineEdit, &styleOption, &painter);
++		
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		kapp->style()->drawPrimitive( QStyle::PE_FrameLineEdit, &styleOption, &painter);
++	}
++	else if (type == CTRL_COMBOBOX)
++	{
++		pixmap.fill(KApplication::palette().color(QPalette::Window));
++		
++		QStyleOptionComboBox styleOption;
++		
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		
++		styleOption.editable = true;
++		
++		kapp->style()->drawComplexControl(QStyle::CC_ComboBox, &styleOption, &painter);
++	}
++	else if (type == CTRL_LISTBOX)
++	{
++		QStyleOptionComboBox styleOption;
++		
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		
++		if (part == PART_SUB_EDIT)
++		{
++			kapp->style()->drawControl(QStyle::CE_ComboBoxLabel, &styleOption, &painter);
++		}
++		else
++		{
++			kapp->style()->drawComplexControl(QStyle::CC_ComboBox, &styleOption, &painter);
++		}
++	}
++	else if (type == CTRL_LISTNODE)
++	{
++		QStyleOption styleOption;
++		
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		
++		styleOption.state |= QStyle::State_Item;
++		styleOption.state |= QStyle::State_Children;
++		
++		if (nControlState & CTRL_STATE_PRESSED)
++		{
++			styleOption.state |= QStyle::State_Open;
++		}
++		
++		kapp->style()->drawPrimitive(QStyle::PE_IndicatorBranch, &styleOption, &painter);
++	}
++	else if (type == CTRL_CHECKBOX)
++	{	
++		QStyleOptionButton styleOption;
++		
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		
++		kapp->style()->drawControl(QStyle::CE_CheckBox, &styleOption, &painter);
++	}
++	else if (type == CTRL_SCROLLBAR)
++	{
++		pixmap.fill(KApplication::palette().color(QPalette::Window));
++		
++		if ((part == PART_DRAW_BACKGROUND_VERT) || (part == PART_DRAW_BACKGROUND_HORZ))
++		{
++			ScrollbarValue* sbVal = static_cast<ScrollbarValue *> ( value.getOptionalVal() );
++			
++			QStyleOptionSlider styleOption;
++			styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++			
++			//if the scroll bar is active (aka not degenrate...allow for hover events
++			if (sbVal->mnVisibleSize < sbVal->mnMax)
++			{
++				styleOption.state = vclStateValue2StateFlag( nControlState, value );
++				styleOption.state |= QStyle::State_MouseOver;
++			}
++			
++			//horizontal or vertical
++			if (part == PART_DRAW_BACKGROUND_VERT)
++			{
++				styleOption.orientation = Qt::Vertical;
++			}
++			else
++			{
++				styleOption.state |= QStyle::State_Horizontal;
++			}
++			
++			//setup parameters from the OO values
++			styleOption.minimum = sbVal->mnMin;
++			styleOption.maximum = sbVal->mnMax - sbVal->mnVisibleSize;
++			styleOption.sliderValue = sbVal->mnCur;
++			styleOption.sliderPosition = sbVal->mnCur;
++			styleOption.pageStep = sbVal->mnVisibleSize;
++			
++			//setup the active control...always the slider
++			if (sbVal->mnThumbState & CTRL_STATE_ROLLOVER)
++			{
++				styleOption.activeSubControls = QStyle::SC_ScrollBarSlider;
++			}
++			
++			kapp->style()->drawComplexControl(QStyle::CC_ScrollBar, &styleOption, &painter);
++		}
++	}
++	else if (type == CTRL_SPINBOX)
++	{
++		pixmap.fill(KApplication::palette().color(QPalette::Window));
++		//SpinbuttonValue* sbVal = static_cast<SpinbuttonValue *> ( value.getOptionalVal() );
++		
++		QStyleOptionSpinBox styleOption;
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		
++		kapp->style()->drawComplexControl(QStyle::CC_SpinBox, &styleOption, &painter);
++	}
++	else if (type == CTRL_SPINBUTTONS)
++	{
++		pixmap.fill(KApplication::palette().color(QPalette::Window));
++		
++		QStyleOptionSpinBox styleOption;
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		
++		styleOption.subControls = QStyle::SC_SpinBoxUp | QStyle::SC_SpinBoxDown;
++		
++		kapp->style()->drawComplexControl(QStyle::CC_SpinBox, &styleOption, &painter);
++	}
++	else if (type == CTRL_GROUPBOX)
++	{
++		QStyleOptionGroupBox styleOption;
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		
++		kapp->style()->drawComplexControl(QStyle::CC_GroupBox, &styleOption, &painter);
++	}
++	else if (type == CTRL_RADIOBUTTON)
++	{
++		QStyleOptionButton styleOption;
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		
++		kapp->style()->drawControl(QStyle::CE_RadioButton, &styleOption, &painter);
++	}
++	else if (type == CTRL_TOOLTIP)
++	{
++		QStyleOption styleOption;
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		
++		kapp->style()->drawPrimitive(QStyle::PE_PanelTipLabel, &styleOption, &painter);
++	}
++	else if (type == CTRL_FRAME)
++	{
++		QStyleOptionFrameV3 styleOption;
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		styleOption.frameShape = QFrame::StyledPanel;
++		
++		kapp->style()->drawPrimitive(QStyle::PE_FrameWindow, &styleOption, &painter);
++	}
++	else if (type == CTRL_FIXEDBORDER)
++	{
++		QStyleOptionFrameV3 styleOption;
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		styleOption.frameShape = QFrame::StyledPanel;
++		
++		kapp->style()->drawPrimitive(QStyle::PE_FrameWindow, &styleOption, &painter);
++	}
++	else if (type == CTRL_WINDOW_BACKGROUND)
++	{
++		pixmap.fill(KApplication::palette().color(QPalette::Window));	
++	}
++	else if (type == CTRL_FIXEDLINE)
++	{
++		QStyleOptionMenuItem styleOption;
++			
++		styleOption.rect = QRect(0, 0, widgetRect.width(), widgetRect.height());
++		styleOption.state = vclStateValue2StateFlag( nControlState, value );
++		styleOption.menuItemType = QStyleOptionMenuItem::Separator;
++		styleOption.state |= QStyle::State_Item;
++		
++		kapp->style()->drawControl( QStyle::CE_MenuItem, &styleOption, &painter);
++	}
++	else
++	{
++		returnVal = false;
++	}
++	
++	if (returnVal)
++	{
++		X11SalGraphics::CopyScreenArea( dpy,
++			pixmap.handle(), pixmap.x11Info().screen(), pixmap.x11Info().depth(),
++			drawable, GetScreenNumber(), GetVisual().GetDepth(), gc,
++			0, 0, widgetRect.width(), widgetRect.height(), widgetRect.left(), widgetRect.top() );
++	}
++	
++	#if 0
++    else if ( (type == CTRL_RADIOBUTTON) && (part == PART_ENTIRE_CONTROL) )
++    {
++		bReturn = pWidgetPainter->drawStyledWidget(
++			pWidgetPainter->radioButton( rControlRegion ),
++			nControlState, aValue,
++			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
++    }
++    else if ( (type==CTRL_TAB_ITEM) && (part == PART_ENTIRE_CONTROL) )
++    {
++		bReturn = pWidgetPainter->drawStyledWidget(
++			pWidgetPainter->tabBar( rControlRegion ),
++			nControlState, aValue,
++			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
++    }
++    else if ( (type==CTRL_TAB_PANE) && (part == PART_ENTIRE_CONTROL) )
++    {
++		bReturn = pWidgetPainter->drawStyledWidget(
++			pWidgetPainter->tabWidget( rControlRegion ),
++			nControlState, aValue,
++			dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
++    }
++    else if ( (type == CTRL_PROGRESS) && (part == PART_ENTIRE_CONTROL) )
++    {
++        bReturn = pWidgetPainter->drawStyledWidget(
++            pWidgetPainter->progressBar( rControlRegion ),
++            nControlState, aValue,
++            dpy, drawable, GetScreenNumber(), GetVisual().GetDepth(), gc );
++    }
++	#endif
++
++    return returnVal;
++}
++
++
++
++/** Check if the bounding regions match.
++
++    If the return value is TRUE, rNativeBoundingRegion
++    contains the true bounding region covered by the control
++    including any adornment, while rNativeContentRegion contains the area
++    within the control that can be safely drawn into without drawing over
++    the borders of the control.
++
++    @param rControlRegion
++    The bounding region of the control in VCL frame coordinates.
++    
++    @param aValue
++    An optional value (tristate/numerical/string)
++    
++    @param rControlHandle
++    Carries platform dependent data and is maintained by the SalFrame implementation.
++    
++    @param aCaption
++    A caption or title string (like button text etc.)
++*/
++BOOL KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
++											 const Region& controlRegion, ControlState controlState,
++											 const ImplControlValue& val, SalControlHandle&,
++											 const OUString&,
++											 Region &nativeBoundingRegion, Region &nativeContentRegion )
++{
++    bool retVal = false;
++	
++    QRect boundingRect = region2QRect( controlRegion );
++    QRect contentRect = boundingRect;
++    QStyleOptionComplex styleOption;
++	
++    switch ( type )
++    {
++		// Metrics of the push button
++		case CTRL_PUSHBUTTON:
++			if (part == PART_ENTIRE_CONTROL)
++			{
++				styleOption.state = vclStateValue2StateFlag(controlState, val);
++
++				if ( controlState & CTRL_STATE_DEFAULT )
++				{
++					int size = kapp->style()->pixelMetric(
++						QStyle::PM_ButtonDefaultIndicator, &styleOption );
++					
++					boundingRect.adjust( -size, -size, size, size );
++					
++					retVal = true;
++				}
++			}
++			break;
++		case CTRL_EDITBOX:
++		{
++			styleOption.rect = QRect(0, 0, contentRect.width(), contentRect.height());
++			styleOption.state = vclStateValue2StateFlag(controlState, val);
++
++			int size = kapp->style()->pixelMetric(QStyle::PM_LayoutLeftMargin) - 1;
++			
++			contentRect.adjust( -size, -size, size, size);
++			boundingRect = contentRect;
++			
++			retVal = true;
++			
++			break;
++		}
++		case CTRL_CHECKBOX:
++			if (part == PART_ENTIRE_CONTROL)
++			{
++				styleOption.state = vclStateValue2StateFlag(controlState, val);
++						
++				contentRect.setWidth(kapp->style()->pixelMetric(
++					QStyle::PM_IndicatorWidth, &styleOption));
++				contentRect.setHeight(kapp->style()->pixelMetric(
++					QStyle::PM_IndicatorHeight, &styleOption) + 5);
++					
++				contentRect.adjust(0, 10, 0, 0);
++				
++				boundingRect = contentRect;
++					
++				retVal = true;
++				
++				break;
++			}
++		case CTRL_COMBOBOX:
++		case CTRL_LISTBOX:
++		{
++			QStyleOptionComboBox cbo;
++			
++			cbo.rect = QRect(0, 0, contentRect.width(), contentRect.height());
++			cbo.state = vclStateValue2StateFlag(controlState, val);
++			
++			switch ( part )
++			{
++				case PART_ENTIRE_CONTROL:
++				{
++					int size = kapp->style()->pixelMetric(QStyle::PM_ComboBoxFrameWidth) - 2;
++					contentRect.adjust(-size,-size,size,size);
++					retVal = true;
++					break;
++				}
++				case PART_BUTTON_DOWN:
++					//the entire control can be used as the "down" button
++					retVal = true;
++					break;
++				case PART_SUB_EDIT:
++					contentRect = kapp->style()->subControlRect(
++						QStyle::CC_ComboBox, &cbo, QStyle::SC_ComboBoxEditField );
++						
++					contentRect.translate( boundingRect.left(), boundingRect.top() );
++					
++					retVal = true;
++					break;
++			}
++			break;
++		}
++		case CTRL_SPINBOX:
++		{
++			QStyleOptionSpinBox sbo;
++
++			sbo.rect = QRect(0, 0, contentRect.width(), contentRect.height());
++			sbo.state = vclStateValue2StateFlag(controlState, val);
++			
++			switch ( part )
++			{
++				case PART_BUTTON_UP:
++					contentRect = kapp->style()->subControlRect(
++						QStyle::CC_SpinBox, &sbo, QStyle::SC_SpinBoxUp );
++					contentRect.translate( boundingRect.left(), boundingRect.top() );
++					retVal = true;
++					boundingRect = QRect();
++					break;
++				
++				case PART_BUTTON_DOWN:
++					contentRect = kapp->style()->subControlRect(
++						QStyle::CC_SpinBox, &sbo, QStyle::SC_SpinBoxDown );
++					retVal = true;
++					contentRect.translate( boundingRect.left(), boundingRect.top() );
++					boundingRect = QRect();
++					break;
++
++				case PART_SUB_EDIT:
++					contentRect = kapp->style()->subControlRect(
++						QStyle::CC_SpinBox, &sbo, QStyle::SC_SpinBoxEditField );
++					retVal = true;
++					contentRect.translate( boundingRect.left(), boundingRect.top() );
++					break;
++				default:
++					retVal = true;
++			}
++			break;
++		}
++		case CTRL_MENU_POPUP:
++			//just limit the widget of the menu items
++			//OO isn't very flexible in all reguards with the menu
++			//so we do the best we can
++			if (part == PART_MENU_ITEM_CHECK_MARK)
++			{
++				contentRect.setWidth(contentRect.height());
++				retVal = true;
++			}
++			else if (part == PART_MENU_ITEM_RADIO_MARK)
++			{
++				contentRect.setWidth(contentRect.height());
++				retVal = true;
++			}
++			break;
++		case CTRL_FRAME:
++		{
++			if (part == PART_BORDER)
++			{
++				int size = kapp->style()->pixelMetric(QStyle::PM_DefaultFrameWidth);
++				//contentRect.adjust(size, size, size, size);
++				boundingRect.adjust(-size, -size, size, size);
++				retVal = true;
++			}
++			
++			break;
++		}
++		case CTRL_RADIOBUTTON:
++		{
++			const int h = kapp->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorHeight);
++			const int w = kapp->style()->pixelMetric(QStyle::PM_ExclusiveIndicatorWidth);
++			
++			contentRect = QRect(boundingRect.left(), boundingRect.top(), w, h);
++			
++			retVal = true;
++		}
++		default:
++			break;
++	}
++#if 0
++	
++
++		// Metrics of the scroll bar
++		case CTRL_SCROLLBAR:
++			//pWidget = pWidgetPainter->scrollBar( rControlRegion,
++				//( part == PART_BUTTON_LEFT || part == PART_BUTTON_RIGHT ),
++				//ImplControlValue() );
++			//aStyleOption.initFrom( pWidget );
++
++			switch ( part )
++			{
++			case PART_BUTTON_LEFT:
++			case PART_BUTTON_UP:
++				qRect = kapp->style()->subControlRect(
++					QStyle::CC_ScrollBar, &aStyleOption, QStyle::SC_ScrollBarSubLine );
++
++				// Workaround for Platinum style scroll bars. It makes the
++				// left/up button invisible.
++				if ( part == PART_BUTTON_LEFT )
++				{
++					if ( qRect.left() > kapp->style()->subControlRect(
++						QStyle::CC_ScrollBar, &aStyleOption,
++						QStyle::SC_ScrollBarSubPage ).left() )
++					{
++						qRect.setLeft( 0 );
++						qRect.setRight( 0 );
++					}
++				}
++				else
++				{
++					if ( qRect.top() > kapp->style()->subControlRect(
++						QStyle::CC_ScrollBar, &aStyleOption,
++						QStyle::SC_ScrollBarSubPage ).top() )
++					{
++						qRect.setTop( 0 );
++						qRect.setBottom( 0 );
++					}
++				}
++	
++				qRect.translate( qBoundingRect.left(), qBoundingRect.top() );
++
++				bReturn = TRUE;
++				break;
++
++			case PART_BUTTON_RIGHT:
++			case PART_BUTTON_DOWN:
++				qRect = kapp->style()->subControlRect(
++					QStyle::CC_ScrollBar, &aStyleOption, QStyle::SC_ScrollBarAddLine );
++
++				// Workaround for Platinum and 3 button style scroll bars.
++				// It makes the right/down button bigger.
++				if ( part == PART_BUTTON_RIGHT )
++					qRect.setLeft( kapp->style()->subControlRect(
++						QStyle::CC_ScrollBar, &aStyleOption,
++						QStyle::SC_ScrollBarAddPage ).right() + 1 );
++				else
++					qRect.setTop( kapp->style()->subControlRect(
++						QStyle::CC_ScrollBar, &aStyleOption,
++						QStyle::SC_ScrollBarAddPage ).bottom() + 1 );
++
++				qRect.translate( qBoundingRect.left(), qBoundingRect.top() );
++
++				bReturn = TRUE;
++				break;
++			}
++			break;
++    }
++#endif
++    
++    if (retVal)
++    {
++		// Bounding region
++		Point aBPoint( boundingRect.x(), boundingRect.y() );
++		Size aBSize( boundingRect.width(), boundingRect.height() );
++		nativeBoundingRegion = Region( Rectangle( aBPoint, aBSize ) );
++
++		// Region of the content
++		Point aPoint( contentRect.x(), contentRect.y() );
++		Size  aSize( contentRect.width(), contentRect.height() );
++		nativeContentRegion = Region( Rectangle( aPoint, aSize ) );
++    }
++	
++    return retVal;
++}
++
++// -----------------------------------------------------------------------
++// KDESalFrame implementation
++// -----------------------------------------------------------------------
++
++KDESalFrame::KDESalFrame( SalFrame* pParent, ULONG nState ) :
++    X11SalFrame( pParent, nState )
++{
++}
++
++void KDESalFrame::Show( BOOL bVisible, BOOL bNoActivate )
++{
++    if ( !GetParent() && ! (GetStyle() & SAL_FRAME_STYLE_INTRO) )
++    {
++        KDEXLib* pXLib = static_cast<KDEXLib*>(GetDisplay()->GetXLib());
++        pXLib->doStartup();
++    }
++    X11SalFrame::Show( bVisible, bNoActivate );
++}
++
++/** Helper function to convert colors.
++*/
++static Color toColor( const QColor &rColor )
++{
++    return Color( rColor.red(), rColor.green(), rColor.blue() );
++}
++
++/** Helper function to read untranslated text entry from KConfig configuration repository.
++*/
++static OUString readEntryUntranslated( KConfigGroup *pGroup, const char *pKey )
++{
++    return OUString::createFromAscii( (const char *) pGroup->readEntryUntranslated( pKey ).toAscii() );
++}
++
++/** Helper function to read color from KConfig configuration repository.
++*/
++static Color readColor( KConfigGroup *pGroup, const char *pKey )
++{
++    return toColor( pGroup->readEntry( pKey, QColor(Qt::white) ) );
++}
++
++/** Helper function to add information to Font from QFont.
++
++    Mostly grabbed from the Gtk+ vclplug (salnativewidgets-gtk.cxx).
++*/
++static Font toFont( const QFont &rQFont, const ::com::sun::star::lang::Locale& rLocale )
++{
++    psp::FastPrintFontInfo aInfo;
++    QFontInfo qFontInfo( rQFont );
++    
++    // set family name
++    aInfo.m_aFamilyName = String( (const char *) rQFont.family().toUtf8(), RTL_TEXTENCODING_UTF8 );
++
++    // set italic
++    aInfo.m_eItalic = ( qFontInfo.italic()? psp::italic::Italic: psp::italic::Upright );
++    
++    // set weight
++    int nWeight = qFontInfo.weight();
++    if ( nWeight <= QFont::Light )
++        aInfo.m_eWeight = psp::weight::Light;
++    else if ( nWeight <= QFont::Normal )
++        aInfo.m_eWeight = psp::weight::Normal;
++    else if ( nWeight <= QFont::DemiBold )
++        aInfo.m_eWeight = psp::weight::SemiBold;
++    else if ( nWeight <= QFont::Bold )
++        aInfo.m_eWeight = psp::weight::Bold;
++    else
++        aInfo.m_eWeight = psp::weight::UltraBold;
++    
++    // set width
++    int nStretch = rQFont.stretch();
++    if ( nStretch <= QFont::UltraCondensed )
++        aInfo.m_eWidth = psp::width::UltraCondensed;
++    else if ( nStretch <= QFont::ExtraCondensed )
++        aInfo.m_eWidth = psp::width::ExtraCondensed;
++    else if ( nStretch <= QFont::Condensed )
++        aInfo.m_eWidth = psp::width::Condensed;
++    else if ( nStretch <= QFont::SemiCondensed )
++        aInfo.m_eWidth = psp::width::SemiCondensed;
++    else if ( nStretch <= QFont::Unstretched )
++        aInfo.m_eWidth = psp::width::Normal;
++    else if ( nStretch <= QFont::SemiExpanded )
++        aInfo.m_eWidth = psp::width::SemiExpanded;
++    else if ( nStretch <= QFont::Expanded )
++        aInfo.m_eWidth = psp::width::Expanded;
++    else if ( nStretch <= QFont::ExtraExpanded )
++        aInfo.m_eWidth = psp::width::ExtraExpanded;
++    else
++        aInfo.m_eWidth = psp::width::UltraExpanded;
++    
++#if OSL_DEBUG_LEVEL > 1
++    fprintf( stderr, "font name BEFORE system match: \"%s\"\n", OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
++#endif
++
++    // match font to e.g. resolve "Sans"
++    psp::PrintFontManager::get().matchFont( aInfo, rLocale );
++
++#if OSL_DEBUG_LEVEL > 1
++    fprintf( stderr, "font match %s, name AFTER: \"%s\"\n",
++             aInfo.m_nID != 0 ? "succeeded" : "failed",
++             OUStringToOString( aInfo.m_aFamilyName, RTL_TEXTENCODING_ISO_8859_1 ).getStr() );
++#endif
++
++    // font height
++    int nPointHeight = qFontInfo.pointSize();
++    if ( nPointHeight <= 0 )
++        nPointHeight = rQFont.pointSize();
++    
++    // Create the font
++    Font aFont( aInfo.m_aFamilyName, Size( 0, nPointHeight ) );
++    if( aInfo.m_eWeight != psp::weight::Unknown )
++        aFont.SetWeight( PspGraphics::ToFontWeight( aInfo.m_eWeight ) );
++    if( aInfo.m_eWidth != psp::width::Unknown )
++        aFont.SetWidthType( PspGraphics::ToFontWidth( aInfo.m_eWidth ) );
++    if( aInfo.m_eItalic != psp::italic::Unknown )
++        aFont.SetItalic( PspGraphics::ToFontItalic( aInfo.m_eItalic ) );
++    if( aInfo.m_ePitch != psp::pitch::Unknown )
++        aFont.SetPitch( PspGraphics::ToFontPitch( aInfo.m_ePitch ) );
++
++    return aFont;
++}
++
++/** Implementation of KDE integration's main method.
++*/
++void KDESalFrame::UpdateSettings( AllSettings& rSettings )
++{
++    StyleSettings style( rSettings.GetStyleSettings() );
++	BOOL bSetTitleFont = false;
++
++	
++	// General settings
++    QPalette pal = kapp->palette();
++	
++	style.SetActiveColor(toColor(pal.color(QPalette::Active, QPalette::Window)));
++	style.SetDeactiveColor(toColor(pal.color(QPalette::Inactive, QPalette::Window)));
++	
++	style.SetActiveColor2(toColor(pal.color(QPalette::Active, QPalette::Window)));
++	style.SetDeactiveColor2(toColor(pal.color(QPalette::Inactive, QPalette::Window)));
++	
++	style.SetActiveTextColor(toColor(pal.color(QPalette::Active, QPalette::WindowText)));
++	style.SetDeactiveTextColor(toColor(pal.color(QPalette::Inactive, QPalette::WindowText)));
++	
++    // WM settings
++    KConfig *pConfig = KGlobal::config().data();
++    if ( pConfig )
++    {
++        KConfigGroup aGroup = pConfig->group( "WM" );
++        const char *pKey;
++		
++        pKey = "titleFont";
++        if ( aGroup.hasKey( pKey ) )
++        {
++            Font aFont = toFont( aGroup.readEntry( pKey, QFont() ), rSettings.GetUILocale() );
++            style.SetTitleFont( aFont );
++			bSetTitleFont = true;
++        }
++		
++        aGroup = pConfig->group( "Icons" );
++
++        pKey = "Theme";
++        if ( aGroup.hasKey( pKey ) )
++            style.SetPreferredSymbolsStyleName( readEntryUntranslated( &aGroup, pKey ) );
++    }
++	
++    Color aFore = toColor( pal.color( QPalette::Active, QPalette::WindowText ) );
++    Color aBack = toColor( pal.color( QPalette::Active, QPalette::Window ) );
++    Color aText = toColor( pal.color( QPalette::Active, QPalette::Text ) );
++    Color aBase = toColor( pal.color( QPalette::Active, QPalette::Base ) );
++    Color aButn = toColor( pal.color( QPalette::Active, QPalette::ButtonText ) );
++    Color aMid = toColor( pal.color( QPalette::Active, QPalette::Mid ) );
++    Color aHigh = toColor( pal.color( QPalette::Active, QPalette::Highlight ) );
++
++    // Foreground
++    style.SetRadioCheckTextColor( aFore );
++    style.SetLabelTextColor( aFore );
++    style.SetInfoTextColor( aFore );
++    style.SetDialogTextColor( aFore );
++    style.SetGroupTextColor( aFore );
++
++    // Text
++    style.SetFieldTextColor( aText );
++    style.SetFieldRolloverTextColor( aText );
++    style.SetWindowTextColor( aText );
++    style.SetHelpTextColor( aText );
++
++    // Base
++    style.SetFieldColor( aBase );
++    style.SetHelpColor( aBase );
++    style.SetWindowColor( aBase );
++    style.SetActiveTabColor( aBase );
++    
++    // Buttons
++    style.SetButtonTextColor( aButn );
++    style.SetButtonRolloverTextColor( aButn );
++
++    // Disable color
++    style.SetDisableColor( aMid );
++
++    // Workspace
++    style.SetWorkspaceColor( aMid );
++
++    // Background
++    style.Set3DColors( aBack );
++    style.SetFaceColor( aBack );
++    style.SetInactiveTabColor( aBack );
++    style.SetDialogColor( aBack );
++	
++    if( aBack == COL_LIGHTGRAY )
++        style.SetCheckedColor( Color( 0xCC, 0xCC, 0xCC ) );
++    else
++    {
++        Color aColor2 = style.GetLightColor();
++        style.
++            SetCheckedColor( Color( (BYTE)(((USHORT)aBack.GetRed()+(USHORT)aColor2.GetRed())/2),
++                        (BYTE)(((USHORT)aBack.GetGreen()+(USHORT)aColor2.GetGreen())/2),
++                        (BYTE)(((USHORT)aBack.GetBlue()+(USHORT)aColor2.GetBlue())/2)
++                        ) );
++    }
++
++    // Selection
++    style.SetHighlightColor( aHigh );
++    style.SetHighlightTextColor( toColor(pal.color( QPalette::HighlightedText))  );
++
++    // Font
++    Font aFont = toFont( kapp->font(), rSettings.GetUILocale() );
++	
++    style.SetAppFont( aFont );
++    style.SetHelpFont( aFont );
++	
++	if( !bSetTitleFont )
++	{
++		style.SetTitleFont( aFont );
++	}
++	
++	style.SetFloatTitleFont( aFont );
++    style.SetMenuFont( aFont ); // will be changed according to pMenuBar
++    style.SetToolFont( aFont ); // will be changed according to pToolBar
++    style.SetLabelFont( aFont );
++    style.SetInfoFont( aFont );
++    style.SetRadioCheckFont( aFont );
++    style.SetPushButtonFont( aFont );
++    style.SetFieldFont( aFont );
++    style.SetIconFont( aFont );
++    style.SetGroupFont( aFont );
++	
++    int flash_time = QApplication::cursorFlashTime();
++    style.SetCursorBlinkTime( flash_time != 0 ? flash_time/2 : STYLE_CURSOR_NOBLINKTIME );
++
++    KMainWindow qMainWindow;
++
++    // Menu
++    style.SetSkipDisabledInMenus( TRUE );
++    KMenuBar *pMenuBar = qMainWindow.menuBar();
++    if ( pMenuBar )
++    {
++        // Color
++        QPalette qMenuCG = pMenuBar->palette();
++        
++        // Menu text and background color, theme specific
++        Color aMenuFore = toColor( qMenuCG.color( QPalette::WindowText ) );
++        Color aMenuBack = toColor( qMenuCG.color( QPalette::Window ) );
++		
++        aMenuFore = toColor( qMenuCG.color( QPalette::ButtonText ) );
++        aMenuBack = toColor( qMenuCG.color( QPalette::Button ) );
++        
++        style.SetMenuTextColor( aMenuFore );
++        style.SetMenuColor( aMenuBack );
++        style.SetMenuBarColor( aMenuBack );
++
++        style.SetMenuHighlightColor( toColor ( qMenuCG.color( QPalette::Highlight ) ) );
++
++        style.SetMenuHighlightTextColor( aMenuFore );
++        
++        // set special menubar higlight text color
++        if ( kapp->style()->inherits( "HighContrastStyle" ) )
++            ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = toColor( qMenuCG.color( QPalette::HighlightedText ) );
++        else
++            ImplGetSVData()->maNWFData.maMenuBarHighlightTextColor = aMenuFore;
++
++        // Font
++        aFont = toFont( pMenuBar->font(), rSettings.GetUILocale() );
++        style.SetMenuFont( aFont );
++    }
++
++    // Tool bar
++    KToolBar *pToolBar = qMainWindow.toolBar();
++    if ( pToolBar )
++    {
++        aFont = toFont( pToolBar->font(), rSettings.GetUILocale() );
++        style.SetToolFont( aFont );
++    }
++
++    // Scroll bar size
++    style.SetScrollBarSize( kapp->style()->pixelMetric( QStyle::PM_ScrollBarExtent ) );
++    
++    // #i59364# high contrast mode
++    BOOL bHC = ( style.GetFaceColor().IsDark() ||
++                 style.GetWindowColor().IsDark() );
++    style.SetHighContrastMode( bHC );
++
++    rSettings.SetStyleSettings( style );
++}
++
++SalGraphics* KDESalFrame::GetGraphics()
++{
++    if( GetWindow() )
++    {
++        for( int i = 0; i < nMaxGraphics; i++ )
++        {
++            if( ! m_aGraphics[i].bInUse )
++            {
++                m_aGraphics[i].bInUse = true;
++                if( ! m_aGraphics[i].pGraphics )
++                {
++                    m_aGraphics[i].pGraphics = new KDESalGraphics();
++                    m_aGraphics[i].pGraphics->Init( this, GetWindow(), GetScreenNumber() );
++                }
++                return m_aGraphics[i].pGraphics;
++            }
++        }
++    }
++    
++    return NULL;
++}
++
++void KDESalFrame::ReleaseGraphics( SalGraphics *pGraphics )
++{
++    for( int i = 0; i < nMaxGraphics; i++ )
++    {
++        if( m_aGraphics[i].pGraphics == pGraphics )
++        {
++            m_aGraphics[i].bInUse = false;
++            break;
++        }
++    }
++}
++
++void KDESalFrame::updateGraphics()
++{
++    for( int i = 0; i < nMaxGraphics; i++ )
++    {
++        if( m_aGraphics[i].bInUse )
++            m_aGraphics[i].pGraphics->SetDrawable( GetWindow(), GetScreenNumber() );
++    }
++}
++
++KDESalFrame::~KDESalFrame()
++{
++}
++
++KDESalFrame::GraphicsHolder::~GraphicsHolder()
++{
++	delete pGraphics;
++}
++
++// -----------------------------------------------------------------------
++// KDESalInstance implementation
++// -----------------------------------------------------------------------
++
++SalFrame *
++KDESalInstance::CreateFrame( SalFrame *pParent, ULONG nState )
++{
++	return new KDESalFrame( pParent, nState );
++}
++
++// -----------------------------------------------------------------------
++// KDESalData pieces
++// -----------------------------------------------------------------------
++
++// Create the widget painter so we have some control over
++// the destruction sequence, so Qt doesn't die in action.
++
++void KDEData::initNWF()
++{
++    ImplSVData *pSVData = ImplGetSVData();
++    // draw toolbars on separate lines
++    pSVData->maNWFData.mbDockingAreaSeparateTB = true;
++}
++
++void KDEData::deInitNWF()
++{
++}
+diff --git vcl/unx/inc/kde4_headers.h vcl/unx/inc/kde4_headers.h
+new file mode 100644
+index 0000000..e9b87d7
+--- /dev/null
++++ vcl/unx/inc/kde4_headers.h
+@@ -0,0 +1,102 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: kde_headers.h,v $
++ * $Revision: 1.6 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++#ifndef INCLUDED_VCL_KDE_HEADERS_H
++#define INCLUDED_VCL_KDE_HEADERS_H
++
++/* ********* Suppress warnings if needed */
++#include "sal/config.h"
++
++#if defined __GNUC__
++#pragma GCC system_header
++#endif
++
++
++/* ********* Hack, but needed because of conflicting types... */
++#define Region QtXRegion
++
++
++/* ********* Qt headers */
++#include <QtCore/qstring.h>
++
++#include <QtGui/qaccessible.h>
++#include <QtGui/qcheckbox.h>
++#include <QtGui/qcombobox.h>
++#include <QtGui/qfont.h>
++#include <QtGui/qframe.h>
++#include <QtGui/qlineedit.h>
++#include <QtGui/qlistview.h>
++#include <QtGui/qmainwindow.h>
++#include <QtGui/qmenudata.h>
++#include <QtGui/qpaintdevice.h>
++#include <QtGui/qpainter.h>
++#include <QtGui/qpushbutton.h>
++#include <QtGui/qradiobutton.h>
++#include <QtGui/qscrollbar.h>
++#include <QtGui/qspinbox.h>
++#include <QtGui/qtabbar.h>
++#include <QtGui/qtabwidget.h>
++#include <QtGui/qtoolbar.h>
++#include <QtGui/qtoolbutton.h>
++#include <QtGui/qwidget.h>
++#include <QtGui/qprogressbar.h>
++
++
++/* ********* See hack on top of this file */
++#undef Region
++
++
++/* ********* KDE base headers */
++#include <kaboutdata.h>
++#include <kapplication.h>
++#include <kcmdlineargs.h>
++#include <kconfig.h>
++#include <kconfiggroup.h>
++#include <kdeversion.h>
++#include <kemailsettings.h>
++#include <kglobal.h>
++#include <kglobalsettings.h>
++#include <klocale.h>
++#include <kmainwindow.h>
++#include <kmenubar.h>
++#include <kprotocolmanager.h>
++#include <kstartupinfo.h>
++#include <kstyle.h>
++#include <ktoolbar.h>
++
++
++/* ********* KDE address book connectivity headers */
++//#include <kabc/addressbook.h>
++//#include <kabc/addressee.h>
++//#include <kabc/field.h>
++//#include <kabc/stdaddressbook.h>
++
++
++#endif
+diff --git vcl/unx/inc/plugins/kde4/kdedata.hxx vcl/unx/inc/plugins/kde4/kdedata.hxx
+new file mode 100644
+index 0000000..e25c97a
+--- /dev/null
++++ vcl/unx/inc/plugins/kde4/kdedata.hxx
+@@ -0,0 +1,115 @@
++/*************************************************************************
++ *
++ * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
++ * 
++ * Copyright 2008 by Sun Microsystems, Inc.
++ *
++ * OpenOffice.org - a multi-platform office productivity suite
++ *
++ * $RCSfile: kdedata.hxx,v $
++ * $Revision: 1.8 $
++ *
++ * This file is part of OpenOffice.org.
++ *
++ * OpenOffice.org is free software: you can redistribute it and/or modify
++ * it under the terms of the GNU Lesser General Public License version 3
++ * only, as published by the Free Software Foundation.
++ *
++ * OpenOffice.org is distributed in the hope that it will be useful,
++ * but WITHOUT ANY WARRANTY; without even the implied warranty of
++ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
++ * GNU Lesser General Public License version 3 for more details
++ * (a copy is included in the LICENSE file that accompanied this code).
++ *
++ * You should have received a copy of the GNU Lesser General Public License
++ * version 3 along with OpenOffice.org.  If not, see
++ * <http://www.openoffice.org/license.html>
++ * for a copy of the LGPLv3 License.
++ *
++ ************************************************************************/
++
++#ifndef _VCL_KDEDATA_HXX
++#define _VCL_KDEDATA_HXX
++
++#include <saldisp.hxx>
++#include <saldata.hxx>
++#include <salframe.h>
++
++class KDEData : public X11SalData
++{
++public:
++    KDEData() {}
++    virtual ~KDEData();
++    
++    virtual void Init();
++    virtual void initNWF();
++    virtual void deInitNWF();
++};
++
++class SalKDEDisplay : public SalX11Display
++{
++   public:
++       SalKDEDisplay( Display* pDisp );
++       virtual ~SalKDEDisplay();
++   
++   //virtual long Dispatch( XEvent *pEvent );
++};
++
++class KDESalFrame : public X11SalFrame
++{
++    static const int nMaxGraphics = 2;
++
++    struct GraphicsHolder
++    {
++        X11SalGraphics*        pGraphics;
++        bool               bInUse;
++        GraphicsHolder() 
++                : pGraphics( NULL ),
++                  bInUse( false )
++        {}
++       ~GraphicsHolder();
++    };
++    GraphicsHolder m_aGraphics[ nMaxGraphics ];
++
++public:
++   KDESalFrame( SalFrame* pParent, ULONG nStyle );
++   virtual ~KDESalFrame();
++
++    virtual SalGraphics* GetGraphics();
++   virtual void ReleaseGraphics( SalGraphics *pGraphics );
++    virtual void updateGraphics();
++    virtual void UpdateSettings( AllSettings& rSettings );
++    virtual void Show( BOOL bVisible, BOOL bNoActivate );
++};
++
++class KDESalInstance : public X11SalInstance
++{
++public:
++    KDESalInstance( SalYieldMutex* pMutex ) 
++            : X11SalInstance( pMutex ) {}
++   virtual ~KDESalInstance() {}
++    virtual SalFrame* CreateFrame( SalFrame* pParent, ULONG nStyle );
++};
++
++class KDEXLib : public SalXLib
++{
++    bool            m_bStartupDone;
++    void*           m_pApplication;
++    char**          m_pFreeCmdLineArgs;
++    char**          m_pAppCmdLineArgs;
++    int             m_nFakeCmdLineArgs;
++public:
++   KDEXLib() : SalXLib(),
++        m_bStartupDone( false ),
++        m_pApplication( NULL ),
++        m_pFreeCmdLineArgs( NULL ),
++        m_pAppCmdLineArgs( NULL ),
++        m_nFakeCmdLineArgs( 0 )
++        {}
++   virtual ~KDEXLib();
++    virtual void Init();
++    
++    void doStartup();
++};
++
++#endif // _VCL_KDEDATA_HXX


More information about the ooo-build-commit mailing list