Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 16214 → Rev 16215

/trunk/Scribus/scribus/pdflib_core.cpp
2190,6 → 2190,7
case PageItem::ItemType3:
case PageItem::Polygon:
case PageItem::RegularPolygon:
case PageItem::Arc:
PutPage("q\n");
if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
{
3926,6 → 3927,7
case PageItem::ItemType3:
case PageItem::Polygon:
case PageItem::RegularPolygon:
case PageItem::Arc:
tmp += "q\n";
if (((ite->GrMask > 0) || (ite->fillTransparency() != 0) || (ite->fillBlendmode() != 0)) && ((Options.Version >= PDFOptions::PDFVersion_14) || (Options.Version == PDFOptions::PDFVersion_X4)))
{
/trunk/Scribus/scribus/canvasmode_editarc.cpp
0,0 → 1,359
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/***************************************************************************
canvasmode_editarc.cpp - description
-------------------
begin : Tue Jan 4 2011
copyright : (C) 2011 by Franz Schmid
email : Franz.Schmid@altmuehlnet.de
***************************************************************************/
 
 
#include "canvasmode_editarc.h"
 
#include <QApplication>
#include <QButtonGroup>
#include <QCheckBox>
#include <QCursor>
#include <QEvent>
#include <QMessageBox>
#include <QMouseEvent>
#include <QPainterPath>
#include <QPoint>
#include <QRect>
#include <QTimer>
#include <QWidgetAction>
#include <QDebug>
 
#include "ui/aligndistribute.h"
#include "canvas.h"
#include "ui/contextmenu.h"
#include "fpoint.h"
#include "fpointarray.h"
#include "hyphenator.h"
#include "pageitem_arc.h"
#include "ui/pageselector.h"
#include "prefscontext.h"
#include "prefsfile.h"
#include "prefsmanager.h"
#include "ui/propertiespalette.h"
#include "scribus.h"
#include "scribusdoc.h"
#include "scribusview.h"
#include "scribusXml.h"
#include "selection.h"
#include "undomanager.h"
#include "units.h"
#include "util.h"
#include "util_icon.h"
#include "util_math.h"
 
CanvasMode_EditArc::CanvasMode_EditArc(ScribusView* view) : CanvasMode(view), m_ScMW(view->m_ScMW)
{
Mxp = Myp = -1;
m_arcPoint = noPointDefined;
}
 
inline bool CanvasMode_EditArc::GetItem(PageItem** pi)
{
*pi = m_doc->m_Selection->itemAt(0);
return (*pi) != NULL;
}
 
void CanvasMode_EditArc::drawControls(QPainter* p)
{
p->save();
if (m_canvas->m_viewMode.operItemMoving)
{
drawOutline(p);
}
else
{
drawSelection(p, false);
}
if (m_doc->appMode == modeEditArc)
{
drawControlsArc(p, m_doc->m_Selection->itemAt(0));
}
p->restore();
}
 
void CanvasMode_EditArc::drawControlsArc(QPainter* psx, PageItem* currItem)
{
QPen p1b = QPen(Qt::blue, 1.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::FlatCap, Qt::MiterJoin);
QPen p1bd = QPen(Qt::blue, 1.0 / m_canvas->m_viewMode.scale, Qt::DotLine, Qt::FlatCap, Qt::MiterJoin);
QPen p8b = QPen(Qt::blue, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
QPen p8r = QPen(Qt::red, 8.0 / m_canvas->m_viewMode.scale, Qt::SolidLine, Qt::RoundCap, Qt::MiterJoin);
psx->translate(static_cast<int>(currItem->xPos()), static_cast<int>(currItem->yPos()));
psx->rotate(currItem->rotation());
psx->setPen(p1b);
psx->setBrush(Qt::NoBrush);
QPainterPath pp;
PageItem_Arc* item = currItem->asArc();
QPointF mPoint = item->PoLine.pointQF(0);
double nWidth = mPoint.x() - widthPoint.x();
double nHeight = mPoint.y() - heightPoint.y();
pp.moveTo(mPoint);
pp.arcTo(QRectF(mPoint.x() - nWidth, mPoint.y() - nHeight, nWidth * 2, nHeight * 2), startAngle, endAngle - startAngle);
pp.closeSubpath();
psx->drawPath(pp);
psx->setPen(p1bd);
psx->drawLine(mPoint, widthPoint);
psx->drawLine(mPoint, heightPoint);
psx->setPen(p8b);
if (m_arcPoint == useControlStart)
psx->setPen(p8r);
else
psx->setPen(p8b);
psx->drawPoint(startPoint);
if (m_arcPoint == useControlSweep)
psx->setPen(p8r);
else
psx->setPen(p8b);
psx->drawPoint(endPoint);
if (m_arcPoint == useControlWidth)
psx->setPen(p8r);
else
psx->setPen(p8b);
psx->drawPoint(widthPoint);
if (m_arcPoint == useControlHeight)
psx->setPen(p8r);
else
psx->setPen(p8b);
psx->drawPoint(heightPoint);
}
 
void CanvasMode_EditArc::enterEvent(QEvent *)
{
if (!m_canvas->m_viewMode.m_MouseButtonPressed)
{
setModeCursor();
}
}
 
void CanvasMode_EditArc::leaveEvent(QEvent *e)
{
if (!m_canvas->m_viewMode.m_MouseButtonPressed)
qApp->changeOverrideCursor(QCursor(Qt::ArrowCursor));
}
 
 
void CanvasMode_EditArc::activate(bool fromGesture)
{
m_canvas->m_viewMode.m_MouseButtonPressed = false;
m_canvas->resetRenderMode();
m_doc->DragP = false;
m_doc->leaveDrag = false;
m_canvas->m_viewMode.operItemMoving = false;
m_canvas->m_viewMode.operItemResizing = false;
m_view->MidButt = false;
Mxp = Myp = -1;
PageItem *currItem = m_doc->m_Selection->itemAt(0);
PageItem_Arc* item = currItem->asArc();
centerPoint = currItem->PoLine.pointQF(0);
startPoint = currItem->PoLine.pointQF(3);
endPoint = currItem->PoLine.pointQF(currItem->PoLine.size() - 4);
widthPoint = QPointF(centerPoint.x() - item->arcWidth / 2.0, centerPoint.y());
heightPoint = QPointF(centerPoint.x(), centerPoint.y() - item->arcHeight / 2.0);
startAngle = item->arcStartAngle;
endAngle = startAngle + item->arcSweepAngle;
setModeCursor();
if (fromGesture)
{
m_view->update();
}
}
 
void CanvasMode_EditArc::deactivate(bool forGesture)
{
m_view->redrawMarker->hide();
m_arcPoint = noPointDefined;
}
 
void CanvasMode_EditArc::mouseDoubleClickEvent(QMouseEvent *m)
{
m->accept();
m_canvas->m_viewMode.m_MouseButtonPressed = false;
m_canvas->resetRenderMode();
PageItem *currItem = 0;
if ((m_doc->m_Selection->isMultipleSelection()) || (m_doc->appMode != modeNormal))
{
if ((m_doc->m_Selection->isMultipleSelection()) && (m_doc->appMode == modeNormal))
{
if (GetItem(&currItem))
{
/* CB: old code, removing this as shift-alt select on an unselected table selects a cell now.
//#6789 is closed by sorting this.
if (currItem->isTableItem)
{
m_view->Deselect(false);
m_doc->m_Selection->addItem(currItem);
currItem->isSingleSel = true;
//CB FIXME dont call this if the added item is item 0
if (!m_doc->m_Selection->primarySelectionIs(currItem))
currItem->emitAllToGUI();
m_view->updateContents(currItem->getRedrawBounding(m_canvas->scale()));
}*/
}
return;
}
else
{
if (!(GetItem(&currItem) && (m_doc->appMode == modeEdit) && currItem->asTextFrame()))
{
mousePressEvent(m);
return;
}
}
}
}
 
 
void CanvasMode_EditArc::mouseMoveEvent(QMouseEvent *m)
{
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
m->accept();
double newX = mousePointDoc.x();
double newY = mousePointDoc.y();
if (m_canvas->m_viewMode.m_MouseButtonPressed && m_view->moveTimerElapsed())
{
PageItem *currItem = m_doc->m_Selection->itemAt(0);
QTransform itemMatrix;
itemMatrix.translate(currItem->xPos(), currItem->yPos());
itemMatrix.rotate(currItem->rotation());
QPointF sPoint = currItem->PoLine.pointQF(0);
QPointF smPoint = itemMatrix.map(sPoint);
QLineF stLinA = QLineF(smPoint, QPointF(Mxp, Myp));
QLineF stLinM = QLineF(smPoint, QPointF(newX, newY));
double deltaAngle = stLinM.angle() - stLinA.angle();
QPainterPath pp;
if (m_arcPoint == useControlStart)
startAngle += deltaAngle;
else if (m_arcPoint == useControlSweep)
endAngle += deltaAngle;
else if (m_arcPoint == useControlHeight)
heightPoint = QPointF(heightPoint.x(), heightPoint.y() + (newY - Myp));
else if (m_arcPoint == useControlWidth)
widthPoint = QPointF(widthPoint.x() + (newX - Mxp), widthPoint.y());
double nSweep = endAngle - startAngle;
double nWidth = sPoint.x() - widthPoint.x();
double nHeight = sPoint.y() - heightPoint.y();
pp.moveTo(sPoint);
pp.arcTo(QRectF(sPoint.x() - nWidth, sPoint.y() - nHeight, nWidth * 2, nHeight * 2), startAngle, nSweep);
pp.closeSubpath();
FPointArray ar;
ar.fromQPainterPath(pp);
if (m_arcPoint == useControlStart)
startPoint = ar.pointQF(3);
else if (m_arcPoint == useControlSweep)
endPoint = ar.pointQF(ar.size() - 4);
currItem->update();
QRectF upRect;
upRect = QRectF(QPointF(0, 0), QPointF(currItem->width(), currItem->height())).normalized();
upRect.translate(currItem->xPos(), currItem->yPos());
m_doc->regionsChanged()->update(upRect.adjusted(-10.0 - currItem->width() / 2.0, -10.0 - currItem->height() / 2.0, 10.0 + currItem->width() / 2.0, 10.0 + currItem->height() / 2.0));
}
Mxp = newX;
Myp = newY;
}
 
void CanvasMode_EditArc::mousePressEvent(QMouseEvent *m)
{
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
 
m_canvas->PaintSizeRect(QRect());
m_canvas->m_viewMode.m_MouseButtonPressed = true;
m_canvas->m_viewMode.operItemMoving = false;
m_view->HaveSelRect = false;
m_doc->DragP = false;
m_doc->leaveDrag = false;
m->accept();
m_view->registerMousePress(m->globalPos());
Mxp = mousePointDoc.x(); //m->x();
Myp = mousePointDoc.y(); //m->y();
if (m->button() == Qt::MidButton)
{
m_view->MidButt = true;
if (m->modifiers() & Qt::ControlModifier)
m_view->DrawNew();
return;
}
QTransform itemMatrix;
PageItem *currItem = m_doc->m_Selection->itemAt(0);
itemMatrix.translate(currItem->xPos(), currItem->yPos());
itemMatrix.rotate(currItem->rotation());
QPointF stPoint = startPoint;
stPoint = itemMatrix.map(stPoint);
QPointF swPoint = endPoint;
swPoint = itemMatrix.map(swPoint);
QPointF shPoint = heightPoint;
shPoint = itemMatrix.map(shPoint);
QPointF sPoint = widthPoint;
sPoint = itemMatrix.map(sPoint);
if (m_canvas->hitsCanvasPoint(m->globalPos(), stPoint))
m_arcPoint = useControlStart;
else if (m_canvas->hitsCanvasPoint(m->globalPos(), swPoint))
m_arcPoint = useControlSweep;
else if (m_canvas->hitsCanvasPoint(m->globalPos(), shPoint))
m_arcPoint = useControlHeight;
else if (m_canvas->hitsCanvasPoint(m->globalPos(), sPoint))
m_arcPoint = useControlWidth;
else
m_arcPoint = noPointDefined;
m_canvas->m_viewMode.m_MouseButtonPressed = true;
qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
QRectF upRect;
upRect = QRectF(QPointF(0, 0), QPointF(currItem->width(), currItem->height())).normalized();
upRect.translate(currItem->xPos(), currItem->yPos());
m_doc->regionsChanged()->update(upRect.adjusted(-10.0 - currItem->width() / 2.0, -10.0 - currItem->height() / 2.0, 10.0 + currItem->width() / 2.0, 10.0 + currItem->height() / 2.0));
}
 
void CanvasMode_EditArc::mouseReleaseEvent(QMouseEvent *m)
{
const FPoint mousePointDoc = m_canvas->globalToCanvas(m->globalPos());
m_canvas->m_viewMode.m_MouseButtonPressed = false;
m_canvas->resetRenderMode();
m->accept();
PageItem *currItem = m_doc->m_Selection->itemAt(0);
PageItem_Arc* item = currItem->asArc();
QPointF mPoint = item->PoLine.pointQF(0);
QRectF upRect = QRectF(QPointF(0, 0), QPointF(currItem->width(), currItem->height())).normalized();
QRectF upRect2 = QRectF(mPoint.x() - item->arcWidth / 2.0, mPoint.y() - item->arcHeight / 2.0, item->arcWidth, item->arcHeight);
upRect = upRect2.united(upRect);
upRect.translate(currItem->xPos(), currItem->yPos());
if ((m_arcPoint == useControlStart) || (m_arcPoint == useControlSweep) || (m_arcPoint == useControlHeight) || (m_arcPoint == useControlWidth))
{
double nWidth = mPoint.x() - widthPoint.x();
double nHeight = mPoint.y() - heightPoint.y();
item->arcWidth = nWidth * 2.0;
item->arcHeight = nHeight * 2.0;
QPainterPath pp;
pp.moveTo(mPoint);
pp.arcTo(QRectF(mPoint.x() - item->arcWidth / 2.0, mPoint.y() - item->arcHeight / 2.0, item->arcWidth, item->arcHeight), startAngle, endAngle - startAngle);
pp.closeSubpath();
currItem->PoLine.fromQPainterPath(pp);
m_doc->AdjustItemSize(currItem);
item->arcStartAngle = startAngle;
item->arcSweepAngle = endAngle - startAngle;
startPoint = currItem->PoLine.pointQF(3);
endPoint = currItem->PoLine.pointQF(currItem->PoLine.size() - 4);
centerPoint = currItem->PoLine.pointQF(0);
widthPoint = QPointF(centerPoint.x() - item->arcWidth / 2.0, centerPoint.y());
heightPoint = QPointF(centerPoint.x(), centerPoint.y() - item->arcHeight / 2.0);
startAngle = item->arcStartAngle;
endAngle = startAngle + item->arcSweepAngle;
}
m_doc->regionsChanged()->update(upRect.adjusted(-10.0 - currItem->width() / 2.0, -10.0 - currItem->height() / 2.0, 10.0 + currItem->width() / 2.0, 10.0 + currItem->height() / 2.0));
}
/trunk/Scribus/scribus/pageitem_arc.h
0,0 → 1,59
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
/***************************************************************************
pageitem.h - description
-------------------
copyright : Scribus Team
***************************************************************************/
 
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
 
#ifndef PAGEITEM_ARC_H
#define PAGEITEM_ARC_H
 
#include <QString>
#include <QRectF>
 
#include "scribusapi.h"
#include "pageitem.h"
class ScPainter;
class ScribusDoc;
 
 
class SCRIBUS_API PageItem_Arc : public PageItem
{
Q_OBJECT
 
public:
PageItem_Arc(ScribusDoc *pa, double x, double y, double w, double h, double w2, QString fill, QString outline);
PageItem_Arc(const PageItem & p) : PageItem(p) {}
~PageItem_Arc() {};
 
virtual PageItem_Arc * asArc() { return this; }
virtual bool isArc() const { return true; }
virtual ItemType realItemType() const { return PageItem::Arc; }
virtual void applicableActions(QStringList& actionList);
virtual QString infoDescription();
void recalcPath();
double arcHeight; //! height of the circumfering ellipse
double arcWidth; //! width of the circumfering ellipse
double arcStartAngle; //! angle where the arc starts
double arcSweepAngle; //! angle the arc spans
protected:
virtual void DrawObj_Item(ScPainter *p, QRectF e);
 
};
 
#endif
/trunk/Scribus/scribus/canvasmode_create.cpp
102,6 → 102,15
{
p->drawEllipse(localRect);
}
else if (createObjectMode == modeDrawArc)
{
QPainterPath path;
path.moveTo(localRect.width() / 2.0, localRect.height() / 2.0);
path.arcTo(0.0, 0.0, localRect.width(), localRect.height(), m_doc->itemToolPrefs().arcStartAngle, m_doc->itemToolPrefs().arcSweepAngle);
path.closeSubpath();
p->translate(localRect.left(), localRect.top());
p->drawPath(path);
}
else if (createObjectMode == modeDrawRegularPolygon)
{
QPainterPath path = RegularPolygonPath(localRect.width(), localRect.height(), m_doc->itemToolPrefs().polyCorners, m_doc->itemToolPrefs().polyUseFactor, m_doc->itemToolPrefs().polyFactor, m_doc->itemToolPrefs().polyRotation, m_doc->itemToolPrefs().polyCurvature, m_doc->itemToolPrefs().polyInnerRot, m_doc->itemToolPrefs().polyOuterCurvature);
516,6 → 525,10
itemType = (int) PageItem::RegularPolygon;
frameType = (int) PageItem::Unspecified;
break;
case modeDrawArc:
itemType = (int) PageItem::Arc;
frameType = (int) PageItem::Unspecified;
break;
case modeInsertPDFButton:
case modeInsertPDFTextfield:
case modeInsertPDFCheckbox:
671,32 → 684,17
}
break;
case modeDrawRegularPolygon:
{
if (modifiers == Qt::ShiftModifier)
z = m_doc->itemAddArea(PageItem::RegularPolygon, PageItem::Unspecified, Rxp, Ryp, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().shapeFillColor, m_doc->itemToolPrefs().lineColor, true);
else
z = m_doc->itemAdd(PageItem::RegularPolygon, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().shapeFillColor, m_doc->itemToolPrefs().lineColor, true);
/*
qApp->changeOverrideCursor(QCursor(Qt::SizeFDiagCursor));
m_doc->m_Selection->clear();
m_doc->m_Selection->addItem(currItem);
currItem->update();
inItemCreation = true;
//FIXME: m_canvas->m_viewMode.operItemResizing = true;
if (m->modifiers() == Qt::ShiftModifier)
{
m_view->requestMode(modeNormal);
// itemAdd calls PageItem::update emit DocChanged();
inItemCreation = false;
// m_view->updateContents();
}
else
{
//FIXME: m_canvas->m_viewMode.operItemMoving = true;
m_canvas->setRenderModeFillBuffer();
}*/
break;
}
if (modifiers == Qt::ShiftModifier)
z = m_doc->itemAddArea(PageItem::RegularPolygon, PageItem::Unspecified, Rxp, Ryp, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().shapeFillColor, m_doc->itemToolPrefs().lineColor, true);
else
z = m_doc->itemAdd(PageItem::RegularPolygon, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().shapeFillColor, m_doc->itemToolPrefs().lineColor, true);
break;
case modeDrawArc:
if (modifiers == Qt::ShiftModifier)
z = m_doc->itemAddArea(PageItem::Arc, PageItem::Unspecified, Rxp, Ryp, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().shapeFillColor, m_doc->itemToolPrefs().lineColor, true);
else
z = m_doc->itemAdd(PageItem::Arc, PageItem::Unspecified, Rxp, Ryp, Rxpd, Rypd, m_doc->itemToolPrefs().shapeLineWidth, m_doc->itemToolPrefs().shapeFillColor, m_doc->itemToolPrefs().lineColor, true);
break;
case modeInsertPDFButton:
case modeInsertPDFTextfield:
case modeInsertPDFCheckbox:
/trunk/Scribus/scribus/canvasmode.cpp
24,6 → 24,7
#include "canvasmode_drawfreehand.h"
#include "canvasmode_drawcalligraphic.h"
#include "canvasmode_edit.h"
#include "canvasmode_editarc.h"
#include "canvasmode_editgradient.h"
#include "canvasmode_editmeshgradient.h"
#include "canvasmode_eyedropper.h"
134,6 → 135,7
case modeDrawText:
case modeDrawTable:
case modeDrawRegularPolygon:
case modeDrawArc:
case modeInsertPDFButton:
case modeInsertPDFTextfield:
case modeInsertPDFCheckbox:
166,6 → 168,9
case modeRotation:
result = new CanvasMode_Rotate(view);
break;
case modeEditArc:
result = new CanvasMode_EditArc(view);
break;
// more modes as they are defined...
default:
539,6 → 544,7
switch (m_doc->appMode)
{
case modeDrawShapes:
case modeDrawArc:
qApp->changeOverrideCursor(QCursor(loadIcon("DrawFrame.xpm")));
break;
case modeDrawImage:
590,6 → 596,7
case modeInsertPDFTextAnnotation:
case modeInsertPDFLinkAnnotation:
case modeInsertPDF3DAnnotation:
case modeEditArc:
qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
break;
default:
/trunk/Scribus/scribus/scribusdoc.cpp
59,6 → 59,7
#include "pageitem_symbol.h"
#include "pageitem_group.h"
#include "pageitem_regularpolygon.h"
#include "pageitem_arc.h"
#include "ui/pagepalette.h"
#include "pagesize.h"
#include "pagestructs.h"
4023,6 → 4024,10
newItem = new PageItem_RegularPolygon(this, x, y, b, h, w, fill, outline);
Q_ASSERT(frameType==PageItem::Rectangle || frameType==PageItem::Ellipse || frameType==PageItem::Unspecified);
break;
case PageItem::Arc:
newItem = new PageItem_Arc(this, x, y, b, h, w, fill, outline);
Q_ASSERT(frameType==PageItem::Rectangle || frameType==PageItem::Ellipse || frameType==PageItem::Unspecified);
break;
default:
// qDebug() << "unknown item type";
assert (false);
4253,6 → 4258,7
case PageItem::Symbol:
case PageItem::Group:
case PageItem::RegularPolygon:
case PageItem::Arc:
newItem->ClipEdited = true;
newItem->FrameType = 3;
//At this point, we cannot create a PathText item like this, only by conversion, do nothing
4280,12 → 4286,12
}
 
//ItemType Polygon
if (itemType==PageItem::Polygon || itemType==PageItem::PolyLine || itemType == PageItem::RegularPolygon)
if (itemType==PageItem::Polygon || itemType==PageItem::PolyLine || itemType == PageItem::RegularPolygon || itemType == PageItem::Arc)
{
newItem->PLineArt = Qt::PenStyle(docPrefsData.itemToolPrefs.shapeLineStyle);
newItem->setFillShade(docPrefsData.itemToolPrefs.shapeFillColorShade);
newItem->setLineShade(docPrefsData.itemToolPrefs.shapeLineColorShade);
if ((itemType == PageItem::Polygon) || (itemType == PageItem::RegularPolygon))
if ((itemType == PageItem::Polygon) || (itemType == PageItem::RegularPolygon) || (itemType == PageItem::Arc))
newItem->ContourLine = newItem->PoLine.copy();
}
}
/trunk/Scribus/scribus/scribusview.h
101,6 → 101,7
friend class CanvasMode_Edit;
friend class CanvasMode_EditGradient;
friend class CanvasMode_EditMeshGradient;
friend class CanvasMode_EditArc;
friend class CanvasMode_FrameLinks;
friend class CanvasMode_Magnifier;
friend class CanvasMode_NodeEdit;
/trunk/Scribus/scribus/prefsmanager.cpp
270,6 → 270,8
appPrefs.itemToolPrefs.polyInnerRot = 0.0;
appPrefs.itemToolPrefs.polyCurvature = 0.0;
appPrefs.itemToolPrefs.polyOuterCurvature = 0.0;
appPrefs.itemToolPrefs.arcStartAngle = 30.0;
appPrefs.itemToolPrefs.arcSweepAngle = 300.0;
// appPrefs.PSize = 40;
appPrefs.printerPrefs.ClipMargin = false;
appPrefs.printerPrefs.GCRMode = false;
1472,6 → 1474,8
dcItemTools.setAttribute("PolygonFactorGUI", appPrefs.itemToolPrefs.polyFactorGuiVal);
dcItemTools.setAttribute("PolygonCurvature", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyCurvature));
dcItemTools.setAttribute("PolygonOuterCurvature", ScCLocale::toQStringC(appPrefs.itemToolPrefs.polyOuterCurvature));
dcItemTools.setAttribute("arcStartAngle", ScCLocale::toQStringC(appPrefs.itemToolPrefs.arcStartAngle));
dcItemTools.setAttribute("arcSweepAngle", ScCLocale::toQStringC(appPrefs.itemToolPrefs.arcSweepAngle));
dcItemTools.setAttribute("PolygonUseFactor", static_cast<int>(appPrefs.itemToolPrefs.polyUseFactor));
dcItemTools.setAttribute("ImageScaleType", static_cast<int>(appPrefs.itemToolPrefs.imageScaleType));
dcItemTools.setAttribute("ImageAspectRatio", static_cast<int>(appPrefs.itemToolPrefs.imageAspectRatio));
2065,6 → 2069,8
appPrefs.itemToolPrefs.polyUseFactor = static_cast<bool>(dc.attribute("PolygonUseFactor", "0").toInt());
appPrefs.itemToolPrefs.lineStartArrow = dc.attribute("LineStartArrow", "0").toInt();
appPrefs.itemToolPrefs.lineEndArrow = dc.attribute("LineEndArrow", "0").toInt();
appPrefs.itemToolPrefs.arcStartAngle = ScCLocale::toDoubleC(dc.attribute("arcStartAngle"), 30.0);
appPrefs.itemToolPrefs.arcSweepAngle = ScCLocale::toDoubleC(dc.attribute("arcSweepAngle"), 300.0);
if (dc.hasAttribute("Face"))
{
QString tmpf=dc.attribute("Face");
/trunk/Scribus/scribus/canvas.h
90,6 → 90,7
friend class CanvasMode;
friend class CanvasMode_CopyProperties;
friend class CanvasMode_Edit;
friend class CanvasMode_EditArc;
friend class CanvasMode_EditGradient;
friend class CanvasMode_EditMeshGradient;
friend class CanvasMode_EyeDropper;
/trunk/Scribus/scribus/prefsstructs.h
226,6 → 226,9
double calligrapicPenAngle; //! Angle of the calligraphics Brush
double calligrapicPenWidth; //! Width of the calligraphics Brush
int calligrapicPenStyle; //! Line style of the calligraphics Brush
/* Arc Tool */
double arcStartAngle; //! angle where the arc starts
double arcSweepAngle; //! angle the arc spans
};
 
struct OperatorToolPrefs
/trunk/Scribus/scribus/pageitem.h
72,6 → 72,7
class PageItem_LatexFrame;
class PageItem_Symbol;
class PageItem_Group;
class PageItem_Arc;
#ifdef HAVE_OSG
class PageItem_OSGFrame;
#endif
170,6 → 171,7
Symbol = 11,
Group = 12,
RegularPolygon = 13,
Arc = 14,
Multiple = 99
};
 
199,6 → 201,7
virtual PageItem_Symbol * asSymbolFrame() { return NULL; }
virtual PageItem_Group * asGroupFrame() { return NULL; }
virtual PageItem_RegularPolygon * asRegularPolygon() { return NULL; }
virtual PageItem_Arc * asArc() { return NULL; }
 
virtual bool isImageFrame() const { return false; }
virtual bool isLine() const { return false; }
211,6 → 214,7
virtual bool isSymbol() const { return false; }
virtual bool isGroup() const { return false; }
virtual bool isRegularPolygon() const { return false; }
virtual bool isArc() const { return false; }
 
/** @brief Frame Type
*
/trunk/Scribus/scribus/scribusstructs.h
310,7 → 310,9
modeImportObject,
modeInsertPDF3DAnnotation,
modeEditMeshGradient,
modeDrawCalligraphicLine
modeDrawCalligraphicLine,
modeDrawArc,
modeEditArc
};
 
struct AlignObjs
/trunk/Scribus/scribus/scpageoutput.cpp
618,6 → 618,7
case PageItem::Symbol:
case PageItem::Group:
case PageItem::RegularPolygon:
case PageItem::Arc:
drawItem(embedded, p, clip);
break;
case PageItem::Line:
/trunk/Scribus/scribus/pageitem.cpp
560,6 → 560,10
AnName = tr("RegularPolygon");
setUPixmap(Um::IPolygon);
break;
case Arc:
AnName = tr("Arc");
setUPixmap(Um::IPolygon);
break;
default:
AnName = "Item";
break;
1837,6 → 1841,7
case Symbol:
case Group:
case RegularPolygon:
case Arc:
embedded->DrawObj_Item(p, cullingArea);
break;
case Line:
2591,6 → 2596,7
case PolyLine:
case Polygon:
case RegularPolygon:
case Arc:
GrColorP1 = m_Doc->itemToolPrefs().shapeFillColor;
break;
default:
2627,6 → 2633,7
case PolyLine:
case Polygon:
case RegularPolygon:
case Arc:
GrColorP2 = m_Doc->itemToolPrefs().shapeFillColor;
break;
default:
2663,6 → 2670,7
case PolyLine:
case Polygon:
case RegularPolygon:
case Arc:
GrColorP3 = m_Doc->itemToolPrefs().shapeFillColor;
break;
default:
2699,6 → 2707,7
case PolyLine:
case Polygon:
case RegularPolygon:
case Arc:
GrColorP4 = m_Doc->itemToolPrefs().shapeFillColor;
break;
default:
2764,6 → 2773,7
case PolyLine:
case Polygon:
case RegularPolygon:
case Arc:
MColor = m_Doc->itemToolPrefs().shapeFillColor;
break;
default:
2812,6 → 2822,7
case PolyLine:
case Polygon:
case RegularPolygon:
case Arc:
MColor = m_Doc->itemToolPrefs().shapeFillColor;
break;
default:
3112,6 → 3123,7
case PolyLine:
case Polygon:
case RegularPolygon:
case Arc:
tmp = m_Doc->itemToolPrefs().shapeFillColor;
break;
default:
3206,6 → 3218,7
case LatexFrame:
case OSGFrame:
case RegularPolygon:
case Arc:
tmp = m_Doc->itemToolPrefs().shapeLineColor;
break;
default:
3328,6 → 3341,7
case LatexFrame:
case OSGFrame:
case RegularPolygon:
case Arc:
lineColorVal = m_Doc->itemToolPrefs().shapeLineColor;
break;
default:
3366,6 → 3380,7
case PolyLine:
case Polygon:
case RegularPolygon:
case Arc:
fillColorVal = m_Doc->itemToolPrefs().shapeFillColor;
break;
default:
3737,6 → 3752,7
break;
case Polygon:
case RegularPolygon:
case Arc:
fromType = Um::Polygon;
break;
default:
3759,6 → 3775,7
break;
case Polygon:
case RegularPolygon:
case Arc:
toType = Um::Polygon;
setUPixmap(Um::IPolygon);
break;
/trunk/Scribus/scribus/actionmanager.cpp
706,6 → 706,8
scrActions->insert(name, new ScrAction(ScrAction::DataInt, QPixmap(), QPixmap(), "", defaultKey(name), mainWindow, modeDrawShapes));
name="toolsInsertPolygon";
scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-polygon.png"), loadIcon("22/draw-polygon.png"), "", defaultKey(name), mainWindow, modeDrawRegularPolygon));
name="toolsInsertArc";
scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("16/draw-arc.png"), loadIcon("22/draw-arc.png"), "", defaultKey(name), mainWindow, modeDrawArc));
name="toolsInsertLine";
scrActions->insert(name, new ScrAction(ScrAction::DataInt, loadIcon("Stift16.xpm"), loadIcon("Stift.xpm"), "", defaultKey(name), mainWindow, modeDrawLine));
name="toolsInsertBezier";
781,7 → 783,7
(*scrActions)["toolsToolbarPDF"]->setToggleAction(true);
 
*modeActionNames << "toolsSelect" << "toolsInsertTextFrame" << "toolsInsertImageFrame" << "toolsInsertTableFrame";
*modeActionNames << "toolsInsertShape" << "toolsInsertPolygon" << "toolsInsertLine" << "toolsInsertBezier";
*modeActionNames << "toolsInsertShape" << "toolsInsertPolygon" << "toolsInsertArc" << "toolsInsertLine" << "toolsInsertBezier";
*modeActionNames << "toolsInsertFreehandLine" << "toolsInsertCalligraphicLine" << "toolsInsertRenderFrame" << "toolsRotate" << "toolsZoom" << "toolsEditContents";
*modeActionNames << "toolsEditWithStoryEditor" << "toolsLinkTextFrame" << "toolsUnlinkTextFrame";
*modeActionNames << "toolsEyeDropper" << "toolsCopyProperties";
1472,6 → 1474,7
(*scrActions)["toolsInsertTableFrame"]->setText( tr("Insert T&able"));
(*scrActions)["toolsInsertShape"]->setText( tr("Insert &Shape"));
(*scrActions)["toolsInsertPolygon"]->setText( tr("Insert &Polygon"));
(*scrActions)["toolsInsertArc"]->setText( tr("Insert Arc"));
(*scrActions)["toolsInsertLine"]->setText( tr("Insert &Line"));
(*scrActions)["toolsInsertCalligraphicLine"]->setText( tr("Insert Calligraphic Line"));
(*scrActions)["toolsInsertBezier"]->setText( tr("Insert &Bezier Curve"));
1862,6 → 1865,7
<< "toolsInsertTableFrame"
<< "toolsInsertShape"
<< "toolsInsertPolygon"
<< "toolsInsertArc"
<< "toolsInsertLine"
<< "toolsInsertBezier"
<< "toolsInsertFreehandLine"
/trunk/Scribus/scribus/ui/modetoolbar.cpp
70,7 → 70,8
m_ScMW->scrActions["toolsInsertPolygon"]->setMenu(insertPolygonButtonMenu);
QToolButton* tb2 = dynamic_cast<QToolButton*>(this->widgetForAction(m_ScMW->scrActions["toolsInsertPolygon"]));
tb2->setPopupMode(QToolButton::MenuButtonPopup);
 
this->addAction(m_ScMW->scrActions["toolsInsertArc"]);
this->addAction(m_ScMW->scrActions["toolsInsertLine"]);
this->addAction(m_ScMW->scrActions["toolsInsertBezier"]);
this->addAction(m_ScMW->scrActions["toolsInsertFreehandLine"]);
/trunk/Scribus/scribus/ui/propertiespalette.cpp
55,6 → 55,7
#include "transparencypalette.h"
#include "pageitem_textframe.h"
#include "pageitem_regularpolygon.h"
#include "pageitem_arc.h"
#include "polyprops.h"
#include "sccombobox.h"
#include "scfonts.h"
1970,6 → 1971,7
setXY(CurItem->xPos(), CurItem->yPos());
setLocked(i->locked());
setSizeLocked(i->sizeLocked());
NoResize->setEnabled(!CurItem->isArc());
setScaleAndOffset(i->imageXScale(), i->imageYScale(), i->imageXOffset(), i->imageYOffset());
setLineWidth(i->lineWidth());
setLIvalue(i->lineStyle(), i->lineEnd(), i->lineJoin());
2223,6 → 2225,7
case PageItem::ItemType3:
case PageItem::Polygon:
case PageItem::RegularPolygon:
case PageItem::Arc:
TabStack->setItemEnabled(idShapeItem, true);
TabStack->setItemEnabled(idTextItem, false);
TabStack->setItemEnabled(idImageItem, false);
4137,6 → 4140,11
CurItem->update();
emit DocChanged();
}
else if (CurItem->asArc())
{
m_ScMW->view->requestMode(modeEditArc);
RoundRect->setEnabled(false);
}
else
{
m_ScMW->view->requestMode(modeEditClip);
/trunk/Scribus/scribus/ui/outlinepalette.cpp
127,6 → 127,7
case PageItem::Line:
tipText = CommonStrings::itemType_Line;
break;
case PageItem::Arc:
case PageItem::Polygon:
case PageItem::RegularPolygon:
tipText = CommonStrings::itemType_Polygon;
488,6 → 489,7
case PageItem::Line:
item->setIcon( 0, lineIcon );
break;
case PageItem::Arc:
case PageItem::Polygon:
case PageItem::RegularPolygon:
item->setIcon( 0, polygonIcon );
/trunk/Scribus/scribus/scribus.cpp
809,6 → 809,7
scrMenuMgr->addMenuItem(scrActions["toolsInsertTableFrame"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertShape"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertPolygon"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertArc"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertLine"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertBezier"], "Insert", false);
scrMenuMgr->addMenuItem(scrActions["toolsInsertFreehandLine"], "Insert", false);
2458,6 → 2459,7
scrActions["toolsInsertFreehandLine"]->setEnabled(true);
scrActions["toolsInsertCalligraphicLine"]->setEnabled(true);
scrActions["toolsInsertPolygon"]->setEnabled(true);
scrActions["toolsInsertArc"]->setEnabled(true);
scrActions["toolsInsertRenderFrame"]->setEnabled(true);
scrActions["toolsMeasurements"]->setEnabled(true);
scrActions["toolsEyeDropper"]->setEnabled(true);
2972,7 → 2974,7
scrActions["itemConvertToPolygon"]->setEnabled(false);
scrActions["itemConvertToTextFrame"]->setEnabled(doc->appMode != modeEdit);
}
if (SelectedType == PageItem::RegularPolygon) //Polygon
else if ((SelectedType == PageItem::RegularPolygon) || (SelectedType == PageItem::Arc)) // Regular Polygon + Arc
{
scrMenuMgr->setMenuEnabled("ItemConvertTo", true);
scrActions["itemConvertToBezierCurve"]->setEnabled(doc->appMode != modeEdit);
4620,6 → 4622,7
scrActions["toolsInsertFreehandLine"]->setEnabled(false);
scrActions["toolsInsertCalligraphicLine"]->setEnabled(false);
scrActions["toolsInsertPolygon"]->setEnabled(false);
scrActions["toolsInsertArc"]->setEnabled(false);
scrActions["toolsInsertRenderFrame"]->setEnabled(false);
scrActions["toolsLinkTextFrame"]->setEnabled(false);
scrActions["toolsUnlinkTextFrame"]->setEnabled(false);
6106,6 → 6109,7
scrActions["toolsInsertFreehandLine"]->setEnabled(false);
scrActions["toolsInsertCalligraphicLine"]->setEnabled(false);
scrActions["toolsInsertPolygon"]->setEnabled(false);
scrActions["toolsInsertArc"]->setEnabled(false);
scrActions["toolsInsertRenderFrame"]->setEnabled(false);
scrActions["toolsLinkTextFrame"]->setEnabled(false);
scrActions["toolsUnlinkTextFrame"]->setEnabled(false);
6187,6 → 6191,7
scrActions["toolsInsertFreehandLine"]->setEnabled(true);
scrActions["toolsInsertCalligraphicLine"]->setEnabled(true);
scrActions["toolsInsertPolygon"]->setEnabled(true);
scrActions["toolsInsertArc"]->setEnabled(true);
scrActions["toolsInsertRenderFrame"]->setEnabled(true);
scrActions["toolsPDFPushButton"]->setEnabled(true);
scrActions["toolsPDFTextField"]->setEnabled(true);
6276,6 → 6281,7
scrActions["toolsInsertTableFrame"]->setChecked(mode==modeDrawTable);
scrActions["toolsInsertShape"]->setChecked(mode==modeDrawShapes);
scrActions["toolsInsertPolygon"]->setChecked(mode==modeDrawRegularPolygon);
scrActions["toolsInsertArc"]->setChecked(mode==modeDrawArc);
scrActions["toolsInsertLine"]->setChecked(mode==modeDrawLine);
scrActions["toolsInsertBezier"]->setChecked(mode==modeDrawBezierLine);
scrActions["toolsInsertFreehandLine"]->setChecked(mode==modeDrawFreehandLine);
6439,6 → 6445,7
switch (mode)
{
case modeDrawShapes:
case modeDrawArc:
if (docSelectionCount!=0)
view->Deselect(true);
qApp->changeOverrideCursor(QCursor(loadIcon("DrawFrame.xpm")));
6503,6 → 6510,7
case modeMeasurementTool:
case modeEditGradientVectors:
case modeEditMeshGradient:
case modeEditArc:
qApp->changeOverrideCursor(QCursor(Qt::CrossCursor));
break;
default:
9172,6 → 9180,7
scrActions["toolsInsertFreehandLine"]->setEnabled(setter);
scrActions["toolsInsertCalligraphicLine"]->setEnabled(setter);
scrActions["toolsInsertPolygon"]->setEnabled(setter);
scrActions["toolsInsertArc"]->setEnabled(setter);
scrActions["toolsInsertRenderFrame"]->setEnabled(setter);
if (doc->masterPageMode())
{
/trunk/Scribus/scribus/pageitem_arc.cpp
0,0 → 1,96
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
/***************************************************************************
pageitem_arc.cpp - description
-------------------
begin : Mon Jan 3 2011
copyright : (C) 2011 by Franz Schmid
email : Franz.Schmid@altmuehlnet.de
***************************************************************************/
 
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
 
#if defined(_MSC_VER)
#define _USE_MATH_DEFINES
#endif
#include <cmath>
#include <cassert>
 
#include "page.h"
#include "pageitem.h"
#include "pageitem_arc.h"
#include "prefsmanager.h"
#include "scpainter.h"
#include "scpaths.h"
#include "scraction.h"
#include "scribus.h"
#include "scribusstructs.h"
#include "scribusdoc.h"
 
#include "undomanager.h"
#include "undostate.h"
#include "scconfig.h"
 
#include "util.h"
#include "util_math.h"
 
using namespace std;
 
PageItem_Arc::PageItem_Arc(ScribusDoc *pa, double x, double y, double w, double h, double w2, QString fill, QString outline)
: PageItem(pa, PageItem::Arc, x, y, w, h, w2, fill, outline)
{
arcHeight = h;
arcWidth = w;
arcStartAngle = m_Doc->itemToolPrefs().arcStartAngle;
arcSweepAngle = m_Doc->itemToolPrefs().arcSweepAngle;
QPainterPath path;
path.moveTo(w / 2.0, h / 2.0);
path.arcTo(0.0, 0.0, w, h, arcStartAngle, arcSweepAngle);
path.closeSubpath();
PoLine.fromQPainterPath(path);
Clip = FlattenPath(PoLine, Segments);
setSizeLocked(true);
}
 
void PageItem_Arc::DrawObj_Item(ScPainter *p, QRectF /*e*/)
{
if (!m_Doc->RePos)
{
p->setupPolygon(&PoLine);
p->fillPath();
}
}
 
void PageItem_Arc::recalcPath()
{
QPainterPath path;
path.moveTo(arcWidth / 2.0, arcHeight / 2.0);
path.arcTo(0.0, 0.0, arcWidth, arcHeight, arcStartAngle, arcSweepAngle);
path.closeSubpath();
PoLine.fromQPainterPath(path);
Clip = FlattenPath(PoLine, Segments);
}
 
void PageItem_Arc::applicableActions(QStringList & actionList)
{
actionList << "itemConvertToBezierCurve";
actionList << "itemConvertToPolygon";
actionList << "itemConvertToImageFrame";
actionList << "itemConvertToTextFrame";
}
 
QString PageItem_Arc::infoDescription()
{
return QString();
}
/trunk/Scribus/scribus/plugins/tools/lenseffects/lenseffects.cpp
77,6 → 77,7
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
m_actionInfo.notSuitableFor.append(PageItem::Arc);
m_actionInfo.needsNumObjects = 3;
}
 
/trunk/Scribus/scribus/plugins/tools/pathfinder/pathfinder.cpp
92,6 → 92,7
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
m_actionInfo.notSuitableFor.append(PageItem::Arc);
m_actionInfo.needsNumObjects = 2;
}
 
/trunk/Scribus/scribus/plugins/tools/pathconnect/pathconnect.cpp
79,6 → 79,7
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
m_actionInfo.notSuitableFor.append(PageItem::Arc);
m_actionInfo.needsNumObjects = 2;
}
 
/trunk/Scribus/scribus/plugins/tools/pathstroker/pathstroker.cpp
86,6 → 86,7
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
m_actionInfo.notSuitableFor.append(PageItem::Arc);
m_actionInfo.forAppMode.append(modeNormal);
m_actionInfo.needsNumObjects = 1;
}
/trunk/Scribus/scribus/plugins/tools/pathcut/pathcut.cpp
85,6 → 85,7
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
m_actionInfo.notSuitableFor.append(PageItem::Arc);
m_actionInfo.forAppMode.append(modeNormal);
m_actionInfo.needsNumObjects = 2;
m_actionInfo.firstObjectType.append(PageItem::PolyLine);
/trunk/Scribus/scribus/plugins/tools/2geomtools/pathalongpath/pathalongpath.cpp
81,6 → 81,7
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
m_actionInfo.notSuitableFor.append(PageItem::Arc);
m_actionInfo.forAppMode.append(modeNormal);
m_actionInfo.needsNumObjects = 2;
m_actionInfo.firstObjectType.append(PageItem::PolyLine);
/trunk/Scribus/scribus/plugins/tools/2geomtools/meshdistortion/meshdistortion.cpp
80,6 → 80,7
m_actionInfo.notSuitableFor.append(PageItem::LatexFrame);
m_actionInfo.notSuitableFor.append(PageItem::Symbol);
m_actionInfo.notSuitableFor.append(PageItem::RegularPolygon);
m_actionInfo.notSuitableFor.append(PageItem::Arc);
m_actionInfo.needsNumObjects = 3;
}
 
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format_save.cpp
25,6 → 25,7
#include "pageitem_osgframe.h"
#endif
#include "pageitem_regularpolygon.h"
#include "pageitem_arc.h"
 
#include "units.h"
#include "util.h"
262,6 → 263,8
docu.writeAttribute("POLYOCUR", m_Doc->itemToolPrefs().polyOuterCurvature);
docu.writeAttribute("POLYFD", m_Doc->itemToolPrefs().polyFactorGuiVal);
docu.writeAttribute("POLYS", static_cast<int>(m_Doc->itemToolPrefs().polyUseFactor));
docu.writeAttribute("arcStartAngle", m_Doc->itemToolPrefs().arcStartAngle);
docu.writeAttribute("arcSweepAngle", m_Doc->itemToolPrefs().polyInnerRot);
docu.writeAttribute("AutoSave", static_cast<int>(m_Doc->autoSave()));
docu.writeAttribute("AutoSaveTime", m_Doc->autoSaveTime());
docu.writeAttribute("ScratchBottom", m_Doc->scratch()->Bottom);
1683,6 → 1686,14
docu.writeAttribute("POLYFD", regitem->polyFactorGuiVal);
docu.writeAttribute("POLYS", static_cast<int>(regitem->polyUseFactor));
}
if (item->asArc())
{
PageItem_Arc *arcitem = item->asArc();
docu.writeAttribute("arcHeight", arcitem->arcHeight);
docu.writeAttribute("arcWidth", arcitem->arcWidth);
docu.writeAttribute("arcStartAngle", arcitem->arcStartAngle);
docu.writeAttribute("arcSweepAngle", arcitem->arcSweepAngle);
}
if(item->isAnnotation())
{
docu.writeAttribute("ANNOTATION",1);
/trunk/Scribus/scribus/plugins/fileloader/scribus150format/scribus150format.cpp
32,6 → 32,7
#include "pageitem_osgframe.h"
#endif
#include "pageitem_regularpolygon.h"
#include "pageitem_arc.h"
#include <QCursor>
// #include <QDebug>
#include <QFileInfo>
1708,6 → 1709,9
doc->itemToolPrefs().polyFactorGuiVal = attrs.valueAsInt("POLYFD", 0);
doc->itemToolPrefs().polyUseFactor = attrs.valueAsBool("POLYS", false);
 
doc->itemToolPrefs().arcStartAngle = attrs.valueAsDouble("arcStartAngle", 30.0);
doc->itemToolPrefs().arcSweepAngle = attrs.valueAsDouble("arcSweepAngle", 300.0);
 
doc->itemToolPrefs().lineStartArrow = attrs.valueAsInt("StartArrow", 0);
doc->itemToolPrefs().lineEndArrow = attrs.valueAsInt("EndArrow", 0);
doc->itemToolPrefs().imageScaleX = attrs.valueAsDouble("PICTSCX", 1.0);
3355,6 → 3359,12
if (pagenr > -2)
currItem->OwnPage = pagenr;
break;
case PageItem::Arc:
z = doc->itemAdd(PageItem::Arc, PageItem::Unspecified, x, y, w, h, pw, Pcolor, Pcolor2, true);
currItem = doc->Items->at(z);
if (pagenr > -2)
currItem->OwnPage = pagenr;
break;
case PageItem::Multiple:
Q_ASSERT(false);
break;
3676,6 → 3686,14
regitem->polyFactorGuiVal = attrs.valueAsInt("POLYFD", 0);
regitem->polyUseFactor = attrs.valueAsBool("POLYS", false);
}
if (currItem->asArc())
{
PageItem_Arc *arcitem = currItem->asArc();
arcitem->arcHeight = attrs.valueAsDouble("arcHeight", 1.0);
arcitem->arcWidth = attrs.valueAsDouble("arcWidth", 1.0);
arcitem->arcStartAngle = attrs.valueAsDouble("arcStartAngle", 30.0);
arcitem->arcSweepAngle = attrs.valueAsDouble("arcSweepAngle", 300.0);
}
currItem->GrType = attrs.valueAsInt("GRTYP", 0);
QString GrColor;
QString GrColor2;
/trunk/Scribus/scribus/plugins/svgexplugin/svgexplugin.cpp
377,6 → 377,7
stroke = getStrokeStyle(Item);
switch (Item->itemType())
{
case PageItem::Arc:
case PageItem::Polygon:
case PageItem::PolyLine:
case PageItem::RegularPolygon:
515,7 → 516,7
{
bool closedPath;
QDomElement ob;
if ((Item->itemType() == PageItem::Polygon) || (Item->itemType() == PageItem::RegularPolygon))
if ((Item->itemType() == PageItem::Polygon) || (Item->itemType() == PageItem::RegularPolygon) || (Item->itemType() == PageItem::Arc))
closedPath = true;
else
closedPath = false;
1198,6 → 1199,7
stroke = getStrokeStyle(embedded);
switch (embedded->itemType())
{
case PageItem::Arc:
case PageItem::Polygon:
case PageItem::PolyLine:
case PageItem::RegularPolygon:
/trunk/Scribus/scribus/pslib.cpp
2010,6 → 2010,7
case PageItem::ItemType3:
case PageItem::Polygon:
case PageItem::RegularPolygon:
case PageItem::Arc:
if ((c->fillColor() != CommonStrings::None) || (c->GrType != 0))
{
SetClipPath(&c->PoLine);
/trunk/Scribus/scribus/canvasmode_normal.cpp
41,6 → 41,7
#include "loadsaveplugin.h"
#include "pageitem_textframe.h"
#include "pageitem_regularpolygon.h"
#include "pageitem_arc.h"
#include "prefscontext.h"
#include "prefsfile.h"
#include "prefsmanager.h"
252,6 → 253,10
delete dia;
m_view->updateContents();
}
else if (currItem->asArc())
{
m_view->requestMode(modeEditArc);
}
}
}
 
/trunk/Scribus/scribus/CMakeLists.txt
180,8 → 180,9
loadsaveplugin.h
menumanager.h
navigator.h
observable.h
observable.h
pageitem.h
pageitem_arc.h
pageitem_group.h
pageitem_imageframe.h
pageitem_latexframe.h
443,6 → 444,7
canvasmode_eyedropper.cpp
canvasmode_framelinks.cpp
canvasmode_edit.cpp
canvasmode_editarc.cpp
canvasmode_editgradient.cpp
canvasmode_editmeshgradient.cpp
# canvasmode_legacy.cpp
505,6 → 507,7
nfttemplate.cpp
page.cpp
pageitem.cpp
pageitem_arc.cpp
# pageitem_desaxe.cpp
pageitem_group.cpp
pageitem_imageframe.cpp
/trunk/Scribus/scribus/canvasmode_editarc.h
0,0 → 1,84
/*
For general Scribus (>=1.3.2) copyright and licensing information please refer
to the COPYING file provided with the program. Following this notice may exist
a copyright and/or license notice that predates the release of Scribus 1.3.2
for which a new license (GPL+exception) is in place.
*/
/***************************************************************************
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
***************************************************************************/
/***************************************************************************
canvasmode_editarc.h - description
-------------------
begin : Tue Jan 4 2011
copyright : (C) 2011 by Franz Schmid
email : Franz.Schmid@altmuehlnet.de
***************************************************************************/
 
#ifndef CANVAS_MODE_EDITARC_H
#define CANVAS_MODE_EDITARC_H
 
#include <QObject>
#include <QTime>
 
#include "canvasmode.h"
#include "fpointarray.h"
 
class PageItem;
class ScribusMainWindow;
class ScribusView;
 
 
// This class encapsulate the old code for mouse interaction from scribusview.cpp
 
class CanvasMode_EditArc : public CanvasMode
{
public:
CanvasMode_EditArc(ScribusView* view);
 
virtual void enterEvent(QEvent *);
virtual void leaveEvent(QEvent *);
virtual void activate(bool);
virtual void deactivate(bool);
virtual void mouseDoubleClickEvent(QMouseEvent *m);
virtual void mouseReleaseEvent(QMouseEvent *m);
virtual void mouseMoveEvent(QMouseEvent *m);
virtual void mousePressEvent(QMouseEvent *m);
virtual void drawControls(QPainter* p);
void drawControlsArc(QPainter* pp, PageItem* currItem);
 
private:
 
typedef enum
{
noPointDefined,
useControlStart,
useControlSweep,
useControlHeight,
useControlWidth
} eArcPoint;
 
inline bool GetItem(PageItem** pi);
 
double Mxp, Myp;
ScribusMainWindow* m_ScMW;
bool m_cursorVisible;
bool m_lastPosWasOverGuide;
QPointF startPoint;
QPointF endPoint;
QPointF centerPoint;
QPointF widthPoint;
QPointF heightPoint;
double startAngle;
double endAngle;
eArcPoint m_arcPoint;
};
 
 
#endif
/trunk/Scribus/resources/icons/16/draw-arc.png
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: trunk/Scribus/resources/icons/22/draw-arc.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
/trunk/Scribus/resources/icons/22/draw-arc.png
Property changes:
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property