aboutsummaryrefslogtreecommitdiffstats
path: root/PySide/QtOpenGL
diff options
context:
space:
mode:
authorRenato Filho <renato.filho@openbossa.org>2010-05-26 14:28:39 -0300
committerRenato Filho <renato.filho@openbossa.org>2010-05-26 16:24:07 -0300
commit0c6e44c7d421254eadd00282adbaf50247479ebe (patch)
tree03ac27965ec6e7d99b72e6097a1140b165868d85 /PySide/QtOpenGL
parent2264c8874cc2939217745ad9d0daa47e770e9578 (diff)
Updated QtOpenGL typesystem to Qt 4.7.
Reviewer: Luciano Wolf <luciano.wolf@openbossa.org>, Marcelo Lira <marcelo.lira@openbossa.org>
Diffstat (limited to 'PySide/QtOpenGL')
-rw-r--r--PySide/QtOpenGL/CMakeLists.txt10
-rw-r--r--PySide/QtOpenGL/typesystem_opengl.xml64
2 files changed, 74 insertions, 0 deletions
diff --git a/PySide/QtOpenGL/CMakeLists.txt b/PySide/QtOpenGL/CMakeLists.txt
index 5cfaf9336..1d79e6c12 100644
--- a/PySide/QtOpenGL/CMakeLists.txt
+++ b/PySide/QtOpenGL/CMakeLists.txt
@@ -10,6 +10,15 @@ else()
)
endif()
+if (${QT_VERSION_MAJOR} EQUAL 4 AND ${QT_VERSION_MINOR} LESS 7)
+ set(QtOpenGL_47_SRC )
+else()
+ set(QtOpenGL_47_SRC
+ ${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qglbuffer_wrapper.cpp
+ )
+endif()
+
+
set(QtOpenGL_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qgl_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qglcolormap_wrapper.cpp
@@ -20,6 +29,7 @@ set(QtOpenGL_SRC
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qglwidget_wrapper.cpp
${CMAKE_CURRENT_BINARY_DIR}/PySide/QtOpenGL/qtopengl_module_wrapper.cpp
${QtOpenGL_46_SRC}
+ ${QtOpenGL_47_SRC}
)
execute_generator(opengl QtOpenGL_SRC "${CMAKE_CURRENT_BINARY_DIR}:${QtCore_SOURCE_DIR}:${QtGui_BINARY_DIR}:${QtGui_SOURCE_DIR}:${QtOpenGL_SOURCE_DIR}")
diff --git a/PySide/QtOpenGL/typesystem_opengl.xml b/PySide/QtOpenGL/typesystem_opengl.xml
index 62f086426..c2f3ba383 100644
--- a/PySide/QtOpenGL/typesystem_opengl.xml
+++ b/PySide/QtOpenGL/typesystem_opengl.xml
@@ -76,9 +76,73 @@
<value-type name="QGLFramebufferObjectFormat"/>
<object-type name="QGLShader"/>
<object-type name="QGLShaderProgram">
+ <!-- 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 -->
+ <enum-type name="QGLFormat::OpenGLContextProfile" since="4.7"/>
+ <enum-type name="QGLBuffer::Access" since="4.7"/>
+ <enum-type name="QGLBuffer::Type" since="4.7"/>
+ <enum-type name="QGLBuffer::UsagePattern" since="4.7"/>
+
+ <object-type name="QGLBuffer" 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 class="target" position="beginning">
+ void *data = %CPPSELF.map(%1);
+ QByteArray ret;
+ if (data)
+ ret.append((const char*)data, %CPPSELF.size());
+ %PYARG_0 = %CONVERTTOPYTHON[QByteArray](ret);
+ </inject-code>
+ </modify-function>
+ <modify-function signature="read(int, void*, int)">
+ <modify-argument index="2">
+ <remove-argument/>
+ </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>