ObjQt  Diff

Differences From Artifact [c04c6365a3]:

To Artifact [e59a1442ac]:


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
49







-
+







@synthesize qObject = _qObject;

- init
{
	OF_INVALID_INIT_METHOD
}

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

	_qObject = qObject;

	return self;
}
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
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







-
+




-
+









-
+
















-
-
-
+
+
+






-
-
-
+
+
+





-
-
+
+














-
+

















-
+




-
-
+
+




-
+




-
+



















-
+




-
+




-
+




-
+




-
+




-
+




-
-
+
+















-
+











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

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

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

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

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

	for (QObject *qChild: qChildren)
		[children addObject: toOF(qChild)];

	[children makeImmutable];

	objc_autoreleasePoolPop(pool);

	return children;
}

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

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

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

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

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

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

	for (const QByteArray &dynamicPropertyName: dynamicPropertyNames)
		[ret addObject: toOF(dynamicPropertyName)];

	[ret makeImmutable];

	objc_autoreleasePoolPop(pool);

	return ret;
}

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

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

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

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

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

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

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

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

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

- (QtObject*)parent
- (QtObject *)parent
{
	return toOF(_qObject->parent());
}

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

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

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

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

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

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

- (QtThread*)thread
- (QtThread *)thread
{
	return toOF(_qObject->thread());
}

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