Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 294 → Rev 295

/trunk/Scribus/ChangeLogCVS
1,5 → 1,14
Changes since Version 1.1.6
 
29.05.2004
* bug #707: Endian issues with images on fink?
* bug #715: When using Free Linear Gradient, importing an SVG can change the gradient
* bug #720: print dialog does not allow entering of page numbers
* feature #662: Missing option to save Scribus file
* feature #718: german translation update
* feature #727: Add ability for Removing Recently Used Docs
* feature #731: Ability to have Gradients with more than 2 Colors
 
26.05.2004
* bug #713: "Line Style" to "Type of Line"
* feature #688: improve the zoom-icon function
/trunk/Scribus/Scribus.pro
44,6 → 44,7
scribus/gdk-pixbuf-xlib-render.c \
scribus/gdk-pixbuf-xlib.c \
scribus/gdk-pixbuf-xlibrgb.c \
scribus/gradienteditor.cpp \
scribus/guidemanager.cpp \
scribus/helpbrowser.cpp \
scribus/hnjalloc.c \
/trunk/Scribus/scribus/lineformats.cpp
204,7 → 204,39
ListBox1->clear();
QMap<QString,multiLine>::Iterator it;
for (it = TempStyles.begin(); it != TempStyles.end(); ++it)
ListBox1->insertItem(it.key());
{
QPixmap pm = QPixmap(37, 37);
pm.fill(white);
QPainter p;
p.begin(&pm);
QColor tmpf;
int h, s, v, sneu;
multiLine ml = it.data();
for (int its = ml.size()-1; its > -1; its--)
{
Docu->PageColors[ml[its].Color].getRGBColor().rgb(&h, &s, &v);
if ((h == s) && (s == v))
{
Docu->PageColors[ml[its].Color].getRGBColor().hsv(&h, &s, &v);
sneu = 255 - ((255 - v) * ml[its].Shade / 100);
tmpf.setHsv(h, s, sneu);
}
else
{
Docu->PageColors[ml[its].Color].getRGBColor().hsv(&h, &s, &v);
sneu = s * ml[its].Shade / 100;
tmpf.setHsv(h, sneu, v);
}
p.setPen(QPen(tmpf,
QMAX(static_cast<int>(ml[its].Width), 1),
static_cast<PenStyle>(ml[its].Dash),
static_cast<PenCapStyle>(ml[its].LineEnd),
static_cast<PenJoinStyle>(ml[its].LineJoin)));
p.drawLine(0, 18, 37, 18);
}
p.end();
ListBox1->insertItem(pm, it.key());
}
if (ListBox1->count() > 0)
ListBox1->setSelected(ListBox1->findItem(sFnumber), true);
bool setter = ListBox1->count() == 0 ? true : false;
/trunk/Scribus/scribus/mpalette.cpp
971,6 → 971,16
if (ScApp->ScriptRunning)
return;
TabStack->raiseWidget(t);
if ((HaveDoc) && (HaveItem))
{
Cpal->GradCombo->setCurrentItem(CurItem->GrType);
Cpal->ChooseGrad(CurItem->GrType);
Cpal->setSpecialGradient(CurItem->GrStartX * UmReFaktor, CurItem->GrStartY * UmReFaktor,
CurItem->GrEndX * UmReFaktor, CurItem->GrEndY * UmReFaktor,
CurItem->Width * UmReFaktor, CurItem->Height * UmReFaktor);
Cpal->GradEdit->fill_gradient = CurItem->fill_gradient;
Cpal->GradEdit->updateDisplay();
}
}
 
void Mpalette::SetDoc(ScribusDoc *d)
1051,8 → 1061,8
Cpal->setSpecialGradient(CurItem->GrStartX * UmReFaktor, CurItem->GrStartY * UmReFaktor,
CurItem->GrEndX * UmReFaktor, CurItem->GrEndY * UmReFaktor,
CurItem->Width * UmReFaktor, CurItem->Height * UmReFaktor);
Cpal->updateGeometry();
Cpal->repaint();
Cpal->GradEdit->fill_gradient = CurItem->fill_gradient;
Cpal->GradEdit->updateDisplay();
if (i->FrameType == 0)
SCustom->setPixmap(SCustom->getIconPixmap(0));
if (i->FrameType == 1)
/trunk/Scribus/scribus/util.cpp
1622,10 → 1622,11
Buffer->Pcolor2 = b->Pcolor2;
Buffer->Shade = b->Shade;
Buffer->Shade2 = b->Shade2;
Buffer->GrColor = b->GrColor;
Buffer->GrColor2 = b->GrColor2;
Buffer->GrShade = b->GrShade;
Buffer->GrShade2 = b->GrShade2;
Buffer->GrColor = "";
Buffer->GrColor2 = "";
Buffer->GrShade = 100;
Buffer->GrShade2 = 100;
Buffer->fill_gradient = b->fill_gradient;
Buffer->GrType = b->GrType;
Buffer->GrStartX = b->GrStartX;
Buffer->GrStartY = b->GrStartY;
/trunk/Scribus/scribus/story.cpp
285,8 → 285,11
fmenu->insertItem(loadIcon("DateiSave16.png"), tr("Save to File..."), this, SLOT(SaveTextFile()));
fmenu->insertItem(loadIcon("DateiOpen16.png"), tr("Load from File..."), this, SLOT(LoadTextFile()));
fmenu->insertSeparator();
fmenu->insertItem( tr("Save and Exit"), this, SLOT(accept()));
fmenu->insertItem( tr("Exit without Saving"), this, SLOT(Do_leave()));
/* changes to fit the #662 bug 05/28/04 petr vanek */
fmenu->insertItem( tr("Update Text Frame and Exit"), this, SLOT(accept()));
fmenu->insertItem( tr("Exit Without Updating Text Frame"), this, SLOT(Do_leave()));
fmenu->insertItem(tr("Save Document"), this, SLOT(Do_saveDocument()), CTRL+Key_S);
/* end of changes */
emenu = new QPopupMenu();
Mundo = emenu->insertItem( tr("Undo"), this, SLOT(Do_undo()), CTRL+Key_Z);
Mredo = emenu->insertItem( tr("Redo"), this, SLOT(Do_redo()));
536,6 → 539,15
}
reject();
}
/*! Saves the document with editation continued. Signal called from menu.
05/28/04 petr vanek
*/
void StoryEditor::Do_saveDocument()
{
updateTextFrame();
ScApp->slotFileSave();
}
 
void StoryEditor::Do_new()
{
/trunk/Scribus/scribus/gradienteditor.cpp
0,0 → 1,236
/***************************************************************************
gradienteditor - description
-------------------
begin : Mit Mai 26 2004
copyright : (C) 2004 by Franz Schmid
email : Franz.Schmid@altmuehlnet.de
***************************************************************************/
 
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
 
#include "gradienteditor.h"
#include "gradienteditor.moc"
#include <qpainter.h>
#include <qpixmap.h>
#include <qcursor.h>
#include "scpainter.h"
#include "fpoint.h"
extern QPixmap loadIcon(QString nam);
 
GradientPreview::GradientPreview(QWidget *pa) : QLabel(pa)
{
setFrameShape( QFrame::Panel );
setFrameShadow( QFrame::Sunken );
setLineWidth( 2 );
setEraseColor(QColor(255,255,255));
setMinimumSize(QSize(200, 60));
setMaximumSize(QSize(3000, 60));
setMouseTracking(true);
Mpressed = false;
outside = true;
onlyselect = true;
fill_gradient = VGradient(VGradient::linear);
fill_gradient.clearStops();
 
QColor color;
color = QColor(255,255,255);
fill_gradient.addStop( color, 0.0, 0.5, 1.0 );
color = QColor(0,0,0);
fill_gradient.addStop( color, 1.0, 0.5, 1.0 );
 
QPtrVector<VColorStop> cstops = fill_gradient.colorStops();
StopM.clear();
ActStop = 0;
for (uint a = 0; a < fill_gradient.Stops(); ++a)
{
int center = qRound(cstops.at(a)->rampPoint * (width()-20))+10;
StopM.append(center);
}
}
 
void GradientPreview::paintEvent(QPaintEvent *e)
{
QPtrVector<VColorStop> cstops = fill_gradient.colorStops();
StopM.clear();
for (uint a = 0; a < fill_gradient.Stops(); ++a)
{
int center = qRound(cstops.at(a)->rampPoint * (width()-20))+10;
StopM.append(center);
}
QPixmap pixm(width()-20, 37);
ScPainter *p = new ScPainter(&pixm, width()-20, 37);
p->setPen(black);
p->setLineWidth(1);
p->setFillMode(2);
p->fill_gradient = fill_gradient;
p->setGradient(VGradient::linear, FPoint(0,20), FPoint(width()-20,20));
p->drawRect(0, 0, width()-20, 37);
p->end();
delete p;
QPainter pw;
pw.begin(this);
pw.drawPixmap(10, 5, pixm);
for (uint a = 0; a < fill_gradient.Stops(); ++a)
{
int center = qRound(cstops.at(a)->rampPoint * (width()-20))+10;
pw.setPen(QPen(black, 1, SolidLine, FlatCap, MiterJoin));
if (StopM[QMAX(ActStop,0)] == center)
pw.setBrush(red);
else
pw.setBrush(blue);
if ((a == 0) || ( a == fill_gradient.Stops()-1))
pw.drawRect(QRect(center-4, 43, 8, 13));
else
{
QPointArray cr;
cr.setPoints(3, qRound(center), 43, qRound(center-4), 56, qRound(center+4), 56);
pw.drawPolygon(cr);
}
}
pw.end();
QLabel::paintEvent(e);
}
 
void GradientPreview::mousePressEvent(QMouseEvent *m)
{
QRect fpo;
Mpressed = true;
ActStop = -1;
QPtrVector<VColorStop> cstops = fill_gradient.colorStops();
for (int yg = 0; yg < static_cast<int>(StopM.count()); ++yg)
{
fpo = QRect(static_cast<int>(StopM[yg])-4, 43, 8, 13);
if (fpo.contains(m->pos()))
{
ActStop = yg;
emit selectedColor(cstops.at(ActStop)->name, cstops.at(ActStop)->shade);
repaint();
onlyselect = true;
return;
}
}
}
 
void GradientPreview::mouseReleaseEvent(QMouseEvent *m)
{
QRect fpo;
if ((Mpressed) && (ActStop != 0) && (ActStop != static_cast<int>(StopM.count()-1)) && (ActStop != -1) && (outside))
{
onlyselect = false;
fill_gradient.removeStop(ActStop);
ActStop = 0;
repaint();
QPtrVector<VColorStop> cstops = fill_gradient.colorStops();
emit selectedColor(cstops.at(ActStop)->name, cstops.at(ActStop)->shade);
}
if ((m->y() < height()) && (m->y() > 43) && (m->x() > 0) && (m->x() < width()) && (ActStop == -1))
{
QPtrVector<VColorStop> cstops = fill_gradient.colorStops();
double newStop = static_cast<double>((m->x() - 10)) / (static_cast<double>(width())-20);
fill_gradient.addStop(cstops.at(0)->color, newStop, 0.5, 1.0, cstops.at(0)->name, cstops.at(0)->shade);
repaint();
onlyselect = false;
cstops = fill_gradient.colorStops();
for (int yg = 0; yg < static_cast<int>(StopM.count()); ++yg)
{
fpo = QRect(static_cast<int>(StopM[yg])-4, 43, 8, 13);
if (fpo.contains(m->pos()))
{
ActStop = yg;
emit selectedColor(cstops.at(ActStop)->name, cstops.at(ActStop)->shade);
repaint();
break;
}
}
}
Mpressed = false;
if (!onlyselect)
emit gradientChanged();
}
 
void GradientPreview::mouseMoveEvent(QMouseEvent *m)
{
QRect fpo;
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
if ((!Mpressed) && (m->y() < height()) && (m->y() > 43) && (m->x() > 10) && (m->x() < width()-10))
{
qApp->setOverrideCursor(QCursor(loadIcon("AddPoint.png"), 4, 3), true);
for (int yg = 0; yg < static_cast<int>(StopM.count()); ++yg)
{
fpo = QRect(static_cast<int>(StopM[yg])-4, 43, 8, 13);
if (fpo.contains(m->pos()))
{
if ((yg == 0) || (yg == static_cast<int>(StopM.count())-1))
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
else
qApp->setOverrideCursor(QCursor(SizeHorCursor), true);
return;
}
}
}
if ((Mpressed) && (m->y() < height()) && (m->y() > 43) && (m->x() > 10) && (m->x() < width()-10) && (ActStop != -1))
{
if ((ActStop == 0) || (ActStop == static_cast<int>(StopM.count()-1)))
return;
qApp->setOverrideCursor(QCursor(SizeHorCursor), true);
double newStop = static_cast<double>((m->x() - 10)) / (static_cast<double>(width())-20);
if (ActStop > 1)
{
if (StopM[ActStop-1]+2 >= m->x())
return;
}
if (ActStop < static_cast<int>(StopM.count()-2))
{
if (StopM[ActStop+1]-2 < m->x())
return;
}
StopM[ActStop] = m->x();
QPtrVector<VColorStop> cstops = fill_gradient.colorStops();
cstops.at(ActStop)->rampPoint = newStop;
cstops.sort();
onlyselect = false;
repaint();
}
if ((Mpressed) && (outside) && (ActStop != 0) && (ActStop != static_cast<int>(StopM.count()-1)) && (ActStop != -1))
qApp->setOverrideCursor(QCursor(loadIcon("DelPoint.png"), 4, 3), true);
}
 
void GradientPreview::leaveEvent(QEvent*)
{
if ((Mpressed) && (ActStop != 0) && (ActStop != static_cast<int>(StopM.count()-1)) && (ActStop != -1))
qApp->setOverrideCursor(QCursor(loadIcon("DelPoint.png"), 4, 3), true);
else
qApp->setOverrideCursor(QCursor(ArrowCursor), true);
outside = true;
}
 
void GradientPreview::enterEvent(QEvent*)
{
outside = false;
}
 
void GradientPreview::updateDisplay()
{
repaint();
ActStop = 0;
QPtrVector<VColorStop> cstops = fill_gradient.colorStops();
emit selectedColor(cstops.at(ActStop)->name, cstops.at(ActStop)->shade);
}
 
void GradientPreview::setActColor(QColor c, QString n, int s)
{
if (ActStop == -1)
return;
QPtrVector<VColorStop> cstops = fill_gradient.colorStops();
cstops.at(ActStop)->color = c;
cstops.at(ActStop)->name = n;
cstops.at(ActStop)->shade = s;
repaint();
}
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: Scribus/scribus/page.h
===================================================================
--- Scribus/scribus/page.h (revision 294)
+++ Scribus/scribus/page.h (revision 295)
@@ -217,7 +217,7 @@
void ItemBrush(QString farbe);
void ItemPenShade(int sha);
void ItemBrushShade(int sha);
- void ItemGradFill(int typ, QString col1, int sh1, QString col2, int sh2);
+ void ItemGradFill(int typ);
void QueryFarben();
void SetFrameRect();
void SetFrameRounded();
@@ -283,7 +283,7 @@
void SetDistValues(double, double, double, double);
/** Sendet die Stiftfarbe an die Farbpalette */
void ItemFarben(QString, QString, int, int);
- void ItemGradient(QString, QString, int, int, int);
+ void ItemGradient(int);
/** Sendet die Textattribute an die Masspalette */
void ItemTextAttr(double);
/** Sendet die Schriftart */
Index: Scribus/scribus/scpainter.cpp
===================================================================
--- Scribus/scribus/scpainter.cpp (revision 294)
+++ Scribus/scribus/scpainter.cpp (revision 295)
@@ -667,12 +667,12 @@
ArtGradientRadial *radial = art_new( ArtGradientRadial, 1 );
// TODO : make variable
- if( gradient.repeatMethod() == VGradient::none )
+// if( gradient.repeatMethod() == VGradient::none )
radial->spread = ART_GRADIENT_PAD;
- else if( gradient.repeatMethod() == VGradient::repeat )
+/* else if( gradient.repeatMethod() == VGradient::repeat )
radial->spread = ART_GRADIENT_REPEAT;
else if( gradient.repeatMethod() == VGradient::reflect )
- radial->spread = ART_GRADIENT_REFLECT;
+ radial->spread = ART_GRADIENT_REFLECT; */
radial->affine[0] = m_matrix.m11();
radial->affine[1] = m_matrix.m12();
/trunk/Scribus/scribus/pageitem.cpp
238,6 → 238,9
TabValues.clear();
DashOffset = 0;
fill_gradient = VGradient(VGradient::linear);
fill_gradient.clearStops();
fill_gradient.addStop(Doc->PageColors[Pcolor].getRGBColor(), 0.0, 0.5, 1.0, Pcolor, 100);
fill_gradient.addStop(Doc->PageColors[Pcolor2].getRGBColor(), 1.0, 0.5, 1.0, Pcolor2, 100);
Language = doc->Language;
Cols = Doc->DCols;
ColGap = Doc->DGap;
366,6 → 369,10
gra.map(grm);
p->setGradient(VGradient::linear, gra.point(0), gra.point(1));
break;
case 7:
gra.setPoints(2, GrStartX, GrStartY, GrEndX, GrEndY);
p->setGradient(VGradient::radial, gra.point(0), gra.point(1), gra.point(0));
break;
}
}
else
/trunk/Scribus/scribus/cpalette.cpp
18,6 → 18,7
#include "cpalette.h"
#include "cpalette.moc"
#include <qtooltip.h>
 
extern QPixmap loadIcon(QString nam);
 
Cpalette::Cpalette(QWidget* parent) : QWidget(parent, "Cdouble")
91,27 → 92,12
GradCombo->insertItem( tr("Cross Diagonal Gradient"));
GradCombo->insertItem( tr("Radial Gradient"));
GradCombo->insertItem( tr("Free linear Gradient"));
// GradCombo->insertItem( tr("Free radial Gradient"));
GradCombo->setCurrentItem(0);
GradLayout->addWidget( GradCombo );
GradGroup = new QButtonGroup( this, "GradGroup" );
GradGroup->setFrameShape( QButtonGroup::NoFrame );
GradGroup->setFrameShadow( QButtonGroup::Plain );
GradGroup->setTitle("");
GradGroup->setColumnLayout(0, Qt::Vertical );
GradGroup->layout()->setSpacing( 5 );
GradGroup->layout()->setMargin( 0 );
GradGroupLayout = new QVBoxLayout( GradGroup->layout() );
GradGroupLayout->setAlignment( Qt::AlignTop );
layout19 = new QHBoxLayout( 0, 0, 5, "layout19");
GrColor1 = new QRadioButton( GradGroup, "GrColor1" );
GrColor1->setText("#1");
GrColor1->setChecked( true );
layout19->addWidget( GrColor1 );
GrColor2 = new QRadioButton( GradGroup, "GrColor2" );
GrColor2->setText("#2");
layout19->addWidget( GrColor2 );
GradGroupLayout->addLayout( layout19 );
frame8 = new QFrame( GradGroup, "frame8" );
GradEdit = new GradientPreview(this);
GradLayout->addWidget(GradEdit, Qt::AlignHCenter);
frame8 = new QFrame( this, "frame8" );
frame8->setFrameShape( QFrame::NoFrame );
frame8->setFrameShadow( QFrame::Plain );
frame8Layout = new QGridLayout( frame8, 1, 1, 5, 5, "frame8Layout");
147,20 → 133,17
gY2->setDecimals(100);
gY2->setMaxValue(3000);
frame8Layout->addWidget( gY2, 1, 3 );
GradGroupLayout->addWidget( frame8 );
GradLayout->addWidget( GradGroup );
GradLayout->addWidget( frame8 );
Form1Layout->addLayout(GradLayout);
ListBox1 = new QListBox(this, "ListBox1");
ListBox1->setMinimumSize( QSize( 150, 210 ) );
ListBox1->setMinimumSize( QSize( 150, 30 ) );
Form1Layout->addWidget(ListBox1);
setActGradient("", "", 100, 100, 0);
setActGradient(0);
GradientMode = false;
QToolTip::add( Inhalt, tr( "Edit Line Color Properties" ) );
QToolTip::add( Innen, tr( "Edit Fill Color Properties" ) );
QToolTip::add( PM1, tr( "Saturation of color" ) );
QToolTip::add( GradCombo, tr( "Normal or gradient fill method" ) );
QToolTip::add( GrColor1, tr( "Edit the first color of object" ) );
QToolTip::add( GrColor2, tr( "Edit the second color of object" ) );
QToolTip::add( TransSpin, tr( "Set the transparency for the color selected" ) );
QToolTip::add( ListBox1, tr( "Color of selected object" ) );
connect(Inhalt, SIGNAL(clicked()), this, SLOT(InhaltButton()));
168,13 → 151,12
connect(ListBox1, SIGNAL(clicked(QListBoxItem*)), this, SLOT(selFarbe(QListBoxItem*)));
connect(PM1, SIGNAL(valueChanged(int)), this, SLOT(setActShade()));
connect(GradCombo, SIGNAL(activated(int)), this, SLOT(slotGrad(int)));
connect(GrColor1, SIGNAL(clicked()), this, SLOT(slotColor()));
connect(GrColor2, SIGNAL(clicked()), this, SLOT(slotColor()));
connect(TransSpin, SIGNAL(valueChanged(int)), this, SLOT(slotTrans(int)));
connect(gX1, SIGNAL(valueChanged(int)), this, SLOT(changeSpecial()));
connect(gX2, SIGNAL(valueChanged(int)), this, SLOT(changeSpecial()));
connect(gY1, SIGNAL(valueChanged(int)), this, SLOT(changeSpecial()));
connect(gY2, SIGNAL(valueChanged(int)), this, SLOT(changeSpecial()));
connect(GradEdit, SIGNAL(selectedColor(QString, int )), this, SLOT(slotColor(QString, int )));
}
 
void Cpalette::InhaltButton()
185,10 → 167,13
Mode = 1;
Innen->setOn(false);
h += GradCombo->height();
h += GradGroup->height();
h += GradEdit->height();
if (GradCombo->currentItem() < 6)
h -= frame8->height();
frame8->hide();
h += TransGroup->height();
GradCombo->hide();
GradGroup->hide();
GradEdit->hide();
GradientMode = false;
ListBox1->resize(ListBox1->width(), ListBox1->height()+h);
updateCList();
200,6 → 185,7
 
void Cpalette::InnenButton()
{
int h = 0;
if (Innen->isOn())
{
Mode = 2;
206,12 → 192,19
Inhalt->setOn(false);
GradCombo->show();
GradientMode = GradCombo->currentItem() != 0 ? true : false;
h += GradCombo->height();
h += TransGroup->height();
if (GradientMode)
GradGroup->show();
if (GradCombo->currentItem() == 6)
frame8->show();
else
frame8->hide();
{
if (GradEdit->isHidden())
GradEdit->show();
if (GradCombo->currentItem() > 5)
frame8->show();
else
frame8->hide();
h += GradEdit->height();
}
ListBox1->resize(ListBox1->width(), ListBox1->height()-h);
updateCList();
updateGeometry();
repaint();
258,16 → 251,34
}
else
{
if (GrColor1->isChecked())
Color = sFarbe;
else
Color2 = sFarbe;
emit NewGradient(GradCombo->currentItem(), Color, Shade, Color2, Shade2);
GradEdit->setActColor(SetFarbe(sFarbe, Shade), sFarbe, Shade);
Color = sFarbe;
emit gradientChanged();
}
break;
}
}
 
QColor Cpalette::SetFarbe(QString farbe, int shad)
{
int h, s, v, sneu;
QColor tmp;
Farbliste[farbe].getRGBColor().rgb(&h, &s, &v);
if ((h == s) && (s == v))
{
Farbliste[farbe].getRGBColor().hsv(&h, &s, &v);
sneu = 255 - ((255 - v) * shad / 100);
tmp.setHsv(h, s, sneu);
}
else
{
Farbliste[farbe].getRGBColor().hsv(&h, &s, &v);
sneu = s * shad / 100;
tmp.setHsv(h, sneu, v);
}
return tmp;
}
 
void Cpalette::updateBoxS(QString Farbe)
{
CListe::Iterator it;
288,6 → 299,7
 
void Cpalette::setActFarben(QString p, QString b, int shp, int shb)
{
disconnect(PM1, SIGNAL(valueChanged(int)), this, SLOT(setActShade()));
switch (Mode)
{
case 1:
295,32 → 307,29
updateBoxS(p);
break;
case 2:
Color3 = b;
Shade3 = shb;
PM1->setValue(shb);
updateBoxS(b);
Color3 = b;
Shade3 = shb;
break;
}
connect(PM1, SIGNAL(valueChanged(int)), this, SLOT(setActShade()));
}
 
void Cpalette::slotColor()
void Cpalette::slotColor(QString n, int s)
{
if (GrColor1->isChecked())
{
PM1->setValue(Shade);
updateBoxS(Color);
}
if (GrColor2->isChecked())
{
PM1->setValue(Shade2);
updateBoxS(Color2);
}
disconnect(PM1, SIGNAL(valueChanged(int)), this, SLOT(setActShade()));
Color = n;
Shade = s;
PM1->setValue(Shade);
updateBoxS(Color);
connect(PM1, SIGNAL(valueChanged(int)), this, SLOT(setActShade()));
}
 
void Cpalette::slotGrad(int nr)
{
ChooseGrad(nr);
emit NewGradient(nr, Color, Shade, Color2, Shade2);
emit NewGradient(nr);
}
 
void Cpalette::ChooseGrad(int nr)
327,40 → 336,38
{
/* PFJ - 29.02.04 - Removed GradGroup and Gradient mode from switch */
bool test = nr == 0 ? false : true;
GradGroup->setEnabled(test);
GradientMode = test;
if (GradientMode)
GradGroup->show();
if (nr != 0)
{
GradEdit->show();
if (nr > 5)
frame8->show();
else
frame8->hide();
}
else
GradGroup->hide();
if (nr == 6)
frame8->show();
else
{
GradEdit->hide();
frame8->hide();
}
updateGeometry();
repaint();
disconnect(PM1, SIGNAL(valueChanged(int)), this, SLOT(setActShade()));
switch (nr)
{
case 0:
updateCList();
updateGeometry();
repaint();
PM1->setValue(Shade3);
updateBoxS(Color3);
break;
default:
updateCList();
if (GrColor1->isChecked())
{
PM1->setValue(Shade);
updateBoxS(Color);
}
if (GrColor2->isChecked())
{
PM1->setValue(Shade2);
updateBoxS(Color2);
}
PM1->setValue(Shade);
updateBoxS(Color);
break;
}
setFocus();
connect(PM1, SIGNAL(valueChanged(int)), this, SLOT(setActShade()));
}
 
void Cpalette::setActTrans(double val, double val2)
398,13 → 405,9
UseTransFeature = b;
}
 
void Cpalette::setActGradient(QString p, QString b, int shp, int shb, int typ)
void Cpalette::setActGradient(int typ)
{
disconnect(GradCombo, SIGNAL(activated(int)), this, SLOT(slotGrad(int)));
Color2 = b;
Color = p;
Shade = shp;
Shade2 = shb;
if (Mode == 2)
{
GradCombo->setCurrentItem(typ);
449,16 → 452,14
case 2:
if (GradCombo->currentItem() == 0)
{
Shade3 = b;
emit NewBrushShade(b);
Shade3 = b;
}
else
{
if (GrColor1->isChecked())
Shade = b;
else
Shade2 = b;
emit NewGradient(GradCombo->currentItem(), Color, Shade, Color2, Shade2);
GradEdit->setActColor(SetFarbe(Color, b), Color, b);
Shade = b;
emit gradientChanged();
}
break;
}
/trunk/Scribus/scribus/scribusdoc.h
36,6 → 36,7
#include "scfonts.h"
#include "fpointarray.h"
#include "hyphenator.h"
#include "vgradient.h"
#ifdef HAVE_CMS
#include CMS_INC
#endif
85,6 → 86,7
QString GrColor2;
int GrShade;
int GrShade2;
VGradient fill_gradient;
int GrType;
double GrStartX;
double GrStartY;
/trunk/Scribus/scribus/scribusview.cpp
1540,29 → 1540,7
SetClipPath(p, &c->PoLine);
p->PS_closepath();
if ((c->GrType != 0) && (a->PageNam == ""))
{
SetFarbe(c->GrColor2, c->GrShade2, &h, &s, &v, &k);
p->PS_GradientCol1(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
SetFarbe(c->GrColor, c->GrShade, &h, &s, &v, &k);
p->PS_GradientCol2(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
switch (c->GrType)
{
case 1:
case 2:
case 3:
case 4:
p->PS_LinGradient(c->Width, -c->Height, 0, 0, 0, 0, c->PType, c->GrType);
break;
case 6:
p->PS_LinGradient(c->Width, -c->Height, c->GrStartX, -c->GrStartY, c->GrEndX, -c->GrEndY, c->PType, c->GrType);
break;
case 5:
p->PS_RadGradient(c->Width, -c->Height, c->PType);
break;
default:
break;
}
}
HandleGradient(p, c, c->Width, c->Height);
else
p->PS_fill();
}
1648,29 → 1626,7
SetClipPath(p, &c->PoLine);
p->PS_closepath();
if ((c->GrType != 0) && (a->PageNam == ""))
{
SetFarbe(c->GrColor2, c->GrShade2, &h, &s, &v, &k);
p->PS_GradientCol1(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
SetFarbe(c->GrColor, c->GrShade, &h, &s, &v, &k);
p->PS_GradientCol2(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
switch (c->GrType)
{
case 1:
case 2:
case 3:
case 4:
p->PS_LinGradient(c->Width, -c->Height, 0, 0, 0, 0, c->PType, c->GrType);
break;
case 6:
p->PS_LinGradient(c->Width, -c->Height, c->GrStartX, -c->GrStartY, c->GrEndX, -c->GrEndY, c->PType, c->GrType);
break;
case 5:
p->PS_RadGradient(c->Width, -c->Height, c->PType);
break;
default:
break;
}
}
HandleGradient(p, c, c->Width, c->Height);
else
p->PS_fill();
}
1961,29 → 1917,7
SetClipPath(p, &c->PoLine);
p->PS_closepath();
if (c->GrType != 0)
{
SetFarbe(c->GrColor2, c->GrShade2, &h, &s, &v, &k);
p->PS_GradientCol1(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
SetFarbe(c->GrColor, c->GrShade, &h, &s, &v, &k);
p->PS_GradientCol2(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
switch (c->GrType)
{
case 1:
case 2:
case 3:
case 4:
p->PS_LinGradient(c->Width, -c->Height, 0, 0, 0, 0, c->PType, c->GrType);
break;
case 6:
p->PS_LinGradient(c->Width, -c->Height, c->GrStartX, -c->GrStartY, c->GrEndX, -c->GrEndY, c->PType, c->GrType);
break;
case 5:
p->PS_RadGradient(c->Width, -c->Height, c->PType);
break;
default:
break;
}
}
HandleGradient(p, c, c->Width, c->Height);
else
p->PS_fill();
}
2018,29 → 1952,7
SetClipPath(p, &c->PoLine);
p->PS_closepath();
if (c->GrType != 0)
{
SetFarbe(c->GrColor2, c->GrShade2, &h, &s, &v, &k);
p->PS_GradientCol1(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
SetFarbe(c->GrColor, c->GrShade, &h, &s, &v, &k);
p->PS_GradientCol2(h / 255.0, s / 255.0, v / 255.0, k / 255.0);
switch (c->GrType)
{
case 1:
case 2:
case 3:
case 4:
p->PS_LinGradient(c->Width, -c->Height, 0, 0, 0, 0, c->PType, c->GrType);
break;
case 6:
p->PS_LinGradient(c->Width, -c->Height, c->GrStartX, -c->GrStartY, c->GrEndX, -c->GrEndY, c->PType, c->GrType);
break;
case 5:
p->PS_RadGradient(c->Width, -c->Height, c->PType);
break;
default:
break;
}
}
HandleGradient(p, c, c->Width, c->Height);
else
p->PS_fill();
p->PS_newpath();
2231,6 → 2143,112
}
}
 
void ScribusView::HandleGradient(PSLib *p, PageItem *c, double w, double h)
{
int ch,cs,cv,ck;
double StartX, StartY, EndX, EndY;
QPtrVector<VColorStop> cstops = c->fill_gradient.colorStops();
SetFarbe(cstops.at(0)->name, cstops.at(0)->shade, &ch, &cs, &cv, &ck);
p->PS_GradientCol1(ch / 255.0, cs / 255.0, cv / 255.0, ck / 255.0);
SetFarbe(cstops.at(1)->name, cstops.at(1)->shade, &ch, &cs, &cv, &ck);
p->PS_GradientCol2(ch / 255.0, cs / 255.0, cv / 255.0, ck / 255.0);
switch (c->GrType)
{
case 1:
StartX = 0;
StartY = h / 2.0;
EndX = w;
EndY = h / 2.0;
break;
case 2:
StartX = w / 2.0;
StartY = 0;
EndX = w / 2.0;
EndY = h;
break;
case 3:
StartX = 0;
StartY = 0;
EndX = w;
EndY = h;
break;
case 4:
StartX = 0;
StartY = h;
EndX = w;
EndY = 0;
break;
case 5:
StartX = w / 2.0;
StartY = h / 2.0;
if (w >= h)
{
EndX = w;
EndY = h / 2.0;
}
else
{
EndX = w / 2.0;
EndY = h;
}
break;
case 6:
case 7:
StartX = c->GrStartX;
StartY = c->GrStartY;
EndX = c->GrEndX;
EndY = c->GrEndY;
break;
}
if ((c->GrType == 5) || (c->GrType == 7))
{
if (c->fill_gradient.Stops() == 2)
p->PS_RadGradient(w, -h, c->PType);
else
{
QValueList<double> StopVec;
QStringList Gcolors;
StopVec.clear();
for (uint cst = 0; cst < c->fill_gradient.Stops(); ++cst)
{
StopVec.prepend(sqrt(pow(EndX - StartX, 2) + pow(EndY - StartY,2))*cstops.at(cst)->rampPoint);
SetFarbe(cstops.at(cst)->name, cstops.at(cst)->shade, &ch, &cs, &cv, &ck);
QString hs,ss,vs,ks;
QString GCol = hs.setNum(ch / 255.0)+" "+ss.setNum(cs / 255.0)+" "+vs.setNum(cv / 255.0)+" "+ks.setNum(ck / 255.0);
Gcolors.prepend(GCol);
}
p->PS_MultiRadGradient(w, -h, StopVec, Gcolors);
}
}
else
{
if (c->fill_gradient.Stops() == 2)
p->PS_LinGradient(w, -h, StartX, -StartY, EndX, -EndY, c->PType, c->GrType);
else
{
QValueList<double> StopVec;
QStringList Gcolors;
StopVec.clear();
for (uint cst = 0; cst < c->fill_gradient.Stops(); ++cst)
{
QWMatrix ma;
ma.translate(StartX, StartY);
ma.rotate(atan2(EndY - StartY, EndX - StartX)*(180.0/3.1415927));
double w2 = sqrt(pow(EndX - StartX, 2) + pow(EndY - StartY,2))*cstops.at(cst)->rampPoint;
double x = ma.m11() * w2 + ma.dx();
double y = ma.m12() * w2 + ma.dy();
StopVec.append(x);
StopVec.append(-y);
SetFarbe(cstops.at(cst)->name, cstops.at(cst)->shade, &ch, &cs, &cv, &ck);
QString hs,ss,vs,ks;
QString GCol = hs.setNum(ch / 255.0)+" "+ss.setNum(cs / 255.0)+" "+vs.setNum(cv / 255.0)+" "+ks.setNum(ck / 255.0);
Gcolors.append(GCol);
}
p->PS_MultiLinGradient(w, -h, StopVec, Gcolors);
}
}
}
 
void ScribusView::SetFarbe(QString farb, int shade, int *h, int *s, int *v, int *k)
{
int h1, s1, v1, k1;
/trunk/Scribus/scribus/druck.cpp
239,7 → 239,6
To->setMinValue(1);
To->setMaxValue(1000);
To->setValue(1);
To->setFocusPolicy( QSpinBox::TabFocus );
ButtonGroup5Layout->addWidget( To, 3, 1 );
 
From = new QSpinBox( ButtonGroup5, "From" );
248,7 → 247,6
From->setMinValue(1);
From->setMaxValue(1000);
From->setValue(1);
From->setFocusPolicy( QSpinBox::TabFocus );
 
ButtonGroup5Layout->addWidget( From, 2, 1 );
 
305,7 → 303,6
Copies->setMinValue( 1 );
Copies->setMaxValue(1000);
Copies->setValue(1);
Copies->setFocusPolicy( QSpinBox::TabFocus );
 
ButtonGroup4Layout->addWidget( Copies, 2, 1 );
UmfangLayout->addWidget( ButtonGroup4 );
/trunk/Scribus/scribus/art_kmisc.c
767,12 → 767,19
 
src_p = src + (src_y * src_rowstride) + src_x * 4;
 
#ifdef WORDS_BIGENDIAN
srcAlpha = alpha * src_p[0] + 0x80;
#else
srcAlpha = alpha * src_p[3] + 0x80;
#endif
srcAlpha = (srcAlpha + (srcAlpha >> 8)) >> 8;
 
d = *dst_p;
#ifdef WORDS_BIGENDIAN
s = src_p[1];
#else
s = src_p[2];
 
#endif
tmp = srcAlpha * (s - d) + 0x80;
tmp = (tmp + (tmp >> 8)) >> 8;
 
779,8 → 786,11
*dst_p++ = d + tmp;
 
d = *dst_p;
#ifdef WORDS_BIGENDIAN
s = src_p[2];
#else
s = src_p[1];
 
#endif
tmp = srcAlpha * (s - d) + 0x80;
tmp = (tmp + (tmp >> 8)) >> 8;
 
787,7 → 797,11
*dst_p++ = d + tmp;
 
d = *dst_p;
#ifdef WORDS_BIGENDIAN
s = src_p[3];
#else
s = src_p[0];
#endif
 
tmp = srcAlpha * (s - d) + 0x80;
tmp = (tmp + (tmp >> 8)) >> 8;
/trunk/Scribus/scribus/libpostscript/pslib.h
62,6 → 62,8
virtual void PS_GradientCol2(double c, double m, double y, double k);
virtual void PS_LinGradient(double w, double h, double x1, double y1, double x2, double y2, int item, int grad);
virtual void PS_RadGradient(double w, double h, int item);
virtual void PS_MultiRadGradient(double w, double h, QValueList<double> Stops, QStringList Colors);
virtual void PS_MultiLinGradient(double w, double h, QValueList<double> Stops, QStringList Colors);
virtual void PS_show(double x, double y);
virtual void PS_showSub(uint chr, QString font, double size, bool stroke);
virtual void PS_show_xyG(QString font, QString ch, double x, double y);
/trunk/Scribus/scribus/libpostscript/pslib.cpp
540,35 → 540,112
GrColor2 = ToStr(c) + " " + ToStr(m) + " " + ToStr(y) + " " + ToStr(k);
}
 
void PSLib::PS_MultiRadGradient(double w, double h, QValueList<double> Stops, QStringList Colors)
{
double w2, h2;
w2 = w / 2.0;
h2 = h / 2.0;
bool first = true;
PutSeite( "clipsave\n" );
PutSeite("eoclip\n");
for (uint c = 0; c < Colors.count()-1; ++c)
{
PutSeite("<<\n");
PutSeite("/ShadingType 3\n");
PutSeite( DoSep ? "/ColorSpace /DeviceGray\n" : "/ColorSpace /DeviceCMYK\n" );
PutSeite("/BBox [0 "+ToStr(h)+" "+ToStr(w)+" 0]\n");
if (first)
PutSeite("/Extend [false true]\n");
else
{
if (c == Colors.count()-2)
PutSeite("/Extend [true false]\n");
else
PutSeite("/Extend [false false]\n");
}
PutSeite("/Coords ["+ToStr(w2)+" "+ToStr(h2)+" "+ToStr((*Stops.at(c+1)))+" "+ToStr(w2)+" "+ToStr(h2)+" "+ToStr((*Stops.at(c)))+"]\n");
PutSeite("/Function\n");
PutSeite("<<\n");
PutSeite("/FunctionType 2\n");
PutSeite("/Domain [0 1]\n");
if (DoSep)
{
int pla = Plate - 1 < 0 ? 3 : Plate - 1;
QStringList cols1 = QStringList::split(" ", Colors[c+1]);
QStringList cols2 = QStringList::split(" ", Colors[c]);
PutSeite("/C1 ["+ToStr(1-cols1[pla].toDouble())+"]\n");
PutSeite("/C0 ["+ToStr(1-cols2[pla].toDouble())+"]\n");
}
else
{
PutSeite("/C0 ["+Colors[c+1]+"]\n");
PutSeite("/C1 ["+Colors[c]+"]\n");
}
PutSeite("/N 1\n");
PutSeite(">>\n");
PutSeite(">>\n");
PutSeite("shfill\n");
first = false;
}
PutSeite("cliprestore\n");
}
 
void PSLib::PS_MultiLinGradient(double w, double h, QValueList<double> Stops, QStringList Colors)
{
bool first = true;
PutSeite( "clipsave\n" );
PutSeite("eoclip\n");
for (uint c = 0; c < Colors.count()-1; ++c)
{
PutSeite("<<\n");
PutSeite("/ShadingType 2\n");
PutSeite( DoSep ? "/ColorSpace /DeviceGray\n" : "/ColorSpace /DeviceCMYK\n" );
PutSeite("/BBox [0 "+ToStr(h)+" "+ToStr(w)+" 0]\n");
if (first)
PutSeite("/Extend [true false]\n");
else
{
if (c == Colors.count()-2)
PutSeite("/Extend [false true]\n");
else
PutSeite("/Extend [false false]\n");
}
first = false;
PutSeite("/Coords ["+ToStr((*Stops.at(c*2)))+" "+ToStr((*Stops.at(c*2+1)))+" "+ToStr((*Stops.at(c*2+2)))+" "+ToStr((*Stops.at(c*2+3)))+"]\n");
PutSeite("/Function\n");
PutSeite("<<\n");
PutSeite("/FunctionType 2\n");
PutSeite("/Domain [0 1]\n");
if (DoSep)
{
int pla = Plate - 1 < 0 ? 3 : Plate - 1;
QStringList cols1 = QStringList::split(" ", Colors[c]);
QStringList cols2 = QStringList::split(" ", Colors[c+1]);
PutSeite("/C1 ["+ToStr(1-cols1[pla].toDouble())+"]\n");
PutSeite("/C0 ["+ToStr(1-cols2[pla].toDouble())+"]\n");
}
else
{
PutSeite("/C0 ["+Colors[c]+"]\n");
PutSeite("/C1 ["+Colors[c+1]+"]\n");
}
PutSeite("/N 1\n");
PutSeite(">>\n");
PutSeite(">>\n");
PutSeite("shfill\n");
}
PutSeite("cliprestore\n");
}
 
void PSLib::PS_LinGradient(double w, double h, double x1, double y1, double x2, double y2, int item, int grad)
{
if (item == 1)
PutSeite("-"+ToStr(w / 2.0)+" "+ToStr(-h / 2.0)+" tr\n");
PutSeite( "clipsave\n" );
PutSeite("eoclip\n");
PutSeite("<<\n");
PutSeite("/ShadingType 2\n");
PutSeite( DoSep ? "/ColorSpace /DeviceGray\n" : "/ColorSpace /DeviceCMYK\n" );
switch (grad)
{
case 1:
PutSeite("/Coords [0 "+ToStr(h / 2.0)+" "+ToStr(w)+" "+ToStr(h / 2.0)+"]\n");
break;
case 2:
PutSeite("/Coords ["+ToStr(w / 2.0)+" 0 "+ToStr(w / 2.0)+" "+ToStr(h)+"]\n");
break;
case 3:
PutSeite("/Coords [0 0 "+ToStr(w)+" "+ToStr(h)+"]\n");
break;
case 4:
PutSeite("/Coords ["+ToStr(w)+" 0 0 "+ToStr(h)+"]\n");
break;
case 6:
PutSeite("/Coords ["+ToStr(x1)+" "+ToStr(y1)+" "+ToStr(x2)+" "+ToStr(y2)+"]\n");
break;
}
PutSeite("/Coords ["+ToStr(x1)+" "+ToStr(y1)+" "+ToStr(x2)+" "+ToStr(y2)+"]\n");
PutSeite("/BBox [0 "+ToStr(h)+" "+ToStr(w)+" 0]\n");
PutSeite(DoSep ? QString("/Background [0]\n") : QString("/Background ["+FillColor+"]\n"));
if (grad == 6)
PutSeite("/Extend [true true]\n");
else
582,29 → 659,13
int pla = Plate - 1 < 0 ? 3 : Plate - 1;
QStringList cols1 = QStringList::split(" ", GrColor2);
QStringList cols2 = QStringList::split(" ", GrColor1);
if (grad == 4)
{
PutSeite("/C0 ["+ToStr(1-cols1[pla].toDouble())+"]\n");
PutSeite("/C1 ["+ToStr(1-cols2[pla].toDouble())+"]\n");
}
else
{
PutSeite("/C1 ["+ToStr(1-cols1[pla].toDouble())+"]\n");
PutSeite("/C0 ["+ToStr(1-cols2[pla].toDouble())+"]\n");
}
PutSeite("/C1 ["+ToStr(1-cols1[pla].toDouble())+"]\n");
PutSeite("/C0 ["+ToStr(1-cols2[pla].toDouble())+"]\n");
}
else
{
if (grad == 4)
{
PutSeite("/C1 ["+GrColor1+"]\n");
PutSeite("/C0 ["+GrColor2+"]\n");
}
else
{
PutSeite("/C0 ["+GrColor1+"]\n");
PutSeite("/C1 ["+GrColor2+"]\n");
}
PutSeite("/C0 ["+GrColor1+"]\n");
PutSeite("/C1 ["+GrColor2+"]\n");
}
PutSeite("/N 1\n");
PutSeite(">>\n");
617,8 → 678,7
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");
rad = QMAX(w, fabs(h)) / 2.0;
PutSeite( "clipsave\n" );
PutSeite("eoclip\n");
PutSeite("<<\n");
626,7 → 686,6
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");
PutSeite( DoSep ? QString("/Background [0]\n") : "/Background ["+FillColor+"]\n" );
PutSeite("/Extend [true true]\n");
PutSeite("/Function\n");
PutSeite("<<\n");
635,36 → 694,20
if (DoSep)
{
int pla = Plate - 1 < 0 ? 3 : Plate - 1;
QStringList cols1 = QStringList::split(" ", GrColor2);
QStringList cols2 = QStringList::split(" ", GrColor1);
QStringList cols1 = QStringList::split(" ", GrColor1);
QStringList cols2 = QStringList::split(" ", GrColor2);
PutSeite("/C0 ["+ToStr(1-cols1[pla].toDouble())+"]\n");
PutSeite("/C1 ["+ToStr(1-cols2[pla].toDouble())+"]\n");
}
else
{
PutSeite("/C0 ["+GrColor2+"]\n");
PutSeite("/C1 ["+GrColor1+"]\n");
PutSeite("/C0 ["+GrColor1+"]\n");
PutSeite("/C1 ["+GrColor2+"]\n");
}
PutSeite("/N 1\n");
PutSeite(">>\n");
PutSeite(">>\n");
if (item == 1)
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))
PutSeite("-"+ToStr(w2*(w2 / rad)-w2)+" 0 tr\n");
else
{
if (w < fabs(h))
PutSeite("0 "+ToStr(fabs(h2)*(fabs(h2) /rad)-fabs(h2))+" tr\n");
}
}
PutSeite(ToStr(w2 / rad)+" "+ToStr(fabs(h2) / rad)+" scale\n");
PutSeite("shfill\ncliprestore\n");
PutSeite("cmtx setmatrix\n");
}
 
void PSLib::PS_show_xyG(QString font, QString ch, double x, double y)
/trunk/Scribus/scribus/libabout/about.cpp
56,7 → 56,7
tabLayout1->addWidget( PixmapLabel1 );
BuildID = new QLabel( tab, "BB" );
BuildID->setAlignment(Qt::AlignCenter);
QString bu = tr("%1. %2 %3 ").arg("25").arg("May").arg("2004");
QString bu = tr("%1. %2 %3 ").arg("29").arg("May").arg("2004");
#ifdef HAVE_CMS
bu += "C";
#else
/trunk/Scribus/scribus/Makefile.am
1,13 → 1,13
bin_PROGRAMS = scribus
 
scribus_SOURCES = art_kmisc.c art_render_misc.c art_render_pattern.c art_rgb.c art_rgb_affine_private.c art_rgb_svp.c art_rgba_affine.c gdk-pixbuf-xlib-drawable.c gdk-pixbuf-xlib-render.c gdk-pixbuf-xlib.c gdk-pixbuf-xlibrgb.c measurements.cpp tabruler.cpp insertTable.cpp pageselector.cpp shadebutton.cpp alignselect.cpp styleselect.cpp search.cpp tabmanager.cpp fparser.cpp autoform.cpp story.cpp vgradient.cpp scpainter.cpp fontcombo.cpp scpreview.cpp lineformats.cpp multiline.cpp splash.cpp mergedoc.cpp bookpalette.cpp rc4.c md5.c cupsoptions.cpp guidemanager.cpp scribuswin.cpp hyphenator.cpp hyphen.c hyask.cpp hnjalloc.c hysettings.cpp seiten.cpp fpointarray.cpp fpoint.cpp annota.cpp buttonicon.cpp javadocs.cpp selfield.cpp editor.cpp page.cpp layers.cpp polyprops.cpp mpalette.cpp werktoolb.cpp keymanager.cpp navigator.cpp annot.cpp bookmwin.cpp cmsprefs.cpp customfdialog.cpp picsearch.cpp picstatus.cpp newtemp.cpp applytemplate.cpp muster.cpp scfonts_ttf.cpp scrap.cpp scfonts.cpp frameedit.cpp spalette.cpp edit1format.cpp editformats.cpp druck.cpp colorchart.cpp util.cpp cmykcolor.cpp cmykfw.cpp scribusXml.cpp linecombo.cpp linkbutton.cpp helpbrowser.cpp mspinbox.cpp movepage.cpp delpages.cpp inspage.cpp pdfopts.cpp tree.cpp missing.cpp fontprefs.cpp fmitem.cpp align.cpp serializer.cpp reformdoc.cpp docinfo.cpp mdup.cpp cpalette.cpp dcolor.cpp query.cpp colorm.cpp vruler.cpp hruler.cpp pageback.cpp pageitem.cpp newfile.cpp scribusview.cpp scribusdoc.cpp scribus.cpp main.cpp
SOURCES = art_kmisc.c art_render_misc.c art_render_pattern.c art_rgb.c art_rgb_affine_private.c art_rgb_svp.c art_rgba_affine.c gdk-pixbuf-xlib-drawable.c gdk-pixbuf-xlib-render.c gdk-pixbuf-xlib.c gdk-pixbuf-xlibrgb.c measurements.cpp tabruler.cpp insertTable.cpp pageselector.cpp shadebutton.cpp alignselect.cpp styleselect.cpp search.cpp tabmanager.cpp fparser.cpp autoform.cpp story.cpp vgradient.cpp scpainter.cpp libpdf/pdflib.cpp libpostscript/pslib.cpp plugins/libchar/charselect.cpp libprefs/prefs.cpp libabout/about.cpp fontcombo.cpp scpreview.cpp lineformats.cpp multiline.cpp splash.cpp mergedoc.cpp bookpalette.cpp rc4.c md5.c cupsoptions.cpp guidemanager.cpp scribuswin.cpp hyphenator.cpp hyphen.c hyask.cpp hnjalloc.c hysettings.cpp seiten.cpp fpointarray.cpp fpoint.cpp annota.cpp buttonicon.cpp javadocs.cpp selfield.cpp editor.cpp page.cpp layers.cpp polyprops.cpp mpalette.cpp werktoolb.cpp keymanager.cpp navigator.cpp annot.cpp bookmwin.cpp cmsprefs.cpp customfdialog.cpp picsearch.cpp picstatus.cpp newtemp.cpp applytemplate.cpp muster.cpp scfonts_ttf.cpp scrap.cpp scfonts.cpp frameedit.cpp spalette.cpp edit1format.cpp editformats.cpp druck.cpp colorchart.cpp util.cpp cmykcolor.cpp cmykfw.cpp scribusXml.cpp linecombo.cpp linkbutton.cpp helpbrowser.cpp mspinbox.cpp movepage.cpp delpages.cpp inspage.cpp pdfopts.cpp tree.cpp missing.cpp fontprefs.cpp fmitem.cpp align.cpp serializer.cpp reformdoc.cpp docinfo.cpp mdup.cpp cpalette.cpp dcolor.cpp query.cpp colorm.cpp vruler.cpp hruler.cpp pageback.cpp pageitem.cpp newfile.cpp scribusview.cpp scribusdoc.cpp scribus.cpp main.cpp
scribus_SOURCES = art_kmisc.c art_render_misc.c art_render_pattern.c art_rgb.c art_rgb_affine_private.c art_rgb_svp.c art_rgba_affine.c gdk-pixbuf-xlib-drawable.c gdk-pixbuf-xlib-render.c gdk-pixbuf-xlib.c gdk-pixbuf-xlibrgb.c gradienteditor.cpp measurements.cpp tabruler.cpp insertTable.cpp pageselector.cpp shadebutton.cpp alignselect.cpp styleselect.cpp search.cpp tabmanager.cpp fparser.cpp autoform.cpp story.cpp vgradient.cpp scpainter.cpp fontcombo.cpp scpreview.cpp lineformats.cpp multiline.cpp splash.cpp mergedoc.cpp bookpalette.cpp rc4.c md5.c cupsoptions.cpp guidemanager.cpp scribuswin.cpp hyphenator.cpp hyphen.c hyask.cpp hnjalloc.c hysettings.cpp seiten.cpp fpointarray.cpp fpoint.cpp annota.cpp buttonicon.cpp javadocs.cpp selfield.cpp editor.cpp page.cpp layers.cpp polyprops.cpp mpalette.cpp werktoolb.cpp keymanager.cpp navigator.cpp annot.cpp bookmwin.cpp cmsprefs.cpp customfdialog.cpp picsearch.cpp picstatus.cpp newtemp.cpp applytemplate.cpp muster.cpp scfonts_ttf.cpp scrap.cpp scfonts.cpp frameedit.cpp spalette.cpp edit1format.cpp editformats.cpp druck.cpp colorchart.cpp util.cpp cmykcolor.cpp cmykfw.cpp scribusXml.cpp linecombo.cpp linkbutton.cpp helpbrowser.cpp mspinbox.cpp movepage.cpp delpages.cpp inspage.cpp pdfopts.cpp tree.cpp missing.cpp fontprefs.cpp fmitem.cpp align.cpp serializer.cpp reformdoc.cpp docinfo.cpp mdup.cpp cpalette.cpp dcolor.cpp query.cpp colorm.cpp vruler.cpp hruler.cpp pageback.cpp pageitem.cpp newfile.cpp scribusview.cpp scribusdoc.cpp scribus.cpp main.cpp
SOURCES = art_kmisc.c art_render_misc.c art_render_pattern.c art_rgb.c art_rgb_affine_private.c art_rgb_svp.c art_rgba_affine.c gdk-pixbuf-xlib-drawable.c gdk-pixbuf-xlib-render.c gdk-pixbuf-xlib.c gdk-pixbuf-xlibrgb.c gradienteditor.cpp measurements.cpp tabruler.cpp insertTable.cpp pageselector.cpp shadebutton.cpp alignselect.cpp styleselect.cpp search.cpp tabmanager.cpp fparser.cpp autoform.cpp story.cpp vgradient.cpp scpainter.cpp libpdf/pdflib.cpp libpostscript/pslib.cpp plugins/libchar/charselect.cpp libprefs/prefs.cpp libabout/about.cpp fontcombo.cpp scpreview.cpp lineformats.cpp multiline.cpp splash.cpp mergedoc.cpp bookpalette.cpp rc4.c md5.c cupsoptions.cpp guidemanager.cpp scribuswin.cpp hyphenator.cpp hyphen.c hyask.cpp hnjalloc.c hysettings.cpp seiten.cpp fpointarray.cpp fpoint.cpp annota.cpp buttonicon.cpp javadocs.cpp selfield.cpp editor.cpp page.cpp layers.cpp polyprops.cpp mpalette.cpp werktoolb.cpp keymanager.cpp navigator.cpp annot.cpp bookmwin.cpp cmsprefs.cpp customfdialog.cpp picsearch.cpp picstatus.cpp newtemp.cpp applytemplate.cpp muster.cpp scfonts_ttf.cpp scrap.cpp scfonts.cpp frameedit.cpp spalette.cpp edit1format.cpp editformats.cpp druck.cpp colorchart.cpp util.cpp cmykcolor.cpp cmykfw.cpp scribusXml.cpp linecombo.cpp linkbutton.cpp helpbrowser.cpp mspinbox.cpp movepage.cpp delpages.cpp inspage.cpp pdfopts.cpp tree.cpp missing.cpp fontprefs.cpp fmitem.cpp align.cpp serializer.cpp reformdoc.cpp docinfo.cpp mdup.cpp cpalette.cpp dcolor.cpp query.cpp colorm.cpp vruler.cpp hruler.cpp pageback.cpp pageitem.cpp newfile.cpp scribusview.cpp scribusdoc.cpp scribus.cpp main.cpp
INTERFACES =
TRANSLATIONS =
 
SUBDIRS = icons libabout libprefs plugins libpostscript libpdf profiles dicts po qm
 
EXTRA_DIST = main.cpp scribus.cpp scribus.h scribusdoc.cpp scribusdoc.h scribusview.cpp scribusview.h newfile.h newfile.cpp pageitem.cpp pageitem.h pageback.cpp pageback.h hruler.cpp hruler.h vruler.cpp vruler.h colorm.cpp colorm.h query.cpp query.h dcolor.cpp dcolor.h cpalette.cpp cpalette.h mdup.cpp mdup.h docinfo.cpp docinfo.h reformdoc.cpp reformdoc.h serializer.cpp serializer.h align.cpp align.h fmitem.cpp fmitem.h fontprefs.cpp fontprefs.h missing.cpp missing.h tree.cpp tree.h pdfopts.cpp pdfopts.h inspage.cpp inspage.h delpages.cpp delpages.h movepage.cpp movepage.h mspinbox.cpp mspinbox.h helpbrowser.cpp helpbrowser.h icons5.h linkbutton.cpp linkbutton.h icons6.h linecombo.cpp linecombo.h scribusXml.cpp scribusXml.h cmykfw.cpp cmykfw.h cmykcolor.cpp cmykcolor.h util.cpp colorchart.cpp colorchart.h druck.cpp druck.h editformats.cpp editformats.h edit1format.cpp edit1format.h spalette.cpp spalette.h frameedit.cpp frameedit.h scfonts.cpp scfonts.h scrap.cpp scrap.h scfonts_ttf.cpp scfonts_ttf.h muster.cpp muster.h applytemplate.cpp applytemplate.h newtemp.cpp newtemp.h picstatus.cpp picstatus.h picsearch.cpp picsearch.h customfdialog.cpp customfdialog.h cmsprefs.cpp cmsprefs.h bookmwin.cpp bookmwin.h annot.cpp annot.h navigator.cpp navigator.h keymanager.cpp keymanager.h werktoolb.cpp werktoolb.h mpalette.h mpalette.cpp polyprops.cpp polyprops.h layers.cpp layers.h page.cpp page.h editor.cpp editor.h selfield.cpp selfield.h javadocs.cpp javadocs.h buttonicon.cpp buttonicon.h annota.cpp annota.h fpoint.cpp fpoint.h fpointarray.cpp fpointarray.h seiten.cpp seiten.h hysettings.cpp hysettings.h hnjalloc.c hnjalloc.h hyask.cpp hyask.h hyphen.c hyphen.h hyphenator.cpp hyphenator.h scribuswin.cpp scribuswin.h guidemanager.cpp guidemanager.h cupsoptions.cpp cupsoptions.h md5.c md5.h rc4.c rc4.h mergedoc.cpp mergedoc.h bookpalette.cpp bookpalette.h splash.h fontcombo.h scpainter.cpp scpainter.h vgradient.cpp vgradient.h story.cpp story.h autoform.cpp autoform.h fparser.cpp fparser.h tabmanager.cpp tabmanager.h search.cpp search.h styleselect.cpp styleselect.h alignselect.cpp alignselect.h shadebutton.cpp shadebutton.h pageselector.cpp pageselector.h insertTable.cpp insertTable.h art_kmisc.c art_kmisc.h art_render_misc.c art_render_misc.h art_render_pattern.c art_render_pattern.h art_rgb.c art_rgb.h art_rgb_affine_private.c art_rgb_affine_private.h art_rgb_svp.c art_rgb_svp.h art_rgba_affine.c art_rgba_affine.h gdk-pixbuf-xlib-drawable.c gdk-pixbuf-xlib-private.h gdk-pixbuf-xlib-render.c gdk-pixbuf-xlib.c gdk-pixbuf-xlib.h gdk-pixbuf-xlibrgb.c gdk-pixbuf-xlibrgb.h LoremIpsum.txt rgbscribus.txt rgbscribusgreys.txt rgbscribusgnome.txt rgbsvg.txt
EXTRA_DIST = main.cpp scribus.cpp scribus.h scribusdoc.cpp scribusdoc.h scribusview.cpp scribusview.h newfile.h newfile.cpp pageitem.cpp pageitem.h pageback.cpp pageback.h hruler.cpp hruler.h vruler.cpp vruler.h colorm.cpp colorm.h query.cpp query.h dcolor.cpp dcolor.h cpalette.cpp cpalette.h mdup.cpp mdup.h docinfo.cpp docinfo.h reformdoc.cpp reformdoc.h serializer.cpp serializer.h align.cpp align.h fmitem.cpp fmitem.h fontprefs.cpp fontprefs.h missing.cpp missing.h tree.cpp tree.h pdfopts.cpp pdfopts.h inspage.cpp inspage.h delpages.cpp delpages.h movepage.cpp movepage.h mspinbox.cpp mspinbox.h helpbrowser.cpp helpbrowser.h icons5.h linkbutton.cpp linkbutton.h icons6.h linecombo.cpp linecombo.h scribusXml.cpp scribusXml.h cmykfw.cpp cmykfw.h cmykcolor.cpp cmykcolor.h util.cpp colorchart.cpp colorchart.h druck.cpp druck.h editformats.cpp editformats.h edit1format.cpp edit1format.h spalette.cpp spalette.h frameedit.cpp frameedit.h scfonts.cpp scfonts.h scrap.cpp scrap.h scfonts_ttf.cpp scfonts_ttf.h muster.cpp muster.h applytemplate.cpp applytemplate.h newtemp.cpp newtemp.h picstatus.cpp picstatus.h picsearch.cpp picsearch.h customfdialog.cpp customfdialog.h cmsprefs.cpp cmsprefs.h bookmwin.cpp bookmwin.h annot.cpp annot.h navigator.cpp navigator.h keymanager.cpp keymanager.h werktoolb.cpp werktoolb.h mpalette.h mpalette.cpp polyprops.cpp polyprops.h layers.cpp layers.h page.cpp page.h editor.cpp editor.h selfield.cpp selfield.h javadocs.cpp javadocs.h buttonicon.cpp buttonicon.h annota.cpp annota.h fpoint.cpp fpoint.h fpointarray.cpp fpointarray.h seiten.cpp seiten.h hysettings.cpp hysettings.h hnjalloc.c hnjalloc.h hyask.cpp hyask.h hyphen.c hyphen.h hyphenator.cpp hyphenator.h scribuswin.cpp scribuswin.h guidemanager.cpp guidemanager.h cupsoptions.cpp cupsoptions.h md5.c md5.h rc4.c rc4.h mergedoc.cpp mergedoc.h bookpalette.cpp bookpalette.h splash.h fontcombo.h scpainter.cpp scpainter.h vgradient.cpp vgradient.h story.cpp story.h autoform.cpp autoform.h fparser.cpp fparser.h tabmanager.cpp tabmanager.h search.cpp search.h styleselect.cpp styleselect.h alignselect.cpp alignselect.h shadebutton.cpp shadebutton.h pageselector.cpp gradienteditor.cpp gradienteditor.h pageselector.h insertTable.cpp insertTable.h art_kmisc.c art_kmisc.h art_render_misc.c art_render_misc.h art_render_pattern.c art_render_pattern.h art_rgb.c art_rgb.h art_rgb_affine_private.c art_rgb_affine_private.h art_rgb_svp.c art_rgb_svp.h art_rgba_affine.c art_rgba_affine.h gdk-pixbuf-xlib-drawable.c gdk-pixbuf-xlib-private.h gdk-pixbuf-xlib-render.c gdk-pixbuf-xlib.c gdk-pixbuf-xlib.h gdk-pixbuf-xlibrgb.c gdk-pixbuf-xlibrgb.h LoremIpsum.txt rgbscribus.txt rgbscribusgreys.txt rgbscribusgnome.txt rgbsvg.txt
 
install-data-local:
$(mkinstalldirs) $(prefix)/share/scribus/samples/
/trunk/Scribus/scribus/scribus.cpp
519,7 → 519,9
connect(Mpal->Cpal, SIGNAL(NewBrushShade(int)), this, SLOT(setBrushShade(int)));
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(NewGradient(int)), this, SLOT(setGradFill(int)));
connect(Mpal->Cpal->GradEdit, SIGNAL(gradientChanged()), this, SLOT(updtGradFill()));
connect(Mpal->Cpal, SIGNAL(gradientChanged()), this, SLOT(updtGradFill()));
connect(Mpal->Cpal, SIGNAL(QueryItem()), this, SLOT(GetBrushPen()));
connect(Tpal, SIGNAL(Schliessen()), this, SLOT(ToggleTpal()));
connect(Tpal, SIGNAL(SelectElement(int, int)), this, SLOT(SelectFromOutl(int, int)));
2844,6 → 2846,18
recentMenu->insertItem(RecentDocs[m]);
}
}
void ScribusApp::RemoveRecent(QString fn)
{
recentMenu->clear();
if (RecentDocs.findIndex(fn) != -1)
RecentDocs.remove(fn);
uint max = QMIN(Prefs.RecentDCount, RecentDocs.count());
for (uint m = 0; m < max; ++m)
{
recentMenu->insertItem(RecentDocs[m]);
}
}
 
void ScribusApp::LoadRecent(int id)
{
4224,7 → 4238,7
connect(doc->ActPage, SIGNAL(SetLineArt(PenStyle, PenCapStyle, PenJoinStyle)), Mpal, SLOT( setLIvalue(PenStyle, PenCapStyle, PenJoinStyle)));
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(ItemGradient(int)), Mpal->Cpal, SLOT(setActGradient(int)));
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)));
5629,6 → 5643,7
CListe edc;
QMap<QString,QString> ers;
PageItem *ite;
QColor tmpc;
if (HaveDoc)
edc = doc->PageColors;
else
5686,11 → 5701,16
ite->Pcolor = it.data();
if (it.key() == ite->Pcolor2)
ite->Pcolor2 = it.data();
if (it.key() == ite->GrColor)
ite->GrColor = it.data();
if (it.key() == ite->GrColor2)
ite->GrColor2 = it.data();
view->DocPages.at(b)->AdjItemGradient(ite, ite->GrType, ite->GrColor2, ite->GrShade2, ite->GrColor, ite->GrShade);
QPtrVector<VColorStop> cstops = ite->fill_gradient.colorStops();
for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
{
if (it.key() == cstops.at(cst)->name)
{
ite->SetFarbe(&tmpc, it.data(), cstops.at(cst)->shade);
cstops.at(cst)->color = tmpc;
cstops.at(cst)->name = it.data();
}
}
}
}
}
5715,11 → 5735,16
ite->Pcolor = it.data();
if (it.key() == ite->Pcolor2)
ite->Pcolor2 = it.data();
if (it.key() == ite->GrColor)
ite->GrColor = it.data();
if (it.key() == ite->GrColor2)
ite->GrColor2 = it.data();
view->MasterPages.at(b)->AdjItemGradient(ite, ite->GrType, ite->GrColor2, ite->GrShade2, ite->GrColor, ite->GrShade);
QPtrVector<VColorStop> cstops = ite->fill_gradient.colorStops();
for (uint cst = 0; cst < ite->fill_gradient.Stops(); ++cst)
{
if (it.key() == cstops.at(cst)->name)
{
ite->SetFarbe(&tmpc, it.data(), cstops.at(cst)->shade);
cstops.at(cst)->color = tmpc;
cstops.at(cst)->name = it.data();
}
}
}
}
}
5779,16 → 5804,31
}
}
 
void ScribusApp::setGradFill(int typ, QString col1, int sh1, QString col2, int sh2)
void ScribusApp::setGradFill(int typ)
{
setActiveWindow();
if (HaveDoc)
{
doc->ActPage->ItemGradFill(typ, col1, sh1, col2, sh2);
doc->ActPage->ItemGradFill(typ);
slotDocCh();
}
}
 
void ScribusApp::updtGradFill()
{
setActiveWindow();
if (HaveDoc)
{
if (doc->ActPage->SelItem.count() != 0)
{
PageItem *b = doc->ActPage->SelItem.at(0);
b->fill_gradient = Mpal->Cpal->GradEdit->fill_gradient;
doc->ActPage->RefreshItem(b);
slotDocCh();
}
}
}
 
void ScribusApp::GetBrushPen()
{
setActiveWindow();
/trunk/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
143,6 → 143,7
ret = true;
}
Doku = Prog->doc;
Doku->ActPage->Deselect();
Elements.clear();
Doku->loading = true;
Doku->DoDrawing = false;
518,7 → 519,7
else
ite->GrEndY = QMAX(QMIN(gc->GY2, ite->Height), 0);
Doku->ActPage->SelItem.append(ite);
Doku->ActPage->ItemGradFill(gc->Gradient, gc->GCol2, 100, gc->GCol1, 100);
// Doku->ActPage->ItemGradFill(gc->Gradient, gc->GCol2, 100, gc->GCol1, 100);
Doku->ActPage->SelItem.clear();
}
GElements.append(ite);
/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
201,7 → 201,7
if (Item->GrType != 0)
{
defi = docu->createElement("defs");
if (Item->GrType == 5)
if ((Item->GrType == 5) || (Item->GrType == 7))
grad = docu->createElement("radialGradient");
else
grad = docu->createElement("linearGradient");
228,13 → 228,13
grad.setAttribute("y2", FToStr(Item->Height));
break;
case 4:
grad.setAttribute("x1", FToStr(Item->Width));
grad.setAttribute("y1", "0");
grad.setAttribute("x2", "0");
grad.setAttribute("y2", FToStr(Item->Height));
grad.setAttribute("x1", "0");
grad.setAttribute("y1", FToStr(Item->Height));
grad.setAttribute("x2", FToStr(Item->Width));
grad.setAttribute("y2", "0");
break;
case 5:
grad.setAttribute("r", FToStr(QMIN(Item->Width / 2, Item->Height / 2)));
grad.setAttribute("r", FToStr(QMAX(Item->Width / 2, Item->Height / 2)));
grad.setAttribute("cx", FToStr(Item->Width / 2));
grad.setAttribute("cy", FToStr(Item->Height / 2));
break;
244,21 → 244,21
grad.setAttribute("x2", FToStr(Item->GrEndX));
grad.setAttribute("y2", FToStr(Item->GrEndY));
break;
case 7:
grad.setAttribute("r", FToStr(QMAX(Item->Width / 2, Item->Height / 2)));
grad.setAttribute("cx", FToStr(Item->GrStartX));
grad.setAttribute("cy", FToStr(Item->GrStartY));
break;
}
QDomElement s1 = docu->createElement("stop");
s1.setAttribute("offset","0%");
if ((Item->GrType == 5) || (Item->GrType == 4))
s1.setAttribute("stop-color",SetFarbe(Item->GrColor, Item->GrShade, plug));
else
s1.setAttribute("stop-color",SetFarbe(Item->GrColor2, Item->GrShade2, plug));
grad.appendChild(s1);
QDomElement s2 = docu->createElement("stop");
s2.setAttribute("offset","100%");
if ((Item->GrType == 5) || (Item->GrType == 4))
s2.setAttribute("stop-color",SetFarbe(Item->GrColor2, Item->GrShade2, plug));
else
s2.setAttribute("stop-color",SetFarbe(Item->GrColor, Item->GrShade, plug));
grad.appendChild(s2);
QPtrVector<VColorStop> cstops = Item->fill_gradient.colorStops();
for (uint cst = 0; cst < Item->fill_gradient.Stops(); ++cst)
{
QDomElement itcl = docu->createElement("stop");
itcl.setAttribute("offset", FToStr(cstops.at(cst)->rampPoint*100)+"%");
itcl.setAttribute("stop-opacity", FToStr(cstops.at(cst)->opacity));
itcl.setAttribute("stop-color", SetFarbe(cstops.at(cst)->name, cstops.at(cst)->shade, plug));
grad.appendChild(itcl);
}
defi.appendChild(grad);
fill = "fill:url(#"+gradi+IToStr(GradCount)+");";
GradCount++;
/trunk/Scribus/scribus/page.cpp
1374,6 → 1374,21
SetFrameRound(b);
break;
}
if ((b->OldB2 != 0) && (b->OldH2 != 0))
{
double scx = b->Width / b->OldB2;
double scy = b->Height / b->OldH2;
QWMatrix ma;
ma.scale(scx, scy);
FPointArray gr;
gr.addPoint(b->GrStartX, b->GrStartY);
gr.addPoint(b->GrEndX, b->GrEndY);
gr.map(ma);
b->GrStartX = gr.point(0).x();
b->GrStartY = gr.point(0).y();
b->GrEndX = gr.point(1).x();
b->GrEndY = gr.point(0).y();
}
b->OldB2 = b->Width;
b->OldH2 = b->Height;
}
1523,6 → 1538,7
}
UpdateClip(b);
}
updateGradientVectors(b);
RepaintTextRegion(b, alt);
if (!fromMP)
{
2540,7 → 2556,7
emit SetSizeValue(b->Pwidth);
emit SetLineArt(b->PLineArt, b->PLineEnd, b->PLineJoin);
emit ItemFarben(b->Pcolor2, b->Pcolor, b->Shade2, b->Shade);
emit ItemGradient(b->GrColor2, b->GrColor, b->GrShade2, b->GrShade, b->GrType);
emit ItemGradient(b->GrType);
emit ItemTrans(b->Transparency, b->TranspStroke);
emit HaveSel(7);
}
5099,7 → 5115,7
emit SetSizeValue(b->Pwidth);
emit SetLineArt(b->PLineArt, b->PLineEnd, b->PLineJoin);
emit ItemFarben(b->Pcolor2, b->Pcolor, b->Shade2, b->Shade);
emit ItemGradient(b->GrColor2, b->GrColor, b->GrShade2, b->GrShade, b->GrType);
emit ItemGradient(b->GrType);
emit ItemTrans(b->Transparency, b->TranspStroke);
emit HaveSel(5);
break;
5252,7 → 5268,7
emit SetSizeValue(b->Pwidth);
emit SetLineArt(b->PLineArt, b->PLineEnd, b->PLineJoin);
emit ItemFarben(b->Pcolor2, b->Pcolor, b->Shade2, b->Shade);
emit ItemGradient(b->GrColor2, b->GrColor, b->GrShade2, b->GrShade, b->GrType);
emit ItemGradient(b->GrType);
emit ItemTrans(b->Transparency, b->TranspStroke);
emit HaveSel(6);
break;
5307,7 → 5323,7
emit SetSizeValue(b->Pwidth);
emit SetLineArt(b->PLineArt, b->PLineEnd, b->PLineJoin);
emit ItemFarben(b->Pcolor2, b->Pcolor, b->Shade2, b->Shade);
emit ItemGradient(b->GrColor2, b->GrColor, b->GrShade2, b->GrShade, b->GrType);
emit ItemGradient(b->GrType);
emit ItemTrans(b->Transparency, b->TranspStroke);
emit HaveSel(7);
break;
7284,9 → 7300,9
QString c1 = typ == 5 ? col2 : col1, c2 = typ == 5 ? col1 : col2;
int s1 = typ == 5 ? sh2 : sh1, s2 = typ == 5 ? sh1 : sh2;
b->SetFarbe(&tmp, c1, s1);
b->fill_gradient.addStop(tmp, 0.0, 0.5, 1.0);
b->fill_gradient.addStop(tmp, 0.0, 0.5, 1.0, c1, s1);
b->SetFarbe(&tmp, c2, s2);
b->fill_gradient.addStop(tmp, 1.0, 0.5, 1.0);
b->fill_gradient.addStop(tmp, 1.0, 0.5, 1.0, c2, s2);
b->GrColor2 = col1;
b->GrShade2 = sh1;
b->GrColor = col2;
7293,16 → 7309,13
b->GrShade = sh2;
b->GrType = typ;
updateGradientVectors(b);
ScApp->Mpal->Cpal->setSpecialGradient(b->GrStartX * UmReFaktor, b->GrStartY * UmReFaktor,
b->GrEndX * UmReFaktor, b->GrEndY * UmReFaktor,
b->Width * UmReFaktor, b->Height * UmReFaktor);
}
 
void Page::ItemGradFill(int typ, QString col1, int sh1, QString col2, int sh2)
void Page::ItemGradFill(int typ)
{
uint a;
PageItem *i;
QString col1c, col2c;
/* QString col1c, col2c;
if ((col1 == "None") || (col1 == ""))
col1c = doku->PageColors.begin().key();
else
7310,13 → 7323,14
if ((col2 == "None") || (col2 == ""))
col2c = doku->PageColors.begin().key();
else
col2c = col2;
col2c = col2; */
if (SelItem.count() != 0)
{
for (a = 0; a < SelItem.count(); ++a)
{
i = SelItem.at(a);
AdjItemGradient(i, typ, col1c, sh1, col2c, sh2);
i->GrType = typ;
updateGradientVectors(i);
RefreshItem(i);
}
}
7618,7 → 7632,7
if (GetItem(&b))
{
emit ItemFarben(b->Pcolor2, b->Pcolor, b->Shade2, b->Shade);
emit ItemGradient(b->GrColor2, b->GrColor, b->GrShade2, b->GrShade, b->GrType);
emit ItemGradient(b->GrType);
emit ItemTrans(b->Transparency, b->TranspStroke);
}
}
8473,29 → 8487,30
b->IFont = doku->Dfont;
if (Buffer->GrType != 0)
{
b->fill_gradient.clearStops();
if (Buffer->GrType == 5)
if ((Buffer->GrColor != "") && (Buffer->GrColor2 != ""))
{
if ((Buffer->GrColor != "None") && (Buffer->GrColor != ""))
b->SetFarbe(&tmp, Buffer->GrColor, Buffer->GrShade);
b->fill_gradient.addStop(tmp, 0.0, 0.5, 1.0);
if ((Buffer->GrColor2 != "None") && (Buffer->GrColor2 != ""))
b->SetFarbe(&tmp, Buffer->GrColor2, Buffer->GrShade2);
b->fill_gradient.addStop(tmp, 1.0, 0.5, 1.0);
b->fill_gradient.clearStops();
if (Buffer->GrType == 5)
{
if ((Buffer->GrColor != "None") && (Buffer->GrColor != ""))
b->SetFarbe(&tmp, Buffer->GrColor, Buffer->GrShade);
b->fill_gradient.addStop(tmp, 0.0, 0.5, 1.0, Buffer->GrColor, Buffer->GrShade);
if ((Buffer->GrColor2 != "None") && (Buffer->GrColor2 != ""))
b->SetFarbe(&tmp, Buffer->GrColor2, Buffer->GrShade2);
b->fill_gradient.addStop(tmp, 1.0, 0.5, 1.0, Buffer->GrColor2, Buffer->GrShade2);
}
else
{
if ((Buffer->GrColor2 != "None") && (Buffer->GrColor2 != ""))
b->SetFarbe(&tmp, Buffer->GrColor2, Buffer->GrShade2);
b->fill_gradient.addStop(tmp, 0.0, 0.5, 1.0, Buffer->GrColor2, Buffer->GrShade2);
if ((Buffer->GrColor != "None") && (Buffer->GrColor != ""))
b->SetFarbe(&tmp, Buffer->GrColor, Buffer->GrShade);
b->fill_gradient.addStop(tmp, 1.0, 0.5, 1.0, Buffer->GrColor, Buffer->GrShade);
}
}
else
{
if ((Buffer->GrColor2 != "None") && (Buffer->GrColor2 != ""))
b->SetFarbe(&tmp, Buffer->GrColor2, Buffer->GrShade2);
b->fill_gradient.addStop(tmp, 0.0, 0.5, 1.0);
if ((Buffer->GrColor != "None") && (Buffer->GrColor != ""))
b->SetFarbe(&tmp, Buffer->GrColor, Buffer->GrShade);
b->fill_gradient.addStop(tmp, 1.0, 0.5, 1.0);
}
b->GrColor2 = Buffer->GrColor2;
b->GrShade2 = Buffer->GrShade2;
b->GrColor = Buffer->GrColor;
b->GrShade = Buffer->GrShade;
b->fill_gradient = Buffer->fill_gradient;
b->GrType = Buffer->GrType;
b->GrStartX = Buffer->GrStartX;
b->GrStartY = Buffer->GrStartY;
8557,6 → 8572,9
default:
break;
}
ScApp->Mpal->Cpal->setSpecialGradient(b->GrStartX * UmReFaktor, b->GrStartY * UmReFaktor,
b->GrEndX * UmReFaktor, b->GrEndY * UmReFaktor,
b->Width * UmReFaktor, b->Height * UmReFaktor);
}
 
void Page::SetupDraw(int nr)
8585,7 → 8603,7
emit SetLineArt(b->PLineArt, b->PLineEnd, b->PLineJoin);
emit SetLocalValues(b->LocalScX, b->LocalScY, b->LocalX, b->LocalY );
emit ItemFarben(b->Pcolor2, b->Pcolor, b->Shade2, b->Shade);
emit ItemGradient(b->GrColor2, b->GrColor, b->GrShade2, b->GrShade, b->GrType);
emit ItemGradient(b->GrType);
emit ItemTrans(b->Transparency, b->TranspStroke);
emit ItemTextAttr(b->LineSp);
emit ItemTextUSval(b->ExtraV);
/trunk/Scribus/scribus/scribus.h
227,6 → 227,7
void slotFileOpen();
void slotFileAppend();
/** open a document */
void RemoveRecent(QString fn);
void LoadRecent(int id);
bool slotDocOpen();
bool LadeDoc(QString fileName);
345,7 → 346,8
void setPenShade(int sh);
/** Setzt den Brush-Tonwert */
void setBrushShade(int sh);
void setGradFill(int typ, QString col1, int sh1, QString col2, int sh2);
void setGradFill(int typ);
void updtGradFill();
/** Setzt die Pen-Farbe */
void setPenFarbe(QString farbe);
/** Setzt die Brush-Farbe */
/trunk/Scribus/scribus/vgradient.h
1,16 → 1,16
/* This file is part of the KDE project
Copyright (C) 2002, The Karbon Developers
 
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
 
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
 
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
27,52 → 27,68
 
class VColorStop
{
public:
VColorStop( double r, double m, QColor c, double o )
{ rampPoint = r; midPoint = m; color = c; opacity = o; };
VColorStop( const VColorStop& colorStop )
{ rampPoint = colorStop.rampPoint;
midPoint = colorStop.midPoint;
color = colorStop.color;
opacity = colorStop.opacity; };
public:
VColorStop( double r, double m, QColor c, double o, QString n, int s )
{
rampPoint = r;
midPoint = m;
color = c;
opacity = o;
name = n;
shade = s;
};
VColorStop( const VColorStop& colorStop )
{
rampPoint = colorStop.rampPoint;
midPoint = colorStop.midPoint;
color = colorStop.color;
opacity = colorStop.opacity;
name = colorStop.name;
shade = colorStop.shade;
};
 
QColor color;
QColor color;
 
// relative position of color point (0.0-1.0):
double rampPoint;
// relative position of color point (0.0-1.0):
double rampPoint;
 
// relative position of midpoint (0.0-1.0)
// between two ramp points. ignored for last VColorStop.
double midPoint;
double opacity;
friend inline bool operator== ( VColorStop& s1, VColorStop& s2 )
{ return s1.rampPoint == s2.rampPoint; };
}; // VColorStop
// relative position of midpoint (0.0-1.0)
// between two ramp points. ignored for last VColorStop.
double midPoint;
double opacity;
int shade;
QString name;
friend inline bool operator== ( VColorStop& s1, VColorStop& s2 )
{ return s1.rampPoint == s2.rampPoint; };
}
; // VColorStop
 
class VGradient
{
// friend class VGradientWidget;
// friend class VGradientWidget;
 
public:
enum VGradientType
{
linear = 0,
radial = 1,
conic = 2
linear = 0,
radial = 1,
conic = 2
};
 
enum VGradientRepeatMethod
{
none = 0,
reflect = 1,
repeat = 2
none = 0,
reflect = 1,
repeat = 2
};
 
class VColorStopList : public QPtrList<VColorStop>
class VColorStopList : public QPtrList<VColorStop>
{
protected:
virtual int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 );
}; // VColorStopList
protected:
virtual int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 );
}
; // VColorStopList
 
VGradient( VGradientType type = linear );
VGradient( const VGradient& gradient );
87,8 → 103,9
 
const QPtrVector<VColorStop> colorStops() const;
void addStop( const VColorStop& colorStop );
void addStop( const QColor &color, double rampPoint, double midPoint, double opa );
void addStop( const QColor &color, double rampPoint, double midPoint, double opa, QString name = "", int shade = 100 );
void removeStop( const VColorStop& colorStop );
void removeStop( uint n );
void clearStops();
uint Stops() { return m_colorStops.count(); }
 
101,19 → 118,20
FPoint vector() const { return m_vector; }
void setVector( const FPoint &vector ) { m_vector = vector; }
 
// void transform( const QWMatrix& m );
// void transform( const QWMatrix& m );
 
protected:
VColorStopList m_colorStops;
 
private:
VGradientType m_type : 2;
VGradientRepeatMethod m_repeatMethod : 2;
VGradientType m_type : 2;
VGradientRepeatMethod m_repeatMethod : 2;
 
// coordinates:
FPoint m_origin;
FPoint m_focalPoint;
FPoint m_vector;
}; // VGradient
}
; // VGradient
 
#endif /* __VGRADIENT_H__ */
/trunk/Scribus/scribus/tree.cpp
171,6 → 171,7
if ( Nr > PageObj.at(SNr)->Elemente.count()-1)
return;
disconnect(ListView1, SIGNAL(itemRenamed(QListViewItem*, int)), this, SLOT(slotDoRename(QListViewItem*, int)));
disconnect(ListView1, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelect(QListViewItem*)));
PageObj.at(SNr)->Elemente.at(Nr)->setText(0, vie->Pages.at(SNr)->Items.at(Nr)->AnName);
xp = tr("X:")+" "+cc.setNum(vie->Pages.at(SNr)->Items.at(Nr)->Xpos);
yp = tr("Y:")+" "+cc.setNum(vie->Pages.at(SNr)->Items.at(Nr)->Ypos);
208,6 → 209,7
break;
}
connect(ListView1, SIGNAL(itemRenamed(QListViewItem*, int)), this, SLOT(slotDoRename(QListViewItem*, int)));
connect(ListView1, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelect(QListViewItem*)));
}
 
void Tree::slotAddElement(uint SNr, uint Nr)
/trunk/Scribus/scribus/cpalette.h
25,7 → 25,6
#include <qfont.h>
#include <qlayout.h>
#include <qtoolbutton.h>
#include <qradiobutton.h>
#include <qbuttongroup.h>
#include <qcombobox.h>
#include <qlabel.h>
33,6 → 32,7
#include "scribusdoc.h"
#include "shadebutton.h"
#include "mspinbox.h"
#include "gradienteditor.h"
 
/**
*@author Franz Schmid
50,9 → 50,7
QToolButton *Innen;
QSpinBox *PM1;
QComboBox* GradCombo;
QButtonGroup* GradGroup;
QRadioButton* GrColor1;
QRadioButton* GrColor2;
GradientPreview* GradEdit;
QFrame* frame8;
QLabel* GTextX1;
QLabel* GTextY1;
86,11 → 84,12
void updateCList();
void updateBoxS(QString Farbe);
void selFarbe(QListBoxItem *c);
QColor SetFarbe(QString farbe, int shad);
void slotGrad(int nr);
void slotColor();
void slotColor(QString n, int s);
void ChooseGrad(int nr);
void setActFarben(QString p, QString b, int shp, int shb);
void setActGradient(QString p, QString b, int shp, int shb, int typ);
void setActGradient(int typ);
void setSpecialGradient(double x1, double y1, double x2, double y2, double w, double h);
void changeSpecial();
void setActShade();
104,19 → 103,18
void NewBrush(QString);
void NewPenShade(int);
void NewBrushShade(int);
void NewGradient(int, QString, int, QString, int);
void NewGradient(int);
void NewSpecial(double, double, double, double);
void NewTrans(double);
void NewTransS(double);
void QueryItem();
void gradientChanged();
 
protected:
QVBoxLayout* Form1Layout;
QGridLayout* Layout1;
QVBoxLayout* GradLayout;
QVBoxLayout* GradGroupLayout;
QHBoxLayout* TransGroupLayout;
QHBoxLayout* layout19;
QGridLayout* frame8Layout;
};
 
/trunk/Scribus/scribus/scpreview.cpp
173,11 → 173,22
OB.ShTxtStroke = QStoInt(pg.attribute("TXTSTRSH", "100"));
OB.TxtScale = QStoInt(pg.attribute("TXTSCALE", "100"));
OB.TxTStyle = QStoInt(pg.attribute("TXTSTYLE", "0"));
OB.GrColor = pg.attribute("GRCOLOR","");
OB.GrColor2 = pg.attribute("GRCOLOR2","");
OB.GrShade = QStoInt(pg.attribute("GRSHADE","100"));
OB.GrShade2 = QStoInt(pg.attribute("GRSHADE2","100"));
OB.GrType = QStoInt(pg.attribute("GRTYP","0"));
OB.fill_gradient.clearStops();
if (OB.GrType != 0)
{
OB.GrStartX = QStodouble(pg.attribute("GRSTARTX","0.0"));
OB.GrStartY = QStodouble(pg.attribute("GRSTARTY","0.0"));
OB.GrEndX = QStodouble(pg.attribute("GRENDX","0.0"));
OB.GrEndY = QStodouble(pg.attribute("GRENDY","0.0"));
OB.GrColor = pg.attribute("GRCOLOR","");
if (OB.GrColor != "")
{
OB.GrColor2 = pg.attribute("GRCOLOR2","");
OB.GrShade = QStoInt(pg.attribute("GRSHADE","100"));
OB.GrShade2 = QStoInt(pg.attribute("GRSHADE2","100"));
}
}
OB.Rot = QStodouble(pg.attribute("ROT"));
OB.PLineArt = Qt::PenStyle(QStoInt(pg.attribute("PLINEART")));
OB.PLineEnd = Qt::PenCapStyle(QStoInt(pg.attribute("PLINEEND","0")));
263,6 → 274,14
while(!IT.isNull())
{
QDomElement it=IT.toElement();
if (it.tagName()=="CSTOP")
{
QString name = it.attribute("NAME");
double ramp = QStodouble(it.attribute("RAMP","0.0"));
int shade = QStoInt(it.attribute("SHADE","100"));
SetFarbe(&tmpfa, name, shade);
OB.fill_gradient.addStop(tmpfa, ramp, 0.5, 1.0, name, shade);
}
if (it.tagName()=="ITEXT")
{
tmp2 = it.attribute("CH");
392,24 → 411,29
{
pS->setFillMode(2);
pS->fill_gradient.clearStops();
if (OB.GrType == 5)
if ((OB.GrColor != "") && (OB.GrColor2 != ""))
{
if ((OB.GrColor != "None") && (OB.GrColor != ""))
SetFarbe(&tmpfa, OB.GrColor, OB.GrShade);
pS->fill_gradient.addStop(tmpfa, 0.0, 0.5, 1.0);
if ((OB.GrColor2 != "None") && (OB.GrColor2 != ""))
SetFarbe(&tmpfa, OB.GrColor2, OB.GrShade2);
pS->fill_gradient.addStop(tmpfa, 1.0, 0.5, 1.0);
if (OB.GrType == 5)
{
if ((OB.GrColor != "None") && (OB.GrColor != ""))
SetFarbe(&tmpfa, OB.GrColor, OB.GrShade);
pS->fill_gradient.addStop(tmpfa, 0.0, 0.5, 1.0);
if ((OB.GrColor2 != "None") && (OB.GrColor2 != ""))
SetFarbe(&tmpfa, OB.GrColor2, OB.GrShade2);
pS->fill_gradient.addStop(tmpfa, 1.0, 0.5, 1.0);
}
else
{
if ((OB.GrColor2 != "None") && (OB.GrColor2 != ""))
SetFarbe(&tmpfa, OB.GrColor2, OB.GrShade2);
pS->fill_gradient.addStop(tmpfa, 0.0, 0.5, 1.0);
if ((OB.GrColor != "None") && (OB.GrColor != ""))
SetFarbe(&tmpfa, OB.GrColor, OB.GrShade);
pS->fill_gradient.addStop(tmpfa, 1.0, 0.5, 1.0);
}
}
else
{
if ((OB.GrColor2 != "None") && (OB.GrColor2 != ""))
SetFarbe(&tmpfa, OB.GrColor2, OB.GrShade2);
pS->fill_gradient.addStop(tmpfa, 0.0, 0.5, 1.0);
if ((OB.GrColor != "None") && (OB.GrColor != ""))
SetFarbe(&tmpfa, OB.GrColor, OB.GrShade);
pS->fill_gradient.addStop(tmpfa, 1.0, 0.5, 1.0);
}
pS->fill_gradient = OB.fill_gradient;
QWMatrix grm;
grm.rotate(OB.Rot);
FPointArray gra;
443,6 → 467,11
gv = FPoint(OB.Width / 2.0, OB.Height);
pS->setGradient(VGradient::radial, FPoint(OB.Width / 2.0,OB.Height / 2.0), gv, FPoint(OB.Width / 2.0,OB.Height / 2.0));
break;
case 6:
gra.setPoints(2, OB.GrStartX, OB.GrStartY, OB.GrEndX, OB.GrEndY);
gra.map(grm);
pS->setGradient(VGradient::linear, gra.point(0), gra.point(1));
break;
}
}
if (OB.Pcolor2 != "None")
/trunk/Scribus/scribus/scribusview.h
83,6 → 83,7
bool Hm, bool Vm, bool Ic);
void ProcessPage(PSLib *p, Page* a, uint PNr, bool sep = false, bool farb = true, bool ic = false);
void SetClipPath(PSLib *p, FPointArray *c, bool poly = true);
void HandleGradient(PSLib *p, PageItem *c, double w, double h);
void SetFarbe(QString farb, int shade, int *h, int *s, int *v, int *k);
void rememberPreviousSettings(int mx=0, int my=0);
/** Dokument zu dem die Seite geh�t */
/trunk/Scribus/scribus/vgradient.cpp
1,16 → 1,16
/* This file is part of the KDE project
Copyright (C) 2002, The Karbon Developers
 
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
 
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
 
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
27,7 → 27,7
} // VGradient::VColorStopList::compareItems
 
VGradient::VGradient( VGradientType type )
: m_type( type )
: m_type( type )
{
m_colorStops.setAutoDelete( true );
 
105,7 → 105,7
} // VGradient::addStop
 
void
VGradient::addStop( const QColor &color, double rampPoint, double midPoint, double opa )
VGradient::addStop( const QColor &color, double rampPoint, double midPoint, double opa, QString name, int shade )
{
// Clamping between 0.0 and 1.0
rampPoint = QMAX( 0.0f, rampPoint );
114,19 → 114,15
midPoint = QMAX( 0.0f, midPoint );
midPoint = QMIN( 1.0f, midPoint );
 
m_colorStops.inSort( new VColorStop( rampPoint, midPoint, color, opa ) );
m_colorStops.inSort( new VColorStop( rampPoint, midPoint, color, opa, name, shade ) );
}
 
void VGradient::removeStop( const VColorStop& colorstop )
{
m_colorStops.remove( &colorstop );
} // VGradient::removeStop
/*
void
VGradient::transform( const QWMatrix &m )
}
 
void VGradient::removeStop( uint n )
{
m_origin = m_origin.transform( m );
m_focalPoint = m_focalPoint.transform( m );
m_vector = m_vector.transform( m );
m_colorStops.remove( n );
}
*/
/trunk/Scribus/scribus/story.h
118,6 → 118,7
public slots:
void updateStatus();
void Do_leave();
void Do_saveDocument();
void Do_new();
void Do_undo();
void Do_redo();
/trunk/Scribus/scribus/po/scribus.de.ts
1425,11 → 1425,11
</message>
<message>
<source>Edit the first color of object</source>
<translation>Erste Verlaufsfarbe auswählen</translation>
<translation type="obsolete">Erste Verlaufsfarbe auswählen</translation>
</message>
<message>
<source>Edit the second color of object</source>
<translation>Zweite Verlaufsfarbe auswählen</translation>
<translation type="obsolete">Zweite Verlaufsfarbe auswählen</translation>
</message>
<message>
<source>Set the transparency for the color selected</source>
1439,6 → 1439,42
<source>Color of selected object</source>
<translation>Farbe des selektierten Objekts</translation>
</message>
<message>
<source>Free linear Gradient</source>
<translation>Freier linearer Verlauf</translation>
</message>
<message>
<source>X1:</source>
<translation>X1:</translation>
</message>
<message>
<source>Y1:</source>
<translation>Y1:</translation>
</message>
<message>
<source> pt</source>
<translation> pt</translation>
</message>
<message>
<source>X2:</source>
<translation>X2:</translation>
</message>
<message>
<source>Y2:</source>
<translation>Y2:</translation>
</message>
<message>
<source> mm</source>
<translation> mm</translation>
</message>
<message>
<source> in</source>
<translation> in</translation>
</message>
<message>
<source> p</source>
<translation> p</translation>
</message>
</context>
<context>
<name>CupsOptions</name>
1796,6 → 1832,21
</message>
</context>
<context>
<name>EPSPlug</name>
<message>
<source>Importing File:
%1
failed!</source>
<translation>Importieren von Datei:
%1
ist fehlgeschlagen!</translation>
</message>
<message>
<source>Fatal Error</source>
<translation>Fataler Fehler</translation>
</message>
</context>
<context>
<name>EditStyle</name>
<message>
<source>Edit Style</source>
3315,7 → 3366,7
</message>
<message>
<source>Line Style:</source>
<translation>Linienstil:</translation>
<translation type="obsolete">Linienstil:</translation>
</message>
<message>
<source>Line Width:</source>
3755,6 → 3806,10
<source>Font Size:</source>
<translation>Schriftgröße:</translation>
</message>
<message>
<source>Type of Line:</source>
<translation>Linienart:</translation>
</message>
</context>
<context>
<name>MultiLine</name>
5827,7 → 5882,7
</message>
<message>
<source>Line Style:</source>
<translation>Linienstil:</translation>
<translation type="obsolete">Linienstil:</translation>
</message>
<message>
<source>Minimum:</source>
6433,6 → 6488,10
<source> px</source>
<translation>px</translation>
</message>
<message>
<source>Type of Line:</source>
<translation>Linienart:</translation>
</message>
</context>
<context>
<name>QColorDialog</name>
7006,6 → 7065,18
<source>Error writting the output file(s).</source>
<translation>Fehler beim Schreiben der Datei(en).</translation>
</message>
<message>
<source>Import EPS/PS...</source>
<translation>EPS-Bild importieren...</translation>
</message>
<message>
<source>All Supported Formats (*.eps *.EPS *.ps *.PS);;</source>
<translation>Alle unterstützten Formate (*.eps *.EPS *.ps *.PS);;</translation>
</message>
<message>
<source>All Files (*)</source>
<translation>Alle Dateien (*)</translation>
</message>
</context>
<context>
<name>QTextEdit</name>
8619,11 → 8690,11
</message>
<message>
<source>Save and Exit</source>
<translation>Speichern und Beenden</translation>
<translation type="obsolete">Speichern und Beenden</translation>
</message>
<message>
<source>Exit without Saving</source>
<translation>Beenden ohne Speichern</translation>
<translation type="obsolete">Beenden ohne Speichern</translation>
</message>
<message>
<source>Undo</source>
8757,6 → 8828,18
<source>Do you want to save your changes?</source>
<translation>Wollen Sie die Änderungen speichern?</translation>
</message>
<message>
<source>Update Text Frame and Exit</source>
<translation>Textrahmen auffrischen und verlassen</translation>
</message>
<message>
<source>Exit Without Updating Text Frame</source>
<translation>Verlassen ohne Textrahen auffrischen</translation>
</message>
<message>
<source>Save Document</source>
<translation>Dokument speichern</translation>
</message>
</context>
<context>
<name>StyleSelect</name>
/trunk/Scribus/scribus/scribusXml.h
36,6 → 36,7
bool WriteDoc(QString fileName, ScribusDoc *docu, ScribusView *viewx, QProgressBar *dia2);
void WritePref(preV *Vor, QString ho);
bool ReadPref(struct preV *Vorein, QString ho);
QColor ScriXmlDoc::SetFarbe(ScribusDoc *doc, QString farbe, int shad);
CListe Farben;
QValueList<StVorL> Vorlagen;
struct Linked {
/trunk/Scribus/scribus/gradienteditor.h
0,0 → 1,53
/***************************************************************************
gradienteditor - description
-------------------
begin : Mit Mai 26 2004
copyright : (C) 2004 by Franz Schmid
email : Franz.Schmid@altmuehlnet.de
***************************************************************************/
 
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
 
#ifndef GRADEDITOR_H
#define GRADEDITOR_H
 
#include <qlabel.h>
#include <qvaluelist.h>
#include "vgradient.h"
 
class GradientPreview : public QLabel
{
Q_OBJECT
 
public:
GradientPreview(QWidget *pa);
~GradientPreview() {};
void paintEvent(QPaintEvent *e);
void mousePressEvent(QMouseEvent *m);
void mouseReleaseEvent(QMouseEvent *);
void mouseMoveEvent(QMouseEvent *m);
void leaveEvent(QEvent*);
void enterEvent(QEvent*);
void updateDisplay();
void setActColor(QColor c, QString n, int s);
VGradient fill_gradient;
QValueList<int> StopM;
bool Mpressed;
bool outside;
bool onlyselect;
int ActStop;
 
signals:
void selectedColor(QString, int);
void gradientChanged();
};
 
#endif
 
Property changes:
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Added: svn:keywords
## -0,0 +1 ##
+Author Date Id Revision
\ No newline at end of property
Index: Scribus/scribus/scribusXml.cpp
===================================================================
--- Scribus/scribus/scribusXml.cpp (revision 294)
+++ Scribus/scribus/scribusXml.cpp (revision 295)
@@ -705,15 +705,22 @@
OB.TxTStyle=QStoInt(obj.attribute("TXTSTYLE", "0"));
OB.Cols = QStoInt(obj.attribute("COLUMNS","1"));
OB.ColGap = QStodouble(obj.attribute("COLGAP","0.0"));
- OB.GrColor = obj.attribute("GRCOLOR","");
- OB.GrColor2 = obj.attribute("GRCOLOR2","");
- OB.GrShade = QStoInt(obj.attribute("GRSHADE","100"));
- OB.GrShade2 = QStoInt(obj.attribute("GRSHADE2","100"));
- OB.GrStartX = QStodouble(obj.attribute("GRSTARTX","0.0"));
- OB.GrStartY = QStodouble(obj.attribute("GRSTARTY","0.0"));
- OB.GrEndX = QStodouble(obj.attribute("GRENDX","0.0"));
- OB.GrEndY = QStodouble(obj.attribute("GRENDY","0.0"));
OB.GrType = QStoInt(obj.attribute("GRTYP","0"));
+ OB.fill_gradient.clearStops();
+ if (OB.GrType != 0)
+ {
+ OB.GrStartX = QStodouble(obj.attribute("GRSTARTX","0.0"));
+ OB.GrStartY = QStodouble(obj.attribute("GRSTARTY","0.0"));
+ OB.GrEndX = QStodouble(obj.attribute("GRENDX","0.0"));
+ OB.GrEndY = QStodouble(obj.attribute("GRENDY","0.0"));
+ OB.GrColor = obj.attribute("GRCOLOR","");
+ if (OB.GrColor != "")
+ {
+ OB.GrColor2 = obj.attribute("GRCOLOR2","");
+ OB.GrShade = QStoInt(obj.attribute("GRSHADE","100"));
+ OB.GrShade2 = QStoInt(obj.attribute("GRSHADE2","100"));
+ }
+ }
OB.Rot=QStodouble(obj.attribute("ROT"));
OB.PLineArt=Qt::PenStyle(QStoInt(obj.attribute("PLINEART")));
OB.PLineEnd=Qt::PenCapStyle(QStoInt(obj.attribute("PLINEEND","0")));
@@ -895,6 +902,13 @@
while(!IT.isNull())
{
QDomElement it=IT.toElement();
+ if (it.tagName()=="CSTOP")
+ {
+ QString name = it.attribute("NAME");
+ double ramp = QStodouble(it.attribute("RAMP","0.0"));
+ int shade = QStoInt(it.attribute("SHADE","100"));
+ OB.fill_gradient.addStop(SetFarbe(doc, name, shade), ramp, 0.5, 1.0, name, shade);
+ }
if (it.tagName()=="ITEXT")
{
tmp2 = it.attribute("CH");
@@ -1405,15 +1419,22 @@
OB.TxTStyle=QStoInt(obj.attribute("TXTSTYLE", "0"));
OB.Cols = QStoInt(obj.attribute("COLUMNS","1"));
OB.ColGap = QStodouble(obj.attribute("COLGAP","0.0"));
- OB.GrColor = obj.attribute("GRCOLOR","");
- OB.GrColor2 = obj.attribute("GRCOLOR2","");
- OB.GrShade = QStoInt(obj.attribute("GRSHADE","100"));
- OB.GrShade2 = QStoInt(obj.attribute("GRSHADE2","100"));
- OB.GrStartX = QStodouble(obj.attribute("GRSTARTX","0.0"));
- OB.GrStartY = QStodouble(obj.attribute("GRSTARTY","0.0"));
- OB.GrEndX = QStodouble(obj.attribute("GRENDX","0.0"));
- OB.GrEndY = QStodouble(obj.attribute("GRENDY","0.0"));
OB.GrType = QStoInt(obj.attribute("GRTYP","0"));
+ OB.fill_gradient.clearStops();
+ if (OB.GrType != 0)
+ {
+ OB.GrStartX = QStodouble(obj.attribute("GRSTARTX","0.0"));
+ OB.GrStartY = QStodouble(obj.attribute("GRSTARTY","0.0"));
+ OB.GrEndX = QStodouble(obj.attribute("GRENDX","0.0"));
+ OB.GrEndY = QStodouble(obj.attribute("GRENDY","0.0"));
+ OB.GrColor = obj.attribute("GRCOLOR","");
+ if (OB.GrColor != "")
+ {
+ OB.GrColor2 = obj.attribute("GRCOLOR2","");
+ OB.GrShade = QStoInt(obj.attribute("GRSHADE","100"));
+ OB.GrShade2 = QStoInt(obj.attribute("GRSHADE2","100"));
+ }
+ }
OB.Rot=QStodouble(obj.attribute("ROT"));
OB.PLineArt=Qt::PenStyle(QStoInt(obj.attribute("PLINEART")));
OB.PLineEnd=Qt::PenCapStyle(QStoInt(obj.attribute("PLINEEND","0")));
@@ -1596,6 +1617,13 @@
while(!IT.isNull())
{
QDomElement it=IT.toElement();
+ if (it.tagName()=="CSTOP")
+ {
+ QString name = it.attribute("NAME");
+ double ramp = QStodouble(it.attribute("RAMP","0.0"));
+ int shade = QStoInt(it.attribute("SHADE","100"));
+ OB.fill_gradient.addStop(SetFarbe(doc, name, shade), ramp, 0.5, 1.0, name, shade);
+ }
if (it.tagName()=="ITEXT")
{
tmp2 = it.attribute("CH");
@@ -2009,15 +2037,22 @@
OB.TxTStyle = QStoInt(pg.attribute("TXTSTYLE", "0"));
OB.Cols = QStoInt(pg.attribute("COLUMNS","1"));
OB.ColGap = QStodouble(pg.attribute("COLGAP","0.0"));
- OB.GrColor = pg.attribute("GRCOLOR","");
- OB.GrColor2 = pg.attribute("GRCOLOR2","");
- OB.GrShade = QStoInt(pg.attribute("GRSHADE","100"));
- OB.GrShade2 = QStoInt(pg.attribute("GRSHADE2","100"));
OB.GrType = QStoInt(pg.attribute("GRTYP","0"));
- OB.GrStartX = QStodouble(pg.attribute("GRSTARTX","0.0"));
- OB.GrStartY = QStodouble(pg.attribute("GRSTARTY","0.0"));
- OB.GrEndX = QStodouble(pg.attribute("GRENDX","0.0"));
- OB.GrEndY = QStodouble(pg.attribute("GRENDY","0.0"));
+ OB.fill_gradient.clearStops();
+ if (OB.GrType != 0)
+ {
+ OB.GrStartX = QStodouble(pg.attribute("GRSTARTX","0.0"));
+ OB.GrStartY = QStodouble(pg.attribute("GRSTARTY","0.0"));
+ OB.GrEndX = QStodouble(pg.attribute("GRENDX","0.0"));
+ OB.GrEndY = QStodouble(pg.attribute("GRENDY","0.0"));
+ OB.GrColor = pg.attribute("GRCOLOR","");
+ if (OB.GrColor != "")
+ {
+ OB.GrColor2 = pg.attribute("GRCOLOR2","");
+ OB.GrShade = QStoInt(pg.attribute("GRSHADE","100"));
+ OB.GrShade2 = QStoInt(pg.attribute("GRSHADE2","100"));
+ }
+ }
OB.Rot = QStodouble(pg.attribute("ROT"));
OB.PLineArt = Qt::PenStyle(QStoInt(pg.attribute("PLINEART")));
OB.PLineEnd = Qt::PenCapStyle(QStoInt(pg.attribute("PLINEEND","0")));
@@ -2198,6 +2233,13 @@
while(!IT.isNull())
{
QDomElement it=IT.toElement();
+ if (it.tagName()=="CSTOP")
+ {
+ QString name = it.attribute("NAME");
+ double ramp = QStodouble(it.attribute("RAMP","0.0"));
+ int shade = QStoInt(it.attribute("SHADE","100"));
+ OB.fill_gradient.addStop(SetFarbe(doc, name, shade), ramp, 0.5, 1.0, name, shade);
+ }
if (it.tagName()=="ITEXT")
{
tmp2 = it.attribute("CH");
@@ -2354,14 +2396,22 @@
ob.setAttribute("NAMEDLST",item->NamedLStyle);
ob.setAttribute("SHADE",item->Shade);
ob.setAttribute("SHADE2",item->Shade2);
- ob.setAttribute("GRCOLOR",item->GrColor);
- ob.setAttribute("GRCOLOR2",item->GrColor2);
- ob.setAttribute("GRSHADE",item->GrShade);
- ob.setAttribute("GRSHADE2",item->GrShade2);
- ob.setAttribute("GRSTARTX", item->GrStartX);
- ob.setAttribute("GRSTARTY", item->GrStartY);
- ob.setAttribute("GRENDX", item->GrEndX);
- ob.setAttribute("GRENDY", item->GrEndY);
+ if (item->GrType != 0)
+ {
+ QPtrVector<VColorStop> cstops = item->fill_gradient.colorStops();
+ for (uint cst = 0; cst < item->fill_gradient.Stops(); ++cst)
+ {
+ QDomElement itcl = docu.createElement("CSTOP");
+ itcl.setAttribute("RAMP", cstops.at(cst)->rampPoint);
+ itcl.setAttribute("NAME", cstops.at(cst)->name);
+ itcl.setAttribute("SHADE", cstops.at(cst)->shade);
+ ob.appendChild(itcl);
+ }
+ ob.setAttribute("GRSTARTX", item->GrStartX);
+ ob.setAttribute("GRSTARTY", item->GrStartY);
+ ob.setAttribute("GRENDX", item->GrEndX);
+ ob.setAttribute("GRENDY", item->GrEndY);
+ }
ob.setAttribute("GRTYP",item->GrType);
ob.setAttribute("ROT",item->Rot);
ob.setAttribute("PLINEART",item->PLineArt);
@@ -2739,14 +2789,22 @@
ob.setAttribute("NAMEDLST",item->NamedLStyle);
ob.setAttribute("SHADE",item->Shade);
ob.setAttribute("SHADE2",item->Shade2);
- ob.setAttribute("GRCOLOR",item->GrColor);
- ob.setAttribute("GRCOLOR2",item->GrColor2);
- ob.setAttribute("GRSHADE",item->GrShade);
- ob.setAttribute("GRSHADE2",item->GrShade2);
- ob.setAttribute("GRSTARTX", item->GrStartX);
- ob.setAttribute("GRSTARTY", item->GrStartY);
- ob.setAttribute("GRENDX", item->GrEndX);
- ob.setAttribute("GRENDY", item->GrEndY);
+ if (item->GrType != 0)
+ {
+ QPtrVector<VColorStop> cstops = item->fill_gradient.colorStops();
+ for (uint cst = 0; cst < item->fill_gradient.Stops(); ++cst)
+ {
+ QDomElement itcl = docu.createElement("CSTOP");
+ itcl.setAttribute("RAMP", cstops.at(cst)->rampPoint);
+ itcl.setAttribute("NAME", cstops.at(cst)->name);
+ itcl.setAttribute("SHADE", cstops.at(cst)->shade);
+ ob.appendChild(itcl);
+ }
+ ob.setAttribute("GRSTARTX", item->GrStartX);
+ ob.setAttribute("GRSTARTY", item->GrStartY);
+ ob.setAttribute("GRENDX", item->GrEndX);
+ ob.setAttribute("GRENDY", item->GrEndY);
+ }
ob.setAttribute("GRTYP",item->GrType);
ob.setAttribute("ROT",item->Rot);
ob.setAttribute("PLINEART",item->PLineArt);
@@ -3809,3 +3867,23 @@
qApp->setFont(apf,true);
return true;
}
+
+QColor ScriXmlDoc::SetFarbe(ScribusDoc *doc, QString farbe, int shad)
+{
+ int h, s, v, sneu;
+ QColor tmp;
+ doc->PageColors[farbe].getRGBColor().rgb(&h, &s, &v);
+ if ((h == s) && (s == v))
+ {
+ doc->PageColors[farbe].getRGBColor().hsv(&h, &s, &v);
+ sneu = 255 - ((255 - v) * shad / 100);
+ tmp.setHsv(h, s, sneu);
+ }
+ else
+ {
+ doc->PageColors[farbe].getRGBColor().hsv(&h, &s, &v);
+ sneu = s * shad / 100;
+ tmp.setHsv(h, sneu, v);
+ }
+ return tmp;
+}
Index: Scribus/scribus/qm/scribus.de.qm
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream