1// qguiapplication.sip generated by MetaSIP 2// 3// This file is part of the QtGui 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 QGuiApplication : QCoreApplication 24{ 25%TypeHeaderCode 26#include <qguiapplication.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 >= 0x050100 && defined(SIP_FEATURE_PyQt_Desktop_OpenGL) 36 {sipName_QOpenGLTimeMonitor, &sipType_QOpenGLTimeMonitor, -1, 1}, 37 #else 38 {0, 0, -1, 1}, 39 #endif 40 {sipName_QSyntaxHighlighter, &sipType_QSyntaxHighlighter, -1, 2}, 41 {sipName_QWindow, &sipType_QWindow, 25, 3}, 42 {sipName_QPdfWriter, &sipType_QPdfWriter, -1, 4}, 43 {sipName_QMovie, &sipType_QMovie, -1, 5}, 44 #if defined(SIP_FEATURE_PyQt_SessionManager) 45 {sipName_QSessionManager, &sipType_QSessionManager, -1, 6}, 46 #else 47 {0, 0, -1, 6}, 48 #endif 49 {sipName_QAbstractTextDocumentLayout, &sipType_QAbstractTextDocumentLayout, -1, 7}, 50 {sipName_QScreen, &sipType_QScreen, -1, 8}, 51 {sipName_QTextObject, &sipType_QTextObject, 28, 9}, 52 {sipName_QStandardItemModel, &sipType_QStandardItemModel, -1, 10}, 53 {sipName_QDrag, &sipType_QDrag, -1, 11}, 54 #if defined(SIP_FEATURE_PyQt_OpenGL) 55 {sipName_QOpenGLContextGroup, &sipType_QOpenGLContextGroup, -1, 12}, 56 #else 57 {0, 0, -1, 12}, 58 #endif 59 {sipName_QValidator, &sipType_QValidator, 32, 13}, 60 {sipName_QTextDocument, &sipType_QTextDocument, -1, 14}, 61 #if QT_VERSION >= 0x050100 && defined(SIP_FEATURE_PyQt_OpenGL) 62 {sipName_QOpenGLVertexArrayObject, &sipType_QOpenGLVertexArrayObject, -1, 15}, 63 #else 64 {0, 0, -1, 15}, 65 #endif 66 #if QT_VERSION >= 0x050100 && defined(SIP_FEATURE_PyQt_OpenGL) 67 {sipName_QOpenGLDebugLogger, &sipType_QOpenGLDebugLogger, -1, 16}, 68 #else 69 {0, 0, -1, 16}, 70 #endif 71 {sipName_QGuiApplication, &sipType_QGuiApplication, -1, 17}, 72 #if QT_VERSION >= 0x050100 && defined(SIP_FEATURE_PyQt_Desktop_OpenGL) 73 {sipName_QOpenGLTimerQuery, &sipType_QOpenGLTimerQuery, -1, 18}, 74 #else 75 {0, 0, -1, 18}, 76 #endif 77 #if QT_VERSION >= 0x050100 78 {sipName_QOffscreenSurface, &sipType_QOffscreenSurface, -1, 19}, 79 #else 80 {0, 0, -1, 19}, 81 #endif 82 #if defined(SIP_FEATURE_PyQt_OpenGL) 83 {sipName_QOpenGLShaderProgram, &sipType_QOpenGLShaderProgram, -1, 20}, 84 #else 85 {0, 0, -1, 20}, 86 #endif 87 {sipName_QStyleHints, &sipType_QStyleHints, -1, 21}, 88 {sipName_QClipboard, &sipType_QClipboard, -1, 22}, 89 #if defined(SIP_FEATURE_PyQt_OpenGL) 90 {sipName_QOpenGLShader, &sipType_QOpenGLShader, -1, 23}, 91 #else 92 {0, 0, -1, 23}, 93 #endif 94 #if defined(SIP_FEATURE_PyQt_OpenGL) 95 {sipName_QOpenGLContext, &sipType_QOpenGLContext, -1, 24}, 96 #else 97 {0, 0, -1, 24}, 98 #endif 99 {sipName_QInputMethod, &sipType_QInputMethod, -1, -1}, 100 #if QT_VERSION >= 0x050400 101 {sipName_QPaintDeviceWindow, &sipType_QPaintDeviceWindow, 26, -1}, 102 #else 103 {0, 0, 26, -1}, 104 #endif 105 #if QT_VERSION >= 0x050400 && defined(SIP_FEATURE_PyQt_OpenGL) 106 {sipName_QOpenGLWindow, &sipType_QOpenGLWindow, -1, 27}, 107 #else 108 {0, 0, -1, 27}, 109 #endif 110 #if QT_VERSION >= 0x050400 111 {sipName_QRasterWindow, &sipType_QRasterWindow, -1, -1}, 112 #else 113 {0, 0, -1, -1}, 114 #endif 115 {sipName_QTextBlockGroup, &sipType_QTextBlockGroup, 30, 29}, 116 {sipName_QTextFrame, &sipType_QTextFrame, 31, -1}, 117 {sipName_QTextList, &sipType_QTextList, -1, -1}, 118 {sipName_QTextTable, &sipType_QTextTable, -1, -1}, 119 #if QT_VERSION >= 0x050100 120 {sipName_QRegularExpressionValidator, &sipType_QRegularExpressionValidator, -1, 33}, 121 #else 122 {0, 0, -1, 33}, 123 #endif 124 {sipName_QIntValidator, &sipType_QIntValidator, -1, 34}, 125 {sipName_QDoubleValidator, &sipType_QDoubleValidator, -1, 35}, 126 {sipName_QRegExpValidator, &sipType_QRegExpValidator, -1, -1}, 127 }; 128 129 int i = 0; 130 131 sipType = NULL; 132 133 do 134 { 135 struct class_graph *cg = &graph[i]; 136 137 if (cg->name != NULL && sipCpp->inherits(cg->name)) 138 { 139 sipType = *cg->type; 140 i = cg->yes; 141 } 142 else 143 i = cg->no; 144 } 145 while (i >= 0); 146%End 147 148public: 149 QGuiApplication(SIP_PYLIST argv /TypeHint="List[str]"/) /PostHook=__pyQtQAppHook__/ [(int &argc, char **argv, int = ApplicationFlags)]; 150%MethodCode 151 // The Python interface is a list of argument strings that is modified. 152 153 int argc; 154 char **argv; 155 156 // Convert the list. 157 if ((argv = pyqt5_qtgui_from_argv_list(a0, argc)) == NULL) 158 sipIsErr = 1; 159 else 160 { 161 // Create it now the arguments are right. 162 static int nargc; 163 nargc = argc; 164 165 Py_BEGIN_ALLOW_THREADS 166 sipCpp = new sipQGuiApplication(nargc, argv, QCoreApplication::ApplicationFlags); 167 Py_END_ALLOW_THREADS 168 169 // Now modify the original list. 170 pyqt5_qtgui_update_argv_list(a0, argc, argv); 171 } 172%End 173 174 virtual ~QGuiApplication() /ReleaseGIL/; 175%MethodCode 176 pyqt5_qtgui_cleanup_qobjects(); 177%End 178 179 static QWindowList allWindows(); 180 static QWindowList topLevelWindows(); 181 static QWindow *topLevelAt(const QPoint &pos); 182 static QString platformName(); 183 static QWindow *focusWindow(); 184 static QObject *focusObject(); 185 static QScreen *primaryScreen(); 186 static QList<QScreen *> screens(); 187 static QCursor *overrideCursor(); 188 static void setOverrideCursor(const QCursor &); 189 static void changeOverrideCursor(const QCursor &); 190 static void restoreOverrideCursor(); 191 static QFont font(); 192 static void setFont(const QFont &); 193 static QClipboard *clipboard(); 194 static QPalette palette(); 195 static void setPalette(const QPalette &pal); 196 static Qt::KeyboardModifiers keyboardModifiers(); 197 static Qt::KeyboardModifiers queryKeyboardModifiers(); 198 static Qt::MouseButtons mouseButtons(); 199 static void setLayoutDirection(Qt::LayoutDirection direction); 200 static Qt::LayoutDirection layoutDirection(); 201 static bool isRightToLeft(); 202 static bool isLeftToRight(); 203 static void setDesktopSettingsAware(bool on); 204 static bool desktopSettingsAware(); 205 static void setQuitOnLastWindowClosed(bool quit); 206 static bool quitOnLastWindowClosed(); 207 static int exec() /PostHook=__pyQtPostEventLoopHook__,PreHook=__pyQtPreEventLoopHook__,PyName=exec_,ReleaseGIL/; 208%If (Py_v3) 209 static int exec() /PostHook=__pyQtPostEventLoopHook__,PreHook=__pyQtPreEventLoopHook__,ReleaseGIL/; 210%End 211 virtual bool notify(QObject *, QEvent *); 212 213signals: 214 void fontDatabaseChanged(); 215 void screenAdded(QScreen *screen); 216 void lastWindowClosed(); 217 void focusObjectChanged(QObject *focusObject); 218%If (PyQt_SessionManager) 219 void commitDataRequest(QSessionManager &sessionManager); 220%End 221%If (PyQt_SessionManager) 222 void saveStateRequest(QSessionManager &sessionManager); 223%End 224 void focusWindowChanged(QWindow *focusWindow); 225%If (Qt_5_2_0 -) 226 void applicationStateChanged(Qt::ApplicationState state); 227%End 228%If (Qt_5_8_0 -) 229 void applicationDisplayNameChanged(); 230%End 231 232public: 233 static void setApplicationDisplayName(const QString &name); 234 static QString applicationDisplayName(); 235 static QWindow *modalWindow(); 236 static QStyleHints *styleHints(); 237 static QInputMethod *inputMethod(); 238 qreal devicePixelRatio() const; 239%If (PyQt_SessionManager) 240 bool isSessionRestored() const; 241%End 242%If (PyQt_SessionManager) 243 QString sessionId() const; 244%End 245%If (PyQt_SessionManager) 246 QString sessionKey() const; 247%End 248%If (PyQt_SessionManager) 249 bool isSavingSession() const; 250%End 251%If (Qt_5_2_0 -) 252 static Qt::ApplicationState applicationState(); 253%End 254%If (Qt_5_2_0 -) 255 static void sync(); 256%End 257%If (Qt_5_3_0 -) 258 static void setWindowIcon(const QIcon &icon); 259%End 260%If (Qt_5_3_0 -) 261 static QIcon windowIcon(); 262%End 263 264protected: 265 virtual bool event(QEvent *); 266 267signals: 268%If (Qt_5_4_0 -) 269 void screenRemoved(QScreen *screen); 270%End 271%If (Qt_5_4_0 -) 272 void layoutDirectionChanged(Qt::LayoutDirection direction); 273%End 274%If (Qt_5_4_0 -) 275 void paletteChanged(const QPalette &pal); 276%End 277 278public: 279%If (Qt_5_6_0 -) 280%If (PyQt_SessionManager) 281 static bool isFallbackSessionManagementEnabled(); 282%End 283%End 284%If (Qt_5_6_0 -) 285%If (PyQt_SessionManager) 286 static void setFallbackSessionManagementEnabled(bool); 287%End 288%End 289 290signals: 291%If (Qt_5_6_0 -) 292 void primaryScreenChanged(QScreen *screen); 293%End 294 295public: 296%If (Qt_5_7_0 -) 297 static void setDesktopFileName(const QString &name); 298%End 299%If (Qt_5_7_0 -) 300 static QString desktopFileName(); 301%End 302%If (Qt_5_10_0 -) 303 static QScreen *screenAt(const QPoint &point); 304%End 305 306signals: 307%If (Qt_5_11_0 -) 308 void fontChanged(const QFont &font); 309%End 310 311public: 312%If (Qt_5_14_0 -) 313 static void setHighDpiScaleFactorRoundingPolicy(Qt::HighDpiScaleFactorRoundingPolicy policy); 314%End 315%If (Qt_5_14_0 -) 316 static Qt::HighDpiScaleFactorRoundingPolicy highDpiScaleFactorRoundingPolicy(); 317%End 318}; 319 320%ModuleHeaderCode 321// Imports from QtCore. 322typedef void (*pyqt5_qtgui_cleanup_qobjects_t)(); 323extern pyqt5_qtgui_cleanup_qobjects_t pyqt5_qtgui_cleanup_qobjects; 324 325typedef char **(*pyqt5_qtgui_from_argv_list_t)(PyObject *, int &); 326extern pyqt5_qtgui_from_argv_list_t pyqt5_qtgui_from_argv_list; 327 328typedef void (*pyqt5_qtgui_update_argv_list_t)(PyObject *, int, char **); 329extern pyqt5_qtgui_update_argv_list_t pyqt5_qtgui_update_argv_list; 330%End 331 332%ModuleCode 333// Imports from QtCore. 334pyqt5_qtgui_cleanup_qobjects_t pyqt5_qtgui_cleanup_qobjects; 335pyqt5_qtgui_from_argv_list_t pyqt5_qtgui_from_argv_list; 336pyqt5_qtgui_update_argv_list_t pyqt5_qtgui_update_argv_list; 337 338// Forward declarations not in any header files but are part of the API. 339void qt_set_sequence_auto_mnemonic(bool enable); 340%End 341 342%InitialisationCode 343// Export our own helpers. 344sipExportSymbol("qtgui_wrap_ancestors", (void *)qtgui_wrap_ancestors); 345%End 346 347%PostInitialisationCode 348// Imports from QtCore. 349pyqt5_qtgui_cleanup_qobjects = (pyqt5_qtgui_cleanup_qobjects_t)sipImportSymbol("pyqt5_cleanup_qobjects"); 350Q_ASSERT(pyqt5_qtgui_cleanup_qobjects); 351 352pyqt5_qtgui_from_argv_list = (pyqt5_qtgui_from_argv_list_t)sipImportSymbol("pyqt5_from_argv_list"); 353Q_ASSERT(pyqt5_qtgui_from_argv_list); 354 355pyqt5_qtgui_update_argv_list = (pyqt5_qtgui_update_argv_list_t)sipImportSymbol("pyqt5_update_argv_list"); 356Q_ASSERT(pyqt5_qtgui_update_argv_list); 357%End 358