Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 23903 → Rev 23904

/trunk/Scribus/scribus/canvasmode_editgradient.cpp
112,7 → 112,7
qmatrix.translate(0, currItem->GrStrokeStartY * (1.0 - currItem->GrStrokeScale));
qmatrix.translate(-currItem->GrStrokeStartX, -currItem->GrStrokeStartY);
qmatrix.scale(1, currItem->GrStrokeScale);
if (currItem->GrTypeStroke == 7)
if (currItem->GrTypeStroke == Gradient_Radial)
psx->drawPoint(qmatrix.map(QPointF(currItem->GrStrokeFocalX, currItem->GrStrokeFocalY)));
QTransform m;
m.translate(currItem->GrStrokeStartX, currItem->GrStrokeStartY);
177,7 → 177,7
QTransform qmatrix;
qmatrix.translate(currItem->GrStartX, currItem->GrStartY);
qmatrix.rotate(rotEnd);
if (currItem->GrType != 13)
if (currItem->GrType != Gradient_Conical)
{
double mask_gradientSkew = 0.0;
if (currItem->GrSkew == 90)
195,7 → 195,7
qmatrix.translate(0, currItem->GrStartY * (1.0 - currItem->GrScale));
qmatrix.translate(-currItem->GrStartX, -currItem->GrStartY);
qmatrix.scale(1, currItem->GrScale);
if ((currItem->GrType == 7) || (currItem->GrType == 13))
if ((currItem->GrType == Gradient_Radial) || (currItem->GrType == Gradient_Conical))
psx->drawPoint(qmatrix.map(QPointF(currItem->GrFocalX, currItem->GrFocalY)));
QTransform m;
m.translate(currItem->GrStartX, currItem->GrStartY);
536,7 → 536,7
QTransform qmatrix;
qmatrix.translate(currItem->GrStartX, currItem->GrStartY);
qmatrix.rotate(rotEnd);
if (currItem->GrType != 13)
if (currItem->GrType != Gradient_Conical)
{
double mask_gradientSkew = 0.0;
if (currItem->GrSkew == 90)
559,7 → 559,7
QPointF shRe = m.map(shR - np);
currItem->GrFocalX = shRe.x();
currItem->GrFocalY = shRe.y();
if ((currItem->GrType == 7) || (currItem->GrType == 13))
if ((currItem->GrType == Gradient_Radial) || (currItem->GrType == Gradient_Conical))
{
double radEnd = distance(currItem->GrEndX - currItem->GrStartX, currItem->GrEndY - currItem->GrStartY);
double radFoc = distance(currItem->GrFocalX - currItem->GrStartX, currItem->GrFocalY - currItem->GrStartY);
580,7 → 580,7
m.translate(currItem->GrStartX, currItem->GrStartY);
m.rotate(rotEnd);
m.rotate(-90);
if (currItem->GrType != 13)
if (currItem->GrType != Gradient_Conical)
m.rotate(currItem->GrSkew);
m.translate(radEnd * currItem->GrScale, 0);
QPointF shP = m.map(QPointF(0,0));
587,7 → 587,7
QPointF shR = QPointF(shP.x() -np.x(), shP.y() - np.y());
double radNew = distance(shR.x() - currItem->GrStartX, shR.y() - currItem->GrStartY);
double rotNew = xy2Deg(shR.x() - currItem->GrStartX, shR.y() - currItem->GrStartY) + 90;
if (currItem->GrType != 13)
if (currItem->GrType != Gradient_Conical)
currItem->GrSkew = rotNew - rotEnd;
else
currItem->GrSkew = 0;
599,7 → 599,7
{
currItem->GrEndX -= np.x();
currItem->GrEndY -= np.y();
if ((currItem->GrType == 7) || (currItem->GrType == 13))
if ((currItem->GrType == Gradient_Radial) || (currItem->GrType == Gradient_Conical))
{
double radEnd = distance(currItem->GrEndX - currItem->GrStartX, currItem->GrEndY - currItem->GrStartY);
double radFoc = distance(currItem->GrFocalX - currItem->GrStartX, currItem->GrFocalY - currItem->GrStartY);
699,7 → 699,7
QTransform itemMatrix = currItem->getTransform();
upRect = itemMatrix.mapRect(upRect);
m_doc->regionsChanged()->update(upRect.adjusted(-10.0, -10.0, 10.0, 10.0)); */
if (currItem->GrType == 13)
if (currItem->GrType == Gradient_Conical)
currItem->createConicalMesh();
m_doc->regionsChanged()->update(QRectF());
}
812,7 → 812,7
QTransform qmatrix;
qmatrix.translate(currItem->GrStartX, currItem->GrStartY);
qmatrix.rotate(rotEnd);
if (currItem->GrType != 13)
if (currItem->GrType != Gradient_Conical)
{
double mask_gradientSkew = 0.0;
if (currItem->GrSkew == 90)
/trunk/Scribus/scribus/documentchecker.cpp
207,7 → 207,7
}
if ((currItem->GrType != 0) && (checkerSettings.checkTransparency))
{
if (currItem->GrType == 9)
if (currItem->GrType == Gradient_4Colors)
{
if (currItem->GrCol1transp != 1.0)
itemError.insert(Transparency, 0);
218,7 → 218,7
else if (currItem->GrCol4transp != 1.0)
itemError.insert(Transparency, 0);
}
else if (currItem->GrType == 11)
else if (currItem->GrType == Gradient_Mesh)
{
for (int grow = 0; grow < currItem->meshGradientArray.count(); grow++)
{
229,7 → 229,7
}
}
}
else if (currItem->GrType == 12)
else if (currItem->GrType == Gradient_PatchMesh)
{
for (int grow = 0; grow < currItem->meshGradientPatches.count(); grow++)
{
469,7 → 469,7
}
if ((currItem->GrType != 0) && (checkerSettings.checkTransparency))
{
if (currItem->GrType == 9)
if (currItem->GrType == Gradient_4Colors)
{
if (currItem->GrCol1transp != 1.0)
itemError.insert(Transparency, 0);
480,7 → 480,7
else if (currItem->GrCol4transp != 1.0)
itemError.insert(Transparency, 0);
}
else if (currItem->GrType == 11)
else if (currItem->GrType == Gradient_Mesh)
{
for (int grow = 0; grow < currItem->meshGradientArray.count(); grow++)
{
491,7 → 491,7
}
}
}
else if (currItem->GrType == 12)
else if (currItem->GrType == Gradient_PatchMesh)
{
for (int grow = 0; grow < currItem->meshGradientPatches.count(); grow++)
{
/trunk/Scribus/scribus/pageitem.cpp
1840,7 → 1840,7
p->setLineWidth(lwCorr);
if (GrType != 0)
{
if (GrType == 8)
if (GrType == Gradient_Pattern)
{
ScPattern *pattern = m_Doc->checkedPattern(m_patternName);
if (!pattern)
1871,7 → 1871,7
}
else
{
if (GrType == 9)
if (GrType == Gradient_4Colors)
{
p->setFillMode(ScPainter::Gradient);
FPoint pG1 = FPoint(0, 0);
1881,7 → 1881,7
p->set4ColorGeometry(pG1, pG2, pG3, pG4, GrControl1, GrControl2, GrControl3, GrControl4);
p->set4ColorColors(m_grQColorP1, m_grQColorP2, m_grQColorP3, m_grQColorP4);
}
else if (GrType == 14)
else if (GrType == Gradient_Hatch)
{
if (fillColor() != CommonStrings::None)
p->setBrush(m_fillQColor);
1894,7 → 1894,7
m_gradientName = "";
if (!(m_gradientName.isEmpty()) && (m_Doc->docGradients.contains(m_gradientName)))
fill_gradient = m_Doc->docGradients[m_gradientName];
if ((fill_gradient.stops() < 2) && (GrType < 9)) // fall back to solid filling if there are not enough colorstops in the gradient.
if ((fill_gradient.stops() < 2) && (GrType < Gradient_4Colors)) // fall back to solid filling if there are not enough colorstops in the gradient.
{
if (fillColor() != CommonStrings::None)
{
1914,27 → 1914,27
p->fill_gradient.setRepeatMethod(GrExtend);
switch (GrType)
{
case 1:
case 2:
case 3:
case 4:
case 6:
case Gradient_LinearLegacy1:
case Gradient_LinearLegacy2:
case Gradient_LinearLegacy3:
case Gradient_LinearLegacy4:
case Gradient_Linear:
p->setGradient(VGradient::linear, FPoint(GrStartX, GrStartY), FPoint(GrEndX, GrEndY), FPoint(GrStartX, GrStartY), GrScale, GrSkew);
break;
case 5:
case 7:
case Gradient_RadialLegacy5:
case Gradient_Radial:
p->setGradient(VGradient::radial, FPoint(GrStartX, GrStartY), FPoint(GrEndX, GrEndY), FPoint(GrFocalX, GrFocalY), GrScale, GrSkew);
break;
case 10:
case Gradient_Diamond:
p->setFillMode(ScPainter::Gradient);
p->setDiamondGeometry(FPoint(0, 0), FPoint(width(), 0), FPoint(width(), height()), FPoint(0, height()), GrControl1, GrControl2, GrControl3, GrControl4, GrControl5);
break;
case 11:
case 13:
case Gradient_Mesh:
case Gradient_Conical:
p->setFillMode(ScPainter::Gradient);
p->setMeshGradient(FPoint(0, 0), FPoint(width(), 0), FPoint(width(), height()), FPoint(0, height()), meshGradientArray);
break;
case 12:
case Gradient_PatchMesh:
p->setFillMode(ScPainter::Gradient);
p->setMeshGradient(FPoint(0, 0), FPoint(width(), 0), FPoint(width(), height()), FPoint(0, height()), meshGradientPatches);
break;
2109,7 → 2109,7
p->setStrokeMode(ScPainter::Gradient);
p->stroke_gradient = stroke_gradient;
p->stroke_gradient.setRepeatMethod(GrStrokeExtend);
if (GrTypeStroke == 6)
if (GrTypeStroke == Gradient_Linear)
p->setGradient(VGradient::linear, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeStartX, GrStrokeStartY), GrStrokeScale, GrStrokeSkew);
else
p->setGradient(VGradient::radial, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeFocalX, GrStrokeFocalY), GrStrokeScale, GrStrokeSkew);
5942,7 → 5942,7
GrMaskScale = is->getDouble("MARKSCALE");
GrMaskSkew = is->getDouble("MARKSKEW");
}
if (GrType == 13)
if (GrType == Gradient_Conical)
createConicalMesh();
update();
}
8528,7 → 8528,7
 
if (GrType == 0)
lists.collectColor(fillColor());
else if ((GrType < 8) || (GrType == 10))
else if ((GrType < Gradient_Pattern) || (GrType == Gradient_Diamond))
{
if ((!m_gradientName.isEmpty()) && (m_Doc->docGradients.contains(m_gradientName)))
lists.collectGradient(m_gradientName);
8538,7 → 8538,7
lists.collectColor(cstops.at(cst)->name);
}
}
else if (GrType == 9)
else if (GrType == Gradient_4Colors)
{
lists.collectColor(GrColorP1);
lists.collectColor(GrColorP2);
8545,7 → 8545,7
lists.collectColor(GrColorP3);
lists.collectColor(GrColorP4);
}
else if (GrType == 11)
else if (GrType == Gradient_Mesh)
{
for (int grow = 0; grow < meshGradientArray.count(); grow++)
{
8556,7 → 8556,7
}
}
}
else if (GrType == 12)
else if (GrType == Gradient_PatchMesh)
{
for (int col = 0; col < meshGradientPatches.count(); col++)
{
8568,7 → 8568,7
}
if (GrTypeStroke == 0)
lists.collectColor(lineColor());
else if (GrTypeStroke < 8)
else if (GrTypeStroke < Gradient_Pattern)
{
if ((!gradientStrokeVal.isEmpty()) && (m_Doc->docGradients.contains(gradientStrokeVal)))
lists.collectGradient(gradientStrokeVal);
8619,7 → 8619,7
void PageItem::SetFrameShape(int count, const double *vals)
{
PoLine.resize(0);
for (int i = 0; i < count-3; i += 4)
for (int i = 0; i < count - 3; i += 4)
{
if (vals[i] < 0)
{
8627,9 → 8627,9
continue;
}
double x1 = m_width * vals[i] / 100.0;
double y1 = m_height * vals[i+1] / 100.0;
double x2 = m_width * vals[i+2] / 100.0;
double y2 = m_height * vals[i+3] / 100.0;
double y1 = m_height * vals[i + 1] / 100.0;
double x2 = m_width * vals[i + 2] / 100.0;
double y2 = m_height * vals[i + 3] / 100.0;
PoLine.addPoint(x1, y1);
PoLine.addPoint(x2, y2);
}
9725,7 → 9725,7
{
p->setFillMode(ScPainter::Gradient);
p->fill_gradient = stroke_gradient;
if (GrTypeStroke == 6)
if (GrTypeStroke == Gradient_Linear)
p->setGradient(VGradient::linear, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeStartX, GrStrokeStartY), GrStrokeScale, GrStrokeSkew);
else
p->setGradient(VGradient::radial, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeFocalX, GrStrokeFocalY), GrStrokeScale, GrStrokeSkew);
9984,24 → 9984,24
{
switch (GrType)
{
case 0:
case 1:
case Gradient_None:
case Gradient_LinearLegacy1:
setGradientStart(0.0, m_height / 2.0);
setGradientEnd(m_width, m_height / 2.0);
break;
case 2:
case Gradient_LinearLegacy2:
setGradientStart(m_width / 2.0, 0.0);
setGradientEnd(m_width / 2.0, m_height);
break;
case 3:
case Gradient_LinearLegacy3:
setGradientStart(0.0, 0.0);
setGradientEnd(m_width, m_height);
break;
case 4:
case Gradient_LinearLegacy4:
setGradientStart(0.0, m_height);
setGradientEnd(m_width, 0.0);
break;
case 5:
case Gradient_RadialLegacy5:
setGradientStart(m_width / 2.0, m_height / 2.0);
if (m_width >= m_height)
setGradientEnd(m_width, m_height / 2.0);
/trunk/Scribus/scribus/pageitem_line.cpp
103,7 → 103,7
{
p->setStrokeMode(ScPainter::Gradient);
p->stroke_gradient = stroke_gradient;
if (GrTypeStroke == 6)
if (GrTypeStroke == Gradient_Linear)
p->setGradient(VGradient::linear, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeStartX, GrStrokeStartY), GrStrokeScale, GrStrokeSkew);
else
p->setGradient(VGradient::radial, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeFocalX, GrStrokeFocalY), GrStrokeScale, GrStrokeSkew);
/trunk/Scribus/scribus/pageitem_pathtext.cpp
123,7 → 123,7
{
p->setStrokeMode(ScPainter::Gradient);
p->stroke_gradient = stroke_gradient;
if (GrTypeStroke == 6)
if (GrTypeStroke == Gradient_Linear)
p->setGradient(VGradient::linear, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeStartX, GrStrokeStartY), GrStrokeScale, GrStrokeSkew);
else
p->setGradient(VGradient::radial, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeFocalX, GrStrokeFocalY), GrStrokeScale, GrStrokeSkew);
/trunk/Scribus/scribus/pageitem_polyline.cpp
139,7 → 139,7
{
p->setStrokeMode(ScPainter::Gradient);
p->stroke_gradient = stroke_gradient;
if (GrTypeStroke == 6)
if (GrTypeStroke == Gradient_Linear)
p->setGradient(VGradient::linear, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeStartX, GrStrokeStartY), GrStrokeScale, GrStrokeSkew);
else
p->setGradient(VGradient::radial, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeFocalX, GrStrokeFocalY), GrStrokeScale, GrStrokeSkew);
/trunk/Scribus/scribus/pageitem_spiral.cpp
141,7 → 141,7
{
p->setStrokeMode(ScPainter::Gradient);
p->stroke_gradient = stroke_gradient;
if (GrTypeStroke == 6)
if (GrTypeStroke == Gradient_Linear)
p->setGradient(VGradient::linear, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeStartX, GrStrokeStartY), GrStrokeScale, GrStrokeSkew);
else
p->setGradient(VGradient::radial, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeFocalX, GrStrokeFocalY), GrStrokeScale, GrStrokeSkew);
/trunk/Scribus/scribus/pageitem_textframe.cpp
3635,7 → 3635,7
{
p->setStrokeMode(ScPainter::Gradient);
p->stroke_gradient = stroke_gradient;
if (GrTypeStroke == 6)
if (GrTypeStroke == Gradient_Linear)
p->setGradient(VGradient::linear, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeStartX, GrStrokeStartY), GrStrokeScale, GrStrokeSkew);
else
p->setGradient(VGradient::radial, FPoint(GrStrokeStartX, GrStrokeStartY), FPoint(GrStrokeEndX, GrStrokeEndY), FPoint(GrStrokeFocalX, GrStrokeFocalY), GrStrokeScale, GrStrokeSkew);
/trunk/Scribus/scribus/pdflib_core.cpp
2765,12 → 2765,12
{
if (ite->GrType != 0)
{
if (ite->GrType == 8)
if (ite->GrType == Gradient_Pattern)
{
if (!PDF_PatternFillStroke(tmpOut, ite))
return false;
}
else if (ite->GrType == 14)
else if (ite->GrType == Gradient_Hatch)
{
if (!PDF_HatchFill(tmpOut, ite))
return false;
2783,7 → 2783,7
if (!tmpOut.isEmpty())
{
PutPage("q\n");
if (ite->GrType == 14)
if (ite->GrType == Gradient_Hatch)
PutPage(tmpOut);
else
{
2958,12 → 2958,12
}
if (ite->GrType != 0)
{
if (ite->GrType == 8)
if (ite->GrType == Gradient_Pattern)
{
if (!PDF_PatternFillStroke(tmpOut, ite))
return false;
}
else if (ite->GrType == 14)
else if (ite->GrType == Gradient_Hatch)
{
if (!PDF_HatchFill(tmpOut, ite))
return false;
2975,7 → 2975,7
}
if (!tmpOut.isEmpty())
{
if (ite->GrType == 14)
if (ite->GrType == Gradient_Hatch)
PutPage(tmpOut);
else
{
3058,12 → 3058,12
}
if (ite->GrType != 0)
{
if (ite->GrType == 8)
if (ite->GrType == Gradient_Pattern)
{
if (!PDF_PatternFillStroke(tmpOut, ite))
return false;
}
else if (ite->GrType == 14)
else if (ite->GrType == Gradient_Hatch)
{
if (!PDF_HatchFill(tmpOut, ite))
return false;
3075,7 → 3075,7
}
if (!tmpOut.isEmpty())
{
if (ite->GrType == 14)
if (ite->GrType == Gradient_Hatch)
PutPage(tmpOut);
else
{
4507,12 → 4507,12
{
if (ite->GrType != 0)
{
if (ite->GrType == 8)
if (ite->GrType == Gradient_Pattern)
{
if (!PDF_PatternFillStroke(tmpOut, ite))
return false;
}
else if (ite->GrType == 14)
else if (ite->GrType == Gradient_Hatch)
{
if (!PDF_HatchFill(tmpOut, ite))
return false;
4525,7 → 4525,7
if (!tmpOut.isEmpty())
{
tmp += "q\n";
if (ite->GrType == 14)
if (ite->GrType == Gradient_Hatch)
tmp += tmpOut;
else
{
4636,12 → 4636,12
{
if (ite->GrType != 0)
{
if (ite->GrType == 8)
if (ite->GrType == Gradient_Pattern)
{
if (!PDF_PatternFillStroke(tmpOut, ite))
return false;
}
else if (ite->GrType == 14)
else if (ite->GrType == Gradient_Hatch)
{
if (!PDF_HatchFill(tmpOut, ite))
return false;
4654,7 → 4654,7
if (!tmpOut.isEmpty())
{
tmp += "q\n";
if (ite->GrType == 14)
if (ite->GrType == Gradient_Hatch)
tmp += tmpOut;
else
{
4821,12 → 4821,12
}
if (ite->GrType != 0)
{
if (ite->GrType == 8)
if (ite->GrType == Gradient_Pattern)
{
if (!PDF_PatternFillStroke(tmpOut, ite))
return false;
}
else if (ite->GrType == 14)
else if (ite->GrType == Gradient_Hatch)
{
if (!PDF_HatchFill(tmpOut, ite))
return false;
4838,7 → 4838,7
}
if (!tmpOut.isEmpty())
{
if (ite->GrType == 14)
if (ite->GrType == Gradient_Hatch)
tmp += tmpOut;
else
{
4922,12 → 4922,12
}
if (ite->GrType != 0)
{
if (ite->GrType == 8)
if (ite->GrType == Gradient_Pattern)
{
if (!PDF_PatternFillStroke(tmpOut, ite))
return false;
}
else if (ite->GrType == 14)
else if (ite->GrType == Gradient_Hatch)
{
if (!PDF_HatchFill(tmpOut, ite))
return false;
4939,7 → 4939,7
}
if (!tmpOut.isEmpty())
{
if (ite->GrType == 14)
if (ite->GrType == Gradient_Hatch)
tmp += tmpOut;
else
{
6455,7 → 6455,7
}
else
{
if (currItem->GrType == 14)
if (currItem->GrType == Gradient_Hatch)
Transpar[ShName] = writeGState("/CA " + FToStr(1.0 - currItem->fillTransparency()) + "\n/ca " + FToStr(1.0 - currItem->fillTransparency()) + "\n/SMask /None\n/AIS false\n/OPM 1\n/BM /" + blendMode(currItem->fillBlendmode()) + "\n");
else
Transpar[ShName] = writeGState("/ca " + FToStr(1.0 - currItem->fillTransparency()) + "\n/SMask /None\n/AIS false\n/OPM 1\n/BM /" + blendMode(currItem->fillBlendmode()) + "\n");
8190,13 → 8190,13
else
{
GType = currItem->GrType;
if (GType == 9)
if (GType == Gradient_4Colors)
return PDF_TensorGradientFill(output, currItem);
if (GType == 10)
if (GType == Gradient_Diamond)
return PDF_DiamondGradientFill(output, currItem);
if ((GType == 11) || (GType == 13))
if ((GType == Gradient_Mesh) || (GType == Gradient_Conical))
return PDF_MeshGradientFill(output, currItem);
if (GType == 12)
if (GType == Gradient_PatchMesh)
return PDF_PatchMeshGradientFill(output, currItem);
StartX = currItem->GrStartX;
StartY = currItem->GrStartY;
8249,7 → 8249,7
Gskew = 0;
else
Gskew = tan(M_PI / 180.0 * Gskew);
if (GType == 6)
if (GType == Gradient_Linear)
{
mpa.translate(StartX, -StartY);
mpa.shear(Gskew, 0);
8319,7 → 8319,7
QTransform mpM;
//#12058: cause problems with rotated objects
//mpM.rotate(-currItem->rotation());
if (GType == 6)
if (GType == Gradient_Linear)
{
mpM.translate(StartX, -StartY);
mpM.shear(Gskew, 0);
8342,7 → 8342,7
PutDoc("/Matrix [" + TransformToStr(mpM) + "]\n");
PutDoc("/Shading\n");
PutDoc("<<\n");
if (GType == 6)
if (GType == Gradient_Linear)
PutDoc("/ShadingType 2\n");
else
PutDoc("/ShadingType 3\n");
8351,7 → 8351,7
PutDoc("/Extend [false false]\n");
else
PutDoc("/Extend [true true]\n");
if (GType == 6)
if (GType == Gradient_Linear)
PutDoc("/Coords [" + FToStr(StartX) + " " + FToStr(-StartY) + " " + FToStr(EndX) + " " + FToStr(-EndY) + "]\n");
else
PutDoc("/Coords [" + FToStr(FocalX) + " " + FToStr(-FocalY) + " 0.0 " + FToStr(StartX) + " " + FToStr(-StartY) + " " + FToStr(sqrt(pow(EndX - StartX, 2) + pow(EndY - StartY,2))) + "]\n");
8445,7 → 8445,7
PutDoc("/Matrix [" + TransformToStr(mpa) + "]\n");
PutDoc("/Shading\n");
PutDoc("<<\n");
if (GType == 6)
if (GType == Gradient_Linear)
PutDoc("/ShadingType 2\n");
else
PutDoc("/ShadingType 3\n");
8479,7 → 8479,7
PutDoc("/Extend [false false]\n");
else
PutDoc("/Extend [true true]\n");
if (GType == 6)
if (GType == Gradient_Linear)
PutDoc("/Coords [" + FToStr(StartX) + " " + FToStr(-StartY) + " " + FToStr(EndX) + " " + FToStr(-EndY) + "]\n");
else
PutDoc("/Coords [" + FToStr(FocalX) + " " + FToStr(-FocalY) + " 0.0 " + FToStr(StartX) + " " + FToStr(-StartY) + " " + FToStr(sqrt(pow(EndX - StartX, 2) + pow(EndY - StartY,2))) + "]\n");
/trunk/Scribus/scribus/plugins/export/svgexplugin/svgexplugin.cpp
903,7 → 903,7
if ((!item->strokePattern().isEmpty()) && (item->patternStrokePath))
{
ob = m_domDoc.createElement("g");
if (item->GrType == 14)
if (item->GrType == Gradient_Hatch)
{
QDomElement ob1 = processHatchFill(item, trans);
ob.appendChild(ob1);
911,7 → 911,7
QDomElement ob2 = m_domDoc.createElement("path");
ob2.setAttribute("d", setClipPath(&item->PoLine, closedPath));
ob2.setAttribute("transform", trans);
if (item->GrType != 14)
if (item->GrType != Gradient_Hatch)
ob2.setAttribute("style", fill);
else
{
924,7 → 924,7
}
else
{
if (item->GrType == 14)
if (item->GrType == Gradient_Hatch)
{
ob = m_domDoc.createElement("g");
ob.setAttribute("transform", trans);
948,7 → 948,7
{
ob = m_domDoc.createElement("g");
ob.setAttribute("transform", trans);
if (item->GrType == 14)
if (item->GrType == Gradient_Hatch)
{
QDomElement ob1 = processHatchFill(item);
ob.appendChild(ob1);
955,7 → 955,7
}
QDomElement ob2 = m_domDoc.createElement("path");
ob2.setAttribute("d", setClipPath(&item->PoLine, closedPath));
if (item->GrType != 14)
if (item->GrType != Gradient_Hatch)
ob2.setAttribute("style", fill);
else
{
1015,7 → 1015,7
ob.setAttribute("transform", trans);
if ((item->fillColor() != CommonStrings::None) || (item->GrType != 0))
{
if (item->GrType == 14)
if (item->GrType == Gradient_Hatch)
{
QDomElement ob1 = processHatchFill(item);
ob.appendChild(ob1);
1270,7 → 1270,7
ob.setAttribute("transform", trans);
if ((item->fillColor() != CommonStrings::None) || (item->GrType != 0))
{
if (item->GrType == 14)
if (item->GrType == Gradient_Hatch)
{
QDomElement ob1 = processHatchFill(item);
ob.appendChild(ob1);
1590,7 → 1590,7
else if (item->GrTypeStroke > 0)
{
QDomElement grad;
if (item->GrTypeStroke == 7)
if (item->GrTypeStroke == Gradient_Radial)
{
grad = m_domDoc.createElement("radialGradient");
grad.setAttribute("r", FToStr(sqrt(pow(item->GrStrokeEndX - item->GrStrokeStartX, 2) + pow(item->GrStrokeEndY - item->GrStrokeStartY,2))));
1755,7 → 1755,7
else if (item->GrTypeStroke > 0)
{
QDomElement grad;
if (item->GrTypeStroke == 7)
if (item->GrTypeStroke == Gradient_Radial)
{
grad = m_domDoc.createElement("radialGradient");
grad.setAttribute("r", FToStr(sqrt(pow(item->GrStrokeEndX - item->GrStrokeStartX, 2) + pow(item->GrStrokeEndY - item->GrStrokeStartY,2))));
1916,7 → 1916,7
else
gradientSkew = tan(M_PI / 180.0 * item->GrMaskSkew);
QTransform qmatrix;
if (item->GrType == 6)
if (item->GrType == Gradient_Linear)
{
qmatrix.translate(item->GrMaskStartX, item->GrMaskStartY);
qmatrix.shear(-gradientSkew, 0);
1979,7 → 1979,7
fill = "fill:" + setColor(item->fillColor(), item->fillShade()) + ";";
if (item->GrType != 0)
{
if (item->GrType == 8)
if (item->GrType == Gradient_Pattern)
{
QString pattID = item->pattern() + IToStr(m_pattCount);
m_pattCount++;
2010,7 → 2010,7
}
else
{
if (item->GrType == 6)
if (item->GrType == Gradient_Linear)
{
grad = m_domDoc.createElement("linearGradient");
grad.setAttribute("x1", FToStr(item->GrStartX));
2039,7 → 2039,7
else
gradientSkew = tan(M_PI / 180.0 * item->GrSkew);
QTransform qmatrix;
if (item->GrType == 6)
if (item->GrType == Gradient_Linear)
{
qmatrix.translate(item->GrStartX, item->GrStartY);
qmatrix.shear(-gradientSkew, 0);
2228,7 → 2228,7
else if (item->GrTypeStroke > 0)
{
QDomElement grad;
if (item->GrTypeStroke == 7)
if (item->GrTypeStroke == Gradient_Radial)
{
grad = m_domDoc.createElement("radialGradient");
grad.setAttribute("r", FToStr(sqrt(pow(item->GrStrokeEndX - item->GrStrokeStartX, 2) + pow(item->GrStrokeEndY - item->GrStrokeStartY,2))));
2277,7 → 2277,7
else
gradientSkew = tan(M_PI / 180.0 * item->GrStrokeSkew);
QTransform qmatrix;
if (item->GrType == 6)
if (item->GrType == Gradient_Linear)
{
qmatrix.translate(item->GrStrokeStartX, item->GrStrokeStartY);
qmatrix.shear(-gradientSkew, 0);
/trunk/Scribus/scribus/plugins/export/xpsexport/xpsexplugin.cpp
567,7 → 567,7
if (((Item->GrType == 0) && (Item->fillColor() == CommonStrings::None)) && ((Item->GrTypeStroke == 0) && (Item->lineColor() == CommonStrings::None) && Item->NamedLStyle.isEmpty()))
return;
 
if (Item->GrType == 14)
if (Item->GrType == Gradient_Hatch)
processHatchFill(xOffset, yOffset, Item, parentElem, rel_root);
bool closedPath;
closedPath = ((Item->itemType() == PageItem::Polygon) || (Item->itemType() == PageItem::RegularPolygon) || (Item->itemType() == PageItem::Arc));
589,7 → 589,7
else
pa.prepend("F 1 ");
ob.setAttribute("Data", pa);
if (Item->GrType != 14)
if (Item->GrType != Gradient_Hatch)
{
if (Item->GrMask > 0)
handleMask(3, Item, ob, rel_root, xOffset, yOffset);
671,7 → 671,7
 
void XPSExPlug::processImageItem(double xOffset, double yOffset, PageItem *Item, QDomElement &parentElem, QDomElement &rel_root)
{
if (Item->GrType == 14)
if (Item->GrType == Gradient_Hatch)
processHatchFill(xOffset, yOffset, Item, parentElem, rel_root);
FPointArray path = Item->PoLine.copy();
path.translate(xOffset, yOffset);
690,7 → 690,7
mpx.translate(-xOffset * conversionFactor, -yOffset * conversionFactor);
grp.setAttribute("RenderTransform", MatrixToStr(mpx));
}
if (Item->GrType != 14)
if (Item->GrType != Gradient_Hatch)
{
if (Item->GrMask > 0)
handleMask(1, Item, grp, rel_root, xOffset, yOffset);
997,7 → 997,7
{
if (Item->isAnnotation())
return;
if (Item->GrType == 14)
if (Item->GrType == Gradient_Hatch)
processHatchFill(xOffset, yOffset, Item, parentElem, rel_root);
FPointArray path = Item->PoLine.copy();
path.scale(conversionFactor, conversionFactor);
1029,7 → 1029,7
grp.setAttribute("RenderTransform", MatrixToStr(mpx));
if (Item->isBookmark)
grp.setAttribute("Name", Item->itemName());
if (Item->GrType != 14)
if (Item->GrType != Gradient_Hatch)
{
if (Item->GrMask > 0)
handleMask(1, Item, grp, rel_root, xOffset, yOffset);
2016,7 → 2016,7
ob.appendChild(gr);
parentElem.appendChild(ob);
}
else if ((Item->GrTypeStroke == 6) || (Item->GrTypeStroke == 7))
else if ((Item->GrTypeStroke == Gradient_Linear) || (Item->GrTypeStroke == Gradient_Radial))
{
QDomElement ob;
if (forArrow)
2030,7 → 2030,7
double GrFocalY = (Item->GrStrokeFocalY + yOffset) * conversionFactor;
double GrEndX = (Item->GrStrokeEndX + xOffset) * conversionFactor;
double GrEndY = (Item->GrStrokeEndY + yOffset) * conversionFactor;
if (Item->GrTypeStroke == 6)
if (Item->GrTypeStroke == Gradient_Linear)
{
gr = p_docu.createElement("LinearGradientBrush");
gr.setAttribute("MappingMode", "Absolute");
2059,7 → 2059,7
else
gradientSkew = tan(M_PI / 180.0 * Item->GrStrokeSkew);
QTransform qmatrix;
if (Item->GrTypeStroke == 6)
if (Item->GrTypeStroke == Gradient_Linear)
{
qmatrix.translate(GrStartX, GrStartY);
qmatrix.shear(-gradientSkew, 0);
2079,7 → 2079,7
if (Item->lineTransparency() != 0)
gr.setAttribute("Opacity", FToStr(1.0 - Item->lineTransparency()));
QDomElement grs;
if (Item->GrTypeStroke == 6)
if (Item->GrTypeStroke == Gradient_Linear)
grs = p_docu.createElement("LinearGradientBrush.GradientStops");
else
grs = p_docu.createElement("RadialGradientBrush.GradientStops");
2120,7 → 2120,7
return;
}
 
if ((Item->GrType == 6) || (Item->GrType == 7))
if ((Item->GrType == Gradient_Linear) || (Item->GrType == Gradient_Radial))
{
QDomElement ob = p_docu.createElement("Path.Fill");
QDomElement gr;
2130,7 → 2130,7
double GrFocalY = (Item->GrFocalY + yOffset) * conversionFactor;
double GrEndX = (Item->GrEndX + xOffset) * conversionFactor;
double GrEndY = (Item->GrEndY + yOffset) * conversionFactor;
if (Item->GrType == 6)
if (Item->GrType == Gradient_Linear)
{
gr = p_docu.createElement("LinearGradientBrush");
gr.setAttribute("MappingMode", "Absolute");
2159,7 → 2159,7
else
gradientSkew = tan(M_PI / 180.0 * Item->GrSkew);
QTransform qmatrix;
if (Item->GrType == 6)
if (Item->GrType == Gradient_Linear)
{
qmatrix.translate(GrStartX, GrStartY);
qmatrix.shear(-gradientSkew, 0);
2179,7 → 2179,7
if ((Item->fillTransparency() != 0) && ((withTransparency) || (Item->GrMask == 0)))
gr.setAttribute("Opacity", FToStr(1.0 - Item->fillTransparency()));
QDomElement grs;
if (Item->GrType == 6)
if (Item->GrType == Gradient_Linear)
grs = p_docu.createElement("LinearGradientBrush.GradientStops");
else
grs = p_docu.createElement("RadialGradientBrush.GradientStops");
2649,7 → 2649,7
bool ret = false;
int GrType = Item->GrType;
int GrMask = Item->GrMask;
if ((GrType == 9) || (GrType == 10) || (GrType == 11) || (GrType == 12) || (GrType == 13))
if ((GrType == Gradient_4Colors) || (GrType == Gradient_Diamond) || (GrType == Gradient_Mesh) || (GrType == Gradient_PatchMesh) || (GrType == Gradient_Conical))
ret = true;
if ((GrMask == 4) || (GrMask == 5) || (GrMask == 6) || (GrMask == 7) || (GrMask == 8))
ret = true;
/trunk/Scribus/scribus/plugins/fileloader/scribus12format/scribus12format.cpp
578,13 → 578,13
if (Buffer->GrType != 0)
{
currItem->GrType = Buffer->GrType;
if (Buffer->GrType == 8)
if (Buffer->GrType == Gradient_Pattern)
{
currItem->setPattern(Buffer->pattern);
currItem->setPatternTransform(Buffer->patternScaleX, Buffer->patternScaleY, Buffer->patternOffsetX, Buffer->patternOffsetY, Buffer->patternRotation, Buffer->patternSkewX, Buffer->patternSkewY);
currItem->setPatternFlip(Buffer->patternMirrorX, Buffer->patternMirrorY);
}
else if (Buffer->GrType == 11)
else if (Buffer->GrType == Gradient_Mesh)
{
currItem->meshGradientArray = Buffer->meshGradientArray;
}
593,7 → 593,7
if ((!Buffer->GrColor.isEmpty()) && (!Buffer->GrColor2.isEmpty()))
{
currItem->fill_gradient.clearStops();
if (Buffer->GrType == 5)
if (Buffer->GrType == Gradient_RadialLegacy5)
{
if ((Buffer->GrColor != CommonStrings::None) && (!Buffer->GrColor.isEmpty()))
currItem->SetQColor(&tmp, Buffer->GrColor, Buffer->GrShade);
641,6 → 641,20
currItem->GrCol4Shade = Buffer->GrCol4Shade;
currItem->set4ColorColors(currItem->GrColorP1, currItem->GrColorP2, currItem->GrColorP3, currItem->GrColorP4);
}
switch (currItem->GrType)
{
case Gradient_LinearLegacy1:
case Gradient_LinearLegacy2:
case Gradient_LinearLegacy3:
case Gradient_LinearLegacy4:
currItem->GrType = Gradient_Linear;
break;
case Gradient_RadialLegacy5:
currItem->GrType = Gradient_Radial;
break;
default:
break;
}
}
if (Buffer->GrTypeStroke > 0)
{
1431,7 → 1445,7
OB->fill_gradient.clearStops();
if (OB->GrType != 0)
{
if (OB->GrType == 8)
if (OB->GrType == Gradient_Pattern)
{
OB->pattern = obj->attribute("pattern", "");
OB->patternScaleX = ScCLocale::toDoubleC(obj->attribute("pScaleX"), 100.0);
1499,23 → 1513,23
 
switch (OB->GrType)
{
case 1:
case 2:
case 3:
case 4:
OB->GrType = 6;
case Gradient_LinearLegacy1:
case Gradient_LinearLegacy2:
case Gradient_LinearLegacy3:
case Gradient_LinearLegacy4:
OB->GrType = Gradient_Linear;
break;
case 5:
OB->GrType = 7;
case Gradient_RadialLegacy5:
OB->GrType = Gradient_Radial;
break;
default:
break;
}
OB->Rot=ScCLocale::toDoubleC(obj->attribute("ROT"));
OB->PLineArt=Qt::PenStyle(obj->attribute("PLINEART").toInt());
OB->PLineEnd=Qt::PenCapStyle(obj->attribute("PLINEEND", "0").toInt());
OB->PLineJoin=Qt::PenJoinStyle(obj->attribute("PLINEJOIN", "0").toInt());
OB->LineSp=ScCLocale::toDoubleC(obj->attribute("LINESP"));
OB->Rot = ScCLocale::toDoubleC(obj->attribute("ROT"));
OB->PLineArt = Qt::PenStyle(obj->attribute("PLINEART").toInt());
OB->PLineEnd = Qt::PenCapStyle(obj->attribute("PLINEEND", "0").toInt());
OB->PLineJoin = Qt::PenJoinStyle(obj->attribute("PLINEJOIN", "0").toInt());
OB->LineSp = ScCLocale::toDoubleC(obj->attribute("LINESP"));
OB->LineSpMode = obj->attribute("LINESPMode", "0").toInt();
OB->LocalScX = ScCLocale::toDoubleC(obj->attribute("LOCALSCX"));
OB->LocalScY = ScCLocale::toDoubleC(obj->attribute("LOCALSCY"));
/trunk/Scribus/scribus/plugins/fileloader/scribus134format/scribus134format.cpp
3065,7 → 3065,7
int GrShade2 = 0;
if (currItem->GrType != 0)
{
if (currItem->GrType == 8)
if (currItem->GrType == Gradient_Pattern)
{
currItem->setPattern( attrs.valueAsString("pattern", "") );
double patternScaleX = attrs.valueAsDouble("pScaleX", 100.0);
3094,12 → 3094,12
}
}
}
if ((currItem->GrType != 0) && (currItem->GrType != 8))
if ((currItem->GrType != 0) && (currItem->GrType != Gradient_Pattern))
{
currItem->fill_gradient.clearStops();
if ((!GrColor.isEmpty()) && (!GrColor2.isEmpty()))
{
if (currItem->GrType == 5)
if (currItem->GrType == Gradient_RadialLegacy5)
{
if ((GrColor != CommonStrings::None) && (!GrColor.isEmpty()))
currItem->SetQColor(&tmpc, GrColor, GrShade);
3122,14 → 3122,14
}
switch (currItem->GrType)
{
case 1:
case 2:
case 3:
case 4:
currItem->GrType = 6;
case Gradient_LinearLegacy1:
case Gradient_LinearLegacy2:
case Gradient_LinearLegacy3:
case Gradient_LinearLegacy4:
currItem->GrType = Gradient_Linear;
break;
case 5:
currItem->GrType = 7;
case Gradient_RadialLegacy5:
currItem->GrType = Gradient_Radial;
break;
default:
break;
/trunk/Scribus/scribus/plugins/fileloader/scribus13format/scribus13format.cpp
1977,7 → 1977,7
currItem->fill_gradient.clearStops();
if ((!GrColor.isEmpty()) && (!GrColor2.isEmpty()))
{
if (currItem->GrType == 5)
if (currItem->GrType == Gradient_RadialLegacy5)
{
handleOldColorShade(doc, GrColor, GrShade);
if ((GrColor != CommonStrings::None) && (!GrColor.isEmpty()))
2004,14 → 2004,14
}
switch (currItem->GrType)
{
case 1:
case 2:
case 3:
case 4:
currItem->GrType = 6;
case Gradient_LinearLegacy1:
case Gradient_LinearLegacy2:
case Gradient_LinearLegacy3:
case Gradient_LinearLegacy4:
currItem->GrType = Gradient_Linear;
break;
case 5:
currItem->GrType = 7;
case Gradient_RadialLegacy5:
currItem->GrType = Gradient_Radial;
break;
default:
break;
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
4343,7 → 4343,7
newItem->mask_gradient.addStop(ScColorEngine::getRGBColor(col1, doc), 0.0, 0.5, 1.0, doc->itemToolPrefs().shapeFillColor, 100);
newItem->mask_gradient.addStop(ScColorEngine::getRGBColor(col2, doc), 1.0, 0.5, 1.0, doc->itemToolPrefs().shapeLineColor, 100);
}
if (newItem->GrType == 13)
if (newItem->GrType == Gradient_Conical)
{
if (!newItem->gradient().isEmpty())
newItem->fill_gradient = doc->docGradients[newItem->gradient()];
5639,7 → 5639,7
int GrShade2 = 0;
if (currItem->GrType != 0)
{
if (currItem->GrType == 8)
if (currItem->GrType == Gradient_Pattern)
{
currItem->setPattern( attrs.valueAsString("pattern", "") );
double patternScaleX = attrs.valueAsDouble("pScaleX", 100.0);
5654,7 → 5654,7
bool mirrorY = attrs.valueAsBool("pMirrorY", false);
currItem->setPatternFlip(mirrorX, mirrorY);
}
else if (currItem->GrType == 11)
else if (currItem->GrType == Gradient_Mesh)
{
currItem->meshGradientArray.clear();
int mGArrayRows = attrs.valueAsInt("GMAX", 1);
5670,7 → 5670,7
currItem->meshGradientArray.append(ml);
}
}
else if (currItem->GrType == 12)
else if (currItem->GrType == Gradient_PatchMesh)
{
currItem->meshGradientPatches.clear();
int mGArrayRows = attrs.valueAsInt("GMAX", 1);
5680,7 → 5680,7
currItem->meshGradientPatches.append(patchM);
}
}
else if (currItem->GrType == 14)
else if (currItem->GrType == Gradient_Hatch)
{
int hatchType = attrs.valueAsInt("HatchMode", 0);
double hatchDistance = attrs.valueAsDouble("HatchDist", 2);
5711,7 → 5711,7
GrName = attrs.valueAsString("GRNAME","");
if (!GrName.isEmpty())
currItem->setGradient(GrName);
if ((currItem->GrType == 9) || (currItem->GrType == 10))
if ((currItem->GrType == Gradient_4Colors) || (currItem->GrType == Gradient_Diamond))
{
currItem->GrControl1 = FPoint(attrs.valueAsDouble("GRC1X", 0.0), attrs.valueAsDouble("GRC1Y", 0.0));
currItem->GrControl2 = FPoint(attrs.valueAsDouble("GRC2X", 0.0), attrs.valueAsDouble("GRC2Y", 0.0));
5734,12 → 5734,12
}
}
}
if (((currItem->GrType != 0) && (currItem->GrType != 8) && (currItem->GrType != 14)) && (currItem->gradient().isEmpty()))
if (((currItem->GrType != 0) && (currItem->GrType != Gradient_Pattern) && (currItem->GrType != Gradient_Hatch)) && (currItem->gradient().isEmpty()))
{
currItem->fill_gradient.clearStops();
if ((!GrColor.isEmpty()) && (!GrColor2.isEmpty()))
{
if (currItem->GrType == 5)
if (currItem->GrType == Gradient_RadialLegacy5)
{
if ((GrColor != CommonStrings::None) && (!GrColor.isEmpty()))
currItem->SetQColor(&tmpc, GrColor, GrShade);
5760,6 → 5760,7
}
// currItem->updateGradientVectors();
}
 
currItem->setStrokePattern( attrs.valueAsString("patternS", "") );
double patternScaleX = attrs.valueAsDouble("pScaleXS", 100.0);
double patternScaleY = attrs.valueAsDouble("pScaleYS", 100.0);
5776,7 → 5777,7
currItem->setPatternFlip(mirrorX, mirrorY);
currItem->setStrokePatternToPath(atPath);
currItem->GrTypeStroke = attrs.valueAsInt("GRTYPS", 0);
if (((currItem->GrTypeStroke != 0) && (currItem->GrTypeStroke != 8)) && (currItem->strokeGradient().isEmpty()))
if (((currItem->GrTypeStroke != 0) && (currItem->GrTypeStroke != Gradient_Pattern)) && (currItem->strokeGradient().isEmpty()))
currItem->stroke_gradient.clearStops();
currItem->GrStrokeStartX = attrs.valueAsDouble("GRSTARTXS", 0.0);
currItem->GrStrokeStartY = attrs.valueAsDouble("GRSTARTYS", 0.0);
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
1907,7 → 1907,7
docu.writeAttribute("pattern", item->pattern());
if (item->GrType != 0)
{
if (item->GrType == 8)
if (item->GrType == Gradient_Pattern)
{
docu.writeAttribute("pattern", item->pattern());
double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
1926,16 → 1926,16
}
else
{
if (item->GrType == 11)
if (item->GrType == Gradient_Mesh)
{
docu.writeAttribute("GMAY", item->meshGradientArray[0].count());
docu.writeAttribute("GMAX", item->meshGradientArray.count());
}
else if (item->GrType == 12)
else if (item->GrType == Gradient_PatchMesh)
{
docu.writeAttribute("GMAX", item->meshGradientPatches.count());
}
else if (item->GrType == 14)
else if (item->GrType == Gradient_Hatch)
{
docu.writeAttribute("HatchMode", item->hatchType);
docu.writeAttribute("HatchDist", item->hatchDistance);
1955,7 → 1955,7
docu.writeAttribute("GRSCALE" , item->GrScale);
docu.writeAttribute("GRSKEW" , item->GrSkew);
docu.writeAttribute("GRExt", item->getGradientExtend());
if ((item->GrType == 9) || (item->GrType == 10))
if ((item->GrType == Gradient_4Colors) || (item->GrType == Gradient_Diamond))
{
docu.writeAttribute("GRC1X" , item->GrControl1.x());
docu.writeAttribute("GRC1Y" , item->GrControl1.y());
2129,7 → 2129,7
docu.writeAttribute("Blend", it2.value().blend);
}
}
if (((item->GrType > 0) && (item->GrType != 8) && (item->GrType != 9) && (item->GrType != 11) && (item->GrType != 14)) && (item->gradient().isEmpty()))
if (((item->GrType > 0) && (item->GrType != Gradient_Pattern) && (item->GrType != Gradient_4Colors) && (item->GrType != Gradient_Mesh) && (item->GrType != Gradient_Hatch)) && (item->gradient().isEmpty()))
{
QList<VColorStop*> cstops = item->fill_gradient.colorStops();
for (int cst = 0; cst < item->fill_gradient.stops(); ++cst)
2165,7 → 2165,7
docu.writeAttribute("TRANS", cstops.at(cst)->opacity);
}
}
if (item->GrType == 11)
if (item->GrType == Gradient_Mesh)
{
for (int grow = 0; grow < item->meshGradientArray.count(); grow++)
{
2192,7 → 2192,7
}
}
}
if (item->GrType == 12)
if (item->GrType == Gradient_PatchMesh)
{
for (int grow = 0; grow < item->meshGradientPatches.count(); grow++)
{
/trunk/Scribus/scribus/plugins/import/ai/importai.cpp
1584,14 → 1584,14
{
ite->setPattern(currentPatternName);
ite->setPatternTransform(currentPatternXScale * 100, currentPatternYScale * 100, currentPatternX, currentPatternY, currentPatternRotation, 0.0, 0.0);
ite->GrType = 8;
currentPatternName = "";
ite->GrType = Gradient_Pattern;
currentPatternName.clear();
}
if (!currentStrokePatternName.isEmpty())
{
ite->setStrokePattern(currentStrokePatternName);
ite->setStrokePatternTransform(currentStrokePatternXScale * 100, currentStrokePatternYScale * 100, currentStrokePatternX, currentStrokePatternY, currentStrokePatternRotation, 0.0, 0.0, 1.0);
currentStrokePatternName = "";
currentStrokePatternName.clear();
}
ite->setLineEnd(CapStyle);
ite->setLineJoin(JoinStyle);
1868,9 → 1868,9
ite->fill_gradient = m_gradients[currentGradientName];
ite->setGradient(currentGradientName);
if (ite->fill_gradient.type() == 0)
ite->GrType = 6;
ite->GrType = Gradient_Linear;
else
ite->GrType = 7;
ite->GrType = Gradient_Radial;
QTransform m1;
m1.translate(currentGradientOrigin.x() - ite->xPos(), currentGradientOrigin.y() - ite->yPos());
m1.translate(m_Doc->currentPage()->xOffset(), m_Doc->currentPage()->yOffset());
1999,7 → 1999,7
}
}
ite->meshGradientArray = meshGradientArray;
ite->GrType = 11;
ite->GrType = Gradient_Mesh;
ite->meshToShape();
for (int grow = 0; grow < ite->meshGradientArray.count(); grow++)
{
/trunk/Scribus/scribus/plugins/import/cgm/importcgm.cpp
3403,7 → 3403,7
if (patternScaleY > -1)
patSY = patternScaleY / pat.height * 100;
ite->setPatternTransform(patSX, patSY, 0, 0, 0, 0.0, 0.0);
ite->GrType = 8;
ite->GrType = Gradient_Pattern;
}
}
else if (fillType == 4)
3432,7 → 3432,7
if (patternScaleY > -1)
patSY = patternScaleY / pat.height * 100;
ite->setPatternTransform(patSX, patSY, 0, 0, 0, 0.0, 0.0);
ite->GrType = 8;
ite->GrType = Gradient_Pattern;
}
}
else
/trunk/Scribus/scribus/plugins/import/drw/importdrw.cpp
1804,7 → 1804,7
{
FillGradient.addStop( ScColorEngine::getRGBColor(gradC2, m_Doc), qMin(grad.yOffset, 0.99), 0.5, 1.0, backColor, 100 );
FillGradient.addStop( ScColorEngine::getRGBColor(gradC1, m_Doc), 1.0, 0.5, 1.0, fillColor, 100 );
currentItem->GrType = 6;
currentItem->GrType = Gradient_Linear;
currentItem->fill_gradient = FillGradient;
currentItem->setGradientVector(bBox.width() / 2.0, 0, bBox.width() / 2.0, bBox.height(), 0, 0, 1, 0);
}
1811,7 → 1811,7
else
{
FillGradient.addStop( ScColorEngine::getRGBColor(gradC2, m_Doc), 1.0, 0.5, 1.0, backColor, 100 );
currentItem->GrType = 7;
currentItem->GrType = Gradient_Radial;
currentItem->fill_gradient = FillGradient;
currentItem->setGradientVector(xoff, yoff, qMax(bBox.width(), bBox.height()), qMax(bBox.width(), bBox.height()), xoff, yoff, 1, 0);
}
1907,7 → 1907,7
importedPatterns.append(patternName);
currentItem->setPattern(patternName);
currentItem->setPatternTransform(16.6666, 16.6666, 0, 0, 0, 0, 0);
currentItem->GrType = 8;
currentItem->GrType = Gradient_Pattern;
}
}
}
/trunk/Scribus/scribus/plugins/import/emf/importemf.cpp
2028,31 → 2028,31
{
case U_HSP_Horizontal:
ite->setHatchParameters(0, 5, 0, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_Vertical:
ite->setHatchParameters(0, 5, 90, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_ForwardDiagonal:
ite->setHatchParameters(0, 5, -45, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_BackwardDiagonal:
ite->setHatchParameters(0, 5, 45, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_LargeGrid:
ite->setHatchParameters(1, 5, 0, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_DiagonalCross:
ite->setHatchParameters(1, 5, 45, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
default:
ite->setHatchParameters(1, 5, 45, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
}
}
2253,7 → 2253,7
}
}
}
ite->GrType = 12;
ite->GrType = Gradient_PatchMesh;
}
else if (currentDC.brushStyle == U_BT_TextureFill)
{
2282,7 → 2282,7
double sy = ite->height() / pat.height * 100;
ite->setPatternTransform(sx, sy, 0, 0, 0, 0, 0);
}
ite->GrType = 8;
ite->GrType = Gradient_Pattern;
}
}
}
2294,27 → 2294,27
{
case U_HSP_Horizontal:
ite->setHatchParameters(0, 5, 0, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_Vertical:
ite->setHatchParameters(0, 5, 90, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_ForwardDiagonal:
ite->setHatchParameters(0, 5, -45, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_BackwardDiagonal:
ite->setHatchParameters(0, 5, 45, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_LargeGrid:
ite->setHatchParameters(1, 5, 0, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_DiagonalCross:
ite->setHatchParameters(1, 5, 45, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case 6:
case 7:
2335,7 → 2335,7
else if (currentDC.brushStyle == U_BT_TextureFill)
{
ite->setPattern(currentDC.patternName);
ite->GrType = 8;
ite->GrType = Gradient_Pattern;
}
}
}
/trunk/Scribus/scribus/plugins/import/odg/importodg.cpp
3593,7 → 3593,7
item->fill_gradient.addStop(ScColorEngine::getRGBColor(gradC, m_Doc), 0.0, 0.5, 1.0, gStyle.gradientEndColor, gStyle.gradientEndShade);
const ScColor& gradC2 = m_Doc->PageColors[gStyle.gradientStartColor];
item->fill_gradient.addStop(ScColorEngine::getRGBColor(gradC2, m_Doc), 1.0 - gStyle.gradientBorder, 0.5, 1.0, gStyle.gradientStartColor, gStyle.gradientStartShade);
item->GrType = 7;
item->GrType = Gradient_Radial;
item->GrStartX = item->width() * gStyle.gradientCenterX;
item->GrStartY = item->height()* gStyle.gradientCenterY;
item->GrFocalX = item->width() * gStyle.gradientCenterX;
3619,7 → 3619,7
item->fill_gradient.addStop(ScColorEngine::getRGBColor(gradC, m_Doc), 0.0, 0.5, 1.0, gStyle.gradientEndColor, gStyle.gradientEndShade);
const ScColor& gradC2 = m_Doc->PageColors[gStyle.gradientStartColor];
item->fill_gradient.addStop(ScColorEngine::getRGBColor(gradC2, m_Doc), 1.0 - gStyle.gradientBorder, 0.5, 1.0, gStyle.gradientStartColor, gStyle.gradientStartShade);
item->GrType = 7;
item->GrType = Gradient_Radial;
item->GrStartX = item->width() * gStyle.gradientCenterX;
item->GrStartY = item->height()* gStyle.gradientCenterY;
item->GrFocalX = item->width() * gStyle.gradientCenterX;
3662,7 → 3662,7
QLineF p4 = QLineF(cp.x(), cp.y(), cp.x() - gLen, cp.y() + gLen);
p4.setAngle(p4.angle() + gStyle.gradientAngle);
item->setDiamondGeometry(FPoint(p1.p2().x(), p1.p2().y()), FPoint(p2.p2().x(), p2.p2().y()), FPoint(p3.p2().x(), p3.p2().y()), FPoint(p4.p2().x(), p4.p2().y()), cp);
item->GrType = 10;
item->GrType = Gradient_Diamond;
}
else if (gStyle.gradientType == "rectangular")
{
3721,7 → 3721,7
iLineP4.setLength(lineLen);
P4 = intersectBoundingRect(item, iLineP4);
item->setDiamondGeometry(FPoint(P1.x(), P1.y()), FPoint(P2.x(), P2.y()), FPoint(P3.x(), P3.y()), FPoint(P4.x(), P4.y()), cp);
item->GrType = 10;
item->GrType = Gradient_Diamond;
*/
/*
item->meshGradientPatches.clear();
3773,7 → 3773,7
patch1.BR = inner;
patch1.TR = inner;
item->meshGradientPatches.append(patch1);
item->GrType = 12;
item->GrType = Gradient_PatchMesh;
*/
 
QLineF p1 = QLineF(cp.x(), cp.y(), cp.x() - gLenW, cp.y() - gLenH);
3785,7 → 3785,7
QLineF p4 = QLineF(cp.x(), cp.y(), cp.x() - gLenW, cp.y() + gLenH);
p4.setAngle(p4.angle() + gStyle.gradientAngle);
item->setDiamondGeometry(FPoint(p1.p2().x(), p1.p2().y()), FPoint(p2.p2().x(), p2.p2().y()), FPoint(p3.p2().x(), p3.p2().y()), FPoint(p4.p2().x(), p4.p2().y()), cp);
item->GrType = 10;
item->GrType = Gradient_Diamond;
}
}
else if (obState.fill_type == 3)
3828,7 → 3828,7
}
item->setPatternTransform(sx, sy, dx, dy, 0, 0, 0);
item->setPattern(patternName);
item->GrType = 8;
item->GrType = Gradient_Pattern;
}
else
{
3902,7 → 3902,7
dy = pat.height * obState.patternY;
}
item->setPatternTransform(sx, sy, dx, dy, 0, 0, 0);
item->GrType = 8;
item->GrType = Gradient_Pattern;
}
}
delete tempFile;
3998,7 → 3998,7
dy = pat.height * obState.patternY;
}
item->setPatternTransform(sx, sy, dx, dy, 0, 0, 0);
item->GrType = 8;
item->GrType = Gradient_Pattern;
}
}
delete tempFile;
4016,7 → 4016,7
else if (gStyle.hatchStyle == "triple")
hatchS = 2;
item->setHatchParameters(hatchS, gStyle.hatchDistance, gStyle.hatchRotation, obState.hatchSolidFill, obState.currColorFill, gStyle.hatchColor);
item->GrType = 14;
item->GrType = Gradient_Hatch;
}
if (!obState.opacityName.isEmpty())
{
/trunk/Scribus/scribus/plugins/import/oodraw/oodrawimp.cpp
1161,9 → 1161,9
double gradientAngle(oostyle.gradientAngle);
if ((gradientAngle == 0) || (gradientAngle == 180) || (gradientAngle == 90) || (gradientAngle == 270))
{
item->GrType = Gradient_Linear;
if ((gradientAngle == 0) || (gradientAngle == 180))
{
item->GrType = 6;
item->GrStartX = item->width() / 2.0;
item->GrStartY = 0;
item->GrEndX = item->width() / 2.0;
1171,7 → 1171,6
}
else if ((gradientAngle == 90) || (gradientAngle == 270))
{
item->GrType = 6;
item->GrStartX = 0;
item->GrStartY = item->height() / 2.0;
item->GrEndX = item->width();
1221,12 → 1220,12
item->GrStartX = xpos;
item->GrStartY = 0;
}
item->GrType = 6;
item->GrType = Gradient_Linear;
}
}
if (oostyle.gradientType == 2)
{
item->GrType = 7;
item->GrType = Gradient_Radial;
item->GrStartX = item->width() * oostyle.gradientPointX;
item->GrStartY = item->height()* oostyle.gradientPointY;
if (item->width() >= item->height())
/trunk/Scribus/scribus/plugins/import/pages/importpages.cpp
2205,7 → 2205,7
else if (!obState.patternName.isEmpty())
{
item->setPattern(obState.patternName);
item->GrType = 8;
item->GrType = Gradient_Pattern;
}
if (obState.maskTyp != 0)
{
2226,7 → 2226,7
}
if (!obState.patternStroke.isEmpty())
{
item->GrTypeStroke = 8;
item->GrTypeStroke = Gradient_Pattern;
item->setStrokePattern(obState.patternStroke);
}
if (!obState.DashPattern.isEmpty())
/trunk/Scribus/scribus/plugins/import/pct/importpct.cpp
2218,7 → 2218,7
else
patternName = patternMap[patNa];
ite->setPattern(patternName);
ite->GrType = 8;
ite->GrType = Gradient_Pattern;
m_Doc->TotalItems = oldNum;
// qDebug() << "Using Pattern" << patternName << "internal Name" << patNa;
}
/trunk/Scribus/scribus/plugins/import/revenge/rawpainter.cpp
1839,7 → 1839,7
else if (angle == 270)
ite->setGradientVector(0, h / 2.0, w, h / 2.0, 0, 0, 1, 0);
ite->fill_gradient = m_currentGradient;
ite->GrType = 6;
ite->GrType = Gradient_Linear;
}
else if (gradMode == "radial")
{
1853,7 → 1853,7
cy = m_style["svg:cy"]->getDouble();
ite->setGradientVector(cx, cy, w, h / 2.0, cx, cy, 1, 0);
ite->fill_gradient = m_currentGradient;
ite->GrType = 7;
ite->GrType = Gradient_Radial;
}
else if (gradMode == "square")
{
1871,7 → 1871,7
{
ite->fill_gradient.addStop(colorStops[a]->color, 1.0 - colorStops[a]->rampPoint, colorStops[a]->midPoint, colorStops[a]->opacity, colorStops[a]->name, colorStops[a]->shade);
}
ite->GrType = 10;
ite->GrType = Gradient_Diamond;
}
else if (gradMode == "center")
{
1894,7 → 1894,7
{
ite->fill_gradient.addStop(colorStops[a]->color, 1.0 - colorStops[a]->rampPoint, colorStops[a]->midPoint, colorStops[a]->opacity, colorStops[a]->name, colorStops[a]->shade);
}
ite->GrType = 10;
ite->GrType = Gradient_Diamond;
}
else if (gradMode == "shape")
{
2105,7 → 2105,7
ite->meshGradientPatches.append(patch);
}
*/
ite->GrType = 12;
ite->GrType = Gradient_PatchMesh;
}
}
if (m_style["draw:fill"] && m_style["draw:fill"]->getStr() == "bitmap")
2172,7 → 2172,7
m_Doc->addPattern(patternName, pat);
m_importedPatterns->append(patternName);
ite->setPattern(patternName);
ite->GrType = 8;
ite->GrType = Gradient_Pattern;
}
delete tempFile;
}
3228,7 → 3228,7
else if (angle == 270)
ite->setGradientVector(0, h / 2.0, w, h / 2.0, 0, 0, 1, 0);
ite->fill_gradient = m_currentGradient;
ite->GrType = 6;
ite->GrType = Gradient_Linear;
}
else if (gradMode == "radial")
{
3242,7 → 3242,7
cy = m_style["svg:cy"]->getDouble();
ite->setGradientVector(cx, cy, w, h / 2.0, cx, cy, 1, 0);
ite->fill_gradient = m_currentGradient;
ite->GrType = 7;
ite->GrType = Gradient_Radial;
}
else if (gradMode == "square")
{
3260,7 → 3260,7
{
ite->fill_gradient.addStop(colorStops[a]->color, 1.0 - colorStops[a]->rampPoint, colorStops[a]->midPoint, colorStops[a]->opacity, colorStops[a]->name, colorStops[a]->shade);
}
ite->GrType = 10;
ite->GrType = Gradient_Diamond;
}
else if (gradMode == "center")
{
3283,7 → 3283,7
{
ite->fill_gradient.addStop(colorStops[a]->color, 1.0 - colorStops[a]->rampPoint, colorStops[a]->midPoint, colorStops[a]->opacity, colorStops[a]->name, colorStops[a]->shade);
}
ite->GrType = 10;
ite->GrType = Gradient_Diamond;
}
else if (gradMode == "shape")
{
3320,7 → 3320,7
patch.TR = tR;
ite->meshGradientPatches.append(patch);
}
ite->GrType = 12;
ite->GrType = Gradient_PatchMesh;
}
}
if (m_style["draw:fill"] && m_style["draw:fill"]->getStr() == "bitmap")
3387,7 → 3387,7
m_Doc->addPattern(patternName, pat);
m_importedPatterns->append(patternName);
ite->setPattern(patternName);
ite->GrType = 8;
ite->GrType = Gradient_Pattern;
}
delete tempFile;
}
/trunk/Scribus/scribus/plugins/import/svm/importsvm.cpp
1229,31 → 1229,31
{
case U_HSP_Horizontal:
ite->setHatchParameters(0, 5, 0, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_Vertical:
ite->setHatchParameters(0, 5, 90, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_ForwardDiagonal:
ite->setHatchParameters(0, 5, -45, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_BackwardDiagonal:
ite->setHatchParameters(0, 5, 45, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_LargeGrid:
ite->setHatchParameters(1, 5, 0, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
case U_HSP_DiagonalCross:
ite->setHatchParameters(1, 5, 45, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
default:
ite->setHatchParameters(1, 5, 45, currentDC.backgroundMode, currentDC.backColor, currentDC.CurrColorFill);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
break;
}
}
1454,7 → 1454,7
}
}
}
ite->GrType = 12;
ite->GrType = Gradient_PatchMesh;
}
else if (currentDC.brushStyle == U_BT_TextureFill)
{
1483,7 → 1483,7
double sy = ite->height() / pat.height * 100;
ite->setPatternTransform(sx, sy, 0, 0, 0, 0, 0);
}
ite->GrType = 8;
ite->GrType = Gradient_Pattern;
}
}
}
2179,7 → 2179,7
finishItem(ite);
QString haColor = handleColor(colS);
ite->setHatchParameters(haStyle, convertLogical2Pts(haDist), haAngle / 10.0, false, CommonStrings::None, haColor);
ite->GrType = 14;
ite->GrType = Gradient_Hatch;
}
}
 
2278,7 → 2278,7
ite->fill_gradient.setRepeatMethod( VGradient::none );
ite->fill_gradient.addStop(colE, 0.0, 0.5, 1.0, gradientEndColor, gradientEndShade);
ite->fill_gradient.addStop(colS, 1.0 - (mnBorder / 100.0), 0.5, 1.0, gradientStartColor, gradientStartShade);
ite->GrType = 7;
ite->GrType = Gradient_Radial;
ite->GrStartX = ite->width() * gradientCenterX;
ite->GrStartY = ite->height()* gradientCenterY;
ite->GrFocalX = ite->width() * gradientCenterX;
2302,7 → 2302,7
ite->fill_gradient.setRepeatMethod( VGradient::none );
ite->fill_gradient.addStop(colE, 0.0, 0.5, 1.0, gradientEndColor, gradientEndShade);
ite->fill_gradient.addStop(colS, 1.0 - (mnBorder / 100.0), 0.5, 1.0, gradientStartColor, gradientStartShade);
ite->GrType = 7;
ite->GrType = Gradient_Radial;
ite->GrStartX = ite->width() * gradientCenterX;
ite->GrStartY = ite->height()* gradientCenterY;
ite->GrFocalX = ite->width() * gradientCenterX;
2343,7 → 2343,7
QLineF p4 = QLineF(cp.x(), cp.y(), cp.x() - gLen, cp.y() + gLen);
p4.setAngle(p4.angle() + gradientAngle);
ite->setDiamondGeometry(FPoint(p1.p2().x(), p1.p2().y()), FPoint(p2.p2().x(), p2.p2().y()), FPoint(p3.p2().x(), p3.p2().y()), FPoint(p4.p2().x(), p4.p2().y()), cp);
ite->GrType = 10;
ite->GrType = Gradient_Diamond;
}
else if (meStyle == GradientStyle_RECT)
{
2390,7 → 2390,7
QLineF p4 = QLineF(cp.x(), cp.y(), cp.x() - gLenW, cp.y() + gLenH);
p4.setAngle(p4.angle() + gradientAngle);
ite->setDiamondGeometry(FPoint(p1.p2().x(), p1.p2().y()), FPoint(p2.p2().x(), p2.p2().y()), FPoint(p3.p2().x(), p3.p2().y()), FPoint(p4.p2().x(), p4.p2().y()), cp);
ite->GrType = 10;
ite->GrType = Gradient_Diamond;
}
}
 
/trunk/Scribus/scribus/plugins/import/viva/importviva.cpp
1568,7 → 1568,7
patch.TR = tR;
item->meshGradientPatches.append(patch);
}
item->GrType = 12;
item->GrType = Gradient_PatchMesh;
}
else
{
/trunk/Scribus/scribus/plugins/import/wpg/importwpg.cpp
359,7 → 359,7
if (isGradient)
{
ite->fill_gradient = currentGradient;
ite->GrType = 6;
ite->GrType = Gradient_Linear;
QTransform m1;
m1.rotate(-gradientAngle);
ite->GrStartX = 0;
/trunk/Scribus/scribus/plugins/import/xar/importxar.cpp
1347,21 → 1347,21
{
item->setPattern(txDat.fillPattern);
item->setPatternTransform(txDat.patternScaleX, txDat.patternScaleY, txDat.patternOffsetX, txDat.patternOffsetY, txDat.patternRotation, txDat.patternSkewX, txDat.patternSkewY);
item->GrType = 8;
item->GrType = Gradient_Pattern;
}
if ((txDat.FillGradientType == 6) || (txDat.FillGradientType == 7))
if ((txDat.FillGradientType == Gradient_Linear) || (txDat.FillGradientType == Gradient_Radial))
{
item->GrType = txDat.FillGradientType;
item->fill_gradient = txDat.FillGradient;
item->setGradientVector(txDat.GradFillX1 - item->xPos(), txDat.GradFillY1 - item->yPos(), txDat.GradFillX2 - item->xPos(), txDat.GradFillY2 - item->yPos(), txDat.GradFillX1 - item->xPos(), txDat.GradFillY1 - item->yPos(), txDat.GrScale, txDat.GrSkew);
}
if (txDat.FillGradientType == 9)
if (txDat.FillGradientType == Gradient_4Colors)
{
item->GrType = txDat.FillGradientType;
item->set4ColorGeometry(FPoint(0, 0), FPoint(item->width(), 0), FPoint(item->width(), item->height()), FPoint(0, item->height()));
item->set4ColorColors(txDat.GrColorP1, txDat.GrColorP2, txDat.GrColorP3, txDat.GrColorP4);
}
if (txDat.FillGradientType == 10)
if (txDat.FillGradientType == Gradient_Diamond)
{
item->GrType = txDat.FillGradientType;
item->fill_gradient = txDat.FillGradient;
1454,21 → 1454,21
{
item->setPattern(txDat.fillPattern);
item->setPatternTransform(txDat.patternScaleX, txDat.patternScaleY, txDat.patternOffsetX, txDat.patternOffsetY, txDat.patternRotation, txDat.patternSkewX, txDat.patternSkewY);
item->GrType = 8;
item->GrType = Gradient_Pattern;
}
if ((txDat.FillGradientType == 6) || (txDat.FillGradientType == 7))
if ((txDat.FillGradientType == Gradient_Linear) || (txDat.FillGradientType == Gradient_Radial))
{
item->GrType = txDat.FillGradientType;
item->fill_gradient = txDat.FillGradient;
item->setGradientVector(txDat.GradFillX1 - item->xPos(), txDat.GradFillY1 - item->yPos(), txDat.GradFillX2 - item->xPos(), txDat.GradFillY2 - item->yPos(), txDat.GradFillX1 - item->xPos(), txDat.GradFillY1 - item->yPos(), txDat.GrScale, txDat.GrSkew);
}
if (txDat.FillGradientType == 9)
if (txDat.FillGradientType == Gradient_4Colors)
{
item->GrType = txDat.FillGradientType;
item->set4ColorGeometry(FPoint(0, 0), FPoint(item->width(), 0), FPoint(item->width(), item->height()), FPoint(0, item->height()));
item->set4ColorColors(txDat.GrColorP1, txDat.GrColorP2, txDat.GrColorP3, txDat.GrColorP4);
}
if (txDat.FillGradientType == 10)
if (txDat.FillGradientType == Gradient_Diamond)
{
item->GrType = txDat.FillGradientType;
item->fill_gradient = txDat.FillGradient;
3730,21 → 3730,21
{
item->setPattern(gc->fillPattern);
item->setPatternTransform(gc->patternScaleX, gc->patternScaleY, gc->patternOffsetX, gc->patternOffsetY, gc->patternRotation, gc->patternSkewX, gc->patternSkewY);
item->GrType = 8;
item->GrType = Gradient_Pattern;
}
if ((gc->FillGradientType == 6) || (gc->FillGradientType == 7))
if ((gc->FillGradientType == Gradient_Linear) || (gc->FillGradientType == Gradient_Radial))
{
item->GrType = gc->FillGradientType;
item->fill_gradient = gc->FillGradient;
item->setGradientVector(gc->GradFillX1 - item->xPos(), gc->GradFillY1 - item->yPos(), gc->GradFillX2 - item->xPos(), gc->GradFillY2 - item->yPos(), gc->GradFillX1 - item->xPos(), gc->GradFillY1 - item->yPos(), gc->GrScale, gc->GrSkew);
}
if (gc->FillGradientType == 9)
if (gc->FillGradientType == Gradient_4Colors)
{
item->GrType = gc->FillGradientType;
item->set4ColorGeometry(FPoint(0, 0), FPoint(item->width(), 0), FPoint(item->width(), item->height()), FPoint(0, item->height()));
item->set4ColorColors(gc->GrColorP1, gc->GrColorP2, gc->GrColorP3, gc->GrColorP4);
}
if (gc->FillGradientType == 10)
if (gc->FillGradientType == Gradient_Diamond)
{
item->GrType = gc->FillGradientType;
item->fill_gradient = gc->FillGradient;
/trunk/Scribus/scribus/plugins/import/xps/importxps.cpp
1762,7 → 1762,7
else if (!obState.patternName.isEmpty())
{
item->setPattern(obState.patternName);
item->GrType = 8;
item->GrType = Gradient_Pattern;
}
if (obState.maskTyp != 0)
{
1783,7 → 1783,7
}
if (!obState.patternStroke.isEmpty())
{
item->GrTypeStroke = 8;
item->GrTypeStroke = Gradient_Pattern;
item->setStrokePattern(obState.patternStroke);
}
if (!obState.DashPattern.isEmpty())
/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortiondialog.cpp
263,7 → 263,7
{
if (currItem->GrType != 0)
{
if (currItem->GrType != 8)
if (currItem->GrType != Gradient_Pattern)
{
QGradient pat;
double x1 = currItem->GrStartX;
300,7 → 300,7
}
pItem->setBrush(pat);
}
else if ((currItem->GrType == 8) && (!currItem->pattern().isEmpty()) && (doc->docPatterns.contains(currItem->pattern())))
else if ((currItem->GrType == Gradient_Pattern) && (!currItem->pattern().isEmpty()) && (doc->docPatterns.contains(currItem->pattern())))
{
double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
currItem->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
360,7 → 360,7
double y1 = currItem->GrStrokeStartY;
double x2 = currItem->GrStrokeEndX;
double y2 = currItem->GrStrokeEndY;
if (currItem->GrTypeStroke == 6)
if (currItem->GrTypeStroke == Gradient_Linear)
pat = QLinearGradient(x1, y1, x2, y2);
else
pat = QRadialGradient(x1, y1, sqrt(pow(x2 - x1, 2) + pow(y2 - y1,2)), x1, y1);
/trunk/Scribus/scribus/plugins/tools/lenseffects/lensdialog.cpp
316,7 → 316,7
{
if (currItem->GrType != 0)
{
if (currItem->GrType != 8)
if (currItem->GrType != Gradient_Pattern)
{
QGradient pat;
double x1 = currItem->GrStartX;
353,7 → 353,7
}
pItem->setBrush(pat);
}
else if ((currItem->GrType == 8) && (!currItem->pattern().isEmpty()) && (doc->docPatterns.contains(currItem->pattern())))
else if ((currItem->GrType == Gradient_Pattern) && (!currItem->pattern().isEmpty()) && (doc->docPatterns.contains(currItem->pattern())))
{
double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
currItem->patternTransform(patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY);
413,7 → 413,7
double y1 = currItem->GrStrokeStartY;
double x2 = currItem->GrStrokeEndX;
double y2 = currItem->GrStrokeEndY;
if (currItem->GrTypeStroke == 6)
if (currItem->GrTypeStroke == Gradient_Linear)
pat = QLinearGradient(x1, y1, x2, y2);
else
pat = QRadialGradient(x1, y1, sqrt(pow(x2 - x1, 2) + pow(y2 - y1,2)), x1, y1);
/trunk/Scribus/scribus/pslib.cpp
1844,7 → 1844,7
{
SetClipPath(item->PoLine);
PS_closepath();
if (item->GrType == 14)
if (item->GrType == Gradient_Hatch)
PS_HatchFill(item);
else if ((item->GrType != 0) && (!master))
HandleGradientFillStroke(item, false);
1961,7 → 1961,7
{
SetClipPath(item->PoLine);
PS_closepath();
if (item->GrType == 14)
if (item->GrType == Gradient_Hatch)
PS_HatchFill(item);
else if ((item->GrType != 0) && (!master))
HandleGradientFillStroke(item, false);
2109,7 → 2109,7
SetClipPath(item->PoLine);
PS_closepath();
fillRule = item->fillRule;
if (item->GrType == 14)
if (item->GrType == Gradient_Hatch)
PS_HatchFill(item);
else if (item->GrType != 0)
HandleGradientFillStroke(item, false);
2165,7 → 2165,7
SetClipPath(item->PoLine);
PS_closepath();
fillRule = item->fillRule;
if (item->GrType == 14)
if (item->GrType == Gradient_Hatch)
PS_HatchFill(item);
else if (item->GrType != 0)
HandleGradientFillStroke(item, false);
2892,7 → 2892,7
{
SetClipPath(ite->PoLine);
PS_closepath();
if (ite->GrType == 14)
if (ite->GrType == Gradient_Hatch)
PS_HatchFill(ite);
else if (ite->GrType != 0)
HandleGradientFillStroke(ite, false);
3873,7 → 3873,7
else
gradient = item->fill_gradient;
gradient.setRepeatMethod(item->getGradientExtend());
if (GType == 8)
if (GType == Gradient_Pattern)
{
QTransform patternMatrix;
double patternScaleX, patternScaleY, patternOffsetX, patternOffsetY, patternRotation, patternSkewX, patternSkewY;
3898,22 → 3898,22
PutStream("fill\n");
return;
}
if (GType == 9)
if (GType == Gradient_4Colors)
{
HandleTensorGradient(item);
return;
}
if (GType == 10)
if (GType == Gradient_Diamond)
{
HandleDiamondGradient(item);
return;
}
if ((GType == 11) || (GType == 13))
if ((GType == Gradient_Mesh) || (GType == Gradient_Conical))
{
HandleMeshGradient(item);
return;
}
if (GType == 12)
if (GType == Gradient_PatchMesh)
{
HandlePatchMeshGradient(item);
return;
3948,7 → 3948,7
colorShades.append(cstops.at(cst)->shade);
}
}
if (GType == 6)
if (GType == Gradient_Linear)
PutStream("/ShadingType 2\n");
else
PutStream("/ShadingType 3\n");
3991,7 → 3991,7
PutStream("/Extend [false false]\n");
else
PutStream("/Extend [true true]\n");
if (GType == 6)
if (GType == Gradient_Linear)
PutStream("/Coords [" + ToStr(StartX) + " " + ToStr(-StartY) + " " + ToStr(EndX) + " " + ToStr(-EndY) + "]\n");
else
PutStream("/Coords [" + ToStr(FocalX) + " " + ToStr(-FocalY) + " 0.0 " + ToStr(StartX) + " " + ToStr(-StartY) + " " + ToStr(sqrt(pow(EndX - StartX, 2) + pow(EndY - StartY,2))) + "]\n");
4115,7 → 4115,7
Gskew = 0;
else
Gskew = tan(M_PI / 180.0 * Gskew);
if (GType == 6)
if (GType == Gradient_Linear)
{
qmatrix.translate(StartX, -StartY);
qmatrix.shear(Gskew, 0);
/trunk/Scribus/scribus/scpageoutput.cpp
230,7 → 230,7
painter->setLineWidth(item->lineWidth());
if (item->isGroup())
return;
if (item->GrType == 8)
if (item->GrType == Gradient_Pattern)
{
QString pat = item->pattern();
ScPattern *pattern = m_doc->checkedPattern(pat);
256,7 → 256,7
painter->setFillMode(ScPainterExBase::Pattern);
}
}
else if (item->GrType == 9)
else if (item->GrType == Gradient_4Colors)
{
painter->setFillMode(ScPainterExBase::Gradient);
FPoint pG1 = FPoint(0, 0);
277,7 → 277,7
gradientVal = "";
if (!(gradientVal.isEmpty()) && (m_doc->docGradients.contains(gradientVal)))
painter->m_fillGradient = VGradientEx(m_doc->docGradients[gradientVal], *m_doc);
if ((painter->m_fillGradient.stops() < 2) && (item->GrType < 9)) // fall back to solid filling if there are not enough colorstops in the gradient.
if ((painter->m_fillGradient.stops() < 2) && (item->GrType < Gradient_4Colors)) // fall back to solid filling if there are not enough colorstops in the gradient.
{
if (item->fillColor() != CommonStrings::None)
{
463,7 → 463,7
FPoint fpFocal(item->GrStrokeFocalX, item->GrStrokeFocalY);
painter->setStrokeMode(ScPainterExBase::Gradient);
painter->m_strokeGradient = VGradientEx(item->stroke_gradient, *m_doc);
if (item->GrTypeStroke == 6)
if (item->GrTypeStroke == Gradient_Linear)
painter->setGradient(VGradientEx::linear, fpStart, fpEnd, fpStart, item->GrStrokeScale, item->GrStrokeSkew);
else
painter->setGradient(VGradientEx::radial, fpStart, fpEnd, fpFocal, item->GrStrokeScale, item->GrStrokeSkew);
871,7 → 871,7
FPoint fpFocal(item->GrStrokeFocalX, item->GrStrokeFocalY);
painter->setStrokeMode(ScPainterExBase::Gradient);
painter->m_strokeGradient = VGradientEx(item->stroke_gradient, *m_doc);
if (item->GrTypeStroke == 6)
if (item->GrTypeStroke == Gradient_Linear)
painter->setGradient(VGradientEx::linear, fpStart, fpEnd, fpStart, item->GrStrokeScale, item->GrStrokeSkew);
else
painter->setGradient(VGradientEx::radial, fpStart, fpEnd, fpFocal, item->GrStrokeScale, item->GrStrokeSkew);
1212,7 → 1212,7
FPoint fpFocal(item->GrStrokeFocalX, item->GrStrokeFocalY);
painter->setStrokeMode(ScPainterExBase::Gradient);
painter->m_strokeGradient = VGradientEx(item->stroke_gradient, *m_doc);
if (item->GrTypeStroke == 6)
if (item->GrTypeStroke == Gradient_Linear)
painter->setGradient(VGradientEx::linear, fpStart, fpEnd, fpStart, item->GrStrokeScale, item->GrStrokeSkew);
else
painter->setGradient(VGradientEx::radial, fpStart, fpEnd, fpFocal, item->GrStrokeScale, item->GrStrokeSkew);
1379,7 → 1379,7
FPoint fpFocal(item->GrStrokeFocalX, item->GrStrokeFocalY);
painter->setStrokeMode(ScPainterExBase::Gradient);
painter->m_strokeGradient = VGradientEx(item->stroke_gradient, *m_doc);
if (item->GrTypeStroke == 6)
if (item->GrTypeStroke == Gradient_Linear)
painter->setGradient(VGradientEx::linear, fpStart, fpEnd, fpStart, item->GrStrokeScale, item->GrStrokeSkew);
else
painter->setGradient(VGradientEx::radial, fpStart, fpEnd, fpFocal, item->GrStrokeScale, item->GrStrokeSkew);
/trunk/Scribus/scribus/scribus.cpp
9343,7 → 9343,7
for (int ii = 0; ii < allItems.count(); ii++)
{
PageItem *item = allItems.at(ii);
if ((!results.contains(item->pattern())) && ((item->GrType == 8) || (item->itemType() == PageItem::Symbol)))
if ((!results.contains(item->pattern())) && ((item->GrType == Gradient_Pattern) || (item->itemType() == PageItem::Symbol)))
results.append(item->pattern());
if (!item->strokePattern().isEmpty())
{
/trunk/Scribus/scribus/scribusdoc.cpp
3716,7 → 3716,7
for (PageItemIterator it(this, PageItemIterator::IterateInDocNoPatterns) ; *it; ++it)
{
PageItem* currItem = *it;
if ((!results.contains(currItem->pattern())) && ((currItem->GrType == 8) || (currItem->itemType() == PageItem::Symbol)))
if ((!results.contains(currItem->pattern())) && ((currItem->GrType == Gradient_Pattern) || (currItem->itemType() == PageItem::Symbol)))
results.append(currItem->pattern());
if (!currItem->strokePattern().isEmpty())
{
3743,7 → 3743,7
for (int j = 0; j < allItems.count(); j++)
{
currItem = allItems.at(j);
if ((currItem->GrType == 8) || (currItem->itemType() == PageItem::Symbol))
if ((currItem->GrType == Gradient_Pattern) || (currItem->itemType() == PageItem::Symbol))
{
const QString& patName = currItem->pattern();
if (!patName.isEmpty() && !results.contains(patName))
3781,7 → 3781,7
for (int j = 0; j < allItems.count(); j++)
{
currItem = allItems.at(j);
if ((currItem->GrType == 8) || (currItem->itemType() == PageItem::Symbol))
if ((currItem->GrType == Gradient_Pattern) || (currItem->itemType() == PageItem::Symbol))
{
const QString& pat = currItem->pattern();
if (!pat.isEmpty() && !results.contains(pat))
3829,7 → 3829,7
for (int j = 0; j < allItems.count(); j++)
{
PageItem *currItem = allItems.at(j);
if ((currItem->GrType == 8) || (currItem->itemType() == PageItem::Symbol))
if ((currItem->GrType == Gradient_Pattern) || (currItem->itemType() == PageItem::Symbol))
{
const QString& patName = currItem->pattern();
if (!patName.isEmpty() && !results.contains(patName))
4804,7 → 4804,7
cstops = ite->mask_gradient.colorStops();
for (int cst = 0; cst < ite->mask_gradient.stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
if (ite->GrType == 13)
if (ite->GrType == Gradient_Conical)
ite->createConicalMesh();
}
allItems.clear();
4849,7 → 4849,7
cstops = ite->mask_gradient.colorStops();
for (int cst = 0; cst < ite->mask_gradient.stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
if (ite->GrType == 13)
if (ite->GrType == Gradient_Conical)
ite->createConicalMesh();
}
allItems.clear();
4924,7 → 4924,7
cstops = ite->mask_gradient.colorStops();
for (int cst = 0; cst < ite->mask_gradient.stops(); ++cst)
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
if (ite->GrType == 13)
if (ite->GrType == Gradient_Conical)
ite->createConicalMesh();
}
allItems.clear();
4976,7 → 4976,7
ite->SetQColor(&cstops.at(cst)->color, cstops.at(cst)->name, cstops.at(cst)->shade);
if (ite->isImageFrame())
loadPict(ite->Pfile, ite, true, false);
if (ite->GrType == 13)
if (ite->GrType == Gradient_Conical)
ite->createConicalMesh();
}
allItems.clear();
15162,7 → 15162,7
item->setImageXScale(item->imageXScale() * grScXi);
item->setImageYScale(item->imageYScale() * grScYi);
}
if (item->GrType == 8)
if (item->GrType == Gradient_Pattern)
{
double psx, psy, pox, poy, prot, pskx, psky;
item->patternTransform(psx, psy, pox, poy, prot, pskx, psky);
15498,7 → 15498,7
for (int i = 0; i < allItems.count(); i++)
{
PageItem *item = allItems.at(i);
if ((!results.contains(item->pattern())) && ((item->GrType == 8) || (item->itemType() == PageItem::Symbol)))
if ((!results.contains(item->pattern())) && ((item->GrType == Gradient_Pattern) || (item->itemType() == PageItem::Symbol)))
results.append(item->pattern());
if (!item->strokePattern().isEmpty())
{
/trunk/Scribus/scribus/scribusstructs.h
99,8 → 99,27
bool SoftProofFullOn;
bool GamutCheck;
bool BlackPoint;
} ;
};
 
enum
{
Gradient_None = 0,
Gradient_LinearLegacy1 = 1,
Gradient_LinearLegacy2 = 2,
Gradient_LinearLegacy3 = 3,
Gradient_LinearLegacy4 = 4,
Gradient_RadialLegacy5 = 5,
Gradient_Linear = 6,
Gradient_Radial = 7,
Gradient_Pattern = 8,
Gradient_4Colors = 9,
Gradient_Diamond = 10,
Gradient_Mesh = 11,
Gradient_PatchMesh = 12,
Gradient_Conical = 13,
Gradient_Hatch = 14
};
 
struct SingleLine
{
double Width;
235,7 → 254,8
}
};
 
typedef enum {
enum PreflightError
{
MissingGlyph = 1,
TextOverflow = 2,
ObjectNotOnPage = 3,
257,7 → 277,7
MarksChanged = 19,
AppliedMasterDifferentSide = 20,
EmptyTextFrame = 21
} PreflightError;
};
 
typedef QMap<PreflightError, int> errorCodes;
 
/trunk/Scribus/scribus/ui/colorsandfills.cpp
944,7 → 944,7
pats.clear();
for (int c = 0; c < pat->items.count(); ++c)
{
if ((pat->items.at(c)->GrType == 8) || (pat->items.at(c)->itemType() == PageItem::Symbol))
if ((pat->items.at(c)->GrType == Gradient_Pattern) || (pat->items.at(c)->itemType() == PageItem::Symbol))
{
const QString& patName = pat->items.at(c)->pattern();
if (!patName.isEmpty() && !results.contains(patName))
969,7 → 969,7
pats.clear();
for (int c = 0; c < pat->items.count(); ++c)
{
if ((!results.contains(pat->items.at(c)->pattern())) && ((pat->items.at(c)->GrType == 8) || (pat->items.at(c)->itemType() == PageItem::Symbol)))
if ((!results.contains(pat->items.at(c)->pattern())) && ((pat->items.at(c)->GrType == Gradient_Pattern) || (pat->items.at(c)->itemType() == PageItem::Symbol)))
pats.append(pat->items.at(c)->pattern());
}
if (!pats.isEmpty())
/trunk/Scribus/scribus/ui/cpalette.cpp
287,7 → 287,7
}
if (currentItem->GrTypeStroke > 0)
{
if (currentItem->GrTypeStroke == 6)
if (currentItem->GrTypeStroke == Gradient_Linear)
gradientTypeStroke->setCurrentIndex(0);
else
gradientTypeStroke->setCurrentIndex(1);