Subversion Repositories Scribus

Compare Revisions

Ignore whitespace Rev 8194 → Rev 8195

/branches/Version13x/Scribus/scribus/undoobject.cpp
45,7 → 45,7
upixmap_ = objectIcon;
}
 
ulong UndoObject::getUId()
ulong UndoObject::getUId() const
{
return id_;
}
/branches/Version13x/Scribus/scribus/annotation.h
27,11 → 27,12
#endif
 
#include <qstring.h>
#include "desaxe/saxio.h"
 
//FIXME: Someone please fix these variable names..
//They are simply moved here, not all fixed.
//TODO make the usage in various places a little simpler
class Annotation
class Annotation : public SaxIO
{
public:
//Do we need a null or an empty QString for these? Remove the qstring initialisations if null is ok.
44,6 → 45,7
{
}
void saxx(SaxHandler& handler) const;
void setType(int newType) { AnType=newType; }
void setAction(const QString& newAction) { AnAction=newAction; }
void setE_act(const QString& newE_act) { An_E_act=newE_act; }
/branches/Version13x/Scribus/scribus/fpointarray.cpp
141,7 → 141,7
return true;
}
 
void FPointArray::point(uint i, double *x, double *y)
void FPointArray::point(uint i, double *x, double *y) const
{
// FPoint p = QMemArray<FPoint>::at(i);
ConstIterator p = begin();
153,7 → 153,7
}
 
 
QPoint FPointArray::pointQ(uint i)
QPoint FPointArray::pointQ(uint i) const
{
// FPoint p = QMemArray<FPoint>::at(i);
ConstIterator p = begin();
187,12 → 187,12
}
 
 
FPoint FPointArray::WidthHeight()
FPoint FPointArray::WidthHeight() const
{
if ( count == 0 )
return FPoint( 0.0, 0.0 ); // null rectangle
Iterator pd = begin();
Iterator pend = begin();
ConstIterator pd = begin();
ConstIterator pend = begin();
pend += count;
double minx, maxx, miny, maxy;
minx = maxx = pd->xp;
266,7 → 266,7
}
 
 
bool FPointArray::hasLastQuadPoint(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4)
bool FPointArray::hasLastQuadPoint(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) const
{
int i = count-4;
if (i < 0)
315,7 → 315,7
*p = p4;
}
 
double FPointArray::lenPathSeg(int seg)
double FPointArray::lenPathSeg(int seg) const
{
FPoint p1 = point(seg);
FPoint k1 = point(seg+1);
349,7 → 349,7
return newLen;
}
 
double FPointArray::lenPathDist(int seg, double t1, double t2)
double FPointArray::lenPathDist(int seg, double t1, double t2) const
{
FPoint p1 = point(seg);
FPoint k1 = point(seg+1);
373,7 → 373,7
return newLen;
}
 
void FPointArray::pointTangentNormalAt( int seg, double t, FPoint* p, FPoint* tn, FPoint* n )
void FPointArray::pointTangentNormalAt( int seg, double t, FPoint* p, FPoint* tn, FPoint* n ) const
{
// Calculate derivative if necessary.
FPoint d;
406,7 → 406,7
*p = ((tm * tm * tm) * p1) + (3 * t * (tm * tm) * k1) + (3 * (t * t) * tm * k2 + (t * t * t) * p2);
}
 
void FPointArray::pointDerivativesAt( int seg, double t, FPoint* p, FPoint* d1, FPoint* d2 )
void FPointArray::pointDerivativesAt( int seg, double t, FPoint* p, FPoint* d1, FPoint* d2 ) const
{
// Copy points.
FPoint* q = new FPoint[ 4 ];
/branches/Version13x/Scribus/scribus/pageitem.cpp
2066,7 → 2066,7
patternRotation = rotation;
}
 
void PageItem::patternTransform(double &scaleX, double &scaleY, double &offsetX, double &offsetY, double &rotation)
void PageItem::patternTransform(double &scaleX, double &scaleY, double &offsetX, double &offsetY, double &rotation) const
{
scaleX = patternScaleX;
scaleY = patternScaleY;
3330,11 → 3330,11
return &pageItemAttributes;
}
 
ObjectAttribute PageItem::getObjectAttribute(QString attributeName)
ObjectAttribute PageItem::getObjectAttribute(QString attributeName) const
{
int countFound=0;
ObjAttrVector::Iterator foundIt = pageItemAttributes.begin();
for(ObjAttrVector::Iterator objAttrIt = pageItemAttributes.begin() ; objAttrIt != pageItemAttributes.end(); ++objAttrIt )
ObjAttrVector::const_iterator foundIt = pageItemAttributes.begin();
for(ObjAttrVector::const_iterator objAttrIt = pageItemAttributes.begin() ; objAttrIt != pageItemAttributes.end(); ++objAttrIt )
{
if ((*objAttrIt).name==attributeName)
{
3636,7 → 3636,7
FrameType = 2;
}
 
void PageItem::getBoundingRect(double *x1, double *y1, double *x2, double *y2)
void PageItem::getBoundingRect(double *x1, double *y1, double *x2, double *y2) const
{
double minx = 99999.9;
double miny = 99999.9;
3672,9 → 3672,9
}
 
 
bool PageItem::pointWithinItem(const int x, const int y)
bool PageItem::pointWithinItem(const int x, const int y) const
{
setRedrawBounding();
const_cast<PageItem*>(this)-> setRedrawBounding();
// FIXME: We should be rounding or truncating here, not letting the compiler do it.
// Should we be rounding, truncating up, or truncating down?
//CB is this now correct?
3682,7 → 3682,7
return itemRect.contains(x, y);
}
 
bool PageItem::mouseWithinItem(QWidget* vport, const int x, const int y, double scale)
bool PageItem::mouseWithinItem(QWidget* vport, const int x, const int y, double scale) const
{
QPainter p;
QRect transRect;
/branches/Version13x/Scribus/scribus/vgradient.h
97,7 → 97,7
class SCRIBUS_API VColorStopList : public QPtrList<VColorStop>
{
protected:
virtual int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 );
virtual int compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ) const;
public:
// Reimplement inSort so that two color stop with same offset can be found
// in the same order they are inserted
121,7 → 121,7
void removeStop( const VColorStop& colorStop );
void removeStop( uint n );
void clearStops();
uint Stops() { return m_colorStops.count(); }
uint Stops() const { return m_colorStops.count(); }
 
// This function let only one stop with offset value equal to 0 and 1.0
// by removing the firsts with 0.0 value and the lasts with 1.0 value;
/branches/Version13x/Scribus/scribus/vgradient.cpp
26,7 → 26,7
#include <algorithm>
 
// colorStop comparison function for stable_sort function
bool compareStops( const VColorStop* item1, const VColorStop* item2 )
bool compareStops( const VColorStop* item1, const VColorStop* item2 )
{
double r1 = item1->rampPoint;
double r2 = item2->rampPoint;
33,7 → 33,7
return ( r1 < r2 ? true : false );
}
 
int VGradient::VColorStopList::compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 )
int VGradient::VColorStopList::compareItems( QPtrCollection::Item item1, QPtrCollection::Item item2 ) const
{
double r1 = ( (VColorStop*)item1 )->rampPoint;
double r2 = ( (VColorStop*)item2 )->rampPoint;
/branches/Version13x/Scribus/scribus/undoobject.h
97,7 → 97,7
* @brief Returns an unique identifier number for the UndoObject
* @return unique identifier number for the UndoObjet
*/
virtual ulong getUId();
ulong getUId() const;
 
/**
* @brief Method used when an undo/redo is requested.
/branches/Version13x/Scribus/scribus/fpointarray.h
47,12 → 47,12
bool setPoints( int nPoints, double firstx, double firsty, ... );
bool putPoints( int index, int nPoints, double firstx, double firsty, ... );
bool putPoints( int index, int nPoints, const FPointArray & from, int fromIndex = 0 );
void point(uint i, double *x, double *y);
const FPoint & point(uint i) { ConstIterator p = begin(); p+=i; return *p; };
QPoint pointQ(uint i);
void point(uint i, double *x, double *y) const;
const FPoint & point(uint i) const{ ConstIterator p = begin(); p+=i; return *p; };
QPoint pointQ(uint i) const;
void translate( double dx, double dy );
void scale( double sx, double sy );
FPoint WidthHeight();
FPoint WidthHeight() const;
void map(QWMatrix m);
FPointArray &operator=( const FPointArray &a );
FPointArray copy() const;
59,13 → 59,13
void setMarker();
void addPoint(double x, double y);
void addPoint(FPoint p);
bool hasLastQuadPoint(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4);
bool hasLastQuadPoint(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4) const;
void addQuadPoint(double x1, double y1, double x2, double y2, double x3, double y3, double x4, double y4);
void addQuadPoint(FPoint p1, FPoint p2, FPoint p3, FPoint p4);
double lenPathSeg(int seg);
double lenPathDist(int seg, double t1, double t2);
void pointTangentNormalAt( int seg, double t, FPoint* p, FPoint* tn, FPoint* n );
void pointDerivativesAt( int seg, double t, FPoint* p, FPoint* d1, FPoint* d2 );
double lenPathSeg(int seg) const;
double lenPathDist(int seg, double t1, double t2) const;
void pointTangentNormalAt( int seg, double t, FPoint* p, FPoint* tn, FPoint* n ) const;
void pointDerivativesAt( int seg, double t, FPoint* p, FPoint* d1, FPoint* d2 ) const;
bool operator==(const FPointArray &rhs) const;
bool operator!=(const FPointArray &rhs) const;
~FPointArray() {};
/branches/Version13x/Scribus/scribus/pageitem.h
41,6 → 41,7
#include "vgradient.h"
#include "text/nlsconfig.h"
#include "text/storytext.h"
#include "desaxe/saxio.h"
 
class ScPainter;
class ScribusDoc;
59,7 → 60,7
*@author Franz Schmid
*/
 
class SCRIBUS_API PageItem : public QObject, public UndoObject
class SCRIBUS_API PageItem : public QObject, public UndoObject, public SaxIO
{
Q_OBJECT
 
180,6 → 181,10
public:
PageItem(ScribusDoc *pa, ItemType newType, double x, double y, double w, double h, double w2, QString fill, QString outline);
~PageItem() {};
 
virtual void saxx(SaxHandler & ) const;
static void desaxeRules(Xml_string prefixPattern, desaxe::Digester & ruleset);
/**
* @brief Clear the contents of a frame.
* WARNING: Currently *they* do not check if the user wants this.
214,7 → 219,7
/*!
* brief Returns a complete ObjectAttribute struct if 1 is found, or ObjectAttribute.name will be QString::null if 0 or >1 are found
*/
ObjectAttribute getObjectAttribute(QString);
ObjectAttribute getObjectAttribute(QString) const;
void setObjectAttributes(ObjAttrVector*);
/** Zeichnet das Item */
void paintObj(QRect e=QRect(), QPixmap *ppX = 0);
243,7 → 248,7
void convertClip();
//QRect getRedrawBounding(const double);
//void setRedrawBounding();
void getBoundingRect(double *x1, double *y1, double *x2, double *y2);
void getBoundingRect(double *x1, double *y1, double *x2, double *y2) const;
/**
* @brief Check if a QPoint is within the items boundaries
* No coordinates transformation is performed
251,7 → 256,7
@param y Y position
* @return bool true if x, i in the item
*/
bool pointWithinItem(const int x, const int y);
bool pointWithinItem(const int x, const int y) const;
/**
* @brief Check if the mouse is within the items boundaries
* This method performs necessary page to device transformations
261,7 → 266,7
@param scale scale of the vport
* @return bool true if the x, y is in the bounds
*/
bool mouseWithinItem(QWidget* vport, const int x, const int y, double scale);
bool mouseWithinItem(QWidget* vport, const int x, const int y, double scale) const;
void copyToCopyPasteBuffer(struct CopyPasteBuffer *Buffer);
virtual void handleModeEditKey(QKeyEvent *k, bool &keyRepeat);
327,7 → 332,7
uint ItemNr;
/** Internal unique Item-Number, used for the undo system */
uint uniqueNr;
/** Hat Element Rahmen? */
/** Hat Element Rahmen? FIXME: still used?*/
bool Frame;
/** Seite zu der das Element gehoert */
int OwnPage;
373,6 → 378,8
bool isAutoText;
PageItem* prevInChain() { return BackBox; }
PageItem* nextInChain() { return NextBox; }
const PageItem* prevInChain() const { return BackBox; }
const PageItem* nextInChain() const { return NextBox; }
void unlink();
void link(PageItem* nextFrame);
 
513,7 → 520,7
QString pattern() const { return patternVal; }
 
/** @brief Get the pattern transformation matrix of the object */
void patternTransform(double &scaleX, double &scaleY, double &offsetX, double &offsetY, double &rotation);
void patternTransform(double &scaleX, double &scaleY, double &offsetX, double &offsetY, double &rotation) const;
 
/**
* @brief Set the fill pattern of the object.
836,6 → 843,7
void setIsAnnotation(bool);
void setAnnotation(const Annotation& ad);
Annotation& annotation() { return m_annotation; }
const Annotation& annotation() const { return m_annotation; }
bool imageShown() const { return PicArt; }
void setImageShown(bool);