Initial checkin

This commit is contained in:
Patrick Luby 2001-03-15 18:25:36 +00:00
parent a5a06fc3dd
commit 0b6ef4b130
4 changed files with 454 additions and 0 deletions

View file

@ -0,0 +1,134 @@
/*************************************************************************
*
* $RCSfile: aqua_clipboard.hxx,v $
*
* $Revision: 1.1 $
*
* last change: $Author: pluby $ $Date: 2001-03-15 19:25:36 $
*
* 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 _AQUA_CLIPBOARD_HXX_
#define _AQUA_CLIPBOARD_HXX_
#ifndef _RTL_USTRING_
#include <rtl/ustring>
#endif
#ifndef _SAL_TYPES_H_
#include <sal/types.h>
#endif
#ifndef _CPPUHELPER_COMPBASE3_HXX_
#include <cppuhelper/compbase3.hxx>
#endif
#ifndef _COM_SUN_STAR_DATATRANSFER_XTRANSFERABLE_HPP_
#include <com/sun/star/datatransfer/XTransferable.hpp>
#endif
#ifndef _COM_SUN_STAR_DATATRANSFER_CLIPBOARD_XCLIPBOARDEX_HPP_
#include <com/sun/star/datatransfer/clipboard/XClipboardEx.hpp>
#endif
#ifndef _COM_SUN_STAR_DATATRANSFER_CLIPBOARD_XCLIPBOARDOWNER_HPP_
#include <com/sun/star/datatransfer/clipboard/XClipboardOwner.hpp>
#endif
#ifndef _COM_SUN_STAR_DATATRANSFER_CLIPBOARD_XCLIPBOARDLISTENER_HPP_
#include <com/sun/star/datatransfer/clipboard/XClipboardListener.hpp>
#endif
#ifndef _COM_SUN_STAR_DATATRANSFER_CLIPBOARD_XCLIPBOARDNOTIFIER_HPP_
#include <com/sun/star/datatransfer/clipboard/XClipboardNotifier.hpp>
#endif
#ifndef _COM_SUN_STAR_LANG_XSERVICEINFO_HPP_
#include <com/sun/star/lang/XServiceInfo.hpp>
#endif
namespace aqua {
class AquaClipboard :
public cppu::WeakComponentImplHelper3< ::com::sun::star::datatransfer::clipboard::XClipboardEx, ::com::sun::star::datatransfer::clipboard::XClipboardNotifier, ::com::sun::star::lang::XServiceInfo >
{
public:
AquaClipboard();
virtual ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable > SAL_CALL getContents()
throw( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL setContents( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::XTransferable >& xTransferable, const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardOwner >& xClipboardOwner )
throw( ::com::sun::star::uno::RuntimeException );
virtual ::rtl::OUString SAL_CALL getName()
throw( ::com::sun::star::uno::RuntimeException );
virtual sal_Int8 SAL_CALL getRenderingCapabilities()
throw( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL addClipboardListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
throw( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL removeClipboardListener( const ::com::sun::star::uno::Reference< ::com::sun::star::datatransfer::clipboard::XClipboardListener >& listener )
throw( ::com::sun::star::uno::RuntimeException );
virtual void SAL_CALL dispose() throw(::com::sun::star::uno::RuntimeException);
virtual ::rtl::OUString SAL_CALL getImplementationName( )
throw(::com::sun::star::uno::RuntimeException);
virtual sal_Bool SAL_CALL supportsService( const ::rtl::OUString& ServiceName )
throw(::com::sun::star::uno::RuntimeException);
virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL getSupportedServiceNames()
throw(::com::sun::star::uno::RuntimeException);
};
} // namespace aqua
#endif

View file

@ -0,0 +1,160 @@
/*************************************************************************
*
* $RCSfile: aqua_service.cxx,v $
*
* $Revision: 1.1 $
*
* last change: $Author: pluby $ $Date: 2001-03-15 19:25:36 $
*
* 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 _AQUA_CLIPBOARD_HXX_
#include "aqua_clipboard.hxx"
#endif
#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
// the service names
#define AQUA_CLIPBOARD_SERVICE_NAME "com.sun.star.datatransfer.clipboard.SystemClipboard"
// the implementation names
#define AQUA_CLIPBOARD_IMPL_NAME "com.sun.star.datatransfer.clipboard.AquaClipboard"
// the registry key names
#define AQUA_CLIPBOARD_REGKEY_NAME "/com.sun.star.datatransfer.clipboard.AquaClipboard/UNO/SERVICES/com.sun.star.datatransfer.clipboard.SystemClipboard"
using namespace rtl;
using namespace com::sun::star::uno;
using namespace com::sun::star::registry;
using namespace cppu;
using namespace com::sun::star::lang;
using namespace com::sun::star::datatransfer::clipboard;
using namespace aqua;
namespace aqua {
Reference< XInterface > SAL_CALL createInstance( const Reference< XMultiServiceFactory >& rServiceManager )
{
return Reference< XInterface >( static_cast< XClipboard* >( new AquaClipboard() ) );
}
} // namespace aqua
extern "C"
{
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_False;
if ( pRegistryKey )
{
try
{
Reference< XRegistryKey > pXNewKey( static_cast< XRegistryKey* >( pRegistryKey ) );
pXNewKey->createKey( OUString( RTL_CONSTASCII_USTRINGPARAM( AQUA_CLIPBOARD_REGKEY_NAME ) ) );
bRetVal = sal_True;
}
catch( InvalidRegistryException& )
{
OSL_ENSHURE(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, AQUA_CLIPBOARD_IMPL_NAME ) ) )
{
Sequence< OUString > aSNS( 1 );
aSNS.getArray( )[0] = OUString( RTL_CONSTASCII_USTRINGPARAM( AQUA_CLIPBOARD_SERVICE_NAME ) );
//OUString( RTL_CONSTASCII_USTRINGPARAM( FPS_IMPL_NAME ) )
Reference< XSingleServiceFactory > xFactory ( createOneInstanceFactory(
reinterpret_cast< XMultiServiceFactory* > ( pSrvManager ),
OUString::createFromAscii( pImplName ),
createInstance,
aSNS ) );
if ( xFactory.is() )
{
xFactory->acquire();
pRet = xFactory.get();
}
}
return pRet;
}
} // extern "C"

View file

@ -0,0 +1,55 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE COMPONENTDESCRIPTION PUBLIC "-//StarOffice//DTD ComponentDescription 1.0//EN" "componentdescription.dtd">
<COMPONENTDESCRIPTION
xmlns:xlink="http://www.w3.org/1999/xlink/Namespace" >
<Author> Tino Rachui </Author>
<Name> com.sun.star.comp.datatransfer.clipboard </Name>
<Description>
The win32 implementation of the datatransfer service.
</Description>
<ModuleName> sysdtrans </ModuleName>
<LoaderName> com.sun.star.loader.SharedLibrary </LoaderName>
<Language> c++ </Language>
<Status StatusValue="experimental"/>
<SupportedService> com.sun.star.datatransfer.clipboard.SystemClipboard </SupportedService>
<ServiceDependency> ... </ServiceDependency>
<ProjectBuildDependency> cppuhelper </ProjectBuildDependency>
<ProjectBuildDependency> cppu </ProjectBuildDependency>
<ProjectBuildDependency> sal </ProjectBuildDependency>
<RuntimeModuleDependency> cppuhelper </RuntimeModuleDependency>
<RuntimeModuleDependency> cppu2 </RuntimeModuleDependency>
<RuntimeModuleDependency> sal2 </RuntimeModuleDependency>
<Type> com.sun.star.datatransfer.clipboard.XClipboardEx </Type>
<Type> com.sun.star.datatransfer.XTransferable </Type>
<Type> com.sun.star.datatransfer.XTransferableEx </Type>
<Type> com.sun.star.datatransfer.clipboard.XClipboardOwner</Type>
<Type> com.sun.star.datatransfer.clipboard.XClipboardListener</Type>
<Type> com.sun.star.datatransfer.clipboard.XClipboardNotifier</Type>
<Type> com.sun.star.datatransfer.XTransferDataAccess </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>
</COMPONENTDESCRIPTION>

View file

@ -0,0 +1,105 @@
#*************************************************************************
#
# $RCSfile: makefile.mk,v $
#
# $Revision: 1.1 $
#
# last change: $Author: pluby $ $Date: 2001-03-15 19:25:36 $
#
# 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=dtrans
TARGET=dtransaqua
ENABLE_EXCEPTIONS=TRUE
LIBTARGET=NO
COMP1TYPELIST=$(TARGET)
COMPRDB=$(SOLARBINDIR)$/applicat.rdb
USE_BOUNDCHK=
# --- Settings -----------------------------------------------------
.INCLUDE : settings.mk
# ------------------------------------------------------------------
.IF "$(OS)"!="MACOSX"
dummy:
@echo "Nothing to build for this platform"
.ELSE # "$(OS)"!="MACOSX"
.INCLUDE : ..$/cppumaker.mk
SLOFILES= \
$(SLO)$/aqua_service.obj
SHL1TARGET=$(TARGET)
SHL1STDLIBS= \
$(SALLIB) \
$(CPPULIB) \
$(CPPUHELPERLIB) \
-framework Cocoa
SHL1OBJS= $(SLOFILES)
.ENDIF # "$(OS)"!="MACOSX"
# --- Targets ------------------------------------------------------
.INCLUDE : target.mk