1// qquickwindow.sip generated by MetaSIP 2// 3// This file is part of the QtQuick Python extension module. 4// 5// Copyright (c) 2021 Riverbank Computing Limited <info@riverbankcomputing.com> 6// 7// This file is part of PyQt5. 8// 9// This file may be used under the terms of the GNU General Public License 10// version 3.0 as published by the Free Software Foundation and appearing in 11// the file LICENSE included in the packaging of this file. Please review the 12// following information to ensure the GNU General Public License version 3.0 13// requirements will be met: http://www.gnu.org/copyleft/gpl.html. 14// 15// If you do not wish to use this file under the terms of the GPL version 3.0 16// then you may purchase a commercial license. For more information contact 17// info@riverbankcomputing.com. 18// 19// This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 20// WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 21 22 23class QQuickWindow : QWindow /ExportDerived/ 24{ 25%TypeHeaderCode 26#include <qquickwindow.h> 27%End 28 29%ConvertToSubClassCode 30 static struct class_graph { 31 const char *name; 32 sipTypeDef **type; 33 int yes, no; 34 } graph[] = { 35 #if QT_VERSION >= 0x050400 36 {sipName_QSGEngine, &sipType_QSGEngine, -1, 1}, 37 #else 38 {0, 0, -1, 1}, 39 #endif 40 {sipName_QQuickItem, &sipType_QQuickItem, 11, 2}, 41 #if QT_VERSION >= 0x050400 42 {sipName_QQuickItemGrabResult, &sipType_QQuickItemGrabResult, -1, 3}, 43 #else 44 {0, 0, -1, 3}, 45 #endif 46 {sipName_QSGTexture, &sipType_QSGTexture, 13, 4}, 47 #if QT_VERSION >= 0x050100 48 {sipName_QQuickTextDocument, &sipType_QQuickTextDocument, -1, 5}, 49 #else 50 {0, 0, -1, 5}, 51 #endif 52 #if QT_VERSION >= 0x050400 53 {sipName_QSGAbstractRenderer, &sipType_QSGAbstractRenderer, -1, 6}, 54 #else 55 {0, 0, -1, 6}, 56 #endif 57 #if QT_VERSION >= 0x050600 58 {sipName_QQuickImageResponse, &sipType_QQuickImageResponse, -1, 7}, 59 #else 60 {0, 0, -1, 7}, 61 #endif 62 {sipName_QQuickTextureFactory, &sipType_QQuickTextureFactory, -1, 8}, 63 #if QT_VERSION >= 0x050400 64 {sipName_QQuickRenderControl, &sipType_QQuickRenderControl, -1, 9}, 65 #else 66 {0, 0, -1, 9}, 67 #endif 68 {sipName_QSGTextureProvider, &sipType_QSGTextureProvider, -1, 10}, 69 {sipName_QQuickWindow, &sipType_QQuickWindow, 14, -1}, 70 #if QT_VERSION >= 0x050200 71 {sipName_QQuickFramebufferObject, &sipType_QQuickFramebufferObject, -1, 12}, 72 #else 73 {0, 0, -1, 12}, 74 #endif 75 {sipName_QQuickPaintedItem, &sipType_QQuickPaintedItem, -1, -1}, 76 {sipName_QSGDynamicTexture, &sipType_QSGDynamicTexture, -1, -1}, 77 {sipName_QQuickView, &sipType_QQuickView, -1, -1}, 78 }; 79 80 int i = 0; 81 82 sipType = NULL; 83 84 do 85 { 86 struct class_graph *cg = &graph[i]; 87 88 if (cg->name != NULL && sipCpp->inherits(cg->name)) 89 { 90 sipType = *cg->type; 91 i = cg->yes; 92 } 93 else 94 i = cg->no; 95 } 96 while (i >= 0); 97%End 98 99public: 100 enum CreateTextureOption 101 { 102 TextureHasAlphaChannel, 103 TextureHasMipmaps, 104 TextureOwnsGLTexture, 105%If (Qt_5_2_0 -) 106 TextureCanUseAtlas, 107%End 108%If (Qt_5_6_0 -) 109 TextureIsOpaque, 110%End 111 }; 112 113 typedef QFlags<QQuickWindow::CreateTextureOption> CreateTextureOptions; 114%If (Qt_5_6_1 -) 115 explicit QQuickWindow(QWindow *parent /TransferThis/ = 0); 116%End 117%If (- Qt_5_6_1) 118 QQuickWindow(QWindow *parent /TransferThis/ = 0); 119%End 120 virtual ~QQuickWindow() /ReleaseGIL/; 121 QQuickItem *contentItem() const; 122 QQuickItem *activeFocusItem() const; 123 virtual QObject *focusObject() const; 124 QQuickItem *mouseGrabberItem() const; 125 bool sendEvent(QQuickItem *, QEvent *); 126 QImage grabWindow() /ReleaseGIL/; 127%If (PyQt_OpenGL) 128 void setRenderTarget(QOpenGLFramebufferObject *fbo); 129%End 130%If (PyQt_OpenGL) 131 QOpenGLFramebufferObject *renderTarget() const; 132%End 133 void setRenderTarget(uint fboId, const QSize &size); 134 uint renderTargetId() const; 135 QSize renderTargetSize() const; 136 QQmlIncubationController *incubationController() const; 137 QSGTexture *createTextureFromImage(const QImage &image) const /Factory/; 138%If (Qt_5_2_0 -) 139 QSGTexture *createTextureFromImage(const QImage &image, QQuickWindow::CreateTextureOptions options) const /Factory/; 140%End 141 QSGTexture *createTextureFromId(uint id, const QSize &size, QQuickWindow::CreateTextureOptions options = QQuickWindow::CreateTextureOption()) const /Factory/; 142%If (Qt_5_14_0 -) 143 QSGTexture *createTextureFromNativeObject(QQuickWindow::NativeObjectType type, const void *nativeObjectPtr, int nativeLayout, const QSize &size, QQuickWindow::CreateTextureOptions options = QQuickWindow::CreateTextureOption()) const /Factory/; 144%End 145 void setClearBeforeRendering(bool enabled); 146 bool clearBeforeRendering() const; 147 void setColor(const QColor &color); 148 QColor color() const; 149 void setPersistentOpenGLContext(bool persistent); 150 bool isPersistentOpenGLContext() const; 151 void setPersistentSceneGraph(bool persistent); 152 bool isPersistentSceneGraph() const; 153%If (PyQt_OpenGL) 154 QOpenGLContext *openglContext() const; 155%End 156 157signals: 158 void frameSwapped(); 159 void sceneGraphInitialized(); 160 void sceneGraphInvalidated(); 161 void beforeSynchronizing(); 162 void beforeRendering(); 163 void afterRendering(); 164 void colorChanged(const QColor &); 165 166public slots: 167 void update(); 168 void releaseResources(); 169 170protected: 171 virtual void exposeEvent(QExposeEvent *); 172 virtual void resizeEvent(QResizeEvent *); 173 virtual void showEvent(QShowEvent *); 174 virtual void hideEvent(QHideEvent *); 175 virtual void focusInEvent(QFocusEvent *); 176 virtual void focusOutEvent(QFocusEvent *); 177 virtual bool event(QEvent *); 178 virtual void keyPressEvent(QKeyEvent *); 179 virtual void keyReleaseEvent(QKeyEvent *); 180 virtual void mousePressEvent(QMouseEvent *); 181 virtual void mouseReleaseEvent(QMouseEvent *); 182 virtual void mouseDoubleClickEvent(QMouseEvent *); 183 virtual void mouseMoveEvent(QMouseEvent *); 184 virtual void wheelEvent(QWheelEvent *); 185%If (Qt_5_15_0 -) 186 virtual void tabletEvent(QTabletEvent *); 187%End 188 189public: 190%If (Qt_5_1_0 -) 191 static bool hasDefaultAlphaBuffer(); 192%End 193%If (Qt_5_1_0 -) 194 static void setDefaultAlphaBuffer(bool useAlpha); 195%End 196 197signals: 198%If (Qt_5_1_0 -) 199 void closing(QQuickCloseEvent *close); 200%End 201%If (Qt_5_1_0 -) 202 void activeFocusItemChanged(); 203%End 204 205public: 206%If (Qt_5_2_0 -) 207%If (PyQt_OpenGL) 208 void resetOpenGLState(); 209%End 210%End 211%If (Qt_5_3_0 -) 212 213 enum SceneGraphError 214 { 215 ContextNotAvailable, 216 }; 217 218%End 219 220signals: 221%If (Qt_5_3_0 -) 222%If (PyQt_OpenGL) 223 void openglContextCreated(QOpenGLContext *context); 224%End 225%End 226%If (Qt_5_3_0 -) 227 void afterSynchronizing(); 228%End 229%If (Qt_5_3_0 -) 230 void afterAnimating(); 231%End 232%If (Qt_5_3_0 -) 233 void sceneGraphAboutToStop(); 234%End 235%If (Qt_5_3_0 -) 236 void sceneGraphError(QQuickWindow::SceneGraphError error, const QString &message); 237%End 238 239public: 240%If (Qt_5_4_0 -) 241 242 enum RenderStage 243 { 244 BeforeSynchronizingStage, 245 AfterSynchronizingStage, 246 BeforeRenderingStage, 247 AfterRenderingStage, 248 AfterSwapStage, 249%If (Qt_5_6_0 -) 250 NoStage, 251%End 252 }; 253 254%End 255%If (Qt_5_4_0 -) 256 void scheduleRenderJob(QRunnable *job /Transfer/, QQuickWindow::RenderStage schedule) /ReleaseGIL/; 257%End 258%If (Qt_5_4_0 -) 259 qreal effectiveDevicePixelRatio() const; 260%End 261%If (Qt_5_5_0 -) 262 bool isSceneGraphInitialized() const; 263%End 264%If (Qt_5_8_0 -) 265 QSGRendererInterface *rendererInterface() const; 266%End 267%If (Qt_5_8_0 -) 268 static void setSceneGraphBackend(QSGRendererInterface::GraphicsApi api); 269%End 270%If (Qt_5_8_0 -) 271 static void setSceneGraphBackend(const QString &backend); 272%End 273%If (Qt_5_8_0 -) 274 QSGRectangleNode *createRectangleNode() const /Factory/; 275%End 276%If (Qt_5_8_0 -) 277 QSGImageNode *createImageNode() const /Factory/; 278%End 279%If (Qt_5_9_0 -) 280 static QString sceneGraphBackend(); 281%End 282%If (Qt_5_10_0 -) 283 284 enum TextRenderType 285 { 286 QtTextRendering, 287 NativeTextRendering, 288 }; 289 290%End 291%If (Qt_5_10_0 -) 292 static QQuickWindow::TextRenderType textRenderType(); 293%End 294%If (Qt_5_10_0 -) 295 static void setTextRenderType(QQuickWindow::TextRenderType renderType); 296%End 297%If (Qt_5_14_0 -) 298 299 enum NativeObjectType 300 { 301 NativeObjectTexture, 302 }; 303 304%End 305%If (Qt_5_14_0 -) 306 void beginExternalCommands(); 307%End 308%If (Qt_5_14_0 -) 309 void endExternalCommands(); 310%End 311 312signals: 313%If (Qt_5_14_0 -) 314 void beforeRenderPassRecording(); 315%End 316%If (Qt_5_14_0 -) 317 void afterRenderPassRecording(); 318%End 319}; 320 321%If (Qt_5_1_0 -) 322class QQuickCloseEvent; 323%End 324 325%ModuleHeaderCode 326#include "qpyquick_api.h" 327%End 328 329%PostInitialisationCode 330qpyquick_post_init(); 331%End 332