Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 1734 → Rev 1735

/branches/Version13x/Scribus/scribus/fpointarray.cpp
139,6 → 139,11
pd++;
for ( int i=1; i < static_cast<int>(size()); ++i )
{ // find min+max x and y
if (pd->x() > 900000)
{
pd++;
continue;
}
if ( pd->x() < minx )
minx = pd->x();
else
/branches/Version13x/Scribus/scribus/extimageprops.cpp
14,8 → 14,10
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qheader.h>
#include "scpainter.h"
extern QPixmap loadIcon(QString nam);
extern QPointArray FlattenPath(FPointArray ina, QValueList<uint> &Segs);
extern FPoint getMinClipF(FPointArray* Clip);
 
ExtImageProps::ExtImageProps( QWidget* parent, ImageInfoRecord *info, PageItem *item, ScribusView *view ) : QDialog( parent, "ExtImageProps", true, 0 )
{
142,9 → 144,11
for (it2 = info->layerInfo.begin(); it2 != info->layerInfo.end(); ++it2)
{
QCheckBox *cp = new QCheckBox(this, (*it2).layerName);
cp->setChecked(!((*it2).flags & 2));
if ((info->isRequest) && (info->RequestProps.contains(counter)))
cp->setChecked(info->RequestProps[counter].visible);
else
cp->setChecked(!((*it2).flags & 2));
FlagsSicht.append(cp);
// connect(cp2, SIGNAL(clicked()), this, SLOT(visibleLayer()));
connect(cp, SIGNAL(clicked()), this, SLOT(changedLayer()));
layerTable->setCellWidget(info->layerInfo.count()-counter-1, 0, cp);
QPixmap pm;
188,16 → 192,39
pathList = new QListBox( tab_2, "pathList" );
pathList->clear();
QMap<QString, FPointArray>::Iterator it;
QPixmap dummy(16,16);
dummy.fill(white);
if (info->PDSpathData.count() != 0)
{
for (it = info->PDSpathData.begin(); it != info->PDSpathData.end(); ++it)
{
QPixmap pixm(40, 40);
ScPainter *p = new ScPainter(&pixm, 40, 40);
p->clear();
p->translate(3.0, 3.0);
if (it.key() == info->clipPath)
pathList->insertItem(loadIcon("ok.png"), it.key());
{
pixm.fill(green);
p->clear(green);
}
else
pathList->insertItem(dummy, it.key());
pixm.fill(white);
FPointArray Path;
Path.resize(0);
Path = currentItem->imgInfo.PDSpathData[it.key()].copy();
FPoint min = getMinClipF(&Path);
Path.translate(-min.x(), -min.y());
FPoint max = Path.WidthHeight();
QWMatrix mm;
mm.scale(34.0 / QMAX(max.x(), max.y()), 34.0 / QMAX(max.x(), max.y()));
Path.map(mm);
p->setupPolygon(&Path);
p->setPen(black);
p->setBrush(white);
p->setFillMode(0);
p->setLineWidth(1.0);
p->strokePath();
p->end();
delete p;
pathList->insertItem(pixm, it.key());
}
}
tabLayout_2->addWidget( pathList );
208,7 → 235,7
connect(pathList, SIGNAL( highlighted(QListBoxItem*) ), this, SLOT( selPath(QListBoxItem*) ) );
connect(layerTable, SIGNAL(currentChanged(int, int)), this, SLOT(selLayer(int)));
connect(opacitySpinBox, SIGNAL(valueChanged(int)), this, SLOT(changedLayer()));
connect(blendMode, SIGNAL(highlighted(int)), this, SLOT(changedLayer()));
connect(blendMode, SIGNAL(activated(int)), this, SLOT(changedLayer()));
}
 
void ExtImageProps::changedLayer()
215,8 → 242,7
{
struct LoadRequest loadingInfo;
currentItem->imgInfo.isRequest = true;
currentItem->imgInfo.RequestProps.clear();
for (uint r = 0; r < layerTable->numRows(); ++r)
for (int r = 0; r < layerTable->numRows(); ++r)
{
if (currentLayer == layerTable->numRows() - r - 1)
{
223,6 → 249,11
loadingInfo.blend = blendModesRev[blendMode->currentText()];
loadingInfo.opacity = qRound(opacitySpinBox->value() / 100.0 * 255);
}
else if (currentItem->imgInfo.RequestProps.contains(layerTable->numRows() - r - 1))
{
loadingInfo.blend = currentItem->imgInfo.RequestProps[layerTable->numRows() - r - 1].blend;
loadingInfo.opacity = currentItem->imgInfo.RequestProps[layerTable->numRows() - r - 1].opacity;
}
else
{
loadingInfo.blend = currentItem->imgInfo.layerInfo[layerTable->numRows() - r - 1].blend;
237,6 → 268,8
 
void ExtImageProps::selLayer(int layer)
{
disconnect(opacitySpinBox, SIGNAL(valueChanged(int)), this, SLOT(changedLayer()));
disconnect(blendMode, SIGNAL(activated(int)), this, SLOT(changedLayer()));
if ((currentItem->imgInfo.isRequest) && (currentItem->imgInfo.RequestProps.contains(layerTable->numRows() - layer - 1)))
{
opacitySpinBox->setValue(qRound(currentItem->imgInfo.RequestProps[layerTable->numRows() - layer - 1].opacity / 255.0 * 100));
250,6 → 283,8
opacitySpinBox->setEnabled(true);
blendMode->setEnabled(true);
currentLayer = layerTable->numRows() - layer - 1;
connect(opacitySpinBox, SIGNAL(valueChanged(int)), this, SLOT(changedLayer()));
connect(blendMode, SIGNAL(activated(int)), this, SLOT(changedLayer()));
}
 
void ExtImageProps::selPath(QListBoxItem *c)
/branches/Version13x/Scribus/scribus/libpostscript/pslib.h
67,7 → 67,7
virtual void PS_show(double x, double y);
virtual void PS_showSub(uint chr, QString font, double size, bool stroke);
virtual void PS_show_xyG(QString font, QString ch, double x, double y);
virtual void PS_image(bool inver, double x, double y, QString fn, double scalex, double scaley, QString Prof, bool UseEmbedded, bool UseProf, QString Name = "");
virtual void PS_image(PageItem *c, bool inver, double x, double y, QString fn, double scalex, double scaley, QString Prof, bool UseEmbedded, bool UseProf, QString Name = "");
virtual void PS_plate(int nr);
virtual void PS_setGray();
virtual void PDF_Bookmark(QString text, uint Seite);
77,7 → 77,7
virtual void PS_TemplateStart(QString Name, double breite, double hoehe);
virtual void PS_TemplateEnd();
virtual void PS_UseTemplate(QString Name);
virtual void PS_ImageData(bool inver, QString fn, QString Name, QString Prof, bool UseEmbedded, bool UseProf);
virtual void PS_ImageData(PageItem *c, bool inver, QString fn, QString Name, QString Prof, bool UseEmbedded, bool UseProf);
virtual void CreatePS(ScribusDoc* Doc, ScribusView* view, std::vector<int> &pageNs, bool sep, QString SepNam, bool farb, bool Hm, bool Vm, bool Ic, bool gcr);
virtual void ProcessItem(ScribusDoc* Doc, Page* a, PageItem* c, uint PNr, bool sep, bool farb, bool ic, bool gcr, bool master);
virtual void ProcessPage(ScribusDoc* Doc, ScribusView* view, Page* a, uint PNr, bool sep = false, bool farb = true, bool ic = false, bool gcr = true);
/branches/Version13x/Scribus/scribus/libpostscript/pslib.cpp
651,8 → 651,9
PutSeite(stroke ? "shgs\n" : "shgf\n");
}
 
void PSLib::PS_ImageData(bool inver, QString fn, QString Name, QString Prof, bool UseEmbedded, bool UseProf)
void PSLib::PS_ImageData(PageItem *c, bool inver, QString fn, QString Name, QString Prof, bool UseEmbedded, bool UseProf)
{
bool dummy;
QString tmp;
QFileInfo fi = QFileInfo(fn);
QString ext = fi.extension(false).lower();
678,7 → 679,11
}
QString ImgStr = "";
QImage image;
image = LoadPicture(fn, Prof, 0, UseEmbedded, UseProf, 0, 300);
c->imgInfo.valid = false;
c->imgInfo.clipPath = "";
c->imgInfo.PDSpathData.clear();
c->imgInfo.layerInfo.clear();
image = LoadPicture(fn, Prof, 0, UseEmbedded, UseProf, 0, 300, &dummy, &c->imgInfo);
if (inver)
image.invertPixels();
ImgStr = ImageToCMYK_PS(&image, -1, true);
712,8 → 717,9
}
}
 
void PSLib::PS_image(bool inver, double x, double y, QString fn, double scalex, double scaley, QString Prof, bool UseEmbedded, bool UseProf, QString Name)
void PSLib::PS_image(PageItem *c, bool inver, double x, double y, QString fn, double scalex, double scaley, QString Prof, bool UseEmbedded, bool UseProf, QString Name)
{
bool dummy;
QString tmp;
QFileInfo fi = QFileInfo(fn);
QString ext = fi.extension(false).lower();
749,7 → 755,11
{
QString ImgStr = "";
QImage image;
image = LoadPicture(fn, Prof, 0, UseEmbedded, UseProf, 0, 300);
c->imgInfo.valid = false;
c->imgInfo.clipPath = "";
c->imgInfo.PDSpathData.clear();
c->imgInfo.layerInfo.clear();
image = LoadPicture(fn, Prof, 0, UseEmbedded, UseProf, 0, 300, &dummy, &c->imgInfo);
if (inver)
image.invertPixels();
int w = image.width();
995,7 → 1005,7
if ((it->OwnPage != static_cast<int>(Doc->MasterPages.at(ap)->PageNr)) && (it->OwnPage != -1))
continue;
if ((it->itemType() == PageItem::ImageFrame) && (it->PicAvail) && (it->Pfile != "") && (it->isPrintable) && (!sep) && (farb))
PS_ImageData(it->InvPict, it->Pfile, it->itemName(), it->IProfile, it->UseEmbedded, Ic);
PS_ImageData(it, it->InvPict, it->Pfile, it->itemName(), it->IProfile, it->UseEmbedded, Ic);
PS_TemplateStart(Doc->MasterPages.at(ap)->PageNam + tmps.setNum(it->ItemNr), Doc->PageB, Doc->PageH);
ProcessItem(Doc, Doc->MasterPages.at(ap), it, ap+1, sep, farb, Ic, gcr, true);
PS_TemplateEnd();
1104,9 → 1114,9
{
PS_translate(0, -ite->BBoxH*ite->LocalScY);
if ((!sep) && (farb))
PS_image(ite->InvPict, -ite->BBoxX+ite->LocalX, -ite->LocalY, ite->Pfile, ite->LocalScX, ite->LocalScY, ite->IProfile, ite->UseEmbedded, Ic, ite->itemName());
PS_image(ite, ite->InvPict, -ite->BBoxX+ite->LocalX, -ite->LocalY, ite->Pfile, ite->LocalScX, ite->LocalScY, ite->IProfile, ite->UseEmbedded, Ic, ite->itemName());
else
PS_image(ite->InvPict, -ite->BBoxX+ite->LocalX, -ite->LocalY, ite->Pfile, ite->LocalScX, ite->LocalScY, ite->IProfile, ite->UseEmbedded, Ic);
PS_image(ite, ite->InvPict, -ite->BBoxX+ite->LocalX, -ite->LocalY, ite->Pfile, ite->LocalScX, ite->LocalScY, ite->IProfile, ite->UseEmbedded, Ic);
}
PS_restore();
if (((ite->lineColor() != "None") || (ite->NamedLStyle != "")) && (!ite->isTableItem))
1580,9 → 1590,9
{
PS_translate(0, -c->BBoxH*c->LocalScY);
if ((a->PageNam != "") && (!sep) && (farb))
PS_image(c->InvPict, -c->BBoxX+c->LocalX, -c->LocalY, c->Pfile, c->LocalScX, c->LocalScY, c->IProfile, c->UseEmbedded, ic, c->itemName());
PS_image(c, c->InvPict, -c->BBoxX+c->LocalX, -c->LocalY, c->Pfile, c->LocalScX, c->LocalScY, c->IProfile, c->UseEmbedded, ic, c->itemName());
else
PS_image(c->InvPict, -c->BBoxX+c->LocalX, -c->LocalY, c->Pfile, c->LocalScX, c->LocalScY, c->IProfile, c->UseEmbedded, ic);
PS_image(c, c->InvPict, -c->BBoxX+c->LocalX, -c->LocalY, c->Pfile, c->LocalScX, c->LocalScY, c->IProfile, c->UseEmbedded, ic);
}
PS_restore();
if (((c->lineColor() != "None") || (c->NamedLStyle != "")) && (!c->isTableItem))
/branches/Version13x/Scribus/scribus/plugins/psimport/importps.h
31,7 → 31,7
EPSPlug( ScribusApp *plug, QString fName );
~EPSPlug() {};
bool convert(QString fn, double x, double y, double b, double h);
void parseOutput(QString fn);
void parseOutput(QString fn, bool eps);
void LineTo(FPointArray *i, QString vals);
void Curve(FPointArray *i, QString vals);
QString parseColor(QString vals, colorModel model = colorModelCMYK);
/branches/Version13x/Scribus/scribus/plugins/psimport/importps.cpp
345,6 → 345,8
QString tmpFile = Prog->PrefsPfad+"/ps.out";
QString pfad = ScPaths::instance().libDir();
QString pfad2;
QFileInfo fi = QFileInfo(fn);
QString ext = fi.extension(false).lower();
cmd1 = Prog->Prefs.gs_exe;
pfad2 = QDir::convertSeparators(pfad + "import.prolog");
cmd1 += " -q -dNOPAUSE -dNODISPLAY";
358,7 → 360,10
QMessageBox::critical(0, tr("Fatal Error"), mess, 1, 0, 0);
return false;
}
parseOutput(tmpFile);
if (ext == "eps")
parseOutput(tmpFile, true);
else
parseOutput(tmpFile, false);
system("rm -f "+tmpFile);
return true;
}
371,7 → 376,7
\param None
\retval None
*/
void EPSPlug::parseOutput(QString fn)
void EPSPlug::parseOutput(QString fn, bool eps)
{
QString tmp, token, params, lasttoken, lastPath, currPath;
int z, lcap, ljoin, dc, pagecount;
398,7 → 403,7
QTextStream Code(&tmp, IO_ReadOnly);
Code >> token;
params = Code.read();
if ((lasttoken == "sp") && (Prog->pluginManager->dllInput != ""))
if ((lasttoken == "sp") && (Prog->pluginManager->dllInput != "") && (!eps))
{
Prog->view->addPage(pagecount);
pagecount++;