From a57a202a70801f766094c3ed11664b03c9a6a3e4 Mon Sep 17 00:00:00 2001 From: Cristian Maureira-Fredes Date: Thu, 11 Oct 2018 17:45:43 +0200 Subject: Move inject-code snippets to separate files When code must be modified or added to certain functions, we currently have two options: * Write a template and include it into the typesystem, * inject code directly at a certain place of the function entry. The problem with injecting raw code is that since it is an XML file, one need to escape protected symbols, like "<" and "&". Thanks to a couple of complementary commits, now we can place this code snippets on a separate file without triggering a whole module compiling process, since the typesystem itself will not be alterered. All the injected code from the typesystem was removed and placed into a single file per module inside a top-level directory called glue. Some small fixes were included mainly regarding styling of the code. Task-number: PYSIDE-834 Change-Id: I823e92d241a528d75d5940090008db9bf297f49e Reviewed-by: Qt CI Bot Reviewed-by: Friedemann Kleint --- .../pyside2/PySide2/QtOpenGL/typesystem_opengl.xml | 252 +++++++++------------ 1 file changed, 112 insertions(+), 140 deletions(-) (limited to 'sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml') diff --git a/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml b/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml index c332eea0d..59019faa1 100644 --- a/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml +++ b/sources/pyside2/PySide2/QtOpenGL/typesystem_opengl.xml @@ -40,7 +40,7 @@ ****************************************************************************/ --> - + @@ -88,7 +88,7 @@ - + @@ -99,7 +99,7 @@ - + @@ -124,7 +124,7 @@ - + @@ -158,12 +158,12 @@ - + - - + + @@ -171,12 +171,12 @@ - + - - + + @@ -184,12 +184,12 @@ - + - - + + @@ -197,12 +197,12 @@ - + - - + + @@ -210,12 +210,12 @@ - + - - + + @@ -223,12 +223,12 @@ - + - - + + @@ -237,15 +237,15 @@ - + - - + + @@ -253,15 +253,15 @@ - + - - + + @@ -269,15 +269,15 @@ - + - - + + @@ -285,15 +285,15 @@ - + - - + + @@ -301,15 +301,15 @@ - + - - + + @@ -317,15 +317,15 @@ - + - - + + @@ -333,15 +333,15 @@ - + - - + + @@ -349,15 +349,15 @@ - + - - + + @@ -365,15 +365,15 @@ - + - - + + @@ -381,15 +381,15 @@ - + - - + + @@ -397,15 +397,15 @@ - + - - + + @@ -413,15 +413,15 @@ - + - - + + @@ -429,15 +429,15 @@ - + - - + + @@ -445,15 +445,15 @@ - + - - + + @@ -461,15 +461,15 @@ - + - - + + @@ -477,15 +477,15 @@ - + - - + + @@ -493,15 +493,15 @@ - + - - + + @@ -509,15 +509,15 @@ - + - - + + @@ -525,15 +525,15 @@ - + - - + + @@ -541,15 +541,15 @@ - + - - + + @@ -557,15 +557,15 @@ - + - - + + @@ -573,15 +573,15 @@ - + - - + + @@ -589,15 +589,15 @@ - + - - + + @@ -605,15 +605,15 @@ - + - - + + @@ -621,15 +621,15 @@ - + - - + + @@ -637,15 +637,15 @@ - + - - + + @@ -653,15 +653,15 @@ - + - - + + @@ -669,23 +669,23 @@ - + - - + + - - + + @@ -701,25 +701,10 @@ - - int size = (%2 < 0) ? %1.size() : %2; - %CPPSELF.allocate((const void*) %1.data(), size); - + - - 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); - } - + @@ -728,17 +713,7 @@ - - char *data = new char[%3]; - bool result = %CPPSELF.read(%1, data, %3); - QByteArray ret; - if (result) - ret.append((const char*)data, %3); - %PYARG_0 = PyTuple_New(2); - PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[bool](result)); - PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QByteArray](ret)); - delete[] data; - + @@ -747,10 +722,7 @@ - - int size = (%3 < 0) ? %2.size() : %3; - %CPPSELF.write(%1, (const void*) %2.data(), size); - + -- cgit v1.2.3