aboutsummaryrefslogtreecommitdiffstats
path: root/PySide
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-08-11 13:06:41 -0300
committerHugo Parente Lima <hugo.pl@gmail.com>2012-03-08 16:54:45 -0300
commit2a26f3560784cc2c939224cf75a49b2a16d91724 (patch)
tree645dfa601693568be5af0095c7d2d34c9fc551e5 /PySide
parentd2e18937621e7327e341357eb674683c341e93e3 (diff)
Updated QtWebKit's type system.
Reviewed by Luciano Wolf <luciano.wolf@openbossa.org> Reviewed by Renato Ara├║jo <renato.filho@openbossa.org>
Diffstat (limited to 'PySide')
-rw-r--r--PySide/QtWebKit/typesystem_webkit.xml50
1 files changed, 27 insertions, 23 deletions
diff --git a/PySide/QtWebKit/typesystem_webkit.xml b/PySide/QtWebKit/typesystem_webkit.xml
index 9f96255f8..39326c7e2 100644
--- a/PySide/QtWebKit/typesystem_webkit.xml
+++ b/PySide/QtWebKit/typesystem_webkit.xml
@@ -90,28 +90,31 @@
<value-type name="ExtensionReturn" />
<modify-function signature="extension(QWebPage::Extension, const QWebPage::ExtensionOption*, QWebPage::ExtensionReturn*)">
- <modify-argument index="2" invalidate-after-use="yes">
+ <template name="qwebpage_extension_argument_conversion">
+ PyObject* %out = 0;
+ // Cast the parameters according to the extension type
+ if (extension == QWebPage::ChooseMultipleFilesExtension) {
+ const ChooseMultipleFilesExtension$TYPE_SUFFIX* _in = reinterpret_cast&lt;const ChooseMultipleFilesExtension$TYPE_SUFFIX*>(%in);
+ %out = %CONVERTTOPYTHON[const ChooseMultipleFilesExtension$TYPE_SUFFIX*](_in);
+ #if QT_VERSION >= 0x040600
+ } else if (extension == QWebPage::ErrorPageExtension) {
+ const ErrorPageExtension$TYPE_SUFFIX* _in = reinterpret_cast&lt;const ErrorPageExtension$TYPE_SUFFIX*>(%in);
+ %out = %CONVERTTOPYTHON[const ErrorPageExtension$TYPE_SUFFIX*](_in);
+ #endif
+ }
+ </template>
+ <modify-argument index="2" invalidate-after-use="yes">
<conversion-rule class="target">
- PyObject* %out = 0;
- // Cast the parameters according to the extension type
- if (extension == QWebPage::ChooseMultipleFilesExtension)
- %out = %CONVERTTOPYTHON[ChooseMultipleFilesExtensionOption*](reinterpret_cast&lt;const ChooseMultipleFilesExtensionOption*>(option));
- #if QT_VERSION >= 0x040600
- else if (extension == QWebPage::ErrorPageExtension)
- %out = %CONVERTTOPYTHON[ErrorPageExtensionOption*](reinterpret_cast&lt;const ErrorPageExtensionOption*>(option));
- #endif
+ <insert-template name="qwebpage_extension_argument_conversion">
+ <replace from="$TYPE_SUFFIX" to="Option"/>
+ </insert-template>
</conversion-rule>
</modify-argument>
<modify-argument index="3" invalidate-after-use="yes">
<conversion-rule class="target">
- PyObject* %out = 0;
- // Cast the parameters according to the extension type
- if (extension == QWebPage::ChooseMultipleFilesExtension)
- %out = %CONVERTTOPYTHON[ChooseMultipleFilesExtensionReturn*](reinterpret_cast&lt;const ChooseMultipleFilesExtensionReturn*>(output));
- #if QT_VERSION >= 0x040600
- else if (extension == QWebPage::ErrorPageExtension)
- %out = %CONVERTTOPYTHON[ErrorPageExtensionReturn*](reinterpret_cast&lt;const ErrorPageExtensionReturn*>(output));
- #endif
+ <insert-template name="qwebpage_extension_argument_conversion">
+ <replace from="$TYPE_SUFFIX" to="Return"/>
+ </insert-template>
</conversion-rule>
</modify-argument>
</modify-function>
@@ -181,16 +184,17 @@
<value-type name="QWebElementCollection" since="4.6">
<add-function signature="__len__">
<inject-code>
- return %CPPSELF.count();
+ return %CPPSELF.count();
</inject-code>
</add-function>
<add-function signature="__getitem__">
<inject-code>
- if (_i &lt; 0 || _i >= %CPPSELF.count()) {
- PyErr_SetString(PyExc_IndexError, "index out of bounds");
- return 0;
- }
- return %CONVERTTOPYTHON[QWebElement](%CPPSELF.at(_i));
+ if (_i &lt; 0 || _i >= %CPPSELF.count()) {
+ PyErr_SetString(PyExc_IndexError, "index out of bounds");
+ return 0;
+ }
+ QWebElement element = %CPPSELF.at(_i);
+ return %CONVERTTOPYTHON[QWebElement](element);
</inject-code>
</add-function>
</value-type>