AIPlug Class Reference
Adobe Illustrator importer plugin. More...
#include <importai.h>

Public Slots | |
| void | cancelRequested () |
Public Member Functions | |
| AIPlug (ScribusDoc *doc, int flags) | |
| Create the AI importer window. | |
| ~AIPlug () | |
| bool | import (QString fn, int flags, bool showProgress=true) |
| Perform import. | |
Private Member Functions | |
| bool | extractFromPDF (QString infile, QString outfile) |
| Does the conversion. | |
| bool | decompressAIData (QString &fName) |
| bool | parseHeader (QString fName, double &x, double &y, double &b, double &h) |
| QString | removeAIPrefix (QString comment) |
| QString | parseColor (QString data) |
| QString | parseColorGray (QString data) |
| QString | parseColorRGB (QString data) |
| QString | parseCustomColor (QString data, double &shade) |
| QString | parseCustomColorX (QString data, double &shade, QString type) |
| QStringList | getStrings (QString data) |
| void | getCommands (QString data, QStringList &commands) |
| void | processData (QString data) |
| void | processGradientData (QString data) |
| void | processPattern (QDataStream &ts) |
| void | processRaster (QDataStream &ts) |
| void | processComment (QDataStream &ts, QString comment) |
| bool | convert (QString fn) |
Private Attributes | |
| QList< PageItem * > | Elements |
| QList< PageItem * > | PatternElements |
| QStack< QList< PageItem * > > | groupStack |
| ColorList | CustColors |
| double | baseX |
| double | baseY |
| double | docX |
| double | docY |
| double | docWidth |
| double | docHeight |
| double | LineW |
| Qt::PenCapStyle | CapStyle |
| Qt::PenJoinStyle | JoinStyle |
| double | DashOffset |
| QList< double > | DashPattern |
| double | Opacity |
| int | blendMode |
| QString | CurrColorFill |
| QString | CurrColorStroke |
| double | CurrStrokeShade |
| double | CurrFillShade |
| bool | fillRule |
| bool | itemLocked |
| FPointArray | Coords |
| FPointArray | clipCoords |
| FPoint | currentPoint |
| int | currentLayer |
| bool | firstLayer |
| bool | FirstU |
| bool | WasU |
| bool | ClosedPath |
| bool | interactive |
| MultiProgressDialog * | progressDialog |
| bool | cancel |
| ScribusDoc * | m_Doc |
| Selection * | tmpSel |
| QStringList | importedColors |
| int | importerFlags |
| QStringList | commandList |
| bool | convertedPDF |
| QMap< QString, VGradient > | m_gradients |
| VGradient | currentGradient |
| QString | currentGradientName |
| QMatrix | currentGradientMatrix |
| QPointF | currentGradientOrigin |
| double | currentGradientAngle |
| double | currentGradientLenght |
| bool | gradientMode |
| bool | wasBC |
| bool | itemRendered |
| QMatrix | startMatrix |
| QMatrix | endMatrix |
| bool | patternMode |
| QString | currentPatternDefName |
| QString | currentPatternName |
| double | patternX1 |
| double | patternY1 |
| double | patternX2 |
| double | patternY2 |
| double | currentPatternX |
| double | currentPatternY |
| double | currentPatternXScale |
| double | currentPatternYScale |
| double | currentPatternRotation |
| QString | docCreator |
| QString | docDate |
| QString | docTime |
| QString | docOrganisation |
| QString | docTitle |
| int | textMode |
| QMatrix | textMatrix |
| StoryText | textData |
| QString | textFont |
| double | textSize |
| double | maxWidth |
| double | tempW |
| double | maxHeight |
| double | textKern |
| double | textScaleH |
| double | textScaleV |
| int | startCurrentTextRange |
| int | endCurrentTextRange |
| int | imgNum |
| QString | baseFile |
Detailed Description
Adobe Illustrator importer plugin.Definition at line 27 of file importai.h.
Constructor & Destructor Documentation
| AIPlug::AIPlug | ( | ScribusDoc * | doc, | |
| int | flags | |||
| ) |
Create the AI importer window.
- Date:
- Parameters:
-
fName QString flags combination of loadFlags showProgress if progress must be displayed
- Return values:
-
EPSPlug plugin
Definition at line 59 of file importai.cpp.
References interactive, LoadSavePlugin::lfInteractive, m_Doc, and tmpSel.
| AIPlug::~AIPlug | ( | ) |
Member Function Documentation
| bool AIPlug::import | ( | QString | fn, | |
| int | flags, | |||
| bool | showProgress = true | |||
| ) |
Perform import.
- Date:
- Parameters:
-
fn QString flags combination of loadFlags showProgress if progress must be displayed
- Return values:
-
bool true if import was ok
Definition at line 66 of file importai.cpp.
References MultiProgressDialog::addExtraProgressBars(), Selection::addItem(), ScribusView::addPage(), ScribusDoc::addPage(), FPointArray::addPoint(), ScribusView::adjustCanvas(), PrefsManager::appPrefs, baseFile, baseX, baseY, cancel, cancelRequested(), ScribusView::canvasOrigin(), ScribusDoc::changed(), Selection::clear(), convert(), convertedPDF, ScribusDoc::currentPage(), CustColors, toolPrefs::dBrush, decompressAIData(), docCreator, docDate, docHeight, docOrganisation, docTime, docTitle, ScribusDoc::documentInfo, docWidth, docX, docY, ScribusDoc::DoDrawing, ScribusMainWindow::doFileNew(), toolPrefs::dPen, ScribusDoc::DragElements, ScribusDoc::DraggedElem, ScribusDoc::DragP, ScribusView::DrawNew(), Elements, extractFromPDF(), getShortPathName(), ScPaths::getTempFileDir(), ScribusDoc::GroupCounter, PageItem::Groups, PageItem::groupsLastItem, ScribusMainWindow::HaveNewDoc(), PageItem::height, importerFlags, PrefsManager::instance(), interactive, PageItem::isGroupControl, ScribusDoc::isLoading(), ScribusDoc::itemAdd(), PageItem::ItemNr, ScribusDoc::Items, ScribusDoc::itemSelection_DeleteItem(), LoadSavePlugin::lfCreateDoc, LoadSavePlugin::lfInsertPage, LoadSavePlugin::lfInteractive, LoadSavePlugin::lfScripted, PageItem::lineWidth, loadIcon(), m_Doc, ScribusDoc::m_pageSize, ScribusDoc::m_Selection, ScribusDoc::maxCanvasCoordinate, ScribusDoc::minCanvasCoordinate, ScribusDoc::PageColors, ApplicationPrefs::PageHeight, ScribusDoc::PageOri, ApplicationPrefs::PageWidth, parseHeader(), FPointArray::point(), PageItem::Polygon, ScribusCore::primaryMainWindow(), progressDialog, PageItem::Rectangle, ScribusDoc::reformPages(), FPointArray::resize(), PageItem::rotation, ScribusView::scale(), ScCore, ScribusDoc::scMW(), ScribusMainWindow::ScriptRunning, DocumentInformation::setAuthor(), ScribusView::setCanvasOrigin(), DocumentInformation::setDate(), Selection::setGroupRect(), PageItem::setItemName(), ScribusDoc::setLoading(), MultiProgressDialog::setOverallProgress(), MultiProgressDialog::setOverallTotalSteps(), ScribusDoc::setPage(), MultiProgressDialog::setProgress(), DocumentInformation::setPublisher(), PageItem::setTextFlowMode(), DocumentInformation::setTitle(), PageItem::TextFlowUsesFrameShape, tmpSel, ScribusDoc::toolSettings, tr(), CommonStrings::tr_Cancel, ScribusView::updateCanvas(), ScribusView::updatesOn(), ScribusCore::usingGUI(), ScribusDoc::view(), PageItem::width, ScriXmlDoc::WriteElem(), FPoint::x(), Page::xOffset(), PageItem::xPos, FPoint::y(), Page::yOffset(), and PageItem::yPos.
Referenced by ImportAIPlugin::import().
| bool AIPlug::extractFromPDF | ( | QString | infile, | |
| QString | outfile | |||
| ) | [private] |
Does the conversion.
- Date:
- Parameters:
-
fn QString x X position y Y position b double h double
- Return values:
-
bool true if conversion was ok
Definition at line 379 of file importai.cpp.
Referenced by import().
| bool AIPlug::decompressAIData | ( | QString & | fName | ) | [private] |
Definition at line 458 of file importai.cpp.
References baseFile, convertedPDF, getShortPathName(), ScPaths::getTempFileDir(), and moveFile().
Referenced by import().
| bool AIPlug::parseHeader | ( | QString | fName, | |
| double & | x, | |||
| double & | y, | |||
| double & | b, | |||
| double & | h | |||
| ) | [private] |
Definition at line 534 of file importai.cpp.
References CustColors, docCreator, docDate, docOrganisation, docTime, docTitle, getStrings(), importedColors, readLinefromDataStream(), and ScColor::setSpotColor().
Referenced by import().
| QString AIPlug::removeAIPrefix | ( | QString | comment | ) | [private] |
| QString AIPlug::parseColor | ( | QString | data | ) | [private] |
Definition at line 661 of file importai.cpp.
References colorModelCMYK, importedColors, m_Doc, ScColor::name(), CommonStrings::None, ScribusDoc::PageColors, ScColor::setColor(), ScColor::setRegistrationColor(), and ScColor::setSpotColor().
Referenced by processData(), and processGradientData().
| QString AIPlug::parseColorGray | ( | QString | data | ) | [private] |
Definition at line 705 of file importai.cpp.
References colorModelCMYK, importedColors, m_Doc, ScColor::name(), CommonStrings::None, ScribusDoc::PageColors, ScColor::setColor(), ScColor::setRegistrationColor(), and ScColor::setSpotColor().
Referenced by processData(), and processGradientData().
| QString AIPlug::parseColorRGB | ( | QString | data | ) | [private] |
Definition at line 743 of file importai.cpp.
References colorModelRGB, importedColors, m_Doc, ScColor::name(), CommonStrings::None, ScribusDoc::PageColors, ScColor::setColorRGB(), ScColor::setRegistrationColor(), and ScColor::setSpotColor().
Referenced by processData().
| QString AIPlug::parseCustomColor | ( | QString | data, | |
| double & | shade | |||
| ) | [private] |
Definition at line 785 of file importai.cpp.
References colorModelCMYK, importedColors, m_Doc, CommonStrings::None, ScribusDoc::PageColors, ScColor::setColor(), ScColor::setRegistrationColor(), and ScColor::setSpotColor().
Referenced by processData(), and processGradientData().
| QString AIPlug::parseCustomColorX | ( | QString | data, | |
| double & | shade, | |||
| QString | type | |||
| ) | [private] |
Definition at line 837 of file importai.cpp.
References colorModelCMYK, colorModelRGB, importedColors, m_Doc, CommonStrings::None, ScribusDoc::PageColors, ScColor::setColor(), ScColor::setColorRGB(), ScColor::setRegistrationColor(), and ScColor::setSpotColor().
Referenced by processData(), and processGradientData().
| QStringList AIPlug::getStrings | ( | QString | data | ) | [private] |
Definition at line 916 of file importai.cpp.
References SpecialChars::PARSEP.
Referenced by parseHeader(), and processData().
| void AIPlug::getCommands | ( | QString | data, | |
| QStringList & | commands | |||
| ) | [private] |
Definition at line 981 of file importai.cpp.
References commandList.
Referenced by processData(), processGradientData(), and processRaster().
| void AIPlug::processData | ( | QString | data | ) | [private] |
Definition at line 1050 of file importai.cpp.
References Selection::addItem(), ScribusDoc::addLayer(), ScribusDoc::AdjustItemSize(), ScribusDoc::AllFonts, StoryText::append(), StoryText::applyCharStyle(), PrefsManager::appPrefs, baseX, baseY, blendMode, CapStyle, ScribusDoc::changeLayerName(), StoryText::charStyle(), StoryText::clear(), Selection::clear(), PageItem::Clip, clipCoords, PageItem::ClipEdited, Coords, FPointArray::copy(), Selection::count(), CurrColorFill, CurrColorStroke, SCFontsIterator::current(), currentGradientAngle, currentGradientLenght, currentGradientMatrix, currentGradientName, currentGradientOrigin, currentLayer, ScribusDoc::currentPage(), currentPatternDefName, currentPatternName, currentPatternRotation, currentPatternX, currentPatternXScale, currentPatternY, currentPatternYScale, currentPoint, CurrFillShade, CurrStrokeShade, toolPrefs::defFont, docHeight, docX, docY, Elements, endCurrentTextRange, endMatrix, PageItem::fill_gradient, fillRule, firstLayer, FirstU, FlattenPath(), CharStyle::font, PageItem::FrameType, getCommands(), getMaxClipF(), MissingFont::getReplacementFont(), getRotationFromMatrix(), getStrings(), ApplicationPrefs::GFontSub, gradientMode, PageItem::GrEndX, PageItem::GrEndY, groupStack, PageItem::GrStartX, PageItem::GrStartY, PageItem::GrType, SCFontsIterator::hasNext(), PageItem::height, importerFlags, StoryText::insertChars(), PrefsManager::instance(), ScribusDoc::itemAdd(), Selection::itemAt(), itemLocked, itemRendered, ScribusDoc::Items, ScribusDoc::itemSelection_GroupObjects(), PageItem::itemText, JoinStyle, StoryText::length(), LoadSavePlugin::lfCreateDoc, SpecialChars::LINEBREAK, LineW, m_Doc, m_gradients, M_PI, maxHeight, maxWidth, SCFontsIterator::next(), CommonStrings::None, Opacity, parseColor(), parseColorGray(), parseColorRGB(), parseCustomColor(), parseCustomColorX(), SpecialChars::PARSEP, PatternElements, patternMode, patternX1, patternX2, patternY1, patternY2, PageItem::PoLine, PageItem::Polygon, PageItem::PolyLine, FPointArray::putPoints(), FPointArray::resize(), ScFace::scName(), ScStyle_Default, PageItem::Segments, PageItem::setFillEvenOdd(), PageItem::setFillShade(), PageItem::setFillTransparency(), ScribusDoc::setLayerLocked(), ScribusDoc::setLayerMarker(), ScribusDoc::setLayerOutline(), ScribusDoc::setLayerPrintable(), ScribusDoc::setLayerVisible(), PageItem::setLineEnd(), PageItem::setLineJoin(), PageItem::setLineShade(), PageItem::setLineTransparency(), PageItem::setLocked(), FPointArray::setMarker(), PageItem::setPattern(), PageItem::setPatternTransform(), PageItem::SetRectFrame(), ScribusDoc::setRedrawBounding(), PageItem::setRotation(), PageItem::setTextFlowMode(), PageItem::setTextToFrameDist(), PageItem::setWidthHeight(), PageItem::setXPos(), PageItem::setYPos(), FPointArray::size(), startCurrentTextRange, startMatrix, FPointArray::svgCurveToCubic(), FPointArray::svgInit(), FPointArray::svgLineTo(), FPointArray::svgMoveTo(), tempW, textData, PageItem::TextFlowDisabled, PageItem::TextFlowUsesFrameShape, textFont, PageItem::TextFrame, textKern, textMatrix, textMode, textScaleH, textScaleV, textSize, tmpSel, ScribusDoc::toolSettings, FPointArray::translate(), VGradient::type(), PageItem::Unspecified, wasBC, WasU, PageItem::width, FPoint::x(), Page::xOffset(), PageItem::xPos, FPoint::y(), Page::yOffset(), and PageItem::yPos.
Referenced by convert(), processComment(), and processPattern().
| void AIPlug::processGradientData | ( | QString | data | ) | [private] |
Definition at line 1710 of file importai.cpp.
References VGradient::addStop(), VGradient::clearStops(), currentGradient, currentGradientName, getCommands(), ScColorEngine::getRGBColor(), VGradient::linear, m_Doc, m_gradients, VGradient::none, ScribusDoc::PageColors, parseColor(), parseColorGray(), parseCustomColor(), parseCustomColorX(), VGradient::radial, and VGradient::setRepeatMethod().
Referenced by processComment().
| void AIPlug::processPattern | ( | QDataStream & | ts | ) | [private] |
Definition at line 1782 of file importai.cpp.
References Selection::addItem(), ScribusDoc::addPattern(), Selection::clear(), Selection::count(), currentPatternDefName, ScribusDoc::DoDrawing, PageItem::DrawObj_toImage(), ScPattern::height, Selection::itemAt(), ScPattern::items, ScribusDoc::itemSelection_DeleteItem(), ScribusDoc::itemSelection_GroupObjects(), m_Doc, p, ScPattern::pattern, PatternElements, patternMode, patternX1, patternX2, patternY1, patternY2, processData(), readLinefromDataStream(), removeAIPrefix(), ScPattern::setDoc(), PageItem::setItemName(), tmpSel, and ScPattern::width.
Referenced by processComment().
| void AIPlug::processRaster | ( | QDataStream & | ts | ) | [private] |
Definition at line 1870 of file importai.cpp.
References baseFile, CapStyle, RawImage::channels(), PageItem::Clip, RawImage::create(), CurrColorFill, CurrColorStroke, ScribusDoc::currentPage(), CurrFillShade, CurrStrokeShade, data, docHeight, docX, docY, Elements, fillRule, FlattenPath(), getCommands(), getRotationFromMatrix(), groupStack, ScImage::height(), PageItem::height, PageItem::ImageFrame, imgNum, ScribusDoc::itemAdd(), itemLocked, ScribusDoc::Items, JoinStyle, ScribusDoc::LoadPict(), m_Doc, M_PI, Opacity, p, PageItem::PicAvail, PageItem::pixm, PageItem::PoLine, readLinefromDataStream(), RawImage::scanLine(), PageItem::Segments, PageItem::setFillEvenOdd(), PageItem::setFillShade(), PageItem::setFillTransparency(), PageItem::setImageXYScale(), PageItem::setLineEnd(), PageItem::setLineJoin(), PageItem::setLineShade(), PageItem::setLineTransparency(), PageItem::setLocked(), PageItem::SetRectFrame(), ScribusDoc::setRedrawBounding(), PageItem::setRotation(), PageItem::setTextFlowMode(), PageItem::setWidthHeight(), PageItem::TextFlowDisabled, PageItem::Unspecified, ScImage::width(), PageItem::width, RawImage::width(), Page::xOffset(), and Page::yOffset().
Referenced by processComment().
| void AIPlug::processComment | ( | QDataStream & | ts, | |
| QString | comment | |||
| ) | [private] |
Definition at line 2027 of file importai.cpp.
References processData(), processGradientData(), processPattern(), processRaster(), readLinefromDataStream(), and removeAIPrefix().
Referenced by convert().
| bool AIPlug::convert | ( | QString | fn | ) | [private] |
Definition at line 2141 of file importai.cpp.
References blendMode, CapStyle, VGradient::clearStops(), clipCoords, commandList, Coords, CurrColorFill, CurrColorStroke, currentGradient, currentGradientAngle, currentGradientLenght, currentGradientMatrix, currentGradientName, currentGradientOrigin, currentLayer, currentPatternName, currentPatternRotation, currentPatternX, currentPatternXScale, currentPatternY, currentPatternYScale, currentPoint, CurrFillShade, CurrStrokeShade, DashOffset, DashPattern, fillRule, firstLayer, FirstU, groupStack, imgNum, int(), itemLocked, JoinStyle, VGradient::linear, LineW, VGradient::none, Opacity, patternMode, patternX1, patternX2, patternY1, patternY2, processComment(), processData(), progressDialog, readLinefromDataStream(), FPointArray::resize(), MultiProgressDialog::setLabel(), MultiProgressDialog::setOverallProgress(), VGradient::setRepeatMethod(), MultiProgressDialog::setTotalSteps(), FPointArray::svgInit(), tr(), and WasU.
Referenced by import().
| void AIPlug::cancelRequested | ( | ) | [inline, slot] |
Member Data Documentation
QList<PageItem*> AIPlug::Elements [private] |
Definition at line 86 of file importai.h.
Referenced by import(), processData(), and processRaster().
QList<PageItem*> AIPlug::PatternElements [private] |
QStack<QList<PageItem*> > AIPlug::groupStack [private] |
Definition at line 88 of file importai.h.
Referenced by convert(), processData(), and processRaster().
ColorList AIPlug::CustColors [private] |
double AIPlug::baseX [private] |
double AIPlug::baseY [private] |
double AIPlug::docX [private] |
Definition at line 91 of file importai.h.
Referenced by import(), processData(), and processRaster().
double AIPlug::docY [private] |
Definition at line 92 of file importai.h.
Referenced by import(), processData(), and processRaster().
double AIPlug::docWidth [private] |
double AIPlug::docHeight [private] |
Definition at line 94 of file importai.h.
Referenced by import(), processData(), and processRaster().
double AIPlug::LineW [private] |
Qt::PenCapStyle AIPlug::CapStyle [private] |
Definition at line 97 of file importai.h.
Referenced by convert(), processData(), and processRaster().
Qt::PenJoinStyle AIPlug::JoinStyle [private] |
Definition at line 98 of file importai.h.
Referenced by convert(), processData(), and processRaster().
double AIPlug::DashOffset [private] |
QList<double> AIPlug::DashPattern [private] |
double AIPlug::Opacity [private] |
Definition at line 101 of file importai.h.
Referenced by convert(), processData(), and processRaster().
int AIPlug::blendMode [private] |
QString AIPlug::CurrColorFill [private] |
Definition at line 103 of file importai.h.
Referenced by convert(), processData(), and processRaster().
QString AIPlug::CurrColorStroke [private] |
Definition at line 104 of file importai.h.
Referenced by convert(), processData(), and processRaster().
double AIPlug::CurrStrokeShade [private] |
Definition at line 105 of file
