<?xml version="1.0" encoding="UTF-8"?>
<typesystem package="testbinding">
    <load-typesystem name="QtWidgets/typesystem_widgets.xml" generate="no"/>
    <value-type name="IntValue"/>
    <primitive-type name="TypedefValue">
        <!--
        A conversion rule is used here because ApiExtractor can't associate
        a primitive typedef to a non-primitive type. That would be a good
        improvement to ApiExtractor.
        -->
        <conversion-rule>
            <native-to-target>
            return %CONVERTTOPYTHON[IntValue](%in);
            </native-to-target>
            <target-to-native>
                <add-conversion type="IntValue">
                IntValue value = %CONVERTTOCPP[IntValue](%in);
                %out = %OUTTYPE(value);
                </add-conversion>
            </target-to-native>
        </conversion-rule>
    </primitive-type>
    <object-type name="TestObject" />

    <primitive-type name="PySideInt"/>
    <primitive-type name="PySideCPP2::PySideLong"/>
    <!--<primitive-type name="PySideLong"/>-->

    <function signature="getHiddenObject()" />

    <inject-code position="end">
    Shiboken::Conversions::registerConverterName(Shiboken::Conversions::PrimitiveTypeConverter&lt;long&gt;(), "PySideLong");
    Shiboken::Conversions::registerConverterName(Shiboken::Conversions::PrimitiveTypeConverter&lt;long&gt;(), "PySideCPP2::PySideLong");
    qRegisterMetaType&lt;PySideInt>("PySideInt");
    qRegisterMetaType&lt;PySideCPP2::PySideLong>("PySideLong");
    </inject-code>

    <object-type name="ContainerTest"/>

    <namespace-type name="PySideCPP">
        <object-type name="TestObjectWithNamespace"/>
        <object-type name="TestObject2WithNamespace">
            <add-function signature="__repr__" return-type="PyObject*">
                <inject-code class="target" position="beginning">
                    %PYARG_0 = Shiboken::String::fromCString("TestObject2WithNamespace(injected_repr)");
                </inject-code>
            </add-function>
        </object-type>
    </namespace-type>

    <namespace-type name="PySideCPP2" generate="no">
        <enum-type name="Enum1" />
        <object-type name="TestObjectWithoutNamespace">
            <enum-type name="Enum2" />
        </object-type>
    </namespace-type>

    <object-type name="TestView" >
        <modify-function signature="TestView(QAbstractListModel*,QObject*)">
            <modify-argument index="1">
                <reference-count action="set"/>
            </modify-argument>
        </modify-function>
    </object-type>

    <value-type name="TestQVariantEnum"/>

    <namespace-type name="FlagsNamespace" visible="no">
        <enum-type name="Option" flags="Options"/>
        <object-type name="ClassForEnum" />
    </namespace-type>

    <object-type name="SharedPointerTestbench"/>

    <smart-pointer-type name="QSharedPointer" type="shared" getter="data"
                        reset-method="reset"/>

</typesystem>
