Mercurial > projects > qtd
comparison generator/dgenerator.cpp @ 361:beaf4a2974d7
Autogeneration of QMetaType. First attempts at fixing qRegisterMetaType etc
author | Max Samukha <maxter@maxter.com> |
---|---|
date | Wed, 09 Jun 2010 11:08:56 +0300 |
parents | a3f5c10414f3 |
children | 3b0545d4d479 |
comparison
equal
deleted
inserted
replaced
360:49d0a43433e7 | 361:beaf4a2974d7 |
---|---|
1724 } | 1724 } |
1725 } | 1725 } |
1726 | 1726 |
1727 void DGenerator::writeFlagsSetter(QTextStream &s, const AbstractMetaClass *d_class) | 1727 void DGenerator::writeFlagsSetter(QTextStream &s, const AbstractMetaClass *d_class) |
1728 { | 1728 { |
1729 if (d_class->isInterface() || d_class->isNamespace()) | 1729 if (d_class->isInterface()) |
1730 s << INDENT << "void __setFlags(QtdObjectFlags flags, bool val);"; | 1730 s << INDENT << "void __setFlags(QtdObjectFlags flags, bool val);"; |
1731 else // COMPILER BUG: | 1731 else if (!d_class->isNamespace()) // COMPILER BUG: |
1732 s << INDENT << "void __setFlags(QtdObjectFlags flags, bool val) { super.__setFlags(flags, val); }"; | 1732 s << INDENT << "void __setFlags(QtdObjectFlags flags, bool val) { super.__setFlags(flags, val); }"; |
1733 } | 1733 } |
1734 | 1734 |
1735 void DGenerator::writeSignalHandlers(QTextStream &s, const AbstractMetaClass *d_class) | 1735 void DGenerator::writeSignalHandlers(QTextStream &s, const AbstractMetaClass *d_class) |
1736 { | 1736 { |
1842 QString auxModName = d_class->package() + "." + d_class->name() + "_aux"; | 1842 QString auxModName = d_class->package() + "." + d_class->name() + "_aux"; |
1843 FileOut auxFile(outputDirectory() + "/" + subDirectoryForClass(d_class) + "/" + d_class->name() + "_aux.d"); | 1843 FileOut auxFile(outputDirectory() + "/" + subDirectoryForClass(d_class) + "/" + d_class->name() + "_aux.d"); |
1844 auxFile.isDone = true; | 1844 auxFile.isDone = true; |
1845 auxFile.stream << "module " << auxModName << ";" << endl << endl; | 1845 auxFile.stream << "module " << auxModName << ";" << endl << endl; |
1846 | 1846 |
1847 bool staticInit = d_class->isQObject() || d_class->typeEntry()->isValue() || (cpp_shared && d_class->generateShellClass() && !d_class->isInterface()); | 1847 bool staticInit = d_class->isQObject() || d_class->typeEntry()->isValue() |
1848 || (cpp_shared && d_class->generateShellClass() && !d_class->isInterface() && !d_class->isNamespace()); | |
1848 if (staticInit) | 1849 if (staticInit) |
1849 { | 1850 { |
1850 auxFile.isDone = false; | 1851 auxFile.isDone = false; |
1851 auxFile.stream << "extern(C) void static_init_" << d_class->name() << "();" << endl; | 1852 auxFile.stream << "extern(C) void static_init_" << d_class->name() << "();" << endl; |
1852 auxFile.stream << "shared static this() { static_init_" << d_class->name() << "; }" << endl << endl; | 1853 auxFile.stream << "shared static this() { static_init_" << d_class->name() << "; }" << endl << endl; |