Subversion Repositories Scribus

Compare Revisions

Regard whitespace Rev 203 → Rev 204

/trunk/Scribus/ChangeLogCVS
1,4 → 1,9
Changes since Version 1.1.5
22.02.2004 Included Patches from Jean-Jacques Sarton.
Fixed Bug #278
Updated the Ukrainian Translation.
Another addition for the Scripter from Petr Vanek.
 
21.02.2004 Added ability to include Softmasks into PDFs when exporting to PDF 1.4
Fixed Bugs #279, #277, #235
Bug #235 was fixed by Petr Vanek.
/trunk/Scribus/scribus/util.cpp
33,6 → 33,7
#include <cmath>
#include "md5.h"
#include <setjmp.h>
#include "qprocess.h"
 
#if (_MSC_VER >= 1200)
#include "win-config.h"
122,6 → 123,10
QImage ProofPict(QImage *Im, QString Prof, int Rend);
#endif
QImage ProofImage(QImage *Im);
int System(const QStringList & args);
int callGS(const QStringList & args_in);
int copyFile(QString source, QString target);
int moveFile(QString source, QString target);
 
#ifdef HAVE_CMS
QImage ProofPict(QImage *Im, QString Prof, int Rend, cmsHPROFILE emPr)
223,6 → 228,101
#endif
}
 
/******************************************************************
* Function System()
*
* Create a new process via QProcess and wait until finished.
* return the process exit code.
*
******************************************************************/
 
int System(const QStringList & args)
{
QProcess *proc = new QProcess(NULL);
proc->setArguments(args);
if ( !proc->start() )
{
return 1;
}
/* start was OK */
while(proc->isRunning())
{
/* wait a little bit */
usleep(5000);
}
int ex = proc->exitStatus();
delete proc;
return ex;
}
 
/******************************************************************
* Function callGS()
* build the complete list of arguments for the call of our
* System() function.
*
* The gs commands are all similar and consist of a few constant
* arguments, the variablke arguments and the end arguments which
* are also invariant.
******************************************************************/
int callGS(const QStringList & args_in)
{
QStringList args;
 
/* these parameters are always the same */
args.append("gs");
args.append("-q");
args.append("-dNOPAUSE");
args.append("-sDEVICE=png16m");
/* insert specific arguments */
QStringList p;
p = args_in;
args += args_in;
/* insert last unspecific arguments */
args.append("-c");
args.append("showpage");
args.append("-c");
args.append("quit");
return System(args);
}
 
int copyFile(QString source, QString target)
{
if ((source.isNull()) || (target.isNull()))
return -1;
if (source == target)
return -1;
QFile s(source);
QFile t(target);
if (!s.exists())
return -1;
QByteArray bb(s.size());
if (s.open(IO_ReadOnly))
{
s.readBlock(bb.data(), s.size());
s.close();
if (t.open(IO_WriteOnly))
{
t.writeBlock(bb.data(), bb.size());
t.close();
}
}
return 0;
}
 
int moveFile(QString source, QString target)
{
if ((source.isNull()) || (target.isNull()))
return -1;
if (source == target)
return -1;
copyFile(source, target);
unlink(source);
return 0;
}
 
QPixmap LoadPDF(QString fn, int Seite, int Size, int *w, int *h)
{
QString tmp, cmd1, cmd2;
230,14 → 330,18
QPixmap pm;
int ret = -1;
tmp.setNum(Seite);
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile="+tmpFile+" -dFirstPage="+tmp+" -dLastPage="+tmp+" ";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + "\"" + fn + "\"" + cmd2);
QStringList args;
args.append("-r72");
args.append("-sOutputFile="+tmpFile);
args.append("-dFirstPage="+tmp);
args.append("-dLastPage="+tmp);
args.append(fn);
ret = callGS(args);
if (ret == 0)
{
QImage image;
image.load(tmpFile);
system("rm -f "+tmpFile);
unlink(tmpFile);
QImage im2;
*h = image.height();
*w = image.width();
270,15 → 374,19
QString ext = fi.extension(false).lower();
if (ext == "pdf")
{
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile="+tmpFile+" -dFirstPage=1 -dLastPage=1 ";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + "\"" + fn + "\"" + cmd2);
QStringList args;
args.append("-r72");
args.append("-sOutputFile="+tmpFile);
args.append("-dFirstPage=1");
args.append("-dLastPage=1");
args.append(fn);
ret = callGS(args);
if (ret == 0)
{
QImage image;
image.load(tmpFile);
Bild = image.convertDepth(32);
system("rm -f "+tmpFile);
unlink(tmpFile);
}
}
if ((ext == "eps") || (ext == "ps"))
310,10 → 418,12
{
QTextStream ts2(&BBox, IO_ReadOnly);
ts2 >> dummy >> x >> y >> b >> h;
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile="+tmpFile+" -g";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + tmp.setNum(qRound(b)) + "x" + tmp2.setNum(qRound(h)) + " \"" +
fn + "\"" + cmd2);
QStringList args;
args.append("-r72");
args.append("-sOutputFile="+tmpFile);
args.append("-g"+tmp.setNum(qRound(b))+"x"+tmp2.setNum(qRound(h)));
args.append(fn);
ret = callGS(args);
if (ret == 0)
{
QImage image;
333,7 → 443,7
}
}
Bild = image.copy(static_cast<int>(x), 0, static_cast<int>(b-x), static_cast<int>(h-y));
system("rm -f "+tmpFile);
unlink(tmpFile);
}
}
}
414,15 → 524,19
QString ext = fi.extension(false).lower();
if (ext == "pdf")
{
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile="+tmpFile+" -dFirstPage=1 -dLastPage=1 ";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + "\"" + fn + "\"" + cmd2);
QStringList args;
args.append("-r72");
args.append("-sOutputFile="+tmpFile);
args.append("-dFirstPage=1");
args.append("-dLastPage=1");
args.append(fn);
ret = callGS(args);
if (ret == 0)
{
QImage image;
image.load(tmpFile);
Bild = image.convertDepth(32);
system("rm -f "+tmpFile);
unlink(tmpFile);
*realCMYK = false;
}
}
455,10 → 569,12
{
QTextStream ts2(&BBox, IO_ReadOnly);
ts2 >> dummy >> x >> y >> b >> h;
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile="+tmpFile+" -g";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + tmp.setNum(qRound(b)) + "x" + tmp2.setNum(qRound(h)) + " \"" +
fn + "\"" + cmd2);
QStringList args;
args.append("-r72");
args.append("-sOutputFile="+tmpFile);
args.append("-g"+tmp.setNum(qRound(b))+"x"+tmp2.setNum(qRound(h)));
args.append(fn);
ret = callGS(args);
if (ret == 0)
{
QImage image;
478,7 → 594,7
}
}
Bild = image.copy(static_cast<int>(x), 0, static_cast<int>(b-x), static_cast<int>(h-y));
system("rm -f "+tmpFile);
unlink(tmpFile);
*realCMYK = false;
}
}
/trunk/Scribus/scribus/pageitem.h
129,6 → 129,7
Page *OwnPage;
/** Darzustellendes Bild */
QImage pixm;
QImage pixmOrg;
/** Dateiname des Bildes */
QString Pfile;
QString Pfile2;
/trunk/Scribus/scribus/pageitem.cpp
97,6 → 97,7
Ptext.setAutoDelete(true);
Pfile = "";
pixm = QImage();
pixmOrg = QImage();
Pfile2 = "";
Pfile3 = "";
LocalScX = 1;
761,11 → 762,14
double TopOffset;
double BotOffset = desc2+BExtra+lineCorr;
if (StartOfCol)
{
TopOffset = asce+TExtra+lineCorr;
CurY = asce+TExtra+lineCorr+1;
}
else
TopOffset = asce;
pt1 = QPoint(qRound(CurX), qRound(CurY+BotOffset));
pt2 = QPoint(qRound(CurX), qRound(CurY-TopOffset));
pt1 = QPoint(static_cast<int>(ceil(CurX)), static_cast<int>(ceil(CurY+BotOffset)));
pt2 = QPoint(static_cast<int>(ceil(CurX)), static_cast<int>(ceil(CurY-TopOffset)));
while ((!cl.contains(pf.xForm(pt1))) || (!cl.contains(pf.xForm(pt2))))
{
fBorder = true;
790,7 → 794,8
ColBound = FPoint((ColWidth + ColGap) * CurrCol + Extra+lineCorr, ColWidth * (CurrCol+1) + ColGap * CurrCol + Extra+lineCorr);
CurX = ColBound.x();
ColBound = FPoint(ColBound.x(), ColBound.y()+RExtra+lineCorr);
CurY = TExtra+lineCorr;
CurY = asce+TExtra+lineCorr+1;
// CurY = TExtra+lineCorr;
if ((a > 0) && (Ptext.at(a-1)->ch == QChar(13)))
{
if (chx != QChar(13))
801,7 → 806,7
CurX += Doc->Vorlagen[hl->cab].Indent;
if (DropCmode)
desc2 = -(*Doc->AllFonts)[hl->cfont]->numDescender * Doc->Vorlagen[hl->cab].LineSpa * Doc->Vorlagen[hl->cab].DropLin;
CurY = TExtra+lineCorr;
// CurY = TExtra+lineCorr;
CurY += Doc->Vorlagen[hl->cab].Avor;
if (DropCmode)
DropLines = Doc->Vorlagen[hl->cab].DropLin;
816,8 → 821,8
}
}
}
pt1 = QPoint(qRound(CurX), qRound(CurY+BotOffset));
pt2 = QPoint(qRound(CurX), qRound(CurY-TopOffset));
pt1 = QPoint(static_cast<int>(ceil(CurX)), static_cast<int>(ceil(CurY+BotOffset)));
pt2 = QPoint(static_cast<int>(ceil(CurX)), static_cast<int>(ceil(CurY-TopOffset)));
}
if ((fBorder) && (!AbsHasDrop))
CurX += Extra;
885,8 → 890,8
hl->xp = CurX;
if ((TabCode == 4) && (RTab))
CurX += (wide+hl->cextra) / 2;
pt1 = QPoint(qRound(CurX), qRound(CurY+desc+BExtra+lineCorr));
pt2 = QPoint(qRound(CurX), qRound(CurY-asce));
pt1 = QPoint(static_cast<int>(ceil(CurX)), static_cast<int>(ceil(CurY+desc+BExtra+lineCorr)));
pt2 = QPoint(static_cast<int>(ceil(CurX)), static_cast<int>(ceil(CurY-asce)));
if ((!cl.contains(pf.xForm(pt1))) || (!cl.contains(pf.xForm(pt2))) || (CurX+RExtra+lineCorr > ColBound.y()))
outs = true;
Zli = new ZZ;
953,6 → 958,7
if ((hl->ch == QChar(13)) || (outs))
{
RTab = false;
StartOfCol = false;
TabCode = 0;
if (outs)
{
986,8 → 992,8
EndX = LastXp;
do
{
pt1 = QPoint(qRound(EndX), qRound(CurY+desc));
pt2 = QPoint(qRound(EndX), qRound(CurY-asce));
pt1 = QPoint(qRound(EndX), static_cast<int>(ceil(CurY+desc)));
pt2 = QPoint(qRound(EndX), static_cast<int>(ceil(CurY-asce)));
EndX++;
}
while ((cl.contains(pf.xForm(pt1))) && (cl.contains(pf.xForm(pt2))) && (EndX+RExtra+lineCorr < ColBound.y()));
1046,8 → 1052,8
EndX = CurX;
do
{
pt1 = QPoint(qRound(EndX), qRound(CurY+desc));
pt2 = QPoint(qRound(EndX), qRound(CurY-asce));
pt1 = QPoint(qRound(EndX), static_cast<int>(ceil(CurY+desc)));
pt2 = QPoint(qRound(EndX), static_cast<int>(ceil(CurY-asce)));
EndX++;
}
while ((cl.contains(pf.xForm(pt1))) && (cl.contains(pf.xForm(pt2))) && (EndX+RExtra+lineCorr < ColBound.y()));
1107,8 → 1113,8
}
bool fromOut = true;
double BotOffset = desc+BExtra+lineCorr;
pt1 = QPoint(qRound(CurX), qRound(CurY+BotOffset));
pt2 = QPoint(qRound(CurX), qRound(CurY-asce));
pt1 = QPoint(qRound(CurX), static_cast<int>(ceil(CurY+BotOffset)));
pt2 = QPoint(qRound(CurX), static_cast<int>(ceil(CurY-asce)));
while ((!cl.contains(pf.xForm(pt1))) || (!cl.contains(pf.xForm(pt2))))
{
CurX++;
1138,8 → 1144,8
}
break;
}
pt1 = QPoint(qRound(CurX), qRound(CurY+BotOffset));
pt2 = QPoint(qRound(CurX), qRound(CurY-asce));
pt1 = QPoint(qRound(CurX), static_cast<int>(ceil(CurY+BotOffset)));
pt2 = QPoint(qRound(CurX), static_cast<int>(ceil(CurY-asce)));
}
if (fromOut)
CurX--;
1222,8 → 1228,8
EndX = CurX;
do
{
pt1 = QPoint(qRound(EndX), qRound(CurY+desc));
pt2 = QPoint(qRound(EndX), qRound(CurY-asce));
pt1 = QPoint(qRound(EndX), static_cast<int>(ceil(CurY+desc)));
pt2 = QPoint(qRound(EndX), static_cast<int>(ceil(CurY-asce)));
EndX++;
}
while ((cl.contains(pf.xForm(pt1))) && (cl.contains(pf.xForm(pt2))) && (EndX+RExtra+lineCorr < ColBound.y()));
/trunk/Scribus/scribus/libabout/about.cpp
54,7 → 54,7
tabLayout1->addWidget( PixmapLabel1 );
BuildID = new QLabel( tab, "BB" );
BuildID->setAlignment(Qt::AlignCenter);
QString bu = tr("%1. %2 %3 ").arg(21).arg("February").arg(2004);
QString bu = tr("%1. %2 %3 ").arg(22).arg("February").arg(2004);
#ifdef HAVE_CMS
bu += "C";
#else
88,6 → 88,8
"<tr><td>Paul F. Johnson</td><td>paul@all-the-johnsons.co.uk</td></tr>" +
"<tr><td>Craig Bradney</td><td>cbradney@zip.com.au</td></tr>" +
"<tr><td>Alessandro Rimoldi</td><td>http://ideale.ch/contact</td></tr>" +
"<tr><td>Petr Vaněk</td><td>subzero@py.cz</td></tr>" +
"<tr><td>Jean-Jacques Sarton</td><td>jj.sarton@t-online.de</td></tr>" +
"<tr><td>Christian Töpp</td><td>mr-ct@gmx.de</td></tr>" +
"<tr><td>Alastair Robinson</td><td>blackfive@fakenhamweb.co.uk</td></tr>" +
"<tr><td></td><td> </td></tr>" +
/trunk/Scribus/scribus/scribus.cpp
17,6 → 17,7
 
#include <qaccel.h>
#include <qapplication.h>
#include <qeventloop.h>
#include <qcolordialog.h>
#include <qcolor.h>
#include <qiconset.h>
89,6 → 90,8
extern bool overwrite(QWidget *parent, QString filename);
extern void CopyPageItem(struct CLBuf *Buffer, PageItem *b);
extern void ReOrderText(ScribusDoc *doc, ScribusView *view);
extern int copyFile(QString source, QString target);
extern int moveFile(QString source, QString target);
 
using namespace std;
 
177,19 → 180,19
QFileInfo OldPi = QFileInfo(OldPR);
if (OldPi.exists())
{
system("mv " + OldPR + " " + Pff+"/scribus.rc");
moveFile(OldPR, Pff+"/scribus.rc");
}
QString OldPR2 = QString(getenv("HOME"))+"/.scribusfont.rc";
QFileInfo OldPi2 = QFileInfo(OldPR2);
if (OldPi2.exists())
{
system("mv " + OldPR2 + " " + Pff+"/scribusfont.rc");
moveFile(OldPR2, Pff+"/scribusfont.rc");
}
QString OldPR3 = QString(getenv("HOME"))+"/.scribusscrap.scs";
QFileInfo OldPi3 = QFileInfo(OldPR3);
if (OldPi3.exists())
{
system("mv " + OldPR3 + " " + Pff+"/scrap.scs");
moveFile(OldPR3, Pff+"/scrap.scs");
}
}
/** Erstelle Fontliste */
1512,7 → 1515,7
ScBook->Save();
}
if (ScBook->BibWin->Objekte.count() == 0)
system("rm -f " + PrefsPfad+"/scrap.scs");
unlink(PrefsPfad+"/scrap.scs");
Prefs.AvailFonts.~SCFonts();
FinalizePlugs();
exit(0);
1527,7 → 1530,7
ScBook->Save();
}
if (ScBook->BibWin->Objekte.count() == 0)
system("rm -f " + PrefsPfad+"/scrap.scs");
unlink(PrefsPfad+"/scrap.scs");
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
Prefs.AvailFonts.~SCFonts();
FinalizePlugs();
2778,9 → 2781,13
b->UseEmbedded = true;
b->IProfile = doc->CMSSettings.DefaultInputProfile;
b->IRender = doc->CMSSettings.DefaultIntentMonitor2;
qApp->setOverrideCursor( QCursor(Qt::WaitCursor) );
qApp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
doc->ActPage->LoadPict(fileName, b->ItemNr);
doc->ActPage->AdjustPictScale(b);
doc->ActPage->AdjustPreview(b);
qApp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
qApp->restoreOverrideCursor();
doc->ActPage->update();
Mpal->Cpal->SetColors(doc->PageColors);
Mpal->updateCList();
3106,7 → 3113,7
cmd += " "+PrefsPfad+"/tmp.ps";
system(cmd);
}
system("rm -f "+PrefsPfad+"/tmp.ps");
unlink(PrefsPfad+"/tmp.ps");
}
}
else
5927,6 → 5934,8
{
doc->PDF_Optionen.UseRGB = false;
#ifdef HAVE_CMS
if (CMSuse)
{
doc->PDF_Optionen.UseProfiles = dia->EmbedProfs->isChecked();
doc->PDF_Optionen.UseProfiles2 = dia->EmbedProfs2->isChecked();
doc->PDF_Optionen.Intent = dia->IntendS->currentItem();
5958,6 → 5967,12
doc->PDF_Optionen.PresentMode = false;
doc->PDF_Optionen.Encrypt = false;
}
}
else
{
doc->PDF_Optionen.UseProfiles = false;
doc->PDF_Optionen.UseProfiles2 = false;
}
#else
doc->PDF_Optionen.UseProfiles = false;
doc->PDF_Optionen.UseProfiles2 = false;
6306,6 → 6321,8
if (dia.exec() == QDialog::Accepted)
{
LoadEnc = cod ? dia.TxCodeM->currentText() : "";
this->repaint();
qApp->eventLoop()->processEvents(QEventLoop::ExcludeUserInput);
return dia.selectedFile();
}
return "";
7113,9 → 7130,7
QFileInfo itf = QFileInfo(ite->Pfile);
if (itf.exists())
{
QCString cmd = "cp \"" + QFile::encodeName(ite->Pfile) +
"\" \"" + QCString(s) + QFile::encodeName(itf.fileName())+"\"";
system(cmd);
copyFile(ite->Pfile, s + itf.fileName());
ite->Pfile = s + itf.fileName();
}
}
7123,7 → 7138,6
{
if (ite->isAnnotation)
{
QString cmd = "";
QFileInfo itf;
if (ite->Pfile != "")
{
7130,9 → 7144,7
itf = QFileInfo(ite->Pfile);
if (itf.exists())
{
cmd = "cp \"" + QFile::encodeName(ite->Pfile) +
"\" \"" + QCString(s) + QFile::encodeName(itf.fileName())+"\"";
system(cmd);
copyFile(ite->Pfile, s + itf.fileName());
ite->Pfile = s + itf.fileName();
}
}
7141,9 → 7153,7
itf = QFileInfo(ite->Pfile2);
if (itf.exists())
{
cmd = "cp \"" + QFile::encodeName(ite->Pfile2) +
"\" \"" + QCString(s) + QFile::encodeName(itf.fileName())+"\"";
system(cmd);
copyFile(ite->Pfile2, s + itf.fileName());
ite->Pfile2 = s + itf.fileName();
}
}
7152,9 → 7162,7
itf = QFileInfo(ite->Pfile3);
if (itf.exists())
{
cmd = "cp \"" + QFile::encodeName(ite->Pfile3) +
"\" \"" + QCString(s) + QFile::encodeName(itf.fileName())+"\"";
system(cmd);
copyFile(ite->Pfile3, s + itf.fileName());
ite->Pfile3 = s + itf.fileName();
}
}
7172,9 → 7180,7
QFileInfo itf = QFileInfo(ite->Pfile);
if (itf.exists())
{
QCString cmd = "cp \"" + QFile::encodeName(ite->Pfile) +
"\" \"" + QCString(s) + QFile::encodeName(itf.fileName())+"\"";
system(cmd);
copyFile(ite->Pfile, s + itf.fileName());
ite->Pfile = s + itf.fileName();
}
}
7182,7 → 7188,6
{
if (ite->isAnnotation)
{
QCString cmd = "";
QFileInfo itf;
if (ite->Pfile != "")
{
7189,9 → 7194,7
itf = QFileInfo(ite->Pfile);
if (itf.exists())
{
cmd = "cp \"" + QFile::encodeName(ite->Pfile) +
"\" \"" + QCString(s) + QFile::encodeName(itf.fileName())+"\"";
system(cmd);
copyFile(ite->Pfile, s + itf.fileName());
ite->Pfile = s + itf.fileName();
}
}
7200,9 → 7203,7
itf = QFileInfo(ite->Pfile2);
if (itf.exists())
{
cmd = "cp \"" + QFile::encodeName(ite->Pfile2) +
"\" \"" + QCString(s) + QFile::encodeName(itf.fileName())+"\"";
system(cmd);
copyFile(ite->Pfile2, s + itf.fileName());
ite->Pfile2 = s + itf.fileName();
}
}
7211,9 → 7212,7
itf = QFileInfo(ite->Pfile3);
if (itf.exists())
{
cmd = "cp \"" + QFile::encodeName(ite->Pfile3) +
"\" \"" + QCString(s) + QFile::encodeName(itf.fileName())+"\"";
system(cmd);
copyFile(ite->Pfile, s + itf.fileName());
ite->Pfile3 = s + itf.fileName();
}
}
/trunk/Scribus/scribus/plugins/scriptplugin/guiapp.h
23,4 → 23,10
*/
PyObject *scribus_setcursor(PyObject *self, PyObject* args);
 
/**
Enable/disable save icon
(Petr Vanek 02/20/04)
*/
PyObject *scribus_docchanged(PyObject *self, PyObject* args);
 
#endif
/trunk/Scribus/scribus/plugins/scriptplugin/scriptplugin.cpp
370,6 → 370,7
{"ProgressTotal", scribus_progresssettotalsteps, METH_VARARGS},
{"ProgressSet", scribus_progresssetprogress, METH_VARARGS},
{"MessagebarText", scribus_messagebartext, METH_VARARGS},
{"DocChanged", scribus_docchanged, METH_VARARGS},
{"SetCursor", scribus_setcursor, METH_VARARGS},
{"PageDimension", scribus_pagedimension, METH_VARARGS},
{"NewDocDialog", scribus_newdocdia, METH_VARARGS},
/trunk/Scribus/scribus/plugins/scriptplugin/guiapp.cpp
68,3 → 68,18
qApp->restoreOverrideCursor();
return Py_None;
}
 
PyObject *scribus_docchanged(PyObject *self, PyObject* args)
{
int aValue;
if (!PyArg_ParseTuple(args, "i", &aValue))
return NULL;
Py_INCREF(Py_None);
if (!Carrier->HaveDoc)
return Py_None;
if (aValue>0)
Carrier->slotDocCh(true);
else
Carrier->slotDocCh(false);
return Py_None;
}
/trunk/Scribus/scribus/page.cpp
77,6 → 77,7
extern FPoint GetMaxClipF(FPointArray Clip);
extern void WordAndPara(PageItem* b, int *w, int *p, int *c, int *wN, int *pN, int *cN);
extern ScribusApp* ScApp;
extern int callGS(const QStringList & args);
 
Page::Page(QWidget *pa, int x, int y, int b, int h, ScribusDoc *doc, QScrollView *view)
: QWidget(pa, "ps", WRepaintNoErase)
867,6 → 868,15
fho = b->flippedH;
fvo = b->flippedV;
savF = b->PicArt;
if ( !b->pixmOrg.isNull() )
{
b->pixm = b->pixmOrg.copy();
b->OrigW = b->pixm.width();
b->OrigH = b->pixm.height();
b->LocalViewX = b->LocalScX;
b->LocalViewY = b->LocalScY;
}
else
LoadPict(b->Pfile, b->ItemNr);
b->flippedH = fho;
b->flippedV = fvo;
895,6 → 905,15
{
int fho = b->flippedH, fvo = b->flippedV;
savF = b->PicArt;
if (!b->pixmOrg.isNull())
{
b->pixm = b->pixmOrg.copy();
b->OrigW = b->pixm.width();
b->OrigH = b->pixm.height();
b->LocalViewX = b->LocalScX;
b->LocalViewY = b->LocalScY;
}
else
LoadPict(b->Pfile, b->ItemNr);
b->flippedH = fho;
b->flippedV = fvo;
6436,13 → 6455,12
b->Ptext.clear();
b->CPos = 0;
}
if (b->PType == 2)
{
b->Pfile = "";
b->PicAvail = false;
b->pixm = QImage();
b->pixmOrg = QImage();
if (b->PType == 2)
emit UpdtObj(PageNr, b->ItemNr);
}
RefreshItem(b);
emit DocChanged();
}
7268,9 → 7286,16
QString ext = fi.extension(false).lower();
if (ext == "pdf")
{
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile="+tmpFile+" -dFirstPage=1 -dLastPage=1 ";
/* cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile="+tmpFile+" -dFirstPage=1 -dLastPage=1 ";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + "\"" + fn + "\"" + cmd2);
ret = system(cmd1 + "\"" + fn + "\"" + cmd2); */
QStringList args;
args.append("-r72");
args.append("-sOutputFile="+tmpFile);
args.append("-dFirstPage=1");
args.append("-dLastPage=1");
args.append(fn);
ret = callGS(args);
if (ret == 0)
{
QImage im4;
7279,6 → 7304,7
image = image.convertDepth(32);
im4 = ProofPict(&image, Items.at(ItNr)->IProfile, Items.at(ItNr)->IRender);
Items.at(ItNr)->pixm = im4;
Items.at(ItNr)->pixmOrg = im4.copy();
Items.at(ItNr)->Pfile = fi.absFilePath();
Items.at(ItNr)->PicAvail = true;
Items.at(ItNr)->PicArt = true;
7291,7 → 7317,7
Items.at(ItNr)->LocalViewY = Items.at(ItNr)->LocalScY;
Items.at(ItNr)->dpiX = 72.0;
Items.at(ItNr)->dpiY = 72.0;
system("rm -f "+tmpFile);
unlink(tmpFile);
}
else
{
7362,9 → 7388,12
{
QTextStream ts2(&BBox, IO_ReadOnly);
ts2 >> dummy >> x >> y >> b >> h;
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r72 -sOutputFile="+tmpFile+" -g";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + tmp.setNum(qRound(b)) + "x" + tmp2.setNum(qRound(h)) + " \"" + fn + "\"" + cmd2);
QStringList args;
args.append("-r72");
args.append("-sOutputFile="+tmpFile);
args.append("-g"+tmp.setNum(qRound(b))+"x"+tmp2.setNum(qRound(h)));
args.append(fn);
ret = callGS(args);
if (ret == 0)
{
QImage im4;
7388,6 → 7417,7
im4 = image.copy(static_cast<int>(x), 0, static_cast<int>(b-x), static_cast<int>(h-y));
image = ProofPict(&im4, Items.at(ItNr)->IProfile, Items.at(ItNr)->IRender);
Items.at(ItNr)->pixm = image;
Items.at(ItNr)->pixmOrg = image.copy();
Items.at(ItNr)->Pfile = fi.absFilePath();
Items.at(ItNr)->PicAvail = true;
Items.at(ItNr)->PicArt = true;
7400,7 → 7430,7
Items.at(ItNr)->LocalViewY = Items.at(ItNr)->LocalScY;
Items.at(ItNr)->dpiX = 72.0;
Items.at(ItNr)->dpiY = 72.0;
system("rm -f "+tmpFile);
unlink(tmpFile);
}
else
{
7503,6 → 7533,7
inI2 = ProofPict(&img, Items.at(ItNr)->IProfile, Items.at(ItNr)->IRender);
#endif
Items.at(ItNr)->pixm = inI2;
Items.at(ItNr)->pixmOrg = QImage();
Items.at(ItNr)->PicAvail = true;
Items.at(ItNr)->PicArt = true;
Items.at(ItNr)->BBoxX = 0;
7549,6 → 7580,7
inI = inI.convertDepth(32);
inI2 = ProofPict(&inI, Items.at(ItNr)->IProfile, Items.at(ItNr)->IRender);
Items.at(ItNr)->pixm = inI2.copy();
Items.at(ItNr)->pixmOrg = QImage();
if (Items.at(ItNr)->Pfile != fn)
{
Items.at(ItNr)->LocalScX = 72.0 / dpiX;
7588,3 → 7620,4
}
emit DocChanged();
}
 
/trunk/Scribus/scribus/libpdf/pdflib.cpp
32,6 → 32,7
#include <cmath>
#include "rc4.h"
 
extern int callGS(const QStringList & args);
extern QString Path2Relative(QString Path);
extern bool GlyIndex(QMap<uint, PDFlib::GlNamInd> *GListInd, QString Dat);
extern QByteArray ComputeMD5Sum(QByteArray *in);
2857,16 → 2858,19
afl = Options->Resolution;
if (ext == "pdf")
{
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r"+IToStr(afl)+" -sOutputFile="+tmpFile+
" -dFirstPage=1 -dLastPage=1 ";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + "\"" + fn + "\"" + cmd2);
QStringList args;
args.append("-r"+IToStr(afl));
args.append("-sOutputFile="+tmpFile);
args.append("-dFirstPage=1");
args.append("-dLastPage=1");
args.append(fn);
ret = callGS(args);
if (ret == 0)
{
QImage image;
image.load(tmpFile);
img = image.convertDepth(32);
system("rm -f "+tmpFile);
unlink(tmpFile);
}
}
else
2902,11 → 2906,12
y2 = y2 * aufl;
b = b * aufl;
h = h * aufl;
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r"+IToStr(afl)+
" -sOutputFile="+tmpFile+" -g";
cmd2 = " -c showpage -c quit";
ret = system(cmd1 + tmp.setNum(qRound(b)) + "x" + tmpy.setNum(qRound(h)) +
" \"" + fn + "\"" + cmd2);
QStringList args;
args.append("-r"+IToStr(afl));
args.append("-sOutputFile="+tmpFile);
args.append("-g"+ tmp.setNum(qRound(b))+"x"+tmpy.setNum(qRound(h)));
args.append(fn);
ret = callGS(args);
if (ret == 0)
{
QImage image;
2914,7 → 2919,7
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 "+tmpFile);
unlink(tmpFile);
}
}
}
/trunk/Scribus/scribus/scribuswin.cpp
20,8 → 20,10
#include "scribuswin.moc"
#include "scribusXml.h"
#include "scribus.h"
 
extern QPixmap loadIcon(QString nam);
extern ScribusApp* ScApp;
extern int moveFile(QString source, QString target);
 
ScribusWin::ScribusWin(QWidget* parent, ScribusDoc* ddoc)
: QMainWindow(parent, "", WDestructiveClose)
43,7 → 45,7
{
if ((doc->hasName) && (doc->isModified()) && (!doc->TemplateMode))
{
system("mv -f \"" + doc->DocName + "\" \"" + doc->DocName+".bak\"");
moveFile(doc->DocName, doc->DocName+".bak");
QString fn = doc->DocName;
QFileInfo fi(fn);
QDir::setCurrent(fi.dirPath(true));
/trunk/Scribus/scribus/po/scribus.uk.ts
2992,6 → 2992,22
<source>Postscript-Files (*.ps);;All Files (*)</source>
<translation>Постскрипт файли (*.ps);;Всі файли (*)</translation>
</message>
<message>
<source>Cyan</source>
<translation>Салатовий</translation>
</message>
<message>
<source>Magenta</source>
<translation>Малиновий</translation>
</message>
<message>
<source>Yellow</source>
<translation>Жовтий</translation>
</message>
<message>
<source>Black</source>
<translation>Чорний</translation>
</message>
</context>
<context>
<name>EditStyle</name>
3091,6 → 3107,10
<source>Name of the Style is not unique</source>
<translation>Ім&apos;я стилю вже використане</translation>
</message>
<message>
<source>Stroke Color:</source>
<translation>Колір мазка:</translation>
</message>
</context>
<context>
<name>Editor</name>
5036,6 → 5056,54
<source>Absolute Colorimetric</source>
<translation>Абсолютна кольорометрія</translation>
</message>
<message>
<source>Image Settings</source>
<translation>Установки зображення</translation>
</message>
<message>
<source>Method:</source>
<translation>Метод:</translation>
</message>
<message>
<source>Automatic</source>
<translation>Автоматичний</translation>
</message>
<message>
<source>JPEG</source>
<translation>JPEG</translation>
</message>
<message>
<source>Zip</source>
<translation>Zip</translation>
</message>
<message>
<source>None</source>
<translation>Ніякого</translation>
</message>
<message>
<source>Quality:</source>
<translation>Якість:</translation>
</message>
<message>
<source>Maximum</source>
<translation>Максимальна</translation>
</message>
<message>
<source>High</source>
<translation>Висока</translation>
</message>
<message>
<source>Medium</source>
<translation>Середня</translation>
</message>
<message>
<source>Low</source>
<translation>Низька</translation>
</message>
<message>
<source>Minimum</source>
<translation>Мінімальна</translation>
</message>
</context>
<context>
<name>PPreview</name>
5329,6 → 5397,17
</message>
</context>
<context>
<name>PageSelector</name>
<message>
<source>Page </source>
<translation>Сторінка</translation>
</message>
<message>
<source> of %1</source>
<translation> з %1</translation>
</message>
</context>
<context>
<name>PicSearch</name>
<message>
<source>Result</source>
5377,6 → 5456,26
<source>Search</source>
<translation>Пошук</translation>
</message>
<message>
<source>Name</source>
<translation>Ім&apos;я</translation>
</message>
<message>
<source>Path</source>
<translation>Шлях</translation>
</message>
<message>
<source>Page</source>
<translation>Сторінка</translation>
</message>
<message>
<source>Print</source>
<translation>Друк</translation>
</message>
<message>
<source>Status</source>
<translation>Статус</translation>
</message>
</context>
<context>
<name>PolygonProps</name>
6357,7 → 6456,7
</message>
<message>
<source> pt</source>
<translation>точки</translation>
<translation>тчк</translation>
</message>
<message>
<source> mm</source>
6369,7 → 6468,7
</message>
<message>
<source> p</source>
<translation>піки</translation>
<translation>п</translation>
</message>
<message>
<source>Left Page</source>
6387,6 → 6486,22
<source>Background</source>
<translation>Фон</translation>
</message>
<message>
<source>pt</source>
<translation>тчк</translation>
</message>
<message>
<source>mm</source>
<translation>мм</translation>
</message>
<message>
<source>in</source>
<translation>дюйм</translation>
</message>
<message>
<source>p</source>
<translation>п</translation>
</message>
</context>
<context>
<name>QTextEdit</name>
6420,6 → 6535,37
</message>
</context>
<context>
<name>QTitleBar</name>
<message>
<source>System Menu</source>
<translation>Системне меню</translation>
</message>
<message>
<source>Shade</source>
<translation>Затінити</translation>
</message>
<message>
<source>Unshade</source>
<translation>Відтінити</translation>
</message>
<message>
<source>Normalize</source>
<translation>Нормальний розмір</translation>
</message>
<message>
<source>Minimize</source>
<translation>Згорнути до мінімуму</translation>
</message>
<message>
<source>Maximize</source>
<translation>Розгорнути до максимуму</translation>
</message>
<message>
<source>Close</source>
<translation>Зачинити</translation>
</message>
</context>
<context>
<name>QWorkspace</name>
<message>
<source>&amp;Restore</source>
/trunk/Scribus/scribus/scribusXml.cpp
1019,11 → 1019,16
doc->Einheit = QStoInt(dc.attribute("UNITS","0"));
DoFonts.clear();
Defont=dc.attribute("DFONT");
if (Defont == "")
if (!avail.find(Defont))
{
QString dd = Defont;
if (view->Prefs->GFontSub.contains(Defont))
Defont = view->Prefs->GFontSub[dd];
else
Defont = view->Prefs->DefFont;
DoFonts[Defont] = Defont;
DoFonts[dd] = Defont;
}
doc->Dfont = Defont;
doc->Dsize=qRound(QStodouble(dc.attribute("DSIZE")) * 10);
doc->DCols=QStoInt(dc.attribute("DCOL", "1"));
doc->DGap=QStodouble(dc.attribute("DGAP", "0.0"));
1420,9 → 1425,10
OB.PoShow = QStoInt(obj.attribute("PTLSHOW","0"));
OB.BaseOffs = QStodouble(obj.attribute("BASEOF","0"));
OB.Ausrich = QStoInt(obj.attribute("ALIGN","0"));
tmf = obj.attribute("IFONT", doc->Dfont);
OB.IFont = obj.attribute("IFONT", doc->Dfont);
if (tmf == "")
tmf = doc->Dfont;
OB.IFont = doc->Dfont;
else
OB.IFont = DoFonts[tmf];
OB.ISize = qRound(QStodouble(obj.attribute("ISIZE","12")) * 10);
OB.Pfile=obj.attribute("PFILE");
1545,7 → 1551,6
OB.Ptext = tmp;
int docGc = doc->GroupCounter;
doc->GroupCounter = 0;
doc->Dfont = DoFonts[Defont];
if ((OB.PType == 5) && (OB.Height != 0))
{
OB.Rot += atan2(OB.Height,OB.Width)*(180.0/3.1415927);
/trunk/Scribus/scribus/qm/scribus.uk.qm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream