Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 15 → Rev 16

/trunk/Scribus/ChangeLogCVS
1,4 → 1,10
Changes since Version 0.9.10
25.05.2003 util.cpp
page.cpp Improved Rotation of Objects with the Mouse.
scribuxXml.cpp Icons of PDF-Buttons are now saved properly.
scribus.cpp The first Page of a PDF can now placed like a EPS-File.
The Postscript-Exporter embeds now only really used Fonts.
 
24.05.2003 scribus.cpp Improved the Clipboard once more, works now with Nedit, OpenOffice
and Mozilla too.
customfdialog.cpp
/trunk/Scribus/scribus/customfdialog.cpp
96,7 → 96,7
QStrList imfo = QImageIO::inputFormats();
if (ex == "JPG")
ex = "JPEG";
if ((imfo.contains(ex))||(ex=="PS")||(ex=="EPS")||(ex=="TIF"))
if ((imfo.contains(ex))||(ex=="PS")||(ex=="EPS")||(ex=="PDF")||(ex=="TIF"))
{
QImage im = LoadPict(name);
if (!im.isNull())
221,14 → 221,21
TxCodeM->insertItem("KOI8-R");
TxCodeM->insertItem("KOI8-U");
QString localEn = QTextCodec::codecForLocale()->name();
bool hasIt = false;
for (int cc = 0; cc < TxCodeM->count(); cc++)
{
if (TxCodeM->text(cc) == localEn)
{
TxCodeM->setCurrentItem(cc);
hasIt = true;
break;
}
}
if (!hasIt)
{
TxCodeM->insertItem(localEn);
TxCodeM->setCurrentItem(TxCodeM->count()-1);
}
TxCodeM->setMinimumSize(QSize(200, 0));
Layout1C->addWidget(TxCodeM);
QSpacerItem* spacer2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
/trunk/Scribus/scribus/util.cpp
206,6 → 206,19
int ret = -1;
QFileInfo fi = QFileInfo(fn);
QString ext = fi.extension(false).lower();
if (ext == "pdf")
{
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile=/tmp/sc.png -dFirstPage=1 -dLastPage=1 ";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + fn + cmd2);
if (ret == 0)
{
QImage image;
image.load("/tmp/sc.png");
Bild = image.convertDepth(32);
system("rm -f /tmp/sc.png");
}
}
if ((ext == "eps") || (ext == "ps"))
{
QFile f(fn);
353,6 → 366,20
int ret = -1;
QFileInfo fi = QFileInfo(fn);
QString ext = fi.extension(false).lower();
if (ext == "pdf")
{
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile=/tmp/sc.png -dFirstPage=1 -dLastPage=1 ";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + fn + cmd2);
if (ret == 0)
{
QImage image;
image.load("/tmp/sc.png");
Bild = image.convertDepth(32);
system("rm -f /tmp/sc.png");
*realCMYK = false;
}
}
if ((ext == "eps") || (ext == "ps"))
{
QFile f(fn);
/trunk/Scribus/scribus/scribus.cpp
2444,7 → 2444,7
formats += "*."+form+" ";
}
formats += "*.tif";
QString fileName = CFileDialog(tr("Open"),tr("Images")+" ("+formats+tr(");;Postscript (*.eps);;All Files (*)"), "", true);
QString fileName = CFileDialog(tr("Open"),tr("Images")+" ("+formats+tr(");;Vectorimages (*.eps *.pdf);;All Files (*)"), "", true);
if (!fileName.isEmpty())
{
b->EmProfile = "";
2461,11 → 2461,12
}
if (b->PType == 4)
{
QString fileName = CFileDialog(tr("Open"),tr("Textfiles (*.txt);;All Files (*)"));
LoadEnc = "";
QString fileName = CFileDialog(tr("Open"),tr("Textfiles (*.txt);;All Files (*)"), "", false, true, false, true);
if (!fileName.isEmpty())
{
Serializer *ss = new Serializer(fileName);
if (ss->Read())
if (ss->Read(LoadEnc))
{
ss->GetText(b, doc->CurrentABStil);
}
2717,7 → 2718,10
if (printer->OtherCom->isChecked())
PDef.Command = printer->Command->text();
PrinterUsed = true;
PSLib *dd = getPSDriver(true, Prefs.AvailFonts, doc->UsedFonts, doc->PageColors, false);
QMap<QString,QFont> ReallyUsed;
ReallyUsed.clear();
GetUsedFonts(&ReallyUsed);
PSLib *dd = getPSDriver(true, Prefs.AvailFonts, ReallyUsed, doc->PageColors, false);
if (dd != NULL)
{
if (fil)
2875,8 → 2879,6
NoFrameEdit();
if (HaveDoc)
{
if (!BuFromApp)
Buffer2 = ClipB->text(QClipboard::Clipboard);
if (Buffer2.isNull())
return;
if (doc->AppMode == 7)
2965,10 → 2967,13
{
QString cc;
cc = ClipB->text(QClipboard::Clipboard);
if (cc.isNull())
cc = ClipB->text(QClipboard::Selection);
editMenu->setItemEnabled(edid3, 0);
if (!cc.isNull())
{
BuFromApp = false;
Buffer2 = cc;
if (cc.startsWith("<SCRIBUSELEM"))
{
if (doc->AppMode != 7)
3656,9 → 3661,12
}
QString cc;
cc = ClipB->text(QClipboard::Clipboard);
if (cc.isNull())
cc = ClipB->text(QClipboard::Selection);
editMenu->setItemEnabled(edid3, 0);
if (!cc.isNull())
{
Buffer2 = cc;
if (!cc.startsWith("<SCRIBUSELEM"))
{
BuFromApp = false;
5117,7 → 5125,10
bool ScribusApp::DoSaveAsEps(QString fn)
{
qApp->setOverrideCursor(QCursor(waitCursor), true);
PSLib *dd = getPSDriver(false, Prefs.AvailFonts, doc->UsedFonts, doc->PageColors, false);
QMap<QString,QFont> ReallyUsed;
ReallyUsed.clear();
GetUsedFonts(&ReallyUsed);
PSLib *dd = getPSDriver(false, Prefs.AvailFonts, ReallyUsed, doc->PageColors, false);
if (dd != NULL)
{
if (dd->PS_set_file(fn))
5613,13 → 5624,19
}
}
 
QString ScribusApp::CFileDialog(QString caption, QString filter, QString defNa, bool Pre, bool mod, bool comp)
QString ScribusApp::CFileDialog(QString caption, QString filter, QString defNa, bool Pre, bool mod, bool comp, bool cod)
{
CustomFDialog dia(this, caption, filter, Pre, mod, comp);
CustomFDialog dia(this, caption, filter, Pre, mod, comp, cod);
if (defNa != "")
dia.setSelection(defNa);
if (dia.exec() == QDialog::Accepted)
{
if (cod)
LoadEnc = dia.TxCodeM->currentText();
else
LoadEnc = "";
return dia.selectedFile();
}
else
return "";
}
6367,6 → 6384,36
}
}
 
void ScribusApp::GetUsedFonts(QMap<QString,QFont> *Really)
{
for (uint c=0; c<view->MasterPages.count(); ++c)
{
for (uint d=0; d<view->MasterPages.at(c)->Items.count(); ++d)
{
if ((view->MasterPages.at(c)->Items.at(d)->PType == 4) || (view->MasterPages.at(c)->Items.at(d)->PType == 8))
{
for (uint e=0; e<view->MasterPages.at(c)->Items.at(d)->Ptext.count(); ++e)
{
Really->insert(view->MasterPages.at(c)->Items.at(d)->Ptext.at(e)->cfont, doc->UsedFonts[view->MasterPages.at(c)->Items.at(d)->Ptext.at(e)->cfont]);
}
}
}
}
for (uint c=0; c<view->Pages.count(); ++c)
{
for (uint d=0; d<view->Pages.at(c)->Items.count(); ++d)
{
if ((view->Pages.at(c)->Items.at(d)->PType == 4) || (view->Pages.at(c)->Items.at(d)->PType == 8))
{
for (uint e=0; e<view->Pages.at(c)->Items.at(d)->Ptext.count(); ++e)
{
Really->insert(view->Pages.at(c)->Items.at(d)->Ptext.at(e)->cfont, doc->UsedFonts[view->Pages.at(c)->Items.at(d)->Ptext.at(e)->cfont]);
}
}
}
}
}
 
void ScribusApp::slotTest()
{
}
/trunk/Scribus/scribus/page.cpp
14,7 → 14,7
* (at your option) any later version. *
* *
***************************************************************************/
// #include <iostream.h>
#include <iostream.h>
 
#include "page.h"
#include "page.moc"
2575,7 → 2575,6
if (Mpressed && (doku->AppMode == 9))
{
float newW = xy2Deg(newX - qRound(RCenter.x()), newY - qRound(RCenter.y()));
// RotateItem(qRound((b->Rot - (oldW - newW))*100.0)/100.0, b->ItemNr);
RotateItem(b->Rot - (oldW - newW), b->ItemNr);
oldW = newW;
// emit DocChanged();
2856,15 → 2855,16
case 2:
if (b->PType == 5)
{
float sav = doku->SnapGuides;
doku->SnapGuides = false;
npf = FPoint(newX, newY);
npf = ApplyGridF(npf);
p.begin(this);
Transform(b, &p);
mop = QPoint(m->x(), m->y());
npf = p.xFormDev(mop);
nx = np.x();
ny = np.y();
npf = transformPointI(FPoint(nx-Mxp, ny-Myp), 0, 0, b->Rot, 1, 1);
p.end();
float sav = doku->SnapGuides;
npf2 = FPoint(nx-Mxp, ny-Myp);
erf = MoveSizeItem(np2, np, b->ItemNr);
erf = MoveSizeItem(npf, npf, b->ItemNr);
doku->SnapGuides = sav;
if (sav)
b->Sizing = true;
3635,27 → 3635,27
p.begin(this);
Transform(b, &p);
doku->RotMode = 2;
RCenter = transformPointI(FPoint(b->Width/2, b->Height/2), b->Xpos, b->Ypos, b->Rot, 1, 1);
RCenter = transformPointI(FPoint(b->Xpos+b->Width/2, b->Ypos+b->Height/2), 0, 0, b->Rot, 1, 1);
if (QRegion(p.xForm(QPointArray(QRect(0, 0, static_cast<int>(b->Width), static_cast<int>(b->Height))))).contains(mpo))
{
if (p.xForm(QRect(static_cast<int>(b->Width)-6, static_cast<int>(b->Height)-6, 6, 6)).intersects(mpo))
{
RCenter = transformPointI(FPoint(0, 0), b->Xpos, b->Ypos, b->Rot, 1, 1);
RCenter = FPoint(b->Xpos, b->Ypos);
doku->RotMode = 0;
}
if (p.xForm(QRect(0, 0, 6, 6)).intersects(mpo))
{
RCenter = transformPointI(FPoint(b->Width, b->Height), b->Xpos, b->Ypos, b->Rot, 1, 1);
RCenter = transformPointI(FPoint(b->Xpos+b->Width, b->Ypos+b->Height), 0, 0, b->Rot, 1, 1);
doku->RotMode = 4;
}
if (p.xForm(QRect(0, static_cast<int>(b->Height)-6, 6, 6)).intersects(mpo))
{
RCenter = transformPointI(FPoint(b->Width, 0), b->Xpos, b->Ypos, b->Rot, 1, 1);
RCenter = transformPointI(FPoint(b->Xpos+b->Width, b->Ypos), 0, 0, b->Rot, 1, 1);
doku->RotMode = 1;
}
if (p.xForm(QRect(static_cast<int>(b->Width)-6, 0, 6, 6)).intersects(mpo))
{
RCenter = transformPointI(FPoint(0, b->Height), b->Xpos, b->Ypos, b->Rot, 1, 1);
RCenter = transformPointI(FPoint(b->Xpos, b->Ypos+b->Height), 0, 0, b->Rot, 1, 1);
doku->RotMode = 3;
}
oldW = xy2Deg(Mxp - qRound(RCenter.x()), Myp - qRound(RCenter.y()));
6514,6 → 6514,39
int ret = -1;
QFileInfo fi = QFileInfo(fn);
QString ext = fi.extension(false).lower();
if (ext == "pdf")
{
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile=/tmp/sc.png -dFirstPage=1 -dLastPage=1 ";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + fn + cmd2);
if (ret == 0)
{
QImage im4;
QImage image;
image.load("/tmp/sc.png");
image = image.convertDepth(32);
im4 = ProofPict(&image, Items.at(ItNr)->IProfile, Items.at(ItNr)->IRender);
Items.at(ItNr)->pixm = im4;
Items.at(ItNr)->Pfile = fi.absFilePath();
Items.at(ItNr)->PicAvail = true;
Items.at(ItNr)->PicArt = true;
Items.at(ItNr)->isRaster = false;
Items.at(ItNr)->BBoxX = 0;
Items.at(ItNr)->BBoxH = Items.at(ItNr)->pixm.height();
Items.at(ItNr)->OrigW = Items.at(ItNr)->pixm.width();
Items.at(ItNr)->OrigH = Items.at(ItNr)->pixm.height();
Items.at(ItNr)->LocalViewX = Items.at(ItNr)->LocalScX;
Items.at(ItNr)->LocalViewY = Items.at(ItNr)->LocalScY;
system("rm -f /tmp/sc.png");
}
else
{
Items.at(ItNr)->Pfile = fn;
Items.at(ItNr)->PicAvail = false;
Items.at(ItNr)->PicArt = false;
}
return;
}
if ((ext == "eps") || (ext == "ps"))
{
QFile f(fn);
6586,7 → 6619,6
int hi = image.height();
QBitmap bm("/tmp/sc.png");
bm.fill(Qt::color1);
// int i = 0;
QPainter pp;
pp.begin(&bm);
pp.setPen(Qt::color0);
6600,7 → 6632,6
{
if(image.color(s[xi]) == 0xffffffff)
pp.drawPoint(xi, yi);
// i++;
}
}
}
/trunk/Scribus/scribus/libpdf/pdflib.cpp
2667,50 → 2667,66
}
}
#endif
if (ext == "eps")
if ((ext == "eps") || (ext == "pdf"))
{
QFile f(fn);
if (f.open(IO_ReadOnly))
if (ext == "pdf")
{
QTextStream ts(&f);
while (!ts.atEnd())
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r"+IToStr(Options->Resolution)+" -sOutputFile=/tmp/sc.png -dFirstPage=1 -dLastPage=1 ";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + fn + cmd2);
if (ret == 0)
{
tc = ' ';
tmp = "";
while ((tc != '\n') && (tc != '\r'))
QImage image;
image.load("/tmp/sc.png");
img = image.convertDepth(32);
system("rm -f /tmp/sc.png");
}
}
else
{
QFile f(fn);
if (f.open(IO_ReadOnly))
{
QTextStream ts(&f);
while (!ts.atEnd())
{
ts >> tc;
if ((tc != '\n') && (tc != '\r'))
tmp += tc;
}
if (tmp.startsWith("%%BoundingBox"))
tc = ' ';
tmp = "";
while ((tc != '\n') && (tc != '\r'))
{
ts >> tc;
if ((tc != '\n') && (tc != '\r'))
tmp += tc;
}
if (tmp.startsWith("%%BoundingBox"))
{
found = true;
BBox = tmp;
}
if (tmp.startsWith("%%EndComments"))
break;
}
f.close();
if (found)
{
found = true;
BBox = tmp;
QTextStream ts2(&BBox, IO_ReadOnly);
ts2 >> dummy >> x2 >> y2 >> b >> h;
x2 = x2 * aufl;
y2 = y2 * aufl;
b = b * aufl;
h = h * aufl;
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r"+IToStr(Options->Resolution)+" -sOutputFile=/tmp/sc.png -g";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + tmp.setNum(qRound(b)) + "x" + tmp.setNum(qRound(h)) + " " + fn + cmd2);
if (ret == 0)
{
QImage image;
image.load("/tmp/sc.png");
image = image.convertDepth(32);
img = image.copy(static_cast<int>(x2), 0, static_cast<int>(b-x2), static_cast<int>(h-y2));
system("rm -f /tmp/sc.png");
}
}
if (tmp.startsWith("%%EndComments"))
break;
}
f.close();
if (found)
{
QTextStream ts2(&BBox, IO_ReadOnly);
ts2 >> dummy >> x2 >> y2 >> b >> h;
x2 = x2 * aufl;
y2 = y2 * aufl;
b = b * aufl;
h = h * aufl;
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r"+IToStr(Options->Resolution)+" -sOutputFile=/tmp/sc.png -g";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + tmp.setNum(qRound(b)) + "x" + tmp.setNum(qRound(h)) + " " + fn + cmd2);
if (ret == 0)
{
QImage image;
image.load("/tmp/sc.png");
image = image.convertDepth(32);
img = image.copy(static_cast<int>(x2), 0, static_cast<int>(b-x2), static_cast<int>(h-y2));
system("rm -f /tmp/sc.png");
}
}
}
if (Options->RecalcPic)
/trunk/Scribus/scribus/scribus.h
110,6 → 110,7
void SwitchWin();
void RestoreBookMarks();
void AdjustBM();
void GetUsedFonts(QMap<QString,QFont> *Really);
struct CLBuf Buffer;
QString Buffer2;
QString Buffer3;
/trunk/Scribus/scribus/po/scribus.de_DE.po
218,8 → 218,8
msgid "Images"
msgstr "Rasterbilder"
 
msgid ");;Postscript (*.eps);;All Files (*)"
msgstr ");;Vektorbilder (*.eps);;Alle Dateien (*)"
msgid ");;Vectorimages (*.eps *.pdf);;All Files (*)"
msgstr ");;Vektorbilder (*.eps *.pdf);;Alle Dateien (*)"
 
msgid "Look &in:"
msgstr "Suche &in:"
2735,3 → 2735,21
msgid "To adjust the Display drag the Ruler below with the Slider."
msgstr "Zum Einstellen der Anzeigegröße das Lineal mit dem Regler anpassen"
 
msgid "Show PDF-Tools"
msgstr "PDF-Werkzeuge zeigen"
 
msgid "Hide PDF-Tools"
msgstr "PDF-Werkzeuge verbergen"
 
msgid "Shears the Path horizotal to the right"
msgstr "Scherung nach rechts"
 
msgid "Shears the Path horizotal to the left"
msgstr "Scherung nach links"
 
msgid "Shears the Path vertical up"
msgstr "Scherung nach open"
 
msgid "Shears the Path vertical down"
msgstr "Scherung nach unten"
 
/trunk/Scribus/scribus/scribusXml.h
20,6 → 20,7
public:
ScriXmlDoc() {};
~ScriXmlDoc() {};
QString Path2Relative(QString Path);
QString ReadDatei(QString fileName);
bool ReadColors(QString fileName);
int ReadPageCount(QString fileName);
/trunk/Scribus/scribus/scribusXml.cpp
27,6 → 27,36
extern int QStoInt(QString in);
extern bool loadText(QString nam, QString *Buffer);
 
QString ScriXmlDoc::Path2Relative(QString Path)
{
QString Ndir = "";
QStringList Pdir = QStringList::split("/", QDir::currentDirPath());
QFileInfo Bfi = QFileInfo(Path);
QStringList Bdir = QStringList::split("/", Bfi.dirPath(true));
bool ende = true;
uint dcoun = 0;
uint dcoun2 = 0;
while (ende)
{
if (Pdir[dcoun] == Bdir[dcoun])
dcoun++;
else
break;
if (dcoun > Pdir.count())
break;
}
dcoun2 = dcoun;
for (uint ddx2 = dcoun; ddx2 < Pdir.count(); ddx2++)
{
Ndir += "../";
}
for (uint ddx = dcoun2; ddx < Bdir.count(); ddx++)
{
Ndir += Bdir[ddx]+"/";
}
Ndir += Bfi.fileName();
return Ndir;
}
QString ScriXmlDoc::ReadDatei(QString fileName)
{
/**
1590,15 → 1620,15
ob.setAttribute("IFONT",item->IFont);
ob.setAttribute("ISIZE",item->ISize);
if (item->Pfile != "")
ob.setAttribute("PFILE",item->Pfile);
ob.setAttribute("PFILE",Path2Relative(item->Pfile));
else
ob.setAttribute("PFILE","");
if (item->Pfile2 != "")
ob.setAttribute("PFILE2",item->Pfile2);
ob.setAttribute("PFILE2",Path2Relative(item->Pfile2));
else
ob.setAttribute("PFILE2","");
if (item->Pfile3 != "")
ob.setAttribute("PFILE3",item->Pfile3);
ob.setAttribute("PFILE3",Path2Relative(item->Pfile3));
else
ob.setAttribute("PFILE3","");
ob.setAttribute("PRFILE",item->IProfile);
1899,45 → 1929,16
ob.setAttribute("TEXTRA",item->TExtra);
ob.setAttribute("BEXTRA",item->BExtra);
ob.setAttribute("REXTRA",item->RExtra);
if ((item->PType == 2) && (item->Pfile != ""))
{
Ndir = "";
QStringList Pdir = QStringList::split("/", QDir::currentDirPath());
QFileInfo Bfi = QFileInfo(item->Pfile);
QStringList Bdir = QStringList::split("/", Bfi.dirPath(true));
bool ende = true;
uint dcoun = 0;
uint dcoun2 = 0;
while (ende)
{
if (Pdir[dcoun] == Bdir[dcoun])
dcoun++;
else
break;
if (dcoun > Pdir.count())
break;
}
dcoun2 = dcoun;
for (uint ddx2 = dcoun; ddx2 < Pdir.count(); ddx2++)
{
Ndir += "../";
}
for (uint ddx = dcoun2; ddx < Bdir.count(); ddx++)
{
Ndir += Bdir[ddx]+"/";
}
Ndir += Bfi.fileName();
}
if (item->Pfile != "")
ob.setAttribute("PFILE",Ndir);
if (((item->PType == 2) || (item->PType == 4)) && (item->Pfile != ""))
ob.setAttribute("PFILE",Path2Relative(item->Pfile));
else
ob.setAttribute("PFILE","");
if (item->Pfile2 != "")
ob.setAttribute("PFILE2",item->Pfile2);
ob.setAttribute("PFILE2",Path2Relative(item->Pfile2));
else
ob.setAttribute("PFILE2","");
if (item->Pfile3 != "")
ob.setAttribute("PFILE3",item->Pfile3);
ob.setAttribute("PFILE3",Path2Relative(item->Pfile3));
else
ob.setAttribute("PFILE3","");
ob.setAttribute("PRFILE",item->IProfile);
/trunk/Scribus/scribus/qm/scribus.de.qm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream