changeset 148:ae34188ddd84

private signals of QAbstractItemModel are now accessible
author eldar
date Sat, 13 Jun 2009 14:05:32 +0000
parents 4b423949c893
children 7bc921c7100a
files Makefile changelog.txt examples/layouts/dynamiclayouts/build.sh generator/abstractmetabuilder.cpp generator/cppimplgenerator.cpp generator/generator.cpp generator/typesystem.cpp generator/typesystem.h generator/typesystem_core.xml
diffstat 9 files changed, 47 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/Makefile	Fri Jun 12 22:21:33 2009 +0000
+++ b/Makefile	Sat Jun 13 14:05:32 2009 +0000
@@ -27,7 +27,7 @@
 ## Main settings.
 ## D compiler.
 ifndef $(DC)
-DC = ldmd
+DC = dmd
 endif
 ## C++ compiler.
 ifndef $(CC)
--- a/changelog.txt	Fri Jun 12 22:21:33 2009 +0000
+++ b/changelog.txt	Sat Jun 13 14:05:32 2009 +0000
@@ -9,4 +9,9 @@
  * building system is now based on CMake to be crossplatform and more flexible
  * all classes from Gui, OpenGL, Xml, Svg, Network and Webkit packages are wrapped
  * ported duic, the tool for generating code out from xml representation
- * ported drcc, the resources compiler
\ No newline at end of file
+ * ported drcc, the resources compiler
+ 
+ changes since 0.2
+
+ * new CMake module for D
+ * support for MSVC
\ No newline at end of file
--- a/examples/layouts/dynamiclayouts/build.sh	Fri Jun 12 22:21:33 2009 +0000
+++ b/examples/layouts/dynamiclayouts/build.sh	Sat Jun 13 14:05:32 2009 +0000
@@ -1,3 +1,4 @@
 #! /bin/bash
 
-dmd main.d dialog.d -I../../../ -I../../../qt/d1 -L-L../../../lib -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui -ofdynamiclayouts
\ No newline at end of file
+ldmd main.d dialog.d -I../../../ -I../../../qt/d1 -L-L../../../lib -L-lqtdgui -L-lqtdcore -L-lQtCore -L-lQtGui -ofdynamiclayouts
+
--- a/generator/abstractmetabuilder.cpp	Fri Jun 12 22:21:33 2009 +0000
+++ b/generator/abstractmetabuilder.cpp	Sat Jun 13 14:05:32 2009 +0000
@@ -1246,6 +1246,14 @@
         AbstractMetaFunction *meta_function = traverseFunction(function);
 
         if (meta_function) {
+
+            QList<FunctionModification> mods = meta_function->modifications(meta_class);
+            for (int i=0; i<mods.size(); ++i) {
+                if (mods.at(i).isPrivateSignal()) {
+                    meta_function->setFunctionType(AbstractMetaFunction::SignalFunction);
+                }
+            }
+
             meta_function->setOriginalAttributes(meta_function->attributes());
             if (meta_class->isNamespace())
                 *meta_function += AbstractMetaAttributes::Static;
--- a/generator/cppimplgenerator.cpp	Fri Jun 12 22:21:33 2009 +0000
+++ b/generator/cppimplgenerator.cpp	Sat Jun 13 14:05:32 2009 +0000
@@ -747,8 +747,7 @@
                 s << "typedef " << return_type << " " << "(*pf" << f_name << ")";
                 writeVirtualDispatchArguments(s, function, false);
                 s << ";" << endl
-                  << "pf" << function->marshalledName() << "_dispatch "
-                  << function->marshalledName() << "_dispatch;";
+                  << "pf" << f_name << " " << f_name << ";";
             }
 
             s << endl;
--- a/generator/generator.cpp	Fri Jun 12 22:21:33 2009 +0000
+++ b/generator/generator.cpp	Sat Jun 13 14:05:32 2009 +0000
@@ -207,7 +207,7 @@
             if (!f->isSignal()
                 || cls != f->implementingClass()
                 || notWrappedYet(f)
-                || f->isPrivate()
+// qtd2                || f->isPrivate() // we want private signals to be accessible as well
                 || f->isModifiedRemoved(TypeSystem::TargetLangCode))
                 continue;
 
--- a/generator/typesystem.cpp	Fri Jun 12 22:21:33 2009 +0000
+++ b/generator/typesystem.cpp	Sat Jun 13 14:05:32 2009 +0000
@@ -107,6 +107,7 @@
         Removal                  = 0x020000,
         Rename                   = 0x040000,
         ModifyArgument           = 0x080000,
+        PrivateSignal            = 0x100000,
         FunctionModifiers        = 0xff0000,
         StoreResult              = 0x110000,
 
@@ -752,6 +753,8 @@
             attributes["deprecated"] = QString("no");
             attributes["associated-to"] = QString();
             attributes["virtual-slot"] = QString("no");
+            attributes["allow-as-slot"] = QString("no");
+            attributes["private-signal"] = QString("no");
             break;
         case StackElement::ModifyArgument:
             attributes["index"] = QString();
@@ -1237,6 +1240,8 @@
                     mod.association = association;
 
                 mod.modifiers |= (convertBoolean(attributes["virtual-slot"], "virtual-slot", false) ? Modification::VirtualSlot : 0);
+                mod.modifiers |= (convertBoolean(attributes["allow-as-slot"], "allow-as-slot", false) ? Modification::AllowAsSlot : 0);
+                mod.modifiers |= (convertBoolean(attributes["private-signal"], "private-signal", false) ? Modification::PrivateSignal : 0);
 
                 m_function_mods << mod;
             }
--- a/generator/typesystem.h	Fri Jun 12 22:21:33 2009 +0000
+++ b/generator/typesystem.h	Sat Jun 13 14:05:32 2009 +0000
@@ -329,7 +329,10 @@
         Rename =                0x2000,
         Deprecated =            0x4000,
         ReplaceExpression =     0x8000,
-        VirtualSlot =          0x10000 | NonFinal
+        VirtualSlot =          0x10000 | NonFinal,
+        AllowAsSlot =           0x00020000,
+        PrivateSignal =         0x00040000
+
     };
 
     Modification() : modifiers(0) { }
@@ -343,6 +346,8 @@
     bool isFinal() const { return modifiers & Final; }
     bool isNonFinal() const { return modifiers & NonFinal; }
     bool isVirtualSlot() const { return (modifiers & VirtualSlot) == VirtualSlot; }
+    bool isAllowedAsSlot() const { return (modifiers & AllowAsSlot) == AllowAsSlot; }
+    bool isPrivateSignal() const { return (modifiers & PrivateSignal) == PrivateSignal; }
     QString accessModifierString() const;
 
     bool isDeprecated() const { return modifiers & Deprecated; }
--- a/generator/typesystem_core.xml	Fri Jun 12 22:21:33 2009 +0000
+++ b/generator/typesystem_core.xml	Sat Jun 13 14:05:32 2009 +0000
@@ -1077,6 +1077,21 @@
   <object-type name="QDirIterator"/>
   <object-type name="QAbstractFileEngineIterator"/>
   <object-type name="QAbstractItemModel">
+    <modify-function signature="rowsAboutToBeInserted(QModelIndex,int,int)" private-signal="yes"/>
+    <modify-function signature="rowsInserted(QModelIndex,int,int)" private-signal="yes"/>
+
+    <modify-function signature="rowsAboutToBeRemoved(QModelIndex,int,int)" private-signal="yes"/>
+    <modify-function signature="rowsRemoved(QModelIndex,int,int)" private-signal="yes"/>
+
+    <modify-function signature="columnsAboutToBeInserted(QModelIndex,int,int)" private-signal="yes"/>
+    <modify-function signature="columnsInserted(QModelIndex,int,int)" private-signal="yes"/>
+
+    <modify-function signature="columnsAboutToBeRemoved(QModelIndex,int,int)" private-signal="yes"/>
+    <modify-function signature="columnsRemoved(QModelIndex,int,int)" private-signal="yes"/>
+
+    <modify-function signature="modelAboutToBeReset()" private-signal="yes"/>
+    <modify-function signature="modelReset()" private-signal="yes"/>
+    
         <modify-function signature="parent()const" remove="java"/>
         <extra-includes>
             <include file-name="QStringList" location="global"/>
@@ -1116,12 +1131,12 @@
         return qtjambi_from_qvariant(__jni_env, __qt_this-&gt;data(index, role));
     }
         </inject-code>
--->
+
         <modify-function signature="mimeData(QList&lt;QModelIndex&gt;)const">
             <modify-argument index="0">
                 <define-ownership class="shell" owner="c++"/>
             </modify-argument>
-        </modify-function>
+        </modify-function>-->
     </object-type>
 
   <object-type name="QAbstractListModel">