diff options
Diffstat (limited to 'cppu/inc/uno')
-rw-r--r-- | cppu/inc/uno/Enterable.h | 106 | ||||
-rw-r--r-- | cppu/inc/uno/EnvDcp.h | 58 | ||||
-rw-r--r-- | cppu/inc/uno/any2.h | 170 | ||||
-rw-r--r-- | cppu/inc/uno/current_context.h | 63 | ||||
-rw-r--r-- | cppu/inc/uno/current_context.hxx | 119 | ||||
-rw-r--r-- | cppu/inc/uno/data.h | 251 | ||||
-rw-r--r-- | cppu/inc/uno/dispatcher.h | 89 | ||||
-rw-r--r-- | cppu/inc/uno/dispatcher.hxx | 171 | ||||
-rw-r--r-- | cppu/inc/uno/environment.h | 386 | ||||
-rw-r--r-- | cppu/inc/uno/environment.hxx | 270 | ||||
-rw-r--r-- | cppu/inc/uno/lbnames.h | 54 | ||||
-rw-r--r-- | cppu/inc/uno/mapping.h | 214 | ||||
-rw-r--r-- | cppu/inc/uno/mapping.hxx | 346 | ||||
-rw-r--r-- | cppu/inc/uno/sequence2.h | 181 | ||||
-rw-r--r-- | cppu/inc/uno/threadpool.h | 185 |
15 files changed, 0 insertions, 2663 deletions
diff --git a/cppu/inc/uno/Enterable.h b/cppu/inc/uno/Enterable.h deleted file mode 100644 index 29b51f41bb29..000000000000 --- a/cppu/inc/uno/Enterable.h +++ /dev/null @@ -1,106 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_uno_Enterable_h -#define INCLUDED_uno_Enterable_h - -#include "uno/environment.h" - - -#ifdef __cplusplus -extern "C" -{ -#endif - - -/** Generic function type declaration for entering an Environment. - (http://wiki.services.openoffice.org/wiki/Uno/Binary/Spec/Environment_Stack) - - @param context - @since UDK 3.2.7 -*/ -typedef void uno_Enterable_enter (void * context); - - -/** Generic function type declaration for levaing an Environment. - (http://wiki.services.openoffice.org/wiki/Uno/Binary/Spec/Environment_Stack) - - @param context - @since UDK 3.2.7 -*/ -typedef void uno_Enterable_leave (void * context); - - -/** Generic function type declaration for calling into an Environment. - (http://wiki.services.openoffice.org/wiki/Uno/Binary/Spec/Environment_Stack) - - @param context - @param pCallee the function to be called - @param pParam the parameter pointer to be passed to the function - @since UDK 3.2.7 -*/ -typedef void uno_Enterable_callInto_v(void * context, uno_EnvCallee * pCallee, va_list * pParam); - - -/** Generic function type declaration for calling out of an Environment. - (http://wiki.services.openoffice.org/wiki/Uno/Binary/Spec/Environment_Stack) - - @param context - @param pCallee the function to be called - @param pParam the parameter pointer to be passed to the function - @since UDK 3.2.7 -*/ -typedef void uno_Enterable_callOut_v (void * context, uno_EnvCallee * pCallee, va_list * pParam); - - -/** Generic function type declaration for checking if calling on managed object is - valid. - (http://wiki.services.openoffice.org/wiki/Uno/Binary/Spec/Environment_Stack) - - @param context - @param ppReason the reason, in case calling is not valid - @return 0 == calling is not valid, 1 == calling is valid - @since UDK 3.2.7 -*/ -typedef int uno_Enterable_isValid_v (void * context, rtl_uString ** ppReason); - - -/** A struct pReserved needs to point to, if implementing a purpose environment. - (http://wiki.services.openoffice.org/wiki/Uno/Binary/Spec/Environment_Stack) - - @since UDK 3.2.7 -*/ -typedef struct -{ - uno_Enterable_enter * m_enter; - uno_Enterable_leave * m_leave; - uno_Enterable_callInto_v * m_callInto_v; - uno_Enterable_callOut_v * m_callOut_v; - uno_Enterable_isValid_v * m_isValid; -} -uno_Enterable; - - -#ifdef __cplusplus -} -#endif - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/EnvDcp.h b/cppu/inc/uno/EnvDcp.h deleted file mode 100644 index 0dd327dea4c6..000000000000 --- a/cppu/inc/uno/EnvDcp.h +++ /dev/null @@ -1,58 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_uno_EnvDcp_h -#define INCLUDED_uno_EnvDcp_h - -#include <cppu/cppudllapi.h> -#include "rtl/ustring.h" - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Get the OBI type part of an environment descriptor. - (http://wiki.services.openoffice.org/wiki/Uno/Binary/Spec/Environment_Descriptor) - - @param pEnvDcp the Environment Descriptor - @param ppEnvTypeName the OBI type - @since UDK 3.2.7 -*/ -CPPU_DLLPUBLIC void uno_EnvDcp_getTypeName(rtl_uString const * pEnvDcp, rtl_uString ** ppEnvTypeName); - - -/** Get the purpose part of an environment descriptor. - (http://wiki.services.openoffice.org/wiki/Uno/Binary/Spec/Environment_Descriptor) - - @param pEnvDcp the Environment Descriptor - @param ppEnvPurpose the purpose - @since UDK 3.2.7 -*/ -CPPU_DLLPUBLIC void uno_EnvDcp_getPurpose (rtl_uString const * pEnvDcp, rtl_uString ** ppEnvPurpose); - - -#ifdef __cplusplus -} -#endif - - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/any2.h b/cppu/inc/uno/any2.h deleted file mode 100644 index e18087a165e5..000000000000 --- a/cppu/inc/uno/any2.h +++ /dev/null @@ -1,170 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef _UNO_ANY2_H_ -#define _UNO_ANY2_H_ - -#include <cppu/cppudllapi.h> -#include <uno/data.h> - -#ifdef __cplusplus -extern "C" -{ -#endif - -#if defined( SAL_W32) -#pragma pack(push, 8) -#endif - -struct _typelib_TypeDescriptionReference; -struct _typelib_TypeDescription; -struct _uno_Mapping; - -/** This is the binary specification of an UNO any. -*/ -typedef struct _uno_Any -{ - /** type of value - */ - struct _typelib_TypeDescriptionReference * pType; - /** pointer to value; this may point to pReserved and thus the uno_Any is not anytime - mem-copyable! You may have to correct the pData pointer to pReserved. Otherwise you need - not, because the data is stored in heap space. - */ - void * pData; - /** reserved space for storing value - */ - void * pReserved; -} uno_Any; - -#if defined( SAL_W32) -#pragma pack(pop) -#endif - -/** Assign an any with a given value. Interfaces are acquired or released by the given callback - functions. - - @param pDest pointer memory of destination any - @param pSource pointer to source value; defaults (0) to default constructed value - @param pTypeDescr type description of value; defaults (0) to void - @param acquire function called each time an interface needs to be acquired; - defaults (0) to uno - @param release function called each time an interface needs to be released; - defaults (0) to uno -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_any_assign( - uno_Any * pDest, void * pSource, - struct _typelib_TypeDescription * pTypeDescr, - uno_AcquireFunc acquire, uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); -/** Assign an any with a given value. Interfaces are acquired or released by the given callback - functions. - - @param pDest pointer memory of destination any - @param pSource pointer to source value; defaults (0) to default constructed value - @param pType type description of value; defaults (0) to void - @param acquire function called each time an interface needs to be acquired; - defaults (0) to uno - @param release function called each time an interface needs to be released; - defaults (0) to uno -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_type_any_assign( - uno_Any * pDest, void * pSource, - struct _typelib_TypeDescriptionReference * pType, - uno_AcquireFunc acquire, uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); - -/** Constructs an any with a given value. Interfaces are acquired by the given callback function. - - @param pDest pointer memory of destination any - @param pSource pointer to source value; defaults (0) to default constructed value - @param pTypeDescr type description of value; defaults (0) to void - @param acquire function called each time an interface needs to be acquired; - defaults (0) to uno -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_any_construct( - uno_Any * pDest, void * pSource, - struct _typelib_TypeDescription * pTypeDescr, - uno_AcquireFunc acquire ) - SAL_THROW_EXTERN_C(); -/** Constructs an any with a given value. Interfaces are acquired by the given callback function. - - @param pDest pointer memory of destination any - @param pSource pointer to source value; defaults (0) to default constructed value - @param pType type of value; defaults (0) to void - @param acquire function called each time an interface needs to be acquired; - defaults (0) to uno -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_type_any_construct( - uno_Any * pDest, void * pSource, - struct _typelib_TypeDescriptionReference * pType, - uno_AcquireFunc acquire ) - SAL_THROW_EXTERN_C(); - -/** Constructs an any with a given value and converts/ maps interfaces. - - @param pDest pointer memory of destination any - @param pSource pointer to source value; defaults (0) to default constructed value - @param pTypeDescr type description of value; defaults (0) to void - @param mapping mapping to convert/ map interfaces -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_any_constructAndConvert( - uno_Any * pDest, void * pSource, - struct _typelib_TypeDescription * pTypeDescr, - struct _uno_Mapping * mapping ) - SAL_THROW_EXTERN_C(); -/** Constructs an any with a given value and converts/ maps interfaces. - - @param pDest pointer memory of destination any - @param pSource pointer to source value; defaults (0) to default constructed value - @param pType type of value; defaults (0) to void - @param mapping mapping to convert/ map interfaces -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_type_any_constructAndConvert( - uno_Any * pDest, void * pSource, - struct _typelib_TypeDescriptionReference * pType, - struct _uno_Mapping * mapping ) - SAL_THROW_EXTERN_C(); - -/** Destructs an any. - - @param pValue pointer to any - @param release function called each time an interface needs to be released; - defaults (0) to uno -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_any_destruct( - uno_Any * pValue, uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); - -/** Sets value to void. - - @param pValue pointer to any - @param release function called each time an interface needs to be released; - defaults (0) to uno -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_any_clear( - uno_Any * pValue, uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); - -#ifdef __cplusplus -} -#endif - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/current_context.h b/cppu/inc/uno/current_context.h deleted file mode 100644 index 18adfe84b45e..000000000000 --- a/cppu/inc/uno/current_context.h +++ /dev/null @@ -1,63 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef _UNO_CURRENT_CONTEXT_H_ -#define _UNO_CURRENT_CONTEXT_H_ - -#include <cppu/cppudllapi.h> -#include <rtl/ustring.h> - -#ifdef __cplusplus -extern "C" -{ -#endif - -/** Gets the current task's context. - @attention - Don't spread the returned interface around to other threads. Every thread has its own - current context. - - @param ppCurrentContext inout param current context of type com.sun.star.uno.XCurrentContext - @param pEnvDcp descriptor of returned interface's environment - @param pEnvContext context of returned interface's environment (commonly 0) - @return true, if context ref was transferred (even if null ref) -*/ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_getCurrentContext( - void ** ppCurrentContext, - rtl_uString * pEnvDcp, void * pEnvContext ) - SAL_THROW_EXTERN_C(); - -/** Sets the current task's context. - - @param pCurrentContext in param current context of type com.sun.star.uno.XCurrentContext - @param pEnvDcp descriptor of interface's environment - @param pEnvContext context of interface's environment (commonly 0) - @return true, if context ref was transferred (even if null ref) -*/ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_setCurrentContext( - void * pCurrentContext, - rtl_uString * pEnvDcp, void * pEnvContext ) - SAL_THROW_EXTERN_C(); - -#ifdef __cplusplus -} -#endif - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/current_context.hxx b/cppu/inc/uno/current_context.hxx deleted file mode 100644 index 5812db74700c..000000000000 --- a/cppu/inc/uno/current_context.hxx +++ /dev/null @@ -1,119 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef _UNO_CURRENT_CONTEXT_HXX_ -#define _UNO_CURRENT_CONTEXT_HXX_ - -#include <uno/current_context.h> - -#include <com/sun/star/uno/XCurrentContext.hpp> - - -namespace com -{ -namespace sun -{ -namespace star -{ -namespace uno -{ - -/** Getting the current context. - @attention - Don't spread the returned interface around to other threads. Every thread has its own - current context. - - @return current context or null ref, if none is set -*/ -inline Reference< XCurrentContext > SAL_CALL getCurrentContext() - SAL_THROW(()) -{ - Reference< XCurrentContext > xRet; - ::rtl::OUString aEnvTypeName( RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ); - ::uno_getCurrentContext( (void **)&xRet, aEnvTypeName.pData, 0 ); - return xRet; -} -/** Setting the current context. - - @param xContext current context to be set - @return true, if context has been successfully set -*/ -inline bool SAL_CALL setCurrentContext( - Reference< XCurrentContext > const & xContext ) - SAL_THROW(()) -{ - ::rtl::OUString aEnvTypeName( RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ); - return (::uno_setCurrentContext( xContext.get(), aEnvTypeName.pData, 0 ) != sal_False); -} - -/** Objects of this class are used for applying a current context until they are destructed, i.e. - the ctor of this class saves the previous and sets the given context while the dtor restores - the previous one upon destruction. -*/ -class ContextLayer -{ - /** this C++ environment type name. - */ - ::rtl::OUString m_aEnvTypeName; - /** previous context - */ - Reference< XCurrentContext > m_xPreviousContext; - -public: - /** Constructor: Saves the previous context and sets the new (given) one. - - @param xNewContext new context to be set - */ - inline ContextLayer( - Reference< XCurrentContext > const & xNewContext = Reference< XCurrentContext >() ) - SAL_THROW(()); - /** Destructor: restores the previous context. - */ - inline ~ContextLayer() SAL_THROW(()); - - /** Gets the previously set context. - - @return the previously set context - */ - inline Reference< XCurrentContext > SAL_CALL getPreviousContext() const - SAL_THROW(()) - { return m_xPreviousContext; } -}; -//__________________________________________________________________________________________________ -inline ContextLayer::ContextLayer( Reference< XCurrentContext > const & xNewContext ) - SAL_THROW(()) - : m_aEnvTypeName( RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ) -{ - ::uno_getCurrentContext( (void **)&m_xPreviousContext, m_aEnvTypeName.pData, 0 ); - ::uno_setCurrentContext( xNewContext.get(), m_aEnvTypeName.pData, 0 ); -} -//__________________________________________________________________________________________________ -inline ContextLayer::~ContextLayer() - SAL_THROW(()) -{ - ::uno_setCurrentContext( m_xPreviousContext.get(), m_aEnvTypeName.pData, 0 ); -} - -} -} -} -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/data.h b/cppu/inc/uno/data.h deleted file mode 100644 index 9454ba9012d5..000000000000 --- a/cppu/inc/uno/data.h +++ /dev/null @@ -1,251 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef _UNO_DATA_H_ -#define _UNO_DATA_H_ - -#include <cppu/cppudllapi.h> - -#ifdef __cplusplus -extern "C" -{ -#endif - -struct _typelib_TypeDescriptionReference; -struct _typelib_TypeDescription; -struct _typelib_InterfaceTypeDescription; -struct _uno_Mapping; - -/** Generic function pointer declaration to query for an interface. - - @param pInterface interface - @param pTypedemanded interface type - @return interface pointer -*/ -typedef void * (SAL_CALL * uno_QueryInterfaceFunc)( - void * pInterface, struct _typelib_TypeDescriptionReference * pType ); -/** Generic function pointer declaration to acquire an interface. - - @param pInterface interface to be acquired -*/ -typedef void (SAL_CALL * uno_AcquireFunc)( - void * pInterface ); -/** Generic function pointer declaration to release an interface. - - @param pInterface interface to be release -*/ -typedef void (SAL_CALL * uno_ReleaseFunc)( - void * pInterface ); - -/** Tests if two values are equal. May compare different types (e.g., short to long). - - @param pVal1 pointer to a value - @param pVal1TypeDescr type description of pVal1 - @param pVal2 pointer to another value - @param pVal2TypeDescr type description of pVal2 - @param queryInterface function called each time two interfaces are tested whether they belong - to the same object; defaults (0) to uno - @param release function to release queried interfaces; defaults (0) to uno - @return true if values are equal -*/ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_equalData( - void * pVal1, struct _typelib_TypeDescription * pVal1TypeDescr, - void * pVal2, struct _typelib_TypeDescription * pVal2TypeDescr, - uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); -/** Tests if two values are equal. May compare different types (e.g., short to long). - - @param pVal1 pointer to a value - @param pVal1Type type of pVal1 - @param pVal2 pointer to another value - @param pVal2Type type of pVal2 - @param queryInterface function called each time two interfaces are tested whether they belong - to the same object; defaults (0) to uno - @param release function to release queried interfaces; defaults (0) to uno - @return true if values are equal -*/ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_type_equalData( - void * pVal1, struct _typelib_TypeDescriptionReference * pVal1Type, - void * pVal2, struct _typelib_TypeDescriptionReference * pVal2Type, - uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); - -/** Copy construct memory with given value. The size of the destination value must be larger - or equal to the size of the source value. - - @param pDest pointer to destination value memory - @param pSource pointer to source value - @param pTypeDescr type description of source - @param acquire function called each time an interface needs to be acquired; - defaults (0) to uno -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_copyData( - void * pDest, void * pSource, - struct _typelib_TypeDescription * pTypeDescr, uno_AcquireFunc acquire ) - SAL_THROW_EXTERN_C(); -/** Copy construct memory with given value. The size of the destination value must be larger - or equal to the size of the source value. - - @param pDest pointer to destination value memory - @param pSource pointer to source value - @param pType type of source - @param acquire function called each time an interface needs to be acquired; - defaults (0) to uno -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_type_copyData( - void * pDest, void * pSource, - struct _typelib_TypeDescriptionReference * pType, uno_AcquireFunc acquire ) - SAL_THROW_EXTERN_C(); - -/** Copy construct memory with given value. The size of the destination value must be larger - or equal to the size of the source value. Interfaces are converted/ mapped by mapping parameter. - - @param pDest pointer to destination value memory - @param pSource pointer to source value - @param pTypeDescr type description of source - @param mapping mapping to convert/ map interfaces -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_copyAndConvertData( - void * pDest, void * pSource, - struct _typelib_TypeDescription * pTypeDescr, struct _uno_Mapping * mapping ) - SAL_THROW_EXTERN_C(); -/** Copy construct memory with given value. The size of the destination value must be larger - or equal to the size of the source value. Interfaces are converted/ mapped by mapping parameter. - - @param pDest pointer to destination value memory - @param pSource pointer to source value - @param pType type of source - @param mapping mapping to convert/ map interfaces -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_type_copyAndConvertData( - void * pDest, void * pSource, - struct _typelib_TypeDescriptionReference * pType, struct _uno_Mapping * mapping ) - SAL_THROW_EXTERN_C(); - -/** Destructs a given value; does NOT free its memory! - - @param pValue value to be destructed - @param pTypeDescr type description of value - @param release function called each time an interface pointer needs to be released; - defaults (0) to uno -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_destructData( - void * pValue, struct _typelib_TypeDescription * pTypeDescr, uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); -/** Destructs a given value; does NOT free its memory! - - @param pValue value to be destructed - @param pType type of value - @param release function called each time an interface pointer needs to be released; - defaults (0) to uno -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_type_destructData( - void * pValue, struct _typelib_TypeDescriptionReference * pType, uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); - -/** Default constructs a value. All simple types are set to 0, enums are set to their default value. - - @param pMem pointer to memory of value to be constructed - @param pTypeDescr type description of value to be constructed -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_constructData( - void * pMem, struct _typelib_TypeDescription * pTypeDescr ) - SAL_THROW_EXTERN_C(); -/** Default constructs a value. All simple types are set to 0, enums are set to their default value. - - @param pMem pointer to memory of value to be constructed - @param pType type of value to be constructed -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_type_constructData( - void * pMem, struct _typelib_TypeDescriptionReference * pType ) - SAL_THROW_EXTERN_C(); - -/** Assigns a destination value with a source value. - Widening conversion WITHOUT data loss is allowed (e.g., assigning a long with a short). - Querying for demanded interface type is allowed. - Assignment from any value to a value of type Any and vice versa is allowed. - - @param pDest pointer to destination value - @param pDestTypeDescr type description of destination value - @param pSource pointer to source value; if 0, then destination value will be assigned - to default value - @param pSourceTypeDescr type destination of source value - @param queryInterface function called each time an interface needs to be queried; - defaults (0) to uno - @param acquire function called each time an interface needs to be acquired; - defaults (0) to uno - @param release function called each time an interface needs to be released; - defaults (0) to uno - @return true if destination has been successfully assigned -*/ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_assignData( - void * pDest, struct _typelib_TypeDescription * pDestTypeDescr, - void * pSource, struct _typelib_TypeDescription * pSourceTypeDescr, - uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); -/** Assigns a destination value with a source value. - Widening conversion WITHOUT data loss is allowed (e.g., assigning a long with a short). - Querying for demanded interface type is allowed. - Assignment from any value to a value of type Any and vice versa is allowed. - - @param pDest pointer to destination value - @param pDestType type of destination value - @param pSource pointer to source value; if 0, then destination value will be assigned - to default value - @param pSourceType type of source value - @param queryInterface function called each time an interface needs to be queried; - defaults (0) to uno - @param acquire function called each time an interface needs to be acquired; - defaults (0) to uno - @param release function called each time an interface needs to be released; - defaults (0) to uno - @return true if destination has been successfully assigned -*/ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_type_assignData( - void * pDest, struct _typelib_TypeDescriptionReference * pDestType, - void * pSource, struct _typelib_TypeDescriptionReference * pSourceType, - uno_QueryInterfaceFunc queryInterface, uno_AcquireFunc acquire, uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); - -/** Tests whether a value of given type is assignable from given value. - Widening conversion WITHOUT data loss is allowed (e.g., assigning a long with a short). - Querying for demanded interface type is allowed. - Assignment from any value to a value of type Any and vice versa is allowed. - - @param pAssignable type - @param pFrom pointer to value - @param pFromType type of value - @param queryInterface function called each time an interface needs to be queried; - defaults (0) to uno - @param release function called each time an interface needs to be released; - defaults (0) to uno - @return true if value is destination has been successfully assigned -*/ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_type_isAssignableFromData( - struct _typelib_TypeDescriptionReference * pAssignable, - void * pFrom, struct _typelib_TypeDescriptionReference * pFromType, - uno_QueryInterfaceFunc queryInterface, uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); - -#ifdef __cplusplus -} -#endif - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/dispatcher.h b/cppu/inc/uno/dispatcher.h deleted file mode 100644 index 4008f7c1e360..000000000000 --- a/cppu/inc/uno/dispatcher.h +++ /dev/null @@ -1,89 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef _UNO_DISPATCHER_H_ -#define _UNO_DISPATCHER_H_ - -#include <sal/types.h> -#include <rtl/ustring.h> -#include <uno/any2.h> - -#ifdef __cplusplus -extern "C" -{ -#endif - -struct _typelib_TypeDescription; -struct _uno_Interface; - -/** Function pointer declaration for the binary C uno dispatch function. Any pure out or return - value will be constructed by the callee, iff no exception is signalled. - If an exception is signalled, the any *ppException is properly constructed by the callee, - otherwise the pointer *ppException is set to 0. - An attribute get call is indicated by a non-null return pointer. - - @param pUnoI uno interface the call is performed on - @param pMemberType member type description of a method or attribute - @param pReturn pointer to return value memory; - pointer may be undefined if void method, null if attribute set call. - @param pArgs an array of pointers to arguments values. - (remark: the value of an interface reference stores a - uno_interface *, so you get it by *(uno_Interface **)pArgs[n]) - @param ppException pointer to pointer to unconstructed any to signal an exception. -*/ -typedef void (SAL_CALL * uno_DispatchMethod)( - struct _uno_Interface * pUnoI, - const struct _typelib_TypeDescription * pMemberType, - void * pReturn, - void * pArgs[], - uno_Any ** ppException ); - -#if defined( SAL_W32) -#pragma pack(push, 8) -#endif - -/** The binary C uno interface description. -*/ -typedef struct _uno_Interface -{ - /** Acquires uno interface. - - @param pInterface uno interface - */ - void (SAL_CALL * acquire)( struct _uno_Interface * pInterface ); - /** Releases uno interface. - - @param pInterface uno interface - */ - void (SAL_CALL * release)( struct _uno_Interface * pInterface ); - /** dispatch function - */ - uno_DispatchMethod pDispatcher; -} uno_Interface; - -#if defined( SAL_W32) -#pragma pack(pop) -#endif - -#ifdef __cplusplus -} -#endif - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/dispatcher.hxx b/cppu/inc/uno/dispatcher.hxx deleted file mode 100644 index 4fb7cced4626..000000000000 --- a/cppu/inc/uno/dispatcher.hxx +++ /dev/null @@ -1,171 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ - -#ifndef INCLUDED_UNO_DISPATCHER_HXX -#define INCLUDED_UNO_DISPATCHER_HXX - -#include "uno/dispatcher.h" - -/// @cond INTERNAL - -namespace com -{ -namespace sun -{ -namespace star -{ -namespace uno -{ - -/** C++ holder reference for binary C uno_Interface. Not for public use, may be - subject to changes. - - @see uno_Interface - @attention - not for public use! -*/ -class UnoInterfaceReference -{ -public: - uno_Interface * m_pUnoI; - - inline bool is() const - { return m_pUnoI != 0; } - - inline ~UnoInterfaceReference(); - inline UnoInterfaceReference(); - inline UnoInterfaceReference( uno_Interface * pUnoI, __sal_NoAcquire ); - inline UnoInterfaceReference( uno_Interface * pUnoI ); - inline UnoInterfaceReference( UnoInterfaceReference const & ref ); - - inline uno_Interface * get() const - { return m_pUnoI; } - - inline UnoInterfaceReference & set( - uno_Interface * pUnoI ); - inline UnoInterfaceReference & set( - uno_Interface * pUnoI, __sal_NoAcquire ); - inline void clear(); - - inline UnoInterfaceReference & operator = ( - UnoInterfaceReference const & ref ) - { return set( ref.m_pUnoI ); } - inline UnoInterfaceReference & operator = ( - uno_Interface * pUnoI ) - { return set( pUnoI ); } - - inline void dispatch( - struct _typelib_TypeDescription const * pMemberType, - void * pReturn, void * pArgs [], uno_Any ** ppException ) const; - -private: - inline bool operator == ( UnoInterfaceReference const & ); // not impl - inline bool operator != ( UnoInterfaceReference const & ); // not impl - inline bool operator == ( uno_Interface * ); // not impl - inline bool operator != ( uno_Interface * ); // not impl -}; - -//______________________________________________________________________________ -inline UnoInterfaceReference::~UnoInterfaceReference() -{ - if (m_pUnoI != 0) - (*m_pUnoI->release)( m_pUnoI ); -} - -//______________________________________________________________________________ -inline UnoInterfaceReference::UnoInterfaceReference() - : m_pUnoI( 0 ) -{ -} - -//______________________________________________________________________________ -inline UnoInterfaceReference::UnoInterfaceReference( - uno_Interface * pUnoI, __sal_NoAcquire ) - : m_pUnoI( pUnoI ) -{ -} - -//______________________________________________________________________________ -inline UnoInterfaceReference::UnoInterfaceReference( uno_Interface * pUnoI ) - : m_pUnoI( pUnoI ) -{ - if (m_pUnoI != 0) - (*m_pUnoI->acquire)( m_pUnoI ); -} - -//______________________________________________________________________________ -inline UnoInterfaceReference::UnoInterfaceReference( - UnoInterfaceReference const & ref ) - : m_pUnoI( ref.m_pUnoI ) -{ - if (m_pUnoI != 0) - (*m_pUnoI->acquire)( m_pUnoI ); -} - -//______________________________________________________________________________ -inline UnoInterfaceReference & UnoInterfaceReference::set( - uno_Interface * pUnoI ) -{ - if (pUnoI != 0) - (*pUnoI->acquire)( pUnoI ); - if (m_pUnoI != 0) - (*m_pUnoI->release)( m_pUnoI ); - m_pUnoI = pUnoI; - return *this; -} - -//______________________________________________________________________________ -inline UnoInterfaceReference & UnoInterfaceReference::set( - uno_Interface * pUnoI, __sal_NoAcquire ) -{ - if (m_pUnoI != 0) - (*m_pUnoI->release)( m_pUnoI ); - m_pUnoI = pUnoI; - return *this; -} - -//______________________________________________________________________________ -inline void UnoInterfaceReference::clear() -{ - if (m_pUnoI != 0) - { - (*m_pUnoI->release)( m_pUnoI ); - m_pUnoI = 0; - } -} - -//______________________________________________________________________________ -inline void UnoInterfaceReference::dispatch( - struct _typelib_TypeDescription const * pMemberType, - void * pReturn, void * pArgs [], uno_Any ** ppException ) const -{ - (*m_pUnoI->pDispatcher)( - m_pUnoI, pMemberType, pReturn, pArgs, ppException ); -} - -} -} -} -} - -/// @endcond - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/environment.h b/cppu/inc/uno/environment.h deleted file mode 100644 index e76ed2fc7ba6..000000000000 --- a/cppu/inc/uno/environment.h +++ /dev/null @@ -1,386 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef _UNO_ENVIRONMENT_H_ -#define _UNO_ENVIRONMENT_H_ - -#include <cppu/cppudllapi.h> -#include <rtl/ustring.h> - -#include <stdarg.h> - -#ifdef __cplusplus -extern "C" -{ -#endif - -struct _uno_ExtEnvironment; -struct _typelib_InterfaceTypeDescription; - -#if defined( SAL_W32) -#pragma pack(push, 8) -#endif - -/** The binary specification of an UNO environment. -*/ -typedef struct _uno_Environment -{ - /** reserved for future use (0 if not used) - */ - void * pReserved; - - /** type name of environment - */ - rtl_uString * pTypeName; - - /** free context pointer to be used for specific classes of environments (e.g., a jvm pointer) - */ - void * pContext; - - /** pointer to extended environment (interface registration functionality), if supported - */ - struct _uno_ExtEnvironment * pExtEnv; - - /** Acquires this environment. - - @param pEnv this environment - */ - void (SAL_CALL * acquire)( struct _uno_Environment * pEnv ); - - /** Releases this environment; last release of environment will revoke the environment from - runtime. - - @param pEnv this environment - */ - void (SAL_CALL * release)( struct _uno_Environment * pEnv ); - - /** Acquires this environment weakly. You can only harden a weakly held environment if it - is still acquired hard (acquire()). - - @param pEnv this environment - */ - void (SAL_CALL * acquireWeak)( struct _uno_Environment * pEnv ); - - /** Releases this environment weakly in correspondence to acquireWeak(). - - @param pEnv this environment - */ - void (SAL_CALL * releaseWeak)( struct _uno_Environment * pEnv ); - - /** Makes hard reference out of weak referenced environment. You can only harden a weakly - held environment if it is still acquired hard (acquire()). - - @param ppHardEnv inout hard referenced environment (has to be released via release()) - @param pEnv environment (may be weak referenced) - */ - void (SAL_CALL * harden)( - struct _uno_Environment ** ppHardEnv, - struct _uno_Environment * pEnv ); - - /** Call this function to EXPLICITLY dispose this environment (e.g., release all - interfaces). You may want to call this function before shutting down due to a runtime error. - - @param pEnv this environment - */ - void (SAL_CALL * dispose)( struct _uno_Environment * pEnv ); - - /* ===== the following part will be late initialized by a matching bridge ===== * - * ===== and is NOT for public use. ===== */ - - /** CALLBACK function pointer: Disposing callback function pointer that can be set to get - signalled before the environment is destroyed. - - @param pEnv environment that is being disposed - */ - void (SAL_CALL * environmentDisposing)( struct _uno_Environment * pEnv ); -} uno_Environment; - -/** Generic function pointer declaration to free a proxy object if it is not needed by the - environment anymore. - Any proxy object must register itself on first acquire() call and revoke itself on last - release() call. This can happen several times because the environment caches proxy objects - until the environment explicitly frees the proxy object calling this function. - - @param pEnv environment - @param pProxy proxy pointer -*/ -typedef void (SAL_CALL * uno_freeProxyFunc)( struct _uno_ExtEnvironment * pEnv, void * pProxy ); - -/** Generic function pointer declaration to allocate memory. Used with getRegisteredInterfaces(). - - @param nBytes amount of memory in bytes - @return pointer to allocated memory -*/ -typedef void * (SAL_CALL * uno_memAlloc)( sal_Size nBytes ); - -/** The binary specification of an UNO environment supporting interface registration. -*/ -typedef struct _uno_ExtEnvironment -{ - /** inherits all members of an uno_Environment - */ - uno_Environment aBase; - - /** Registers an interface of this environment. - - @param pEnv this environment - @param ppInterface inout parameter of interface to be registered - @param pOId object id of interface - @param pTypeDescr type description of interface - */ - void (SAL_CALL * registerInterface)( - struct _uno_ExtEnvironment * pEnv, - void ** ppInterface, - rtl_uString * pOId, - struct _typelib_InterfaceTypeDescription * pTypeDescr ); - - /** Registers a proxy interface of this environment that can be reanimated and is freed - explicitly by this environment. - - @param pEnv this environment - @param ppInterface inout parameter of interface to be registered - @param freeProxy function to free proxy object - @param pOId object id of interface - @param pTypeDescr type description of interface - */ - void (SAL_CALL * registerProxyInterface)( - struct _uno_ExtEnvironment * pEnv, - void ** ppProxy, - uno_freeProxyFunc freeProxy, - rtl_uString * pOId, - struct _typelib_InterfaceTypeDescription * pTypeDescr ); - - /** Revokes an interface from this environment. You have to revoke any interface that has - been registered via this method. - - @param pEnv this environment - @param pInterface interface to be revoked - */ - void (SAL_CALL * revokeInterface)( - struct _uno_ExtEnvironment * pEnv, - void * pInterface ); - - /** Provides the object id of a given interface. - - @param ppOut inout oid - @param pInterface interface of object - */ - void (SAL_CALL * getObjectIdentifier)( - struct _uno_ExtEnvironment * pEnv, - rtl_uString ** ppOId, - void * pInterface ); - - /** Retrieves an interface identified by its object id and type from this environment. - Interfaces are retrieved in the same order as they are registered. - - @param pEnv this environment - @param ppInterface inout parameter for the registered interface; (0) if none was found - @param pOId object id of interface to be retrieved - @param pTypeDescr type description of interface to be retrieved - */ - void (SAL_CALL * getRegisteredInterface)( - struct _uno_ExtEnvironment * pEnv, - void ** ppInterface, - rtl_uString * pOId, - struct _typelib_InterfaceTypeDescription * pTypeDescr ); - - /** Returns all currently registered interfaces of this environment. The memory block - allocated might be slightly larger than (*pnLen * sizeof(void *)). - - @param pEnv this environment - @param pppInterfaces out param; pointer to array of interface pointers - @param pnLen out param; length of array - @param memAlloc function for allocating memory that is passed back - */ - void (SAL_CALL * getRegisteredInterfaces)( - struct _uno_ExtEnvironment * pEnv, - void *** pppInterfaces, - sal_Int32 * pnLen, - uno_memAlloc memAlloc ); - - /* ===== the following part will be late initialized by a matching bridge ===== */ - - /** Computes an object id of the given interface; is called by the environment implementation. - - @param pEnv corresponding environment - @param ppOId out param: computed id - @param pInterface an interface - */ - void (SAL_CALL * computeObjectIdentifier)( - struct _uno_ExtEnvironment * pEnv, - rtl_uString ** ppOId, void * pInterface ); - - /** Function to acquire an interface. - - @param pEnv corresponding environment - @param pInterface an interface - */ - void (SAL_CALL * acquireInterface)( - struct _uno_ExtEnvironment * pEnv, - void * pInterface ); - - /** Function to release an interface. - - @param pEnv corresponding environment - @param pInterface an interface - */ - void (SAL_CALL * releaseInterface)( - struct _uno_ExtEnvironment * pEnv, - void * pInterface ); - -} uno_ExtEnvironment; - -#if defined( SAL_W32) -#pragma pack(pop) -#endif - -/** Function exported by some bridge library providing acquireInterface(), releaseInterface(); - may set a disposing callback. - - @param pEnv environment to be initialized -*/ -typedef void (SAL_CALL * uno_initEnvironmentFunc)( uno_Environment * pEnv ); -#define UNO_INIT_ENVIRONMENT "uno_initEnvironment" - -#ifdef DISABLE_DYNLOADING -/* We link statically and have just the C++ environment */ -void SAL_CALL CPPU_ENV_uno_initEnvironment( uno_Environment * Env ) - SAL_THROW_EXTERN_C(); -#ifdef SOLAR_JAVA -/* We also have the Java environment */ -void SAL_CALL java_uno_initEnvironment( uno_Environment * Env ) - SAL_THROW_EXTERN_C(); -#endif -#endif - -/** Gets a specific environment. If the specified environment does not exist, then a default one - is created and registered. The environment revokes itself on last release() call. - - @param ppEnv inout parameter of environment; given environment will be released - @param pEnvDcp descriptor of environment - @param pContext some context pointer (e.g., to distinguish java vm; set 0 if not needed) -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_getEnvironment( - uno_Environment ** ppEnv, rtl_uString * pEnvDcp, void * pContext ) - SAL_THROW_EXTERN_C(); - -/** Gets all specified environments. Caller has to release returned environments and free allocated - memory. - - @param pppEnvs out param; pointer to array of environments - @param pnLen out param; length of array - @param memAlloc function for allocating memory that is passed back - @param pEnvDcp descriptor of environments; 0 defaults to all -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_getRegisteredEnvironments( - uno_Environment *** pppEnvs, sal_Int32 * pnLen, uno_memAlloc memAlloc, - rtl_uString * pEnvDcp ) - SAL_THROW_EXTERN_C(); - -/** Creates an environment. The new environment is anonymous (NOT publicly registered/ accessible). - - @param ppEnv out parameter of environment; given environment will be released - @param pEnvDcp descriptor of environment - @param pContext context pointer (e.g., to distinguish java vm); set 0 if not needed -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_createEnvironment( - uno_Environment ** ppEnv, rtl_uString * pEnvDcp, void * pContext ) - SAL_THROW_EXTERN_C(); - -/** Dumps out environment information, i.e. registered interfaces. - - @param stream output stream (FILE *) - @param pEnv environment to be dumped - @param pFilter if not null, filters output -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_dumpEnvironment( - void * stream, uno_Environment * pEnv, const sal_Char * pFilter ) - SAL_THROW_EXTERN_C(); -/** Dumps out environment information, i.e. registered interfaces. - - @param stream output stream (FILE *) - @param pEnvDcp descritpro of environment to be dumped - @param pFilter if not null, filters output -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_dumpEnvironmentByName( - void * stream, rtl_uString * pEnvDcp, const sal_Char * pFilter ) - SAL_THROW_EXTERN_C(); - - - -/** Returns the current Environment. - In case no Environment has explicitly been entered, a purpose free - default environment gets returned (e.g. the "uno" or "gcc3" Environment). - - @param ppEnv inout parameter; a given environment will be released - @param pTypeName the optional type of the environment, falls back to "uno" - @since UDK 3.2.7 -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_getCurrentEnvironment(uno_Environment ** ppEnv, rtl_uString * pTypeName) - SAL_THROW_EXTERN_C(); - -/** Typedef for variable argument function. - */ -typedef void SAL_CALL uno_EnvCallee(va_list * pParam); - -/** Invoke the passed function in the given environment. - - @param pEnv the target environment - @param pCallee the function to call - @param pParam the parameter pointer passed to the function - @since UDK 3.2.7 - */ -CPPU_DLLPUBLIC void SAL_CALL uno_Environment_invoke_v(uno_Environment * pEnv, uno_EnvCallee * pCallee, va_list * pParam) - SAL_THROW_EXTERN_C(); - -/** Invoke the passed function in the given environment. - - @param pEnv the target environment - @param pCallee the function to call - @param ... the parameters passed to the function - @since UDK 3.2.7 -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_Environment_invoke (uno_Environment * pEnv, uno_EnvCallee * pCallee, ...) - SAL_THROW_EXTERN_C(); - -/** Enter an environment explicitly. - - @param pEnv the environment to enter; NULL leaves all environments - @since UDK 3.2.7 -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_Environment_enter(uno_Environment * pEnv) - SAL_THROW_EXTERN_C(); - -/** Check if a particular environment is currently valid, so - that objects of that environment might be called. - - @param pEnv the environment - @param pReason the reason, if it is not valid - @return 1 == valid, 0 == invalid - @since UDK 3.2.7 -*/ -CPPU_DLLPUBLIC int SAL_CALL uno_Environment_isValid(uno_Environment * pEnv, rtl_uString ** pReason) - SAL_THROW_EXTERN_C(); - -#ifdef __cplusplus -} -#endif - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/environment.hxx b/cppu/inc/uno/environment.hxx deleted file mode 100644 index 5fd8633c6e9f..000000000000 --- a/cppu/inc/uno/environment.hxx +++ /dev/null @@ -1,270 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef _UNO_ENVIRONMENT_HXX_ -#define _UNO_ENVIRONMENT_HXX_ - -#include <rtl/alloc.h> -#include <rtl/ustring.hxx> -#include <uno/environment.h> - -#include "uno/lbnames.h" - -/** */ //for docpp -namespace com -{ -/** */ //for docpp -namespace sun -{ -/** */ //for docpp -namespace star -{ -/** */ //for docpp -namespace uno -{ - -/** C++ wrapper for binary C uno_Environment. - - @see uno_Environment -*/ -class Environment -{ - /** binary C uno_Environment - */ - uno_Environment * _pEnv; - -public: - /** Returns the current Environment. - - @param typeName the optional type of the Environment, falls back to "uno" in case being empty, - respectively to current C++ Environment. - @since UDK 3.2.7 - */ - inline static Environment getCurrent(rtl::OUString const & typeName = rtl::OUString(RTL_CONSTASCII_USTRINGPARAM(CPPU_STRINGIFY(CPPU_ENV)))) SAL_THROW(()); - - /// @cond INTERNAL - // these are here to force memory de/allocation to sal lib. - inline static void * SAL_CALL operator new ( size_t nSize ) SAL_THROW(()) - { return ::rtl_allocateMemory( nSize ); } - inline static void SAL_CALL operator delete ( void * pMem ) SAL_THROW(()) - { ::rtl_freeMemory( pMem ); } - inline static void * SAL_CALL operator new ( size_t, void * pMem ) SAL_THROW(()) - { return pMem; } - inline static void SAL_CALL operator delete ( void *, void * ) SAL_THROW(()) - {} - /// @endcond - - /** Constructor: acquires given environment - - @param pEnv environment - */ - inline Environment( uno_Environment * pEnv = 0 ) SAL_THROW(()); - - /** Gets a specific environment. If the specified environment does not exist, then a default one - is created and registered. - - @param envDcp descriptor of the environment - @param pContext context pointer - */ - inline explicit Environment( rtl::OUString const & envDcp, void * pContext = NULL ) SAL_THROW(()); - - - /** Copy constructor: acquires given environment - - @param rEnv another environment - */ - inline Environment( const Environment & rEnv ) SAL_THROW(()); - - /** Destructor: releases a set environment. - */ - inline ~Environment() SAL_THROW(()); - - /** Sets a given environment, i.e. acquires given one and releases a set one. - - @param pEnv another environment - @return this environment - */ - inline Environment & SAL_CALL operator = ( uno_Environment * pEnv ) SAL_THROW(()); - /** Sets a given environment, i.e. acquires given one and releases a set one. - - @param rEnv another environment - @return this environment - */ - inline Environment & SAL_CALL operator = ( const Environment & rEnv ) SAL_THROW(()) - { return operator = ( rEnv._pEnv ); } - - /** Provides UNacquired pointer to the set C environment. - - @return UNacquired pointer to the C environment struct - */ - inline uno_Environment * SAL_CALL get() const SAL_THROW(()) - { return _pEnv; } - - /** Gets type name of set environment. - - @return type name of set environment - */ - inline ::rtl::OUString SAL_CALL getTypeName() const SAL_THROW(()) - { return _pEnv->pTypeName; } - - /** Gets free context pointer of set environment. - - @return free context pointer of set environment - */ - inline void * SAL_CALL getContext() const SAL_THROW(()) - { return _pEnv->pContext; } - - /** Tests if a environment is set. - - @return true, if a environment is set, false otherwise - */ - inline sal_Bool SAL_CALL is() const SAL_THROW(()) - { return (_pEnv != 0); } - - /** Releases a set environment. - */ - inline void SAL_CALL clear() SAL_THROW(()); - - /** Invoke the passed function in this environment. - - @param pCallee the function to call - @param pParam the parameter pointer to be passed to the function - @since UDK 3.2.7 - */ - inline void SAL_CALL invoke_v(uno_EnvCallee * pCallee, va_list * pParam) const SAL_THROW(()); - - /** Invoke the passed function in this environment. - - @param pCallee the function to call - @param ... the parameters to be passed to the function - @since UDK 3.2.7 - */ - inline void SAL_CALL invoke(uno_EnvCallee * pCallee, ...) const SAL_THROW(()); - - /** Enter this environment explicitly. - - @since UDK 3.2.7 - */ - inline void SAL_CALL enter() const SAL_THROW(()); - - /** Checks, if it is valid to currently call objects - belonging to this environment. - - @since UDK 3.2.7 - */ - inline int SAL_CALL isValid(rtl::OUString * pReason) const SAL_THROW(()); -}; -//__________________________________________________________________________________________________ -inline Environment::Environment( uno_Environment * pEnv ) SAL_THROW(()) - : _pEnv( pEnv ) -{ - if (_pEnv) - (*_pEnv->acquire)( _pEnv ); -} -//__________________________________________________________________________________________________ -inline Environment::Environment( rtl::OUString const & rEnvDcp, void * pContext ) SAL_THROW(()) - : _pEnv(NULL) -{ - uno_getEnvironment(&_pEnv, rEnvDcp.pData, pContext); -} -//__________________________________________________________________________________________________ -inline Environment::Environment( const Environment & rEnv ) SAL_THROW(()) - : _pEnv( rEnv._pEnv ) -{ - if (_pEnv) - (*_pEnv->acquire)( _pEnv ); -} -//__________________________________________________________________________________________________ -inline Environment::~Environment() SAL_THROW(()) -{ - if (_pEnv) - (*_pEnv->release)( _pEnv ); -} -//__________________________________________________________________________________________________ -inline void Environment::clear() SAL_THROW(()) -{ - if (_pEnv) - { - (*_pEnv->release)( _pEnv ); - _pEnv = 0; - } -} -//__________________________________________________________________________________________________ -inline Environment & Environment::operator = ( uno_Environment * pEnv ) SAL_THROW(()) -{ - if (pEnv != _pEnv) - { - if (pEnv) - (*pEnv->acquire)( pEnv ); - if (_pEnv) - (*_pEnv->release)( _pEnv ); - _pEnv = pEnv; - } - return *this; -} -//__________________________________________________________________________________________________ -inline void SAL_CALL Environment::invoke_v(uno_EnvCallee * pCallee, va_list * pParam) const SAL_THROW(()) -{ - if (_pEnv) - uno_Environment_invoke_v(_pEnv, pCallee, pParam); -} -//__________________________________________________________________________________________________ -inline void SAL_CALL Environment::invoke(uno_EnvCallee * pCallee, ...) const SAL_THROW(()) -{ - if (_pEnv) - { - va_list param; - - va_start(param, pCallee); - uno_Environment_invoke_v(_pEnv, pCallee, ¶m); - va_end(param); - } - -} -//__________________________________________________________________________________________________ -inline void SAL_CALL Environment::enter() const SAL_THROW(()) -{ - uno_Environment_enter(_pEnv); -} -//__________________________________________________________________________________________________ -inline int SAL_CALL Environment::isValid(rtl::OUString * pReason) const SAL_THROW(()) -{ - return uno_Environment_isValid(_pEnv, (rtl_uString **)pReason); -} -//__________________________________________________________________________________________________ -inline Environment Environment::getCurrent(rtl::OUString const & typeName) SAL_THROW(()) -{ - Environment environment; - - uno_Environment * pEnv = NULL; - uno_getCurrentEnvironment(&pEnv, typeName.pData); - environment = pEnv; - if (pEnv) - pEnv->release(pEnv); - - return environment; -} - -} -} -} -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/lbnames.h b/cppu/inc/uno/lbnames.h deleted file mode 100644 index dcae196ece60..000000000000 --- a/cppu/inc/uno/lbnames.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef _UNO_LBNAMES_H_ -#define _UNO_LBNAMES_H_ - -/* I assume "LB" means "Language Binding" */ - -#ifdef __cplusplus - -#ifdef CPPU_ENV - -#define CPPU_STRINGIFY_EX( x ) #x -#define CPPU_STRINGIFY( x ) CPPU_STRINGIFY_EX( x ) - -/** Name for C++ compiler/ platform, e.g. "gcc3", "msci" */ -#define CPPU_CURRENT_LANGUAGE_BINDING_NAME CPPU_STRINGIFY( CPPU_ENV ) - -#else - -#error "No supported C++ compiler environment." -provoking error here, because PP ignores #error - -#endif /* CPPU_ENV */ - -#endif /* __cplusplus */ - -/** Environment type name for binary C UNO. */ -#define UNO_LB_UNO "uno" -/** Environment type name for ANSI C compilers. */ -#define UNO_LB_C "c" -/** Environment type name for Java 1.3.1 compatible virtual machine. */ -#define UNO_LB_JAVA "java" -/** Environment type name for CLI (Common Language Infrastructure). */ -#define UNO_LB_CLI "cli" - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/mapping.h b/cppu/inc/uno/mapping.h deleted file mode 100644 index 179f41f869c9..000000000000 --- a/cppu/inc/uno/mapping.h +++ /dev/null @@ -1,214 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef _UNO_MAPPING_H_ -#define _UNO_MAPPING_H_ - -#include <cppu/cppudllapi.h> -#include <rtl/ustring.h> - - -#ifdef __cplusplus -extern "C" -{ -#endif - -struct _typelib_InterfaceTypeDescription; -struct _uno_Mapping; -struct _uno_Environment; - -/** - Function pointer declaration to acquire a UNO mapping. -*/ -typedef void (SAL_CALL * uno_AcquireMappingFunc)(struct _uno_Mapping *); - -/** - Function pointer declaration to release a UNO mapping. -*/ -typedef void (SAL_CALL * uno_ReleaseMappingFunc)(struct _uno_Mapping *); - -/** Function pointer declaration to map an interface from one environment to another. - - @param pMapping mapping - @param ppOut [inout] destination interface; existing interfaces are released - @param pInterface source interface - @param pInterfaceTypeDescr type description of the interface -*/ -typedef void (SAL_CALL * uno_MapInterfaceFunc)( - struct _uno_Mapping * pMapping, - void ** ppOut, void * pInterface, - struct _typelib_InterfaceTypeDescription * pInterfaceTypeDescr ); - - -#if defined( SAL_W32) -#pragma pack(push, 8) -#endif - -/** This is the binary specification of a mapping. -*/ -typedef struct _uno_Mapping -{ - /** Acquires mapping - */ - uno_AcquireMappingFunc acquire; - - /** Releases mapping. The last release may unload bridges. - */ - uno_ReleaseMappingFunc release; - - /** mapping function - */ - uno_MapInterfaceFunc mapInterface; -} uno_Mapping; - -#if defined( SAL_W32) -#pragma pack(pop) -#endif - -/** Gets an interface mapping from one environment to another. - - @param ppMapping [inout] mapping; existing mapping will be released - @param pFrom source environment - @param pTo destination environment - (interfaces resulting in mapInterface() call can be used - in this language environment) - @param pAddPurpose additional purpose of mapping (e.g., protocolling); defaults to 0 (none) -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_getMapping( - struct _uno_Mapping ** ppMapping, - struct _uno_Environment * pFrom, - struct _uno_Environment * pTo, - rtl_uString * pAddPurpose ) - SAL_THROW_EXTERN_C(); - -/** Callback function pointer declaration to get a mapping. - - @param ppMapping inout mapping - @param pFrom source environment - @param pTo destination environment - @param pAddPurpose additional purpose -*/ -typedef void (SAL_CALL * uno_getMappingFunc)( - struct _uno_Mapping ** ppMapping, - struct _uno_Environment * pFrom, - struct _uno_Environment * pTo, - rtl_uString * pAddPurpose ); - -/** Registers a callback being called each time a mapping is demanded. - - @param pCallback callback function -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_registerMappingCallback( - uno_getMappingFunc pCallback ) - SAL_THROW_EXTERN_C(); - -/** Revokes a mapping callback registration. - - @param pCallback callback function -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_revokeMappingCallback( - uno_getMappingFunc pCallback ) - SAL_THROW_EXTERN_C(); - -/** Function pointer declaration to free a mapping. - - @param pMapping mapping to be freed -*/ -typedef void (SAL_CALL * uno_freeMappingFunc)( struct _uno_Mapping * pMapping ); - -/** Registers a mapping. A mapping registers itself on first acquire and revokes itself on last - release. The given freeMapping function is called by the runtime to cleanup any resources. - - @param ppMapping inout mapping to be registered - @param freeMapping called by runtime to delete mapping - @param pFrom source environment - @param pTo destination environment - @param pAddPurpose additional purpose string; defaults to 0 -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_registerMapping( - struct _uno_Mapping ** ppMapping, uno_freeMappingFunc freeMapping, - struct _uno_Environment * pFrom, struct _uno_Environment * pTo, rtl_uString * pAddPurpose ) - SAL_THROW_EXTERN_C(); - -/** Revokes a mapping. A mapping registers itself on first acquire and revokes itself on last - release. - - @param pMapping mapping to be revoked -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_revokeMapping( - struct _uno_Mapping * pMapping ) - SAL_THROW_EXTERN_C(); - -/** Gets an interface mapping from one language environment to another by corresponding environment - type names. - - @param ppMapping [inout] mapping; existing mapping will be released - @param pFrom source environment type name - @param pTo destination environment type name - (interfaces resulting in mapInterface() call can be used - in this language environment) - @param pAddPurpose additional purpose of mapping (e.g., protocolling); defaults to 0 (none) -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_getMappingByName( - struct _uno_Mapping ** ppMapping, - rtl_uString * pFrom, - rtl_uString * pTo, - rtl_uString * pAddPurpose ) - SAL_THROW_EXTERN_C(); - -/* symbol exported by each language binding library */ -#define UNO_EXT_GETMAPPING "uno_ext_getMapping" - -/** Function pointer declaration to get a mapping from a loaded bridge. Bridges export a function - called uno_ext_getMapping() of this signature. - - @param[in,out] ppMapping mapping; existing mapping will be released - @param[in] pFrom source environment - @param[in] pTo destination environment -*/ -typedef void (SAL_CALL * uno_ext_getMappingFunc)( - struct _uno_Mapping ** ppMapping, - struct _uno_Environment * pFrom, - struct _uno_Environment * pTo ); - -#ifdef DISABLE_DYNLOADING -/* Static linking, this is the uno_ext_getMapping function in the C++/UNO bridge */ -void SAL_CALL CPPU_ENV_uno_ext_getMapping( - struct _uno_Mapping ** ppMapping, - struct _uno_Environment * pFrom, - struct _uno_Environment * pTo ) - SAL_THROW_EXTERN_C(); - -#ifdef SOLAR_JAVA -/* This is the uno_ext_getMapping function in the Java/UNO bridge */ -void SAL_CALL java_uno_ext_getMapping( - struct _uno_Mapping ** ppMapping, - struct _uno_Environment * pFrom, - struct _uno_Environment * pTo ) - SAL_THROW_EXTERN_C(); -#endif - -#endif - -#ifdef __cplusplus -} -#endif - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/mapping.hxx b/cppu/inc/uno/mapping.hxx deleted file mode 100644 index 13a042833ad6..000000000000 --- a/cppu/inc/uno/mapping.hxx +++ /dev/null @@ -1,346 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef _UNO_MAPPING_HXX_ -#define _UNO_MAPPING_HXX_ - -#include <cppu/macros.hxx> -#include <rtl/alloc.h> -#include <rtl/ustring.hxx> -#include <uno/mapping.h> -#include <com/sun/star/uno/Type.hxx> -#include <com/sun/star/uno/Reference.hxx> -#include "cppu/unotype.hxx" -#include "uno/environment.hxx" - -typedef struct _typelib_TypeDescription typelib_TypeDescription; -typedef struct _typelib_InterfaceTypeDescription typelib_InterfaceTypeDescription; -typedef struct _uno_Interface uno_Interface; - -namespace com -{ -namespace sun -{ -namespace star -{ -namespace uno -{ - -/** C++ wrapper for C uno_Mapping. - - @see uno_Mapping -*/ -class Mapping -{ - uno_Mapping * _pMapping; - -public: - // these are here to force memory de/allocation to sal lib. - /// @cond INTERNAL - inline static void * SAL_CALL operator new ( size_t nSize ) SAL_THROW(()) - { return ::rtl_allocateMemory( nSize ); } - inline static void SAL_CALL operator delete ( void * pMem ) SAL_THROW(()) - { ::rtl_freeMemory( pMem ); } - inline static void * SAL_CALL operator new ( size_t, void * pMem ) SAL_THROW(()) - { return pMem; } - inline static void SAL_CALL operator delete ( void *, void * ) SAL_THROW(()) - {} - /// @endcond - - /** Holds a mapping from the specified source to the specified destination by environment - type names. - - @param rFrom type name of source environment - @param rTo type name of destination environment - @param rAddPurpose additional purpose - */ - inline Mapping( - const ::rtl::OUString & rFrom, const ::rtl::OUString & rTo, - const ::rtl::OUString & rAddPurpose = ::rtl::OUString() ) - SAL_THROW(()); - - /** Holds a mapping from the specified source to the specified destination. - - @param pFrom source environment - @param pTo destination environment - @param rAddPurpose additional purpose - */ - inline Mapping( - uno_Environment * pFrom, uno_Environment * pTo, - const ::rtl::OUString & rAddPurpose = ::rtl::OUString() ) - SAL_THROW(()); - - /** Holds a mapping from the specified source to the specified destination - environment. - - @param rFrom source environment - @param rTo destination environment - @param rAddPurpose additional purpose - */ - inline Mapping(const Environment & rFrom, const Environment & rTo, - const ::rtl::OUString & rAddPurpose = ::rtl::OUString() ) - SAL_THROW(()); - - /** Constructor. - - @param pMapping another mapping - */ - inline Mapping( uno_Mapping * pMapping = 0 ) SAL_THROW(()); - - /** Copy constructor. - - @param rMapping another mapping - */ - inline Mapping( const Mapping & rMapping ) SAL_THROW(()); - - /** Destructor. - */ - inline ~Mapping() SAL_THROW(()); - - /** Sets a given mapping. - - @param pMapping another mapping - @return this mapping - */ - inline Mapping & SAL_CALL operator = ( uno_Mapping * pMapping ) SAL_THROW(()); - /** Sets a given mapping. - - @param rMapping another mapping - @return this mapping - */ - inline Mapping & SAL_CALL operator = ( const Mapping & rMapping ) SAL_THROW(()) - { return operator = ( rMapping._pMapping ); } - - /** Provides a pointer to the C mapping. The returned mapping is NOT acquired! - - @return UNacquired C mapping - */ - inline uno_Mapping * SAL_CALL get() const SAL_THROW(()) - { return _pMapping; } - - /** Tests if a mapping is set. - - @return true if a mapping is set - */ - inline sal_Bool SAL_CALL is() const SAL_THROW(()) - { return (_pMapping != 0); } - - /** Releases a set mapping. - */ - inline void SAL_CALL clear() SAL_THROW(()); - - /** Maps an interface from one environment to another. - - @param pInterface source interface - @param pTypeDescr type description of interface - @return mapped interface - */ - inline void * SAL_CALL mapInterface( void * pInterface, typelib_InterfaceTypeDescription * pTypeDescr ) const SAL_THROW(()); - /** Maps an interface from one environment to another. - - @param pInterface source interface - @param pTypeDescr type description of interface - @return mapped interface - */ - inline void * SAL_CALL mapInterface( void * pInterface, typelib_TypeDescription * pTypeDescr ) const SAL_THROW(()) - { return mapInterface( pInterface, (typelib_InterfaceTypeDescription *)pTypeDescr ); } - - /** Maps an interface from one environment to another. - - @param pInterface source interface - @param rType type of interface - @return mapped interface - */ - inline void * SAL_CALL mapInterface( - void * pInterface, const ::com::sun::star::uno::Type & rType ) const SAL_THROW(()); - - /** Maps an interface from one environment to another. - - @param ppOut inout mapped interface - @param pInterface source interface - @param pTypeDescr type description of interface - */ - inline void SAL_CALL mapInterface( void ** ppOut, void * pInterface, typelib_InterfaceTypeDescription * pTypeDescr ) const SAL_THROW(()) - { (*_pMapping->mapInterface)( _pMapping, ppOut, pInterface, pTypeDescr ); } - /** Maps an interface from one environment to another. - - @param ppOut inout mapped interface - @param pInterface source interface - @param pTypeDescr type description of interface - */ - inline void SAL_CALL mapInterface( void ** ppOut, void * pInterface, typelib_TypeDescription * pTypeDescr ) const SAL_THROW(()) - { (*_pMapping->mapInterface)( _pMapping, ppOut, pInterface, (typelib_InterfaceTypeDescription *)pTypeDescr ); } - - /** Maps an interface from one environment to another. - - @param ppOut inout mapped interface - @param pInterface source interface - @param rType type of interface to be mapped - */ - inline void SAL_CALL mapInterface( void ** ppOut, void * pInterface, const ::com::sun::star::uno::Type & rType ) const SAL_THROW(()); -}; -//__________________________________________________________________________________________________ -inline Mapping::Mapping( - const ::rtl::OUString & rFrom, const ::rtl::OUString & rTo, const ::rtl::OUString & rAddPurpose ) - SAL_THROW(()) - : _pMapping( 0 ) -{ - uno_getMappingByName( &_pMapping, rFrom.pData, rTo.pData, rAddPurpose.pData ); -} -//__________________________________________________________________________________________________ -inline Mapping::Mapping( - uno_Environment * pFrom, uno_Environment * pTo, const ::rtl::OUString & rAddPurpose ) - SAL_THROW(()) - : _pMapping( 0 ) -{ - uno_getMapping( &_pMapping, pFrom, pTo, rAddPurpose.pData ); -} -//__________________________________________________________________________________________________ -inline Mapping::Mapping( - const Environment & rFrom, const Environment & rTo, const ::rtl::OUString & rAddPurpose ) - SAL_THROW(()) - : _pMapping(0) -{ - uno_getMapping( &_pMapping, rFrom.get(), rTo.get(), rAddPurpose.pData ); -} -//__________________________________________________________________________________________________ -inline Mapping::Mapping( uno_Mapping * pMapping ) SAL_THROW(()) - : _pMapping( pMapping ) -{ - if (_pMapping) - (*_pMapping->acquire)( _pMapping ); -} -//__________________________________________________________________________________________________ -inline Mapping::Mapping( const Mapping & rMapping ) SAL_THROW(()) - : _pMapping( rMapping._pMapping ) -{ - if (_pMapping) - (*_pMapping->acquire)( _pMapping ); -} -//__________________________________________________________________________________________________ -inline Mapping::~Mapping() SAL_THROW(()) -{ - if (_pMapping) - (*_pMapping->release)( _pMapping ); -} -//__________________________________________________________________________________________________ -inline void Mapping::clear() SAL_THROW(()) -{ - if (_pMapping) - { - (*_pMapping->release)( _pMapping ); - _pMapping = 0; - } -} -//__________________________________________________________________________________________________ -inline Mapping & Mapping::operator = ( uno_Mapping * pMapping ) SAL_THROW(()) -{ - if (pMapping) - (*pMapping->acquire)( pMapping ); - if (_pMapping) - (*_pMapping->release)( _pMapping ); - _pMapping = pMapping; - return *this; -} -//__________________________________________________________________________________________________ -inline void Mapping::mapInterface( - void ** ppOut, void * pInterface, const ::com::sun::star::uno::Type & rType ) const - SAL_THROW(()) -{ - typelib_TypeDescription * pTD = 0; - TYPELIB_DANGER_GET( &pTD, rType.getTypeLibType() ); - if (pTD) - { - (*_pMapping->mapInterface)( _pMapping, ppOut, pInterface, (typelib_InterfaceTypeDescription *)pTD ); - TYPELIB_DANGER_RELEASE( pTD ); - } -} -//__________________________________________________________________________________________________ -inline void * Mapping::mapInterface( - void * pInterface, typelib_InterfaceTypeDescription * pTypeDescr ) const - SAL_THROW(()) -{ - void * pOut = 0; - (*_pMapping->mapInterface)( _pMapping, &pOut, pInterface, pTypeDescr ); - return pOut; -} -//__________________________________________________________________________________________________ -inline void * Mapping::mapInterface( - void * pInterface, const ::com::sun::star::uno::Type & rType ) const - SAL_THROW(()) -{ - void * pOut = 0; - mapInterface( &pOut, pInterface, rType ); - return pOut; -} - -/** Deprecated. This function DOES NOT WORK with Purpose Environments - (http://wiki.services.openoffice.org/wiki/Uno/Binary/Spec/Purpose Environments) - - Maps an binary C UNO interface to be used in the currently used compiler environment. - - @tparam C interface type - @param ppRet inout returned interface pointer - @param pUnoI binary C UNO interface - @return true if successful, false otherwise - - @deprecated -*/ -template< class C > -inline sal_Bool mapToCpp( Reference< C > * ppRet, uno_Interface * pUnoI ) SAL_THROW(()) -{ - Mapping aMapping( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO) ), - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ) ); - OSL_ASSERT( aMapping.is() ); - aMapping.mapInterface( - (void **)ppRet, pUnoI, ::cppu::getTypeFavourUnsigned( ppRet ) ); - return (0 != *ppRet); -} -/** Deprecated. This function DOES NOT WORK with Purpose Environments - (http://wiki.services.openoffice.org/wiki/Uno/Binary/Spec/Purpose Environments) - - Maps an UNO interface of the currently used compiler environment to binary C UNO. - - @tparam C interface type - @param ppRet inout returned interface pointer - @param x interface reference - @return true if successful, false otherwise - - @deprecated -*/ -template< class C > -inline sal_Bool mapToUno( uno_Interface ** ppRet, const Reference< C > & x ) SAL_THROW(()) -{ - Mapping aMapping( - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(CPPU_CURRENT_LANGUAGE_BINDING_NAME) ), - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(UNO_LB_UNO) ) ); - OSL_ASSERT( aMapping.is() ); - aMapping.mapInterface( - (void **)ppRet, x.get(), ::cppu::getTypeFavourUnsigned( &x ) ); - return (0 != *ppRet); -} - -} -} -} -} - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/sequence2.h b/cppu/inc/uno/sequence2.h deleted file mode 100644 index 304eefc9f746..000000000000 --- a/cppu/inc/uno/sequence2.h +++ /dev/null @@ -1,181 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ -#ifndef _UNO_SEQUENCE2_H_ -#define _UNO_SEQUENCE2_H_ - -#include <cppu/cppudllapi.h> -#include <uno/data.h> - -#ifdef __cplusplus -extern "C" -{ -#endif - -struct _typelib_TypeDescriptionReference; -struct _typelib_TypeDescription; -typedef sal_Sequence uno_Sequence; - -/** Assigns a sequence. - - @param ppDest destinstaion sequence - @param pSource source sequence - @param pTypeDescr type description of the sequence and NOT of an element - @param release function called each time an interface needs to - be released; defaults (0) to uno -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_sequence_assign( - uno_Sequence ** ppDest, - uno_Sequence * pSource, - struct _typelib_TypeDescription * pTypeDescr, - uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); -/** Assigns a sequence. - - @param ppDest destinstaion sequence - @param pSource source sequence - @param pType type of the sequence and NOT of an element - @param release function called each time an interface needs to - be released; defaults (0) to uno -*/ -CPPU_DLLPUBLIC void SAL_CALL uno_type_sequence_assign( - uno_Sequence ** ppDest, - uno_Sequence * pSource, - struct _typelib_TypeDescriptionReference * pType, - uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); - -/** Constructs a new sequence with given elements. - - @param ppSequence out parameter sequence; - 0 if memory allocation has failed - @param pTypeDescr type description of the sequence and NOT of an - element - @param pElements if 0, then all elements are default constructed - @param len number of elements - @param acquire function called each time an interface needs to - be acquired; defaults (0) to uno - @return false, if memoray allocation has failed -*/ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_sequence_construct( - uno_Sequence ** ppSequence, - struct _typelib_TypeDescription * pTypeDescr, - void * pElements, sal_Int32 len, - uno_AcquireFunc acquire ) - SAL_THROW_EXTERN_C(); -/** Constructs a new sequence with given elements. - - @param ppSequence out parameter sequence; - 0 if memory allocation has failed - @param pType type of the sequence and NOT of an element - @param pElements if 0, then all elements are default constructed - @param len number of elements - @param acquire function called each time an interface needs to - be acquired; defaults (0) to uno - @return false, if memoray allocation has failed -*/ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_type_sequence_construct( - uno_Sequence ** ppSequence, - struct _typelib_TypeDescriptionReference * pType, - void * pElements, sal_Int32 len, - uno_AcquireFunc acquire ) - SAL_THROW_EXTERN_C(); - -/** Assures that the reference count of the given sequence is one. - Otherwise a new copy of the sequence is created with a reference count - of one. - - @param ppSequence inout sequence - @param pTypeDescr type description of sequence - @param acquire function called each time an interface needs to - be acquired; defaults (0) to uno - @param release function called each time an interface needs to - be released; defaults (0) to uno - @return false, if memoray allocation has failed -*/ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_sequence_reference2One( - uno_Sequence ** ppSequence, - struct _typelib_TypeDescription * pTypeDescr, - uno_AcquireFunc acquire, - uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); -/** Assures that the reference count of the given sequence is one. - Otherwise a new copy of the sequence is created with a reference count - of one. - - @param ppSequence inout sequence - @param pType type of sequence - @param acquire function called each time an interface needs to - be acquired; defaults (0) to uno - @param release function called each time an interface needs to - be released; defaults (0) to uno - @return false, if memoray allocation has failed -*/ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_type_sequence_reference2One( - uno_Sequence ** ppSequence, - struct _typelib_TypeDescriptionReference * pType, - uno_AcquireFunc acquire, - uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); - -/** Reallocates length of a sequence. This truncates a sequence or enlarges - it default constructing appended elements. - - @param ppSequence inout sequence - @param pTypeDescr type description of sequence - @param nSize new size of sequence - @param acquire function called each time an interface needs to - be acquired; defaults (0) to uno - @param release function called each time an interface needs to - be released; defaults (0) to uno - @return false, if memoray allocation has failed -*/ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_sequence_realloc( - uno_Sequence ** ppSequence, - struct _typelib_TypeDescription * pTypeDescr, - sal_Int32 nSize, - uno_AcquireFunc acquire, - uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); -/** Reallocates length of a sequence. This truncates a sequence or enlarges - it default constructing appended elements. - - @param ppSequence inout sequence - @param pType type of sequence - @param nSize new size of sequence - @param acquire function called each time an interface needs to - be acquired; defaults (0) to uno - @param release function called each time an interface needs to - be released; defaults (0) to uno - @return false, if memoray allocation has failed -*/ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_type_sequence_realloc( - uno_Sequence ** ppSequence, - struct _typelib_TypeDescriptionReference * pType, - sal_Int32 nSize, - uno_AcquireFunc acquire, - uno_ReleaseFunc release ) - SAL_THROW_EXTERN_C(); - -#ifdef __cplusplus -} -#endif - -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cppu/inc/uno/threadpool.h b/cppu/inc/uno/threadpool.h deleted file mode 100644 index 6e880e55b144..000000000000 --- a/cppu/inc/uno/threadpool.h +++ /dev/null @@ -1,185 +0,0 @@ -/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ -/* - * This file is part of the LibreOffice project. - * - * This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this - * file, You can obtain one at http://mozilla.org/MPL/2.0/. - * - * This file incorporates work covered by the following license notice: - * - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed - * with this work for additional information regarding copyright - * ownership. The ASF licenses this file to you under the Apache - * License, Version 2.0 (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.apache.org/licenses/LICENSE-2.0 . - */ - -#include <cppu/cppudllapi.h> -#include <rtl/byteseq.h> - -#ifdef __cplusplus -extern "C" { -#endif - -/*** - * Thread identifier administration. - ***/ -/** - Establishs an association between the current thread and the given thread identifier. - There can be only one association at a time. The association must be broken by - uno_releaseIdFromCurrentThread(). - This method is in general called by a bridge, that wants to bind a remote threadId - to a new thread. - - @param pThreadId a byte sequence, that contains the identifier of the current thread. - @return true, when the identifier was registered. - false, when the thread has already an identifier. The identifier was not - altered. ( This is in general a bug ). - - @see uno_releaseIdFromCurrentThread() - */ -CPPU_DLLPUBLIC sal_Bool SAL_CALL uno_bindIdToCurrentThread( sal_Sequence *pThreadId ) - SAL_THROW_EXTERN_C(); - - -/** - Get the identifier of the current thread. - If no id has been bound for the thread before, a new one is generated and bound - to the thread. - For each call to uno_getIdOfCurrentThread(), a call to uno_releaseIdFromCurrentThread() - must be done. - - @param ppThreadId [out] Contains the (acquired) ThreadId. - @see uno_releaseIdFromCurrentThread() - */ -CPPU_DLLPUBLIC void SAL_CALL uno_getIdOfCurrentThread( sal_Sequence **ppThreadId ) - SAL_THROW_EXTERN_C(); - - -/** - If the internal refcount drops to zero, the association between threadId and - thread is broken. - */ -CPPU_DLLPUBLIC void SAL_CALL uno_releaseIdFromCurrentThread() - SAL_THROW_EXTERN_C(); - - -struct _uno_ThreadPool; -typedef struct _uno_ThreadPool * uno_ThreadPool; - -/** - Creates a threadpool handle. Typically each remote bridge instances creates one - handle. - */ -CPPU_DLLPUBLIC uno_ThreadPool SAL_CALL -uno_threadpool_create() SAL_THROW_EXTERN_C(); - - -/** - Makes the current thread known to the threadpool. This function must be - called, BEFORE uno_threadpool_enter() is called and BEFORE a job for this - thread is put into the threadpool (avoid a race between this thread and - an incoming request/reply). - For every call to uno_threadpool_attach, a corrosponding call to - uno_threadpool_detach must be done. - - @param hPool The bridge threadpool handle previously created by uno_threadpool_create. - -*/ -CPPU_DLLPUBLIC void SAL_CALL -uno_threadpool_attach( uno_ThreadPool hPool ) SAL_THROW_EXTERN_C(); - -/** - This method is called to wait for a reply of a previously sent request. This is a - blocking method. uno_threadpool_attach() must have been called before. - - @param hPool the handle that was previously created by uno_threadpool_create(). - @param ppJob [out] the pointer, that was given by uno_threadpool_putJob - 0, when uno_threadpool_dispose() was the reason to fall off from threadpool. - @see uno_threadpool_dispose() - **/ -CPPU_DLLPUBLIC void SAL_CALL -uno_threadpool_enter( uno_ThreadPool hPool , void **ppJob ) - SAL_THROW_EXTERN_C(); - -/** - Detaches the current thread from the threadpool. Must be called for - every call to uno_threadpool_attach. - @param hPool the handle that was previously created by uno_threadpool_create(). -*/ -CPPU_DLLPUBLIC void SAL_CALL -uno_threadpool_detach( uno_ThreadPool hPool ) SAL_THROW_EXTERN_C(); - -/** - Puts a job into the pool. A job may eiter be a request or a reply - (replies have a 0 in the doRequest parameter). This function is non-blocking. - - A request may either be synchronous or asynchronous. - If the request is synchronous, it is first looked up, - if there exists a handle with the given - identifier. If this is the case, the thread is woken up and the doRequest - function is called with the given pJob. If no handle exists, - a new thread is created and the given threadId is bound to the new thread. - - If the request is asynchronous, it is put into the queue of asynchronous - requests for the current threadid. The requests are always executed in a new - thread, even if the thread with the given id is waiting in the pool. No id is bound - to the newly created thread. The responsibilty is left to the bridge ( if it - wishes to bind a name). - - If pJob is a reply, there MUST be a thread with the given threadId waiting - for this reply. - - @param hPool the handle that was previously created by uno_threadpool_create(). - @param pThreadId The Id of the thread, that initialized this request. (In general a - remote threadid). - @param pJob The argument, that doRequest will get or that will be returned by - uno_threadpool_enter(). - @param doRequest The function, that shall be called to execute the request. - 0 if pJob is a reply. - @param bIsOneway True, if the request is asynchrons. False, if it is synchronous. - Set to sal_False, if pJob is a reply. - */ -CPPU_DLLPUBLIC void SAL_CALL -uno_threadpool_putJob( - uno_ThreadPool hPool, - sal_Sequence *pThreadId, - void *pJob, - void ( SAL_CALL * doRequest ) ( void *pThreadSpecificData ), - sal_Bool bIsOneway ) SAL_THROW_EXTERN_C(); - -/** - All threads, that are waiting on the hPool handle, are forced out of the pool. - The threads waiting with uno_threadpool_enter() will return with *ppJob == 0 - - Later calls to uno_threadpool_enter() using the hPool handle will also - return immeadiatly with *ppJob == 0. - - @param hPool The handle to be disposed. - - This function is called i.e. by a bridge, that is forced to dispose itself. - */ -CPPU_DLLPUBLIC void SAL_CALL -uno_threadpool_dispose( uno_ThreadPool hPool ) SAL_THROW_EXTERN_C(); - - -/** Releases the previously with uno_threadpool_create() created handle. - The handle thus becomes invalid. It is an error to use the handle after - uno_threadpool_destroy(). - - A call to uno_threadpool_destroy can synchronously join on spawned worker - threads, so this function must never be called from such a worker thread. - - @see uno_threadpool_create() - */ -CPPU_DLLPUBLIC void SAL_CALL -uno_threadpool_destroy( uno_ThreadPool hPool ) SAL_THROW_EXTERN_C(); - -#ifdef __cplusplus -} -#endif - -/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |