Mercurial > projects > qtd
comparison generator/typesystem_core-java.xml @ 1:e78566595089
initial import
author | mandel |
---|---|
date | Mon, 11 May 2009 16:01:50 +0000 |
parents | |
children | 7664de4a55e5 |
comparison
equal
deleted
inserted
replaced
0:36fb74dc547d | 1:e78566595089 |
---|---|
1 <?xml version="1.0"?> | |
2 <typesystem package="qt.core" default-superclass="QtDObject"> | |
3 <inject-code> | |
4 qt.Utilities.loadQtLibrary("QtCore"); | |
5 </inject-code> | |
6 | |
7 <template name="core.return_string_instead_of_char*"> | |
8 public final String %FUNCTION_NAME() { | |
9 QNativePointer np = %FUNCTION_NAME_private(); | |
10 String returned = ""; | |
11 int i=0; | |
12 while (np.byteAt(i) != 0) returned += (char) np.byteAt(i++); | |
13 return returned; | |
14 } | |
15 </template> | |
16 <template name="core.call_with_string_instead_of_char*"> | |
17 public final void %FUNCTION_NAME(String %ARG_NAME) { | |
18 %FUNCTION_NAME(QNativePointer.createCharPointer(%ARG_NAME)); | |
19 } | |
20 </template> | |
21 | |
22 <template name="core.private_function_return_self"> | |
23 public final %RETURN_TYPE %FUNCTION_NAME(%ARGUMENTS) { | |
24 %FUNCTION_NAME_private(%ARGUMENT_NAMES); | |
25 return this; | |
26 } | |
27 </template> | |
28 | |
29 <template name="core.unary_other_type"> | |
30 <insert-template name="core.private_function_return_self"> | |
31 <replace from="%RETURN_TYPE" to="%OUT_TYPE"/> | |
32 <replace from="%ARGUMENTS" to="%IN_TYPE other"/> | |
33 <replace from="%ARGUMENT_NAMES" to="other"/> | |
34 </insert-template> | |
35 </template> | |
36 | |
37 <template name="core.unary_self_type"> | |
38 <insert-template name="core.unary_other_type"> | |
39 <replace from="%IN_TYPE" to="%TYPE"/> | |
40 <replace from="%OUT_TYPE" to="%TYPE"/> | |
41 </insert-template> | |
42 </template> | |
43 | |
44 <template name="core.operator_assign_self_type"> | |
45 <insert-template name="core.unary_self_type"> | |
46 <replace from="%FUNCTION_NAME" to="operator_assign"/> | |
47 </insert-template> | |
48 </template> | |
49 | |
50 <template name="core.operator_assign_other_type"> | |
51 <insert-template name="core.unary_other_type"> | |
52 <replace from="%FUNCTION_NAME" to="operator_assign"/> | |
53 </insert-template> | |
54 </template> | |
55 | |
56 <template name="core.call_through_with_byte[]_instead_of_char*_and_int"> | |
57 public final int %FUNCTION_NAME(byte data[]) { | |
58 QNativePointer np = new QNativePointer(QNativePointer.Type.Byte, data.length); | |
59 %COPY_IN | |
60 int returned = (int) %FUNCTION_NAME(np, data.length); | |
61 %COPY_OUT | |
62 return returned; | |
63 } | |
64 </template> | |
65 | |
66 <template name="core.read_with_byte[]_instead_of_char*_and_int"> | |
67 <insert-template name="core.call_through_with_byte[]_instead_of_char*_and_int"> | |
68 <replace from="%COPY_IN" to=""/> | |
69 <replace from="%COPY_OUT" to="for (int i=0; i<returned; ++i) data[i] = np.byteAt(i);"/> | |
70 </insert-template> | |
71 </template> | |
72 | |
73 <template name="core.write_with_byte[]_instead_of_char*_and_int"> | |
74 <insert-template name="core.call_through_with_byte[]_instead_of_char*_and_int"> | |
75 <replace from="%COPY_OUT" to=""/> | |
76 <replace from="%COPY_IN" to="for (int i=0; i<data.length; ++i) np.setByteAt(i, data[i]);"/> | |
77 </insert-template> | |
78 </template> | |
79 | |
80 <template name="core.stream_operator_shift_right"> | |
81 public final %STREAM_TYPE operator_shift_right(%TYPE array[]) { | |
82 QNativePointer np = new QNativePointer(QNativePointer.Type.%NATIVEPOINTER_TYPE); | |
83 for (int i=0; i<array.length; ++i) { | |
84 operator_shift_right_%TYPE(np); | |
85 array[i] = np.%VALUE_FUNCTION(); | |
86 } | |
87 | |
88 return this; | |
89 } | |
90 </template> | |
91 | |
92 <template name="core.convert_primitive_array_to_java"> | |
93 %JNITYPEArray %out = __jni_env->New%JAVATYPEArray((int) %len); | |
94 __jni_env->Set%JAVATYPEArrayRegion(%out, 0, (int) %len, (%JNITYPE *) %in); | |
95 %JNITYPE *__ptr = (%JNITYPE *) %in; | |
96 Q_UNUSED(__ptr); | |
97 %JNITYPEArray __array = %out; | |
98 Q_UNUSED(__array); | |
99 </template> | |
100 | |
101 <template name="core.cleanup_convert_primitive_array_to_java"> | |
102 if (%len > 0) __jni_env->Get%JAVATYPEArrayRegion(__array, 0, %len, __ptr); | |
103 </template> | |
104 | |
105 <template name="core.get_array_length"> | |
106 int %out = __jni_env->GetArrayLength((jarray) %ARRAY); | |
107 </template> | |
108 | |
109 <template name="core.cleanup_convert_primitive_array_from_java"> | |
110 __jni_env->Release%JAVATYPEArrayElements((%JNITYPEArray) %1, (%JNITYPE *) __ptr, 0); | |
111 </template> | |
112 | |
113 <template name="core.convert_primitive_array_from_java"> | |
114 %CTYPE *%out = (%CTYPE *) __jni_env->Get%JAVATYPEArrayElements((%JNITYPEArray) %in, 0); | |
115 %CTYPE *__ptr = %out; | |
116 </template> | |
117 | |
118 | |
119 <primitive-type name="bool" java-name="bool" jni-name="jboolean"/> | |
120 <primitive-type name="double" jni-name="jdouble"/> | |
121 <primitive-type name="float" jni-name="jfloat"/> | |
122 | |
123 <primitive-type name="__int64" java-name="long" preferred-conversion="no" jni-name="jlong"/> | |
124 <primitive-type name="unsigned __int64" java-name="long" preferred-conversion="no" jni-name="jlong"/> | |
125 <primitive-type name="unsigned long long" java-name="ulong" preferred-conversion="no" jni-name="jlong"/> | |
126 <primitive-type name="long long" java-name="long" preferred-conversion="no" jni-name="jlong"/> | |
127 <primitive-type name="quintptr" preferred-conversion="no" java-name="ulong" jni-name="jlong" /> | |
128 | |
129 <primitive-type name="short" preferred-conversion="no" java-name="short" jni-name="jchar"/> | |
130 <primitive-type name="short" preferred-java-type="no" java-name="short" jni-name="jshort" /> | |
131 <primitive-type name="signed short" java-name="short" preferred-conversion="no" jni-name="jchar"/> | |
132 <primitive-type name="unsigned short" java-name="ushort" preferred-conversion="no" jni-name="jchar"/> | |
133 | |
134 <primitive-type name="char" java-name="char" jni-name="jbyte"/> | |
135 <primitive-type name="signed char" java-name="char" preferred-conversion="no" jni-name="jbyte"/> | |
136 <primitive-type name="unsigned char" java-name="ubyte" preferred-conversion="no" jni-name="jbyte"/> | |
137 | |
138 <primitive-type name="int" jni-name="jint"/> | |
139 <primitive-type name="signed int" java-name="int" preferred-conversion="no" jni-name="jint"/> | |
140 <primitive-type name="uint" java-name="uint" preferred-conversion="no" jni-name="jint"/> | |
141 <primitive-type name="ulong" java-name="uint" preferred-conversion="no" jni-name="jint"/> | |
142 <primitive-type name="unsigned int" java-name="uint" preferred-conversion="no" jni-name="jint"/> | |
143 <primitive-type name="signed long" java-name="int" preferred-conversion="no" jni-name="jint"/> | |
144 <primitive-type name="long" java-name="int" preferred-conversion="no" jni-name="jint"/> | |
145 <primitive-type name="unsigned long" java-name="uint" preferred-conversion="no" jni-name="jint"/> | |
146 | |
147 <primitive-type name="WId" java-name="long" preferred-conversion="no" jni-name="jlong"/> | |
148 <primitive-type name="Qt::HANDLE" java-name="long" preferred-conversion="no" jni-name="jlong"/> | |
149 <!-- <primitive-type name="QVariant::Type" java-name="int" preferred-conversion="no" jni-name="jint"/>--> | |
150 | |
151 <primitive-type name="QByteRef" java-name="byte" preferred-conversion="no" jni-name="jbyte"/> | |
152 <primitive-type name="QBitRef" java-name="bool" preferred-conversion="no" jni-name="jboolean"/> | |
153 | |
154 <primitive-type name="QBool" java-name="bool" preferred-conversion="no" jni-name="bool"/> | |
155 <!-- <primitive-type name="QVariant" java-name="QVariant" jni-name="jVariant"/>--> | |
156 | |
157 <primitive-type name="jobject" java-name="java.lang.Object" jni-name="jobject"/> | |
158 | |
159 | |
160 <value-type name="QDate"> | |
161 <inject-code> | |
162 <import-file name="typesystem_core-java.java" quote-after-line="class QDate___" quote-before-line="}// class"/> | |
163 </inject-code> | |
164 <extra-includes> | |
165 <include file-name="qt.QNativePointer" location="java"/> | |
166 </extra-includes> | |
167 <modify-function signature="weekNumber(int*)const"> | |
168 <access modifier="private"/> | |
169 <modify-argument index="1"> | |
170 <remove-default-expression/> | |
171 </modify-argument> | |
172 </modify-function> | |
173 | |
174 </value-type> | |
175 | |
176 | |
177 <value-type name="QDir"> | |
178 <inject-code> | |
179 <import-file name="typesystem_core-java.java" quote-after-line="class QDir___" quote-before-line="}// class"/> | |
180 </inject-code> | |
181 <modify-function signature="operator[](int)const" access="private"/> | |
182 | |
183 </value-type> | |
184 | |
185 <template name="core.multiply-devide-add-subtract"> | |
186 public final %TYPE multiply(double d) { operator_multiply_assign(d); return this; } | |
187 public final %TYPE divide(double d) { operator_divide_assign(d); return this; } | |
188 public final %TYPE add(%TYPE p) { operator_add_assign(p); return this; } | |
189 public final %TYPE subtract(%TYPE p) { operator_subtract_assign(p); return this; } | |
190 </template> | |
191 | |
192 <value-type name="QPoint"> | |
193 <modify-function signature="operator*=(double)" | |
194 access="private" | |
195 associated-to="multiply(double d)"/> | |
196 <modify-function signature="operator/=(double)" | |
197 access="private" | |
198 associated-to="divide(double d)"/> | |
199 <modify-function signature="operator+=(QPoint)" | |
200 access="private" | |
201 associated-to="add(QPoint)"/> | |
202 <modify-function signature="operator-=(QPoint)" | |
203 access="private" | |
204 associated-to="subtract(QPoint)"/> | |
205 <modify-function signature="rx()"> <remove/> </modify-function> | |
206 <modify-function signature="ry()"> <remove/> </modify-function> | |
207 <inject-code> | |
208 <insert-template name="core.multiply-devide-add-subtract"> | |
209 <replace from="%TYPE" to="QPoint"/> | |
210 </insert-template> | |
211 </inject-code> | |
212 </value-type> | |
213 | |
214 <value-type name="QPointF"> | |
215 <modify-function signature="operator*=(double)" | |
216 access="private" | |
217 associated-to="multiply(double d)"/> | |
218 <modify-function signature="operator/=(double)" | |
219 access="private" | |
220 associated-to="divide(double d)"/> | |
221 <modify-function signature="operator+=(QPointF)" | |
222 access="private" | |
223 associated-to="add(QPointF p)"/> | |
224 <modify-function signature="operator-=(QPointF)" | |
225 access="private" | |
226 associated-to="subtract(QPointF p)"/> | |
227 <modify-function signature="rx()"> <remove/> </modify-function> | |
228 <modify-function signature="ry()"> <remove/> </modify-function> | |
229 <inject-code> | |
230 <insert-template name="core.multiply-devide-add-subtract"> | |
231 <replace from="%TYPE" to="QPointF"/> | |
232 </insert-template> | |
233 </inject-code> | |
234 </value-type> | |
235 | |
236 <value-type name="QSize"> | |
237 <inject-code> | |
238 <insert-template name="core.multiply-devide-add-subtract"> | |
239 <replace from="%TYPE" to="QSize"/> | |
240 </insert-template> | |
241 </inject-code> | |
242 </value-type> | |
243 | |
244 <value-type name="QSizeF"> | |
245 <inject-code> | |
246 <insert-template name="core.multiply-devide-add-subtract"> | |
247 <replace from="%TYPE" to="QSizeF"/> | |
248 </insert-template> | |
249 </inject-code> | |
250 </value-type> | |
251 | |
252 <value-type name="QLocale"> | |
253 <extra-includes> | |
254 <include file-name="qt.QNativePointer" location="java"/> | |
255 </extra-includes> | |
256 | |
257 <template name="core.qlocale_to_type_general"> | |
258 public final %TYPE %FUNCTION_NAME(String s%EXTRA_ARGUMENTS) { | |
259 QNativePointer ok = new QNativePointer(QNativePointer.Type.Boolean); | |
260 %TYPE returned = (%TYPE) %FUNCTION_NAME(s, ok%EXTRA_CALL_ARGUMENTS); | |
261 if (!ok.booleanValue()) | |
262 throw new NumberFormatException(s); | |
263 return returned; | |
264 } | |
265 </template> | |
266 | |
267 | |
268 <template name="core.qlocale_to_type_integer"> | |
269 <insert-template name="core.qlocale_to_type_general"> | |
270 <replace from="%EXTRA_ARGUMENTS" to=", int base"/> | |
271 <replace from="%EXTRA_CALL_ARGUMENTS" to=", base"/> | |
272 </insert-template> | |
273 | |
274 public final %TYPE %FUNCTION_NAME(String s) { | |
275 return %FUNCTION_NAME(s, 0); | |
276 } | |
277 </template> | |
278 | |
279 <template name="core.qlocale_to_type_float"> | |
280 <insert-template name="core.qlocale_to_type_general"> | |
281 <replace from="%EXTRA_ARGUMENTS" to=""/> | |
282 <replace from="%EXTRA_CALL_ARGUMENTS" to=""/> | |
283 </insert-template> | |
284 </template> | |
285 | |
286 <modify-function signature="toDouble(QString,bool*)const"> | |
287 <access modifier="private"/> | |
288 <modify-argument index="2"> | |
289 <remove-default-expression/> | |
290 </modify-argument> | |
291 </modify-function> | |
292 <inject-code> | |
293 <insert-template name="core.qlocale_to_type_float"> | |
294 <replace from="%TYPE" to="double"/> | |
295 <replace from="%FUNCTION_NAME" to="toDouble"/> | |
296 </insert-template> | |
297 </inject-code> | |
298 | |
299 <modify-function signature="toFloat(QString,bool*)const"> | |
300 <access modifier="private"/> | |
301 <modify-argument index="2"> | |
302 <remove-default-expression/> | |
303 </modify-argument> | |
304 </modify-function> | |
305 <inject-code> | |
306 <insert-template name="core.qlocale_to_type_float"> | |
307 <replace from="%TYPE" to="float"/> | |
308 <replace from="%FUNCTION_NAME" to="toFloat"/> | |
309 </insert-template> | |
310 </inject-code> | |
311 | |
312 <modify-function signature="toInt(QString,bool*,int)const"> | |
313 <access modifier="private"/> | |
314 <modify-argument index="2"> | |
315 <remove-default-expression/> | |
316 </modify-argument> | |
317 <modify-argument index="3"> | |
318 <remove-default-expression/> | |
319 </modify-argument> | |
320 </modify-function> | |
321 <inject-code> | |
322 <insert-template name="core.qlocale_to_type_integer"> | |
323 <replace from="%TYPE" to="int"/> | |
324 <replace from="%FUNCTION_NAME" to="toInt"/> | |
325 </insert-template> | |
326 </inject-code> | |
327 | |
328 <modify-function signature="toLongLong(QString,bool*,int)const"> | |
329 <access modifier="private"/> | |
330 <rename to="toLong"/> | |
331 <modify-argument index="2"> | |
332 <remove-default-expression/> | |
333 </modify-argument> | |
334 <modify-argument index="3"> | |
335 <remove-default-expression/> | |
336 </modify-argument> | |
337 </modify-function> | |
338 <inject-code> | |
339 <insert-template name="core.qlocale_to_type_integer"> | |
340 <replace from="%TYPE" to="long"/> | |
341 <replace from="%FUNCTION_NAME" to="toLong"/> | |
342 </insert-template> | |
343 </inject-code> | |
344 | |
345 <modify-function signature="toShort(QString,bool*,int)const"> | |
346 <access modifier="private"/> | |
347 <modify-argument index="2"> | |
348 <remove-default-expression/> | |
349 </modify-argument> | |
350 <modify-argument index="3"> | |
351 <remove-default-expression/> | |
352 </modify-argument> | |
353 </modify-function> | |
354 <inject-code> | |
355 <insert-template name="core.qlocale_to_type_integer"> | |
356 <replace from="%TYPE" to="short"/> | |
357 <replace from="%FUNCTION_NAME" to="toShort"/> | |
358 </insert-template> | |
359 </inject-code> | |
360 | |
361 <modify-function signature="toUShort(QString,bool*,int)const"> | |
362 <access modifier="private"/> | |
363 <rename to="toChar"/> | |
364 <modify-argument index="2"> | |
365 <remove-default-expression/> | |
366 </modify-argument> | |
367 <modify-argument index="3"> | |
368 <remove-default-expression/> | |
369 </modify-argument> | |
370 </modify-function> | |
371 <inject-code> | |
372 <insert-template name="core.qlocale_to_type_integer"> | |
373 <replace from="%TYPE" to="char"/> | |
374 <replace from="%FUNCTION_NAME" to="toChar"/> | |
375 </insert-template> | |
376 </inject-code> | |
377 </value-type> | |
378 | |
379 <object-type name="QAbstractItemModel"> | |
380 <modify-function signature="parent()const" remove="all"/> | |
381 <extra-includes> | |
382 <include file-name="QStringList" location="global"/> | |
383 <include file-name="QSize" location="global"/> | |
384 </extra-includes> | |
385 <modify-function signature="match(QModelIndex,int,QVariant,int,QFlags<Qt::MatchFlag>)const"> | |
386 <modify-argument index="5"> | |
387 <replace-default-expression with="Qt.MatchFlag.MatchStartsWith, Qt.MatchFlag.MatchWrap"/> | |
388 </modify-argument> | |
389 </modify-function> | |
390 <modify-function signature="createIndex(int, int, int)const"> | |
391 <remove/> | |
392 </modify-function> | |
393 <inject-code class="java"> | |
394 <import-file name="typesystem_core-java.java" quote-after-line="class QAbstractItemModel___" quote-before-line="}// class"/> | |
395 </inject-code> | |
396 <inject-code class="native"> | |
397 extern "C" JNIEXPORT jboolean JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QAbstractItemModel_setData_1native) | |
398 (JNIEnv *__jni_env, | |
399 jobject, | |
400 jlong __this_nativeId, | |
401 jint row, jint col, jobject value, jint role) | |
402 { | |
403 QtJambiShell_QAbstractItemModel *__qt_this = | |
404 (QtJambiShell_QAbstractItemModel *) qtjambi_from_jlong(__this_nativeId); | |
405 QVariant qt_value = qtjambi_to_qvariant(__jni_env, value); | |
406 | |
407 QModelIndex index = __qt_this->index(row, col, QModelIndex()); | |
408 return __qt_this->setData(index, qt_value, role); | |
409 } | |
410 | |
411 extern "C" JNIEXPORT jobject JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QAbstractItemModel_data_1native) | |
412 (JNIEnv *__jni_env, | |
413 jobject, | |
414 jlong __this_nativeId, | |
415 jint row, jint col, jint role) | |
416 { | |
417 QtJambiShell_QAbstractItemModel *__qt_this = | |
418 (QtJambiShell_QAbstractItemModel *) qtjambi_from_jlong(__this_nativeId); | |
419 | |
420 QModelIndex index = __qt_this->index(row, col, QModelIndex()); | |
421 return qtjambi_from_qvariant(__jni_env, __qt_this->data(index, role)); | |
422 } | |
423 </inject-code> | |
424 | |
425 <modify-function signature="mimeData(QList<QModelIndex>)const"> | |
426 <modify-argument index="0"> | |
427 <define-ownership class="shell" owner="c++"/> | |
428 </modify-argument> | |
429 </modify-function> | |
430 </object-type> | |
431 | |
432 | |
433 <value-type name="QByteArray"> | |
434 <inject-code class="java"> | |
435 <import-file name="typesystem_core-java.java" quote-after-line="class QByteArray___" quote-before-line="}// class"/> | |
436 | |
437 <template name="QByteArray::toType(base)"> | |
438 public final %TYPE% %NAME%(int base) throws NumberFormatException{ | |
439 qt.QNativePointer ok = new qt.QNativePointer(qt.QNativePointer.Type.Boolean); | |
440 %TYPE% res = %NAME%_private(ok, base); | |
441 if(!ok.booleanValue()){ | |
442 throw new NumberFormatException(); | |
443 } | |
444 return res; | |
445 } | |
446 | |
447 public %TYPE% %NAME%(){ | |
448 return %NAME%(10); | |
449 } | |
450 </template> | |
451 | |
452 <insert-template name="QByteArray::toType(base)"> | |
453 <replace from="%NAME%" to="toChar"/> | |
454 <replace from="%TYPE%" to="char"/> | |
455 </insert-template> | |
456 | |
457 <insert-template name="QByteArray::toType(base)"> | |
458 <replace from="%NAME%" to="toInt"/> | |
459 <replace from="%TYPE%" to="int"/> | |
460 </insert-template> | |
461 | |
462 <template name="QByteArray::toType()"> | |
463 public final %TYPE% %NAME%() throws NumberFormatException{ | |
464 qt.QNativePointer ok = new qt.QNativePointer(qt.QNativePointer.Type.Boolean); | |
465 %TYPE% res = %NAME%_private(ok); | |
466 if(!ok.booleanValue()){ | |
467 throw new NumberFormatException(); | |
468 } | |
469 return res; | |
470 } | |
471 </template> | |
472 | |
473 <insert-template name="QByteArray::toType()"> | |
474 <replace from="%NAME%" to="toDouble"/> | |
475 <replace from="%TYPE%" to="double"/> | |
476 </insert-template> | |
477 | |
478 <insert-template name="QByteArray::toType()"> | |
479 <replace from="%NAME%" to="toFloat"/> | |
480 <replace from="%TYPE%" to="float"/> | |
481 </insert-template> | |
482 | |
483 </inject-code> | |
484 | |
485 | |
486 | |
487 <modify-function signature="toUShort(bool*, int) const" rename="toChar_private" access="private"> | |
488 <modify-argument index="1"> | |
489 <remove-default-expression/> | |
490 </modify-argument> | |
491 <modify-argument index="2"> | |
492 <remove-default-expression/> | |
493 </modify-argument> | |
494 </modify-function> | |
495 | |
496 <modify-function signature="toInt(bool*, int) const" rename="toInt_private" access="private"> | |
497 <modify-argument index="1"> | |
498 <remove-default-expression/> | |
499 </modify-argument> | |
500 <modify-argument index="2"> | |
501 <remove-default-expression/> | |
502 </modify-argument> | |
503 </modify-function> | |
504 | |
505 <modify-function signature="toDouble(bool*) const"> | |
506 <rename to="toDouble_private"/> | |
507 <access modifier="private"/> | |
508 <modify-argument index="1"> | |
509 <remove-default-expression/> | |
510 </modify-argument> | |
511 </modify-function> | |
512 | |
513 <modify-function signature="toFloat(bool*) const"> | |
514 <rename to="toFloat_private"/> | |
515 <access modifier="private"/> | |
516 <modify-argument index="1"> | |
517 <remove-default-expression/> | |
518 </modify-argument> | |
519 </modify-function> | |
520 | |
521 <modify-function signature="QByteArray(const char*)" remove="all"/> | |
522 | |
523 <modify-function signature="QByteArray(const char*,int)"> | |
524 <access modifier="private"/> | |
525 </modify-function> | |
526 | |
527 | |
528 <modify-function signature="append(QString)"> | |
529 <access modifier="private"/> | |
530 <rename to="append_private"/> | |
531 </modify-function> | |
532 <inject-code> | |
533 <insert-template name="core.unary_other_type"> | |
534 <replace from="%IN_TYPE" to="String"/> | |
535 <replace from="%OUT_TYPE" to="QByteArray"/> | |
536 <replace from="%FUNCTION_NAME" to="append"/> | |
537 </insert-template> | |
538 </inject-code> | |
539 | |
540 <modify-function signature="append(const char*)"> | |
541 <remove/> | |
542 </modify-function> | |
543 | |
544 <modify-function signature="append(QByteArray)"> | |
545 <access modifier="private"/> | |
546 <rename to="append_private"/> | |
547 </modify-function> | |
548 <inject-code> | |
549 <insert-template name="core.unary_self_type"> | |
550 <replace from="%TYPE" to="QByteArray"/> | |
551 <replace from="%FUNCTION_NAME" to="append"/> | |
552 </insert-template> | |
553 </inject-code> | |
554 | |
555 <modify-function signature="append(char)"> | |
556 <access modifier="private"/> | |
557 <rename to="append_private"/> | |
558 </modify-function> | |
559 <inject-code> | |
560 <insert-template name="core.unary_other_type"> | |
561 <replace from="%IN_TYPE" to="byte"/> | |
562 <replace from="%OUT_TYPE" to="QByteArray"/> | |
563 <replace from="%FUNCTION_NAME" to="append"/> | |
564 </insert-template> | |
565 </inject-code> | |
566 | |
567 <modify-function signature="contains(const char*)const"> | |
568 <remove/> | |
569 </modify-function> | |
570 | |
571 | |
572 <modify-function signature="count(const char*)const"> | |
573 <remove/> | |
574 </modify-function> | |
575 | |
576 | |
577 <modify-function signature="endsWith(const char*)const"> | |
578 <remove/> | |
579 </modify-function> | |
580 | |
581 | |
582 <modify-function signature="fill(char,int)"> | |
583 <access modifier="private"/> | |
584 <rename to="fill_private"/> | |
585 <modify-argument index="2"> | |
586 <remove-default-expression/> | |
587 </modify-argument> | |
588 </modify-function> | |
589 <inject-code> | |
590 <insert-template name="core.private_function_return_self"> | |
591 <replace from="%RETURN_TYPE" to="QByteArray"/> | |
592 <replace from="%FUNCTION_NAME" to="fill"/> | |
593 <replace from="%ARGUMENTS" to="byte b, int size"/> | |
594 <replace from="%ARGUMENT_NAMES" to="b, size"/> | |
595 </insert-template> | |
596 | |
597 public QByteArray fill(byte b) { | |
598 return fill(b, -1); | |
599 } | |
600 | |
601 </inject-code> | |
602 | |
603 <modify-function signature="indexOf(const char*,int)const"> | |
604 <remove/> | |
605 </modify-function> | |
606 | |
607 <modify-function signature="insert(int,QByteArray)"> | |
608 <access modifier="private"/> | |
609 <rename to="insert_private"/> | |
610 </modify-function> | |
611 <inject-code> | |
612 <insert-template name="core.private_function_return_self"> | |
613 <replace from="%RETURN_TYPE" to="QByteArray"/> | |
614 <replace from="%FUNCTION_NAME" to="insert"/> | |
615 <replace from="%ARGUMENTS" to="int i, QByteArray ba"/> | |
616 <replace from="%ARGUMENT_NAMES" to="i, ba"/> | |
617 </insert-template> | |
618 </inject-code> | |
619 | |
620 <modify-function signature="insert(int,char)"> | |
621 <access modifier="private"/> | |
622 <rename to="insert_private"/> | |
623 </modify-function> | |
624 <inject-code> | |
625 <insert-template name="core.private_function_return_self"> | |
626 <replace from="%RETURN_TYPE" to="QByteArray"/> | |
627 <replace from="%FUNCTION_NAME" to="insert"/> | |
628 <replace from="%ARGUMENTS" to="int i, byte b"/> | |
629 <replace from="%ARGUMENT_NAMES" to="i, b"/> | |
630 </insert-template> | |
631 </inject-code> | |
632 | |
633 <modify-function signature="insert(int,QString)"> | |
634 <access modifier="private"/> | |
635 <rename to="insert_private"/> | |
636 </modify-function> | |
637 <inject-code> | |
638 <insert-template name="core.private_function_return_self"> | |
639 <replace from="%RETURN_TYPE" to="QByteArray"/> | |
640 <replace from="%FUNCTION_NAME" to="insert"/> | |
641 <replace from="%ARGUMENTS" to="int i, String str"/> | |
642 <replace from="%ARGUMENT_NAMES" to="i, str"/> | |
643 </insert-template> | |
644 </inject-code> | |
645 | |
646 <modify-function signature="insert(int,const char*)" remove="all"/> | |
647 <modify-function signature="lastIndexOf(const char*,int)const" remove="all"/> | |
648 | |
649 <modify-function signature="prepend(QByteArray)"> | |
650 <access modifier="private"/> | |
651 <rename to="prepend_private"/> | |
652 </modify-function> | |
653 <inject-code> | |
654 <insert-template name="core.unary_self_type"> | |
655 <replace from="%TYPE" to="QByteArray"/> | |
656 <replace from="%FUNCTION_NAME" to="prepend"/> | |
657 </insert-template> | |
658 </inject-code> | |
659 | |
660 <modify-function signature="prepend(char)"> | |
661 <access modifier="private"/> | |
662 <rename to="prepend_private"/> | |
663 </modify-function> | |
664 <inject-code> | |
665 <insert-template name="core.unary_other_type"> | |
666 <replace from="%OUT_TYPE" to="QByteArray"/> | |
667 <replace from="%IN_TYPE" to="byte"/> | |
668 <replace from="%FUNCTION_NAME" to="prepend"/> | |
669 </insert-template> | |
670 </inject-code> | |
671 | |
672 <modify-function signature="prepend(const char*)"> | |
673 <remove/> | |
674 </modify-function> | |
675 | |
676 | |
677 <modify-function signature="remove(int,int)"> | |
678 <access modifier="private"/> | |
679 <rename to="remove_private"/> | |
680 </modify-function> | |
681 <inject-code> | |
682 <insert-template name="core.private_function_return_self"> | |
683 <replace from="%RETURN_TYPE" to="QByteArray"/> | |
684 <replace from="%FUNCTION_NAME" to="remove"/> | |
685 <replace from="%ARGUMENTS" to="int pos, int len"/> | |
686 <replace from="%ARGUMENT_NAMES" to="pos, len"/> | |
687 </insert-template> | |
688 </inject-code> | |
689 | |
690 <modify-function signature="replace(QByteArray,const char*)"> | |
691 <remove/> | |
692 </modify-function> | |
693 | |
694 | |
695 <template name="core.qbytearray_replace"> | |
696 <insert-template name="core.private_function_return_self"> | |
697 <replace from="%RETURN_TYPE" to="QByteArray"/> | |
698 <replace from="%FUNCTION_NAME" to="replace"/> | |
699 <replace from="%ARGUMENTS" to="%BEFORE_TYPE before, %AFTER_TYPE after"/> | |
700 <replace from="%ARGUMENT_NAMES" to="before, after"/> | |
701 </insert-template> | |
702 </template> | |
703 | |
704 <modify-function signature="replace(char,QByteArray)"> | |
705 <access modifier="private"/> | |
706 <rename to="replace_private"/> | |
707 </modify-function> | |
708 <inject-code> | |
709 <insert-template name="core.qbytearray_replace"> | |
710 <replace from="%BEFORE_TYPE" to="byte"/> | |
711 <replace from="%AFTER_TYPE" to="QByteArray"/> | |
712 </insert-template> | |
713 </inject-code> | |
714 | |
715 <modify-function signature="replace(QString,const char*)"> | |
716 <remove/> | |
717 </modify-function> | |
718 | |
719 | |
720 <modify-function signature="replace(int,int,const char*)"> | |
721 <remove/> | |
722 </modify-function> | |
723 | |
724 <modify-function signature="replace(const char*,const char*)"> | |
725 <remove/> | |
726 </modify-function> | |
727 | |
728 <modify-function signature="replace(const char*,QByteArray)"> | |
729 <remove/> | |
730 </modify-function> | |
731 | |
732 <modify-function signature="replace(int,int,QByteArray)"> | |
733 <access modifier="private"/> | |
734 <rename to="replace_private"/> | |
735 </modify-function> | |
736 <inject-code> | |
737 <insert-template name="core.private_function_return_self"> | |
738 <replace from="%RETURN_TYPE" to="QByteArray"/> | |
739 <replace from="%FUNCTION_NAME" to="replace"/> | |
740 <replace from="%ARGUMENTS" to="int pos, int len, QByteArray after"/> | |
741 <replace from="%ARGUMENT_NAMES" to="pos, len, after"/> | |
742 </insert-template> | |
743 </inject-code> | |
744 | |
745 <modify-function signature="replace(char,const char*)"> | |
746 <remove/> | |
747 </modify-function> | |
748 | |
749 <modify-function signature="replace(char,QString)"> | |
750 <access modifier="private"/> | |
751 <rename to="replace_private"/> | |
752 </modify-function> | |
753 <inject-code> | |
754 <insert-template name="core.qbytearray_replace"> | |
755 <replace from="%BEFORE_TYPE" to="byte"/> | |
756 <replace from="%AFTER_TYPE" to="String"/> | |
757 </insert-template> | |
758 </inject-code> | |
759 | |
760 <modify-function signature="replace(char,char)"> | |
761 <access modifier="private"/> | |
762 <rename to="replace_private"/> | |
763 </modify-function> | |
764 <inject-code> | |
765 <insert-template name="core.qbytearray_replace"> | |
766 <replace from="%BEFORE_TYPE" to="byte"/> | |
767 <replace from="%AFTER_TYPE" to="byte"/> | |
768 </insert-template> | |
769 </inject-code> | |
770 | |
771 <modify-function signature="replace(QByteArray,QByteArray)"> | |
772 <access modifier="private"/> | |
773 <rename to="replace_private"/> | |
774 </modify-function> | |
775 <inject-code> | |
776 <insert-template name="core.qbytearray_replace"> | |
777 <replace from="%BEFORE_TYPE" to="QByteArray"/> | |
778 <replace from="%AFTER_TYPE" to="QByteArray"/> | |
779 </insert-template> | |
780 </inject-code> | |
781 | |
782 <modify-function signature="replace(QString,QByteArray)"> | |
783 <access modifier="private"/> | |
784 <rename to="replace_private"/> | |
785 </modify-function> | |
786 <inject-code> | |
787 <insert-template name="core.qbytearray_replace"> | |
788 <replace from="%BEFORE_TYPE" to="String"/> | |
789 <replace from="%AFTER_TYPE" to="QByteArray"/> | |
790 </insert-template> | |
791 </inject-code> | |
792 | |
793 <modify-function signature="setNum(int,int)"> | |
794 <access modifier="private"/> | |
795 <rename to="setNum_private"/> | |
796 <modify-argument index="2"> | |
797 <remove-default-expression/> | |
798 </modify-argument> | |
799 </modify-function> | |
800 | |
801 <template name="core.qbytearray_setNum_integer"> | |
802 <insert-template name="core.private_function_return_self"> | |
803 <replace from="%RETURN_TYPE" to="QByteArray"/> | |
804 <replace from="%FUNCTION_NAME" to="setNum"/> | |
805 <replace from="%ARGUMENTS" to="%INTEGER_TYPE n, int base"/> | |
806 <replace from="%ARGUMENT_NAMES" to="n, base"/> | |
807 </insert-template> | |
808 | |
809 public QByteArray setNum(%INTEGER_TYPE n) { | |
810 return setNum(n, 10); | |
811 } | |
812 </template> | |
813 <template name="core.qbytearray_setNum_float"> | |
814 <insert-template name="core.private_function_return_self"> | |
815 <replace from="%RETURN_TYPE" to="QByteArray"/> | |
816 <replace from="%FUNCTION_NAME" to="setNum"/> | |
817 <replace from="%ARGUMENTS" to="%FLOAT_TYPE n, char f, int prec"/> | |
818 <replace from="%ARGUMENT_NAMES" to="n, (byte) f, prec"/> | |
819 </insert-template> | |
820 | |
821 public final QByteArray setNum(%FLOAT_TYPE n, char f) { | |
822 return setNum(n, f, 6); | |
823 } | |
824 | |
825 public final QByteArray setNum(%FLOAT_TYPE n) { | |
826 return setNum(n, 'g'); | |
827 } | |
828 </template> | |
829 | |
830 <inject-code> | |
831 <insert-template name="core.qbytearray_setNum_integer"> | |
832 <replace from="%INTEGER_TYPE" to="int"/> | |
833 </insert-template> | |
834 </inject-code> | |
835 | |
836 <inject-code> | |
837 <insert-template name="core.qbytearray_setNum_integer"> | |
838 <replace from="%INTEGER_TYPE" to="char"/> | |
839 </insert-template> | |
840 </inject-code> | |
841 | |
842 | |
843 <modify-function signature="setNum(float,char,int)"> | |
844 <access modifier="private"/> | |
845 <rename to="setNum_private"/> | |
846 <modify-argument index="2"> | |
847 <remove-default-expression/> | |
848 </modify-argument> | |
849 <modify-argument index="3"> | |
850 <remove-default-expression/> | |
851 </modify-argument> | |
852 </modify-function> | |
853 <inject-code> | |
854 <insert-template name="core.qbytearray_setNum_float"> | |
855 <replace from="%FLOAT_TYPE" to="float"/> | |
856 </insert-template> | |
857 </inject-code> | |
858 | |
859 <modify-function signature="setNum(long long,int)"> | |
860 <access modifier="private"/> | |
861 <rename to="setNum_private"/> | |
862 <modify-argument index="2"> | |
863 <remove-default-expression/> | |
864 </modify-argument> | |
865 </modify-function> | |
866 <inject-code> | |
867 <insert-template name="core.qbytearray_setNum_integer"> | |
868 <replace from="%INTEGER_TYPE" to="long"/> | |
869 </insert-template> | |
870 </inject-code> | |
871 | |
872 <modify-function signature="setNum(double,char,int)"> | |
873 <access modifier="private"/> | |
874 <rename to="setNum_private"/> | |
875 <modify-argument index="2"> | |
876 <remove-default-expression/> | |
877 </modify-argument> | |
878 <modify-argument index="3"> | |
879 <remove-default-expression/> | |
880 </modify-argument> | |
881 </modify-function> | |
882 <inject-code> | |
883 <insert-template name="core.qbytearray_setNum_float"> | |
884 <replace from="%FLOAT_TYPE" to="double"/> | |
885 </insert-template> | |
886 </inject-code> | |
887 | |
888 <modify-function signature="setNum(short,int)"> | |
889 <access modifier="private"/> | |
890 <rename to="setNum_private"/> | |
891 <modify-argument index="2"> | |
892 <remove-default-expression/> | |
893 </modify-argument> | |
894 </modify-function> | |
895 <inject-code> | |
896 <insert-template name="core.qbytearray_setNum_integer"> | |
897 <replace from="%INTEGER_TYPE" to="short"/> | |
898 </insert-template> | |
899 </inject-code> | |
900 | |
901 <modify-function signature="startsWith(const char*)const"> | |
902 <remove/> | |
903 </modify-function> | |
904 | |
905 | |
906 <modify-function signature="fromRawData(const char*,int)"> | |
907 <remove/> | |
908 </modify-function> | |
909 | |
910 </value-type> | |
911 | |
912 | |
913 <object-type name="QFile"> | |
914 <inject-code> | |
915 <import-file name="typesystem_core-java.java" quote-after-line="class QFile___" quote-before-line="}// class"/> | |
916 </inject-code> | |
917 <modify-function signature="decodeName(const char*)"> | |
918 <access modifier="private"/> | |
919 </modify-function> | |
920 | |
921 </object-type> | |
922 | |
923 | |
924 <object-type name="QIODevice"> | |
925 <inject-code> | |
926 <import-file name="typesystem_core-java.java" quote-after-line="class QIODevice___" quote-before-line="}// class"/> | |
927 </inject-code> | |
928 <extra-includes> | |
929 <include file-name="qt.QNativePointer" location="java"/> | |
930 </extra-includes> | |
931 | |
932 <modify-function signature="putChar(char)" rename="putByte"/> | |
933 <modify-function signature="ungetChar(char)" rename="ungetByte"/> | |
934 <modify-function signature="getChar(char*)"> | |
935 <access modifier="private"/> | |
936 <rename to="getByte"/> | |
937 </modify-function> | |
938 | |
939 | |
940 <modify-function signature="peek(char*,long long)"> | |
941 <access modifier="private"/> | |
942 </modify-function> | |
943 <inject-code> | |
944 <insert-template name="core.read_with_byte[]_instead_of_char*_and_int"> | |
945 <replace from="%FUNCTION_NAME" to="peek"/> | |
946 </insert-template> | |
947 </inject-code> | |
948 | |
949 <modify-function signature="read(char*,long long)"> | |
950 <access modifier="private"/> | |
951 </modify-function> | |
952 <inject-code> | |
953 <insert-template name="core.read_with_byte[]_instead_of_char*_and_int"> | |
954 <replace from="%FUNCTION_NAME" to="read"/> | |
955 </insert-template> | |
956 </inject-code> | |
957 | |
958 <modify-function signature="readLine(char*,long long)"> | |
959 <access modifier="private"/> | |
960 </modify-function> | |
961 <inject-code> | |
962 <insert-template name="core.read_with_byte[]_instead_of_char*_and_int"> | |
963 <replace from="%FUNCTION_NAME" to="readLine"/> | |
964 </insert-template> | |
965 </inject-code> | |
966 | |
967 <modify-function signature="write(const char*,long long)"> | |
968 <access modifier="private"/> | |
969 </modify-function> | |
970 <inject-code> | |
971 <insert-template name="core.write_with_byte[]_instead_of_char*_and_int"> | |
972 <replace from="%FUNCTION_NAME" to="write"/> | |
973 </insert-template> | |
974 </inject-code> | |
975 | |
976 <template name="core.iodevice_convert_char*_to_byte[]"> | |
977 <insert-template name="core.convert_primitive_array_to_java"> | |
978 <replace from="%JNITYPE" to="jbyte"/> | |
979 <replace from="%JAVATYPE" to="Byte"/> | |
980 </insert-template> | |
981 </template> | |
982 | |
983 <template name="core.iodevice_cleanup_to_java"> | |
984 <insert-template name="core.cleanup_convert_primitive_array_to_java"> | |
985 <replace from="%JNITYPE" to="jbyte"/> | |
986 <replace from="%JAVATYPE" to="Byte"/> | |
987 </insert-template> | |
988 </template> | |
989 | |
990 | |
991 <template name="core.iodevice_cleanup"> | |
992 jint %out = (jint) %in; | |
993 <insert-template name="core.cleanup_convert_primitive_array_from_java"> | |
994 <replace from="%JAVATYPE" to="Byte"/> | |
995 <replace from="%JNITYPE" to="jbyte"/> | |
996 </insert-template> | |
997 | |
998 </template> | |
999 | |
1000 <template name="core.iodevice_convert_byte[]_to_char*"> | |
1001 <insert-template name="core.convert_primitive_array_from_java"> | |
1002 <replace from="%CTYPE" to="char"/> | |
1003 <replace from="%JAVATYPE" to="Byte"/> | |
1004 <replace from="%JNITYPE" to="jbyte"/> | |
1005 </insert-template> | |
1006 </template> | |
1007 | |
1008 <modify-function signature="readData(char*,long long)"> | |
1009 <modify-argument index="0"> | |
1010 <replace-type modified-type="int"/> | |
1011 <conversion-rule class="native"> | |
1012 <insert-template name="core.iodevice_cleanup"/> | |
1013 </conversion-rule> | |
1014 <conversion-rule class="shell"> | |
1015 qint64 %out = %in; | |
1016 <insert-template name="core.iodevice_cleanup_to_java"> | |
1017 <replace from="%len" to="(int) %in"/> | |
1018 </insert-template> | |
1019 </conversion-rule> | |
1020 </modify-argument> | |
1021 | |
1022 <modify-argument index="1"> | |
1023 <replace-type modified-type="byte[]"/> | |
1024 <conversion-rule class="shell"> | |
1025 <insert-template name="core.iodevice_convert_char*_to_byte[]"> | |
1026 <replace from="%len" to="%2"/> | |
1027 </insert-template> | |
1028 </conversion-rule> | |
1029 <conversion-rule class="native"> | |
1030 <insert-template name="core.iodevice_convert_byte[]_to_char*"/> | |
1031 </conversion-rule> | |
1032 </modify-argument> | |
1033 | |
1034 <modify-argument index="2"> | |
1035 <remove-argument/> | |
1036 <conversion-rule class="shell"> | |
1037 // nothing | |
1038 </conversion-rule> | |
1039 <conversion-rule class="native"> | |
1040 <insert-template name="core.get_array_length"> | |
1041 <replace from="%ARRAY" to="%1"/> | |
1042 </insert-template> | |
1043 </conversion-rule> | |
1044 </modify-argument> | |
1045 </modify-function> | |
1046 | |
1047 <modify-function signature="writeData(const char*,long long)"> | |
1048 <modify-argument index="1"> | |
1049 <replace-type modified-type="byte[]"/> | |
1050 <conversion-rule class="shell"> | |
1051 <insert-template name="core.iodevice_convert_char*_to_byte[]"> | |
1052 <replace from="%len" to="%2"/> | |
1053 </insert-template> | |
1054 </conversion-rule> | |
1055 <conversion-rule class="native"> | |
1056 <insert-template name="core.iodevice_convert_byte[]_to_char*"/> | |
1057 </conversion-rule> | |
1058 </modify-argument> | |
1059 | |
1060 <modify-argument index="2"> | |
1061 <remove-argument/> | |
1062 <conversion-rule class="shell"> | |
1063 // nothing | |
1064 </conversion-rule> | |
1065 <conversion-rule class="native"> | |
1066 <insert-template name="core.get_array_length"> | |
1067 <replace from="%ARRAY" to="%1"/> | |
1068 </insert-template> | |
1069 </conversion-rule> | |
1070 </modify-argument> | |
1071 | |
1072 <modify-argument index="0"> | |
1073 <replace-type modified-type="int"/> | |
1074 <conversion-rule class="native"> | |
1075 <insert-template name="core.iodevice_cleanup"/> | |
1076 </conversion-rule> | |
1077 </modify-argument> | |
1078 </modify-function> | |
1079 | |
1080 <modify-function signature="readLineData(char*,long long)"> | |
1081 <modify-argument index="1"> | |
1082 <replace-type modified-type="byte[]"/> | |
1083 <conversion-rule class="shell"> | |
1084 <insert-template name="core.iodevice_convert_char*_to_byte[]"> | |
1085 <replace from="%len" to="%2"/> | |
1086 </insert-template> | |
1087 </conversion-rule> | |
1088 <conversion-rule class="native"> | |
1089 <insert-template name="core.iodevice_convert_byte[]_to_char*"/> | |
1090 </conversion-rule> | |
1091 </modify-argument> | |
1092 | |
1093 <modify-argument index="2"> | |
1094 <remove-argument/> | |
1095 <conversion-rule class="shell"> | |
1096 // nothing | |
1097 </conversion-rule> | |
1098 <conversion-rule class="native"> | |
1099 <insert-template name="core.get_array_length"> | |
1100 <replace from="%ARRAY" to="%1"/> | |
1101 </insert-template> | |
1102 </conversion-rule> | |
1103 </modify-argument> | |
1104 | |
1105 <modify-argument index="0"> | |
1106 <replace-type modified-type="int"/> | |
1107 <conversion-rule class="native"> | |
1108 <insert-template name="core.iodevice_cleanup"/> | |
1109 </conversion-rule> | |
1110 <conversion-rule class="shell"> | |
1111 qint64 %out = %in; | |
1112 <insert-template name="core.iodevice_cleanup_to_java"> | |
1113 <replace from="%len" to="(int) %in"/> | |
1114 </insert-template> | |
1115 </conversion-rule> | |
1116 </modify-argument> | |
1117 </modify-function> | |
1118 </object-type> | |
1119 | |
1120 <value-type name="QLineF"> | |
1121 <inject-code> | |
1122 <import-file name="typesystem_core-java.java" quote-after-line="class QLineF___" quote-before-line="}// class"/> | |
1123 </inject-code> | |
1124 <modify-function signature="intersect(QLineF,QPointF*)const "> | |
1125 <access modifier="private"/> | |
1126 </modify-function> | |
1127 | |
1128 </value-type> | |
1129 | |
1130 <object-type name="QCryptographicHash"> | |
1131 <inject-code> | |
1132 <import-file name="typesystem_core-java.java" quote-after-line="class QCryptographicHash___" quote-before-line="}// class"/> | |
1133 </inject-code> | |
1134 <modify-function signature="addData(const char*,int)"> | |
1135 <access modifier="private"/> | |
1136 </modify-function> | |
1137 | |
1138 </object-type> | |
1139 | |
1140 | |
1141 <object-type name="QTextCodec"> | |
1142 <inject-code> | |
1143 <import-file name="typesystem_core-java.java" quote-after-line="class QTextCodec___" quote-before-line="}// class"/> | |
1144 </inject-code> | |
1145 | |
1146 <modify-function signature="convertFromUnicode(const QChar*,int,QTextCodec::ConverterState*)const"> | |
1147 <modify-argument index="3" invalidate-after-use="yes" /> | |
1148 <modify-argument index="1"> | |
1149 <replace-type modified-type="string"/> | |
1150 <conversion-rule class="shell"> | |
1151 // Convert directly QChar * -> ushort * | |
1152 <insert-template name="core.convert_primitive_array_to_java"> | |
1153 <replace from="%JNITYPE" to="jchar"/> | |
1154 <replace from="%JAVATYPE" to="Char"/> | |
1155 <replace from="%len" to="%2"/> | |
1156 </insert-template> | |
1157 </conversion-rule> | |
1158 <conversion-rule class="native"> | |
1159 // Convert directly ushort * -> QChar * | |
1160 <insert-template name="core.convert_primitive_array_from_java"> | |
1161 <replace from="%CTYPE" to="ushort"/> | |
1162 <replace from="%JAVATYPE" to="Char"/> | |
1163 <replace from="%JNITYPE" to="jchar"/> | |
1164 </insert-template> | |
1165 </conversion-rule> | |
1166 </modify-argument> | |
1167 | |
1168 <modify-argument index="0"> | |
1169 <conversion-rule class="native"> | |
1170 jobject %out = qtjambi_from_object(__jni_env, &%in, "QByteArray", "com/trolltech/qt/core/", true); | |
1171 <insert-template name="core.cleanup_convert_primitive_array_from_java"> | |
1172 <replace from="%JNITYPE" to="jchar"/> | |
1173 <replace from="%JAVATYPE" to="Char"/> | |
1174 </insert-template> | |
1175 </conversion-rule> | |
1176 </modify-argument> | |
1177 </modify-function> | |
1178 | |
1179 <modify-function signature="convertToUnicode(const char*,int,QTextCodec::ConverterState*)const"> | |
1180 <modify-argument index="3" invalidate-after-use="yes" /> | |
1181 <modify-argument index="1"> | |
1182 <replace-type modified-type="byte[]"/> | |
1183 <conversion-rule class="shell"> | |
1184 <insert-template name="core.convert_primitive_array_to_java"> | |
1185 <replace from="%JNITYPE" to="jbyte"/> | |
1186 <replace from="%JAVATYPE" to="Byte"/> | |
1187 <replace from="%len" to="%2"/> | |
1188 </insert-template> | |
1189 </conversion-rule> | |
1190 <conversion-rule class="native"> | |
1191 <insert-template name="core.convert_primitive_array_from_java"> | |
1192 <replace from="%CTYPE" to="char"/> | |
1193 <replace from="%JAVATYPE" to="Byte"/> | |
1194 <replace from="%JNITYPE" to="jbyte"/> | |
1195 </insert-template> | |
1196 </conversion-rule> | |
1197 </modify-argument> | |
1198 | |
1199 <modify-argument index="0"> | |
1200 <conversion-rule class="native"> | |
1201 jstring %out = qtjambi_from_qstring(__jni_env, %in); | |
1202 <insert-template name="core.cleanup_convert_primitive_array_from_java"> | |
1203 <replace from="%JNITYPE" to="jbyte"/> | |
1204 <replace from="%JAVATYPE" to="Byte"/> | |
1205 </insert-template> | |
1206 </conversion-rule> | |
1207 </modify-argument> | |
1208 </modify-function> | |
1209 | |
1210 <modify-function signature="codecForName(const char*) "> | |
1211 <access modifier="private"/> | |
1212 </modify-function> | |
1213 | |
1214 </object-type> | |
1215 | |
1216 <object-type name="QTranslator"> | |
1217 <extra-includes> | |
1218 <include file-name="QTextCodec" location="global"/> | |
1219 </extra-includes> | |
1220 <modify-function signature="load(const unsigned char*,int)"> | |
1221 <access modifier="private"/> | |
1222 </modify-function> | |
1223 <inject-code> | |
1224 <import-file name="typesystem_core-java.java" quote-after-line="class QTranslator___" quote-before-line="}// class"/> | |
1225 </inject-code> | |
1226 | |
1227 <modify-function signature="translate(const char*,const char*,const char*)const"> | |
1228 <modify-argument index="1"> | |
1229 <replace-type modified-type="string"/> | |
1230 <conversion-rule class="shell"> | |
1231 QTextCodec *codec = QTextCodec::codecForName("UTF-8"); | |
1232 QByteArray b1; | |
1233 if (%in != 0) | |
1234 b1 = codec->fromUnicode(%in); | |
1235 | |
1236 jobject %out = qtjambi_from_qstring(__jni_env, QString(b1)); | |
1237 </conversion-rule> | |
1238 | |
1239 <conversion-rule class="native"> | |
1240 const char* %out = %in; | |
1241 </conversion-rule> | |
1242 </modify-argument> | |
1243 <modify-argument index="2"> | |
1244 <replace-type modified-type="string"/> | |
1245 <conversion-rule class="shell"> | |
1246 QByteArray b2; | |
1247 if (%in != 0) | |
1248 b2 = codec->fromUnicode(%in); | |
1249 | |
1250 jobject %out = qtjambi_from_qstring(__jni_env, QString(b2)); | |
1251 </conversion-rule> | |
1252 <conversion-rule class="native"> | |
1253 const char* %out = %in; | |
1254 </conversion-rule> | |
1255 | |
1256 </modify-argument> | |
1257 <modify-argument index="3"> | |
1258 <replace-type modified-type="string"/> | |
1259 <conversion-rule class="shell"> | |
1260 QByteArray b3; | |
1261 if (%in != 0) | |
1262 b3 = codec->fromUnicode(%in); | |
1263 | |
1264 jobject %out = qtjambi_from_qstring(__jni_env, QString(b3)); | |
1265 </conversion-rule> | |
1266 <conversion-rule class="native"> | |
1267 const char* %out = %in; | |
1268 </conversion-rule> | |
1269 </modify-argument> | |
1270 </modify-function> | |
1271 </object-type> | |
1272 | |
1273 <object-type name="QWaitCondition"> | |
1274 <modify-function signature="wait(QMutex *, unsigned long)"> | |
1275 <modify-argument index="2"> | |
1276 <replace-default-expression with="0xffffffff"/> | |
1277 </modify-argument> | |
1278 </modify-function> | |
1279 <modify-function signature="wait(QReadWriteLock *, unsigned long)"> | |
1280 <modify-argument index="2"> | |
1281 <replace-default-expression with="0xffffffff"/> | |
1282 </modify-argument> | |
1283 </modify-function> | |
1284 </object-type> | |
1285 | |
1286 | |
1287 <object-type name="QBuffer"> | |
1288 <inject-code> | |
1289 <import-file name="typesystem_core-java.java" quote-after-line="class QBuffer___" quote-before-line="}// class"/> | |
1290 </inject-code> | |
1291 <extra-includes> | |
1292 <include file-name="qt.QNativePointer" location="java"/> | |
1293 </extra-includes> | |
1294 | |
1295 | |
1296 <modify-function signature="QBuffer(QByteArray*,QObject*)"> | |
1297 <access modifier="private"/> | |
1298 <modify-argument index="2"> | |
1299 <remove-default-expression /> | |
1300 </modify-argument> | |
1301 </modify-function> | |
1302 | |
1303 | |
1304 <modify-function signature="setBuffer(QByteArray*)"> | |
1305 <access modifier="private"/> | |
1306 </modify-function> | |
1307 | |
1308 | |
1309 <modify-function signature="setData(const char*,int)"> | |
1310 <access modifier="private"/> | |
1311 </modify-function> | |
1312 | |
1313 </object-type> | |
1314 | |
1315 <object-type name="QTimer"> | |
1316 <inject-code class="java"> | |
1317 <import-file name="typesystem_core-java.java" quote-after-line="class QTimer___" quote-before-line="}// class"/> | |
1318 </inject-code> | |
1319 </object-type> | |
1320 | |
1321 <object-type name="QProcess"> | |
1322 <modify-function signature="finished(int, QProcess::ExitStatus)"> | |
1323 <rename to="finishedWithStatusCode"/> | |
1324 </modify-function> | |
1325 <modify-function signature="setStandardOutputProcess(QProcess*)"> | |
1326 <modify-argument index="1"> | |
1327 <reference-count action="set" variable-name="__rcStandardOutputProcess"/> | |
1328 </modify-argument> | |
1329 </modify-function> | |
1330 <modify-function signature="startDetached(QString,QStringList<QString>,QString,long long*)"> | |
1331 <access modifier="private"/> | |
1332 <modify-argument index="4"> | |
1333 <remove-default-expression/> | |
1334 </modify-argument> | |
1335 </modify-function> | |
1336 <inject-code> | |
1337 <import-file name="typesystem_core-java.java" quote-after-line="class QProcess___" quote-before-line="}// class"/> | |
1338 </inject-code> | |
1339 </object-type> | |
1340 | |
1341 | |
1342 <object-type name="QSignalMapper"> | |
1343 <inject-code> | |
1344 <import-file name="typesystem_core-java.java" quote-after-line="class QSignalMapper___" quote-before-line="}// class"/> | |
1345 </inject-code> | |
1346 | |
1347 | |
1348 <modify-function signature="removeMappings(QObject*)"> | |
1349 <modify-argument index="1"> | |
1350 <reference-count action="remove" variable-name="__rcMappings"/> | |
1351 </modify-argument> | |
1352 <inject-code class="java" position="end"> | |
1353 <argument-map index="1" meta-name="%1"/> | |
1354 if (__rcObjectForObject.containsKey(%1)) __rcObjectForObject.remove(%1); | |
1355 if (__rcWidgetForObject.containsKey(%1)) __rcWidgetForObject.remove(%1); | |
1356 </inject-code> | |
1357 </modify-function> | |
1358 | |
1359 <modify-function signature="setMapping(QObject*,QObject*)"> | |
1360 <modify-argument index="1"> | |
1361 <reference-count action="add" variable-name="__rcMappings"/> | |
1362 </modify-argument> | |
1363 <inject-code class="java" position="end"> | |
1364 <argument-map index="1" meta-name="%1"/> | |
1365 <argument-map index="2" meta-name="%2"/> | |
1366 if (%2 == null) | |
1367 __rcObjectForObject.remove(%1); | |
1368 else | |
1369 __rcObjectForObject.put(%1,%2); | |
1370 </inject-code> | |
1371 </modify-function> | |
1372 | |
1373 <modify-function signature="setMapping(QObject*,QString)"> | |
1374 <modify-argument index="1"> | |
1375 <reference-count action="add" variable-name="__rcMappings"/> | |
1376 </modify-argument> | |
1377 </modify-function> | |
1378 | |
1379 <modify-function signature="setMapping(QObject*,int)"> | |
1380 <modify-argument index="1"> | |
1381 <reference-count action="add" variable-name="__rcMappings"/> | |
1382 </modify-argument> | |
1383 </modify-function> | |
1384 </object-type> | |
1385 | |
1386 <object-type name="QObject"> | |
1387 <inject-code class="java"> | |
1388 <import-file name="typesystem_core-java.java" quote-after-line="class QObject___" quote-before-line="}// class"/> | |
1389 </inject-code> | |
1390 </object-type> | |
1391 | |
1392 <object-type name="QCoreApplication"> | |
1393 <modify-function signature="QCoreApplication(int &, char **)"> | |
1394 <inject-code class="shell"> | |
1395 // qtjambi_register_variant_handler(); | |
1396 </inject-code> | |
1397 </modify-function> | |
1398 <modify-function signature="translate(const char*,const char*,const char*,QCoreApplication::Encoding)"> | |
1399 <access modifier="private"/> | |
1400 <modify-argument index="3"> | |
1401 <remove-default-expression/> | |
1402 </modify-argument> | |
1403 <modify-argument index="4"> | |
1404 <remove-default-expression/> | |
1405 </modify-argument> | |
1406 </modify-function> | |
1407 <inject-code> | |
1408 <import-file name="typesystem_core-java.java" quote-after-line="class QCoreApplication___" quote-before-line="}// class"/> | |
1409 </inject-code> | |
1410 | |
1411 <modify-function signature="translate(const char*,const char*,const char*,QCoreApplication::Encoding,int)"> | |
1412 <access modifier="private"/> | |
1413 </modify-function> | |
1414 </object-type> | |
1415 | |
1416 <object-type name="QDataStream"> | |
1417 <extra-includes> | |
1418 <include file-name="qt.QNativePointer" location="java"/> | |
1419 </extra-includes> | |
1420 <template name="core.datastream_operator_shift_right"> | |
1421 <insert-template name="core.stream_operator_shift_right"> | |
1422 <replace from="%STREAM_TYPE" to="QDataStream"/> | |
1423 </insert-template> | |
1424 </template> | |
1425 | |
1426 <template name="core.datastream_operator_shift_right_primitive"> | |
1427 <insert-template name="core.datastream_operator_shift_right"> | |
1428 <replace from="%VALUE_FUNCTION" to="%TYPEValue"/> | |
1429 </insert-template> | |
1430 </template> | |
1431 | |
1432 <modify-function signature="operator<<(bool)"> | |
1433 <rename to="writeBoolean"/> | |
1434 <modify-argument index="0" replace-value="this"/> | |
1435 </modify-function> | |
1436 <modify-function signature="operator<<(signed char)"> | |
1437 <rename to="writeByte"/> | |
1438 <modify-argument index="0" replace-value="this"/> | |
1439 </modify-function> | |
1440 <modify-function signature="operator<<(int)"> | |
1441 <rename to="writeInt"/> | |
1442 <modify-argument index="0" replace-value="this"/> | |
1443 </modify-function> | |
1444 <modify-function signature="operator<<(long long)"> | |
1445 <rename to="writeLong"/> | |
1446 <modify-argument index="0" replace-value="this"/> | |
1447 </modify-function> | |
1448 <modify-function signature="operator<<(float)"> | |
1449 <rename to="writeFloat"/> | |
1450 <modify-argument index="0" replace-value="this"/> | |
1451 </modify-function> | |
1452 <modify-function signature="operator<<(double)"> | |
1453 <rename to="writeDouble"/> | |
1454 <modify-argument index="0" replace-value="this"/> | |
1455 </modify-function> | |
1456 <modify-function signature="operator<<(short)"> | |
1457 <rename to="writeShort_char"/> | |
1458 <access modifier="private"/> | |
1459 <modify-argument index="0" replace-value="this"/> | |
1460 </modify-function> | |
1461 | |
1462 <modify-function signature="operator>>(int&)"> | |
1463 <rename to="operator_shift_right_int"/> | |
1464 <modify-argument index="0" replace-value="this"/> | |
1465 <access modifier="private"/> | |
1466 </modify-function> | |
1467 | |
1468 <modify-function signature="operator>>(bool&)"> | |
1469 <rename to="operator_shift_right_boolean"/> | |
1470 <modify-argument index="0" replace-value="this"/> | |
1471 <access modifier="private"/> | |
1472 </modify-function> | |
1473 | |
1474 <modify-function signature="operator>>(short&)"> | |
1475 <rename to="operator_shift_right_short"/> | |
1476 <modify-argument index="0" replace-value="this"/> | |
1477 <access modifier="private"/> | |
1478 </modify-function> | |
1479 | |
1480 <modify-function signature="operator>>(long long&)"> | |
1481 <rename to="operator_shift_right_long"/> | |
1482 <modify-argument index="0" replace-value="this"/> | |
1483 <access modifier="private"/> | |
1484 </modify-function> | |
1485 | |
1486 <modify-function signature="operator>>(signed char&)"> | |
1487 <rename to="operator_shift_right_byte"/> | |
1488 <modify-argument index="0" replace-value="this"/> | |
1489 <access modifier="private"/> | |
1490 </modify-function> | |
1491 | |
1492 <modify-function signature="operator>>(unsigned short&)"> | |
1493 <rename to="operator_shift_right_char"/> | |
1494 <modify-argument index="0" replace-value="this"/> | |
1495 <access modifier="private"/> | |
1496 </modify-function> | |
1497 | |
1498 <modify-function signature="operator>>(float&)"> | |
1499 <rename to="operator_shift_right_float"/> | |
1500 <modify-argument index="0" replace-value="this"/> | |
1501 <access modifier="private"/> | |
1502 </modify-function> | |
1503 | |
1504 <modify-function signature="operator>>(double&)"> | |
1505 <rename to="operator_shift_right_double"/> | |
1506 <modify-argument index="0" replace-value="this"/> | |
1507 <access modifier="private"/> | |
1508 </modify-function> | |
1509 | |
1510 <inject-code> | |
1511 <import-file name="typesystem_core-java.java" quote-after-line="class QDataStream___" quote-before-line="}// class"/> | |
1512 </inject-code> | |
1513 | |
1514 <inject-code class="native"> | |
1515 extern "C" JNIEXPORT jstring JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QDataStream_readString_1private) | |
1516 (JNIEnv *env, jobject, jlong stream) | |
1517 { | |
1518 QTJAMBI_DEBUG_TRACE("(native) entering: QDataStream::%FUNCTION_NAME%_native"); | |
1519 QDataStream *qtStream = (QDataStream *) qtjambi_from_jlong(stream); | |
1520 | |
1521 jstring returned = 0; | |
1522 if (qtStream != 0) { | |
1523 QString qtString; | |
1524 operator>>(*qtStream, qtString); | |
1525 | |
1526 returned = qtjambi_from_qstring(env, qtString); | |
1527 } | |
1528 | |
1529 return returned; | |
1530 } | |
1531 | |
1532 extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QDataStream_writeString_1private) | |
1533 (JNIEnv *env, jobject, jlong stream, jstring string) | |
1534 { | |
1535 QTJAMBI_DEBUG_TRACE("(native) entering: QDataStream::%FUNCTION_NAME%_native"); | |
1536 QDataStream *qtStream = (QDataStream *) qtjambi_from_jlong(stream); | |
1537 | |
1538 if (qtStream != 0) { | |
1539 QString qtString = qtjambi_to_qstring(env, string); | |
1540 operator<<(*qtStream, qtString); | |
1541 } | |
1542 } | |
1543 | |
1544 </inject-code> | |
1545 | |
1546 <template name="core.stream_constructor_bytearray"> | |
1547 // Hold reference to byte array which goes away when the stream dies | |
1548 private QByteArray byteArray = null; | |
1549 public %CLASSNAME(QByteArray a, QIODevice.OpenMode mode) { | |
1550 this(a.nativePointer(), mode); | |
1551 byteArray = a; | |
1552 } | |
1553 | |
1554 public %CLASSNAME(QByteArray a, QIODevice.OpenModeFlag ... mode) { | |
1555 this(a.nativePointer(), mode); | |
1556 byteArray = a; | |
1557 } | |
1558 </template> | |
1559 | |
1560 <modify-function signature="QDataStream(QByteArray*,QFlags<QIODevice::OpenModeFlag>)"> | |
1561 <access modifier="private"/> | |
1562 </modify-function> | |
1563 <inject-code> | |
1564 <insert-template name="core.stream_constructor_bytearray"> | |
1565 <replace from="%CLASSNAME" to="QDataStream"/> | |
1566 </insert-template> | |
1567 </inject-code> | |
1568 | |
1569 <template name="core.qdatastream_readorwrite_bytes"> | |
1570 extern "C" JNIEXPORT jint JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QDataStream_%FUNCTION_NAME%) | |
1571 (JNIEnv *env, jobject, jlong stream, jbyteArray array, jint length) | |
1572 { | |
1573 QTJAMBI_DEBUG_TRACE("(native) entering: QDataStream::%FUNCTION_NAME%"); | |
1574 char *rawBuffer = (char *) env->GetByteArrayElements(array, 0); | |
1575 | |
1576 QDataStream *qtStream = (QDataStream *) qtjambi_from_jlong(stream); | |
1577 int count = qtStream->%QT_FUNCTION_NAME%(rawBuffer, length); | |
1578 | |
1579 env->ReleaseByteArrayElements(array, (jbyte *) rawBuffer, 0); | |
1580 QTJAMBI_DEBUG_TRACE("(native) -> leaving: QDataStream::%FUNCTION_NAME%"); | |
1581 return qMin(count, (int) length); | |
1582 } | |
1583 </template> | |
1584 | |
1585 <inject-code class="native"> | |
1586 <insert-template name="core.qdatastream_readorwrite_bytes"> | |
1587 <replace from="%FUNCTION_NAME%" to="readBytes"/> | |
1588 <replace from="%QT_FUNCTION_NAME%" to="readRawData"/> | |
1589 </insert-template> | |
1590 <insert-template name="core.qdatastream_readorwrite_bytes"> | |
1591 <replace from="%FUNCTION_NAME%" to="writeBytes"/> | |
1592 <replace from="%QT_FUNCTION_NAME%" to="writeRawData"/> | |
1593 </insert-template> | |
1594 </inject-code> | |
1595 </object-type> | |
1596 | |
1597 <object-type name="QAbstractFileEngine::UnMapExtensionOption"> | |
1598 <modify-field name="address"> | |
1599 <access modifier="private" /> | |
1600 <rename to="address_private" /> | |
1601 </modify-field> | |
1602 <inject-code> | |
1603 <import-file name="typesystem_core-java.java" quote-after-line="class QAbstractFileEngine_UnMapExtensionOption___" quote-before-line="}// class"/> | |
1604 </inject-code> | |
1605 </object-type> | |
1606 | |
1607 <object-type name="QAbstractFileEngine::MapExtensionReturn"> | |
1608 <modify-field name="address"> | |
1609 <access modifier="private" /> | |
1610 <rename to="address_private" /> | |
1611 </modify-field> | |
1612 <inject-code> | |
1613 <import-file name="typesystem_core-java.java" quote-after-line="class QAbstractFileEngine_MapExtensionReturn___" quote-before-line="}// class"/> | |
1614 </inject-code> | |
1615 </object-type> | |
1616 | |
1617 <object-type name="QAbstractFileEngine"> | |
1618 <inject-code> | |
1619 <import-file name="typesystem_core-java.java" quote-after-line="class QAbstractFileEngine___" quote-before-line="}// class"/> | |
1620 </inject-code> | |
1621 </object-type> | |
1622 | |
1623 <object-type name="QTextStream"> | |
1624 <extra-includes> | |
1625 <include file-name="qt.QNativePointer" location="java"/> | |
1626 </extra-includes> | |
1627 | |
1628 <template name="core.textstream_operator_shift_right"> | |
1629 <insert-template name="core.stream_operator_shift_right"> | |
1630 <replace from="%STREAM_TYPE" to="QTextStream"/> | |
1631 </insert-template> | |
1632 </template> | |
1633 | |
1634 <template name="core.textstream_operator_shift_right_primitive"> | |
1635 <insert-template name="core.textstream_operator_shift_right"> | |
1636 <replace from="%VALUE_FUNCTION" to="%TYPEValue"/> | |
1637 </insert-template> | |
1638 </template> | |
1639 | |
1640 <modify-function signature="operator<<(QBool)"> | |
1641 <rename to="writeBoolean"/> | |
1642 <modify-argument index="0" replace-value="this"/> | |
1643 </modify-function> | |
1644 <modify-function signature="operator<<(char)"> | |
1645 <modify-argument index="0" replace-value="this"/> | |
1646 <rename to="writeByte"/> | |
1647 </modify-function> | |
1648 <modify-function signature="operator<<(signed int)"> | |
1649 <rename to="writeInt"/> | |
1650 <modify-argument index="0" replace-value="this"/> | |
1651 </modify-function> | |
1652 <modify-function signature="operator<<(long long)"> | |
1653 <rename to="writeLong"/> | |
1654 <modify-argument index="0" replace-value="this"/> | |
1655 </modify-function> | |
1656 <modify-function signature="operator<<(float)"> | |
1657 <rename to="writeFloat"/> | |
1658 <modify-argument index="0" replace-value="this"/> | |
1659 </modify-function> | |
1660 <modify-function signature="operator<<(double)"> | |
1661 <rename to="writeDouble"/> | |
1662 <modify-argument index="0" replace-value="this"/> | |
1663 </modify-function> | |
1664 <modify-function signature="operator<<(signed short)"> | |
1665 <rename to="writeShort_char"/> | |
1666 <modify-argument index="0" replace-value="this"/> | |
1667 <access modifier="private"/> | |
1668 </modify-function> | |
1669 | |
1670 <modify-function signature="operator>>(char&)"> | |
1671 <access modifier="private"/> | |
1672 <modify-argument index="0" replace-value="this"/> | |
1673 <rename to="operator_shift_right_byte"/> | |
1674 </modify-function> | |
1675 <modify-function signature="operator>>(signed short&)"> | |
1676 <access modifier="private"/> | |
1677 <modify-argument index="0" replace-value="this"/> | |
1678 <rename to="operator_shift_right_short"/> | |
1679 </modify-function> | |
1680 <modify-function signature="operator>>(signed int&)"> | |
1681 <access modifier="private"/> | |
1682 <modify-argument index="0" replace-value="this"/> | |
1683 <rename to="operator_shift_right_int"/> | |
1684 </modify-function> | |
1685 <modify-function signature="operator>>(long long&)"> | |
1686 <access modifier="private"/> | |
1687 <modify-argument index="0" replace-value="this"/> | |
1688 <rename to="operator_shift_right_long"/> | |
1689 </modify-function> | |
1690 <modify-function signature="operator>>(float&)"> | |
1691 <access modifier="private"/> | |
1692 <modify-argument index="0" replace-value="this"/> | |
1693 <rename to="operator_shift_right_float"/> | |
1694 </modify-function> | |
1695 <modify-function signature="operator>>(double&)"> | |
1696 <access modifier="private"/> | |
1697 <modify-argument index="0" replace-value="this"/> | |
1698 <rename to="operator_shift_right_double"/> | |
1699 </modify-function> | |
1700 | |
1701 <modify-function signature="setCodec(const char*)"> | |
1702 <access modifier="private"/> | |
1703 </modify-function> | |
1704 <inject-code> | |
1705 <import-file name="typesystem_core-java.java" quote-after-line="class QTextStream___" quote-before-line="}// class"/> | |
1706 </inject-code> | |
1707 | |
1708 <inject-code class="native"> | |
1709 extern "C" JNIEXPORT jstring JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QTextStream_readString_1native) | |
1710 (JNIEnv *env, jobject, jlong id) | |
1711 { | |
1712 QTJAMBI_DEBUG_TRACE("(native) entering: QTextStream::readString()"); | |
1713 QTextStream *stream = (QTextStream *) qtjambi_from_jlong(id); | |
1714 QString str; | |
1715 (*stream) >> str; | |
1716 jstring s = qtjambi_from_qstring(env, str); | |
1717 QTJAMBI_DEBUG_TRACE("(native) -> leaving: QTextStream::readString()"); | |
1718 return s; | |
1719 } | |
1720 | |
1721 extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QTextStream_writeString_1native) | |
1722 (JNIEnv *env, jobject, jlong id, jstring str) | |
1723 { | |
1724 QTJAMBI_DEBUG_TRACE("(native) entering: QTextStream::writeString()"); | |
1725 QString qstr = qtjambi_to_qstring(env, str); | |
1726 QTextStream *stream = (QTextStream *) qtjambi_from_jlong(id); | |
1727 (*stream) << qstr; | |
1728 QTJAMBI_DEBUG_TRACE("(native) -> leaving: QTextStream::readString()"); | |
1729 } | |
1730 </inject-code> | |
1731 </object-type> | |
1732 <value-type name="QBitArray"> | |
1733 <inject-code> | |
1734 <import-file name="typesystem_core-java.java" quote-after-line="class QBitArray___" quote-before-line="}// class"/> | |
1735 </inject-code> | |
1736 </value-type> | |
1737 | |
1738 <template name="convert_qtjambifuture_to_native"> | |
1739 QtJambiFuture %out = %in != 0 ? (const QtJambiFuture& ) *(QtJambiFuture *)qtjambi_from_jlong(%in) : QtJambiFuture(); | |
1740 </template> | |
1741 <template name="convert_futurevoid_to_native"> | |
1742 QtJambiVoidFuture %out = %in != 0 ? (const QtJambiVoidFuture& ) *(QtJambiVoidFuture *)qtjambi_from_jlong(%in) : QtJambiVoidFuture(); | |
1743 </template> | |
1744 | |
1745 <value-type name="QFuture"> | |
1746 <modify-function signature="operator==(const QFuture &)const"> | |
1747 <modify-argument index="1"> | |
1748 <replace-type modified-type="qt.core.QFuture" /> | |
1749 <conversion-rule class="native"> | |
1750 <insert-template name="convert_qtjambifuture_to_native" /> | |
1751 </conversion-rule> | |
1752 </modify-argument> | |
1753 </modify-function> | |
1754 </value-type> | |
1755 | |
1756 <value-type name="QtJambiFuture"> | |
1757 <modify-function signature="QFuture(const QFuture &)"> | |
1758 <modify-argument index="1"> | |
1759 <replace-type modified-type="qt.core.QFuture<T>" /> | |
1760 <conversion-rule class="native"> | |
1761 <insert-template name="convert_qtjambifuture_to_native" /> | |
1762 </conversion-rule> | |
1763 </modify-argument> | |
1764 </modify-function> | |
1765 </value-type> | |
1766 | |
1767 <value-type name="QtJambiVoidFuture"> | |
1768 <modify-function signature="QFuture(const QFuture &)"> | |
1769 <modify-argument index="1"> | |
1770 <replace-type modified-type="qt.core.QFutureVoid" /> | |
1771 <conversion-rule class="native"> | |
1772 <insert-template name="convert_futurevoid_to_native" /> | |
1773 </conversion-rule> | |
1774 </modify-argument> | |
1775 </modify-function> | |
1776 </value-type> | |
1777 | |
1778 <object-type name="QFutureWatcherBase"> | |
1779 <inject-code class="shell-declaration"> | |
1780 | |
1781 // private, pure virtual and considered internal | |
1782 // we need to reimplement them so it will compile | |
1783 QFutureInterfaceBase dummyBase; | |
1784 virtual const QFutureInterfaceBase &futureInterface() const { return dummyBase; } | |
1785 virtual QFutureInterfaceBase &futureInterface() { return dummyBase; } | |
1786 </inject-code> | |
1787 </object-type> | |
1788 | |
1789 <object-type name="QFutureWatcher"> | |
1790 <modify-function signature="setFuture(const QFuture &)"> | |
1791 <modify-argument index="1"> | |
1792 <replace-type modified-type="qt.core.QFuture<T>" /> | |
1793 <conversion-rule class="native"> | |
1794 <insert-template name="convert_qtjambifuture_to_native" /> | |
1795 </conversion-rule> | |
1796 </modify-argument> | |
1797 </modify-function> | |
1798 </object-type> | |
1799 | |
1800 <template name="future_function_in_futurewatcher"> | |
1801 extern "C" JNIEXPORT jobject JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QFutureWatcher__1_1qt_1future__J) | |
1802 (JNIEnv *__jni_env, | |
1803 jobject, | |
1804 jlong __this_nativeId) | |
1805 { | |
1806 QTJAMBI_DEBUG_TRACE("(native) entering: QFutureWatcher::future() const"); | |
1807 Q_UNUSED(__jni_env) | |
1808 Q_UNUSED(__this_nativeId) | |
1809 QtJambiShell_QFutureWatcher *__qt_this = (QtJambiShell_QFutureWatcher *) qtjambi_from_jlong(__this_nativeId); | |
1810 QTJAMBI_EXCEPTION_CHECK(__jni_env); | |
1811 Q_ASSERT(__qt_this); | |
1812 QtJambiFuture __qt_return_value = __qt_this->future(); | |
1813 | |
1814 jobject __java_return_value = qtjambi_from_object(__jni_env, &__qt_return_value, "QFuture", "com/trolltech/qt/core/", true); | |
1815 | |
1816 QTJAMBI_DEBUG_TRACE("(native) -> leaving: QFutureWatcher::future() const"); | |
1817 return __java_return_value; | |
1818 } | |
1819 </template> | |
1820 <template name="futures_function_in_futuresynchronizer"> | |
1821 extern "C" JNIEXPORT jobject JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_core_QFutureSynchronizer__1_1qt_1futures__J) | |
1822 (JNIEnv *__jni_env, | |
1823 jobject, | |
1824 jlong __this_nativeId) | |
1825 { | |
1826 QTJAMBI_DEBUG_TRACE("(native) entering: QFutureSynchronizer::futures() const"); | |
1827 Q_UNUSED(__jni_env) | |
1828 Q_UNUSED(__this_nativeId) | |
1829 QtJambiFutureSynchronizer *__qt_this = (QtJambiFutureSynchronizer *) qtjambi_from_jlong(__this_nativeId); | |
1830 QTJAMBI_EXCEPTION_CHECK(__jni_env); | |
1831 Q_ASSERT(__qt_this); | |
1832 QList<QtJambiFuture> __qt_return_value = __qt_this->futures(); | |
1833 | |
1834 | |
1835 jobject __java_return_value = qtjambi_arraylist_new(__jni_env, __qt_return_value.size()); | |
1836 QList<QtJambiFuture> ::const_iterator __qt_return_value_end_it = __qt_return_value.constEnd(); | |
1837 for (QList<QtJambiFuture> ::const_iterator __qt_return_value_it = __qt_return_value.constBegin(); __qt_return_value_it != __qt_return_value_end_it; ++__qt_return_value_it) { | |
1838 QtJambiFuture __qt_tmp = *__qt_return_value_it; | |
1839 jobject __java_tmp = qtjambi_from_object(__jni_env, &__qt_tmp, "QFuture", "com/trolltech/qt/core/", true); | |
1840 QTJAMBI_EXCEPTION_CHECK(__jni_env); | |
1841 qtjambi_collection_add(__jni_env, __java_return_value, __java_tmp); | |
1842 } | |
1843 QTJAMBI_EXCEPTION_CHECK(__jni_env); | |
1844 QTJAMBI_EXCEPTION_CHECK(__jni_env); | |
1845 QTJAMBI_DEBUG_TRACE("(native) -> leaving: QFutureSynchronizer::futures() const"); | |
1846 return __java_return_value; | |
1847 } | |
1848 </template> | |
1849 | |
1850 <object-type name="QtJambiFutureWatcher"> | |
1851 <inject-code> | |
1852 <import-file name="typesystem_core-java.java" quote-after-line="class QFutureWatcher___" quote-before-line="}// class"/> | |
1853 </inject-code> | |
1854 <inject-code class="native"> | |
1855 <insert-template name="future_function_in_futurewatcher" /> | |
1856 </inject-code> | |
1857 </object-type> | |
1858 | |
1859 <object-type name="QtJambiVoidFutureWatcher"> | |
1860 <modify-function signature="setFuture(const QFuture &)"> | |
1861 <modify-argument index="1"> | |
1862 <replace-type modified-type="qt.core.QFutureVoid" /> | |
1863 <conversion-rule class="native"> | |
1864 <insert-template name="convert_futurevoid_to_native" /> | |
1865 </conversion-rule> | |
1866 </modify-argument> | |
1867 </modify-function> | |
1868 <inject-code> | |
1869 <import-file name="typesystem_core-java.java" quote-after-line="class QFutureWatcherVoid___" quote-before-line="}// class"/> | |
1870 </inject-code> | |
1871 <inject-code class="native"> | |
1872 <insert-template name="future_function_in_futurewatcher"> | |
1873 <replace from="QFutureWatcher" to="QFutureWatcherVoid" /> | |
1874 <replace from="QtJambiFuture" to="QtJambiVoidFuture" /> | |
1875 <replace from=""QFuture"" to=""QFutureVoid"" /> | |
1876 </insert-template> | |
1877 </inject-code> | |
1878 </object-type> | |
1879 | |
1880 <object-type name="QtJambiFutureSynchronizer"> | |
1881 <modify-function signature="QFutureSynchronizer(const QFuture &)"> | |
1882 <modify-argument index="1"> | |
1883 <replace-type modified-type="qt.core.QFuture<T>" /> | |
1884 <conversion-rule class="native"> | |
1885 <insert-template name="convert_qtjambifuture_to_native" /> | |
1886 </conversion-rule> | |
1887 </modify-argument> | |
1888 </modify-function> | |
1889 <modify-function signature="addFuture(const QFuture &)"> | |
1890 <modify-argument index="1"> | |
1891 <replace-type modified-type="qt.core.QFuture<T>" /> | |
1892 <conversion-rule class="native"> | |
1893 <insert-template name="convert_qtjambifuture_to_native" /> | |
1894 </conversion-rule> | |
1895 </modify-argument> | |
1896 </modify-function> | |
1897 <modify-function signature="setFuture(const QFuture &)"> | |
1898 <modify-argument index="1"> | |
1899 <replace-type modified-type="qt.core.QFuture<T>" /> | |
1900 <conversion-rule class="native"> | |
1901 <insert-template name="convert_qtjambifuture_to_native" /> | |
1902 </conversion-rule> | |
1903 </modify-argument> | |
1904 </modify-function> | |
1905 <modify-function signature="futures()const" remove="all" /> | |
1906 <inject-code class="native"> | |
1907 <insert-template name="futures_function_in_futuresynchronizer" /> | |
1908 </inject-code> | |
1909 <inject-code class="java"> | |
1910 <import-file name="typesystem_core-java.java" quote-after-line="class QFutureSynchronizer___" quote-before-line="}// class"/> | |
1911 </inject-code> | |
1912 </object-type> | |
1913 <object-type name="QtJambiVoidFutureSynchronizer"> | |
1914 <modify-function signature="QFutureSynchronizer(const QFuture &)"> | |
1915 <modify-argument index="1"> | |
1916 <replace-type modified-type="qt.core.QFutureVoid" /> | |
1917 <conversion-rule class="native"> | |
1918 <insert-template name="convert_futurevoid_to_native" /> | |
1919 </conversion-rule> | |
1920 </modify-argument> | |
1921 </modify-function> | |
1922 <modify-function signature="addFuture(const QFuture &)"> | |
1923 <modify-argument index="1"> | |
1924 <replace-type modified-type="qt.core.QFutureVoid" /> | |
1925 <conversion-rule class="native"> | |
1926 <insert-template name="convert_futurevoid_to_native" /> | |
1927 </conversion-rule> | |
1928 </modify-argument> | |
1929 </modify-function> | |
1930 <modify-function signature="setFuture(const QFuture &)"> | |
1931 <modify-argument index="1"> | |
1932 <replace-type modified-type="qt.core.QFutureVoid" /> | |
1933 <conversion-rule class="native"> | |
1934 <insert-template name="convert_futurevoid_to_native" /> | |
1935 </conversion-rule> | |
1936 </modify-argument> | |
1937 </modify-function> | |
1938 <modify-function signature="futures()const" remove="all" /> | |
1939 <inject-code class="native"> | |
1940 <insert-template name="futures_function_in_futuresynchronizer"> | |
1941 <replace from="QFutureSynchronizer" to="QFutureSynchronizerVoid" /> | |
1942 <replace from="QtJambiFutureSynchronizer" to="QtJambiVoidFutureSynchronizer" /> | |
1943 <replace from="QtJambiFuture" to="QtJambiVoidFuture" /> | |
1944 <replace from=""QFuture"" to=""QFutureVoid"" /> | |
1945 </insert-template> | |
1946 </inject-code> | |
1947 <inject-code class="java"> | |
1948 <import-file name="typesystem_core-java.java" quote-after-line="class QFutureSynchronizerVoid___" quote-before-line="}// class"/> | |
1949 </inject-code> | |
1950 </object-type> | |
1951 | |
1952 <object-type name="QtJambiFutureIterator"> | |
1953 <modify-function signature="QFutureIterator(const QFuture &)"> | |
1954 <modify-argument index="1"> | |
1955 <replace-type modified-type="qt.core.QFuture<T>" /> | |
1956 <conversion-rule class="native"> | |
1957 <insert-template name="convert_qtjambifuture_to_native" /> | |
1958 </conversion-rule> | |
1959 </modify-argument> | |
1960 </modify-function> | |
1961 </object-type> | |
1962 | |
1963 <namespace-type name="QtConcurrent"> | |
1964 <inject-code class="java"> | |
1965 <import-file name="typesystem_core-java.java" quote-after-line="class QtConcurrent___" quote-before-line="}// class"/> | |
1966 </inject-code> | |
1967 </namespace-type> | |
1968 | |
1969 </typesystem> |