From 7ca670edb21bc9755045bacb775c95c4a755c706 Mon Sep 17 00:00:00 2001 From: albert-github Date: Thu, 8 Oct 2020 17:36:00 +0200 Subject: Optimization for Slice missing in doxywizard Wizard-Mode page The Optimization for Slice was missing in the doxywizard "Wizard-Mode" page. --- addon/doxywizard/wizard.cpp | 87 ++++++++++++++++++++++++++++----------------- 1 file changed, 54 insertions(+), 33 deletions(-) diff --git a/addon/doxywizard/wizard.cpp b/addon/doxywizard/wizard.cpp index c3c1b57..90fe15b 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") @@ -74,7 +75,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 @@ -82,23 +83,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 }; //========================================================================== @@ -107,7 +111,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&model,const QString &name) @@ -115,7 +119,7 @@ static bool getBoolOption( Input *option = model[name]; Q_ASSERT(option!=0); return stringVariantToBool(option->value()); -} +} static int getIntOption( const QHash&model,const QString &name) @@ -123,7 +127,7 @@ static int getIntOption( Input *option = model[name]; Q_ASSERT(option!=0); return option->value().toInt(); -} +} static QString getStringOption( const QHash&model,const QString &name) @@ -343,19 +347,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))); @@ -372,7 +376,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); @@ -382,14 +386,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())); } @@ -530,7 +534,7 @@ Step1::Step1(Wizard *wizard,const QHash &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); @@ -602,7 +606,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(");")); } @@ -711,7 +715,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(");")); } @@ -745,7 +749,7 @@ void Step1::init() //========================================================================== -Step2::Step2(Wizard *wizard,const QHash &modelData) +Step2::Step2(Wizard *wizard,const QHash &modelData) : m_wizard(wizard), m_modelData(modelData) { QRadioButton *r; @@ -770,7 +774,7 @@ Step2::Step2(Wizard *wizard,const QHash &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 ); @@ -779,8 +783,8 @@ Step2::Step2(Wizard *wizard,const QHash &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); @@ -791,6 +795,7 @@ Step2::Step2(Wizard *wizard,const QHash &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); @@ -801,6 +806,7 @@ Step2::Step2(Wizard *wizard,const QHash &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 @@ -809,6 +815,7 @@ Step2::Step2(Wizard *wizard,const QHash &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); @@ -818,6 +825,7 @@ Step2::Step2(Wizard *wizard,const QHash &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); @@ -827,6 +835,7 @@ Step2::Step2(Wizard *wizard,const QHash &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); @@ -836,7 +845,18 @@ Step2::Step2(Wizard *wizard,const QHash &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); @@ -852,7 +872,7 @@ Step2::Step2(Wizard *wizard,const QHash &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], @@ -882,12 +902,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 &modelData) +Step3::Step3(Wizard *wizard,const QHash &modelData) : m_wizard(wizard), m_modelData(modelData) { QVBoxLayout *vbox = 0; @@ -1093,7 +1114,7 @@ void Step3::init() //========================================================================== -Step4::Step4(Wizard *wizard,const QHash &modelData) +Step4::Step4(Wizard *wizard,const QHash &modelData) : m_wizard(wizard), m_modelData(modelData) { m_diagramModeGroup = new QButtonGroup(this); @@ -1250,7 +1271,7 @@ void Step4::init() //========================================================================== -Wizard::Wizard(const QHash &modelData, QWidget *parent) : +Wizard::Wizard(const QHash &modelData, QWidget *parent) : QSplitter(parent), m_modelData(modelData) { m_treeWidget = new QTreeWidget; @@ -1303,7 +1324,7 @@ void Wizard::activateTopic(QTreeWidgetItem *item,QTreeWidgetItem *) { if (item) { - + QString label = item->text(0); if (label==tr("Project")) { -- cgit v0.12