ObjQt  Check-in [9463212568]

Overview
Comment:Initial commit
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | descendants | trunk
Files: files | file ages | folders
SHA3-256: 94632125686fbbd49b9f4f551ad36afb212313b1ee88fe4de8b494663a63c0dc
User & Date: js on 2017-04-02 20:51:55
Other Links: manifest | tags
Context
2017-04-02
23:00
Add QtPaintDevice and initial QtWidget check-in: 25466afe90 user: js tags: trunk
20:51
Initial commit check-in: 9463212568 user: js tags: trunk
Changes

Added .gitignore version [13ce87425d].









>
>
>
>
1
2
3
4
*~
.qmake.stash
build
Makefile

Added ObjQt.pro version [4cb866f5b3].







































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
TEMPLATE = lib
TARGET = ObjQt
DESTDIR = build
OBJECTS_DIR = build
QT += core gui widgets

INCLUDEPATH += common	\
	       QtCore	\
	       QtGui	\
	       QtWidgets

HEADERS += common/helpers.h		\
	   common/QtOwnershipManaging.h	\
	   QtCore/QtChildEvent.h	\
	   QtCore/QtCoreApplication.h	\
	   QtCore/QtEvent.h		\
	   QtCore/QtObject.h		\
	   QtCore/QtThread.h		\
	   QtGui/QtGuiApplication.h	\
	   QtWidgets/QtApplication.h

SOURCES += QtCore/QtChildEvent.mm	\
           QtCore/QtCoreApplication.mm	\
	   QtCore/QtEvent.mm  		\
	   QtCore/QtObject.mm		\
	   QtCore/QtThread.mm		\
	   QtGui/QtGuiApplication.mm	\
	   QtWidgets/QtApplication.mm

QMAKE_CXXFLAGS += $$system("objfw-config --cppflags --objcflags --cxxflags")
QMAKE_CXXFLAGS_WARN_ON = -Wall					\
			 -Werror				\
			 -Wsemicolon-before-method-body		\
			 -Wobjc-missing-property-synthesis
LIBS += $$system("objfw-config --ldflags --libs")

Added QtCore/QtChildEvent.h version [afb63d192f].































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#import "QtEvent.h"

@class QtObject;

@interface QtChildEvent: QtEvent
@property (readonly) QChildEvent *qChildEvent;
@property (readonly, getter=isAdded) bool added;
@property (readonly, retain) QtObject *child;
@property (readonly, getter=isPolished) bool polished;
@property (readonly, getter=isRemoved) bool removed;

- initWithQChildEvent: (QChildEvent*)qChildEvent;
- initWithType: (QChildEvent::Type)type
	 child: (QtObject*)child;
@end

Added QtCore/QtChildEvent.mm version [3e5461799b].











































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#import "QtChildEvent.h"
#import "QtObject.h"

@implementation QtChildEvent
- initWithQEvent: (QEvent*)event
{
	OF_INVALID_INIT_METHOD
}

- initWithQChildEvent: (QChildEvent*)event
{
	return [super initWithQEvent: event];
}

- initWithType: (QChildEvent::Type)type
	 child: (QtObject*)child
{
	try {
		return [self initWithQChildEvent:
		    new QChildEvent(type, [child qObject])];
	} catch (const std::bad_alloc &e) {
		self = [super initWithQEvent: NULL];
		[self release];
		throw;
	}
}

- (QChildEvent*)qChildEvent
{
	return dynamic_cast<QChildEvent*>(_qEvent);
}

- (bool)isAdded
{
	return [self qChildEvent]->added();
}

- (QtObject*)child
{
	return [[[QtObject alloc]
	    initWithQObject: [self qChildEvent]->child()] autorelease];
}

- (bool)isPolished
{
	return [self qChildEvent]->polished();
}

- (bool)isRemoved
{
	return [self qChildEvent]->removed();
}
@end

Added QtCore/QtCoreApplication.h version [f9f030da21].



































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#import "QtObject.h"

#include <QCoreApplication>

@interface QtCoreApplication: QtObject
@property (readonly) QCoreApplication *qCoreApplication;
@property (copy) OFString *applicationName, *applicationVersion;
@property (copy) OFString *organizationDomain, *organizationName;
@property (getter=isQuitLockEnabled) bool quitLockEnabled;

- initWithQCoreApplication: (QCoreApplication*)qCoreApplication;
- (void)installNativeEventFilter: (QAbstractNativeEventFilter*)filterObject;
- (void)quit;
- (void)removeNativeEventFilter: (QAbstractNativeEventFilter*)filterObject;
- (bool)sendEvent: (QtEvent*)event
	 receiver: (QtObject*)receiver;
@end

Added QtCore/QtCoreApplication.mm version [1f6a27146b].



































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
#import "QtCoreApplication.h"
#import "QtEvent.h"

#import "helpers.h"

@implementation QtCoreApplication
- initWithQObject: (QObject*)qObject
{
	OF_INVALID_INIT_METHOD
}

- initWithQCoreApplication: (QCoreApplication*)qCoreApplication
{
	return [super initWithQObject: qCoreApplication];
}

- (QCoreApplication*)qCoreApplication
{
	return qobject_cast<QCoreApplication*>(_qObject);
}

- (OFString*)applicationName
{
	return QToOFString([self qCoreApplication]->applicationName());
}

- (void)setApplicationName: (OFString*)applicationName
{
	[self qCoreApplication]->setApplicationName(
	    OFToQString(applicationName));
}

- (OFString*)applicationVersion
{
	return QToOFString([self qCoreApplication]->applicationVersion());
}

- (void)installNativeEventFilter: (QAbstractNativeEventFilter*)filterObject
{
	[self qCoreApplication]->installNativeEventFilter(filterObject);
}

- (void)setApplicationVersion: (OFString*)applicationVersion
{
	[self qCoreApplication]->setApplicationVersion(
	    OFToQString(applicationVersion));
}

- (OFString*)organizationDomain
{
	return QToOFString([self qCoreApplication]->organizationDomain());
}

- (void)setOrganizationDomain: (OFString*)organizationDomain
{
	[self qCoreApplication]->setOrganizationDomain(
	    OFToQString(organizationDomain));
}

- (OFString*)organizationName
{
	return QToOFString([self qCoreApplication]->organizationName());
}

- (void)setOrganizationName: (OFString*)organizationName
{
	[self qCoreApplication]->setOrganizationName(
	    OFToQString(organizationName));
}

- (void)quit
{
	[self qCoreApplication]->quit();
}

- (bool)isQuitLockEnabled
{
	return [self qCoreApplication]->isQuitLockEnabled();
}

- (void)setQuitLockEnabled: (bool)quitLockEnabled
{
	[self qCoreApplication]->setQuitLockEnabled(quitLockEnabled);
}

- (void)removeNativeEventFilter: (QAbstractNativeEventFilter*)filterObject
{
	[self qCoreApplication]->removeNativeEventFilter(filterObject);
}

- (bool)sendEvent: (QtEvent*)event
	 receiver: (QtObject*)receiver
{
	return [self qCoreApplication]->notify(
	    [receiver qObject], [event qEvent]);
}
@end

Added QtCore/QtEvent.h version [fee591102a].













































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#import <ObjFW/ObjFW.h>

#import "QtOwnershipManaging.h"

#include <QEvent>

@interface QtEvent: OFObject <QtOwnershipManaging>
{
	QEvent *_qEvent;
	bool _ownsEvent;
}

@property (readonly) QEvent *qEvent;
@property (getter=isAccepted) bool accepted;
@property (readonly, getter=isSpontaneous) bool spontaneous;
@property (readonly) QEvent::Type type;

+ (int)registerEventType: (int)hint;
- initWithQEvent: (QEvent*)qEvent;
- (void)accept;
- (void)ignore;
@end

Added QtCore/QtEvent.mm version [ba45d3786a].





















































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#import "QtEvent.h"

@implementation QtEvent
@synthesize qEvent = _eEvent;

+ (int)registerEventType: (int)hint
{
	return QEvent::registerEventType(hint);
}

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithQEvent: (QEvent*)qEvent
{
	self = [super init];

	_qEvent = qEvent;

	return self;
}

- (void)dealloc
{
	if (_ownsEvent)
		delete _qEvent;

	[super dealloc];
}

- (void)takeOwnership
{
	OF_ENSURE(!_ownsEvent);
	_ownsEvent = true;
}

- (void)giveUpOwnership
{
	OF_ENSURE(_ownsEvent);
	_ownsEvent = false;
}

- (void)accept
{
	_qEvent->accept();
}

- (void)ignore
{
	_qEvent->ignore();
}

- (bool)isAccepted
{
	return _qEvent->isAccepted();
}

- (void)setAccepted: (bool)accepted
{
	_qEvent->setAccepted(accepted);
}

- (bool)isSpontaneous
{
	return _qEvent->spontaneous();
}

- (QEvent::Type)type
{
	return _qEvent->type();
}
@end

Added QtCore/QtObject.h version [138653f846].

























































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#import <ObjFW/ObjFW.h>

#import "QtOwnershipManaging.h"

#include <QObject>

@class QtEvent;
@class QtThread;

@interface QtObject: OFObject <QtOwnershipManaging>
{
	QObject *_qObject;
	bool _ownsObject;
}

@property (readonly) QObject *qObject;
@property (readonly) const QMetaObject *metaObject;
@property (retain) QtObject *parent;
@property (copy) OFString *objectName;

- initWithQObject: (QObject*)qObject;
- (bool)setBlockSignals: (bool)block;
- (OFArray OF_GENERIC(QtObject*)*)children;
- (QMetaObject::Connection)connectSignal: (OFString*)signal
				  sender: (QtObject*)sender
				  method: (OFString*)method
				    type: (Qt::ConnectionType)type;
- (bool)disconnectSignal: (OFString*)signal
		receiver: (QtObject*)receiver
		  method: (OFString*)method;
- (bool)disconnectAllSignalsForReceiver: (QtObject*)receiver
				 method: (OFString*)method;
- (void)dumpObjectInfo;
- (void)dumpObjectTree;
- (OFArray OF_GENERIC(OFDataArray*)*)dynamicPropertyNames;
- (bool)handleEvent: (QtEvent*)event;
- (bool)filterEvent: (QtEvent*)event
	  forObject: (QtObject*)watched;
// MISSING: T findChild(const QString &name = QString(),
//     Qt::FindChildOptions options = Qt::FindChildrenRecursively) const;
// MISSING QList<T> findChildren(const QString &name = QString(),
//     Qt::FindChildOptions options = Qt::FindChildrenRecursively) const;
// MISSING: QList<T> findChildren(const QRegExp &regExp,
//     Qt::FindChildOptions options = Qt::FindChildrenRecursively) const;
- (bool)inheritsClassWithName: (OFString*)className;
- (void)installEventFilter: (QtObject*)filterObj;
- (bool)isWidgetType;
- (bool)isWindowType;
- (void)killTimerWithID: (int)ID;
- (void)moveToThread: (QtThread*)targetThread;
- (QVariant)propertyForName: (OFString*)name;
- (void)removeEventFilter: (QtObject*)obj;
- (bool)setProperty: (QVariant&)value
	    forName: (OFString*)name;
- (bool)signalsBlocked;
- (int)startTimerWithInterval: (int)interval
			 type: (Qt::TimerType)type;
- (QtThread*)thread;
- (void)deleteLater;
@end

Added QtCore/QtObject.mm version [1a4b3f6c8d].



































































































































































































































































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
#import "QtObject.h"
#import "QtEvent.h"
#import "QtThread.h"

#import "helpers.h"

#include <QVariant>

@implementation QtObject
@synthesize qObject = _qObject;

- init
{
	OF_INVALID_INIT_METHOD
}

- initWithQObject: (QObject*)qObject
{
	self = [super init];

	_qObject = qObject;

	return self;
}

- (void)dealloc
{
	if (_ownsObject)
		delete _qObject;

	[super dealloc];
}

- (void)takeOwnership
{
	OF_ENSURE(!_ownsObject);
	_ownsObject = true;
}

- (void)giveUpOwnership
{
	OF_ENSURE(_ownsObject);
	_ownsObject = false;
}

- (OFString*)objectName
{
	return QToOFString(_qObject->objectName());
}

- (void)setObjectName: (OFString*)objectName
{
	_qObject->setObjectName(OFToQString(objectName));
}

- (bool)setBlockSignals: (bool)block
{
	return _qObject->blockSignals(block);
}

- (OFArray OF_GENERIC(QtObject*)*)children
{
	const QObjectList &qChildren = _qObject->children();
	OFMutableArray *children = [OFMutableArray arrayWithCapacity:
	    qChildren.count()];
	void *pool = objc_autoreleasePoolPush();

	for (QObject *qChild: qChildren)
		[children addObject:
		    [[[QtObject alloc] initWithQObject: qChild] autorelease]];

	objc_autoreleasePoolPop(pool);

	return children;
}

- (QMetaObject::Connection)connectSignal: (OFString*)signal
				  sender: (QtObject*)sender
				  method: (OFString*)method
				    type: (Qt::ConnectionType)type
{
	return _qObject->connect([sender qObject],
	    [signal UTF8String], [method UTF8String], type);
}

- (bool)disconnectSignal: (OFString*)signal
		receiver: (QtObject*)receiver
		  method: (OFString*)method
{
	return _qObject->disconnect([signal UTF8String], [receiver qObject],
	    [method UTF8String]);
}

- (bool)disconnectAllSignalsForReceiver: (QtObject*)receiver
				 method: (OFString*)method
{
	return _qObject->disconnect([receiver qObject], [method UTF8String]);
}

- (void)dumpObjectInfo
{
	_qObject->dumpObjectInfo();
}

- (void)dumpObjectTree
{
	_qObject->dumpObjectTree();
}

- (OFArray OF_GENERIC(OFDataArray*)*)dynamicPropertyNames
{
	const QList<QByteArray> &qDynamicPropertyNames =
	    _qObject->dynamicPropertyNames();
	OFMutableArray *dynamicPropertyNames =
	    [OFMutableArray arrayWithCapacity: qDynamicPropertyNames.count()];
	void *pool = objc_autoreleasePoolPush();

	for (const QByteArray &qDynamicPropertyName: qDynamicPropertyNames) {
		OFDataArray *dynamicPropertyName = [OFDataArray dataArray];
		[dynamicPropertyName addItems: qDynamicPropertyName.data()
					count: qDynamicPropertyName.count()];
		[dynamicPropertyNames addObject: dynamicPropertyName];
	}

	objc_autoreleasePoolPop(pool);

	return dynamicPropertyNames;
}

- (bool)handleEvent: (QtEvent*)event
{
	return _qObject->event([event qEvent]);
}

- (bool)filterEvent: (QtEvent*)event
	  forObject: (QtObject*)watched
{
	return _qObject->eventFilter([watched qObject], [event qEvent]);
}

- (bool)inheritsClassWithName: (OFString*)className
{
	return _qObject->inherits([className UTF8String]);
}

- (void)installEventFilter: (QtObject*)filterObj
{
	_qObject->installEventFilter([filterObj qObject]);
}

- (bool)isWidgetType
{
	return _qObject->isWidgetType();
}

- (bool)isWindowType
{
	return _qObject->isWindowType();
}

- (void)killTimerWithID: (int)ID
{
	_qObject->killTimer(ID);
}

- (const QMetaObject*)metaObject
{
	return _qObject->metaObject();
}

- (void)moveToThread: (QtThread*)targetThread
{
	_qObject->moveToThread([targetThread qThread]);
}

- (QtObject*)parent
{
	return [[[QtObject alloc]
	    initWithQObject: _qObject->parent()] autorelease];
}

- (void)setParent: (QtObject*)parent
{
	_qObject->setParent([parent qObject]);
}

- (QVariant)propertyForName: (OFString*)name
{
	return _qObject->property([name UTF8String]);
}

- (void)removeEventFilter: (QtObject*)obj
{
	_qObject->removeEventFilter([obj qObject]);
}

- (bool)setProperty: (QVariant&)value
	    forName: (OFString*)name
{
	return _qObject->setProperty([name UTF8String], value);
}

- (bool)signalsBlocked
{
	return _qObject->signalsBlocked();
}

- (int)startTimerWithInterval: (int)interval
			 type: (Qt::TimerType)type
{
	return _qObject->startTimer(interval, type);
}

- (QtThread*)thread
{
	return [[[QtThread alloc]
	    initWithQThread: _qObject->thread()] autorelease];
}

- (void)deleteLater
{
	OF_ENSURE(!_ownsObject);
	_qObject->deleteLater();
}
@end

Added QtCore/QtThread.h version [4544f52d2c].













































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#import "QtObject.h"

#include <QThread>

@interface QtThread: QtObject
@property (readonly) QThread *qThread;
@property QAbstractEventDispatcher *eventDispatcher;
@property (readonly, getter=isFinished) bool finished;
@property (readonly, getter=isInterruptionRequested) bool interruptionRequested;
@property (readonly, getter=isRunning) bool running;
@property (readonly) int loopLevel;
@property QThread::Priority priority;
@property unsigned int stackSize;

- initWithQThread: (QThread*)qThread;
- (void)exitWithReturnCode: (int)returnCode;
- (void)requestInterruption;
- (bool)waitForMilliseconds: (unsigned long)time;
- (void)quit;
- (void)startWithPriority: (QThread::Priority)priority;
- (void)terminate;
@end

Added QtCore/QtThread.mm version [a7bf371568].





































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
#import "QtThread.h"

@implementation QtThread: QtObject
- initWithQObject: (QObject*)qObject
{
	OF_INVALID_INIT_METHOD
}

- initWithQThread: (QThread*)qThread
{
	return [super initWithQObject: qThread];
}

- (QThread*)qThread
{
	return qobject_cast<QThread*>(_qObject);
}

- (QAbstractEventDispatcher*)eventDispatcher
{
	return [self qThread]->eventDispatcher();
}

- (void)setEventDispatcher: (QAbstractEventDispatcher*)eventDispatcher
{
	[self qThread]->setEventDispatcher(eventDispatcher);
}

- (void)exitWithReturnCode: (int)returnCode
{
	[self qThread]->exit(returnCode);
}

- (bool)isFinished
{
	return [self qThread]->isFinished();
}

- (bool)isInterruptionRequested
{
	return [self qThread]->isInterruptionRequested();
}

- (bool)isRunning
{
	return [self qThread]->isRunning();
}

- (int)loopLevel
{
	return [self qThread]->loopLevel();
}

- (QThread::Priority)priority
{
	return [self qThread]->priority();
}

- (void)setPriority: (QThread::Priority)priority
{
	[self qThread]->setPriority(priority);
}

- (void)requestInterruption
{
	[self qThread]->requestInterruption();
}

- (unsigned int)stackSize
{
	return [self qThread]->stackSize();
}

- (void)setStackSize: (unsigned int)stackSize
{
	[self qThread]->setStackSize(stackSize);
}

- (bool)waitForMilliseconds: (unsigned long)time
{
	return [self qThread]->wait(time);
}

- (void)quit
{
	[self qThread]->quit();
}

- (void)startWithPriority: (QThread::Priority)priority
{
	[self qThread]->start(priority);
}

- (void)terminate
{
	[self qThread]->terminate();
}
@end

Added QtGui/QtGuiApplication.h version [87f13e83bf].











































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#import "QtCoreApplication.h"

#include <QGuiApplication>

@interface QtGuiApplication: QtCoreApplication
@property (readonly) QGuiApplication *qGuiApplication;
@property (copy) OFString *applicationDisplayName;
@property (copy) OFString *desktopFileName;
@property Qt::LayoutDirection layoutDirection;
@property (readonly, copy) OFString *platformName;
@property (readonly) QScreen *primaryScreen;
@property bool quitOnLastWindowClosed;
@property QIcon windowIcon;

- initWithQGuiApplication: (QGuiApplication*)qGuiApplication;
- (double)devicePixelRatio;
- (bool)isSavingSession;
- (bool)isSessionRestored;
- (OFString*)sessionID;
- (OFString*)sessionKey;
@end

Added QtGui/QtGuiApplication.mm version [228043c92e].





























































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
#import "QtGuiApplication.h"

#import "helpers.h"

#include <QIcon>

@implementation QtGuiApplication
- initWithQCoreApplication: (QCoreApplication*)qCoreApplication
{
	OF_INVALID_INIT_METHOD
}

- initWithQGuiApplication: (QGuiApplication*)qGuiApplication
{
	return [super initWithQCoreApplication: qGuiApplication];
}

- (QGuiApplication*)qGuiApplication
{
	return qobject_cast<QGuiApplication*>(_qObject);
}

- (OFString*)applicationDisplayName
{
	return QToOFString([self qGuiApplication]->applicationDisplayName());
}

- (void)setApplicationDisplayName: (OFString*)applicationDisplayName
{
	[self qGuiApplication]->setApplicationDisplayName(
	    OFToQString(applicationDisplayName));
}

- (OFString*)desktopFileName
{
	return QToOFString([self qGuiApplication]->desktopFileName());
}

- (void)setDesktopFileName: (OFString*)desktopFileName
{
	[self qGuiApplication]->setDesktopFileName(
	    OFToQString(desktopFileName));
}

- (double)devicePixelRatio
{
	return [self qGuiApplication]->devicePixelRatio();
}

- (bool)isSavingSession
{
	return [self qGuiApplication]->isSavingSession();
}

- (bool)isSessionRestored
{
	return [self qGuiApplication]->isSessionRestored();
}

- (Qt::LayoutDirection)layoutDirection
{
	return [self qGuiApplication]->layoutDirection();
}

- (void)setLayoutDirection: (Qt::LayoutDirection)layoutDirection
{
	[self qGuiApplication]->setLayoutDirection(layoutDirection);
}

- (OFString*)platformName
{
	return QToOFString([self qGuiApplication]->platformName());
}

- (QScreen*)primaryScreen
{
	return [self qGuiApplication]->primaryScreen();
}

- (bool)quitOnLastWindowClosed
{
	return [self qGuiApplication]->quitOnLastWindowClosed();
}

- (void)setQuitOnLastWindowClosed: (bool)quitOnLastWindowClosed
{
	[self qGuiApplication]->setQuitOnLastWindowClosed(
	    quitOnLastWindowClosed);
}

- (OFString*)sessionID
{
	return QToOFString([self qGuiApplication]->sessionId());
}

- (OFString*)sessionKey
{
	return QToOFString([self qGuiApplication]->sessionKey());
}

- (QIcon)windowIcon
{
	return [self qGuiApplication]->windowIcon();
}

- (void)setWindowIcon: (QIcon)windowIcon
{
	[self qGuiApplication]->setWindowIcon(windowIcon);
}
@end

Added QtWidgets/QtApplication.h version [e6e3189b74].













































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#import "QtGuiApplication.h"

#include <QApplication>

@interface QtApplication: QtGuiApplication
@property (readonly) QApplication *qApplication;
@property bool autoSipEnabled;
@property int cursorFlashTime;
@property int doubleClickInterval;
@property QSize globalStrut;
@property int keyboardInputInterval;
@property int startDragDistance;
@property int startDragTime;
@property (copy) OFString *styleSheet;
@property int wheelScrollLines;

- initWithQApplication: (QApplication*)qApplication;
- (void)aboutQt;
- (bool)autoSipEnabled;
- (void)closeAllWindows;
- (void)setAutoSipEnabled: (bool)enabled;
@end

Added QtWidgets/QtApplication.mm version [5d6ff1b5d5].

















































































































































































































































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
#import "QtApplication.h"

#import "helpers.h"

@implementation QtApplication
- initWithQGuiApplication: (QGuiApplication*)qGuiApplication
{
	OF_INVALID_INIT_METHOD
}

- initWithQApplication: (QApplication*)qApplication
{
	return [super initWithQGuiApplication: qApplication];
}

- (QApplication*)qApplication
{
	return qobject_cast<QApplication*>(_qObject);
}

- (bool)autoSipEnabled
{
	return [self qApplication]->autoSipEnabled();
}

- (void)setAutoSipEnabled: (bool)autoSipEnabled
{
	[self qApplication]->setAutoSipEnabled(autoSipEnabled);
}

- (int)cursorFlashTime
{
	return [self qApplication]->cursorFlashTime();
}

- (void)setCursorFlashTime: (int)cursorFlashTime
{
	[self qApplication]->setCursorFlashTime(cursorFlashTime);
}

- (int)doubleClickInterval
{
	return [self qApplication]->doubleClickInterval();
}

- (void)setDoubleClickInterval: (int)doubleClickInterval
{
	[self qApplication]->setDoubleClickInterval(doubleClickInterval);
}

- (QSize)globalStrut
{
	return [self qApplication]->globalStrut();
}

- (void)setGlobalStrut: (QSize)globalStrut
{
	[self qApplication]->setGlobalStrut(globalStrut);
}

- (int)keyboardInputInterval
{
	return [self qApplication]->keyboardInputInterval();
}

- (void)setKeyboardInputInterval: (int)keyboardInputInterval
{
	[self qApplication]->setKeyboardInputInterval(keyboardInputInterval);
}

- (int)startDragDistance
{
	return [self qApplication]->startDragDistance();
}

- (void)setStartDragDistance: (int)startDragDistance
{
	[self qApplication]->setStartDragDistance(startDragDistance);
}

- (int)startDragTime
{
	return [self qApplication]->startDragTime();
}

- (void)setStartDragTime: (int)startDragTime
{
	[self qApplication]->setStartDragTime(startDragTime);
}

- (OFString*)styleSheet
{
	return QToOFString([self qApplication]->styleSheet());
}

- (void)setStyleSheet: (OFString*)styleSheet
{
	[self qApplication]->setStyleSheet(OFToQString(styleSheet));
}

- (int)wheelScrollLines
{
	return [self qApplication]->wheelScrollLines();
}

- (void)setWheelScrollLines: (int)wheelScrollLines
{
	[self qApplication]->setWheelScrollLines(wheelScrollLines);
}

- (void)aboutQt
{
	[self qApplication]->aboutQt();
}

- (void)closeAllWindows
{
	[self qApplication]->closeAllWindows();
}
@end

Added common/QtOwnershipManaging.h version [79a3e85e4c].













>
>
>
>
>
>
1
2
3
4
5
6
#import <ObjFW/ObjFW.h>

@protocol QtOwnershipManaging
- (void)takeOwnership;
- (void)giveUpOwnership;
@end

Added common/helpers.h version [7d6cebc297].































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#import <ObjFW/ObjFW.h>

#include <QString>

inline OFString*
QToOFString(const QString &qString)
{
	return [OFString stringWithUTF8String: qString.toUtf8()];
}

inline QString
OFToQString(OFString *string)
{
	return QString::fromUtf8([string UTF8String]);
}