26#include <com/sun/star/uno/XInterface.hpp>
27#include <rtl/ustring.h>
29#include <typelib/typedescription.h>
30#include <uno/dispatcher.h>
31#include <uno/environment.h>
32#include <uno/mapping.h>
52 uno_Mapping * pMapping,
void ** ppUnoI,
void * pCppI,
53 typelib_InterfaceTypeDescription * pTypeDescr)
55 assert(ppUnoI && pTypeDescr);
58 (*
static_cast< uno_Interface *
>( *ppUnoI )->release)(
59 static_cast< uno_Interface *
>( *ppUnoI ) );
68 rtl_uString * pOId =
nullptr;
69 (*pBridge->
pCppEnv->getObjectIdentifier)(
70 pBridge->
pCppEnv, &pOId, pCppI );
74 (*pBridge->
pUnoEnv->getRegisteredInterface)(
75 pBridge->
pUnoEnv, ppUnoI, pOId, pTypeDescr );
80 uno_Interface * pSurrogate
83 static_cast< ::com::sun::star::uno::XInterface *
>( pCppI ),
87 (*pBridge->
pUnoEnv->registerProxyInterface)(
88 pBridge->
pUnoEnv,
reinterpret_cast< void **
>( &pSurrogate ),
94 ::rtl_uString_release( pOId );
98 uno_Mapping * pMapping,
void ** ppCppI,
void * pUnoI,
99 typelib_InterfaceTypeDescription * pTypeDescr)
101 assert(ppCppI && pTypeDescr);
104 static_cast< ::com::sun::star::uno::XInterface *
>( *ppCppI )->
114 rtl_uString * pOId =
nullptr;
115 (*pBridge->
pUnoEnv->getObjectIdentifier)(
116 pBridge->
pUnoEnv, &pOId, pUnoI );
120 (*pBridge->
pCppEnv->getRegisteredInterface)(
121 pBridge->
pCppEnv, ppCppI, pOId, pTypeDescr );
126 com::sun::star::uno::XInterface * pProxy
128 pBridge,
static_cast< uno_Interface *
>( pUnoI ),
132 (*pBridge->
pCppEnv->registerProxyInterface)(
133 pBridge->
pCppEnv,
reinterpret_cast< void **
>( &pProxy ),
139 ::rtl_uString_release( pOId );
143 uno_ExtEnvironment * pCppEnv, uno_ExtEnvironment * pUnoEnv,
159 ::uno_registerMapping(
166 ::uno_registerMapping(
181 uno_ExtEnvironment * pCppEnv_, uno_ExtEnvironment * pUnoEnv_,
182 bool bExportCpp2Uno_)
184 , pCppEnv( pCppEnv_ )
185 , pUnoEnv( pUnoEnv_ )
186 , bExportCpp2Uno( bExportCpp2Uno_ )
Holding environments and mappings.
friend void uno2cppMapping(uno_Mapping *pMapping, void **ppCppI, void *pUnoI, typelib_InterfaceTypeDescription *pTypeDescr)
uno_ExtEnvironment * pCppEnv
friend void acquireMapping(uno_Mapping *pMapping)
Bridge(Bridge const &)=delete
friend void cpp2unoMapping(uno_Mapping *pMapping, void **ppUnoI, void *pCppI, typelib_InterfaceTypeDescription *pTypeDescr)
static uno_Mapping * createMapping(uno_ExtEnvironment *pCppEnv, uno_ExtEnvironment *pUnoEnv, bool bExportCpp2Uno)
std::atomic< std::size_t > nRef
friend void freeMapping(uno_Mapping *pMapping)
friend void releaseMapping(uno_Mapping *pMapping)
uno_ExtEnvironment * pUnoEnv
static com::sun::star::uno::XInterface * create(Bridge *pBridge, uno_Interface *pUnoI, typelib_InterfaceTypeDescription *pTypeDescr, OUString const &rOId)
static UnoInterfaceProxy * create(Bridge *pBridge, com::sun::star::uno::XInterface *pCppI, typelib_InterfaceTypeDescription *pTypeDescr, OUString const &rOId)
struct _uno_Mapping uno_Mapping
void cpp2unoMapping(uno_Mapping *pMapping, void **ppUnoI, void *pCppI, typelib_InterfaceTypeDescription *pTypeDescr)
void freeCppInterfaceProxy(uno_ExtEnvironment *pEnv, void *pInterface)
void acquireMapping(uno_Mapping *pMapping)
void freeMapping(uno_Mapping *pMapping)
void freeUnoInterfaceProxy(uno_ExtEnvironment *pEnv, void *pProxy)
void uno2cppMapping(uno_Mapping *pMapping, void **ppCppI, void *pUnoI, typelib_InterfaceTypeDescription *pTypeDescr)
void releaseMapping(uno_Mapping *pMapping)