diff options
Diffstat (limited to 'sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml')
-rw-r--r-- | sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml | 105 |
1 files changed, 25 insertions, 80 deletions
diff --git a/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml b/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml index 74a96250a..dfabff81d 100644 --- a/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml +++ b/sources/pyside2/PySide2/QtWebKitWidgets/typesystem_webkitwidgets.xml @@ -46,6 +46,7 @@ <load-typesystem name="QtWebKit/typesystem_webkit.xml" generate="no"/> <load-typesystem name="QtNetwork/typesystem_network.xml" generate="no"/> <load-typesystem name="QtPrintSupport/typesystem_printsupport.xml" generate="no"/> + <load-typesystem name="templates/webkitwidgets_common.xml" generate="no"/> <value-type name="QWebDatabase"/> @@ -66,13 +67,13 @@ <value-type name="QWebHistoryItem"/> <value-type name="QWebSecurityOrigin"> - <enum-type name="SubdomainSetting" /> + <enum-type name="SubdomainSetting"/> </value-type> <object-type name="QWebSettings"> <enum-type name="FontFamily"/> <enum-type name="FontSize"/> - <enum-type name="ThirdPartyCookiePolicy" /> + <enum-type name="ThirdPartyCookiePolicy"/> <enum-type name="WebAttribute"/> <enum-type name="WebGraphic"/> </object-type> @@ -87,13 +88,9 @@ <modify-argument index="return"> <define-ownership class="target" owner="default"/> </modify-argument> - <inject-code position="end"> - SbkObject* _pyReturn = reinterpret_cast<SbkObject*>(%PYARG_0); - if (!Shiboken::Object::hasParentInfo(_pyReturn)) - Shiboken::Object::setParent(%PYSELF, %PYARG_0); - </inject-code> + <inject-code position="end" file="../glue/qtwebkitwidgets.cpp" snippet="qwebview-page"/> </modify-function> - <modify-function signature="print(QPrinter*)const" rename="print_" /> + <modify-function signature="print(QPrinter*)const" rename="print_"/> </object-type> <value-type name="QWebElement" since="4.6"> @@ -102,43 +99,27 @@ <value-type name="QWebElementCollection" since="4.6"> <add-function signature="__len__"> - <inject-code> - return %CPPSELF.count(); - </inject-code> + <inject-code file="../glue/qtwebkitwidgets.cpp" snippet="qwebelementcollection-len"/> </add-function> <add-function signature="__getitem__"> - <inject-code> - if (_i < 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> + <inject-code file="../glue/qtwebkitwidgets.cpp" snippet="qwebelementcollection-getitem"/> </add-function> </value-type> <object-type name="QWebFrame"> <enum-type name="RenderLayer" flags="RenderLayers" since="4.6"/> - <enum-type name="ValueOwnership" /> + <enum-type name="ValueOwnership"/> <modify-function signature="addToJavaScriptWindowObject(QString,QObject*,QWebFrame::ValueOwnership)"> <modify-argument index="2"> <parent index="this" action="add"/> </modify-argument> </modify-function> - <modify-function signature="print(QPrinter*)const" rename="print_" /> + <modify-function signature="print(QPrinter*)const" rename="print_"/> <modify-function signature="metaData()const"> <modify-argument index="return"> - <replace-type modified-type="PyObject" /> + <replace-type modified-type="PyObject"/> </modify-argument> - <inject-code position="end"> - <insert-template name="convertFromMultiMap"> - <replace from="%MAP_NAME" to="%0"/> - <replace from="%RETURN_NAME" to="%PYARG_0"/> - <replace from="%KEY_TYPE" to="QString"/> - <replace from="%VALUE_TYPE" to="QString"/> - </insert-template> - </inject-code> + <inject-code position="end" file="../glue/qtwebkitwidgets.cpp" snippet="qwebframe-metadata" /> </modify-function> </object-type> @@ -149,33 +130,20 @@ <enum-type name="FindFlag" flags="FindFlags"/> <enum-type name="LinkDelegationPolicy"/> <enum-type name="NavigationType"/> - <enum-type name="PermissionPolicy" since="4.8" revision="4800" /> - <enum-type name="VisibilityState" /> + <enum-type name="PermissionPolicy" since="4.8" revision="4800"/> + <enum-type name="VisibilityState"/> <enum-type name="WebAction"/> <enum-type name="WebWindowType"/> - <value-type name="ChooseMultipleFilesExtensionOption" /> - <value-type name="ChooseMultipleFilesExtensionReturn" /> - <value-type name="ErrorPageExtensionOption" since="4.6" /> - <value-type name="ErrorPageExtensionReturn" since="4.6" /> - <value-type name="ExtensionOption" /> - <value-type name="ExtensionReturn" /> - <value-type name="ViewportAttributes" /> + <value-type name="ChooseMultipleFilesExtensionOption"/> + <value-type name="ChooseMultipleFilesExtensionReturn"/> + <value-type name="ErrorPageExtensionOption" since="4.6"/> + <value-type name="ErrorPageExtensionReturn" since="4.6"/> + <value-type name="ExtensionOption"/> + <value-type name="ExtensionReturn"/> + <value-type name="ViewportAttributes"/> <modify-function signature="extension(QWebPage::Extension,const QWebPage::ExtensionOption*,QWebPage::ExtensionReturn*)"> - <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<const ChooseMultipleFilesExtension$TYPE_SUFFIX*>(%in); - %out = %CONVERTTOPYTHON[const QWebPage::ChooseMultipleFilesExtension$TYPE_SUFFIX*](_in); - #if QT_VERSION >= 0x040600 - } else if (extension == QWebPage::ErrorPageExtension) { - const ErrorPageExtension$TYPE_SUFFIX* _in = reinterpret_cast<const ErrorPageExtension$TYPE_SUFFIX*>(%in); - %out = %CONVERTTOPYTHON[const QWebPage::ErrorPageExtension$TYPE_SUFFIX*](_in); - #endif - } - </template> <modify-argument index="2" invalidate-after-use="yes"> <conversion-rule class="target"> <insert-template name="qwebpage_extension_argument_conversion"> @@ -199,7 +167,7 @@ </modify-function> <modify-function signature="networkAccessManager()const"> <modify-argument index="return"> - <reference-count action="set" variable-name="setNetworkAccessManager(QNetworkAccessManager*)1" /> + <reference-count action="set" variable-name="setNetworkAccessManager(QNetworkAccessManager*)1"/> </modify-argument> </modify-function> <modify-function signature="view()const"> @@ -217,45 +185,22 @@ <modify-argument index="4"> <remove-argument /> <conversion-rule class="native"> - QString _local; - QString* %4 = &_local; + <insert-template name="qstring_remove"/> </conversion-rule> </modify-argument> <modify-argument index="return"> <replace-type modified-type="PySequence"/> <conversion-rule class="native"> - Shiboken::AutoDecRef pyRes(PySequence_GetItem(%PYARG_0, 0)); - Shiboken::AutoDecRef pyStr(PySequence_GetItem(%PYARG_0, 1)); - %RETURN_TYPE %out = %CONVERTTOCPP[%RETURN_TYPE](pyRes); - *%4 = %CONVERTTOCPP[QString](pyStr); + <insert-template name="pysequence_qstring"/> </conversion-rule> <conversion-rule class="target"> - %PYARG_0 = PyTuple_New(2); - PyTuple_SET_ITEM(%PYARG_0, 0, %CONVERTTOPYTHON[%RETURN_TYPE](%0)); - PyTuple_SET_ITEM(%PYARG_0, 1, %CONVERTTOPYTHON[QString](*%4)); + <insert-template name="qstring_pytuple"/> </conversion-rule> </modify-argument> </modify-function> <add-function signature="qt_metacall()"> - <inject-code class="native"> - static int _signalIndex = -1; - static QMetaMethod _m; - - if (_signalIndex == -1) { - _signalIndex = QWebPage::staticMetaObject.indexOfSlot("shouldInterruptJavaScript()"); - _m = QWebPage::staticMetaObject.method(_signalIndex); - } - - if (_signalIndex == id) { - Shiboken::GilState gil; - PyObject* self = (PyObject*)Shiboken::BindingManager::instance().retrieveWrapper(this); - if (self) { - Shiboken::AutoDecRef _pyMethod(PyObject_GetAttrString(self, "shouldInterruptJavaScript")); - return PySide::SignalManager::callPythonMetaMethod(_m, args, _pyMethod, false); - } - } - </inject-code> + <inject-code class="native" file="../glue/qtwebkitwidgets.cpp" snippet="qwebpage-qt-metacall"/> </add-function> </object-type> |