Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 25 → Rev 26

/trunk/Scribus/ChangeLogCVS
1,4 → 1,7
Changes since Version 0.9.10
07.06.2003 pdflib.cpp
scribus.cpp Fixed grave Bug with the PDF-Exporter.
 
05.06.2003 annot.cpp Fixed Bug with external PDF-Links.
pdfopts.cpp Fixed Bug with PDF-Page Effects.
scribus.cpp Fixed Bug when exporting Documents to PDF.
/trunk/Scribus/scribus/libabout/about.cpp
32,7 → 32,7
tabLayout1->addWidget( PixmapLabel1 );
BuildID = new QLabel( tab, "BB" );
BuildID->setAlignment(Qt::AlignCenter);
QString bu = "03. June 2003 ";
QString bu = "07. June 2003 ";
#ifdef HAVE_FREETYPE
bu += "F";
#else
/trunk/Scribus/scribus/Makefile.am
5,14 → 5,16
INTERFACES =
TRANSLATIONS =
 
SUBDIRS = icons libabout libprefs plugins libpostscript profiles libpdf dicts po qm
SUBDIRS = icons libabout libprefs plugins libpostscript libpdf profiles dicts po qm
 
EXTRA_DIST = main.cpp scribus.cpp scribus.h scribusdoc.cpp scribusdoc.h scribusview.cpp scribusview.h newfile.h newfile.cpp pageitem.cpp pageitem.h pageback.cpp pageback.h hruler.cpp hruler.h vruler.cpp vruler.h colorm.cpp colorm.h query.cpp query.h dcolor.cpp dcolor.h cpalette.cpp cpalette.h mdup.cpp mdup.h docinfo.cpp docinfo.h reformdoc.cpp reformdoc.h serializer.cpp serializer.h align.cpp align.h fmitem.cpp fmitem.h fontprefs.cpp fontprefs.h missing.cpp missing.h tree.cpp tree.h pdfopts.cpp pdfopts.h inspage.cpp inspage.h delpages.cpp delpages.h movepage.cpp movepage.h modify.cpp modify.h mspinbox.cpp mspinbox.h helpbrowser.cpp helpbrowser.h icons5.h linkbutton.cpp linkbutton.h icons6.h linecombo.cpp linecombo.h scribusXml.cpp scribusXml.h cmykfw.cpp cmykfw.h cmykcolor.cpp cmykcolor.h util.cpp colorchart.cpp colorchart.h druck.cpp druck.h editformats.cpp editformats.h edit1format.cpp edit1format.h spalette.cpp spalette.h ISOenc.txt frameedit.cpp frameedit.h scfonts.cpp scfonts.h scrap.cpp scrap.h TTFenc.txt Stdenc.txt scfonts_encoding.cpp scfonts_encoding.h scfonts_ttf.cpp scfonts_ttf.h scfonts_ttftypes.h muster.cpp muster.h applytemplate.cpp applytemplate.h newtemp.cpp newtemp.h picstatus.cpp picstatus.h picsearch.cpp picsearch.h customfdialog.cpp customfdialog.h cmsprefs.cpp cmsprefs.h bookmwin.cpp bookmwin.h annot.cpp annot.h navigator.cpp navigator.h keymanager.cpp keymanager.h icc34.h werktoolb.cpp werktoolb.h mpalette.h mpalette.cpp polyprops.cpp polyprops.h layers.cpp layers.h page.cpp page.h editor.cpp editor.h selfield.cpp selfield.h javadocs.cpp javadocs.h buttonicon.cpp buttonicon.h annota.cpp annota.h fpoint.cpp fpoint.h fpointarray.cpp fpointarray.h seiten.cpp seiten.h hysettings.cpp hysettings.h hnjalloc.c hnjalloc.h hyask.cpp hyask.h hyphen.c hyphen.h hyphenator.cpp hyphenator.h scribuswin.cpp scribuswin.h kimageeffect.cpp kimageeffect.h guidemanager.cpp guidemanager.h cupsoptions.cpp cupsoptions.h md5.c md5.h rc4.c rc4.h mergedoc.cpp mergedoc.h bookpalette.cpp bookpalette.h iso8859-2.enc iso8859-13.enc iso8859-15.enc iso8859-2ps.enc iso8859-3ps.enc iso8859-4ps.enc iso8859-5ps.enc iso8859-7ps.enc iso8859-9ps.enc iso8859-10ps.enc iso8859-13ps.enc koi8ps.enc
EXTRA_DIST = main.cpp scribus.cpp scribus.h scribusdoc.cpp scribusdoc.h scribusview.cpp scribusview.h newfile.h newfile.cpp pageitem.cpp pageitem.h pageback.cpp pageback.h hruler.cpp hruler.h vruler.cpp vruler.h colorm.cpp colorm.h query.cpp query.h dcolor.cpp dcolor.h cpalette.cpp cpalette.h mdup.cpp mdup.h docinfo.cpp docinfo.h reformdoc.cpp reformdoc.h serializer.cpp serializer.h align.cpp align.h fmitem.cpp fmitem.h fontprefs.cpp fontprefs.h missing.cpp missing.h tree.cpp tree.h pdfopts.cpp pdfopts.h inspage.cpp inspage.h delpages.cpp delpages.h movepage.cpp movepage.h modify.cpp modify.h mspinbox.cpp mspinbox.h helpbrowser.cpp helpbrowser.h icons5.h linkbutton.cpp linkbutton.h icons6.h linecombo.cpp linecombo.h scribusXml.cpp scribusXml.h cmykfw.cpp cmykfw.h cmykcolor.cpp cmykcolor.h util.cpp colorchart.cpp colorchart.h druck.cpp druck.h editformats.cpp editformats.h edit1format.cpp edit1format.h spalette.cpp spalette.h ISOenc.txt frameedit.cpp frameedit.h scfonts.cpp scfonts.h scrap.cpp scrap.h TTFenc.txt Stdenc.txt scfonts_encoding.cpp scfonts_encoding.h scfonts_ttf.cpp scfonts_ttf.h scfonts_ttftypes.h muster.cpp muster.h applytemplate.cpp applytemplate.h newtemp.cpp newtemp.h picstatus.cpp picstatus.h picsearch.cpp picsearch.h customfdialog.cpp customfdialog.h cmsprefs.cpp cmsprefs.h bookmwin.cpp bookmwin.h annot.cpp annot.h navigator.cpp navigator.h keymanager.cpp keymanager.h icc34.h werktoolb.cpp werktoolb.h mpalette.h mpalette.cpp polyprops.cpp polyprops.h layers.cpp layers.h page.cpp page.h editor.cpp editor.h selfield.cpp selfield.h javadocs.cpp javadocs.h buttonicon.cpp buttonicon.h annota.cpp annota.h fpoint.cpp fpoint.h fpointarray.cpp fpointarray.h seiten.cpp seiten.h hysettings.cpp hysettings.h hnjalloc.c hnjalloc.h hyask.cpp hyask.h hyphen.c hyphen.h hyphenator.cpp hyphenator.h scribuswin.cpp scribuswin.h kimageeffect.cpp kimageeffect.h guidemanager.cpp guidemanager.h cupsoptions.cpp cupsoptions.h md5.c md5.h rc4.c rc4.h mergedoc.cpp mergedoc.h bookpalette.cpp bookpalette.h iso8859-2.enc iso8859-13.enc iso8859-15.enc iso8859-2ps.enc iso8859-3ps.enc iso8859-4ps.enc iso8859-5ps.enc iso8859-7ps.enc iso8859-9ps.enc iso8859-10ps.enc iso8859-13ps.enc koi8ps.enc splash.h
 
install-data-local:
$(mkinstalldirs) $(prefix)/include/scribus/
$(INSTALL_DATA) $(srcdir)/scribus.h $(prefix)/include/scribus/scribus.h
$(mkinstalldirs) $(prefix)/include/scribus/
$(INSTALL_DATA) $(srcdir)/splash.h $(prefix)/include/scribus/splash.h
$(mkinstalldirs) $(prefix)/include/scribus/
$(INSTALL_DATA) $(srcdir)/scribusdoc.h $(prefix)/include/scribus/scribusdoc.h
$(mkinstalldirs) $(prefix)/include/scribus/
$(INSTALL_DATA) $(srcdir)/scribusview.h $(prefix)/include/scribus/scribusview.h
113,6 → 115,7
 
uninstall-local:
-rm -f $(prefix)/include/scribus/scribus.h
-rm -f $(prefix)/include/scribus/splash.h
-rm -f $(prefix)/include/scribus/scribusdoc.h
-rm -f $(prefix)/include/scribus/scribusview.h
-rm -f $(prefix)/include/scribus/pageitem.h
/trunk/Scribus/scribus/scribus.cpp
2985,15 → 2985,18
{
BuFromApp = false;
Buffer2 = cc;
if (cc.startsWith("<SCRIBUSELEM"))
if (HaveDoc)
{
if (doc->AppMode != 7)
editMenu->setItemEnabled(edid3, 1);
}
else
{
if (doc->AppMode == 7)
editMenu->setItemEnabled(edid3, 1);
if (cc.startsWith("<SCRIBUSELEM"))
{
if (doc->AppMode != 7)
editMenu->setItemEnabled(edid3, 1);
}
else
{
if (doc->AppMode == 7)
editMenu->setItemEnabled(edid3, 1);
}
}
}
}
4547,9 → 4550,7
FStyleMenu->insertItem(family, pm);
}
a = FontMenu->insertItem(tr("Face"), FStyleMenu);
// FontID.insert(long(a), &b);
a = FontMenu->insertSeparator();
// FontID.insert(long(a), &b);
if (!HaveDoc)
{
it.toFirst();
5101,10 → 5102,12
dlclose(PSDriver);
}
 
PDFlib* ScribusApp::getPDFDriver()
bool ScribusApp::getPDFDriver(QString fn, QString nam, int Components, int frPa, int toPa, QMap<int,QPixmap> thumbs)
{
bool ret = false;
char *error;
typedef PDFlib* (*sdem)();
void *PDFDriver;
typedef bool (*sdem)(ScribusApp *plug, QString fn, QString nam, int Components, int frPa, int toPa, QMap<int,QPixmap> thumbs);
sdem demo;
QString pfad = PREL;
#if defined(__hpux)
5116,7 → 5119,7
if (!PDFDriver)
{
std::cout << "Can't find Plugin" << endl;
return NULL;
return false;
}
dlerror();
demo = (sdem)dlsym(PDFDriver, "Run");
5124,15 → 5127,11
{
std::cout << "Can't find Symbol" << endl;
dlclose(PDFDriver);
return NULL;
return false;
}
PDFlib *dia = (*demo)();
return dia;
}
 
void ScribusApp::closePDFDriver()
{
ret = (*demo)(this, fn, nam, Components, frPa, toPa, thumbs);
dlclose(PDFDriver);
return ret;
}
 
bool ScribusApp::DoSaveAsEps(QString fn)
5298,30 → 5297,9
pm = view->PageToPixmap(ap, 100);
thumbs.insert(ap, pm);
}
PDFlib *pd = getPDFDriver();
if (pd->PDF_Begin_Doc(fn, doc, view, &doc->PDF_Optionen, Prefs.AvailFonts, doc->UsedFonts, BookPal->BView))
{
for (uint ap = 0; ap < view->MasterPages.count(); ++ap)
{
if (view->MasterPages.at(ap)->Items.count() != 0)
pd->PDF_TemplatePage(view->MasterPages.at(ap));
}
for (uint a = frPa; a < toPa; ++a)
{
pd->PDF_Begin_Page(view->Pages.at(a), thumbs[a]);
pd->PDF_ProcessPage(view->Pages.at(a), a);
pd->PDF_End_Page();
}
if (doc->PDF_Optionen.Version == 12)
pd->PDF_End_Doc(pfad+PrinterProfiles[doc->PDF_Optionen.PrintProf], nam, Components);
else
pd->PDF_End_Doc();
}
else
if (!getPDFDriver(fn, nam, Components, frPa, toPa, thumbs))
QMessageBox::warning(this, tr("Warning"), tr("Can't write the File: \n%1").arg(fn), tr("OK"));
delete pd;
closePDFDriver();
BuildFontMenu();
// BuildFontMenu();
qApp->setOverrideCursor(QCursor(arrowCursor), true);
}
delete dia;
/trunk/Scribus/scribus/libpdf/pdflib.cpp
16,6 → 16,7
***************************************************************************/
 
#include "pdflib.h"
#include "pdflib.moc"
#include "config.h"
#include <qregexp.h>
#include <qdatetime.h>
46,12 → 47,38
#endif
extern ProfilesL InputProfiles;
 
extern "C" void* Run();
extern "C" bool Run(ScribusApp *plug, QString fn, QString nam, int Components, int frPa, int toPa, QMap<int,QPixmap> thumbs);
 
void* Run()
bool Run(ScribusApp *plug, QString fn, QString nam, int Components, int frPa, int toPa, QMap<int,QPixmap> thumbs)
{
QPixmap pm;
QString pfad = PREL;
pfad += "/lib/scribus/profiles/";
bool ret = false;
PDFlib *dia = new PDFlib();
return dia;
if (dia->PDF_Begin_Doc(fn, plug->doc, plug->view, &plug->doc->PDF_Optionen, plug->Prefs.AvailFonts, plug->doc->UsedFonts, plug->BookPal->BView))
{
for (uint ap = 0; ap < plug->view->MasterPages.count(); ++ap)
{
if (plug->view->MasterPages.at(ap)->Items.count() != 0)
dia->PDF_TemplatePage(plug->view->MasterPages.at(ap));
}
for (int a = frPa; a < toPa; ++a)
{
if (plug->doc->PDF_Optionen.Thumbnails)
pm = thumbs[a];
dia->PDF_Begin_Page(plug->view->Pages.at(a), pm);
dia->PDF_ProcessPage(plug->view->Pages.at(a), a);
dia->PDF_End_Page();
}
if (plug->doc->PDF_Optionen.Version == 12)
dia->PDF_End_Doc(pfad+plug->PrinterProfiles[plug->doc->PDF_Optionen.PrintProf], nam, Components);
else
dia->PDF_End_Doc();
ret = true;
}
delete dia;
return ret;
}
 
PDFlib::PDFlib()
577,7 → 604,6
QMap<QString,QFont>::Iterator it;
a = 0;
for (it = ReallyUsed.begin(); it != ReallyUsed.end(); ++it)
// for (it = DocFonts.begin(); it != DocFonts.end(); ++it)
{
fd = QFileInfo(AllFonts[it.key()]->Datei);
UsedFontsP.insert(it.key(), "/Fo"+IToStr(a));
1550,10 → 1576,11
if (ite->Reverse)
{
QPainter ph;
QFont ffo;
QFont tff(RealFonts[hl->cfont]);
tff.setPointSize(hl->csize);
ph.begin(doc->ActPage);
ph.setFont(tff);
int chs = hl->csize;
ite->SetZeichAttr(&ph, &ffo, hl, &chs, &chx);
float wtr;
if (d < ite->MaxChars-1)
wtr = Cwidth(doc, &ph, hl->cfont, chx, chs, ite->Ptext.at(d+1)->ch);
1602,10 → 1629,11
if ((hl->cstyle & 128) && ((ite->Ptext.at(QMIN(d+1, ite->Ptext.count()-1))->yp != hl->yp) && (ite->Ptext.at(QMIN(d+1, ite->Ptext.count()-1))->ch != QChar(13)) || ((ite->NextBox != 0) && (d == ite->Ptext.count()-1))))
{
QPainter ph;
QFont ffo;
QFont tff(RealFonts[hl->cfont]);
tff.setPointSize(hl->csize);
ph.begin(doc->ActPage);
ph.setFont(tff);
int chs = hl->csize;
ite->SetZeichAttr(&ph, &ffo, hl, &chs, &chx);
float wtr = Cwidth(doc, &ph, hl->cfont, chx, chs);
ph.end();
tmp += "1 0 0 1 "+FToStr(hl->xp+wtr)+" "+FToStr(-hl->yp)+" Tm\n";
3196,5 → 3224,13
PutDoc(">>\nstartxref\n");
PutDoc(IToStr(StX)+"\n%%EOF\n");
Spool.close();
Seite.XObjects.clear();
Seite.FObjects.clear();
Seite.AObjects.clear();
Seite.FormObjects.clear();
CalcFields.clear();
Shadings.clear();
Transpar.clear();
ICCProfiles.clear();
}
 
/trunk/Scribus/scribus/libpdf/pdflib.h
24,6 → 24,7
#include "pageitem.h"
#include "scribusview.h"
#include "bookmwin.h"
#include "scribus.h"
#include <qfile.h>
 
/**
30,17 → 31,19
*@author Franz Schmid
*/
 
class PDFlib {
class PDFlib : public QObject
{
Q_OBJECT
 
public:
public:
PDFlib();
virtual ~PDFlib();
virtual bool PDF_Begin_Doc(QString fn, ScribusDoc *docu, ScribusView *vie, PDFOpt *opts, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, BookMView* vi);
virtual void PDF_Begin_Page(Page* pag, QPixmap pm);
virtual void PDF_End_Page();
virtual void PDF_TemplatePage(Page* pag);
virtual void PDF_ProcessPage(Page* pag, uint PNr);
virtual void PDF_End_Doc(QString PrintPr = "", QString Name = "", int Components = 0);
~PDFlib();
bool PDF_Begin_Doc(QString fn, ScribusDoc *docu, ScribusView *vie, PDFOpt *opts, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, BookMView* vi);
void PDF_Begin_Page(Page* pag, QPixmap pm = 0);
void PDF_End_Page();
void PDF_TemplatePage(Page* pag);
void PDF_ProcessPage(Page* pag, uint PNr);
void PDF_End_Doc(QString PrintPr = "", QString Name = "", int Components = 0);
struct GlNamInd { uint Code;
QString Name;
};
48,29 → 51,29
QMap<QString, GListeInd> GlyphsIdxOfFont;
private:
virtual QString EncStream(QString *in, int ObjNum);
virtual QString EncString(QString in, int ObjNum);
virtual void CalcOwnerKey(QString Owner, QString User);
virtual void CalcUserKey(QString User, int Permission);
virtual QString FitKey(QString pass);
virtual QString FToStr(float c);
virtual QString IToStr(int c);
virtual QString SetClipPath(PageItem *ite);
virtual QString SetFarbe(QString farbe, int Shade);
virtual QString setTextSt(PageItem *ite, uint PNr);
virtual void PutDoc(QString in);
virtual void PutPage(QString in);
virtual void StartObj(int nr);
virtual void WritePDFStream(QString *cc);
virtual QString PDFEncode(QString in);
virtual QByteArray ComputeMD5(QString in);
virtual void PDF_Bookmark(int nr, float ypos);
virtual void PDF_Gradient(PageItem *b);
virtual void PDF_Transparenz(PageItem *b);
virtual void PDF_Annotation(PageItem *ite, uint PNr);
virtual void PDF_Form(QString im);
virtual void PDF_xForm(float w, float h, QString im);
virtual void PDF_Image(bool inver, QString fn, float sx, float sy, float x, float y, bool fromAN = false, QString Profil = "", bool Embedded = false, int Intent = 1);
QString EncStream(QString *in, int ObjNum);
QString EncString(QString in, int ObjNum);
void CalcOwnerKey(QString Owner, QString User);
void CalcUserKey(QString User, int Permission);
QString FitKey(QString pass);
QString FToStr(float c);
QString IToStr(int c);
QString SetClipPath(PageItem *ite);
QString SetFarbe(QString farbe, int Shade);
QString setTextSt(PageItem *ite, uint PNr);
void PutDoc(QString in);
void PutPage(QString in);
void StartObj(int nr);
void WritePDFStream(QString *cc);
QString PDFEncode(QString in);
QByteArray ComputeMD5(QString in);
void PDF_Bookmark(int nr, float ypos);
void PDF_Gradient(PageItem *b);
void PDF_Transparenz(PageItem *b);
void PDF_Annotation(PageItem *ite, uint PNr);
void PDF_Form(QString im);
void PDF_xForm(float w, float h, QString im);
void PDF_Image(bool inver, QString fn, float sx, float sy, float x, float y, bool fromAN = false, QString Profil = "", bool Embedded = false, int Intent = 1);
QString Inhalt;
ScribusDoc* doc;
ScribusView* view;
/trunk/Scribus/scribus/scribus.h
56,7 → 56,6
#include "scrap.h"
#include "layers.h"
#include "libpostscript/pslib.h"
#include "libpdf/pdflib.h"
#include "werktoolb.h"
#include "seiten.h"
#include "bookpalette.h"
102,8 → 101,7
void CallDLL(QString name);
PSLib* getPSDriver(bool psart, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, CListe DocColors, bool pdf);
void closePSDriver();
PDFlib* getPDFDriver();
void closePDFDriver();
bool getPDFDriver(QString fn, QString nam, int Components, int frPa, int toPa, QMap<int,QPixmap> thumbs);
bool DoSaveAsEps(QString fn);
QString CFileDialog(QString caption = "", QString filter = "", QString defNa = "", bool Pre = false, bool mod = true, bool comp = false, bool cod = false);
void GetCMSProfiles();
497,7 → 495,6
int HaveGS;
bool PDFavailable;
void *PSDriver;
void *PDFDriver;
int DocNr;
QStringList RecentDocs;
struct PlugData { QString Datei;