diff options
Diffstat (limited to 'sources/shiboken6/tests/samplebinding/typesystem_sample.xml')
-rw-r--r-- | sources/shiboken6/tests/samplebinding/typesystem_sample.xml | 84 |
1 files changed, 53 insertions, 31 deletions
diff --git a/sources/shiboken6/tests/samplebinding/typesystem_sample.xml b/sources/shiboken6/tests/samplebinding/typesystem_sample.xml index d7f45d8b6..e315e599e 100644 --- a/sources/shiboken6/tests/samplebinding/typesystem_sample.xml +++ b/sources/shiboken6/tests/samplebinding/typesystem_sample.xml @@ -1,12 +1,9 @@ <?xml version="1.0" encoding="UTF-8"?> <typesystem package="sample"> - <suppress-warning text="Duplicate type entry: 'sample'" /> - <suppress-warning text="Duplicate type entry: 'SampleNamespace'" /> - <primitive-type name="ObjectType::Identifier"/> <primitive-type name="std::nullptr_t"/> - <primitive-type name="Foo::HANDLE" target-lang-api-name="PyLong"/> + <primitive-type name="Foo::SAMPLE_HANDLE" target-lang-api-name="PyLong"/> <primitive-type name="std::size_t" target-lang-api-name="PyLong"> <conversion-rule> @@ -74,7 +71,7 @@ </conversion-rule> </primitive-type> - <primitive-type name="HANDLE" target-lang-api-name="PyComplex"> + <primitive-type name="SAMPLE_HANDLE" target-lang-api-name="PyComplex"> <include file-name="handle.h" location="local"/> <conversion-rule> <native-to-target> @@ -400,6 +397,7 @@ <function signature="returnNullValueTypePointer()" /> <function signature="returnNullObjectTypePointer()" /> <function signature="acceptInt(int)" /> + <function signature="acceptIntReturnPtr(int)"/> <function signature="acceptUInt(unsigned int)" /> <function signature="acceptLong(long)" /> <function signature="acceptULong(unsigned long)" /> @@ -421,6 +419,8 @@ <function signature="addStdStrings(const std::string&, const std::string&)"/> <function signature="addStdWStrings(const std::wstring&, const std::wstring&)"/> <function signature="testNullPtrT(std::nullptr_t)"/> + <function signature="takePolygon(Polygon&&)"/> + <function signature="takeObjectType(ObjectType&&)"/> <value-type name="ArrayModifyTest"> <modify-function signature="sumIntArray(int, int*)"> @@ -429,7 +429,7 @@ </value-type> <value-type name="ClassWithFunctionPointer"> - <suppress-warning text="skipping function 'ClassWithFunctionPointer::callFunctionPointer', unmatched parameter type 'void (*)(void*)'" /> + <suppress-warning text="^skipping public function 'void ClassWithFunctionPointer::callFunctionPointer.*$" /> </value-type> <value-type name="IntArray" generate="no"/> @@ -571,6 +571,14 @@ <modify-function signature="hideFunction(HideType*)" remove="all"/> <modify-field name="toBeRenamedField" rename="renamedField"/> <modify-field name="readOnlyField" write="false"/> + <modify-function signature="virtualWithOutParameter(int&)const"> + <inject-code class="shell" position="override"> + x = virtualWithOutParameterPyOverride(gil, pyOverride.object()); + return; + </inject-code> + </modify-function> + <add-function signature="virtualWithOutParameterPyOverride()" + return-type="int" python-override="true"/> </object-type> <object-type name="Derived" polymorphic-id-expression="%1->type() == Derived::TpDerived"> @@ -633,8 +641,8 @@ // CHECKTYPE and ISCONVERTIBLE are used here for test purposes, don't change them. if (!%CHECKTYPE[ObjectTypeLayout*](layout) && !%ISCONVERTIBLE[ObjectTypeLayout*](layout)) return; - // %CHECKTYPE[ObjectTypeLayout*](layout) - // %ISCONVERTIBLE[ObjectTypeLayout*](layout) + /* %CHECKTYPE[ObjectTypeLayout*](layout) */ + /* %ISCONVERTIBLE[ObjectTypeLayout*](layout) */ ObjectTypeLayout* var; var = %CONVERTTOCPP[ObjectTypeLayout*](layout); // TODO-CONVERTER: erase this @@ -721,7 +729,7 @@ </modify-function> </object-type> - <value-type name="ObjectTypeHolder"/> + <object-type name="ObjectTypeHolder"/> <value-type name="OnlyCopy"/> <value-type name="FriendOfOnlyCopy"/> @@ -1894,13 +1902,13 @@ </value-type> <value-type name="Size"> + <extra-includes> + <include file-name="string" location="global"/> + <include file-name="sstream" location="global"/> + </extra-includes> <add-function signature="Size(const char*)"> - <inject-code class="target" position="beginning"> - %0 = new %TYPE(); - </inject-code> - <inject-code class="target" position="end"> - Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, const_cast<char*>("setHeight"), const_cast<char*>("i"), 2)); - </inject-code> + <inject-code class="target" position="beginning" + file="samplesnippets.cpp" snippet="size_char_ct"/> </add-function> </value-type> <value-type name="SizeF"/> @@ -2217,14 +2225,14 @@ </add-function> </value-type> - <value-type name="SimpleFile"> + <object-type name="SimpleFile"> <modify-function signature="open()"> <modify-argument index="return"> <remove-argument/> </modify-argument> <inject-code class="target" position="end" file="simplefile_glue.cpp"/> </modify-function> - </value-type> + </object-type> <value-type name="VoidHolder" /> @@ -2401,6 +2409,31 @@ <object-type name="ObjectTypeByValue" /> + <value-type name="StdComplex"> + <extra-includes> + <include file-name="cmath" location="global"/> + </extra-includes> + <!-- PYSIDE-2446: number protocols without a Py_nb_ constant. --> + <add-function signature="__floor__()" return-type="double"> + <inject-code class="target" position="end" + file="samplesnippets.cpp" snippet="stdcomplex_floor"/> + </add-function> + <add-function signature="__ceil__()" return-type="double"> + <inject-code class="target" position="end" + file="samplesnippets.cpp" snippet="stdcomplex_ceil"/> + </add-function> + <!-- PYSIDE-2446: number protocols with Py_nb_ constants. --> + <add-function signature="__abs__()" return-type="double"> + <inject-code class="target" position="end" + file="samplesnippets.cpp" snippet="stdcomplex_abs"/> + </add-function> + <add-function signature="__pow__(StdComplex@exp@)" return-type="StdComplex"> + <inject-code class="target" position="end" + file="samplesnippets.cpp" snippet="stdcomplex_pow"/> + </add-function> + + </value-type> + <object-type name="TemplatePtr"> <modify-function signature="dummy(std::list<std::pair<BlackBox *, BlackBox *> > &)" rename="dummy_method" /> </object-type> @@ -2416,20 +2449,9 @@ <suppress-warning text="horribly broken type '__off64_t'" /> <suppress-warning text="enum '__codecvt_result' does not have a type entry or is not an enum" /> - <suppress-warning text="Pure virtual method "Abstract::hideFunction(HideType*)" must be implement but was completely removed on typesystem." /> - <suppress-warning text="hiding of function 'takeChild' in class 'ObjectType'" /> + <suppress-warning text="Pure virtual method 'Abstract::hideFunction(HideType*)' must be implemented but was completely removed on type system." /> <suppress-warning text="Shadowing: MDerived2::castToBase3() and MDerived3::castToBase3()" /> - <suppress-warning text="hiding of function 'takeChild' in class 'Bucket'" /> - <suppress-warning text="visibility of function 'publicMethod' modified in class 'MDerived1'" /> - <suppress-warning text="hiding of function 'doNothingInPublic3' in class 'Overload2'" /> - <suppress-warning text="hiding of function 'takeChild' in class 'ObjectModel'" /> - <suppress-warning text="hiding of function 'takeChild' in class 'ObjectView'" /> - <suppress-warning text="visibility of function 'publicMethod' modified in class 'MDerived3'" /> - <suppress-warning text="skipping function 'InjectCode::toStr', unmatched parameter type 'T const&'" /> - - <suppress-warning text="^skipping function 'std::enable_if.*ComparisonTester::operator[!=]=.*ComparisonTester.*$"/> - - <!-- Do not fix this warning, the generator should be able to handle this situation for Object Types. --> - <suppress-warning text="Argument in position 1 of added function 'SampleNamespace::passReferenceToObjectType(ObjectType * arg__1)', has a type that is not a reference, while the argument in the corresponding position in C++ function 'SampleNamespace::passReferenceToObjectType(const ObjectType & obj, int multiplier)' is a reference." /> + <suppress-warning text="Visibility of function 'publicMethod' modified in class 'MDerived1'" /> + <suppress-warning text="^skipping public function 'std::enable_if.*ComparisonTester::operator[!=]=.*ComparisonTester.*$"/> </typesystem> |