ObjQt  Check-in [3ece549448]

Overview
Comment:Make toOF/toQt more powerful and complete QtWidget
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 3ece549448f7cfd39600c8f90d4c7fccd4ce5aae1c0f2f4d7dd53cf1ef468ce0
User & Date: js on 2017-04-15 17:18:52
Other Links: manifest | tags
Context
2017-04-16
19:09
Make the Qt project work on Windows check-in: 38d57b4977 user: js tags: trunk
2017-04-15
17:18
Make toOF/toQt more powerful and complete QtWidget check-in: 3ece549448 user: js tags: trunk
02:42
Make Qt project work on non-Mac systems check-in: 0df95396ff user: js tags: trunk
Changes

Modified ObjQt.pro from [34f4d80068] to [f5d1613e99].

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
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











-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+


+
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+







TEMPLATE = lib
TARGET = ObjQt
DESTDIR = build
OBJECTS_DIR = build
QT += core gui widgets

INCLUDEPATH += common	\
	       QtCore	\
	       QtGui	\
	       QtWidgets

HEADERS += common/helpers.h		\
	   common/OFString+QString.h	\
	   common/QtOwnershipManaging.h	\
	   QtCore/QtChildEvent.h	\
	   QtCore/QtCoreApplication.h	\
	   QtCore/QtEvent.h		\
	   QtCore/QtObject.h		\
	   QtCore/QtThread.h		\
	   QtGui/QtGuiApplication.h	\
	   QtGui/QtPaintDevice.h	\
	   QtWidgets/QtAction.h		\
	   QtWidgets/QtApplication.h	\
HEADERS += common/helpers.h			\
	   common/OFDataArray+QByteArray.h	\
	   common/OFString+QString.h		\
	   common/QtOwnershipManaging.h		\
	   QtCore/QtChildEvent.h		\
	   QtCore/QtCoreApplication.h		\
	   QtCore/QtEvent.h			\
	   QtCore/QtObject.h			\
	   QtCore/QtThread.h			\
	   QtGui/QtGUIApplication.h		\
	   QtGui/QtPaintDevice.h		\
	   QtWidgets/QtAction.h			\
	   QtWidgets/QtApplication.h		\
	   QtWidgets/QtWidget.h

SOURCES += common/OFDataArray+QByteArray.mm	\
SOURCES += common/OFString+QString.mm	\
	   QtCore/QtChildEvent.mm	\
	   QtCore/QtCoreApplication.mm	\
	   QtCore/QtEvent.mm  		\
	   QtCore/QtObject.mm		\
	   QtCore/QtThread.mm		\
	   QtGui/QtGuiApplication.mm	\
	   QtGui/QtPaintDevice.mm	\
	   QtWidgets/QtAction.mm	\
	   QtWidgets/QtApplication.mm	\
	   common/OFString+QString.mm		\
	   QtCore/QtChildEvent.mm		\
	   QtCore/QtCoreApplication.mm		\
	   QtCore/QtEvent.mm  			\
	   QtCore/QtObject.mm			\
	   QtCore/QtThread.mm			\
	   QtGui/QtGUIApplication.mm		\
	   QtGui/QtPaintDevice.mm		\
	   QtWidgets/QtAction.mm		\
	   QtWidgets/QtApplication.mm		\
	   QtWidgets/QtWidget.mm

OBJCFLAGS += $$system("objfw-config --cppflags --objcflags --cxxflags")
OBJCFLAGS_WARN_ON = -Wall				\
		    -Werror				\
		    -Wsemicolon-before-method-body	\
		    -Wobjc-missing-property-synthesis

Modified QtCore/QtChildEvent.h from [9dc2585a76] to [53abd485c2].

31
32
33
34
35
36
37

















31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@property (readonly, getter=isPolished) bool polished;
@property (readonly, getter=isRemoved) bool removed;

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

namespace ObjQt {

static OF_INLINE QtChildEvent*
toOF(QChildEvent *qChildEvent)
{
	return [[[QtChildEvent alloc]
	    initWithQChildEvent: qChildEvent] autorelease];
}

static OF_INLINE QChildEvent*
toQt(QtChildEvent *childEvent)
{
	return [childEvent qChildEvent];
}

}

Modified QtCore/QtChildEvent.mm from [f611af8c09] to [0050860fa4].

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
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







+
+
+

















-
+


















-
+




-
+
-




-
+




-
+


 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "QtChildEvent.h"
#import "QtObject.h"

using ObjQt::toOF;
using ObjQt::toQt;

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

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

- initWithType: (QChildEvent::Type)type
	 child: (QtObject*)child
{
	try {
		self = [self initWithQChildEvent:
		    new QChildEvent(type, [child qObject])];
		    new QChildEvent(type, toQt(child))];

		[self takeOwnership];

		return self;
	} 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();
	return toQt(self)->added();
}

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

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

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

Modified QtCore/QtCoreApplication.h from [4f441fa3cb] to [dfc55ef348].

33
34
35
36
37
38
39

















33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56







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

namespace ObjQt {

static OF_INLINE QtCoreApplication*
toOF(QCoreApplication *qCoreApplication)
{
	return [[[QtCoreApplication alloc]
	    initWithQCoreApplication: qCoreApplication] autorelease];
}

static OF_INLINE QCoreApplication*
toQt(QtCoreApplication *coreApplication)
{
	return [coreApplication qCoreApplication];
}

}

Modified QtCore/QtCoreApplication.mm from [948643ef9b] to [b055a533da].

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
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







+

-
+
+



















-
+




-
+




-
+




-
+




-
+
-




-
+




-
-
+




-
+




-
+




-
+




-
+




-
+




-
+





-
+
-


 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "QtCoreApplication.h"
#import "QtEvent.h"
#import "OFString+QString.h"

#import "helpers.h"
using ObjQt::toOF;
using ObjQt::toQt;

@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 toOF([self qCoreApplication]->applicationName());
	return toOF(toQt(self)->applicationName());
}

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

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

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

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

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

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

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

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

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

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

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

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

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

Modified QtCore/QtEvent.h from [227e728850] to [6eeefe4604].

38
39
40
41
42
43
44
















38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@property (readonly) QEvent::Type type;

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

namespace ObjQt {

static OF_INLINE QtEvent*
toOF(QEvent *qEvent)
{
	return [[[QtEvent alloc] initWithQEvent: qEvent] autorelease];
}

static OF_INLINE QEvent*
toQt(QtEvent *event)
{
	return [event qEvent];
}

}

Modified QtCore/QtObject.h from [a3fdff21da] to [6c34637edf].

76
77
78
79
80
81
82
















76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
	    forName: (OFString*)name;
- (bool)signalsBlocked;
- (int)startTimerWithInterval: (int)interval
			 type: (Qt::TimerType)type;
- (QtThread*)thread;
- (void)deleteLater;
@end

namespace ObjQt {

static OF_INLINE QtObject*
toOF(QObject *qObject)
{
	return [[[QtObject alloc] initWithQObject: qObject] autorelease];
}

static OF_INLINE QObject*
toQt(QtObject *object)
{
	return [object qObject];
}

}

Modified QtCore/QtObject.mm from [d103de14ea] to [c04c6365a3].

19
20
21
22
23
24
25
26
27


28
29



30
31
32
33
34
35
36
19
20
21
22
23
24
25


26
27
28
29
30
31
32
33
34
35
36
37
38
39







-
-
+
+


+
+
+







 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "QtObject.h"
#import "QtEvent.h"
#import "QtThread.h"

#import "helpers.h"
#import "OFString+QString.h"
#import "OFDataArray+QByteArray.h"

#include <QVariant>

using ObjQt::toOF;
using ObjQt::toQt;

@implementation QtObject
@synthesize qObject = _qObject;

- init
{
	OF_INVALID_INIT_METHOD
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
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







-
+
-













-
+







-
+






-
+














-
+

-
-
+
+


-
+
-
-
-
+
-
-
+
-
-
+



-
+




-
+





-
+









-
+







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

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

	[children makeImmutable];

	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],
	return _qObject->connect(toQt(sender),
	    [signal UTF8String], [method UTF8String], type);
}

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

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

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

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

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

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


	[dynamicPropertyNames makeImmutable];
	[ret makeImmutable];

	objc_autoreleasePoolPop(pool);

	return dynamicPropertyNames;
	return ret;
}

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

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

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

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

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

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
226
227
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







-
+




-
-
+




-
+









-
+







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

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

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

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

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

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

- (bool)setProperty: (QVariant&)value
	    forName: (OFString*)name
{
	return _qObject->setProperty([name UTF8String], value);
}
235
236
237
238
239
240
241
242
243

244
245
246
247
248
249
250
251
232
233
234
235
236
237
238


239
240
241
242
243
244
245
246
247







-
-
+








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

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

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

Modified QtCore/QtThread.h from [149eabc8dd] to [c9467afda7].

38
39
40
41
42
43
44
















38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60







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

namespace ObjQt {

static OF_INLINE QtThread*
toOF(QThread *qThread)
{
	return [[[QtThread alloc] initWithQThread: qThread] autorelease];
}

static OF_INLINE QThread*
toQt(QtThread *thread)
{
	return [thread qThread];
}

}

Modified QtCore/QtThread.mm from [c9293dd1ab] to [117e62c463].

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
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







+
+



















-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+


 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "QtThread.h"

using ObjQt::toQt;

@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();
	return toQt(self)->eventDispatcher();
}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Added QtGui/QtGUIApplication.h version [94e433c5c3].





























































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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
/*
 * Copyright (c) 2017, Jonathan Schleifer <js@heap.zone>
 *
 * https://heap.zone/git/objqt.git
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice is present in all copies.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#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 quitsOnLastWindowClosed;
@property QIcon windowIcon;

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

namespace ObjQt {

static OF_INLINE QtGUIApplication*
toOF(QGuiApplication *qGuiApplication)
{
	return [[[QtGUIApplication alloc]
	    initWithQGuiApplication: qGuiApplication] autorelease];
}

static OF_INLINE QGuiApplication*
toQt(QtGUIApplication *GUIApplication)
{
	return [GUIApplication qGuiApplication];
}

}

Added QtGui/QtGUIApplication.mm version [d51001d0be].




































































































































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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
/*
 * Copyright (c) 2017, Jonathan Schleifer <js@heap.zone>
 *
 * https://heap.zone/git/objqt.git
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice is present in all copies.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "QtGUIApplication.h"
#import "OFString+QString.h"

#include <QIcon>

using ObjQt::toOF;
using ObjQt::toQt;

@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 toOF(toQt(self)->applicationDisplayName());
}

- (void)setApplicationDisplayName: (OFString*)applicationDisplayName
{
	toQt(self)->setApplicationDisplayName(toQt(applicationDisplayName));
}

- (OFString*)desktopFileName
{
	return toOF(toQt(self)->desktopFileName());
}

- (void)setDesktopFileName: (OFString*)desktopFileName
{
	toQt(self)->setDesktopFileName(toQt(desktopFileName));
}

- (double)devicePixelRatio
{
	return toQt(self)->devicePixelRatio();
}

- (bool)isSavingSession
{
	return toQt(self)->isSavingSession();
}

- (bool)isSessionRestored
{
	return toQt(self)->isSessionRestored();
}

- (Qt::LayoutDirection)layoutDirection
{
	return toQt(self)->layoutDirection();
}

- (void)setLayoutDirection: (Qt::LayoutDirection)layoutDirection
{
	toQt(self)->setLayoutDirection(layoutDirection);
}

- (OFString*)platformName
{
	return toOF(toQt(self)->platformName());
}

- (QScreen*)primaryScreen
{
	return toQt(self)->primaryScreen();
}

- (bool)quitsOnLastWindowClosed
{
	return toQt(self)->quitOnLastWindowClosed();
}

- (void)setQuitsOnLastWindowClosed: (bool)quitsOnLastWindowClosed
{
	toQt(self)->setQuitOnLastWindowClosed(quitsOnLastWindowClosed);
}

- (OFString*)sessionID
{
	return toOF(toQt(self)->sessionId());
}

- (OFString*)sessionKey
{
	return toOF(toQt(self)->sessionKey());
}

- (QIcon)windowIcon
{
	return toQt(self)->windowIcon();
}

- (void)setWindowIcon: (QIcon)windowIcon
{
	toQt(self)->setWindowIcon(windowIcon);
}
@end

Deleted QtGui/QtGuiApplication.h version [e6af0fcbec].

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











































-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
/*
 * Copyright (c) 2017, Jonathan Schleifer <js@heap.zone>
 *
 * https://heap.zone/git/objqt.git
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice is present in all copies.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#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

Deleted QtGui/QtGuiApplication.mm version [a4dbea1f9e].

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



































































































































-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
/*
 * Copyright (c) 2017, Jonathan Schleifer <js@heap.zone>
 *
 * https://heap.zone/git/objqt.git
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice is present in all copies.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#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 toOF([self qGuiApplication]->applicationDisplayName());
}

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

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

- (void)setDesktopFileName: (OFString*)desktopFileName
{
	[self qGuiApplication]->setDesktopFileName(toQt(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 toOF([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 toOF([self qGuiApplication]->sessionId());
}

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

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

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

Modified QtGui/QtPaintDevice.h from [0228d0430e] to [7d8d2afd79].

41
42
43
44
45
46
47










41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57







+
+
+
+
+
+
+
+
+
+
- (int)width;
- (int)widthMM;
@end

@interface QtPaintDevice: OFObject <QtPaintDevice>
@property (readonly) QObject *qObject;
@end

namespace ObjQt {

static OF_INLINE QPaintDevice*
toQt(QtPaintDevice *paintDevice)
{
	return [paintDevice qPaintDevice];
}

}

Modified QtGui/QtPaintDevice.mm from [6e4c1498e8] to [e4cb504292].

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
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







+
+











-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+


 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "QtPaintDevice.h"

#include <QObject>

using ObjQt::toQt;

@implementation QtPaintDevice
@dynamic qObject;

- (QPaintDevice*)qPaintDevice
{
	return dynamic_cast<QPaintDevice*>([self qObject]);
}

- (int)colorCount
{
	return [self qPaintDevice]->colorCount();
	return toQt(self)->colorCount();
}

- (int)depth
{
	return [self qPaintDevice]->depth();
	return toQt(self)->depth();
}

- (int)devicePixelRatio
{
	return [self qPaintDevice]->devicePixelRatio();
	return toQt(self)->devicePixelRatio();
}

- (double)devicePixelRatioF
{
	return [self qPaintDevice]->devicePixelRatioF();
	return toQt(self)->devicePixelRatioF();
}

- (int)height
{
	return [self qPaintDevice]->height();
	return toQt(self)->height();
}

- (int)heightMM
{
	return [self qPaintDevice]->heightMM();
	return toQt(self)->heightMM();
}

- (int)logicalDPIX
{
	return [self qPaintDevice]->logicalDpiX();
	return toQt(self)->logicalDpiX();
}

- (int)logicalDPIY
{
	return [self qPaintDevice]->logicalDpiY();
	return toQt(self)->logicalDpiY();
}

- (QPaintEngine*)paintEngine
{
	return [self qPaintDevice]->paintEngine();
	return toQt(self)->paintEngine();
}

- (bool)paintingActive
{
	return [self qPaintDevice]->paintingActive();
	return toQt(self)->paintingActive();
}

- (int)physicalDPIX
{
	return [self qPaintDevice]->physicalDpiX();
	return toQt(self)->physicalDpiX();
}

- (int)physicalDPIY
{
	return [self qPaintDevice]->physicalDpiY();
	return toQt(self)->physicalDpiY();
}

- (int)width
{
	return [self qPaintDevice]->width();
	return toQt(self)->width();
}

- (int)widthMM
{
	return [self qPaintDevice]->widthMM();
	return toQt(self)->widthMM();
}
@end

Modified QtWidgets/QtAction.h from [c64a4c6e90] to [f6acd86617].

52
53
54
55
56
57
58

59
60
61
62
63
64
65
















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







+







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- (QList<QGraphicsWidget*>)associatedGraphicsWidgets;
- (OFArray OF_GENERIC(QtWidget*)*)associatedWidgets;
- (QVariant)data;
- (bool)isSeparator;
- (QMenu*)menu;
- (QtWidget*)parentWidget;
- (void)setActionGroup: (QActionGroup*)group;
- (void)setData: (const QVariant&)data;
- (void)setMenu: (QMenu*)menu;
- (void)setSeparator: (bool)isSeparator;
- (void)setShortcuts: (const QList<QKeySequence>&)shortcuts;
- (void)setShortcutsWithStandardKey: (QKeySequence::StandardKey)key;
- (QList<QKeySequence>)shortcuts;
- (bool)showStatusText: (QtWidget*)widget;
@end

namespace ObjQt {

static OF_INLINE QtAction*
toOF(QAction *qAction)
{
	return [[[QtAction alloc] initWithQAction: qAction] autorelease];
}

static OF_INLINE QAction*
toQt(QtAction *action)
{
	return [action qAction];
}

}

Modified QtWidgets/QtAction.mm from [122eed180b] to [d6c33d3e64].

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
226

227
228
229
230
231

232
233
234
235
236
237

238
239
240
241
242
243
244
245
246
247
248
249

250
251
252
253
254

255
256
257
258
259

260
261
262
263
264
265

266
267
268
269
270






271
272
273
274
275

276
277
278
279
280

281
282
283
284
285

286
287
288
289
290

291
292
293
294
295

296
297
298
299
300

301
302
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
226
227

228
229
230
231
232

233
234
235
236
237
238

239

240
241
242
243
244
245
246
247
248
249

250
251
252
253
254

255
256
257
258
259

260
261
262
263
264


265
266
267
268
269

270
271
272
273
274
275
276
277
278
279

280
281
282
283
284

285
286
287
288
289

290
291
292
293
294

295
296
297
298
299

300
301
302
303
304

305
306
307







+

-
+
+



















-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+





-
+
-










-
+




-
+




-
+




-
-
+




-
+
+
+
+
+
+




-
+




-
+




-
+




-
+




-
+




-
+


 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "QtAction.h"
#import "QtWidget.h"
#import "OFString+QString.h"

#import "helpers.h"
using ObjQt::toOF;
using ObjQt::toQt;

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

- initWithQAction: (QAction*)qAction
{
	return [super initWithQObject: qAction];
}

- (QAction*)qAction
{
	return qobject_cast<QAction*>(_qObject);
}

- (bool)autoRepeat
{
	return [self qAction]->autoRepeat();
	return toQt(self)->autoRepeat();
}

- (void)setAutoRepeat: (bool)autoRepeat
{
	[self qAction]->setAutoRepeat(autoRepeat);
	toQt(self)->setAutoRepeat(autoRepeat);
}

- (bool)isCheckable
{
	return [self qAction]->isCheckable();
	return toQt(self)->isCheckable();
}

- (void)setCheckable: (bool)checkable
{
	[self qAction]->setCheckable(checkable);
	toQt(self)->setCheckable(checkable);
}

- (bool)isChecked
{
	return [self qAction]->isChecked();
	return toQt(self)->isChecked();
}

- (void)setChecked: (bool)checked
{
	[self qAction]->setChecked(checked);
	toQt(self)->setChecked(checked);
}

- (bool)isEnabled
{
	return [self qAction]->isEnabled();
	return toQt(self)->isEnabled();
}

- (void)setEnabled: (bool)enabled
{
	[self qAction]->setEnabled(enabled);
	toQt(self)->setEnabled(enabled);
}

- (QFont)font
{
	return [self qAction]->font();
	return toQt(self)->font();
}

- (void)setFont: (QFont)font
{
	[self qAction]->setFont(font);
	toQt(self)->setFont(font);
}

- (QIcon)icon
{
	return [self qAction]->icon();
	return toQt(self)->icon();
}

- (void)setIcon: (QIcon)icon
{
	[self qAction]->setIcon(icon);
	toQt(self)->setIcon(icon);
}

- (OFString*)iconText
{
	return toOF([self qAction]->iconText());
	return toOF(toQt(self)->iconText());
}

- (void)setIconText: (OFString*)iconText
{
	[self qAction]->setIconText(toQt(iconText));
	toQt(self)->setIconText(toQt(iconText));
}

- (bool)isIconVisibleInMenu
{
	return [self qAction]->isIconVisibleInMenu();
	return toQt(self)->isIconVisibleInMenu();
}

- (void)setIconVisibleInMenu: (bool)iconVisibleInMenu
{
	[self qAction]->setIconVisibleInMenu(iconVisibleInMenu);
	toQt(self)->setIconVisibleInMenu(iconVisibleInMenu);
}

- (QAction::MenuRole)menuRole
{
	return [self qAction]->menuRole();
	return toQt(self)->menuRole();
}

- (void)setMenuRole: (QAction::MenuRole)menuRole
{
	[self qAction]->setMenuRole(menuRole);
	toQt(self)->setMenuRole(menuRole);
}

- (QAction::Priority)priority
{
	return [self qAction]->priority();
	return toQt(self)->priority();
}

- (void)setPriority: (QAction::Priority)priority
{
	[self qAction]->setPriority(priority);
	toQt(self)->setPriority(priority);
}

- (QKeySequence)shortcut
{
	return [self qAction]->shortcut();
	return toQt(self)->shortcut();
}

- (void)setShortcut: (QKeySequence)shortcut
{
	[self qAction]->setShortcut(shortcut);
	toQt(self)->setShortcut(shortcut);
}

- (Qt::ShortcutContext)shortcutContext
{
	return [self qAction]->shortcutContext();
	return toQt(self)->shortcutContext();
}

- (void)setShortcutContext: (Qt::ShortcutContext)shortcutContext
{
	[self qAction]->setShortcutContext(shortcutContext);
	toQt(self)->setShortcutContext(shortcutContext);
}

- (OFString*)statusTip
{
	return toOF([self qAction]->statusTip());
	return toOF(toQt(self)->statusTip());
}

- (void)setStatusTip: (OFString*)statusTip
{
	[self qAction]->setStatusTip(toQt(statusTip));
	toQt(self)->setStatusTip(toQt(statusTip));
}

- (OFString*)text
{
	return toOF([self qAction]->text());
	return toOF(toQt(self)->text());
}

- (void)setText: (OFString*)text
{
	[self qAction]->setText(toQt(text));
	toQt(self)->setText(toQt(text));
}

- (OFString*)toolTip
{
	return toOF([self qAction]->toolTip());
	return toOF(toQt(self)->toolTip());
}

- (void)setToolTip: (OFString*)toolTip
{
	[self qAction]->setToolTip(toQt(toolTip));
	toQt(self)->setToolTip(toQt(toolTip));
}

- (bool)isVisible
{
	return [self qAction]->isVisible();
	return toQt(self)->isVisible();
}

- (void)setVisible: (bool)visible
{
	[self qAction]->setVisible(visible);
	toQt(self)->setVisible(visible);
}

- (OFString*)whatsThis
{
	return toOF([self qAction]->whatsThis());
	return toOF(toQt(self)->whatsThis());
}

- (void)setWhatsThis: (OFString*)whatsThis
{
	[self qAction]->setWhatsThis(toQt(whatsThis));
	toQt(self)->setWhatsThis(toQt(whatsThis));
}

- (QActionGroup*)actionGroup
{
	return [self qAction]->actionGroup();
	return toQt(self)->actionGroup();
}

- (void)activate: (QAction::ActionEvent)event
{
	[self qAction]->activate(event);
	toQt(self)->activate(event);
}

- (QList<QGraphicsWidget*>)associatedGraphicsWidgets
{
	return [self qAction]->associatedGraphicsWidgets();
	return toQt(self)->associatedGraphicsWidgets();
}

- (OFArray OF_GENERIC(QtWidget*)*)associatedWidgets
{
	const QList<QWidget*> &widgets = [self qAction]->associatedWidgets();
	const QList<QWidget*> &widgets = toQt(self)->associatedWidgets();
	OFMutableArray *ret =
	    [OFMutableArray arrayWithCapacity: widgets.count()];
	void *pool = objc_autoreleasePoolPush();

	for (QWidget *widget: widgets)
		[ret addObject:
		[ret addObject: toOF(widget)];
		    [[[QtWidget alloc] initWithQWidget: widget] autorelease]];

	[ret makeImmutable];

	objc_autoreleasePoolPop(pool);

	return ret;
}

- (QVariant)data
{
	return [self qAction]->data();
	return toQt(self)->data();
}

- (bool)isSeparator
{
	return [self qAction]->isSeparator();
	return toQt(self)->isSeparator();
}

- (QMenu*)menu
{
	return [self qAction]->menu();
	return toQt(self)->menu();
}

- (QtWidget*)parentWidget
{
	return [[[QtWidget alloc] initWithQWidget:
	    [self qAction]->parentWidget()] autorelease];
	return toOF(toQt(self)->parentWidget());
}

- (void)setActionGroup: (QActionGroup*)group
{
	[self qAction]->setActionGroup(group);
	toQt(self)->setActionGroup(group);
}

- (void)setData: (const QVariant&)userData
{
	toQt(self)->setData(userData);
}

- (void)setMenu: (QMenu*)menu
{
	[self qAction]->setMenu(menu);
	toQt(self)->setMenu(menu);
}

- (void)setSeparator: (bool)isSeparator
{
	[self qAction]->setSeparator(isSeparator);
	toQt(self)->setSeparator(isSeparator);
}

- (void)setShortcuts: (const QList<QKeySequence>&)shortcuts
{
	[self qAction]->setShortcuts(shortcuts);
	toQt(self)->setShortcuts(shortcuts);
}

- (void)setShortcutsWithStandardKey: (QKeySequence::StandardKey)key
{
	[self qAction]->setShortcuts(key);
	toQt(self)->setShortcuts(key);
}

- (QList<QKeySequence>)shortcuts
{
	return [self qAction]->shortcuts();
	return toQt(self)->shortcuts();
}

- (bool)showStatusText: (QtWidget*)widget
{
	return [self qAction]->showStatusText([widget qWidget]);
	return toQt(self)->showStatusText(toQt(widget));
}
@end

Modified QtWidgets/QtApplication.h from [997e3bde7c] to [4e836c2280].

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

















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







-
+



-
+

-
+











-

-

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "QtGuiApplication.h"
#import "QtGUIApplication.h"

#include <QApplication>

@interface QtApplication: QtGuiApplication
@interface QtApplication: QtGUIApplication
@property (readonly) QApplication *qApplication;
@property bool autoSipEnabled;
@property bool autoSIPEnabled;
@property int cursorFlashTime;
@property int doubleClickInterval;
@property of_dimension_t 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

namespace ObjQt {

static OF_INLINE QtApplication*
toOF(QApplication *qApplication)
{
	return [[[QtApplication alloc]
	    initWithQApplication: qApplication] autorelease];
}

static OF_INLINE QApplication*
toQt(QtApplication *application)
{
	return [application qApplication];
}

}

Modified QtWidgets/QtApplication.mm from [35f02118d0] to [56fa6f8c8c].

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
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







+


+
+
+

















-
+

-
+


-
+

-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+


 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "QtApplication.h"
#import "OFString+QString.h"

#import "helpers.h"

using ObjQt::toOF;
using ObjQt::toQt;

@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
- (bool)autoSIPEnabled
{
	return [self qApplication]->autoSipEnabled();
	return toQt(self)->autoSipEnabled();
}

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

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

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

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

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

- (of_dimension_t)globalStrut
{
	return toOF([self qApplication]->globalStrut());
	return toOF(toQt(self)->globalStrut());
}

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

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

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

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

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

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

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

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

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

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

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

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

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

Modified QtWidgets/QtWidget.h from [61a5454776] to [986333abc0].

35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
35
36
37
38
39
40
41

42
43
44
45
46
47
48







-







@property bool autoFillBackground;
@property of_dimension_t baseSize;
@property (readonly) of_rectangle_t childrenRect;
@property (readonly) QRegion childrenRegion;
@property Qt::ContextMenuPolicy contextMenuPolicy;
@property QCursor cursor;
@property (getter=isEnabled) bool enabled;
@property (readonly, getter=hasFocus) bool focus;
@property Qt::FocusPolicy focusPolicy;
@property const QFont &font;
@property (readonly) of_rectangle_t frameGeometry;
@property (readonly) of_dimension_t frameSize;
@property (readonly, getter=isFullScreen) bool fullScreen;
@property of_rectangle_t geometry;
@property (readonly) int height;
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
73
74
75
76
77
78
79

80
81
82
83
84
85
86







-







@property (copy) OFString *styleSheet;
@property (copy) OFString *toolTip;
@property int toolTipDuration;
@property bool updatesEnabled;
@property (getter=isVisible) bool visible;
@property (copy) OFString *whatsThis;
@property (readonly) int width;
@property (copy) OFString *windowFilePath;
@property Qt::WindowFlags windowFlags;
@property QIcon windowIcon;
@property Qt::WindowModality windowModality;
@property (getter=isWindowModified) bool windowModified;
@property double windowOpacity;
@property (copy) OFString *windowTitle;
@property (readonly) int x;
97
98
99
100
101
102
103
104

105
106
107
108
109
110
111
95
96
97
98
99
100
101

102
103
104
105
106
107
108
109







-
+







- (QPalette::ColorRole)backgroundRole;
- (QBackingStore*)backingStore;
- (QtWidget*)childAt: (of_point_t)point;
- (void)clearFocus;
- (void)clearMask;
- (QMargins)contentsMargins;
- (of_rectangle_t)contentsRect;
- (WId)effectiveWinId;
- (WId)effectiveWinID;
- (void)ensurePolished;
- (QtWidget*)focusProxy;
- (QtWidget*)focusWidget;
- (QFontInfo)fontInfo;
- (QFontMetrics)fontMetrics;
- (QPalette::ColorRole)foregroundRole;
- (QPixmap)grabRectangle: (of_rectangle_t)rectangle;
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
















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
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240







+












+
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+



+
+
+
+
+
+
+
+
+
+




+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- (int)grabShortcutWithKey: (const QKeySequence&)key
		   context: (Qt::ShortcutContext)context;
- (QGraphicsEffect*)graphicsEffect;
- (QGraphicsProxyWidget*)graphicsProxyWidget;
#ifdef QT_KEYPAD_NAVIGATION
- (bool)hasEditFocus;
#endif
- (bool)hasFocus;
- (bool)hasHeightForWidth;
- (int)heightForWidth: (int)w;
- (QVariant)queryInputMethod: (Qt::InputMethodQuery)query;
- (void)insertAction: (QtAction*)action
	      before: (QtAction*)before;
- (void)insertActions: (OFArray OF_GENERIC(QtAction*)*)actions
	       before: (QtAction*)before;
- (bool)isAncestorOf: (QtWidget*)child;
- (bool)isEnabledTo: (QtWidget*)ancestor;
- (bool)isHidden;
- (bool)isVisibleTo: (QtWidget*)ancestor;
- (bool)isWindow;
- (of_point_t)mapPosition: (of_point_t)pos
// QPoint mapFrom(const QWidget *parent, const QPoint &pos) const
// QPoint mapFromGlobal(const QPoint &pos) const
// QPoint mapFromParent(const QPoint &pos) const
// QPoint mapTo(const QWidget *parent, const QPoint &pos) const
// QPoint mapToGlobal(const QPoint &pos) const
// QPoint mapToParent(const QPoint &pos) const
// QRegion mask() const
// ...

		     from: (QtWidget*)parent;
- (of_point_t)mapPositionFromGlobal: (of_point_t)pos;
- (of_point_t)mapPositionFromParent: (of_point_t)pos;
- (of_point_t)mapPosition: (of_point_t)pos
		       to: (QtWidget*)parent;
- (of_point_t)mapPositionToGlobal: (of_point_t)pos;
- (of_point_t)mapPositionToParent: (of_point_t)pos;
- (QRegion)mask;
- (QtWidget*)nativeParentWidget;
- (QtWidget*)nextInFocusChain;
- (void)overrideWindowFlags: (Qt::WindowFlags)flags;
- (QtWidget*)parentWidget;
- (QtWidget*)previousInFocusChain;
- (void)releaseKeyboard;
- (void)releaseMouse;
- (void)releaseShortcut: (int)ID;
- (void)removeAction: (QtAction*)action;
- (void)renderIntoPaintDevice: (QtObject <QtPaintDevice>*)target
		 targetOffset: (of_point_t)targetOffset
		 sourceRegion: (QRegion)sourceRegion;
- (void)renderIntoPaintDevice: (QtObject <QtPaintDevice>*)target
		 targetOffset: (of_point_t)targetOffset
		 sourceRegion: (QRegion)sourceRegion
			flags: (QWidget::RenderFlags)renderFlags;
- (void)renderIntoPainter: (QPainter*)target
	     targetOffset: (of_point_t)targetOffset
	     sourceRegion: (QRegion)sourceRegion;
- (void)renderIntoPainter: (QPainter*)target
	     targetOffset: (of_point_t)targetOffset
	     sourceRegion: (QRegion)sourceRegion
		    flags: (QWidget::RenderFlags)renderFlags;
- (void)repaintInRectangle: (of_rectangle_t)rect;
- (void)repaintInRegion: (const QRegion&)region;
- (bool)restoreGeometry: (OFDataArray*)geometry;
- (OFDataArray*)saveGeometry;
- (void)scrollRight: (int)dx
	       down: (int)dy;
- (void)scrollRight: (int)dx
	       down: (int)dy
	inRectangle: (of_rectangle_t)rect;
- (void)setAttribute: (Qt::WidgetAttribute)attribute
		  to: (bool)on;
#ifdef QT_KEYPAD_NAVIGATION
- (void)setEditFocus: (bool)enable;
#endif
- (void)setFixedHeight: (int)height;
- (void)setFixedSize: (of_dimension_t)size;
- (void)setFixedWidth: (int)width;
- (void)setFocus: (Qt::FocusReason)reason;
- (void)setFocusProxy: (QtWidget*)widget;
- (void)setForegroundRole: (QPalette::ColorRole)role;
- (void)setGraphicsEffect: (QGraphicsEffect*)effect;
- (void)setLayout: (QLayout*)layout;
- (void)setMaskFromBitmap: (const QBitmap&)bitmap;
- (void)setMask: (const QRegion&)region;
- (void)setParent: (QtWidget*)parent;
- (void)setParent: (QtWidget*)parent
	    flags: (Qt::WindowFlags)flags;
- (void)setAutoRepeat: (bool)enable
	  forShortcut: (int)ID;
- (void)setEnabled: (bool)enable
       forShortcut: (int)ID;
- (void)setStyle: (QStyle*)style;
- (void)setWindowRole: (OFString*)role;
- (void)setWindowState: (Qt::WindowStates)windowState;
- (void)stackUnder: (QtWidget*)widget;
- (QStyle*)style;
- (bool)testAttribute: (Qt::WidgetAttribute)attribute;
- (bool)isUnderMouse;
- (void)ungrabGesture: (Qt::GestureType)gesture;
- (void)unsetCursor;
- (void)unsetLayoutDirection;
- (void)unsetLocale;
- (void)updateInRectangle: (of_rectangle_t)rect;
- (void)updateInRegion: (const QRegion&)region;
- (void)updateGeometry;
- (QRegion)visibleRegion;
- (WId)winID;
- (QtWidget*)window;
- (QWindow*)windowHandle;
- (OFString*)windowRole;
- (Qt::WindowStates)windowState;
- (Qt::WindowType)windowType;
@end

@interface QtWidget (QtPaintDevice) <QtPaintDevice>
@end

namespace ObjQt {

static OF_INLINE QtWidget*
toOF(QWidget *qWidget)
{
	return [[[QtWidget alloc] initWithQWidget: qWidget] autorelease];
}

static OF_INLINE QWidget*
toQt(QtWidget *widget)
{
	return [widget qWidget];
}

}

Modified QtWidgets/QtWidget.mm from [87d02fdba3] to [f374133c3b].

18
19
20
21
22
23
24


25
26
27
28
29



30
31
32
33
34
35
36
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41







+
+





+
+
+







 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "QtWidget.h"
#import "QtAction.h"
#import "OFString+QString.h"
#import "OFDataArray+QByteArray.h"

#import "helpers.h"

#include <QIcon>
#include <QLocale>

using ObjQt::toOF;
using ObjQt::toQt;

@implementation QtWidget
+ (void)initialize
{
	if (self == [QtWidget class])
		[self inheritMethodsFromClass: [QtPaintDevice class]];
}
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

226
227
228
229
230

231
232
233
234
235

236
237
238
239
240

241
242
243
244
245

246
247
248
249
250

251
252
253
254
255

256
257
258
259
260

261
262
263
264
265

266
267
268
269
270

271
272
273
274
275

276
277
278
279
280

281
282
283
284
285

286
287
288
289
290

291
292
293
294
295

296
297
298
299
300

301
302
303
304
305

306
307
308
309
310

311
312
313
314
315

316
317
318
319
320

321
322
323
324
325

326
327
328
329
330

331
332
333
334
335

336
337
338
339
340

341
342
343
344
345

346
347
348
349
350

351
352
353
354
355

356
357
358
359
360

361
362
363
364
365

366
367
368
369
370

371
372
373
374
375

376
377
378
379
380

381
382
383
384
385

386
387
388
389
390

391
392
393
394
395

396
397
398
399
400

401
402
403
404
405

406
407
408
409
410

411
412
413
414
415

416
417
418
419
420

421
422
423
424
425

426
427
428
429
430

431
432
433
434
435

436
437
438
439
440

441
442
443
444
445

446
447
448
449
450

451
452
453
454
455

456
457
458
459
460

461
462
463
464
465

466
467
468
469
470

471
472
473
474
475

476
477
478
479
480

481
482
483
484
485

486
487
488
489
490

491
492
493
494
495

496
497
498
499
500

501
502
503
504
505

506
507
508
509
510

511
512
513
514
515

516
517
518
519
520

521
522
523
524
525

526
527
528
529
530

531
532
533
534
535

536
537
538
539
540

541
542
543
544
545

546
547
548
549
550

551
552
553
554
555

556
557
558
559
560

561
562
563
564
565
566

567
568
569
570
571
572
573
574
575
576
577
578

579
580
581
582
583

584
585
586
587
588
589
590
591

592
593

594
595
596
597
598

599
600
601
602
603

604
605
606
607
608

609
610
611
612
613
614

615
616
617
618
619

620
621
622
623
624

625
626
627
628
629

630
631
632
633
634

635
636
637

638
639

640
641
642
643
644

645
646
647
648
649
650

651
652
653
654
655
656

657
658
659
660
661

662
663
664
665
666

667
668
669
670
671

672
673
674
675
676

677
678
679
680
681

682
683
684
685
686
687

688
689
690
691
692

693
694
695
696
697

698
699
700
701
702

703
704
705
706
707

708
709
710
711
712
713

714
715
716
717
718

719
720
721
722
723

724
725
726
727
728
729

730
731
732
733
734
735

736
737
738
739
740

741
742
743
744
745

746
747
748
749
750
751

752
753
754
755
756
757
758
759
760

761
762

763
764
765
766
767

768
769
770
771
772

773
774
775
776
777

778
779
780
781
782

783
784
785
786
787

788




































































































































































































































































































































789
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
226
227
228
229

230
231
232
233
234

235
236
237
238
239

240
241
242
243
244

245
246
247
248
249

250
251
252
253
254

255
256
257
258
259

260
261
262
263
264

265
266
267
268
269

270
271
272
273
274

275
276
277
278
279

280
281
282
283
284

285
286
287
288
289

290
291
292
293
294

295
296
297
298
299

300
301
302
303
304

305
306
307
308
309

310
311
312
313
314

315
316
317
318
319

320
321
322
323
324

325
326
327
328
329

330
331
332
333
334

335
336
337
338
339

340
341
342
343
344

345
346
347
348
349

350
351
352
353
354

355
356
357
358
359

360
361
362
363
364

365
366
367
368
369

370
371
372
373
374

375
376
377
378
379

380
381
382
383
384

385
386
387
388
389

390
391
392
393
394

395
396
397
398
399

400
401
402
403
404

405
406
407
408
409

410
411
412
413
414

415
416
417
418
419

420
421
422
423
424

425
426
427
428
429

430
431
432
433
434

435
436
437
438
439

440
441
442
443
444

445
446
447
448
449

450
451
452
453
454

455
456
457
458
459

460
461
462
463
464

465
466
467
468
469

470
471
472
473
474

475
476
477
478
479

480
481
482
483
484

485
486
487
488
489

490
491
492
493
494

495
496
497
498
499

500
501
502
503
504

505
506
507
508
509

510
511
512
513
514

515
516
517
518
519

520
521
522
523
524

525
526
527
528
529

530
531
532
533
534

535
536
537
538
539

540
541
542
543
544

545
546
547
548
549

550
551
552
553
554

555
556
557
558
559

560
561
562
563
564

565
566
567
568
569
570

571

572
573
574
575
576
577
578
579
580
581

582
583
584
585
586

587
588
589
590
591
592
593
594

595
596

597
598
599
600
601

602
603
604
605
606

607
608
609
610
611

612
613
614
615
616


617
618
619
620
621

622
623
624
625
626

627
628
629
630
631

632
633
634
635
636

637
638
639

640
641

642
643
644
645
646

647
648
649
650
651


652
653
654
655
656


657
658
659
660
661

662
663
664
665
666

667
668
669
670
671

672
673
674
675
676

677
678
679
680
681

682
683
684
685
686
687

688
689
690
691
692

693
694
695
696
697

698
699
700
701
702

703
704
705
706
707

708
709
710
711
712
713

714
715
716
717
718

719
720
721
722
723

724
725
726
727
728
729

730
731
732
733
734
735

736
737
738
739
740

741
742
743
744
745

746
747
748
749
750
751

752
753
754
755
756
757
758
759
760

761
762

763
764
765
766
767

768
769
770
771
772

773
774
775
776
777

778
779
780
781
782

783
784
785
786
787

788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114







-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+




-
+





-
+
-










-
+




-
+







-
+

-
+




-
+




-
+




-
+




-
-
+




-
+




-
+




-
+




-
+


-
+

-
+




-
+




-
-
+




-
-
+




-
+




-
+




-
+




-
+




-
+





-
+




-
+




-
+




-
+




-
+





-
+




-
+




-
+





-
+





-
+




-
+




-
+





-
+








-
+

-
+




-
+




-
+




-
+




-
+




-
+

+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+

- (QWidget*)qWidget
{
	return qobject_cast<QWidget*>(_qObject);
}

- (bool)acceptDrops
{
	return [self qWidget]->acceptDrops();
	return toQt(self)->acceptDrops();
}

- (void)setAcceptDrops: (bool)acceptDrops
{
	[self qWidget]->setAcceptDrops(acceptDrops);
	toQt(self)->setAcceptDrops(acceptDrops);
}

- (OFString*)accessibleDescription
{
	return toOF([self qWidget]->accessibleDescription());
	return toOF(toQt(self)->accessibleDescription());
}

- (void)setAccessibleDescription: (OFString*)accessibleDescription
{
	[self qWidget]->setAccessibleDescription(toQt(accessibleDescription));
	toQt(self)->setAccessibleDescription(toQt(accessibleDescription));
}

- (OFString*)accessibleName
{
	return toOF([self qWidget]->accessibleName());
	return toOF(toQt(self)->accessibleName());
}

- (void)setAccessibleName: (OFString*)accessibleName
{
	[self qWidget]->setAccessibleName(toQt(accessibleName));
	toQt(self)->setAccessibleName(toQt(accessibleName));
}

- (bool)autoFillBackground
{
	return [self qWidget]->autoFillBackground();
	return toQt(self)->autoFillBackground();
}

- (void)setAutoFillBackground: (bool)autoFillBackground
{
	[self qWidget]->setAutoFillBackground(autoFillBackground);
	toQt(self)->setAutoFillBackground(autoFillBackground);
}

- (of_dimension_t)baseSize
{
	return toOF([self qWidget]->baseSize());
	return toOF(toQt(self)->baseSize());
}

- (void)setBaseSize: (of_dimension_t)baseSize
{
	[self qWidget]->setBaseSize(toQt(baseSize));
	toQt(self)->setBaseSize(toQt(baseSize));
}

- (of_rectangle_t)childrenRect
{
	return toOF([self qWidget]->childrenRect());
	return toOF(toQt(self)->childrenRect());
}

- (QRegion)childrenRegion
{
	return [self qWidget]->childrenRegion();
	return toQt(self)->childrenRegion();
}

- (Qt::ContextMenuPolicy)contextMenuPolicy
{
	return [self qWidget]->contextMenuPolicy();
	return toQt(self)->contextMenuPolicy();
}

- (void)setContextMenuPolicy: (Qt::ContextMenuPolicy)contextMenuPolicy
{
	[self qWidget]->setContextMenuPolicy(contextMenuPolicy);
	toQt(self)->setContextMenuPolicy(contextMenuPolicy);
}

- (QCursor)cursor
{
	return [self qWidget]->cursor();
	return toQt(self)->cursor();
}

- (void)setCursor: (QCursor)cursor
{
	[self qWidget]->setCursor(cursor);
	toQt(self)->setCursor(cursor);
}

- (void)unsetCursor
{
	[self qWidget]->unsetCursor();
	toQt(self)->unsetCursor();
}

- (bool)isEnabled
{
	return [self qWidget]->isEnabled();
	return toQt(self)->isEnabled();
}

- (void)setEnabled: (bool)enabled
{
	[self qWidget]->setEnabled(enabled);
	toQt(self)->setEnabled(enabled);
}

- (bool)hasFocus
{
	return [self qWidget]->hasFocus();
	return toQt(self)->hasFocus();
}

- (Qt::FocusPolicy)focusPolicy
{
	return [self qWidget]->focusPolicy();
	return toQt(self)->focusPolicy();
}

- (void)setFocusPolicy: (Qt::FocusPolicy)focusPolicy
{
	[self qWidget]->setFocusPolicy(focusPolicy);
	toQt(self)->setFocusPolicy(focusPolicy);
}

- (const QFont&)font
{
	return [self qWidget]->font();
	return toQt(self)->font();
}

- (void)setFont: (const QFont&)font
{
	[self qWidget]->setFont(font);
	toQt(self)->setFont(font);
}

- (of_rectangle_t)frameGeometry
{
	return toOF([self qWidget]->frameGeometry());
	return toOF(toQt(self)->frameGeometry());
}

- (of_dimension_t)frameSize
{
	return toOF([self qWidget]->frameSize());
	return toOF(toQt(self)->frameSize());
}

- (bool)isFullScreen
{
	return [self qWidget]->isFullScreen();
	return toQt(self)->isFullScreen();
}

- (of_rectangle_t)geometry
{
	return toOF([self qWidget]->geometry());
	return toOF(toQt(self)->geometry());
}

- (void)setGeometry: (of_rectangle_t)geometry
{
	[self qWidget]->setGeometry(toQt(geometry));
	toQt(self)->setGeometry(toQt(geometry));
}

- (int)height
{
	return [self qWidget]->height();
	return toQt(self)->height();
}

- (Qt::InputMethodHints)inputMethodHints
{
	return [self qWidget]->inputMethodHints();
	return toQt(self)->inputMethodHints();
}

- (void)setInputMethodHints: (Qt::InputMethodHints)inputMethodHints
{
	[self qWidget]->setInputMethodHints(inputMethodHints);
	toQt(self)->setInputMethodHints(inputMethodHints);
}

- (bool)isActiveWindow
{
	return [self qWidget]->isActiveWindow();
	return toQt(self)->isActiveWindow();
}

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

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

- (void)unsetLayoutDirection
{
	[self qWidget]->unsetLayoutDirection();
	toQt(self)->unsetLayoutDirection();
}

- (QLocale)locale
{
	return [self qWidget]->locale();
	return toQt(self)->locale();
}

- (void)setLocale: (QLocale)locale
{
	[self qWidget]->setLocale(locale);
	toQt(self)->setLocale(locale);
}

- (void)unsetLocale
{
	[self qWidget]->unsetLocale();
	toQt(self)->unsetLocale();
}

- (bool)isMaximized
{
	return [self qWidget]->isMaximized();
	return toQt(self)->isMaximized();
}

- (int)maximumHeight
{
	return [self qWidget]->maximumHeight();
	return toQt(self)->maximumHeight();
}

- (void)setMaximumHeight: (int)maximumHeight
{
	[self qWidget]->setMaximumHeight(maximumHeight);
	toQt(self)->setMaximumHeight(maximumHeight);
}

- (of_dimension_t)maximumSize
{
	return toOF([self qWidget]->maximumSize());
	return toOF(toQt(self)->maximumSize());
}

- (void)setMaximumSize: (of_dimension_t)maximumSize
{
	[self qWidget]->setMaximumSize(toQt(maximumSize));
	toQt(self)->setMaximumSize(toQt(maximumSize));
}

- (int)maximumWidth
{
	return [self qWidget]->maximumWidth();
	return toQt(self)->maximumWidth();
}

- (void)setMaximumWidth: (int)maximumWidth
{
	[self qWidget]->setMaximumWidth(maximumWidth);
	toQt(self)->setMaximumWidth(maximumWidth);
}

- (bool)isMinimized
{
	return [self qWidget]->isMinimized();
	return toQt(self)->isMinimized();
}

- (int)minimumHeight
{
	return [self qWidget]->minimumHeight();
	return toQt(self)->minimumHeight();
}

- (void)setMinimumHeight: (int)minimumHeight
{
	[self qWidget]->setMinimumHeight(minimumHeight);
	toQt(self)->setMinimumHeight(minimumHeight);
}

- (of_dimension_t)minimumSize
{
	return toOF([self qWidget]->minimumSize());
	return toOF(toQt(self)->minimumSize());
}

- (void)setMinimumSize: (of_dimension_t)minimumSize
{
	[self qWidget]->setMinimumSize(toQt(minimumSize));
	toQt(self)->setMinimumSize(toQt(minimumSize));
}

- (of_dimension_t)minimumSizeHint
{
	return toOF([self qWidget]->minimumSizeHint());
	return toOF(toQt(self)->minimumSizeHint());
}

- (int)minimumWidth
{
	return [self qWidget]->minimumWidth();
	return toQt(self)->minimumWidth();
}

- (void)setMinimumWidth: (int)minimumWidth
{
	[self qWidget]->setMinimumWidth(minimumWidth);
	toQt(self)->setMinimumWidth(minimumWidth);
}

- (bool)isModal
{
	return [self qWidget]->isModal();
	return toQt(self)->isModal();
}

- (bool)hasMouseTracking
{
	return [self qWidget]->hasMouseTracking();
	return toQt(self)->hasMouseTracking();
}

- (void)setMouseTracking: (bool)mouseTracking
{
	[self qWidget]->setMouseTracking(mouseTracking);
	toQt(self)->setMouseTracking(mouseTracking);
}

- (of_rectangle_t)normalGeometry
{
	return toOF([self qWidget]->normalGeometry());
	return toOF(toQt(self)->normalGeometry());
}

- (const QPalette&)palette
{
	return [self qWidget]->palette();
	return toQt(self)->palette();
}

- (void)setPalette: (const QPalette&)palette
{
	[self qWidget]->setPalette(palette);
	toQt(self)->setPalette(palette);
}

- (of_point_t)pos
{
	return toOF([self qWidget]->pos());
	return toOF(toQt(self)->pos());
}

- (void)moveToPosition: (of_point_t)pos
{
	[self qWidget]->move(toQt(pos));
	toQt(self)->move(toQt(pos));
}

- (of_rectangle_t)rect
{
	return toOF([self qWidget]->rect());
	return toOF(toQt(self)->rect());
}

- (of_dimension_t)size
{
	return toOF([self qWidget]->size());
	return toOF(toQt(self)->size());
}

- (void)resizeTo: (of_dimension_t)size
{
	[self qWidget]->resize(toQt(size));
	toQt(self)->resize(toQt(size));
}

- (of_dimension_t)sizeHint
{
	return toOF([self qWidget]->sizeHint());
	return toOF(toQt(self)->sizeHint());
}

- (of_dimension_t)sizeIncrement
{
	return toOF([self qWidget]->sizeIncrement());
	return toOF(toQt(self)->sizeIncrement());
}

- (void)setSizeIncrement: (of_dimension_t)sizeIncrement
{
	[self qWidget]->setSizeIncrement(toQt(sizeIncrement));
	toQt(self)->setSizeIncrement(toQt(sizeIncrement));
}

- (QSizePolicy)sizePolicy
{
	return [self qWidget]->sizePolicy();
	return toQt(self)->sizePolicy();
}

- (void)setSizePolicy: (QSizePolicy)sizePolicy
{
	[self qWidget]->setSizePolicy(sizePolicy);
	toQt(self)->setSizePolicy(sizePolicy);
}

- (OFString*)statusTip
{
	return toOF([self qWidget]->statusTip());
	return toOF(toQt(self)->statusTip());
}

- (void)setStatusTip: (OFString*)statusTip
{
	[self qWidget]->setStatusTip(toQt(statusTip));
	toQt(self)->setStatusTip(toQt(statusTip));
}

- (OFString*)styleSheet
{
	return toOF([self qWidget]->styleSheet());
	return toOF(toQt(self)->styleSheet());
}

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

- (OFString*)toolTip
{
	return toOF([self qWidget]->toolTip());
	return toOF(toQt(self)->toolTip());
}

- (void)setToolTip: (OFString*)toolTip
{
	[self qWidget]->setToolTip(toQt(toolTip));
	toQt(self)->setToolTip(toQt(toolTip));
}

- (int)toolTipDuration
{
	return [self qWidget]->toolTipDuration();
	return toQt(self)->toolTipDuration();
}

- (void)setToolTipDuration: (int)toolTipDuration
{
	[self qWidget]->setToolTipDuration(toolTipDuration);
	toQt(self)->setToolTipDuration(toolTipDuration);
}

- (bool)updatesEnabled
{
	return [self qWidget]->updatesEnabled();
	return toQt(self)->updatesEnabled();
}

- (void)setUpdatesEnabled: (bool)updatesEnabled
{
	[self qWidget]->setUpdatesEnabled(updatesEnabled);
	toQt(self)->setUpdatesEnabled(updatesEnabled);
}

- (bool)isVisible
{
	return [self qWidget]->isVisible();
	return toQt(self)->isVisible();
}

- (void)setVisible: (bool)visible
{
	[self qWidget]->setVisible(visible);
	toQt(self)->setVisible(visible);
}

- (OFString*)whatsThis
{
	return toOF([self qWidget]->whatsThis());
	return toOF(toQt(self)->whatsThis());
}

- (void)setWhatsThis: (OFString*)whatsThis
{
	[self qWidget]->setWhatsThis(toQt(whatsThis));
	toQt(self)->setWhatsThis(toQt(whatsThis));
}

- (int)width
{
	return [self qWidget]->width();
	return toQt(self)->width();
}

- (OFString*)windowFilePath
{
	return toOF([self qWidget]->windowFilePath());
	return toOF(toQt(self)->windowFilePath());
}

- (void)setWindowFilePath: (OFString*)windowFilePath
{
	[self qWidget]->setWindowFilePath(toQt(windowFilePath));
	toQt(self)->setWindowFilePath(toQt(windowFilePath));
}

- (Qt::WindowFlags)windowFlags
{
	return [self qWidget]->windowFlags();
	return toQt(self)->windowFlags();
}

- (void)setWindowFlags: (Qt::WindowFlags)windowFlags
{
	[self qWidget]->setWindowFlags(windowFlags);
	toQt(self)->setWindowFlags(windowFlags);
}

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

- (void)setWindowIcon: (QIcon)windowIcon
{
	[self qWidget]->setWindowIcon(windowIcon);
	toQt(self)->setWindowIcon(windowIcon);
}

- (Qt::WindowModality)windowModality
{
	return [self qWidget]->windowModality();
	return toQt(self)->windowModality();
}

- (void)setWindowModality: (Qt::WindowModality)windowModality
{
	[self qWidget]->setWindowModality(windowModality);
	toQt(self)->setWindowModality(windowModality);
}

- (bool)isWindowModified
{
	return [self qWidget]->isWindowModified();
	return toQt(self)->isWindowModified();
}

- (void)setWindowModified: (bool)windowModified
{
	[self qWidget]->setWindowModified(windowModified);
	toQt(self)->setWindowModified(windowModified);
}

- (double)windowOpacity
{
	return [self qWidget]->windowOpacity();
	return toQt(self)->windowOpacity();
}

- (void)setWindowOpacity: (double)windowOpacity
{
	[self qWidget]->setWindowOpacity(windowOpacity);
	toQt(self)->setWindowOpacity(windowOpacity);
}

- (OFString*)windowTitle
{
	return toOF([self qWidget]->windowTitle());
	return toOF(toQt(self)->windowTitle());
}

- (void)setWindowTitle: (OFString*)windowTitle
{
	[self qWidget]->setWindowTitle(toQt(windowTitle));
	toQt(self)->setWindowTitle(toQt(windowTitle));
}

- (int)x
{
	return [self qWidget]->x();
	return toQt(self)->x();
}

- (int)y
{
	return [self qWidget]->y();
	return toQt(self)->y();
}

- (OFArray OF_GENERIC(QtAction*)*)actions
{
	const QList<QAction*> &actions = [self qWidget]->actions();
	const QList<QAction*> &actions = toQt(self)->actions();
	OFMutableArray *ret =
	    [OFMutableArray arrayWithCapacity: actions.count()];
	void *pool = objc_autoreleasePoolPush();

	for (QAction *action: actions)
		[ret addObject:
		[ret addObject: toOF(action)];
		    [[[QtAction alloc] initWithQAction: action] autorelease]];

	[ret makeImmutable];

	objc_autoreleasePoolPop(pool);

	return ret;
}

- (void)activateWindow
{
	[self qWidget]->activateWindow();
	toQt(self)->activateWindow();
}

- (void)addAction: (QtAction*)action
{
	[self qWidget]->addAction([action qAction]);
	toQt(self)->addAction(toQt(action));
}

- (void)addActions: (OFArray OF_GENERIC(QtAction*)*)actions
{
	QList<QAction*> list;

	for (QtAction *action in actions)
		list.append([action qAction]);
		list.append(toQt(action));

	[self qWidget]->addActions(list);
	toQt(self)->addActions(list);
}

- (void)adjustSize
{
	[self qWidget]->adjustSize();
	toQt(self)->adjustSize();
}

- (QPalette::ColorRole)backgroundRole
{
	return [self qWidget]->backgroundRole();
	return toQt(self)->backgroundRole();
}

- (QBackingStore*)backingStore
{
	return [self qWidget]->backingStore();
	return toQt(self)->backingStore();
}

- (QtWidget*)childAt: (of_point_t)point
{
	return [[[QtWidget alloc] initWithQWidget:
	    [self qWidget]->childAt(toQt(point))] autorelease];
	return toOF(toQt(self)->childAt(toQt(point)));
}

- (void)clearFocus
{
	return [self qWidget]->clearFocus();
	return toQt(self)->clearFocus();
}

- (void)clearMask
{
	[self qWidget]->clearMask();
	toQt(self)->clearMask();
}

- (QMargins)contentsMargins
{
	return [self qWidget]->contentsMargins();
	return toQt(self)->contentsMargins();
}

- (of_rectangle_t)contentsRect
{
	return toOF([self qWidget]->contentsRect());
	return toOF(toQt(self)->contentsRect());
}

- (WId)effectiveWinId
- (WId)effectiveWinID
{
	return [self qWidget]->effectiveWinId();
	return toQt(self)->effectiveWinId();
}

- (void)ensurePolished
{
	[self qWidget]->ensurePolished();
	toQt(self)->ensurePolished();
}

- (QtWidget*)focusProxy
{
	return [[[QtWidget alloc] initWithQWidget:
	    [self qWidget]->focusProxy()] autorelease];
	return toOF(toQt(self)->focusProxy());
}

- (QtWidget*)focusWidget
{
	return [[[QtWidget alloc] initWithQWidget:
	    [self qWidget]->focusWidget()] autorelease];
	return toOF(toQt(self)->focusWidget());
}

- (QFontInfo)fontInfo
{
	return [self qWidget]->fontInfo();
	return toQt(self)->fontInfo();
}

- (QFontMetrics)fontMetrics
{
	return [self qWidget]->fontMetrics();
	return toQt(self)->fontMetrics();
}

- (QPalette::ColorRole)foregroundRole
{
	return [self qWidget]->foregroundRole();
	return toQt(self)->foregroundRole();
}

- (QPixmap)grabRectangle: (of_rectangle_t)rectangle
{
	return [self qWidget]->grab(toQt(rectangle));
	return toQt(self)->grab(toQt(rectangle));
}

- (void)grabGesture: (Qt::GestureType)gesture
{
	[self qWidget]->grabGesture(gesture);
	toQt(self)->grabGesture(gesture);
}

- (void)grabGesture: (Qt::GestureType)gesture
	      flags: (Qt::GestureFlags)flags
{
	[self qWidget]->grabGesture(gesture, flags);
	toQt(self)->grabGesture(gesture, flags);
}

- (void)grabKeyboard
{
	[self qWidget]->grabKeyboard();
	toQt(self)->grabKeyboard();
}

- (void)grabMouse
{
	[self qWidget]->grabMouse();
	toQt(self)->grabMouse();
}

- (void)grabMouseWithCursor: (const QCursor&)cursor
{
	[self qWidget]->grabMouse(cursor);
	toQt(self)->grabMouse(cursor);
}

- (int)grabShortcutWithKey: (const QKeySequence&)key
{
	return [self qWidget]->grabShortcut(key);
	return toQt(self)->grabShortcut(key);
}

- (int)grabShortcutWithKey: (const QKeySequence&)key
		   context: (Qt::ShortcutContext)context
{
	return [self qWidget]->grabShortcut(key, context);
	return toQt(self)->grabShortcut(key, context);
}

- (QGraphicsEffect*)graphicsEffect
{
	return [self qWidget]->graphicsEffect();
	return toQt(self)->graphicsEffect();
}

- (QGraphicsProxyWidget*)graphicsProxyWidget
{
	return [self qWidget]->graphicsProxyWidget();
	return toQt(self)->graphicsProxyWidget();
}

#ifdef QT_KEYPAD_NAVIGATION
- (bool)hasEditFocus
{
	return [self qWidget]->hasEditFocus();
	return toQt(self)->hasEditFocus();
}
#endif

- (bool)hasHeightForWidth
{
	return [self qWidget]->hasHeightForWidth();
	return toQt(self)->hasHeightForWidth();
}

- (int)heightForWidth: (int)w
{
	return [self qWidget]->heightForWidth(w);
	return toQt(self)->heightForWidth(w);
}

- (QVariant)queryInputMethod: (Qt::InputMethodQuery)query
{
	return [self qWidget]->inputMethodQuery(query);
	return toQt(self)->inputMethodQuery(query);
}

- (void)insertAction: (QtAction*)action
	      before: (QtAction*)before
{
	[self qWidget]->insertAction([before qAction], [action qAction]);
	toQt(self)->insertAction(toQt(before), toQt(action));
}

- (void)insertActions: (OFArray OF_GENERIC(QtAction*)*)actions
	       before: (QtAction*)before
{
	QList<QAction*> list;

	for (QtAction *action in actions)
		list.append([action qAction]);
		list.append(toQt(action));

	[self qWidget]->insertActions([before qAction], list);
	toQt(self)->insertActions(toQt(before), list);
}

- (bool)isAncestorOf: (QtWidget*)child
{
	return [self qWidget]->isAncestorOf([child qWidget]);
	return toQt(self)->isAncestorOf(toQt(child));
}

- (bool)isEnabledTo: (QtWidget*)ancestor
{
	return [self qWidget]->isEnabledTo([ancestor qWidget]);
	return toQt(self)->isEnabledTo(toQt(ancestor));
}

- (bool)isHidden
{
	return [self qWidget]->isHidden();
	return toQt(self)->isHidden();
}

- (bool)isVisibleTo: (QtWidget*)ancestor
{
	return [self qWidget]->isVisibleTo([ancestor qWidget]);
	return toQt(self)->isVisibleTo(toQt(ancestor));
}

- (bool)isWindow
{
	return [self qWidget]->isWindow();
	return toQt(self)->isWindow();
}

- (of_point_t)mapPosition: (of_point_t)pos
		     from: (QtWidget*)parent
{
	return toOF(toQt(self)->mapFrom(toQt(parent), toQt(pos)));
}

- (of_point_t)mapPositionFromGlobal: (of_point_t)pos
{
	return toOF(toQt(self)->mapFromGlobal(toQt(pos)));
}

- (of_point_t)mapPositionFromParent: (of_point_t)pos
{
	return toOF(toQt(self)->mapFromParent(toQt(pos)));
}

- (of_point_t)mapPosition: (of_point_t)pos
		       to: (QtWidget*)parent
{
	return toOF(toQt(self)->mapTo(toQt(parent), toQt(pos)));
}

- (of_point_t)mapPositionToGlobal: (of_point_t)pos
{
	return toOF(toQt(self)->mapToGlobal(toQt(pos)));
}

- (of_point_t)mapPositionToParent: (of_point_t)pos
{
	return toOF(toQt(self)->mapToParent(toQt(pos)));
}

- (QRegion)mask
{
	return toQt(self)->mask();
}

- (QtWidget*)nativeParentWidget
{
	return toOF(toQt(self)->nativeParentWidget());
}

- (QtWidget*)nextInFocusChain
{
	return toOF(toQt(self)->nextInFocusChain());
}

- (void)overrideWindowFlags: (Qt::WindowFlags)flags
{
	toQt(self)->overrideWindowFlags(flags);
}

- (QtWidget*)parentWidget
{
	return toOF(toQt(self)->parentWidget());
}

- (QtWidget*)previousInFocusChain
{
	return toOF(toQt(self)->previousInFocusChain());
}

- (void)releaseKeyboard
{
	toQt(self)->releaseKeyboard();
}

- (void)releaseMouse
{
	toQt(self)->releaseMouse();
}

- (void)releaseShortcut: (int)ID
{
	toQt(self)->releaseShortcut(ID);
}

- (void)removeAction: (QtAction*)action
{
	toQt(self)->removeAction(toQt(action));
}

- (void)renderIntoPaintDevice: (QtObject <QtPaintDevice>*)target
		 targetOffset: (of_point_t)targetOffset
		 sourceRegion: (QRegion)sourceRegion
{
	toQt(self)->render([target qPaintDevice], toQt(targetOffset),
	    sourceRegion);
}

- (void)renderIntoPaintDevice: (QtObject <QtPaintDevice>*)target
		 targetOffset: (of_point_t)targetOffset
		 sourceRegion: (QRegion)sourceRegion
			flags: (QWidget::RenderFlags)renderFlags
{
	toQt(self)->render([target qPaintDevice], toQt(targetOffset),
	    sourceRegion, renderFlags);
}

- (void)renderIntoPainter: (QPainter*)target
	     targetOffset: (of_point_t)targetOffset
	     sourceRegion: (QRegion)sourceRegion
{
	toQt(self)->render(target, toQt(targetOffset), sourceRegion);
}

- (void)renderIntoPainter: (QPainter*)target
	     targetOffset: (of_point_t)targetOffset
	     sourceRegion: (QRegion)sourceRegion
		    flags: (QWidget::RenderFlags)renderFlags
{
	toQt(self)->render(target, toQt(targetOffset), sourceRegion,
	    renderFlags);
}

- (void)repaintInRectangle: (of_rectangle_t)rect
{
	toQt(self)->repaint(toQt(rect));
}

- (void)repaintInRegion: (const QRegion&)region
{
	toQt(self)->repaint(region);
}

- (bool)restoreGeometry: (OFDataArray*)geometry
{
	return toQt(self)->restoreGeometry(toQt(geometry));
}

- (OFDataArray*)saveGeometry
{
	return toOF(toQt(self)->saveGeometry());
}

- (void)scrollRight: (int)dx
	       down: (int)dy
{
	toQt(self)->scroll(dx, dy);
}

- (void)scrollRight: (int)dx
	       down: (int)dy
	inRectangle: (of_rectangle_t)rect
{
	toQt(self)->scroll(dx, dy, toQt(rect));
}

- (void)setAttribute: (Qt::WidgetAttribute)attribute
		  to: (bool)on
{
	toQt(self)->setAttribute(attribute, on);
}

#ifdef QT_KEYPAD_NAVIGATION
- (void)setEditFocus: (bool)enable
{
	toQt(self)->setEditFocus(enable);
}
#endif

- (void)setFixedHeight: (int)height
{
	toQt(self)->setFixedHeight(height);
}

- (void)setFixedSize: (of_dimension_t)size
{
	toQt(self)->setFixedSize(toQt(size));
}

- (void)setFixedWidth: (int)width
{
	toQt(self)->setFixedWidth(width);
}

- (void)setFocus: (Qt::FocusReason)reason
{
	toQt(self)->setFocus(reason);
}

- (void)setFocusProxy: (QtWidget*)widget
{
	toQt(self)->setFocusProxy(toQt(widget));
}

- (void)setForegroundRole: (QPalette::ColorRole)role
{
	toQt(self)->setForegroundRole(role);
}

- (void)setGraphicsEffect: (QGraphicsEffect*)effect
{
	toQt(self)->setGraphicsEffect(effect);
}

- (void)setLayout: (QLayout*)layout
{
	toQt(self)->setLayout(layout);
}

- (void)setMaskFromBitmap: (const QBitmap&)bitmap
{
	toQt(self)->setMask(bitmap);
}

- (void)setMask: (const QRegion&)region
{
	toQt(self)->setMask(region);
}

- (void)setParent: (QtWidget*)parent
{
	toQt(self)->setParent(toQt(parent));
}

- (void)setParent: (QtWidget*)parent
	    flags: (Qt::WindowFlags)flags
{
	toQt(self)->setParent(toQt(parent), flags);
}

- (void)setAutoRepeat: (bool)enable
	  forShortcut: (int)ID
{
	toQt(self)->setShortcutAutoRepeat(ID, enable);
}

- (void)setEnabled: (bool)enable
       forShortcut: (int)ID
{
	toQt(self)->setShortcutEnabled(ID, enable);
}

- (void)setStyle: (QStyle*)style
{
	toQt(self)->setStyle(style);
}

- (void)setWindowRole: (OFString*)role
{
	toQt(self)->setWindowRole(toQt(role));
}

- (void)setWindowState: (Qt::WindowStates)windowState
{
	toQt(self)->setWindowState(windowState);
}

- (void)stackUnder: (QtWidget*)widget
{
	toQt(self)->stackUnder(toQt(widget));
}

- (QStyle*)style
{
	return toQt(self)->style();
}

- (bool)testAttribute: (Qt::WidgetAttribute)attribute
{
	return toQt(self)->testAttribute(attribute);
}

- (bool)isUnderMouse
{
	return toQt(self)->underMouse();
}

- (void)ungrabGesture: (Qt::GestureType)gesture
{
	toQt(self)->ungrabGesture(gesture);
}

- (void)updateInRectangle: (of_rectangle_t)rect
{
	toQt(self)->update(toQt(rect));
}

- (void)updateInRegion: (const QRegion&)region
{
	toQt(self)->update(region);
}

- (void)updateGeometry
{
	toQt(self)->updateGeometry();
}

- (QRegion)visibleRegion
{
	return toQt(self)->visibleRegion();
}

- (WId)winID
{
	return toQt(self)->winId();
}

- (QtWidget*)window
{
	return toOF(toQt(self)->window());
}

- (QWindow*)windowHandle
{
	return toQt(self)->windowHandle();
}

- (OFString*)windowRole
{
	return toOF(toQt(self)->windowRole());
}

- (Qt::WindowStates)windowState
{
	return toQt(self)->windowState();
}

- (Qt::WindowType)windowType
{
	return toQt(self)->windowType();
}
@end

Added common/OFDataArray+QByteArray.h version [f43313841c].















































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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
/*
 * Copyright (c) 2017, Jonathan Schleifer <js@heap.zone>
 *
 * https://heap.zone/git/objqt.git
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice is present in all copies.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import <ObjFW/ObjFW.h>

#include <QByteArray>

@interface OFDataArray (QByteArray)
+ (instancetype)dataArrayWithQByteArray: (const QByteArray&)qByteArray;
- (QByteArray)qByteArray;
@end

namespace ObjQt {

static OF_INLINE OFDataArray*
toOF(const QByteArray &qByteArray)
{
	return [OFDataArray dataArrayWithQByteArray: qByteArray];
}

static OF_INLINE QByteArray
toQt(OFDataArray *dataArray)
{
	return [dataArray qByteArray];
}

}

Added common/OFDataArray+QByteArray.mm version [37ebb8afd0].








































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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
/*
 * Copyright (c) 2017, Jonathan Schleifer <js@heap.zone>
 *
 * https://heap.zone/git/objqt.git
 *
 * Permission to use, copy, modify, and/or distribute this software for any
 * purpose with or without fee is hereby granted, provided that the above
 * copyright notice and this permission notice is present in all copies.
 *
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import "OFDataArray+QByteArray.h"

@implementation OFDataArray (QByteArray)
+ (instancetype)dataArrayWithQByteArray: (const QByteArray&)qByteArray
{
	OFDataArray *ret = [OFDataArray dataArray];
	[ret addItems: qByteArray.data()
		count: qByteArray.count()];

	return ret;
}

- (QByteArray)qByteArray
{
	return QByteArray((char*)[self items], [self count] * [self itemSize]);
}
@end

Modified common/OFString+QString.h from [8f5d08de4a] to [dd6dc45afe].

25
26
27
28
29
30
31
















25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47







+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
#include <QString>

@interface OFString (QString)
+ (instancetype)stringWithQString: (const QString&)qString;
- initWithQString: (const QString&)qString;
- (QString)qString;
@end

namespace ObjQt {

static OF_INLINE OFString*
toOF(const QString &qString)
{
	return [OFString stringWithQString: qString];
}

static OF_INLINE QString
toQt(OFString *string)
{
	return [string qString];
}

}

Modified common/helpers.h from [b9c441bfd0] to [07b560bcd3].

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
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







-



-
-
-
-
+
+
+
+
-
-
-
-
+
-
-
-
+
+
-
-
+







 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGE.
 */

#import <ObjFW/ObjFW.h>

#include <QString>
#include <QSize>
#include <QRect>

#import "OFString+QString.h"

static OF_INLINE OFString*
toOF(const QString &qString)
#import "QtObject.h"
#import "QtAction.h"
#import "QtEvent.h"
#import "QtChildEvent.h"
{
	return [OFString stringWithQString: qString];
}

#import "QtThread.h"
static OF_INLINE QString
toQt(OFString *string)
{
#import "QtWidget.h"

	return [string qString];
}
namespace ObjQt {

static OF_INLINE of_point_t
toOF(const QPoint &qPoint)
{
	return of_point(qPoint.x(), qPoint.y());
}

72
73
74
75
76
77
78
79


66
67
68
69
70
71
72
73
74
75








+
+
}

static OF_INLINE QRect
toQt(of_rectangle_t rectangle)
{
	return QRect(rectangle.origin.x, rectangle.origin.y,
	    rectangle.size.width, rectangle.size.height);
}

}