Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 23704 → Rev 23705

/trunk/Scribus/scribus/plugins/barcodegenerator/barcode.cpp
37,7 → 37,7
m_actionInfo.needsNumObjects = -1;
}
 
const QString Barcode::fullTrName() const
QString Barcode::fullTrName() const
{
return QObject::tr("Barcode Generator");
}
/trunk/Scribus/scribus/plugins/barcodegenerator/barcode.h
25,7 → 25,7
/*! \brief run the plug
\param target none usage here */
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/colorwheel/colorwheel.cpp
53,7 → 53,7
m_actionInfo.needsNumObjects = -1;
}
 
const QString ColorWheelPlugin::fullTrName() const
QString ColorWheelPlugin::fullTrName() const
{
return QObject::tr("Color Wheel");
}
/trunk/Scribus/scribus/plugins/colorwheel/colorwheel.h
28,7 → 28,7
ColorWheelPlugin();
virtual ~ColorWheelPlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/export/pixmapexport/export.cpp
69,7 → 69,7
m_actionInfo.needsNumObjects = -1;
}
 
const QString PixmapExportPlugin::fullTrName() const
QString PixmapExportPlugin::fullTrName() const
{
return tr("Export As Image");
}
/trunk/Scribus/scribus/plugins/export/pixmapexport/export.h
24,7 → 24,7
PixmapExportPlugin();
virtual ~PixmapExportPlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
102,7 → 102,7
m_actionInfo.needsNumObjects = -1;
}
 
const QString SVGExportPlugin::fullTrName() const
QString SVGExportPlugin::fullTrName() const
{
return QObject::tr("SVG Export");
}
/trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.h
43,7 → 43,7
\retval bool true
*/
bool run(ScribusDoc* doc=nullptr, const QString& filename = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
105,7 → 105,7
m_actionInfo.needsNumObjects = -1;
}
 
const QString XPSExportPlugin::fullTrName() const
QString XPSExportPlugin::fullTrName() const
{
return QObject::tr("XPS Export");
}
/trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.h
45,7 → 45,7
\retval bool true
*/
bool run(ScribusDoc* doc=nullptr, const QString& filename = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/fileloader/oldscribusformat/oldscribusformat.h
18,15 → 18,15
// Standard plugin implementation
OldScribusFormat();
virtual ~OldScribusFormat();
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
virtual bool fileSupported(QIODevice* file) const;
 
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
virtual bool saveFile(const QString & fileName, const FileFormat & fmt);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
// Special features - .sla page extraction support
bool loadPage(int pageNumber, bool Mpage);
/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
63,7 → 63,7
fmt->filter = fmt->trName + " (*.sla *.SLA *.sla.gz *.SLA.GZ *.scd *.SCD *.scd.gz *.SCD.GZ)";
}
 
const QString Scribus12Format::fullTrName() const
QString Scribus12Format::fullTrName() const
{
return QObject::tr("Scribus 1.2.x Support");
}
/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.h
29,24 → 29,24
// Standard plugin implementation
Scribus12Format();
virtual ~Scribus12Format();
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
//Not the same as readSLA. This one only reads max 4k of the file for speed.
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
 
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual bool saveFile(const QString & fileName, const FileFormat & fmt);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
bool saveFile(const QString & fileName, const FileFormat & fmt) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
// Special features - .sla page extraction support
virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, const QString& renamedPageName=QString());
virtual bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
virtual bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
virtual void getReplacedFontData(bool& getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces);
bool loadPage(const QString & fileName, int pageNumber, bool Mpage, const QString& renamedPageName=QString()) override;
bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles) override;
bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty) override;
bool readColors(const QString& fileName, ColorList & colors) override;
bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames) override;
void getReplacedFontData(bool& getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces) override;
 
private:
void registerFormats();
/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
72,7 → 72,7
fmt->filter = fmt->trName + " (*.sla *.SLA *.sla.gz *.SLA.GZ *.scd *.SCD *.scd.gz *.SCD.GZ)";
}
 
const QString Scribus134Format::fullTrName() const
QString Scribus134Format::fullTrName() const
{
return QObject::tr("Scribus 1.3.4+ Support");
}
/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.h
38,25 → 38,25
// Standard plugin implementation
Scribus134Format();
virtual ~Scribus134Format();
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
//Not the same as readSLA. This one only reads max 4k of the file for speed.
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
 
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual bool saveFile(const QString & fileName, const FileFormat & fmt) { return false; };
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
bool saveFile(const QString & fileName, const FileFormat & fmt) override { return false; };
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
// Special features - .sla page extraction support
virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, const QString& renamedPageName=QString());
virtual bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
virtual bool readCharStyles(const QString& fileName, ScribusDoc* doc, StyleSet<CharStyle> &docCharStyles);
virtual bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces);
bool loadPage(const QString & fileName, int pageNumber, bool Mpage, const QString& renamedPageName=QString()) override;
bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles) override;
bool readCharStyles(const QString& fileName, ScribusDoc* doc, StyleSet<CharStyle> &docCharStyles) override;
bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty) override;
bool readColors(const QString& fileName, ColorList & colors) override;
bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames) override;
void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces) override;
 
private:
 
/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
65,7 → 65,7
fmt->filter = fmt->trName + " (*.sla *.SLA *.sla.gz *.SLA.GZ *.scd *.SCD *.scd.gz *.SCD.GZ)";
}
 
const QString Scribus13Format::fullTrName() const
QString Scribus13Format::fullTrName() const
{
return QObject::tr("Scribus 1.3.0->1.3.3.x Support");
}
/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.h
27,24 → 27,24
// Standard plugin implementation
Scribus13Format();
virtual ~Scribus13Format();
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
//Not the same as readSLA. This one only reads max 4k of the file for speed.
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
 
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual bool saveFile(const QString & fileName, const FileFormat & fmt) { return false; };
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
bool saveFile(const QString & fileName, const FileFormat & fmt) override { return false; };
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
// Special features - .sla page extraction support
virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, const QString& renamedPageName=QString());
virtual bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
virtual bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces);
bool loadPage(const QString & fileName, int pageNumber, bool Mpage, const QString& renamedPageName=QString()) override;
bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles) override;
bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty) override;
bool readColors(const QString& fileName, ColorList & colors) override;
bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames) override;
void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces) override;
 
private:
void registerFormats();
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
78,7 → 78,7
fmt->filter = fmt->trName + " (*.sla *.SLA *.sla.gz *.SLA.GZ *.scd *.SCD *.scd.gz *.SCD.GZ)";
}
 
const QString Scribus150Format::fullTrName() const
QString Scribus150Format::fullTrName() const
{
return QObject::tr("Scribus 1.5.0+ Support");
}
6288,7 → 6288,6
QString mlName = attrs.valueAsString("Name");
QString mlName2 = mlName;
readMultiline(ml, reader);
int copyC = 1;
QHash<QString,multiLine>::ConstIterator mlit = m_Doc->MLineStyles.find(mlName2);
if (mlit != m_Doc->MLineStyles.end() && ml != mlit.value())
mlName2 = getUniqueName(mlName2, m_Doc->MLineStyles);
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.h
42,29 → 42,29
// Standard plugin implementation
Scribus150Format();
virtual ~Scribus150Format();
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
//Not the same as readSLA. This one only reads max 4k of the file for speed.
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
 
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual bool saveFile(const QString & fileName, const FileFormat & fmt);
virtual bool savePalette(const QString & fileName);
virtual QString saveElements(double xp, double yp, double wp, double hp, Selection* selection, QByteArray &prevData);
virtual bool loadPalette(const QString & fileName);
virtual bool loadElements(const QString & data, const QString& fileDir, int toLayer, double Xp_in, double Yp_in, bool loc);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
bool saveFile(const QString & fileName, const FileFormat & fmt) override;
bool savePalette(const QString & fileName) override;
QString saveElements(double xp, double yp, double wp, double hp, Selection* selection, QByteArray &prevData) override;
bool loadPalette(const QString & fileName) override;
bool loadElements(const QString & data, const QString& fileDir, int toLayer, double Xp_in, double Yp_in, bool loc) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
// Special features - .sla page extraction support
virtual bool loadPage(const QString & fileName, int pageNumber, bool Mpage, const QString& renamedPageName=QString());
virtual bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles);
virtual bool readCharStyles(const QString& fileName, ScribusDoc* doc, StyleSet<CharStyle> &docCharStyles);
virtual bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames);
virtual void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces);
bool loadPage(const QString & fileName, int pageNumber, bool Mpage, const QString& renamedPageName=QString()) override;
bool readStyles(const QString& fileName, ScribusDoc* doc, StyleSet<ParagraphStyle> &docParagraphStyles) override;
bool readCharStyles(const QString& fileName, ScribusDoc* doc, StyleSet<CharStyle> &docCharStyles) override;
bool readLineStyles(const QString& fileName, QHash<QString, multiLine> *Sty) override;
bool readColors(const QString& fileName, ColorList & colors) override;
bool readPageCount(const QString& fileName, int *num1, int *num2, QStringList & masterPageNames) override;
void getReplacedFontData(bool & getNewReplacement, QMap<QString,QString> &getReplacedFonts, QList<ScFace> &getDummyScFaces) override;
 
private:
 
/trunk/Scribus/scribus/plugins/fontpreview/fontpreviewplugin.cpp
54,7 → 54,7
m_actionInfo.needsNumObjects = -1;
}
 
const QString FontPreviewPlugin::fullTrName() const
QString FontPreviewPlugin::fullTrName() const
{
return QObject::tr("Font Preview");
}
/trunk/Scribus/scribus/plugins/fontpreview/fontpreviewplugin.h
22,7 → 22,7
virtual ~FontPreviewPlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
bool run(QWidget *parent, ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/import/ai/importai.cpp
239,9 → 239,9
return tmpImage;
}
 
bool AIPlug::readColors(const QString& fNameIn, ColorList & colors)
bool AIPlug::readColors(const QString& fileName, ColorList & colors)
{
QString fName = fNameIn;
QString fName(fileName);
bool success = false;
cancel = false;
double x, y, b, h;
/trunk/Scribus/scribus/plugins/import/ai/importaiplugin.cpp
1,256 → 1,256
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
#include "commonstrings.h"
 
#include "importai.h"
#include "importaiplugin.h"
 
#include "prefscontext.h"
#include "prefsfile.h"
#include "prefsmanager.h"
#include "scconfig.h"
#include "scpage.h"
#include "scraction.h"
#include "scribuscore.h"
#include "undomanager.h"
#include "util_formats.h"
 
#include "ui/customfdialog.h"
#include "ui/scmessagebox.h"
#include "ui/scmwmenumanager.h"
 
#include <QApplication>
#include <QMessageBox>
 
int importai_getPluginAPIVersion()
{
return PLUGIN_API_VERSION;
}
 
ScPlugin* importai_getPlugin()
{
ImportAIPlugin* plug = new ImportAIPlugin();
Q_CHECK_PTR(plug);
return plug;
}
 
void importai_freePlugin(ScPlugin* plugin)
{
ImportAIPlugin* plug = dynamic_cast<ImportAIPlugin*>(plugin);
Q_ASSERT(plug);
delete plug;
}
 
ImportAIPlugin::ImportAIPlugin() :
importAction(new ScrAction(ScrAction::DLL, "", QKeySequence(), this))
{
// Set action info in languageChange, so we only have to do it in one
// place. This includes registering file format support.
registerFormats();
languageChange();
}
 
void ImportAIPlugin::languageChange()
{
importAction->setText( tr("Import AI..."));
FileFormat* fmt = getFormatByExt("ai");
fmt->trName = FormatsManager::instance()->nameOfFormat(FormatsManager::AI); // Human readable name
fmt->filter = FormatsManager::instance()->extensionsForFormat(FormatsManager::AI); // QFileDialog filter
}
 
ImportAIPlugin::~ImportAIPlugin()
{
unregisterAll();
}
 
const QString ImportAIPlugin::fullTrName() const
{
return QObject::tr("Adobe Illustrator Importer");
}
 
 
const ScActionPlugin::AboutData* ImportAIPlugin::getAboutData() const
{
AboutData* about = new AboutData;
about->authors = "Franz Schmid <franz@scribus.info>";
about->shortDescription = tr("Imports Illustrator Files");
about->description = tr("Imports most Illustrator files into the current document, converting their vector data into Scribus objects.");
about->license = "GPL";
Q_CHECK_PTR(about);
return about;
}
 
void ImportAIPlugin::deleteAboutData(const AboutData* about) const
{
Q_ASSERT(about);
delete about;
}
 
void ImportAIPlugin::registerFormats()
{
FileFormat fmt(this);
fmt.trName = FormatsManager::instance()->nameOfFormat(FormatsManager::AI); // Human readable name
fmt.formatId = 0;
fmt.filter = FormatsManager::instance()->extensionsForFormat(FormatsManager::AI); // QFileDialog filter
fmt.fileExtensions = QStringList() << "ai";
fmt.load = true;
fmt.save = false;
fmt.thumb = true;
fmt.colorReading = true;
fmt.mimeTypes = FormatsManager::instance()->mimetypeOfFormat(FormatsManager::AI); // MIME types
fmt.priority = 64; // Priority
registerFormat(fmt);
}
 
bool ImportAIPlugin::fileSupported(QIODevice* /* file */, const QString & fileName) const
{
// TODO: check for %!PS-Adobe
return true;
}
 
bool ImportAIPlugin::loadFile(const QString & fileName, const FileFormat &, int flags, int /*index*/)
{
// There's only one format to handle, so we just call import(...)
return import(fileName, flags);
}
 
bool ImportAIPlugin::import(QString fileName, int flags)
{
if (!checkFlags(flags))
return false;
if (fileName.isEmpty())
{
flags |= lfInteractive;
PrefsContext* prefs = PrefsManager::instance().prefsFile->getPluginContext("importai");
QString wdir = prefs->get("wdir", ".");
CustomFDialog diaf(ScCore->primaryMainWindow(), wdir, QObject::tr("Open"), FormatsManager::instance()->fileDialogFormatList(FormatsManager::AI));
if (diaf.exec())
{
fileName = diaf.selectedFile();
prefs->set("wdir", fileName.left(fileName.lastIndexOf("/")));
}
else
return true;
}
m_Doc=ScCore->primaryMainWindow()->doc;
UndoTransaction activeTransaction;
bool emptyDoc = (m_Doc == nullptr);
bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
TransactionSettings trSettings;
trSettings.targetName = hasCurrentPage ? m_Doc->currentPage()->getUName() : "";
trSettings.targetPixmap = Um::IImageFrame;
trSettings.actionName = Um::ImportAI;
trSettings.description = fileName;
trSettings.actionPixmap = Um::IAI;
if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
UndoManager::instance()->setUndoEnabled(false);
if (UndoManager::undoEnabled())
activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
#ifdef HAVE_POPPLER
if (!(flags & LoadSavePlugin::lfLoadAsPattern))
{
/* Check if the file is an old style AI or one of the newer PDF wrapped ones */
QFile fT(fileName);
if (fT.open(QIODevice::ReadOnly))
{
QByteArray tempBuf(25, ' ');
fT.read(tempBuf.data(), 24);
fT.close();
if (tempBuf.startsWith("%PDF"))
{
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
ScMessageBox msgBox(ScCore->primaryMainWindow());
msgBox.setText( tr("This file contains 2 versions of the data."));
msgBox.setInformativeText( tr("Choose which one should be imported"));
msgBox.setIcon(QMessageBox::Question);
QPushButton *pdfButton = msgBox.addButton( tr("Use the pdf part"), QMessageBox::ActionRole);
msgBox.addButton( tr("Use the ai part"), QMessageBox::ActionRole);
msgBox.setDefaultButton(pdfButton);
msgBox.exec();
if ((QPushButton *)msgBox.clickedButton() == pdfButton)
{
//Import PDF
const FileFormat *fmt = LoadSavePlugin::getFormatByExt("pdf");
if (!fmt)
{
ScMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The PDF Import plugin could not be found"));
return false;
}
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
bool success = fmt->loadFile(fileName, flags);
if (activeTransaction)
activeTransaction.commit();
if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
UndoManager::instance()->setUndoEnabled(true);
if (!success)
ScMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The file could not be imported"));
return success;
}
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
}
else if (tempBuf.startsWith("%!PS-Adobe-3.0 EPSF-3.0"))
{
//Import EPS
const FileFormat *fmt = LoadSavePlugin::getFormatByExt("eps");
if (!fmt)
{
ScMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The EPS Import plugin could not be found"));
return false;
}
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
bool success = fmt->loadFile(fileName, flags);
if (activeTransaction)
activeTransaction.commit();
if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
UndoManager::instance()->setUndoEnabled(true);
if (!success)
ScMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The file could not be imported"));
return success;
}
}
}
#endif
AIPlug *dia = new AIPlug(m_Doc, flags);
Q_CHECK_PTR(dia);
bool success = dia->import(fileName, trSettings, flags, !(flags & lfScripted));
if (activeTransaction)
activeTransaction.commit();
if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
UndoManager::instance()->setUndoEnabled(true);
if (!success)
ScMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The file could not be imported"));
delete dia;
return success;
}
 
QImage ImportAIPlugin::readThumbnail(const QString& fileName)
{
if (fileName.isEmpty())
return QImage();
UndoManager::instance()->setUndoEnabled(false);
m_Doc = nullptr;
AIPlug *dia = new AIPlug(m_Doc, lfCreateThumbnail);
Q_CHECK_PTR(dia);
QImage ret = dia->readThumbnail(fileName);
UndoManager::instance()->setUndoEnabled(true);
delete dia;
return ret;
}
 
bool ImportAIPlugin::readColors(const QString& fileName, ColorList &colors)
{
if (fileName.isEmpty())
return false;
UndoManager::instance()->setUndoEnabled(false);
m_Doc = nullptr;
AIPlug *dia = new AIPlug(m_Doc, lfCreateThumbnail);
Q_CHECK_PTR(dia);
bool ret = dia->readColors(fileName, colors);
UndoManager::instance()->setUndoEnabled(true);
delete dia;
return ret;
}
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
#include "commonstrings.h"
 
#include "importai.h"
#include "importaiplugin.h"
 
#include "prefscontext.h"
#include "prefsfile.h"
#include "prefsmanager.h"
#include "scconfig.h"
#include "scpage.h"
#include "scraction.h"
#include "scribuscore.h"
#include "undomanager.h"
#include "util_formats.h"
 
#include "ui/customfdialog.h"
#include "ui/scmessagebox.h"
#include "ui/scmwmenumanager.h"
 
#include <QApplication>
#include <QMessageBox>
 
int importai_getPluginAPIVersion()
{
return PLUGIN_API_VERSION;
}
 
ScPlugin* importai_getPlugin()
{
ImportAIPlugin* plug = new ImportAIPlugin();
Q_CHECK_PTR(plug);
return plug;
}
 
void importai_freePlugin(ScPlugin* plugin)
{
ImportAIPlugin* plug = dynamic_cast<ImportAIPlugin*>(plugin);
Q_ASSERT(plug);
delete plug;
}
 
ImportAIPlugin::ImportAIPlugin() :
importAction(new ScrAction(ScrAction::DLL, "", QKeySequence(), this))
{
// Set action info in languageChange, so we only have to do it in one
// place. This includes registering file format support.
registerFormats();
languageChange();
}
 
void ImportAIPlugin::languageChange()
{
importAction->setText( tr("Import AI..."));
FileFormat* fmt = getFormatByExt("ai");
fmt->trName = FormatsManager::instance()->nameOfFormat(FormatsManager::AI); // Human readable name
fmt->filter = FormatsManager::instance()->extensionsForFormat(FormatsManager::AI); // QFileDialog filter
}
 
ImportAIPlugin::~ImportAIPlugin()
{
unregisterAll();
}
 
QString ImportAIPlugin::fullTrName() const
{
return QObject::tr("Adobe Illustrator Importer");
}
 
 
const ScActionPlugin::AboutData* ImportAIPlugin::getAboutData() const
{
AboutData* about = new AboutData;
about->authors = "Franz Schmid <franz@scribus.info>";
about->shortDescription = tr("Imports Illustrator Files");
about->description = tr("Imports most Illustrator files into the current document, converting their vector data into Scribus objects.");
about->license = "GPL";
Q_CHECK_PTR(about);
return about;
}
 
void ImportAIPlugin::deleteAboutData(const AboutData* about) const
{
Q_ASSERT(about);
delete about;
}
 
void ImportAIPlugin::registerFormats()
{
FileFormat fmt(this);
fmt.trName = FormatsManager::instance()->nameOfFormat(FormatsManager::AI); // Human readable name
fmt.formatId = 0;
fmt.filter = FormatsManager::instance()->extensionsForFormat(FormatsManager::AI); // QFileDialog filter
fmt.fileExtensions = QStringList() << "ai";
fmt.load = true;
fmt.save = false;
fmt.thumb = true;
fmt.colorReading = true;
fmt.mimeTypes = FormatsManager::instance()->mimetypeOfFormat(FormatsManager::AI); // MIME types
fmt.priority = 64; // Priority
registerFormat(fmt);
}
 
bool ImportAIPlugin::fileSupported(QIODevice* /* file */, const QString & fileName) const
{
// TODO: check for %!PS-Adobe
return true;
}
 
bool ImportAIPlugin::loadFile(const QString & fileName, const FileFormat & /*fmt*/, int flags, int /*index*/)
{
// There's only one format to handle, so we just call import(...)
return import(fileName, flags);
}
 
bool ImportAIPlugin::import(QString fileName, int flags)
{
if (!checkFlags(flags))
return false;
if (fileName.isEmpty())
{
flags |= lfInteractive;
PrefsContext* prefs = PrefsManager::instance().prefsFile->getPluginContext("importai");
QString wdir = prefs->get("wdir", ".");
CustomFDialog diaf(ScCore->primaryMainWindow(), wdir, QObject::tr("Open"), FormatsManager::instance()->fileDialogFormatList(FormatsManager::AI));
if (diaf.exec())
{
fileName = diaf.selectedFile();
prefs->set("wdir", fileName.left(fileName.lastIndexOf("/")));
}
else
return true;
}
m_Doc=ScCore->primaryMainWindow()->doc;
UndoTransaction activeTransaction;
bool emptyDoc = (m_Doc == nullptr);
bool hasCurrentPage = (m_Doc && m_Doc->currentPage());
TransactionSettings trSettings;
trSettings.targetName = hasCurrentPage ? m_Doc->currentPage()->getUName() : "";
trSettings.targetPixmap = Um::IImageFrame;
trSettings.actionName = Um::ImportAI;
trSettings.description = fileName;
trSettings.actionPixmap = Um::IAI;
if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
UndoManager::instance()->setUndoEnabled(false);
if (UndoManager::undoEnabled())
activeTransaction = UndoManager::instance()->beginTransaction(trSettings);
#ifdef HAVE_POPPLER
if (!(flags & LoadSavePlugin::lfLoadAsPattern))
{
/* Check if the file is an old style AI or one of the newer PDF wrapped ones */
QFile fT(fileName);
if (fT.open(QIODevice::ReadOnly))
{
QByteArray tempBuf(25, ' ');
fT.read(tempBuf.data(), 24);
fT.close();
if (tempBuf.startsWith("%PDF"))
{
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
ScMessageBox msgBox(ScCore->primaryMainWindow());
msgBox.setText( tr("This file contains 2 versions of the data."));
msgBox.setInformativeText( tr("Choose which one should be imported"));
msgBox.setIcon(QMessageBox::Question);
QPushButton *pdfButton = msgBox.addButton( tr("Use the pdf part"), QMessageBox::ActionRole);
msgBox.addButton( tr("Use the ai part"), QMessageBox::ActionRole);
msgBox.setDefaultButton(pdfButton);
msgBox.exec();
if ((QPushButton *)msgBox.clickedButton() == pdfButton)
{
//Import PDF
const FileFormat *fmt = LoadSavePlugin::getFormatByExt("pdf");
if (!fmt)
{
ScMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The PDF Import plugin could not be found"));
return false;
}
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
bool success = fmt->loadFile(fileName, flags);
if (activeTransaction)
activeTransaction.commit();
if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
UndoManager::instance()->setUndoEnabled(true);
if (!success)
ScMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The file could not be imported"));
return success;
}
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
}
else if (tempBuf.startsWith("%!PS-Adobe-3.0 EPSF-3.0"))
{
//Import EPS
const FileFormat *fmt = LoadSavePlugin::getFormatByExt("eps");
if (!fmt)
{
ScMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The EPS Import plugin could not be found"));
return false;
}
qApp->changeOverrideCursor(QCursor(Qt::WaitCursor));
bool success = fmt->loadFile(fileName, flags);
if (activeTransaction)
activeTransaction.commit();
if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
UndoManager::instance()->setUndoEnabled(true);
if (!success)
ScMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The file could not be imported"));
return success;
}
}
}
#endif
AIPlug *dia = new AIPlug(m_Doc, flags);
Q_CHECK_PTR(dia);
bool success = dia->import(fileName, trSettings, flags, !(flags & lfScripted));
if (activeTransaction)
activeTransaction.commit();
if (emptyDoc || !(flags & lfInteractive) || !(flags & lfScripted))
UndoManager::instance()->setUndoEnabled(true);
if (!success)
ScMessageBox::warning(ScCore->primaryMainWindow(), CommonStrings::trWarning, tr("The file could not be imported"));
delete dia;
return success;
}
 
QImage ImportAIPlugin::readThumbnail(const QString& fileName)
{
if (fileName.isEmpty())
return QImage();
UndoManager::instance()->setUndoEnabled(false);
m_Doc = nullptr;
AIPlug *dia = new AIPlug(m_Doc, lfCreateThumbnail);
Q_CHECK_PTR(dia);
QImage ret = dia->readThumbnail(fileName);
UndoManager::instance()->setUndoEnabled(true);
delete dia;
return ret;
}
 
bool ImportAIPlugin::readColors(const QString& fileName, ColorList &colors)
{
if (fileName.isEmpty())
return false;
UndoManager::instance()->setUndoEnabled(false);
m_Doc = nullptr;
AIPlug *dia = new AIPlug(m_Doc, lfCreateThumbnail);
Q_CHECK_PTR(dia);
bool ret = dia->readColors(fileName, colors);
UndoManager::instance()->setUndoEnabled(true);
delete dia;
return ret;
}
/trunk/Scribus/scribus/plugins/import/ai/importaiplugin.h
27,15 → 27,15
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
bool readColors(const QString& fileName, ColorList & colors) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/cdr/importcdrplugin.cpp
63,7 → 63,7
unregisterAll();
}
 
const QString ImportCdrPlugin::fullTrName() const
QString ImportCdrPlugin::fullTrName() const
{
return QObject::tr("Corel Draw Importer");
}
/trunk/Scribus/scribus/plugins/import/cdr/importcdrplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.cpp
68,7 → 68,7
unregisterAll();
}
 
const QString ImportCgmPlugin::fullTrName() const
QString ImportCgmPlugin::fullTrName() const
{
return QObject::tr("Cgm Importer");
}
/trunk/Scribus/scribus/plugins/import/cgm/importcgmplugin.h
34,14 → 34,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.cpp
61,7 → 61,7
unregisterAll();
}
 
const QString ImportCvgPlugin::fullTrName() const
QString ImportCvgPlugin::fullTrName() const
{
return QObject::tr("Calamus Vector Graphics Importer");
}
/trunk/Scribus/scribus/plugins/import/cvg/importcvgplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.cpp
69,7 → 69,7
unregisterAll();
}
 
const QString ImportDrwPlugin::fullTrName() const
QString ImportDrwPlugin::fullTrName() const
{
return QObject::tr("DRW Importer");
}
/trunk/Scribus/scribus/plugins/import/drw/importdrwplugin.h
34,14 → 34,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/emf/importemfplugin.cpp
66,7 → 66,7
unregisterAll();
}
 
const QString ImportEmfPlugin::fullTrName() const
QString ImportEmfPlugin::fullTrName() const
{
return QObject::tr("EMF Importer");
}
/trunk/Scribus/scribus/plugins/import/emf/importemfplugin.h
32,14 → 32,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/fh/importfhplugin.cpp
61,7 → 61,7
unregisterAll();
}
 
const QString ImportFhPlugin::fullTrName() const
QString ImportFhPlugin::fullTrName() const
{
return QObject::tr("Freehand Importer");
}
/trunk/Scribus/scribus/plugins/import/fh/importfhplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/idml/importidml.cpp
213,18 → 213,18
return tmp;
}
 
bool IdmlPlug::readColors(const QString& fNameIn, ColorList & colors)
bool IdmlPlug::readColors(const QString& fileName, ColorList & colors)
{
bool success = false;
importedColors.clear();
 
QByteArray f;
QFileInfo fi = QFileInfo(fNameIn);
QFileInfo fi = QFileInfo(fileName);
QString ext = fi.suffix().toLower();
if (ext == "idml")
{
m_zip = new ScZipHandler();
if (!m_zip->open(fNameIn))
if (!m_zip->open(fileName))
{
delete m_zip;
m_zip = nullptr;
235,7 → 235,7
}
else if (ext == "idms")
{
loadRawText(fNameIn, f);
loadRawText(fileName, f);
}
 
if (f.isEmpty())
/trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.cpp
70,7 → 70,7
unregisterAll();
}
 
const QString ImportIdmlPlugin::fullTrName() const
QString ImportIdmlPlugin::fullTrName() const
{
return QObject::tr("Idml Importer");
}
/trunk/Scribus/scribus/plugins/import/idml/importidmlplugin.h
40,15 → 40,15
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
bool readColors(const QString& fileName, ColorList & colors) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/idml_old/importidml.h
29,13 → 29,13
virtual ~ImportIdml();
//! \brief main method to run the plug
virtual bool run(ScribusDoc* doc, QString target = QString());
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
// virtual bool import(QString fileName = QString(), int flags = lfUseCurrentPage|lfInteractive);
void registerFormats();
};
/trunk/Scribus/scribus/plugins/import/odg/importodgplugin.cpp
70,7 → 70,7
unregisterAll();
}
 
const QString ImportOdgPlugin::fullTrName() const
QString ImportOdgPlugin::fullTrName() const
{
return QObject::tr("Open Document Importer");
}
/trunk/Scribus/scribus/plugins/import/odg/importodgplugin.h
40,14 → 40,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
97,7 → 97,7
fmt2->filter = tr("OpenOffice.org 1.x Draw (*.sxd *.SXD)");
}
 
const QString OODrawImportPlugin::fullTrName() const
QString OODrawImportPlugin::fullTrName() const
{
return QObject::tr("OpenOffice.org Draw Importer");
}
/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.h
27,14 → 27,14
// Standard plugin implementation
OODrawImportPlugin();
virtual ~OODrawImportPlugin();
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
// Special features - File->Import slot
public slots:
/trunk/Scribus/scribus/plugins/import/pages/importpagesplugin.cpp
67,7 → 67,7
unregisterAll();
}
 
const QString ImportPagesPlugin::fullTrName() const
QString ImportPagesPlugin::fullTrName() const
{
return QObject::tr("Pages Importer");
}
/trunk/Scribus/scribus/plugins/import/pages/importpagesplugin.h
40,14 → 40,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
63,7 → 63,10
{
QFileInfo fi = QFileInfo(fName);
baseFile = QDir::cleanPath(QDir::toNativeSeparators(fi.absolutePath()+"/"));
double b, h, x, y;
double b {0.0};
double h {0.0};
double x {0.0};
double y {0.0};
parseHeader(fName, x, y, b, h);
if (b == 0.0)
b = PrefsManager::instance().appPrefs.docSetupPrefs.pageWidth;
2084,7 → 2087,7
return QRect(QPoint(RectY, RectX), QPoint(RectH, RectW));
}
 
QByteArray PctPlug::decodeRLE(QByteArray &in, quint16 bytesPerLine, int multByte)
QByteArray PctPlug::decodeRLE(QByteArray &in, quint16 bytesPerLine, int twoByte)
{
QByteArray ret = QByteArray(bytesPerLine, ' ');
uchar *ptrOut, *ptrIn;
2102,13 → 2105,13
{
// Copy next len+1 bytes literally.
len++;
len *= multByte;
len *= twoByte;
while (len != 0)
{
*ptrOut++ = *ptrIn++;
len--;
count++;
if (multByte == 2)
if (twoByte == 2)
{
*ptrOut++ = *ptrIn++;
len--;
2122,8 → 2125,8
// (Interpret len as a negative 8-bit int.)
len ^= 0xFF;
len += 2;
len *= multByte;
if (multByte == 2)
len *= twoByte;
if (twoByte == 2)
{
c = *ptrIn++;
count++;
/trunk/Scribus/scribus/plugins/import/pct/importpctplugin.cpp
61,7 → 61,7
unregisterAll();
}
 
const QString ImportPctPlugin::fullTrName() const
QString ImportPctPlugin::fullTrName() const
{
return QObject::tr("Pict Importer");
}
/trunk/Scribus/scribus/plugins/import/pct/importpctplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.cpp
76,7 → 76,7
unregisterAll();
}
 
const QString ImportPdfPlugin::fullTrName() const
QString ImportPdfPlugin::fullTrName() const
{
return QObject::tr("PDF Importer");
}
/trunk/Scribus/scribus/plugins/import/pdf/importpdfplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/pm/importpmplugin.cpp
61,7 → 61,7
unregisterAll();
}
 
const QString ImportPmPlugin::fullTrName() const
QString ImportPmPlugin::fullTrName() const
{
return QObject::tr("Pagemaker Importer");
}
/trunk/Scribus/scribus/plugins/import/pm/importpmplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/ps/importpsplugin.h
27,13 → 27,13
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/pub/importpubplugin.cpp
61,7 → 61,7
unregisterAll();
}
 
const QString ImportPubPlugin::fullTrName() const
QString ImportPubPlugin::fullTrName() const
{
return QObject::tr("PUB Importer");
}
/trunk/Scribus/scribus/plugins/import/pub/importpubplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/qxp/importqxpplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/shape/importshapeplugin.cpp
61,7 → 61,7
unregisterAll();
}
 
const QString ImportShapePlugin::fullTrName() const
QString ImportShapePlugin::fullTrName() const
{
return QObject::tr("Shape Importer");
}
/trunk/Scribus/scribus/plugins/import/shape/importshapeplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.cpp
61,7 → 61,7
unregisterAll();
}
 
const QString ImportSmlPlugin::fullTrName() const
QString ImportSmlPlugin::fullTrName() const
{
return QObject::tr("Sml Importer");
}
/trunk/Scribus/scribus/plugins/import/sml/importsmlplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/svg/svgplugin.cpp
101,7 → 101,7
fmt->filter = FormatsManager::instance()->extensionsForFormat(FormatsManager::SVG);
}
 
const QString SVGImportPlugin::fullTrName() const
QString SVGImportPlugin::fullTrName() const
{
return QObject::tr("SVG Import");
}
/trunk/Scribus/scribus/plugins/import/svg/svgplugin.h
33,14 → 33,14
// Standard plugin implementation
SVGImportPlugin();
virtual ~SVGImportPlugin();
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/svm/importsvmplugin.cpp
67,7 → 67,7
unregisterAll();
}
 
const QString ImportSvmPlugin::fullTrName() const
QString ImportSvmPlugin::fullTrName() const
{
return QObject::tr("SVM Importer");
}
/trunk/Scribus/scribus/plugins/import/svm/importsvmplugin.h
32,14 → 32,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/uniconvertor/uniconvplugin.cpp
72,7 → 72,7
fmt->filter = name + " (" + FormatsManager::instance()->extensionListForFormat( FormatsManager::UNICONV, 0)+")";
}
 
const QString UniconvImportPlugin::fullTrName() const
QString UniconvImportPlugin::fullTrName() const
{
return QObject::tr("Uniconvertor Import");
}
/trunk/Scribus/scribus/plugins/import/uniconvertor/uniconvplugin.h
26,13 → 26,13
// Standard plugin implementation
UniconvImportPlugin();
virtual ~UniconvImportPlugin();
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
163,7 → 163,7
return tmp;
}
 
bool VivaPlug::readColors(const QString& fNameIn, ColorList & colors)
bool VivaPlug::readColors(const QString& fileName, ColorList & colors)
{
bool success = false;
m_Doc = new ScribusDoc();
173,7 → 173,7
m_Doc->setGUI(false, ScCore->primaryMainWindow(), nullptr);
importedColors.clear();
QByteArray f;
loadRawText(fNameIn, f);
loadRawText(fileName, f);
if (designMapDom.setContent(f))
{
QDomElement docElem = designMapDom.documentElement();
/trunk/Scribus/scribus/plugins/import/viva/importvivaplugin.cpp
67,7 → 67,7
unregisterAll();
}
 
const QString ImportVivaPlugin::fullTrName() const
QString ImportVivaPlugin::fullTrName() const
{
return QObject::tr("Viva Importer");
}
/trunk/Scribus/scribus/plugins/import/viva/importvivaplugin.h
40,15 → 40,15
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
bool readColors(const QString& fileName, ColorList & colors) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/vsd/importvsdplugin.cpp
61,7 → 61,7
unregisterAll();
}
 
const QString ImportVsdPlugin::fullTrName() const
QString ImportVsdPlugin::fullTrName() const
{
return QObject::tr("MS Visio Importer");
}
/trunk/Scribus/scribus/plugins/import/vsd/importvsdplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.cpp
80,7 → 80,7
fmt->filter = FormatsManager::instance()->extensionsForFormat(FormatsManager::WMF);
}
 
const QString WMFImportPlugin::fullTrName() const
QString WMFImportPlugin::fullTrName() const
{
return QObject::tr("WMF Import");
}
/trunk/Scribus/scribus/plugins/import/wmf/wmfimportplugin.h
25,14 → 25,14
// Standard plugin implementation
WMFImportPlugin();
virtual ~WMFImportPlugin();
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/wpg/importwpgplugin.cpp
61,7 → 61,7
unregisterAll();
}
 
const QString ImportWpgPlugin::fullTrName() const
QString ImportWpgPlugin::fullTrName() const
{
return QObject::tr("WPG Importer");
}
/trunk/Scribus/scribus/plugins/import/wpg/importwpgplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
67,12 → 67,12
progressDialog = nullptr;
}
 
bool XarPlug::readColors(const QString& fNameIn, ColorList &colors)
bool XarPlug::readColors(const QString& fileName, ColorList & colors)
{
progressDialog = nullptr;
bool success = false;
importedColors.clear();
QFile f(fNameIn);
QFile f(fileName);
if (f.open(QIODevice::ReadOnly))
{
QDataStream ts(&f);
/trunk/Scribus/scribus/plugins/import/xar/importxarplugin.cpp
61,7 → 61,7
unregisterAll();
}
 
const QString ImportXarPlugin::fullTrName() const
QString ImportXarPlugin::fullTrName() const
{
return QObject::tr("Xara Importer");
}
168,7 → 168,7
return ret;
}
 
bool ImportXarPlugin::readColors(const QString& fileName, ColorList &colors)
bool ImportXarPlugin::readColors(const QString& fileName, ColorList & colors)
{
if (fileName.isEmpty())
return false;
/trunk/Scribus/scribus/plugins/import/xar/importxarplugin.h
27,15 → 27,15
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual bool readColors(const QString& fileName, ColorList & colors);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
bool readColors(const QString& fileName, ColorList & colors) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/xfig/importxfigplugin.cpp
61,7 → 61,7
unregisterAll();
}
 
const QString ImportXfigPlugin::fullTrName() const
QString ImportXfigPlugin::fullTrName() const
{
return QObject::tr("Xfig Importer");
}
/trunk/Scribus/scribus/plugins/import/xfig/importxfigplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/xps/importxpsplugin.cpp
70,7 → 70,7
unregisterAll();
}
 
const QString ImportXpsPlugin::fullTrName() const
QString ImportXpsPlugin::fullTrName() const
{
return QObject::tr("Xps Importer");
}
/trunk/Scribus/scribus/plugins/import/xps/importxpsplugin.h
40,14 → 40,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/import/zmf/importzmfplugin.h
27,14 → 27,14
\brief Returns name of plugin
\retval QString containing name of plugin: Import EPS/PDF/PS...
*/
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual bool fileSupported(QIODevice* file, const QString & fileName=QString()) const;
virtual bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0);
virtual QImage readThumbnail(const QString& fileName);
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
bool fileSupported(QIODevice* file, const QString & fileName=QString()) const override;
bool loadFile(const QString & fileName, const FileFormat & fmt, int flags, int index = 0) override;
QImage readThumbnail(const QString& fileName) override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
public slots:
/*!
/trunk/Scribus/scribus/plugins/imposition/imposition.h
67,7 → 67,7
void booklet16p(QList<int>*);
protected slots:
virtual void languageChange();
void languageChange() override;
void setPageSize(const QString &);
void customizeSize();
void change2SidesBox(int);
/trunk/Scribus/scribus/plugins/imposition/impositionplugin.h
36,11 → 36,11
virtual bool run(QWidget* parent, ScribusDoc* doc, QString target = QString());
virtual bool run(ScribusDoc* doc, QString target = QString());
virtual void languageChange();
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
void languageChange() override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
};
 
extern "C" PLUGIN_API int imposition_getPluginAPIVersion();
/trunk/Scribus/scribus/plugins/myplugin/myplugin.h
24,11 → 24,11
virtual ~MyPlugin();
//! \brief main method to run the plug
virtual bool run(ScribusDoc* doc, QString target = QString());
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
// Special features (none)
};
/trunk/Scribus/scribus/plugins/newfromtemplateplugin/nftemplate.h
23,11 → 23,11
virtual ~NewFromTemplatePlugin();
//! \brief main method
virtual bool run(ScribusDoc* doc, QString target = QString());
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual void addToMainWindowMenu(ScribusMainWindow *) {};
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
void addToMainWindowMenu(ScribusMainWindow *) override {};
 
// Special features (none)
};
/trunk/Scribus/scribus/plugins/picbrowser/picturebrowserplugin.cpp
48,7 → 48,7
m_actionInfo.enabledOnStartup = false;
}
 
const QString PictureBrowserPlugin::fullTrName() const
QString PictureBrowserPlugin::fullTrName() const
{
return QObject::tr ( "Picture Browser" );
}
/trunk/Scribus/scribus/plugins/picbrowser/picturebrowserplugin.h
26,7 → 26,7
bool cleanupPlugin() override;
//! \brief main method to run the plug
bool run ( ScribusDoc* doc, const QString& target = QString() ) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData ( const AboutData* about ) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/saveastemplateplugin/satemplate.cpp
63,7 → 63,7
m_actionInfo.needsNumObjects = -1;
}
 
const QString SaveAsTemplatePlugin::fullTrName() const
QString SaveAsTemplatePlugin::fullTrName() const
{
return QObject::tr("Save As Template");
}
/trunk/Scribus/scribus/plugins/saveastemplateplugin/satemplate.h
21,7 → 21,7
SaveAsTemplatePlugin();
virtual ~SaveAsTemplatePlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/scripter/scripter.h
19,13 → 19,13
public:
Scripter();
virtual ~Scripter();
virtual bool initPlugin();
virtual bool cleanupPlugin();
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual void addToMainWindowMenu(ScribusMainWindow *);
bool initPlugin() override;
bool cleanupPlugin() override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
void addToMainWindowMenu(ScribusMainWindow *) override;
 
private:
ScripterImpl *scripterImpl;
/trunk/Scribus/scribus/plugins/scriptplugin/cmdannotations.cpp
52,7 → 52,7
if (item == nullptr)
return nullptr;
 
if (item->isAnnotation() == false)
if (!item->isAnnotation())
{
PyErr_SetString(PyExc_RuntimeError,
QObject::tr("Page item must be an annotation", "python error").toLocal8Bit().constData());
123,7 → 123,7
if (item == nullptr)
return nullptr;
 
if (item->isAnnotation() == false)
if (!item->isAnnotation())
{
PyErr_SetString(PyExc_RuntimeError,
QObject::tr("Page item must be an annotation", "python error").toLocal8Bit().constData());
/trunk/Scribus/scribus/plugins/scriptplugin/scriptercore.cpp
200,12 → 200,12
finishScriptRun();
}
 
void ScripterCore::StdScript(const QString& basefilename)
void ScripterCore::StdScript(const QString& baseFilename)
{
QString pfad = ScPaths::instance().scriptDir();
QString pfad2;
pfad2 = QDir::toNativeSeparators(pfad);
QString fn = pfad2+basefilename+".py";
QString fn = pfad2+baseFilename+".py";
QFileInfo fd(fn);
if (!fd.exists())
return;
/trunk/Scribus/scribus/plugins/scriptplugin/scriptercore.h
36,7 → 36,7
 
public slots:
void runScriptDialog();
void StdScript(const QString& filebasename);
void StdScript(const QString& baseFilename);
void RecentScript(const QString& fn);
void slotRunScriptFile(const QString& fileName, bool inMainInterpreter = false);
void slotRunScriptFile(const QString& fileName, QStringList arguments, bool inMainInterpreter = false);
/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
131,7 → 131,7
scripterCore->addToMainWindowMenu(mw);
}
 
const QString ScriptPlugin::fullTrName() const
QString ScriptPlugin::fullTrName() const
{
return QObject::tr("Scripter");
}
/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.h
28,7 → 28,7
~ScriptPlugin() override;
bool initPlugin() override;
bool cleanupPlugin() override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/scriptplugin_py2x/pconsole.h
78,7 → 78,7
QString cursorTemplate;
 
protected slots:
virtual void languageChange();
void languageChange() override;
void documentChanged(bool state);
 
};
/trunk/Scribus/scribus/plugins/scriptplugin_py2x/scriptplugin.h
28,7 → 28,7
~ScriptPlugin() override;
bool initPlugin() override;
bool cleanupPlugin() override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/shapes/shapeplugin.cpp
80,7 → 80,7
mw->scrMenuMgr->addMenuItemStringsToMenuBar("Windows", m_actions);
}
 
const QString ShapePlugin::fullTrName() const
QString ShapePlugin::fullTrName() const
{
return QObject::tr("Custom Shapes");
}
/trunk/Scribus/scribus/plugins/shapes/shapeplugin.h
26,13 → 26,13
// Standard plugin implementation
ShapePlugin();
virtual ~ShapePlugin();
virtual bool initPlugin();
virtual bool cleanupPlugin();
virtual const QString fullTrName() const;
virtual const AboutData* getAboutData() const;
virtual void deleteAboutData(const AboutData* about) const;
virtual void languageChange();
virtual void addToMainWindowMenu(ScribusMainWindow *);
bool initPlugin() override;
bool cleanupPlugin() override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
void addToMainWindowMenu(ScribusMainWindow *) override;
ShapePalette* sc_palette;
 
protected:
/trunk/Scribus/scribus/plugins/short-words/shortwords.cpp
81,7 → 81,7
m_actionInfo.needsNumObjects = -1;
}
 
const QString ShortWordsPlugin::fullTrName() const
QString ShortWordsPlugin::fullTrName() const
{
return QObject::tr("Short Words");
}
/trunk/Scribus/scribus/plugins/short-words/shortwords.h
28,7 → 28,7
ShortWordsPlugin();
virtual ~ShortWordsPlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp
88,7 → 88,7
m_actionInfo.needsNumObjects = 3;
}
 
const QString MeshDistortionPlugin::fullTrName() const
QString MeshDistortionPlugin::fullTrName() const
{
return QObject::tr("MeshDistortion");
}
/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.h
44,7 → 44,7
MeshDistortionPlugin();
virtual ~MeshDistortionPlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp
42,7 → 42,7
#include "selection.h"
#include "util_math.h"
 
NodeItem::NodeItem(QRectF geom, uint num, MeshDistortionDialog *parent) : QGraphicsEllipseItem(geom)
NodeItem::NodeItem(QRectF geom, uint num, MeshDistortionDialog* parent) : QGraphicsEllipseItem(geom)
{
dialog = parent;
handle = num;
55,18 → 55,18
mousePressed = false;
}
 
void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void NodeItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget* widget)
{
Q_UNUSED(widget);
if (option->state & QStyle::State_Selected)
if (item->state & QStyle::State_Selected)
{
painter->setBrush(Qt::red);
painter->setPen(QPen(Qt::red, qMax(0.1, 1.0 / option->levelOfDetail)));
painter->setPen(QPen(Qt::red, qMax(0.1, 1.0 / item->levelOfDetail)));
}
else
{
painter->setBrush(Qt::NoBrush);
painter->setPen(QPen(Qt::red, qMax(0.2, 2.0 / option->levelOfDetail)));
painter->setPen(QPen(Qt::red, qMax(0.2, 2.0 / item->levelOfDetail)));
}
painter->drawEllipse(rect());
}
/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.h
62,10 → 62,10
class PLUGIN_API NodeItem : public QGraphicsEllipseItem
{
public:
NodeItem(QRectF geom, uint num, MeshDistortionDialog *parent);
NodeItem(QRectF geom, uint num, MeshDistortionDialog* parent);
~NodeItem() {};
void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget);
void paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget* widget);
uint handle;
bool mouseMoving;
bool mousePressed;
/trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp
108,7 → 108,7
m_actionInfo.secondObjectType.append(PageItem::Polygon);
}
 
const QString PathAlongPathPlugin::fullTrName() const
QString PathAlongPathPlugin::fullTrName() const
{
return QObject::tr("PathAlongPath");
}
/trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.h
61,7 → 61,7
PathAlongPathPlugin();
virtual ~PathAlongPathPlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/tools/flattenpath/flattenpath.cpp
88,7 → 88,7
m_actionInfo.needsNumObjects = 1;
}
 
const QString FlattenPathPlugin::fullTrName() const
QString FlattenPathPlugin::fullTrName() const
{
return QObject::tr("FlattenPath");
}
/trunk/Scribus/scribus/plugins/tools/flattenpath/flattenpath.h
39,7 → 39,7
FlattenPathPlugin();
virtual ~FlattenPathPlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellplugin.cpp
56,7 → 56,7
m_actionInfo.needsNumObjects = 1;
}
 
const QString HunspellPlugin::fullTrName() const
QString HunspellPlugin::fullTrName() const
{
return QObject::tr("Hunspell Plugin");
}
/trunk/Scribus/scribus/plugins/tools/hunspellcheck/hunspellplugin.h
25,7 → 25,7
//! \brief main method to run the plug
bool run(ScribusDoc* doc, const QString& target = QString()) override;
bool run(QWidget* p, ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp
58,10 → 58,10
 
}
 
void LensItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget)
void LensItem::paint(QPainter *painter, const QStyleOptionGraphicsItem *item, QWidget *widget)
{
Q_UNUSED(widget);
painter->setPen(QPen(Qt::black, 1.0 / option->levelOfDetail));
painter->setPen(QPen(Qt::black, 1.0 / item->levelOfDetail));
QRadialGradient radialGrad(QPointF(0.5, 0.5), 1.0);
radialGrad.setColorAt(0.0, QColor(255, 0, 0, 127));
radialGrad.setColorAt(0.1, QColor(255, 0, 0, 127));
69,13 → 69,13
radialGrad.setCoordinateMode(QGradient::ObjectBoundingMode);
painter->setBrush(radialGrad);
painter->drawEllipse(rect().toRect());
if (option->state & QStyle::State_Selected)
if (item->state & QStyle::State_Selected)
{
scaling = option->levelOfDetail;
double siz = 6.0 / option->levelOfDetail;
scaling = item->levelOfDetail;
double siz = 6.0 / item->levelOfDetail;
QRectF br = boundingRect();
painter->setBrush(Qt::NoBrush);
painter->setPen(QPen(Qt::red, 1.0 / option->levelOfDetail, Qt::DotLine));
painter->setPen(QPen(Qt::red, 1.0 / item->levelOfDetail, Qt::DotLine));
painter->drawRect(br);
painter->setBrush(Qt::red);
painter->setPen(Qt::NoPen);
/trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.cpp
83,7 → 83,7
m_actionInfo.needsNumObjects = 3;
}
 
const QString LensEffectsPlugin::fullTrName() const
QString LensEffectsPlugin::fullTrName() const
{
return QObject::tr("Lens Effects");
}
/trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.h
43,7 → 43,7
LensEffectsPlugin();
virtual ~LensEffectsPlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
86,7 → 86,7
m_actionInfo.needsNumObjects = 2;
}
 
const QString PathConnectPlugin::fullTrName() const
QString PathConnectPlugin::fullTrName() const
{
return QObject::tr("PathConnect");
}
/trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.h
47,7 → 47,7
PathConnectPlugin();
virtual ~PathConnectPlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.cpp
94,7 → 94,7
m_actionInfo.secondObjectType.append(PageItem::Polygon);
}
 
const QString PathCutPlugin::fullTrName() const
QString PathCutPlugin::fullTrName() const
{
return QObject::tr("PathCutter");
}
/trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.h
43,7 → 43,7
PathCutPlugin();
virtual ~PathCutPlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp
100,7 → 100,7
m_actionInfo.needsNumObjects = 2;
}
 
const QString PathFinderPlugin::fullTrName() const
QString PathFinderPlugin::fullTrName() const
{
return QObject::tr("PathFinder");
}
/trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.h
44,7 → 44,7
PathFinderPlugin();
virtual ~PathFinderPlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.cpp
275,12 → 275,12
return out;
}
 
const QString PathFinderDialog::getOtherFillColor()
QString PathFinderDialog::getOtherFillColor()
{
return otherColorComboFill->currentText();
}
 
const QString PathFinderDialog::getOtherLineColor()
QString PathFinderDialog::getOtherLineColor()
{
return otherColorComboLine->currentText();
}
/trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinderdialog.h
25,8 → 25,8
~PathFinderDialog() = default;
void updatePreview(QLabel *label, QPainterPath &path, const QColor& color, double scale);
void updatePartPreview(const QColor& color, double scale);
const QString getOtherFillColor();
const QString getOtherLineColor();
QString getOtherFillColor();
QString getOtherLineColor();
 
bool keepItem1;
bool keepItem2;
/trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp
96,7 → 96,7
m_actionInfo.needsNumObjects = 1;
}
 
const QString PathStrokerPlugin::fullTrName() const
QString PathStrokerPlugin::fullTrName() const
{
return QObject::tr("PathStroker");
}
/trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.h
43,7 → 43,7
PathStrokerPlugin();
virtual ~PathStrokerPlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/tools/smoothpath/smoothpath.cpp
94,7 → 94,7
m_actionInfo.needsNumObjects = 1;
}
 
const QString SmoothPathPlugin::fullTrName() const
QString SmoothPathPlugin::fullTrName() const
{
return QObject::tr("SmoothPath");
}
/trunk/Scribus/scribus/plugins/tools/smoothpath/smoothpath.h
39,7 → 39,7
SmoothPathPlugin();
virtual ~SmoothPathPlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.cpp
78,7 → 78,7
m_actionInfo.needsNumObjects = 1;
}
 
const QString SubdividePlugin::fullTrName() const
QString SubdividePlugin::fullTrName() const
{
return QObject::tr("Subdivide");
}
/trunk/Scribus/scribus/plugins/tools/subdivide/subdivide.h
43,7 → 43,7
SubdividePlugin();
virtual ~SubdividePlugin();
bool run(ScribusDoc* doc, const QString& target = QString()) override;
const QString fullTrName() const override;
QString fullTrName() const override;
const AboutData* getAboutData() const override;
void deleteAboutData(const AboutData* about) const override;
void languageChange() override;
/trunk/Scribus/scribus/scplugin.h
143,7 → 143,7
* The results of testing the value of this can not be guaranteed,
* as its value may change depending on locale and change at runtime.
*/
virtual const QString fullTrName() const = 0;
virtual QString fullTrName() const = 0;
 
/**
* \brief Create and return a prefs UI panel for the plugin.
512,7 → 512,7
//
// The API version is currently simply incremented with each incompatible
// change. Future versions may introduce a minor/major scheme if necessary.
#define PLUGIN_API_VERSION 0x00000106
#define PLUGIN_API_VERSION 0x00000107
 
 
#endif
/trunk/Scribus/scribus/text/frect.h
5,7 → 5,7
**
** Created : 931028
**
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
** Copyright (C) 1992-2000 Trolltech AS. All rights reserved.
**
** This file is part of the kernel module of the Qt GUI Toolkit.
**
26,7 → 26,7
** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
**
** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
** information about Qt Commercial License Agreements.
** information about Qt Commercial License Agreements.
** See http://www.trolltech.com/qpl/ for QPL licensing information.
** See http://www.trolltech.com/gpl/ for GPL licensing information.
**
38,9 → 38,7
#ifndef FRECT_H
#define FRECT_H
 
//#ifndef QT_H
#include "fsize.h"
//#endif // QT_H
 
#if defined(topLeft)
#error "Macro definition of topLeft conflicts with FRect"
47,124 → 45,122
// don't just silently undo people's defines: #undef topLeft
#endif
 
class FRect // rectangle class
class FRect // rectangle class
{
public:
FRect() { x1 = y1 = 0; x2 = y2 = -1; }
FRect( FPoint &topleft, FPoint &bottomright );
FRect( FPoint &topleft, FSize &size );
FRect( qreal left, qreal top, qreal width, qreal height );
public:
FRect() {}
FRect(FPoint &topleft, FPoint &bottomright);
FRect(FPoint &topleft, FSize &size);
FRect(qreal left, qreal top, qreal width, qreal height);
 
bool isNull() const;
bool isEmpty() const;
bool isValid() const;
FRect normalize() const;
bool isNull() const;
bool isEmpty() const;
bool isValid() const;
FRect normalize() const;
 
qreal left() const;
qreal top() const;
qreal right() const;
qreal bottom() const;
qreal left() const;
qreal top() const;
qreal right() const;
qreal bottom() const;
 
qreal &rLeft();
qreal &rTop();
qreal &rRight();
qreal &rBottom();
qreal &rLeft();
qreal &rTop();
qreal &rRight();
qreal &rBottom();
 
qreal x() const;
qreal y() const;
void setLeft( qreal pos );
void setTop( qreal pos );
void setRight( qreal pos );
void setBottom( qreal pos );
void setX( qreal x );
void setY( qreal y );
qreal x() const;
qreal y() const;
void setLeft(qreal pos);
void setTop(qreal pos);
void setRight(qreal pos);
void setBottom(qreal pos);
void setX(qreal x);
void setY(qreal y);
 
void setTopLeft( FPoint &p );
void setBottomRight( FPoint &p );
void setTopRight( FPoint &p );
void setBottomLeft( FPoint &p );
void setTopLeft(FPoint &p);
void setBottomRight(FPoint &p);
void setTopRight(FPoint &p);
void setBottomLeft(FPoint &p);
 
FPoint topLeft() const;
FPoint bottomRight() const;
FPoint topRight() const;
FPoint bottomLeft() const;
FPoint center() const;
FPoint topLeft() const;
FPoint bottomRight() const;
FPoint topRight() const;
FPoint bottomLeft() const;
FPoint center() const;
 
void rect( qreal *x, qreal *y, qreal *w, qreal *h ) const;
void coords( qreal *xp1, qreal *yp1, qreal *xp2, qreal *yp2 ) const;
void rect(qreal *x, qreal *y, qreal *w, qreal *h) const;
void coords(qreal *xp1, qreal *yp1, qreal *xp2, qreal *yp2) const;
 
void moveLeft( qreal pos );
void moveTop( qreal pos );
void moveRight( qreal pos );
void moveBottom( qreal pos );
void moveTopLeft( FPoint &p );
void moveBottomRight( FPoint &p );
void moveTopRight( FPoint &p );
void moveBottomLeft( FPoint &p );
void moveCenter( FPoint &p );
void moveBy( qreal dx, qreal dy );
void moveLeft(qreal pos);
void moveTop(qreal pos);
void moveRight(qreal pos);
void moveBottom(qreal pos);
void moveTopLeft(FPoint &p);
void moveBottomRight(FPoint &p);
void moveTopRight(FPoint &p);
void moveBottomLeft(FPoint &p);
void moveCenter(FPoint &p);
void moveBy(qreal dx, qreal dy);
 
void setRect( qreal x, qreal y, qreal w, qreal h );
void setCoords( qreal xp1, qreal yp1, qreal xp2, qreal yp );
void addCoords( qreal xp1, qreal yp1, qreal xp2, qreal yp2 );
void setRect(qreal x, qreal y, qreal w, qreal h);
void setCoords(qreal xp1, qreal yp1, qreal xp2, qreal yp);
void addCoords(qreal xp1, qreal yp1, qreal xp2, qreal yp2);
 
FSize size() const;
qreal width() const;
qreal height() const;
void setWidth( qreal w );
void setHeight( qreal h );
void setSize( const FSize &s );
FSize size() const;
qreal width() const;
qreal height() const;
void setWidth(qreal w);
void setHeight(qreal h);
void setSize(const FSize &s);
 
FRect operator|(const FRect &r) const;
FRect operator&(const FRect &r) const;
FRect& operator|=(const FRect &r);
FRect& operator&=(const FRect &r);
FRect operator|(const FRect &r) const;
FRect operator&(const FRect &r) const;
FRect& operator|=(const FRect &r);
FRect& operator&=(const FRect &r);
 
bool contains( FPoint &p, bool proper=false ) const;
bool contains( qreal x, qreal y ) const; // inline methods, _don't_ merge these
bool contains( qreal x, qreal y, bool proper ) const;
bool contains( const FRect &r, bool proper=false ) const;
FRect unite( const FRect &r ) const;
FRect intersect( const FRect &r ) const;
bool intersects( const FRect &r ) const;
bool contains(FPoint &p, bool proper=false) const;
bool contains(qreal x, qreal y) const; // inline methods, _don't_ merge these
bool contains(qreal x, qreal y, bool proper) const;
bool contains(const FRect &r, bool proper=false) const;
FRect unite(const FRect &r) const;
FRect intersect(const FRect &r) const;
bool intersects(const FRect &r) const;
 
friend bool operator==( const FRect &, const FRect & );
friend bool operator!=( const FRect &, const FRect & );
friend bool operator==(const FRect &, const FRect &);
friend bool operator!=(const FRect &, const FRect &);
 
private:
#if defined(Q_OS_LINUX) || defined(Q_OS_TEMP)
friend void qt_setCoords( FRect *r, qreal xp1, qreal yp1, qreal xp2, qreal yp2 );
#endif
 
qreal x1;
qreal y1;
qreal x2;
qreal y2;
 
private:
#if defined(Q_OS_LINUX) || defined(Q_OS_TEMP)
friend void qt_setCoords(FRect *r, qreal xp1, qreal yp1, qreal xp2, qreal yp2);
#endif
qreal x1 {0.0};
qreal y1 {0.0};
qreal x2 {-1.0};
qreal y2 {-1.0};
};
 
bool operator==( const FRect &, const FRect & );
bool operator!=( const FRect &, const FRect & );
bool operator==(const FRect &, const FRect &);
bool operator!=(const FRect &, const FRect &);
 
 
/*****************************************************************************
FRect stream functions
FRect stream functions
*****************************************************************************/
// #ifndef QT_NO_DATASTREAM
// Q_EXPORT QDataStream &operator<<( QDataStream &, const FRect & );
// Q_EXPORT QDataStream &operator>>( QDataStream &, FRect & );
// Q_EXPORT QDataStream &operator<<(QDataStream &, const FRect &);
// Q_EXPORT QDataStream &operator>>(QDataStream &, FRect &);
// #endif
 
/*****************************************************************************
FRect inline member functions
FRect inline member functions
*****************************************************************************/
 
inline FRect::FRect( qreal left, qreal top, qreal width, qreal height )
inline FRect::FRect(qreal left, qreal top, qreal width, qreal height)
{
x1 = (qreal)left;
y1 = (qreal)top;
x2 = (qreal)(left+width-1);
y2 = (qreal)(top+height-1);
x1 = (qreal)left;
y1 = (qreal)top;
x2 = (qreal)(left+width-1);
y2 = (qreal)(top+height-1);
}
 
inline bool FRect::isNull() const
206,22 → 202,22
inline qreal FRect::y() const
{ return y1; }
 
inline void FRect::setLeft( qreal pos )
inline void FRect::setLeft(qreal pos)
{ x1 = (qreal)pos; }
 
inline void FRect::setTop( qreal pos )
inline void FRect::setTop(qreal pos)
{ y1 = (qreal)pos; }
 
inline void FRect::setRight( qreal pos )
inline void FRect::setRight(qreal pos)
{ x2 = (qreal)pos; }
 
inline void FRect::setBottom( qreal pos )
inline void FRect::setBottom(qreal pos)
{ y2 = (qreal)pos; }
 
inline void FRect::setX( qreal x )
inline void FRect::setX(qreal x)
{ x1 = (qreal)x; }
 
inline void FRect::setY( qreal y )
inline void FRect::setY(qreal y)
{ y1 = (qreal)y; }
 
inline FPoint FRect::topLeft() const
240,29 → 236,28
{ return FPoint((x1+x2)/2, (y1+y2)/2); }
 
inline qreal FRect::width() const
{ return x2 - x1 + 1; }
{ return x2 - x1 + 1; }
 
inline qreal FRect::height() const
{ return y2 - y1 + 1; }
{ return y2 - y1 + 1; }
 
inline FSize FRect::size() const
{ return FSize(x2-x1+1, y2-y1+1); }
 
inline bool FRect::contains( qreal x, qreal y, bool proper ) const
inline bool FRect::contains(qreal x, qreal y, bool proper) const
{
if ( proper )
return x > x1 && x < x2 &&
y > y1 && y < y2;
else
return x >= x1 && x <= x2 &&
y >= y1 && y <= y2;
if (proper)
return x > x1 && x < x2 &&
y > y1 && y < y2;
else
return x >= x1 && x <= x2 &&
y >= y1 && y <= y2;
}
 
inline bool FRect::contains( qreal x, qreal y ) const
inline bool FRect::contains(qreal x, qreal y) const
{
return x >= x1 && x <= x2 &&
y >= y1 && y <= y2;
return x >= x1 && x <= x2 &&
y >= y1 && y <= y2;
}
// #define Q_DEFINED_QRECT
// #include "qwinexport.h"
#endif // QRECT_H
 
#endif // FRECT_H