diff -x CVS -urN ooo_SRC680_m205_src.orig/scp2/source/ooo/file_library_ooo.scp ooo_SRC680_m205_src.pj74/scp2/source/ooo/file_library_ooo.scp
--- ooo_SRC680_m205_src.orig/scp2/source/ooo/file_library_ooo.scp	2007-02-28 17:26:18.000000000 +0100
+++ ooo_SRC680_m205_src.pj74/scp2/source/ooo/file_library_ooo.scp	2007-03-04 11:12:55.000000000 +0100
@@ -2064,6 +2064,10 @@
 SPECIAL_UNO_COMPONENT_LIB_FILE_PATCH( gid_File_Lib_Wininetbe, wininetbe1.uno )
 #endif
 
+#ifdef MACOSX
+SPECIAL_UNO_COMPONENT_LIB_FILE_PATCH( gid_File_Lib_Macbe, macbe1.uno )
+#endif
+
 File gid_File_Lib_Tcv
     TXT_FILE_BODY;
     Styles = (PACKED,UNO_COMPONENT,DONT_OVERWRITE,PATCH);
diff -x CVS -urN ooo_SRC680_m205_src.orig/scp2/source/ooo/module_hidden_ooo.scp ooo_SRC680_m205_src.pj74/scp2/source/ooo/module_hidden_ooo.scp
--- ooo_SRC680_m205_src.orig/scp2/source/ooo/module_hidden_ooo.scp	2007-01-22 15:49:42.000000000 +0100
+++ ooo_SRC680_m205_src.pj74/scp2/source/ooo/module_hidden_ooo.scp	2007-03-01 11:00:41.000000000 +0100
@@ -477,6 +477,7 @@
 	gid_File_Lib_Sunpro5_Uno,
 	gid_File_Lib_Gconfebe,
 	gid_File_Lib_Wininetbe,
+	gid_File_Lib_Macbe,
 	gid_File_Lib_Unicows,
 	gid_File_Lib_Uwinapi,
 	gid_File_Lib_Msvcp70_So,
diff -x CVS -urN ooo_SRC680_m205_src.orig/shell/prj/build.lst ooo_SRC680_m205_src.pj74/shell/prj/build.lst
--- ooo_SRC680_m205_src.orig/shell/prj/build.lst	2006-10-31 14:48:09.000000000 +0100
+++ ooo_SRC680_m205_src.pj74/shell/prj/build.lst	2007-03-01 10:55:53.000000000 +0100
@@ -21,6 +21,7 @@
 sl    shell\source\win32\shlxthandler              nmake   -   w   sl_win32_shlxthandler sl_win32_lngconv.w sl_win32_shlxthandler_res.w sl_win32_shlxthandler_util.w sl_all_zipfile.w sl_all_ooofilereader.w sl_win32_shlxthandler_propsheets.w sl_win32_shlxthandler_infotips.w sl_win32_shlxthandler_columninfo.w sl_win32_shlxthandler_thumbviewer.w sl_inc NULL
 sl    shell\source\backends\localebe               nmake   -   all sl_backends_localebe sl_inc NULL
 sl    shell\source\backends\wininetbe              nmake   -   w   sl_backends_wininetbe sl_inc NULL
+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\desktopbe              nmake   -   u   sl_backends_desktopbe sl_inc NULL
diff -x CVS -urN ooo_SRC680_m205_src.orig/shell/source/backends/macbe/exports.map ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/exports.map
--- ooo_SRC680_m205_src.orig/shell/source/backends/macbe/exports.map	1970-01-01 01:00:00.000000000 +0100
+++ ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/exports.map	2007-03-01 10:57:44.000000000 +0100
@@ -0,0 +1,11 @@
+UDK_3_0_0 {
+	global:
+		GetVersionInfo;
+		component_getDescriptionFunc;
+		component_getImplementationEnvironment;
+		component_getFactory;
+		component_writeInfo;
+
+	local:
+		*;
+};
diff -x CVS -urN ooo_SRC680_m205_src.orig/shell/source/backends/macbe/macbackend.cxx ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/macbackend.cxx
--- ooo_SRC680_m205_src.orig/shell/source/backends/macbe/macbackend.cxx	1970-01-01 01:00:00.000000000 +0100
+++ ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/macbackend.cxx	2007-03-04 08:37:34.000000000 +0100
@@ -0,0 +1,158 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile$
+ *
+ *  $Revision$
+ *
+ *  last change: $Author$ $Date$
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+
+#include "macbackend.hxx"
+#include "macbelayer.hxx"
+
+#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_COMPONENTCHANGEEVENT_HPP_
+#include <com/sun/star/configuration/backend/ComponentChangeEvent.hpp>
+#endif
+
+#ifndef _UNO_CURRENT_CONTEXT_HXX_
+#include <uno/current_context.hxx>
+#endif
+
+MacOSXBackend::MacOSXBackend(const uno::Reference<uno::XComponentContext>& xContext)
+        throw (backend::BackendAccessException) :
+        ::cppu::WeakImplHelper2 < backend::XSingleLayerStratum, lang::XServiceInfo > (),
+        m_xContext(xContext)
+{
+}
+
+//------------------------------------------------------------------------------
+
+MacOSXBackend::~MacOSXBackend(void)
+{
+}
+
+//------------------------------------------------------------------------------
+
+MacOSXBackend* MacOSXBackend::createInstance(const uno::Reference<uno::XComponentContext>& xContext)
+{
+    return new MacOSXBackend(xContext);
+}
+
+// ---------------------------------------------------------------------------------------
+
+uno::Reference<backend::XLayer> SAL_CALL MacOSXBackend::getLayer(const rtl::OUString& aComponent, const rtl::OUString& /*aTimestamp*/)
+    throw (backend::BackendAccessException, lang::IllegalArgumentException)
+{
+    if( aComponent.equals( getSupportedComponents()[0]) )
+    {
+        if( ! m_xSystemLayer.is() )
+            m_xSystemLayer = new MacOSXLayer(m_xContext);
+
+        return m_xSystemLayer;
+    }
+
+    return uno::Reference<backend::XLayer>();
+}
+
+//------------------------------------------------------------------------------
+
+uno::Reference<backend::XUpdatableLayer> SAL_CALL
+    MacOSXBackend::getUpdatableLayer(const rtl::OUString& /*aComponent*/)
+    throw (backend::BackendAccessException,lang::NoSupportException,
+		   lang::IllegalArgumentException)
+{
+    throw lang::NoSupportException(
+        rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(
+                           "MacOSXBackend: No Update Operation allowed, Read Only access") ),
+        *this);
+
+    return NULL;
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL MacOSXBackend::getBackendName(void)
+{
+	return rtl::OUString::createFromAscii("com.sun.star.comp.configuration.backend.MacOSXBackend");
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL MacOSXBackend::getImplementationName(void)
+    throw (uno::RuntimeException)
+{
+    return getBackendName();
+}
+
+//------------------------------------------------------------------------------
+
+uno::Sequence<rtl::OUString> SAL_CALL MacOSXBackend::getBackendServiceNames(void)
+{
+    uno::Sequence<rtl::OUString> aServiceNameList(2);
+    aServiceNameList[0] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.MacOSXBackend"));
+    aServiceNameList[1] = rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("com.sun.star.configuration.backend.PlatformBackend"));
+
+    return aServiceNameList;
+}
+
+//------------------------------------------------------------------------------
+
+sal_Bool SAL_CALL MacOSXBackend::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 MacOSXBackend::getSupportedServiceNames(void)
+    throw (uno::RuntimeException)
+{
+    return getBackendServiceNames();
+}
+
+// ---------------------------------------------------------------------------------------
+
+uno::Sequence<rtl::OUString> SAL_CALL MacOSXBackend::getSupportedComponents(void)
+{
+    uno::Sequence<rtl::OUString> aSupportedComponentList(1);
+    aSupportedComponentList[0] = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet" ));
+
+    return aSupportedComponentList;
+}
+
diff -x CVS -urN ooo_SRC680_m205_src.orig/shell/source/backends/macbe/macbackend.hxx ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/macbackend.hxx
--- ooo_SRC680_m205_src.orig/shell/source/backends/macbe/macbackend.hxx	1970-01-01 01:00:00.000000000 +0100
+++ ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/macbackend.hxx	2007-03-01 10:57:45.000000000 +0100
@@ -0,0 +1,140 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile$
+ *
+ *  $Revision$
+ *
+ *  last change: $Author$ $Date$
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 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
+ *
+ ************************************************************************/
+
+#ifndef _MACBACKEND_HXX_
+#define _MACBACKEND_HXX_
+
+#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XSINGLELAYERSTRATUM_HPP_
+#include <com/sun/star/configuration/backend/XSingleLayerStratum.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
+#include <com/sun/star/lang/XServiceInfo.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XBACKENDCHANGESNOTIFIER_HPP_
+#include <com/sun/star/configuration/backend/XBackendChangesNotifier.hpp>
+#endif
+
+#ifndef _CPPUHELPER_IMPLBASE2_HXX_
+#include <cppuhelper/implbase2.hxx>
+#endif
+
+#ifndef _RTL_STRING_HXX_
+#include <rtl/string.hxx>
+#endif
+
+// FIXME: stdio.h only for debugging...
+#include <stdio.h>
+
+namespace css = com::sun::star;
+namespace uno = css::uno;
+namespace lang = css::lang;
+namespace backend = css::configuration::backend;
+
+
+/**
+  Implements the SingleLayerStratum service.
+  */
+class MacOSXBackend : public ::cppu::WeakImplHelper2 <backend::XSingleLayerStratum, lang::XServiceInfo >
+{
+
+public:
+
+    static MacOSXBackend* 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);
+
+    /**
+       Provides the supported component nodes
+
+       @return supported component nodes
+    */
+    static uno::Sequence<rtl::OUString> SAL_CALL getSupportedComponents(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
+    */
+    MacOSXBackend(const uno::Reference<uno::XComponentContext>& xContext)
+        throw (backend::BackendAccessException);
+
+    /** Destructor */
+    ~MacOSXBackend(void);
+
+private:
+
+    uno::Reference<uno::XComponentContext> m_xContext;
+    uno::Reference<backend::XLayer> m_xSystemLayer;
+
+};
+
+#endif // _MACBACKEND_HXX_
diff -x CVS -urN ooo_SRC680_m205_src.orig/shell/source/backends/macbe/macbe.xml ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/macbe.xml
--- ooo_SRC680_m205_src.orig/shell/source/backends/macbe/macbe.xml	1970-01-01 01:00:00.000000000 +0100
+++ ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/macbe.xml	2007-03-01 10:57:45.000000000 +0100
@@ -0,0 +1,36 @@
+<?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>macbe</module-name>
+    <component-description>
+        <author> Pavel Janík </author>
+        <name>com.sun.star.comp.configuration.backend.MacOSXBackend</name>
+        <description> The  </description>
+        <loader-name>com.sun.star.loader.SharedLibrary</loader-name>
+        <language>c++</language>
+        <status value="beta"/>
+        <supported-service>com.sun.star.comp.configuration.backend.MacOSXBackend</supported-service>
+        <supported-service>com.sun.star.comp.configuration.backend.PlatformBackend</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 -x CVS -urN ooo_SRC680_m205_src.orig/shell/source/backends/macbe/macbecdef.cxx ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/macbecdef.cxx
--- ooo_SRC680_m205_src.orig/shell/source/backends/macbe/macbecdef.cxx	1970-01-01 01:00:00.000000000 +0100
+++ ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/macbecdef.cxx	2007-03-01 10:57:45.000000000 +0100
@@ -0,0 +1,141 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile$
+ *
+ *  $Revision$
+ *
+ *  last change: $Author$ $Date$
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+
+#include "macbackend.hxx"
+
+#ifndef _COM_SUN_STAR_REGISTRY_XREGISTRYKEY_HPP_
+#include <com/sun/star/registry/XRegistryKey.hpp>
+#endif
+
+#ifndef _CPPUHELPER_IMPLEMENTATIONENTRY_HXX_
+#include <cppuhelper/implementationentry.hxx>
+#endif
+
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+
+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 createMacOSXBackend(
+    const uno::Reference<uno::XComponentContext>& xContext)
+{
+    return * MacOSXBackend::createInstance(xContext);
+}
+
+//------------------------------------------------------------------------------
+
+static const cppu::ImplementationEntry kImplementations_entries[] =
+{
+    {
+        createMacOSXBackend,
+        MacOSXBackend::getBackendName,
+        MacOSXBackend::getBackendServiceNames,
+        cppu::createSingleComponentFactory,
+        NULL,
+        0
+    },
+    { NULL }
+};
+
+//------------------------------------------------------------------------------
+
+extern "C" void SAL_CALL component_getImplementationEnvironment(
+    const sal_Char **aEnvTypeName, uno_Environment ** /*aEnvironment*/) {
+
+    *aEnvTypeName = CPPU_CURRENT_LANGUAGE_BINDING_NAME;
+}
+
+//------------------------------------------------------------------------------
+
+extern "C" sal_Bool SAL_CALL component_writeInfo(void * /*pServiceManager*/, 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("/") ) + MacOSXBackend::getBackendName()
+                );
+
+            // Register associated service names
+            uno::Reference< XRegistryKey > xServicesKey = xImplKey->createKey(
+                rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/UNO/SERVICES") )
+                );
+
+            uno::Sequence<rtl::OUString> sServiceNames = MacOSXBackend::getBackendServiceNames();
+            for (sal_Int32 i = 0; i < sServiceNames.getLength(); ++ i)
+                xServicesKey->createKey(sServiceNames[i]);
+
+            // Register supported components
+            uno::Reference<XRegistryKey> xComponentKey = xImplKey->createKey(
+                rtl::OUString( RTL_CONSTASCII_USTRINGPARAM("/DATA/SupportedComponents") )
+                );
+
+            xComponentKey->setAsciiListValue( MacOSXBackend::getSupportedComponents() );
+
+            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 -x CVS -urN ooo_SRC680_m205_src.orig/shell/source/backends/macbe/macbelayer.cxx ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/macbelayer.cxx
--- ooo_SRC680_m205_src.orig/shell/source/backends/macbe/macbelayer.cxx	1970-01-01 01:00:00.000000000 +0100
+++ ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/macbelayer.cxx	2007-03-04 08:38:21.000000000 +0100
@@ -0,0 +1,334 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile$
+ *
+ *  $Revision$
+ *
+ *  last change: $Author$ $Date$
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 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
+ *
+ ************************************************************************/
+
+// MARKER(update_precomp.py): autogen include statement, do not remove
+#include "precompiled_shell.hxx"
+
+// For MAXHOSTNAMELEN constant
+#include <sys/param.h>
+
+#include <Carbon/Carbon.h>
+#include <SystemConfiguration/SystemConfiguration.h>
+
+#ifndef _MACBELAYER_HXX_
+#include "macbelayer.hxx"
+#endif
+
+#define SPACE      ' '
+#define SEMI_COLON ';'
+
+typedef struct
+{
+    rtl::OUString Server;
+    sal_Int32 Port;
+} ProxyEntry;
+
+typedef enum {
+    sHTTP,
+    sFTP
+} ServiceType;
+
+//------------------------------------------------------------------------
+// helper functions
+//------------------------------------------------------------------------
+
+namespace // private
+{
+
+/*
+ * Returns current proxy settings for selected service type (HTTP or
+ * FTP) as a C string (in the buffer specified by host and hostSize)
+ * and a port number.
+ */
+
+Boolean GetProxySetting(ServiceType sType, char *host, size_t hostSize, UInt16 *port)
+{
+    Boolean             result;
+    CFDictionaryRef     proxyDict;
+    CFNumberRef         enableNum;
+    int                 enable;
+    CFStringRef         hostStr;
+    CFNumberRef         portNum;
+    int                 portInt;
+
+    proxyDict = SCDynamicStoreCopyProxies(NULL);
+
+    if (!proxyDict)
+        return false;
+
+    // Proxy enabled?
+    enableNum = (CFNumberRef) CFDictionaryGetValue(proxyDict,
+                                                   (sType == sHTTP) ? kSCPropNetProxiesHTTPEnable : kSCPropNetProxiesFTPEnable);
+
+    result = (enableNum != NULL) && (CFGetTypeID(enableNum) == CFNumberGetTypeID());
+
+    if (result)
+        result = CFNumberGetValue(enableNum, kCFNumberIntType, &enable) && (enable != 0);
+
+    // Proxy enabled -> get hostname
+    if (result)
+    {
+        hostStr = (CFStringRef) CFDictionaryGetValue(proxyDict,
+                                                     (sType == sHTTP) ? kSCPropNetProxiesHTTPProxy : kSCPropNetProxiesFTPProxy);
+
+        result = (hostStr != NULL) && (CFGetTypeID(hostStr) == CFStringGetTypeID());
+    }
+
+    if (result)
+        result = CFStringGetCString(hostStr, host, (CFIndex) hostSize, kCFStringEncodingASCII);
+
+    // Get proxy port
+    if (result)
+    {
+        portNum = (CFNumberRef) CFDictionaryGetValue(proxyDict,
+                                                     (sType == sHTTP) ? kSCPropNetProxiesHTTPPort : kSCPropNetProxiesFTPPort);
+
+        result = (portNum != NULL) && (CFGetTypeID(portNum) == CFNumberGetTypeID());
+    }
+    else
+        return false;
+
+    if (result)
+        result = CFNumberGetValue(portNum, kCFNumberIntType, &portInt);
+
+    if (result)
+        *port = (UInt16) portInt;
+
+    if (proxyDict)
+        CFRelease(proxyDict);
+
+    if (!result)
+    {
+        *host = 0;
+        *port = 0;
+    }
+
+    return result;
+}
+
+/*
+ * Get the list of proxy exceptions
+ */
+
+CFArrayRef GetExceptionsListSetting()
+{
+    CFDictionaryRef rProxyDict = SCDynamicStoreCopyProxies(NULL);
+
+    if (!rProxyDict)
+        return false;
+    else
+        return (CFArrayRef) CFDictionaryGetValue(rProxyDict, kSCPropNetProxiesExceptionsList);
+}
+
+} // end private namespace
+
+//------------------------------------------------------------------------------
+
+MacOSXLayer::MacOSXLayer( 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");
+    }
+
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString CFStringToOUString(const CFStringRef sOrig) {
+    CFRetain(sOrig);
+
+    CFIndex nStringLen = CFStringGetLength(sOrig)+1;
+
+    // Allocate a c string buffer
+    char sBuffer[nStringLen];
+
+    CFStringGetCString(sOrig, sBuffer, nStringLen, kCFStringEncodingASCII);
+
+    CFRelease(sOrig);
+
+    return rtl::OUString::createFromAscii((sal_Char*)sBuffer);
+}
+
+void SAL_CALL MacOSXLayer::readData(
+	const uno::Reference<backend::XLayerHandler>& xHandler)
+    throw ( backend::MalformedDataException,
+            lang::NullPointerException,
+            lang::WrappedTargetException,
+            uno::RuntimeException)
+{
+
+    if (m_xLayerContentDescriber.is())
+    {
+        rtl::OUString aProxyBypassList;
+
+        CFArrayRef rExceptionsList = GetExceptionsListSetting();
+
+        if (rExceptionsList)
+        {
+            for (CFIndex idx = 0; idx < CFArrayGetCount(rExceptionsList); idx++)
+            {
+                CFStringRef rException = (CFStringRef) CFArrayGetValueAtIndex(rExceptionsList, idx);
+
+                if (idx>0)
+                    aProxyBypassList += rtl::OUString::createFromAscii( ";" );
+
+                aProxyBypassList += CFStringToOUString(rException);
+            }
+        }
+
+        // override default for ProxyType, which is "0" meaning "No proxies".
+        uno::Sequence<backend::PropertyInfo> aPropInfoList(6);
+        sal_Int32 nProperties = 1;
+
+        aPropInfoList[0].Name = rtl::OUString(
+            RTL_CONSTASCII_USTRINGPARAM( "org.openoffice.Inet/Settings/ooInetProxyType") );
+        aPropInfoList[0].Type = rtl::OUString(
+            RTL_CONSTASCII_USTRINGPARAM( "int" ) );
+        aPropInfoList[0].Protected = sal_False;
+        aPropInfoList[0].Value = uno::makeAny( nProperties );
+
+        // fill proxy bypass list
+        if( aProxyBypassList.getLength() > 0 )
+        {
+            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( aProxyBypassList.replace( SPACE, SEMI_COLON ) );
+        }
+
+        ProxyEntry aHttpProxy;
+        ProxyEntry aFtpProxy;
+
+        char host[MAXHOSTNAMELEN];
+        UInt16 port;
+        Boolean retVal;
+
+        retVal = GetProxySetting(sHTTP, host, 100, &port);
+
+        if (retVal)
+        {
+            aHttpProxy.Server = rtl::OUString::createFromAscii( host );
+            aHttpProxy.Port = port;
+        }
+
+        retVal = GetProxySetting(sFTP, host, 100, &port);
+
+        if (retVal)
+        {
+            aFtpProxy.Server = rtl::OUString::createFromAscii( host );
+            aFtpProxy.Port = port;
+        }
+
+        // http proxy name
+        if( aHttpProxy.Server.getLength() > 0 )
+        {
+            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( aHttpProxy.Server );
+        }
+
+        // http proxy port
+        if( aHttpProxy.Port > 0 )
+        {
+            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( aHttpProxy.Port );
+        }
+
+        // ftp proxy name
+        if( aFtpProxy.Server.getLength() > 0 )
+        {
+            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( aFtpProxy.Server );
+        }
+
+        // ftp proxy port
+        if( aFtpProxy.Port > 0 )
+        {
+            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( aFtpProxy.Port );
+        }
+
+        // resize the property info list appropriately
+        aPropInfoList.realloc(nProperties);
+
+        m_xLayerContentDescriber->describeLayer(xHandler, aPropInfoList);
+    }
+    else
+    {
+        OSL_TRACE("Could not create com.sun.star.configuration.backend.LayerContentDescriber Service");
+    }
+}
+
+//------------------------------------------------------------------------------
+
+rtl::OUString SAL_CALL MacOSXLayer::getTimestamp(void)
+    throw (uno::RuntimeException)
+{
+    // FIXME: Always new timestamp!?
+    rtl::OUString aTimestamp = rtl::OUString::valueOf( time(NULL) );
+
+    return aTimestamp;
+}
+
+//------------------------------------------------------------------------------
diff -x CVS -urN ooo_SRC680_m205_src.orig/shell/source/backends/macbe/macbelayer.hxx ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/macbelayer.hxx
--- ooo_SRC680_m205_src.orig/shell/source/backends/macbe/macbelayer.hxx	1970-01-01 01:00:00.000000000 +0100
+++ ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/macbelayer.hxx	2007-03-01 10:57:46.000000000 +0100
@@ -0,0 +1,114 @@
+/*************************************************************************
+ *
+ *  OpenOffice.org - a multi-platform office productivity suite
+ *
+ *  $RCSfile$
+ *
+ *  $Revision$
+ *
+ *  last change: $Author$ $Date$
+ *
+ *  The Contents of this file are made available subject to
+ *  the terms of GNU Lesser General Public License Version 2.1.
+ *
+ *
+ *    GNU Lesser General Public License Version 2.1
+ *    =============================================
+ *    Copyright 2005 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
+ *
+ ************************************************************************/
+
+#ifndef _MACBELAYER_HXX_
+#define _MACBELAYER_HXX_
+
+#ifndef _COM_SUN_STAR_UNO_XCOMPONENTCONTEXT_HPP_
+#include <com/sun/star/uno/XComponentContext.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYER_HPP_
+#include <com/sun/star/configuration/backend/XLayer.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_PROPERTYINFO_HPP_
+#include <com/sun/star/configuration/backend/PropertyInfo.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_BACKENDACCESSEXCEPTION_HPP_
+#include <com/sun/star/configuration/backend/BackendAccessException.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_CONFIGURATION_BACKEND_XLAYERCONTENTDESCIBER_HPP_
+#include <com/sun/star/configuration/backend/XLayerContentDescriber.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_UTIL_XTIMESTAMPED_HPP_
+#include <com/sun/star/util/XTimeStamped.hpp>
+#endif
+
+#ifndef _COM_SUN_STAR_UNO_SEQUENCE_HXX_
+#include <com/sun/star/uno/Sequence.hxx>
+#endif
+
+#ifndef _CPPUHELPER_IMPLBASE2_HXX_
+#include <cppuhelper/implbase2.hxx>
+#endif
+
+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 interfaces for fixed values
+ */
+
+class MacOSXLayer : public cppu::WeakImplHelper2<backend::XLayer, util::XTimeStamped>
+{
+public:
+
+    /**
+       Constructor given the requested component name
+
+       @param aTimestamp     timestamp indicating last modifictaion
+    */
+    MacOSXLayer(const uno::Reference<uno::XComponentContext>& xContext);
+
+    /** Destructor */
+    ~MacOSXLayer(void) {}
+
+    // 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);
+
+private:
+
+    rtl::OUString m_aComponent;
+
+    uno::Reference<backend::XLayerContentDescriber> m_xLayerContentDescriber;
+
+};
+
+#endif // _MACBELAYER_HXX_
diff -x CVS -urN ooo_SRC680_m205_src.orig/shell/source/backends/macbe/makefile.mk ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/makefile.mk
--- ooo_SRC680_m205_src.orig/shell/source/backends/macbe/makefile.mk	1970-01-01 01:00:00.000000000 +0100
+++ ooo_SRC680_m205_src.pj74/shell/source/backends/macbe/makefile.mk	2007-03-01 10:57:46.000000000 +0100
@@ -0,0 +1,85 @@
+#*************************************************************************
+#
+#   OpenOffice.org - a multi-platform office productivity suite
+#
+#   $RCSfile$
+#
+#   $Revision$
+#
+#   last change: $Author$ $Date$
+#
+#   The Contents of this file are made available subject to
+#   the terms of GNU Lesser General Public License Version 2.1.
+#
+#
+#     GNU Lesser General Public License Version 2.1
+#     =============================================
+#     Copyright 2005 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
+#
+#*************************************************************************
+
+PRJ=..$/..$/..
+
+PRJNAME=shell
+TARGET=macbe
+
+LIBTARGET=NO
+ENABLE_EXCEPTIONS=TRUE
+
+COMP1TYPELIST=$(TARGET)
+
+# --- Settings ---
+
+.INCLUDE : settings.mk
+
+DLLPRE =
+
+# --- Files ---
+
+.IF "$(OS)" != "MACOSX"
+
+dummy:
+        @echo "Nothing to build for OS $(OS)."
+
+.ELSE
+
+SLOFILES= \
+	$(SLO)$/macbecdef.obj \
+	$(SLO)$/macbackend.obj \
+	$(SLO)$/macbelayer.obj
+
+SHL1TARGET=$(TARGET)1.uno
+SHL1OBJS=$(SLOFILES)
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+
+SHL1IMPLIB=i$(SHL1TARGET)
+SHL1STDLIBS= \
+        $(CPPUHELPERLIB) \
+        $(CPPULIB) \
+        $(SALLIB) \
+	-framework Carbon -framework SystemConfiguration
+
+SHL1VERSIONMAP=exports.map
+SHL1DEF=$(MISC)$/$(SHL1TARGET).def
+DEF1NAME=$(SHL1TARGET)
+
+# --- Targets ---
+
+.INCLUDE : target.mk
+
+.ENDIF # "$(OS)" != "MACOSX"
