1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: pyuno.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #include "pyuno_impl.hxx"
33 #include <rtl/strbuf.hxx>
34 #include <rtl/ustrbuf.hxx>
36 #include <osl/thread.h>
38 #include <com/sun/star/lang/XServiceInfo.hpp>
39 #include <com/sun/star/lang/XTypeProvider.hpp>
40 #include <com/sun/star/beans/XPropertySet.hpp>
41 #include <com/sun/star/beans/XMaterialHolder.hpp>
43 #define TO_ASCII(x) OUStringToOString( x , RTL_TEXTENCODING_ASCII_US).getStr()
45 using rtl::OStringBuffer
;
46 using rtl::OUStringBuffer
;
47 using rtl::OUStringToOString
;
49 using com::sun::star::uno::Sequence
;
50 using com::sun::star::uno::Reference
;
51 using com::sun::star::uno::XInterface
;
52 using com::sun::star::uno::Any
;
53 using com::sun::star::uno::makeAny
;
54 using com::sun::star::uno::UNO_QUERY
;
55 using com::sun::star::uno::Type
;
56 using com::sun::star::uno::TypeClass
;
57 using com::sun::star::uno::RuntimeException
;
58 using com::sun::star::uno::Exception
;
59 using com::sun::star::uno::XComponentContext
;
60 using com::sun::star::lang::XSingleServiceFactory
;
61 using com::sun::star::lang::XServiceInfo
;
62 using com::sun::star::lang::XTypeProvider
;
63 using com::sun::star::script::XTypeConverter
;
64 using com::sun::star::script::XInvocation2
;
65 using com::sun::star::beans::XMaterialHolder
;
70 PyObject
*PyUNO_str( PyObject
* self
);
72 void PyUNO_del (PyObject
* self
)
74 PyUNO
* me
= reinterpret_cast< PyUNO
* > (self
);
76 PyThreadDetach antiguard
;
84 OUString
val2str( const void * pVal
, typelib_TypeDescriptionReference
* pTypeRef
, sal_Int32 mode
) SAL_THROW( () )
87 if (pTypeRef
->eTypeClass
== typelib_TypeClass_VOID
)
88 return OUString( RTL_CONSTASCII_USTRINGPARAM("void") );
90 OUStringBuffer
buf( 64 );
91 buf
.append( (sal_Unicode
)'(' );
92 buf
.append( pTypeRef
->pTypeName
);
93 buf
.append( (sal_Unicode
)')' );
95 switch (pTypeRef
->eTypeClass
)
97 case typelib_TypeClass_INTERFACE
:
99 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") );
100 buf
.append( reinterpret_cast< sal_IntPtr
>(*(void **)pVal
), 16 );
101 if( VAL2STR_MODE_DEEP
== mode
)
103 buf
.appendAscii( "{" ); Reference
< XInterface
> r
= *( Reference
< XInterface
> * ) pVal
;
104 Reference
< XServiceInfo
> serviceInfo( r
, UNO_QUERY
);
105 Reference
< XTypeProvider
> typeProvider(r
,UNO_QUERY
);
106 if( serviceInfo
.is() )
108 buf
.appendAscii("implementationName=" );
109 buf
.append(serviceInfo
->getImplementationName() );
110 buf
.appendAscii(", supportedServices={" );
111 Sequence
< OUString
> seq
= serviceInfo
->getSupportedServiceNames();
112 for( int i
= 0 ; i
< seq
.getLength() ; i
++ )
114 buf
.append( seq
[i
] );
115 if( i
+1 != seq
.getLength() )
116 buf
.appendAscii( "," );
118 buf
.appendAscii("}");
121 if( typeProvider
.is() )
123 buf
.appendAscii(", supportedInterfaces={" );
124 Sequence
< Type
> seq (typeProvider
->getTypes());
125 for( int i
= 0 ; i
< seq
.getLength() ; i
++ )
127 buf
.append(seq
[i
].getTypeName());
128 if( i
+1 != seq
.getLength() )
129 buf
.appendAscii( "," );
131 buf
.appendAscii("}");
133 buf
.appendAscii( "}" );
138 case typelib_TypeClass_UNION
:
140 // typelib_TypeDescription * pTypeDescr = 0;
141 // TYPELIB_DANGER_GET( &pTypeDescr, pTypeRef );
142 // buf.appendAscii( RTL_CONSTASCII_STRINGPARAM("{ ") );
143 // buf.append( val2str( (char *)pVal + ((typelib_UnionTypeDescription *)pTypeDescr)->nValueOffset,
144 // union_getSetType( pVal, pTypeDescr ) ) );
145 // buf.appendAscii( RTL_CONSTASCII_STRINGPARAM(" }") );
146 // TYPELIB_DANGER_RELEASE( pTypeDescr );
149 case typelib_TypeClass_STRUCT
:
150 case typelib_TypeClass_EXCEPTION
:
152 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("{ ") );
153 typelib_TypeDescription
* pTypeDescr
= 0;
154 TYPELIB_DANGER_GET( &pTypeDescr
, pTypeRef
);
155 OSL_ASSERT( pTypeDescr
);
157 typelib_CompoundTypeDescription
* pCompType
= (typelib_CompoundTypeDescription
*)pTypeDescr
;
158 sal_Int32 nDescr
= pCompType
->nMembers
;
160 if (pCompType
->pBaseTypeDescription
)
162 buf
.append( val2str( pVal
, ((typelib_TypeDescription
*)pCompType
->pBaseTypeDescription
)->pWeakRef
,mode
) );
164 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(", ") );
167 typelib_TypeDescriptionReference
** ppTypeRefs
= pCompType
->ppTypeRefs
;
168 sal_Int32
* pMemberOffsets
= pCompType
->pMemberOffsets
;
169 rtl_uString
** ppMemberNames
= pCompType
->ppMemberNames
;
171 for ( sal_Int32 nPos
= 0; nPos
< nDescr
; ++nPos
)
173 buf
.append( ppMemberNames
[nPos
] );
174 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(" = ") );
175 typelib_TypeDescription
* pMemberType
= 0;
176 TYPELIB_DANGER_GET( &pMemberType
, ppTypeRefs
[nPos
] );
177 buf
.append( val2str( (char *)pVal
+ pMemberOffsets
[nPos
], pMemberType
->pWeakRef
, mode
) );
178 TYPELIB_DANGER_RELEASE( pMemberType
);
179 if (nPos
< (nDescr
-1))
180 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(", ") );
183 TYPELIB_DANGER_RELEASE( pTypeDescr
);
185 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(" }") );
188 case typelib_TypeClass_SEQUENCE
:
190 typelib_TypeDescription
* pTypeDescr
= 0;
191 TYPELIB_DANGER_GET( &pTypeDescr
, pTypeRef
);
193 uno_Sequence
* pSequence
= *(uno_Sequence
**)pVal
;
194 typelib_TypeDescription
* pElementTypeDescr
= 0;
195 TYPELIB_DANGER_GET( &pElementTypeDescr
, ((typelib_IndirectTypeDescription
*)pTypeDescr
)->pType
);
197 sal_Int32 nElementSize
= pElementTypeDescr
->nSize
;
198 sal_Int32 nElements
= pSequence
->nElements
;
202 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("{ ") );
203 char * pElements
= pSequence
->elements
;
204 for ( sal_Int32 nPos
= 0; nPos
< nElements
; ++nPos
)
206 buf
.append( val2str( pElements
+ (nElementSize
* nPos
), pElementTypeDescr
->pWeakRef
, mode
) );
207 if (nPos
< (nElements
-1))
208 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(", ") );
210 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(" }") );
214 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("{}") );
216 TYPELIB_DANGER_RELEASE( pElementTypeDescr
);
217 TYPELIB_DANGER_RELEASE( pTypeDescr
);
220 case typelib_TypeClass_ANY
:
221 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("{ ") );
222 buf
.append( val2str( ((uno_Any
*)pVal
)->pData
,
223 ((uno_Any
*)pVal
)->pType
,
225 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM(" }") );
227 case typelib_TypeClass_TYPE
:
228 buf
.append( (*(typelib_TypeDescriptionReference
**)pVal
)->pTypeName
);
230 case typelib_TypeClass_STRING
:
231 buf
.append( (sal_Unicode
)'\"' );
232 buf
.append( *(rtl_uString
**)pVal
);
233 buf
.append( (sal_Unicode
)'\"' );
235 case typelib_TypeClass_ENUM
:
237 typelib_TypeDescription
* pTypeDescr
= 0;
238 TYPELIB_DANGER_GET( &pTypeDescr
, pTypeRef
);
240 sal_Int32
* pValues
= ((typelib_EnumTypeDescription
*)pTypeDescr
)->pEnumValues
;
241 sal_Int32 nPos
= ((typelib_EnumTypeDescription
*)pTypeDescr
)->nEnumValues
;
244 if (pValues
[nPos
] == *(int *)pVal
)
248 buf
.append( ((typelib_EnumTypeDescription
*)pTypeDescr
)->ppEnumNames
[nPos
] );
250 buf
.append( (sal_Unicode
)'?' );
252 TYPELIB_DANGER_RELEASE( pTypeDescr
);
255 case typelib_TypeClass_BOOLEAN
:
256 if (*(sal_Bool
*)pVal
)
257 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("true") );
259 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("false") );
261 case typelib_TypeClass_CHAR
:
262 buf
.append( (sal_Unicode
)'\'' );
263 buf
.append( *(sal_Unicode
*)pVal
);
264 buf
.append( (sal_Unicode
)'\'' );
266 case typelib_TypeClass_FLOAT
:
267 buf
.append( *(float *)pVal
);
269 case typelib_TypeClass_DOUBLE
:
270 buf
.append( *(double *)pVal
);
272 case typelib_TypeClass_BYTE
:
273 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") );
274 buf
.append( (sal_Int32
)*(sal_Int8
*)pVal
, 16 );
276 case typelib_TypeClass_SHORT
:
277 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") );
278 buf
.append( (sal_Int32
)*(sal_Int16
*)pVal
, 16 );
280 case typelib_TypeClass_UNSIGNED_SHORT
:
281 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") );
282 buf
.append( (sal_Int32
)*(sal_uInt16
*)pVal
, 16 );
284 case typelib_TypeClass_LONG
:
285 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") );
286 buf
.append( *(sal_Int32
*)pVal
, 16 );
288 case typelib_TypeClass_UNSIGNED_LONG
:
289 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") );
290 buf
.append( (sal_Int64
)*(sal_uInt32
*)pVal
, 16 );
292 case typelib_TypeClass_HYPER
:
293 case typelib_TypeClass_UNSIGNED_HYPER
:
294 buf
.appendAscii( RTL_CONSTASCII_STRINGPARAM("0x") );
295 #if defined(GCC) && defined(SPARC)
298 *(sal_Int32
*)&aVal
= *(sal_Int32
*)pVal
;
299 *((sal_Int32
*)&aVal
+1)= *((sal_Int32
*)pVal
+1);
300 buf
.append( aVal
, 16 );
303 buf
.append( *(sal_Int64
*)pVal
, 16 );
307 case typelib_TypeClass_VOID
:
308 case typelib_TypeClass_ARRAY
:
309 case typelib_TypeClass_UNKNOWN
:
310 case typelib_TypeClass_SERVICE
:
311 case typelib_TypeClass_MODULE
:
313 buf
.append( (sal_Unicode
)'?' );
316 return buf
.makeStringAndClear();
320 PyObject
*PyUNO_repr( PyObject
* self
)
322 PyUNO
*me
= (PyUNO
* ) self
;
325 if( me
->members
->wrappedObject
.getValueType().getTypeClass()
326 == com::sun::star::uno::TypeClass_EXCEPTION
)
328 Reference
< XMaterialHolder
> rHolder(me
->members
->xInvocation
,UNO_QUERY
);
331 Any a
= rHolder
->getMaterial();
334 ret
= ustring2PyUnicode(e
.Message
).getAcquired();
339 ret
= PyUNO_str( self
);
344 PyObject
*PyUNO_invoke( PyObject
*object
, const char *name
, PyObject
*args
)
351 PyRef paras
,callable
;
352 if( PyObject_IsInstance( object
, getPyUnoClass( runtime
).get() ) )
354 PyUNO
* me
= (PyUNO
*) object
;
355 OUString attrName
= OUString::createFromAscii(name
);
356 if (! me
->members
->xInvocation
->hasMethod (attrName
))
359 buf
.appendAscii( "Attribute " );
360 buf
.append( attrName
);
361 buf
.appendAscii( " unknown" );
362 throw RuntimeException( buf
.makeStringAndClear(), Reference
< XInterface
> () );
364 callable
= PyUNO_callable_new (
365 me
->members
->xInvocation
,
367 runtime
.getImpl()->cargo
->xInvocation
,
368 runtime
.getImpl()->cargo
->xTypeConverter
,
374 // clean the tuple from uno.Any !
375 int size
= PyTuple_Size( args
);
376 { // for CC, keeping ref-count of tuple being 1
377 paras
= PyRef(PyTuple_New( size
), SAL_NO_ACQUIRE
);
379 for( int i
= 0 ; i
< size
;i
++ )
381 PyObject
* element
= PyTuple_GetItem( args
, i
);
382 if( PyObject_IsInstance( element
, getAnyClass( runtime
).get() ) )
384 element
= PyObject_GetAttrString(
385 element
, const_cast< char * >("value") );
389 Py_XINCREF( element
);
391 PyTuple_SetItem( paras
.get(), i
, element
);
393 callable
= PyRef( PyObject_GetAttrString( object
, (char*)name
), SAL_NO_ACQUIRE
);
397 ret
= PyRef( PyObject_CallObject( callable
.get(), paras
.get() ), SAL_NO_ACQUIRE
);
399 catch (::com::sun::star::lang::IllegalArgumentException
&e
)
401 raisePyExceptionWithAny( com::sun::star::uno::makeAny( e
) );
403 catch (::com::sun::star::script::CannotConvertException
&e
)
405 raisePyExceptionWithAny( com::sun::star::uno::makeAny( e
) );
407 catch (::com::sun::star::uno::RuntimeException
&e
)
409 raisePyExceptionWithAny( com::sun::star::uno::makeAny( e
) );
411 catch (::com::sun::star::uno::Exception
&e
)
413 raisePyExceptionWithAny( com::sun::star::uno::makeAny( e
) );
416 return ret
.getAcquired();
419 PyObject
*PyUNO_str( PyObject
* self
)
421 PyUNO
*me
= ( PyUNO
* ) self
;
426 if( me
->members
->wrappedObject
.getValueType().getTypeClass()
427 == com::sun::star::uno::TypeClass_STRUCT
||
428 me
->members
->wrappedObject
.getValueType().getTypeClass()
429 == com::sun::star::uno::TypeClass_EXCEPTION
)
431 Reference
< XMaterialHolder
> rHolder(me
->members
->xInvocation
,UNO_QUERY
);
434 PyThreadDetach antiguard
;
435 Any a
= rHolder
->getMaterial();
436 OUString s
= val2str( (void*) a
.getValue(), a
.getValueType().getTypeLibType() );
437 buf
.append( OUStringToOString(s
,RTL_TEXTENCODING_ASCII_US
) );
442 // a common UNO object
443 PyThreadDetach antiguard
;
444 buf
.append( "pyuno object " );
446 OUString s
= val2str( (void*)me
->members
->wrappedObject
.getValue(),
447 me
->members
->wrappedObject
.getValueType().getTypeLibType() );
448 buf
.append( OUStringToOString(s
,RTL_TEXTENCODING_ASCII_US
) );
451 return PyString_FromString( buf
.getStr());
454 PyObject
* PyUNO_getattr (PyObject
* self
, char* name
)
464 //Handle Python dir () stuff first...
465 if (strcmp (name
, "__members__") == 0)
467 PyObject
* member_list
;
468 Sequence
<OUString
> oo_member_list
;
470 oo_member_list
= me
->members
->xInvocation
->getMemberNames ();
471 member_list
= PyList_New (oo_member_list
.getLength ());
472 for (int i
= 0; i
< oo_member_list
.getLength (); i
++)
474 // setitem steals a reference
475 PyList_SetItem (member_list
, i
, ustring2PyString(oo_member_list
[i
]).getAcquired() );
480 if (strcmp (name
, "__dict__") == 0)
485 if (strcmp (name
, "__methods__") == 0)
490 if (strcmp (name
, "__class__") == 0)
492 if( me
->members
->wrappedObject
.getValueTypeClass() ==
493 com::sun::star::uno::TypeClass_STRUCT
||
494 me
->members
->wrappedObject
.getValueTypeClass() ==
495 com::sun::star::uno::TypeClass_EXCEPTION
)
498 me
->members
->wrappedObject
.getValueType().getTypeName(), runtime
).getAcquired();
504 OUString
attrName( OUString::createFromAscii( name
) );
505 //We need to find out if it's a method...
506 if (me
->members
->xInvocation
->hasMethod (attrName
))
508 //Create a callable object to invoke this...
509 PyRef ret
= PyUNO_callable_new (
510 me
->members
->xInvocation
,
512 runtime
.getImpl()->cargo
->xInvocation
,
513 runtime
.getImpl()->cargo
->xTypeConverter
);
514 Py_XINCREF( ret
.get() );
520 if (me
->members
->xInvocation
->hasProperty ( attrName
))
522 //Return the value of the property
525 PyThreadDetach antiguard
;
526 anyRet
= me
->members
->xInvocation
->getValue (attrName
);
528 PyRef ret
= runtime
.any2PyObject(anyRet
);
529 Py_XINCREF( ret
.get() );
534 PyErr_SetString (PyExc_AttributeError
, name
);
536 catch( com::sun::star::reflection::InvocationTargetException
& e
)
538 raisePyExceptionWithAny( makeAny(e
.TargetException
) );
540 catch( com::sun::star::beans::UnknownPropertyException
& e
)
542 raisePyExceptionWithAny( makeAny(e
) );
544 catch( com::sun::star::lang::IllegalArgumentException
&e
)
546 raisePyExceptionWithAny( makeAny(e
) );
548 catch( com::sun::star::script::CannotConvertException
&e
)
550 raisePyExceptionWithAny( makeAny(e
) );
552 catch( RuntimeException
&e
)
554 raisePyExceptionWithAny( makeAny(e
) );
560 int PyUNO_setattr (PyObject
* self
, char* name
, PyObject
* value
)
568 Any val
= runtime
.pyObject2Any(value
, ACCEPT_UNO_ANY
);
570 OUString
attrName( OUString::createFromAscii( name
) );
572 PyThreadDetach antiguard
;
573 if (me
->members
->xInvocation
->hasProperty (attrName
))
575 me
->members
->xInvocation
->setValue (attrName
, val
);
576 return 0; //Keep with Python's boolean system
580 catch( com::sun::star::reflection::InvocationTargetException
& e
)
582 raisePyExceptionWithAny( makeAny(e
.TargetException
) );
585 catch( com::sun::star::beans::UnknownPropertyException
& e
)
587 raisePyExceptionWithAny( makeAny(e
) );
590 catch( com::sun::star::script::CannotConvertException
&e
)
592 raisePyExceptionWithAny( makeAny(e
) );
595 catch( RuntimeException
& e
)
597 raisePyExceptionWithAny( makeAny( e
) );
600 PyErr_SetString (PyExc_AttributeError
, name
);
601 return 1; //as above.
604 // ensure object identity and struct equality
605 static int PyUNO_cmp( PyObject
*self
, PyObject
*that
)
609 int retDefault
= self
> that
? 1 : -1;
613 if( PyObject_IsInstance( that
, getPyUnoClass( runtime
).get() ) )
616 PyUNO
*me
= reinterpret_cast< PyUNO
*> ( self
);
617 PyUNO
*other
= reinterpret_cast< PyUNO
*> (that
);
618 com::sun::star::uno::TypeClass tcMe
= me
->members
->wrappedObject
.getValueTypeClass();
619 com::sun::star::uno::TypeClass tcOther
= other
->members
->wrappedObject
.getValueTypeClass();
621 if( tcMe
== tcOther
)
623 if( tcMe
== com::sun::star::uno::TypeClass_STRUCT
||
624 tcMe
== com::sun::star::uno::TypeClass_EXCEPTION
)
626 Reference
< XMaterialHolder
> xMe( me
->members
->xInvocation
,UNO_QUERY
);
627 Reference
< XMaterialHolder
> xOther( other
->members
->xInvocation
,UNO_QUERY
);
628 if( xMe
->getMaterial() == xOther
->getMaterial() )
631 else if( tcMe
== com::sun::star::uno::TypeClass_INTERFACE
)
633 if( me
->members
->wrappedObject
== other
->members
->wrappedObject
)
634 // if( me->members->xInvocation == other->members->xInvocation )
640 catch( com::sun::star::uno::RuntimeException
& e
)
642 raisePyExceptionWithAny( makeAny( e
) );
647 static PyTypeObject PyUNOType
=
649 PyObject_HEAD_INIT (&PyType_Type
)
651 const_cast< char * >("pyuno"),
654 (destructor
) PyUNO_del
,
656 (getattrfunc
) PyUNO_getattr
,
657 (setattrfunc
) PyUNO_setattr
,
659 (reprfunc
) PyUNO_repr
,
665 (reprfunc
) PyUNO_str
,
696 #if PY_VERSION_HEX >= 0x02060000
701 PyRef
getPyUnoClass( const Runtime
&)
703 return PyRef( reinterpret_cast< PyObject
* > ( &PyUNOType
) );
706 PyObject
* PyUNO_new (
707 const Any
& targetInterface
, const Reference
<XSingleServiceFactory
> &ssf
)
709 Reference
<XInterface
> tmp_interface
;
711 targetInterface
>>= tmp_interface
;
712 if (!tmp_interface
.is ())
715 Py_INCREF( Py_None
);
719 return PyUNO_new_UNCHECKED (targetInterface
, ssf
);
723 PyObject
* PyUNO_new_UNCHECKED (
724 const Any
&targetInterface
,
725 const Reference
<XSingleServiceFactory
> &ssf
)
728 Sequence
<Any
> arguments (1);
729 Reference
<XInterface
> tmp_interface
;
731 self
= PyObject_New (PyUNO
, &PyUNOType
);
733 return NULL
; //NULL == error
734 self
->members
= new PyUNOInternals();
736 arguments
[0] <<= targetInterface
;
738 PyThreadDetach antiguard
;
739 tmp_interface
= ssf
->createInstanceWithArguments (arguments
);
740 Reference
<XInvocation2
> tmp_invocation (tmp_interface
, UNO_QUERY
);
741 self
->members
->xInvocation
= tmp_invocation
;
742 self
->members
->wrappedObject
= targetInterface
;
744 return (PyObject
*) self
;