summaryrefslogtreecommitdiffstats
path: root/PySide/QtOpenGL/typesystem_opengl.xml
blob: abed71869a3e2c47268bc1f0c97d43e04d33418f (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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
<?xml version="1.0"?>
<!--
    This file is part of PySide project.
    Copyright (C) 2009-2010 Nokia Corporation and/or its subsidiary(-ies).
    Contact: PySide team <contact@pyside.org>

    This library is free software; you can redistribute it and/or
    modify it under the terms of the GNU Lesser General Public
    License as published by the Free Software Foundation; either
    version 2.1 of the License, or (at your option) any later version.

    This library is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public
    License along with this library; if not, write to the Free Software
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
-->
<typesystem package="PySide.QtOpenGL">
  <load-typesystem name="typesystem_gui.xml" generate="no" />

  <rejection class="QGLColormap::QGLColormapData"/>
  <rejection class="QGLContext" field-name="currentCtx"/>

  <namespace-type name="QGL">
    <enum-type name="FormatOption" flags="FormatOptions" force-integer="yes"/>
    <extra-includes>
        <include file-name="qgl.h" location="global"/>
    </extra-includes>
  </namespace-type>

  <value-type name="QGLColormap">
    <modify-function signature="setEntries(int,const unsigned int*,int)">
        <access modifier="private"/>
    </modify-function>
  </value-type>

  <value-type name="QGLFormat">
    <enum-type name="OpenGLContextProfile" since="4.7"/>
    <enum-type name="OpenGLVersionFlag" flags="OpenGLVersionFlags"/>
  </value-type>

  <rejection class="QGLContext" field-name="currentCtx" />
  <object-type name="QGLContext">
    <enum-type name="BindOption" flags="BindOptions" since="4.6"/>
    <modify-function signature="chooseContext(const QGLContext*)">
        <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>
    <modify-function signature="create(const QGLContext*)">
        <modify-argument index="1" invalidate-after-use="yes"/>
    </modify-function>

    <!-- ### Obsolete functions and ctors -->
    <modify-function signature="generateFontDisplayLists(QFont, int)" remove="all"/>
    <modify-function signature="QGLContext(const QGLFormat&amp;, QPaintDevice*)" remove="all" />
    <!-- ### -->
  </object-type>
  <object-type name="QGLFramebufferObject">
    <enum-type name="Attachment"/>
  </object-type>
  <object-type name="QGLPixelBuffer">
    <extra-includes>
        <include file-name="QImage" location="global"/>
    </extra-includes>
  </object-type>
  <object-type name="QGLWidget">
    <extra-includes>
        <include file-name="QImage" location="global"/>
        <include file-name="QPixmap" location="global"/>
    </extra-includes>
    <modify-function signature="QGLWidget(QGLContext*, QWidget*, const QGLWidget*, QFlags&lt;Qt::WindowType&gt;)">
      <modify-argument index="1">
        <parent index="this" action="add"/>
      </modify-argument>
      <modify-argument index="this">
        <parent index="2" action="add"/>
      </modify-argument>
    </modify-function>
    <!-- ### Not part of Qt public API -->
    <modify-function signature="setContext(QGLContext*,const QGLContext*,bool)" remove="all" />
    <!-- ### -->
    <!--- ### Obsolete functions -->
    <modify-function signature="fontDisplayListBase(QFont, int)" remove="all"/>
    <modify-function signature="setFormat(QGLFormat)" remove="all"/>
    <!-- ### -->
  </object-type>

  <value-type name="QGLFramebufferObjectFormat" since="4.6"/>
  <object-type name="QGLShader" since="4.6">
    <enum-type name="ShaderTypeBit" flags="ShaderType"/>
  </object-type>
  <object-type name="QGLShaderProgram" since="4.6">
    <!-- ### Use QMatrixZxY overloads -->
    <modify-function signature="setUniformValue(int, Array)" remove="all" />
    <modify-function signature="setUniformValue(const char*, Array)" remove="all" />
    <modify-function signature="setAttributeValue(int,const float*,int,int)" remove="all" />
    <modify-function signature="setAttributeValue(const char*,const float*,int,int)" remove="all" />
    <modify-function signature="setAttributeArray(int, uint, const void*, int, int)" remove="all" since="4.7" />
    <modify-function signature="setAttributeArray(const char*, uint, const void*, int, int)" remove="all" since="4.7" />
    <!-- ### -->
  </object-type>

  <!-- Qt 4.7 -->
  <object-type name="QGLBuffer" since="4.7">
    <enum-type name="Access" since="4.7"/>
    <enum-type name="Type" since="4.7"/>
    <enum-type name="UsagePattern" since="4.7"/>
    <modify-function signature="allocate(const void*, int)">
      <modify-argument index="1">
        <replace-type modified-type="const QByteArray&amp;"/>
      </modify-argument>
      <modify-argument index="2">
        <replace-default-expression with="-1"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        int size = %2;
        if (size &lt; 0)
            size = %1.size();
        %CPPSELF.allocate((const void*) %1.data(), size);
      </inject-code>
    </modify-function>
    <modify-function signature="map(QGLBuffer::Access)">
      <inject-code>
        Py_ssize_t dataSize = %CPPSELF.size();
        void* data = %CPPSELF.map(%1);

        if (!data) {
            Py_INCREF(Py_None);
            %PYARG_0 = Py_None;
        } else if (%1 == QGLBuffer::ReadOnly) {
            %PYARG_0 = Shiboken::Buffer::newObject(data, dataSize, Shiboken::Buffer::ReadOnly);
        } else {
            %PYARG_0 = Shiboken::Buffer::newObject(data, dataSize, Shiboken::Buffer::ReadWrite);
        }
      </inject-code>
    </modify-function>
    <modify-function signature="read(int, void*, int)">
      <modify-argument index="2">
        <remove-argument/>
      </modify-argument>
      <modify-argument index="return">
        <replace-type modified-type="(retval, data)"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        char *data = new char[%3];
        bool result = %CPPSELF.read(%1, data, %3);
        QByteArray ret;
        if (result)
            ret.append((const char*)data, %3);
        %PYARG_0 = Shiboken::makeTuple(result, ret);
        delete[] data;
      </inject-code>
    </modify-function>
    <modify-function signature="write(int, const void*, int)">
      <modify-argument index="2">
        <replace-type modified-type="const QByteArray&amp;"/>
      </modify-argument>
      <modify-argument index="3">
        <replace-default-expression with="-1"/>
      </modify-argument>
      <inject-code class="target" position="beginning">
        int size = %3;
        if (size &lt; 0)
            size = %2.size();
        %CPPSELF.write(%1, (const void*) %2.data(), size);
      </inject-code>
    </modify-function>
  </object-type>

</typesystem>