changeset 14:5015aede8edd

insert() for QPolygons
author eldar
date Thu, 14 May 2009 15:53:32 +0000
parents 4faee409a98d
children 056e83133e29
files generator/dgenerator.cpp generator/typesystem.cpp generator/typesystem.h generator/typesystem_core.xml generator/typesystem_gui.xml
diffstat 5 files changed, 110 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/generator/dgenerator.cpp	Thu May 14 15:04:16 2009 +0000
+++ b/generator/dgenerator.cpp	Thu May 14 15:53:32 2009 +0000
@@ -2376,6 +2376,19 @@
 */
     s << "}" << endl;
 
+    /* ---------------- injected free code ----------------*/
+    const ComplexTypeEntry *class_type = d_class->typeEntry();
+    Q_ASSERT(class_type);
+
+    CodeSnipList code_snips = class_type->codeSnips();
+    foreach (const CodeSnip &snip, code_snips) {
+        if (!d_class->isInterface() && snip.language == TypeSystem::TargetLangFreeCode) {
+            s << endl;
+            snip.formattedCode(s, INDENT);
+        }
+    }
+    /* --------------------------------------------------- */
+
     interfaces = d_class->interfaces();
     if (!interfaces.isEmpty()) {
         for (int i=0; i<interfaces.size(); ++i) {
--- a/generator/typesystem.cpp	Thu May 14 15:04:16 2009 +0000
+++ b/generator/typesystem.cpp	Thu May 14 15:53:32 2009 +0000
@@ -1315,6 +1315,7 @@
                 static QHash<QString, TypeSystem::Language> languageNames;
                 if (languageNames.isEmpty()) {
                     languageNames["java"] = TypeSystem::TargetLangCode;
+                    languageNames["java-free"] = TypeSystem::TargetLangFreeCode;
                     languageNames["native"] = TypeSystem::NativeCode;
                     languageNames["shell"] = TypeSystem::ShellCode;
                     languageNames["shell-declaration"] = TypeSystem::ShellDeclaration;
--- a/generator/typesystem.h	Thu May 14 15:04:16 2009 +0000
+++ b/generator/typesystem.h	Thu May 14 15:53:32 2009 +0000
@@ -95,6 +95,7 @@
         NoLanguage          = 0x0000,
         TargetLangCode      = 0x0001,
         NativeCode          = 0x0002,
+        TargetLangFreeCode  = 0x0003,
         ShellCode           = 0x0004,
         ShellDeclaration    = 0x0008,
         PackageInitializer  = 0x0010,
--- a/generator/typesystem_core.xml	Thu May 14 15:04:16 2009 +0000
+++ b/generator/typesystem_core.xml	Thu May 14 15:53:32 2009 +0000
@@ -2394,7 +2394,8 @@
         <include file-name="QVarLengthArray" location="global"/>
     </extra-includes>
 
-  
+
+
       <inject-code class="java">
           <import-file name="typesystem_core-java.java" quote-after-line="class QObject___" quote-before-line="}// class"/>
       </inject-code>
--- a/generator/typesystem_gui.xml	Thu May 14 15:04:16 2009 +0000
+++ b/generator/typesystem_gui.xml	Thu May 14 15:53:32 2009 +0000
@@ -1050,19 +1050,61 @@
 
   <value-type name="QTextListFormat" delete-in-main-thread="yes"/>
   <value-type name="QPolygon">
+    <extra-includes>
+        <include file-name="qt.core.QPoint" location="java"/>
+    </extra-includes>
+    
     <modify-function signature="QPolygon(int, const int *)" remove="all"/>
     <modify-function signature="operator+(QVector&lt;QPoint&gt;)const" remove="all"/>
     <modify-function signature="operator&lt;&lt;(QPoint)" remove="all"/>
     <modify-function signature="operator&lt;&lt;(QVector&lt;QPoint&gt;)" remove="all"/>
-
-
-  
-        <extra-includes>
-            <include file-name="qt.core.QPoint" location="java"/>
-        </extra-includes>
-        <inject-code>
-            <import-file name="typesystem_gui-java.java" quote-after-line="class QPolygon___" quote-before-line="}// class"/>
-        </inject-code>
+    
+    <inject-code class="java">
+    public final void insert(int i, QPoint t) {
+        qtd_QPolygon_insert_int_QPoint(nativeId, i, t);
+    }
+    
+    public final void insert(int i, int n, QPoint t) {
+        qtd_QPolygon_insert_int_int_QPoint(nativeId, i, n, t);
+    }
+    </inject-code>
+    <inject-code class="java-free">
+private extern(C) void  qtd_QPolygon_insert_int_QPoint(void* __this_nativeId,
+ int i0,
+ QPoint t1);
+private extern(C) void  qtd_QPolygon_insert_int_int_QPoint(void* __this_nativeId,
+ int i0,
+ int n1,
+ QPoint t2);
+    </inject-code>
+    <inject-code class="native">
+// QPolygon::insert(int i, const QPoint &amp; t)
+extern "C" DLL_PUBLIC void qtd_QPolygon_insert_int_QPoint
+(void* __this_nativeId,
+ int i0,
+ QPoint t1)
+{
+    QPolygon *__qt_this = (QPolygon *) __this_nativeId;
+    __qt_this->insert((int )i0, (const QPoint&amp; )t1);
+
+}
+
+// QPolygon::insert(int i, int n, const QPoint &amp; t)
+extern "C" DLL_PUBLIC void qtd_QPolygon_insert_int_int_QPoint
+(void* __this_nativeId,
+ int i0,
+ int n1,
+ QPoint t2)
+{
+    QPolygon *__qt_this = (QPolygon *) __this_nativeId;
+    __qt_this->insert((int )i0, (int )n1, (const QPoint&amp; )t2);
+
+}
+    </inject-code>
+    
+    <inject-code>
+        <import-file name="typesystem_gui-java.java" quote-after-line="class QPolygon___" quote-before-line="}// class"/>
+    </inject-code>
 <!-- qtd2
         <inject-code class="native">
       extern "C" JNIEXPORT void JNICALL QTJAMBI_FUNCTION_PREFIX(Java_com_trolltech_qt_gui_QPolygon_add_1private)
@@ -1102,6 +1144,48 @@
       }
         </inject-code>
 		-->
+    <inject-code class="java">
+    public final void insert(int i, QPointF t) {
+        qtd_QPolygonF_insert_int_QPointF(nativeId, i, t);
+    }
+
+    public final void insert(int i, int n, QPointF t) {
+        qtd_QPolygonF_insert_int_int_QPointF(nativeId, i, n, t);
+    }
+    </inject-code>
+    <inject-code class="java-free">
+private extern(C) void  qtd_QPolygonF_insert_int_QPointF(void* __this_nativeId,
+ int i0,
+ QPointF t1);
+private extern(C) void  qtd_QPolygonF_insert_int_int_QPointF(void* __this_nativeId,
+ int i0,
+ int n1,
+ QPointF t2);
+    </inject-code>
+    <inject-code class="native">
+// QPolygonF::insert(int i, const QPointF &amp; t)
+extern "C" DLL_PUBLIC void qtd_QPolygonF_insert_int_QPointF
+(void* __this_nativeId,
+ int i0,
+ QPointF t1)
+{
+    QPolygonF *__qt_this = (QPolygonF *) __this_nativeId;
+    __qt_this->insert((int )i0, (const QPointF&amp; )t1);
+
+}
+
+// QPolygonF::insert(int i, int n, const QPointF &amp; t)
+extern "C" DLL_PUBLIC void qtd_QPolygonF_insert_int_int_QPointF
+(void* __this_nativeId,
+ int i0,
+ int n1,
+ QPointF t2)
+{
+    QPolygonF *__qt_this = (QPolygonF *) __this_nativeId;
+    __qt_this->insert((int )i0, (int )n1, (const QPointF&amp; )t2);
+
+}
+    </inject-code>
     </value-type>
 
   <value-type name="QIcon" delete-in-main-thread="yes">