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 | |
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')
-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 | ||||
-rw-r--r-- | ksvg/plugin/ksvg_factory.cpp | 14 | ||||
-rw-r--r-- | ksvg/plugin/ksvg_factory.h | 4 | ||||
-rw-r--r-- | ksvg/plugin/ksvg_plugin.cpp | 78 | ||||
-rw-r--r-- | ksvg/plugin/ksvg_plugin.h | 22 | ||||
-rw-r--r-- | ksvg/plugin/ksvg_widget.cpp | 38 | ||||
-rw-r--r-- | ksvg/plugin/ksvg_widget.h | 28 | ||||
-rw-r--r-- | ksvg/plugin/svgcreator.cpp | 10 | ||||
-rw-r--r-- | ksvg/plugin/svgcreator.h | 4 |
19 files changed, 242 insertions, 242 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; }; } diff --git a/ksvg/plugin/ksvg_factory.cpp b/ksvg/plugin/ksvg_factory.cpp index b231783c..d5e5e1dc 100644 --- a/ksvg/plugin/ksvg_factory.cpp +++ b/ksvg/plugin/ksvg_factory.cpp @@ -28,8 +28,8 @@ #include "ksvg_factory.moc" #include <kdebug.h> -#include <qstringlist.h> -#include <qregexp.h> +#include <tqstringlist.h> +#include <tqregexp.h> extern "C" { @@ -43,7 +43,7 @@ extern "C" KInstance *KSVGPluginFactory::s_instance = 0; KAboutData *KSVGPluginFactory::s_about = 0; -KSVGPluginFactory::KSVGPluginFactory(QObject *parent, const char *name) : KParts::Factory(parent, name) +KSVGPluginFactory::KSVGPluginFactory(TQObject *parent, const char *name) : KParts::Factory(parent, name) { } @@ -56,15 +56,15 @@ KSVGPluginFactory::~KSVGPluginFactory() s_about = 0; } -KParts::Part *KSVGPluginFactory::createPartObject(QWidget *parentWidget, const char *wname, QObject *parent, const char *name, const char *, const QStringList &args) +KParts::Part *KSVGPluginFactory::createPartObject(TQWidget *parentWidget, const char *wname, TQObject *parent, const char *name, const char *, const TQStringList &args) { // Get the width and height of the <embed> // TODO : <object> unsigned int width = 0, height = 0; bool dummy; - QRegExp r1("(WIDTH)(\\s*=\\s*\")(\\d+)(\\w*)(\")"); - QRegExp r2("(HEIGHT)(\\s*=\\s*\")(\\d+)(\\w*)(\")"); - for(QValueListConstIterator<QString> it = args.begin(); it != args.end(); ++it) + TQRegExp r1("(WIDTH)(\\s*=\\s*\")(\\d+)(\\w*)(\")"); + TQRegExp r2("(HEIGHT)(\\s*=\\s*\")(\\d+)(\\w*)(\")"); + for(TQValueListConstIterator<TQString> it = args.begin(); it != args.end(); ++it) { if(r1.search(*it) > -1) width = r1.cap(3).toUInt(&dummy); diff --git a/ksvg/plugin/ksvg_factory.h b/ksvg/plugin/ksvg_factory.h index b462c782..c931e503 100644 --- a/ksvg/plugin/ksvg_factory.h +++ b/ksvg/plugin/ksvg_factory.h @@ -31,10 +31,10 @@ class KSVGPluginFactory : public KParts::Factory { Q_OBJECT public: - KSVGPluginFactory(QObject *parent = 0, const char *name = 0); + KSVGPluginFactory(TQObject *parent = 0, const char *name = 0); virtual ~KSVGPluginFactory(); - virtual KParts::Part *createPartObject(QWidget *parentWidget = 0, const char *widgetName = 0, QObject *parent = 0, const char *name = 0, const char *classname = "KParts::Part", const QStringList &args = QStringList()); + virtual KParts::Part *createPartObject(TQWidget *parentWidget = 0, const char *widgetName = 0, TQObject *parent = 0, const char *name = 0, const char *classname = "KParts::Part", const TQStringList &args = TQStringList()); static KInstance *instance(); diff --git a/ksvg/plugin/ksvg_plugin.cpp b/ksvg/plugin/ksvg_plugin.cpp index 37e0a0dd..75699ec7 100644 --- a/ksvg/plugin/ksvg_plugin.cpp +++ b/ksvg/plugin/ksvg_plugin.cpp @@ -42,7 +42,7 @@ #include "SVGDocumentImpl.h" #include "SVGSVGElementImpl.h" -#include <qimage.h> +#include <tqimage.h> using namespace KSVG; @@ -67,21 +67,21 @@ struct KSVGPlugin::Private KToggleAction *progressiveAction; KSelectAction *renderingBackendAction; - QString description; + TQString description; - QPoint panPoint; + TQPoint panPoint; float zoomFactor; SVGDocumentImpl *doc; KSVGCanvas *canvas; - QPixmap *backgroundPixmap; + TQPixmap *backgroundPixmap; KAboutApplication *aboutKSVG; unsigned int width; unsigned int height; }; -KSVGPlugin::KSVGPlugin(QWidget *wparent, const char *, QObject *parent, const char *name, unsigned int width, unsigned int height) : KParts::ReadOnlyPart(parent, name) +KSVGPlugin::KSVGPlugin(TQWidget *wparent, const char *, TQObject *parent, const char *name, unsigned int width, unsigned int height) : KParts::ReadOnlyPart(parent, name) { kdDebug(26003) << "KSVGPlugin::KSVGPlugin" << endl; setInstance(KSVGPluginFactory::instance()); @@ -96,14 +96,14 @@ KSVGPlugin::KSVGPlugin(QWidget *wparent, const char *, QObject *parent, const ch ksvgd->doc = 0; ksvgd->window = new KSVGWidget(this, wparent, "Rendering Widget"); - connect(ksvgd->window, SIGNAL(browseURL(const QString &)), this, SLOT(browseURL(const QString &))); + connect(ksvgd->window, TQT_SIGNAL(browseURL(const TQString &)), this, TQT_SLOT(browseURL(const TQString &))); ksvgd->window->show(); KParts::Part::setWidget(ksvgd->window); ksvgd->extension = new KSVGPluginBrowserExtension(this); - ksvgd->backgroundPixmap = new QPixmap(width > 0 ? width : DEFAULT_WIDTH, height > 0 ? height : DEFAULT_HEIGHT); + ksvgd->backgroundPixmap = new TQPixmap(width > 0 ? width : DEFAULT_WIDTH, height > 0 ? height : DEFAULT_HEIGHT); ksvgd->backgroundPixmap->fill(); ksvgd->canvas = KSVG::CanvasFactory::self()->loadCanvas(width > 0 ? width : DEFAULT_WIDTH, height > 0 ? height : DEFAULT_HEIGHT); @@ -112,28 +112,28 @@ KSVGPlugin::KSVGPlugin(QWidget *wparent, const char *, QObject *parent, const ch ksvgd->canvas->setup(ksvgd->backgroundPixmap, ksvgd->window); - ksvgd->zoomInAction = KStdAction::zoomIn(this, SLOT(slotZoomIn()), actionCollection()); - ksvgd->zoomOutAction = KStdAction::zoomOut(this, SLOT(slotZoomOut()), actionCollection()); - ksvgd->zoomResetAction = new KAction(i18n("Zoom &Reset"), "viewmag", this, SLOT(slotZoomReset()), actionCollection(), "zoom_reset"); - ksvgd->stopAnimationsAction = new KAction(i18n("&Stop Animations"), "stop", Key_Escape, this, SLOT(slotStop()), actionCollection(), "stop_anims"); - ksvgd->viewSourceAction = new KAction(i18n("View &Source"), "document2", Key_F6, this, SLOT(slotViewSource()), actionCollection(), "view_source"); - ksvgd->viewMemoryAction = new KAction(i18n("View &Memory"), "document2", Key_F7, this, SLOT(slotViewMemory()), actionCollection(), "view_memory"); - ksvgd->saveToPNG = new KAction(i18n("Save to PNG..."), "save", 0, this, SLOT(slotSaveToPNG()), actionCollection(), "save_to_png"); -// ksvgd->aboutApp = KStdAction::aboutApp(this, SLOT(slotAboutKSVG()), actionCollection());//, "KSVG"); - ksvgd->aboutApp = new KAction(i18n("About KSVG"), "vectorgfx", 0, this, SLOT(slotAboutKSVG()), actionCollection(), "help_about_app"); - ksvgd->fontKerningAction = new KToggleAction(i18n("Use Font &Kerning"), "viewmagfit", Key_F8, this, SLOT(slotFontKerning()), actionCollection(), "font_kerning"); - ksvgd->progressiveAction = new KToggleAction(i18n("Use &Progressive Rendering"), "", Key_F9, this, SLOT(slotProgressiveRendering()), actionCollection(), "progressive"); + ksvgd->zoomInAction = KStdAction::zoomIn(this, TQT_SLOT(slotZoomIn()), actionCollection()); + ksvgd->zoomOutAction = KStdAction::zoomOut(this, TQT_SLOT(slotZoomOut()), actionCollection()); + ksvgd->zoomResetAction = new KAction(i18n("Zoom &Reset"), "viewmag", this, TQT_SLOT(slotZoomReset()), actionCollection(), "zoom_reset"); + ksvgd->stopAnimationsAction = new KAction(i18n("&Stop Animations"), "stop", Key_Escape, this, TQT_SLOT(slotStop()), actionCollection(), "stop_anims"); + ksvgd->viewSourceAction = new KAction(i18n("View &Source"), "document2", Key_F6, this, TQT_SLOT(slotViewSource()), actionCollection(), "view_source"); + ksvgd->viewMemoryAction = new KAction(i18n("View &Memory"), "document2", Key_F7, this, TQT_SLOT(slotViewMemory()), actionCollection(), "view_memory"); + ksvgd->saveToPNG = new KAction(i18n("Save to PNG..."), "save", 0, this, TQT_SLOT(slotSaveToPNG()), actionCollection(), "save_to_png"); +// ksvgd->aboutApp = KStdAction::aboutApp(this, TQT_SLOT(slotAboutKSVG()), actionCollection());//, "KSVG"); + ksvgd->aboutApp = new KAction(i18n("About KSVG"), "vectorgfx", 0, this, TQT_SLOT(slotAboutKSVG()), actionCollection(), "help_about_app"); + ksvgd->fontKerningAction = new KToggleAction(i18n("Use Font &Kerning"), "viewmagfit", Key_F8, this, TQT_SLOT(slotFontKerning()), actionCollection(), "font_kerning"); + ksvgd->progressiveAction = new KToggleAction(i18n("Use &Progressive Rendering"), "", Key_F9, this, TQT_SLOT(slotProgressiveRendering()), actionCollection(), "progressive"); KSimpleConfig config("ksvgpluginrc", true); config.setGroup("Rendering"); ksvgd->fontKerningAction->setChecked(config.readBoolEntry("FontKerning", true)); ksvgd->progressiveAction->setChecked(config.readBoolEntry("ProgressiveRendering", true)); - ksvgd->renderingBackendAction = new KSelectAction(i18n("Rendering &Backend"), 0, this, SLOT(slotRenderingBackend()), actionCollection(), "rendering_backend"); + ksvgd->renderingBackendAction = new KSelectAction(i18n("Rendering &Backend"), 0, this, TQT_SLOT(slotRenderingBackend()), actionCollection(), "rendering_backend"); - QStringList items; - QPtrList<KSVG::CanvasInfo> canvasList = KSVG::CanvasFactory::self()->canvasList(); - QPtrListIterator<KSVG::CanvasInfo> it(canvasList); + TQStringList items; + TQPtrList<KSVG::CanvasInfo> canvasList = KSVG::CanvasFactory::self()->canvasList(); + TQPtrListIterator<KSVG::CanvasInfo> it(canvasList); KSVG::CanvasInfo *canvasInfo = 0; while((canvasInfo = it.current()) != 0) { @@ -184,7 +184,7 @@ void KSVGPlugin::reset() ksvgd->zoomFactor = 1; ksvgd->window->reset(); - ksvgd->panPoint = QPoint(0, 0); + ksvgd->panPoint = TQPoint(0, 0); } bool KSVGPlugin::openURL(const KURL &url) @@ -204,12 +204,12 @@ bool KSVGPlugin::openURL(const KURL &url) ksvgd->doc->addToDocumentDict(ksvgd->doc->handle(), ksvgd->doc); ksvgd->doc->setReferrer(ksvgd->extension->urlArgs().metaData()["referrer"]); - connect(ksvgd->doc, SIGNAL(finishedParsing(bool, const QString &)), this, SLOT(slotParsingFinished(bool, const QString &))); - connect(ksvgd->doc, SIGNAL(finishedRendering()), this, SLOT(slotRenderingFinished())); - connect(ksvgd->doc, SIGNAL(gotDescription(const QString &)), this, SLOT(slotSetDescription(const QString &))); - connect(ksvgd->doc, SIGNAL(gotTitle(const QString &)), this, SLOT(slotSetTitle(const QString &))); - connect(ksvgd->doc, SIGNAL(gotURL(const QString &)), this, SLOT(slotGotURL(const QString &))); - connect(ksvgd->window, SIGNAL(redraw(const QRect &)), this, SLOT(slotRedraw(const QRect &))); + connect(ksvgd->doc, TQT_SIGNAL(finishedParsing(bool, const TQString &)), this, TQT_SLOT(slotParsingFinished(bool, const TQString &))); + connect(ksvgd->doc, TQT_SIGNAL(finishedRendering()), this, TQT_SLOT(slotRenderingFinished())); + connect(ksvgd->doc, TQT_SIGNAL(gotDescription(const TQString &)), this, TQT_SLOT(slotSetDescription(const TQString &))); + connect(ksvgd->doc, TQT_SIGNAL(gotTitle(const TQString &)), this, TQT_SLOT(slotSetTitle(const TQString &))); + connect(ksvgd->doc, TQT_SIGNAL(gotURL(const TQString &)), this, TQT_SLOT(slotGotURL(const TQString &))); + connect(ksvgd->window, TQT_SIGNAL(redraw(const TQRect &)), this, TQT_SLOT(slotRedraw(const TQRect &))); ksvgd->backgroundPixmap->fill(); bitBlt(ksvgd->window, 0, 0, ksvgd->backgroundPixmap, 0, 0, ksvgd->backgroundPixmap->width(), ksvgd->backgroundPixmap->height()); @@ -225,7 +225,7 @@ bool KSVGPlugin::openURL(const KURL &url) return true; } -void KSVGPlugin::browseURL(const QString &url) +void KSVGPlugin::browseURL(const TQString &url) { ksvgd->doc->rootElement()->pauseAnimations(); KParts::URLArgs args; @@ -233,7 +233,7 @@ void KSVGPlugin::browseURL(const QString &url) emit ksvgd->extension->openURLRequest(KURL(m_url, url), args); } -void KSVGPlugin::slotRedraw(const QRect &r) +void KSVGPlugin::slotRedraw(const TQRect &r) { if(ksvgd->window->width() != ksvgd->backgroundPixmap->width() || ksvgd->window->height() != ksvgd->backgroundPixmap->height()) @@ -316,7 +316,7 @@ void KSVGPlugin::slotStop() ksvgd->doc->rootElement()->pauseAnimations(); } -void KSVGPlugin::slotParsingFinished(bool error, const QString &errorDesc) +void KSVGPlugin::slotParsingFinished(bool error, const TQString &errorDesc) { emit completed(); @@ -356,14 +356,14 @@ void KSVGPlugin::slotSaveToPNG() { if(ksvgd && ksvgd->backgroundPixmap) { - QImage img = ksvgd->backgroundPixmap->convertToImage(); - QString filename = KFileDialog::getSaveFileName(); + TQImage img = ksvgd->backgroundPixmap->convertToImage(); + TQString filename = KFileDialog::getSaveFileName(); if(!filename.isEmpty()) img.save(filename, "PNG"); } } -void KSVGPlugin::setPanPoint(const QPoint &translate) +void KSVGPlugin::setPanPoint(const TQPoint &translate) { ksvgd->panPoint = translate; update(); @@ -391,22 +391,22 @@ void KSVGPlugin::update() ksvgd->doc->canvas()->update(ksvgd->panPoint); // Fixes drawing glitches - slotRedraw(QRect(0, 0, ksvgd->backgroundPixmap->width(), ksvgd->backgroundPixmap->height())); + slotRedraw(TQRect(0, 0, ksvgd->backgroundPixmap->width(), ksvgd->backgroundPixmap->height())); } } -void KSVGPlugin::slotSetDescription(const QString &desc) +void KSVGPlugin::slotSetDescription(const TQString &desc) { ksvgd->description = desc; emit setStatusBarText(i18n("Description: %1").arg(desc)); } -void KSVGPlugin::slotSetTitle(const QString &title) +void KSVGPlugin::slotSetTitle(const TQString &title) { emit setWindowCaption(title); } -void KSVGPlugin::slotGotURL(const QString &text) +void KSVGPlugin::slotGotURL(const TQString &text) { if(text.isNull() && !ksvgd->description.isEmpty()) emit setStatusBarText(i18n("Description: %1").arg(ksvgd->description)); diff --git a/ksvg/plugin/ksvg_plugin.h b/ksvg/plugin/ksvg_plugin.h index 87286be9..669d3661 100644 --- a/ksvg/plugin/ksvg_plugin.h +++ b/ksvg/plugin/ksvg_plugin.h @@ -21,7 +21,7 @@ #ifndef KSVGPlugin_H #define KSVGPlugin_H -#include <qobject.h> +#include <tqobject.h> #include <kparts/part.h> namespace KSVG @@ -36,7 +36,7 @@ class KSVGPlugin : public KParts::ReadOnlyPart { Q_OBJECT public: - KSVGPlugin(QWidget *parentWidget, const char *wname, QObject *parent, const char *name, unsigned int width = 0, unsigned int height = 0); + KSVGPlugin(TQWidget *parentWidget, const char *wname, TQObject *parent, const char *name, unsigned int width = 0, unsigned int height = 0); virtual ~KSVGPlugin(); virtual bool openFile() { return false; } @@ -46,19 +46,19 @@ public: KSVG::SVGDocumentImpl *docImpl(); void reset(); - void setPanPoint(const QPoint &translate); + void setPanPoint(const TQPoint &translate); void update(); void setPopupActive(bool); signals: - void gotHyperlink(const QString &); - void gotHyperlinkCoordinate(const QRect &); + void gotHyperlink(const TQString &); + void gotHyperlinkCoordinate(const TQRect &); public slots: - void slotRedraw(const QRect &); + void slotRedraw(const TQRect &); private slots: - void browseURL(const QString &url); + void browseURL(const TQString &url); void slotStop(); void slotViewSource(); void slotViewMemory(); @@ -71,11 +71,11 @@ private slots: void slotAboutKSVG(); void slotSaveToPNG(); - void slotParsingFinished(bool error, const QString &errorDesc); + void slotParsingFinished(bool error, const TQString &errorDesc); void slotRenderingFinished(); - void slotSetDescription(const QString &); - void slotSetTitle(const QString &); - void slotGotURL(const QString &); + void slotSetDescription(const TQString &); + void slotSetTitle(const TQString &); + void slotGotURL(const TQString &); private: class Private; diff --git a/ksvg/plugin/ksvg_widget.cpp b/ksvg/plugin/ksvg_widget.cpp index 073e60a5..0f1b9d3e 100644 --- a/ksvg/plugin/ksvg_widget.cpp +++ b/ksvg/plugin/ksvg_widget.cpp @@ -27,8 +27,8 @@ #include "SVGDocumentImpl.h" #include "SVGSVGElementImpl.h" -KSVGWidget::KSVGWidget(KSVGPlugin *part, QWidget *parent, const char *name) -: QWidget(parent, name), m_part(part) +KSVGWidget::KSVGWidget(KSVGPlugin *part, TQWidget *parent, const char *name) +: TQWidget(parent, name), m_part(part) { setMouseTracking(true); setFocusPolicy(WheelFocus); @@ -55,12 +55,12 @@ void KSVGWidget::reset() m_panningPos.setY(0); } -void KSVGWidget::paintEvent(QPaintEvent *e) +void KSVGWidget::paintEvent(TQPaintEvent *e) { emit redraw(e->rect()); } -KSVG::SVGMouseEventImpl *KSVGWidget::newMouseEvent(KSVG::SVGEvent::EventId id, QMouseEvent *event) +KSVG::SVGMouseEventImpl *KSVGWidget::newMouseEvent(KSVG::SVGEvent::EventId id, TQMouseEvent *event) { DOM::AbstractView temp; @@ -102,9 +102,9 @@ KSVG::SVGMouseEventImpl *KSVGWidget::newMouseEvent(KSVG::SVGEvent::EventId id, Q return mev; } -void KSVGWidget::mouseMoveEvent(QMouseEvent *event) +void KSVGWidget::mouseMoveEvent(TQMouseEvent *event) { - if(event->state() & QMouseEvent::ControlButton && event->state() & QMouseEvent::LeftButton) + if(event->state() & TQMouseEvent::ControlButton && event->state() & TQMouseEvent::LeftButton) { if(m_panningPos.isNull()) m_panningPos = event->pos(); @@ -113,7 +113,7 @@ void KSVGWidget::mouseMoveEvent(QMouseEvent *event) return; } - else if(event->state() & QMouseEvent::ControlButton) + else if(event->state() & TQMouseEvent::ControlButton) return; KSVG::SVGMouseEventImpl *mev = newMouseEvent(KSVG::SVGEvent::MOUSEMOVE_EVENT, event); @@ -181,16 +181,16 @@ void KSVGWidget::mouseMoveEvent(QMouseEvent *event) mev->deref(); } -void KSVGWidget::mousePressEvent(QMouseEvent *event) +void KSVGWidget::mousePressEvent(TQMouseEvent *event) { - if(event->state() & QMouseEvent::ControlButton) + if(event->state() & TQMouseEvent::ControlButton) return; if(event->button() == RightButton) { if(part() && part()->factory()) { - QPopupMenu *popup = static_cast<QPopupMenu *>(part()->factory()->container("popupmenu", part())); + TQPopupMenu *popup = static_cast<TQPopupMenu *>(part()->factory()->container("popupmenu", part())); if(popup) popup->popup(event->globalPos()); } @@ -204,7 +204,7 @@ void KSVGWidget::mousePressEvent(QMouseEvent *event) mev->deref(); } -void KSVGWidget::mouseReleaseEvent(QMouseEvent *event) +void KSVGWidget::mouseReleaseEvent(TQMouseEvent *event) { if(!m_panningPos.isNull()) { @@ -213,7 +213,7 @@ void KSVGWidget::mouseReleaseEvent(QMouseEvent *event) m_panningPos.setY(0); } - if(event->state() & QMouseEvent::ControlButton) + if(event->state() & TQMouseEvent::ControlButton) return; KSVG::SVGMouseEventImpl *mev = newMouseEvent(KSVG::SVGEvent::MOUSEUP_EVENT, event); @@ -223,7 +223,7 @@ void KSVGWidget::mouseReleaseEvent(QMouseEvent *event) if(!mev->url().string().isEmpty()) { - QString url = mev->url().string(); + TQString url = mev->url().string(); if(url.startsWith("#")) url.prepend(part()->docImpl()->baseUrl().prettyURL()); emit browseURL(url); @@ -232,9 +232,9 @@ void KSVGWidget::mouseReleaseEvent(QMouseEvent *event) mev->deref(); } -void KSVGWidget::keyPressEvent(QKeyEvent *ke) +void KSVGWidget::keyPressEvent(TQKeyEvent *ke) { - if(ke->stateAfter() & QMouseEvent::ControlButton) + if(ke->stateAfter() & TQMouseEvent::ControlButton) { setCursor(KCursor::sizeAllCursor()); return; @@ -244,9 +244,9 @@ void KSVGWidget::keyPressEvent(QKeyEvent *ke) part()->docImpl()->lastTarget()->dispatchKeyEvent(ke); } -void KSVGWidget::keyReleaseEvent(QKeyEvent *ke) +void KSVGWidget::keyReleaseEvent(TQKeyEvent *ke) { - if(ke->state() & QMouseEvent::ControlButton) + if(ke->state() & TQMouseEvent::ControlButton) { setCursor(KCursor::arrowCursor()); return; @@ -256,12 +256,12 @@ void KSVGWidget::keyReleaseEvent(QKeyEvent *ke) part()->docImpl()->lastTarget()->dispatchKeyEvent(ke); } -void KSVGWidget::resizeEvent(QResizeEvent *e) +void KSVGWidget::resizeEvent(TQResizeEvent *e) { if(part()->docImpl() && part()->docImpl()->rootElement()) part()->docImpl()->rootElement()->dispatchEvent(KSVG::SVGEvent::RESIZE_EVENT, true, false); - emit redraw(QRect(0, 0, e->size().width(), e->size().height())); + emit redraw(TQRect(0, 0, e->size().width(), e->size().height())); } // vim:ts=4:noet diff --git a/ksvg/plugin/ksvg_widget.h b/ksvg/plugin/ksvg_widget.h index 3cd94849..c25fddbc 100644 --- a/ksvg/plugin/ksvg_widget.h +++ b/ksvg/plugin/ksvg_widget.h @@ -21,7 +21,7 @@ #ifndef KSVGWidget_H #define KSVGWidget_H -#include <qwidget.h> +#include <tqwidget.h> #include <kpopupmenu.h> @@ -32,7 +32,7 @@ class KSVGWidget : public QWidget { Q_OBJECT public: - KSVGWidget(KSVGPlugin *part, QWidget *parent, const char *name); + KSVGWidget(KSVGPlugin *part, TQWidget *parent, const char *name); virtual ~KSVGWidget(); KSVGPlugin *part() const; @@ -40,26 +40,26 @@ public: void reset(); protected: - virtual void paintEvent(QPaintEvent *); + virtual void paintEvent(TQPaintEvent *); - virtual void mouseMoveEvent(QMouseEvent *); - virtual void mousePressEvent(QMouseEvent *); - virtual void mouseReleaseEvent(QMouseEvent *); + virtual void mouseMoveEvent(TQMouseEvent *); + virtual void mousePressEvent(TQMouseEvent *); + virtual void mouseReleaseEvent(TQMouseEvent *); - virtual void keyPressEvent(QKeyEvent *); - virtual void keyReleaseEvent(QKeyEvent *); + virtual void keyPressEvent(TQKeyEvent *); + virtual void keyReleaseEvent(TQKeyEvent *); - virtual void resizeEvent(QResizeEvent *); + virtual void resizeEvent(TQResizeEvent *); signals: - void browseURL(const QString &); - void redraw(const QRect &); + void browseURL(const TQString &); + void redraw(const TQRect &); private: - KSVG::SVGMouseEventImpl *newMouseEvent(KSVG::SVGEvent::EventId id, QMouseEvent *event); + KSVG::SVGMouseEventImpl *newMouseEvent(KSVG::SVGEvent::EventId id, TQMouseEvent *event); - QPoint m_panningPos; - QPoint m_oldPanningPos; + TQPoint m_panningPos; + TQPoint m_oldPanningPos; KSVGPlugin *m_part; }; diff --git a/ksvg/plugin/svgcreator.cpp b/ksvg/plugin/svgcreator.cpp index c6689c9a..dc20e06f 100644 --- a/ksvg/plugin/svgcreator.cpp +++ b/ksvg/plugin/svgcreator.cpp @@ -21,8 +21,8 @@ #include <time.h> -#include <qpixmap.h> -#include <qimage.h> +#include <tqpixmap.h> +#include <tqimage.h> #include "KSVGCanvas.h" #include "CanvasFactory.h" @@ -50,19 +50,19 @@ SVGCreator::~SVGCreator() { } -bool SVGCreator::create(const QString &path, int width, int height, QImage &img) +bool SVGCreator::create(const TQString &path, int width, int height, TQImage &img) { KSVG::SVGDocumentImpl *doc = new KSVG::SVGDocumentImpl(false, true); doc->ref(); - QPixmap pix(width, height); + TQPixmap pix(width, height); pix.fill(Qt::white); KSVG::KSVGCanvas *c = KSVG::CanvasFactory::self()->loadCanvas(width, height); c->setup(&pix, &pix); doc->attach(c); - connect(doc, SIGNAL(finishedRendering()), SLOT(slotFinished())); + connect(doc, TQT_SIGNAL(finishedRendering()), TQT_SLOT(slotFinished())); doc->open( KURL::fromPathOrURL(path)); m_finished = false; diff --git a/ksvg/plugin/svgcreator.h b/ksvg/plugin/svgcreator.h index ad1b8f30..403f0a78 100644 --- a/ksvg/plugin/svgcreator.h +++ b/ksvg/plugin/svgcreator.h @@ -24,13 +24,13 @@ #include <kio/thumbcreator.h> -class SVGCreator : public QObject, public ThumbCreator +class SVGCreator : public TQObject, public ThumbCreator { Q_OBJECT public: SVGCreator(); virtual ~SVGCreator(); - virtual bool create(const QString &path, int width, int height, QImage &img); + virtual bool create(const TQString &path, int width, int height, TQImage &img); virtual Flags flags() const; private slots: |