Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 79 → Rev 80

/trunk/Scribus/ChangeLogCVS
1,4 → 1,7
Changes since Version 1.1.1
16.10.2003 Included Paul patches with only one small correction.
Updated the German translation.
 
15.10.2003 Made some improvements to linked Textframes.
 
13.10.2003 Fixed crash when doubleclicking an empty Textframe.
/trunk/Scribus/scribus/fpointarray.h
32,15 → 32,15
public:
FPointArray() {};
FPointArray(int size) : QMemArray<FPoint>(size) {};
void setPoint(uint i, float x, float y);
void setPoint(uint i, double x, double y);
void setPoint(uint i, FPoint p);
bool setPoints( int nPoints, double firstx, double firsty, ... );
bool putPoints( int index, int nPoints, double firstx, double firsty, ... );
bool putPoints( int index, int nPoints, const FPointArray & from, int fromIndex = 0 );
void point(uint i, float *x, float *y);
void point(uint i, double *x, double *y);
FPoint point(uint i);
QPoint pointQ(uint i);
void translate( float dx, float dy );
void translate( double dx, double dy );
FPoint WidthHeight();
void map(QWMatrix m);
FPointArray &operator=( const FPointArray &a )
48,7 → 48,7
FPointArray copy() const
{ FPointArray tmp; return *((FPointArray*)&tmp.duplicate(*this)); }
void setMarker();
void addPoint(float x, float y);
void addPoint(double x, double y);
void addPoint(FPoint p);
~FPointArray() {};
};
/trunk/Scribus/scribus/mdup.h
21,7 → 21,7
Q_OBJECT
 
public:
Mdup( QWidget* parent, float Dx, float Dy, int Ein );
Mdup( QWidget* parent, double Dx, double Dy, int Ein );
~Mdup() {};
 
QLabel* TextLabel1_2;
/trunk/Scribus/scribus/pdfopts.cpp
3,7 → 3,7
#include "customfdialog.h"
#include "config.h"
extern QPixmap loadIcon(QString nam);
extern float UmReFaktor;
extern double UmReFaktor;
extern ProfilesL InputProfiles;
#ifdef HAVE_CMS
extern bool CMSuse;
504,7 → 504,7
EmbedProfs2->setChecked(Optionen->UseProfiles2);
ProfsGroupLayout->addMultiCellWidget( EmbedProfs2, 0, 0, 0, 1 );
NoEmbedded = new QCheckBox( ProfsGroup, "NoEmbedded" );
NoEmbedded->setText( tr( "Don't use embedded Profiles" ) );
NoEmbedded->setText( tr( "Don't use embedded ICC profiles" ) );
NoEmbedded->setChecked(Optionen->EmbeddedI);
ProfsGroupLayout->addMultiCellWidget( NoEmbedded, 1, 1, 0, 1 );
ProfsTxt3 = new QLabel( ProfsGroup, "ProfsTxt3" );
766,16 → 766,11
 
void PDF_Opts::ToggleEncr()
{
bool setter = false;
if (Encry->isChecked())
{
GroupSecSet->setEnabled(true);
GroupPass->setEnabled(true);
}
else
{
GroupSecSet->setEnabled(false);
GroupPass->setEnabled(false);
}
setter = true;
GroupSecSet->setEnabled(setter);
GroupPass->setEnabled(setter);
}
 
void PDF_Opts::BleedChanged()
833,20 → 828,13
if (EmbedProfs2->isChecked())
{
NoEmbedded->setEnabled(true);
bool setter = false;
if (NoEmbedded->isChecked())
{
ProfsTxt3->setEnabled(true);
ProfsTxt4->setEnabled(true);
ImageP->setEnabled(true);
IntendI->setEnabled(true);
}
else
{
ProfsTxt3->setEnabled(false);
ProfsTxt4->setEnabled(false);
ImageP->setEnabled(false);
IntendI->setEnabled(false);
}
setter = true;
ProfsTxt3->setEnabled(setter);
ProfsTxt4->setEnabled(setter);
ImageP->setEnabled(setter);
IntendI->setEnabled(setter);
}
else
{
860,52 → 848,31
 
void PDF_Opts::EnablePGI2()
{
bool setter = false;
if (NoEmbedded->isChecked())
{
ProfsTxt3->setEnabled(true);
ProfsTxt4->setEnabled(true);
ImageP->setEnabled(true);
IntendI->setEnabled(true);
}
else
{
ProfsTxt3->setEnabled(false);
ProfsTxt4->setEnabled(false);
ImageP->setEnabled(false);
IntendI->setEnabled(false);
}
setter = true;
ProfsTxt3->setEnabled(setter);
ProfsTxt4->setEnabled(setter);
ImageP->setEnabled(setter);
IntendI->setEnabled(setter);
}
 
void PDF_Opts::EnablePG()
{
bool setter = false;
if (EmbedProfs->isChecked())
{
ProfsTxt1->setEnabled(true);
ProfsTxt2->setEnabled(true);
SolidPr->setEnabled(true);
IntendS->setEnabled(true);
}
else
{
ProfsTxt1->setEnabled(false);
ProfsTxt2->setEnabled(false);
SolidPr->setEnabled(false);
IntendS->setEnabled(false);
}
setter = true;
ProfsTxt1->setEnabled(setter);
ProfsTxt2->setEnabled(setter);
SolidPr->setEnabled(setter);
IntendS->setEnabled(setter);
}
 
void PDF_Opts::EnablePr(int a)
{
if (a == 1)
{
GroupBox9->setEnabled(true);
ProfsGroup->setEnabled(true);
}
else
{
GroupBox9->setEnabled(false);
ProfsGroup->setEnabled(false);
}
bool setter = a == 1 ? true : false;
GroupBox9->setEnabled(setter);
ProfsGroup->setEnabled(setter);
}
 
void PDF_Opts::ChFrom()
926,19 → 893,14
 
void PDF_Opts::SelRange(bool e)
{
bool setter = true;
if (e)
{
RText->setEnabled( false );
FirstPage->setEnabled( false );
LastPage->setEnabled( false );
}
else
{
RText->setEnabled( true );
FirstPage->setEnabled( true );
LastPage->setEnabled( true );
setter = false;
RText->setEnabled( setter );
FirstPage->setEnabled( setter );
LastPage->setEnabled( setter );
if (setter == false)
CheckBM->setChecked(false);
}
}
 
void PDF_Opts::EffectOnAll()
956,18 → 918,12
 
void PDF_Opts::DoEffects()
{
bool setter = false;
if (CheckBox10->isChecked())
{
Pages->setEnabled(true);
Effects->setEnabled(true);
PagePrev->setEnabled(true);
}
else
{
Pages->setEnabled(false);
Effects->setEnabled(false);
PagePrev->setEnabled(false);
}
setter = true;
Pages->setEnabled(setter);
Effects->setEnabled(setter);
PagePrev->setEnabled(setter);
}
 
void PDF_Opts::ValidDI(int nr)
/trunk/Scribus/scribus/mpalette.h
198,7 → 198,7
bool HaveDoc;
bool HaveItem;
ScribusDoc *doc;
float Umrech;
double Umrech;
bool LMode;
 
public slots:
207,17 → 207,17
void NewSel(int nr);
void SetCurItem(PageItem *i);
void UnitChange();
void setXY(float x, float y);
void setBH(float x, float y);
void setR(float r);
void setRR(float r);
void setXY(double x, double y);
void setBH(double x, double y);
void setR(double r);
void setRR(double r);
void setRM(int r);
void setLsp(float r);
void setLsp(double r);
void setSize(int s);
void setExtra(float e);
void setExtra(double e);
void ChangeScaling();
void setLvalue(float scx, float scy, float x, float y);
void setSvalue(float s);
void setLvalue(double scx, double scy, double x, double y);
void setSvalue(double s);
void setLIvalue(PenStyle p, PenCapStyle pc, PenJoinStyle pj);
void setStil(int s);
void setAli(int e);
/trunk/Scribus/scribus/hyphenator.cpp
22,11 → 22,12
#include <qcursor.h>
#include <qdir.h>
#include <cstdlib>
#include <string>
#include "scribus.h"
 
Hyphenator::Hyphenator(QWidget* parent, ScribusDoc *dok, ScribusApp* app) : QObject( parent, "bu")
{
char *filename = NULL;
std::string filename;
doc = dok;
Sap = app;
MinWordLen = doc->MinWordLen;
43,7 → 44,7
pfad += "/lib/scribus/dicts/" + Sap->Sprachen[Language];
QCString fn = pfad.latin1();
filename = fn.data();
hdict = hnj_hyphen_load(filename);
hdict = hnj_hyphen_load(filename.c_str());
}
 
Hyphenator::~Hyphenator()
53,7 → 54,7
 
void Hyphenator::slotNewDict(QString name)
{
char *filename = NULL;
std::string filename;
if (!Sap->Sprachen.contains(name))
return;
if (hdict != NULL)
64,7 → 65,7
pfad += "/lib/scribus/dicts/" + Sap->Sprachen[Language];
QCString fn = pfad.latin1();
filename = fn.data();
hdict = hnj_hyphen_load(filename);
hdict = hnj_hyphen_load(filename.c_str());
}
 
void Hyphenator::slotNewSettings(int Wordlen, bool Autom, bool ACheck)
/trunk/Scribus/scribus/lineformats.cpp
146,18 → 146,11
}
if (ListBox1->count() > 0)
ListBox1->setSelected(ListBox1->findItem(sFnumber), true);
if (ListBox1->count() == 0)
{
bool setter = ListBox1->count() == 0 ? true : false;
if (setter == false)
sFnumber = "";
DublicateB->setEnabled(false);
EditB->setEnabled(false);
DeleteB->setEnabled(false);
}
else
{
EditB->setEnabled(true);
DublicateB->setEnabled(true);
DeleteB->setEnabled(true);
}
DublicateB->setEnabled(setter);
EditB->setEnabled(setter);
DeleteB->setEnabled(setter);
connect(ListBox1, SIGNAL(highlighted(QListBoxItem*)), this, SLOT(selFormat(QListBoxItem*)));
}
/trunk/Scribus/scribus/edit1format.h
19,7 → 19,7
Q_OBJECT
 
public:
EditStyle( QWidget* parent, struct StVorL *vor, QValueList<StVorL> v, bool neu, preV *Prefs, float au);
EditStyle( QWidget* parent, struct StVorL *vor, QValueList<StVorL> v, bool neu, preV *Prefs, double au);
~EditStyle() {};
 
QLabel* TextLabel1;
53,7 → 53,7
QValueList<StVorL> allV;
QString OldName;
bool IsNew;
float AutoVal;
double AutoVal;
 
private slots:
void Verlassen();
/trunk/Scribus/scribus/scfonts.h
55,10 → 55,10
bool isOTF;
bool Subset;
struct GlyphR { FPointArray Outlines;
float x;
float y;
double x;
double y;
};
QMap<uint,float> CharWidth;
QMap<uint,double> CharWidth;
QMap<uint,GlyphR> GlyphArray;
QMap<uint,FPointArray> RealGlyphs;
QString Ascent;
71,12 → 71,12
QString FontBBox;
bool UseFont;
bool HasKern;
float uniEM;
float numAscent;
float numDescender;
float underline_pos;
float strikeout_pos;
float strokeWidth;
double uniEM;
double numAscent;
double numDescender;
double underline_pos;
double strikeout_pos;
double strokeWidth;
// QPixmap Appearance;
};
 
/trunk/Scribus/scribus/align.cpp
1,7 → 1,7
#include "align.h"
#include "align.moc"
extern QPixmap loadIcon(QString nam);
extern float UmReFaktor;
extern double UmReFaktor;
 
Align::Align( QWidget* parent, int anz, int ein)
: QDialog( parent, "al", true, 0 )
164,7 → 164,7
connect( ButtonGroup1_2, SIGNAL( clicked(int) ), this, SLOT( DistVert() ) );
}
 
/*
/*
* Destroys the object and frees any allocated resources
*/
Align::~Align()
174,37 → 174,28
 
void Align::DistHoriz()
{
if (CheckH->isChecked())
{
AHor->setEnabled( true );
TextLabelD->setEnabled(true);
}
else
{
AHor->setEnabled( false );
TextLabelD->setEnabled(false);
}
bool setter = false;
if (CheckH->isChecked())
setter = true;
AHor->setEnabled( setter );
TextLabelD->setEnabled( setter );
 
}
 
void Align::DistVert()
{
if (CheckV->isChecked())
{
AVert->setEnabled( true );
TextLabelD2->setEnabled(true);
}
else
{
AVert->setEnabled( false );
TextLabelD2->setEnabled(false);
}
bool setter = false;
if (CheckV->isChecked())
setter = true;
AVert->setEnabled( setter );
TextLabelD2->setEnabled( setter );
}
 
void Align::slotApplyDiag()
{
float xdp = static_cast<float>(AHor->value()) / UmReFaktor / 100.0;
double xdp = static_cast<double>(AHor->value()) / UmReFaktor / 100.0;
bool xa = (CheckH->isChecked() || VerteilenH->isChecked());
float ydp = static_cast<float>(AVert->value()) / UmReFaktor / 100.0;
double ydp = static_cast<double>(AVert->value()) / UmReFaktor / 100.0;
bool ya = (CheckV->isChecked() || VerteilenV->isChecked());
int xart = VartH->currentItem();
int yart = VartV->currentItem();
/trunk/Scribus/scribus/customfdialog.cpp
107,10 → 107,8
if ((im.width() > width()-5) || (im.height() > height()-20))
{
QImage im2;
float sx = im.width() /
static_cast<float>(width()-5);
float sy = im.height() /
static_cast<float>(height()-20);
double sx = im.width() / static_cast<double>(width()-5);
double sy = im.height() / static_cast<double>(height()-20);
im2 = sy < sx ? im.smoothScale(qRound(im.width() / sx), qRound(im.height() / sx)) : im.smoothScale(qRound(im.width() / sy), qRound(im.height() / sy));
im = im2;
im2.detach();
250,10 → 248,7
Layout1C->addItem( spacer2 );
addWidgets(TxCodeT, LayoutC, 0);
}
if (Pre)
setPreviewMode( QFileDialog::Contents );
else
setPreviewMode( QFileDialog::NoPreview );
setPreviewMode(Pre ? QFileDialog::Contents : QFileDialog::NoPreview );
setViewMode( QFileDialog::List );
if (comp)
connect(SaveZip, SIGNAL(clicked()), this, SLOT(HandleComp()));
/trunk/Scribus/scribus/mpalette.cpp
7,7 → 7,7
#include "query.h"
#include "scribusview.h"
extern QPixmap loadIcon(QString nam);
extern float UmReFaktor;
extern double UmReFaktor;
extern ProfilesL InputProfiles;
 
NameWidget::NameWidget(QWidget* parent) : QLineEdit(parent)
20,8 → 20,8
}
 
Mpalette::Mpalette( QWidget* parent, preV *Prefs)
: QDialog( parent, "Mfloat", false, 0)
// : QDialog( parent, "Mfloat", false, Qt::WStyle_Customize | Qt::WStyle_Title | Qt::WStyle_Tool)
: QDialog( parent, "Mdouble", false, 0)
// : QDialog( parent, "Mdouble", false, Qt::WStyle_Customize | Qt::WStyle_Title | Qt::WStyle_Tool)
{
setCaption( tr( "Properties" ) );
HaveDoc = false;
38,7 → 38,7
buttonGroup5 = new QButtonGroup( this, "buttonGroup5" );
buttonGroup5->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, 0, 0, buttonGroup5->sizePolicy().hasHeightForWidth() ) );
buttonGroup5->setFrameShape( QButtonGroup::NoFrame );
buttonGroup5->setExclusive( TRUE );
buttonGroup5->setExclusive( true );
buttonGroup5->setColumnLayout(0, Qt::Vertical );
buttonGroup5->setTitle( QString::null );
buttonGroup5->layout()->setSpacing( 0 );
212,7 → 212,7
RotationGroup->layout()->setMargin( 5 );
RotationGroupLayout = new QHBoxLayout( RotationGroup->layout() );
RotationGroupLayout->setAlignment( Qt::AlignTop );
Layout12 = new QGridLayout( 0, 1, 1, 0, 0, "Layout12");
Layout12 = new QGridLayout( 0, 1, 1, 0, 0, "Layout12");
TopLeft = new QRadioButton( RotationGroup, "TopLeft" );
TopLeft->setText( tr( "" ) );
TopLeft->setChecked( true );
262,7 → 262,7
BottomRight->setText( tr( "" ) );
Layout12->addWidget( BottomRight, 2, 2 );
RotationGroupLayout->addLayout( Layout12 );
Layout15_2 = new QVBoxLayout( 0, 3, 0, "Layout15_2");
Layout15_2 = new QVBoxLayout( 0, 3, 0, "Layout15_2");
Text3 = new QLabel( RotationGroup, "Text3" );
Text3->setText( tr( "by:" ) );
Layout15_2->addWidget( Text3 );
309,7 → 309,7
EditShape->setText( tr( "Edit Shape..." ) );
pageLayout_2->addWidget( EditShape );
 
Layout13 = new QHBoxLayout( 0, 0, 2, "Layout13");
Layout13 = new QHBoxLayout( 0, 0, 2, "Layout13");
 
Text4 = new QLabel( page_2, "Text4" );
Text4->setText( tr( "Round\nCorners:" ) );
335,7 → 335,7
page_2b = new QWidget( TabStack2, "page" );
pageLayout_2b = new QVBoxLayout( page_2b, 0, 5, "pageLayout_2");
Distance2 = new QGroupBox( page_2b, "Distance" );
Distance2->setTitle( tr( "Pathtext Properites" ) );
Distance2->setTitle( tr( "Path Text Properites" ) );
Distance2->setColumnLayout(0, Qt::Vertical );
Distance2->layout()->setSpacing( 2 );
Distance2->layout()->setMargin( 5 );
345,7 → 345,7
NormText2->setText( tr( "Show Curve" ) );
DistanceLayout2->addMultiCellWidget( NormText2, 0, 0, 0, 1 );
TextLabel3 = new QLabel( Distance2, "TextLabel3" );
TextLabel3->setText( tr( "Startoffset:" ) );
TextLabel3->setText( tr( "Start Offset:" ) );
DistanceLayout2->addWidget( TextLabel3, 1, 0);
Dist = new MSpinBox( Distance2, 1 );
Dist->setSuffix( tr( " pts" ) );
600,19 → 600,19
GroupAlignLayout->addWidget( TextL, 0, 0 );
 
TextR = new QToolButton( GroupAlign, "TextR" );
TextR->setMaximumSize( QSize( 22, 22 ) );
TextR->setMaximumSize( QSize( 22, 22 ) );
TextR->setPixmap(loadIcon("text_right.png"));
TextR->setToggleButton( true );
GroupAlignLayout->addWidget( TextR, 0, 1 );
 
TextC = new QToolButton( GroupAlign, "TextC" );
TextC->setMaximumSize( QSize( 22, 22 ) );
TextC->setMaximumSize( QSize( 22, 22 ) );
TextC->setPixmap(loadIcon("text_center.png"));
TextC->setToggleButton( true );
GroupAlignLayout->addWidget( TextC, 0, 2 );
 
TextB = new QToolButton( GroupAlign, "TextB" );
TextB->setMaximumSize( QSize( 22, 22 ) );
TextB->setMaximumSize( QSize( 22, 22 ) );
TextB->setPixmap(loadIcon("text_block.png"));
TextB->setToggleButton( true );
GroupAlignLayout->addWidget( TextB, 0, 3 );
645,7 → 645,7
GroupBox3Layout->addWidget( Text5, 0, 0 );
 
Text6 = new QLabel( GroupBox3, "Text6" );
Text6->setText( tr( "Linespacing:" ) );
Text6->setText( tr( "Line Spacing:" ) );
 
GroupBox3Layout->addWidget( Text6, 1, 0 );
pageLayout_3->addWidget( GroupBox3 );
663,7 → 663,7
 
layoutLang = new QHBoxLayout( 0, 0, 5, "layout24");
SprachT = new QLabel( page_3, "Sprache" );
SprachT->setText(tr("Sprache:"));
SprachT->setText(tr("Lang.:"));
layoutLang->addWidget( SprachT );
LangCombo = new QComboBox( true, page_3, "Lang" );
LangCombo->setEditable(false);
699,7 → 699,7
layout43->addWidget( Text12, 2, 0 );
ScaleX = new MSpinBox( page_4, 1 );
ScaleX->setSuffix( tr( " %" ) );
layout43->addWidget( ScaleX, 2, 1 );
layout43->addWidget( ScaleX, 2, 1 );
Text13 = new QLabel( page_4, "Text13" );
Text13->setText( tr( "Vert. Scale:" ) );
layout43->addWidget( Text13, 3, 0 );
713,13 → 713,13
layout43->addMultiCellWidget( Kette, 2, 3, 2, 2 );
pageLayout_4->addLayout( layout43 );
 
Layout24 = new QVBoxLayout( 0, 0, 3, "Layout24");
Layout24 = new QVBoxLayout( 0, 0, 3, "Layout24");
 
FrameScale = new QRadioButton( page_4, "FixedScale" );
FrameScale->setText( tr( "Scale to Frame Size" ) );
Layout24->addWidget( FrameScale );
 
Layout18 = new QHBoxLayout( 0, 0, 6, "Layout18");
Layout18 = new QHBoxLayout( 0, 0, 6, "Layout18");
 
Frame4 = new QFrame( page_4, "Frame4" );
Frame4->setMinimumSize( QSize( 15, 2 ) );
765,12 → 765,12
page_5 = new QWidget( TabStack, "page_5" );
pageLayout_5 = new QVBoxLayout( page_5, 0, 5, "pageLayout_5");
 
Layout13_2 = new QHBoxLayout( 0, 0, 4, "Layout13_2");
Layout13_2 = new QHBoxLayout( 0, 0, 4, "Layout13_2");
 
LineMode = new QComboBox( true, page_5, "LMode" );
LineMode->setEditable(false);
LineMode->insertItem( tr( "Left Point" ) );
LineMode->insertItem( tr( "Endpoints" ) );
LineMode->insertItem( tr( "End Points" ) );
Layout13_2->addWidget( LineMode );
LMode = false;
QSpacerItem* spacer10 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
777,14 → 777,14
Layout13_2->addItem( spacer10 );
pageLayout_5->addLayout( Layout13_2 );
 
Layout12_2 = new QGridLayout( 0, 1, 1, 0, 3, "Layout12_2");
Layout12_2 = new QGridLayout( 0, 1, 1, 0, 3, "Layout12_2");
Text8 = new QLabel( page_5, "Text8" );
Text8->setText( tr( "Linestyle:" ) );
Text8->setText( tr( "Line Style:" ) );
Layout12_2->addWidget( Text8, 0, 0 );
LStyle = new LineCombo(page_5);
Layout12_2->addWidget( LStyle, 1, 0 );
TextLabel1 = new QLabel( page_5, "TextLabel1" );
TextLabel1->setText( tr( "Linewidth:" ) );
TextLabel1->setText( tr( "Line Width:" ) );
Layout12_2->addWidget( TextLabel1, 2, 0 );
LSize = new MSpinBox( page_5, 1 );
LSize->setSuffix( tr( " pt" ) );
821,7 → 821,7
TabStack->addWidget(Cpal, 5);
MpalLayout->addWidget( TabStack );
QToolTip::add( Size, tr( "Font Size" ) );
QToolTip::add( LineSp, tr( "Linespacing" ) );
QToolTip::add( LineSp, tr( "Line Spacing" ) );
QToolTip::add( Extra, tr( "Manual Kerning" ) );
QToolTip::add( Revert, tr( "Reverse Writing" ) );
QToolTip::add( Underline, tr( "Underline" ) );
1022,22 → 1022,21
Textflow2->setChecked(i->Textflow2);
ToggleFlow();
LangCombo->setCurrentText(i->Language);
bool setter;
if (i->NamedLStyle == "")
{
StyledLine->setCurrentItem(0);
LStyle->setEnabled(true);
LSize->setEnabled(true);
LJoinStyle->setEnabled(true);
LEndStyle->setEnabled(true);
StyledLine->setCurrentItem(0);
setter = true;
}
else
{
StyledLine->setSelected(StyledLine->findItem(i->NamedLStyle), true);
LStyle->setEnabled(false);
LSize->setEnabled(false);
LJoinStyle->setEnabled(false);
LEndStyle->setEnabled(false);
StyledLine->setSelected(StyledLine->findItem(i->NamedLStyle), true);
setter = false;
}
LStyle->setEnabled(setter);
LSize->setEnabled(setter);
LJoinStyle->setEnabled(setter);
LEndStyle->setEnabled(setter);
connect(StyledLine, SIGNAL(clicked(QListBoxItem*)), this, SLOT(SetSTline(QListBoxItem*)));
connect(NameEdit, SIGNAL(Leaved()), this, SLOT(NewName()));
if (i->isPrintable)
1045,33 → 1044,24
else
NoPrint->setOn(true);
if (i->Locked)
setter = false;
else
setter = true;
Xpos->setEnabled(setter);
Ypos->setEnabled(setter);
Width->setEnabled(setter);
Height->setEnabled(setter);
Rot->setEnabled(setter);
RoundRect->setEnabled(setter);
EditShape->setEnabled(setter);
ShapeGroup->setEnabled(setter);
LayerGroup->setEnabled(setter);
Locked->setOn(setter);
if (i->Locked)
{
Xpos->setEnabled(false);
Ypos->setEnabled(false);
Width->setEnabled(false);
Height->setEnabled(false);
Rot->setEnabled(false);
RoundRect->setEnabled(false);
EditShape->setEnabled(false);
ShapeGroup->setEnabled(false);
LayerGroup->setEnabled(false);
Locked->setOn(true);
HaveItem = true;
return;
}
else
{
Xpos->setEnabled(true);
Ypos->setEnabled(true);
Width->setEnabled(true);
Height->setEnabled(true);
Rot->setEnabled(true);
RoundRect->setEnabled(true);
EditShape->setEnabled(true);
ShapeGroup->setEnabled(true);
LayerGroup->setEnabled(true);
Locked->setOn(false);
}
if (i->PType == 8)
{
TabStack2->raiseWidget(1);
1119,20 → 1109,15
{
updateCmsList();
if (i->ScaleType)
{
FreeScale->setChecked(true);
FrameScale->setChecked(false);
Aspect->setEnabled(false);
Aspect->setChecked(i->AspectRatio);
}
setter = true;
else
{
FreeScale->setChecked(false);
FrameScale->setChecked(true);
Kette->setOn(false);
Aspect->setEnabled(true);
setter = false;
FreeScale->setChecked(setter);
FrameScale->setChecked(!setter);
if (setter == false)
Kette->setOn(setter);
Aspect->setEnabled(!setter);
Aspect->setChecked(i->AspectRatio);
}
}
}
HaveItem = true;
1334,7 → 1319,7
 
void Mpalette::UnitChange()
{
float old = Umrech;
double old = Umrech;
bool tmp = HaveItem;
HaveItem = false;
QString ein;
1364,16 → 1349,16
Height->setSuffix( ein );
LXpos->setSuffix( ein );
LYpos->setSuffix( ein );
Xpos->setValue(qRound(static_cast<float>(Xpos->value()) / old * UmReFaktor));
Ypos->setValue(qRound(static_cast<float>(Ypos->value()) / old * UmReFaktor));
Width->setValue(qRound(static_cast<float>(Width->value()) / old * UmReFaktor));
Height->setValue(qRound(static_cast<float>(Height->value()) / old * UmReFaktor));
LXpos->setValue(qRound(static_cast<float>(LXpos->value()) / old * UmReFaktor));
LYpos->setValue(qRound(static_cast<float>(LYpos->value()) / old * UmReFaktor));
Xpos->setValue(qRound(static_cast<double>(Xpos->value()) / old * UmReFaktor));
Ypos->setValue(qRound(static_cast<double>(Ypos->value()) / old * UmReFaktor));
Width->setValue(qRound(static_cast<double>(Width->value()) / old * UmReFaktor));
Height->setValue(qRound(static_cast<double>(Height->value()) / old * UmReFaktor));
LXpos->setValue(qRound(static_cast<double>(LXpos->value()) / old * UmReFaktor));
LYpos->setValue(qRound(static_cast<double>(LYpos->value()) / old * UmReFaktor));
HaveItem = tmp;
}
 
void Mpalette::setXY(float x, float y)
void Mpalette::setXY(double x, double y)
{
bool tmp = HaveItem;
HaveItem = false;
1384,7 → 1369,7
HaveItem = tmp;
}
 
void Mpalette::setBH(float x, float y)
void Mpalette::setBH(double x, double y)
{
bool tmp = HaveItem;
HaveItem = false;
1392,8 → 1377,8
QPoint dp;
if ((LMode) && (CurItem->PType == 5))
{
ma.translate(static_cast<float>(Xpos->value()) / UmReFaktor / 100.0, static_cast<float>(Ypos->value()) / UmReFaktor / 100.0);
ma.rotate(static_cast<float>(Rot->value())/100.0*(-1));
ma.translate(static_cast<double>(Xpos->value()) / UmReFaktor / 100.0, static_cast<double>(Ypos->value()) / UmReFaktor / 100.0);
ma.rotate(static_cast<double>(Rot->value())/100.0*(-1));
dp = ma * QPoint(static_cast<int>(x), static_cast<int>(y));
Width->setValue(qRound(dp.x()*UmReFaktor*100.0));
Height->setValue(qRound(dp.y()*UmReFaktor*100.0));
1407,10 → 1392,10
HaveItem = tmp;
}
 
void Mpalette::setR(float r)
void Mpalette::setR(double r)
{
bool tmp = HaveItem;
float rr = r;
double rr = r;
if (r > 0)
rr = 360 - rr;
HaveItem = false;
1418,7 → 1403,7
HaveItem = tmp;
}
 
void Mpalette::setRR(float r)
void Mpalette::setRR(double r)
{
bool tmp = HaveItem;
HaveItem = false;
1434,7 → 1419,7
HaveItem = tmp;
}
 
void Mpalette::setLsp(float r)
void Mpalette::setLsp(double r)
{
bool tmp = HaveItem;
HaveItem = false;
1450,7 → 1435,7
HaveItem = tmp;
}
 
void Mpalette::setExtra(float e)
void Mpalette::setExtra(double e)
{
bool tmp = HaveItem;
HaveItem = false;
1484,7 → 1469,7
}
}
 
void Mpalette::setLvalue(float scx, float scy, float x, float y)
void Mpalette::setLvalue(double scx, double scy, double x, double y)
{
bool tmp = HaveItem;
HaveItem = false;
1495,7 → 1480,7
HaveItem = tmp;
}
 
void Mpalette::setSvalue(float s)
void Mpalette::setSvalue(double s)
{
bool tmp = HaveItem;
HaveItem = false;
1643,11 → 1628,11
 
void Mpalette::NewX()
{
float x,y,w,h, gx, gy, gh, gw;
x = static_cast<float>(Xpos->value()) / UmReFaktor / 100.0;
y = static_cast<float>(Ypos->value()) / UmReFaktor / 100.0;
w = static_cast<float>(Width->value()) / UmReFaktor / 100.0;
h = static_cast<float>(Height->value()) / UmReFaktor / 100.0;
double x,y,w,h, gx, gy, gh, gw;
x = static_cast<double>(Xpos->value()) / UmReFaktor / 100.0;
y = static_cast<double>(Ypos->value()) / UmReFaktor / 100.0;
w = static_cast<double>(Width->value()) / UmReFaktor / 100.0;
h = static_cast<double>(Height->value()) / UmReFaktor / 100.0;
if ((HaveDoc) && (HaveItem))
{
if (doc->ActPage->GroupSel)
1659,7 → 1644,7
{
if ((CurItem->PType == 5) && (LMode))
{
float r = atan2(h-y,w-x)*(180.0/3.1415927);
double r = atan2(h-y,w-x)*(180.0/3.1415927);
w = sqrt(pow(w-x,2)+pow(h-y,2));
doc->ActPage->MoveItem(x - CurItem->Xpos, 0, CurItem, true);
doc->ActPage->SizeItem(w, CurItem->Height, CurItem->ItemNr, true);
1674,11 → 1659,11
 
void Mpalette::NewY()
{
float x,y,w,h, gx, gy, gh, gw;
x = static_cast<float>(Xpos->value()) / UmReFaktor / 100.0;
y = static_cast<float>(Ypos->value()) / UmReFaktor / 100.0;
w = static_cast<float>(Width->value()) / UmReFaktor / 100.0;
h = static_cast<float>(Height->value()) / UmReFaktor / 100.0;
double x,y,w,h, gx, gy, gh, gw;
x = static_cast<double>(Xpos->value()) / UmReFaktor / 100.0;
y = static_cast<double>(Ypos->value()) / UmReFaktor / 100.0;
w = static_cast<double>(Width->value()) / UmReFaktor / 100.0;
h = static_cast<double>(Height->value()) / UmReFaktor / 100.0;
if ((HaveDoc) && (HaveItem))
{
if (doc->ActPage->GroupSel)
1690,7 → 1675,7
{
if ((CurItem->PType == 5) && (LMode))
{
float r = atan2(h-y,w-x)*(180.0/3.1415927);
double r = atan2(h-y,w-x)*(180.0/3.1415927);
w = sqrt(pow(w-x,2)+pow(h-y,2));
doc->ActPage->MoveItem(0, y - CurItem->Ypos, CurItem, true);
doc->ActPage->SizeItem(w, CurItem->Height, CurItem->ItemNr, true);
1705,11 → 1690,11
 
void Mpalette::NewW()
{
float x,y,w,h, gx, gy, gh, gw;
x = static_cast<float>(Xpos->value()) / UmReFaktor / 100.0;
y = static_cast<float>(Ypos->value()) / UmReFaktor / 100.0;
w = static_cast<float>(Width->value()) / UmReFaktor / 100.0;
h = static_cast<float>(Height->value()) / UmReFaktor / 100.0;
double x,y,w,h, gx, gy, gh, gw;
x = static_cast<double>(Xpos->value()) / UmReFaktor / 100.0;
y = static_cast<double>(Ypos->value()) / UmReFaktor / 100.0;
w = static_cast<double>(Width->value()) / UmReFaktor / 100.0;
h = static_cast<double>(Height->value()) / UmReFaktor / 100.0;
if ((HaveDoc) && (HaveItem))
{
if (doc->ActPage->GroupSel)
1727,7 → 1712,7
{
if (LMode)
{
float r = atan2(h-y,w-x)*(180.0/3.1415927);
double r = atan2(h-y,w-x)*(180.0/3.1415927);
doc->ActPage->RotateItem(r, CurItem->ItemNr);
w = sqrt(pow(w-x,2)+pow(h-y,2));
}
1742,11 → 1727,11
 
void Mpalette::NewH()
{
float x,y,w,h, gx, gy, gh, gw;
x = static_cast<float>(Xpos->value()) / UmReFaktor / 100.0;
y = static_cast<float>(Ypos->value()) / UmReFaktor / 100.0;
w = static_cast<float>(Width->value()) / UmReFaktor / 100.0;
h = static_cast<float>(Height->value()) / UmReFaktor / 100.0;
double x,y,w,h, gx, gy, gh, gw;
x = static_cast<double>(Xpos->value()) / UmReFaktor / 100.0;
y = static_cast<double>(Ypos->value()) / UmReFaktor / 100.0;
w = static_cast<double>(Width->value()) / UmReFaktor / 100.0;
h = static_cast<double>(Height->value()) / UmReFaktor / 100.0;
if ((HaveDoc) && (HaveItem))
{
if (doc->ActPage->GroupSel)
1764,7 → 1749,7
{
if (LMode)
{
float r = atan2(h-y,w-x)*(180.0/3.1415927);
double r = atan2(h-y,w-x)*(180.0/3.1415927);
doc->ActPage->RotateItem(r, CurItem->ItemNr);
w = sqrt(pow(w-x,2)+pow(h-y,2));
}
1783,7 → 1768,7
{
if (doc->ActPage->GroupSel)
return;
doc->ActPage->RotateItem(static_cast<float>(Rot->value())/100.0*(-1), CurItem->ItemNr);
doc->ActPage->RotateItem(static_cast<double>(Rot->value())/100.0*(-1), CurItem->ItemNr);
emit DocChanged();
}
}
1802,7 → 1787,7
{
if ((HaveDoc) && (HaveItem))
{
doc->ActPage->ChLineSpa(static_cast<float>(LineSp->value())/10.0);
doc->ActPage->ChLineSpa(static_cast<double>(LineSp->value())/10.0);
emit DocChanged();
}
}
1822,7 → 1807,7
{
if ((CurItem->HasSel) || (doc->AppMode == 1))
{
doc->ActPage->chKerning(static_cast<float>(Extra->value())/10);
doc->ActPage->chKerning(static_cast<double>(Extra->value())/10);
emit DocChanged();
}
else
1829,7 → 1814,7
{
if (uint(CurItem->CPos) != CurItem->Ptext.count())
{
CurItem->Ptext.at(CurItem->CPos)->cextra = static_cast<float>(Extra->value())/10;
CurItem->Ptext.at(CurItem->CPos)->cextra = static_cast<double>(Extra->value())/10;
CurItem->Dirty = true;
doc->ActPage->RefreshItem(CurItem);
emit DocChanged();
1842,7 → 1827,7
{
if ((HaveDoc) && (HaveItem))
{
doc->ActPage->ChLocalXY(static_cast<float>(LXpos->value()) / UmReFaktor / 100.0, static_cast<float>(LYpos->value()) / UmReFaktor / 100.0);
doc->ActPage->ChLocalXY(static_cast<double>(LXpos->value()) / UmReFaktor / 100.0, static_cast<double>(LYpos->value()) / UmReFaktor / 100.0);
emit DocChanged();
}
}
1851,7 → 1836,7
{
if ((HaveDoc) && (HaveItem))
{
doc->ActPage->ChLocalSc(static_cast<float>(ScaleX->value()) / 1000.0, static_cast<float>(ScaleY->value()) / 1000.0);
doc->ActPage->ChLocalSc(static_cast<double>(ScaleX->value()) / 1000.0, static_cast<double>(ScaleY->value()) / 1000.0);
emit DocChanged();
}
}
1860,7 → 1845,7
{
if ((HaveDoc) && (HaveItem))
{
doc->ActPage->ChLineWidth(static_cast<float>(LSize->value())/10.0);
doc->ActPage->ChLineWidth(static_cast<double>(LSize->value())/10.0);
emit DocChanged();
}
}
1971,7 → 1956,7
{
ScaleY->setValue(ScaleX->value());
NewLocalSC();
}
}
}
 
void Mpalette::HChange()
2196,10 → 2181,10
{
if ((HaveDoc) && (HaveItem))
{
CurItem->Extra = static_cast<float>(DLeft->value()) / 10;
CurItem->TExtra = static_cast<float>(DTop->value()) / 10;
CurItem->BExtra = static_cast<float>(DBottom->value()) / 10;
CurItem->RExtra = static_cast<float>(DRight->value()) / 10;
CurItem->Extra = static_cast<double>(DLeft->value()) / 10;
CurItem->TExtra = static_cast<double>(DTop->value()) / 10;
CurItem->BExtra = static_cast<double>(DBottom->value()) / 10;
CurItem->RExtra = static_cast<double>(DRight->value()) / 10;
doc->ActPage->RefreshItem(CurItem);
emit DocChanged();
}
2251,22 → 2236,15
{
if (c == NULL)
return;
if (c->listBox()->currentItem() == 0)
{
bool setter = c->listBox()->currentItem() == 0 ? false : true;
if (setter == true)
CurItem->NamedLStyle = "";
LStyle->setEnabled(true);
LSize->setEnabled(true);
LJoinStyle->setEnabled(true);
LEndStyle->setEnabled(true);
}
else
{
CurItem->NamedLStyle = c->text();
LStyle->setEnabled(false);
LSize->setEnabled(false);
LJoinStyle->setEnabled(false);
LEndStyle->setEnabled(false);
}
LStyle->setEnabled(setter);
LSize->setEnabled(setter);
LJoinStyle->setEnabled(setter);
LEndStyle->setEnabled(setter);
doc->ActPage->RefreshItem(CurItem);
emit DocChanged();
}
2314,9 → 2292,7
{
InputP->insertItem(itP.key());
if (itP.key() == CurItem->IProfile)
{
InputP->setCurrentItem(InputP->count()-1);
}
}
if (!InputProfiles.contains(CurItem->IProfile))
{
2550,7 → 2526,7
{
if ((HaveDoc) && (HaveItem))
{
CurItem->Extra = static_cast<float>(Dist->value()) / 10;
CurItem->Extra = static_cast<double>(Dist->value()) / 10;
doc->ActPage->UpdatePolyClip(CurItem);
doc->ActPage->AdjustItemSize(CurItem);
doc->ActPage->RefreshItem(CurItem);
2562,7 → 2538,7
{
if ((HaveDoc) && (HaveItem))
{
CurItem->BaseOffs = static_cast<float>(-LineW->value()) / 10;
CurItem->BaseOffs = static_cast<double>(-LineW->value()) / 10;
doc->ActPage->UpdatePolyClip(CurItem);
doc->ActPage->AdjustItemSize(CurItem);
doc->ActPage->RefreshItem(CurItem);
/trunk/Scribus/scribus/util.cpp
60,7 → 60,7
#endif
extern ProfilesL InputProfiles;
 
FPointArray traceChar(FT_Face face, uint chr, int chs, float *x, float *y);
FPointArray traceChar(FT_Face face, uint chr, int chs, double *x, double *y);
QString Path2Relative(QString Path);
QPixmap LoadPDF(QString fn, int Seite, int Size, int *w, int *h);
bool GlyNames(QMap<uint, QString> *GList, QString Dat);
75,14 → 75,14
QString MaskToTxt(QImage *im, bool PDF = true);
void Level2Layer(ScribusDoc *doc, struct Layer *ll, int Level);
void BezierPoints(QPointArray *ar, QPoint n1, QPoint n2, QPoint n3, QPoint n4);
float xy2Deg(float x, float y);
double xy2Deg(double x, double y);
QPointArray FlattenPath(FPointArray ina, QValueList<uint> &Segs);
QPointArray RegularPolygon(float w, float h, uint c, bool star, float factor, float rota);
FPointArray RegularPolygonF(float w, float h, uint c, bool star, float factor, float rota);
QPointArray RegularPolygon(double w, double h, uint c, bool star, double factor, double rota);
FPointArray RegularPolygonF(double w, double h, uint c, bool star, double factor, double rota);
QPixmap loadIcon(QString nam);
bool loadText(QString nam, QString *Buffer);
float Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
float QStoFloat(QString in);
double Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
double QStodouble(QString in);
int QStoInt(QString in);
QString GetAttr(QDomElement *el, QString at, QString def="0");
QImage LoadPict(QString fn);
214,8 → 214,8
QImage im2;
*h = image.height();
*w = image.width();
float sx = image.width() / static_cast<float>(Size);
float sy = image.height() / static_cast<float>(Size);
double sx = image.width() / static_cast<double>(Size);
double sy = image.height() / static_cast<double>(Size);
if (sy < sx)
im2 = image.smoothScale(static_cast<int>(image.width() / sx), static_cast<int>(image.height() / sx));
else
237,7 → 237,7
QString tmp, dummy, cmd1, cmd2, BBox;
QChar tc;
QImage Bild;
float x, y, b, h;
double x, y, b, h;
bool found = false;
int ret = -1;
QFileInfo fi = QFileInfo(fn);
278,7 → 278,7
}
if (tmp.startsWith("%%EndComments"))
break;
}
}
f.close();
if (found)
{
397,7 → 397,7
QString tmp, dummy, cmd1, cmd2, BBox;
QChar tc;
QImage Bild;
float x, y, b, h;
double x, y, b, h;
bool found = false;
int ret = -1;
QFileInfo fi = QFileInfo(fn);
638,10 → 638,10
return 0;
}
 
float QStoFloat(QString in)
double QStodouble(QString in)
{
bool ok = false;
float c = in.toFloat(&ok);
double c = in.toDouble(&ok);
if (ok)
return c;
else
683,9 → 683,9
return ret;
}
 
float Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2)
double Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2)
{
float w;
double w;
FT_Vector delta;
uint c1 = ch.at(0).unicode();
uint c2 = ch2.at(0).unicode();
703,10 → 703,10
return w;
}
else
return static_cast<float>(Siz);
return static_cast<double>(Siz);
}
 
QPointArray RegularPolygon(float w, float h, uint c, bool star, float factor, float rota)
QPointArray RegularPolygon(double w, double h, uint c, bool star, double factor, double rota)
{
uint cx;
if (star)
713,9 → 713,9
cx = c * 2;
else
cx = c;
float seg = 360.0 / cx;
float sc = rota + 180.0;
float di = factor;
double seg = 360.0 / cx;
double sc = rota + 180.0;
double di = factor;
int mx = 0;
int my = 0;
QPointArray pts = QPointArray();
746,7 → 746,7
return pts;
}
 
FPointArray RegularPolygonF(float w, float h, uint c, bool star, float factor, float rota)
FPointArray RegularPolygonF(double w, double h, uint c, bool star, double factor, double rota)
{
uint cx;
if (star)
753,11 → 753,11
cx = c * 2;
else
cx = c;
float seg = 360.0 / cx;
float sc = rota + 180.0;
float di = factor;
float mx = 0;
float my = 0;
double seg = 360.0 / cx;
double sc = rota + 180.0;
double di = factor;
double mx = 0;
double my = 0;
FPointArray pts = FPointArray();
for (uint x = 0; x < cx; ++x)
{
799,7 → 799,7
{
outa.resize(outa.size()+1);
outa.setPoint(outa.size()-1, cli.point(cli.size()-1));
Segs.append(outa.size());
Segs.append(outa.size());
continue;
}
BezierPoints(&Bez, ina.pointQ(poi), ina.pointQ(poi+1), ina.pointQ(poi+3), ina.pointQ(poi+2));
812,7 → 812,7
return outa;
}
 
float xy2Deg(float x, float y)
double xy2Deg(double x, double y)
{
return (atan2(y,x)*(180.0/M_PI));
}
1209,7 → 1209,7
0
};
 
FPointArray traceChar(FT_Face face, uint chr, int chs, float *x, float *y)
FPointArray traceChar(FT_Face face, uint chr, int chs, double *x, double *y)
{
FT_UInt glyphIndex;
FPointArray pts, pts2;
/trunk/Scribus/scribus/edit1format.cpp
3,7 → 3,7
extern QPixmap loadIcon(QString nam);
#include <qmessagebox.h>
 
EditStyle::EditStyle( QWidget* parent, struct StVorL *vor, QValueList<StVorL> v, bool neu, preV *Prefs, float au)
EditStyle::EditStyle( QWidget* parent, struct StVorL *vor, QValueList<StVorL> v, bool neu, preV *Prefs, double au)
: QDialog( parent, "EditST", true, 0)
{
setCaption( tr( "Edit Style" ) );
183,7 → 183,7
LineSpVal->setLineStep(10);
LineSpVal->setValue(qRound(vor->LineSpa * 10));
AbstandVLayout->addWidget( LineSpVal, 2, 1 );
 
TextLabel3 = new QLabel( AbstandV, "TextLabel3" );
TextLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)1, TextLabel3->sizePolicy().hasHeightForWidth() ) );
TextLabel3->setMinimumSize( QSize( 90, 22 ) );
271,11 → 271,11
werte->Ausri = 3;
if (Forced->isChecked())
werte->Ausri = 4;
werte->LineSpa = static_cast<float>(LineSpVal->value()) / 10;
werte->Indent = static_cast<float>(LeftInd->value() / 10);
werte->First = static_cast<float>(FirstLin->value() / 10);
werte->Avor = static_cast<float>(AboveV->value() / 10);
werte->Anach = static_cast<float>(BelowV->value() / 10);
werte->LineSpa = static_cast<double>(LineSpVal->value()) / 10;
werte->Indent = static_cast<double>(LeftInd->value() / 10);
werte->First = static_cast<double>(FirstLin->value() / 10);
werte->Avor = static_cast<double>(AboveV->value() / 10);
werte->Anach = static_cast<double>(BelowV->value() / 10);
werte->Vname = Name->text();
werte->Font = FontC->currentText();
werte->FontSize = SizeC->value();
/trunk/Scribus/scribus/scfonts.cpp
30,7 → 30,7
#include FT_FREETYPE_H
#include FT_OUTLINE_H
#include FT_GLYPH_H
extern FPointArray traceChar(FT_Face face, uint chr, int chs, float *x, float *y);
extern FPointArray traceChar(FT_Face face, uint chr, int chs, double *x, double *y);
 
extern bool loadText(QString nam, QString *Buffer);
extern bool GlyNames(QMap<uint, QString> *GList, QString Dat);
156,7 → 156,7
CharWidth.clear();
GlyphArray.clear();
QString tmp;
float x, y;
double x, y;
FPointArray outlines;
struct GlyphR GRec;
bool error;
176,7 → 176,7
UseFont = false;
return false;
}
uniEM = static_cast<float>(face->units_per_EM);
uniEM = static_cast<double>(face->units_per_EM);
QString afnm = Datei.left(Datei.length()-3);
QFile afm(afnm+"afm");
if(!(afm.exists()))
289,7 → 289,7
posi += 6;
for (uint j = posi; j < bb.size(); ++j)
{
if ((bb[j] == char(0x80)) && (static_cast<int>(bb[j+1]) == 3))
if ((bb[j] == static_cast<char>(0x80)) && (static_cast<int>(bb[j+1]) == 3))
break;
if(bb[j]=='\r')
str+="\n";
/trunk/Scribus/scribus/fmitem.cpp
15,6 → 15,9
* *
***************************************************************************/
 
/* IMPORTANT! The variable string has been renamed stringy to avoid clashes with the STL
string class */
#include "fmitem.h"
#include <qfontmetrics.h>
#include <qapplication.h>
21,7 → 24,7
 
FmItem::FmItem(const QString& s, const QFont& f)
{
string = s;
stringy = s;
font = f;
font.setPointSize(qApp->font().pointSize());
}
29,15 → 32,15
void FmItem::paint(QPainter *p, const QColorGroup&, bool, bool, int x, int y, int w, int h)
{
p->setFont(font);
p->drawText(x, y, w, h, AlignLeft | AlignVCenter | ShowPrefix | DontClip, string);
p->drawText(x, y, w, h, AlignLeft | AlignVCenter | ShowPrefix | DontClip, stringy);
}
 
QSize FmItem::sizeHint()
{
return QFontMetrics(font).size(AlignLeft | AlignVCenter | ShowPrefix | DontClip, string);
return QFontMetrics(font).size(AlignLeft | AlignVCenter | ShowPrefix | DontClip, stringy);
}
 
QString FmItem::Ctext()
{
return string;
return stringy;
}
/trunk/Scribus/scribus/annota.h
56,7 → 56,7
int MaxSeite;
 
public slots:
void SetCo(float x, float y);
void SetCo(double x, double y);
void SetPg(int v);
void SetCross();
void SetVals();
/trunk/Scribus/scribus/align.h
46,7 → 46,7
virtual void slotApplyDiag();
 
signals:
void ApplyDist(bool, bool, bool, bool, float, float, int, int);
void ApplyDist(bool, bool, bool, bool, double, double, int, int);
 
protected:
QVBoxLayout* AlignLayout;
/trunk/Scribus/scribus/pageitem.h
35,7 → 35,7
class PageItem : public QObject {
 
public:
PageItem(Page* pa, int art, float x, float y, float w, float h, float w2, QString fill, QString outline, ScribusDoc *doc);
PageItem(Page* pa, int art, double x, double y, double w, double h, double w2, QString fill, QString outline, ScribusDoc *doc);
~PageItem() {};
struct ZZ { QString Zeich;
QString Farb;
43,13 → 43,13
int shade;
int shade2;
QString ZFo;
float xco;
float yco;
double xco;
double yco;
bool Sele;
int Siz;
int Style;
float wide;
float kern;
double wide;
double kern;
int scale;
};
/** Zeichnet das Item */
65,19 → 65,19
bool Locked;
bool Reverse;
/** X-Position auf der Seite */
float Xpos;
double Xpos;
/** Y-Position auf der Seite */
float Ypos;
double Ypos;
/** Breite des Elements */
float Width;
double Width;
/** Hoehe des Elements */
float Height;
double Height;
/** Eckrundung von Rechtecken */
float RadRect;
double RadRect;
/** Art des Items */
int PType;
/** Winkel um den das Item gedreht wird */
float Rot;
double Rot;
/** Enthaelt das uebergeordnete Objekt */
QWidget *Parent;
/** Enthaelt das Dokument */
102,7 → 102,7
int TxtScale;
int TxTStyle;
/** Strichstaerke */
float Pwidth;
double Pwidth;
/** Linienart */
PenStyle PLineArt;
PenCapStyle PLineEnd;
115,7 → 115,7
FPointArray PoLine;
QValueList<uint> Segments;
bool PoShow;
float BaseOffs;
double BaseOffs;
bool ClipEdited;
int FrameType;
/** Interne Item-Nummer */
139,15 → 139,15
/** Bild verfuegbar */
bool PicAvail;
/** Lokales Scaling x*/
float LocalScX;
float LocalViewX;
double LocalScX;
double LocalViewX;
/** Lokales Scaling y*/
float LocalScY;
float LocalViewY;
double LocalScY;
double LocalViewY;
/** Lokales X */
float LocalX;
double LocalX;
/** Lokales Y */
float LocalY;
double LocalY;
int OrigW;
int OrigH;
/** Anzahl horizontaler Spiegelungen */
155,20 → 155,20
/** Anzahl vertikaler Spiegelungen */
int flippedV;
/** BoundigBox-X */
float BBoxX;
double BBoxX;
/** BoundingBox-H */
float BBoxH;
double BBoxH;
/** Extra Abstand vom Rand */
float Extra;
float TExtra;
float BExtra;
float RExtra;
double Extra;
double TExtra;
double BExtra;
double RExtra;
/** Linespacing */
float LineSp;
double LineSp;
/** Zeichen X-Position */
float CurX;
double CurX;
/** Zeichen Y-Position */
float CurY;
double CurY;
/** Cursorposition */
int CPos;
/** Text des Elements */
235,23 → 235,23
int Ausrich;
uint MaxChars;
bool Redrawn;
float ExtraV;
double ExtraV;
bool isRaster;
float OldB;
float OldH;
float OldB2;
float OldH2;
double OldB;
double OldH;
double OldB2;
double OldH2;
bool Sizing;
bool toPixmap;
int LayerNr;
bool ScaleType;
bool AspectRatio;
float Transparency;
float TranspStroke;
double Transparency;
double TranspStroke;
QValueStack<int> Groups;
bool InvPict;
QValueList<float> DashValues;
float DashOffset;
QValueList<double> DashValues;
double DashOffset;
VGradient fill_gradient;
QString Language;
};
/trunk/Scribus/scribus/fpoint.h
27,20 → 27,20
{
public:
FPoint() {};
FPoint(float x, float y);
FPoint(double x, double y);
FPoint(QPoint p);
~FPoint() {};
float x();
float y();
void setX(float x);
void setY(float y);
double x();
double y();
void setX(double x);
void setY(double y);
bool operator==(const FPoint &rhs);
bool operator!=(const FPoint &rhs);
FPoint &operator+=( const FPoint &p );
FPoint &operator-=( const FPoint &p );
private:
float xp;
float yp;
double xp;
double yp;
};
 
#endif
/trunk/Scribus/scribus/vruler.cpp
54,8 → 54,8
void Vruler::paintEvent(QPaintEvent *)
{
int xx, pc;
float of, xl, iter, iter2;
float sc = doku->Scale;
double of, xl, iter, iter2;
double sc = doku->Scale;
switch (doku->Einheit)
{
case 0:
/trunk/Scribus/scribus/page.h
39,32 → 39,32
Page(QWidget *pa, int x, int y, int b, int h, ScribusDoc *doc, QScrollView *view);
~Page() {};
/** Zeichnet eine Ellipse */
int PaintEllipse(float x, float y, float b, float h, float w, QString fill, QString outline);
int PaintEllipse(double x, double y, double b, double h, double w, QString fill, QString outline);
/** Zeichnet eine Bildbox */
int PaintPict(float x, float y, float b, float h);
int PaintPict(double x, double y, double b, double h);
/** Zeichnet ein Rechteck */
int PaintRect(float x, float y, float b, float h, float w, QString fill, QString outline);
int PaintRect(double x, double y, double b, double h, double w, QString fill, QString outline);
/** Zeichnet eine Linie */
int PaintLine(float x, float y, float b, float h, float w, QString outline);
int PaintLine(double x, double y, double b, double h, double w, QString outline);
/** Zeichnet eine Textbox */
int PaintText(float x, float y, float b, float h, float w, QString outline);
int PaintText(double x, double y, double b, double h, double w, QString outline);
/** Zeichnet ein Polygon */
int PaintPoly(float x, float y, float b, float h, float w, QString fill, QString outline);
int PaintPolyLine(float x, float y, float b, float h, float w, QString fill, QString outline);
int PaintPoly(double x, double y, double b, double h, double w, QString fill, QString outline);
int PaintPolyLine(double x, double y, double b, double h, double w, QString fill, QString outline);
/** Laedt ein Bild */
void LoadPict(QString fn, int ItNr);
void insertColor(QString nam, float c, float m, float y, float k);
void insertColor(QString nam, double c, double m, double y, double k);
void DrawPageMarks(QPaintEvent *e, ScPainter *p, QRect rd);
void DrawPageItems(QPaintEvent *e, ScPainter *painter, QRect rd);
void paintEvent(QPaintEvent *e);
void setGroupRect();
void getGroupRect(float *x, float *y, float *w, float *h);
void getGroupRectScreen(float *x, float *y, float *w, float *h);
void getGroupRect(double *x, double *y, double *w, double *h);
void getGroupRectScreen(double *x, double *y, double *w, double *h);
void paintGroupRect(bool norm = true);
void moveGroup(float x, float y, bool fromMP = false);
FPoint transformPointI(FPoint in, float dx, float dy, float rot, float sx, float sy);
FPoint transformPoint(FPoint in, float dx, float dy, float rot, float sx, float sy);
void scaleGroup(float scx, float scy);
void moveGroup(double x, double y, bool fromMP = false);
FPoint transformPointI(FPoint in, double dx, double dy, double rot, double sx, double sy);
FPoint transformPoint(FPoint in, double dx, double dy, double rot, double sx, double sy);
void scaleGroup(double scx, double scy);
void storeUndoInf(PageItem* b);
void mouseDoubleClickEvent(QMouseEvent *);
void mouseReleaseEvent(QMouseEvent *m);
80,8 → 80,8
void Deselect(bool prop = true);
void SelectItemNr(int nr);
void SetupDraw(int Nr);
void MoveItemI(float newX, float newY, int ite);
bool MoveItem(float newX, float newY, PageItem* ite, bool fromMP = false);
void MoveItemI(double newX, double newY, int ite);
bool MoveItem(double newX, double newY, PageItem* ite, bool fromMP = false);
void UpdateClip(PageItem* b);
FPoint GetMaxClipF(FPointArray Clip);
FPoint GetMinClipF(FPointArray Clip);
106,9 → 106,9
bool GetItem(PageItem **b, int nr = -1);
void MoveRotated(PageItem *b, FPoint npv);
void AdjustPictScale(PageItem *b);
bool SizeItem(float newX, float newY, int ite, bool fromMP = false, bool DoUpdateClip = true);
bool SizeItem(double newX, double newY, int ite, bool fromMP = false, bool DoUpdateClip = true);
bool MoveSizeItem(FPoint newX, FPoint newY, int ite);
void RotateItem(float win, int ite);
void RotateItem(double win, int ite);
void MarkClip(PageItem *b);
void Transform(PageItem *b, QPainter *p);
void TransformM(PageItem *b, QPainter *p);
124,7 → 124,7
void SetYGuide(QMouseEvent *m);
void SetXGuide(QMouseEvent *m);
void SnapToGuides(PageItem* b);
void ApplyGuides(float *x, float *y);
void ApplyGuides(double *x, double *y);
void TextToPath();
void UniteObj();
void SplitObj();
151,7 → 151,7
int Myp;
bool Mpressed;
bool mCG;
float oldW;
double oldW;
QPtrList<PageItem> SelItem;
QValueList<int> SelNode;
int HowTo;
174,15 → 174,15
bool MoveSym;
bool GroupSel;
bool DraggedGroup;
float GroupX;
float GroupY;
float GroupW;
float GroupH;
double GroupX;
double GroupY;
double GroupW;
double GroupH;
bool HanMove;
int DrHY;
int DrVX;
QValueList<float> XGuides;
QValueList<float> YGuides;
QValueList<double> XGuides;
QValueList<double> YGuides;
uint GyM;
bool MoveGY;
uint GxM;
191,12 → 191,12
bool MidButt;
 
public slots:
void ChLineWidth(float w);
void ChLineWidth(double w);
void ChLineArt(PenStyle w);
void ChLineJoin(PenJoinStyle w);
void ChLineEnd(PenCapStyle w);
void ChLocalXY(float x, float y);
void ChLocalSc(float x, float y);
void ChLocalXY(double x, double y);
void ChLocalSc(double x, double y);
void ToggleBookmark();
void ToggleAnnotation();
void ToggleLock();
222,12 → 222,12
bool slotSetCurs(int x, int y);
void slotDoCurs(bool draw);
void BlinkCurs();
void ChLineSpa(float w);
void chKerning(float us);
void ChLineSpa(double w);
void chKerning(double us);
void chTyStyle(int s);
void SetAbStyle(int s);
void chAbStyle(PageItem *b, int s);
void AlignObj(bool xa, bool ya, bool Vth, bool Vtv, float xdisp, float ydisp, int xart, int yart);
void AlignObj(bool xa, bool ya, bool Vth, bool Vtv, double xdisp, double ydisp, int xart, int yart);
void sentToScrap();
void sentToLayer(int id);
void ToTextFrame();
252,12 → 252,12
/** Seite veraendert */
void DocChanged();
/** Position eines Elementes */
void ItemPos(float, float);
void ItemPos(double, double);
/** Breite und Hoehe eines Elementes */
void ItemGeom(float, float);
void ItemRadius(float);
void ItemGeom(double, double);
void ItemRadius(double);
/** Setzt den Drehungswinkel des Elementes */
void SetAngle(float);
void SetAngle(double);
/** Zoomfunktionen */
void ZoomIn();
void ZoomOut();
265,22 → 265,22
void AbsPosi(int, int);
void AbsPosi2(int, int);
/** Sendet die Linienstaerke an die Masspalette */
void SetSizeValue(float);
void SetSizeValue(double);
/** Sendet die Linienart an die Masspalette */
void SetLineArt(PenStyle, PenCapStyle, PenJoinStyle);
/** Sendet die lokalen Bildeigenschaften an die Masspalette */
void SetLocalValues(float, float, float, float);
void SetLocalValues(double, double, double, double);
/** Sendet die Stiftfarbe an die Farbpalette */
void ItemFarben(QString, QString, int, int);
void ItemGradient(QString, QString, int, int, int);
/** Sendet die Textattribute an die Masspalette */
void ItemTextAttr(float);
void ItemTextAttr(double);
/** Sendet die Schriftart */
void ItemTextFont(QString);
/** Sendet die Schriftgroesse */
void ItemTextSize(int);
void ItemTextSca(int);
void ItemTextUSval(float);
void ItemTextUSval(double);
void ItemTextAbs(int);
void ItemTextFarben(QString, QString, int, int);
/** Text in Textbox selektiert */
294,14 → 294,14
void Amode(int);
void AnnotProps();
void ToScrap(QString);
void MousePos(float, float);
void ClipPo(float, float);
void MousePos(double, double);
void ClipPo(double, double);
void HavePoint(bool, bool);
void PolyOpen();
void PStatus(int, uint);
void UndoAvail();
void EditGuides();
void ItemTrans(float, float);
void ItemTrans(double, double);
void AddBM(PageItem *);
void DelBM(PageItem *);
void NewBMNr(int, int);
/trunk/Scribus/scribus/cmsprefs.cpp
224,27 → 224,19
 
void CMSPrefs::slotSimula()
{
if (Simulate->isChecked())
GamutC->setEnabled(true);
else
GamutC->setEnabled(false);
bool setter = Simulate->isChecked() ? true : false;
GamutC->setEnabled(setter);
}
 
void CMSPrefs::slotCMSon()
{
if (CheckBox1->isChecked())
{
SysProfiles->setEnabled( true );
Render->setEnabled( true );
Simulate->setEnabled(true);
slotSimula();
}
else
{
SysProfiles->setEnabled( false );
Render->setEnabled( false );
Simulate->setEnabled(false);
GamutC->setEnabled(false);
}
bool setter = CheckBox1->isChecked() ? true : false;
SysProfiles->setEnabled(setter);
Render->setEnabled(setter);
Simulate->setEnabled(setter);
if (setter == true)
slotSimula();
else
GamutC->setEnabled(setter);
}
 
/trunk/Scribus/scribus/buttonicon.cpp
118,10 → 118,7
{
Place->setCurrentItem(Item->AnIPlace);
ScaleW->setCurrentItem(Item->AnScaleW);
if (Item->LocalScX != Item->LocalScY)
ScaleH->setCurrentItem(1);
else
ScaleH->setCurrentItem(0);
ScaleH->setCurrentItem(Item->LocalScX != Item->LocalScY ? 1 : 0);
SetScaleHow(ScaleH->currentItem());
if ((Item->Width/Item->LocalScX - Item->pixm.width()) != 0)
SliderX->setValue(static_cast<int>(Item->LocalX / (Item->Width/Item->LocalScX - Item->pixm.width()) * 1000));
136,19 → 133,10
 
void ButtonIcon::SetScaleHow(int s)
{
if (s == 1)
{
GroupButton->setEnabled(false);
TextLabel3->setEnabled(false);
SliderX->setEnabled(false);
SliderY->setEnabled(false);
}
else
{
GroupButton->setEnabled(true);
TextLabel3->setEnabled(true);
SliderX->setEnabled(true);
SliderY->setEnabled(true);
}
bool setter = (s == 1) ? false : true;
GroupButton->setEnabled(setter);
TextLabel3->setEnabled(setter);
SliderX->setEnabled(setter);
SliderY->setEnabled(setter);
IcScaleH = s;
}
/trunk/Scribus/scribus/reformdoc.h
22,7 → 22,7
Q_OBJECT
 
public:
ReformDoc( QWidget* parent, float t, float l, float r, float b, float Pagebr, float Pageho, bool fp, bool fpe, int Einh );
ReformDoc( QWidget* parent, double t, double l, double r, double b, double Pagebr, double Pageho, bool fp, bool fpe, int Einh );
~ReformDoc() {};
 
QGroupBox* GroupBox7;
/trunk/Scribus/scribus/seiten.cpp
163,16 → 163,11
void SeView::ToggleNam()
{
Namen = !Namen;
int val = 35;
if (Namen)
{
setColumnWidth(1, 100);
setColumnWidth(3, 100);
}
else
{
setColumnWidth(1, 35);
setColumnWidth(3, 35);
}
val = 100;
setColumnWidth(1, val);
setColumnWidth(3, val);
hide();
show();
}
678,10 → 673,10
 
void SeitenPal::HandleDS()
{
float tpr = Vie->Doc->PageM.Top;
float lr = Vie->Doc->PageM.Left;
float rr = Vie->Doc->PageM.Right;
float br = Vie->Doc->PageM.Bottom;
double tpr = Vie->Doc->PageM.Top;
double lr = Vie->Doc->PageM.Left;
double rr = Vie->Doc->PageM.Right;
double br = Vie->Doc->PageM.Bottom;
bool fp = DS->isChecked();
Vie->Doc->resetPage(tpr, lr, rr, br, fp);
Vie->reformPages();
697,10 → 692,10
 
void SeitenPal::HandleLP()
{
float tpr = Vie->Doc->PageM.Top;
float lr = Vie->Doc->PageM.Left;
float rr = Vie->Doc->PageM.Right;
float br = Vie->Doc->PageM.Bottom;
double tpr = Vie->Doc->PageM.Top;
double lr = Vie->Doc->PageM.Left;
double rr = Vie->Doc->PageM.Right;
double br = Vie->Doc->PageM.Bottom;
bool fp2 = Vie->Doc->PageFP;
if (fp2)
Vie->Doc->FirstPageLeft = LP->isChecked();
768,16 → 763,11
PageView->setNumCols(4);
PageView->setColumnWidth(0, 5);
PageView->setColumnWidth(2, 5);
int val = 35;
if (PageView->Namen)
{
PageView->setColumnWidth(1, 100);
PageView->setColumnWidth(3, 100);
}
else
{
PageView->setColumnWidth(1, 35);
PageView->setColumnWidth(3, 35);
}
val = 100;
PageView->setColumnWidth(1, val);
PageView->setColumnWidth(3, val);
cc = 1;
if (Vie->Doc->FirstPageLeft)
{
/trunk/Scribus/scribus/guidemanager.cpp
1,7 → 1,7
#include "guidemanager.h"
#include "guidemanager.moc"
extern QPixmap loadIcon(QString nam);
extern float UmReFaktor;
extern double UmReFaktor;
GuideManager::GuideManager( QWidget* parent, Page* page, int Einh)
: QDialog( parent, "GuideManager", true, 0 )
/trunk/Scribus/scribus/scpainter.cpp
292,15 → 292,15
m_stroke = c;
}
 
void ScPainter::setPen( const QColor &c, float w, Qt::PenStyle st, Qt::PenCapStyle ca, Qt::PenJoinStyle jo )
void ScPainter::setPen( const QColor &c, double w, Qt::PenStyle st, Qt::PenCapStyle ca, Qt::PenJoinStyle jo )
{
m_stroke = c;
LineWidth = w;
PLineEnd = ca;
PLineJoin = jo;
float Dt = QMAX(2*w, 1);
float Da = QMAX(6*w, 1);
QValueList<float> tmp;
double Dt = QMAX(2*w, 1);
double Da = QMAX(6*w, 1);
QValueList<double> tmp;
m_array.clear();
m_offset = 0;
switch (st)
333,18 → 333,18
}
}
 
void ScPainter::setLineWidth( float w )
void ScPainter::setLineWidth( double w )
{
LineWidth = w;
}
 
void ScPainter::setPenOpacity( float op )
void ScPainter::setPenOpacity( double op )
{
stroke_trans = op;
}
 
 
void ScPainter::setDash(const QValueList<float>& array, float ofs)
void ScPainter::setDash(const QValueList<double>& array, double ofs)
{
m_array = array;
m_offset = ofs;
355,12 → 355,12
m_fill = c;
}
 
void ScPainter::setBrushOpacity( float op )
void ScPainter::setBrushOpacity( double op )
{
fill_trans = op;
}
 
void ScPainter::setOpacity( float op )
void ScPainter::setOpacity( double op )
{
fill_trans = op;
stroke_trans = op;
394,13 → 394,13
{
// clamp to viewport
x0 = QMAX( x0, 0 );
x0 = QMIN( x0, int( m_width ) );
x0 = QMIN( x0, static_cast<int>( m_width ) );
y0 = QMAX( y0, 0 );
y0 = QMIN( y0, int ( m_height ) );
y0 = QMIN( y0, static_cast<int>( m_height ) );
x1 = QMAX( x1, 0 );
x1 = QMIN( x1, int( m_width ) );
x1 = QMIN( x1, static_cast<int>( m_width ) );
y1 = QMAX( y1, 0 );
y1 = QMIN( y1, int( m_height ) );
y1 = QMIN( y1, static_cast<int>( m_height ) );
}
 
void ScPainter::clampToViewport( const ArtSVP &svp, int &x0, int &y0, int &x1, int &y1 )
412,18 → 412,18
//m_bbox = KoRect( bbox.x0, bbox.y0, bbox.x1 - bbox.x0, bbox.y1 - bbox.y0 );
 
// clamp to viewport
x0 = int( bbox.x0 );
x0 = static_cast<int>( bbox.x0 );
x0 = QMAX( x0, 0 );
x0 = QMIN( x0, int( m_width ) );
y0 = int( bbox.y0 );
x0 = QMIN( x0, static_cast<int>( m_width ) );
y0 = static_cast<int>( bbox.y0 );
y0 = QMAX( y0, 0 );
y0 = QMIN( y0, int ( m_height ) );
x1 = int( bbox.x1 ) + 1;
y0 = QMIN( y0, static_cast<int>( m_height ) );
x1 = static_cast<int>( bbox.x1 ) + 1;
x1 = QMAX( x1, 0 );
x1 = QMIN( x1, int( m_width ) );
y1 = int( bbox.y1 ) + 1;
x1 = QMIN( x1, static_cast<int>( m_width ) );
y1 = static_cast<int>( bbox.y1 ) + 1;
y1 = QMAX( y1, 0 );
y1 = QMIN( y1, int( m_height ) );
y1 = QMIN( y1, static_cast<int>( m_height ) );
}
 
void ScPainter::drawVPath( ArtVpath *vec, int mode )
581,7 → 581,7
ArtRender *render = 0L;
 
VGradient gradient = fill ? fill_gradient : stroke_gradient;
float opa = fill ? fill_trans : stroke_trans;
double opa = fill ? fill_trans : stroke_trans;
 
if (gradient.type() == VGradient::linear)
{
623,8 → 623,8
 
if( x0 != x1 && y0 != y1 )
{
render = art_render_new( x0, y0, x1, y1, m_buffer + 4 * int(x0) + m_width * 4 * int(y0), m_width * 4, 3, 8, ART_ALPHA_PREMUL, 0 );
int opacity = int( opa * 255.0 );
render = art_render_new( x0, y0, x1, y1, m_buffer + 4 * static_cast<int>(x0) + m_width * 4 * static_cast<int>(y0), m_width * 4, 3, 8, ART_ALPHA_PREMUL, 0 );
int opacity = static_cast<int>( opa * 255.0 );
art_render_svp( render, svp );
art_render_mask_solid (render, (opacity << 8) + opacity + (opacity >> 7));
art_karbon_render_gradient_linear( render, linear, ART_FILTER_NEAREST );
679,7 → 679,7
if( x0 != x1 && y0 != y1 )
{
render = art_render_new( x0, y0, x1, y1, m_buffer + 4 * x0 + m_width * 4 * y0, m_width * 4, 3, 8, ART_ALPHA_PREMUL, 0 );
int opacity = int( opa * 255.0 );
int opacity = static_cast<int>( opa * 255.0 );
art_render_svp( render, svp );
art_render_mask_solid (render, (opacity << 8) + opacity + (opacity >> 7));
art_karbon_render_gradient_radial( render, radial, ART_FILTER_NEAREST );
720,7 → 720,7
if( x0 != x1 && y0 != y1 )
{
render = art_render_new( x0, y0, x1, y1, m_buffer + 4 * x0 + m_width * 4 * y0, m_width * 4, 3, 8, ART_ALPHA_PREMUL, 0 );
int opacity = int( opa * 255.0 );
int opacity = static_cast<int>( opa * 255.0 );
art_render_svp( render, svp );
art_render_mask_solid (render, (opacity << 8) + opacity + (opacity >> 7));
art_karbon_render_gradient_conical( render, conical, ART_FILTER_NEAREST );
751,7 → 751,7
int g = qGreen( qStopColor.rgb() );
int b = qBlue( qStopColor.rgb() );
art_u32 rgba = (r << 24) | (g << 16) | (b << 8) | qAlpha(qStopColor.rgb());
int a = int( colorStops[offset]->opacity * 255.0 );
int a = static_cast<int>( colorStops[offset]->opacity * 255.0 );
// int a = int( fill_trans * 255.0 );
r = (rgba >> 24) * a + 0x80;
r = (r + (r >> 8)) >> 8;
769,11 → 769,11
stopArray[ offset * 2 + 1 ].offset = ramp + ( colorStops[ offset + 1 ]->rampPoint - ramp ) * colorStops[ offset ]->midPoint;
 
QColor qStopColor2 = colorStops[ offset + 1 ]->color;
rgba = int(r + ((qRed(qStopColor2.rgb()) - r)) * 0.5) << 24 |
int(g + ((qGreen(qStopColor2.rgb()) - g)) * 0.5) << 16 |
int(b + ((qBlue(qStopColor2.rgb()) - b)) * 0.5) << 8 |
rgba = static_cast<int>(r + ((qRed(qStopColor2.rgb()) - r)) * 0.5) << 24 |
static_cast<int>(g + ((qGreen(qStopColor2.rgb()) - g)) * 0.5) << 16 |
static_cast<int>(b + ((qBlue(qStopColor2.rgb()) - b)) * 0.5) << 8 |
qAlpha(qStopColor2.rgb());
int a = int( colorStops[offset]->opacity * 255.0 );
int a = static_cast<int>( colorStops[offset]->opacity * 255.0 );
// int a = int( fill_trans * 255.0 );
r = (rgba >> 24) * a + 0x80;
r = (r + (r >> 8)) >> 8;
/trunk/Scribus/scribus/pageitem.cpp
29,12 → 29,12
#include "config.h"
#include <ft2build.h>
#include FT_GLYPH_H
extern float Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
extern double Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
extern QPointArray FlattenPath(FPointArray ina, QValueList<uint> &Segs);
extern float xy2Deg(float x, float y);
extern double xy2Deg(double x, double y);
extern void BezierPoints(QPointArray *ar, QPoint n1, QPoint n2, QPoint n3, QPoint n4);
 
PageItem::PageItem(Page *pa, int art, float x, float y, float w, float h, float w2, QString fill, QString outline, ScribusDoc *doc) : QObject(pa)
PageItem::PageItem(Page *pa, int art, double x, double y, double w, double h, double w2, QString fill, QString outline, ScribusDoc *doc) : QObject(pa)
{
QString tmp;
BackBox = 0;
80,7 → 80,7
FrameType = 0;
IFont = Doc->Dfont;
ISize = Doc->Dsize;
LineSp = (Doc->Dsize * static_cast<float>(Doc->AutoLine) / 100) + Doc->Dsize;
LineSp = (Doc->Dsize * static_cast<double>(Doc->AutoLine) / 100) + Doc->Dsize;
Doc->Vorlagen[0].LineSpa = LineSp;
CurX = 0;
CurY = 0;
209,8 → 209,8
uint a, nrc, nrc2, zae;
int desc, asce, absa, aSpa, chs;
uint BuPos, LastSP, BuPos2;
float oldCurY, LastXp, EndX, OFs, OFs2, wide, rota, wid;
float sc = Doc->Scale;
double oldCurY, LastXp, EndX, OFs, OFs2, wide, rota, wid;
double sc = Doc->Scale;
QString chx, chx2, chx3;
struct Pti *hl;
struct ZZ *Zli;
396,10 → 396,10
}
else
pd.drawImage(static_cast<int>(LocalX*LocalScX), static_cast<int>(LocalY*LocalScY), pixm);
pmd.setMask(bmd);
QImage ip2 = pmd.convertToImage();
p->drawImage(ip2);
}
pmd.setMask(bmd);
QImage ip2 = pmd.convertToImage();
p->drawImage(ip2);
pd.end();
}
break;
1038,7 → 1038,10
{
zae++;
if (zae == cl.size()-1)
goto PfadEnd;
{
MaxChars = Ptext.count();
break;
}
wid = sqrt(pow(cl.point(zae+1).x()-cl.point(zae).x(),2)+pow(cl.point(zae+1).y()-cl.point(zae).y(),2));
}
rota = xy2Deg(cl.point(zae+1).x()-cl.point(zae).x(),cl.point(zae+1).y()-cl.point(zae).y());
1079,7 → 1082,10
{
zae++;
if (zae == cl.size()-1)
goto PfadEnd;
{
MaxChars = Ptext.count();
break;
}
wid = sqrt(pow(cl.point(zae+1).x()-cl.point(zae).x(),2)+pow(cl.point(zae+1).y()-cl.point(zae).y(),2));
rota = xy2Deg(cl.point(zae+1).x()-cl.point(zae).x(),cl.point(zae+1).y()-cl.point(zae).y());
}
1090,8 → 1096,11
CurX = EndX + wid;
}
else
goto PfadEnd;
{
MaxChars = Ptext.count();
break;
}
}
p->save();
p->translate(cl.point(zae).x()*sc, cl.point(zae).y()*sc);
p->rotate(rota);
1132,8 → 1141,6
p->setZoomFactor(sc);
CurX += wide+hl->cextra;
}
PfadEnd: MaxChars = Ptext.count();
break;
default:
break;
}
1264,7 → 1271,7
pr.setBrush(red);
}
if (PType != 5)
{
{
pr.drawRect(-1, -1, 6, 6);
pr.drawRect(static_cast<int>(Width*Doc->Scale), static_cast<int>(Height*Doc->Scale), -6, -6);
pr.drawRect(static_cast<int>(Width*Doc->Scale), -1, -6, 6);
1328,7 → 1335,7
{
Doc->PageColors[farbe].getRGBColor().hsv(&h, &s, &v);
sneu = 255 - ((255 - v) * shad / 100);
tmp->setHsv(h, s, sneu);
tmp->setHsv(h, s, sneu);
}
else
{
1372,7 → 1379,7
ccx = " ";
if (ccx == QChar(13))
return;
float csi = static_cast<double>(hl->Siz) / 10.0;
double csi = static_cast<double>(hl->Siz) / 10.0;
uint chr = ccx[0].unicode();
if ((*Doc->AllFonts)[hl->ZFo]->CharWidth.contains(chr))
{
1410,13 → 1417,13
if (hl->Style & 16)
{
p->setPen(p->brush());
float st = (*Doc->AllFonts)[hl->ZFo]->strikeout_pos * hl->Siz;
double st = (*Doc->AllFonts)[hl->ZFo]->strikeout_pos * hl->Siz;
p->setLineWidth(QMAX((*Doc->AllFonts)[hl->ZFo]->strokeWidth * hl->Siz, 1));
p->drawLine(FPoint(hl->xco-hl->kern, hl->yco-st), FPoint(hl->xco+hl->wide, hl->yco-st));
}
if (hl->Style & 8)
{
float st = (*Doc->AllFonts)[hl->ZFo]->underline_pos * hl->Siz;
double st = (*Doc->AllFonts)[hl->ZFo]->underline_pos * hl->Siz;
QString dummy;
p->setPen(p->brush());
p->setLineWidth(QMAX((*Doc->AllFonts)[hl->ZFo]->strokeWidth * hl->Siz, 1));
/trunk/Scribus/scribus/fpoint.cpp
17,7 → 17,7
 
#include "fpoint.h"
 
FPoint::FPoint(float x, float y)
FPoint::FPoint(double x, double y)
{
xp = x;
yp = y;
29,22 → 29,22
yp = p.y();
}
 
float FPoint::x()
double FPoint::x()
{
return xp;
}
 
float FPoint::y()
double FPoint::y()
{
return yp;
}
 
void FPoint::setX(float x)
void FPoint::setX(double x)
{
xp = x;
}
 
void FPoint::setY(float y)
void FPoint::setY(double y)
{
yp = y;
}
/trunk/Scribus/scribus/hysettings.cpp
16,11 → 16,11
Verbose = new QCheckBox(this, "Verbose");
Verbose->setText(tr("Fully Automatic"));
Layout3->addMultiCellWidget(Verbose, 0, 0, 0, 1);
QToolTip::add( Verbose, tr( "If you uncheck this you will get an Dialog\neverytime a possible Hyphenation is found." ) );
QToolTip::add( Verbose, tr( "If you uncheck this you will get a dialog\neverytime a possible Hyphenation is found." ) );
Input = new QCheckBox(this, "inp");
Input->setText(tr("Check during Typing"));
Layout3->addMultiCellWidget(Input, 1, 1, 0, 1);
QToolTip::add(Input, tr("Enables automatic checking of your Text during Typing."));
QToolTip::add(Input, tr("Enables automatic checking of your text while typing."));
Language = new QComboBox( true, this, "Language" );
QMap<QString,QString>::Iterator it;
for (it = langs->begin(); it != langs->end(); ++it)
/trunk/Scribus/scribus/cpalette.cpp
20,7 → 20,7
#include "query.h"
extern QPixmap loadIcon(QString nam);
 
Cpalette::Cpalette(QWidget* parent) : QWidget(parent, "Cfloat")
Cpalette::Cpalette(QWidget* parent) : QWidget(parent, "Cdouble")
{
Color = "";
Color2 = "";
169,10 → 169,7
Inhalt->setOn(false);
GradCombo->show();
GradGroup->show();
if (GradCombo->currentItem() != 0)
GradientMode = true;
else
GradientMode = false;
GradientMode = GradCombo->currentItem() != 0 ? true : false;
updateCList();
updateGeometry();
repaint();
185,7 → 182,7
Farbliste.clear();
Farbliste = farben;
updateCList();
}
}
 
void Cpalette::updateCList()
{
227,7 → 224,7
}
break;
}
}
}
 
void Cpalette::updateBoxS(QString Farbe)
{
327,7 → 324,7
setFocus();
}
 
void Cpalette::setActTrans(float val, float val2)
void Cpalette::setActTrans(double val, double val2)
{
disconnect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(slotTrans(int)));
if (Mode == 1)
340,9 → 337,9
void Cpalette::slotTrans(int val)
{
if (Mode == 1)
emit NewTransS(static_cast<float>(100 - val) / 100.0);
emit NewTransS(static_cast<double>(100 - val) / 100.0);
else
emit NewTrans(static_cast<float>(100 - val) / 100.0);
emit NewTrans(static_cast<double>(100 - val) / 100.0);
setFocus();
}
 
/trunk/Scribus/scribus/frameedit.h
69,7 → 69,7
 
public slots:
void MoveN();
void SetXY(float x, float y);
void SetXY(double x, double y);
void HaveNode(bool have, bool mov);
void IsOpen();
void PolyStatus(int typ, uint size);
/trunk/Scribus/scribus/scribusdoc.h
48,14 → 48,14
 
/* Struktur fuer Pageitem Text */
struct Pti { QString ch;
float xp;
float yp;
double xp;
double yp;
int csize;
QString cfont;
QString ccolor;
QString cstroke;
bool cselect;
float cextra;
double cextra;
int cshade;
int cshade2;
int cstyle;
63,18 → 63,18
int PtransX;
int PtransY;
int cscale;
float PRot;
double PRot;
};
 
struct CLBuf { int PType;
float Xpos;
float Ypos;
float Width;
float Height;
float RadRect;
double Xpos;
double Ypos;
double Width;
double Height;
double RadRect;
int FrameType;
bool ClipEdited;
float Pwidth;
double Pwidth;
QString Pcolor;
QString Pcolor2;
int Shade;
90,21 → 90,21
int ShTxtFill;
int TxtScale;
int TxTStyle;
float Rot;
double Rot;
int PLineArt;
int PLineJoin;
int PLineEnd;
float LineSp;
float ExtraV;
float LocalScX;
float LocalScY;
float LocalX;
float LocalY;
double LineSp;
double ExtraV;
double LocalScX;
double LocalScY;
double LocalX;
double LocalY;
bool PicArt;
int flippedH;
int flippedV;
float BBoxX;
float BBoxH;
double BBoxX;
double BBoxH;
bool isPrintable;
bool isBookmark;
int BMnr;
143,10 → 143,10
bool AnUseIcons;
int AnIPlace;
int AnScaleW;
float Extra;
float TExtra;
float BExtra;
float RExtra;
double Extra;
double TExtra;
double BExtra;
double RExtra;
QString Pfile;
QString Pfile2;
QString Pfile3;
158,7 → 158,7
QPointArray Clip;
FPointArray PoLine;
bool PoShow;
float BaseOffs;
double BaseOffs;
bool Textflow;
bool Textflow2;
int Ausrich;
169,8 → 169,8
bool ScaleType;
bool AspectRatio;
bool Locked;
float Transparency;
float TranspStroke;
double Transparency;
double TranspStroke;
bool Reverse;
bool InvPict;
QString NamedLStyle;
178,19 → 178,19
};
 
/** Seitenraender */
struct Margs { float Top;
float Left;
float Right;
float Bottom;
struct Margs { double Top;
double Left;
double Right;
double Bottom;
};
 
struct StVorL { QString Vname;
float LineSpa;
double LineSpa;
int Ausri;
float Indent;
float First;
float Avor;
float Anach;
double Indent;
double First;
double Avor;
double Anach;
QString Font;
int FontSize;
};
214,15 → 214,15
PageItem* Item;
uint PageNr;
uint ItemNr;
float Xpos;
float Ypos;
float Width;
float Height;
float Rot;
float Gx;
float Gy;
float Gw;
float Gh;
double Xpos;
double Ypos;
double Width;
double Height;
double Rot;
double Gx;
double Gy;
double Gw;
double Gh;
int UnCode;
};
 
230,7 → 230,7
typedef QMap<QString,CMYKColor> CListe;
typedef QMap<QString,QString> ProfilesL;
 
struct singleLine { float Width;
struct singleLine { double Width;
int Dash;
int LineEnd;
int LineJoin;
253,7 → 253,7
int M;
int Di;
};
 
struct PDFOpt { bool Thumbnails;
bool Articles;
bool Compress;
278,21 → 278,21
QString PrintProf;
QString Info;
int Intent;
float BleedTop;
float BleedLeft;
float BleedRight;
float BleedBottom;
double BleedTop;
double BleedLeft;
double BleedRight;
double BleedBottom;
bool Encrypt;
QString PassOwner;
QString PassUser;
int Permissions;
};
 
struct Keys { QString Name;
int MenuID;
int KeyID;
};
 
struct preV { SCFonts AvailFonts;
QString DefFont;
int DefSize;
300,9 → 300,9
int Wheelval;
int AppFontSize;
int GrabRad;
float GuideRad;
float DminGrid;
float DmajGrid;
double GuideRad;
double DminGrid;
double DmajGrid;
QColor DminColor;
QColor DmajColor;
QColor DpapColor;
319,11 → 319,11
int Dshade;
int Dshade2;
int DLineArt;
float Dwidth;
double Dwidth;
QString DpenLine;
QString DpenText;
int DshadeLine;
float DwidthLine;
double DwidthLine;
int DLstyleLine;
int MagMin;
int MagMax;
330,8 → 330,8
int MagStep;
QString DbrushPict;
int ShadePict;
float ScaleX;
float ScaleY;
double ScaleX;
double ScaleY;
bool Before;
int Einheit;
bool Werkv;
376,20 → 376,20
QMap<int,Keys> KeyActions;
int PolyC;
int PolyFd;
float PolyF;
double PolyF;
bool PolyS;
float PolyR;
double PolyR;
QString PrinterName;
QString PrinterFile;
QString PrinterCommand;
int PageFormat;
int Ausrichtung;
float PageBreite;
float PageHoehe;
float RandOben;
float RandUnten;
float RandLinks;
float RandRechts;
double PageBreite;
double PageHoehe;
double RandOben;
double RandUnten;
double RandLinks;
double RandRechts;
bool DoppelSeiten;
bool ErsteLinks;
bool ScaleType;
404,7 → 404,7
bool PDFTransparency;
bool AutoSave;
int AutoSaveTime;
float DisScale;
double DisScale;
};
/**
* the Document Class
420,32 → 420,32
void setUnModified();
bool isModified() const;
/** Setzt die Seitenattribute */
void setPage(float b, float h, float t, float l, float r, float bo, float sp, float ab, bool atf, bool fp);
void resetPage(float t, float l, float r, float bo, bool fp);
void setPage(double b, double h, double t, double l, double r, double bo, double sp, double ab, bool atf, bool fp);
void resetPage(double t, double l, double r, double bo, bool fp);
void AddFont(QString name, QFont fo);
protected:
bool modified;
public: // Public attributes
/** Vergroesserungsfaktor fuer das Dokument */
float Scale;
double Scale;
bool Marks;
bool Guides;
bool SnapGuides;
float GuideRad;
double GuideRad;
bool GuideLock;
bool loading;
/** Breite der Seite */
float PageB;
double PageB;
/** Hoehe der Seite */
float PageH;
double PageH;
/** Anzahl der Seiten */
int PageC;
/** Seitenraender */
Margs PageM;
/** Anzahl der Spalten */
float PageSp;
double PageSp;
/** Abstand der Spalten */
float PageSpa;
double PageSpa;
/** Flag fuer AutoTextrahmen */
bool PageAT;
/** Flag fuer Doppelseiten */
471,7 → 471,7
int AppMode;
QString Dpen;
QString Dbrush;
float Dwidth;
double Dwidth;
int Dshade;
int Dshade2;
PenStyle DLineArt;
479,7 → 479,7
QString DpenText;
int DshadeLine;
PenStyle DLstyleLine;
float DwidthLine;
double DwidthLine;
QString Dfont;
QString DocName;
QMap<QString,QFont> UsedFonts;
490,8 → 490,8
QColor papColor;
QColor margColor;
QColor guideColor;
float minorGrid;
float majorGrid;
double minorGrid;
double majorGrid;
int CurrentSel;
int CurrentStyle;
int CurrentABStil;
524,8 → 524,8
int GrabRad;
QString DbrushPict;
int ShadePict;
float ScaleX;
float ScaleY;
double ScaleX;
double ScaleY;
bool ScaleType;
bool AspectRatio;
bool Before;
/trunk/Scribus/scribus/scribusview.cpp
29,7 → 29,7
#include <qcstring.h>
 
extern void Level2Layer(ScribusDoc *doc, struct Layer *ll, int Level);
extern float Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
extern double Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
 
ScribusView::ScribusView(QWidget *parent, ScribusDoc *doc, preV *prefs)
: QScrollView(parent, "s", WRepaintNoErase | WNorthWestGravity)
168,7 → 168,7
 
void ScribusView::Zval()
{
Doc->Scale = static_cast<float>(LE->value()) / 10000.0 * Prefs->DisScale;
Doc->Scale = static_cast<double>(LE->value()) / 10000.0 * Prefs->DisScale;
slotDoZoom();
setFocus();
}
177,7 → 177,7
Page* ScribusView::addPage(int nr)
{
int z;
float s = Doc->Scale;
double s = Doc->Scale;
QWidget* feh = new PageBack(viewport());
feh->resize(static_cast<int>((Doc->PageB+5)*s), static_cast<int>((Doc->PageH+5)*s));
Page* fe = new Page(feh, 0, 0, static_cast<int>(Doc->PageB*s), static_cast<int>(Doc->PageH*s), Doc, this);
194,8 → 194,8
if (Doc->PageSp > 1)
{
int a;
float bsp = (Doc->PageB-fe->Margins.Right-fe->Margins.Left-(Doc->PageSp-1)*Doc->PageSpa)/Doc->PageSp;
float anf = fe->Margins.Left;
double bsp = (Doc->PageB-fe->Margins.Right-fe->Margins.Left-(Doc->PageSp-1)*Doc->PageSpa)/Doc->PageSp;
double anf = fe->Margins.Left;
for (a = 0; a < Doc->PageSp; a++)
{
z = fe->PaintText(anf,
242,7 → 242,7
connect(fe, SIGNAL(ZoomAbs()), this, SLOT(slotDoZoom()));
connect(fe, SIGNAL(AbsPosi(int, int)), this, SLOT(SetCPo(int, int)));
connect(fe, SIGNAL(AbsPosi2(int, int)), this, SLOT(SetCCPo(int, int)));
return fe;
return fe;
}
 
/** Löscht eine Seite */
272,7 → 272,7
Buf.append(Pages.at(from));
Pages.remove(from);
if (a <= zz)
zz--;
zz--;
}
switch (art)
{
301,7 → 301,7
}
 
void ScribusView::reformPages()
{
{
uint a;
Page* Seite;
QWidget* PSeite = Doc->ActPage->parentWidget();
326,7 → 326,7
}
}
else
{
{
if (a % 2 == 0)
{
if (Doc->FirstPageLeft)
411,7 → 411,7
setRulerPos(contentsX(), contentsY());
PaMenu();
setMenTxt(Doc->ActPage->PageNr);
}
}
 
void ScribusView::setMenTxt(int Seite)
{
425,7 → 425,7
 
/** Fuehrt die Vergroesserung/Verkleinerung aus */
void ScribusView::slotDoZoom()
{
{
uint a;
Page* Seite;
QWidget* PSeite = Doc->ActPage->parentWidget();
499,13 → 499,13
void ScribusView::SetCCPo(int x, int y)
{
center(static_cast<int>(childX(Doc->ActPage->parentWidget())+x*Doc->Scale), static_cast<int>(childY(Doc->ActPage->parentWidget())+y*Doc->Scale));
setRulerPos(contentsX(), contentsY());
setRulerPos(contentsX(), contentsY());
}
 
void ScribusView::SetCPo(int x, int y)
{
setContentsPos(static_cast<int>(childX(Doc->ActPage->parentWidget())+x*Doc->Scale), static_cast<int>(childY(Doc->ActPage->parentWidget())+y*Doc->Scale));
setRulerPos(contentsX(), contentsY());
setRulerPos(contentsX(), contentsY());
}
 
void ScribusView::PaMenu()
580,9 → 580,9
/** Vergrößert die Ansicht */
void ScribusView::slotZoomIn2()
{
Doc->Scale += static_cast<float>(Doc->MagStep)/100;
if (Doc->Scale > static_cast<float>(Doc->MagMax)/100)
Doc->Scale = static_cast<float>(Doc->MagMax)/100;
Doc->Scale += static_cast<double>(Doc->MagStep)/100;
if (Doc->Scale > static_cast<double>(Doc->MagMax)/100)
Doc->Scale = static_cast<double>(Doc->MagMax)/100;
slotDoZoom();
}
 
589,14 → 589,14
/** Verkleinert die Ansicht */
void ScribusView::slotZoomOut2()
{
Doc->Scale -= static_cast<float>(Doc->MagStep)/100;
if (Doc->Scale < static_cast<float>(Doc->MagMin)/100)
Doc->Scale = static_cast<float>(Doc->MagMin)/100;
Doc->Scale -= static_cast<double>(Doc->MagStep)/100;
if (Doc->Scale < static_cast<double>(Doc->MagMin)/100)
Doc->Scale = static_cast<double>(Doc->MagMin)/100;
slotDoZoom();
}
 
void ScribusView::DrawNew()
{
{
uint a;
Page *b = Doc->ActPage;
if (Pages.count() != 0)
626,7 → 626,7
}
 
void ScribusView::RecalcPictures(ProfilesL *Pr, QProgressBar *dia)
{
{
uint a, i;
Page *b = Doc->ActPage;
PageItem* it;
713,7 → 713,7
{
QPixmap pm = QPixmap(static_cast<int>(Doc->PageB), static_cast<int>(Doc->PageH));
ScPainter *painter = new ScPainter(&pm, pm.width(), pm.height());
float sca = Doc->Scale;
double sca = Doc->Scale;
bool frs = Doc->ShFrames;
int Lnr;
struct Layer ll;
764,8 → 764,8
Doc->Scale = sca;
QImage im2;
QImage im = pm.convertToImage();
float sx = im.width() / static_cast<float>(maxGr);
float sy = im.height() / static_cast<float>(maxGr);
double sx = im.width() / static_cast<double>(maxGr);
double sy = im.height() / static_cast<double>(maxGr);
if (sy < sx)
im2 = im.smoothScale(static_cast<int>(im.width() / sx), static_cast<int>(im.height() / sx));
else
786,7 → 786,7
{
QPixmap pm = QPixmap(static_cast<int>(Doc->PageB), static_cast<int>(Doc->PageH));
ScPainter *painter = new ScPainter(&pm, pm.width(), pm.height());
float sca = Doc->Scale;
double sca = Doc->Scale;
bool frs = Doc->ShFrames;
int Lnr;
struct Layer ll;
869,8 → 869,8
Doc->Scale = sca;
QImage im2;
QImage im = pm.convertToImage();
float sx = im.width() / static_cast<float>(maxGr);
float sy = im.height() / static_cast<float>(maxGr);
double sx = im.width() / static_cast<double>(maxGr);
double sy = im.height() / static_cast<double>(maxGr);
if (sy < sx)
im2 = im.smoothScale(static_cast<int>(im.width() / sx), static_cast<int>(im.height() / sx));
else
891,7 → 891,7
{
uint a;
int sepac;
float wideR;
double wideR;
bool multiPath = false;
p->PS_set_Info("Author", Doc->DocAutor);
p->PS_set_Info("Title", Doc->DocTitel);
912,7 → 912,7
if ((it->PType == 2) && (it->PicAvail) && (it->Pfile != "") && (it->isPrintable))
p->PS_ImageData(it->InvPict, it->Pfile, it->AnName, it->IProfile, it->UseEmbedded, Ic);
}
}
}
p->PS_TemplateStart(MasterPages.at(ap)->PageNam, Doc->PageB, Doc->PageH);
ProcessPage(p, MasterPages.at(ap), ap+1, sep, farb, Ic);
p->PS_TemplateEnd();
1042,7 → 1042,7
p->PS_setcmykcolor_fill(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
}
p->PS_translate(ite->Xpos, Doc->PageH - ite->Ypos);
if (ite->Rot != 0)
if (ite->Rot != 0)
p->PS_rotate(-ite->Rot);
if ((ite->Pcolor != "None") || (ite->GrType != 0))
{
1211,8 → 1211,8
}
if (hl->cstyle & 16)
{
float Ulen = Cwidth(Doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0);
float Upos = (*Doc->AllFonts)[hl->cfont]->strikeout_pos * tsz;
double Ulen = Cwidth(Doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0);
double Upos = (*Doc->AllFonts)[hl->cfont]->strikeout_pos * tsz;
if (hl->ccolor != "None")
{
p->PS_setdash(SolidLine, FlatCap, MiterJoin);
1228,7 → 1228,7
{
int chs = hl->csize;
ite->SetZeichAttr(hl, &chs, &chx);
float wide = Cwidth(Doc, hl->cfont, chx, chs);
double wide = Cwidth(Doc, hl->cfont, chx, chs);
chx = "-";
uint chr = chx[0].unicode();
if ((*Doc->AllFonts)[hl->cfont]->CharWidth.contains(chr))
1257,8 → 1257,8
{
int chs = hl->csize;
ite->SetZeichAttr(hl, &chs, &chx);
float csi = chs / 10.0;
float wid = Cwidth(Doc, hl->cfont, chx, chs) * (hl->cscale / 100.0);
double csi = chs / 10.0;
double wid = Cwidth(Doc, hl->cfont, chx, chs) * (hl->cscale / 100.0);
QPixmap pgPix(static_cast<int>(wid), hl->csize);
ScPainter *painter = new ScPainter(&pgPix, static_cast<int>(wid), hl->csize);
QString psSt = "1 -1 scale\n";
1266,7 → 1266,7
if ((*Doc->AllFonts)[hl->cfont]->CharWidth.contains(chr))
{
FPointArray gly = (*Doc->AllFonts)[hl->cfont]->GlyphArray[chr].Outlines.copy();
float st = (*Doc->AllFonts)[hl->cfont]->underline_pos * chs;
double st = (*Doc->AllFonts)[hl->cfont]->underline_pos * chs;
painter->setLineWidth(QMAX((*Doc->AllFonts)[hl->cfont]->strokeWidth * chs, 1));
if (gly.size() < 4)
{
1368,7 → 1368,7
{
uint b, d;
int h, s, v, k, tsz;
float wideR;
double wideR;
QCString chxc;
QString chx, chglyph, tmp;
PageItem *c;
1490,7 → 1490,7
p->PS_stroke();
}
}
}
}
break;
case 4:
if (c->isBookmark)
1707,8 → 1707,8
{
int chs = hl->csize;
c->SetZeichAttr(hl, &chs, &chx);
float csi = chs / 10.0;
float wid = Cwidth(Doc, hl->cfont, chx, chs) * (hl->cscale / 100.0);
double csi = chs / 10.0;
double wid = Cwidth(Doc, hl->cfont, chx, chs) * (hl->cscale / 100.0);
QPixmap pgPix(hl->csize, static_cast<int>(wid));
ScPainter *painter = new ScPainter(&pgPix, hl->csize, static_cast<int>(wid));
QString psSt = "1 -1 scale\n";
1716,7 → 1716,7
if ((*Doc->AllFonts)[hl->cfont]->CharWidth.contains(chr))
{
FPointArray gly = (*Doc->AllFonts)[hl->cfont]->GlyphArray[chr].Outlines.copy();
float st = (*Doc->AllFonts)[hl->cfont]->underline_pos * chs;
double st = (*Doc->AllFonts)[hl->cfont]->underline_pos * chs;
painter->setLineWidth(QMAX((*Doc->AllFonts)[hl->cfont]->strokeWidth * chs, 1));
if (gly.size() < 4)
{
1757,8 → 1757,8
}
if (hl->cstyle & 16)
{
float Ulen = Cwidth(Doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0);
float Upos = (*Doc->AllFonts)[hl->cfont]->strikeout_pos * tsz;
double Ulen = Cwidth(Doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0);
double Upos = (*Doc->AllFonts)[hl->cfont]->strikeout_pos * tsz;
if (hl->ccolor != "None")
{
p->PS_setdash(SolidLine, FlatCap, MiterJoin);
1774,7 → 1774,7
{
int chs = hl->csize;
c->SetZeichAttr(hl, &chs, &chx);
float wide = Cwidth(Doc, hl->cfont, chx, chs);
double wide = Cwidth(Doc, hl->cfont, chx, chs);
chx = "-";
uint chr = chx[0].unicode();
if ((*Doc->AllFonts)[hl->cfont]->CharWidth.contains(chr))
/trunk/Scribus/scribus/druck.cpp
523,59 → 523,31
 
void Druck::SelPrinter(const QString& prn)
{
if (prn == tr("File"))
{
DateiT->setEnabled(true);
LineEdit1->setEnabled(true);
ToolButton1->setEnabled(true);
ToFile = true;
bool setter = prn == tr("File") ? true : false;
DateiT->setEnabled(setter);
LineEdit1->setEnabled(setter);
ToolButton1->setEnabled(setter);
ToFile = setter;
#ifdef HAVE_CUPS
OptButton->setEnabled(false);
OptButton->setEnabled(setter);
#endif
}
else
{
DateiT->setEnabled(false);
LineEdit1->setEnabled(false);
ToolButton1->setEnabled(false);
ToFile = false;
#ifdef HAVE_CUPS
OptButton->setEnabled(true);
#endif
}
Geraet = prn;
}
 
void Druck::SelRange(bool e)
{
if (e)
{
TextLabel2_2->setEnabled( false );
TextLabel2->setEnabled( false );
To->setEnabled( false );
From->setEnabled( false );
}
else
{
TextLabel2_2->setEnabled( true );
TextLabel2->setEnabled( true );
To->setEnabled( true );
From->setEnabled( true );
}
bool setter = e ? false : true;
TextLabel2_2->setEnabled( setter );
TextLabel2->setEnabled( setter );
To->setEnabled( setter );
From->setEnabled( setter );
}
 
void Druck::SelMode(bool e)
{
if (e)
{
SepArt->setEnabled( false );
ToSeparation = false;
}
else
{
SepArt->setEnabled( true );
ToSeparation = true;
}
bool setter = e ? false : true;
SepArt->setEnabled( setter );
ToSeparation = setter;
}
 
void Druck::SelFile()
633,10 → 605,7
 
int Druck::pageOrder()
{
if (FirstPfirst->isChecked())
return 0;
else
return 1;
return FirstPfirst->isChecked() ? 0 : 1;
}
 
bool Druck::outputSeparations()
/trunk/Scribus/scribus/werktoolb.cpp
21,9 → 21,9
 
extern int PolyC;
extern int PolyFd;
extern float PolyF;
extern double PolyF;
extern bool PolyS;
extern float PolyR;
extern double PolyR;
extern QPixmap loadIcon(QString nam);
 
WerkToolB::WerkToolB(QMainWindow* parent) : QToolBar(tr("Tools"), parent)
39,7 → 39,7
Textedit->setEnabled( FALSE );
Zoom = new QToolButton(loadIcon("Lupe.xpm"),tr("Zooms in or out"), QString::null, this, SLOT(ModeFromTB()), this);
Zoom->setToggleButton( true );
Texte = new QToolButton(loadIcon("Text.xpm"),tr("Insert Textbox"), QString::null, this, SLOT(ModeFromTB()), this);
Texte = new QToolButton(loadIcon("Text.xpm"),tr("Insert Text Frame"), QString::null, this, SLOT(ModeFromTB()), this);
Texte->setToggleButton( true );
BildB = new QToolButton(loadIcon("Bild.xpm"),tr("Insert Picture"), QString::null, this, SLOT(ModeFromTB()), this);
BildB->setToggleButton( true );
57,10 → 57,10
Linien->setToggleButton( true );
PolyLin = new QToolButton(loadIcon("beziertool.png"),tr("Insert Bezier Curves"), QString::null, this, SLOT(ModeFromTB()), this);
PolyLin->setToggleButton( true );
KetteEin = new QToolButton(loadIcon("Lock.xpm"),tr("Create Textchains"), QString::null, this, SLOT(ModeFromTB()), this);
KetteEin = new QToolButton(loadIcon("Lock.xpm"),tr("Create Text Chains"), QString::null, this, SLOT(ModeFromTB()), this);
KetteEin->setToggleButton( true );
KetteEin->setEnabled(false);
KetteAus = new QToolButton(loadIcon("Unlock.xpm"),tr("Break Textchains"), QString::null, this, SLOT(ModeFromTB()), this);
KetteAus = new QToolButton(loadIcon("Unlock.xpm"),tr("Break Text Chains"), QString::null, this, SLOT(ModeFromTB()), this);
KetteAus->setToggleButton( true );
KetteAus->setEnabled(false);
setCloseMode(QDockWindow::Undocked);
/trunk/Scribus/scribus/libpostscript/pslib.h
31,26 → 31,26
class PSLib {
public:
PSLib(bool psart, SCFonts &AllFonts, QMap<QString,QFont> DocFonts, CListe DocColors, bool pdf = false);
virtual ~PSLib();
virtual ~PSLib() {};
virtual bool PS_set_file(QString fn);
virtual void PS_set_Info(QString art, QString was);
virtual void PS_begin_doc(int Ori, float breite, float hoehe, int numpage);
virtual void PS_begin_page(float breite, float hoehe, struct Margs* Ma);
virtual void PS_begin_doc(int Ori, double breite, double hoehe, int numpage);
virtual void PS_begin_page(double breite, double hoehe, struct Margs* Ma);
virtual void PS_end_page();
virtual void PS_curve(float x1, float y1, float x2, float y2, float x3, float y3);
virtual void PS_moveto(float x, float y);
virtual void PS_lineto(float x, float y);
virtual void PS_curve(double x1, double y1, double x2, double y2, double x3, double y3);
virtual void PS_moveto(double x, double y);
virtual void PS_lineto(double x, double y);
virtual void PS_closepath();
virtual void PS_translate(float x, float y);
virtual void PS_scale(float x, float y);
virtual void PS_rotate(float x);
virtual void PS_translate(double x, double y);
virtual void PS_scale(double x, double y);
virtual void PS_rotate(double x);
virtual void PS_clip(bool mu);
virtual void PS_save();
virtual void PS_restore();
virtual void PS_setcmykcolor_fill(float c, float m, float y, float k);
virtual void PS_setcmykcolor_fill(double c, double m, double y, double k);
virtual void PS_setcmykcolor_dummy();
virtual void PS_setcmykcolor_stroke(float c, float m, float y, float k);
virtual void PS_setlinewidth(float w);
virtual void PS_setcmykcolor_stroke(double c, double m, double y, double k);
virtual void PS_setlinewidth(double w);
virtual void PS_setdash(Qt::PenStyle st, Qt::PenCapStyle ca, Qt::PenJoinStyle jo);
virtual void PS_selectfont(QString f, int s);
virtual void PS_fill(bool mu);
57,21 → 57,21
virtual void PS_stroke();
virtual void PS_fill_stroke(bool mu);
virtual void PS_newpath();
virtual void PS_GradientCol1(float c, float m, float y, float k);
virtual void PS_GradientCol2(float c, float m, float y, float k);
virtual void PS_LinGradient(float w, float h, int item, int grad, bool mu);
virtual void PS_RadGradient(float w, float h, int item, bool mu);
virtual void PS_show(float x, float y);
virtual void PS_GradientCol1(double c, double m, double y, double k);
virtual void PS_GradientCol2(double c, double m, double y, double k);
virtual void PS_LinGradient(double w, double h, int item, int grad, bool mu);
virtual void PS_RadGradient(double w, double h, int item, bool mu);
virtual void PS_show(double x, double y);
virtual void PS_showSub(uint chr, QString font, int size, bool stroke);
virtual void PS_show_xyG(QString font, QString ch, float x, float y);
virtual void PS_image(bool inver, float x, float y, QString fn, float scalex, float scaley, QString Prof, bool UseEmbedded, bool UseProf, QString Name = "");
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_plate(int nr);
virtual void PS_setGray();
virtual void PDF_Bookmark(QString text, uint Seite);
virtual void PDF_Annotation(QString text, float x, float y, float b, float h);
virtual void PDF_Annotation(QString text, double x, double y, double b, double h);
virtual void PS_close();
virtual void PS_insert(QString i);
virtual void PS_TemplateStart(QString Name, float breite, float hoehe);
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);
78,7 → 78,7
private:
void PutSeite(QString c);
void PutDoc(QString c);
QString ToStr(float c);
QString ToStr(double c);
QString IToStr(int c);
QString PSEncode(QString in);
bool Art;
99,7 → 99,7
QString StrokeColor;
QString GrColor1;
QString GrColor2;
float LineW;
double LineW;
QString Fonts;
QString FontDesc;
QMap<QString, QString> UsedFonts;
/trunk/Scribus/scribus/libpostscript/pslib.cpp
58,14 → 58,7
Titel = "";
FillColor = "0.0 0.0 0.0 0.0";
StrokeColor = "0.0 0.0 0.0 0.0";
if (psart)
{
Header = "%!PS-Adobe-3.0\n";
}
else
{
Header = "%!PS-Adobe-3.0 EPSF-3.0\n";
}
Header = psart ? "%!PS-Adobe-3.0\n" : "%!PS-Adobe-3.0 EPSF-3.0\n";
BBox = "";
BBoxH = "";
Art = psart;
99,8 → 92,8
Farben += "%%+ ";
FNamen += "%%+ ";
}
Farben += ToStr(float(c) / 255) + " " + ToStr(float(m) / 255) + " ";
Farben += ToStr(float(y) / 255) + " " + ToStr(float(k) / 255) + " (" + itf.key() + ")\n";
Farben += ToStr(static_cast<double>(c) / 255) + " " + ToStr(static_cast<double>(m) / 255) + " ";
Farben += ToStr(static_cast<double>(y) / 255) + " " + ToStr(static_cast<double>(k) / 255) + " (" + itf.key() + ")\n";
FNamen += "(" + itf.key() + ")\n";
erst = false;
}
212,9 → 205,6
Prolog += " end\n";
Prolog += "%%EndProlog\n";
}
PSLib::~PSLib()
{
}
 
void PSLib::PutSeite(QString c)
{
228,7 → 218,7
t.writeRawBytes(c, c.length());
}
 
QString PSLib::ToStr(float c)
QString PSLib::ToStr(double c)
{
QString cc;
return cc.setNum(c);
256,7 → 246,7
return Spool.open(IO_WriteOnly);
}
 
void PSLib::PS_begin_doc(int Ori, float breite, float hoehe, int numpage)
void PSLib::PS_begin_doc(int Ori, double breite, double hoehe, int numpage)
{
PutDoc(Header);
PutDoc("%%For: " + User + "\n");
311,7 → 301,7
return tmp;
}
 
void PSLib::PS_TemplateStart(QString Name, float breite, float hoehe)
void PSLib::PS_TemplateStart(QString Name, double breite, double hoehe)
{
PutDoc("/"+PSEncode(Name)+"\n<<\n");
PutDoc("/FormType 1\n");
331,7 → 321,7
PutDoc(">> def\n");
}
 
void PSLib::PS_begin_page(float breite, float hoehe, struct Margs* Ma)
void PSLib::PS_begin_page(double breite, double hoehe, struct Margs* Ma)
{
PDev = ToStr(Ma->Left) + " " + ToStr(Ma->Bottom) + " m\n";
PDev += ToStr(breite - Ma->Right) + " " + ToStr(Ma->Bottom) + " li\n";
347,17 → 337,17
PutSeite("%%PageTrailer\nrestore\nsp\n");
}
 
void PSLib::PS_curve(float x1, float y1, float x2, float y2, float x3, float y3)
void PSLib::PS_curve(double x1, double y1, double x2, double y2, double x3, double y3)
{
PutSeite(ToStr(x1) + " " + ToStr(y1) + " " + ToStr(x2) + " " + ToStr(y2) + " " + ToStr(x3) + " " + ToStr(y3) + " curveto\n");
}
 
void PSLib::PS_moveto(float x, float y)
void PSLib::PS_moveto(double x, double y)
{
PutSeite(ToStr(x) + " " + ToStr(y) + " m\n");
}
 
void PSLib::PS_lineto(float x, float y)
void PSLib::PS_lineto(double x, double y)
{
PutSeite(ToStr(x) + " " + ToStr(y) + " li\n");
}
367,17 → 357,17
PutSeite("cl\n");
}
 
void PSLib::PS_translate(float x, float y)
void PSLib::PS_translate(double x, double y)
{
PutSeite(ToStr(x) + " " + ToStr(y) + " tr\n");
}
 
void PSLib::PS_scale(float x, float y)
void PSLib::PS_scale(double x, double y)
{
PutSeite(ToStr(x) + " " + ToStr(y) + " sc\n");
}
 
void PSLib::PS_rotate(float x)
void PSLib::PS_rotate(double x)
{
PutSeite(ToStr(x) + " ro\n");
}
384,10 → 374,7
 
void PSLib::PS_clip(bool mu)
{
if (mu)
PutSeite("eoclip newpath\n");
else
PutSeite("clip newpath\n");
PutSeite( mu ? "eoclip newpath\n" : "clip newpath\n" );
}
 
void PSLib::PS_save()
400,7 → 387,7
PutSeite("gr\n");
}
 
void PSLib::PS_setcmykcolor_fill(float c, float m, float y, float k)
void PSLib::PS_setcmykcolor_fill(double c, double m, double y, double k)
{
FillColor = ToStr(c) + " " + ToStr(m) + " " + ToStr(y) + " " + ToStr(k);
}
410,12 → 397,12
PutSeite("0 0 0 0 cmyk\n");
}
 
void PSLib::PS_setcmykcolor_stroke(float c, float m, float y, float k)
void PSLib::PS_setcmykcolor_stroke(double c, double m, double y, double k)
{
StrokeColor = ToStr(c) + " " + ToStr(m) + " " + ToStr(y) + " " + ToStr(k);
}
 
void PSLib::PS_setlinewidth(float w)
void PSLib::PS_setlinewidth(double w)
{
PutSeite(ToStr(w) + " sw\n");
LineW = w;
485,10 → 472,7
 
void PSLib::PS_fill(bool mu)
{
if (mu)
PutSeite(FillColor + " cmyk eofill\n");
else
PutSeite(FillColor + " cmyk fi\n");
PutSeite( mu ? FillColor + " cmyk eofill\n" : FillColor + " cmyk fi\n" );
}
 
void PSLib::PS_stroke()
509,30 → 493,24
PutSeite("newpath\n");
}
 
void PSLib::PS_GradientCol1(float c, float m, float y, float k)
void PSLib::PS_GradientCol1(double c, double m, double y, double k)
{
GrColor1 = ToStr(c) + " " + ToStr(m) + " " + ToStr(y) + " " + ToStr(k);
}
 
void PSLib::PS_GradientCol2(float c, float m, float y, float k)
void PSLib::PS_GradientCol2(double c, double m, double y, double k)
{
GrColor2 = ToStr(c) + " " + ToStr(m) + " " + ToStr(y) + " " + ToStr(k);
}
 
void PSLib::PS_LinGradient(float w, float h, int item, int grad, bool mu)
void PSLib::PS_LinGradient(double w, double h, int item, int grad, bool mu)
{
if (item == 1)
PutSeite("-"+ToStr(w / 2.0)+" "+ToStr(-h / 2.0)+" tr\n");
if (mu)
PutSeite("eoclip\n");
else
PutSeite("clip\n");
PutSeite( mu ? "eoclip\n" : "clip\n" );
PutSeite("<<\n");
PutSeite("/ShadingType 2\n");
if (DoSep)
PutSeite("/ColorSpace /DeviceGray\n");
else
PutSeite("/ColorSpace /DeviceCMYK\n");
PutSeite( DoSep ? "/ColorSpace /DeviceGray\n" : "/ColorSpace /DeviceCMYK\n" );
switch (grad)
{
case 1:
549,10 → 527,7
break;
}
PutSeite("/BBox [0 "+ToStr(h)+" "+ToStr(w)+" 0]\n");
if (DoSep)
PutSeite("/Background [0]\n");
else
PutSeite("/Background ["+FillColor+"]\n");
PutSeite(DoSep ? QString("/Background [0]\n") : QString("/Background ["+FillColor+"]\n"));
PutSeite("/Extend [false false]\n");
PutSeite("/Function\n");
PutSeite("<<\n");
565,8 → 540,8
pla = 3;
QStringList cols1 = QStringList::split(" ", GrColor2);
QStringList cols2 = QStringList::split(" ", GrColor1);
PutSeite("/C1 ["+ToStr(1-cols1[pla].toFloat())+"]\n");
PutSeite("/C0 ["+ToStr(1-cols2[pla].toFloat())+"]\n");
PutSeite("/C1 ["+ToStr(1-cols1[pla].toDouble())+"]\n");
PutSeite("/C0 ["+ToStr(1-cols2[pla].toDouble())+"]\n");
}
else
{
579,29 → 554,20
PutSeite("shfill\n");
}
 
void PSLib::PS_RadGradient(float w, float h, int item, bool mu)
void PSLib::PS_RadGradient(double w, double h, int item, bool mu)
{
float w2, h2, rad;
double w2, h2, rad;
w2 = w / 2.0;
h2 = h / 2.0;
rad = QMIN(w, fabs(h)) / 2.0;
PutSeite("/cmtx matrix currentmatrix def\n");
if (mu)
PutSeite("eoclip\n");
else
PutSeite("clip\n");
PutSeite( mu ? "eoclip\n" : "clip\n" );
PutSeite("<<\n");
PutSeite("/ShadingType 3\n");
if (DoSep)
PutSeite("/ColorSpace /DeviceGray\n");
else
PutSeite("/ColorSpace /DeviceCMYK\n");
PutSeite( DoSep ? "/ColorSpace /DeviceGray\n" : "/ColorSpace /DeviceCMYK\n" );
PutSeite("/Coords ["+ToStr(w2)+" "+ToStr(h2)+" 0 "+ToStr(w2)+" "+ToStr(h2)+" "+ToStr(rad)+"]\n");
PutSeite("/BBox [0 "+ToStr(h)+" "+ToStr(w)+" 0]\n");
if (DoSep)
PutSeite("/Background [0]\n");
else
PutSeite("/Background ["+FillColor+"]\n");
PutSeite( DoSep ? QString("/Background [0]\n") : "/Background ["+FillColor+"]\n" );
PutSeite("/Extend [true true]\n");
PutSeite("/Function\n");
PutSeite("<<\n");
614,8 → 580,8
pla = 3;
QStringList cols1 = QStringList::split(" ", GrColor2);
QStringList cols2 = QStringList::split(" ", GrColor1);
PutSeite("/C0 ["+ToStr(1-cols1[pla].toFloat())+"]\n");
PutSeite("/C1 ["+ToStr(1-cols2[pla].toFloat())+"]\n");
PutSeite("/C0 ["+ToStr(1-cols1[pla].toDouble())+"]\n");
PutSeite("/C1 ["+ToStr(1-cols2[pla].toDouble())+"]\n");
}
else
{
626,12 → 592,8
PutSeite(">>\n");
PutSeite(">>\n");
if (item == 1)
{
if (w > fabs(h))
PutSeite("-"+ToStr(w2*(w2 / rad))+" "+ToStr(fabs(h2))+" tr\n");
else
PutSeite("-"+ToStr(w2*(w2 / rad))+" "+ToStr(fabs(h2)*(fabs(h2) /rad))+" tr\n");
}
PutSeite( w > fabs(h) ? "-"+ToStr(w2*(w2 / rad))+" "+ToStr(fabs(h2))+" tr\n" :
"-"+ToStr(w2*(w2 / rad))+" "+ToStr(fabs(h2)*(fabs(h2) /rad))+" tr\n" );
else
{
if (w > fabs(h))
647,18 → 609,15
PutSeite("cmtx setmatrix\n");
}
 
void PSLib::PS_show_xyG(QString font, QString ch, float x, float y)
void PSLib::PS_show_xyG(QString font, QString ch, double x, double y)
{
QString Name;
uint cc = ch[0].unicode();
if (GlyphsOfFont[font].contains(cc))
Name = GlyphsOfFont[font][cc];
else
Name = ".notdef";
Name = GlyphsOfFont[font].contains(cc) ? GlyphsOfFont[font][cc] : QString(".notdef");
PutSeite("/"+Name+" "+ToStr(x)+" "+ToStr(y)+" "+StrokeColor+" shg\n");
}
 
void PSLib::PS_show(float x, float y)
void PSLib::PS_show(double x, double y)
{
PS_moveto(x, y);
PutSeite("/hyphen glyphshow\n");
667,10 → 626,7
void PSLib::PS_showSub(uint chr, QString font, int size, bool stroke)
{
PutSeite(FillColor + " cmyk (G"+IToStr(chr)+") "+font+" "+ToStr(size / 10.0)+" ");
if (stroke)
PutSeite("shgs\n");
else
PutSeite("shgf\n");
PutSeite(stroke ? "shgs\n" : "shgf\n");
}
 
void PSLib::PS_ImageData(bool inver, QString fn, QString Name, QString Prof, bool UseEmbedded, bool UseProf)
752,7 → 708,7
}
}
 
void PSLib::PS_image(bool inver, float x, float y, QString fn, float scalex, float scaley, QString Prof, bool UseEmbedded, bool UseProf, QString Name)
void PSLib::PS_image(bool inver, double x, double y, QString fn, double scalex, double scaley, QString Prof, bool UseEmbedded, bool UseProf, QString Name)
{
QString tmp;
QFileInfo fi = QFileInfo(fn);
761,25 → 717,21
{
if (loadText(fn, &tmp))
{
if (Name != "")
{
PutSeite("bEPS\n");
PutSeite("bEPS\n");
PutSeite(ToStr(scalex) + " " + ToStr(scaley) + " sc\n");
PutSeite(ToStr(x) + " " + ToStr(y) + " tr\n");
PutSeite(PSEncode(Name)+"Bild cvx exec\n");
PutSeite(PSEncode(Name)+"Bild resetfile\n");
PutSeite("eEPS\n");
}
else
{
PutSeite("bEPS\n");
PutSeite(ToStr(scalex) + " " + ToStr(scaley) + " sc\n");
PutSeite(ToStr(x) + " " + ToStr(y) + " tr\n");
PutSeite("%%BeginDocument: " + fi.fileName() + "\n");
PutSeite(tmp+"\n");
PutSeite("%%EndDocument\n");
PutSeite("eEPS\n");
}
if (Name != "")
{
PutSeite(PSEncode(Name)+"Bild cvx exec\n");
PutSeite(PSEncode(Name)+"Bild resetfile\n");
}
else
{
PutSeite("%%BeginDocument: " + fi.fileName() + "\n");
PutSeite(tmp+"\n");
PutSeite("%%EndDocument\n");
}
PutSeite("eEPS\n");
}
}
else
815,10 → 767,7
int h = image.height();
PutSeite(ToStr(x*scalex) + " " + ToStr(y*scaley) + " tr\n");
PutSeite(ToStr(scalex*w) + " " + ToStr(scaley*h) + " sc\n");
if ((!DoSep) && (!GraySc))
PutSeite("/DeviceCMYK setcolorspace\n");
else
PutSeite("/DeviceGray setcolorspace\n");
PutSeite(((!DoSep) && (!GraySc)) ? "/DeviceCMYK setcolorspace\n" : "/DeviceGray setcolorspace\n");
if (image.hasAlphaBuffer())
{
QImage iMask = image.createAlphaMask();
828,12 → 777,7
if (DoSep)
ImgStr = ImageToCMYK_PS(&image2, Plate, cmy);
else
{
if (GraySc)
ImgStr = ImageToCMYK_PS(&image2, -2, cmy);
else
ImgStr = ImageToCMYK_PS(&image2, -1, cmy);
}
ImgStr = GraySc ? ImageToCMYK_PS(&image2, -2, cmy) : ImageToCMYK_PS(&image2, -1, cmy);
}
else
{
840,23 → 784,13
if (DoSep)
ImgStr = ImageToCMYK_PS(&image, Plate, false);
else
{
if (GraySc)
ImgStr = ImageToCMYK_PS(&image, -2, false);
else
ImgStr = ImageToCMYK_PS(&image, -1, false);
}
ImgStr = GraySc ? ImageToCMYK_PS(&image, -2, false) : ImageToCMYK_PS(&image, -1, false);
}
#else
if (DoSep)
ImgStr = ImageToCMYK_PS(&image, Plate, false);
else
{
if (GraySc)
ImgStr = ImageToCMYK_PS(&image, -2, false);
else
ImgStr = ImageToCMYK_PS(&image, -1, false);
}
ImgStr = GraySc ? ImageToCMYK_PS(&image, -2, false) : ImageToCMYK_PS(&image, -1, false);
#endif
if (Name == "")
{
903,12 → 837,7
if (DoSep)
PutSeite(" /Decode [1 0]\n");
else
{
if (GraySc)
PutSeite(" /Decode [1 0]\n");
else
PutSeite(" /Decode [0 1 0 1 0 1 0 1]\n");
}
PutSeite( GraySc ? " /Decode [1 0]\n" : " /Decode [0 1 0 1 0 1 0 1]\n" );
PutSeite(" /BitsPerComponent 8\n");
PutSeite(" /DataSource "+PSEncode(Name)+"Bild\n");
PutSeite(" >>\n");
915,7 → 844,7
PutSeite(" image\n");
PutSeite(" }\n");
PutSeite(">> matrix makepattern setpattern\n");
PutSeite("<< /ImageType 1\n");
PutSeite("<< /ImageType 1\n");
PutSeite(" /Width " + IToStr(w) + "\n");
PutSeite(" /Height " + IToStr(h) + "\n");
PutSeite(" /BitsPerComponent 1\n");
932,7 → 861,7
}
else
{
PutSeite("<< /ImageType 1\n");
PutSeite("<< /ImageType 1\n");
PutSeite(" /Width " + IToStr(w) + "\n");
PutSeite(" /Height " + IToStr(h) + "\n");
PutSeite(" /BitsPerComponent 8\n");
939,12 → 868,7
if (DoSep)
PutSeite(" /Decode [1 0]\n");
else
{
if (GraySc)
PutSeite(" /Decode [1 0]\n");
else
PutSeite(" /Decode [0 1 0 1 0 1 0 1]\n");
}
PutSeite( GraySc ? " /Decode [1 0]\n" : " /Decode [0 1 0 1 0 1 0 1]\n");
PutSeite(" /ImageMatrix [" + IToStr(w) + " 0 0 " + IToStr(-h) + " 0 " + IToStr(h) + "]\n");
if (Name != "")
{
953,11 → 877,8
PutSeite(PSEncode(Name)+"Bild resetfile\n");
}
else
{
if (CompAvail)
PutSeite(" /DataSource currentfile /ASCIIHexDecode filter /FlateDecode filter >>\n");
else
PutSeite(" /DataSource currentfile /ASCIIHexDecode filter >>\n");
PutSeite ( CompAvail ? " /DataSource currentfile /ASCIIHexDecode filter /FlateDecode filter >>\n" :
" /DataSource currentfile /ASCIIHexDecode filter >>\n");
PutSeite("image\n");
#ifdef HAVE_CMS
if ((CMSuse) && (UseProf))
965,12 → 886,7
if (DoSep)
ImgStr = ImageToCMYK_PS(&image2, Plate, cmy);
else
{
if (GraySc)
ImgStr = ImageToCMYK_PS(&image2, -2, cmy);
else
ImgStr = ImageToCMYK_PS(&image2, -1, cmy);
}
ImgStr = GraySc ? ImageToCMYK_PS(&image2, -2, cmy) : ImageToCMYK_PS(&image2, -1, cmy);
}
else
{
977,23 → 893,13
if (DoSep)
ImgStr = ImageToCMYK_PS(&image, Plate, false);
else
{
if (GraySc)
ImgStr = ImageToCMYK_PS(&image, -2, false);
else
ImgStr = ImageToCMYK_PS(&image, -1, false);
}
ImgStr = GraySc ? ImageToCMYK_PS(&image, -2, false) : ImageToCMYK_PS(&image, -1, false);
}
#else
if (DoSep)
ImgStr = ImageToCMYK_PS(&image, Plate, false);
else
{
if (GraySc)
ImgStr = ImageToCMYK_PS(&image, -2, false);
else
ImgStr = ImageToCMYK_PS(&image, -1, false);
}
ImgStr = GraySc ? ImageToCMYK_PS(&image, -2, false) : ImageToCMYK_PS(&image, -1, false);
#endif
if (CompAvail)
ImgStr = CompressStr(&ImgStr);
1002,9 → 908,9
PutSeite("\n>\n");
}
}
}
}
 
 
void PSLib::PS_plate(int nr)
{
switch (nr)
1046,7 → 952,7
isPDF = true;
}
 
void PSLib::PDF_Annotation(QString text, float x, float y, float b, float h)
void PSLib::PDF_Annotation(QString text, double x, double y, double b, double h)
{
PutSeite("[ /Rect [ "+ToStr(static_cast<int>(x))+" "+ToStr(static_cast<int>(y))+" "+ToStr(static_cast<int>(b))+" "+ToStr(static_cast<int>(h))+" ]\n");
PutSeite(" /Contents ("+text+")\n /Open false\n");
/trunk/Scribus/scribus/libabout/about.cpp
32,7 → 32,7
tabLayout1->addWidget( PixmapLabel1 );
BuildID = new QLabel( tab, "BB" );
BuildID->setAlignment(Qt::AlignCenter);
QString bu = "15. October 2003 ";
QString bu = "16. October 2003 ";
#ifdef HAVE_CMS
bu += "C";
#else
/trunk/Scribus/scribus/fontcombo.cpp
24,10 → 24,6
setText(fontName);
}
 
FontListItem::~FontListItem()
{
}
 
int FontListItem::width(const QListBox *lb) const
{
return lb->fontMetrics().width(text()) + 2;
/trunk/Scribus/scribus/newfile.cpp
203,7 → 203,7
GroupBox3Layout = new QGridLayout( GroupBox3->layout() );
GroupBox3Layout->setAlignment( Qt::AlignTop );
TextLabel1_3 = new QLabel( GroupBox3, "TextLabel1_3" );
TextLabel1_3->setText( tr( "First Pagenumber:" ) );
TextLabel1_3->setText( tr( "First Page Number:" ) );
GroupBox3Layout->addMultiCellWidget( TextLabel1_3, 0, 0, 0, 1 );
PgNr = new QSpinBox( GroupBox3, "PgNr" );
PgNr->setMaxValue( 1000 );
223,7 → 223,7
Layout10->addWidget( GroupBox3 );
 
AutoFrame = new QCheckBox( this, "AutoFrame" );
AutoFrame->setText( tr( "Autom. Textframes" ) );
AutoFrame->setText( tr( "Autom. Text Frames" ) );
Layout10->addWidget( AutoFrame );
 
GroupBox4 = new QGroupBox( this, "GroupBox4" );
292,46 → 292,63
connect(Distance, SIGNAL(valueChanged(int)), this, SLOT(setDist(int)));
}
 
void NewDoc::code_repeat(int m)
{
switch (m)
{
case 0 :
case 3 :
RightR->setMaxValue(Breite->value() - LeftR->value());
if (m == 3)
break;
case 4 :
LeftR->setMaxValue(Breite->value() - RightR->value());
if (m == 4)
break;
case 2 :
TopR->setMaxValue(Hoehe->value() - BottomR->value());
if (m == 2)
break;
case 1 :
BottomR->setMaxValue(Hoehe->value() - TopR->value());
break;
}
}
void NewDoc::setBreite(int v)
{
Pagebr = v / Umrech / 100.0;
RightR->setMaxValue(Breite->value() - LeftR->value());
LeftR->setMaxValue(Breite->value() - RightR->value());
TopR->setMaxValue(Hoehe->value() - BottomR->value());
BottomR->setMaxValue(Hoehe->value() - TopR->value());
code_repeat(0);
}
 
void NewDoc::setHoehe(int v)
{
Pageho = v / Umrech / 100.0;
RightR->setMaxValue(Breite->value() - LeftR->value());
LeftR->setMaxValue(Breite->value() - RightR->value());
TopR->setMaxValue(Hoehe->value() - BottomR->value());
BottomR->setMaxValue(Hoehe->value() - TopR->value());
code_repeat(0);
}
 
void NewDoc::setTop(int v)
{
Top = v / Umrech / 100.0;
BottomR->setMaxValue(Hoehe->value() - TopR->value());
code_repeat(1);
}
 
void NewDoc::setBottom(int v)
{
Bottom = v / Umrech / 100.0;
TopR->setMaxValue(Hoehe->value() - BottomR->value());
code_repeat(2);
}
 
void NewDoc::setLeft(int v)
{
Left = v / Umrech / 100.0;
RightR->setMaxValue(Breite->value() - LeftR->value());
code_repeat(3);
}
 
void NewDoc::setRight(int v)
{
Right = v / Umrech / 100.0;
LeftR->setMaxValue(Breite->value() - RightR->value());
code_repeat(4);
}
 
void NewDoc::setDist(int v)
403,7 → 420,7
}
if (Orient == 1)
{
float br = Pagebr;
double br = Pagebr;
Pagebr = Pageho;
Pageho = br;
}
/trunk/Scribus/scribus/navigator.cpp
43,21 → 43,21
void Navigator::mouseMoveEvent(QMouseEvent *m)
{
drawMark(m->x(), m->y());
emit Coords(static_cast<float>(m->x())/static_cast<float>(pmx.width()),
static_cast<float>(m->y())/static_cast<float>(pmx.height()));
emit Coords(static_cast<double>(m->x())/static_cast<double>(pmx.width()),
static_cast<double>(m->y())/static_cast<double>(pmx.height()));
}
 
void Navigator::mousePressEvent(QMouseEvent *m)
{
drawMark(m->x(), m->y());
emit Coords(static_cast<float>(m->x())/static_cast<float>(pmx.width()),
static_cast<float>(m->y())/static_cast<float>(pmx.height()));
emit Coords(static_cast<double>(m->x())/static_cast<double>(pmx.width()),
static_cast<double>(m->y())/static_cast<double>(pmx.height()));
}
 
void Navigator::mouseReleaseEvent(QMouseEvent *m)
{
emit Coords(static_cast<float>(m->x())/static_cast<float>(pmx.width()),
static_cast<float>(m->y())/static_cast<float>(pmx.height()));
emit Coords(static_cast<double>(m->x())/static_cast<double>(pmx.width()),
static_cast<double>(m->y())/static_cast<double>(pmx.height()));
}
 
void Navigator::paintEvent(QPaintEvent *e)
/trunk/Scribus/scribus/scfonts_ttf.cpp
10,7 → 10,7
#include FT_FREETYPE_H
#include FT_OUTLINE_H
#include FT_GLYPH_H
extern FPointArray traceChar(FT_Face face, uint chr, int chs, float *x, float *y);
extern FPointArray traceChar(FT_Face face, uint chr, int chs, double *x, double *y);
 
QString Foi_ttf::RealName()
{
25,7 → 25,7
ItalicAngle = "0";
StdVW = "1";
FontBBox = "0 0 0 0";
IsFixedPitch = false;
IsFixedPitch = false;
if(metricsread)
return(true);
CharWidth.clear();
37,11 → 37,11
FT_UInt gindex;
FT_Face face;
FPointArray outlines;
float x, y;
double x, y;
struct GlyphR GRec;
error = FT_Init_FreeType( &library );
error = FT_New_Face( library, Datei, 0, &face );
uniEM = static_cast<float>(face->units_per_EM);
uniEM = static_cast<double>(face->units_per_EM);
HasKern = FT_HAS_KERNING(face);
Ascent = tmp.setNum(face->ascender * 1000 / uniEM);
Descender = tmp.setNum(face->descender * 1000 / uniEM);
/trunk/Scribus/scribus/hruler.cpp
54,8 → 54,8
void Hruler::paintEvent(QPaintEvent *)
{
int pc, xx;
float of, xl, iter, iter2;
float sc = doku->Scale;
double of, xl, iter, iter2;
double sc = doku->Scale;
switch (doku->Einheit)
{
case 0:
/trunk/Scribus/scribus/scribus.cpp
30,6 → 30,7
#include <cstdlib>
#include <dlfcn.h>
#include <iostream>
#include <string>
#include "scribus.h"
#include "scribus.moc"
#include "newfile.h"
89,10 → 90,10
ProfilesL InputProfiles;
int PolyC;
int PolyFd;
float PolyF;
double PolyF;
bool PolyS;
float PolyR;
float UmReFaktor;
double PolyR;
double UmReFaktor;
QString DocDir;
 
ScribusApp::ScribusApp(SplashScreen *splash)
108,26 → 109,26
DatClo = new QToolButton(loadIcon("DateiClos.xpm"), tr("Closes the Current Document"), QString::null, this, SLOT(slotFileClose()), WerkTools2);
DatPri = new QToolButton(loadIcon("DateiPrint.xpm"), tr("Prints the Current Document"), QString::null, this, SLOT(slotFilePrint()), WerkTools2);
DatPDF = new QToolButton(loadIcon("acrobat.png"), tr("Saves the Current Document as PDF"), QString::null, this, SLOT(SaveAsPDF()), WerkTools2);
DatSav->setEnabled(false);
DatSav->setEnabled(false);
DatClo->setEnabled(false);
DatPri->setEnabled(false);
DatPDF->setEnabled(false);
DatPDF->setEnabled(false);
DatOpe->setPopup(recentMenu);
WerkTools = new WerkToolB(this);
WerkTools = new WerkToolB(this);
setDockEnabled(WerkTools, DockLeft, false);
setDockEnabled(WerkTools, DockRight, false);
WerkTools->Sichtbar = true;
WerkTools->setEnabled(false);
WerkToolsP = new WerkToolBP(this);
setDockEnabled(WerkToolsP, DockLeft, false);
setDockEnabled(WerkToolsP, DockLeft, false);
setDockEnabled(WerkToolsP, DockRight, false);
WerkToolsP->setEnabled(false);
WerkToolsP->setEnabled(false);
WerkToolsP->Sichtbar = true;
QString Pff = QString(getenv("HOME"))+"/.scribus";
QString Pff = QString(getenv("HOME"))+"/.scribus";
QFileInfo Pffi = QFileInfo(Pff);
if (Pffi.exists())
{
if (Pffi.isDir())
if (Pffi.isDir())
PrefsPfad = Pff;
else
PrefsPfad = QString(getenv("HOME"));
350,7 → 351,7
{
ip = PrinterProfiles.begin();
Prefs.DCMSset.DefaultPrinterProfile = ip.key();
}
}
#ifdef HAVE_CMS
SoftProofing = Prefs.DCMSset.SoftProofOn;
CMSuse = false;
386,8 → 387,8
connect(Mpal->Cpal, SIGNAL(NewBrush(QString)), this, SLOT(setBrushFarbe(QString)));
connect(Mpal->Cpal, SIGNAL(NewPenShade(int)), this, SLOT(setPenShade(int)));
connect(Mpal->Cpal, SIGNAL(NewBrushShade(int)), this, SLOT(setBrushShade(int)));
connect(Mpal->Cpal, SIGNAL(NewTrans(float)), this, SLOT(SetTranspar(float)));
connect(Mpal->Cpal, SIGNAL(NewTransS(float)), this, SLOT(SetTransparS(float)));
connect(Mpal->Cpal, SIGNAL(NewTrans(double)), this, SLOT(SetTranspar(double)));
connect(Mpal->Cpal, SIGNAL(NewTransS(double)), this, SLOT(SetTransparS(double)));
connect(Mpal->Cpal, SIGNAL(NewGradient(int, QString, int, QString, int)), this, SLOT(setGradFill(int, QString, int, QString, int)));
connect(Mpal->Cpal, SIGNAL(QueryItem()), this, SLOT(GetBrushPen()));
connect(Tpal, SIGNAL(Schliessen()), this, SLOT(ToggleTpal()));
421,7 → 422,7
connect(this, SIGNAL(TextIFont(QString)), this, SLOT(AdjustFontMenu(QString)));
connect(this, SIGNAL(TextISize(int)), this, SLOT(setFSizeMenu(int)));
connect(this, SIGNAL(TextISize(int)), Mpal, SLOT(setSize(int)));
connect(this, SIGNAL(TextUSval(float)), Mpal, SLOT(setExtra(float)));
connect(this, SIGNAL(TextUSval(double)), Mpal, SLOT(setExtra(double)));
connect(this, SIGNAL(TextStil(int)), Mpal, SLOT(setStil(int)));
connect(this, SIGNAL(TextScale(int)), Mpal, SLOT(setTScale(int)));
connect(this, SIGNAL(TextFarben(QString, QString, int, int)), Mpal, SLOT(setActFarben(QString, QString, int, int)));
740,10 → 741,10
statusBar()->addWidget(YMess, 0, true);
YDat = new QLabel(statusBar(), "ydt");
statusBar()->addWidget(YDat, 1, true);
YDat->setText(" ");
YDat->setText(" ");
}
 
void ScribusApp::ReportMP(float xp, float yp)
void ScribusApp::ReportMP(double xp, double yp)
{
QString tmp, tmp2;
switch (doc->Einheit)
846,7 → 847,7
struct Pti *hg;
int kk = k->key();
int as = k->ascii();
float altx, alty;
double altx, alty;
QString uc = k->text();
QString cr, Tcha, Twort;
uint Tcoun;
998,7 → 999,7
b->NextBox->OwnPage->SelectItemNr(b->NextBox->ItemNr);
b = b->NextBox;
}
}
}
}
else
{
1339,12 → 1340,12
/////////////////////////////////////////////////////////////////////
// SLOT IMPLEMENTATION
/////////////////////////////////////////////////////////////////////
float ScribusApp::mm2pts(int mm)
double ScribusApp::mm2pts(int mm)
{
return mm / 25.4 * 72;
}
 
float ScribusApp::pts2mm(float pts)
double ScribusApp::pts2mm(double pts)
{
return pts / 72 * 25.4;
}
1351,7 → 1352,7
 
bool ScribusApp::slotFileNew()
{
float b, h, tpr, lr, rr, br, sp, ab;
double b, h, tpr, lr, rr, br, sp, ab;
bool fp, atf, ret;
NewDoc* dia = new NewDoc(this, &Prefs);
if (dia->exec())
1381,7 → 1382,7
return ret;
}
 
bool ScribusApp::doFileNew(float b, float h, float tpr, float lr, float rr, float br, float ab, float sp,
bool ScribusApp::doFileNew(double b, double h, double tpr, double lr, double rr, double br, double ab, double sp,
bool atf, bool fp, int einh, bool firstleft, int Ori, int SNr)
{
QString cc;
1501,7 → 1502,7
if (static_cast<int>(cmsGetColorSpace(doc->DocPrinterProf)) == icSigCmyData)
doc->CMSSettings.ComponentsPrinter = 3;
doc->PDF_Optionen.SComp = doc->CMSSettings.ComponentsInput2;
#endif
#endif
if (Prefs.DCMSset.CMSinUse)
RecalcColors();
}
1620,13 → 1621,13
 
bool ScribusApp::SetupDoc()
{
float tpr = doc->PageM.Top;
float lr = doc->PageM.Left;
float rr = doc->PageM.Right;
float br = doc->PageM.Bottom;
double tpr = doc->PageM.Top;
double lr = doc->PageM.Left;
double rr = doc->PageM.Right;
double br = doc->PageM.Bottom;
bool fp = doc->PageFP;
bool fpe = doc->FirstPageLeft;
float tpr2, lr2, rr2, br2;
double tpr2, lr2, rr2, br2;
bool ret = false;
ReformDoc* dia = new ReformDoc(this, tpr, lr, rr, br, doc->PageB, doc->PageH, fp, fpe, doc->Einheit);
if (dia->exec())
1684,7 → 1685,7
stdTransImg = ActWin->stdTransImg;
CMSoutputProf = doc->DocOutputProf;
CMSprinterProf = doc->DocPrinterProf;
#endif
#endif
Mpal->Cpal->SetColors(doc->PageColors);
Mpal->Cpal->ChooseGrad(0);
ActWin->setCaption(tr(doc->DocName));
1797,16 → 1798,11
menuBar()->setItemEnabled(exmn, 1);
WerkTools->setEnabled(true);
WerkToolsP->setEnabled(true);
int setter = 0;
if (view->Pages.count() > 1)
{
pageMenu->setItemEnabled(pgmd, 1);
pageMenu->setItemEnabled(pgmv, 1);
}
else
{
pageMenu->setItemEnabled(pgmd, 0);
pageMenu->setItemEnabled(pgmv, 0);
}
setter = 1;
pageMenu->setItemEnabled(pgmd, setter);
pageMenu->setItemEnabled(pgmv, setter);
editMenu->setItemEnabled(tman, 1);
editMenu->setItemEnabled(jman, 1);
CListe::Iterator it;
2208,7 → 2204,7
doc->ActPage->update();
return ret;
}
 
bool ScribusApp::LadeDoc(QString fileName)
{
bool ret = false;
2523,7 → 2519,7
 
void ScribusApp::slotAutoSave()
{
/* Disabled temporary because of some Problems
/* Disabled temporary because of some Problems, RaceCondition
if ((doc->hasName) && (doc->isModified()) && (!doc->TemplateMode))
{
system("mv -f " + doc->DocName + " " + doc->DocName+".bak");
3060,7 → 3056,7
if (doc->AppMode == 7)
editMenu->setItemEnabled(edid3, 1);
}
}
}
}
}
 
3271,20 → 3267,20
connect(doc->ActPage, SIGNAL(PaintingDone()), this, SLOT(slotSelect()));
connect(doc->ActPage, SIGNAL(HaveSel(int)), this, SLOT(HaveNewSel(int)));
connect(doc->ActPage, SIGNAL(DocChanged()), this, SLOT(slotDocCh()));
connect(doc->ActPage, SIGNAL(ClipPo(float, float)), Npal, SLOT(SetXY(float, float)));
connect(doc->ActPage, SIGNAL(ClipPo(double, double)), Npal, SLOT(SetXY(double, double)));
connect(doc->ActPage, SIGNAL(HavePoint(bool, bool)), Npal, SLOT(HaveNode(bool, bool)));
connect(doc->ActPage, SIGNAL(PolyOpen()), Npal, SLOT(IsOpen()));
connect(doc->ActPage, SIGNAL(PStatus(int, uint)), Npal, SLOT(PolyStatus(int, uint)));
connect(doc->ActPage, SIGNAL(MousePos(float, float)), this, SLOT(ReportMP(float, float)));
connect(doc->ActPage, SIGNAL(ItemPos(float, float)), Mpal, SLOT(setXY(float, float)));
connect(doc->ActPage, SIGNAL(ItemGeom(float, float)), Mpal, SLOT(setBH(float, float)));
connect(doc->ActPage, SIGNAL(SetAngle(float)), Mpal, SLOT(setR(float)));
connect(doc->ActPage, SIGNAL(ItemRadius(float)), Mpal, SLOT(setRR(float)));
connect(doc->ActPage, SIGNAL(ItemTextAttr(float)), Mpal, SLOT(setLsp(float)));
connect(doc->ActPage, SIGNAL(MousePos(double, double)), this, SLOT(ReportMP(double, double)));
connect(doc->ActPage, SIGNAL(ItemPos(double, double)), Mpal, SLOT(setXY(double, double)));
connect(doc->ActPage, SIGNAL(ItemGeom(double, double)), Mpal, SLOT(setBH(double, double)));
connect(doc->ActPage, SIGNAL(SetAngle(double)), Mpal, SLOT(setR(double)));
connect(doc->ActPage, SIGNAL(ItemRadius(double)), Mpal, SLOT(setRR(double)));
connect(doc->ActPage, SIGNAL(ItemTextAttr(double)), Mpal, SLOT(setLsp(double)));
connect(doc->ActPage, SIGNAL(ItemTextSize(int)), Mpal, SLOT(setSize(int)));
connect(doc->ActPage, SIGNAL(ItemTextUSval(float)), Mpal, SLOT(setExtra(float)));
connect(doc->ActPage, SIGNAL(SetLocalValues(float, float, float, float)), Mpal, SLOT(setLvalue(float, float, float, float)));
connect(doc->ActPage, SIGNAL(SetSizeValue(float)), Mpal, SLOT(setSvalue(float)));
connect(doc->ActPage, SIGNAL(ItemTextUSval(double)), Mpal, SLOT(setExtra(double)));
connect(doc->ActPage, SIGNAL(SetLocalValues(double, double, double, double)), Mpal, SLOT(setLvalue(double, double, double, double)));
connect(doc->ActPage, SIGNAL(SetSizeValue(double)), Mpal, SLOT(setSvalue(double)));
connect(doc->ActPage, SIGNAL(ItemTextStil(int)), Mpal, SLOT(setStil(int)));
connect(doc->ActPage, SIGNAL(ItemTextSca(int)), Mpal, SLOT(setTScale(int)));
connect(doc->ActPage, SIGNAL(ItemTextAbs(int)), Mpal, SLOT(setAli(int)));
3293,7 → 3289,7
connect(doc->ActPage, SIGNAL(ItemFarben(QString, QString, int, int)), this, SLOT(setCSMenu(QString, QString, int, int)));
connect(doc->ActPage, SIGNAL(ItemFarben(QString, QString, int, int)), Mpal->Cpal, SLOT(setActFarben(QString, QString, int, int)));
connect(doc->ActPage, SIGNAL(ItemGradient(QString, QString, int, int, int)), Mpal->Cpal, SLOT(setActGradient(QString, QString, int, int, int)));
connect(doc->ActPage, SIGNAL(ItemTrans(float, float)), Mpal->Cpal, SLOT(setActTrans(float, float)));
connect(doc->ActPage, SIGNAL(ItemTrans(double, double)), Mpal->Cpal, SLOT(setActTrans(double, double)));
connect(doc->ActPage, SIGNAL(ItemTextFont(QString)), this, SLOT(AdjustFontMenu(QString)));
connect(doc->ActPage, SIGNAL(ItemTextSize(int)), this, SLOT(setFSizeMenu(int)));
connect(doc->ActPage, SIGNAL(ItemTextStil(int)), this, SLOT(setStilvalue(int)));
3318,7 → 3314,7
}
 
/** Ansicht absolut zoomen */
void ScribusApp::slotZoomAbs(float z)
void ScribusApp::slotZoomAbs(double z)
{
doc->Scale = z;
view->slotDoZoom();
3326,8 → 3322,8
 
void ScribusApp::slotZoomFit()
{
float dx = (view->width()-50) / (doc->PageB+30);
float dy = (view->height()-70) / (doc->PageH+30);
double dx = (view->width()-50) / (doc->PageB+30);
double dy = (view->height()-70) / (doc->PageH+30);
if (dx > dy)
slotZoomAbs(dy);
else
4213,13 → 4209,13
{
la = l;
lb = ls;
}
}
}
else
{
la = l;
lb = ls;
}
}
if (la == "None")
la = tr("None");
for (a = 0; a < ColorMenu->count(); ++a)
4617,10 → 4613,10
if (dia->exec())
{
int anz = dia->Ncopies->value();
float dH = static_cast<float>(dia->ShiftH->value()) / UmReFaktor / 100.0;
float dV = static_cast<float>(dia->ShiftV->value()) / UmReFaktor / 100.0;
float dH2 = dH;
float dV2 = dV;
double dH = static_cast<double>(dia->ShiftH->value()) / UmReFaktor / 100.0;
double dV = static_cast<double>(dia->ShiftV->value()) / UmReFaktor / 100.0;
double dH2 = dH;
double dV2 = dV;
int a;
if (anz>0)
{
4681,7 → 4677,7
 
void ScribusApp::ObjektAlign()
{
float xdp, ydp;
double xdp, ydp;
bool xa, ya, Vth, Vtv;
int xart, yart, ein;
if (HaveDoc)
4690,13 → 4686,13
ein = Prefs.Einheit;
NoFrameEdit();
Align *dia = new Align(this, doc->ActPage->SelItem.count(), ein);
connect(dia, SIGNAL(ApplyDist(bool, bool, bool, bool, float, float, int, int)),
this, SLOT(DoAlign(bool, bool, bool, bool, float, float, int, int)));
connect(dia, SIGNAL(ApplyDist(bool, bool, bool, bool, double, double, int, int)),
this, SLOT(DoAlign(bool, bool, bool, bool, double, double, int, int)));
if (dia->exec())
{
xdp = float(dia->AHor->value()) / UmReFaktor / 100.0;
xdp = static_cast<double>(dia->AHor->value()) / UmReFaktor / 100.0;
xa = (dia->CheckH->isChecked() || dia->VerteilenH->isChecked());
ydp = static_cast<float>(dia->AVert->value()) / UmReFaktor/ 100.0;
ydp = static_cast<double>(dia->AVert->value()) / UmReFaktor/ 100.0;
ya = (dia->CheckV->isChecked() || dia->VerteilenV->isChecked());
xart = dia->VartH->currentItem();
yart = dia->VartV->currentItem();
4710,7 → 4706,7
delete dia;
}
 
void ScribusApp::DoAlign(bool xa, bool ya, bool Vth, bool Vtv, float xdp, float ydp, int xart, int yart)
void ScribusApp::DoAlign(bool xa, bool ya, bool Vth, bool Vtv, double xdp, double ydp, int xart, int yart)
{
doc->ActPage->AlignObj(xa, ya, Vth, Vtv, xdp, ydp, xart, yart);
slotDocCh();
4954,27 → 4950,12
if (doc->DbrushPict == tr("None"))
doc->DbrushPict = "None";
doc->ShadePict = dia->ShadeP->value();
doc->ScaleX = static_cast<float>(dia->XScale->value()) / 100;
doc->ScaleY = static_cast<float>(dia->YScale->value()) / 100;
doc->ScaleX = static_cast<double>(dia->XScale->value()) / 100;
doc->ScaleY = static_cast<double>(dia->YScale->value()) / 100;
doc->ScaleType = dia->FreeScale->isChecked();
doc->AspectRatio = dia->Aspect->isChecked();
doc->Before = dia->RadioButton6->isChecked();
doc->Einheit = dia->UnitCombo->currentItem();
switch (doc->Einheit)
{
case 0:
view->UN->setText("pt");
break;
case 1:
view->UN->setText("mm");
break;
case 2:
view->UN->setText("in");
break;
case 3:
view->UN->setText("p");
break;
}
slotChangeUnit(dia->UnitCombo->currentItem(), false);
doc->PagesSbS = dia->SidebySide->isChecked();
doc->ShFrames = dia->FramesVisible->isChecked();
doc->RandFarbig = dia->RandFarb->isChecked();
4985,7 → 4966,6
doc->ASaveTimer->stop();
doc->ASaveTimer->start(dia->ASTime->value() * 60 * 1000);
}
Mpal->UnitChange();
view->reformPages();
view->DrawNew();
}
5067,8 → 5047,8
if (Prefs.DbrushPict == tr("None"))
Prefs.DbrushPict = "None";
Prefs.ShadePict = dia->ShadeP->value();
Prefs.ScaleX = static_cast<float>(dia->XScale->value()) / 100;
Prefs.ScaleY = static_cast<float>(dia->YScale->value()) / 100;
Prefs.ScaleX = static_cast<double>(dia->XScale->value()) / 100;
Prefs.ScaleY = static_cast<double>(dia->YScale->value()) / 100;
Prefs.ScaleType = dia->FreeScale->isChecked();
Prefs.AspectRatio = dia->Aspect->isChecked();
Prefs.Before = dia->RadioButton6->isChecked();
5448,10 → 5428,10
Components = 3;
cmsCloseProfile(hIn);
doc->PDF_Optionen.Info = dia->InfoString->text();
doc->PDF_Optionen.BleedTop = static_cast<float>(dia->BleedTop->value())/UmReFaktor/100.0;
doc->PDF_Optionen.BleedLeft = static_cast<float>(dia->BleedLeft->value())/UmReFaktor/100.0;
doc->PDF_Optionen.BleedRight = static_cast<float>(dia->BleedRight->value())/UmReFaktor/100.0;
doc->PDF_Optionen.BleedBottom = static_cast<float>(dia->BleedBottom->value())/UmReFaktor/100.0;
doc->PDF_Optionen.BleedTop = static_cast<double>(dia->BleedTop->value())/UmReFaktor/100.0;
doc->PDF_Optionen.BleedLeft = static_cast<double>(dia->BleedLeft->value())/UmReFaktor/100.0;
doc->PDF_Optionen.BleedRight = static_cast<double>(dia->BleedRight->value())/UmReFaktor/100.0;
doc->PDF_Optionen.BleedBottom = static_cast<double>(dia->BleedBottom->value())/UmReFaktor/100.0;
doc->PDF_Optionen.Encrypt = false;
doc->PDF_Optionen.PresentMode = false;
doc->PDF_Optionen.Encrypt = false;
5674,16 → 5654,11
DatOpe->setEnabled(true);
DatClo->setEnabled(true);
fileMenu->setEnabled(true);
int setter = 0;
if (view->Pages.count() > 1)
{
pageMenu->setItemEnabled(pgmd, 1);
pageMenu->setItemEnabled(pgmv, 1);
}
else
{
pageMenu->setItemEnabled(pgmd, 0);
pageMenu->setItemEnabled(pgmv, 0);
}
setter = 1;
pageMenu->setItemEnabled(pgmd, setter);
pageMenu->setItemEnabled(pgmv, setter);
if (doc->isModified())
slotDocCh();
for (uint c=0; c<view->Pages.count(); ++c)
5765,7 → 5740,7
void ScribusApp::GroupObj()
{
PageItem* b;
float x, y, w, h;
double x, y, w, h;
for (uint a=0; a<doc->ActPage->SelItem.count(); ++a)
{
b = doc->ActPage->SelItem.at(a);
6381,7 → 6356,7
editMenu->changeItem(edUndo, tr("Undo Object Change"));
break;
}
if (doc->UnDoValid)
if (doc->UnDoValid)
editMenu->setItemEnabled(edUndo, 1);
else
editMenu->setItemEnabled(edUndo, 0);
6508,7 → 6483,7
}
}
 
void ScribusApp::SetTranspar(float t)
void ScribusApp::SetTranspar(double t)
{
PageItem *b;
if (HaveDoc)
6523,7 → 6498,7
}
}
 
void ScribusApp::SetTransparS(float t)
void ScribusApp::SetTransparS(double t)
{
PageItem *b;
if (HaveDoc)
/trunk/Scribus/scribus/polyprops.h
26,8 → 26,8
public:
PolygonProps(QWidget* parent = 0);
~PolygonProps() {};
float GetZeroFaktor();
float GetMaxFaktor();
double GetZeroFaktor();
double GetMaxFaktor();
 
QLabel* Text1;
QSpinBox* Ecken;
42,11 → 42,11
QPushButton* PushButton1;
QPushButton* PushButton2;
QPixmap* Pre;
float PFactor;
double PFactor;
 
public slots:
void UpdatePreView();
float GetFaktor();
double GetFaktor();
void ValFromSpin(int a);
void ValFromSpin2(int a);
 
/trunk/Scribus/scribus/annota.cpp
90,11 → 90,7
GroupBox1Layout->addWidget( TextLabel3, 1, 0 );
SpinBox1 = new QSpinBox( GroupBox1, "SpinBox1" );
SpinBox1->setMinValue(1);
if (item->AnActType == 7)
// if (Destfile->text() != "")
SpinBox1->setMaxValue(1000);
else
SpinBox1->setMaxValue(Seite);
SpinBox1->setMaxValue(item->AnActType == 7 ? 1000 : Seite);
SpinBox1->setValue(item->AnZiel+1);
GroupBox1Layout->addWidget( SpinBox1, 1, 1 );
if ((Destfile->text() != "") && (item->AnActType == 7))
147,7 → 143,7
connect(PushButton2, SIGNAL(clicked()), this, SLOT(reject()));
connect(ComboBox1, SIGNAL(activated(int)), this, SLOT(SetZiel(int)));
connect(SpinBox1, SIGNAL(valueChanged(int)), this, SLOT(SetPg(int)));
connect(Pg, SIGNAL(Coords(float, float)), this, SLOT(SetCo(float, float)));
connect(Pg, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
connect(SpinBox2, SIGNAL(valueChanged(int)), this, SLOT(SetCross()));
connect(SpinBox3, SIGNAL(valueChanged(int)), this, SLOT(SetCross()));
connect(ChFile, SIGNAL(clicked()), this, SLOT(GetFile()));
156,7 → 152,7
}
 
 
void Annota::SetCo(float x, float y)
void Annota::SetCo(double x, double y)
{
SpinBox2->setValue(static_cast<int>(x*Breite));
SpinBox3->setValue(static_cast<int>(y*Hoehe));
190,11 → 186,11
void Annota::SetCross()
{
int x,y;
disconnect(Pg, SIGNAL(Coords(float, float)), this, SLOT(SetCo(float, float)));
x = static_cast<int>(static_cast<float>(SpinBox2->value())/static_cast<float>(Breite)*Pg->pmx.width());
y = static_cast<int>(static_cast<float>(SpinBox3->value())/static_cast<float>(Hoehe)*Pg->pmx.height());
disconnect(Pg, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
x = static_cast<int>(static_cast<double>(SpinBox2->value())/static_cast<double>(Breite)*Pg->pmx.width());
y = static_cast<int>(static_cast<double>(SpinBox3->value())/static_cast<double>(Hoehe)*Pg->pmx.height());
Pg->drawMark(x, y);
connect(Pg, SIGNAL(Coords(float, float)), this, SLOT(SetCo(float, float)));
connect(Pg, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
}
 
void Annota::SetVals()
/trunk/Scribus/scribus/annot.h
234,7 → 234,7
void HandleCalc();
void SetCalc();
void SetFoScript(int it);
void SetCo(float x, float y);
void SetCo(double x, double y);
void SetPg(int v);
void SetCross();
void SetVals();
/trunk/Scribus/scribus/libprefs/prefs.cpp
13,7 → 13,7
#include <cmath>
 
extern QPixmap loadIcon(QString nam);
extern QPointArray RegularPolygon(float w, float h, uint c, bool star, float factor, float rota);
extern QPointArray RegularPolygon(double w, double h, uint c, bool star, double factor, double rota);
 
extern "C" void* Run(QWidget *d, preV *Vor);
 
29,10 → 29,7
fon = &Vor->AvailFonts;
ap = (ScribusApp*)parent;
Umrech = 1.0;
if (ap->HaveDoc)
Einheit = ap->doc->Einheit;
else
Einheit = Vor->Einheit;
Einheit = ap->HaveDoc ? ap->doc->Einheit : Vor->Einheit;
DisScale = Vor->DisScale;
KKC = Vor->KeyActions;
setCaption( tr( "Preferences" ) );
109,10 → 106,7
UnitCombo->insertItem( tr( "Inches (in)" ) );
UnitCombo->insertItem( tr( "Picas (p)" ) );
UnitCombo->setEditable(false);
if (ap->HaveDoc)
UnitCombo->setCurrentItem(ap->doc->Einheit);
else
UnitCombo->setCurrentItem(Vor->Einheit);
UnitCombo->setCurrentItem(ap->HaveDoc ? ap->doc->Einheit : Vor->Einheit);
GroupBox20Layout->addWidget( UnitCombo );
tabLayout->addWidget( GroupBox20, 1, 0 );
Mouse = new QGroupBox( tab, "Mouse" );
145,10 → 139,7
SpinBox3_2->setMaxValue( 1000 );
SpinBox3_2->setMinValue( 1 );
SpinBox3_2->setLineStep( 1 );
if (ap->HaveDoc)
SpinBox3_2->setValue( ap->doc->GrabRad );
else
SpinBox3_2->setValue( Vor->GrabRad );
SpinBox3_2->setValue(ap->HaveDoc ? ap->doc->GrabRad : Vor->GrabRad );
Layout5->addWidget( SpinBox3_2, 1, 1 );
MouseLayout->addLayout( Layout5 );
tabLayout->addWidget( Mouse, 0, 1 );
389,10 → 380,7
GroupASLayout->setAlignment( Qt::AlignTop );
ASon = new QCheckBox( GroupAS, "Enable Autosave" );
ASon->setText( tr( "Enabled" ) );
if (ap->HaveDoc)
ASon->setChecked(ap->doc->AutoSave);
else
ASon->setChecked(Vor->AutoSave);
ASon->setChecked(ap->HaveDoc ? ap->doc->AutoSave : Vor->AutoSave);
GroupASLayout->addMultiCellWidget( ASon, 0, 0, 0, 1 );
ASText = new QLabel( GroupAS, "ASText" );
ASText->setText( tr( "Interval:" ) );
555,17 → 543,11
Layout7->setMargin( 0 );
RadioButton6 = new QRadioButton( ButtonGroup5, "RadioButton6" );
RadioButton6->setText( tr( "In the Background" ) );
if (ap->HaveDoc)
RadioButton6->setChecked( ap->doc->Before );
else
RadioButton6->setChecked( Vor->Before );
RadioButton6->setChecked(ap->HaveDoc ? ap->doc->Before : Vor->Before );
Layout7->addWidget( RadioButton6 );
RadioButton7 = new QRadioButton( ButtonGroup5, "RadioButton6_2" );
RadioButton7->setText( tr( "In the Foreground" ) );
if (ap->HaveDoc)
RadioButton7->setChecked( !ap->doc->Before );
else
RadioButton7->setChecked( !Vor->Before );
RadioButton7->setChecked(ap->HaveDoc ? !ap->doc->Before : !Vor->Before );
Layout7->addWidget( RadioButton7 );
ButtonGroup5Layout->addLayout( Layout7 );
tabLayout_2->addWidget( ButtonGroup5, 0, 1 );
600,19 → 582,13
VTiefW->setSuffix( tr( " %" ) );
VTiefW->setMaxValue( 100 );
VTiefW->setMinValue( 1 );
if (ap->HaveDoc)
VTiefW->setValue( ap->doc->VTief );
else
VTiefW->setValue( Vor->DVTief );
VTiefW->setValue(ap->HaveDoc ? ap->doc->VTief : Vor->DVTief );
Layout12->addWidget( VTiefW, 0, 1 );
VTiefWSc = new QSpinBox( GroupBox4_2, "VTiefWSc" );
VTiefWSc->setSuffix( tr( " %" ) );
VTiefWSc->setMaxValue( 100 );
VTiefWSc->setMinValue( 1 );
if (ap->HaveDoc)
VTiefWSc->setValue( ap->doc->VTiefSc );
else
VTiefWSc->setValue( Vor->DVTiefSc );
VTiefWSc->setValue(ap->HaveDoc ? ap->doc->VTiefSc : Vor->DVTiefSc );
Layout12->addWidget( VTiefWSc, 1, 1 );
GroupBox4_2Layout->addLayout( Layout12 );
tabLayout_3->addWidget( GroupBox4_2, 1, 0 );
640,19 → 616,13
VHochW->setSuffix( tr( " %" ) );
VHochW->setMaxValue( 100 );
VHochW->setMinValue( 1 );
if (ap->HaveDoc)
VHochW->setValue( ap->doc->VHoch );
else
VHochW->setValue( Vor->DVHoch );
VHochW->setValue(ap->HaveDoc ? ap->doc->VHoch : Vor->DVHoch );
Layout13->addWidget( VHochW, 0, 1 );
VHochWSc = new QSpinBox( GroupBox4, "VHochWSc" );
VHochWSc->setSuffix( tr( " %" ) );
VHochWSc->setMaxValue( 100 );
VHochWSc->setMinValue( 1 );
if (ap->HaveDoc)
VHochWSc->setValue( ap->doc->VHochSc );
else
VHochWSc->setValue( Vor->DVHochSc );
VHochWSc->setValue(ap->HaveDoc ? ap->doc->VHochSc : Vor->DVHochSc );
Layout13->addWidget( VHochWSc, 1, 1 );
GroupBox4Layout->addLayout( Layout13 );
tabLayout_3->addWidget( GroupBox4, 0, 0 );
676,10 → 646,7
SmallCaps->setSuffix( tr( " %" ) );
SmallCaps->setMaxValue( 100 );
SmallCaps->setMinValue( 1 );
if (ap->HaveDoc)
SmallCaps->setValue( ap->doc->VKapit );
else
SmallCaps->setValue( Vor->DVKapit );
SmallCaps->setValue(ap->HaveDoc ? ap->doc->VKapit : Vor->DVKapit );
Layout14->addWidget( SmallCaps );
GroupBox4_3Layout->addLayout( Layout14 );
tabLayout_3->addWidget( GroupBox4_3, 0, 1 );
704,10 → 671,7
AutoLineV->setSuffix( tr( " %" ) );
AutoLineV->setMaxValue( 100 );
AutoLineV->setMinValue( 1 );
if (ap->HaveDoc)
AutoLineV->setValue( ap->doc->AutoLine );
else
AutoLineV->setValue( Vor->AutoLine );
AutoLineV->setValue(ap->HaveDoc ? ap->doc->AutoLine : Vor->AutoLine );
Layout14a->addWidget( AutoLineV );
GroupBox4_3aLayout->addLayout( Layout14a );
tabLayout_3->addWidget( GroupBox4_3a, 1, 1 );
937,10 → 901,7
Shade2->setSuffix( tr( " %" ) );
Shade2->setMaxValue( 100 );
Shade2->setMinValue( 0 );
if (ap->HaveDoc)
Shade2->setValue( ap->doc->Dshade2 );
else
Shade2->setValue( Vor->Dshade2 );
Shade2->setValue(ap->HaveDoc ? ap->doc->Dshade2 : Vor->Dshade2 );
Layout15b->addWidget(Shade2, 1, 1);
Background = new QComboBox( true, ToolFrame2, "Background" );
Background->setEditable(false);
961,18 → 922,12
Shade->setSuffix( tr( " %" ) );
Shade->setMaxValue( 100 );
Shade->setMinValue( 0 );
if (ap->HaveDoc)
Shade->setValue( ap->doc->Dshade );
else
Shade->setValue( Vor->Dshade );
Shade->setValue(ap->HaveDoc ? ap->doc->Dshade : Vor->Dshade );
Layout15b->addWidget(Shade, 3, 1);
Linestyle = new LineCombo(ToolFrame2);
Linestyle->setEditable(false);
int dla;
if (ap->HaveDoc)
dla = ap->doc->DLineArt;
else
dla = Vor->DLineArt;
dla = ap->HaveDoc ? ap->doc->DLineArt : Vor->DLineArt;
switch (dla)
{
case SolidLine:
1000,10 → 955,7
LineW->setMaxValue( 200 );
LineW->setMinValue( 0 );
LineW->setLineStep(10);
if (ap->HaveDoc)
LineW->setValue(static_cast<int>(ap->doc->Dwidth*10));
else
LineW->setValue(static_cast<int>(Vor->Dwidth*10));
LineW->setValue(ap->HaveDoc ? static_cast<int>(ap->doc->Dwidth*10) : static_cast<int>(Vor->Dwidth*10));
Layout15b->addWidget(LineW, 5, 1);
QSpacerItem* sp07 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
ToolFrame2Layout->addItem( sp07 );
1011,7 → 963,7
QSpacerItem* sp08 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
ToolFrame2Layout->addItem( sp08 );
Fram->addWidget(ToolFrame2, 2);
 
ToolFrame3 = new QFrame( this, "ToolFrame" );
ToolFrame3->setFrameShape( QFrame::Box );
ToolFrame3->setFrameShadow( QFrame::Sunken );
1056,17 → 1008,11
Shade22->setSuffix( tr( " %" ) );
Shade22->setMaxValue( 100 );
Shade22->setMinValue( 0 );
if (ap->HaveDoc)
Shade22->setValue( ap->doc->DshadeLine );
else
Shade22->setValue( Vor->DshadeLine );
Shade22->setValue(ap->HaveDoc ? ap->doc->DshadeLine : Vor->DshadeLine );
Layout15c->addWidget(Shade22, 1, 1);
Linestyle2 = new LineCombo(ToolFrame3);
Linestyle2->setEditable(false);
if (ap->HaveDoc)
dla = ap->doc->DLstyleLine;
else
dla = Vor->DLstyleLine;
dla = ap->HaveDoc ? ap->doc->DLstyleLine : Vor->DLstyleLine;
switch (dla)
{
case SolidLine:
1094,10 → 1040,7
LineW2->setMaxValue( 200 );
LineW2->setMinValue( 1 );
LineW2->setLineStep(10);
if (ap->HaveDoc)
LineW2->setValue( static_cast<int>(ap->doc->DwidthLine*10) );
else
LineW2->setValue( static_cast<int>(Vor->DwidthLine*10) );
LineW2->setValue(ap->HaveDoc ? static_cast<int>(ap->doc->DwidthLine*10) : static_cast<int>(Vor->DwidthLine*10) );
Layout15c->addWidget(LineW2, 3, 1);
QSpacerItem* sp05 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
ToolFrame3Layout->addItem( sp05 );
1105,7 → 1048,7
QSpacerItem* sp06 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
ToolFrame3Layout->addItem( sp06 );
Fram->addWidget(ToolFrame3, 3);
 
ToolFrame4 = new QFrame( this, "ToolFrame" );
ToolFrame4->setFrameShape( QFrame::Box );
ToolFrame4->setFrameShadow( QFrame::Sunken );
1132,10 → 1075,7
MinMag->setMaxValue( 800 );
MinMag->setMinValue( 10 );
MinMag->setLineStep( 10 );
if (ap->HaveDoc)
MinMag->setValue( ap->doc->MagMin );
else
MinMag->setValue( Vor->MagMin );
MinMag->setValue(ap->HaveDoc ? ap->doc->MagMin : Vor->MagMin );
Layout15d->addWidget(MinMag, 0, 1);
MaxMag = new QSpinBox( ToolFrame4, "Shade" );
MaxMag->setSuffix( tr( " %" ) );
1142,10 → 1082,7
MaxMag->setMaxValue( 800 );
MaxMag->setMinValue( 10 );
MaxMag->setLineStep( 10 );
if (ap->HaveDoc)
MaxMag->setValue( ap->doc->MagMax );
else
MaxMag->setValue( Vor->MagMax );
MaxMag->setValue(ap->HaveDoc ? ap->doc->MagMax : Vor->MagMax );
Layout15d->addWidget(MaxMag, 1, 1);
StepMag = new QSpinBox( ToolFrame4, "LineW" );
StepMag->setSuffix( tr( " %" ) );
1152,10 → 1089,7
StepMag->setMaxValue( 200 );
StepMag->setMinValue( 1 );
StepMag->setLineStep( 25 );
if (ap->HaveDoc)
StepMag->setValue( ap->doc->MagStep );
else
StepMag->setValue( Vor->MagStep );
StepMag->setValue(ap->HaveDoc ? ap->doc->MagStep : Vor->MagStep );
Layout15d->addWidget(StepMag, 2, 1);
QSpacerItem* sp03 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
ToolFrame4Layout->addItem( sp03 );
1198,19 → 1132,13
XScale->setSuffix( tr( " %" ) );
XScale->setMaxValue( 1000 );
XScale->setMinValue( 1 );
if (ap->HaveDoc)
XScale->setValue( qRound(ap->doc->ScaleX * 100) );
else
XScale->setValue( qRound(Vor->ScaleX * 100) );
XScale->setValue(ap->HaveDoc ? qRound(ap->doc->ScaleX * 100) : qRound(Vor->ScaleX * 100) );
Layout15->addWidget( XScale, 1, 2 );
YScale = new QSpinBox( ToolFrame5, "YScale" );
YScale->setSuffix( tr( " %" ) );
YScale->setMaxValue( 1000 );
YScale->setMinValue( 1 );
if (ap->HaveDoc)
YScale->setValue( qRound(ap->doc->ScaleY * 100) );
else
YScale->setValue( qRound(Vor->ScaleY * 100) );
YScale->setValue(ap->HaveDoc ? qRound(ap->doc->ScaleY * 100) : qRound(Vor->ScaleY * 100) );
Layout15->addWidget( YScale, 2, 2 );
Kette = new LinkButton( ToolFrame5 );
Kette->setToggleButton( true );
1226,10 → 1154,7
ShadeP->setSuffix( tr( " %" ) );
ShadeP->setMaxValue( 100 );
ShadeP->setMinValue( 0 );
if (ap->HaveDoc)
ShadeP->setValue( ap->doc->ShadePict );
else
ShadeP->setValue( Vor->ShadePict );
ShadeP->setValue(ap->HaveDoc ? ap->doc->ShadePict : Vor->ShadePict );
Layout15->addWidget( ShadeP, 6, 1 );
BackgroundP = new QComboBox( true, ToolFrame5, "BackgroundP" );
BackgroundP->setEditable(false);
1251,15 → 1176,9
ToolFrame5Layout->addLayout( Layout15 );
QSpacerItem* sp02 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum );
ToolFrame5Layout->addItem( sp02 );
if (ap->HaveDoc)
Aspect->setChecked(ap->doc->AspectRatio);
else
Aspect->setChecked(Vor->AspectRatio);
Aspect->setChecked(ap->HaveDoc ? ap->doc->AspectRatio : Vor->AspectRatio);
bool sct;
if (ap->HaveDoc)
sct = ap->doc->ScaleType;
else
sct = Vor->ScaleType;
sct = ap->HaveDoc ? ap->doc->ScaleType : Vor->ScaleType;
if (sct)
{
FreeScale->setChecked(true);
1441,17 → 1360,11
GroupBox10Layout->setMargin( 11 );
FramesVisible = new QCheckBox( GroupBox10, "FramesVisible" );
FramesVisible->setText( tr( "Display Frames" ) );
if (ap->HaveDoc)
FramesVisible->setChecked(ap->doc->ShFrames);
else
FramesVisible->setChecked(Vor->ShFrames);
FramesVisible->setChecked(ap->HaveDoc ? ap->doc->ShFrames : Vor->ShFrames);
GroupBox10Layout->addWidget( FramesVisible );
SidebySide = new QCheckBox( GroupBox10, "SidebySide" );
SidebySide->setText( tr( "Display Pages Side by Side" ) );
if (ap->HaveDoc)
SidebySide->setChecked(ap->doc->PagesSbS);
else
SidebySide->setChecked(Vor->PagesSbS);
SidebySide->setChecked(ap->HaveDoc ? ap->doc->PagesSbS : Vor->PagesSbS);
GroupBox10Layout->addWidget( SidebySide );
 
Layout_6b = new QHBoxLayout();
1511,10 → 1424,7
GroupBox10Layout->addLayout(Layout_6b);
RandFarb = new QCheckBox( GroupBox10, "Ran" );
RandFarb->setText( tr( "Display Unprintable Area in Margin Color" ) );
if (ap->HaveDoc)
RandFarb->setChecked(ap->doc->RandFarbig);
else
RandFarb->setChecked(Vor->RandFarbig);
RandFarb->setChecked(ap->HaveDoc ? ap->doc->RandFarbig : Vor->RandFarbig);
GroupBox10Layout->addWidget( RandFarb );
UsePDFTrans = new QCheckBox( GroupBox10, "Ran2" );
UsePDFTrans->setText( tr( "Use PDF-1.4 Transparency Features" ) );
1654,24 → 1564,15
 
void Preferences::ChangeScaling()
{
bool setter = false;
if (FreeScale->isChecked())
{
TextLabelT51->setEnabled(true);
TextLabelT52->setEnabled(true);
XScale->setEnabled(true);
YScale->setEnabled(true);
Kette->setEnabled(true);
Aspect->setEnabled(false);
}
else
{
TextLabelT51->setEnabled(false);
TextLabelT52->setEnabled(false);
XScale->setEnabled(false);
YScale->setEnabled(false);
Kette->setEnabled(false);
Aspect->setEnabled(true);
}
setter = true;
TextLabelT51->setEnabled(setter);
TextLabelT52->setEnabled(setter);
XScale->setEnabled(setter);
YScale->setEnabled(setter);
Kette->setEnabled(setter);
Aspect->setEnabled(!setter);
}
 
void Preferences::setDS()
1941,7 → 1842,7
QPixmap pm = QPixmap(40, 20);
pm.fill(neu);
Cmin = neu;
minColor->setPixmap(pm);
minColor->setPixmap(pm);
}
}
 
1954,7 → 1855,7
QPixmap pm = QPixmap(40, 20);
pm.fill(neu);
Cpaper = neu;
PapColor->setPixmap(pm);
PapColor->setPixmap(pm);
}
}
 
1967,7 → 1868,7
QPixmap pm = QPixmap(40, 20);
pm.fill(neu);
Crand = neu;
RandColor->setPixmap(pm);
RandColor->setPixmap(pm);
}
}
 
2022,7 → 1923,7
 
void Preferences::UnitChange()
{
float AltUmrech = Umrech;
double AltUmrech = Umrech;
Einheit = UnitCombo->currentItem();
switch (UnitCombo->currentItem())
{
2148,7 → 2049,7
if ((br.height() > 100) || (br.width() > 100))
{
QWMatrix ma;
float sca = 100.0 / float(QMAX(br.width(), br.height()));
double sca = 100.0 / static_cast<double>(QMAX(br.width(), br.height()));
ma.scale(sca, sca);
pp = ma * pp;
}
2157,15 → 2058,15
T6_Preview->setPixmap(*Pre);
}
 
float Preferences::GetZeroFaktor()
double Preferences::GetZeroFaktor()
{
return sqrt(pow(1,2)-pow(((sin((360.0/(T6_Ecken->value()*2))/180*M_PI)* 2.0)/2.0),2));
}
 
float Preferences::GetMaxFaktor()
double Preferences::GetMaxFaktor()
{
float win = (360.0/(T6_Ecken->value()*2)) / 180.0 * M_PI;
float ret;
double win = (360.0/(T6_Ecken->value()*2)) / 180.0 * M_PI;
double ret;
if ((360.0/(T6_Ecken->value()*2)) > 45)
ret = 1/sin(win);
else
2173,7 → 2074,7
return ret;
}
 
float Preferences::GetFaktor()
double Preferences::GetFaktor()
{
int val = T6_Slider1->value();
if (val < 0)
2182,8 → 2083,8
}
else
{
float ma = GetMaxFaktor();
float mi = GetZeroFaktor();
double ma = GetMaxFaktor();
double mi = GetZeroFaktor();
PFactor = ((ma - mi) * val / 100.0) + mi;
}
return PFactor;
2198,7 → 2099,7
 
void Preferences::DrawRuler()
{
float xl, iter, iter2, maxi;
double xl, iter, iter2, maxi;
switch (Einheit)
{
case 0:
/trunk/Scribus/scribus/libprefs/prefs.h
34,8 → 34,8
public:
Preferences( QWidget* parent, preV *Vor);
~Preferences();
float GetZeroFaktor();
float GetMaxFaktor();
double GetZeroFaktor();
double GetMaxFaktor();
void DrawRuler();
 
QPushButton* buttonOK;
222,9 → 222,9
QLabel* CaliAnz;
 
SCFonts *fon; // can't use a reference, and can't copy whole structure...
float Umrech;
double Umrech;
QPixmap* Pre;
float PFactor;
double PFactor;
QMap<int,Keys> KKC;
QColor Cmin;
QColor Cmax;
231,14 → 231,14
QColor Crand;
QColor Cpaper;
QColor Cgui;
float Pagebr;
float Pageho;
float RandT;
float RandB;
float RandL;
float RandR;
double Pagebr;
double Pageho;
double RandT;
double RandB;
double RandL;
double RandR;
int Einheit;
float DisScale;
double DisScale;
ScribusApp *ap;
 
public slots:
267,7 → 267,7
void VChange();
void UnitChange();
void UpdatePreView();
float GetFaktor();
double GetFaktor();
void ValFromSpin(int a);
void ValFromSpin2(int a);
void SetDisScale();
/trunk/Scribus/scribus/fmitem.h
35,7 → 35,7
QSize sizeHint();
QString Ctext();
private:
QString string;
QString stringy;
QFont font;
};
 
/trunk/Scribus/scribus/fontcombo.h
31,7 → 31,7
{
public:
FontListItem(QComboBox* parent, QString f, QFont fo);
virtual ~FontListItem();
virtual ~FontListItem() {};
 
virtual int width(const QListBox *) const;
virtual int height(const QListBox *) const;
/trunk/Scribus/scribus/mspinbox.cpp
68,22 → 68,14
 
QString MSpinBox::mapValueToText(int value)
{
double dez;
if (Width == 1)
dez = 10.0;
else
dez = 100.0;
double dez = Width == 1 ? 10.0 : 100.0;
return QString::number(static_cast<double>(value) / dez, 'f', Width);
}
 
int MSpinBox::mapTextToValue(bool *)
{
float dez;
if (Width == 1)
dez = 10.0;
else
dez = 100.0;
return int(qRound(text().toFloat()*dez));
double dez = Width == 1 ? 10.0 : 100.0;
return static_cast<int>(qRound(text().toDouble()*dez));
}
 
void MSpinBox::setDecimals(int deci)
90,7 → 82,7
{
Decimals = deci;
setLineStep(Decimals);
if (deci > 9)
if (deci > 9 && deci < 100)
Width = 1;
if (deci > 99)
Width = 2;
/trunk/Scribus/scribus/navigator.h
47,7 → 47,7
QPixmap pmx;
signals:
void Coords(float x, float y);
void Coords(double x, double y);
};
 
#endif
/trunk/Scribus/scribus/plugins/libchar/charselect.cpp
82,7 → 82,7
QWMatrix chma;
chma.scale(4.8, 4.8);
FPointArray gly = (*ap->doc->AllFonts)[ap->doc->CurrFont]->GlyphArray[par->Zeich[r*32+c]].Outlines.copy();
float ww = bh - (*ap->doc->AllFonts)[ap->doc->CurrFont]->CharWidth[par->Zeich[r*32+c]]*48;
double ww = bh - (*ap->doc->AllFonts)[ap->doc->CurrFont]->CharWidth[par->Zeich[r*32+c]]*48;
if (gly.size() > 4)
{
gly.map(chma);
/trunk/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
15,7 → 15,7
extern QPointArray FlattenPath(FPointArray ina, QValueList<uint> &Segs);
extern bool loadText(QString nam, QString *Buffer);
extern QPixmap loadIcon(QString nam);
extern float Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
extern double Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
 
QString Name()
{
582,7 → 582,7
}
}
number = integer + decimal;
number *= sign * pow( (double)10, double( expsign * exponent ) );
number *= sign * pow( static_cast<double>(10), static_cast<double>( expsign * exponent ) );
 
// skip the following space
if(*ptr == ' ')
879,7 → 879,7
th_arc += 2 * M_PI;
else if(th_arc > 0 && !sweepFlag)
th_arc -= 2 * M_PI;
n_segs = (int) (int) ceil(fabs(th_arc / (M_PI * 0.5 + 0.001)));
n_segs = static_cast<int>(ceil(fabs(th_arc / (M_PI * 0.5 + 0.001))));
for(i = 0; i < n_segs; i++)
{
{
938,10 → 938,10
}
FirstM = false;
WasM = false;
i->addPoint(FPoint(static_cast<float>(CurrX), static_cast<float>(CurrY)));
i->addPoint(FPoint(static_cast<float>(CurrX), static_cast<float>(CurrY)));
i->addPoint(FPoint(static_cast<float>(x1), static_cast<float>(y1)));
i->addPoint(FPoint(static_cast<float>(x1), static_cast<float>(y1)));
i->addPoint(FPoint(static_cast<double>(CurrX), static_cast<double>(CurrY)));
i->addPoint(FPoint(static_cast<double>(CurrX), static_cast<double>(CurrY)));
i->addPoint(FPoint(static_cast<double>(x1), static_cast<double>(y1)));
i->addPoint(FPoint(static_cast<double>(x1), static_cast<double>(y1)));
CurrX = x1;
CurrY = y1;
PathLen += 4;
956,10 → 956,10
}
FirstM = false;
WasM = false;
i->addPoint(FPoint(static_cast<float>(CurrX), static_cast<float>(CurrY)));
i->addPoint(FPoint(static_cast<float>(x1), static_cast<float>(y1)));
i->addPoint(FPoint(static_cast<float>(x3), static_cast<float>(y3)));
i->addPoint(FPoint(static_cast<float>(x2), static_cast<float>(y2)));
i->addPoint(FPoint(static_cast<double>(CurrX), static_cast<double>(CurrY)));
i->addPoint(FPoint(static_cast<double>(x1), static_cast<double>(y1)));
i->addPoint(FPoint(static_cast<double>(x3), static_cast<double>(y3)));
i->addPoint(FPoint(static_cast<double>(x2), static_cast<double>(y2)));
CurrX = x3;
CurrY = y3;
PathLen += 4;
967,12 → 967,12
 
void SVGPlug::svgClosePath(FPointArray *i)
{
if ((PathLen == 4) || (i->point(i->size()-2).x() != static_cast<float>(StartX)) || (i->point(i->size()-2).y() != static_cast<float>(StartY)))
if ((PathLen == 4) || (i->point(i->size()-2).x() != static_cast<double>(StartX)) || (i->point(i->size()-2).y() != static_cast<double>(StartY)))
{
i->addPoint(i->point(i->size()-2));
i->addPoint(i->point(i->size()-3));
i->addPoint(FPoint(static_cast<float>(StartX), static_cast<float>(StartY)));
i->addPoint(FPoint(static_cast<float>(StartX), static_cast<float>(StartY)));
i->addPoint(FPoint(static_cast<double>(StartX), static_cast<double>(StartY)));
i->addPoint(FPoint(static_cast<double>(StartX), static_cast<double>(StartY)));
}
}
 
997,17 → 997,17
if( r.contains( "%" ) )
{
r = r.left( r.length() - 1 );
r = QString::number( int( ( double( 255 * r.toDouble() ) / 100.0 ) ) );
r = QString::number( static_cast<int>( ( static_cast<double>( 255 * r.toDouble() ) / 100.0 ) ) );
}
if( g.contains( "%" ) )
{
g = g.left( g.length() - 1 );
g = QString::number( int( ( double( 255 * g.toDouble() ) / 100.0 ) ) );
g = QString::number( static_cast<int>( ( static_cast<double>( 255 * g.toDouble() ) / 100.0 ) ) );
}
if( b.contains( "%" ) )
{
b = b.left( b.length() - 1 );
b = QString::number( int( ( double( 255 * b.toDouble() ) / 100.0 ) ) );
b = QString::number( static_cast<int>( ( static_cast<double>( 255 * b.toDouble() ) / 100.0 ) ) );
}
c = QColor(r.toInt(), g.toInt(), b.toInt());
}
1130,20 → 1130,20
obj->PLineEnd = Qt::SquareCap;
}
// else if( command == "stroke-miterlimit" )
// gc->stroke.setMiterLimit( params.toFloat() );
// gc->stroke.setMiterLimit( params.todouble() );
else if( command == "stroke-dasharray" )
{
QValueList<float> array;
QValueList<double> array;
if(params != "none")
{
QStringList dashes = QStringList::split( ' ', params );
for( QStringList::Iterator it = dashes.begin(); it != dashes.end(); ++it )
array.append( (*it).toFloat() );
array.append( (*it).toDouble() );
}
obj->dashArray = array;
}
else if( command == "stroke-dashoffset" )
obj->dashOffset = params.toFloat();
obj->dashOffset = params.toDouble();
else if( command == "stroke-opacity" )
obj->TranspStroke = 1.0 - fromPercentage(params);
else if( command == "fill-opacity" )
1236,7 → 1236,7
{
QString Col = "Black";
bool first = false;
float offset;
double offset;
for(QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling())
{
QDomElement stop = n.toElement();
1246,10 → 1246,10
if( temp.contains( '%' ) )
{
temp = temp.left( temp.length() - 1 );
offset = temp.toFloat() / 100.0;
offset = temp.toDouble() / 100.0;
}
else
offset = temp.toFloat();
offset = temp.toDouble();
if( !stop.attribute( "stop-color" ).isEmpty() )
Col = parseColor(stop.attribute("stop-color"));
else
1340,7 → 1340,7
if ((!c.isNull()) && (c.toElement().tagName() == "tspan"))
{
ite->Height = ite->LineSp+desc+2;
float tempW = 0;
double tempW = 0;
for(QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling())
{
QDomElement tspan = n.toElement();
/trunk/Scribus/scribus/plugins/svgimplugin/svgplugin.h
59,7 → 59,7
dashArray.clear();
}
QWMatrix matrix;
float LWidth;
double LWidth;
Qt::PenStyle PLineArt;
Qt::PenJoinStyle PLineJoin;
Qt::PenCapStyle PLineEnd;
72,11 → 72,11
VGradient GradCo;
int FontSize;
QString Family;
float Transparency;
float TranspStroke;
double Transparency;
double TranspStroke;
bool InherCol;
float dashOffset;
QValueList<float> dashArray;
double dashOffset;
QValueList<double> dashArray;
};
 
class SVGPlug : public QObject
/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.h
27,7 → 27,7
private:
void ProcessPage(ScribusApp *plug, Page *Seite, QDomDocument *docu, QDomElement *elem);
QString SetClipPath(PageItem *ite);
QString FToStr(float c);
QString FToStr(double c);
QString IToStr(int c);
void SetTextProps(QDomElement *tp, struct Pti *hl, ScribusApp *plug);
QString SetFarbe(QString farbe, int shad, ScribusApp *plug);
/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
520,7 → 520,7
return tmp;
}
 
QString SVGExPlug::FToStr(float c)
QString SVGExPlug::FToStr(double c)
{
QString cc;
return cc.setNum(c);
/trunk/Scribus/scribus/plugins/printpreview/preview.cpp
171,26 → 171,16
{
disconnect(SeitenAusw, SIGNAL(activated(int)), this, SLOT(ToSeite(int)));
SeitenAusw->setCurrentItem(num);
bool setter = true;
if (num == 0)
{
First->setEnabled(false);
Back->setEnabled(false);
}
else
{
First->setEnabled(true);
Back->setEnabled(true);
}
setter = false;
First->setEnabled(setter);
Back->setEnabled(setter);
setter = true;
if (num == MPage-1)
{
Forward->setEnabled(false);
Last->setEnabled(false);
}
else
{
Forward->setEnabled(true);
Last->setEnabled(true);
}
setter = false;
Forward->setEnabled(setter);
Last->setEnabled(setter);
connect(SeitenAusw, SIGNAL(activated(int)), this, SLOT(ToSeite(int)));
}
 
212,8 → 202,8
}
else
return Bild;
float b = app->doc->PageB * Res / 72;
float h = app->doc->PageH * Res / 72;
double b = app->doc->PageB * Res / 72;
double h = app->doc->PageH * Res / 72;
cmd1 = "gs -q -dNOPAUSE -sDEVICE=png16m -r"+tmp.setNum(Res)+" -g"+tmp2.setNum(qRound(b))+"x"+tmp3.setNum(qRound(h));
if (AliasText->isChecked())
cmd1 += " -dTextAlphaBits=4";
/trunk/Scribus/scribus/multiline.cpp
185,13 → 185,11
Docu->PageColors[name].getRGBColor().rgb(&h, &s, &v);
if ((h == s) && (s == v))
{
Docu->PageColors[name].getRGBColor().hsv(&h, &s, &v);
sneu = 255 - ((255 - v) * shade / 100);
tmpf.setHsv(h, s, sneu);
}
else
{
Docu->PageColors[name].getRGBColor().hsv(&h, &s, &v);
sneu = s * shade / 100;
tmpf.setHsv(h, sneu, v);
}
446,7 → 444,7
 
void MultiLine::NewLWidth()
{
TempVorl[CurLin].Width = static_cast<float>(LWidth->value()) / 10.0;
TempVorl[CurLin].Width = static_cast<double>(LWidth->value()) / 10.0;
reSort();
updatePreview();
}
/trunk/Scribus/scribus/mdup.cpp
8,9 → 8,9
#include <qvariant.h>
#include <qtooltip.h>
extern QPixmap loadIcon(QString nam);
extern float UmReFaktor;
extern double UmReFaktor;
 
Mdup::Mdup( QWidget* parent, float Dx, float Dy, int Ein )
Mdup::Mdup( QWidget* parent, double Dx, double Dy, int Ein )
: QDialog( parent, "m", true, 0 )
{
setCaption( tr( "Multiple Duplicate" ) );
/trunk/Scribus/scribus/fontprefs.cpp
89,7 → 89,7
Header->setLabel(2, tr("Embed in:"));
Header->setLabel(3, tr("Subset"));
Header->setLabel(4, tr("Type"));
Header->setLabel(5, tr("Path to Fontfile"));
Header->setLabel(5, tr("Path to Font File"));
Table1->adjustColumn(0);
Table1->adjustColumn(1);
Table1->setColumnWidth(2, 110);
272,9 → 272,10
{
QFile fp(s+"fonts.scale");
if(!(fp.exists()))
{
fp.setName(s+"fonts.dir");
if(!(fp.exists()))
return;
}
s = s.left(s.length()-1);
if (PathList->findItem(s))
return;
306,9 → 307,10
{
QFile fp(s+"fonts.scale");
if(!(fp.exists()))
{
fp.setName(s+"fonts.dir");
if(!(fp.exists()))
return;
}
s = s.left(s.length()-1);
if (PathList->findItem(s))
return;
352,16 → 354,9
return;
CurrentPath = "";
RebuildDialog();
if (PathList->count() > 0)
{
ChangeB->setEnabled(true);
RemoveB->setEnabled(true);
}
else
{
ChangeB->setEnabled(false);
RemoveB->setEnabled(false);
}
bool setter = PathList->count() > 0 ? true : false;
ChangeB->setEnabled(setter);
RemoveB->setEnabled(setter);
}
 
void FontPrefs::RebuildDialog()
/trunk/Scribus/scribus/polyprops.cpp
16,11 → 16,11
 
extern int PolyC;
extern int PolyFd;
extern float PolyF;
extern double PolyF;
extern bool PolyS;
extern float PolyR;
extern double PolyR;
extern QPixmap loadIcon(QString nam);
extern QPointArray RegularPolygon(float w, float h, uint c, bool star, float factor, float rota);
extern QPointArray RegularPolygon(double w, double h, uint c, bool star, double factor, double rota);
 
PolygonProps::PolygonProps(QWidget* parent) : QDialog( parent, "poly", true, 0 )
{
28,7 → 28,7
setIcon(loadIcon("AppIcon.xpm"));
Pre = new QPixmap(101, 101);
Pre->fill(white);
PolygonPropsLayout = new QVBoxLayout( this, 10, 5, "PolygonPropsLayout");
PolygonPropsLayout = new QVBoxLayout( this, 10, 5, "PolygonPropsLayout");
Layout11 = new QHBoxLayout( 0, 0, 5, "Layout11");
Layout10 = new QVBoxLayout( 0, 0, 5, "Layout10");
Layout2 = new QHBoxLayout( 0, 0, 5, "Layout2");
106,7 → 106,7
Layout11->addWidget( Preview );
PolygonPropsLayout->addLayout( Layout11 );
 
Layout1_2 = new QHBoxLayout( 0, 0, 6, "Layout1_2");
Layout1_2 = new QHBoxLayout( 0, 0, 6, "Layout1_2");
PushButton1 = new QPushButton( this, "PushButton1" );
PushButton1->setMinimumSize( QSize( 90, 0 ) );
PushButton1->setText( tr( "OK" ) );
164,7 → 164,7
if ((br.height() > 100) || (br.width() > 100))
{
QWMatrix ma;
float sca = 100.0 / static_cast<float>(QMAX(br.width(), br.height()));
double sca = 100.0 / static_cast<double>(QMAX(br.width(), br.height()));
ma.scale(sca, sca);
pp = ma * pp;
}
173,15 → 173,15
Preview->setPixmap(*Pre);
}
 
float PolygonProps::GetZeroFaktor()
double PolygonProps::GetZeroFaktor()
{
return sqrt(pow(1,2)-pow(((sin((360.0/(Ecken->value()*2))/180*M_PI)* 2.0)/2.0),2));
}
 
float PolygonProps::GetMaxFaktor()
double PolygonProps::GetMaxFaktor()
{
float win = (360.0/(Ecken->value()*2)) / 180.0 * M_PI;
float ret;
double win = (360.0/(Ecken->value()*2)) / 180.0 * M_PI;
double ret;
if ((360.0/(Ecken->value()*2)) > 45)
ret = 1/sin(win);
else
189,7 → 189,7
return ret;
}
 
float PolygonProps::GetFaktor()
double PolygonProps::GetFaktor()
{
int val = Slider1->value();
if (val < 0)
198,8 → 198,8
}
else
{
float ma = GetMaxFaktor();
float mi = GetZeroFaktor();
double ma = GetMaxFaktor();
double mi = GetZeroFaktor();
PFactor = ((ma - mi) * val / 100.0) + mi;
}
return PFactor;
/trunk/Scribus/scribus/serializer.cpp
69,12 → 69,12
}
for (a=0; a<Objekt.length(); ++a)
{
if (Objekt.at(a) == QChar(0)) { continue; }
if (Objekt.at(a) == QChar(13)) { continue; }
hg = new Pti;
hg->ch = Objekt.at(a);
if (hg->ch == QChar(10)) { hg->ch = QChar(13); }
if (hg->ch == QChar(5)) { hg->ch = QChar(13); }
if ((Objekt.at(a) == QChar(0)) || (Objekt.at(a) == QChar(13)))
continue;
hg = new Pti;
hg->ch = Objekt.at(a);
if ((hg->ch == QChar(10)) || (hg->ch == QChar(5)))
hg->ch = QChar(13);
if (hg->ch == QChar(9)) { hg->ch = " "; }
if (font != "")
{
/trunk/Scribus/scribus/page.cpp
48,20 → 48,20
#endif
extern int PolyC;
extern int PolyFd;
extern float PolyF;
extern double PolyF;
extern bool PolyS;
extern float PolyR;
extern double PolyR;
extern ProfilesL InputProfiles;
extern QPixmap loadIcon(QString nam);
extern float Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
extern double Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
#ifdef HAVE_CMS
QImage ProofPict(QImage *Im, QString Prof, int Rend, cmsHPROFILE emPr=0);
#else
QImage ProofPict(QImage *Im, QString Prof, int Rend);
#endif
extern FPointArray RegularPolygonF(float w, float h, uint c, bool star, float factor, float rota);
extern FPointArray RegularPolygonF(double w, double h, uint c, bool star, double factor, double rota);
extern QPointArray FlattenPath(FPointArray ina, QValueList<uint> &Segs);
extern float xy2Deg(float x, float y);
extern double xy2Deg(double x, double y);
extern void BezierPoints(QPointArray *ar, QPoint n1, QPoint n2, QPoint n3, QPoint n4);
extern void Level2Layer(ScribusDoc *doc, struct Layer *ll, int Level);
 
115,7 → 115,7
{
if (DraggedGroup)
{
float gx, gy, gw, gh;
double gx, gy, gw, gh;
getGroupRectScreen(&gx, &gy, &gw, &gh);
repaint(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw), static_cast<int>(gh));
DraggedGroup = false;
128,7 → 128,7
e->accept(QTextDrag::canDecode(e));
if (QTextDrag::decode(e, text))
{
float gx, gy, gw, gh;
double gx, gy, gw, gh;
QUrl ur(text);
QFileInfo fi = QFileInfo(ur.path());
ScriXmlDoc *ss = new ScriXmlDoc();
160,7 → 160,7
{
if (DraggedGroup)
{
float gx, gy, gw, gh;
double gx, gy, gw, gh;
getGroupRectScreen(&gx, &gy, &gw, &gh);
repaint(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw), static_cast<int>(gh));
GroupX = e->pos().x() / doku->Scale;
294,7 → 294,7
else
{
if (doku->DraggedElem != 0)
{
{
QPopupMenu *pmen = new QPopupMenu();
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
pmen->insertItem(tr("Copy Here"));
366,10 → 366,10
 
void Page::DrawPageMarks(QPaintEvent *e, ScPainter *p, QRect rd)
{
float b;
double b;
if ((rd.width() == 0) || (rd.height() == 0))
return;
float lw = 1.0 / doku->Scale;
double lw = 1.0 / doku->Scale;
p->setZoomFactor(doku->Scale);
QWMatrix ma = p->worldMatrix();
QWMatrix ma2 = p->worldMatrix();
395,13 → 395,13
}
if (doku->Raster)
{
float stx = rd.x()/doku->Scale;
float endx = rd.x()/doku->Scale+e->rect().width()/doku->Scale;
float sty = rd.y()/doku->Scale;
float endy = rd.y()/doku->Scale+e->rect().height()/doku->Scale;
double stx = rd.x()/doku->Scale;
double endx = rd.x()/doku->Scale+e->rect().width()/doku->Scale;
double sty = rd.y()/doku->Scale;
double endy = rd.y()/doku->Scale+e->rect().height()/doku->Scale;
if (doku->Scale > 0.49)
{
float i,start;
double i,start;
i=doku->majorGrid*doku->Scale;
p->setPen(doku->majorColor, lw, SolidLine, FlatCap, MiterJoin);
start=floor(sty/i);
525,10 → 525,10
void Page::setGroupRect()
{
PageItem* b;
float minx = 99999.9;
float miny = 99999.9;
float maxx = -99999.9;
float maxy = -99999.9;
double minx = 99999.9;
double miny = 99999.9;
double maxx = -99999.9;
double maxy = -99999.9;
for (uint gc = 0; gc < SelItem.count(); ++gc)
{
b = SelItem.at(gc);
560,10 → 560,10
GroupSel = true;
}
 
void Page::moveGroup(float x, float y, bool fromMP)
void Page::moveGroup(double x, double y, bool fromMP)
{
PageItem* b;
float gx, gy, gw, gh;
double gx, gy, gw, gh;
if (GroupSel)
getGroupRectScreen(&gx, &gy, &gw, &gh);
for (uint a = 0; a < SelItem.count(); ++a)
575,7 → 575,7
repaint(QRect(static_cast<int>(gx-5), static_cast<int>(gy-5), static_cast<int>(gw+10), static_cast<int>(gh+10)));
}
 
void Page::getGroupRect(float *x, float *y, float *w, float *h)
void Page::getGroupRect(double *x, double *y, double *w, double *h)
{
*x = GroupX;
*y = GroupY;
583,9 → 583,9
*h = GroupH;
}
 
void Page::getGroupRectScreen(float *x, float *y, float *w, float *h)
void Page::getGroupRectScreen(double *x, double *y, double *w, double *h)
{
float sc = doku->Scale;
double sc = doku->Scale;
*x = GroupX*sc;
*y = GroupY*sc;
*w = GroupW*sc;
594,7 → 594,7
 
void Page::paintGroupRect(bool norm)
{
float x, y, w, h;
double x, y, w, h;
getGroupRectScreen(&x, &y, &w, &h);
QPainter pgc;
pgc.begin(this);
711,7 → 711,7
return np;
}
 
void Page::ApplyGuides(float *x, float *y)
void Page::ApplyGuides(double *x, double *y)
{
if (doku->SnapGuides)
{
852,8 → 852,8
b->LocalY = 0;
if ((b->OrigW == 0) || (b->OrigH == 0))
return;
float xs = b->Width / static_cast<float>(b->OrigW);
float ys = b->Height / static_cast<float>(b->OrigH);
double xs = b->Width / static_cast<double>(b->OrigW);
double ys = b->Height / static_cast<double>(b->OrigH);
if (!b->Sizing)
{
fho = b->flippedH;
895,8 → 895,8
QWMatrix ma;
ma.translate(b->Xpos, b->Ypos);
ma.rotate(b->Rot);
float mx = ma.m11() * b->Width + ma.m21() * b->Height + ma.dx();
float my = ma.m22() * b->Height + ma.m12() * b->Width + ma.dy();
double mx = ma.m11() * b->Width + ma.m21() * b->Height + ma.dx();
double my = ma.m22() * b->Height + ma.m12() * b->Width + ma.dy();
MoveItem(newX.x(), newX.y(), b);
b->Rot = xy2Deg(mx - b->Xpos, my - b->Ypos);
b->Width = sqrt(pow(mx - b->Xpos,2)+pow(my - b->Ypos,2));
915,8 → 915,8
QWMatrix ma3;
ma3.translate(b->Xpos, b->Ypos);
ma3.rotate(b->Rot);
float mxc3 = b->Xpos - (ma3.m11() * npv.x() + ma3.m21() * npv.y() + ma3.dx());
float myc3 = b->Ypos - (ma3.m22() * npv.y() + ma3.m12() * npv.x() + ma3.dy());
double mxc3 = b->Xpos - (ma3.m11() * npv.x() + ma3.m21() * npv.y() + ma3.dx());
double myc3 = b->Ypos - (ma3.m22() * npv.y() + ma3.m12() * npv.x() + ma3.dy());
SizeItem(b->Width - newY.x(), b->Height - newY.y(), ite);
MoveItem(-mxc3, -myc3, b);
}
956,11 → 956,11
b->OldH2 = b->Height;
}
else
{
{
if ((b->OldB2 == 0) || (b->OldH2 == 0))
return;
float scx = b->Width / b->OldB2;
float scy = b->Height / b->OldH2;
double scx = b->Width / b->OldB2;
double scy = b->Height / b->OldH2;
QWMatrix ma;
ma.scale(scx, scy);
b->PoLine.map(ma);
975,7 → 975,7
}
}
 
bool Page::SizeItem(float newX, float newY, int ite, bool fromMP, bool DoUpdateClip)
bool Page::SizeItem(double newX, double newY, int ite, bool fromMP, bool DoUpdateClip)
{
QRegion alt, neu;
QPainter p;
1044,7 → 1044,7
{
if (GroupSel)
{
float gx, gy, gh, gw;
double gx, gy, gh, gw;
setGroupRect();
getGroupRect(&gx, &gy, &gw, &gh);
emit ItemGeom(gw, gh);
1053,10 → 1053,10
emit ItemGeom(b->Width, b->Height);
}
emit ItemRadius(b->RadRect);
return true;
return true;
}
 
void Page::MoveItemI(float newX, float newY, int ite)
void Page::MoveItemI(double newX, double newY, int ite)
{
QPainter p;
PageItem *b = Items.at(ite);
1078,17 → 1078,17
else
b->LocalY += newY;
repaint(alt);
emit SetLocalValues(b->LocalScX, b->LocalScY, b->LocalX, b->LocalY);
emit SetLocalValues(b->LocalScX, b->LocalScY, b->LocalX, b->LocalY);
}
 
bool Page::MoveItem(float newX, float newY, PageItem* b, bool fromMP)
bool Page::MoveItem(double newX, double newY, PageItem* b, bool fromMP)
{
QRegion alt;
bool retw = false;
if (b->Locked)
return false;
float oldx = b->Xpos;
float oldy = b->Ypos;
double oldx = b->Xpos;
double oldy = b->Ypos;
if (!Imoved)
{
QPainter p;
1114,7 → 1114,7
{
if (GroupSel)
{
float gx, gy, gh, gw;
double gx, gy, gh, gw;
setGroupRect();
getGroupRect(&gx, &gy, &gw, &gh);
emit ItemPos(gx, gy);
1122,10 → 1122,10
else
emit ItemPos(b->Xpos, b->Ypos);
}
return retw;
return retw;
}
 
void Page::RotateItem(float win, int ite)
void Page::RotateItem(double win, int ite)
{
QRegion alt, neu;
QPainter p;
1144,7 → 1144,7
ma.translate(b->Xpos, b->Ypos);
ma.scale(1, 1);
ma.rotate(b->Rot);
float ro = win-b->Rot;
double ro = win-b->Rot;
b->Rot = win;
switch (doku->RotMode)
{
1166,8 → 1166,8
break;
}
ma.rotate(ro);
float x = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
float y = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
double x = ma.m11() * n.x() + ma.m21() * n.y() + ma.dx();
double y = ma.m22() * n.y() + ma.m12() * n.x() + ma.dy();
MoveItem(x-b->Xpos, y-b->Ypos, b);
}
else
1192,7 → 1192,7
QWMatrix ma;
ma.translate(b->Xpos, b->Ypos);
ma.rotate(b->Rot);
float my = ma.m22() * b->Height + ma.m12() * b->Width + ma.dy();
double my = ma.m22() * b->Height + ma.m12() * b->Width + ma.dy();
if ((YGuides[yg] < (my+doku->GuideRad)) && (YGuides[yg] > (my-doku->GuideRad)))
{
b->Ypos = b->Ypos + YGuides[yg] - my;
1223,7 → 1223,7
QWMatrix ma;
ma.translate(b->Xpos, b->Ypos);
ma.rotate(b->Rot);
float mx = ma.m11() * b->Width + ma.m21() * b->Height + ma.dx();
double mx = ma.m11() * b->Width + ma.m21() * b->Height + ma.dx();
if ((XGuides[xg] < (mx+doku->GuideRad)) && (XGuides[xg] > (mx-doku->GuideRad)))
{
b->Xpos = b->Xpos + XGuides[xg] - mx;
1250,7 → 1250,7
}
 
void Page::sentToLayer(int id)
{
{
int d = pmen3->indexOf(id);
PageItem *b = SelItem.at(0);
b->LayerNr = d;
1307,7 → 1307,7
en = Ende;
an = Start;
}
float stg = (en.y() - an.y()) / static_cast<float>((en.x() - an.x()));
double stg = (en.y() - an.y()) / static_cast<double>((en.x() - an.x()));
for (int a = an.x(); a < en.x(); ++a)
{
if (MArea.contains(QPoint(a, an.y()+qRound((a-an.x())*stg))))
1321,8 → 1321,8
QWMatrix ma;
ma.translate(b->Xpos, b->Ypos);
ma.rotate(b->Rot);
float mxc = b->Xpos - (ma.m11() * npv.x() + ma.m21() * npv.y() + ma.dx());
float myc = b->Ypos - (ma.m22() * npv.y() + ma.m12() * npv.x() + ma.dy());
double mxc = b->Xpos - (ma.m11() * npv.x() + ma.m21() * npv.y() + ma.dx());
double myc = b->Ypos - (ma.m22() * npv.y() + ma.m12() * npv.x() + ma.dy());
MoveItem(-mxc, -myc, b);
}
 
1599,8 → 1599,8
kon = StartInd + 1;
FPoint lxy = Clip.point(ClRe-1);
FPoint lk = Clip.point(ClRe);
float dx = lxy.x() - lk.x();
float dy = lxy.y() - lk.y();
double dx = lxy.x() - lk.x();
double dy = lxy.y() - lk.y();
lk.setX(lk.x() + dx*2);
lk.setY(lk.y() + dy*2);
Clip.setPoint(kon, lk);
1614,8 → 1614,8
kon = ClRe - 2;
FPoint lxy = Clip.point(ClRe-1);
FPoint lk = Clip.point(ClRe);
float dx = lxy.x() - lk.x();
float dy = lxy.y() - lk.y();
double dx = lxy.x() - lk.x();
double dy = lxy.y() - lk.y();
lk.setX(lk.x() + dx*2);
lk.setY(lk.y() + dy*2);
Clip.setPoint(kon, lk);
1681,7 → 1681,7
}
}
 
FPoint Page::transformPointI(FPoint in, float dx, float dy, float rot, float sx, float sy)
FPoint Page::transformPointI(FPoint in, double dx, double dy, double rot, double sx, double sy)
{
QWMatrix ma;
ma.translate(dx, dy);
1688,26 → 1688,26
ma.scale(sx, sy);
ma.rotate(rot);
ma = ma.invert();
float x = ma.m11() * in.x() + ma.m21() * in.y() + ma.dx();
float y = ma.m22() * in.y() + ma.m12() * in.x() + ma.dy();
double x = ma.m11() * in.x() + ma.m21() * in.y() + ma.dx();
double y = ma.m22() * in.y() + ma.m12() * in.x() + ma.dy();
return FPoint(x, y);
}
 
FPoint Page::transformPoint(FPoint in, float dx, float dy, float rot, float sx, float sy)
FPoint Page::transformPoint(FPoint in, double dx, double dy, double rot, double sx, double sy)
{
QWMatrix ma;
ma.translate(dx, dy);
ma.scale(sx, sy);
ma.rotate(rot);
float x = ma.m11() * in.x() + ma.m21() * in.y() + ma.dx();
float y = ma.m22() * in.y() + ma.m12() * in.x() + ma.dy();
double x = ma.m11() * in.x() + ma.m21() * in.y() + ma.dx();
double y = ma.m22() * in.y() + ma.m12() * in.x() + ma.dy();
return FPoint(x, y);
}
 
void Page::scaleGroup(float scx, float scy)
void Page::scaleGroup(double scx, double scy)
{
PageItem *bb;
float gx, gy, gh, gw;
double gx, gy, gh, gw;
uint aa;
getGroupRect(&gx, &gy, &gw, &gh);
for (uint a = 0; a < SelItem.count(); ++a)
1719,7 → 1719,7
bb->OldH2 = bb->Height;
bb->Sizing = false;
FPoint b, b1, t, t1, h, h1, g, tes, tes2;
float oldRot;
double oldRot;
switch (HowTo)
{
case 1:
1742,7 → 1742,7
bb->ISize = QMAX(qRound(bb->ISize*((scx+scy)/2)), 1);
if (bb->Ptext.count() != 0)
{
bb->LineSp = (bb->ISize * static_cast<float>(doku->AutoLine) / 100) + bb->ISize;
bb->LineSp = (bb->ISize * static_cast<double>(doku->AutoLine) / 100) + bb->ISize;
for (aa = 0; aa < bb->Ptext.count(); ++aa)
{
bb->Ptext.at(aa)->csize = QMAX(qRound(bb->Ptext.at(aa)->csize*((scx+scy)/2)), 1);
1767,8 → 1767,8
if (doku->Guides)
{
bool fg = false;
float nx = m->x()/doku->Scale;
float ny = m->y()/doku->Scale;
double nx = m->x()/doku->Scale;
double ny = m->y()/doku->Scale;
if (YGuides.count() != 0)
{
for (uint yg = 0; yg < YGuides.count(); ++yg)
1820,7 → 1820,7
}
if ((doku->EditClip) && (ClRe == -1) && (HaveSelRect))
{
float sc = doku->Scale;
double sc = doku->Scale;
QPainter p;
p.begin(this);
p.setRasterOp(XorROP);
1829,13 → 1829,13
p.end();
if((Mxp*sc) > SeRx)
{
float tmp=SeRx;
double tmp=SeRx;
SeRx=static_cast<int>(Mxp*sc);
Mxp=static_cast<int>(tmp/sc);
}
if((Myp*sc) > SeRy)
{
float tmp=SeRy;
double tmp=SeRy;
SeRy=static_cast<int>(Myp*sc);
Myp=static_cast<int>(tmp/sc);
}
1868,8 → 1868,8
b = SelItem.at(0);
b->OldB2 = b->Width;
b->OldH2 = b->Height;
float nx = m->x()/doku->Scale;
float ny = m->y()/doku->Scale;
double nx = m->x()/doku->Scale;
double ny = m->y()/doku->Scale;
FPoint npg = ApplyGridF(FPoint(nx, ny));
nx = npg.x();
ny = npg.y();
2034,7 → 2034,7
{
if (mCG)
{
float gx, gy, gh, gw, mx, my, scx, scy;
double gx, gy, gh, gw, mx, my, scx, scy;
mx = Mxp;
my = Myp;
getGroupRect(&gx, &gy, &gw, &gh);
2048,8 → 2048,8
if (b->Sizing)
{
FPoint npx;
float nx = m->pos().x()/doku->Scale;
float ny = m->pos().y()/doku->Scale;
double nx = m->pos().x()/doku->Scale;
double ny = m->pos().y()/doku->Scale;
if (doku->SnapGuides)
{
ApplyGuides(&nx, &ny);
2079,8 → 2079,8
{
if (sav)
{
float nx = m->pos().x()/doku->Scale;
float ny = m->pos().y()/doku->Scale;
double nx = m->pos().x()/doku->Scale;
double ny = m->pos().y()/doku->Scale;
if (doku->useRaster)
{
FPoint ra = ApplyGridF(FPoint(nx, ny));
2090,9 → 2090,9
doku->SnapGuides = sav;
ApplyGuides(&nx, &ny);
doku->SnapGuides = false;
float r = atan2(ny - b->Ypos, nx - b->Xpos)*(180.0/3.1415927);
double r = atan2(ny - b->Ypos, nx - b->Xpos)*(180.0/3.1415927);
RotateItem(r, b->ItemNr);
float w = sqrt(pow(nx - b->Xpos, 2) + pow(ny - b->Ypos,2));
double w = sqrt(pow(nx - b->Xpos, 2) + pow(ny - b->Ypos,2));
SizeItem(w, b->Height, b->ItemNr, true);
}
}
2112,8 → 2112,8
{
if (sav)
{
float nx = m->pos().x()/doku->Scale;
float ny = m->pos().y()/doku->Scale;
double nx = m->pos().x()/doku->Scale;
double ny = m->pos().y()/doku->Scale;
if (doku->useRaster)
{
FPoint ra = ApplyGridF(FPoint(nx, ny));
2126,10 → 2126,10
QWMatrix ma;
ma.translate(b->Xpos, b->Ypos);
ma.rotate(b->Rot);
float mx = ma.m11() * b->Width + ma.m21() * b->Height + ma.dx();
float my = ma.m22() * b->Height + ma.m12() * b->Width + ma.dy();
float r = atan2(my-ny,mx-nx)*(180.0/3.1415927);
float w = sqrt(pow(mx-nx,2)+pow(my-ny,2));
double mx = ma.m11() * b->Width + ma.m21() * b->Height + ma.dx();
double my = ma.m22() * b->Height + ma.m12() * b->Width + ma.dy();
double r = atan2(my-ny,mx-nx)*(180.0/3.1415927);
double w = sqrt(pow(mx-nx,2)+pow(my-ny,2));
MoveItem(nx - b->Xpos, ny - b->Ypos, b, true);
SizeItem(w, b->Height, b->ItemNr, true);
RotateItem(r, b->ItemNr);
2211,7 → 2211,7
}
if ((SelItem.count() == 0) && (HaveSelRect) && (!MidButt))
{
float sc = doku->Scale;
double sc = doku->Scale;
QPainter p;
p.begin(this);
p.setRasterOp(XorROP);
2220,13 → 2220,13
p.end();
if((Mxp*sc) > SeRx)
{
float tmp=SeRx;
double tmp=SeRx;
SeRx=static_cast<int>(Mxp*sc);
Mxp=static_cast<int>(tmp/sc);
}
if((Myp*sc) > SeRy)
{
float tmp=SeRy;
double tmp=SeRy;
SeRy=static_cast<int>(Myp*sc);
Myp=static_cast<int>(tmp/sc);
}
2234,7 → 2234,7
if (Items.count() != 0)
{
for (uint a = 0; a < Items.count(); ++a)
{
{
p.begin(this);
Transform(Items.at(a), &p);
QRegion apr = QRegion(p.xForm(Items.at(a)->Clip));
2257,7 → 2257,7
{
setGroupRect();
paintGroupRect();
float x, y, w, h;
double x, y, w, h;
getGroupRect(&x, &y, &w, &h);
emit ItemPos(x, y);
emit ItemGeom(w, h);
2270,21 → 2270,21
{
if (HaveSelRect)
{
float sc = doku->Scale;
double sc = doku->Scale;
if((Mxp*sc) > SeRx)
{
float tmp=SeRx;
double tmp=SeRx;
SeRx=static_cast<int>(Mxp*sc);
Mxp=static_cast<int>(tmp/sc);
}
if((Myp*sc) > SeRy)
{
float tmp=SeRy;
double tmp=SeRy;
SeRy=static_cast<int>(Myp*sc);
Myp=static_cast<int>(tmp/sc);
}
float yf = height() / (SeRy/sc-Myp);
float xf = width() / (SeRx/sc-Mxp);
double yf = height() / (SeRy/sc-Myp);
double xf = width() / (SeRx/sc-Mxp);
doku->Scale = QMIN(yf, xf);
emit ZoomAbs();
emit AbsPosi(Mxp, Myp);
2337,8 → 2337,8
{
FPoint lxy = b->PoLine.point(b->PoLine.size()-2);
FPoint lk = b->PoLine.point(b->PoLine.size()-1);
float dx = lxy.x() - lk.x();
float dy = lxy.y() - lk.y();
double dx = lxy.x() - lk.x();
double dy = lxy.y() - lk.y();
lk.setX(lk.x() + dx*2);
lk.setY(lk.y() + dy*2);
b->PoLine.addPoint(lxy);
2384,7 → 2384,7
void Page::SetYGuide(QMouseEvent *m)
{
QPoint py = mapFromGlobal(m->globalPos());
float newY = py.y() / doku->Scale;
double newY = py.y() / doku->Scale;
if ((newY > 0) && (newY < doku->PageH) && (doku->Guides))
{
YGuides.append(newY);
2397,7 → 2397,7
void Page::SetXGuide(QMouseEvent *m)
{
QPoint py = mapFromGlobal(m->globalPos());
float newY = py.x() / doku->Scale;
double newY = py.x() / doku->Scale;
if ((newY > 0) && (newY < doku->PageB) && (doku->Guides))
{
XGuides.append(newY);
2409,7 → 2409,7
 
void Page::FromHRuler(QMouseEvent *m)
{
float sc = doku->Scale;
double sc = doku->Scale;
int newY;
if (doku->Guides)
{
2431,7 → 2431,7
 
void Page::FromVRuler(QMouseEvent *m)
{
float sc = doku->Scale;
double sc = doku->Scale;
int newY;
if (doku->Guides)
{
2454,7 → 2454,7
void Page::mouseMoveEvent(QMouseEvent *m)
{
int newX, newY, c;
float nx, ny, dx, dy;
double nx, ny, dx, dy;
uint a;
PageItem *b;
QPoint np, np2, mop;
2463,7 → 2463,7
QRect tx;
QPointArray Bez(4);
bool erf = false;
float sc = doku->Scale;
double sc = doku->Scale;
emit MousePos(m->x()/sc, m->y()/sc);
emit Hrule(m->x()+Anz->childX(parentWidget()));
emit Vrule(m->y()+Anz->childY(parentWidget()));
2534,7 → 2534,7
return;
if (Mpressed && (doku->AppMode == 9))
{
float newW = xy2Deg(newX - qRound(RCenter.x()), newY - qRound(RCenter.y()));
double newW = xy2Deg(newX - qRound(RCenter.x()), newY - qRound(RCenter.y()));
RotateItem(b->Rot - (oldW - newW), b->ItemNr);
oldW = newW;
// emit DocChanged();
2732,7 → 2732,7
Imoved = false;
if (GroupSel)
{
float gx, gy, gh, gw;
double gx, gy, gh, gw;
getGroupRect(&gx, &gy, &gw, &gh);
p.begin(this);
switch (HowTo)
2800,7 → 2800,7
else
{
p.begin(this);
float rba = b->Rot;
double rba = b->Rot;
b->Rot = 0;
Transform(b, &p);
np = p.xFormDev(QPoint(m->x(), m->y()));
2830,7 → 2830,7
nx = np.x();
ny = np.y();
p.end();
float sav = doku->SnapGuides;
double sav = doku->SnapGuides;
npf2 = FPoint(nx-Mxp, ny-Myp);
erf = MoveSizeItem(npf, npf, b->ItemNr);
doku->SnapGuides = sav;
2949,7 → 2949,7
if (GroupSel)
{
QRect mpo = QRect(m->x()-doku->GrabRad, m->y()-doku->GrabRad, doku->GrabRad*2, doku->GrabRad*2);
float gx, gy, gh, gw;
double gx, gy, gh, gw;
getGroupRectScreen(&gx, &gy, &gw, &gh);
if (QRect(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw), static_cast<int>(gh)).intersects(mpo))
{
3092,7 → 3092,7
}
p.end();
}
}
}
}
else
{
3151,14 → 3151,14
 
void Page::mousePressEvent(QMouseEvent *m)
{
float sc;
double sc;
bool inText;
uint a;
int z;
float Rxp = 0;
float Ryp = 0;
float Rxpd = 0;
float Rypd = 0;
double Rxp = 0;
double Ryp = 0;
double Rxpd = 0;
double Rypd = 0;
PageItem *b;
PageItem *bb;
QPainter p;
3422,7 → 3422,7
{
if (GroupSel)
{
float gx, gy, gh, gw;
double gx, gy, gh, gw;
getGroupRectScreen(&gx, &gy, &gw, &gh);
if (QRect(static_cast<int>(gx), static_cast<int>(gy), static_cast<int>(gw), static_cast<int>(gh)).intersects(mpo))
{
3436,7 → 3436,7
mCG = true;
}
else
SeleItem(m);
SeleItem(m);
}
else
{
3487,7 → 3487,7
Mpressed = true;
Dxp = Mxp;
Dyp = Mxp;
}
}
break;
case 2:
SeleItem(m);
3880,8 → 3880,8
FPoint Page::GetMinClipF(FPointArray Clip)
{
FPoint np, rp;
float mx = 99999;
float my = 99999;
double mx = 99999;
double my = 99999;
for (uint c = 0; c < Clip.size(); ++c)
{
np = Clip.point(c);
3899,8 → 3899,8
FPoint Page::GetMaxClipF(FPointArray Clip)
{
FPoint np, rp;
float mx = 0;
float my = 0;
double mx = 0;
double my = 0;
for (uint c = 0; c < Clip.size(); ++c)
{
np = Clip.point(c);
3952,7 → 3952,7
bool Page::SeleItemPos(QPoint m)
{
uint a;
float sc = doku->Scale;
double sc = doku->Scale;
QPainter p;
PageItem* b = Items.last();
Mxp = static_cast<int>(m.x()/sc);
4004,7 → 4004,7
bool Page::SeleItem(QMouseEvent *m)
{
uint a;
float sc = doku->Scale;
double sc = doku->Scale;
QPainter p;
QRect tx, mpo;
PageItem* b = Items.last();
4086,7 → 4086,7
{
setGroupRect();
paintGroupRect();
float x, y, w, h;
double x, y, w, h;
getGroupRect(&x, &y, &w, &h);
emit ItemPos(x, y);
emit ItemGeom(w, h);
4220,7 → 4220,7
{
setGroupRect();
paintGroupRect();
float x, y, w, h;
double x, y, w, h;
getGroupRect(&x, &y, &w, &h);
emit ItemPos(x, y);
emit ItemGeom(w, h);
4418,7 → 4418,7
 
void Page::MarkClip(PageItem *b)
{
float x, y;
double x, y;
QPainter p;
FPointArray cli;
QPointArray Bez(4);
4474,7 → 4474,7
QValueList<int>::Iterator itm;
for (itm = SelNode.begin(); itm != SelNode.end(); ++itm)
{
cli.point((*itm), &x, &y);
cli.point((*itm), &x, &y);
p.drawLine(static_cast<int>(x), static_cast<int>(y), static_cast<int>(x), static_cast<int>(y));
}
emit HavePoint(true, MoveSym);
4554,7 → 4554,7
{
QPoint np, np2;
QPointArray cl, cl1, cl2;
float rot;
double rot;
b->Clip.resize(0);
if (b->PoLine.size() < 4)
return;
4649,8 → 4649,8
{
bb = SelItem.at(a);
toDel.append(bb->ItemNr);
float dx = b->Xpos - bb->Xpos;
float dy = b->Ypos - bb->Ypos;
double dx = b->Xpos - bb->Xpos;
double dy = b->Ypos - bb->Ypos;
bb->PoLine.translate(-dx, -dy);
b->PoLine.setMarker();
b->PoLine.putPoints(b->PoLine.size(), bb->PoLine.size(), bb->PoLine);
4672,7 → 4672,7
PageItem *b;
PageItem *bb;
FPointArray pts;
float x, y;
double x, y;
QString chx;
if (SelItem.count() > 0)
{
4708,7 → 4708,7
chx = chx.upper();
}
}
float csi = static_cast<double>(chs) / 10.0;
double csi = static_cast<double>(chs) / 10.0;
uint chr = chx[0].unicode();
QWMatrix chma;
chma.scale(csi, csi);
4746,7 → 4746,7
bb->Clip = FlattenPath(bb->PoLine, bb->Segments);
if (b->Reverse)
{
float wide;
double wide;
if (a < b->Ptext.count()-1)
wide = Cwidth(doku, b->Ptext.at(a)->cfont, chx, b->Ptext.at(a)->csize, b->Ptext.at(a+1)->ch);
else
4804,8 → 4804,8
b->PLineJoin = bb->PLineJoin;
UpdatePolyClip(b);
AdjustItemSize(b);
float dx = bb->Xpos - b->Xpos;
float dy = bb->Ypos - b->Ypos;
double dx = bb->Xpos - b->Xpos;
double dy = bb->Ypos - b->Ypos;
MoveItem(dx, dy, b);
Deselect(true);
SelectItemNr(bb->ItemNr);
4861,7 → 4861,7
{
b->RadRect = QMIN(b->RadRect, QMIN(b->Width,b->Height)/2);
b->PoLine.resize(0);
float rr = fabs(b->RadRect);
double rr = fabs(b->RadRect);
if (b->RadRect > 0)
{
b->PoLine.addPoint(rr, 0);
4973,7 → 4973,7
b->FrameType = 1;
}
 
void Page::ChLineWidth(float w)
void Page::ChLineWidth(double w)
{
uint a;
if (SelItem.count() != 0)
5033,7 → 5033,7
}
}
 
void Page::ChLineSpa(float w)
void Page::ChLineSpa(double w)
{
uint a;
if (SelItem.count() != 0)
5048,7 → 5048,7
}
 
 
void Page::ChLocalXY(float x, float y)
void Page::ChLocalXY(double x, double y)
{
uint a;
PageItem *b;
5064,10 → 5064,10
}
}
 
void Page::ChLocalSc(float x, float y)
void Page::ChLocalSc(double x, double y)
{
uint a;
float oldx, oldy;
double oldx, oldy;
PageItem *b;
if (SelItem.count() != 0)
{
5331,7 → 5331,7
{
for (a = 0; a < SelItem.count(); ++a)
{
b = SelItem.at(a);
b = SelItem.at(a);
b->Shade = sha;
emit ItemFarben(b->Pcolor2, b->Pcolor, b->Shade2, b->Shade);
RefreshItem(b);
5559,7 → 5559,7
}
}
 
void Page::chKerning(float us)
void Page::chKerning(double us)
{
uint a;
uint aa;
5610,7 → 5610,7
doku->CurrFontSize = size;
if (doku->AppMode != 7)
{
b->LineSp = (size * float(doku->AutoLine) / 100) + size;
b->LineSp = (size * static_cast<double>(doku->AutoLine) / 100) + size;
doku->Vorlagen[0].LineSpa = b->LineSp;
emit ItemTextAttr(b->LineSp);
b->ISize = size;
5922,10 → 5922,10
}
if (GroupSel)
{
float x, y, w, h;
double x, y, w, h;
getGroupRectScreen(&x, &y, &w, &h);
SelItem.clear();
GroupSel = false;
GroupSel = false;
repaint(QRect(static_cast<int>(x-5), static_cast<int>(y-5), static_cast<int>(w+10), static_cast<int>(h+10)));
}
else
5941,7 → 5941,7
 
void Page::Deselect(bool prop)
{
float x, y, w, h;
double x, y, w, h;
PageItem* b;
if (doku->ActPage->SelItem.count() != 0)
{
5975,11 → 5975,11
QColor tmp;
if (!loading)
Deselect(true);
float x = Buffer->Xpos;
float y = Buffer->Ypos;
float w = Buffer->Width;
float h = Buffer->Height;
float pw = Buffer->Pwidth;
double x = Buffer->Xpos;
double y = Buffer->Ypos;
double w = Buffer->Width;
double h = Buffer->Height;
double pw = Buffer->Pwidth;
int z = 0;
struct Pti *hg;
switch (Buffer->PType)
6058,7 → 6058,7
it++;
hg->ccolor = *it;
it++;
hg->cextra = (*it).toFloat();
hg->cextra = (*it).toDouble();
it++;
hg->cshade = (*it).toInt();
hg->cselect = false;
6254,7 → 6254,7
b->GrType = Buffer->GrType;
}
if (!loading)
{
{
b->Select = true;
b->Dirty = true;
SelItem.append(b);
6312,14 → 6312,14
}
}
 
void Page::AlignObj(bool xa, bool ya, bool Vth, bool Vtv, float xdisp, float ydisp, int xart, int yart)
void Page::AlignObj(bool xa, bool ya, bool Vth, bool Vtv, double xdisp, double ydisp, int xart, int yart)
{
uint a;
float xp = 999999;
float yp = 999999;
float xm = 0;
float xd, xo;
QPtrList<float> ml;
double xp = 999999;
double yp = 999999;
double xm = 0;
double xd, xo;
QPtrList<double> ml;
QPainter p;
PageItem *b;
ml.setAutoDelete(true);
6336,13 → 6336,13
switch (xart)
{
case 0:
ml.append(new float(QRegion(p.xForm(b->Clip)).boundingRect().x()));
ml.append(new double(QRegion(p.xForm(b->Clip)).boundingRect().x()));
break;
case 1:
ml.append(new float(QRegion(p.xForm(b->Clip)).boundingRect().x()+QRegion(p.xForm(b->Clip)).boundingRect().width() / 2));
ml.append(new double(QRegion(p.xForm(b->Clip)).boundingRect().x()+QRegion(p.xForm(b->Clip)).boundingRect().width() / 2));
break;
case 2:
ml.append(new float(QRegion(p.xForm(b->Clip)).boundingRect().right()));
ml.append(new double(QRegion(p.xForm(b->Clip)).boundingRect().right()));
break;
}
p.end();
6372,7 → 6372,7
b = SelItem.at(a);
p.begin(this);
Transform(b, &p);
ml.append(new float(QRegion(p.xForm(b->Clip)).boundingRect().x()));
ml.append(new double(QRegion(p.xForm(b->Clip)).boundingRect().x()));
p.end();
}
xp = 99999;
6392,7 → 6392,7
b = SelItem.at(a);
p.begin(this);
Transform(b, &p);
ml.append(new float(QRegion(p.xForm(b->Clip)).boundingRect().x()+QRegion(p.xForm(b->Clip)).boundingRect().width() / 2));
ml.append(new double(QRegion(p.xForm(b->Clip)).boundingRect().x()+QRegion(p.xForm(b->Clip)).boundingRect().width() / 2));
p.end();
}
xp = *ml.at(0);
6409,7 → 6409,7
b = SelItem.at(a);
p.begin(this);
Transform(b, &p);
ml.append(new float(QRegion(p.xForm(b->Clip)).boundingRect().right()));
ml.append(new double(QRegion(p.xForm(b->Clip)).boundingRect().right()));
p.end();
}
for (a=0; a<SelItem.count(); ++a)
6437,13 → 6437,13
switch (yart)
{
case 0:
ml.append(new float(QRegion(p.xForm(b->Clip)).boundingRect().y()));
ml.append(new double(QRegion(p.xForm(b->Clip)).boundingRect().y()));
break;
case 1:
ml.append(new float(QRegion(p.xForm(b->Clip)).boundingRect().y()+QRegion(p.xForm(b->Clip)).boundingRect().height() / 2));
ml.append(new double(QRegion(p.xForm(b->Clip)).boundingRect().y()+QRegion(p.xForm(b->Clip)).boundingRect().height() / 2));
break;
case 2:
ml.append(new float(QRegion(p.xForm(b->Clip)).boundingRect().bottom()));
ml.append(new double(QRegion(p.xForm(b->Clip)).boundingRect().bottom()));
break;
}
p.end();
6473,7 → 6473,7
b = SelItem.at(a);
p.begin(this);
Transform(b, &p);
ml.append(new float(QRegion(p.xForm(b->Clip)).boundingRect().y()));
ml.append(new double(QRegion(p.xForm(b->Clip)).boundingRect().y()));
p.end();
}
yp = 99999;
6493,7 → 6493,7
b = SelItem.at(a);
p.begin(this);
Transform(b, &p);
ml.append(new float(QRegion(p.xForm(b->Clip)).boundingRect().y()+QRegion(p.xForm(b->Clip)).boundingRect().height() / 2));
ml.append(new double(QRegion(p.xForm(b->Clip)).boundingRect().y()+QRegion(p.xForm(b->Clip)).boundingRect().height() / 2));
p.end();
}
xp = *ml.at(0);
6510,7 → 6510,7
b = SelItem.at(a);
p.begin(this);
Transform(b, &p);
ml.append(new float(QRegion(p.xForm(b->Clip)).boundingRect().bottom()));
ml.append(new double(QRegion(p.xForm(b->Clip)).boundingRect().bottom()));
p.end();
}
for (a=0; a<SelItem.count(); ++a)
6530,7 → 6530,7
}
 
/** Zeichnet eine Ellipse */
int Page::PaintEllipse(float x, float y, float b, float h, float w, QString fill, QString outline)
int Page::PaintEllipse(double x, double y, double b, double h, double w, QString fill, QString outline)
{
PageItem* ite = new PageItem(this, 6, x, y, b, h, w, fill, outline, doku);
Items.append(ite);
6545,7 → 6545,7
}
 
/** Zeichnet einen Bildrahmen */
int Page::PaintPict(float x, float y, float b, float h)
int Page::PaintPict(double x, double y, double b, double h)
{
PageItem* ite = new PageItem(this, 2, x, y, b, h, 1, doku->DbrushPict, "None", doku);
Items.append(ite);
6564,7 → 6564,7
}
 
/** Zeichnet ein Rechteck */
int Page::PaintRect(float x, float y, float b, float h, float w, QString fill, QString outline)
int Page::PaintRect(double x, double y, double b, double h, double w, QString fill, QString outline)
{
PageItem* ite = new PageItem(this, 6, x, y, b, h, w, fill, outline, doku);
Items.append(ite);
6579,7 → 6579,7
}
 
/** Zeichnet ein Polygon */
int Page::PaintPoly(float x, float y, float b, float h, float w, QString fill, QString outline)
int Page::PaintPoly(double x, double y, double b, double h, double w, QString fill, QString outline)
{
PageItem* ite = new PageItem(this, 6, x, y, b, h, w, fill, outline, doku);
Items.append(ite);
6595,7 → 6595,7
}
 
/** Zeichnet eine Polyline */
int Page::PaintPolyLine(float x, float y, float b, float h, float w, QString fill, QString outline)
int Page::PaintPolyLine(double x, double y, double b, double h, double w, QString fill, QString outline)
{
PageItem* ite = new PageItem(this, 7, x, y, b, h, w, fill, outline, doku);
Items.append(ite);
6610,7 → 6610,7
}
 
/** Zeichnet einen Textrahmen */
int Page::PaintText(float x, float y, float b, float h, float w, QString outline)
int Page::PaintText(double x, double y, double b, double h, double w, QString outline)
{
if (w == 0) { w = 1; }
PageItem* ite = new PageItem(this, 4, x, y, b, h, w, "None", outline, doku);
6623,7 → 6623,7
}
 
/** Zeichnet eine Linie */
int Page::PaintLine(float x, float y, float b, float h, float w, QString outline)
int Page::PaintLine(double x, double y, double b, double h, double w, QString outline)
{
if (w == 0) { w = 1; }
PageItem* ite = new PageItem(this, 5, x, y, b, h, w, "Black", outline, doku);
6636,7 → 6636,7
return ite->ItemNr;
}
 
void Page::insertColor(QString nam, float c, float m, float y, float k)
void Page::insertColor(QString nam, double c, double m, double y, double k)
{
if (!doku->PageColors.contains(nam))
{
6650,7 → 6650,7
QString tmp, dummy, cmd1, cmd2, BBox, FarNam;
QChar tc;
QString oldPr = doku->CMSSettings.DefaultInputProfile;
float x, y, b, h, c, m, k;
double x, y, b, h, c, m, k;
bool found = false;
int ret = -1;
QFileInfo fi = QFileInfo(fn);
6738,12 → 6738,12
FarNam = FarNam.stripWhiteSpace();
FarNam = FarNam.remove(0,1);
FarNam = FarNam.remove(FarNam.length()-1,1);
insertColor(FarNam, c, m, y, k);
insertColor(FarNam, c, m, y, k);
}
}
if (tmp.startsWith("%%EndComments"))
break;
}
}
f.close();
if (found)
{
6844,7 → 6844,7
if(tif)
{
unsigned width, height,size;
float xres, yres;
double xres, yres;
TIFFGetField(tif, TIFFTAG_IMAGEWIDTH, &width);
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &height);
TIFFGetField(tif, TIFFTAG_XRESOLUTION, &xres);
/trunk/Scribus/scribus/scpreview.h
12,7 → 12,7
~ScPreview() {};
QPixmap createPreview(QString data);
void SetFarbe(QColor *tmp, QString farbe, int shad);
void DrawZeichenS(ScPainter *p, float xco, float yco, QString ch, QString ZFo, bool Reverse, int Style, int mode, int Siz);
void DrawZeichenS(ScPainter *p, double xco, double yco, QString ch, QString ZFo, bool Reverse, int Style, int mode, int Siz);
void DrawPoly(QPainter *p, QPointArray pts, QColor BackF, struct CLBuf *OB, bool bitm = false);
QMap<QString,CMYKColor> Farben;
QMap<QString,multiLine> MLineStyles;
/trunk/Scribus/scribus/libpdf/pdflib.cpp
38,7 → 38,7
extern QString MaskToTxt(QImage *im, bool PDF = true);
extern char *toHex( uchar u );
extern QString String2Hex(QString *in, bool lang = true);
extern float Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
extern double Cwidth(ScribusDoc *doc, QString name, QString ch, int Siz, QString ch2 = " ");
#ifdef HAVE_CMS
extern bool CMSuse;
#endif
155,11 → 155,8
KeyGen[31] = 0x7a;
}
 
PDFlib::~PDFlib()
{
}
 
QString PDFlib::FToStr(float c)
QString PDFlib::FToStr(double c)
{
QString cc;
return cc.setNum(c);
283,8 → 280,8
data[dlen++] = 0;
QByteArray step1(16);
step1 = ComputeMD5Sum(&data);
rc4_init(&rc4, (uchar*)step1.data(), QMIN(KeyLen+5, 16));
rc4_encrypt(&rc4, (uchar*)us.data(), (uchar*)ou.data(), tmp.length());
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), QMIN(KeyLen+5, 16));
rc4_encrypt(&rc4, reinterpret_cast<uchar*>(us.data()), reinterpret_cast<uchar*>(ou.data()), tmp.length());
QString uk = "";
for (uint cl = 0; cl < tmp.length(); ++cl)
{
346,8 → 343,8
{
enk[j] = step1[j] ^ rl;
}
rc4_init(&rc4, (uchar*)enk.data(), 16);
rc4_encrypt(&rc4, (uchar*)OwnerKey.data(), (uchar*)OwnerKey.data(), 32);
rc4_init(&rc4, reinterpret_cast<uchar*>(enk.data()), 16);
rc4_encrypt(&rc4, reinterpret_cast<uchar*>(OwnerKey.data()), reinterpret_cast<uchar*>(OwnerKey.data()), 32);
}
}
else
356,8 → 353,8
{
us[a] = uchar(QChar(pw.at(a)));
}
rc4_init(&rc4, (uchar*)step1.data(), 5);
rc4_encrypt(&rc4, (uchar*)us.data(), (uchar*)OwnerKey.data(), 32);
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), 5);
rc4_encrypt(&rc4, reinterpret_cast<uchar*>(us.data()), reinterpret_cast<uchar*>(OwnerKey.data()), 32);
}
return;
}
422,14 → 419,14
{
enk[j] = EncryKey[j] ^ rl;
}
rc4_init(&rc4, (uchar*)enk.data(), 16);
rc4_encrypt(&rc4, (uchar*)UserKey.data(), (uchar*)UserKey.data(), 16);
rc4_init(&rc4, reinterpret_cast<uchar*>(enk.data()), 16);
rc4_encrypt(&rc4, reinterpret_cast<uchar*>(UserKey.data()), reinterpret_cast<uchar*>(UserKey.data()), 16);
}
}
else
{
rc4_init(&rc4, (uchar*)step1.data(), 5);
rc4_encrypt(&rc4, (uchar*)KeyGen.data(), (uchar*)UserKey.data(), 32);
rc4_init(&rc4, reinterpret_cast<uchar*>(step1.data()), 5);
rc4_encrypt(&rc4, reinterpret_cast<uchar*>(KeyGen.data()), reinterpret_cast<uchar*>(UserKey.data()), 32);
}
return;
}
460,10 → 457,7
Bvie = vi;
Options = opts;
UsedFontsP.clear();
if (Options->Articles)
ObjCounter = 9;
else
ObjCounter = 8;
ObjCounter = Options->Articles ? 9 : 8;
if (Options->Version == 12)
{
PutDoc("%PDF-1.3\n");
481,10 → 475,7
if (Options->Version == 12)
PutDoc("/OutputIntents [ "+IToStr(ObjCounter-1)+" 0 R ]\n");
PutDoc("/ViewerPreferences << /PageDirection ");
if (Options->Binding == 0)
PutDoc("/L2R");
else
PutDoc("/R2L");
PutDoc( Options->Binding == 0 ? "/L2R" : "/R2L");
PutDoc(" >>\n>>\nendobj\n");
QString IDg = Datum;
IDg += Options->Datei;
496,10 → 487,7
FileID = ComputeMD5(IDg);
if (Options->Encrypt)
{
if (Options->Version == 14)
KeyLen = 16;
else
KeyLen = 5;
KeyLen = Options->Version == 14 ? 16 : 5;
CalcOwnerKey(Options->PassOwner, Options->PassUser);
CalcUserKey(Options->PassUser, Options->Permissions);
for (uint cl2 = 0; cl2 < 32; ++cl2)
566,10 → 554,7
Encrypt = ObjCounter;
ObjCounter++;
PutDoc("<<\n/Filter /Standard\n");
if (KeyLen > 5)
PutDoc("/R 3\n/V 2\n/Length 128\n");
else
PutDoc("/R 2\n/V 1\n");
PutDoc( KeyLen > 5 ? "/R 3\n/V 2\n/Length 128\n" : "/R 2\n/V 1\n");
PutDoc("/O <"+String2Hex(&ok)+">\n");
PutDoc("/U <"+String2Hex(&uk)+">\n");
PutDoc("/P "+IToStr(Options->Permissions)+"\n>>\nendobj\n");
718,7 → 703,7
uint posi;
for (posi = 6; posi < bb.size(); ++posi)
{
if ((bb[posi] == char(0x80)) && (static_cast<int>(bb[posi+1]) == 2))
if ((bb[posi] == static_cast<char>(0x80)) && (static_cast<int>(bb[posi+1]) == 2))
break;
fon += bb[posi];
}
740,10 → 725,10
int len2 = fon.length()-len1;
for (uint j = posi; j < bb.size(); ++j)
{
if ((bb[j] == char(0x80)) && (static_cast<int>(bb[j+1]) == 3))
if ((bb[j] == static_cast<char>(0x80)) && (static_cast<int>(bb[j+1]) == 3))
break;
if(bb[j]=='\r')
fon +="\n";
if (bb[j] == '\r')
fon += "\n";
else
fon += bb[j];
}
777,10 → 762,8
for (int xx = len1; xx < len2-1; ++xx)
{
tm = fon.at(xx);
if (tm == QChar(13))
if ((tm == QChar(13)) || (tm == QChar(10)))
continue;
if (tm == QChar(10))
continue;
xx++;
count++;
tm += fon.at(xx);
793,10 → 776,8
PutDoc("<<\n/Length "+IToStr(fon2.length()+1)+"\n");
PutDoc("/Length1 "+IToStr(len1+1)+"\n");
PutDoc("/Length2 "+IToStr(count)+"\n");
if (static_cast<int>(fon.length()-len2) == -1)
PutDoc("/Length3 0\n");
else
PutDoc("/Length3 "+IToStr(fon.length()-len2)+"\n");
PutDoc(static_cast<int>(fon.length()-len2) == -1 ? QString("/Length3 0\n") :
"/Length3 "+IToStr(fon.length()-len2)+"\n");
if ((Options->Compress) && (CompAvail))
PutDoc("/Filter /FlateDecode\n");
PutDoc(">>\nstream\n"+EncStream(&fon2, ObjCounter)+"\nendstream\nendobj\n");
901,10 → 882,7
PutDoc("]\n>>\nendobj\n");
StartObj(ObjCounter);
PutDoc("<<\n/Type /Font\n/Subtype ");
if ((fext == "ttf") || (fext == "otf"))
PutDoc("/TrueType\n");
else
PutDoc("/Type1\n");
PutDoc(((fext == "ttf") || (fext == "otf")) ? "/TrueType\n" : "/Type1\n");
PutDoc("/Name /Fo"+IToStr(a)+"S"+IToStr(Fc)+"\n");
PutDoc("/BaseFont /"+AllFonts[it.key()]->RealName()+"\n");
PutDoc("/FirstChar 0\n");
1080,17 → 1058,11
{
case 1:
PutDoc("/S /Blinds\n");
if (Options->PresentVals[PgNr].Dm == 0)
PutDoc("/Dm /H\n");
else
PutDoc("/Dm /V\n");
PutDoc(Options->PresentVals[PgNr].Dm == 0 ? "/Dm /H\n" : "/Dm /V\n");
break;
case 2:
PutDoc("/S /Box\n");
if (Options->PresentVals[PgNr].M == 0)
PutDoc("/M /I\n");
else
PutDoc("/M /O\n");
PutDoc(Options->PresentVals[PgNr].M == 0 ? "/M /I\n" : "/M /O\n");
break;
case 3:
PutDoc("/S /Dissolve\n");
1101,14 → 1073,8
break;
case 5:
PutDoc("/S /Split\n");
if (Options->PresentVals[PgNr].Dm == 0)
PutDoc("/Dm /H\n");
else
PutDoc("/Dm /V\n");
if (Options->PresentVals[PgNr].M == 0)
PutDoc("/M /I\n");
else
PutDoc("/M /O\n");
PutDoc(Options->PresentVals[PgNr].Dm == 0 ? "/Dm /H\n" : "/Dm /V\n");
PutDoc(Options->PresentVals[PgNr].M == 0 ? "/M /I\n" : "/M /O\n");
break;
case 6:
PutDoc("/S /Wipe\n");
1206,8 → 1172,8
PutPage("1 0 0 1 "+FToStr(ite->Xpos)+" "+FToStr(doc->PageH - ite->Ypos)+" cm\n");
if (ite->Rot != 0)
{
float sr = sin(-ite->Rot* 3.1415927 / 180.0);
float cr = cos(-ite->Rot* 3.1415927 / 180.0);
double sr = sin(-ite->Rot* 3.1415927 / 180.0);
double cr = cos(-ite->Rot* 3.1415927 / 180.0);
if ((cr * cr) < 0.001)
cr = 0;
if ((sr * sr) < 0.001)
1221,10 → 1187,7
else
{
PutPage(SetClipPath(ite));
if (ite->Segments.count() != 0)
PutPage("h\nf*\n");
else
PutPage("h\nf\n");
PutPage(ite->Segments.count() != 0 ? "h\nf*\n" : "h\nf\n");
}
}
if ((ite->flippedH % 2) != 0)
1370,8 → 1333,8
PutPage("1 0 0 1 "+FToStr(ite->Xpos)+" "+FToStr(doc->PageH - ite->Ypos)+" cm\n");
if (ite->Rot != 0)
{
float sr = sin(-ite->Rot* 3.1415927 / 180.0);
float cr = cos(-ite->Rot* 3.1415927 / 180.0);
double sr = sin(-ite->Rot* 3.1415927 / 180.0);
double cr = cos(-ite->Rot* 3.1415927 / 180.0);
if ((cr * cr) < 0.001)
cr = 0;
if ((sr * sr) < 0.001)
1387,19 → 1350,11
if (ite->GrType != 0)
PDF_Gradient(ite);
else
{
if (ite->Segments.count() != 0)
PutPage("h\nf*\n");
else
PutPage("h\nf\n");
}
PutPage(ite->Segments.count() != 0 ? "h\nf*\n" : "h\nf\n");
}
PutPage("q\n");
PutPage(SetClipPath(ite));
if (ite->Segments.count() != 0)
PutPage("h\nW*\nn\n");
else
PutPage("h\nW\nn\n");
PutPage(ite->Segments.count() != 0 ? "h\nW*\nn\n" : "h\nW\nn\n");
if ((ite->flippedH % 2) != 0)
PutPage("-1 0 0 1 "+FToStr(ite->Width)+" 0 cm\n");
if ((ite->flippedV % 2) != 0)
1440,12 → 1395,7
if (ite->GrType != 0)
PDF_Gradient(ite);
else
{
if (ite->Segments.count() != 0)
PutPage("h\nf*\n");
else
PutPage("h\nf\n");
}
PutPage(ite->Segments.count() != 0 ? "h\nf*\n" : "h\nf\n");
}
if ((ite->flippedH % 2) != 0)
PutPage("-1 0 0 1 "+FToStr(ite->Width)+" 0 cm\n");
1482,10 → 1432,7
if (ite->Pcolor != "None")
{
PutPage(SetClipPath(ite));
if (ite->Segments.count() != 0)
PutPage("h\nf*\n");
else
PutPage("h\nf\n");
PutPage(ite->Segments.count() != 0 ? "h\nf*\n" : "h\nf\n");
}
}
if ((ite->Pcolor2 != "None") || (ite->NamedLStyle != ""))
1676,8 → 1623,8
{
tmp += "q\n";
tmp += "1 0 0 1 "+FToStr(hl->PtransX)+" "+FToStr(-hl->PtransY)+" cm\n";
float sr = sin(-hl->PRot* 3.1415927 / 180.0);
float cr = cos(-hl->PRot* 3.1415927 / 180.0);
double sr = sin(-hl->PRot* 3.1415927 / 180.0);
double cr = cos(-hl->PRot* 3.1415927 / 180.0);
if ((cr * cr) < 0.001)
cr = 0;
if ((sr * sr) < 0.001)
1775,8 → 1722,8
if (ite->PType == 8)
{
tmp2 += "1 0 0 1 "+FToStr(hl->PtransX)+" "+FToStr(-hl->PtransY)+" cm\n";
float sr = sin(-hl->PRot* 3.1415927 / 180.0);
float cr = cos(-hl->PRot* 3.1415927 / 180.0);
double sr = sin(-hl->PRot* 3.1415927 / 180.0);
double cr = cos(-hl->PRot* 3.1415927 / 180.0);
if ((cr * cr) < 0.001)
cr = 0;
if ((sr * sr) < 0.001)
1785,7 → 1732,7
}
if (ite->Reverse)
{
float wid = Cwidth(doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0);
double wid = Cwidth(doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0);
tmp2 += "1 0 0 1 "+FToStr(hl->xp)+" "+FToStr((hl->yp - tsz) * -1)+" cm\n";
tmp2 += "-1 0 0 1 0 0 cm\n";
tmp2 += "1 0 0 1 "+FToStr(-wid)+" 0 cm\n";
1832,7 → 1779,7
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))))
{
int chs = hl->csize;
float wtr = Cwidth(doc, hl->cfont, chx, chs);
double wtr = Cwidth(doc, hl->cfont, chx, chs);
tmp2 += "1 0 0 1 "+FToStr(wtr / tsz)+" 0 cm\n";
chx = "-";
chr = chx[0].unicode();
1903,7 → 1850,7
if (ite->Reverse)
{
int chs = hl->csize;
float wtr;
double wtr;
if (d < ite->MaxChars-1)
{
QString ctx = ite->Ptext.at(d+1)->ch;
1923,7 → 1870,7
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))))
{
int chs = hl->csize;
float wtr = Cwidth(doc, hl->cfont, chx, chs);
double wtr = Cwidth(doc, hl->cfont, chx, chs);
tmp += "1 0 0 1 "+FToStr(hl->xp+wtr)+" "+FToStr(-hl->yp)+" Tm\n";
chx = "-";
cc = chx[0].unicode();
1939,13 → 1886,13
uint chr = chx[0].unicode();
if ((*doc->AllFonts)[hl->cfont]->CharWidth.contains(chr))
{
float csi = tsz / 10.0;
float wid = Cwidth(doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0);
double csi = tsz / 10.0;
double wid = Cwidth(doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0);
QPixmap pgPix(tsz, static_cast<int>(wid));
ScPainter *painter = new ScPainter(&pgPix, tsz, static_cast<int>(wid));
FPointArray gly = (*doc->AllFonts)[hl->cfont]->GlyphArray[chr].Outlines.copy();
float st = (*doc->AllFonts)[hl->cfont]->underline_pos * tsz;
float Uwid = QMAX((*doc->AllFonts)[hl->cfont]->strokeWidth * tsz, 1);
double st = (*doc->AllFonts)[hl->cfont]->underline_pos * tsz;
double Uwid = QMAX((*doc->AllFonts)[hl->cfont]->strokeWidth * tsz, 1);
painter->setLineWidth(Uwid);
if (gly.size() < 4)
{
1983,9 → 1930,9
}
if (hl->cstyle & 16)
{
float Ulen = Cwidth(doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0);
float Upos = (*doc->AllFonts)[hl->cfont]->strikeout_pos * tsz;
float Uwid = QMAX((*doc->AllFonts)[hl->cfont]->strokeWidth * tsz, 1);
double Ulen = Cwidth(doc, hl->cfont, chx, hl->csize) * (hl->cscale / 100.0);
double Upos = (*doc->AllFonts)[hl->cfont]->strikeout_pos * tsz;
double Uwid = QMAX((*doc->AllFonts)[hl->cfont]->strokeWidth * tsz, 1);
if (hl->ccolor != "None")
{
if (Options->UseRGB)
2029,17 → 1976,15
if (Options->UseRGB)
{
tmpC.getRawRGBColor(&h, &s, &v);
tmpR.setRgb(h, s, v);
tmpR.hsv(&h, &s, &v);
if ((h == s) && (s == v))
{
tmpR.setRgb(h, s, v);
tmpR.hsv(&h, &s, &v);
sneu = 255 - ((255 - v) * Shade / 100);
tmpR.setHsv(h, s, sneu);
}
else
{
tmpR.setRgb(h, s, v);
tmpR.hsv(&h, &s, &v);
sneu = s * Shade / 100;
tmpR.setHsv(h, sneu, v);
}
2054,17 → 1999,16
if (Options->SComp == 3)
{
tmpC.getRawRGBColor(&h, &s, &v);
tmpR.setRgb(h, s, v);
tmpR.hsv(&h, &s, &v);
 
if ((h == s) && (s == v))
{
tmpR.setRgb(h, s, v);
tmpR.hsv(&h, &s, &v);
sneu = 255 - ((255 - v) * Shade / 100);
tmpR.setHsv(h, s, sneu);
}
else
{
tmpR.setRgb(h, s, v);
tmpR.hsv(&h, &s, &v);
sneu = s * Shade / 100;
tmpR.setHsv(h, sneu, v);
}
2147,11 → 2091,11
 
void PDFlib::PDF_Gradient(PageItem *b)
{
float w = b->Width;
float h = -b->Height;
float w2 = w / 2.0;
float h2 = h / 2.0;
float rad = QMIN(w, fabs(h)) / 2.0;
double w = b->Width;
double h = -b->Height;
double w2 = w / 2.0;
double h2 = h / 2.0;
double rad = QMIN(w, fabs(h)) / 2.0;
StartObj(ObjCounter);
QString ShName = ResNam+IToStr(ResCount);
Shadings[ShName] = ObjCounter;
2158,10 → 2102,7
ResCount++;
ObjCounter++;
PutDoc("<<\n");
if (b->GrType == 5)
PutDoc("/ShadingType 3\n");
else
PutDoc("/ShadingType 2\n");
PutDoc(b->GrType == 5 ? "ShadingType 3\n" : "/ShadingType 2\n");
if (Options->UseRGB)
PutDoc("/ColorSpace /DeviceRGB\n");
else
2195,10 → 2136,7
}
PutDoc("/BBox [0 "+FToStr(h)+" "+FToStr(w)+" 0]\n");
PutDoc("/Background ["+SetFarbe(b->Pcolor, b->Shade)+"]\n");
if (b->GrType == 5)
PutDoc("/Extend [true true]\n");
else
PutDoc("/Extend [false false]\n");
PutDoc(b->GrType == 5 ? "/Extend [true true]\n" : "/Extend [false false]\n");
PutDoc("/Function\n<<\n/FunctionType 2\n/Domain [0 1]\n");
if (b->GrType == 5)
{
2213,10 → 2151,7
PutDoc("/N 1\n>>\n>>\nendobj\n");
PutPage("q\n");
PutPage(SetClipPath(b));
if (b->Segments.count() != 0)
PutPage("h\nW* n\n");
else
PutPage("h\nW n\n");
PutPage(b->Segments.count() != 0 ? "h\nW* n\n" : "h\nW n\n");
if (b->GrType == 5)
{
QString sca = FToStr(w2 / rad)+" 0 0 "+FToStr(fabs(h2) / rad)+" ";
2259,10 → 2194,10
ind2PDFabr[11] = "/TiBI";
ind2PDFabr[12] = "/ZaDb";
ind2PDFabr[13] = "/Symb";
float x = ite->Xpos;
float y = doc->PageH - ite->Ypos;
float x2 = ite->Xpos+ite->Width;
float y2 = doc->PageH-ite->Ypos-ite->Height;
double x = ite->Xpos;
double y = doc->PageH - ite->Ypos;
double x2 = ite->Xpos+ite->Width;
double y2 = doc->PageH-ite->Ypos-ite->Height;
for (uint d = 0; d < ite->Ptext.count(); ++d)
{
cc = ite->Ptext.at(d)->ch;
2349,10 → 2284,7
}
PutDoc("\n");
PutDoc("/BS << /Type /Border /W ");
if (ite->AnBColor != "None")
PutDoc(IToStr(ite->AnBwid));
else
PutDoc("0");
PutDoc(ite->AnBColor != "None" ? IToStr(ite->AnBwid) : QString("0"));
PutDoc(" /S /");
switch (ite->AnBsty)
{
2390,7 → 2322,7
cnx += " /"+ICCProfiles[Options->SolidProf].ResName+" CS\n";
if (ite->Pcolor != "None")
cnx += SetFarbe(ite->Pcolor, ite->Shade)+" SCN\n";
if (ite->Pcolor2 != "None")
if (ite->Pcolor2 != "None")
cnx += SetFarbe(ite->Pcolor2, ite->Shade2)+" scn\n";
}
else
2444,10 → 2376,7
break;
case 4:
PutDoc("/FT /Btn\n");
if (ite->AnIsChk)
PutDoc("/V /On\n/DV /On\n/AS /On\n");
else
PutDoc("/V /Off\n/DV /Off\n/AS /Off\n");
PutDoc(ite->AnIsChk ? "/V /On\n/DV /On\n/AS /On\n" : "/V /Off\n/DV /Off\n/AS /Off\n");
PutDoc("/AP << /N << /On "+IToStr(ObjCounter)+" 0 R >> >>\n");
break;
case 5:
2505,19 → 2434,13
if (ite->Pfile2 != "")
{
img = LoadPict(ite->Pfile2);
if (img.hasAlphaBuffer())
IconOb += 3;
else
IconOb += 2;
IconOb += img.hasAlphaBuffer() ? 3 : 2;
PutDoc("/IX "+IToStr(ObjCounter+IconOb-1)+" 0 R ");
}
if (ite->Pfile3 != "")
{
img2 = LoadPict(ite->Pfile3);
if (img2.hasAlphaBuffer())
IconOb += 3;
else
IconOb += 2;
IconOb = img2.hasAlphaBuffer() ? 3 : 2;
PutDoc("/RI "+IToStr(ObjCounter+IconOb-1)+" 0 R ");
}
PutDoc("/TP "+IToStr(ite->AnIPlace)+" ");
2538,10 → 2461,7
break;
}
PutDoc(" /S /");
if (ite->LocalScX != ite->LocalScY)
PutDoc("A");
else
PutDoc("P");
PutDoc(ite->LocalScX != ite->LocalScY ? "A" : "P");
PutDoc(" /A [ ");
if ((ite->Width/ite->LocalScX - ite->pixm.width()) != 0)
PutDoc(FToStr(QMAX(ite->LocalX / (ite->Width/ite->LocalScX - ite->pixm.width()), 0.01)));
2589,10 → 2509,7
if (ite->AnAction != "")
{
PutDoc("/A << /Type /Action /S /JavaScript /JS ");
if (ite->AnType > 2)
PutDoc(IToStr(ObjCounter+1+IconOb));
else
PutDoc(IToStr(ObjCounter+IconOb));
PutDoc(ite->AnType > 2 ? IToStr(ObjCounter+1+IconOb) : IToStr(ObjCounter+IconOb));
PutDoc(" 0 R >>\n");
}
}
2601,27 → 2518,14
if (ite->AnAction != "")
{
PutDoc("/A << /Type /Action /S /JavaScript /JS ");
if (ite->AnType > 2)
PutDoc(IToStr(ObjCounter+1+IconOb));
else
PutDoc(IToStr(ObjCounter+IconOb));
PutDoc(ite->AnType > 2 ? IToStr(ObjCounter+1+IconOb) : IToStr(ObjCounter+IconOb));
PutDoc(" 0 R >>\n");
}
PutDoc("/AA ");
if (ite->AnType > 2)
{
if (ite->AnAction != "")
PutDoc(IToStr(ObjCounter+2+IconOb));
else
PutDoc(IToStr(ObjCounter+1+IconOb));
}
PutDoc(ite->AnAction != "" ? IToStr(ObjCounter+2+IconOb) : IToStr(ObjCounter+1+IconOb));
else
{
if (ite->AnAction != "")
PutDoc(IToStr(ObjCounter+1+IconOb));
else
PutDoc(IToStr(ObjCounter));
}
PutDoc(ite->AnAction != "" ? IToStr(ObjCounter+1+IconOb) : IToStr(ObjCounter));
PutDoc(" 0 R\n");
if (ite->An_C_act != "")
CalcFields.append(ObjCounter-1+IconOb);
2888,7 → 2792,7
AAcoun++;
}
}
PutDoc(">>\nendobj\n");
PutDoc(">>\nendobj\n");
if (ite->An_E_act != "")
WritePDFStream(&ite->An_E_act);
if (ite->An_X_act != "")
2909,7 → 2813,7
WritePDFStream(&ite->An_V_act);
if (ite->An_C_act != "")
WritePDFStream(&ite->An_C_act);
}
}
}
}
 
2926,7 → 2830,7
PutDoc(" >>\nstream\n"+EncStream(&tmp, ObjCounter-1)+"\nendstream\nendobj\n");
}
 
void PDFlib::PDF_xForm(float w, float h, QString im)
void PDFlib::PDF_xForm(double w, double h, QString im)
{
StartObj(ObjCounter);
ObjCounter++;
2980,12 → 2884,12
PutDoc(">>\nstream\n"+EncStream(&im, ObjCounter-1)+"\nendstream\nendobj\n");
}
 
void PDFlib::PDF_Bookmark(int nr, float ypos)
void PDFlib::PDF_Bookmark(int nr, double ypos)
{
Bvie->SetAction(nr, "/XYZ 0 "+FToStr(ypos)+" 0]");
}
 
void PDFlib::PDF_Image(bool inver, QString fn, float sx, float sy, float x, float y, bool fromAN, QString Profil, bool Embedded, int Intent)
void PDFlib::PDF_Image(bool inver, QString fn, double sx, double sy, double x, double y, bool fromAN, QString Profil, bool Embedded, int Intent)
{
QFileInfo fi = QFileInfo(fn);
QString ext = fi.extension(false).lower();
2995,9 → 2899,9
bool found = false;
int ret = -1;
int afl;
float x2, y2, b, h, ax, ay, a2, a1, sxn, syn;
double x2, y2, b, h, ax, ay, a2, a1, sxn, syn;
x2 = 0;
float aufl = Options->Resolution / 72.0;
double aufl = Options->Resolution / 72.0;
#ifdef HAVE_CMS
if ((CMSuse) && (Options->UseProfiles2))
{
3110,7 → 3014,7
}
if (tmp.startsWith("%%EndComments"))
break;
}
}
f.close();
if (found)
{
3145,7 → 3049,7
img = LoadPict(fn);
if (Options->RecalcPic)
{
float afl = QMIN(Options->PicRes, Options->Resolution);
double afl = QMIN(Options->PicRes, Options->Resolution);
a2 = (72.0 / sx) / afl;
a1 = (72.0 / sy) / afl;
ax = img.width() / a2;
/trunk/Scribus/scribus/libpdf/pdflib.h
37,7 → 37,7
 
public:
PDFlib();
~PDFlib();
~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();
56,7 → 56,7
void CalcOwnerKey(QString Owner, QString User);
void CalcUserKey(QString User, int Permission);
QString FitKey(QString pass);
QString FToStr(float c);
QString FToStr(double c);
QString IToStr(int c);
QString setStrokeMulti(struct singleLine *sl);
QString SetClipPath(PageItem *ite);
68,13 → 68,13
void WritePDFStream(QString *cc);
QString PDFEncode(QString in);
QByteArray ComputeMD5(QString in);
void PDF_Bookmark(int nr, float ypos);
void PDF_Bookmark(int nr, double 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);
void PDF_xForm(double w, double h, QString im);
void PDF_Image(bool inver, QString fn, double sx, double sy, double x, double y, bool fromAN = false, QString Profil = "", bool Embedded = false, int Intent = 1);
QString Inhalt;
ScribusDoc* doc;
ScribusView* view;
/trunk/Scribus/scribus/annot.cpp
407,18 → 407,16
MaxChars = new QSpinBox( OptTextFeld, "MaxChars" );
MaxChars->setMinValue(0);
MaxChars->setMaxValue(32768);
bool setter = false;
if (item->AnMaxChar != -1)
{
{
setter = true;
MaxChars->setValue(item->AnMaxChar);
Limit->setChecked(true);
MaxChars->setEnabled(true);
}
}
else
{
MaxChars->setValue(0);
Limit->setChecked(false);
MaxChars->setEnabled(false);
}
Limit->setChecked(setter);
MaxChars->setEnabled(setter);
Layout8->addWidget( MaxChars );
TextLabel2_2 = new QLabel( OptTextFeld, "TextLabel2_2" );
TextLabel2_2->setText( tr( "Characters" ) );
504,10 → 502,8
int tmpac = item->AnActType;
if (item->AnActType < 0)
tmpac = 1;
if (tmpac == 7)
ActionCombo->setCurrentItem(2);
else
ActionCombo->setCurrentItem(tmpac);
ActionCombo->setCurrentItem(tmpac == 7 ? 2 : tmpac);
 
Layout20->addWidget( ActionCombo );
tabLayout_2->addLayout( Layout20 );
 
616,10 → 612,7
GroupBox11Layout->addWidget( TextLabel31, 1, 0 );
SpinBox11 = new QSpinBox( GroupBox11, "SpinBox1" );
SpinBox11->setMinValue(1);
if (item->AnActType == 7)
SpinBox11->setMaxValue(1000);
else
SpinBox11->setMaxValue(Seite);
SpinBox11->setMaxValue(item->AnActType == 7 ? 1000 : Seite);
SpinBox11->setValue(item->AnZiel+1);
GroupBox11Layout->addWidget( SpinBox11, 1, 1 );
if (item->AnActType == 7)
1060,7 → 1053,7
connect(ComboBox1, SIGNAL(activated(int)), this, SLOT(SetZiel(int)));
connect(ActionCombo, SIGNAL(activated(int)), this, SLOT(SetActTyp(int)));
connect(SelAction, SIGNAL(activated(int)), this, SLOT(SetActScript(int)));
connect(Pg1, SIGNAL(Coords(float, float)), this, SLOT(SetCo(float, float)));
connect(Pg1, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
connect(SpinBox11, SIGNAL(valueChanged(int)), this, SLOT(SetPg(int)));
connect(SpinBox21, SIGNAL(valueChanged(int)), this, SLOT(SetCross()));
connect(SpinBox31, SIGNAL(valueChanged(int)), this, SLOT(SetCross()));
1096,7 → 1089,7
connect(LExtern, SIGNAL(clicked()), this, SLOT(SetExternL()));
QToolTip::add(NoSpell, tr( "Flag is ignored for PDF-1.3" ) );
QToolTip::add(NoScroll, tr( "Flag is ignored for PDF-1.3" ) );
QToolTip::add(CalcFields, tr( "Enter a comma separated list of Fields here" ) );
QToolTip::add(CalcFields, tr( "Enter a comma separated list of fields here" ) );
QToolTip::add(IconNR, tr("You need at least the Icon for Normal to use Icons for Buttons"));
SetPg(QMIN(SpinBox11->value(), MaxSeite));
SetCross();
1113,9 → 1106,9
{
int w = item->pixm.width();
int h = item->pixm.height();
float sw = item->Width / w;
float sh = item->Height / h;
float sc = QMIN(sw,sh);
double sw = item->Width / w;
double sh = item->Height / h;
double sc = QMIN(sw,sh);
if (dia->IcScaleH == 0)
{
item->LocalScX = sc;
1160,24 → 1153,19
 
void Annot::IconsEin()
{
bool setter = true;
if (!UseIcons->isChecked())
{
IconN->setEnabled(false);
IconP->setEnabled(false);
IconR->setEnabled(false);
IconNR->setEnabled(false);
IconPR->setEnabled(false);
IconRR->setEnabled(false);
NiconPrev->setEnabled(false);
PiconPrev->setEnabled(false);
RiconPrev->setEnabled(false);
PlaceIcon->setEnabled(false);
}
else
{
IconN->setEnabled(true);
IconP->setEnabled(true);
IconR->setEnabled(true);
setter = false;
IconN->setEnabled(setter);
IconP->setEnabled(setter);
IconR->setEnabled(setter);
 
NiconPrev->setEnabled(setter);
PiconPrev->setEnabled(setter);
RiconPrev->setEnabled(setter);
PlaceIcon->setEnabled(setter);
if (setter == true)
{
if (item->Pfile != "")
IconNR->setEnabled(true);
if (item->Pfile2 != "")
1184,11 → 1172,13
IconPR->setEnabled(true);
if (item->Pfile3 != "")
IconRR->setEnabled(true);
NiconPrev->setEnabled(true);
PiconPrev->setEnabled(true);
RiconPrev->setEnabled(true);
PlaceIcon->setEnabled(true);
}
}
else
{
IconNR->setEnabled(false);
IconPR->setEnabled(false);
IconRR->setEnabled(false);
}
item->AnUseIcons = UseIcons->isChecked();
}
 
1212,9 → 1202,9
item->pixm = im.copy();
int w = im.width();
int h = im.height();
float sw = item->Width / w;
float sh = item->Height / h;
float sc = QMIN(sw,sh);
double sw = item->Width / w;
double sh = item->Height / h;
double sc = QMIN(sw,sh);
item->LocalScX = sc;
item->LocalScY = sc;
item->LocalX = ((item->Width - (w * sc)) / 2) / sc;
1412,29 → 1402,24
if (item->AnFormat == 1)
{
Decim->setValue(pfol[0].toInt());
if (pfol[1].toInt() < 4)
FormNum = pfol[1].toInt();
switch (pfol[1].toInt())
{
case 0:
Format0->setChecked(true);
FormNum = 0;
break;
case 1:
Format1->setChecked(true);
FormNum = 1;
Format1->setChecked(true);;
break;
case 2:
Format2->setChecked(true);
FormNum = 2;
break;
case 3:
Format3->setChecked(true);
FormNum = 3;
break;
}
if (pfol[5] == " true")
PreCurr->setChecked(true);
else
PreCurr->setChecked(false);
PreCurr->setChecked(pfol[5] == " true" ? true : false);
if (pfol[4].length() > 2)
{
if (PreCurr->isChecked())
1455,23 → 1440,21
if (item->AnFormat == 2)
{
Decim2->setValue(pfol[0].toInt());
if (pfol[1].toInt() < 4)
FormNum = pfol[1].toInt();
switch (pfol[1].toInt())
{
case 0:
Format0a->setChecked(true);
FormNum = 0;
break;
case 1:
Format1a->setChecked(true);
FormNum = 1;
break;
case 2:
Format2a->setChecked(true);
FormNum = 2;
break;
case 3:
Format3a->setChecked(true);
FormNum = 3;
break;
}
}
1482,23 → 1465,21
}
if (item->AnFormat == 4)
{
if (pfol[0].toInt() < 4)
FormNum = pfol[0].toInt();
switch (pfol[0].toInt())
{
case 0:
Format0b->setChecked(true);
FormNum = 0;
break;
case 1:
Format1b->setChecked(true);
FormNum = 1;
break;
case 2:
Format2b->setChecked(true);
FormNum = 2;
break;
case 3:
Format3b->setChecked(true);
FormNum = 3;
break;
}
}
1543,14 → 1524,12
 
void Annot::HandleVali()
{
MaxValid->setEnabled(false);
MinValid->setEnabled(false);
bool setter = false;
if (SimpleValid->isChecked())
setter = true;
MaxValid->setEnabled(setter);
MinValid->setEnabled(setter);
EditValScript->setEnabled(false);
if (SimpleValid->isChecked())
{
MaxValid->setEnabled(true);
MinValid->setEnabled(true);
}
if (CustomValid->isChecked())
EditValScript->setEnabled(true);
}
1583,16 → 1562,11
 
void Annot::HandleCalc()
{
CalcFields->setEnabled(false);
CalcArt->setEnabled(false);
bool setter = SimpleCalc->isChecked() ? true : false;
CalcFields->setEnabled(setter);
CalcArt->setEnabled(setter);
EditCalc->setEnabled(false);
SeField->setEnabled(false);
if (SimpleCalc->isChecked())
{
CalcFields->setEnabled(true);
CalcArt->setEnabled(true);
SeField->setEnabled(true);
}
SeField->setEnabled(setter);
if (CustomCalc->isChecked())
EditCalc->setEnabled(true);
}
1626,16 → 1600,9
 
void Annot::SetCurr()
{
if (UseCurr->isChecked())
{
CurSym->setEnabled(true);
PreCurr->setEnabled(true);
}
else
{
CurSym->setEnabled(false);
PreCurr->setEnabled(false);
}
bool setter = UseCurr->isChecked() ? true : false;
CurSym->setEnabled(setter);
PreCurr->setEnabled(setter);
}
 
void Annot::SetFoScript(int it)
1669,7 → 1636,7
item->AnFormat = it;
}
 
void Annot::SetCo(float x, float y)
void Annot::SetCo(double x, double y)
{
SpinBox21->setValue(static_cast<int>(x*Breite));
SpinBox31->setValue(static_cast<int>(y*Hoehe));
1705,11 → 1672,11
void Annot::SetCross()
{
int x,y;
disconnect(Pg1, SIGNAL(Coords(float, float)), this, SLOT(SetCo(float, float)));
x = static_cast<int>(static_cast<float>(SpinBox21->value())/static_cast<float>(Breite)*Pg1->pmx.width());
y = static_cast<int>(static_cast<float>(SpinBox31->value())/static_cast<float>(Hoehe)*Pg1->pmx.height());
disconnect(Pg1, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
x = static_cast<int>(static_cast<double>(SpinBox21->value())/static_cast<double>(Breite)*Pg1->pmx.width());
y = static_cast<int>(static_cast<double>(SpinBox31->value())/static_cast<double>(Hoehe)*Pg1->pmx.height());
Pg1->drawMark(x, y);
connect(Pg1, SIGNAL(Coords(float, float)), this, SLOT(SetCo(float, float)));
connect(Pg1, SIGNAL(Coords(double, double)), this, SLOT(SetCo(double, double)));
}
 
void Annot::SetVals()
1917,24 → 1884,10
item->AnAction = SubURLa->text().stripWhiteSpace();
break;
}
if (item->An_E_act != "")
if (item->An_E_act != "" || item->An_X_act != "" || item->An_D_act != "" ||
item->An_Fo_act != "" || item->An_Bl_act != "" || item->An_K_act != "" ||
item->An_F_act != "" || item->An_V_act != "" || item->An_C_act != "")
AAct = true;
if (item->An_X_act != "")
AAct = true;
if (item->An_D_act != "")
AAct = true;
if (item->An_Fo_act != "")
AAct = true;
if (item->An_Bl_act != "")
AAct = true;
if (item->An_K_act != "")
AAct = true;
if (item->An_F_act != "")
AAct = true;
if (item->An_V_act != "")
AAct = true;
if (item->An_C_act != "")
AAct = true;
if (AAct)
item->AnAAact = true;
else
1962,6 → 1915,7
SelAction->insertItem( tr( "Mouse Exit" ) );
SelAction->insertItem( tr( "On Focus" ) );
SelAction->insertItem( tr( "On Blur" ) );
bool setter;
switch (sela)
{
case 2:
1981,16 → 1935,9
ActionCombo->insertItem( tr( "Reset Form" ) );
ActionCombo->insertItem( tr( "Import Data" ) );
ActionCombo->setCurrentItem(QMIN(tmpac,5));
if (item->AnActType != 7)
{
Destfile->setEnabled(false);
ChFile->setEnabled(false);
}
else
{
Destfile->setEnabled(true);
ChFile->setEnabled(true);
}
setter = item->AnActType != 7 ? true : false;
Destfile->setEnabled(setter);
ChFile->setEnabled(setter);
SetActTyp(tmpac);
break;
case 3:
2033,18 → 1980,10
NoScroll->setChecked(item->AnFlag & 8388608);
ChkStil->setCurrentItem(item->AnChkStil);
isChkd->setChecked(item->AnIsChk);
if (item->AnMaxChar != -1)
{
MaxChars->setValue(item->AnMaxChar);
Limit->setChecked(true);
MaxChars->setEnabled(true);
}
else
{
MaxChars->setValue(0);
Limit->setChecked(false);
MaxChars->setEnabled(false);
}
setter = item->AnMaxChar != -1 ? true : false;
MaxChars->setValue(setter == true ? item->AnMaxChar : 0);
Limit->setChecked(setter);
MaxChars->setEnabled(setter);
connect(ActionCombo, SIGNAL(activated(int)), this, SLOT(SetActTyp(int)));
connect(TxFormat, SIGNAL(activated(int)), this, SLOT(SetFoScript(int)));
}
2070,9 → 2009,8
Destfile->setEnabled(true);
ChFile->setEnabled(true);
if (Destfile->text() == "")
{
GetFile();
if (Destfile->text() == "")
{
item->AnActType = 2;
Destfile->setEnabled(false);
ChFile->setEnabled(false);
2085,6 → 2023,7
 
void Annot::SetActTyp(int it)
{
bool setter;
switch (it)
{
case 5:
2098,16 → 2037,9
break;
case 2:
Fram2->raiseWidget(3);
if (item->AnActType != 7)
{
Destfile->setEnabled(false);
ChFile->setEnabled(false);
}
else
{
Destfile->setEnabled(true);
ChFile->setEnabled(true);
}
setter = item->AnActType != 7 ? true : false;
Destfile->setEnabled(setter);
ChFile->setEnabled(setter);
SetPg(QMIN(SpinBox11->value(), MaxSeite));
break;
case 1:
/trunk/Scribus/scribus/scribus.h
81,7 → 81,7
void initStatusBar();
void SetShortCut();
void SetKeyEntry(int Nr, QString text, int Men, int KeyC);
bool doFileNew(float b, float h, float tpr, float lr, float rr, float br, float ab, float sp,
bool doFileNew(double b, double h, double tpr, double lr, double rr, double br, double ab, double sp,
bool atf, bool fp, int einh, bool firstleft, int Ori, int SNr);
bool DoFileSave(QString fn);
void closeEvent(QCloseEvent *ce);
117,8 → 117,8
ProfilesL MonitorProfiles;
ProfilesL PrinterProfiles;
ProfilesL PDFXProfiles;
float DispX;
float DispY;
double DispX;
double DispY;
QTimer *CurTimer;
bool NoFonts;
int HaveDoc;
164,9 → 164,9
void StoreBookmarks();
void ReadPrefs();
void ManageGuides();
void SetTranspar(float t);
void SetTransparS(float t);
void ReportMP(float xp, float yp);
void SetTranspar(double t);
void SetTransparS(double t);
void ReportMP(double xp, double yp);
bool DoFileClose();
void DoSaveClose();
void windowsMenuAboutToShow();
244,7 → 244,7
void MovePage();
void CopyPage();
/** Ansicht absolut zoomen */
void slotZoomAbs(float z);
void slotZoomAbs(double z);
/** Ansicht ganzes Blatt) */
void slotZoomFit();
/** Ansicht 20 % */
340,7 → 340,7
bool SetupDoc();
/** Richtet Objekte aus */
void ObjektAlign();
void DoAlign(bool xa, bool ya, bool Vth, bool Vtv, float xdp, float ydp, int xart, int yart);
void DoAlign(bool xa, bool ya, bool Vth, bool Vtv, double xdp, double ydp, int xart, int yart);
void GetAllFonts();
void BuildFontMenu();
void slotFontOrg();
378,11 → 378,11
signals:
void TextISize(int);
void TextIFont(QString);
void TextUSval(float);
void TextUSval(double);
void TextStil(int);
void TextFarben(QString, QString, int, int);
void TextScale(int);
 
private:
 
/** file_menu contains all items of the menubar entry "File" */
492,8 → 492,8
QPopupMenu *extraMenu;
QPopupMenu *importMenu;
QPopupMenu *exportMenu;
float mm2pts(int mm);
float pts2mm(float pts);
double mm2pts(int mm);
double pts2mm(double pts);
QMap<int,QString> FontID;
int HaveGS;
void *PSDriver;
/trunk/Scribus/scribus/reformdoc.cpp
1,9 → 1,9
#include "reformdoc.h"
#include "reformdoc.moc"
extern QPixmap loadIcon(QString nam);
extern float UmReFaktor;
extern double UmReFaktor;
 
ReformDoc::ReformDoc( QWidget* parent, float t, float l, float r, float b, float Pagebr, float Pageho, bool fp, bool fpe, int Einh)
ReformDoc::ReformDoc( QWidget* parent, double t, double l, double r, double b, double Pagebr, double Pageho, bool fp, bool fpe, int Einh)
: QDialog( parent, "r", true, 0 )
{
QString ein;
/trunk/Scribus/scribus/vgradient.h
39,12 → 39,12
QColor color;
 
// relative position of color point (0.0-1.0):
float rampPoint;
double rampPoint;
 
// relative position of midpoint (0.0-1.0)
// between two ramp points. ignored for last VColorStop.
float midPoint;
float opacity;
double midPoint;
double opacity;
friend inline bool operator== ( VColorStop& s1, VColorStop& s2 )
{ return s1.rampPoint == s2.rampPoint; };
}; // VColorStop
87,7 → 87,7
 
const QPtrVector<VColorStop> colorStops() const;
void addStop( const VColorStop& colorStop );
void addStop( const QColor &color, float rampPoint, float midPoint, float opa );
void addStop( const QColor &color, double rampPoint, double midPoint, double opa );
void removeStop( const VColorStop& colorStop );
void clearStops();
uint Stops() { return m_colorStops.count(); }
/trunk/Scribus/scribus/frameedit.cpp
3,7 → 3,7
#include "page.h"
 
extern QPixmap loadIcon(QString nam);
extern float UmReFaktor;
extern double UmReFaktor;
 
NodePalette::NodePalette( QWidget* parent)
: QDialog( parent, "Npal", false, WStyle_Customize | WStyle_DialogBorder)
11,7 → 11,7
// resize( 155, 165 );
setCaption( tr( "Nodes" ) );
setIcon(loadIcon("AppIcon.xpm"));
NodePaletteLayout = new QVBoxLayout( this );
NodePaletteLayout = new QVBoxLayout( this );
NodePaletteLayout->setSpacing( 2 );
NodePaletteLayout->setMargin( 5 );
 
256,6 → 256,7
 
void NodePalette::PolyStatus(int typ, uint size)
{
bool setter;
switch (typ)
{
case 6:
263,16 → 264,9
BezierClose->setEnabled(false);
break;
case 7:
if (size > 7)
{
BezierClose->setEnabled(true);
PolySplit->setEnabled(true);
}
else
{
BezierClose->setEnabled(false);
PolySplit->setEnabled(false);
}
setter = size > 7 ? true : false;
BezierClose->setEnabled(setter);
PolySplit->setEnabled(setter);
break;
default:
BezierClose->setEnabled(false);
354,7 → 348,7
doc->ActPage->MoveSym = false;
}
 
void NodePalette::SetXY(float x, float y)
void NodePalette::SetXY(double x, double y)
{
disconnect(XSpin, SIGNAL(valueChanged(int)), this, SLOT(MovePoint()));
disconnect(YSpin, SIGNAL(valueChanged(int)), this, SLOT(MovePoint()));
366,22 → 360,21
 
void NodePalette::HaveNode(bool have, bool mov)
{
if (have)
{
XSpin->setEnabled(true);
YSpin->setEnabled(true);
bool setter = have ? true : false;
XSpin->setEnabled(setter);
YSpin->setEnabled(setter);
if (setter == true)
{
if (doc->ActPage->EdPoints)
ResNode->setEnabled(true);
ResNode->setEnabled(setter);
else
Res1Node->setEnabled(true);
}
Res1Node->setEnabled(setter);
}
else
{
XSpin->setEnabled(false);
YSpin->setEnabled(false);
ResNode->setEnabled(false);
Res1Node->setEnabled(false);
}
{
ResNode->setEnabled(setter);
Res1Node->setEnabled(setter);
}
disconnect(AsymMove, SIGNAL(clicked()), this, SLOT(SetAsym()));
disconnect(SymMove, SIGNAL(clicked()), this, SLOT(SetSym()));
if (mov)
/trunk/Scribus/scribus/cmykfw.cpp
58,7 → 58,7
ComboBox1->setEditable(false);
ComboBox1->insertItem( tr( "CMYK" ) );
ComboBox1->insertItem( tr( "RGB" ) );
ComboBox1->insertItem( tr( "Websave RGB" ) );
ComboBox1->insertItem( tr( "Web Safe RGB" ) );
ComboBox1->setMinimumSize( QSize( 200, 22 ) );
Layout23->addWidget( ComboBox1 );
QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
314,10 → 314,11
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
int px = pmen->insertItem(tr("Dynamic Color Bars"), this, SLOT(ToggleSL()));
int py = pmen->insertItem(tr("Static Color Bars"), this, SLOT(ToggleSL()));
if (dynamic)
pmen->setItemChecked((dynamic ? px : py) , true);
/*if (dynamic)
pmen->setItemChecked(px, true);
else
pmen->setItemChecked(py, true);
pmen->setItemChecked(py, true);*/
pmen->exec(QCursor::pos());
delete pmen;
}
/trunk/Scribus/scribus/scribusdoc.cpp
162,7 → 162,7
return modified;
}
/** Setzt die Seitenattribute */
void ScribusDoc::setPage(float b, float h, float t, float l, float r, float bo, float sp, float ab, bool atf, bool fp)
void ScribusDoc::setPage(double b, double h, double t, double l, double r, double bo, double sp, double ab, bool atf, bool fp)
{
PageB = b;
PageH = h;
176,7 → 176,7
PageAT = atf;
}
 
void ScribusDoc::resetPage(float t, float l, float r, float bo, bool fp)
void ScribusDoc::resetPage(double t, double l, double r, double bo, bool fp)
{
PageM.Top = t;
PageM.Left = l;
/trunk/Scribus/scribus/cpalette.h
82,10 → 82,10
void setActGradient(QString p, QString b, int shp, int shb, int typ);
int SetMen(int c);
void setActShade(int);
void setActTrans(float, float);
void setActTrans(double, double);
void slotTrans(int val);
void UseTrans(bool b);
 
signals:
void NewPen(QString);
void NewBrush(QString);
92,8 → 92,8
void NewPenShade(int);
void NewBrushShade(int);
void NewGradient(int, QString, int, QString, int);
void NewTrans(float);
void NewTransS(float);
void NewTrans(double);
void NewTransS(double);
void QueryItem();
protected:
/trunk/Scribus/scribus/scpreview.cpp
12,10 → 12,10
#include <cmath>
#include <cstdlib>
#include "missing.h"
extern float QStoFloat(QString in);
extern double QStodouble(QString in);
extern int QStoInt(QString in);
extern QString GetAttr(QDomElement *el, QString at, QString def="0");
extern float xy2Deg(float x, float y);
extern double xy2Deg(double x, double y);
extern QPointArray FlattenPath(FPointArray ina, QValueList<uint> &Segs);
extern QImage LoadPict(QString fn);
 
39,7 → 39,7
QMap<QString,QFont> DoFonts2;
QString tmpf, tmpx, tmp2, tmp3;
int x, y;
float xf, yf, asce;
double xf, yf, asce;
QPainter pm;
QPainter pb;
QPainter pd;
52,7 → 52,7
QColor tmpfa;
QString chx;
uint a, zae;
float CurY, EndX, CurX, wide, rota, wid;
double CurY, EndX, CurX, wide, rota, wid;
QDomDocument docu("scridoc");
docu.setContent(data);
QDomElement elem=docu.documentElement();
61,11 → 61,11
QPixmap tmp = QPixmap(0, 0);
return tmp;
}
float GrX = QStoFloat(elem.attribute("XP"));
float GrY = QStoFloat(elem.attribute("YP"));
float GrW = QStoFloat(elem.attribute("W"));
float GrH = QStoFloat(elem.attribute("H"));
float pmmax = Prefs->PSize / QMAX(GrW+30, GrH+30);
double GrX = QStodouble(elem.attribute("XP"));
double GrY = QStodouble(elem.attribute("YP"));
double GrW = QStodouble(elem.attribute("W"));
double GrH = QStodouble(elem.attribute("H"));
double pmmax = Prefs->PSize / QMAX(GrW+30, GrH+30);
QPixmap tmp = QPixmap(static_cast<int>(GrW)+30, static_cast<int>(GrH)+30);
ScPainter *pS = new ScPainter(&tmp, tmp.width(), tmp.height());
pS->translate(15,15);
124,7 → 124,7
sl.LineEnd = QStoInt(MuL.attribute("LineEnd"));
sl.LineJoin = QStoInt(MuL.attribute("LineJoin"));
sl.Shade = QStoInt(MuL.attribute("Shade"));
sl.Width = QStoFloat(MuL.attribute("Width"));
sl.Width = QStodouble(MuL.attribute("Width"));
ml.push_back(sl);
MuLn = MuLn.nextSibling();
}
143,14 → 143,14
QDir::setCurrent(QString(getenv("HOME")));
Segments.clear();
OB.PType = QStoInt(pg.attribute("PTYPE"));
OB.Xpos = QStoFloat(pg.attribute("XPOS")) - GrX;
OB.Ypos = QStoFloat(pg.attribute("YPOS")) - GrY;
OB.Width = QStoFloat(pg.attribute("WIDTH"));
OB.Height = QStoFloat(pg.attribute("HEIGHT"));
OB.RadRect = QStoFloat(pg.attribute("RADRECT","0"));
OB.Xpos = QStodouble(pg.attribute("XPOS")) - GrX;
OB.Ypos = QStodouble(pg.attribute("YPOS")) - GrY;
OB.Width = QStodouble(pg.attribute("WIDTH"));
OB.Height = QStodouble(pg.attribute("HEIGHT"));
OB.RadRect = QStodouble(pg.attribute("RADRECT","0"));
OB.ClipEdited = QStoInt(pg.attribute("CLIPEDIT", "0"));
OB.FrameType = QStoInt(pg.attribute("FRTYPE", "0"));
OB.Pwidth = QStoFloat(pg.attribute("PWIDTH"));
OB.Pwidth = QStodouble(pg.attribute("PWIDTH"));
OB.Pcolor = pg.attribute("PCOLOR");
OB.Pcolor2 = pg.attribute("PCOLOR2");
OB.NamedLStyle = pg.attribute("NAMEDLST", "");
169,23 → 169,23
OB.GrShade = QStoInt(pg.attribute("GRSHADE","100"));
OB.GrShade2 = QStoInt(pg.attribute("GRSHADE2","100"));
OB.GrType = QStoInt(pg.attribute("GRTYP","0"));
OB.Rot = QStoFloat(pg.attribute("ROT"));
OB.Rot = QStodouble(pg.attribute("ROT"));
OB.PLineArt = Qt::PenStyle(QStoInt(pg.attribute("PLINEART")));
OB.PLineEnd = Qt::PenCapStyle(QStoInt(pg.attribute("PLINEEND","0")));
OB.PLineJoin = Qt::PenJoinStyle(QStoInt(pg.attribute("PLINEJOIN","0")));
OB.LineSp = QStoFloat(pg.attribute("LINESP"));
OB.ExtraV = QStoFloat(pg.attribute("EXTRAV","0"));
OB.LocalScX = QStoFloat(pg.attribute("LOCALSCX"));
OB.LocalScY = QStoFloat(pg.attribute("LOCALSCY"));
OB.LocalX = QStoFloat(pg.attribute("LOCALX"));
OB.LocalY = QStoFloat(pg.attribute("LOCALY"));
OB.LineSp = QStodouble(pg.attribute("LINESP"));
OB.ExtraV = QStodouble(pg.attribute("EXTRAV","0"));
OB.LocalScX = QStodouble(pg.attribute("LOCALSCX"));
OB.LocalScY = QStodouble(pg.attribute("LOCALSCY"));
OB.LocalX = QStodouble(pg.attribute("LOCALX"));
OB.LocalY = QStodouble(pg.attribute("LOCALY"));
OB.PicArt = QStoInt(pg.attribute("PICART"));
OB.flippedH = QStoInt(pg.attribute("FLIPPEDH"));
OB.flippedV = QStoInt(pg.attribute("FLIPPEDV"));
OB.ScaleType = QStoInt(pg.attribute("SCALETYPE","1"));
OB.AspectRatio = QStoInt(pg.attribute("RATIO","0"));
OB.BBoxX = QStoFloat(pg.attribute("BBOXX"));
OB.BBoxH = QStoFloat(pg.attribute("BBOXH"));
OB.BBoxX = QStodouble(pg.attribute("BBOXX"));
OB.BBoxH = QStodouble(pg.attribute("BBOXH"));
OB.isPrintable = QStoInt(pg.attribute("PRINTABLE"));
OB.isBookmark = false;
OB.BMnr = 0;
194,12 → 194,12
OB.Pcolor = "None";
OB.Textflow = QStoInt(pg.attribute("TEXTFLOW"));
OB.Textflow2 = QStoInt(pg.attribute("TEXTFLOW2","0"));
OB.Extra = QStoFloat(pg.attribute("EXTRA"));
OB.TExtra = QStoFloat(pg.attribute("TEXTRA", "1"));
OB.BExtra = QStoFloat(pg.attribute("BEXTRA", "1"));
OB.RExtra = QStoFloat(pg.attribute("REXTRA", "1"));
OB.Extra = QStodouble(pg.attribute("EXTRA"));
OB.TExtra = QStodouble(pg.attribute("TEXTRA", "1"));
OB.BExtra = QStodouble(pg.attribute("BEXTRA", "1"));
OB.RExtra = QStodouble(pg.attribute("REXTRA", "1"));
OB.PoShow = QStoInt(pg.attribute("PTLSHOW","0"));
OB.BaseOffs = QStoFloat(pg.attribute("BASEOF","0"));
OB.BaseOffs = QStodouble(pg.attribute("BASEOF","0"));
OB.Ausrich = QStoInt(pg.attribute("ALIGN","0"));
OB.IFont = DoFonts[pg.attribute("IFONT")];
OB.ISize = QStoInt(pg.attribute("ISIZE","12"));
213,9 → 213,9
OB.Locked = static_cast<bool>(QStoInt(pg.attribute("LOCK","0")));
OB.Reverse = static_cast<bool>(QStoInt(pg.attribute("REVERS","0")));
OB.InvPict = static_cast<bool>(QStoInt(pg.attribute("INVERS","0")));
OB.Transparency = QStoFloat(pg.attribute("TransValue","0.0"));
OB.Transparency = QStodouble(pg.attribute("TransValue","0.0"));
if (pg.hasAttribute("TransValueS"))
OB.TranspStroke = QStoFloat(pg.attribute("TransValueS","0.0"));
OB.TranspStroke = QStodouble(pg.attribute("TransValueS","0.0"));
else
OB.TranspStroke = OB.Transparency;
if (pg.hasAttribute("NUMCLIP"))
764,7 → 764,7
}
}
 
void ScPreview::DrawZeichenS(ScPainter *p, float xco, float yco, QString ch, QString ZFo, bool Reverse, int Style, int mod, int Siz)
void ScPreview::DrawZeichenS(ScPainter *p, double xco, double yco, QString ch, QString ZFo, bool Reverse, int Style, int mod, int Siz)
{
if (mod == 0)
return;
771,8 → 771,8
QString ccx = ch;
if (ccx == QChar(29))
ccx = " ";
float wide;
float csi = static_cast<double>(Siz) / 10.0;
double wide;
double csi = static_cast<double>(Siz) / 10.0;
uint chr = ccx[0].unicode();
if (Prefs->AvailFonts[ZFo]->CharWidth.contains(chr))
{
807,13 → 807,13
}
if (Style & 16)
{
float st = Prefs->AvailFonts[ZFo]->strikeout_pos * Siz;
double st = Prefs->AvailFonts[ZFo]->strikeout_pos * Siz;
p->setLineWidth(QMAX(Prefs->AvailFonts[ZFo]->strokeWidth * Siz, 1));
p->drawLine(FPoint(xco, yco-st), FPoint(xco+wide, yco-st));
}
if (Style & 8)
{
float st = Prefs->AvailFonts[ZFo]->underline_pos * Siz;
double st = Prefs->AvailFonts[ZFo]->underline_pos * Siz;
QString dummy;
p->setLineWidth(QMAX(Prefs->AvailFonts[ZFo]->strokeWidth * Siz, 1));
if (gly.size() > 4)
/trunk/Scribus/scribus/editformats.cpp
89,7 → 89,7
sty.FontSize = TempVorl[sFnumber].FontSize;
TempVorl.append(sty);
sFnumber = TempVorl.count()-1;
EditStyle* dia2 = new EditStyle(this, &TempVorl[sFnumber], TempVorl, true, fon, static_cast<float>(Docu->AutoLine));
EditStyle* dia2 = new EditStyle(this, &TempVorl[sFnumber], TempVorl, true, fon, static_cast<double>(Docu->AutoLine));
if (!dia2->exec())
TempVorl.remove(TempVorl.fromLast());
delete dia2;
100,7 → 100,7
{
struct StVorL sty;
sty.Vname = tr("New Style");
sty.LineSpa = (Docu->Dsize * static_cast<float>(Docu->AutoLine) / 100) + Docu->Dsize;
sty.LineSpa = (Docu->Dsize * static_cast<double>(Docu->AutoLine) / 100) + Docu->Dsize;
sty.Ausri = 0;
sty.Indent = 0;
sty.First = 0;
110,7 → 110,7
sty.FontSize = Docu->Dsize;
TempVorl.append(sty);
sFnumber = TempVorl.count()-1;
EditStyle* dia2 = new EditStyle(this, &TempVorl[sFnumber], TempVorl, true, fon, static_cast<float>(Docu->AutoLine));
EditStyle* dia2 = new EditStyle(this, &TempVorl[sFnumber], TempVorl, true, fon, static_cast<double>(Docu->AutoLine));
if (!dia2->exec())
TempVorl.remove(TempVorl.fromLast());
delete dia2;
119,7 → 119,7
 
void StilFormate::editFormat()
{
EditStyle* dia = new EditStyle(this, &TempVorl[sFnumber], TempVorl, false, fon, static_cast<float>(Docu->AutoLine));
EditStyle* dia = new EditStyle(this, &TempVorl[sFnumber], TempVorl, false, fon, static_cast<double>(Docu->AutoLine));
dia->exec();
delete dia;
UpdateFList();
/trunk/Scribus/scribus/vgradient.cpp
20,8 → 20,8
 
int VGradient::VColorStopList::compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 )
{
float r1 = ( (VColorStop*)item1 )->rampPoint;
float r2 = ( (VColorStop*)item2 )->rampPoint;
double r1 = ( (VColorStop*)item1 )->rampPoint;
double r2 = ( (VColorStop*)item2 )->rampPoint;
 
return ( r1 == r2 ? 0 : r1 < r2 ? -1 : 1 );
} // VGradient::VColorStopList::compareItems
81,15 → 81,15
m_colorStops.append( new VColorStop( *cs[i] ) );
m_colorStops.sort();
 
return *this;
return *this;
} // VGradient::operator=
 
const QPtrVector<VColorStop> VGradient::colorStops() const
{
{
QPtrVector<VColorStop> v;
m_colorStops.toVector( &v );
v.setAutoDelete( false );
return v;
return v;
} // VGradient::colorStops()
 
void
105,7 → 105,7
} // VGradient::addStop
 
void
VGradient::addStop( const QColor &color, float rampPoint, float midPoint, float opa )
VGradient::addStop( const QColor &color, double rampPoint, double midPoint, double opa )
{
// Clamping between 0.0 and 1.0
rampPoint = QMAX( 0.0f, rampPoint );
/trunk/Scribus/scribus/main.cpp
101,7 → 101,7
if (Arg1 == "--help")
{
std::cout << endl;
std::cout << "Scribus, a DTP-Program for Linux." << endl;
std::cout << "Scribus, a DTP-Program" << endl;
std::cout << endl;
std::cout << "Usage:" << endl;
std::cout << "scribus --version -> prints Version-Number and exits." << endl;
/trunk/Scribus/scribus/cupsoptions.cpp
53,12 → 53,9
ppd_group_t *group; /* Current group */
num_dests = cupsGetDests(&dests);
dest = cupsGetDest(Geraet, NULL, num_dests, dests);
if (dest == NULL)
if (dest == NULL || (filename = cupsGetPPD(dest->name)) == NULL ||
(ppd = ppdOpenFile(filename)) == NULL)
return;
if ((filename = cupsGetPPD(dest->name)) == NULL)
return;
if ((ppd = ppdOpenFile(filename)) == NULL)
return;
ppdMarkDefaults(ppd);
cupsMarkOptions(ppd, dest->num_options, dest->options);
QStringList opts;
/trunk/Scribus/scribus/editor.cpp
57,7 → 57,7
void Editor::LoadScript()
{
QString fileName = QFileDialog::getOpenFileName(0,tr("Javascripts (*.js);;All Files (*)"),this);
if (!fileName.isEmpty())
if (!fileName.isEmpty())
{
QFile file( fileName );
if ( file.open( IO_ReadOnly ) )
72,7 → 72,7
void Editor::SaveAs()
{
QString fn = QFileDialog::getSaveFileName(0, tr("Javascripts (*.js);;All Files (*)"), this);
if (!fn.isEmpty())
if (!fn.isEmpty())
{
QFile file( fn );
if ( file.open( IO_WriteOnly ) )
/trunk/Scribus/scribus/colorm.cpp
136,8 → 136,8
void Farbmanager::duplFarbe()
{
QString nam;
Query *dia = new Query(this, "tt", 1, 0, tr("New Color:"), tr("New Color"));
dia->Answer->setText(tr("Copy of")+" "+sFarbe);
Query *dia = new Query(this, "tt", 1, 0, "New Color:", "New Color");
dia->Answer->setText(tr("Copy of ")+sFarbe);
if (dia->exec())
{
nam = dia->Answer->text();
159,7 → 159,7
void Farbmanager::neueFarbe()
{
QString nam;
Query *dia = new Query(this, "tt", 1, 0, tr("New Color:"), tr("New Color"));
Query *dia = new Query(this, "tt", 1, 0, "New Color:", "New Color");
dia->Answer->setText(sFarbe);
if (dia->exec())
{
211,10 → 211,7
sFarbe = c->text();
EditF->setEnabled(true);
DupF->setEnabled(true);
if (EditColors.count() == 1)
DelF->setEnabled(false);
else
DelF->setEnabled(true);
DelF->setEnabled(EditColors.count() == 1 ? false : true);
if (DontChange.contains(sFarbe))
{
EditF->setEnabled(false);
232,14 → 229,7
pm.fill(EditColors[it.key()].getRGBColor());
ListBox1->insertItem(pm, it.key());
}
if (EditColors.count() == 1)
{
DelF->setEnabled(false);
}
else
{
DelF->setEnabled(true);
}
DelF->setEnabled(EditColors.count() == 1 ? false : true);
if (ListBox1->currentItem() == -1)
{
DupF->setEnabled(false);
/trunk/Scribus/scribus/po/scribus.de_DE.po
181,7 → 181,7
msgid "Cancel"
msgstr "Abbrechen"
 
msgid "Autom. Textframes"
msgid "Autom. Text Frames"
msgstr "Autom. Textrahmen"
 
msgid "W:"
833,7 → 833,7
msgid "Small Caps"
msgstr "Kapitälchen"
 
msgid "Typographics"
msgid "Typography"
msgstr "Typografie"
 
msgid "Italic"
1679,7 → 1679,7
msgid "Orientation:"
msgstr "Ausrichtung:"
 
msgid "First Pagenumber:"
msgid "First Page Number:"
msgstr "Erste Seitennummer:"
 
msgid "Default Unit:"
2894,6 → 2894,9
msgid "Keywords:"
msgstr "Suchbegriffe:"
 
msgid "Line Spacing:"
msgstr "Zeilenabstand:"
 
msgid "Line Spacing"
msgstr "Zeilenabstand"
 
2921,3 → 2924,6
msgid "Display Unprintable Area in Margin Color"
msgstr "Nichtdruckbaren Bereich mit Randfarbe einfärben"
 
msgid "Lang.:"
msgstr "Sprache:"
 
/trunk/Scribus/scribus/fpointarray.cpp
18,7 → 18,7
#include "fpointarray.h"
#include <cstdarg>
 
void FPointArray::setPoint(uint i, float x, float y)
void FPointArray::setPoint(uint i, double x, double y)
{
QMemArray<FPoint>::at( i ) = FPoint( x, y );
}
35,13 → 35,13
return false;
setPoint( 0, firstx, firsty );
int i = 1;
float x, y;
double x, y;
nPoints--;
va_start( ap, firsty );
while ( nPoints-- )
{
x = static_cast<float>(va_arg( ap, double ));
y = static_cast<float>(va_arg( ap, double ));
x = static_cast<double>(va_arg( ap, double ));
y = static_cast<double>(va_arg( ap, double ));
setPoint( i++, x, y );
}
va_end( ap );
60,13 → 60,13
return true;
setPoint( index, firstx, firsty ); // set first point
int i = index + 1;
float x, y;
double x, y;
nPoints--;
va_start( ap, firsty );
while ( nPoints-- )
{
x = static_cast<float>(va_arg(ap, double));
y = static_cast<float>(va_arg(ap, double));
x = static_cast<double>(va_arg(ap, double));
y = static_cast<double>(va_arg(ap, double));
setPoint( i++, x, y );
}
va_end( ap );
91,7 → 91,7
return true;
}
 
void FPointArray::point(uint i, float *x, float *y)
void FPointArray::point(uint i, double *x, double *y)
{
FPoint p = QMemArray<FPoint>::at(i);
if (x)
112,7 → 112,7
return r;
}
 
void FPointArray::translate( float dx, float dy )
void FPointArray::translate( double dx, double dy )
{
FPoint *p = data();
int i = size();
130,7 → 130,7
if ( isEmpty() )
return FPoint( 0.0, 0.0 ); // null rectangle
FPoint *pd = data();
float minx, maxx, miny, maxy;
double minx, maxx, miny, maxy;
minx = maxx = pd->x();
miny = maxy = pd->y();
pd++;
154,7 → 154,7
void FPointArray::map( QWMatrix m )
{
FPoint *p = data();
float mx, my;
double mx, my;
int i = size();
while ( i-- )
{
181,7 → 181,7
addPoint(999999.0, 999999.0);
}
 
void FPointArray::addPoint(float x, float y)
void FPointArray::addPoint(double x, double y)
{
resize(size()+1);
setPoint(size()-1, FPoint(x, y));
/trunk/Scribus/scribus/newfile.h
56,18 → 56,19
MSpinBox* Hoehe;
QPushButton* OKButton;
QPushButton* CancelB;
float Umrech;
double Umrech;
int Orient;
float Pagebr;
float Pageho;
float Top;
float Bottom;
float Left;
float Right;
float Dist;
double Pagebr;
double Pageho;
double Top;
double Bottom;
double Left;
double Right;
double Dist;
QString ein;
int einheit;
void setSize(int gr);
void code_repeat(int);
 
public slots:
void setHoehe(int v);
/trunk/Scribus/scribus/scribusXml.h
25,7 → 25,7
int ReadPageCount(QString fileName);
bool ReadPage(QString fileName, SCFonts &avail, ScribusDoc *doc, ScribusView *view, int PageToLoad);
QString WriteElem(QPtrList<PageItem> *Selitems, ScribusDoc *doc);
bool ReadElemHeader(QString file, bool isFile, float *x, float *y, float *w, float *h);
bool ReadElemHeader(QString file, bool isFile, double *x, double *y, double *w, double *h);
bool ReadElem(QString fileName, SCFonts &avail, ScribusDoc *doc, int Xp, int Yp, bool Fi, bool loc, QMap<QString,QString> &FontSub, preV *Prefs);
bool ReadDoc(QString fileName, SCFonts &avail, ScribusDoc *docu, ScribusView *viewx, QProgressBar *dia2);
void WritePages(ScribusView *view, QDomDocument docu, QDomElement dc, QProgressBar *dia2, uint maxC);
/trunk/Scribus/scribus/picsearch.cpp
116,11 → 116,10
if ((im.width() > 200) || (im.height() > 200))
{
QImage im2;
float sx = im.width() / 200.0;
float sy = im.height() / 200.0;
if (sy < sx)
im2 = im.smoothScale(qRound(im.width() / sx), qRound(im.height() / sx));
else
double sx = im.width() / 200.0;
double sy = im.height() / 200.0;
im2 = sy < sx ?
im2 = im.smoothScale(qRound(im.width() / sx), qRound(im.height() / sx)) :
im2 = im.smoothScale(qRound(im.width() / sy), qRound(im.height() / sy));
im = im2;
im2.detach();
/trunk/Scribus/scribus/buttonicon.h
36,8 → 36,8
int IcPlace;
int IcScaleW;
int IcScaleH;
float IcPlaceX;
float IcPlaceY;
double IcPlaceX;
double IcPlaceY;
 
private slots:
void MoveIconY(int y);
/trunk/Scribus/scribus/scribusXml.cpp
24,7 → 24,7
#ifdef HAVE_LIBZ
#include <zlib.h>
#endif
extern float QStoFloat(QString in);
extern double QStodouble(QString in);
extern int QStoInt(QString in);
extern bool loadText(QString nam, QString *Buffer);
extern QString Path2Relative(QString Path);
156,7 → 156,7
QFont fo;
QMap<QString,QString> DoFonts;
int x, y, a, counter;
float xf, yf;
double xf, yf;
bool newVersion = false;
QDomDocument docu("scridoc");
f = "";
220,12 → 220,12
if(pg.tagName()=="STYLE")
{
vg.Vname = pg.attribute("NAME");
vg.LineSpa = QStoFloat(pg.attribute("LINESP"));
vg.Indent = QStoFloat(pg.attribute("INDENT","0"));
vg.First = QStoFloat(pg.attribute("FIRST","0"));
vg.LineSpa = QStodouble(pg.attribute("LINESP"));
vg.Indent = QStodouble(pg.attribute("INDENT","0"));
vg.First = QStodouble(pg.attribute("FIRST","0"));
vg.Ausri = QStoInt(pg.attribute("ALIGN"));
vg.Avor = QStoFloat(pg.attribute("VOR","0"));
vg.Anach = QStoFloat(pg.attribute("NACH","0"));
vg.Avor = QStodouble(pg.attribute("VOR","0"));
vg.Anach = QStodouble(pg.attribute("NACH","0"));
if (pg.hasAttribute("FONT"))
vg.Font = DoFonts[pg.attribute("FONT")];
else
279,7 → 279,7
sl.LineEnd = QStoInt(MuL.attribute("LineEnd"));
sl.LineJoin = QStoInt(MuL.attribute("LineJoin"));
sl.Shade = QStoInt(MuL.attribute("Shade"));
sl.Width = QStoFloat(MuL.attribute("Width"));
sl.Width = QStodouble(MuL.attribute("Width"));
ml.push_back(sl);
MuLn = MuLn.nextSibling();
}
339,14 → 339,14
}
}
OB.PType = QStoInt(obj.attribute("PTYPE"));
OB.Xpos = QStoFloat(obj.attribute("XPOS"));
OB.Ypos=QStoFloat(obj.attribute("YPOS"));
OB.Width=QStoFloat(obj.attribute("WIDTH"));
OB.Height=QStoFloat(obj.attribute("HEIGHT"));
OB.RadRect = QStoFloat(obj.attribute("RADRECT","0"));
OB.Xpos = QStodouble(obj.attribute("XPOS"));
OB.Ypos=QStodouble(obj.attribute("YPOS"));
OB.Width=QStodouble(obj.attribute("WIDTH"));
OB.Height=QStodouble(obj.attribute("HEIGHT"));
OB.RadRect = QStodouble(obj.attribute("RADRECT","0"));
OB.ClipEdited = QStoInt(obj.attribute("CLIPEDIT", "0"));
OB.FrameType = QStoInt(obj.attribute("FRTYPE", "0"));
OB.Pwidth=QStoFloat(obj.attribute("PWIDTH"));
OB.Pwidth=QStodouble(obj.attribute("PWIDTH"));
OB.Pcolor=obj.attribute("PCOLOR");
if ((!newVersion) && (OB.PType == 4))
{
373,21 → 373,21
OB.GrShade = QStoInt(obj.attribute("GRSHADE","100"));
OB.GrShade2 = QStoInt(obj.attribute("GRSHADE2","100"));
OB.GrType = QStoInt(obj.attribute("GRTYP","0"));
OB.Rot=QStoFloat(obj.attribute("ROT"));
OB.Rot=QStodouble(obj.attribute("ROT"));
OB.PLineArt=Qt::PenStyle(QStoInt(obj.attribute("PLINEART")));
OB.PLineEnd=Qt::PenCapStyle(QStoInt(obj.attribute("PLINEEND","0")));
OB.PLineJoin=Qt::PenJoinStyle(QStoInt(obj.attribute("PLINEJOIN","0")));
OB.LineSp=QStoFloat(obj.attribute("LINESP"));
OB.ExtraV=QStoFloat(obj.attribute("EXTRAV","0"));
OB.LocalScX=QStoFloat(obj.attribute("LOCALSCX"));
OB.LocalScY=QStoFloat(obj.attribute("LOCALSCY"));
OB.LocalX=QStoFloat(obj.attribute("LOCALX"));
OB.LocalY=QStoFloat(obj.attribute("LOCALY"));
OB.LineSp=QStodouble(obj.attribute("LINESP"));
OB.ExtraV=QStodouble(obj.attribute("EXTRAV","0"));
OB.LocalScX=QStodouble(obj.attribute("LOCALSCX"));
OB.LocalScY=QStodouble(obj.attribute("LOCALSCY"));
OB.LocalX=QStodouble(obj.attribute("LOCALX"));
OB.LocalY=QStodouble(obj.attribute("LOCALY"));
OB.PicArt=QStoInt(obj.attribute("PICART"));
OB.flippedH=QStoInt(obj.attribute("FLIPPEDH"));
OB.flippedV=QStoInt(obj.attribute("FLIPPEDV"));
OB.BBoxX=QStoFloat(obj.attribute("BBOXX"));
OB.BBoxH=QStoFloat(obj.attribute("BBOXH"));
OB.BBoxX=QStodouble(obj.attribute("BBOXX"));
OB.BBoxH=QStodouble(obj.attribute("BBOXH"));
OB.ScaleType = QStoInt(obj.attribute("SCALETYPE","1"));
OB.AspectRatio = QStoInt(obj.attribute("RATIO","0"));
OB.isPrintable=QStoInt(obj.attribute("PRINTABLE"));
426,10 → 426,10
OB.AnFont = QStoInt(obj.attribute("ANFONT","4"));
OB.AnFormat = QStoInt(obj.attribute("ANFORMAT","0"));
OB.AnVis = QStoInt(obj.attribute("ANVIS","0"));
OB.AnIsChk = bool(QStoInt(obj.attribute("ANCHK","0")));
OB.AnAAact = bool(QStoInt(obj.attribute("ANAA","0")));
OB.AnHTML = bool(QStoInt(obj.attribute("ANHTML","0")));
OB.AnUseIcons = bool(QStoInt(obj.attribute("ANICON","0")));
OB.AnIsChk = static_cast<bool>(QStoInt(obj.attribute("ANCHK","0")));
OB.AnAAact = static_cast<bool>(QStoInt(obj.attribute("ANAA","0")));
OB.AnHTML = static_cast<bool>(QStoInt(obj.attribute("ANHTML","0")));
OB.AnUseIcons = static_cast<bool>(QStoInt(obj.attribute("ANICON","0")));
OB.AnChkStil = QStoInt(obj.attribute("ANCHKS","0"));
OB.AnMaxChar = QStoInt(obj.attribute("ANMC","-1"));
OB.AnBColor = obj.attribute("ANBCOL","None");
439,12 → 439,12
OB.Pcolor = "None";
OB.Textflow=QStoInt(obj.attribute("TEXTFLOW"));
OB.Textflow2=QStoInt(obj.attribute("TEXTFLOW2","0"));
OB.Extra=QStoFloat(obj.attribute("EXTRA"));
OB.TExtra=QStoFloat(obj.attribute("TEXTRA", "1"));
OB.BExtra=QStoFloat(obj.attribute("BEXTRA", "1"));
OB.RExtra=QStoFloat(obj.attribute("REXTRA", "1"));
OB.Extra=QStodouble(obj.attribute("EXTRA"));
OB.TExtra=QStodouble(obj.attribute("TEXTRA", "1"));
OB.BExtra=QStodouble(obj.attribute("BEXTRA", "1"));
OB.RExtra=QStodouble(obj.attribute("REXTRA", "1"));
OB.PoShow = QStoInt(obj.attribute("PTLSHOW","0"));
OB.BaseOffs = QStoFloat(obj.attribute("BASEOF","0"));
OB.BaseOffs = QStodouble(obj.attribute("BASEOF","0"));
OB.Ausrich = QStoInt(obj.attribute("ALIGN","0"));
OB.IFont = DoFonts[obj.attribute("IFONT", doc->Dfont)];
OB.ISize = QStoInt(obj.attribute("ISIZE","12"));
460,9 → 460,9
OB.InvPict = static_cast<bool>(QStoInt(obj.attribute("INVERS","0")));
OB.LayerNr = QStoInt(obj.attribute("LAYER","0"));
OB.Language = obj.attribute("LANGUAGE", doc->Language);
OB.Transparency = QStoFloat(obj.attribute("TransValue","0.0"));
OB.Transparency = QStodouble(obj.attribute("TransValue","0.0"));
if (obj.hasAttribute("TransValueS"))
OB.TranspStroke = QStoFloat(obj.attribute("TransValueS","0.0"));
OB.TranspStroke = QStodouble(obj.attribute("TransValueS","0.0"));
else
OB.TranspStroke = OB.Transparency;
if (obj.hasAttribute("NUMCLIP"))
619,7 → 619,7
QFont fo;
QMap<QString,QString> DoFonts;
int x, y, a;
float xf, yf;
double xf, yf;
PageItem *Neu;
LFrames.clear();
QDomDocument docu("scridoc");
649,12 → 649,12
/*
* Attribute von DOCUMENT auslesen
*/
doc->PageB=QStoFloat(dc.attribute("PAGEWITH"));
doc->PageH=QStoFloat(dc.attribute("PAGEHEIGHT"));
doc->PageM.Left=QStoFloat(dc.attribute("BORDERLEFT"));
doc->PageM.Right=QStoFloat(dc.attribute("BORDERRIGHT"));
doc->PageM.Top=QStoFloat(dc.attribute("BORDERTOP"));
doc->PageM.Bottom=QStoFloat(dc.attribute("BORDERBOTTOM"));
doc->PageB=QStodouble(dc.attribute("PAGEWITH"));
doc->PageH=QStodouble(dc.attribute("PAGEHEIGHT"));
doc->PageM.Left=QStodouble(dc.attribute("BORDERLEFT"));
doc->PageM.Right=QStodouble(dc.attribute("BORDERRIGHT"));
doc->PageM.Top=QStodouble(dc.attribute("BORDERTOP"));
doc->PageM.Bottom=QStodouble(dc.attribute("BORDERBOTTOM"));
doc->PageOri = QStoInt(dc.attribute("ORIENTATION","0"));
doc->FirstPnum = QStoInt(dc.attribute("FIRSTNUM","1"));
doc->PageFP=QStoInt(dc.attribute("BOOK"));
661,7 → 661,7
doc->FirstPageLeft=QStoInt(dc.attribute("FIRSTLEFT"));
doc->PageAT=QStoInt(dc.attribute("AUTOTEXT"));
doc->PageSp=QStoInt(dc.attribute("AUTOSPALTEN"));
doc->PageSpa=QStoFloat(dc.attribute("ABSTSPALTEN"));
doc->PageSpa=QStodouble(dc.attribute("ABSTSPALTEN"));
doc->Einheit = QStoInt(dc.attribute("UNITS","0"));
Defont=dc.attribute("DFONT");
doc->Dsize=QStoInt(dc.attribute("DSIZE"));
736,17 → 736,17
if(pg.tagName()=="STYLE")
{
vg.Vname = pg.attribute("NAME");
vg.LineSpa = QStoFloat(pg.attribute("LINESP"));
vg.Indent = QStoFloat(pg.attribute("INDENT","0"));
vg.First = QStoFloat(pg.attribute("FIRST","0"));
vg.LineSpa = QStodouble(pg.attribute("LINESP"));
vg.Indent = QStodouble(pg.attribute("INDENT","0"));
vg.First = QStodouble(pg.attribute("FIRST","0"));
vg.Ausri = QStoInt(pg.attribute("ALIGN"));
vg.Avor = QStoFloat(pg.attribute("VOR","0"));
vg.Anach = QStoFloat(pg.attribute("NACH","0"));
vg.Avor = QStodouble(pg.attribute("VOR","0"));
vg.Anach = QStodouble(pg.attribute("NACH","0"));
if (pg.hasAttribute("FONT"))
vg.Font = DoFonts[pg.attribute("FONT")];
else
vg.Font = DoFonts[Defont];
vg.FontSize = QStoInt(pg.attribute("FONTSIZE","12"));
vg.FontSize = QStoInt(pg.attribute("FONTSIZE","12"));
doc->Vorlagen.append(vg);
}
if(pg.tagName()=="JAVA")
757,7 → 757,7
la.Level = QStoInt(pg.attribute("LEVEL"));
la.Name = pg.attribute("NAME");
la.Sichtbar = QStoInt(pg.attribute("SICHTBAR"));
la.Drucken = QStoInt(pg.attribute("DRUCKEN"));
la.Drucken = QStoInt(pg.attribute("DRUCKEN"));
doc->Layers.append(la);
}
if(pg.tagName()=="Bookmark")
797,10 → 797,10
doc->PDF_Optionen.ImageProf = pg.attribute("ImageP", "");
doc->PDF_Optionen.PrintProf = pg.attribute("PrintP", "");
doc->PDF_Optionen.Info = pg.attribute("InfoString", "");
doc->PDF_Optionen.BleedTop = QStoFloat(pg.attribute("BTop","0"));
doc->PDF_Optionen.BleedLeft = QStoFloat(pg.attribute("BLeft","0"));
doc->PDF_Optionen.BleedRight = QStoFloat(pg.attribute("BRight","0"));
doc->PDF_Optionen.BleedBottom = QStoFloat(pg.attribute("BBottom","0"));
doc->PDF_Optionen.BleedTop = QStodouble(pg.attribute("BTop","0"));
doc->PDF_Optionen.BleedLeft = QStodouble(pg.attribute("BLeft","0"));
doc->PDF_Optionen.BleedRight = QStodouble(pg.attribute("BRight","0"));
doc->PDF_Optionen.BleedBottom = QStodouble(pg.attribute("BBottom","0"));
doc->PDF_Optionen.EmbeddedI = static_cast<bool>(QStoInt(pg.attribute("ImagePr","0")));
doc->PDF_Optionen.PassOwner = pg.attribute("PassOwner", "");
doc->PDF_Optionen.PassUser = pg.attribute("PassUser", "");
842,7 → 842,7
sl.LineEnd = QStoInt(MuL.attribute("LineEnd"));
sl.LineJoin = QStoInt(MuL.attribute("LineJoin"));
sl.Shade = QStoInt(MuL.attribute("Shade"));
sl.Width = QStoFloat(MuL.attribute("Width"));
sl.Width = QStodouble(MuL.attribute("Width"));
ml.push_back(sl);
MuLn = MuLn.nextSibling();
}
928,14 → 928,14
}
}
OB.PType = QStoInt(obj.attribute("PTYPE"));
OB.Xpos = QStoFloat(obj.attribute("XPOS"));
OB.Ypos=QStoFloat(obj.attribute("YPOS"));
OB.Width=QStoFloat(obj.attribute("WIDTH"));
OB.Height=QStoFloat(obj.attribute("HEIGHT"));
OB.RadRect = QStoFloat(obj.attribute("RADRECT","0"));
OB.Xpos = QStodouble(obj.attribute("XPOS"));
OB.Ypos=QStodouble(obj.attribute("YPOS"));
OB.Width=QStodouble(obj.attribute("WIDTH"));
OB.Height=QStodouble(obj.attribute("HEIGHT"));
OB.RadRect = QStodouble(obj.attribute("RADRECT","0"));
OB.ClipEdited = QStoInt(obj.attribute("CLIPEDIT", "0"));
OB.FrameType = QStoInt(obj.attribute("FRTYPE", "0"));
OB.Pwidth=QStoFloat(obj.attribute("PWIDTH"));
OB.Pwidth=QStodouble(obj.attribute("PWIDTH"));
OB.Pcolor=obj.attribute("PCOLOR");
if ((!newVersion) && (OB.PType == 4))
{
960,21 → 960,21
OB.GrShade = QStoInt(obj.attribute("GRSHADE","100"));
OB.GrShade2 = QStoInt(obj.attribute("GRSHADE2","100"));
OB.GrType = QStoInt(obj.attribute("GRTYP","0"));
OB.Rot=QStoFloat(obj.attribute("ROT"));
OB.Rot=QStodouble(obj.attribute("ROT"));
OB.PLineArt=Qt::PenStyle(QStoInt(obj.attribute("PLINEART")));
OB.PLineEnd=Qt::PenCapStyle(QStoInt(obj.attribute("PLINEEND","0")));
OB.PLineJoin=Qt::PenJoinStyle(QStoInt(obj.attribute("PLINEJOIN","0")));
OB.LineSp=QStoFloat(obj.attribute("LINESP"));
OB.ExtraV=QStoFloat(obj.attribute("EXTRAV","0"));
OB.LocalScX=QStoFloat(obj.attribute("LOCALSCX"));
OB.LocalScY=QStoFloat(obj.attribute("LOCALSCY"));
OB.LocalX=QStoFloat(obj.attribute("LOCALX"));
OB.LocalY=QStoFloat(obj.attribute("LOCALY"));
OB.LineSp=QStodouble(obj.attribute("LINESP"));
OB.ExtraV=QStodouble(obj.attribute("EXTRAV","0"));
OB.LocalScX=QStodouble(obj.attribute("LOCALSCX"));
OB.LocalScY=QStodouble(obj.attribute("LOCALSCY"));
OB.LocalX=QStodouble(obj.attribute("LOCALX"));
OB.LocalY=QStodouble(obj.attribute("LOCALY"));
OB.PicArt=QStoInt(obj.attribute("PICART"));
OB.flippedH=QStoInt(obj.attribute("FLIPPEDH"));
OB.flippedV=QStoInt(obj.attribute("FLIPPEDV"));
OB.BBoxX=QStoFloat(obj.attribute("BBOXX"));
OB.BBoxH=QStoFloat(obj.attribute("BBOXH"));
OB.BBoxX=QStodouble(obj.attribute("BBOXX"));
OB.BBoxH=QStodouble(obj.attribute("BBOXH"));
OB.ScaleType = QStoInt(obj.attribute("SCALETYPE","1"));
OB.AspectRatio = QStoInt(obj.attribute("RATIO","0"));
OB.isPrintable=QStoInt(obj.attribute("PRINTABLE"));
1013,10 → 1013,10
OB.AnFont = QStoInt(obj.attribute("ANFONT","4"));
OB.AnFormat = QStoInt(obj.attribute("ANFORMAT","0"));
OB.AnVis = QStoInt(obj.attribute("ANVIS","0"));
OB.AnIsChk = bool(QStoInt(obj.attribute("ANCHK","0")));
OB.AnAAact = bool(QStoInt(obj.attribute("ANAA","0")));
OB.AnHTML = bool(QStoInt(obj.attribute("ANHTML","0")));
OB.AnUseIcons = bool(QStoInt(obj.attribute("ANICON","0")));
OB.AnIsChk = static_cast<bool>(QStoInt(obj.attribute("ANCHK","0")));
OB.AnAAact = static_cast<bool>(QStoInt(obj.attribute("ANAA","0")));
OB.AnHTML = static_cast<bool>(QStoInt(obj.attribute("ANHTML","0")));
OB.AnUseIcons = static_cast<bool>(QStoInt(obj.attribute("ANICON","0")));
OB.AnChkStil = QStoInt(obj.attribute("ANCHKS","0"));
OB.AnMaxChar = QStoInt(obj.attribute("ANMC","-1"));
OB.AnBColor = obj.attribute("ANBCOL","None");
1026,12 → 1026,12
OB.Pcolor = "None";
OB.Textflow=QStoInt(obj.attribute("TEXTFLOW"));
OB.Textflow2=QStoInt(obj.attribute("TEXTFLOW2","0"));
OB.Extra=QStoFloat(obj.attribute("EXTRA"));
OB.TExtra=QStoFloat(obj.attribute("TEXTRA", "1"));
OB.BExtra=QStoFloat(obj.attribute("BEXTRA", "1"));
OB.RExtra=QStoFloat(obj.attribute("REXTRA", "1"));
OB.Extra=QStodouble(obj.attribute("EXTRA"));
OB.TExtra=QStodouble(obj.attribute("TEXTRA", "1"));
OB.BExtra=QStodouble(obj.attribute("BEXTRA", "1"));
OB.RExtra=QStodouble(obj.attribute("REXTRA", "1"));
OB.PoShow = QStoInt(obj.attribute("PTLSHOW","0"));
OB.BaseOffs = QStoFloat(obj.attribute("BASEOF","0"));
OB.BaseOffs = QStodouble(obj.attribute("BASEOF","0"));
OB.Ausrich = QStoInt(obj.attribute("ALIGN","0"));
OB.IFont = DoFonts[obj.attribute("IFONT", doc->Dfont)];
OB.ISize = QStoInt(obj.attribute("ISIZE","12"));
1047,9 → 1047,9
OB.InvPict = static_cast<bool>(QStoInt(obj.attribute("INVERS","0")));
OB.LayerNr = QStoInt(obj.attribute("LAYER","0"));
OB.Language = obj.attribute("LANGUAGE", doc->Language);
OB.Transparency = QStoFloat(obj.attribute("TransValue","0.0"));
OB.Transparency = QStodouble(obj.attribute("TransValue","0.0"));
if (obj.hasAttribute("TransValueS"))
OB.TranspStroke = QStoFloat(obj.attribute("TransValueS","0.0"));
OB.TranspStroke = QStodouble(obj.attribute("TransValueS","0.0"));
else
OB.TranspStroke = OB.Transparency;
if (obj.hasAttribute("NUMCLIP"))
1183,12 → 1183,12
doc->PageC = view->Pages.count();
view->reformPages();
if (doc->Layers.count() == 0)
{
{
la.LNr = 0;
la.Level = 0;
la.Name = tr("Background");
la.Sichtbar = true;
la.Drucken = true;
la.Drucken = true;
doc->Layers.append(la);
}
if (LFrames.count() != 0)
1224,7 → 1224,7
return true;
}
 
bool ScriXmlDoc::ReadElemHeader(QString file, bool isFile, float *x, float *y, float *w, float *h)
bool ScriXmlDoc::ReadElemHeader(QString file, bool isFile, double *x, double *y, double *w, double *h)
{
QString f;
QDomDocument docu("scridoc");
1253,10 → 1253,10
QDomElement elem=docu.documentElement();
if ((elem.tagName() != "SCRIBUSELEM") && (elem.tagName() != "SCRIBUSELEMUTF8"))
return false;
*x = QStoFloat(elem.attribute("XP"));
*y = QStoFloat(elem.attribute("YP"));
*w = QStoFloat(elem.attribute("W","0"));
*h = QStoFloat(elem.attribute("H","0"));
*x = QStodouble(elem.attribute("XP"));
*y = QStodouble(elem.attribute("YP"));
*w = QStodouble(elem.attribute("W","0"));
*h = QStodouble(elem.attribute("H","0"));
return true;
}
 
1274,7 → 1274,7
bool VorLFound = false;
bool newVersion = false;
int x, y;
float GrX, GrY, xf, yf;
double GrX, GrY, xf, yf;
int GrMax = doc->GroupCounter;
CMYKColor lf = CMYKColor();
QDomDocument docu("scridoc");
1310,8 → 1310,8
}
else
{
GrX = QStoFloat(elem.attribute("XP"));
GrY = QStoFloat(elem.attribute("YP"));
GrX = QStodouble(elem.attribute("XP"));
GrY = QStodouble(elem.attribute("YP"));
}
if (elem.hasAttribute("Version"))
newVersion = true;
1368,7 → 1368,7
sl.LineEnd = QStoInt(MuL.attribute("LineEnd"));
sl.LineJoin = QStoInt(MuL.attribute("LineJoin"));
sl.Shade = QStoInt(MuL.attribute("Shade"));
sl.Width = QStoFloat(MuL.attribute("Width"));
sl.Width = QStodouble(MuL.attribute("Width"));
ml.push_back(sl);
MuLn = MuLn.nextSibling();
}
1380,17 → 1380,17
fou = false;
VorLFound = true;
vg.Vname = pg.attribute("NAME");
vg.LineSpa = QStoFloat(pg.attribute("LINESP"));
vg.Indent = QStoFloat(pg.attribute("INDENT","0"));
vg.First = QStoFloat(pg.attribute("FIRST","0"));
vg.LineSpa = QStodouble(pg.attribute("LINESP"));
vg.Indent = QStodouble(pg.attribute("INDENT","0"));
vg.First = QStodouble(pg.attribute("FIRST","0"));
vg.Ausri = QStoInt(pg.attribute("ALIGN"));
vg.Avor = QStoFloat(pg.attribute("VOR","0"));
vg.Anach = QStoFloat(pg.attribute("NACH","0"));
vg.Avor = QStodouble(pg.attribute("VOR","0"));
vg.Anach = QStodouble(pg.attribute("NACH","0"));
if (pg.hasAttribute("FONT"))
vg.Font = DoFonts[pg.attribute("FONT")];
else
vg.Font = doc->Dfont;
vg.FontSize = QStoInt(pg.attribute("FONTSIZE","12"));
vg.FontSize = QStoInt(pg.attribute("FONTSIZE","12"));
for (uint xx=0; xx<doc->Vorlagen.count(); ++xx)
{
if (vg.Vname == doc->Vorlagen[xx].Vname)
1417,14 → 1417,14
if(pg.tagName()=="ITEM")
{
OB.PType = QStoInt(pg.attribute("PTYPE"));
OB.Xpos = static_cast<float>(Xp) + QStoFloat(pg.attribute("XPOS")) - GrX;
OB.Ypos = static_cast<float>(Yp) + QStoFloat(pg.attribute("YPOS")) - GrY;
OB.Width = QStoFloat(pg.attribute("WIDTH"));
OB.Height = QStoFloat(pg.attribute("HEIGHT"));
OB.RadRect = QStoFloat(pg.attribute("RADRECT","0"));
OB.Xpos = static_cast<double>(Xp) + QStodouble(pg.attribute("XPOS")) - GrX;
OB.Ypos = static_cast<double>(Yp) + QStodouble(pg.attribute("YPOS")) - GrY;
OB.Width = QStodouble(pg.attribute("WIDTH"));
OB.Height = QStodouble(pg.attribute("HEIGHT"));
OB.RadRect = QStodouble(pg.attribute("RADRECT","0"));
OB.ClipEdited = QStoInt(pg.attribute("CLIPEDIT", "0"));
OB.FrameType = QStoInt(pg.attribute("FRTYPE", "0"));
OB.Pwidth = QStoFloat(pg.attribute("PWIDTH"));
OB.Pwidth = QStodouble(pg.attribute("PWIDTH"));
OB.Pcolor = pg.attribute("PCOLOR");
if ((!newVersion) && (OB.PType == 4))
{
1451,23 → 1451,23
OB.GrShade = QStoInt(pg.attribute("GRSHADE","100"));
OB.GrShade2 = QStoInt(pg.attribute("GRSHADE2","100"));
OB.GrType = QStoInt(pg.attribute("GRTYP","0"));
OB.Rot = QStoFloat(pg.attribute("ROT"));
OB.Rot = QStodouble(pg.attribute("ROT"));
OB.PLineArt = Qt::PenStyle(QStoInt(pg.attribute("PLINEART")));
OB.PLineEnd = Qt::PenCapStyle(QStoInt(pg.attribute("PLINEEND","0")));
OB.PLineJoin = Qt::PenJoinStyle(QStoInt(pg.attribute("PLINEJOIN","0")));
OB.LineSp = QStoFloat(pg.attribute("LINESP"));
OB.ExtraV = QStoFloat(pg.attribute("EXTRAV","0"));
OB.LocalScX = QStoFloat(pg.attribute("LOCALSCX"));
OB.LocalScY = QStoFloat(pg.attribute("LOCALSCY"));
OB.LocalX = QStoFloat(pg.attribute("LOCALX"));
OB.LocalY = QStoFloat(pg.attribute("LOCALY"));
OB.LineSp = QStodouble(pg.attribute("LINESP"));
OB.ExtraV = QStodouble(pg.attribute("EXTRAV","0"));
OB.LocalScX = QStodouble(pg.attribute("LOCALSCX"));
OB.LocalScY = QStodouble(pg.attribute("LOCALSCY"));
OB.LocalX = QStodouble(pg.attribute("LOCALX"));
OB.LocalY = QStodouble(pg.attribute("LOCALY"));
OB.PicArt = QStoInt(pg.attribute("PICART"));
OB.flippedH = QStoInt(pg.attribute("FLIPPEDH"));
OB.flippedV = QStoInt(pg.attribute("FLIPPEDV"));
OB.ScaleType = QStoInt(pg.attribute("SCALETYPE","1"));
OB.AspectRatio = QStoInt(pg.attribute("RATIO","0"));
OB.BBoxX = QStoFloat(pg.attribute("BBOXX"));
OB.BBoxH = QStoFloat(pg.attribute("BBOXH"));
OB.BBoxX = QStodouble(pg.attribute("BBOXX"));
OB.BBoxH = QStodouble(pg.attribute("BBOXH"));
OB.isPrintable = QStoInt(pg.attribute("PRINTABLE"));
OB.isBookmark = false;
OB.BMnr = 0;
1515,12 → 1515,12
OB.Pcolor = "None";
OB.Textflow = QStoInt(pg.attribute("TEXTFLOW"));
OB.Textflow2 = QStoInt(pg.attribute("TEXTFLOW2","0"));
OB.Extra = QStoFloat(pg.attribute("EXTRA"));
OB.TExtra = QStoFloat(pg.attribute("TEXTRA", "1"));
OB.BExtra = QStoFloat(pg.attribute("BEXTRA", "1"));
OB.RExtra = QStoFloat(pg.attribute("REXTRA", "1"));
OB.Extra = QStodouble(pg.attribute("EXTRA"));
OB.TExtra = QStodouble(pg.attribute("TEXTRA", "1"));
OB.BExtra = QStodouble(pg.attribute("BEXTRA", "1"));
OB.RExtra = QStodouble(pg.attribute("REXTRA", "1"));
OB.PoShow = QStoInt(pg.attribute("PTLSHOW","0"));
OB.BaseOffs = QStoFloat(pg.attribute("BASEOF","0"));
OB.BaseOffs = QStodouble(pg.attribute("BASEOF","0"));
OB.Ausrich = QStoInt(pg.attribute("ALIGN","0"));
OB.IFont = DoFonts[pg.attribute("IFONT")];
OB.ISize = QStoInt(pg.attribute("ISIZE","12"));
1535,9 → 1535,9
OB.Reverse = static_cast<bool>(QStoInt(pg.attribute("REVERS","0")));
OB.InvPict = static_cast<bool>(QStoInt(pg.attribute("INVERS","0")));
OB.Language = pg.attribute("LANGUAGE", doc->Language);
OB.Transparency = QStoFloat(pg.attribute("TransValue","0.0"));
OB.Transparency = QStodouble(pg.attribute("TransValue","0.0"));
if (pg.hasAttribute("TransValueS"))
OB.TranspStroke = QStoFloat(pg.attribute("TransValueS","0.0"));
OB.TranspStroke = QStodouble(pg.attribute("TransValueS","0.0"));
else
OB.TranspStroke = OB.Transparency;
if (pg.hasAttribute("NUMCLIP"))
1663,7 → 1663,7
{
int ts, ts2, tsh, tsh2, tst, tst2, tsb, tsb2, tshs, tshs2, tsc, tsc2;
QString text, tf, tf2, tc, tc2, tcs, tcs2, tmp;
float te, te2, xf, yf;
double te, te2, xf, yf;
PageItem *item;
QDomDocument docu("scribus");
QString st="<SCRIBUSELEMUTF8></SCRIBUSELEMUTF8>";
1707,7 → 1707,7
}
}
elem.setAttribute("COUNT", Selitems->count());
elem.setAttribute("Version", "1.1.1");
elem.setAttribute("Version", "1.1.1");
for (uint co=0; co<Selitems->count(); ++co)
{
QString CurDirP = QDir::currentDirPath();
2047,7 → 2047,7
{
int ts, ts2, tsh, tsh2, tst, tst2, tsb, tsb2, tshs, tshs2, tsc, tsc2;
QString text, tf, tf2, tc, tc2, tcs, tcs2, tmp, Ndir;
float te, te2, xf, yf;
double te, te2, xf, yf;
uint ObCount = maxC;
Page *page;
PageItem *item;
2854,8 → 2854,8
}
if (dc.tagName()=="GRID")
{
Vorein->DminGrid = QStoFloat(dc.attribute("MINOR"));
Vorein->DmajGrid = QStoFloat(dc.attribute("MAJOR"));
Vorein->DminGrid = QStodouble(dc.attribute("MINOR"));
Vorein->DmajGrid = QStodouble(dc.attribute("MAJOR"));
Vorein->DminColor = QColor(dc.attribute("MINORC"));
Vorein->DmajColor = QColor(dc.attribute("MAJORC"));
Vorein->Before = static_cast<bool>(QStoInt(dc.attribute("BACKG","1")));
2862,7 → 2862,7
if (dc.hasAttribute("GuideC"))
Vorein->guideColor = QColor(dc.attribute("GuideC"));
if (dc.hasAttribute("GuideZ"))
Vorein->GuideRad = QStoFloat(dc.attribute("GuideZ"));
Vorein->GuideRad = QStodouble(dc.attribute("GuideZ"));
}
if (dc.tagName()=="PAGE")
{
2870,7 → 2870,7
Vorein->DmargColor = QColor(dc.attribute("MARGC","#0000ff"));
Vorein->RandFarbig = static_cast<bool>(QStoInt(dc.attribute("RANDF","0")));
Vorein->PDFTransparency = static_cast<bool>(QStoInt(dc.attribute("TRANS","0")));
Vorein->DisScale = QStoFloat(dc.attribute("DScale","1"));
Vorein->DisScale = QStodouble(dc.attribute("DScale","1"));
}
if (dc.tagName()=="TYPO")
{
2889,8 → 2889,8
Vorein->DpenText = dc.attribute("PENTEXT");
Vorein->DLineArt = QStoInt(dc.attribute("STIL"));
Vorein->DLstyleLine = QStoInt(dc.attribute("STILLINE"));
Vorein->Dwidth = QStoFloat(dc.attribute("WIDTH"));
Vorein->DwidthLine = QStoFloat(dc.attribute("WIDTHLINE"));
Vorein->Dwidth = QStodouble(dc.attribute("WIDTH"));
Vorein->DwidthLine = QStodouble(dc.attribute("WIDTHLINE"));
Vorein->Dshade2 = QStoInt(dc.attribute("PENSHADE"));
Vorein->DshadeLine = QStoInt(dc.attribute("LINESHADE"));
Vorein->Dshade = QStoInt(dc.attribute("BRUSHSHADE"));
2899,13 → 2899,13
Vorein->MagStep = QStoInt(dc.attribute("MAGSTEP","25"));
Vorein->DbrushPict = dc.attribute("CPICT");
Vorein->ShadePict = QStoInt(dc.attribute("PICTSHADE","100"));
Vorein->ScaleX = QStoFloat(dc.attribute("PICTSCX","1"));
Vorein->ScaleY = QStoFloat(dc.attribute("PICTSCY","1"));
Vorein->ScaleX = QStodouble(dc.attribute("PICTSCX","1"));
Vorein->ScaleY = QStodouble(dc.attribute("PICTSCY","1"));
Vorein->ScaleType = static_cast<bool>(QStoInt(dc.attribute("PSCALE", "1")));
Vorein->AspectRatio = static_cast<bool>(QStoInt(dc.attribute("PASPECT", "0")));
Vorein->PolyC = QStoInt(dc.attribute("POLYC", "4"));
Vorein->PolyF = QStoFloat(dc.attribute("POLYF", "0.5"));
Vorein->PolyR = QStoFloat(dc.attribute("POLYR", "0"));
Vorein->PolyF = QStodouble(dc.attribute("POLYF", "0.5"));
Vorein->PolyR = QStodouble(dc.attribute("POLYR", "0"));
Vorein->PolyFd = QStoInt(dc.attribute("POLYFD", "0"));
Vorein->PolyS = static_cast<bool>(QStoInt(dc.attribute("POLYS", "0")));
}
2961,12 → 2961,12
{
Vorein->PageFormat = QStoInt(dc.attribute("FORMATCODE","4"));
Vorein->Ausrichtung = QStoInt(dc.attribute("AUSRICHTUNG","0"));
Vorein->PageBreite = QStoFloat(dc.attribute("BREITE","595"));
Vorein->PageHoehe = QStoFloat(dc.attribute("HOEHE","842"));
Vorein->RandOben = QStoFloat(dc.attribute("RANDO","9"));
Vorein->RandUnten = QStoFloat(dc.attribute("RANDU","40"));
Vorein->RandLinks = QStoFloat(dc.attribute("RANDL","9"));
Vorein->RandRechts = QStoFloat(dc.attribute("RANDR","9"));
Vorein->PageBreite = QStodouble(dc.attribute("BREITE","595"));
Vorein->PageHoehe = QStodouble(dc.attribute("HOEHE","842"));
Vorein->RandOben = QStodouble(dc.attribute("RANDO","9"));
Vorein->RandUnten = QStodouble(dc.attribute("RANDU","40"));
Vorein->RandLinks = QStodouble(dc.attribute("RANDL","9"));
Vorein->RandRechts = QStodouble(dc.attribute("RANDR","9"));
Vorein->DoppelSeiten = static_cast<bool>(QStoInt(dc.attribute("DOPPEL","0")));
Vorein->ErsteLinks = static_cast<bool>(QStoInt(dc.attribute("LINKS","0")));
Vorein->AutoSave = static_cast<bool>(QStoInt(dc.attribute("AutoSave","0")));
/trunk/Scribus/scribus/qm/scribus.de.qm
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/Scribus/scribus/guidemanager.h
43,8 → 43,8
Page* pag;
int curX;
int curY;
QValueList<float> XLocal;
QValueList<float> YLocal;
QValueList<double> XLocal;
QValueList<double> YLocal;
 
private slots:
void HandleLock();
/trunk/Scribus/scribus/scpainter.h
82,15 → 82,15
virtual QColor pen();
virtual QColor brush();
virtual void setPen( const QColor & );
virtual void setPen( const QColor &c, float w, Qt::PenStyle st, Qt::PenCapStyle ca, Qt::PenJoinStyle jo );
virtual void setPenOpacity( float op );
virtual void setLineWidth( float w);
virtual void setDash(const QValueList<float>& array, float ofs);
virtual void setPen( const QColor &c, double w, Qt::PenStyle st, Qt::PenCapStyle ca, Qt::PenJoinStyle jo );
virtual void setPenOpacity( double op );
virtual void setLineWidth( double w);
virtual void setDash(const QValueList<double>& array, double ofs);
virtual void setBrush( const QColor & );
virtual void setBrushOpacity( float op );
virtual void setOpacity( float op );
virtual void setBrushOpacity( double op );
virtual void setOpacity( double op );
virtual void setFont( const QFont &f );
virtual QFont font();
virtual QFont font();
 
 
// stack management
100,7 → 100,7
//
virtual void setRasterOp( Qt::RasterOp );
 
virtual QPaintDevice *device() { return m_target; }
virtual QPaintDevice *device() { return m_target; }
unsigned char *buffer() { return m_buffer; }
VGradient fill_gradient;
VGradient stroke_gradient;
131,22 → 131,22
bool mf_outlined;
/* Filling */
QColor m_fill;
float fill_trans;
double fill_trans;
bool m_fillRule;
int fillMode; // 0 = none, 1 = solid, 2 = gradient
int gradientMode; // 1 = linear, 2 = radial
/* Stroking */
QColor m_stroke;
float stroke_trans;
float LineWidth;
double stroke_trans;
double LineWidth;
 
/* Line End Style */
Qt::PenCapStyle PLineEnd;
/* Line Join Style */
Qt::PenJoinStyle PLineJoin;
/* The Dash Array */
QValueList<float> m_array;
float m_offset;
QValueList<double> m_array;
double m_offset;
/* Transformation Stack */
QValueStack<QWMatrix> MStack;
/* Zoom Factor of the Painter */