[Uml-devel] KDE/kdesdk/umbrello/umbrello
Jonathan Riddell
jr at jriddell.org
Sun Jun 3 12:43:56 UTC 2007
SVN commit 670997 by jriddell:
Add code generator for D from
Jari-Matti Mäkelä <jmjm at iki.fi>
M +13 -0 CMakeLists.txt
M +1 -1 attribute.cpp
M +46 -0 codegenerators/codegenfactory.cpp
A codegenerators/dclassdeclarationblock.cpp [License: GPL (v2+)]
A codegenerators/dclassdeclarationblock.h [License: GPL (v2+)]
A codegenerators/dclassifiercodedocument.cpp [License: GPL (v2+)]
A codegenerators/dclassifiercodedocument.h [License: GPL (v2+)]
A codegenerators/dcodeaccessormethod.cpp [License: GPL (v2+)]
A codegenerators/dcodeaccessormethod.h [License: GPL (v2+)]
A codegenerators/dcodeclassfield.cpp [License: GPL (v2+)]
A codegenerators/dcodeclassfield.h [License: GPL (v2+)]
A codegenerators/dcodeclassfielddeclarationblock.cpp [License: GPL (v2+)]
A codegenerators/dcodeclassfielddeclarationblock.h [License: GPL (v2+)]
A codegenerators/dcodecomment.cpp [License: GPL (v2+)]
A codegenerators/dcodecomment.h [License: GPL (v2+)]
A codegenerators/dcodedocumentation.cpp [License: GPL (v2+)]
A codegenerators/dcodedocumentation.h [License: GPL (v2+)]
A codegenerators/dcodegenerationformbase.ui
A codegenerators/dcodegenerationpolicy.cpp [License: GPL (v2+)]
A codegenerators/dcodegenerationpolicy.h [License: GPL (v2+)]
A codegenerators/dcodegenerationpolicypage.cpp [License: GPL (v2+)]
A codegenerators/dcodegenerationpolicypage.h [License: GPL (v2+)]
A codegenerators/dcodegenerator.cpp [License: GPL (v2+)]
A codegenerators/dcodegenerator.h [License: GPL (v2+)]
A codegenerators/dcodeoperation.cpp [License: GPL (v2+)]
A codegenerators/dcodeoperation.h [License: GPL (v2+)]
A codegenerators/dwriter.cpp [License: GPL (v2+)]
A codegenerators/dwriter.h [License: GPL (v2+)]
M +1 -1 headings/CMakeLists.txt
A headings/heading.d
M +4 -0 model_utils.cpp
M +1 -0 umbrelloui.rc
M +5 -0 uml.cpp
M +1 -0 uml.h
M +1 -0 umlnamespace.h
--- trunk/KDE/kdesdk/umbrello/umbrello/CMakeLists.txt #670996:670997
@@ -49,6 +49,17 @@
codegenerators/cppcodegenerationpolicy.cpp
codegenerators/cppcodegenerationpolicypage.cpp
codegenerators/cppcodegenerationform.cpp
+ codegenerators/dcodegenerator.cpp
+ codegenerators/dcodedocumentation.cpp
+ codegenerators/dcodeclassfield.cpp
+ codegenerators/dcodecomment.cpp
+ codegenerators/dclassdeclarationblock.cpp
+ codegenerators/dclassifiercodedocument.cpp
+ codegenerators/dcodeoperation.cpp
+ codegenerators/dcodeaccessormethod.cpp
+ codegenerators/dcodeclassfielddeclarationblock.cpp
+ codegenerators/dcodegenerationpolicy.cpp
+ codegenerators/dcodegenerationpolicypage.cpp
codegenerators/rubycodegenerator.cpp
codegenerators/rubycodeclassfield.cpp
codegenerators/rubyclassifiercodedocument.cpp
@@ -65,6 +76,7 @@
codegenerators/aswriter.cpp
codegenerators/cppwriter.cpp
codegenerators/csharpwriter.cpp
+ codegenerators/dwriter.cpp
codegenerators/javawriter.cpp
codegenerators/jswriter.cpp
codegenerators/idlwriter.cpp
@@ -88,6 +100,7 @@
)
kde4_add_ui_files( libcodegenerator_SRCS
+ ${CMAKE_CURRENT_SOURCE_DIR}/codegenerators/dcodegenerationformbase.ui
${CMAKE_CURRENT_SOURCE_DIR}/codegenerators/javacodegenerationformbase.ui
)
--- trunk/KDE/kdesdk/umbrello/umbrello/attribute.cpp #670996:670997
@@ -300,7 +300,7 @@
QString type = getType()->getName();
QString templateParam;
//template and generic only in C++ and Java ?
- if (UMLApp::app()->getActiveLanguage() == Uml::pl_Cpp || UMLApp::app()->getActiveLanguage() == Uml::pl_Java) {
+ if (UMLApp::app()->getActiveLanguage() == Uml::pl_Cpp || UMLApp::app()->getActiveLanguage() == Uml::pl_Java || UMLApp::app()->getActiveLanguage() == Uml::pl_D) {
int start = type.find(QChar('<'));
if (start >= 0 ) {
int end = type.findRev(QChar('>'));
--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerators/codegenfactory.cpp #670996:670997
@@ -34,6 +34,7 @@
#include "adawriter.h"
#include "cppwriter.h"
#include "csharpwriter.h"
+#include "dwriter.h"
#include "idlwriter.h"
#include "javawriter.h"
#include "pascalwriter.h"
@@ -50,40 +51,48 @@
// the new
#include "cppcodegenerator.h"
+#include "dcodegenerator.h"
#include "javacodegenerator.h"
#include "rubycodegenerator.h"
#include "cppheadercodedocument.h"
#include "cppsourcecodedocument.h"
+#include "dclassifiercodedocument.h"
#include "javaclassifiercodedocument.h"
#include "rubyclassifiercodedocument.h"
#include "javaantcodedocument.h"
#include "cppheadercodeoperation.h"
#include "cppsourcecodeoperation.h"
+#include "dcodeoperation.h"
#include "javacodeoperation.h"
#include "rubycodeoperation.h"
#include "cppcodeclassfield.h"
+#include "dcodeclassfield.h"
#include "javacodeclassfield.h"
#include "rubycodeclassfield.h"
#include "cppheadercodeaccessormethod.h"
#include "cppsourcecodeaccessormethod.h"
+#include "dcodeaccessormethod.h"
#include "javacodeaccessormethod.h"
#include "rubycodeaccessormethod.h"
#include "cppheadercodeclassfielddeclarationblock.h"
#include "cppsourcecodeclassfielddeclarationblock.h"
+#include "dcodeclassfielddeclarationblock.h"
#include "javacodeclassfielddeclarationblock.h"
#include "rubycodeclassfielddeclarationblock.h"
#include "cppcodedocumentation.h"
+#include "dcodecomment.h"
#include "javacodecomment.h"
#include "rubycodecomment.h"
#include "xmlcodecomment.h"
#include "cppcodegenerationpolicy.h"
+#include "dcodegenerationpolicy.h"
#include "javacodegenerationpolicy.h"
#include "rubycodegenerationpolicy.h"
@@ -116,6 +125,16 @@
case Uml::pl_CSharp:
obj = new CSharpWriter();
break;
+ case Uml::pl_D:
+ if (optionState.generalState.newcodegen) {
+ obj = new DCodeGenerator();
+ obj->connect_newcodegen_slots();
+ DCodeGenerationPolicy *p =
+ new DCodeGenerationPolicy(UMLApp::app()->getConfig());
+ UMLApp::app()->setPolicyExt(p);
+ } else
+ obj = new DWriter();
+ break;
case Uml::pl_IDL:
obj = new IDLWriter();
break;
@@ -186,6 +205,9 @@
case Uml::pl_Cpp:
retval = new CPPSourceCodeDocument(c);
break;
+ case Uml::pl_D:
+ retval = new DClassifierCodeDocument(c);
+ break;
case Uml::pl_Java:
retval = new JavaClassifierCodeDocument(c);
break;
@@ -213,6 +235,9 @@
return new CPPSourceCodeOperation(scd, op);
}
break;
+ case Uml::pl_D:
+ retval = new DCodeOperation(dynamic_cast<DClassifierCodeDocument*>(ccd), op);
+ break;
case Uml::pl_Java:
retval = new JavaCodeOperation(dynamic_cast<JavaClassifierCodeDocument*>(ccd), op);
break;
@@ -232,6 +257,9 @@
case Uml::pl_Cpp:
retval = new CPPCodeClassField(ccd, at);
break;
+ case Uml::pl_D:
+ retval = new DCodeClassField(ccd, at);
+ break;
case Uml::pl_Java:
retval = new JavaCodeClassField(ccd, at);
break;
@@ -251,6 +279,9 @@
case Uml::pl_Cpp:
retval = new CPPCodeClassField(ccd, role);
break;
+ case Uml::pl_D:
+ retval = new DCodeClassField(ccd, role);
+ break;
case Uml::pl_Java:
retval = new JavaCodeClassField(ccd, role);
break;
@@ -282,6 +313,14 @@
}
}
break;
+ case Uml::pl_D:
+ {
+ DCodeAccessorMethod *jcam = new DCodeAccessorMethod(cf, type);
+ jcam->update();
+ retval = jcam;
+ retval->setOverallIndentationLevel(1);
+ }
+ break;
case Uml::pl_Java:
{
JavaCodeAccessorMethod *jcam = new JavaCodeAccessorMethod(cf, type);
@@ -318,6 +357,9 @@
return new CPPSourceCodeClassFieldDeclarationBlock(cf);
}
break;
+ case Uml::pl_D:
+ retval = new DCodeClassFieldDeclarationBlock(cf);
+ break;
case Uml::pl_Java:
retval = new JavaCodeClassFieldDeclarationBlock(cf);
break;
@@ -337,6 +379,10 @@
dynamic_cast<CPPSourceCodeDocument*>(cd))
return new CPPCodeDocumentation(cd);
break;
+ case Uml::pl_D:
+ if (dynamic_cast<DClassifierCodeDocument*>(cd))
+ return new DCodeComment(cd);
+ break;
case Uml::pl_Java:
if (dynamic_cast<JavaClassifierCodeDocument*>(cd))
return new JavaCodeComment(cd);
--- trunk/KDE/kdesdk/umbrello/umbrello/headings/CMakeLists.txt #670996:670997
@@ -1 +1 @@
-install( FILES heading.adb heading.ads heading.as heading.cpp heading.cs heading.h heading.idl heading.java heading.js heading.php heading.pm heading.py heading.rb heading.sql heading.xsd DESTINATION ${DATA_INSTALL_DIR}/umbrello/headings )
+install( FILES heading.adb heading.ads heading.as heading.cpp heading.cs heading.d heading.h heading.idl heading.java heading.js heading.php heading.pm heading.py heading.rb heading.sql heading.xsd DESTINATION ${DATA_INSTALL_DIR}/umbrello/headings )
--- trunk/KDE/kdesdk/umbrello/umbrello/model_utils.cpp #670996:670997
@@ -572,6 +572,8 @@
return "C++";
case Uml::pl_CSharp:
return "C#";
+ case Uml::pl_D:
+ return "D";
case Uml::pl_IDL:
return "IDL";
case Uml::pl_Java:
@@ -611,6 +613,8 @@
return Uml::pl_Cpp;
if (str == "C#")
return Uml::pl_CSharp;
+ if (str == "D")
+ return Uml::pl_D;
if (str == "IDL")
return Uml::pl_IDL;
if (str == "Java")
--- trunk/KDE/kdesdk/umbrello/umbrello/umbrelloui.rc #670996:670997
@@ -49,6 +49,7 @@
<Action name="set_lang_ada"/>
<Action name="set_lang_cpp"/>
<Action name="set_lang_csharp"/>
+ <Action name="set_lang_d"/>
<Action name="set_lang_idl"/>
<Action name="set_lang_java"/>
<Action name="set_lang_javascript"/>
--- trunk/KDE/kdesdk/umbrello/umbrello/uml.cpp #670996:670997
@@ -247,6 +247,7 @@
setProgLangAction(Uml::pl_Ada, "Ada", "set_lang_ada");
setProgLangAction(Uml::pl_Cpp, "C++", "set_lang_cpp");
setProgLangAction(Uml::pl_CSharp, "C#", "set_lang_csharp");
+ setProgLangAction(Uml::pl_D, "D", "set_lang_d");
setProgLangAction(Uml::pl_IDL, "IDL", "set_lang_idl");
setProgLangAction(Uml::pl_Java, "Java", "set_lang_java");
setProgLangAction(Uml::pl_JavaScript, "JavaScript", "set_lang_javascript");
@@ -1386,6 +1387,10 @@
setProgLangMenu(Uml::pl_CSharp);
}
+void UMLApp::set_lang_d() {
+ setProgLangMenu(Uml::pl_D);
+}
+
void UMLApp::set_lang_idl() {
setProgLangMenu(Uml::pl_IDL);
}
--- trunk/KDE/kdesdk/umbrello/umbrello/uml.h #670996:670997
@@ -638,6 +638,7 @@
void set_lang_ada();
void set_lang_cpp();
void set_lang_csharp();
+ void set_lang_d();
void set_lang_idl();
void set_lang_java();
void set_lang_javascript();
--- trunk/KDE/kdesdk/umbrello/umbrello/umlnamespace.h #670996:670997
@@ -319,6 +319,7 @@
pl_Ada,
pl_Cpp,
pl_CSharp,
+ pl_D,
pl_IDL,
pl_Java,
pl_JavaScript,
More information about the umbrello-devel
mailing list