1// qglobal.sip generated by MetaSIP
2//
3// This file is part of the QtCore 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
23%ModuleCode
24#include <qglobal.h>
25%End
26
27// PyQt version information.
28int PYQT_VERSION;
29const char *PYQT_VERSION_STR;
30
31%ModuleCode
32static int PYQT_VERSION = 0x050f04;
33static const char *PYQT_VERSION_STR = "5.15.4";
34%End
35const int QT_VERSION;
36const char *QT_VERSION_STR;
37typedef signed char qint8 /PyInt/;
38typedef unsigned char quint8 /PyInt/;
39typedef short qint16;
40typedef unsigned short quint16;
41typedef int qint32;
42typedef unsigned int quint32;
43typedef long long qint64;
44typedef unsigned long long quint64;
45typedef qint64 qlonglong;
46typedef quint64 qulonglong;
47%If (PyQt_qreal_double)
48typedef double qreal;
49%End
50%If (!PyQt_qreal_double)
51typedef float qreal;
52%End
53typedef unsigned char uchar;
54typedef unsigned short ushort;
55typedef unsigned int uint;
56typedef unsigned long ulong;
57double qAbs(const double &t);
58int qRound(qreal d);
59qint64 qRound64(qreal d);
60const char *qVersion();
61bool qSharedBuild();
62// Template definition for QFlags.
63template<ENUM>
64class QFlags /NoDefaultCtors, PyQtFlagsEnums="ENUM", TypeHintIn="Union[QFlags, ENUM]"/
65{
66public:
67    // QFlags is supposed to be a more type safe version of an int (even though
68    // Qt has cases where it expects multiple flag types to be or-ed together).
69    // Because of the C++ int() operator and because type(ENUM) is a sub-type
70    // of int, most of this is lost.  Therefore we only implement logical
71    // operators that take int arguments.
72    QFlags();
73    QFlags(int f /TypeHint="QFlags"/);
74
75    // This will never be called because the above ctor will be invoked first.
76    // However it's required for sip to generate assignment helpers.
77    QFlags(const QFlags &);
78
79    operator int() const;
80
81    // This is required for Python v3.8 and later.
82    int __index__() const;
83%MethodCode
84        sipRes = sipCpp->operator QFlags::Int();
85%End
86
87    QFlags operator~() const;
88
89    QFlags operator&(int f /TypeHint="QFlags"/) const;
90    QFlags &operator&=(int f /TypeHint="QFlags"/);
91
92    QFlags operator|(int f /TypeHint="QFlags"/) const;
93    QFlags &operator|=(int f /TypeHint="QFlags"/);
94%MethodCode
95        *sipCpp = QFlags(*sipCpp | a0);
96%End
97
98    QFlags operator^(int f /TypeHint="QFlags"/) const;
99    QFlags &operator^=(int f /TypeHint="QFlags"/);
100%MethodCode
101        *sipCpp = QFlags(*sipCpp ^ a0);
102%End
103
104    // These are necessary to prevent Python comparing object IDs.
105    bool operator==(const QFlags &f) const;
106%MethodCode
107        sipRes = (sipCpp->operator QFlags::Int() == a0->operator QFlags::Int());
108%End
109
110    bool operator!=(const QFlags &f) const;
111%MethodCode
112        sipRes = (sipCpp->operator QFlags::Int() != a0->operator QFlags::Int());
113%End
114
115    int __bool__() const;
116%MethodCode
117        sipRes = (sipCpp->operator QFlags::Int() != 0);
118%End
119
120    long __hash__() const;
121%MethodCode
122        sipRes = sipCpp->operator QFlags::Int();
123%End
124
125
126%ConvertToTypeCode
127// Allow an instance of the base enum whenever a QFlags is expected.
128
129if (sipIsErr == NULL)
130    return (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_ENUM)) ||
131            sipCanConvertToType(sipPy, sipType_QFlags, SIP_NO_CONVERTORS));
132
133if (PyObject_TypeCheck(sipPy, sipTypeAsPyTypeObject(sipType_ENUM)))
134{
135    *sipCppPtr = new QFlags(int(SIPLong_AsLong(sipPy)));
136
137    return sipGetState(sipTransferObj);
138}
139
140*sipCppPtr = reinterpret_cast<QFlags *>(sipConvertToType(sipPy, sipType_QFlags, sipTransferObj, SIP_NO_CONVERTORS, 0, sipIsErr));
141
142return 0;
143%End
144};
145// Hook's into Qt's resource system.
146%ModuleCode
147QT_BEGIN_NAMESPACE
148extern bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
149extern bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
150QT_END_NAMESPACE
151%End
152
153bool qRegisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
154bool qUnregisterResourceData(int, const unsigned char *, const unsigned char *, const unsigned char *);
155bool qFuzzyCompare(double p1, double p2);
156bool qIsNull(double d);
157void qsrand(uint seed);
158int qrand();
159typedef void *QFunctionPointer;
160// Mapped type for qintptr.
161// Map qintptr onto sip.voidptr.  This means either an address (on Windows) or
162// an integer file descriptor (on everything else) can be used.
163%MappedType qintptr /TypeHint="PyQt5.sip.voidptr"/
164{
165%TypeHeaderCode
166#include <QtGlobal>
167%End
168
169%ConvertToTypeCode
170    qintptr ptr = (qintptr)sipConvertToVoidPtr(sipPy);
171
172    if (!sipIsErr)
173        return !PyErr_Occurred();
174
175    // Mapped types deal with pointers, so create one on the heap.
176    qintptr *heap = new qintptr;
177    *heap = ptr;
178
179    *sipCppPtr = heap;
180
181    // Make sure the pointer doesn't leak.
182    return SIP_TEMPORARY;
183%End
184
185%ConvertFromTypeCode
186    return sipConvertFromVoidPtr((void *)*sipCpp);
187%End
188};
189// Mapped type for quintptr.
190// Map quintptr onto sip.voidptr.  This means either an address (on Windows) or
191// an integer file descriptor (on everything else) can be used.
192%MappedType quintptr /TypeHint="PyQt5.sip.voidptr"/
193{
194%TypeHeaderCode
195#include <QtGlobal>
196%End
197
198%ConvertToTypeCode
199    quintptr ptr = (quintptr)sipConvertToVoidPtr(sipPy);
200
201    if (!sipIsErr)
202        return !PyErr_Occurred();
203
204    // Mapped types deal with pointers, so create one on the heap.
205    quintptr *heap = new quintptr;
206    *heap = ptr;
207
208    *sipCppPtr = heap;
209
210    // Make sure the pointer doesn't leak.
211    return SIP_TEMPORARY;
212%End
213
214%ConvertFromTypeCode
215    return sipConvertFromVoidPtr((void *)*sipCpp);
216%End
217};
218// Implementations of pyqt[Set]PickleProtocol().
219void pyqtSetPickleProtocol(SIP_PYOBJECT /TypeHint="Optional[int]"/);
220%MethodCode
221    Py_XDECREF(qpycore_pickle_protocol);
222    qpycore_pickle_protocol = a0;
223    Py_INCREF(qpycore_pickle_protocol);
224%End
225
226SIP_PYOBJECT pyqtPickleProtocol() /TypeHint="Optional[int]"/;
227%MethodCode
228    sipRes = qpycore_pickle_protocol;
229    if (!sipRes)
230        sipRes = Py_None;
231
232    Py_INCREF(sipRes);
233%End
234%If (Qt_5_10_0 -)
235QString qEnvironmentVariable(const char *varName);
236%End
237%If (Qt_5_10_0 -)
238QString qEnvironmentVariable(const char *varName, const QString &defaultValue);
239%End
240