qquickwindow.sip 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. // qquickwindow.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtQuick Python extension module.
  4. //
  5. // Copyright (c) 2026 Riverbank Computing Limited <info@riverbankcomputing.com>
  6. //
  7. // This file is part of PyQt6.
  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. class QQuickWindow : public QWindow /ExportDerived/
  22. {
  23. %TypeHeaderCode
  24. #include <qquickwindow.h>
  25. %End
  26. %ConvertToSubClassCode
  27. static struct class_graph {
  28. const char *name;
  29. sipTypeDef **type;
  30. int yes, no;
  31. } graph[] = {
  32. {sipName_QQuickImageProvider, &sipType_QQuickImageProvider, 10, 1},
  33. {sipName_QQuickItem, &sipType_QQuickItem, 11, 2},
  34. {sipName_QQuickImageResponse, &sipType_QQuickImageResponse, -1, 3},
  35. {sipName_QQuickItemGrabResult, &sipType_QQuickItemGrabResult, -1, 4},
  36. {sipName_QQuickRenderControl, &sipType_QQuickRenderControl, -1, 5},
  37. {sipName_QQuickTextDocument, &sipType_QQuickTextDocument, -1, 6},
  38. {sipName_QQuickTextureFactory, &sipType_QQuickTextureFactory, -1, 7},
  39. {sipName_QQuickWindow, &sipType_QQuickWindow, 13, 8},
  40. {sipName_QSGTexture, &sipType_QSGTexture, 14, 9},
  41. {sipName_QSGTextureProvider, &sipType_QSGTextureProvider, -1, -1},
  42. {sipName_QQuickAsyncImageProvider, &sipType_QQuickAsyncImageProvider, -1, -1},
  43. {sipName_QQuickFramebufferObject, &sipType_QQuickFramebufferObject, -1, 12},
  44. {sipName_QQuickPaintedItem, &sipType_QQuickPaintedItem, -1, -1},
  45. {sipName_QQuickView, &sipType_QQuickView, -1, -1},
  46. {sipName_QSGDynamicTexture, &sipType_QSGDynamicTexture, -1, -1},
  47. };
  48. int i = 0;
  49. sipType = NULL;
  50. do
  51. {
  52. struct class_graph *cg = &graph[i];
  53. if (cg->name != NULL && sipCpp->inherits(cg->name))
  54. {
  55. sipType = *cg->type;
  56. i = cg->yes;
  57. }
  58. else
  59. i = cg->no;
  60. }
  61. while (i >= 0);
  62. %End
  63. public:
  64. enum CreateTextureOption /BaseType=Flag/
  65. {
  66. TextureHasAlphaChannel,
  67. TextureHasMipmaps,
  68. TextureOwnsGLTexture,
  69. TextureCanUseAtlas,
  70. TextureIsOpaque,
  71. };
  72. typedef QFlags<QQuickWindow::CreateTextureOption> CreateTextureOptions;
  73. explicit QQuickWindow(QWindow *parent /TransferThis/ = 0);
  74. virtual ~QQuickWindow() /ReleaseGIL/;
  75. QQuickItem *contentItem() const;
  76. QQuickItem *activeFocusItem() const;
  77. virtual QObject *focusObject() const;
  78. QQuickItem *mouseGrabberItem() const;
  79. QImage grabWindow() /ReleaseGIL/;
  80. void setRenderTarget(const QQuickRenderTarget &target);
  81. QQuickRenderTarget renderTarget() const;
  82. QQmlIncubationController *incubationController() const;
  83. %If (Qt_6_7_0 -)
  84. QSGTextNode *createTextNode() const /Factory/;
  85. %End
  86. QSGTexture *createTextureFromImage(const QImage &image) const /Factory/;
  87. QSGTexture *createTextureFromImage(const QImage &image, QQuickWindow::CreateTextureOptions options) const /Factory/;
  88. void setColor(const QColor &color);
  89. QColor color() const;
  90. void setPersistentSceneGraph(bool persistent);
  91. bool isPersistentSceneGraph() const;
  92. signals:
  93. void frameSwapped();
  94. void sceneGraphInitialized();
  95. void sceneGraphInvalidated();
  96. void beforeSynchronizing();
  97. void beforeRendering();
  98. void afterRendering();
  99. void colorChanged(const QColor &);
  100. public slots:
  101. void update();
  102. void releaseResources();
  103. protected:
  104. virtual void exposeEvent(QExposeEvent *);
  105. virtual void resizeEvent(QResizeEvent *);
  106. virtual void showEvent(QShowEvent *);
  107. virtual void hideEvent(QHideEvent *);
  108. virtual void focusInEvent(QFocusEvent *);
  109. virtual void focusOutEvent(QFocusEvent *);
  110. virtual bool event(QEvent *);
  111. virtual void keyPressEvent(QKeyEvent *);
  112. virtual void keyReleaseEvent(QKeyEvent *);
  113. virtual void mousePressEvent(QMouseEvent *);
  114. virtual void mouseReleaseEvent(QMouseEvent *);
  115. virtual void mouseDoubleClickEvent(QMouseEvent *);
  116. virtual void mouseMoveEvent(QMouseEvent *);
  117. virtual void wheelEvent(QWheelEvent *);
  118. virtual void tabletEvent(QTabletEvent *);
  119. virtual void closeEvent(QCloseEvent *);
  120. public:
  121. static bool hasDefaultAlphaBuffer();
  122. static void setDefaultAlphaBuffer(bool useAlpha);
  123. signals:
  124. void closing(QQuickCloseEvent *close);
  125. void activeFocusItemChanged();
  126. public:
  127. enum SceneGraphError
  128. {
  129. ContextNotAvailable,
  130. };
  131. signals:
  132. void afterSynchronizing();
  133. void afterAnimating();
  134. void sceneGraphAboutToStop();
  135. void sceneGraphError(QQuickWindow::SceneGraphError error, const QString &message);
  136. public:
  137. enum RenderStage
  138. {
  139. BeforeSynchronizingStage,
  140. AfterSynchronizingStage,
  141. BeforeRenderingStage,
  142. AfterRenderingStage,
  143. AfterSwapStage,
  144. NoStage,
  145. };
  146. void scheduleRenderJob(QRunnable *job /Transfer/, QQuickWindow::RenderStage schedule) /ReleaseGIL/;
  147. qreal effectiveDevicePixelRatio() const;
  148. bool isSceneGraphInitialized() const;
  149. QSGRendererInterface *rendererInterface() const;
  150. static void setSceneGraphBackend(const QString &backend);
  151. QSGRectangleNode *createRectangleNode() const /Factory/;
  152. QSGImageNode *createImageNode() const /Factory/;
  153. static QString sceneGraphBackend();
  154. enum TextRenderType
  155. {
  156. QtTextRendering,
  157. NativeTextRendering,
  158. %If (Qt_6_7_0 -)
  159. CurveTextRendering,
  160. %End
  161. };
  162. static QQuickWindow::TextRenderType textRenderType();
  163. static void setTextRenderType(QQuickWindow::TextRenderType renderType);
  164. void beginExternalCommands();
  165. void endExternalCommands();
  166. signals:
  167. void beforeRenderPassRecording();
  168. void afterRenderPassRecording();
  169. void beforeFrameBegin();
  170. void afterFrameEnd();
  171. public:
  172. void setPersistentGraphics(bool persistent);
  173. bool isPersistentGraphics() const;
  174. static void setGraphicsApi(QSGRendererInterface::GraphicsApi api);
  175. static QSGRendererInterface::GraphicsApi graphicsApi();
  176. void setGraphicsDevice(const QQuickGraphicsDevice &device);
  177. QQuickGraphicsDevice graphicsDevice() const;
  178. void setGraphicsConfiguration(const QQuickGraphicsConfiguration &config);
  179. QQuickGraphicsConfiguration graphicsConfiguration() const;
  180. signals:
  181. %If (Qt_6_11_0 -)
  182. void devicePixelRatioChanged();
  183. %End
  184. };
  185. class QQuickCloseEvent;
  186. %ModuleHeaderCode
  187. #include "qpyquick_api.h"
  188. %End
  189. %PostInitialisationCode
  190. qpyquick_post_init();
  191. %End