Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 3291 → Rev 3292

/branches/Version13x/Scribus/scribus/fileloader.cpp
1900,12 → 1900,14
{
// OBSOLETE CR 2005-02-06
case PageItem::ItemType1:
z = view->PaintEllipse(x, y, w, h, pw, Pcolor, Pcolor2);
//z = view->PaintEllipse(x, y, w, h, pw, Pcolor, Pcolor2);
z = doc->itemAdd(PageItem::Polygon, PageItem::Ellipse, x, y, w, h, pw, Pcolor, Pcolor2, !view->Mpressed);
currItem = doc->Items.at(z);
break;
//
case PageItem::ImageFrame:
z = view->PaintPict(x, y, w, h);
//z = view->PaintPict(x, y, w, h);
z = doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, x, y, w, h, 1, doc->toolSettings.dBrushPict, "None", !view->Mpressed);
currItem = doc->Items.at(z);
currItem->LocalScX = scx;
currItem->LocalScY = scy;
1953,13 → 1955,15
break;
// OBSOLETE CR 2005-02-06
case PageItem::ItemType3:
z = view->PaintRect(x, y, w, h, pw, Pcolor, Pcolor2);
//z = view->PaintRect(x, y, w, h, pw, Pcolor, Pcolor2);
z = doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, x, y, w, h, pw, Pcolor, Pcolor2, !view->Mpressed);
currItem = doc->Items.at(z);
break;
//
case PageItem::PathText:
case PageItem::TextFrame:
z = view->PaintText(x, y, w, h, pw, Pcolor);
//z = view->PaintText(x, y, w, h, pw, Pcolor);
z = doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, w, h, pw, "None", Pcolor, !view->Mpressed);
currItem = doc->Items.at(z);
if ((QStoInt(obj->attribute("ANNOTATION","0"))) && (static_cast<bool>(QStoInt(obj->attribute("ANICON","0")))))
{
1988,15 → 1992,18
currItem->convertTo(pt);
break;
case PageItem::Line:
z = view->PaintLine(x, y, w, h, pw, Pcolor2);
//z = view->PaintLine(x, y, w, h, pw, Pcolor2);
z = doc->itemAdd(PageItem::Line, PageItem::Unspecified, x, y, w, h, pw, "None", Pcolor2, !ScApp->view->Mpressed);
currItem = doc->Items.at(z);
break;
case PageItem::Polygon:
z = view->PaintPoly(x, y, w, h, pw, Pcolor, Pcolor2);
//z = view->PaintPoly(x, y, w, h, pw, Pcolor, Pcolor2);
z = doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, x, y, w, h, pw, Pcolor, Pcolor2, !ScApp->view->Mpressed);
currItem = doc->Items.at(z);
break;
case PageItem::PolyLine:
z = view->PaintPolyLine(x, y, w, h, pw, Pcolor, Pcolor2);
//z = view->PaintPolyLine(x, y, w, h, pw, Pcolor, Pcolor2);
z = doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, w, h, pw, Pcolor, Pcolor2, !ScApp->view->Mpressed);
currItem = doc->Items.at(z);
break;
}
/branches/Version13x/Scribus/scribus/scribusdoc.cpp
2124,23 → 2124,30
PageItem* newItem=NULL;
switch( itemType )
{
//Q_ASSERTs here will warn on creation issues when a coder specifies the frameType incorrectly
//for items that do not have/need a frameType for creation.
case PageItem::ImageFrame:
newItem = new PageItem(this, PageItem::ImageFrame, x, y, b, h, 1, toolSettings.dBrushPict, "None");
Q_ASSERT(frameType==PageItem::Rectangle || frameType==PageItem::Unspecified);
break;
case PageItem::TextFrame:
newItem = new PageItem(this, PageItem::TextFrame, x, y, b, h, w, "None", outline);
Q_ASSERT(frameType==PageItem::Rectangle || frameType==PageItem::Unspecified);
break;
case PageItem::Line:
{
double lineWidth = w == 0.0 ? 1.0 : w;
newItem = new PageItem(this, PageItem::Line, x, y, b, h, lineWidth, "None", outline);
Q_ASSERT(frameType==PageItem::Unspecified);
}
break;
case PageItem::Polygon:
newItem = new PageItem(this, PageItem::Polygon, x, y, b, h, w, fill, outline);
Q_ASSERT(frameType==PageItem::Rectangle || frameType==PageItem::Ellipse || frameType==PageItem::Unspecified);
break;
case PageItem::PolyLine:
newItem = new PageItem(this, PageItem::PolyLine, x, y, b, h, w, fill, outline);
Q_ASSERT(frameType==PageItem::Unspecified);
break;
case PageItem::PathText:
//At this point, we cannot create a PathText item like this, only by conversion
/branches/Version13x/Scribus/scribus/scribusview.h
233,13 → 233,13
void SetFrameRect();
void SetFrameRounded();
void SetFrameOval();
int PaintEllipse(double x, double y, double b, double h, double w, QString fill, QString outline);
int PaintPict(double x, double y, double b, double h);
int PaintRect(double x, double y, double b, double h, double w, QString fill, QString outline);
int PaintLine(double x, double y, double b, double h, double w, QString outline);
int PaintText(double x, double y, double b, double h, double w, QString outline);
int PaintPoly(double x, double y, double b, double h, double w, QString fill, QString outline);
int PaintPolyLine(double x, double y, double b, double h, double w, QString fill, QString outline);
//int PaintEllipse(double x, double y, double b, double h, double w, QString fill, QString outline);
//int PaintPict(double x, double y, double b, double h);
//int PaintRect(double x, double y, double b, double h, double w, QString fill, QString outline);
//int PaintLine(double x, double y, double b, double h, double w, QString outline);
//int PaintText(double x, double y, double b, double h, double w, QString outline);
//int PaintPoly(double x, double y, double b, double h, double w, QString fill, QString outline);
//int PaintPolyLine(double x, double y, double b, double h, double w, QString fill, QString outline);
void insertColor(QString nam, double c, double m, double y, double k);
void ChLineWidth(double w);
void ChLineArt(PenStyle w);
/branches/Version13x/Scribus/scribus/scribusview.cpp
1398,7 → 1398,8
{
for (int cc = 0; cc < Cols; ++cc)
{
z = PaintText(Tx + offX, Ty + offY, deltaX, deltaY, Doc->toolSettings.dWidth, Doc->toolSettings.dPenText);
//z = PaintText(Tx + offX, Ty + offY, deltaX, deltaY, Doc->toolSettings.dWidth, Doc->toolSettings.dPenText);
z = Doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, Tx + offX, Ty + offY, deltaX, deltaY, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenText, !Mpressed);
currItem = Doc->Items.at(z);
currItem->isTableItem = true;
currItem->setTextFlowsAroundFrame(true);
1447,7 → 1448,8
Doc->appMode = modeNormal;
if (RecordP.size() > 1)
{
uint z = PaintPolyLine(0, 0, 1, 1, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenLine);
//uint z = PaintPolyLine(0, 0, 1, 1, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenLine);
uint z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, 0, 0, 1, 1, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenLine, !Mpressed);
currItem = Doc->Items.at(z);
currItem->PoLine.resize(0);
currItem->PoLine.addPoint(RecordP.point(0));
3955,7 → 3957,8
else
{
cli.putPoints(0, EndInd-StartInd, Clip, StartInd);
z = PaintPoly(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor());
//z = PaintPoly(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor());
z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor(), !Mpressed);
bb = Doc->Items.at(z);
if (EditContour)
bb->ContourLine.resize(0);
4009,7 → 4012,8
{
if ((ClRe > 1) && (ClRe < static_cast<int>(Clip.size()-2)))
{
z = PaintPolyLine(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor());
//z = PaintPolyLine(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor());
z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor(), !Mpressed);
bb = Doc->Items.at(z);
if (EditContour)
bb->ContourLine.putPoints(0, Clip.size()-(ClRe+2), Clip, ClRe+2);
4262,15 → 4266,18
switch (Doc->SubMode)
{
case 0:
z = PaintRect(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen);
//z = PaintRect(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen);
z = Doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen, !Mpressed);
SetupDraw(z);
break;
case 1:
z = PaintEllipse(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen);
//z = PaintEllipse(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen);
z = Doc->itemAdd(PageItem::Polygon, PageItem::Ellipse, Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen, !Mpressed);
SetupDraw(z);
break;
default:
z = PaintPoly(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen);
//z = PaintPoly(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen);
z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen, !Mpressed);
Doc->Items.at(z)->SetFrameShape(Doc->ValCount, Doc->ShapeValues);
setRedrawBounding(Doc->Items.at(z));
Doc->Items.at(z)->FrameType = Doc->SubMode+2;
4281,13 → 4288,15
break;
case modeDrawPicture:
selectPage(m);
z = PaintPict(Rxp, Ryp, 1+Rxpd, 1+Rypd);
//z = PaintPict(Rxp, Ryp, 1+Rxpd, 1+Rypd);
z = Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, Rxp, Ryp, 1+Rxpd, 1+Rypd, 1, Doc->toolSettings.dBrushPict, "None", !Mpressed);
SetupDraw(z);
emit HaveSel(PageItem::ImageFrame);
break;
case modeDrawText:
selectPage(m);
z = PaintText(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dPenText);
//z = PaintText(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dPenText);
z = Doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenText, Mpressed);
SetupDraw(z);
emit HaveSel(PageItem::TextFrame);
break;
4395,7 → 4404,8
break;
case modeDrawLine:
selectPage(m);
z = PaintLine(Rxp, Ryp, 1+Rxpd, Rypd, Doc->toolSettings.dWidthLine, Doc->toolSettings.dPenLine);
//z = PaintLine(Rxp, Ryp, 1+Rxpd, Rypd, Doc->toolSettings.dWidthLine, Doc->toolSettings.dPenLine);
z = Doc->itemAdd(PageItem::Line, PageItem::Unspecified, Rxp, Ryp, 1+Rxpd, Rypd, Doc->toolSettings.dWidthLine, "None", Doc->toolSettings.dPenLine, !Mpressed);
currItem = Doc->Items.at(z);
currItem->Select = true;
qApp->setOverrideCursor(QCursor(SizeFDiagCursor), true);
4538,7 → 4548,8
case modeDrawRegularPolygon:
{
selectPage(m);
z = PaintPoly(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen);
//z = PaintPoly(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen);
z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dBrush, Doc->toolSettings.dPen, !Mpressed);
currItem = Doc->Items.at(z);
FPointArray cli = RegularPolygonF(currItem->Width, currItem->Height, Doc->toolSettings.polyC, Doc->toolSettings.polyS, Doc->toolSettings.polyF, Doc->toolSettings.polyR);
FPoint np = FPoint(cli.point(0));
4574,7 → 4585,8
if (FirstPoly)
{
selectPage(m);
z = PaintPolyLine(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenLine);
//z = PaintPolyLine(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenLine);
z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenLine, !Mpressed);
currItem = Doc->Items.at(z);
SelItem.clear();
SelItem.append(currItem);
4619,7 → 4631,8
case modeInsertPDFTextAnnotation:
case modeInsertPDFLinkAnnotation:
selectPage(m);
z = PaintText(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dPenText);
//z = PaintText(Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, Doc->toolSettings.dPenText);
z = Doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, Rxp, Ryp, 1+Rxpd, 1+Rypd, Doc->toolSettings.dWidth, "None", Doc->toolSettings.dPenText, !Mpressed);
currItem = Doc->Items.at(z);
currItem->isAnnotation = true;
switch (Doc->appMode)
8620,11 → 8633,16
reformPages(mov);
if ((Doc->PageAT) && (!Doc->isLoading()))
{
int z = PaintText(fe->Margins.Left+fe->xOffset(),
fe->Margins.Top+fe->yOffset(),
Doc->pageWidth-fe->Margins.Right-fe->Margins.Left,
Doc->pageHeight-fe->Margins.Bottom-fe->Margins.Top,
1, Doc->toolSettings.dPen);
//int z = PaintText(fe->Margins.Left+fe->xOffset(),
// fe->Margins.Top+fe->yOffset(),
// Doc->pageWidth-fe->Margins.Right-fe->Margins.Left,
// Doc->pageHeight-fe->Margins.Bottom-fe->Margins.Top,
// 1, Doc->toolSettings.dPen);
int z = Doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified,
fe->Margins.Left+fe->xOffset(),
fe->Margins.Top+fe->yOffset(), Doc->pageWidth-fe->Margins.Right-fe->Margins.Left,
Doc->pageHeight-fe->Margins.Bottom-fe->Margins.Top,
1, "None", Doc->toolSettings.dPen, !Mpressed);
Doc->Items.at(z)->isAutoText = true;
Doc->Items.at(z)->BackBox = Doc->LastAuto;
Doc->Items.at(z)->Cols = qRound(Doc->PageSp);
9493,10 → 9511,11
}
 
/** Zeichnet eine Ellipse */
/* CB: Moved to ScribusDoc, left in commented out for now
int ScribusView::PaintEllipse(double x, double y, double b, double h, double w, QString fill, QString outline)
{
return Doc->itemAdd(PageItem::Polygon, PageItem::Ellipse, x, y, b, h, w, fill, outline, !Mpressed);
/* CB: Moved to ScribusDoc, left in commented out for now
if (UndoManager::undoEnabled() && !_itemCreationTransactionStarted)
{
_itemCreationTransactionStarted = true;
9542,14 → 9561,13
}
}
return ite->ItemNr;
*/
}
}*/
 
/** Zeichnet einen Bildrahmen */
/* CB: Moved to ScribusDoc, left in commented out for now
int ScribusView::PaintPict(double x, double y, double b, double h)
{
return Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, x, y, b, h, 1, Doc->toolSettings.dBrushPict, "None", !Mpressed);
/* CB: Moved to ScribusDoc, left in commented out for now
if (UndoManager::undoEnabled() && !_itemCreationTransactionStarted)
{
_itemCreationTransactionStarted = true;
9599,14 → 9617,13
}
}
return ite->ItemNr;
*/
}
}*/
 
/** Zeichnet ein Rechteck */
/* CB: Moved to ScribusDoc, left in commented out for now
int ScribusView::PaintRect(double x, double y, double b, double h, double w, QString fill, QString outline)
{
return Doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, x, y, b, h, w, fill, outline, !Mpressed);
/* CB: Moved to ScribusDoc, left in commented out for now
if (UndoManager::undoEnabled() && !_itemCreationTransactionStarted)
{
_itemCreationTransactionStarted = true;
9652,14 → 9669,14
}
}
return ite->ItemNr;
*/
}
 
*/
/** Zeichnet ein Polygon */
/* CB: Moved to ScribusDoc, left in commented out for now
int ScribusView::PaintPoly(double x, double y, double b, double h, double w, QString fill, QString outline)
{
return Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, x, y, b, h, w, fill, outline, !Mpressed);
/* CB: Moved to ScribusDoc, left in commented out for now
if (UndoManager::undoEnabled() && !_itemCreationTransactionStarted)
{
_itemCreationTransactionStarted = true;
9704,14 → 9721,14
}
}
return ite->ItemNr;
*/
}
*/
 
/** Zeichnet eine Polyline */
/* CB: Moved to ScribusDoc, left in commented out for now
int ScribusView::PaintPolyLine(double x, double y, double b, double h, double w, QString fill, QString outline)
{
return Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, b, h, w, fill, outline, !Mpressed);
/* CB: Moved to ScribusDoc, left in commented out for now
if (UndoManager::undoEnabled() && !_itemCreationTransactionStarted)
{
_itemCreationTransactionStarted = true;
9755,14 → 9772,14
}
}
return ite->ItemNr;
*/
}
*/
 
/** Zeichnet einen Textrahmen */
/* CB: Moved to ScribusDoc, left in commented out for now
int ScribusView::PaintText(double x, double y, double b, double h, double w, QString outline)
{
return Doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, b, h, w, "None", outline, !Mpressed);
/* CB: Moved to ScribusDoc, left in commented out for now
if (UndoManager::undoEnabled() && !_itemCreationTransactionStarted)
{
_itemCreationTransactionStarted = true;
9811,14 → 9828,14
}
}
return ite->ItemNr;
*/
}
*/
 
/** Zeichnet eine Linie */
/* CB: Moved to ScribusDoc, left in commented out for now
int ScribusView::PaintLine(double x, double y, double b, double h, double w, QString outline)
{
return Doc->itemAdd(PageItem::Line, PageItem::Unspecified, x, y, b, h, w, "None", outline, !Mpressed);
/* CB: Moved to ScribusDoc, left in commented out for now
if (w == 0)
w = 1;
if (UndoManager::undoEnabled() && !_itemCreationTransactionStarted)
9858,8 → 9875,8
}
}
return ite->ItemNr;
*/
}
*/
 
void ScribusView::insertColor(QString nam, double c, double m, double y, double k)
{
11419,11 → 11436,13
{
// OBSOLETE CR 2005-02-06
case PageItem::ItemType1:
z = PaintEllipse(x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2);
//z = PaintEllipse(x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2);
z = Doc->itemAdd(PageItem::Polygon, PageItem::Ellipse, x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2, !Mpressed);
break;
//
case PageItem::ImageFrame:
z = PaintPict(x, y, w, h);
//z = PaintPict(x, y, w, h);
z = Doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, x, y, w, h, 1, Doc->toolSettings.dBrushPict, "None", !Mpressed);
Doc->Items.at(z)->LocalScX = Buffer->LocalScX;
Doc->Items.at(z)->LocalScY = Buffer->LocalScY;
Doc->Items.at(z)->LocalX = Buffer->LocalX;
11446,12 → 11465,14
break;
// OBSOLETE CR 2005-02-06
case PageItem::ItemType3:
z = PaintRect(x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2);
//z = PaintRect(x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2);
z = Doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2, !Mpressed);
break;
//
case PageItem::PathText:
case PageItem::TextFrame:
z = PaintText(x, y, w, h, pw, Buffer->Pcolor);
//z = PaintText(x, y, w, h, pw, Buffer->Pcolor);
z = Doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, w, h, pw, "None", Buffer->Pcolor, !Mpressed);
if ((Buffer->isAnnotation) && (Buffer->AnUseIcons))
{
Doc->Items.at(z)->LocalScX = Buffer->LocalScX;
11548,13 → 11569,16
Doc->Items.at(z)->convertTo(Buffer->PType);
break;
case PageItem::Line:
z = PaintLine(x, y, w, 0, pw, Buffer->Pcolor2);
//z = PaintLine(x, y, w, 0, pw, Buffer->Pcolor2);
z = Doc->itemAdd(PageItem::Line, PageItem::Unspecified, x, y, w ,0, pw, "None", Buffer->Pcolor2, !Mpressed);
break;
case PageItem::Polygon:
z = PaintPoly(x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2);
//z = PaintPoly(x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2);
z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2, !Mpressed);
break;
case PageItem::PolyLine:
z = PaintPolyLine(x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2);
//z = PaintPolyLine(x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2);
z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, w, h, pw, Buffer->Pcolor, Buffer->Pcolor2, !Mpressed);
break;
}
PageItem *currItem = Doc->Items.at(z);
11897,7 → 11921,8
PageItem *currItem;
if (GetItem(&currItem))
{
uint z = PaintPolyLine(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, "None", currItem->lineColor());
//uint z = PaintPolyLine(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, "None", currItem->lineColor());
uint z = Doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, "None", currItem->lineColor(), !Mpressed);
PageItem *bb = Doc->Items.at(z);
bb->PoLine = currItem->PoLine.copy();
bb->ClipEdited = true;
11989,7 → 12014,8
if (currItem->imageFlippedV())
chma.scale(1, -1);
pts.map(chma);
uint z = PaintPoly(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->lineColor(), currItem->fillColor());
//uint z = PaintPoly(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->lineColor(), currItem->fillColor());
uint z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->lineColor(), currItem->fillColor(), !Mpressed);
bb = Doc->Items.at(z);
bb->setTextFlowsAroundFrame(currItem->textFlowsAroundFrame());
bb->setTextFlowUsesBoundingBox(currItem->textFlowUsesBoundingBox());
12112,12 → 12138,13
uint z;
PageItem *currItem = SelItem.at(0);
uint EndInd = currItem->PoLine.size();
for (uint a = currItem->PoLine.size()-1; a > 0; a--)
for (uint a = EndInd-1; a > 0; --a)
{
if (currItem->PoLine.point(a).x() > 900000)
{
StartInd = a + 1;
z = PaintPoly(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor());
//z = PaintPoly(currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor());
z = Doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, currItem->Xpos, currItem->Ypos, currItem->Width, currItem->Height, currItem->Pwidth, currItem->fillColor(), currItem->lineColor(), !Mpressed);
bb = Doc->Items.at(z);
bb->PoLine.resize(0);
bb->PoLine.putPoints(0, EndInd - StartInd, currItem->PoLine, StartInd);
/branches/Version13x/Scribus/scribus/plugins/scriptplugin/cmdobj.cpp
16,11 → 16,14
PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
return NULL;
}
int i = ScApp->view->PaintRect(pageUnitXToDocX(x), pageUnitYToDocY(y),
ValueToPoint(b), ValueToPoint(h),
ScApp->doc->toolSettings.dWidth,
ScApp->doc->toolSettings.dBrush,
ScApp->doc->toolSettings.dPen);
//int i = ScApp->view->PaintRect(pageUnitXToDocX(x), pageUnitYToDocY(y),
// ValueToPoint(b), ValueToPoint(h),
// ScApp->doc->toolSettings.dWidth,
// ScApp->doc->toolSettings.dBrush,
// ScApp->doc->toolSettings.dPen);
int i = ScApp->doc->itemAdd(PageItem::Polygon, PageItem::Rectangle, pageUnitXToDocX(x), pageUnitYToDocY(y),
ValueToPoint(b), ValueToPoint(h), ScApp->doc->toolSettings.dWidth,
ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen, !ScApp->view->Mpressed);
ScApp->doc->Items.at(i)->SetRectFrame();
ScApp->view->setRedrawBounding(ScApp->doc->Items.at(i));
if (Name != "")
37,10 → 40,16
return NULL;
if(!checkHaveDocument())
return NULL;
int i = ScApp->view->PaintEllipse(pageUnitXToDocX(x), pageUnitYToDocY(y), b, h,
//int i = ScApp->view->PaintEllipse(pageUnitXToDocX(x), pageUnitYToDocY(y), b, h,
// ScApp->doc->toolSettings.dWidth,
// ScApp->doc->toolSettings.dBrush,
// ScApp->doc->toolSettings.dPen);
int i = ScApp->doc->itemAdd(PageItem::Polygon, PageItem::Ellipse, pageUnitXToDocX(x),
pageUnitYToDocY(y), b, h,
ScApp->doc->toolSettings.dWidth,
ScApp->doc->toolSettings.dBrush,
ScApp->doc->toolSettings.dPen);
ScApp->doc->toolSettings.dPen,
!ScApp->view->Mpressed);
if (ItemExists(QString::fromUtf8(Name)))
{
PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
56,13 → 65,14
 
PyObject *scribus_newimage(PyObject* /* self */, PyObject* args)
{
double x, y, b, h;
double x, y, w, h;
char *Name = const_cast<char*>("");
if (!PyArg_ParseTuple(args, "dddd|es", &x, &y, &b, &h, "utf-8", &Name))
if (!PyArg_ParseTuple(args, "dddd|es", &x, &y, &w, &h, "utf-8", &Name))
return NULL;
if(!checkHaveDocument())
return NULL;
int i = ScApp->view->PaintPict(pageUnitXToDocX(x), pageUnitYToDocY(y), b, h);
//int i = ScApp->view->PaintPict(pageUnitXToDocX(x), pageUnitYToDocY(y), w, h);
int i = ScApp->doc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, pageUnitXToDocX(x), pageUnitYToDocY(y), w, h, 1, ScApp->doc->toolSettings.dBrushPict, "None", !ScApp->view->Mpressed);
if (ItemExists(QString::fromUtf8(Name)))
{
PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
84,9 → 94,10
return NULL;
if(!checkHaveDocument())
return NULL;
int i = ScApp->view->PaintText(pageUnitXToDocX(x), pageUnitYToDocY(y), b, h,
ScApp->doc->toolSettings.dWidth,
ScApp->doc->toolSettings.dPenText);
//int i = ScApp->view->PaintText(pageUnitXToDocX(x), pageUnitYToDocY(y), b, h,
// ScApp->doc->toolSettings.dWidth,
// ScApp->doc->toolSettings.dPenText);
int i = ScApp->doc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, pageUnitXToDocX(x), pageUnitYToDocY(y), b, h, ScApp->doc->toolSettings.dWidth, "None", ScApp->doc->toolSettings.dPenText, !ScApp->view->Mpressed);
if (ItemExists(QString::fromUtf8(Name)))
{
PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
117,7 → 128,8
PyErr_SetString(NameExistsError, QObject::tr("An object with the requested name already exists.","python error"));
return NULL;
}
int i = ScApp->view->PaintPolyLine(x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen);
//int i = ScApp->view->PaintPolyLine(x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen);
int i = ScApp->doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen, !ScApp->view->Mpressed);
PageItem *it = ScApp->doc->Items.at(i);
it->PoLine.resize(4);
it->PoLine.setPoint(0, 0, 0);
174,7 → 186,8
i++;
y = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
i++;
int ic = ScApp->view->PaintPolyLine(x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen);
//int ic = ScApp->view->PaintPolyLine(x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen);
int ic = ScApp->doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen, !ScApp->view->Mpressed);
PageItem *it = ScApp->doc->Items.at(ic);
it->PoLine.resize(2);
it->PoLine.setPoint(0, 0, 0);
249,7 → 262,8
i++;
y = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
i++;
int ic = ScApp->view->PaintPoly(x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen);
//int ic = ScApp->view->PaintPoly(x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen);
int ic = ScApp->doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen, !ScApp->view->Mpressed);
PageItem *it = ScApp->doc->Items.at(ic);
it->PoLine.resize(2);
it->PoLine.setPoint(0, 0, 0);
334,7 → 348,8
i++;
ky2 = pageUnitYToDocY(static_cast<double>(PyFloat_AsDouble(PyList_GetItem(il, i))));
i++;
int ic = ScApp->view->PaintPolyLine(x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen);
//int ic = ScApp->view->PaintPolyLine(x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen);
int ic = ScApp->doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, x, y, 1, 1, ScApp->doc->toolSettings.dWidth, ScApp->doc->toolSettings.dBrush, ScApp->doc->toolSettings.dPen, !ScApp->view->Mpressed);
PageItem *it = ScApp->doc->Items.at(ic);
it->PoLine.resize(2);
it->PoLine.setPoint(0, 0, 0);
/branches/Version13x/Scribus/scribus/plugins/svgimplugin/svgplugin.cpp
214,19 → 214,19
ScApp->doc->PageOri = 0;
ScApp->doc->PageSize = "Custom";
}
Doku = ScApp->doc;
FPoint minSize = Doku->minCanvasCoordinate;
FPoint maxSize = Doku->maxCanvasCoordinate;
currDoc = ScApp->doc;
FPoint minSize = currDoc->minCanvasCoordinate;
FPoint maxSize = currDoc->maxCanvasCoordinate;
ScApp->view->Deselect();
Elements.clear();
Doku->setLoading(true);
Doku->DoDrawing = false;
currDoc->setLoading(true);
currDoc->DoDrawing = false;
ScApp->view->setUpdatesEnabled(false);
ScApp->ScriptRunning = true;
qApp->setOverrideCursor(QCursor(waitCursor), true);
gc->Family = Doku->toolSettings.defFont;
if (!Doku->PageColors.contains("Black"))
Doku->PageColors.insert("Black", ScColor(0, 0, 0, 255));
gc->Family = currDoc->toolSettings.defFont;
if (!currDoc->PageColors.contains("Black"))
currDoc->PageColors.insert("Black", ScColor(0, 0, 0, 255));
m_gc.push( gc );
viewTransformX = 0;
viewTransformY = 0;
253,44 → 253,44
{
for (uint a = 0; a < Elements.count(); ++a)
{
Elements.at(a)->Groups.push(Doku->GroupCounter);
Elements.at(a)->Groups.push(currDoc->GroupCounter);
}
Doku->GroupCounter++;
currDoc->GroupCounter++;
}
Doku->DoDrawing = true;
currDoc->DoDrawing = true;
ScApp->view->setUpdatesEnabled(true);
ScApp->ScriptRunning = false;
if (interactive)
Doku->setLoading(false);
currDoc->setLoading(false);
qApp->setOverrideCursor(QCursor(arrowCursor), true);
if ((Elements.count() > 0) && (!ret) && (interactive))
{
Doku->DragP = true;
Doku->DraggedElem = 0;
Doku->DragElements.clear();
currDoc->DragP = true;
currDoc->DraggedElem = 0;
currDoc->DragElements.clear();
for (uint dre=0; dre<Elements.count(); ++dre)
{
Doku->DragElements.append(Elements.at(dre)->ItemNr);
currDoc->DragElements.append(Elements.at(dre)->ItemNr);
ScApp->view->SelItem.append(Elements.at(dre));
}
ScriXmlDoc *ss = new ScriXmlDoc();
ScApp->view->setGroupRect();
QDragObject *dr = new QTextDrag(ss->WriteElem(&ScApp->view->SelItem, Doku, ScApp->view), ScApp->view->viewport());
QDragObject *dr = new QTextDrag(ss->WriteElem(&ScApp->view->SelItem, currDoc, ScApp->view), ScApp->view->viewport());
ScApp->view->DeleteItem();
ScApp->view->resizeContents(qRound((maxSize.x() - minSize.x()) * ScApp->view->getScale()), qRound((maxSize.y() - minSize.y()) * ScApp->view->getScale()));
ScApp->view->scrollBy(qRound((Doku->minCanvasCoordinate.x() - minSize.x()) * ScApp->view->getScale()), qRound((Doku->minCanvasCoordinate.y() - minSize.y()) * ScApp->view->getScale()));
Doku->minCanvasCoordinate = minSize;
Doku->maxCanvasCoordinate = maxSize;
ScApp->view->scrollBy(qRound((currDoc->minCanvasCoordinate.x() - minSize.x()) * ScApp->view->getScale()), qRound((currDoc->minCanvasCoordinate.y() - minSize.y()) * ScApp->view->getScale()));
currDoc->minCanvasCoordinate = minSize;
currDoc->maxCanvasCoordinate = maxSize;
dr->setPixmap(loadIcon("DragPix.xpm"));
dr->drag();
delete ss;
Doku->DragP = false;
Doku->DraggedElem = 0;
Doku->DragElements.clear();
currDoc->DragP = false;
currDoc->DraggedElem = 0;
currDoc->DragElements.clear();
}
else
{
Doku->setModified(false);
currDoc->setModified(false);
ScApp->slotDocCh();
}
}
340,8 → 340,8
QPtrList<PageItem> GElements;
FPointArray ImgClip;
ImgClip.resize(0);
double BaseX = Doku->currentPage->xOffset();
double BaseY = Doku->currentPage->yOffset();
double BaseX = currDoc->currentPage->xOffset();
double BaseY = currDoc->currentPage->yOffset();
for( QDomNode n = e.firstChild(); !n.isNull(); n = n.nextSibling() )
{
int z = -1;
358,11 → 358,11
QPtrList<PageItem> gElements = parseGroup( b );
for (uint gr = 0; gr < gElements.count(); ++gr)
{
gElements.at(gr)->Groups.push(Doku->GroupCounter);
gElements.at(gr)->Groups.push(currDoc->GroupCounter);
GElements.append(gElements.at(gr));
}
delete( m_gc.pop() );
Doku->GroupCounter++;
currDoc->GroupCounter++;
continue;
}
if( b.tagName() == "defs" )
378,8 → 378,8
else if( STag == "rect" )
{
addGraphicContext();
double x = parseUnit( b.attribute( "x" ) );
double y = parseUnit( b.attribute( "y" ) );
double x = parseUnit( b.attribute( "x" ) );
double y = parseUnit( b.attribute( "y" ) );
double width = parseUnit( b.attribute( "width" ));
double height = parseUnit( b.attribute( "height" ) );
double rx = b.attribute( "rx" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "rx" ) );
386,8 → 386,9
double ry = b.attribute( "ry" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "ry" ) );
SvgStyle *gc = m_gc.current();
parseStyle( gc, b );
z = ScApp->view->PaintRect(BaseX, BaseY, width, height, gc->LWidth, gc->FillCol, gc->StrokeCol);
PageItem* ite = Doku->Items.at(z);
//z = ScApp->view->PaintRect(BaseX, BaseY, width, height, gc->LWidth, gc->FillCol, gc->StrokeCol);
z = currDoc->itemAdd(PageItem::Polygon, PageItem::Rectangle, BaseX, BaseY, width, height, gc->LWidth, gc->FillCol, gc->StrokeCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
if ((rx != 0) || (ry != 0))
{
ite->RadRect = QMAX(rx, ry);
410,8 → 411,9
double y = parseUnit( b.attribute( "cy" ) ) - ry;
SvgStyle *gc = m_gc.current();
parseStyle( gc, b );
z = ScApp->view->PaintEllipse(BaseX, BaseY, rx * 2.0, ry * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol);
PageItem* ite = Doku->Items.at(z);
//z = ScApp->view->PaintEllipse(BaseX, BaseY, rx * 2.0, ry * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol);
z = currDoc->itemAdd(PageItem::Polygon, PageItem::Ellipse, BaseX, BaseY, rx * 2.0, ry * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
QWMatrix mm = QWMatrix();
mm.translate(x, y);
ite->PoLine.map(mm);
422,13 → 424,14
else if( STag == "circle" )
{
addGraphicContext();
double r = parseUnit( b.attribute( "r" ) );
double x = parseUnit( b.attribute( "cx" ) ) - r;
double y = parseUnit( b.attribute( "cy" ) ) - r;
double r = parseUnit( b.attribute( "r" ) );
double x = parseUnit( b.attribute( "cx" ) ) - r;
double y = parseUnit( b.attribute( "cy" ) ) - r;
SvgStyle *gc = m_gc.current();
parseStyle( gc, b );
z = ScApp->view->PaintEllipse(BaseX, BaseY, r * 2.0, r * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol);
PageItem* ite = Doku->Items.at(z);
//z = ScApp->view->PaintEllipse(BaseX, BaseY, r * 2.0, r * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol);
z = currDoc->itemAdd(PageItem::Polygon, PageItem::Ellipse, BaseX, BaseY, r * 2.0, r * 2.0, gc->LWidth, gc->FillCol, gc->StrokeCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
QWMatrix mm = QWMatrix();
mm.translate(x, y);
ite->PoLine.map(mm);
445,8 → 448,9
double y2 = b.attribute( "y2" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "y2" ) );
SvgStyle *gc = m_gc.current();
parseStyle( gc, b );
z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
PageItem* ite = Doku->Items.at(z);
//z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
z = currDoc->itemAdd(PageItem::Polygon, PageItem::Unspecified, BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
ite->PoLine.resize(4);
ite->PoLine.setPoint(0, FPoint(x1, y1));
ite->PoLine.setPoint(1, FPoint(x1, y1));
465,8 → 469,9
addGraphicContext();
SvgStyle *gc = m_gc.current();
parseStyle( gc, b );
z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
PageItem* ite = Doku->Items.at(z);
//z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
z = currDoc->itemAdd(PageItem::Polygon, PageItem::Unspecified, BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
ite->PoLine.resize(0);
if (parseSVG( b.attribute( "d" ), &ite->PoLine ))
ite->convertTo(PageItem::PolyLine);
483,10 → 488,12
SvgStyle *gc = m_gc.current();
parseStyle( gc, b );
if( b.tagName() == "polygon" )
z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
//z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
z = currDoc->itemAdd(PageItem::Polygon, PageItem::Unspecified, BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol, !ScApp->view->Mpressed);
else
z = ScApp->view->PaintPolyLine(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
PageItem* ite = Doku->Items.at(z);
//z = ScApp->view->PaintPolyLine(BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol);
z = currDoc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, BaseX, BaseY, 10, 10, gc->LWidth, gc->FillCol, gc->StrokeCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
ite->PoLine.resize(0);
bool bFirst = true;
double x = 0.0;
541,10 → 548,11
double y = b.attribute( "y" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "y" ) );
double w = b.attribute( "width" ).isEmpty() ? 1.0 : parseUnit( b.attribute( "width" ) );
double h = b.attribute( "height" ).isEmpty() ? 1.0 : parseUnit( b.attribute( "height" ) );
z = ScApp->view->PaintPict(x+BaseX, y+BaseY, w, h);
//z = ScApp->view->PaintPict(x+BaseX, y+BaseY, w, h);
z = currDoc->itemAdd(PageItem::ImageFrame, PageItem::Unspecified, x+BaseX, y+BaseY, w, h, 1, currDoc->toolSettings.dBrushPict, "None", !ScApp->view->Mpressed);
if (!fname.isEmpty())
ScApp->view->LoadPict(fname, z);
PageItem* ite = Doku->Items.at(z);
PageItem* ite = currDoc->Items.at(z);
if (ImgClip.size() != 0)
ite->PoLine = ImgClip.copy();
ImgClip.resize(0);
556,7 → 564,7
{
setupTransform( b );
SvgStyle *gc = m_gc.current();
PageItem* ite = Doku->Items.at(z);
PageItem* ite = currDoc->Items.at(z);
switch (ite->itemType())
{
case PageItem::ImageFrame:
1432,11 → 1440,11
bool found = false;
int r, g, b;
QColor tmpR;
for (it = Doku->PageColors.begin(); it != Doku->PageColors.end(); ++it)
for (it = currDoc->PageColors.begin(); it != currDoc->PageColors.end(); ++it)
{
Doku->PageColors[it.key()].getRGB(&r, &g, &b);
currDoc->PageColors[it.key()].getRGB(&r, &g, &b);
tmpR.setRgb(r, g, b);
if (c == tmpR && Doku->PageColors[it.key()].getColorModel() == colorModelRGB)
if (c == tmpR && currDoc->PageColors[it.key()].getColorModel() == colorModelRGB)
{
ret = it.key();
found = true;
1446,8 → 1454,8
{
ScColor tmp;
tmp.fromQColor(c);
Doku->PageColors.insert("FromSVG"+c.name(), tmp);
ScApp->propertiesPalette->Cpal->SetColors(Doku->PageColors);
currDoc->PageColors.insert("FromSVG"+c.name(), tmp);
ScApp->propertiesPalette->Cpal->SetColors(currDoc->PageColors);
ret = "FromSVG"+c.name();
}
return ret;
1615,7 → 1623,7
QString family = params;
QString ret = "";
family.replace( QRegExp( "'" ) , QChar( ' ' ) );
obj->Family = Doku->toolSettings.defFont; // family;
obj->Family = currDoc->toolSettings.defFont; // family;
bool found = false;
SCFontsIterator it(PrefsManager::instance()->appPrefs.AvailFonts);
for ( ; it.current(); ++it)
1633,7 → 1641,7
if (found)
obj->Family = ret;
else
obj->Family = Doku->toolSettings.defFont;
obj->Family = currDoc->toolSettings.defFont;
}
else if( command == "font-size" )
obj->FontSize = static_cast<int>(parseUnit(params) * 10.0);
1746,7 → 1754,7
}
}
}
gradient->gradient.addStop( Doku->PageColors[Col].getRGBColor(), offset, 0.5, opa, Col, 100 );
gradient->gradient.addStop( currDoc->PageColors[Col].getRGBColor(), offset, 0.5, opa, Col, 100 );
gradient->gradientValid = true;
}
}
1891,7 → 1899,7
QPainter p;
QPtrList<PageItem> GElements;
p.begin(ScApp->view->viewport());
QFont ff(Doku->UsedFonts[m_gc.current()->Family]);
QFont ff(currDoc->UsedFonts[m_gc.current()->Family]);
ff.setPointSize(QMAX(qRound(m_gc.current()->FontSize / 10.0), 1));
p.setFont(ff);
setupTransform(e);
1909,8 → 1917,9
addGraphicContext();
SvgStyle *gc = m_gc.current();
parseStyle(gc, tspan);
int z = ScApp->view->PaintText(x, y, 10, 10, gc->LWidth, gc->FillCol);
PageItem* ite = Doku->Items.at(z);
//int z = ScApp->view->PaintText(x, y, 10, 10, gc->LWidth, gc->FillCol);
int z = currDoc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y, 10, 10, gc->LWidth, "None", gc->FillCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
ite->Extra = 0;
ite->TExtra = 0;
ite->BExtra = 0;
1960,7 → 1969,7
{
hg = new ScText;
hg->ch = Text.at(tt);
hg->cfont = (*Doku->AllFonts)[gc->Family];
hg->cfont = (*currDoc->AllFonts)[gc->Family];
hg->csize = gc->FontSize;
hg->ccolor = gc->FillCol;
hg->cextra = 0;
1990,7 → 1999,7
hg->PtransY = 0;
hg->cembedded = 0;
ite->itemText.append(hg);
tempW += RealCWidth(Doku, hg->cfont, hg->ch, hg->csize)+1;
tempW += RealCWidth(currDoc, hg->cfont, hg->ch, hg->csize)+1;
if (hg->ch == QChar(13))
{
ite->Height += ite->LineSp+desc;
2032,8 → 2041,9
else
{
SvgStyle *gc = m_gc.current();
int z = ScApp->view->PaintText(x, y - qRound(gc->FontSize / 10.0), 10, 10, gc->LWidth, gc->FillCol);
PageItem* ite = Doku->Items.at(z);
//int z = ScApp->view->PaintText(x, y - qRound(gc->FontSize / 10.0), 10, 10, gc->LWidth, gc->FillCol);
int z = currDoc->itemAdd(PageItem::TextFrame, PageItem::Unspecified, x, y - qRound(gc->FontSize / 10.0), 10, 10, gc->LWidth, "None", gc->FillCol, !ScApp->view->Mpressed);
PageItem* ite = currDoc->Items.at(z);
ite->Extra = 0;
ite->TExtra = 0;
ite->BExtra = 0;
2061,7 → 2071,7
{
hg = new ScText;
hg->ch = Text.at(cc);
hg->cfont = (*Doku->AllFonts)[gc->Family];
hg->cfont = (*currDoc->AllFonts)[gc->Family];
hg->csize = gc->FontSize;
hg->ccolor = gc->FillCol;
hg->cextra = 0;
2091,7 → 2101,7
hg->PtransY = 0;
hg->cembedded = 0;
ite->itemText.append(hg);
ite->Width += RealCWidth(Doku, hg->cfont, hg->ch, hg->csize)+1;
ite->Width += RealCWidth(currDoc, hg->cfont, hg->ch, hg->csize)+1;
ite->Height = ite->LineSp+desc+2;
}
ite->SetRectFrame();
/branches/Version13x/Scribus/scribus/plugins/svgimplugin/svgplugin.h
164,7 → 164,7
FPoint GetMinClipO(FPointArray Clip);
QPtrList<PageItem> parseText(double x, double y, const QDomElement &e);
 
ScribusDoc* Doku;
ScribusDoc* currDoc;
QDomDocument inpdoc;
double CurrX, CurrY, StartX, StartY, Conversion;
int PathLen;
/branches/Version13x/Scribus/scribus/plugins/fileloader/oodraw/oodrawimp.cpp
470,7 → 470,8
w = parseUnit(b.attribute("svg:width"));
h = parseUnit(b.attribute("svg:height"));
double corner = parseUnit(b.attribute("draw:corner-radius"));
z = ScApp->view->PaintRect(BaseX+x, BaseY+y, w, h, lwidth, FillColor, StrokeColor);
//z = ScApp->view->PaintRect(BaseX+x, BaseY+y, w, h, lwidth, FillColor, StrokeColor);
Doku->itemAdd(PageItem::Polygon, PageItem::Rectangle, BaseX+x, BaseY+y, w, h, lwidth, FillColor, StrokeColor, !ScApp->view->Mpressed);
PageItem* ite = Doku->Items.at(z);
if (corner != 0)
{
485,7 → 486,8
y = parseUnit(b.attribute("svg:y")) ;
w = parseUnit(b.attribute("svg:width"));
h = parseUnit(b.attribute("svg:height"));
z = ScApp->view->PaintEllipse(BaseX+x, BaseY+y, w, h, lwidth, FillColor, StrokeColor);
//z = ScApp->view->PaintEllipse(BaseX+x, BaseY+y, w, h, lwidth, FillColor, StrokeColor);
z = Doku->itemAdd(PageItem::Polygon, PageItem::Ellipse, BaseX+x, BaseY+y, w, h, lwidth, FillColor, StrokeColor, !ScApp->view->Mpressed);
}
else if( STag == "draw:line" ) // line
{
493,7 → 495,8
double y1 = b.attribute( "svg:y1" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "svg:y1" ) );
double x2 = b.attribute( "svg:x2" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "svg:x2" ) );
double y2 = b.attribute( "svg:y2" ).isEmpty() ? 0.0 : parseUnit( b.attribute( "svg:y2" ) );
z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, lwidth, "None", StrokeColor);
//z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, lwidth, "None", StrokeColor);
z = Doku->itemAdd(PageItem::Polygon, PageItem::Unspecified, BaseX, BaseY, 10, 10, lwidth, "None", StrokeColor, !ScApp->view->Mpressed);
PageItem* ite = Doku->Items.at(z);
ite->PoLine.resize(4);
ite->PoLine.setPoint(0, FPoint(x1, y1));
513,7 → 516,8
}
else if ( STag == "draw:polygon" )
{
z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, lwidth, FillColor, StrokeColor);
//z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, lwidth, FillColor, StrokeColor);
z = Doku->itemAdd(PageItem::Polygon, PageItem::Unspecified, BaseX, BaseY, 10, 10, lwidth, FillColor, StrokeColor, !ScApp->view->Mpressed);
PageItem* ite = Doku->Items.at(z);
ite->PoLine.resize(0);
appendPoints(&ite->PoLine, b);
530,7 → 534,8
}
else if( STag == "draw:polyline" )
{
z = ScApp->view->PaintPolyLine(BaseX, BaseY, 10, 10, lwidth, "None", StrokeColor);
//z = ScApp->view->PaintPolyLine(BaseX, BaseY, 10, 10, lwidth, "None", StrokeColor);
z = Doku->itemAdd(PageItem::PolyLine, PageItem::Unspecified, BaseX, BaseY, 10, 10, lwidth, "None", StrokeColor, !ScApp->view->Mpressed);
PageItem* ite = Doku->Items.at(z);
ite->PoLine.resize(0);
appendPoints(&ite->PoLine, b);
547,7 → 552,8
}
else if( STag == "draw:path" )
{
z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, lwidth, FillColor, StrokeColor);
//z = ScApp->view->PaintPoly(BaseX, BaseY, 10, 10, lwidth, FillColor, StrokeColor);
z = Doku->itemAdd(PageItem::Polygon, PageItem::Unspecified, BaseX, BaseY, 10, 10, lwidth, FillColor, StrokeColor, !ScApp->view->Mpressed);
PageItem* ite = Doku->Items.at(z);
ite->PoLine.resize(0);
if (parseSVG( b.attribute( "svg:d" ), &ite->PoLine ))
591,7 → 597,8
y = parseUnit(b.attribute("svg:y")) ;
w = parseUnit(b.attribute("svg:width"));
h = parseUnit(b.attribute("svg:height"));
z = ScApp->view->PaintText(BaseX+x, BaseY+y, w, h+(h*0.1), lwidth, StrokeColor);
//z = ScApp->view->PaintText(BaseX+x, BaseY+y, w, h+(h*0.1), lwidth, StrokeColor);
z = Doku->itemAdd(PageItem::TextFrame, PageItem::Unspecified, BaseX+x, BaseY+y, w, h+(h*0.1), lwidth, "None", StrokeColor, !ScApp->view->Mpressed);
}
else
{
/branches/Version13x/Scribus/scribus/plugins/psimport/importps.cpp
359,9 → 359,11
else
{
if (ClosedPath)
z = ScApp->view->PaintPoly(0, 0, 10, 10, LineW, CurrColor, "None");
//z = ScApp->view->PaintPoly(0, 0, 10, 10, LineW, CurrColor, "None");
ScApp->doc->itemAdd(PageItem::Polygon, PageItem::Unspecified, 0, 0, 10, 10, LineW, CurrColor, "None", !ScApp->view->Mpressed);
else
z = ScApp->view->PaintPolyLine(0, 0, 10, 10, LineW, CurrColor, "None");
//z = ScApp->view->PaintPolyLine(0, 0, 10, 10, LineW, CurrColor, "None");
z = ScApp->doc->itemAdd(PageItem::PolyLine, PageItem::Unspecified, 0, 0, 10, 10, LineW, CurrColor, "None", !ScApp->view->Mpressed);
ite = ScApp->doc->Items.at(z);
ite->PoLine = Coords.copy();
ite->PoLine.translate(ScApp->doc->currentPage->xOffset(), ScApp->doc->currentPage->yOffset());
397,11 → 399,13
}
else
{
ScribusDoc* Doku = ScApp->doc;
if (ClosedPath)
z = ScApp->view->PaintPoly(0, 0, 10, 10, LineW, "None", CurrColor);
//z = ScApp->view->PaintPoly(0, 0, 10, 10, LineW, "None", CurrColor);
z = Doku->itemAdd(PageItem::Polygon, PageItem::Unspecified, 0, 0, 10, 10, LineW, "None", CurrColor, !ScApp->view->Mpressed);
else
z = ScApp->view->PaintPolyLine(0, 0, 10, 10, LineW, "None", CurrColor);
ScribusDoc* Doku = ScApp->doc;
//z = ScApp->view->PaintPolyLine(0, 0, 10, 10, LineW, "None", CurrColor);
z = Doku->itemAdd(PageItem::PolyLine, PageItem::Unspecified, 0, 0, 10, 10, LineW, "None", CurrColor, !ScApp->view->Mpressed);
ite = Doku->Items.at(z);
ite->PoLine = Coords.copy();
ite->PoLine.translate(Doku->currentPage->xOffset(), Doku->currentPage->yOffset());