diff options
-rw-r--r-- | addon/doxywizard/wizard.cpp | 87 |
1 files changed, 54 insertions, 33 deletions
diff --git a/addon/doxywizard/wizard.cpp b/addon/doxywizard/wizard.cpp index aa98d02..c2ecc2e 100644 --- a/addon/doxywizard/wizard.cpp +++ b/addon/doxywizard/wizard.cpp @@ -3,8 +3,8 @@ * Copyright (C) 1997-2019 by Dimitri van Heesch. * * Permission to use, copy, modify, and distribute this software and its - * documentation under the terms of the GNU General Public License is hereby - * granted. No representations are made about the suitability of this software + * documentation under the terms of the GNU General Public License is hereby + * granted. No representations are made about the suitability of this software * for any purpose. It is provided "as is" without express or implied warranty. * See the GNU General Public License for more details. * @@ -47,6 +47,7 @@ #define STR_OPTIMIZE_OUTPUT_JAVA QString::fromLatin1("OPTIMIZE_OUTPUT_JAVA") #define STR_OPTIMIZE_FOR_FORTRAN QString::fromLatin1("OPTIMIZE_FOR_FORTRAN") #define STR_OPTIMIZE_OUTPUT_VHDL QString::fromLatin1("OPTIMIZE_OUTPUT_VHDL") +#define STR_OPTIMIZE_OUTPUT_SLICE QString::fromLatin1("OPTIMIZE_OUTPUT_SLICE") #define STR_CPP_CLI_SUPPORT QString::fromLatin1("CPP_CLI_SUPPORT") #define STR_HIDE_SCOPE_NAMES QString::fromLatin1("HIDE_SCOPE_NAMES") #define STR_EXTRACT_ALL QString::fromLatin1("EXTRACT_ALL") @@ -75,7 +76,7 @@ #define STR_HTML_COLORSTYLE_SAT QString::fromLatin1("HTML_COLORSTYLE_SAT") #define STR_HTML_COLORSTYLE_GAMMA QString::fromLatin1("HTML_COLORSTYLE_GAMMA") -static bool g_optimizeMapping[6][6] = +static bool g_optimizeMapping[7][7] = { // A: OPTIMIZE_OUTPUT_FOR_C // B: OPTIMIZE_OUTPUT_JAVA @@ -83,23 +84,26 @@ static bool g_optimizeMapping[6][6] = // D: OPTIMIZE_OUTPUT_VHDL // E: CPP_CLI_SUPPORT // F: HIDE_SCOPE_NAMES - // A B C D E F - { false,false,false,false,false,false }, // 0: C++ - { false,false,false,false,true, false }, // 1: C++/CLI - { false,true, false,false,false,false }, // 2: C#/Java - { true, false,false,false,false,true }, // 3: C/PHP - { false,false,true, false,false,false }, // 4: Fortran - { false,false,false,true, false,false }, // 5: VHDL + // G: OPTIMIZE_OUTPUT_SLICE + // A B C D E F G + { false,false,false,false,false,false,false }, // 0: C++ + { false,false,false,false,true, false,false }, // 1: C++/CLI + { false,true, false,false,false,false,false }, // 2: C#/Java + { true, false,false,false,false,true, false }, // 3: C/PHP + { false,false,true, false,false,false,false }, // 4: Fortran + { false,false,false,true, false,false,false }, // 5: VHDL + { false,false,false,false,false,false,true }, // 6: SLICE }; -static QString g_optimizeOptionNames[6] = +static QString g_optimizeOptionNames[7] = { STR_OPTIMIZE_OUTPUT_FOR_C, STR_OPTIMIZE_OUTPUT_JAVA, STR_OPTIMIZE_FOR_FORTRAN, STR_OPTIMIZE_OUTPUT_VHDL, STR_CPP_CLI_SUPPORT, - STR_HIDE_SCOPE_NAMES + STR_HIDE_SCOPE_NAMES, + STR_OPTIMIZE_OUTPUT_SLICE }; //========================================================================== @@ -108,7 +112,7 @@ static bool stringVariantToBool(const QVariant &v) { QString s = v.toString().toLower(); return s==QString::fromLatin1("yes") || s==QString::fromLatin1("true") || s==QString::fromLatin1("1"); -} +} static bool getBoolOption( const QHash<QString,Input*>&model,const QString &name) @@ -116,7 +120,7 @@ static bool getBoolOption( Input *option = model[name]; Q_ASSERT(option!=0); return stringVariantToBool(option->value()); -} +} static int getIntOption( const QHash<QString,Input*>&model,const QString &name) @@ -124,7 +128,7 @@ static int getIntOption( Input *option = model[name]; Q_ASSERT(option!=0); return option->value().toInt(); -} +} static QString getStringOption( const QHash<QString,Input*>&model,const QString &name) @@ -344,19 +348,19 @@ void ColorPicker::paintEvent(QPaintEvent*) QRect r(0, foff, w, height() - 2*foff); int wi = r.width() - 2; int hi = r.height() - 2; - if (!m_pix || m_pix->height() != hi || m_pix->width() != wi) + if (!m_pix || m_pix->height() != hi || m_pix->width() != wi) { delete m_pix; QImage img(wi, hi, QImage::Format_RGB32); int y; uint *pixel = (uint *) img.scanLine(0); - for (y = 0; y < hi; y++) + for (y = 0; y < hi; y++) { const uint *end = pixel + wi; int yh = y2hue(y+coff); int ys = y2sat(y+coff); int yg = y2gam(y+coff); - while (pixel < end) + while (pixel < end) { QColor c; c.setHsv(yh, ys, (int)(255*pow(0.7,yg/100.0))); @@ -373,7 +377,7 @@ void ColorPicker::paintEvent(QPaintEvent*) p.setPen(g.windowText().color()); p.setBrush(g.windowText()); QPolygon a; - int y = m_mode==Hue ? hue2y(m_hue) : + int y = m_mode==Hue ? hue2y(m_hue) : m_mode==Saturation ? sat2y(m_sat) : gam2y(m_gam); a.setPoints(3, w, y, w+5, y+5, w+5, y-5); @@ -383,14 +387,14 @@ void ColorPicker::paintEvent(QPaintEvent*) void ColorPicker::mouseMoveEvent(QMouseEvent *m) { - if (m_mode==Hue) setHue(y2hue(m->y())); + if (m_mode==Hue) setHue(y2hue(m->y())); else if (m_mode==Saturation) setSat(y2sat(m->y())); else setGam(y2gam(m->y())); } void ColorPicker::mousePressEvent(QMouseEvent *m) { - if (m_mode==Hue) setHue(y2hue(m->y())); + if (m_mode==Hue) setHue(y2hue(m->y())); else if (m_mode==Saturation) setSat(y2sat(m->y())); else setGam(y2gam(m->y())); } @@ -531,7 +535,7 @@ Step1::Step1(Wizard *wizard,const QHash<QString,Input*> &modelData) : m_wizard(w QFrame *f = new QFrame( this ); f->setFrameStyle( QFrame::HLine | QFrame::Sunken ); layout->addWidget(f); - + l = new QLabel(this); l->setText(tr("Specify the directory to scan for source code")); layout->addWidget(l); @@ -603,7 +607,7 @@ void Step1::selectProjectIcon() else { QFile Fout(iconName); - if(!Fout.exists()) + if(!Fout.exists()) { m_projIconLab->setText(tr("Sorry, cannot find file(")+iconName+QString::fromLatin1(");")); } @@ -712,7 +716,7 @@ void Step1::init() if (!iconName.isEmpty()) { QFile Fout(iconName); - if(!Fout.exists()) + if(!Fout.exists()) { m_projIconLab->setText(tr("Sorry, cannot find file(")+iconName+QString::fromLatin1(");")); } @@ -746,7 +750,7 @@ void Step1::init() //========================================================================== -Step2::Step2(Wizard *wizard,const QHash<QString,Input*> &modelData) +Step2::Step2(Wizard *wizard,const QHash<QString,Input*> &modelData) : m_wizard(wizard), m_modelData(modelData) { QRadioButton *r; @@ -771,7 +775,7 @@ Step2::Step2(Wizard *wizard,const QHash<QString,Input*> &modelData) // m_crossRef -> SOURCE_BROWSER = YES/NO gbox->addWidget(m_crossRef,3,0); layout->addWidget(m_extractMode); - + //--------------------------------------------------- QFrame *f = new QFrame( this ); f->setFrameStyle( QFrame::HLine | QFrame::Sunken ); @@ -780,8 +784,8 @@ Step2::Step2(Wizard *wizard,const QHash<QString,Input*> &modelData) m_optimizeLangGroup = new QButtonGroup(this); m_optimizeLang = new QGroupBox(this); m_optimizeLang->setTitle(tr("Select programming language to optimize the results for")); - gbox = new QGridLayout( m_optimizeLang ); - + gbox = new QGridLayout( m_optimizeLang ); + r = new QRadioButton(m_optimizeLang); r->setText(tr("Optimize for C++ output")); r->setChecked(true); @@ -792,6 +796,7 @@ Step2::Step2(Wizard *wizard,const QHash<QString,Input*> &modelData) // OPTIMIZE_OUTPUT_VHDL = NO // CPP_CLI_SUPPORT = NO // HIDE_SCOPE_NAMES = NO + // OPTIMIZE_OUTPUT_SLICE = NO gbox->addWidget(r,0,0); r = new QRadioButton(tr("Optimize for C++/CLI output")); gbox->addWidget(r,1,0); @@ -802,6 +807,7 @@ Step2::Step2(Wizard *wizard,const QHash<QString,Input*> &modelData) // OPTIMIZE_OUTPUT_VHDL = NO // CPP_CLI_SUPPORT = YES // HIDE_SCOPE_NAMES = NO + // OPTIMIZE_OUTPUT_SLICE = NO r = new QRadioButton(tr("Optimize for Java or C# output")); m_optimizeLangGroup->addButton(r, 2); // 2 -> OPTIMIZE_OUTPUT_FOR_C = NO @@ -810,6 +816,7 @@ Step2::Step2(Wizard *wizard,const QHash<QString,Input*> &modelData) // OPTIMIZE_OUTPUT_VHDL = NO // CPP_CLI_SUPPORT = NO // HIDE_SCOPE_NAMES = NO + // OPTIMIZE_OUTPUT_SLICE = NO gbox->addWidget(r,2,0); r = new QRadioButton(tr("Optimize for C or PHP output")); m_optimizeLangGroup->addButton(r, 3); @@ -819,6 +826,7 @@ Step2::Step2(Wizard *wizard,const QHash<QString,Input*> &modelData) // OPTIMIZE_OUTPUT_VHDL = NO // CPP_CLI_SUPPORT = NO // HIDE_SCOPE_NAMES = YES + // OPTIMIZE_OUTPUT_SLICE = NO gbox->addWidget(r,3,0); r = new QRadioButton(tr("Optimize for Fortran output")); m_optimizeLangGroup->addButton(r, 4); @@ -828,6 +836,7 @@ Step2::Step2(Wizard *wizard,const QHash<QString,Input*> &modelData) // OPTIMIZE_OUTPUT_VHDL = NO // CPP_CLI_SUPPORT = NO // HIDE_SCOPE_NAMES = NO + // OPTIMIZE_OUTPUT_SLICE = NO gbox->addWidget(r,4,0); r = new QRadioButton(tr("Optimize for VHDL output")); m_optimizeLangGroup->addButton(r, 5); @@ -837,7 +846,18 @@ Step2::Step2(Wizard *wizard,const QHash<QString,Input*> &modelData) // OPTIMIZE_OUTPUT_VHDL = YES // CPP_CLI_SUPPORT = NO // HIDE_SCOPE_NAMES = NO + // OPTIMIZE_OUTPUT_SLICE = NO gbox->addWidget(r,5,0); + r = new QRadioButton(tr("Optimize for SLICE output")); + m_optimizeLangGroup->addButton(r, 6); + // 5 -> OPTIMIZE_OUTPUT_FOR_C = NO + // OPTIMIZE_OUTPUT_JAVA = NO + // OPTIMIZE_FOR_FORTRAN = NO + // OPTIMIZE_OUTPUT_VHDL = NO + // CPP_CLI_SUPPORT = NO + // HIDE_SCOPE_NAMES = NO + // OPTIMIZE_OUTPUT_SLICE = YES + gbox->addWidget(r,6,0); layout->addWidget(m_optimizeLang); layout->addStretch(1); @@ -853,7 +873,7 @@ Step2::Step2(Wizard *wizard,const QHash<QString,Input*> &modelData) void Step2::optimizeFor(int choice) { - for (int i=0;i<6;i++) + for (int i=0;i<7;i++) { updateBoolOption(m_modelData, g_optimizeOptionNames[i], @@ -883,12 +903,13 @@ void Step2::init() else if (getBoolOption(m_modelData,STR_OPTIMIZE_OUTPUT_FOR_C)) x=3; else if (getBoolOption(m_modelData,STR_OPTIMIZE_FOR_FORTRAN)) x=4; else if (getBoolOption(m_modelData,STR_OPTIMIZE_OUTPUT_VHDL)) x=5; + else if (getBoolOption(m_modelData,STR_OPTIMIZE_OUTPUT_SLICE)) x=6; m_optimizeLangGroup->button(x)->setChecked(true); } //========================================================================== -Step3::Step3(Wizard *wizard,const QHash<QString,Input*> &modelData) +Step3::Step3(Wizard *wizard,const QHash<QString,Input*> &modelData) : m_wizard(wizard), m_modelData(modelData) { QVBoxLayout *vbox = 0; @@ -1104,7 +1125,7 @@ void Step3::init() //========================================================================== -Step4::Step4(Wizard *wizard,const QHash<QString,Input*> &modelData) +Step4::Step4(Wizard *wizard,const QHash<QString,Input*> &modelData) : m_wizard(wizard), m_modelData(modelData) { m_diagramModeGroup = new QButtonGroup(this); @@ -1261,7 +1282,7 @@ void Step4::init() //========================================================================== -Wizard::Wizard(const QHash<QString,Input*> &modelData, QWidget *parent) : +Wizard::Wizard(const QHash<QString,Input*> &modelData, QWidget *parent) : QSplitter(parent), m_modelData(modelData) { m_treeWidget = new QTreeWidget; @@ -1314,7 +1335,7 @@ void Wizard::activateTopic(QTreeWidgetItem *item,QTreeWidgetItem *) { if (item) { - + QString label = item->text(0); if (label==tr("Project")) { |