diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-02 19:23:46 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-02 19:23:46 +0000 |
commit | eba47f8f0637f451e21348187591e1f1fd58ac74 (patch) | |
tree | 448f10b95c656604acc331a3236c1e59bde5c1ad /ksvg/plugin/backends | |
parent | c7e8736c69373f48b0401319757c742e8607431a (diff) | |
download | tdegraphics-eba47f8f0637f451e21348187591e1f1fd58ac74.tar.gz tdegraphics-eba47f8f0637f451e21348187591e1f1fd58ac74.zip |
TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1158446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksvg/plugin/backends')
-rw-r--r-- | ksvg/plugin/backends/agg/AggCanvasFactory.cpp | 2 | ||||
-rw-r--r-- | ksvg/plugin/backends/agg/AggCanvasFactory.h | 2 | ||||
-rw-r--r-- | ksvg/plugin/backends/agg/AggCanvasItems.cpp | 64 | ||||
-rw-r--r-- | ksvg/plugin/backends/agg/AggCanvasItems.h | 32 | ||||
-rw-r--r-- | ksvg/plugin/backends/libart/BezierPathLibart.h | 4 | ||||
-rw-r--r-- | ksvg/plugin/backends/libart/LibartCanvas.cpp | 22 | ||||
-rw-r--r-- | ksvg/plugin/backends/libart/LibartCanvas.h | 10 | ||||
-rw-r--r-- | ksvg/plugin/backends/libart/LibartCanvasFactory.cpp | 2 | ||||
-rw-r--r-- | ksvg/plugin/backends/libart/LibartCanvasFactory.h | 2 | ||||
-rw-r--r-- | ksvg/plugin/backends/libart/LibartCanvasItems.cpp | 82 | ||||
-rw-r--r-- | ksvg/plugin/backends/libart/LibartCanvasItems.h | 64 |
11 files changed, 143 insertions, 143 deletions
diff --git a/ksvg/plugin/backends/agg/AggCanvasFactory.cpp b/ksvg/plugin/backends/agg/AggCanvasFactory.cpp index 439623ad..368cb252 100644 --- a/ksvg/plugin/backends/agg/AggCanvasFactory.cpp +++ b/ksvg/plugin/backends/agg/AggCanvasFactory.cpp @@ -35,7 +35,7 @@ AggCanvasFactory::~AggCanvasFactory() { } -QObject *AggCanvasFactory::createObject(QObject *, const char *, const char *, const QStringList &args) +TQObject *AggCanvasFactory::createObject(TQObject *, const char *, const char *, const TQStringList &args) { unsigned int width = (*args.at(1)).toUInt(); unsigned int height = (*args.at(0)).toUInt(); diff --git a/ksvg/plugin/backends/agg/AggCanvasFactory.h b/ksvg/plugin/backends/agg/AggCanvasFactory.h index 9fb3ffbf..8e7d4747 100644 --- a/ksvg/plugin/backends/agg/AggCanvasFactory.h +++ b/ksvg/plugin/backends/agg/AggCanvasFactory.h @@ -35,7 +35,7 @@ public: AggCanvasFactory(); virtual ~AggCanvasFactory(); - virtual QObject *createObject(QObject *parent = 0, const char *pname = 0, const char *name = "QObject", const QStringList &args = QStringList()); + virtual TQObject *createObject(TQObject *parent = 0, const char *pname = 0, const char *name = "TQObject", const TQStringList &args = TQStringList()); }; }; diff --git a/ksvg/plugin/backends/agg/AggCanvasItems.cpp b/ksvg/plugin/backends/agg/AggCanvasItems.cpp index 4ceb6109..be4727ac 100644 --- a/ksvg/plugin/backends/agg/AggCanvasItems.cpp +++ b/ksvg/plugin/backends/agg/AggCanvasItems.cpp @@ -18,7 +18,7 @@ Boston, MA 02110-1301, USA. */ -#include <qimage.h> +#include <tqimage.h> #include "SVGPaint.h" #include "SVGRectImpl.h" @@ -207,12 +207,12 @@ AggShape::~AggShape() delete m_strokePainter; } -QRect AggShape::bbox() const +TQRect AggShape::bbox() const { return m_bbox; } -bool AggShape::fillContains(const QPoint &p) +bool AggShape::fillContains(const TQPoint &p) { agg::rasterizer_scanline_aa<> ras; ras.filling_rule(m_style->getFillRule() == RULE_EVENODD ? agg::fill_even_odd : agg::fill_non_zero); @@ -221,7 +221,7 @@ bool AggShape::fillContains(const QPoint &p) return b; } -bool AggShape::strokeContains(const QPoint &p) +bool AggShape::strokeContains(const TQPoint &p) { agg::rasterizer_scanline_aa<> ras; ras.add_path(m_curved_stroked_trans); @@ -287,7 +287,7 @@ void AggShape::draw(SVGShapeImpl *shape) double x1, y1, x2, y2; agg::bounding_rect(m_curved_trans, *this, 0, 1, &x1, &y1, &x2, &y2); - m_bbox = QRect(int(x1), int(y1), int(x2 - x1), int(y2 - y1)); + m_bbox = TQRect(int(x1), int(y1), int(x2 - x1), int(y2 - y1)); m_curved.approximation_scale(pow(m_transform.scale(), 0.75)); @@ -309,7 +309,7 @@ void AggShape::calcSVPs(const SVGMatrixImpl *matrix) double x1, y1, x2, y2; agg::bounding_rect(m_curved_trans, *this, 0, 1, &x1, &y1, &x2, &y2); - m_bbox = QRect(int(x1), int(y1), int(x2 - x1), int(y2 - y1)); + m_bbox = TQRect(int(x1), int(y1), int(x2 - x1), int(y2 - y1)); } void AggShape::init(const SVGMatrixImpl *) @@ -358,7 +358,7 @@ void AggStrokePaintServer::update(SVGStylableImpl *style) { if(style->getStrokeColor()->paintType() != SVG_PAINTTYPE_URI) { - QColor qcolor; + TQColor qcolor; if(style->getStrokeColor()->paintType() == SVG_PAINTTYPE_CURRENTCOLOR) qcolor = style->getColor()->rgbColor().color(); else @@ -407,7 +407,7 @@ void AggFillPaintServer::update(SVGStylableImpl *style) { if(style->getFillColor()->paintType() != SVG_PAINTTYPE_URI) { - QColor qcolor; + TQColor qcolor; if(style->getFillColor()->paintType() == SVG_PAINTTYPE_CURRENTCOLOR) qcolor = style->getColor()->rgbColor().color(); else @@ -678,7 +678,7 @@ void AggLine::draw() { m_canvas->m_ras.reset(); m_canvas->m_ras.add_path(m_curved_stroked_trans); - QColor qcolor; + TQColor qcolor; if(m_style->getStrokeColor()->paintType() == SVG_PAINTTYPE_CURRENTCOLOR) qcolor = m_style->getColor()->rgbColor().color(); else @@ -995,9 +995,9 @@ void AggImage::draw() { //KSVGPolygon clippingPolygon = m_image->clippingShape(); - QImage *img = m_image->image(); + TQImage *img = m_image->image(); if(!img) return; - QImage image = m_image->scaledImage(); + TQImage image = m_image->scaledImage(); agg::rendering_buffer source_buffer; source_buffer.attach(image.bits(), image.width(), image.height(), image.width() * 4); @@ -1053,9 +1053,9 @@ void AggImage::init() { } -QRect AggImage::bbox() const +TQRect AggImage::bbox() const { - QRect bbox(static_cast<int>(m_image->x()->baseVal()->value()), + TQRect bbox(static_cast<int>(m_image->x()->baseVal()->value()), static_cast<int>(m_image->y()->baseVal()->value()), static_cast<int>(m_image->width()->baseVal()->value()), static_cast<int>(m_image->height()->baseVal()->value())); @@ -1077,9 +1077,9 @@ AggText::~AggText() { } -bool AggText::fillContains(const QPoint &p) +bool AggText::fillContains(const TQPoint &p) { - QPtrListIterator<SVPElement> it(m_drawItems); + TQPtrListIterator<SVPElement> it(m_drawItems); SVPElement *fill = it.current(); while(fill) @@ -1099,9 +1099,9 @@ bool AggText::fillContains(const QPoint &p) return false; } -bool AggText::strokeContains(const QPoint &p) +bool AggText::strokeContains(const TQPoint &p) { - QPtrListIterator<SVPElement> it(m_drawItems); + TQPtrListIterator<SVPElement> it(m_drawItems); SVPElement *stroke = it.current(); while(stroke) @@ -1121,11 +1121,11 @@ bool AggText::strokeContains(const QPoint &p) return false; } -QRect AggText::bbox() const +TQRect AggText::bbox() const { - QRect result, rect; + TQRect result, rect; - QPtrListIterator<SVPElement> it(m_drawItems); + TQPtrListIterator<SVPElement> it(m_drawItems); SVPElement *elem = it.current(); while(elem) @@ -1152,7 +1152,7 @@ void AggText::update(CanvasItemUpdate reason, int param1, int param2) { if(reason == UPDATE_STYLE) { - QPtrListIterator<SVPElement> it(m_drawItems); + TQPtrListIterator<SVPElement> it(m_drawItems); SVPElement *svpelement = it.current(); SVGTextContentElementImpl *text; @@ -1181,7 +1181,7 @@ void AggText::update(CanvasItemUpdate reason, int param1, int param2) } else if(reason == UPDATE_PAN) { - QPtrListIterator<SVPElement> it(m_drawItems); + TQPtrListIterator<SVPElement> it(m_drawItems); SVPElement *svpelement = it.current(); T2P::BezierPathAgg *bpath; @@ -1202,7 +1202,7 @@ void AggText::update(CanvasItemUpdate reason, int param1, int param2) void AggText::draw() { - QPtrListIterator<SVPElement> it(m_drawItems); + TQPtrListIterator<SVPElement> it(m_drawItems); SVPElement *svpelement = it.current(); BezierPathAggStroked *bpath; @@ -1229,7 +1229,7 @@ void AggText::draw() bool AggText::isVisible() { bool foundVisible = false; - QPtrListIterator<SVPElement> it(m_drawItems); + TQPtrListIterator<SVPElement> it(m_drawItems); SVPElement *svpelement = it.current(); SVGTextContentElementImpl *text; @@ -1361,7 +1361,7 @@ void AggGradient::parseGradientStops(SVGGradientElementImpl *gradient) //offsets++; // Get color - QColor qStopColor; + TQColor qStopColor; if(elem->getStopColor()->colorType() == SVG_COLORTYPE_CURRENTCOLOR) qStopColor = elem->getColor()->rgbColor().color(); @@ -1369,7 +1369,7 @@ void AggGradient::parseGradientStops(SVGGradientElementImpl *gradient) qStopColor = elem->getStopColor()->rgbColor().color(); // Convert in an agg suitable form - QString tempName = qStopColor.name(); + TQString tempName = qStopColor.name(); const char *str = tempName.latin1(); // We need to take into account fill/stroke opacity, if available (Rob) @@ -1449,14 +1449,14 @@ void AggGradient::finalizePaintServer() { parseGradientStops(m_gradient->stopsSource()); - QString _href = SVGURIReferenceImpl::getTarget(m_gradient->href()->baseVal().string()); + TQString _href = SVGURIReferenceImpl::getTarget(m_gradient->href()->baseVal().string()); if(!_href.isEmpty()) reference(_href); setFinalized(); } -void AggGradient::reference(const QString &/*href*/) +void AggGradient::reference(const TQString &/*href*/) { } @@ -1475,7 +1475,7 @@ void AggLinearGradient::render(AggCanvas *c) SVGMatrixImpl *gradTrans = linear->gradientTransform()->baseVal()->concatenate(); if(gradTrans) { - QWMatrix m = gradTrans->qmatrix(); + TQWMatrix m = gradTrans->qmatrix(); m.map(_x1, _y1, &_x1, &_y1); m.map(_x2, _y2, &_x2, &_y2); gradTrans->deref(); @@ -1613,7 +1613,7 @@ void AggRadialGradient::render(AggCanvas *c) if(gradTrans) { agg::trans_affine mtx; - QWMatrix m = gradTrans->qmatrix(); + TQWMatrix m = gradTrans->qmatrix(); mtx = agg::trans_affine(m.m11(), m.m12(), m.m21(), m.m22(), m.dx(), m.dy()); gradTrans->deref(); mtx_g1 *= mtx; @@ -1693,7 +1693,7 @@ void AggPattern::finalizePaintServer() setFinalized(); } -void AggPattern::reference(const QString &href) +void AggPattern::reference(const TQString &href) { m_pattern->reference(href); } @@ -1704,7 +1704,7 @@ void AggPattern::render(AggCanvas *c) if(!tile.image().isNull()) { - QWMatrix m = tile.screenToTile(); + TQWMatrix m = tile.screenToTile(); double affine[6]; affine[0] = m.m11(); diff --git a/ksvg/plugin/backends/agg/AggCanvasItems.h b/ksvg/plugin/backends/agg/AggCanvasItems.h index a8c242ec..b5599952 100644 --- a/ksvg/plugin/backends/agg/AggCanvasItems.h +++ b/ksvg/plugin/backends/agg/AggCanvasItems.h @@ -200,7 +200,7 @@ namespace KSVG virtual ~AggPaintServer() {} virtual void finalizePaintServer() = 0; - virtual void reference(const QString &href) = 0; + virtual void reference(const TQString &href) = 0; virtual void render(AggCanvas *c) = 0; }; @@ -214,7 +214,7 @@ namespace KSVG void parseGradientStops(SVGGradientElementImpl *gradient); virtual void finalizePaintServer(); - virtual void reference(const QString &href); + virtual void reference(const TQString &href); protected: SVGGradientElementImpl *m_gradient; @@ -254,7 +254,7 @@ namespace KSVG virtual ~AggPattern() {} virtual void finalizePaintServer(); - virtual void reference(const QString &); + virtual void reference(const TQString &); virtual void render(AggCanvas *c); @@ -307,9 +307,9 @@ namespace KSVG AggShape(AggCanvas *c, SVGStylableImpl *style); virtual ~AggShape(); - virtual QRect bbox() const; - virtual bool fillContains(const QPoint &p); - virtual bool strokeContains(const QPoint &p); + virtual TQRect bbox() const; + virtual bool fillContains(const TQPoint &p); + virtual bool strokeContains(const TQPoint &p); virtual void update(CanvasItemUpdate reason, int param1 = 0, int param2 = 0); void draw(SVGShapeImpl *shape); void calcSVPs(const SVGMatrixImpl *matrix); @@ -416,9 +416,9 @@ namespace KSVG AggMarker(AggCanvas *c, SVGMarkerElementImpl *marker); virtual ~AggMarker(); - virtual QRect bbox() const { return QRect(); } - virtual bool fillContains(const QPoint &) { return true; } - virtual bool strokeContains(const QPoint &) { return true; } + virtual TQRect bbox() const { return TQRect(); } + virtual bool fillContains(const TQPoint &) { return true; } + virtual bool strokeContains(const TQPoint &) { return true; } virtual void update(CanvasItemUpdate, int = 0, int = 0) { } virtual void init(); virtual void draw(); @@ -438,9 +438,9 @@ namespace KSVG AggImage(AggCanvas *c, SVGImageElementImpl *image); virtual ~AggImage(); - virtual QRect bbox() const; - virtual bool fillContains(const QPoint &) { return true; } - virtual bool strokeContains(const QPoint &) { return true; } + virtual TQRect bbox() const; + virtual bool fillContains(const TQPoint &) { return true; } + virtual bool strokeContains(const TQPoint &) { return true; } virtual void update(CanvasItemUpdate, int = 0, int = 0) { } virtual void init(); virtual void draw(); @@ -459,9 +459,9 @@ namespace KSVG AggText(AggCanvas *c, SVGTextElementImpl *text); virtual ~AggText(); - virtual QRect bbox() const; - virtual bool fillContains(const QPoint &p); - virtual bool strokeContains(const QPoint &p); + virtual TQRect bbox() const; + virtual bool fillContains(const TQPoint &p); + virtual bool strokeContains(const TQPoint &p); virtual void update(CanvasItemUpdate, int param1 = 0, int param2 = 0); virtual void draw(); virtual bool isVisible(); @@ -491,7 +491,7 @@ namespace KSVG AggStrokePaintServer *strokePainter; }; - mutable QPtrList<SVPElement> m_drawItems; + mutable TQPtrList<SVPElement> m_drawItems; }; }; diff --git a/ksvg/plugin/backends/libart/BezierPathLibart.h b/ksvg/plugin/backends/libart/BezierPathLibart.h index a6dfd2b9..dd8fda6f 100644 --- a/ksvg/plugin/backends/libart/BezierPathLibart.h +++ b/ksvg/plugin/backends/libart/BezierPathLibart.h @@ -22,7 +22,7 @@ #define T2P_BEZIERPATH_LIBART_H #include "BezierPath.h" -#include <qmemarray.h> +#include <tqmemarray.h> class _ArtBpath; @@ -42,7 +42,7 @@ namespace T2P virtual void boundingBox(Point *topLeft, Point *bottomRight); // Don't make those private members, these are all internal anyway... - QMemArray<_ArtBpath> m_array; + TQMemArray<_ArtBpath> m_array; double m_length; }; } diff --git a/ksvg/plugin/backends/libart/LibartCanvas.cpp b/ksvg/plugin/backends/libart/LibartCanvas.cpp index 5697b623..55b371dd 100644 --- a/ksvg/plugin/backends/libart/LibartCanvas.cpp +++ b/ksvg/plugin/backends/libart/LibartCanvas.cpp @@ -44,9 +44,9 @@ #include "SVGPaint.h" -#include <qdatetime.h> -#include <qstring.h> -#include <qimage.h> +#include <tqdatetime.h> +#include <tqstring.h> +#include <tqimage.h> #include "KSVGHelper.h" #include "KSVGTextChunk.h" @@ -91,7 +91,7 @@ ArtSVP *art_svp_from_irect(ArtIRect *bbox) return art_svp_from_rect(bbox->x0, bbox->y0, bbox->x1, bbox->y1); } -ArtSVP *art_svp_from_qrect(const QRect& rect) +ArtSVP *art_svp_from_qrect(const TQRect& rect) { return art_svp_from_rect(rect.left(), rect.top(), rect.right() + 1, rect.bottom() + 1); } @@ -153,7 +153,7 @@ CanvasItem *LibartCanvas::createPath(SVGPathElementImpl *path) CanvasItem *LibartCanvas::createClipPath(SVGClipPathElementImpl *clippath) { CanvasClipPath *result = new LibartClipPath(this, clippath); - QString index = clippath->id().string(); + TQString index = clippath->id().string(); m_clipPaths.insert(index, result); return result; } @@ -185,7 +185,7 @@ CanvasPaintServer *LibartCanvas::createPaintServer(SVGElementImpl *pserver) return result; } -void LibartCanvas::drawImage(QImage image, SVGStylableImpl *style, const SVGMatrixImpl *matrix, const KSVGPolygon& clippingPolygon) +void LibartCanvas::drawImage(TQImage image, SVGStylableImpl *style, const SVGMatrixImpl *matrix, const KSVGPolygon& clippingPolygon) { SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(style); @@ -212,9 +212,9 @@ void LibartCanvas::drawImage(QImage image, SVGStylableImpl *style, const SVGMatr { clipToBuffer(x0, y0, x1, y1); - QRect screenBBox(x0, y0, x1 - x0 + 1, y1 - y0 + 1); + TQRect screenBBox(x0, y0, x1 - x0 + 1, y1 - y0 + 1); - QByteArray mask = SVGMaskElementImpl::maskRectangle(shape, screenBBox); + TQByteArray mask = SVGMaskElementImpl::maskRectangle(shape, screenBBox); double affine[6]; KSVGHelper::matrixToAffine(matrix, affine); @@ -227,7 +227,7 @@ void LibartCanvas::drawImage(QImage image, SVGStylableImpl *style, const SVGMatr } } -ArtSVP *LibartCanvas::clippingRect(const QRect &rect, const SVGMatrixImpl *ctm) +ArtSVP *LibartCanvas::clippingRect(const TQRect &rect, const SVGMatrixImpl *ctm) { ArtVpath *vec = allocVPath(6); // Order of points in clipping rectangle must be counter-clockwise @@ -273,7 +273,7 @@ ArtSVP *LibartCanvas::clipSingleSVP(ArtSVP *svp, SVGShapeImpl *shape) if(style) { - QString clipPathRef = style->getClipPath(); + TQString clipPathRef = style->getClipPath(); if(!clipPathRef.isEmpty()) { @@ -354,7 +354,7 @@ ArtSVP *LibartCanvas::clipSingleSVP(ArtSVP *svp, SVGShapeImpl *shape) return clippedSvp; } -void LibartCanvas::drawSVP(ArtSVP *svp, art_u32 color, QByteArray mask, QRect screenBBox) +void LibartCanvas::drawSVP(ArtSVP *svp, art_u32 color, TQByteArray mask, TQRect screenBBox) { int x0 = screenBBox.left(); int y0 = screenBBox.top(); diff --git a/ksvg/plugin/backends/libart/LibartCanvas.h b/ksvg/plugin/backends/libart/LibartCanvas.h index e0da1682..9232789a 100644 --- a/ksvg/plugin/backends/libart/LibartCanvas.h +++ b/ksvg/plugin/backends/libart/LibartCanvas.h @@ -32,8 +32,8 @@ #include <Converter.h> #include "GlyphTracerLibart.h" -class QString; -class QImage; +class TQString; +class TQImage; struct _ArtSVP; @@ -50,8 +50,8 @@ class LibartCanvas : public KSVGCanvas public: LibartCanvas(unsigned int width, unsigned int height); - void drawSVP(_ArtSVP *svp, art_u32 color, QByteArray mask, QRect screenBBox); - void drawImage(QImage image, SVGStylableImpl *style, const SVGMatrixImpl *matrix, const KSVGPolygon& clippingPolygon); + void drawSVP(_ArtSVP *svp, art_u32 color, TQByteArray mask, TQRect screenBBox); + void drawImage(TQImage image, SVGStylableImpl *style, const SVGMatrixImpl *matrix, const KSVGPolygon& clippingPolygon); virtual T2P::BezierPath *toBezierPath(CanvasItem *item) const; @@ -69,7 +69,7 @@ public: virtual CanvasItem *createText(SVGTextElementImpl *text); virtual CanvasPaintServer *createPaintServer(SVGElementImpl *pserver); - _ArtSVP *clippingRect(const QRect &rect, const SVGMatrixImpl *ctm); + _ArtSVP *clippingRect(const TQRect &rect, const SVGMatrixImpl *ctm); _ArtSVP *svpFromPolygon(const KSVGPolygon& polygon); static ArtSVP *copy_svp(const ArtSVP *svp); diff --git a/ksvg/plugin/backends/libart/LibartCanvasFactory.cpp b/ksvg/plugin/backends/libart/LibartCanvasFactory.cpp index 48d37f05..9360389c 100644 --- a/ksvg/plugin/backends/libart/LibartCanvasFactory.cpp +++ b/ksvg/plugin/backends/libart/LibartCanvasFactory.cpp @@ -35,7 +35,7 @@ LibartCanvasFactory::~LibartCanvasFactory() { } -QObject *LibartCanvasFactory::createObject(QObject *, const char *, const char *, const QStringList &args) +TQObject *LibartCanvasFactory::createObject(TQObject *, const char *, const char *, const TQStringList &args) { int width = (*args.at(1)).toInt(); int height = (*args.at(0)).toInt(); diff --git a/ksvg/plugin/backends/libart/LibartCanvasFactory.h b/ksvg/plugin/backends/libart/LibartCanvasFactory.h index 5b3ed0b3..58ad5047 100644 --- a/ksvg/plugin/backends/libart/LibartCanvasFactory.h +++ b/ksvg/plugin/backends/libart/LibartCanvasFactory.h @@ -35,7 +35,7 @@ public: LibartCanvasFactory(); virtual ~LibartCanvasFactory(); - virtual QObject *createObject(QObject *parent = 0, const char *pname = 0, const char *name = "QObject", const QStringList &args = QStringList()); + virtual TQObject *createObject(TQObject *parent = 0, const char *pname = 0, const char *name = "TQObject", const TQStringList &args = TQStringList()); }; } diff --git a/ksvg/plugin/backends/libart/LibartCanvasItems.cpp b/ksvg/plugin/backends/libart/LibartCanvasItems.cpp index 5dd97be1..998fb51f 100644 --- a/ksvg/plugin/backends/libart/LibartCanvasItems.cpp +++ b/ksvg/plugin/backends/libart/LibartCanvasItems.cpp @@ -20,8 +20,8 @@ #include <cfloat> -#include <qimage.h> -#include <qwmatrix.h> +#include <tqimage.h> +#include <tqwmatrix.h> #include "SVGPaint.h" #include "SVGRectImpl.h" @@ -108,9 +108,9 @@ LibartShape::~LibartShape() delete m_strokePainter; } -QRect LibartShape::bbox() const +TQRect LibartShape::bbox() const { - QRect rect; + TQRect rect; if(m_strokeSVP || m_fillSVP) { ArtIRect *irect = new ArtIRect(); @@ -134,7 +134,7 @@ bool LibartShape::isVisible(SVGShapeImpl *shape) return m_referenced || (m_style->getVisible() && m_style->getDisplay() && shape->directRender()); } -bool LibartShape::fillContains(const QPoint &p) +bool LibartShape::fillContains(const TQPoint &p) { if(m_fillSVP) return art_svp_point_wind(m_fillSVP, p.x(), p.y()) != 0; @@ -142,7 +142,7 @@ bool LibartShape::fillContains(const QPoint &p) return false; } -bool LibartShape::strokeContains(const QPoint &p) +bool LibartShape::strokeContains(const TQPoint &p) { if(m_strokeSVP) return art_svp_point_wind(m_strokeSVP, p.x(), p.y()) != 0; @@ -214,7 +214,7 @@ void LibartPainter::update(SVGStylableImpl *style) { if(paintType(style) != SVG_PAINTTYPE_URI) { - QColor qcolor; + TQColor qcolor; if(paintType(style) == SVG_PAINTTYPE_CURRENTCOLOR) qcolor = style->getColor()->rgbColor().color(); else @@ -250,9 +250,9 @@ void LibartPainter::draw(LibartCanvas *canvas, _ArtSVP *svp, SVGStylableImpl *st { canvas->clipToBuffer(x0, y0, x1, y1); - QRect screenBBox(x0, y0, x1 - x0 + 1, y1 - y0 + 1); + TQRect screenBBox(x0, y0, x1 - x0 + 1, y1 - y0 + 1); - QByteArray mask = SVGMaskElementImpl::maskRectangle(shape, screenBBox); + TQByteArray mask = SVGMaskElementImpl::maskRectangle(shape, screenBBox); if(paintType(style) == SVG_PAINTTYPE_URI) { @@ -1356,7 +1356,7 @@ void LibartImage::draw() if(isVisible()) { SVGMatrixImpl *ctm = m_image->scaledImageMatrix(); - QImage image = m_image->scaledImage(); + TQImage image = m_image->scaledImage(); KSVGPolygon clippingPolygon = m_image->clippingShape(); m_canvas->drawImage(image, m_image, ctm, clippingPolygon); @@ -1374,9 +1374,9 @@ void LibartImage::init() { } -QRect LibartImage::bbox() const +TQRect LibartImage::bbox() const { - QRect bbox(static_cast<int>(m_image->x()->baseVal()->value()), + TQRect bbox(static_cast<int>(m_image->x()->baseVal()->value()), static_cast<int>(m_image->y()->baseVal()->value()), static_cast<int>(m_image->width()->baseVal()->value()), static_cast<int>(m_image->height()->baseVal()->value())); @@ -1428,12 +1428,12 @@ LibartText::SVPElement::~SVPElement() art_svp_free(svp); } -QRect LibartText::bbox() const +TQRect LibartText::bbox() const { - QRect result, rect; + TQRect result, rect; - QPtrListIterator<SVPElement> it1(m_drawFillItems); - QPtrListIterator<SVPElement> it2(m_drawStrokeItems); + TQPtrListIterator<SVPElement> it1(m_drawFillItems); + TQPtrListIterator<SVPElement> it2(m_drawStrokeItems); SVPElement *fill = it1.current(), *stroke = it2.current(); while(fill != 0 || stroke != 0) @@ -1458,9 +1458,9 @@ QRect LibartText::bbox() const return result; } -bool LibartText::fillContains(const QPoint &p) +bool LibartText::fillContains(const TQPoint &p) { - QPtrListIterator<SVPElement> it(m_drawFillItems); + TQPtrListIterator<SVPElement> it(m_drawFillItems); SVPElement *fill = it.current(); while(fill && fill->svp) @@ -1474,9 +1474,9 @@ bool LibartText::fillContains(const QPoint &p) return false; } -bool LibartText::strokeContains(const QPoint &p) +bool LibartText::strokeContains(const TQPoint &p) { - QPtrListIterator<SVPElement> it(m_drawStrokeItems); + TQPtrListIterator<SVPElement> it(m_drawStrokeItems); SVPElement *stroke = it.current(); while(stroke && stroke->svp) @@ -1494,8 +1494,8 @@ void LibartText::update(CanvasItemUpdate reason, int param1, int param2) { if(reason == UPDATE_STYLE) { - QPtrListIterator<SVPElement> it1(m_drawFillItems); - QPtrListIterator<SVPElement> it2(m_drawStrokeItems); + TQPtrListIterator<SVPElement> it1(m_drawFillItems); + TQPtrListIterator<SVPElement> it2(m_drawStrokeItems); SVPElement *fill = it1.current(), *stroke = it2.current(); while(fill != 0 || stroke != 0) { @@ -1529,8 +1529,8 @@ void LibartText::update(CanvasItemUpdate reason, int param1, int param2) } else if(reason == UPDATE_PAN) { - QPtrListIterator<SVPElement> it1(m_drawFillItems); - QPtrListIterator<SVPElement> it2(m_drawStrokeItems); + TQPtrListIterator<SVPElement> it1(m_drawFillItems); + TQPtrListIterator<SVPElement> it2(m_drawStrokeItems); double affine[6]; KSVGHelper::matrixToAffine(m_text->screenCTM(), affine); @@ -1559,8 +1559,8 @@ void LibartText::update(CanvasItemUpdate reason, int param1, int param2) void LibartText::draw() { - QPtrListIterator<SVPElement> it1(m_drawFillItems); - QPtrListIterator<SVPElement> it2(m_drawStrokeItems); + TQPtrListIterator<SVPElement> it1(m_drawFillItems); + TQPtrListIterator<SVPElement> it2(m_drawStrokeItems); SVPElement *fill = it1.current(), *stroke = it2.current(); while(fill != 0 || stroke != 0) @@ -1588,8 +1588,8 @@ void LibartText::draw() bool LibartText::isVisible() { bool foundVisible = false; - QPtrListIterator<SVPElement> it1(m_drawFillItems); - QPtrListIterator<SVPElement> it2(m_drawStrokeItems); + TQPtrListIterator<SVPElement> it1(m_drawFillItems); + TQPtrListIterator<SVPElement> it2(m_drawStrokeItems); SVPElement *fill = it1.current(), *stroke = it2.current(); while(fill != 0 || stroke != 0) @@ -1767,7 +1767,7 @@ void LibartText::initClipItem() ArtSVP *LibartText::clipSVP() { ArtSVP *svp = 0; - QPtrListIterator<SVPElement> it(m_drawFillItems); + TQPtrListIterator<SVPElement> it(m_drawFillItems); SVPElement *fill = it.current(); while(fill && fill->svp) @@ -1787,7 +1787,7 @@ ArtSVP *LibartText::clipSVP() return svp; } -ArtRender *LibartPaintServer::createRenderer(QRect bbox, KSVGCanvas *c) +ArtRender *LibartPaintServer::createRenderer(TQRect bbox, KSVGCanvas *c) { int x0 = bbox.x(); int y0 = bbox.y(); @@ -1836,7 +1836,7 @@ void LibartGradient::parseGradientStops(SVGGradientElementImpl *gradient) stop->offset = (stop - 1)->offset; // Get color - QColor qStopColor; + TQColor qStopColor; if(elem->getStopColor()->colorType() == SVG_COLORTYPE_CURRENTCOLOR) qStopColor = elem->getColor()->rgbColor().color(); @@ -1844,7 +1844,7 @@ void LibartGradient::parseGradientStops(SVGGradientElementImpl *gradient) qStopColor = elem->getStopColor()->rgbColor().color(); // Convert in a libart suitable form - QString tempName = qStopColor.name(); + TQString tempName = qStopColor.name(); const char *str = tempName.latin1(); int stopColor = 0; @@ -1888,18 +1888,18 @@ void LibartGradient::finalizePaintServer() { parseGradientStops(m_gradient->stopsSource()); - QString _href = SVGURIReferenceImpl::getTarget(m_gradient->href()->baseVal().string()); + TQString _href = SVGURIReferenceImpl::getTarget(m_gradient->href()->baseVal().string()); if(!_href.isEmpty()) reference(_href); setFinalized(); } -void LibartGradient::reference(const QString &) +void LibartGradient::reference(const TQString &) { } -void LibartLinearGradient::render(KSVGCanvas *c, ArtSVP *svp, float opacity, QByteArray mask, QRect screenBBox) +void LibartLinearGradient::render(KSVGCanvas *c, ArtSVP *svp, float opacity, TQByteArray mask, TQRect screenBBox) { if(!m_stops.isEmpty()) { @@ -1995,7 +1995,7 @@ void LibartLinearGradient::render(KSVGCanvas *c, ArtSVP *svp, float opacity, QBy matrix->deref(); - QMemArray<ArtGradientStop> stops = m_stops; + TQMemArray<ArtGradientStop> stops = m_stops; stops.detach(); for(unsigned int i = 0; i < stops.size(); i++) @@ -2032,7 +2032,7 @@ void LibartLinearGradient::render(KSVGCanvas *c, ArtSVP *svp, float opacity, QBy } } -void LibartRadialGradient::render(KSVGCanvas *c, ArtSVP *svp, float opacity, QByteArray mask, QRect screenBBox) +void LibartRadialGradient::render(KSVGCanvas *c, ArtSVP *svp, float opacity, TQByteArray mask, TQRect screenBBox) { if(!m_stops.isEmpty()) { @@ -2146,7 +2146,7 @@ void LibartRadialGradient::render(KSVGCanvas *c, ArtSVP *svp, float opacity, QBy matrix->deref(); - QMemArray<ArtGradientStop> stops = m_stops; + TQMemArray<ArtGradientStop> stops = m_stops; stops.detach(); for(unsigned int i = 0; i < stops.size(); i++) @@ -2179,18 +2179,18 @@ void LibartPattern::finalizePaintServer() setFinalized(); } -void LibartPattern::reference(const QString &href) +void LibartPattern::reference(const TQString &href) { m_pattern->reference(href); } -void LibartPattern::render(KSVGCanvas *c, ArtSVP *svp, float opacity, QByteArray mask, QRect screenBBox) +void LibartPattern::render(KSVGCanvas *c, ArtSVP *svp, float opacity, TQByteArray mask, TQRect screenBBox) { SVGPatternElementImpl::Tile tile = m_pattern->createTile(getBBoxTarget()); if(!tile.image().isNull()) { - QWMatrix m = tile.screenToTile(); + TQWMatrix m = tile.screenToTile(); double affine[6]; affine[0] = m.m11(); diff --git a/ksvg/plugin/backends/libart/LibartCanvasItems.h b/ksvg/plugin/backends/libart/LibartCanvasItems.h index c62224e5..d34ec9f4 100644 --- a/ksvg/plugin/backends/libart/LibartCanvasItems.h +++ b/ksvg/plugin/backends/libart/LibartCanvasItems.h @@ -21,7 +21,7 @@ #ifndef LIBARTCANVASITEMS_H #define LIBARTCANVASITEMS_H -#include <qptrlist.h> +#include <tqptrlist.h> #include "CanvasItems.h" #include "LibartCanvas.h" @@ -73,9 +73,9 @@ namespace KSVG LibartPaintServer() : CanvasPaintServer() {} virtual ~LibartPaintServer() {} - virtual void render(KSVGCanvas *c, _ArtSVP *svp, float opacity, QByteArray mask, QRect screenBBox) = 0; + virtual void render(KSVGCanvas *c, _ArtSVP *svp, float opacity, TQByteArray mask, TQRect screenBBox) = 0; - _ArtRender *createRenderer(QRect rect, KSVGCanvas *c); + _ArtRender *createRenderer(TQRect rect, KSVGCanvas *c); }; class LibartGradient : public LibartPaintServer @@ -87,11 +87,11 @@ namespace KSVG void parseGradientStops(SVGGradientElementImpl *gradient); virtual void finalizePaintServer(); - virtual void reference(const QString &href); + virtual void reference(const TQString &href); protected: SVGGradientElementImpl *m_gradient; - QMemArray<_ArtGradientStop> m_stops; + TQMemArray<_ArtGradientStop> m_stops; }; class LibartLinearGradient : public LibartGradient @@ -99,7 +99,7 @@ namespace KSVG public: LibartLinearGradient(SVGLinearGradientElementImpl *linear) : LibartGradient(linear), m_linear(linear) {} - virtual void render(KSVGCanvas *c, _ArtSVP *svp, float opacity, QByteArray mask, QRect screenBBox); + virtual void render(KSVGCanvas *c, _ArtSVP *svp, float opacity, TQByteArray mask, TQRect screenBBox); protected: SVGLinearGradientElementImpl *m_linear; @@ -110,7 +110,7 @@ namespace KSVG public: LibartRadialGradient(SVGRadialGradientElementImpl *radial) : LibartGradient(radial), m_radial(radial) {} - virtual void render(KSVGCanvas *c, _ArtSVP *svp, float opacity, QByteArray mask, QRect screenBBox); + virtual void render(KSVGCanvas *c, _ArtSVP *svp, float opacity, TQByteArray mask, TQRect screenBBox); protected: SVGRadialGradientElementImpl *m_radial; @@ -123,9 +123,9 @@ namespace KSVG virtual ~LibartPattern() {} virtual void finalizePaintServer(); - virtual void reference(const QString &href); + virtual void reference(const TQString &href); - virtual void render(KSVGCanvas *c, _ArtSVP *svp, float opacity, QByteArray mask, QRect screenBBox); + virtual void render(KSVGCanvas *c, _ArtSVP *svp, float opacity, TQByteArray mask, TQRect screenBBox); protected: SVGPatternElementImpl *m_pattern; @@ -142,7 +142,7 @@ namespace KSVG virtual float opacity(SVGStylableImpl *style) const = 0; virtual unsigned short paintType(SVGStylableImpl *style) const = 0; - virtual QString paintUri(SVGStylableImpl *style) const = 0; + virtual TQString paintUri(SVGStylableImpl *style) const = 0; virtual QRgb color(SVGStylableImpl *style) const = 0; protected: @@ -156,7 +156,7 @@ namespace KSVG float opacity(SVGStylableImpl *style) const { return style->getFillOpacity() * style->getOpacity(); } unsigned short paintType(SVGStylableImpl *style) const { return style->getFillColor()->paintType(); } - QString paintUri(SVGStylableImpl *style) const { return style->getFillColor()->uri().string(); } + TQString paintUri(SVGStylableImpl *style) const { return style->getFillColor()->uri().string(); } QRgb color(SVGStylableImpl *style) const { return style->getFillColor()->rgbColor().color(); } }; @@ -167,7 +167,7 @@ namespace KSVG float opacity(SVGStylableImpl *style) const { return style->getStrokeOpacity() * style->getOpacity(); } unsigned short paintType(SVGStylableImpl *style) const { return style->getStrokeColor()->paintType(); } - QString paintUri(SVGStylableImpl *style) const { return style->getStrokeColor()->uri().string(); } + TQString paintUri(SVGStylableImpl *style) const { return style->getStrokeColor()->uri().string(); } QRgb color(SVGStylableImpl *style) const { return style->getStrokeColor()->rgbColor().color(); } }; @@ -191,9 +191,9 @@ namespace KSVG LibartShape(LibartCanvas *c, SVGStylableImpl *style); virtual ~LibartShape(); - virtual QRect bbox() const; - virtual bool fillContains(const QPoint &p); - virtual bool strokeContains(const QPoint &p); + virtual TQRect bbox() const; + virtual bool fillContains(const TQPoint &p); + virtual bool strokeContains(const TQPoint &p); virtual void update(CanvasItemUpdate reason, int param1 = 0, int param2 = 0); void draw(SVGShapeImpl *shape); bool isVisible(SVGShapeImpl *shape); @@ -307,9 +307,9 @@ namespace KSVG LibartClipPath(LibartCanvas *c, SVGClipPathElementImpl *clipPath); virtual ~LibartClipPath(); - virtual QRect bbox() const { return QRect(); } - virtual bool fillContains(const QPoint &) { return true; } - virtual bool strokeContains(const QPoint &) { return true; } + virtual TQRect bbox() const { return TQRect(); } + virtual bool fillContains(const TQPoint &) { return true; } + virtual bool strokeContains(const TQPoint &) { return true; } virtual void update(CanvasItemUpdate, int param1 = 0, int param2 = 0); virtual void init(); virtual void draw(); @@ -321,7 +321,7 @@ namespace KSVG LibartCanvas *m_canvas; _ArtSVP *m_clipSVP; - QPtrList<CanvasItem> m_clipItems; + TQPtrList<CanvasItem> m_clipItems; }; class LibartImage : public CanvasItem @@ -330,9 +330,9 @@ namespace KSVG LibartImage(LibartCanvas *c, SVGImageElementImpl *image); virtual ~LibartImage(); - virtual QRect bbox() const; - virtual bool fillContains(const QPoint &) { return true; } - virtual bool strokeContains(const QPoint &) { return true; } + virtual TQRect bbox() const; + virtual bool fillContains(const TQPoint &) { return true; } + virtual bool strokeContains(const TQPoint &) { return true; } virtual void update(CanvasItemUpdate, int = 0, int = 0) { } virtual void init(); virtual void draw(); @@ -353,9 +353,9 @@ namespace KSVG LibartMarker(LibartCanvas *c, SVGMarkerElementImpl *marker); virtual ~LibartMarker(); - virtual QRect bbox() const { return QRect(); } - virtual bool fillContains(const QPoint &) { return true; } - virtual bool strokeContains(const QPoint &) { return true; } + virtual TQRect bbox() const { return TQRect(); } + virtual bool fillContains(const TQPoint &) { return true; } + virtual bool strokeContains(const TQPoint &) { return true; } virtual void update(CanvasItemUpdate, int = 0, int = 0) { } virtual void init(); virtual void draw(); @@ -371,9 +371,9 @@ namespace KSVG LibartText(LibartCanvas *c, SVGTextElementImpl *text); virtual ~LibartText(); - virtual QRect bbox() const; - virtual bool fillContains(const QPoint &p); - virtual bool strokeContains(const QPoint &p); + virtual TQRect bbox() const; + virtual bool fillContains(const TQPoint &p); + virtual bool strokeContains(const TQPoint &p); virtual void update(CanvasItemUpdate reason, int param1 = 0, int param2 = 0); virtual void draw(); virtual bool isVisible(); @@ -403,10 +403,10 @@ namespace KSVG }; // renderCallback() is const. - mutable QPtrList<SVPElement> m_drawFillItems; - mutable QPtrList<SVPElement> m_drawStrokeItems; - mutable QPtrDict<LibartFillPainter> m_fillPainters; - mutable QPtrDict<LibartStrokePainter> m_strokePainters; + mutable TQPtrList<SVPElement> m_drawFillItems; + mutable TQPtrList<SVPElement> m_drawStrokeItems; + mutable TQPtrDict<LibartFillPainter> m_fillPainters; + mutable TQPtrDict<LibartStrokePainter> m_strokePainters; }; } |