summaryrefslogtreecommitdiffstats
path: root/PySide/QtWebKit/typesystem_webkit.xml
diff options
context:
space:
mode:
authorMarcelo Lira <marcelo.lira@openbossa.org>2011-08-11 13:06:41 -0300
committerMarcelo Lira <marcelo.lira@openbossa.org>2011-08-18 09:17:00 -0300
commitf4e0aae844b6d204aa58fed9f7d3c864b30f306c (patch)
tree5e66ef4fa3c04c19acdf786ad47f3576b4186a34 /PySide/QtWebKit/typesystem_webkit.xml
parentd01a8a8f6ebc9d257333c01b15b767260b2250ec (diff)
downloadpyside-f4e0aae844b6d204aa58fed9f7d3c864b30f306c.tar.gz
pyside-f4e0aae844b6d204aa58fed9f7d3c864b30f306c.tar.xz
pyside-f4e0aae844b6d204aa58fed9f7d3c864b30f306c.zip
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/QtWebKit/typesystem_webkit.xml')
-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 9f96255..39326c7 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>