comparison generator/typesystem_gui-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.gui" default-superclass="QtDObject">
3 <inject-code>
4 qt.Utilities.loadQtLibrary("QtGui");
5 </inject-code>
6
7 <template name="gui.getter_returning_nativepointer">
8 public final %RETURN_TYPE %FUNCTION_NAME() {
9 QNativePointer np = %FUNCTION_NAME_private();
10 %RETURN_TYPE tmp = np == null ? null : %RETURN_TYPE.fromNativePointer(np);
11 return tmp == null ? null : new %RETURN_TYPE(tmp);
12 }
13
14 </template>
15
16 <template name="gui.init_style_option">
17 protected final void initStyleOption(%TYPE option) {
18 initStyleOption(option.nativePointer());
19 }
20 </template>
21
22 <template name="gui.convert_validationdata_to_java">
23 StaticCache *sc = StaticCache::instance();
24 sc-&gt;resolveValidationData();
25 jstring __qt_converted_input = qtjambi_from_qstring(__jni_env, %STRING);
26 jobject %out = __jni_env-&gt;NewObject(sc-&gt;ValidationData.class_ref, sc-&gt;ValidationData.constructor, __qt_converted_input, %POS);
27 jobject __java_validation_data = %out;
28 </template>
29
30 <template name="gui.cleanup_validationdata_from_java">
31 __jni_env-&gt;SetIntField(%1, sc-&gt;ValidationData.position, *__position_ptr);
32 __jni_env-&gt;SetObjectField(%1, sc-&gt;ValidationData.string, qtjambi_from_qstring(__jni_env, *__string_ptr));
33 </template>
34
35 <template name="gui.convert_validationdata_to_string">
36 StaticCache *sc = StaticCache::instance();
37 sc-&gt;resolveValidationData();
38 jstring __java_string = (jstring) __jni_env-&gt;GetObjectField(%in, sc-&gt;ValidationData.string);
39 QString %out = __java_string == 0 ? QString() : qtjambi_to_qstring(__jni_env, __java_string);
40 QString *__string_ptr = &amp;%out;
41 </template>
42
43 <template name="gui.convert_validationdata_to_pos">
44 int %out = __jni_env-&gt;GetIntField(%1, sc-&gt;ValidationData.position);
45 int *__position_ptr = &amp;%out;
46 </template>
47
48 <template name="gui.cleanup_validationdata_to_java">
49 jstring __java_string = (jstring) __jni_env-&gt;GetObjectField(__java_validation_data, sc-&gt;ValidationData.string);
50 %STRING = __java_string == 0 ? QString() : qtjambi_to_qstring(__jni_env, __java_string);
51 %POS = __jni_env-&gt;GetIntField(__java_validation_data, sc-&gt;ValidationData.position);
52 </template>
53
54 <template name="gui.convert_object_array_to_java">
55 jobjectArray %out = 0;
56
57 {
58 jclass __resolved_class = resolveClass(__jni_env, "%CLASSNAME_ARRAY", "%PACKAGE_ARRAY");
59 QTJAMBI_EXCEPTION_CHECK(__jni_env);
60 Q_ASSERT(__resolved_class != 0);
61
62 %out = %in == 0 ? 0 : __jni_env-&gt;NewObjectArray(%LENGTH, __resolved_class, 0);
63 QTJAMBI_EXCEPTION_CHECK(__jni_env);
64 if (%out != 0) {
65 for (int i=0; i&lt;%LENGTH; ++i) {
66 __jni_env-&gt;SetObjectArrayElement(%out, i, qtjambi_from_object(__jni_env, %REFERENCE %in[i], "%CLASSNAME", "%PACKAGE", %LOOKUP true));
67 }
68 }
69 }
70 </template>
71
72 <template name="gui.convert_graphicsitem_array_to_java">
73 <insert-template name="gui.convert_object_array_to_java">
74 <replace from="%CLASSNAME_ARRAY" to="QGraphicsItemInterface"/>
75 <replace from="%PACKAGE_ARRAY" to="com/trolltech/qt/gui/"/>
76 <replace from="%CLASSNAME" to="QGraphicsItem$ConcreteWrapper"/>
77 <replace from="%PACKAGE" to="com/trolltech/qt/gui/"/>
78 <replace from="%LOOKUP" to=""/>
79 <replace from="%REFERENCE" to=""/>
80 </insert-template>
81 </template>
82
83 <template name="gui.convert_styleoptiongraphicsitem_array_to_java">
84 <insert-template name="gui.convert_object_array_to_java">
85 <replace from="%CLASSNAME_ARRAY" to="QStyleOptionGraphicsItem"/>
86 <replace from="%PACKAGE_ARRAY" to="com/trolltech/qt/gui/"/>
87 <replace from="%CLASSNAME" to="QStyleOptionGraphicsItem"/>
88 <replace from="%PACKAGE" to="com/trolltech/qt/gui/"/>
89 <replace from="%LOOKUP" to="&quot;Lcom_trolltech_qt_gui_QStyleOption_2&quot;,"/>
90 <replace from="%REFERENCE" to="&amp;"/>
91 </insert-template>
92 </template>
93
94 <template name="gui.convert_interface_array_from_java">
95 %CLASSNAME *%out = 0;
96 QVarLengthArray&lt;%CLASSNAME, 256&gt; __interfaceArray(__length);
97 if (%in != 0) {
98 for (int i=0; i&lt;__length; ++i) {
99 __interfaceArray[i] = (%CLASSNAME) %CONVERSION_FUNCTION(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i) %EXTRA);
100 }
101 }
102 %out = %in == 0 ? 0 : __interfaceArray.data();
103 </template>
104
105 <template name="gui.convert_object_array_from_java">
106 %CLASSNAME *%out = 0;
107 QVarLengthArray&lt;%CLASSNAME, 256&gt; __array(__length);
108 if (%in != 0) {
109 for (int i=0; i&lt;__length; ++i) {
110 __array[i] = *(%CLASSNAME *) %CONVERSION_FUNCTION(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i) %EXTRA);
111 }
112 }
113 %out = %in == 0 ? 0 : __array.data();
114 </template>
115
116 <template name="gui.convert_graphicsitem_array_from_java">
117 <insert-template name="gui.convert_interface_array_from_java">
118 <replace from="%CLASSNAME" to="QGraphicsItem *"/>
119 <replace from="%EXTRA" to=", &quot;QGraphicsItemInterface&quot;, &quot;com/trolltech/qt/gui/&quot;, &quot;__qt_cast_to_QGraphicsItem&quot;"/>
120 <replace from="%CONVERSION_FUNCTION" to="qtjambi_to_interface"/>
121 </insert-template>
122 </template>
123
124
125 <template name="gui.convert_styleoptiongraphicsitem_array_from_java">
126 <insert-template name="gui.convert_object_array_from_java">
127 <replace from="%CLASSNAME" to="QStyleOptionGraphicsItem"/>
128 <replace from="%EXTRA" to=""/>
129 <replace from="%CONVERSION_FUNCTION" to="qtjambi_to_object"/>
130 </insert-template>
131 </template>
132
133
134 <value-type name="QTransform">
135 <inject-code>
136 <import-file name="typesystem_gui-java.java" quote-after-line="class QTransform___" quote-before-line="}// class"/>
137 </inject-code>
138
139 <extra-includes>
140 <include file-name="qt.core.Qt.Axis" location="java"/>
141 </extra-includes>
142
143 <modify-function signature="inverted(bool*)const">
144 <access modifier="private"/>
145 <modify-argument index="1">
146 <remove-default-expression/>
147 </modify-argument>
148 </modify-function>
149
150 <modify-function signature="rotate(double,Qt::Axis)">
151 <modify-argument index="1">
152 <remove-default-expression/>
153 </modify-argument>
154 <access modifier="private"/>
155 <rename to="rotate_private"/>
156 </modify-function>
157 <inject-code>
158 /**
159 * Rotates the transformation around the given axis.
160 *
161 * @return The rotated transformation.
162 */
163 <insert-template name="core.private_function_return_self">
164 <replace from="%RETURN_TYPE" to="QTransform"/>
165 <replace from="%FUNCTION_NAME" to="rotate"/>
166 <replace from="%ARGUMENTS" to="double angle, Axis axis"/>
167 <replace from="%ARGUMENT_NAMES" to="angle, axis"/>
168 </insert-template>
169
170 /**
171 * Rotates the transformation around the z-axis.
172 *
173 * @return The rotated transformation.
174 */
175 <insert-template name="core.private_function_return_self">
176 <replace from="%RETURN_TYPE" to="QTransform"/>
177 <replace from="%FUNCTION_NAME" to="rotate"/>
178 <replace from="%ARGUMENTS" to="double angle"/>
179 <replace from="%ARGUMENT_NAMES" to="angle"/>
180 </insert-template>
181 </inject-code>
182
183 <modify-function signature="rotateRadians(double,Qt::Axis)">
184 <modify-argument index="1">
185 <remove-default-expression/>
186 </modify-argument>
187 <access modifier="private"/>
188 <rename to="rotateRadians_private"/>
189 </modify-function>
190 <inject-code>
191 /**
192 * Rotates the transformation around the given axis.
193 *
194 * @return The rotated transformation.
195 */
196 <insert-template name="core.private_function_return_self">
197 <replace from="%RETURN_TYPE" to="QTransform"/>
198 <replace from="%FUNCTION_NAME" to="rotateRadians"/>
199 <replace from="%ARGUMENTS" to="double angle, Axis axis"/>
200 <replace from="%ARGUMENT_NAMES" to="angle, axis"/>
201 </insert-template>
202
203 /**
204 * Rotates the transformation around the z-axis.
205 *
206 * @return The rotated transformation.
207 */
208 <insert-template name="core.private_function_return_self">
209 <replace from="%RETURN_TYPE" to="QTransform"/>
210 <replace from="%FUNCTION_NAME" to="rotateRadians"/>
211 <replace from="%ARGUMENTS" to="double angle"/>
212 <replace from="%ARGUMENT_NAMES" to="angle"/>
213 </insert-template>
214 </inject-code>
215
216 <modify-function signature="scale(double,double)">
217 <access modifier="private"/>
218 <rename to="scale_private"/>
219 </modify-function>
220 <inject-code>
221 /**
222 * Scales the transformation using x and y.
223 *
224 * @return The scaled transformation.
225 */
226 <insert-template name="core.private_function_return_self">
227 <replace from="%RETURN_TYPE" to="QTransform"/>
228 <replace from="%FUNCTION_NAME" to="scale"/>
229 <replace from="%ARGUMENTS" to="double x, double y"/>
230 <replace from="%ARGUMENT_NAMES" to="x, y"/>
231 </insert-template>
232 </inject-code>
233
234 <modify-function signature="shear(double,double)">
235 <access modifier="private"/>
236 <rename to="shear_private"/>
237 </modify-function>
238 <inject-code>
239 /**
240 * Shears the transformation using x and y.
241 *
242 * @return The sheared transformation.
243 */
244 <insert-template name="core.private_function_return_self">
245 <replace from="%RETURN_TYPE" to="QTransform"/>
246 <replace from="%FUNCTION_NAME" to="shear"/>
247 <replace from="%ARGUMENTS" to="double x, double y"/>
248 <replace from="%ARGUMENT_NAMES" to="x, y"/>
249 </insert-template>
250 </inject-code>
251
252 <modify-function signature="translate(double,double)">
253 <access modifier="private"/>
254 <rename to="translate_private"/>
255 </modify-function>
256 <inject-code>
257 /**
258 * Translates the transformation using x and y.
259 *
260 * @return The translated transformation.
261 */
262 <insert-template name="core.private_function_return_self">
263 <replace from="%RETURN_TYPE" to="QTransform"/>
264 <replace from="%FUNCTION_NAME" to="translate"/>
265 <replace from="%ARGUMENTS" to="double x, double y"/>
266 <replace from="%ARGUMENT_NAMES" to="x, y"/>
267 </insert-template>
268 </inject-code>
269
270 <modify-function signature="quadToQuad(QPolygonF,QPolygonF,QTransform&amp;)">
271 <access modifier="private"/>
272 <rename to="quadToQuadPrivate"/>
273 </modify-function>
274
275 <modify-function signature="quadToSquare(QPolygonF,QTransform&amp;)">
276 <access modifier="private"/>
277 <rename to="quadToSquarePrivate"/>
278 </modify-function>
279
280 <modify-function signature="squareToQuad(QPolygonF,QTransform&amp;)">
281 <access modifier="private"/>
282 <rename to="squareToQuadPrivate"/>
283 </modify-function>
284
285 </value-type>
286
287 <value-type name="QBitmap">
288 <inject-code>
289 <import-file name="typesystem_gui-java.java" quote-after-line="class QBitmap___" quote-before-line="}// class"/>
290 </inject-code>
291 </value-type>
292
293
294
295 <value-type name="QTextLine">
296 <inject-code>
297 <import-file name="typesystem_gui-java.java" quote-after-line="class QTextLine___" quote-before-line="}// class"/>
298 </inject-code>
299 <modify-function signature="draw(QPainter*,QPointF,const QTextLayout::FormatRange*)const">
300 <access modifier="private"/>
301 <modify-argument index="3">
302 <remove-default-expression/>
303 </modify-argument>
304 </modify-function>
305
306 </value-type>
307
308
309
310 <value-type name="QKeySequence">
311 <inject-code>
312 <import-file name="typesystem_gui-java.java" quote-after-line="class QKeySequence___" quote-before-line="}// class"/>
313 </inject-code>
314
315 </value-type>
316
317
318
319 <value-type name="QPicture">
320 <inject-code>
321 <import-file name="typesystem_gui-java.java" quote-after-line="class QPicture___" quote-before-line="}// class"/>
322 </inject-code>
323 <extra-includes>
324 <include file-name="qt.core.QIODevice" location="java"/>
325 </extra-includes>
326 <modify-function signature="load(QIODevice*,const char*)">
327 <access modifier="private"/>
328 <modify-argument index="2">
329 <remove-default-expression/>
330 </modify-argument>
331 </modify-function>
332
333
334 <modify-function signature="load(QString,const char*)">
335 <access modifier="private"/>
336 <modify-argument index="2">
337 <remove-default-expression/>
338 </modify-argument>
339 </modify-function>
340
341
342 <modify-function signature="save(QIODevice*,const char*)">
343 <access modifier="private"/>
344 <modify-argument index="2">
345 <remove-default-expression/>
346 </modify-argument>
347 </modify-function>
348
349
350 <modify-function signature="save(QString,const char*)">
351 <access modifier="private"/>
352 <modify-argument index="2">
353 <remove-default-expression/>
354 </modify-argument>
355 </modify-function>
356
357
358 <modify-function signature="setData(const char*,uint)">
359 <modify-argument index="1">
360 <replace-type modified-type="byte[]"/>
361 <conversion-rule class="shell">
362 jbyteArray %out = __jni_env-&gt;NewByteArray(%2);
363 __jni_env-&gt;SetByteArrayRegion(%out, 0, %2, (jbyte *) %in);
364 </conversion-rule>
365 <conversion-rule class="native">
366 char *%out = (char *) __jni_env-&gt;GetByteArrayElements((jbyteArray) %in, 0);
367 char *__ptr = %out;
368 Q_UNUSED(__ptr)
369 </conversion-rule>
370 </modify-argument>
371
372 <modify-argument index="2">
373 <remove-argument/>
374 <conversion-rule class="shell">
375 // nothing
376 </conversion-rule>
377 <conversion-rule class="native">
378 int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
379 </conversion-rule>
380 </modify-argument>
381 </modify-function>
382
383 <modify-function signature="pictureFormat(QString)">
384 <remove/>
385 </modify-function>
386
387 <modify-function signature="data()const">
388 <access modifier="private"/>
389 <rename to="data_private"/>
390 </modify-function>
391
392 </value-type>
393
394
395 <value-type name="QRegion">
396 <inject-code>
397 <import-file name="typesystem_gui-java.java" quote-after-line="class QRegion___" quote-before-line="}// class"/>
398 </inject-code>
399 <modify-function signature="setRects(const QRect*,int)">
400 <access modifier="private"/>
401 </modify-function>
402
403 </value-type>
404
405 <value-type name="QPolygon">
406 <extra-includes>
407 <include file-name="qt.core.QPoint" location="java"/>
408 </extra-includes>
409 <inject-code>
410 <import-file name="typesystem_gui-java.java" quote-after-line="class QPolygon___" quote-before-line="}// class"/>
411 </inject-code>
412
413 <inject-code class="native">
414 extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QPolygon_add_1private)
415 (JNIEnv *__jni_env, jobject, jlong nativeId, jint x, jint y)
416 {
417 Q_UNUSED(__jni_env);
418 QPolygon *polygon = (QPolygon *) qtjambi_from_jlong(nativeId);
419 if (!polygon)
420 return;
421 *polygon &lt;&lt; QPoint(x, y);
422 }
423 </inject-code>
424 </value-type>
425
426 <value-type name="QPolygonF">
427 <extra-includes>
428 <include file-name="qt.core.QPoint" location="java"/>
429 </extra-includes>
430
431 <inject-code>
432 <import-file name="typesystem_gui-java.java" quote-after-line="class QPolygonF___" quote-before-line="}// class"/>
433 </inject-code>
434 <!--
435 <inject-code class="native">
436 extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QPolygonF_add_1private)
437 (JNIEnv *__jni_env, jobject, jlong nativeId, jdouble x, jdouble y)
438 {
439 Q_UNUSED(__jni_env);
440 QPolygonF *polygon = (QPolygonF *) qtjambi_from_jlong(nativeId);
441 if (!polygon)
442 return;
443 *polygon &lt;&lt; QPointF(x, y);
444 }
445 </inject-code>
446 -->
447 </value-type>
448
449
450 <value-type name="QTextFrame::iterator">
451 <inject-code>
452 <import-file name="typesystem_gui-java.java" quote-after-line="class QTextFrame_iterator___" quote-before-line="}// class"/>
453 </inject-code>
454
455 </value-type>
456
457 <value-type name="QTreeWidgetItemIterator">
458 <inject-code>
459 <import-file name="typesystem_gui-java.java" quote-after-line="class QTreeWidgetItemIterator___" quote-before-line="}// class"/>
460 </inject-code>
461
462 </value-type>
463
464
465 <value-type name="QTextBlock::iterator">
466 <inject-code>
467 <import-file name="typesystem_gui-java.java" quote-after-line="class QTextBlock_iterator___" quote-before-line="}// class"/>
468 </inject-code>
469
470 </value-type>
471
472
473 <value-type name="QPixmap">
474 <inject-code>
475 <import-file name="typesystem_gui-java.java" quote-after-line="class QPixmap___" quote-before-line="}// class"/>
476 </inject-code>
477 <modify-function signature="fill(const QColor &amp;)">
478 <modify-argument index="1">
479 <replace-default-expression with="QColor.white"/>
480 </modify-argument>
481 </modify-function>
482
483
484 <template name="gui.pixmap_load">
485 <insert-template name="gui.pixmap_loadconstructor">
486 <replace from="%RETURN_TYPE" to="final boolean"/>
487 <replace from="%FUNCTION_CALL" to="return %FUNCTION_NAME"/>
488 </insert-template>
489 </template>
490
491 <template name="gui.pixmap_constructor">
492 <insert-template name="gui.pixmap_loadconstructor">
493 <replace from="%RETURN_TYPE" to=""/>
494 <replace from="%FUNCTION_NAME" to="QPixmap"/>
495 <replace from="%FUNCTION_CALL" to="this"/>
496 <replace from="%INPUT_TYPE" to="String"/>
497 <replace from="%INPUT_NAME" to="fileName"/>
498 <replace from="%OUTPUT_NAME" to="fileName"/>
499 </insert-template>
500 </template>
501
502 <extra-includes>
503 <include file-name="QBitmap" location="global"/>
504 <include file-name="QMatrix" location="global"/>
505 </extra-includes>
506 <modify-function signature="save(QIODevice *, const char *, int) const">
507 <access modifier="private"/>
508 <rename to="private_save"/>
509 <modify-argument index="2">
510 <remove-default-expression/>
511 </modify-argument>
512 <modify-argument index="3">
513 <remove-default-expression/>
514 </modify-argument>
515 </modify-function>
516 <inject-code>
517 <insert-template name="gui.pixmap_save">
518 <replace from="%INPUT_TYPE" to="qt.core.QIODevice"/>
519 <replace from="%INPUT_NAME" to="dev"/>
520 </insert-template>
521 </inject-code>
522
523 <modify-function signature="save(const QString &amp;, const char *, int) const">
524 <access modifier="private"/>
525 <rename to="private_save"/>
526 <modify-argument index="2">
527 <remove-default-expression/>
528 </modify-argument>
529 <modify-argument index="3">
530 <remove-default-expression/>
531 </modify-argument>
532 </modify-function>
533 <inject-code>
534 <insert-template name="gui.pixmap_save">
535 <replace from="%INPUT_TYPE" to="String"/>
536 <replace from="%INPUT_NAME" to="fileName"/>
537 </insert-template>
538 </inject-code>
539
540 <modify-function signature="QPixmap(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
541 <access modifier="private"/>
542 <modify-argument index="2">
543 <remove-default-expression/>
544 </modify-argument>
545 <modify-argument index="3">
546 <remove-default-expression/>
547 </modify-argument>
548 </modify-function>
549 <inject-code>
550 <insert-template name="gui.pixmap_constructor"/>
551 </inject-code>
552
553 <modify-function signature="load(QString,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
554 <access modifier="private"/>
555 <modify-argument index="2">
556 <remove-default-expression/>
557 </modify-argument>
558 <modify-argument index="3">
559 <remove-default-expression/>
560 </modify-argument>
561 </modify-function>
562 <inject-code>
563 <insert-template name="gui.pixmap_load">
564 <replace from="%FUNCTION_NAME" to="load"/>
565 <replace from="%INPUT_TYPE" to="String"/>
566 <replace from="%INPUT_NAME" to="fileName"/>
567 <replace from="%OUTPUT_NAME" to="fileName"/>
568 </insert-template>
569 </inject-code>
570
571 <modify-function signature="loadFromData(const unsigned char*,uint,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
572 <access modifier="private"/>
573 <modify-argument index="3">
574 <remove-default-expression/>
575 </modify-argument>
576 <modify-argument index="4">
577 <remove-default-expression/>
578 </modify-argument>
579 </modify-function>
580 <inject-code>
581 <insert-template name="gui.pixmap_load">
582 <replace from="%FUNCTION_NAME" to="loadFromData"/>
583 <replace from="%INPUT_TYPE" to="byte[]"/>
584 <replace from="%INPUT_NAME" to="data"/>
585 <replace from="%OUTPUT_NAME" to="qt.internal.QtJambiInternal.byteArrayToNativePointer(data), data.length"/>
586 </insert-template>
587 </inject-code>
588
589 <modify-function signature="loadFromData(QByteArray,const char*,QFlags&lt;Qt::ImageConversionFlag&gt;)">
590 <access modifier="private"/>
591 <modify-argument index="2">
592 <remove-default-expression/>
593 </modify-argument>
594 <modify-argument index="3">
595 <remove-default-expression/>
596 </modify-argument>
597 </modify-function>
598 <inject-code>
599 <insert-template name="gui.pixmap_load">
600 <replace from="%FUNCTION_NAME" to="loadFromData"/>
601 <replace from="%INPUT_TYPE" to="qt.core.QByteArray"/>
602 <replace from="%INPUT_NAME" to="data"/>
603 <replace from="%OUTPUT_NAME" to="data"/>
604 </insert-template>
605 </inject-code>
606 </value-type>
607
608 <value-type name="QTextCursor">
609 <inject-code>
610 <import-file name="typesystem_gui-java.java" quote-after-line="class QTextCursor___" quote-before-line="}// class"/>
611 </inject-code>
612 </value-type>
613
614
615 <value-type name="QItemSelection">
616 <inject-code>
617 <import-file name="typesystem_gui-java.java" quote-after-line="class QItemSelection___" quote-before-line="}// class"/>
618 </inject-code>
619 <modify-function signature="split(QItemSelectionRange,QItemSelectionRange,QItemSelection*)">
620 <access modifier="private"/>
621 </modify-function>
622
623
624 </value-type>
625
626 <value-type name="QMatrix">
627 <inject-code>
628 <import-file name="typesystem_gui-java.java" quote-after-line="class QMatrix___" quote-before-line="}// class"/>
629 </inject-code>
630
631 </value-type>
632
633
634 <value-type name="QPainterPath::Element">
635 <inject-code>
636 <import-file name="typesystem_gui-java.java" quote-after-line="class QPainterPath_Element___" quote-before-line="}// class"/>
637 </inject-code>
638
639 </value-type>
640
641 <value-type name="QImage">
642 <inject-code>
643 <import-file name="typesystem_gui-java.java" quote-after-line="class QImage___" quote-before-line="}// class"/>
644 </inject-code>
645 <inject-code>
646 <insert-template name="gui.pixmap_save">
647 <replace from="%INPUT_TYPE" to="String"/>
648 <replace from="%INPUT_NAME" to="fileName"/>
649 </insert-template>
650 </inject-code>
651
652 <modify-function signature="save(QIODevice *, const char *, int) const">
653 <access modifier="private"/>
654 <rename to="private_save"/>
655 <modify-argument index="2">
656 <remove-default-expression/>
657 </modify-argument>
658 <modify-argument index="3">
659 <remove-default-expression/>
660 </modify-argument>
661 </modify-function>
662 <inject-code>
663 <insert-template name="gui.pixmap_save">
664 <replace from="%INPUT_TYPE" to="qt.core.QIODevice"/>
665 <replace from="%INPUT_NAME" to="dev"/>
666 </insert-template>
667 </inject-code>
668
669 <template name="gui.image_load">
670 public final boolean %FUNCTION_NAME(%ARGUMENT_TYPE %ARGUMENT_NAME, String format) {
671 return %FUNCTION_NAME(%OUT_ARGUMENT_NAME, format != null ? QNativePointer.createCharPointer(format) : null);
672 }
673
674 public final boolean %FUNCTION_NAME(%ARGUMENT_TYPE %ARGUMENT_NAME) {
675 return %FUNCTION_NAME(%ARGUMENT_NAME, (String) null);
676 }
677 </template>
678
679 <inject-code>
680 <insert-template name="gui.image_load">
681 <replace from="%FUNCTION_NAME" to="load"/>
682 <replace from="%ARGUMENT_TYPE" to="String"/>
683 <replace from="%ARGUMENT_NAME" to="fileName"/>
684 <replace from="%OUT_ARGUMENT_NAME" to="fileName"/>
685 </insert-template>
686 </inject-code>
687
688 <inject-code>
689 <insert-template name="gui.image_load">
690 <replace from="%FUNCTION_NAME" to="load"/>
691 <replace from="%ARGUMENT_TYPE" to="qt.core.QIODevice"/>
692 <replace from="%ARGUMENT_NAME" to="device"/>
693 <replace from="%OUT_ARGUMENT_NAME" to="device"/>
694 </insert-template>
695 </inject-code>
696
697 <inject-code>
698 <insert-template name="gui.image_load">
699 <replace from="%FUNCTION_NAME" to="loadFromData"/>
700 <replace from="%ARGUMENT_TYPE" to="byte[]"/>
701 <replace from="%ARGUMENT_NAME" to="data"/>
702 <replace from="%OUT_ARGUMENT_NAME" to="qt.internal.QtJambiInternal.byteArrayToNativePointer(data), data.length"/>
703 </insert-template>
704 </inject-code>
705
706 <inject-code>
707 <insert-template name="gui.image_load">
708 <replace from="%FUNCTION_NAME" to="loadFromData"/>
709 <replace from="%ARGUMENT_TYPE" to="qt.core.QByteArray"/>
710 <replace from="%ARGUMENT_NAME" to="data"/>
711 <replace from="%OUT_ARGUMENT_NAME" to="data"/>
712 </insert-template>
713 </inject-code>
714
715 <inject-code>
716 <insert-template name="gui.image_load">
717 <replace from="%FUNCTION_NAME" to="fromData"/>
718 <replace from="%ARGUMENT_TYPE" to="qt.core.QByteArray"/>
719 <replace from="%ARGUMENT_NAME" to="data"/>
720 <replace from="%OUT_ARGUMENT_NAME" to="data"/>
721 <replace from="boolean" to="QImage"/>
722 <replace from="final" to="static"/>
723 </insert-template>
724 </inject-code>
725 </value-type>
726
727 <value-type name="QCursor">
728 <template name="gui.cursor_bitmap_getter">
729 <insert-template name="gui.getter_returning_nativepointer">
730 <replace from="%RETURN_TYPE" to="QBitmap"/>
731 </insert-template>
732 </template>
733
734 <modify-function signature="bitmap()const">
735 <access modifier="private"/>
736 <rename to="bitmap_private"/>
737 </modify-function>
738 <inject-code>
739 <insert-template name="gui.cursor_bitmap_getter">
740 <replace from="%FUNCTION_NAME" to="bitmap"/>
741 </insert-template>
742 </inject-code>
743
744 <modify-function signature="mask()const">
745 <access modifier="private"/>
746 <rename to="mask_private"/>
747 </modify-function>
748 <inject-code>
749 <insert-template name="gui.cursor_bitmap_getter">
750 <replace from="%FUNCTION_NAME" to="mask"/>
751 </insert-template>
752 </inject-code>
753 </value-type>
754
755 <value-type name="QPen">
756 <inject-code>
757 <import-file name="typesystem_gui-java.java" quote-after-line="class QPen___" quote-before-line="}// class"/>
758 </inject-code>
759 </value-type>
760
761
762 <value-type name="QBrush">
763 <inject-code>
764 <import-file name="typesystem_gui-java.java" quote-after-line="class QBrush___" quote-before-line="}// class"/>
765 </inject-code>
766
767
768 <modify-function signature="gradient()const">
769 <!-- Use custom constructors already defined for gradient -->
770 <modify-argument index="0">
771 <replace-type modified-type="qt.gui.QGradient"/>
772 <conversion-rule class="native">
773 jobject %out = qtjambi_from_object(__jni_env, %in, "QGradient", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QGradient_2", true);
774 </conversion-rule>
775 </modify-argument>
776 </modify-function>
777 </value-type>
778
779 <value-type name="QColor">
780 <inject-code>
781 <import-file name="typesystem_gui-java.java" quote-after-line="class QColor___" quote-before-line="}// class"/>
782 </inject-code>
783 </value-type>
784
785 <value-type name="QFontInfo"/>
786
787 <value-type name="QFontMetricsF">
788 <template name="gui.fontmetricsf_boundingrect">
789 <insert-template name="gui.fontmetrics_tabarray_function">
790 <replace from="%RETURN_TYPE" to="qt.core.QRectF"/>
791 <replace from="%FUNCTION_NAME" to="boundingRect"/>
792 <replace from="%RECT_ARGUMENTS" to="%RECT_ARGUMENTS, "/>
793 <replace from="%RECT_CALL_ARGUMENTS" to="%RECT_CALL_ARGUMENTS, "/>
794 </insert-template>
795 </template>
796
797 <inject-code>
798 <insert-template name="gui.fontmetricsf_boundingrect">
799 <replace from="%RECT_ARGUMENTS" to="qt.core.QRectF rect"/>
800 <replace from="%RECT_CALL_ARGUMENTS" to="rect"/>
801 </insert-template>
802 </inject-code>
803
804 <inject-code>
805 <insert-template name="gui.fontmetrics_tabarray_function">
806 <replace from="%RETURN_TYPE" to="qt.core.QSizeF"/>
807 <replace from="%FUNCTION_NAME" to="size"/>
808 <replace from="%RECT_ARGUMENTS" to=""/>
809 <replace from="%RECT_CALL_ARGUMENTS" to=""/>
810 </insert-template>
811 </inject-code>
812 </value-type>
813
814 <value-type name="QFontMetrics">
815 <template name="gui.fontmetrics_tabarray_function">
816 public final %RETURN_TYPE %FUNCTION_NAME(%RECT_ARGUMENTSint flags, String text, int tabStops, int tabArray[]) {
817 QNativePointer np = tabArray == null ? null : new QNativePointer(QNativePointer.Type.Int, tabArray.length + 1);
818 if (np != null) {
819 for (int i=0; i&lt;tabArray.length; ++i) np.setIntAt(i, tabArray[i]);
820 np.setIntAt(tabArray.length, 0);
821 }
822 return %FUNCTION_NAME(%RECT_CALL_ARGUMENTSflags, text, tabStops, np);
823 }
824
825 public final %RETURN_TYPE %FUNCTION_NAME(%RECT_ARGUMENTSint flags, String text, int tabStops) {
826 return %FUNCTION_NAME(%RECT_CALL_ARGUMENTSflags, text, tabStops, (int []) null);
827 }
828
829 public final %RETURN_TYPE %FUNCTION_NAME(%RECT_ARGUMENTSint flags, String text) {
830 return %FUNCTION_NAME(%RECT_CALL_ARGUMENTSflags, text, 0);
831 }
832 </template>
833
834 <template name="gui.fontmetrics_boundingrect">
835 <insert-template name="gui.fontmetrics_tabarray_function">
836 <replace from="%RETURN_TYPE" to="qt.core.QRect"/>
837 <replace from="%FUNCTION_NAME" to="boundingRect"/>
838 <replace from="%RECT_ARGUMENTS" to="%RECT_ARGUMENTS, "/>
839 <replace from="%RECT_CALL_ARGUMENTS" to="%RECT_CALL_ARGUMENTS, "/>
840 </insert-template>
841 </template>
842
843 <inject-code>
844 <insert-template name="gui.fontmetrics_boundingrect">
845 <replace from="%RECT_ARGUMENTS" to="int x, int y, int width, int height"/>
846 <replace from="%RECT_CALL_ARGUMENTS" to="x, y, width, height"/>
847 </insert-template>
848 </inject-code>
849
850 <inject-code>
851 <insert-template name="gui.fontmetrics_boundingrect">
852 <replace from="%RECT_ARGUMENTS" to="qt.core.QRect rect"/>
853 <replace from="%RECT_CALL_ARGUMENTS" to="rect"/>
854 </insert-template>
855 </inject-code>
856
857 <inject-code>
858 <insert-template name="gui.fontmetrics_tabarray_function">
859 <replace from="%RETURN_TYPE" to="qt.core.QSize"/>
860 <replace from="%FUNCTION_NAME" to="size"/>
861 <replace from="%RECT_ARGUMENTS" to=""/>
862 <replace from="%RECT_CALL_ARGUMENTS" to=""/>
863 </insert-template>
864 </inject-code>
865 </value-type>
866
867 <interface-type name="QGraphicsItem">
868
869 <modify-function signature="QGraphicsItem(QGraphicsItem*,QGraphicsScene*)">
870 <inject-code position="end">
871 <argument-map index="1" meta-name="%1"/>
872 if (%1 != null)
873 disableGarbageCollection();
874 </inject-code>
875 </modify-function>
876
877 <modify-function signature="paint(QPainter *, const QStyleOptionGraphicsItem *, QWidget *)">
878 <modify-argument index="2">
879 <conversion-rule class="shell">
880 jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOptionGraphicsItem", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", true);
881 </conversion-rule>
882 <conversion-rule class="native">
883 const QStyleOptionGraphicsItem *%out = (QStyleOptionGraphicsItem *) qtjambi_to_object(__jni_env, %in);
884 </conversion-rule>
885 <replace-type modified-type="qt.gui.QStyleOptionGraphicsItem"/>
886 </modify-argument>
887 </modify-function>
888
889 <modify-function signature="setGroup(QGraphicsItemGroup*)">
890 <modify-argument index="1">
891 <reference-count action="ignore"/>
892 </modify-argument>
893 <inject-code position="beginning">
894 qt.gui.QGraphicsItemGroup oldGroup = group();
895 </inject-code>
896 <inject-code position="end">
897 <argument-map index="1" meta-name="%1"/>
898 if (%1 == null &amp;&amp; oldGroup != null &amp;&amp; oldGroup.parentItem() == null)
899 reenableGarbageCollection();
900 else
901 disableGarbageCollection();
902 </inject-code>
903 </modify-function>
904
905 <modify-function signature="setParentItem(QGraphicsItem*)">
906 <modify-argument index="1">
907 <reference-count action="ignore"/>
908 </modify-argument>
909 <inject-code position="end">
910 <argument-map index="1" meta-name="%1"/>
911 if (%1 == null)
912 reenableGarbageCollection();
913 else
914 disableGarbageCollection();
915 </inject-code>
916 </modify-function>
917 </interface-type>
918
919 <object-type name="QAbstractGraphicsShapeItem">
920 <modify-function signature="QAbstractGraphicsShapeItem(QGraphicsItem*,QGraphicsScene*)">
921 <inject-code position="end">
922 <argument-map index="1" meta-name="%1"/>
923 if (%1 != null) disableGarbageCollection();
924 </inject-code>
925 </modify-function>
926 </object-type>
927
928
929 <object-type name="QAbstractItemView">
930 <inject-code>
931 <import-file name="typesystem_gui-java.java" quote-after-line="class QAbstractItemView___" quote-before-line="}// class"/>
932 </inject-code>
933
934
935 <modify-function signature="setIndexWidget(const QModelIndex &amp;,QWidget *)">
936 <modify-argument index="2">
937 <!-- Safe to ignore because view reparents widget -->
938 <reference-count action="ignore"/>
939 </modify-argument>
940 </modify-function>
941 <modify-function signature="setItemDelegate(QAbstractItemDelegate *)">
942 <modify-argument index="1">
943 <reference-count action="set" variable-name="__rcItemDelegate"/>
944 </modify-argument>
945 </modify-function>
946 <modify-function signature="setModel(QAbstractItemModel *)">
947 <modify-argument index="1">
948 <reference-count action="set" variable-name="__rcItemModel"/>
949 </modify-argument>
950 <inject-code class="java" position="end">
951 // setModel() creates a new selection model for the object
952 qt.GeneratorUtilities.setField(this, qt.gui.QAbstractItemView.class, "__rcItemSelectionModel", null);
953 </inject-code>
954 </modify-function>
955 <modify-function signature="setSelectionModel(QItemSelectionModel *)">
956 <modify-argument index="1">
957 <no-null-pointer/>
958 <reference-count action="set" variable-name="__rcItemSelectionModel"/>
959 </modify-argument>
960 </modify-function>
961 <modify-function signature="setItemDelegateForColumn(int,QAbstractItemDelegate*)">
962 <modify-argument index="2">
963 <reference-count action="ignore"/>
964 </modify-argument>
965 <inject-code position="end">
966 <argument-map index="1" meta-name="%1"/>
967 <argument-map index="2" meta-name="%2"/>
968 if (%2 == null)
969 __rcDelegatesForColumns.remove(%1);
970 else
971 __rcDelegatesForColumns.put(%1,%2);
972 </inject-code>
973 </modify-function>
974 <modify-function signature="setItemDelegateForRow(int,QAbstractItemDelegate*)">
975 <modify-argument index="2">
976 <reference-count action="ignore"/>
977 </modify-argument>
978 <inject-code position="end">
979 <argument-map index="1" meta-name="%1"/>
980 <argument-map index="2" meta-name="%2"/>
981 if (%2 == null)
982 __rcDelegatesForRows.remove(%1);
983 else
984 __rcDelegatesForRows.put(%1,%2);
985 </inject-code>
986 </modify-function>
987 </object-type>
988
989
990 <object-type name="QAccessibleTableInterface">
991 <inject-code>
992 <import-file name="typesystem_gui-java.java" quote-after-line="class QAccessibleTableInterface___" quote-before-line="}// class"/>
993 </inject-code>
994
995
996 <modify-function signature="cellAtIndex(int,int*,int*,int*,int*,bool*)">
997 <modify-argument index="2">
998 <remove-argument/>
999 <conversion-rule class="native">
1000 int rowHolder;
1001 int *%out = &amp;rowHolder;
1002 </conversion-rule>
1003 <conversion-rule class="shell">
1004 // nothing
1005 </conversion-rule>
1006 </modify-argument>
1007 <modify-argument index="3">
1008 <remove-argument/>
1009 <conversion-rule class="native">
1010 int columnHolder;
1011 int *%out = &amp;columnHolder;
1012 </conversion-rule>
1013 <conversion-rule class="shell">
1014 // nothing
1015 </conversion-rule>
1016 </modify-argument>
1017 <modify-argument index="4">
1018 <remove-argument/>
1019 <conversion-rule class="native">
1020 int rowSpanHolder;
1021 int *%out = &amp;rowSpanHolder;
1022 </conversion-rule>
1023 <conversion-rule class="shell">
1024 // nothing
1025 </conversion-rule>
1026 </modify-argument>
1027 <modify-argument index="5">
1028 <remove-argument/>
1029 <conversion-rule class="native">
1030 int columnSpanHolder;
1031 int *%out = &amp;columnSpanHolder;
1032 </conversion-rule>
1033 <conversion-rule class="shell">
1034 // nothing
1035 </conversion-rule>
1036 </modify-argument>
1037 <modify-argument index="6">
1038 <remove-argument/>
1039 <conversion-rule class="native">
1040 bool isSelectedHolder = false;
1041 bool *%out = &amp;isSelectedHolder;
1042 </conversion-rule>
1043 <conversion-rule class="shell">
1044 // no conversion
1045 </conversion-rule>
1046 </modify-argument>
1047 <modify-argument index="return">
1048 <replace-type modified-type="qt.gui.QAccessibleTableInterface$CellAtIndex"/>
1049 <conversion-rule class="native">
1050 jobject %out = qtjambi_to_cellatindex(__jni_env, rowHolder, columnHolder, rowSpanHolder, columnSpanHolder, isSelectedHolder);
1051 </conversion-rule>
1052 <conversion-rule class="shell">
1053 qtjambi_from_cellatindex(__jni_env, %in, %2, %3, %4, %5, %6);
1054 </conversion-rule>
1055 </modify-argument>
1056 </modify-function>
1057
1058 <modify-function signature="selectedColumns(int,QList&lt;int&gt;*)">
1059 <modify-argument index="2">
1060 <replace-type modified-type="java.util.List&lt;Integer&gt;"/>
1061 <conversion-rule class="shell">
1062 StaticCache *sc = StaticCache::instance();
1063 sc-&gt;resolveArrayList();
1064 sc-&gt;resolveCollection();
1065 sc-&gt;resolveInteger();
1066
1067 jobject columnsHolder = 0;
1068 if (%in != 0) {
1069 columnsHolder = __jni_env-&gt;NewObject(sc-&gt;ArrayList.class_ref, sc-&gt;ArrayList.constructor, %in-&gt;size());
1070 qtjambi_exception_check(__jni_env);
1071 if (columnsHolder != 0) for (int i=0; i&lt;%in-&gt;size(); i++) {
1072 __jni_env-&gt;CallVoidMethod(columnsHolder, sc-&gt;Collection.add, qtjambi_from_int(__jni_env, %in-&gt;at(i)));
1073 }
1074 qtjambi_exception_check(__jni_env);
1075 }
1076 jobject %out = columnsHolder;
1077 </conversion-rule>
1078 <conversion-rule class="native">
1079 StaticCache *sc = StaticCache::instance();
1080 sc-&gt;resolveCollection();
1081
1082 QList&lt;int&gt; columnHolder;
1083 if (%in != 0) {
1084 jobjectArray columnsAsArray = (jobjectArray) __jni_env-&gt;CallObjectMethod(%in, sc-&gt;Collection.toArray);
1085 if (columnsAsArray != 0) {
1086 int len = __jni_env-&gt;GetArrayLength(columnsAsArray);
1087 for (int i=0; i&lt;len; ++i) {
1088 columnHolder.append(qtjambi_to_int(__jni_env, __jni_env-&gt;GetObjectArrayElement(columnsAsArray, i)));
1089 }
1090 }
1091 qtjambi_exception_check(__jni_env);
1092 }
1093 QList&lt;int&gt; *%out = &amp;columnHolder;
1094 </conversion-rule>
1095 </modify-argument>
1096 <modify-argument index="return">
1097 <conversion-rule class="shell">
1098 // Copy back
1099 if (columnsHolder != 0) {
1100 jobjectArray columnsAsArray = (jobjectArray) __jni_env-&gt;CallObjectMethod(columnsHolder, sc-&gt;Collection.toArray);
1101 if (columnsAsArray != 0) {
1102 int len = __jni_env-&gt;GetArrayLength(columnsAsArray);
1103 %2-&gt;clear();
1104 for (int i=0; i&lt;len; ++i) {
1105 %2-&gt;append(qtjambi_to_int(__jni_env, __jni_env-&gt;GetObjectArrayElement(columnsAsArray, i)));
1106 }
1107 }
1108 }
1109
1110 int %out = %in;
1111 </conversion-rule>
1112 <conversion-rule class="native">
1113 // Copy back
1114 if (%2 != 0) {
1115 __jni_env-&gt;CallVoidMethod(%2, sc-&gt;Collection.clear);
1116 for (int i=0; i&lt;columnHolder.size(); ++i) {
1117 __jni_env-&gt;CallVoidMethod(%2, sc-&gt;Collection.add, qtjambi_from_int(__jni_env, columnHolder.at(i)));
1118 }
1119 qtjambi_exception_check(__jni_env);
1120 }
1121
1122 jint %out = %in;
1123 </conversion-rule>
1124 </modify-argument>
1125 </modify-function>
1126 <modify-function signature="selectedRows(int,QList&lt;int&gt;*)">
1127 <modify-argument index="2">
1128 <replace-type modified-type="java.util.List&lt;Integer&gt;"/>
1129 <conversion-rule class="shell">
1130 StaticCache *sc = StaticCache::instance();
1131 sc-&gt;resolveArrayList();
1132 sc-&gt;resolveCollection();
1133 sc-&gt;resolveInteger();
1134
1135 jobject rowsHolder = 0;
1136 if (%in != 0) {
1137 rowsHolder = __jni_env-&gt;NewObject(sc-&gt;ArrayList.class_ref, sc-&gt;ArrayList.constructor, %in-&gt;size());
1138 qtjambi_exception_check(__jni_env);
1139 if (rowsHolder != 0) for (int i=0; i&lt;%in-&gt;size(); i++) {
1140 __jni_env-&gt;CallVoidMethod(rowsHolder, sc-&gt;Collection.add, qtjambi_from_int(__jni_env, %in-&gt;at(i)));
1141 }
1142 qtjambi_exception_check(__jni_env);
1143 }
1144 jobject %out = rowsHolder;
1145 </conversion-rule>
1146 <conversion-rule class="native">
1147 StaticCache *sc = StaticCache::instance();
1148 sc-&gt;resolveCollection();
1149
1150 QList&lt;int&gt; rowsHolder;
1151 if (%in != 0) {
1152 jobjectArray rowsAsArray = (jobjectArray) __jni_env-&gt;CallObjectMethod(%in, sc-&gt;Collection.toArray);
1153 if (rowsAsArray != 0) {
1154 int len = __jni_env-&gt;GetArrayLength(rowsAsArray);
1155 for (int i=0; i&lt;len; ++i) {
1156 rowsHolder.append(qtjambi_to_int(__jni_env, __jni_env-&gt;GetObjectArrayElement(rowsAsArray, i)));
1157 }
1158 }
1159 qtjambi_exception_check(__jni_env);
1160 }
1161 QList&lt;int&gt; *%out = &amp;rowsHolder;
1162 </conversion-rule>
1163 </modify-argument>
1164 <modify-argument index="return">
1165 <conversion-rule class="shell">
1166 // Copy back
1167 if (rowsHolder != 0) {
1168 jobjectArray rowsAsArray = (jobjectArray) __jni_env-&gt;CallObjectMethod(rowsHolder, sc-&gt;Collection.toArray);
1169 if (rowsAsArray != 0) {
1170 int len = __jni_env-&gt;GetArrayLength(rowsAsArray);
1171 %2-&gt;clear();
1172 for (int i=0; i&lt;len; ++i) {
1173 %2-&gt;append(qtjambi_to_int(__jni_env, __jni_env-&gt;GetObjectArrayElement(rowsAsArray, i)));
1174 }
1175 }
1176 }
1177
1178 int %out = %in;
1179 </conversion-rule>
1180 <conversion-rule class="native">
1181 // Copy back
1182 if (%2 != 0) {
1183 __jni_env-&gt;CallVoidMethod(%2, sc-&gt;Collection.clear);
1184 for (int i=0; i&lt;rowsHolder.size(); ++i) {
1185 __jni_env-&gt;CallVoidMethod(%2, sc-&gt;Collection.add, qtjambi_from_int(__jni_env, rowsHolder.at(i)));
1186 }
1187 qtjambi_exception_check(__jni_env);
1188 }
1189
1190 jint %out = %in;
1191 </conversion-rule>
1192 </modify-argument>
1193 </modify-function>
1194 </object-type>
1195
1196
1197 <object-type name="QAccessibleInterface">
1198 <inject-code>
1199 <import-file name="typesystem_gui-java.java" quote-after-line="class QAccessibleInterface___" quote-before-line="}// class"/>
1200 </inject-code>
1201
1202
1203 <template name="gui.accessible_interface_to_target">
1204 jclass __target_class = resolveClass(__jni_env, "QAccessibleInterface$Target", "com/trolltech/qt/gui/");
1205 QTJAMBI_EXCEPTION_CHECK(__jni_env);
1206 Q_ASSERT(__target_class);
1207
1208 jmethodID __target_constructor = resolveMethod(__jni_env, "&lt;init&gt;", "(ILcom/trolltech/qt/gui/QAccessibleInterface;)V", "QAccessibleInterface$Target", "com/trolltech/qt/gui/");
1209 QTJAMBI_EXCEPTION_CHECK(__jni_env);
1210 Q_ASSERT(__target_constructor);
1211
1212 jobject __java_interface = %TARGET != 0 ? qtjambi_from_object(__jni_env, %TARGET, "QAccessibleInterface$ConcreteWrapper", "com/trolltech/qt/gui/", true) : 0;
1213
1214 jobject %OUTPUT = __jni_env-&gt;NewObject(__target_class, __target_constructor, %CHILD_INDEX, __java_interface);
1215 </template>
1216
1217 <modify-function signature="navigate(QAccessible::RelationFlag,int,QAccessibleInterface**)const">
1218 <modify-argument index="3">
1219 <remove-argument/>
1220 <conversion-rule class="shell">
1221 // nothing
1222 </conversion-rule>
1223 <conversion-rule class="native">
1224 QAccessibleInterface *__qt_interface = 0;
1225 QAccessibleInterface **%out = &amp;__qt_interface;
1226 </conversion-rule>
1227 </modify-argument>
1228
1229 <modify-argument index="0">
1230 <replace-type modified-type="qt.gui.QAccessibleInterface$Target"/>
1231 <conversion-rule class="native">
1232 <insert-template name="gui.accessible_interface_to_target">
1233 <replace from="%TARGET" to="__qt_interface"/>
1234 <replace from="%CHILD_INDEX" to="%in"/>
1235 <replace from="%OUTPUT" to="%out"/>
1236 </insert-template>
1237 </conversion-rule>
1238 <conversion-rule class="shell">
1239 jfieldID __childIndex_id = resolveField(__jni_env, "childIndex", "I", "QAccessibleInterface$Target", "com/trolltech/qt/gui/");
1240 Q_ASSERT(__childIndex_id);
1241
1242 jfieldID __target_id = resolveField(__jni_env, "target", "Lcom/trolltech/qt/gui/QAccessibleInterface;", "QAccessibleInterface$Target", "com/trolltech/qt/gui/");
1243 Q_ASSERT(__target_id);
1244
1245 jint %out = __jni_env-&gt;GetIntField(%in, __childIndex_id);
1246
1247 jobject __java_interface = __jni_env-&gt;GetObjectField(%in, __target_id);
1248 QtJambiLink *__qt_link = __java_interface != 0 ? QtJambiLink::findLink(__jni_env, __java_interface) : 0;
1249 if (__qt_link != 0) __qt_link-&gt;disableGarbageCollection(__jni_env, __java_interface);
1250 QAccessibleInterface *__qt_interface = __qt_link != 0 ? (QAccessibleInterface *) __qt_link-&gt;pointer() : 0;
1251
1252 if (%3 != 0) *%3 = __qt_interface;
1253 </conversion-rule>
1254 </modify-argument>
1255 </modify-function>
1256 </object-type>
1257
1258 <object-type name="QActionGroup">
1259 <modify-function signature="addAction(QAction*)">
1260 <modify-argument index="1">
1261 <reference-count action="add" variable-name="__rcActions"/>
1262 </modify-argument>
1263 <inject-code position="end">
1264 <argument-map index="1" meta-name="%1"/>
1265 qt.GeneratorUtilities.setField(%1, QAction.class, "__rcActionGroup", this);
1266 </inject-code>
1267 </modify-function>
1268 <modify-function signature="removeAction(QAction*)">
1269 <modify-argument index="1">
1270 <reference-count action="remove" variable-name="__rcActions"/>
1271 </modify-argument>
1272 <inject-code position="end">
1273 <argument-map index="1" meta-name="%1"/>
1274 qt.GeneratorUtilities.setField(%1, QAction.class, "__rcActionGroup", null);
1275 </inject-code>
1276 </modify-function>
1277 </object-type>
1278
1279 <object-type name="QCheckBox">
1280 <inject-code>
1281 <insert-template name="gui.init_style_option">
1282 <replace from="%TYPE" to="QStyleOptionButton"/>
1283 </insert-template>
1284 </inject-code>
1285 </object-type>
1286
1287
1288 <object-type name="QDesktopServices">
1289 <inject-code>
1290 <import-file name="typesystem_gui-java.java" quote-after-line="class QDesktopServices___" quote-before-line="}// class"/>
1291 </inject-code>
1292
1293 </object-type>
1294
1295
1296 <object-type name="QWizardPage">
1297 <inject-code>
1298 <import-file name="typesystem_gui-java.java" quote-after-line="class QWizardPage___" quote-before-line="}// class"/>
1299 </inject-code>
1300
1301 </object-type>
1302
1303
1304 <object-type name="QFontDialog">
1305 <inject-code>
1306 <import-file name="typesystem_gui-java.java" quote-after-line="class QFontDialog___" quote-before-line="}// class"/>
1307 </inject-code>
1308
1309 <template name="gui.fontdialog_get_font_general">
1310 public static Result getFont(%FONT_ARGUMENT %COMMA QWidget parent %STRING_ARGUMENT) {
1311 QNativePointer np = new QNativePointer(QNativePointer.Type.Boolean);
1312 QFont returned = getFont(np, %FONT_CALL_ARGUMENT %COMMA parent %STRING_CALL_ARGUMENT);
1313 return new Result(returned, np.booleanValue());
1314 }
1315 </template>
1316
1317 <template name="gui.fontdialog_get_font_nocaption">
1318 <insert-template name="gui.fontdialog_get_font_general">
1319 <replace from="%STRING_ARGUMENT" to=""/>
1320 <replace from="%STRING_CALL_ARGUMENT" to=""/>
1321 </insert-template>
1322
1323 public static Result getFont(%FONT_ARGUMENT) {
1324 return getFont(%FONT_CALL_ARGUMENT %COMMA (QWidget) null);
1325 }
1326 </template>
1327
1328 <modify-function signature="getFont(bool*,QFont,QWidget*,QString)">
1329 <access modifier="private"/>
1330 </modify-function>
1331 <inject-code>
1332 <insert-template name="gui.fontdialog_get_font_general">
1333 <replace from="%FONT_ARGUMENT %COMMA" to="QFont initial,"/>
1334 <replace from="%STRING_ARGUMENT" to=", String caption"/>
1335 <replace from="%FONT_CALL_ARGUMENT %COMMA" to="initial,"/>
1336 <replace from="%STRING_CALL_ARGUMENT" to=", caption"/>
1337 </insert-template>
1338 </inject-code>
1339
1340 <modify-function signature="getFont(bool*,QWidget*)">
1341 <access modifier="private"/>
1342 <modify-argument index="2">
1343 <remove-default-expression/>
1344 </modify-argument>
1345 </modify-function>
1346 <inject-code>
1347 <insert-template name="gui.fontdialog_get_font_nocaption">
1348 <replace from="%FONT_ARGUMENT" to=""/>
1349 <replace from="%COMMA" to=""/>
1350 <replace from="%FONT_CALL_ARGUMENT" to=""/>
1351 </insert-template>
1352 </inject-code>
1353
1354 <modify-function signature="getFont(bool*,QFont,QWidget*)">
1355 <access modifier="private"/>
1356 <modify-argument index="3">
1357 <remove-default-expression/>
1358 </modify-argument>
1359 </modify-function>
1360 <inject-code>
1361 <insert-template name="gui.fontdialog_get_font_nocaption">
1362 <replace from="%FONT_ARGUMENT" to="QFont initial"/>
1363 <replace from="%COMMA" to=", "/>
1364 <replace from="%FONT_CALL_ARGUMENT" to="initial"/>
1365 </insert-template>
1366 </inject-code>
1367 </object-type>
1368
1369 <object-type name="QGraphicsEllipseItem">
1370 <modify-function signature="QGraphicsEllipseItem(QGraphicsItem*,QGraphicsScene*)">
1371 <inject-code position="end">
1372 <argument-map index="1" meta-name="%1"/>
1373 if (%1 != null) disableGarbageCollection();
1374 </inject-code>
1375 </modify-function>
1376 <modify-function signature="QGraphicsEllipseItem(const QRectF &amp;,QGraphicsItem*,QGraphicsScene*)">
1377 <inject-code position="end">
1378 <argument-map index="2" meta-name="%2"/>
1379 if (%2 != null) disableGarbageCollection();
1380 </inject-code>
1381 </modify-function>
1382 <modify-function signature="QGraphicsEllipseItem(double,double,double,double,QGraphicsItem*,QGraphicsScene*)">
1383 <inject-code position="end">
1384 <argument-map index="5" meta-name="%5"/>
1385 if (%5 != null) disableGarbageCollection();
1386 </inject-code>
1387 </modify-function>
1388 </object-type>
1389
1390 <object-type name="QGraphicsItemGroup">
1391 <modify-function signature="QGraphicsItemGroup(QGraphicsItem*,QGraphicsScene*)">
1392 <inject-code position="end">
1393 <argument-map index="1" meta-name="%1"/>
1394 if (%1 != null) disableGarbageCollection();
1395 </inject-code>
1396 </modify-function>
1397 <modify-function signature="addToGroup(QGraphicsItem*)">
1398 <modify-argument index="1">
1399 <define-ownership class="java" owner="c++"/>
1400 </modify-argument>
1401 </modify-function>
1402 <modify-function signature="removeFromGroup(QGraphicsItem*)">
1403 <modify-argument index="1">
1404 <reference-count action="ignore"/>
1405 </modify-argument>
1406 <inject-code position="end">
1407 <argument-map index="1" meta-name="%1"/>
1408 if (parentItem() == null)
1409 %1.reenableGarbageCollection();
1410 </inject-code>
1411 </modify-function>
1412 </object-type>
1413
1414 <object-type name="QGraphicsLineItem">
1415 <modify-function signature="QGraphicsLineItem(QGraphicsItem*,QGraphicsScene*)">
1416 <inject-code position="end">
1417 <argument-map index="1" meta-name="%1"/>
1418 if (%1 != null) disableGarbageCollection();
1419 </inject-code>
1420 </modify-function>
1421 <modify-function signature="QGraphicsLineItem(const QLineF &amp;,QGraphicsItem*,QGraphicsScene*)">
1422 <inject-code position="end">
1423 <argument-map index="2" meta-name="%2"/>
1424 if (%2 != null) disableGarbageCollection();
1425 </inject-code>
1426 </modify-function>
1427 <modify-function signature="QGraphicsLineItem(double,double,double,double,QGraphicsItem*,QGraphicsScene*)">
1428 <inject-code position="end">
1429 <argument-map index="5" meta-name="%5"/>
1430 if (%5 != null) disableGarbageCollection();
1431 </inject-code>
1432 </modify-function>
1433 </object-type>
1434
1435 <object-type name="QGraphicsPathItem">
1436 <modify-function signature="QGraphicsPathItem(QGraphicsItem*,QGraphicsScene*)">
1437 <inject-code position="end">
1438 <argument-map index="1" meta-name="%1"/>
1439 if (%1 != null) disableGarbageCollection();
1440 </inject-code>
1441 </modify-function>
1442 <modify-function signature="QGraphicsPathItem(const QPainterPath &amp;,QGraphicsItem*,QGraphicsScene*)">
1443 <inject-code position="end">
1444 <argument-map index="2" meta-name="%2"/>
1445 if (%2 != null) disableGarbageCollection();
1446 </inject-code>
1447 </modify-function>
1448 </object-type>
1449
1450 <object-type name="QGraphicsPixmapItem">
1451 <modify-function signature="QGraphicsPixmapItem(QGraphicsItem*,QGraphicsScene*)">
1452 <inject-code position="end">
1453 <argument-map index="1" meta-name="%1"/>
1454 if (%1 != null) disableGarbageCollection();
1455 </inject-code>
1456 </modify-function>
1457 <modify-function signature="QGraphicsPixmapItem(const QPixmap &amp;,QGraphicsItem*,QGraphicsScene*)">
1458 <inject-code position="end">
1459 <argument-map index="2" meta-name="%2"/>
1460 if (%2 != null) disableGarbageCollection();
1461 </inject-code>
1462 </modify-function>
1463 </object-type>
1464
1465 <object-type name="QGraphicsPolygonItem">
1466 <modify-function signature="QGraphicsPolygonItem(QGraphicsItem*,QGraphicsScene*)">
1467 <inject-code position="end">
1468 <argument-map index="1" meta-name="%1"/>
1469 if (%1 != null) disableGarbageCollection();
1470 </inject-code>
1471 </modify-function>
1472 <modify-function signature="QGraphicsPolygonItem(const QPolygonF &amp;,QGraphicsItem*,QGraphicsScene*)">
1473 <inject-code position="end">
1474 <argument-map index="2" meta-name="%2"/>
1475 if (%2 != null) disableGarbageCollection();
1476 </inject-code>
1477 </modify-function>
1478 </object-type>
1479
1480
1481 <object-type name="QGraphicsRectItem">
1482 <modify-function signature="QGraphicsRectItem(QGraphicsItem*,QGraphicsScene*)">
1483 <inject-code position="end">
1484 <argument-map index="1" meta-name="%1"/>
1485 if (%1 != null) disableGarbageCollection();
1486 </inject-code>
1487 </modify-function>
1488 <modify-function signature="QGraphicsRectItem(double,double,double,double,QGraphicsItem*,QGraphicsScene*)">
1489 <inject-code position="end">
1490 <argument-map index="5" meta-name="%5"/>
1491 if (%5 != null) disableGarbageCollection();
1492 </inject-code>
1493 </modify-function>
1494 <modify-function signature="QGraphicsRectItem(const QRectF &amp;,QGraphicsItem*,QGraphicsScene*)">
1495 <inject-code position="end">
1496 <argument-map index="2" meta-name="%2"/>
1497 if (%2 != null) disableGarbageCollection();
1498 </inject-code>
1499 </modify-function>
1500 </object-type>
1501
1502 <object-type name="QGraphicsSimpleTextItem">
1503 <modify-function signature="QGraphicsSimpleTextItem(QGraphicsItem*,QGraphicsScene*)">
1504 <inject-code position="end">
1505 <argument-map index="1" meta-name="%1"/>
1506 if (%1 != null) disableGarbageCollection();
1507 </inject-code>
1508 </modify-function>
1509 <modify-function signature="QGraphicsSimpleTextItem(const QString &amp;,QGraphicsItem*,QGraphicsScene*)">
1510 <inject-code position="end">
1511 <argument-map index="2" meta-name="%2"/>
1512 if (%2 != null) disableGarbageCollection();
1513 </inject-code>
1514 </modify-function>
1515 </object-type>
1516
1517 <object-type name="QItemEditorFactory">
1518 <modify-function signature="setDefaultFactory(QItemEditorFactory*)">
1519 <modify-argument index="1">
1520 <define-ownership class="java" owner="c++"/>
1521 </modify-argument>
1522 </modify-function>
1523 </object-type>
1524
1525
1526 <object-type name="QMenu">
1527 <inject-code>
1528 <import-file name="typesystem_gui-java.java" quote-after-line="class QMenu___" quote-before-line="}// class"/>
1529 </inject-code>
1530
1531
1532 <template name="gui.addAction">
1533 public final QAction addAction(%EXTRA String text, Object receiver, String method %END_EXTRA) {
1534 QAction returned = addAction(%CALL_EXTRA text %END_CALL_EXTRA);
1535 %POST_CALL
1536 returned.triggered.connect(receiver, method);
1537
1538 return returned;
1539 }
1540
1541 public final QAction addAction(%EXTRA String text, qt.QSignalEmitter.AbstractSignal signal %END_EXTRA) {
1542 QAction returned = addAction(%CALL_EXTRA text %END_CALL_EXTRA);
1543 %POST_CALL
1544 returned.triggered.connect(signal);
1545 return returned;
1546 }
1547 </template>
1548
1549 <template name="gui.addAction_with_shortcut">
1550 <insert-template name="gui.addAction">
1551 <replace from="%POST_CALL" to="returned.setShortcut(shortcut);"/>
1552 <replace from=" %END_EXTRA" to=", QKeySequence shortcut"/>
1553 <replace from=" %END_CALL_EXTRA" to=""/>
1554 </insert-template>
1555
1556 public final QAction addAction(%EXTRA String text, Object receiver, String method) {
1557 return addAction(%CALL_EXTRA text, receiver, method, new QKeySequence(0));
1558 }
1559
1560 public final QAction addAction(%EXTRA String text, qt.QSignalEmitter.AbstractSignal signal) {
1561 return addAction(%CALL_EXTRA text, signal, new QKeySequence(0));
1562 }
1563 </template>
1564
1565 <inject-code>
1566 <insert-template name="gui.addAction_with_shortcut">
1567 <replace from="%EXTRA " to=""/>
1568 <replace from="%CALL_EXTRA " to=""/>
1569 </insert-template>
1570 </inject-code>
1571
1572 <inject-code>
1573 <insert-template name="gui.addAction_with_shortcut">
1574 <replace from="%EXTRA" to="QIcon icon,"/>
1575 <replace from="%CALL_EXTRA" to="icon,"/>
1576 </insert-template>
1577 </inject-code>
1578 </object-type>
1579
1580
1581 <object-type name="QMenuBar">
1582 <inject-code>
1583 <import-file name="typesystem_gui-java.java" quote-after-line="class QMenuBar___" quote-before-line="}// class"/>
1584 </inject-code>
1585 <inject-code>
1586 <insert-template name="gui.addAction">
1587 <replace from="%POST_CALL" to=""/>
1588 <replace from=" %END_EXTRA" to=""/>
1589 <replace from=" %END_CALL_EXTRA" to=""/>
1590 <replace from="%EXTRA " to=""/>
1591 <replace from="%CALL_EXTRA " to=""/>
1592 </insert-template>
1593 </inject-code>
1594
1595
1596 </object-type>
1597
1598 <object-type name="QPictureIO">
1599 <extra-includes>
1600 <include file-name="qt.QNativePointer" location="java"/>
1601 </extra-includes>
1602 <inject-code>
1603 public QPictureIO(qt.core.QIODevice ioDevice, String format) {
1604 this(ioDevice, QNativePointer.createCharPointer(format));
1605 }
1606
1607 public QPictureIO(String fileName, String format) {
1608 this(fileName, QNativePointer.createCharPointer(format));
1609 }
1610
1611 <insert-template name="core.return_string_instead_of_char*">
1612 <replace from="%FUNCTION_NAME" to="format"/>
1613 </insert-template>
1614 <insert-template name="core.return_string_instead_of_char*">
1615 <replace from="%FUNCTION_NAME" to="parameters"/>
1616 </insert-template>
1617 <insert-template name="core.call_with_string_instead_of_char*">
1618 <replace from="%FUNCTION_NAME" to="setFormat"/>
1619 <replace from="%ARG_NAME" to="format"/>
1620 </insert-template>
1621 <insert-template name="core.call_with_string_instead_of_char*">
1622 <replace from="%FUNCTION_NAME" to="setParameters"/>
1623 <replace from="%ARG_NAME" to="parameters"/>
1624 </insert-template>
1625 </inject-code>
1626 </object-type>
1627
1628
1629 <object-type name="QPixmapCache">
1630 <inject-code>
1631 <import-file name="typesystem_gui-java.java" quote-after-line="class QPixmapCache___" quote-before-line="}// class"/>
1632 </inject-code>
1633
1634 </object-type>
1635
1636 <object-type name="QProgressBar">
1637 <inject-code>
1638 <insert-template name="gui.init_style_option">
1639 <replace from="%TYPE" to="QStyleOptionProgressBar"/>
1640 </insert-template>
1641 </inject-code>
1642 </object-type>
1643
1644 <object-type name="QPushButton">
1645 <inject-code>
1646 <insert-template name="gui.init_style_option">
1647 <replace from="%TYPE" to="QStyleOptionButton"/>
1648 </insert-template>
1649 </inject-code>
1650 </object-type>
1651
1652
1653 <object-type name="QShortcut">
1654 <inject-code>
1655 <import-file name="typesystem_gui-java.java" quote-after-line="class QShortcut___" quote-before-line="}// class"/>
1656 </inject-code>
1657
1658 </object-type>
1659
1660 <object-type name="QStandardItem">
1661 <modify-function signature="appendColumn(const QList&lt;QStandardItem *&gt; &amp;)">
1662 <modify-argument index="1">
1663 <define-ownership class="java" owner="c++"/>
1664 </modify-argument>
1665 </modify-function>
1666 <modify-function signature="appendRow(const QList&lt;QStandardItem *&gt; &amp;)">
1667 <modify-argument index="1">
1668 <define-ownership class="java" owner="c++"/>
1669 </modify-argument>
1670 </modify-function>
1671 <modify-function signature="appendRow(QStandardItem *)">
1672 <modify-argument index="1">
1673 <define-ownership class="java" owner="c++"/>
1674 </modify-argument>
1675 </modify-function>
1676 <modify-function signature="insertColumn(int, const QList&lt;QStandardItem *&gt; &amp;)">
1677 <modify-argument index="2">
1678 <define-ownership class="java" owner="c++"/>
1679 </modify-argument>
1680 </modify-function>
1681 <modify-function signature="insertRow(int, const QList&lt;QStandardItem *&gt; &amp;)">
1682 <modify-argument index="2">
1683 <define-ownership class="java" owner="c++"/>
1684 </modify-argument>
1685 </modify-function>
1686 <modify-function signature="insertRow(int, QStandardItem *)">
1687 <modify-argument index="2">
1688 <define-ownership class="java" owner="c++"/>
1689 </modify-argument>
1690 </modify-function>
1691 <modify-function signature="setChild(int,int,QStandardItem *)">
1692 <modify-argument index="3">
1693 <define-ownership class="java" owner="c++"/>
1694 </modify-argument>
1695 </modify-function>
1696 <modify-function signature="setChild(int,QStandardItem *)">
1697 <modify-argument index="2">
1698 <define-ownership class="java" owner="c++"/>
1699 </modify-argument>
1700 </modify-function>
1701 <modify-function signature="takeChild(int,int)">
1702 <modify-argument index="return">
1703 <define-ownership class="java" owner="default"/>
1704 </modify-argument>
1705 </modify-function>
1706 <modify-function signature="takeColumn(int)">
1707 <modify-argument index="return">
1708 <define-ownership class="java" owner="default"/>
1709 </modify-argument>
1710 </modify-function>
1711 <modify-function signature="takeRow(int)">
1712 <modify-argument index="return">
1713 <define-ownership class="java" owner="default"/>
1714 </modify-argument>
1715 </modify-function>
1716 <modify-function signature="clone()const">
1717 <modify-argument index="return">
1718 <define-ownership class="shell" owner="c++"/>
1719 </modify-argument>
1720 </modify-function>
1721 </object-type>
1722
1723 <object-type name="QToolButton">
1724 <inject-code>
1725 <insert-template name="gui.init_style_option">
1726 <replace from="%TYPE" to="QStyleOptionToolButton"/>
1727 </insert-template>
1728 </inject-code>
1729 </object-type>
1730
1731 <object-type name="QUndoStack">
1732 <modify-function signature="push(QUndoCommand *)">
1733 <modify-argument index="1">
1734 <define-ownership class="java" owner="c++"/>
1735 </modify-argument>
1736 </modify-function>
1737 </object-type>
1738
1739
1740 <object-type name="QValidator">
1741 <inject-code>
1742 <import-file name="typesystem_gui-java.java" quote-after-line="class QValidator___" quote-before-line="}// class"/>
1743 </inject-code>
1744
1745
1746 <modify-function signature="fixup(QString&amp;)const">
1747 <modify-argument index="1">
1748 <replace-type modified-type="java.lang.String"/>
1749 <conversion-rule class="shell">
1750 jobject %out = (jobject) qtjambi_from_qstring(__jni_env, %in);
1751 </conversion-rule>
1752 <conversion-rule class="native">
1753 QString %out = qtjambi_to_qstring(__jni_env, (jstring) %in);
1754 QString *__qt_converted = &amp;%out;
1755 </conversion-rule>
1756 </modify-argument>
1757
1758 <modify-argument index="0">
1759 <replace-type modified-type="java.lang.String"/>
1760 <conversion-rule class="native">
1761 jobject %out = (jobject) qtjambi_from_qstring(__jni_env, *__qt_converted);
1762 </conversion-rule>
1763 <conversion-rule class="shell">
1764 %1 = qtjambi_to_qstring(__jni_env, (jstring) %in);
1765 </conversion-rule>
1766 </modify-argument>
1767 </modify-function>
1768
1769 <modify-function signature="validate(QString&amp;,int&amp;)const">
1770 <modify-argument index="1">
1771 <replace-type modified-type="qt.gui.QValidator$QValidationData"/>
1772 <conversion-rule class="shell">
1773 <insert-template name="gui.convert_validationdata_to_java">
1774 <replace from="%STRING" to="%1"/>
1775 <replace from="%POS" to="%2"/>
1776 </insert-template>
1777 </conversion-rule>
1778 <conversion-rule class="native">
1779 <insert-template name="gui.convert_validationdata_to_string"/>
1780 </conversion-rule>
1781 </modify-argument>
1782
1783 <modify-argument index="2">
1784 <remove-argument/>
1785 <conversion-rule class="shell">
1786 // nothing needed
1787 </conversion-rule>
1788 <conversion-rule class="native">
1789 <insert-template name="gui.convert_validationdata_to_pos">
1790 <replace from="%VALIDATIONDATA" to="%1"/>
1791 </insert-template>
1792 </conversion-rule>
1793 </modify-argument>
1794
1795 <modify-argument index="return">
1796 <conversion-rule class="native">
1797 <insert-template name="gui.cleanup_validationdata_from_java"/>
1798 jint %out = %in;
1799 </conversion-rule>
1800 <conversion-rule class="shell">
1801 <insert-template name="gui.cleanup_validationdata_to_java">
1802 <replace from="%STRING" to="%1"/>
1803 <replace from="%POS" to="%2"/>
1804 </insert-template>
1805 QValidator::State %out = (QValidator::State) qtjambi_to_enumerator(__jni_env, %in);
1806 </conversion-rule>
1807 </modify-argument>
1808 </modify-function>
1809 </object-type>
1810
1811 <object-type name="QWidgetAction">
1812 <modify-function signature="setDefaultWidget(QWidget*)">
1813 <modify-argument index="1">
1814 <define-ownership class="java" owner="c++"/>
1815 </modify-argument>
1816 </modify-function>
1817 </object-type>
1818
1819
1820 <object-type name="QAbstractButton">
1821 <inject-code>
1822 <import-file name="typesystem_gui-java.java" quote-after-line="class QAbstractButton___" quote-before-line="}// class"/>
1823 </inject-code>
1824
1825 </object-type>
1826
1827 <template name="gui::qstyleoption_from_object">
1828 jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOption", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", true);
1829 </template>
1830
1831 <template name="gui::qstyleoptioncomplex_from_object">
1832 jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOptionComplex", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", true);
1833 </template>
1834
1835 <template name="gui::qstyleoption_to_object">
1836 QStyleOption *%out = (QStyleOption *) qtjambi_to_object(__jni_env, %in);
1837 </template>
1838
1839
1840 <object-type name="QStyle">
1841 <inject-code>
1842 <import-file name="typesystem_gui-java.java" quote-after-line="class QStyle___" quote-before-line="}// class"/>
1843 </inject-code>
1844 <modify-function signature="drawControl(QStyle::ControlElement, const QStyleOption *, QPainter *, const QWidget *) const">
1845 <modify-argument index="2">
1846 <replace-type modified-type="qt.gui.QStyleOption"/>
1847 <conversion-rule class="shell">
1848 <insert-template name="gui::qstyleoption_from_object"/>
1849 </conversion-rule>
1850 <conversion-rule class="native">
1851 <insert-template name="gui::qstyleoption_to_object"/>
1852 </conversion-rule>
1853 </modify-argument>
1854 </modify-function>
1855
1856 <modify-function signature="drawComplexControl(QStyle::ComplexControl, const QStyleOptionComplex *, QPainter *, const QWidget *) const">
1857 <modify-argument index="2">
1858 <replace-type modified-type="qt.gui.QStyleOptionComplex"/>
1859 <conversion-rule class="shell">
1860 <insert-template name="gui::qstyleoptioncomplex_from_object"/>
1861 </conversion-rule>
1862 <conversion-rule class="native">
1863 <insert-template name="gui::qstyleoption_to_object"/>
1864 </conversion-rule>
1865 </modify-argument>
1866 </modify-function>
1867
1868 <modify-function signature="drawPrimitive(QStyle::PrimitiveElement, const QStyleOption *, QPainter *, const QWidget *) const">
1869 <modify-argument index="2">
1870 <replace-type modified-type="qt.gui.QStyleOption"/>
1871 <conversion-rule class="shell">
1872 <insert-template name="gui::qstyleoption_from_object"/>
1873 </conversion-rule>
1874 <conversion-rule class="native">
1875 <insert-template name="gui::qstyleoption_to_object"/>
1876 </conversion-rule>
1877 </modify-argument>
1878 </modify-function>
1879
1880 <modify-function signature="hitTestComplexControl(QStyle::ComplexControl, const QStyleOptionComplex *, const QPoint &amp;, const QWidget *) const">
1881 <modify-argument index="2">
1882 <replace-type modified-type="qt.gui.QStyleOptionComplex"/>
1883 <conversion-rule class="shell">
1884 <insert-template name="gui::qstyleoptioncomplex_from_object"/>
1885 </conversion-rule>
1886 <conversion-rule class="native">
1887 <insert-template name="gui::qstyleoption_to_object"/>
1888 </conversion-rule>
1889 </modify-argument>
1890 </modify-function>
1891
1892 <modify-function signature="pixelMetric(QStyle::PixelMetric, const QStyleOption *, const QWidget *) const">
1893 <modify-argument index="2">
1894 <replace-type modified-type="qt.gui.QStyleOption"/>
1895 <conversion-rule class="shell">
1896 <insert-template name="gui::qstyleoption_from_object"/>
1897 </conversion-rule>
1898 <conversion-rule class="native">
1899 <insert-template name="gui::qstyleoption_to_object"/>
1900 </conversion-rule>
1901 </modify-argument>
1902 </modify-function>
1903
1904 <modify-function signature="sizeFromContents(QStyle::ContentsType, const QStyleOption *, const QSize &amp;, const QWidget *) const">
1905 <modify-argument index="2">
1906 <replace-type modified-type="qt.gui.QStyleOption"/>
1907 <conversion-rule class="shell">
1908 <insert-template name="gui::qstyleoption_from_object"/>
1909 </conversion-rule>
1910 <conversion-rule class="native">
1911 <insert-template name="gui::qstyleoption_to_object"/>
1912 </conversion-rule>
1913 </modify-argument>
1914 </modify-function>
1915
1916 <modify-function signature="standardIcon(QStyle::StandardPixmap, const QStyleOption *, const QWidget *) const">
1917 <modify-argument index="2">
1918 <replace-type modified-type="qt.gui.QStyleOption"/>
1919 <conversion-rule class="shell">
1920 <insert-template name="gui::qstyleoption_from_object"/>
1921 </conversion-rule>
1922 <conversion-rule class="native">
1923 <insert-template name="gui::qstyleoption_to_object"/>
1924 </conversion-rule>
1925 </modify-argument>
1926 </modify-function>
1927
1928 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption *, const QWidget *) const">
1929 <modify-argument index="2">
1930 <replace-type modified-type="qt.gui.QStyleOption"/>
1931 <conversion-rule class="shell">
1932 <insert-template name="gui::qstyleoption_from_object"/>
1933 </conversion-rule>
1934 <conversion-rule class="native">
1935 <insert-template name="gui::qstyleoption_to_object"/>
1936 </conversion-rule>
1937 </modify-argument>
1938 </modify-function>
1939
1940 <modify-function signature="styleHint(QStyle::StyleHint, const QStyleOption *, const QWidget *, QStyleHintReturn *) const">
1941 <modify-argument index="2">
1942 <replace-type modified-type="qt.gui.QStyleOption"/>
1943 <conversion-rule class="shell">
1944 <insert-template name="gui::qstyleoption_from_object"/>
1945 </conversion-rule>
1946 <conversion-rule class="native">
1947 <insert-template name="gui::qstyleoption_to_object"/>
1948 </conversion-rule>
1949 </modify-argument>
1950 </modify-function>
1951
1952 <modify-function signature="subControlRect(QStyle::ComplexControl, const QStyleOptionComplex *, QStyle::SubControl, const QWidget *) const">
1953 <modify-argument index="2">
1954 <replace-type modified-type="qt.gui.QStyleOptionComplex"/>
1955 <conversion-rule class="shell">
1956 <insert-template name="gui::qstyleoptioncomplex_from_object"/>
1957 </conversion-rule>
1958 <conversion-rule class="native">
1959 QStyleOptionComplex *%out = (QStyleOptionComplex *) qtjambi_to_object(__jni_env, %in);
1960 </conversion-rule>
1961 </modify-argument>
1962 </modify-function>
1963
1964 <modify-function signature="subElementRect(QStyle::SubElement, const QStyleOption *, const QWidget *) const">
1965 <modify-argument index="2">
1966 <replace-type modified-type="qt.gui.QStyleOption"/>
1967 <conversion-rule class="shell">
1968 <insert-template name="gui::qstyleoption_from_object"/>
1969 </conversion-rule>
1970 <conversion-rule class="native">
1971 <insert-template name="gui::qstyleoption_to_object"/>
1972 </conversion-rule>
1973 </modify-argument>
1974 </modify-function>
1975
1976 <modify-function signature="generatedIconPixmap(QIcon::Mode,QPixmap,const QStyleOption*)const">
1977 <modify-argument index="3">
1978 <replace-type modified-type="qt.gui.QStyleOption"/>
1979 <conversion-rule class="shell">
1980 <insert-template name="gui::qstyleoption_from_object"/>
1981 </conversion-rule>
1982 <conversion-rule class="native">
1983 <insert-template name="gui::qstyleoption_to_object"/>
1984 </conversion-rule>
1985 </modify-argument>
1986 </modify-function>
1987
1988 <modify-function signature="polish(QPalette&amp;)">
1989 <modify-argument index="1">
1990 <replace-type modified-type="qt.gui.QPalette"/>
1991 <conversion-rule class="shell">
1992 jobject %out = qtjambi_from_object(__jni_env, &amp;%in, "QPalette", "com/trolltech/qt/gui/", false);
1993 jobject __invalidate_me = %out;
1994 </conversion-rule>
1995 <conversion-rule class="native">
1996 QtJambiLink *link = QtJambiLink::findLink(__jni_env, %in);
1997 Q_ASSERT(link != 0);
1998
1999 QPalette dummy;
2000 QPalette &amp;%out = link != 0 ? * (QPalette *) link-&gt;pointer() : dummy;
2001 </conversion-rule>
2002 </modify-argument>
2003 <modify-argument index="0">
2004 <conversion-rule class="shell">
2005 if (__invalidate_me != 0)
2006 qtjambi_invalidate_object(__jni_env, __invalidate_me);
2007 </conversion-rule>
2008 </modify-argument>
2009 </modify-function>
2010
2011 <modify-function signature="standardIconImplementation(QStyle::StandardPixmap,const QStyleOption*,const QWidget*)const">
2012 <modify-argument index="2">
2013 <replace-type modified-type="qt.gui.QStyleOption"/>
2014 <conversion-rule class="shell">
2015 <insert-template name="gui::qstyleoption_from_object"/>
2016 </conversion-rule>
2017 <conversion-rule class="native">
2018 <insert-template name="gui::qstyleoption_to_object"/>
2019 </conversion-rule>
2020 </modify-argument>
2021 </modify-function>
2022
2023 <modify-function signature="combinedLayoutSpacing(QFlags&lt;QSizePolicy::ControlType&gt;,QFlags&lt;QSizePolicy::ControlType&gt;,Qt::Orientation,QStyleOption*,QWidget*)const">
2024 <access modifier="private"/>
2025 <modify-argument index="4">
2026 <remove-default-expression/>
2027 </modify-argument>
2028 <modify-argument index="5">
2029 <remove-default-expression/>
2030 </modify-argument>
2031 </modify-function>
2032
2033
2034 <modify-function signature="layoutSpacing(QSizePolicy::ControlType,QSizePolicy::ControlType,Qt::Orientation,const QStyleOption*,const QWidget*)const">
2035 <access modifier="private"/>
2036 <modify-argument index="4">
2037 <remove-default-expression/>
2038 </modify-argument>
2039 <modify-argument index="5">
2040 <remove-default-expression/>
2041 </modify-argument>
2042 </modify-function>
2043
2044
2045 <modify-function signature="layoutSpacingImplementation(QSizePolicy::ControlType,QSizePolicy::ControlType,Qt::Orientation,const QStyleOption*,const QWidget*)const">
2046 <modify-argument index="4">
2047 <replace-type modified-type="qt.gui.QStyleOption"/>
2048 <conversion-rule class="shell">
2049 <insert-template name="gui::qstyleoption_from_object"/>
2050 </conversion-rule>
2051 <conversion-rule class="native">
2052 <insert-template name="gui::qstyleoption_to_object"/>
2053 </conversion-rule>
2054 </modify-argument>
2055 </modify-function>
2056
2057
2058
2059 <inject-code class="shell-declaration"> <!-- Remove in Qt 5 -->
2060 QPixmap standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*) const { return QPixmap(); }
2061 </inject-code>
2062
2063 <modify-function signature="standardPixmap(QStyle::StandardPixmap, const QStyleOption*, const QWidget*)const" remove="all"/> <!--### Obsolete in 4.3-->
2064 </object-type>
2065
2066
2067 <object-type name="QLayout">
2068 <inject-code>
2069 <import-file name="typesystem_gui-java.java" quote-after-line="class QLayout___" quote-before-line="}// class"/>
2070 </inject-code>
2071 <modify-function signature="addItem(QLayoutItem *)">
2072 <modify-argument index="1">
2073 <define-ownership class="java" owner="c++"/>
2074 </modify-argument>
2075 </modify-function>
2076 <modify-function signature="removeItem(QLayoutItem *)">
2077 <modify-argument index="1">
2078 <define-ownership class="java" owner="default"/>
2079 </modify-argument>
2080 </modify-function>
2081 <modify-function signature="addChildLayout(QLayout *)">
2082 <modify-argument index="1">
2083 <define-ownership class="java" owner="c++"/>
2084 </modify-argument>
2085 </modify-function>
2086 <modify-function signature="addChildLayout(QLayout *)">
2087 <modify-argument index="1">
2088 <define-ownership class="java" owner="c++"/>
2089 </modify-argument>
2090 </modify-function>
2091 <modify-function signature="itemAt(int) const">
2092 <modify-argument index="return">
2093 <define-ownership class="java" owner="c++"/>
2094 </modify-argument>
2095 </modify-function>
2096
2097
2098 </object-type>
2099
2100
2101 <object-type name="QGridLayout">
2102 <inject-code>
2103 <import-file name="typesystem_gui-java.java" quote-after-line="class QGridLayout___" quote-before-line="}// class"/>
2104 </inject-code>
2105 <extra-includes>
2106 <include file-name="qt.QNativePointer" location="java"/>
2107 </extra-includes>
2108
2109
2110 </object-type>
2111
2112 <template name="gui.inputDialog_get_input">
2113 public static %RETURN_TYPE %FUNCTION_NAME(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, %EXTRA, qt.core.Qt.WindowFlags f) {
2114 qt.QNativePointer ok = new qt.QNativePointer(qt.QNativePointer.Type.Boolean);
2115 %RETURN_TYPE result = %FUNCTION_NAME_internal(parent, title, label, %CALL, ok, f);
2116 return ok.booleanValue() ? result : null;
2117 }
2118
2119 public static %RETURN_TYPE %FUNCTION_NAME(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, %EXTRA, qt.core.Qt.WindowType ... f) {
2120 qt.QNativePointer ok = new qt.QNativePointer(qt.QNativePointer.Type.Boolean);
2121 %RETURN_TYPE result = %FUNCTION_NAME_internal(parent, title, label, %CALL, ok, f);
2122 return ok.booleanValue() ? result : null;
2123 }
2124
2125 public static %RETURN_TYPE %FUNCTION_NAME(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, %EXTRA) {
2126 return %FUNCTION_NAME(parent, title, label, %CALL, qt.core.Qt.WindowType.Widget);
2127 }
2128
2129 </template>
2130
2131 <object-type name="QInputDialog">
2132 <inject-code>
2133 <insert-template name="gui.inputDialog_get_input">
2134 <replace from="%RETURN_TYPE" to="Double"/>
2135 <replace from="%EXTRA" to="double value, double minValue, double maxValue, int decimals"/>
2136 <replace from="%FUNCTION_NAME" to="getDouble"/>
2137 <replace from="%CALL" to="value, minValue, maxValue, decimals"/>
2138 </insert-template>
2139
2140 public static Double getDouble(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue, double maxValue) {
2141 return getDouble(parent, title, label, value, minValue, maxValue, 1);
2142 }
2143
2144 public static Double getDouble(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, double value, double minValue) {
2145 return getDouble(parent, title, label, value, minValue, (double)2147483647);
2146 }
2147
2148
2149 public static Double getDouble(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, double value) {
2150 return getDouble(parent, title, label, value, (double)-2147483647);
2151 }
2152
2153 public static Double getDouble(qt.gui.QWidget parent, java.lang.String title, java.lang.String label) {
2154 return getDouble(parent, title, label, 0.0);
2155 }
2156 </inject-code>
2157
2158 <inject-code>
2159 <insert-template name="gui.inputDialog_get_input">
2160 <replace from="%RETURN_TYPE" to="Integer"/>
2161 <replace from="%EXTRA" to="int value, int minValue, int maxValue, int step"/>
2162 <replace from="%FUNCTION_NAME" to="getInteger"/>
2163 <replace from="%CALL" to="value, minValue, maxValue, step"/>
2164 </insert-template>
2165
2166 public static Integer getInteger(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue, int maxValue) {
2167 return getInteger(parent, title, label, value, minValue, maxValue, 1);
2168 }
2169
2170 public static Integer getInteger(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, int value, int minValue) {
2171 return getInteger(parent, title, label, value, minValue, (int)2147483647);
2172 }
2173
2174 public static Integer getInteger(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, int value) {
2175 return getInteger(parent, title, label, value, (int)-2147483647);
2176 }
2177
2178 public static Integer getInteger(qt.gui.QWidget parent, java.lang.String title, java.lang.String label) {
2179 return getInteger(parent, title, label, 0);
2180 }
2181 </inject-code>
2182
2183 <inject-code>
2184 <insert-template name="gui.inputDialog_get_input">
2185 <replace from="%RETURN_TYPE" to="String"/>
2186 <replace from="%EXTRA" to="java.util.List&lt;java.lang.String&gt; list, int current, boolean editable"/>
2187 <replace from="%FUNCTION_NAME" to="getItem"/>
2188 <replace from="%CALL" to="list, current, editable"/>
2189 </insert-template>
2190
2191 public static java.lang.String getItem(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, java.util.List&lt;java.lang.String&gt; list, int current) {
2192 return getItem(parent, title, label, list, current, true);
2193 }
2194
2195 public static java.lang.String getItem(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, java.util.List&lt;java.lang.String&gt; list) {
2196 return getItem(parent, title, label, list, 0);
2197 }
2198 </inject-code>
2199 <inject-code>
2200 <insert-template name="gui.inputDialog_get_input">
2201 <replace from="%RETURN_TYPE" to="String"/>
2202 <replace from="%EXTRA" to="qt.gui.QLineEdit.EchoMode echo, java.lang.String text"/>
2203 <replace from="%FUNCTION_NAME" to="getText"/>
2204 <replace from="%CALL" to="echo, text"/>
2205 </insert-template>
2206
2207 public static java.lang.String getText(qt.gui.QWidget parent, java.lang.String title, java.lang.String label, qt.gui.QLineEdit.EchoMode echo) {
2208 return getText(parent, title, label, echo, "");
2209 }
2210
2211 public static java.lang.String getText(qt.gui.QWidget parent, java.lang.String title, java.lang.String label) {
2212 return getText(parent, title, label, qt.gui.QLineEdit.EchoMode.Normal);
2213 }
2214 </inject-code>
2215 </object-type>
2216
2217 <object-type name="QGraphicsScene">
2218 <inject-code>
2219 <import-file name="typesystem_gui-java.java" quote-after-line="class QGraphicsScene___" quote-before-line="}// class"/>
2220 </inject-code>
2221
2222 <modify-function signature="addEllipse(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)" remove="all" />
2223 <modify-function signature="addEllipse(double, double, double, double, const QPen &amp;, const QBrush &amp;)" remove="all" />
2224 <modify-function signature="addLine(const QLineF &amp;, const QPen &amp;)" remove="all" />
2225 <modify-function signature="addLine(double, double, double, double, const QPen &amp;)" remove="all" />
2226 <modify-function signature="addPath(const QPainterPath &amp;, const QPen &amp;, const QBrush &amp;)" remove="all" />
2227 <modify-function signature="addPixmap(const QPixmap &amp;)" remove="all" />
2228 <modify-function signature="addPolygon(const QPolygonF &amp;, const QPen &amp;, const QBrush &amp;)" remove="all" />
2229 <modify-function signature="addRect(const QRectF &amp;, const QPen &amp;, const QBrush &amp;)" remove="all" />
2230 <modify-function signature="addRect(double, double, double, double, const QPen &amp;, const QBrush &amp;)" remove="all" />
2231 <modify-function signature="addSimpleText(const QString &amp;, const QFont &amp;)" remove="all" />
2232 <modify-function signature="addText(const QString &amp;, const QFont &amp;)" remove="all" />
2233
2234 <modify-function signature="drawItems(QPainter*,int,QGraphicsItem**,const QStyleOptionGraphicsItem*,QWidget*)">
2235 <modify-argument index="2">
2236 <remove-argument/>
2237 <conversion-rule class="shell">
2238 // nothing
2239 </conversion-rule>
2240 <conversion-rule class="native">
2241 <insert-template name="core.get_array_length">
2242 <replace from="%ARRAY" to="%3"/>
2243 </insert-template>
2244 int __length = %out;
2245 </conversion-rule>
2246
2247 </modify-argument>
2248
2249 <modify-argument index="3">
2250 <replace-type modified-type="qt.gui.QGraphicsItemInterface[]"/>
2251 <conversion-rule class="shell">
2252 <insert-template name="gui.convert_graphicsitem_array_to_java">
2253 <replace from="%LENGTH" to="%2"/>
2254 </insert-template>
2255 jobjectArray graphicsItemArrayHolder = %out;
2256 </conversion-rule>
2257 <conversion-rule class="native">
2258 <insert-template name="gui.convert_graphicsitem_array_from_java"/>
2259 </conversion-rule>
2260 </modify-argument>
2261
2262 <modify-argument index="return">
2263 <conversion-rule class="shell">
2264 qtjambi_invalidate_array(__jni_env, styleOptionArrayHolder);
2265 qtjambi_invalidate_array(__jni_env, graphicsItemArrayHolder);
2266 </conversion-rule>
2267 </modify-argument>
2268
2269 <modify-argument index="4">
2270 <replace-type modified-type="qt.gui.QStyleOptionGraphicsItem[]"/>
2271 <conversion-rule class="shell">
2272 <insert-template name="gui.convert_styleoptiongraphicsitem_array_to_java">
2273 <replace from="%LENGTH" to="%2"/>
2274 </insert-template>
2275 jobjectArray styleOptionArrayHolder = %out;
2276 </conversion-rule>
2277 <conversion-rule class="native">
2278 <insert-template name="gui.convert_styleoptiongraphicsitem_array_from_java"/>
2279 </conversion-rule>
2280 </modify-argument>
2281 </modify-function>
2282 </object-type>
2283
2284
2285 <object-type name="QWidget">
2286 <inject-code>
2287 <import-file name="typesystem_gui-java.java" quote-after-line="class QWidget___" quote-before-line="}// class"/>
2288 </inject-code>
2289 <modify-function signature="setWindowTitle(const QString &amp;)">
2290 <inject-code class="java">
2291 <argument-map index="1" meta-name="%1"/>
2292 if (this instanceof QMessageBox) {
2293 qt.GeneratorUtilities.threadCheck(this);
2294 if (nativeId() == 0)
2295 throw new QNoNativeResourcesException("Function call on incomplete object of type: " +getClass().getName());
2296 __qt_QMessageBox_setWindowTitle(nativeId(), %1);
2297 return ;
2298 }
2299 </inject-code>
2300 </modify-function>
2301
2302
2303 <modify-function signature="setWindowModality(Qt::WindowModality)">
2304 <inject-code class="java">
2305 <argument-map index="1" meta-name="%1"/>
2306 if (this instanceof QMessageBox) {
2307 qt.GeneratorUtilities.threadCheck(this);
2308 if (nativeId() == 0)
2309 throw new QNoNativeResourcesException("Function call on incomplete object of type: " +getClass().getName());
2310 __qt_QMessageBox_setWindowModality(nativeId(), %1.value());
2311 return ;
2312 }
2313 </inject-code>
2314 </modify-function>
2315
2316
2317
2318
2319 </object-type>
2320
2321 <object-type name="QAbstractSpinBox">
2322 <inject-code>
2323 <insert-template name="gui.init_style_option">
2324 <replace from="%TYPE" to="QStyleOptionSpinBox"/>
2325 <replace from="final" to=""/>
2326 </insert-template>
2327 </inject-code>
2328
2329 <modify-function signature="fixup(QString&amp;)const">
2330 <modify-argument index="1">
2331 <replace-type modified-type="java.lang.String"/>
2332 <conversion-rule class="shell">
2333 jobject %out = (jobject) qtjambi_from_qstring(__jni_env, %in);
2334 </conversion-rule>
2335 <conversion-rule class="native">
2336 QString %out = qtjambi_to_qstring(__jni_env, (jstring) %in);
2337 QString *__qt_converted = &amp;%out;
2338 </conversion-rule>
2339 </modify-argument>
2340
2341 <modify-argument index="0">
2342 <replace-type modified-type="java.lang.String"/>
2343 <conversion-rule class="native">
2344 jobject %out = (jobject) qtjambi_from_qstring(__jni_env, *__qt_converted);
2345 </conversion-rule>
2346 <conversion-rule class="shell">
2347 %1 = qtjambi_to_qstring(__jni_env, (jstring) %in);
2348 </conversion-rule>
2349 </modify-argument>
2350 </modify-function>
2351
2352 <modify-function signature="validate(QString&amp;,int&amp;)const">
2353 <modify-argument index="1">
2354 <replace-type modified-type="qt.gui.QValidator$QValidationData"/>
2355 <conversion-rule class="shell">
2356 <insert-template name="gui.convert_validationdata_to_java">
2357 <replace from="%STRING" to="%1"/>
2358 <replace from="%POS" to="%2"/>
2359 </insert-template>
2360 </conversion-rule>
2361 <conversion-rule class="native">
2362 <insert-template name="gui.convert_validationdata_to_string"/>
2363 </conversion-rule>
2364 </modify-argument>
2365
2366 <modify-argument index="2">
2367 <remove-argument/>
2368 <conversion-rule class="shell">
2369 // nothing needed
2370 </conversion-rule>
2371 <conversion-rule class="native">
2372 <insert-template name="gui.convert_validationdata_to_pos">
2373 <replace from="%VALIDATIONDATA" to="%1"/>
2374 </insert-template>
2375 </conversion-rule>
2376 </modify-argument>
2377
2378 <modify-argument index="0">
2379 <conversion-rule class="native">
2380 <insert-template name="gui.cleanup_validationdata_from_java"/>
2381 jint %out = %in;
2382 </conversion-rule>
2383 <conversion-rule class="shell">
2384 <insert-template name="gui.cleanup_validationdata_to_java">
2385 <replace from="%STRING" to="%1"/>
2386 <replace from="%POS" to="%2"/>
2387 </insert-template>
2388 QValidator::State %out = (QValidator::State) qtjambi_to_enumerator(__jni_env, %in);
2389 </conversion-rule>
2390 </modify-argument>
2391 </modify-function>
2392 </object-type>
2393
2394 <object-type name="QDateTimeEdit">
2395 <inject-code>
2396 <insert-template name="gui.init_style_option">
2397 <replace from="%TYPE" to="QStyleOptionSpinBox"/>
2398 <replace from="initStyleOption" to="initDateTimeEditStyleOption"/>
2399 </insert-template>
2400 </inject-code>
2401 </object-type>
2402
2403 <object-type name="QSortFilterProxyModel">
2404 <modify-function signature="match(QModelIndex, int, QVariant, int, QFlags&lt;Qt::MatchFlag&gt;) const">
2405 <modify-argument index="5">
2406 <replace-default-expression with="Qt.MatchFlag.MatchStartsWith, Qt.MatchFlag.MatchWrap"/>
2407 </modify-argument>
2408 </modify-function>
2409 </object-type>
2410
2411 <object-type name="QSlider">
2412 <inject-code>
2413 <insert-template name="gui.init_style_option">
2414 <replace from="%TYPE" to="QStyleOptionSlider"/>
2415 </insert-template>
2416 </inject-code>
2417 </object-type>
2418
2419 <object-type name="QLabel">
2420 <extra-includes>
2421 <include file-name="qt.QNativePointer" location="java"/>
2422 </extra-includes>
2423
2424 <inject-code>
2425 <insert-template name="gui.getter_returning_nativepointer">
2426 <replace from="%RETURN_TYPE" to="QPicture"/>
2427 <replace from="%FUNCTION_NAME" to="picture"/>
2428 </insert-template>
2429 </inject-code>
2430 <inject-code>
2431 <insert-template name="gui.getter_returning_nativepointer">
2432 <replace from="%RETURN_TYPE" to="QPixmap"/>
2433 <replace from="%FUNCTION_NAME" to="pixmap"/>
2434 </insert-template>
2435 </inject-code>
2436 </object-type>
2437
2438
2439 <object-type name="QFileDialog">
2440 <inject-code>
2441 <import-file name="typesystem_gui-java.java" quote-after-line="class QFileDialog___" quote-before-line="}// class"/>
2442 </inject-code>
2443 <extra-includes>
2444 <include file-name="qt.QNativePointer" location="java"/>
2445 </extra-includes>
2446
2447 <template name="gui.filedialog_get_xxx_filename">
2448 public static %TYPE %FUNCTION_NAME(QWidget parent, String caption, String dir, Filter filter, Options options) {
2449 QNativePointer np = filter != null ? new QNativePointer(QNativePointer.Type.String) : null;
2450 %TYPE returned = %FUNCTION_NAME(parent, caption, dir, filter != null ? filter.filter : "", np, options);
2451 if (filter != null)
2452 filter.selectedFilter = np.stringValue();
2453 return returned;
2454 }
2455
2456 public static %TYPE %FUNCTION_NAME(QWidget parent, String caption, String dir, Filter filter, Option ... options) {
2457 QNativePointer np = filter != null ? new QNativePointer(QNativePointer.Type.String) : null;
2458 %TYPE returned = %FUNCTION_NAME(parent, caption, dir, filter != null ? filter.filter : "", np, options);
2459 if (filter != null)
2460 filter.selectedFilter = np.stringValue();
2461 return returned;
2462 }
2463
2464 public static %TYPE %FUNCTION_NAME(QWidget parent, String caption, String dir, Filter filter) {
2465 return %FUNCTION_NAME(parent, caption, dir, filter, new Options(0));
2466 }
2467
2468 public static %TYPE %FUNCTION_NAME(QWidget parent, String caption, String dir) {
2469 return %FUNCTION_NAME(parent, caption, dir, null);
2470 }
2471
2472 public static %TYPE %FUNCTION_NAME(QWidget parent, String caption) {
2473 return %FUNCTION_NAME(parent, caption, "");
2474 }
2475
2476 public static %TYPE %FUNCTION_NAME(QWidget parent) {
2477 return %FUNCTION_NAME(parent, "");
2478 }
2479
2480 public static %TYPE %FUNCTION_NAME() {
2481 return %FUNCTION_NAME(null);
2482 }
2483
2484 </template>
2485 <inject-code>
2486 <insert-template name="gui.filedialog_get_xxx_filename">
2487 <replace from="%FUNCTION_NAME" to="getOpenFileName"/>
2488 <replace from="%TYPE" to="String"/>
2489 </insert-template>
2490 </inject-code>
2491 <inject-code>
2492 <insert-template name="gui.filedialog_get_xxx_filename">
2493 <replace from="%FUNCTION_NAME" to="getOpenFileNames"/>
2494 <replace from="%TYPE" to="java.util.List&lt;String&gt;"/>
2495 </insert-template>
2496 </inject-code>
2497 <inject-code>
2498 <insert-template name="gui.filedialog_get_xxx_filename">
2499 <replace from="%FUNCTION_NAME" to="getSaveFileName"/>
2500 <replace from="%TYPE" to="String"/>
2501 </insert-template>
2502 </inject-code>
2503 </object-type>
2504
2505
2506 <object-type name="QTabBar">
2507 <inject-code>
2508 <import-file name="typesystem_gui-java.java" quote-after-line="class QTabBar___" quote-before-line="}// class"/>
2509 </inject-code>
2510
2511 </object-type>
2512
2513 <object-type name="QRadioButton">
2514 <inject-code>
2515 <insert-template name="gui.init_style_option">
2516 <replace from="%TYPE" to="QStyleOptionButton"/>
2517 </insert-template>
2518 </inject-code>
2519 </object-type>
2520
2521 <object-type name="QScrollBar">
2522 <inject-code>
2523 <insert-template name="gui.init_style_option">
2524 <replace from="%TYPE" to="QStyleOptionSlider"/>
2525 </insert-template>
2526 </inject-code>
2527 </object-type>
2528
2529
2530 <object-type name="QClipboard">
2531 <inject-code>
2532 <import-file name="typesystem_gui-java.java" quote-after-line="class QClipboard___" quote-before-line="}// class"/>
2533 </inject-code>
2534 <extra-includes>
2535 <include file-name="qt.QNativePointer" location="java"/>
2536 </extra-includes>
2537
2538 </object-type>
2539
2540
2541 <object-type name="QAbstractScrollArea">
2542 <inject-code>
2543 <import-file name="typesystem_gui-java.java" quote-after-line="class QAbstractScrollArea___" quote-before-line="}// class"/>
2544 </inject-code>
2545
2546 </object-type>
2547
2548 <object-type name="QRubberBand">
2549 <inject-code>
2550 <insert-template name="gui.init_style_option">
2551 <replace from="%TYPE" to="QStyleOptionRubberBand"/>
2552 </insert-template>
2553 </inject-code>
2554 </object-type>
2555
2556
2557 <object-type name="QTextDocument">
2558 <inject-code>
2559 <import-file name="typesystem_gui-java.java" quote-after-line="class QTextDocument___" quote-before-line="}// class"/>
2560 </inject-code>
2561
2562 </object-type>
2563
2564
2565 <object-type name="QSplitter">
2566 <inject-code>
2567 <import-file name="typesystem_gui-java.java" quote-after-line="class QSplitter___" quote-before-line="}// class"/>
2568 </inject-code>
2569 <extra-includes>
2570 <include file-name="qt.QNativePointer" location="java"/>
2571 </extra-includes>
2572
2573 </object-type>
2574
2575 <object-type name="QGroupBox">
2576 <inject-code>
2577 <insert-template name="gui.init_style_option">
2578 <replace from="%TYPE" to="QStyleOptionGroupBox"/>
2579 </insert-template>
2580 </inject-code>
2581 </object-type>
2582
2583 <object-type name="QDial">
2584 <inject-code>
2585 <insert-template name="gui.init_style_option">
2586 <replace from="%TYPE" to="QStyleOptionSlider"/>
2587 </insert-template>
2588 </inject-code>
2589 </object-type>
2590
2591 <object-type name="QLineEdit">
2592 <inject-code>
2593 <insert-template name="gui.init_style_option">
2594 <replace from="%TYPE" to="QStyleOptionFrame"/>
2595 </insert-template>
2596 </inject-code>
2597 </object-type>
2598
2599 <object-type name="QToolBar">
2600 <inject-code>
2601 <insert-template name="gui.init_style_option">
2602 <replace from="%TYPE" to="QStyleOptionToolBar"/>
2603 </insert-template>
2604 </inject-code>
2605 <inject-code>
2606 <insert-template name="gui.addAction">
2607 <replace from="%POST_CALL" to=""/>
2608 <replace from=" %END_EXTRA" to=""/>
2609 <replace from=" %END_CALL_EXTRA" to=""/>
2610 <replace from="%EXTRA" to="QIcon icon,"/>
2611 <replace from="%CALL_EXTRA" to="icon,"/>
2612 </insert-template>
2613 </inject-code>
2614 <inject-code>
2615 <insert-template name="gui.addAction">
2616 <replace from="%POST_CALL" to=""/>
2617 <replace from=" %END_EXTRA" to=""/>
2618 <replace from=" %END_CALL_EXTRA" to=""/>
2619 <replace from="%EXTRA " to=""/>
2620 <replace from="%CALL_EXTRA " to=""/>
2621 </insert-template>
2622 </inject-code>
2623 </object-type>
2624
2625 <object-type name="QPaintEngine">
2626 <modify-function signature="drawLines(const QLine *, int)">
2627 <modify-argument index="1">
2628 <replace-type modified-type="qt.gui.QLine[]"/>
2629 <conversion-rule class="shell">
2630 jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
2631 "QLine", "com/trolltech/qt/gui/");
2632 </conversion-rule>
2633 <conversion-rule class="native">
2634 QVarLengthArray&lt;QLine, 32&gt; __lines;
2635 int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2636 for (int i=0; i&lt;__size; ++i)
2637 __lines.append(*(QLine *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
2638 const QLine *%out = %1 == 0 ? 0 : __lines.constData();
2639 </conversion-rule>
2640
2641 </modify-argument>
2642 <modify-argument index="2">
2643 <remove-argument/>
2644 <conversion-rule class="shell">
2645 /* nothing */
2646 </conversion-rule>
2647 <conversion-rule class="native">
2648 int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2649 </conversion-rule>
2650 </modify-argument>
2651 </modify-function>
2652
2653 <modify-function signature="drawLines(const QLineF *, int)">
2654 <modify-argument index="1">
2655 <replace-type modified-type="qt.gui.QLineF[]"/>
2656 <conversion-rule class="shell">
2657 jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
2658 "QLineF", "com/trolltech/qt/gui/");
2659 </conversion-rule>
2660 <conversion-rule class="native">
2661 QVarLengthArray&lt;QLineF, 32&gt; __data;
2662 int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2663 for (int i=0; i&lt;__size; ++i)
2664 __data.append(*(QLineF *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
2665 const QLineF *%out = %1 == 0 ? 0 : __data.constData();
2666 </conversion-rule>
2667 </modify-argument>
2668 <modify-argument index="2">
2669 <remove-argument/>
2670 <conversion-rule class="shell">
2671 /* nothing */
2672 </conversion-rule>
2673 <conversion-rule class="native">
2674 int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2675 </conversion-rule>
2676 </modify-argument>
2677 </modify-function>
2678
2679 <modify-function signature="drawRects(const QRectF *, int)">
2680 <modify-argument index="1">
2681 <replace-type modified-type="qt.core.QRectF[]"/>
2682 <conversion-rule class="shell">
2683 jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
2684 "QRectF", "com/trolltech/qt/core/");
2685 </conversion-rule>
2686 <conversion-rule class="native">
2687 QVarLengthArray&lt;QRectF, 32&gt; __data;
2688 int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2689 for (int i=0; i&lt;__size; ++i)
2690 __data.append(*(QRectF *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
2691 const QRectF *%out = %1 == 0 ? 0 : __data.constData();
2692 </conversion-rule>
2693 </modify-argument>
2694 <modify-argument index="2">
2695 <remove-argument/>
2696 <conversion-rule class="shell">
2697 /* nothing */
2698 </conversion-rule>
2699 <conversion-rule class="native">
2700 int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2701 </conversion-rule>
2702 </modify-argument>
2703 </modify-function>
2704
2705 <modify-function signature="drawRects(const QRect *, int)">
2706 <modify-argument index="1">
2707 <replace-type modified-type="qt.core.QRect[]"/>
2708 <conversion-rule class="shell">
2709 jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
2710 "QRect", "com/trolltech/qt/core/");
2711 </conversion-rule>
2712 <conversion-rule class="native">
2713 QVarLengthArray&lt;QRect, 32&gt; __data;
2714 int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2715 for (int i=0; i&lt;__size; ++i)
2716 __data.append(*(QRect *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
2717 const QRect *%out = %1 == 0 ? 0 : __data.constData();
2718 </conversion-rule>
2719 </modify-argument>
2720 <modify-argument index="2">
2721 <remove-argument/>
2722 <conversion-rule class="shell">
2723 /* nothing */
2724 </conversion-rule>
2725 <conversion-rule class="native">
2726 int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2727 </conversion-rule>
2728 </modify-argument>
2729 </modify-function>
2730
2731 <modify-function signature="drawPoints(const QPoint *, int)">
2732 <modify-argument index="1">
2733 <replace-type modified-type="qt.core.QPoint[]"/>
2734 <conversion-rule class="shell">
2735 jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
2736 "QPoint", "com/trolltech/qt/core/");
2737 </conversion-rule>
2738 <conversion-rule class="native">
2739 QVarLengthArray&lt;QPoint, 32&gt; __data;
2740 int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2741 for (int i=0; i&lt;__size; ++i)
2742 __data.append(*(QPoint *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
2743 const QPoint *%out = %1 == 0 ? 0 : __data.constData();
2744 </conversion-rule>
2745 </modify-argument>
2746
2747 <modify-argument index="2">
2748 <remove-argument/>
2749 <conversion-rule class="shell">
2750 /* nothing */
2751 </conversion-rule>
2752 <conversion-rule class="native">
2753 int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2754 </conversion-rule>
2755 </modify-argument>
2756 </modify-function>
2757
2758 <modify-function signature="drawPoints(const QPointF *, int)">
2759 <modify-argument index="1">
2760 <replace-type modified-type="qt.core.QPointF[]"/>
2761 <conversion-rule class="shell">
2762 jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
2763 "QPointF", "com/trolltech/qt/core/");
2764 </conversion-rule>
2765 <conversion-rule class="native">
2766 QVarLengthArray&lt;QPointF, 32&gt; __data;
2767 int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2768 for (int i=0; i&lt;__size; ++i)
2769 __data.append(*(QPointF *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
2770 const QPointF *%out = %1 == 0 ? 0 : __data.constData();
2771 </conversion-rule>
2772 </modify-argument>
2773 <modify-argument index="2">
2774 <remove-argument/>
2775 <conversion-rule class="shell">
2776 /* nothing */
2777 </conversion-rule>
2778 <conversion-rule class="native">
2779 int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2780 </conversion-rule>
2781 </modify-argument>
2782 </modify-function>
2783
2784 <modify-function signature="drawPolygon(const QPoint *, int, QPaintEngine::PolygonDrawMode)">
2785 <modify-argument index="1">
2786 <replace-type modified-type="qt.core.QPoint[]"/>
2787 <conversion-rule class="shell">
2788 jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
2789 "QPoint", "com/trolltech/qt/core/");
2790 </conversion-rule>
2791 <conversion-rule class="native">
2792 QVarLengthArray&lt;QPoint, 32&gt; __data;
2793 int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2794 for (int i=0; i&lt;__size; ++i)
2795 __data.append(*(QPoint *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
2796 const QPoint *%out = %1 == 0 ? 0 : __data.constData();
2797 </conversion-rule>
2798 </modify-argument>
2799 <modify-argument index="2">
2800 <remove-argument/>
2801 <conversion-rule class="shell">
2802 /* nothing */
2803 </conversion-rule>
2804 <conversion-rule class="native">
2805 int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2806 </conversion-rule>
2807 </modify-argument>
2808 </modify-function>
2809
2810 <modify-function signature="drawPolygon(const QPointF *, int, QPaintEngine::PolygonDrawMode)">
2811 <modify-argument index="1">
2812 <replace-type modified-type="qt.core.QPointF[]"/>
2813 <conversion-rule class="shell">
2814 jobjectArray %out = qtjambi_from_array(__jni_env, %in, %2,
2815 "QPointF", "com/trolltech/qt/core/");
2816 </conversion-rule>
2817 <conversion-rule class="native">
2818 QVarLengthArray&lt;QPointF, 32&gt; __data;
2819 int __size = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2820 for (int i=0; i&lt;__size; ++i)
2821 __data.append(*(QPointF *)qtjambi_to_object(__jni_env, __jni_env-&gt;GetObjectArrayElement((jobjectArray) %in, i)));
2822 const QPointF *%out = %1 == 0 ? 0 : __data.constData();
2823 </conversion-rule>
2824 </modify-argument>
2825 <modify-argument index="2">
2826 <remove-argument/>
2827 <conversion-rule class="shell">
2828 /* nothing */
2829 </conversion-rule>
2830 <conversion-rule class="native">
2831 int %out = %1 == 0 ? 0 : __jni_env-&gt;GetArrayLength((jarray) %1);
2832 </conversion-rule>
2833 </modify-argument>
2834 </modify-function>
2835 </object-type>
2836
2837 <object-type name="QGuiSignalMapper">
2838 <modify-function signature="setMapping(QObject*,QWidget*)">
2839 <modify-argument index="1">
2840 <reference-count action="add" declare-variable="qt.core.QSignalMapper" variable-name="__rcMappings"/>
2841 </modify-argument>
2842 <inject-code class="java" position="end">
2843 <argument-map index="1" meta-name="%1"/>
2844 <argument-map index="2" meta-name="%2"/>
2845 java.util.Hashtable&lt;qt.core.QObject, Object&gt; __rcWidgetForObject = (java.util.Hashtable&lt;qt.core.QObject, Object&gt;) qt.GeneratorUtilities.fetchField(this, qt.core.QSignalMapper.class, "__rcWidgetForObject");
2846 if (%2 == null)
2847 __rcWidgetForObject.remove(%1);
2848 else
2849 __rcWidgetForObject.put(%1,%2);
2850 </inject-code>
2851 </modify-function>
2852 </object-type>
2853
2854
2855 <object-type name="QAction">
2856 <inject-code>
2857 <import-file name="typesystem_gui-java.java" quote-after-line="class QAction___" quote-before-line="}// class"/>
2858 </inject-code>
2859
2860 <modify-function signature="setActionGroup(QActionGroup*)">
2861 <modify-argument index="1">
2862 <reference-count action="ignore"/>
2863 </modify-argument>
2864 <inject-code position="end">
2865 <argument-map index="1" meta-name="%1"/>
2866 java.util.Collection&lt;Object&gt; __rcTmp = null;
2867 if (__rcActionGroup != null) {
2868 __rcTmp = (java.util.Collection&lt;Object&gt;)qt.GeneratorUtilities.fetchField(__rcActionGroup, QActionGroup.class, "__rcActions");
2869 while (__rcTmp.contains(this))
2870 __rcTmp.remove(this);
2871 }
2872 __rcActionGroup = %1;
2873 if (__rcActionGroup != null) {
2874 __rcTmp = (java.util.Collection&lt;Object&gt;)qt.GeneratorUtilities.fetchField(__rcActionGroup, QActionGroup.class, "__rcActions");
2875 __rcTmp.add(this);
2876 }
2877 </inject-code>
2878 </modify-function>
2879 </object-type>
2880
2881
2882 <object-type name="QPainter">
2883 <inject-code>
2884 <import-file name="typesystem_gui-java.java" quote-after-line="class QPainter___" quote-before-line="}// class"/>
2885 </inject-code>
2886
2887 <inject-code class="destructor-function">
2888 if (((QPainter *) ptr)->isActive()) {
2889 qWarning("QPainter: trying to delete an active painter, "
2890 "did you forget to call \"end()\"?\n");
2891 return;
2892 }
2893 </inject-code>
2894
2895 <template name="gui.painter_draw_text_general">
2896 public final void drawText(%RECT_ARGUMENTS, int flags, String text, %RECT_TYPE boundingRect) {
2897 drawText(%RECT_CALL_ARGUMENTS, flags, text, boundingRect == null ? null : boundingRect.nativePointer());
2898 }
2899
2900 public final void drawText(%RECT_ARGUMENTS, int flags, String text) {
2901 drawText(%RECT_CALL_ARGUMENTS, flags, text, (%RECT_TYPE) null);
2902 }
2903 </template>
2904
2905 <template name="gui.painter_draw_text_qrect">
2906 <insert-template name="gui.painter_draw_text_general">
2907 <replace from="%RECT_ARGUMENTS" to="%RECT_TYPE rectangle"/>
2908 <replace from="%RECT_CALL_ARGUMENTS" to="rectangle"/>
2909 </insert-template>
2910 </template>
2911 <inject-code>
2912 <insert-template name="gui.painter_draw_text_qrect">
2913 <replace from="%RECT_TYPE" to="qt.core.QRect"/>
2914 </insert-template>
2915 </inject-code>
2916 <inject-code>
2917 <insert-template name="gui.painter_draw_text_qrect">
2918 <replace from="%RECT_TYPE" to="qt.core.QRectF"/>
2919 </insert-template>
2920 </inject-code>
2921 <inject-code>
2922 <insert-template name="gui.painter_draw_text_general">
2923 <replace from="%RECT_TYPE" to="qt.core.QRect"/>
2924 <replace from="%RECT_ARGUMENTS" to="int x, int y, int width, int height"/>
2925 <replace from="%RECT_CALL_ARGUMENTS" to="x, y, width, height"/>
2926 </insert-template>
2927 </inject-code>
2928
2929
2930 <modify-function signature="setRedirected(const QPaintDevice*, QPaintDevice*, const QPoint &amp;)">
2931 <modify-argument index="1">
2932 <reference-count action="ignore"/>
2933 </modify-argument>
2934 <modify-argument index="2">
2935 <reference-count action="ignore"/>
2936 </modify-argument>
2937 <inject-code position="end">
2938 <argument-map index="1" meta-name="%1"/>
2939 <argument-map index="2" meta-name="%2"/>
2940 __rcRedirections.push(%1);
2941 __rcRedirections.push(%2);
2942 </inject-code>
2943 </modify-function>
2944 <modify-function signature="restoreRedirected(const QPaintDevice*)">
2945 <inject-code position="end">
2946 if (!__rcRedirections.empty()) __rcRedirections.pop();
2947 if (!__rcRedirections.empty()) __rcRedirections.pop();
2948 </inject-code>
2949 </modify-function>
2950 </object-type>
2951
2952 <object-type name="QApplication">
2953 <inject-code>
2954 <import-file name="typesystem_gui-java.java" quote-after-line="class QApplication___" quote-before-line="}// class"/>
2955 </inject-code>
2956 <extra-includes>
2957 <include file-name="qt.QNativePointer" location="java"/>
2958 </extra-includes>
2959 <!-- <modify-function signature="QApplication(int &amp;, char **, int)">
2960 <inject-code class="shell">
2961 qtjambi_register_variant_handler();
2962 </inject-code> -->
2963 </modify-function>
2964 <template name="gui.application_char_pointer_function">
2965 public static %RETURN_TYPE %FUNCTION_NAME(%PRE_ARGUMENTS %COMMA QByteArray className) {
2966 return %FUNCTION_NAME(%PRE_CALL_ARGUMENTS %COMMA className == null ? null : className.data());
2967 }
2968 </template>
2969 </object-type>
2970
2971 <object-type name="QFormLayout">
2972 <modify-function signature="getLayoutPosition(QLayout*,int*,QFormLayout::ItemRole*)const" access="private"/>
2973 <modify-function signature="getWidgetPosition(QWidget*,int*,QFormLayout::ItemRole*)const" access="private"/>
2974 <modify-function signature="getItemPosition(int,int*,QFormLayout::ItemRole*)const" access="private"/>
2975 <inject-code>
2976 <import-file name="typesystem_gui-java.java" quote-after-line="class QFormLayout___" quote-before-line="}// class"/>
2977 </inject-code>
2978 </object-type>
2979
2980 <interface-type name="QGraphicsLayoutItem">
2981 <modify-function signature="getContentsMargins(double*,double*,double*,double*)const" access="private" />
2982 <inject-code>
2983 <import-file name="typesystem_gui-java.java" quote-after-line="class Subclass_of_QGraphicsLayoutItem___" quote-before-line="}// class"/>
2984 </inject-code>
2985 <inject-code class="interface">
2986 public QMarginsF getContentsMargins();
2987 </inject-code>
2988 </interface-type>
2989 <object-type name="QGraphicsLayout">
2990 <modify-function signature="getContentsMargins(double*,double*,double*,double*)const" access="private" />
2991 <inject-code>
2992 <import-file name="typesystem_gui-java.java" quote-after-line="class Subclass_of_QGraphicsLayoutItem___" quote-before-line="}// class"/>
2993 </inject-code>
2994 </object-type>
2995 <object-type name="QGraphicsProxyWidget">
2996 <modify-function signature="setWidget(QWidget*)">
2997 <modify-argument index="1">
2998 <reference-count action="ignore" />
2999 </modify-argument>
3000 <inject-code>
3001 <argument-map index="1" meta-name="%1" />
3002 if (%1 != null)
3003 %1.disableGarbageCollection();
3004 else if (widget() != null)
3005 widget().reenableGarbageCollection();
3006 </inject-code>
3007 </modify-function>
3008 </object-type>
3009 <object-type name="QGraphicsWidget">
3010 <modify-function signature="getContentsMargins(double*,double*,double*,double*)const" access="private" />
3011 <modify-function signature="getWindowFrameMargins(double*,double*,double*,double*)const" access="private"/>
3012
3013 <inject-code>
3014 <import-file name="typesystem_gui-java.java" quote-after-line="class QGraphicsWidget___" quote-before-line="}// class"/>
3015 <import-file name="typesystem_gui-java.java" quote-after-line="class Subclass_of_QGraphicsLayoutItem___" quote-before-line="}// class"/>
3016 </inject-code>
3017
3018 <modify-function signature="initStyleOption(QStyleOption*)const">
3019 <modify-argument index="1">
3020 <replace-type modified-type="qt.gui.QStyleOption" />
3021 <conversion-rule class="shell">
3022 jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOption", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", false);
3023 jobject __tmp = %out;
3024 </conversion-rule>
3025 <conversion-rule class="native">
3026 QStyleOption *%out = (QStyleOption *) qtjambi_to_object(__jni_env, %in);
3027 </conversion-rule>
3028 </modify-argument>
3029 <modify-argument index="return">
3030 <conversion-rule class="shell">
3031 // Make sure the java object is not usable after this, since
3032 // the QStyleOption* may be deleted at any time.
3033 qtjambi_invalidate_object(__jni_env, __tmp);
3034 __tmp = 0;
3035 </conversion-rule>
3036 </modify-argument>
3037 </modify-function>
3038
3039 <modify-function signature="paintWindowFrame(QPainter*,const QStyleOptionGraphicsItem*,QWidget*)">
3040 <modify-argument index="2">
3041 <conversion-rule class="shell">
3042 jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOptionGraphicsItem", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", true);
3043 </conversion-rule>
3044 <conversion-rule class="native">
3045 const QStyleOptionGraphicsItem *%out = (QStyleOptionGraphicsItem *) qtjambi_to_object(__jni_env, %in);
3046 </conversion-rule>
3047 <replace-type modified-type="qt.gui.QStyleOptionGraphicsItem"/>
3048 </modify-argument>
3049 </modify-function>
3050
3051 </object-type>
3052
3053 <object-type name="QPrinter">
3054 <modify-function signature="getPageMargins(double*,double*,double*,double*,QPrinter::Unit)const" access="private" />
3055 <inject-code>
3056 <import-file name="typesystem_gui-java.java" quote-after-line="class QPrinter___" quote-before-line="}// class"/>
3057 </inject-code>
3058 </object-type>
3059
3060 <object-type name="QStyledItemDelegate">
3061 <modify-function signature="initStyleOption(QStyleOptionViewItem*,QModelIndex)const">
3062 <modify-argument index="1">
3063 <conversion-rule class="shell">
3064 jobject %out = qtjambi_from_object(__jni_env, %in, "QStyleOptionViewItem", "com/trolltech/qt/gui/", "Lcom_trolltech_qt_gui_QStyleOption_2", false);
3065 </conversion-rule>
3066 <conversion-rule class="native">
3067 QStyleOptionViewItem *%out = (QStyleOptionViewItem *) qtjambi_to_object(__jni_env, %in);
3068 </conversion-rule>
3069 <replace-type modified-type="qt.gui.QStyleOptionViewItem" />
3070 </modify-argument>
3071 </modify-function>
3072 </object-type>
3073
3074 <object-type name="QListWidget">
3075 <modify-function signature="addItem(const QString &amp;)" remove="all" />
3076 <modify-function signature="addItems(const QStringList&lt;QString&gt; &amp;)" remove="all" />
3077 <modify-function signature="insertItem(int, const QString &amp;)" remove="all" />
3078 <modify-function signature="insertItems(int, const QStringList&lt;QString&gt; &amp;)" remove="all" />
3079 <inject-code>
3080 <import-file name="typesystem_gui-java.java" quote-after-line="class QListWidget___" quote-before-line="}// class" />
3081 </inject-code>
3082 </object-type>
3083
3084 <interface-type name="QPictureFormatInterface">
3085 <modify-function signature="loadPicture(QString,QString,QPicture*)">
3086 <modify-argument index="3">
3087 <replace-type modified-type="qt.gui.QPicture" />
3088 <conversion-rule class="shell">
3089 jobject %out = qtjambi_from_object(__jni_env, %in, "QPicture", "com/trolltech/qt/gui/", false);
3090 jobject __tmp = %out;
3091 </conversion-rule>
3092 <conversion-rule class="native">
3093 QPicture *%out = (QPicture *) qtjambi_to_object(__jni_env, %in);
3094 </conversion-rule>
3095 </modify-argument>
3096 <modify-argument index="return">
3097 <conversion-rule class="shell">
3098 // Make sure the java object is not usable after this, since
3099 // the QPicture* may be deleted at any time.
3100 qtjambi_invalidate_object(__jni_env, __tmp);
3101 __tmp = 0;
3102 bool %out = (bool) %in;
3103 </conversion-rule>
3104 <conversion-rule class="native">
3105 jboolean %out = (jboolean) %in;
3106 </conversion-rule>
3107 </modify-argument>
3108 </modify-function>
3109 </interface-type>
3110
3111 <suppress-warning text="WARNING(JavaGenerator) :: either add or remove specified for reference count variable '__rcItems' in 'qt.gui.QGraphicsGridLayout' but not both" />
3112
3113 </typesystem>