aboutsummaryrefslogtreecommitdiffstats
path: root/sources/shiboken6/tests/minimalbinding/typesystem_minimal.xml
blob: 3fac1b2b3978f4de2172bf35ed9d206adc64b51f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?xml version="1.0" encoding="UTF-8"?>
<typesystem package="minimal">

    <primitive-type name="MinBool" target-lang-api-name="PyBool" default-constructor="MinBool(false)">
        <include file-name="minbool.h" location="global"/>
        <conversion-rule>
            <native-to-target>
            return PyBool_FromLong(%in.value());
            </native-to-target>
            <target-to-native>
                <add-conversion type="PyBool" check="PyBool_Check(%in)">
                %out = %OUTTYPE(%in == Py_True);
                </add-conversion>
            </target-to-native>
        </conversion-rule>
    </primitive-type>

    <container-type name="std::list" type="list"
                    opaque-containers="int:StdIntList">
        <include file-name="list" location="global"/>
        <conversion-rule>
            <native-to-target>
                <insert-template name="shiboken_conversion_cppsequence_to_pylist"/>
            </native-to-target>
            <target-to-native>
                <add-conversion type="PySequence">
                    <insert-template name="shiboken_conversion_pyiterable_to_cppsequentialcontainer"/>
                </add-conversion>
            </target-to-native>
        </conversion-rule>
    </container-type>

    <object-type name="Obj"/>
    <value-type name="Val">
        <enum-type name="ValEnum"/>
    </value-type>
    <value-type name="ListUser">
        <modify-field name="m_stdIntList" opaque-container="yes"/>
        <modify-function signature="getIntList()">
            <modify-argument index="return">
                <replace-type modified-type="StdIntList"/>
            </modify-argument>
        </modify-function>
        <modify-function signature="getConstIntList()const">
            <modify-argument index="return">
                <replace-type modified-type="StdIntList"/>
            </modify-argument>
        </modify-function>
    </value-type>
    <value-type name="MinBoolUser"/>

    <!-- Test wrapping of a typedef -->
    <function signature="arrayFuncInt(std::vector&lt;int&gt;)" />
    <!-- Note manual expansion of the typedef -->
    <function signature="arrayFuncIntTypedef(std::vector&lt;int&gt;)" />

    <function signature="arrayFuncIntReturn(int)" />
    <function signature="arrayFuncIntReturnTypedef(int)" />

    <!-- Test wrapping of a typedef of a typedef -->
    <function signature="arrayFunc(std::vector&lt;int&gt;)" />
    <!-- Note manual expansion of the typedef  -->
    <function signature="arrayFuncTypedef(std::vector&lt;int&gt;)" />

    <function signature="arrayFuncReturn(int)" />
    <function signature="arrayFuncReturnTypedef(int)" />
</typesystem>