qwindow.sip 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. // qwindow.sip generated by MetaSIP
  2. //
  3. // This file is part of the QtGui 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 QWindow : public QObject, public QSurface
  22. {
  23. %TypeHeaderCode
  24. #include <qwindow.h>
  25. %End
  26. public:
  27. explicit QWindow(QScreen *screen = 0);
  28. explicit QWindow(QWindow *parent /TransferThis/);
  29. virtual ~QWindow();
  30. void setSurfaceType(QSurface::SurfaceType surfaceType);
  31. virtual QSurface::SurfaceType surfaceType() const;
  32. bool isVisible() const;
  33. void create();
  34. WId winId() const;
  35. QWindow *parent(QWindow::AncestorMode mode = QWindow::ExcludeTransients) const;
  36. void setParent(QWindow *parent /Transfer/);
  37. bool isTopLevel() const;
  38. bool isModal() const;
  39. Qt::WindowModality modality() const;
  40. void setModality(Qt::WindowModality modality);
  41. void setFormat(const QSurfaceFormat &format);
  42. virtual QSurfaceFormat format() const;
  43. QSurfaceFormat requestedFormat() const;
  44. void setFlags(Qt::WindowFlags flags);
  45. Qt::WindowFlags flags() const;
  46. Qt::WindowType type() const;
  47. QString title() const;
  48. void setOpacity(qreal level);
  49. public slots:
  50. void requestActivate();
  51. public:
  52. bool isActive() const;
  53. void reportContentOrientationChange(Qt::ScreenOrientation orientation);
  54. Qt::ScreenOrientation contentOrientation() const;
  55. qreal devicePixelRatio() const;
  56. Qt::WindowState windowState() const;
  57. void setWindowState(Qt::WindowState state);
  58. void setTransientParent(QWindow *parent);
  59. QWindow *transientParent() const;
  60. enum AncestorMode
  61. {
  62. ExcludeTransients,
  63. IncludeTransients,
  64. };
  65. bool isAncestorOf(const QWindow *child, QWindow::AncestorMode mode = QWindow::IncludeTransients) const;
  66. bool isExposed() const;
  67. int minimumWidth() const;
  68. int minimumHeight() const;
  69. int maximumWidth() const;
  70. int maximumHeight() const;
  71. QSize minimumSize() const;
  72. QSize maximumSize() const;
  73. QSize baseSize() const;
  74. QSize sizeIncrement() const;
  75. void setMinimumSize(const QSize &size);
  76. void setMaximumSize(const QSize &size);
  77. void setBaseSize(const QSize &size);
  78. void setSizeIncrement(const QSize &size);
  79. void setGeometry(int posx, int posy, int w, int h);
  80. void setGeometry(const QRect &rect);
  81. QRect geometry() const;
  82. QMargins frameMargins() const;
  83. QRect frameGeometry() const;
  84. QPoint framePosition() const;
  85. void setFramePosition(const QPoint &point);
  86. int width() const;
  87. int height() const;
  88. int x() const;
  89. int y() const;
  90. virtual QSize size() const;
  91. QPoint position() const;
  92. void setPosition(const QPoint &pt);
  93. void setPosition(int posx, int posy);
  94. void resize(const QSize &newSize);
  95. void resize(int w, int h);
  96. void setFilePath(const QString &filePath);
  97. QString filePath() const;
  98. void setIcon(const QIcon &icon);
  99. QIcon icon() const;
  100. void destroy();
  101. bool setKeyboardGrabEnabled(bool grab);
  102. bool setMouseGrabEnabled(bool grab);
  103. QScreen *screen() const;
  104. void setScreen(QScreen *screen);
  105. virtual QObject *focusObject() const;
  106. QPoint mapToGlobal(const QPoint &pos) const;
  107. QPointF mapToGlobal(const QPointF &pos) const;
  108. QPoint mapFromGlobal(const QPoint &pos) const;
  109. QPointF mapFromGlobal(const QPointF &pos) const;
  110. QCursor cursor() const;
  111. void setCursor(const QCursor &);
  112. void unsetCursor();
  113. public slots:
  114. void setVisible(bool visible);
  115. void show() /ReleaseGIL/;
  116. void hide();
  117. void showMinimized() /ReleaseGIL/;
  118. void showMaximized() /ReleaseGIL/;
  119. void showFullScreen() /ReleaseGIL/;
  120. void showNormal() /ReleaseGIL/;
  121. bool close();
  122. void raise();
  123. void lower();
  124. void setTitle(const QString &);
  125. void setX(int arg);
  126. void setY(int arg);
  127. void setWidth(int arg);
  128. void setHeight(int arg);
  129. void setMinimumWidth(int w);
  130. void setMinimumHeight(int h);
  131. void setMaximumWidth(int w);
  132. void setMaximumHeight(int h);
  133. void alert(int msec);
  134. void requestUpdate();
  135. signals:
  136. void screenChanged(QScreen *screen);
  137. void modalityChanged(Qt::WindowModality modality);
  138. void windowStateChanged(Qt::WindowState windowState);
  139. void xChanged(int arg);
  140. void yChanged(int arg);
  141. void widthChanged(int arg);
  142. void heightChanged(int arg);
  143. void minimumWidthChanged(int arg);
  144. void minimumHeightChanged(int arg);
  145. void maximumWidthChanged(int arg);
  146. void maximumHeightChanged(int arg);
  147. void visibleChanged(bool arg);
  148. void contentOrientationChanged(Qt::ScreenOrientation orientation);
  149. void focusObjectChanged(QObject *object);
  150. void windowTitleChanged(const QString &title);
  151. protected:
  152. virtual void exposeEvent(QExposeEvent *);
  153. virtual void resizeEvent(QResizeEvent *);
  154. virtual void moveEvent(QMoveEvent *);
  155. virtual void focusInEvent(QFocusEvent *);
  156. virtual void focusOutEvent(QFocusEvent *);
  157. virtual void showEvent(QShowEvent *);
  158. virtual void hideEvent(QHideEvent *);
  159. virtual bool event(QEvent *);
  160. virtual void keyPressEvent(QKeyEvent *);
  161. virtual void keyReleaseEvent(QKeyEvent *);
  162. virtual void mousePressEvent(QMouseEvent *);
  163. virtual void mouseReleaseEvent(QMouseEvent *);
  164. virtual void mouseDoubleClickEvent(QMouseEvent *);
  165. virtual void mouseMoveEvent(QMouseEvent *);
  166. virtual void wheelEvent(QWheelEvent *);
  167. virtual void touchEvent(QTouchEvent *);
  168. virtual void tabletEvent(QTabletEvent *);
  169. public:
  170. enum Visibility
  171. {
  172. Hidden,
  173. AutomaticVisibility,
  174. Windowed,
  175. Minimized,
  176. Maximized,
  177. FullScreen,
  178. };
  179. QWindow::Visibility visibility() const;
  180. void setVisibility(QWindow::Visibility v);
  181. qreal opacity() const;
  182. void setMask(const QRegion &region);
  183. QRegion mask() const;
  184. static QWindow *fromWinId(WId id);
  185. signals:
  186. void visibilityChanged(QWindow::Visibility visibility);
  187. void activeChanged();
  188. void opacityChanged(qreal opacity);
  189. public:
  190. void setFlag(Qt::WindowType, bool on = true);
  191. Qt::WindowStates windowStates() const;
  192. void setWindowStates(Qt::WindowStates states);
  193. public slots:
  194. bool startSystemResize(Qt::Edges edges);
  195. bool startSystemMove();
  196. protected:
  197. virtual void paintEvent(QPaintEvent *);
  198. virtual void closeEvent(QCloseEvent *);
  199. virtual bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result /Out/);
  200. public:
  201. %If (PyQt_Vulkan)
  202. void setVulkanInstance(QVulkanInstance *instance);
  203. %End
  204. %If (PyQt_Vulkan)
  205. QVulkanInstance *vulkanInstance() const;
  206. %End
  207. %If (Qt_6_9_0 -)
  208. QMargins safeAreaMargins() const;
  209. %End
  210. signals:
  211. %If (Qt_6_9_0 -)
  212. void safeAreaMarginsChanged(QMargins arg);
  213. %End
  214. %If (Qt_6_10_0 -)
  215. void flagsChanged(Qt::WindowFlags flags);
  216. %End
  217. };