summaryrefslogtreecommitdiffstats
path: root/ksvg/core
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-02 19:23:46 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-08-02 19:23:46 +0000
commiteba47f8f0637f451e21348187591e1f1fd58ac74 (patch)
tree448f10b95c656604acc331a3236c1e59bde5c1ad /ksvg/core
parentc7e8736c69373f48b0401319757c742e8607431a (diff)
downloadtdegraphics-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/core')
-rw-r--r--ksvg/core/CanvasFactory.cpp32
-rw-r--r--ksvg/core/CanvasFactory.h12
-rw-r--r--ksvg/core/CanvasItem.h18
-rw-r--r--ksvg/core/CanvasItems.cpp26
-rw-r--r--ksvg/core/CanvasItems.h6
-rw-r--r--ksvg/core/DocumentFactory.cpp8
-rw-r--r--ksvg/core/DocumentFactory.h4
-rw-r--r--ksvg/core/KSVGCanvas.cpp102
-rw-r--r--ksvg/core/KSVGCanvas.h54
-rw-r--r--ksvg/core/KSVGHelper.h14
-rw-r--r--ksvg/core/KSVGLoader.cpp112
-rw-r--r--ksvg/core/KSVGLoader.h20
-rw-r--r--ksvg/core/KSVGReader.cc82
-rw-r--r--ksvg/core/KSVGReader.h14
-rw-r--r--ksvg/core/KSVGTextChunk.cpp4
-rw-r--r--ksvg/core/KSVGTextChunk.h10
16 files changed, 259 insertions, 259 deletions
diff --git a/ksvg/core/CanvasFactory.cpp b/ksvg/core/CanvasFactory.cpp
index ca2822b2..e03bf9ea 100644
--- a/ksvg/core/CanvasFactory.cpp
+++ b/ksvg/core/CanvasFactory.cpp
@@ -18,7 +18,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <qfile.h>
+#include <tqfile.h>
#include <kdebug.h>
#include <ksimpleconfig.h>
@@ -57,14 +57,14 @@ void CanvasFactory::queryCanvas()
{
m_canvasList.clear();
- QValueList<KService::Ptr> traderList = KTrader::self()->query("KSVG/Renderer", "(Type == 'Service')");
+ TQValueList<KService::Ptr> traderList = KTrader::self()->query("KSVG/Renderer", "(Type == 'Service')");
KTrader::OfferList::Iterator it(traderList.begin());
for( ; it != traderList.end(); ++it)
{
KService::Ptr ptr = (*it);
- QString name = ptr->property("Name").toString();
- QString internal = ptr->property("X-KSVG-InternalName").toString();
+ TQString name = ptr->property("Name").toString();
+ TQString internal = ptr->property("X-KSVG-InternalName").toString();
if(name.isEmpty() || internal.isEmpty())
continue;
@@ -90,20 +90,20 @@ KSVGCanvas *CanvasFactory::loadCanvas(int width, int height)
KSimpleConfig *config = new KSimpleConfig("ksvgpluginrc", false);
config->setGroup("Canvas");
- QString load = config->readEntry("ActiveCanvas", "libart");
+ TQString load = config->readEntry("ActiveCanvas", "libart");
delete config;
- QPtrListIterator<CanvasInfo> it(m_canvasList);
+ TQPtrListIterator<CanvasInfo> it(m_canvasList);
CanvasInfo *info = it.current();
while((info = it.current()) != 0)
{
if(info->internal == load)
{
- QStringList args;
- args.prepend(QString::number(width));
- args.prepend(QString::number(height));
+ TQStringList args;
+ args.prepend(TQString::number(width));
+ args.prepend(TQString::number(height));
- info->canvas = KParts::ComponentFactory::createInstanceFromLibrary<KSVGCanvas>(QFile::encodeName(info->service->library()), 0, 0, args);
+ info->canvas = KParts::ComponentFactory::createInstanceFromLibrary<KSVGCanvas>(TQFile::encodeName(info->service->library()), 0, 0, args);
if(info->canvas)
return info->canvas;
@@ -122,7 +122,7 @@ KSVGCanvas *CanvasFactory::loadCanvas(int width, int height)
int CanvasFactory::itemInList(KSVGCanvas *canvas)
{
- QPtrListIterator<CanvasInfo> it(m_canvasList);
+ TQPtrListIterator<CanvasInfo> it(m_canvasList);
CanvasInfo *info = it.current();
unsigned int i = 0;
while((info = it.current()) != 0)
@@ -137,9 +137,9 @@ int CanvasFactory::itemInList(KSVGCanvas *canvas)
return 0;
}
-QString CanvasFactory::internalNameFor(const QString &name)
+TQString CanvasFactory::internalNameFor(const TQString &name)
{
- QPtrListIterator<CanvasInfo> it(m_canvasList);
+ TQPtrListIterator<CanvasInfo> it(m_canvasList);
CanvasInfo *info = it.current();
while((info = it.current()) != 0)
{
@@ -149,12 +149,12 @@ QString CanvasFactory::internalNameFor(const QString &name)
++it;
}
- return QString::null;
+ return TQString::null;
}
void CanvasFactory::deleteCanvas(KSVGCanvas *canvas)
{
- QPtrListIterator<CanvasInfo> it(m_canvasList);
+ TQPtrListIterator<CanvasInfo> it(m_canvasList);
CanvasInfo *info = it.current();
while((info = it.current()) != 0)
{
@@ -168,7 +168,7 @@ void CanvasFactory::deleteCanvas(KSVGCanvas *canvas)
}
}
-QPtrList<CanvasInfo> CanvasFactory::canvasList()
+TQPtrList<CanvasInfo> CanvasFactory::canvasList()
{
return m_canvasList;
}
diff --git a/ksvg/core/CanvasFactory.h b/ksvg/core/CanvasFactory.h
index dc272700..24c59ba6 100644
--- a/ksvg/core/CanvasFactory.h
+++ b/ksvg/core/CanvasFactory.h
@@ -23,8 +23,8 @@
#include <ktrader.h>
-#include <qstring.h>
-#include <qptrlist.h>
+#include <tqstring.h>
+#include <tqptrlist.h>
namespace KSVG
{
@@ -35,7 +35,7 @@ class CanvasInfo
public:
KService::Ptr service;
KSVGCanvas *canvas;
- QString name, internal;
+ TQString name, internal;
};
class CanvasFactory
@@ -50,16 +50,16 @@ public:
KSVGCanvas *loadCanvas(int width, int height);
int itemInList(KSVGCanvas *canvas);
- QString internalNameFor(const QString &name);
+ TQString internalNameFor(const TQString &name);
void deleteCanvas(KSVGCanvas *canvas);
- QPtrList<CanvasInfo> canvasList();
+ TQPtrList<CanvasInfo> canvasList();
private:
void queryCanvas();
static CanvasFactory *s_factory;
- QPtrList<CanvasInfo> m_canvasList;
+ TQPtrList<CanvasInfo> m_canvasList;
};
}
diff --git a/ksvg/core/CanvasItem.h b/ksvg/core/CanvasItem.h
index 7ffc7ad9..1c6b1e34 100644
--- a/ksvg/core/CanvasItem.h
+++ b/ksvg/core/CanvasItem.h
@@ -21,9 +21,9 @@
#ifndef CANVASITEM_H
#define CANVASITEM_H
-#include <qrect.h>
-#include <qpoint.h>
-#include <qvaluelist.h>
+#include <tqrect.h>
+#include <tqpoint.h>
+#include <tqvaluelist.h>
#define CHUNK_SIZE_HORIZONTAL 32
#define CHUNK_SIZE_VERTICAL 32
@@ -60,9 +60,9 @@ public:
CanvasItem() { m_zIndex = 0; m_referenced = false; }
virtual ~CanvasItem() { }
- virtual QRect bbox() const = 0;
- virtual bool fillContains(const QPoint &) = 0;
- virtual bool strokeContains(const QPoint &) = 0;
+ virtual TQRect bbox() const = 0;
+ virtual bool fillContains(const TQPoint &) = 0;
+ virtual bool strokeContains(const TQPoint &) = 0;
virtual void update(CanvasItemUpdate reason, int param1 = 0, int param2 = 0) = 0;
virtual void draw() = 0;
virtual bool isVisible() = 0;
@@ -114,10 +114,10 @@ private:
CanvasItem *ptr;
};
-class CanvasItemList : public QValueList<CanvasItem *>
+class CanvasItemList : public TQValueList<CanvasItem *>
{
public:
- void sort() { qHeapSort(*((QValueList<CanvasItemPtr> *) this)); }
+ void sort() { qHeapSort(*((TQValueList<CanvasItemPtr> *) this)); }
};
class CanvasChunk
@@ -138,7 +138,7 @@ public:
short x() const { return m_x; }
short y() const { return m_y; }
- QRect bbox() const { return QRect(m_x * CHUNK_SIZE_HORIZONTAL, m_y * CHUNK_SIZE_VERTICAL, CHUNK_SIZE_HORIZONTAL, CHUNK_SIZE_VERTICAL); }
+ TQRect bbox() const { return TQRect(m_x * CHUNK_SIZE_HORIZONTAL, m_y * CHUNK_SIZE_VERTICAL, CHUNK_SIZE_HORIZONTAL, CHUNK_SIZE_VERTICAL); }
private:
CanvasItemList m_list;
diff --git a/ksvg/core/CanvasItems.cpp b/ksvg/core/CanvasItems.cpp
index 0ffd017c..333f4608 100644
--- a/ksvg/core/CanvasItems.cpp
+++ b/ksvg/core/CanvasItems.cpp
@@ -104,7 +104,7 @@ void CanvasText::handleTSpan(KSVGCanvas *canvas, const SVGMatrixImpl *screenCTM,
usey = int(tspan->y()->baseVal()->getItem(0)->value());
}
- QString text = tspan->text();
+ TQString text = tspan->text();
if(!text.isEmpty())
{
T2P::GlyphLayoutParams *params = tspan->layoutParams();
@@ -118,7 +118,7 @@ void CanvasText::handleTSpan(KSVGCanvas *canvas, const SVGMatrixImpl *screenCTM,
if(bMultipleY && i < tspan->y()->baseVal()->numberOfItems())
usey = int(tspan->y()->baseVal()->getItem(i)->value());
- textChunk->addText(QString(text.at(i)), tspan);
+ textChunk->addText(TQString(text.at(i)), tspan);
createGlyphs(textChunk, canvas, screenCTM, usex, usey, endx, endy, bpath);
textChunk->clear();
@@ -159,7 +159,7 @@ void CanvasText::handleTSpan(KSVGCanvas *canvas, const SVGMatrixImpl *screenCTM,
if(tspanFound)
{
DOM::Text text = node;
- QString temp = text.data().string();
+ TQString temp = text.data().string();
textChunk->addText(temp, tspan);
}
}
@@ -199,13 +199,13 @@ KSVGTextChunk *CanvasText::createTextChunk(KSVGCanvas *canvas, const SVGMatrixIm
if(node.nodeType() == DOM::Node::TEXT_NODE)
{
DOM::Text text = node;
- QString temp = text.data().string();
+ TQString temp = text.data().string();
if(!temp.isEmpty())
{
if(m_text->getTextDirection() != LTR)
{
- QString convert = temp;
+ TQString convert = temp;
for(int i = temp.length(); i > 0; i--)
convert[temp.length() - i] = temp[i - 1];
@@ -229,7 +229,7 @@ KSVGTextChunk *CanvasText::createTextChunk(KSVGCanvas *canvas, const SVGMatrixIm
}
SVGTextPathElementImpl *tpath = dynamic_cast<SVGTextPathElementImpl *>(element);
- QString target = SVGURIReferenceImpl::getTarget(tpath->href()->baseVal().string());
+ TQString target = SVGURIReferenceImpl::getTarget(tpath->href()->baseVal().string());
SVGPathElementImpl *path = dynamic_cast<SVGPathElementImpl *>(tpath->ownerSVGElement()->getElementById(target));
T2P::BezierPath *bpath = 0;
@@ -242,7 +242,7 @@ KSVGTextChunk *CanvasText::createTextChunk(KSVGCanvas *canvas, const SVGMatrixIm
if(iterate.nodeType() == DOM::Node::TEXT_NODE)
{
DOM::Text text = iterate;
- QString temp = text.data().string();
+ TQString temp = text.data().string();
if(!temp.isEmpty())
textChunk->addText(temp, tpath);
@@ -287,7 +287,7 @@ KSVGTextChunk *CanvasText::createTextChunk(KSVGCanvas *canvas, const SVGMatrixIm
void CanvasText::createGlyphs(KSVGTextChunk *textChunk, KSVGCanvas *canvas, const SVGMatrixImpl *screenCTM, int curx, int cury, int &endx, int &endy, T2P::BezierPath *bpath) const
{
double _curx = double(curx);
- QMemArray<double> _cury(1);
+ TQMemArray<double> _cury(1);
_cury[0] = double(cury);
T2P::GlyphLayoutParams *params = m_text->layoutParams();
@@ -296,8 +296,8 @@ void CanvasText::createGlyphs(KSVGTextChunk *textChunk, KSVGCanvas *canvas, cons
SVGTextContentElementImpl *tc0 = tc;
T2P::SharedFont font;
- QString text;
- QPtrList<T2P::GlyphSet> glyphs;
+ TQString text;
+ TQPtrList<T2P::GlyphSet> glyphs;
glyphs.setAutoDelete(true);
double pathAdvance = 0;
@@ -323,7 +323,7 @@ void CanvasText::createGlyphs(KSVGTextChunk *textChunk, KSVGCanvas *canvas, cons
text = textChunk->getText(i);
if(i != textChunk->count() - 1)
- text += QChar(' ');
+ text += TQChar(' ');
if(!canvas->fontContext()->ready())
canvas->fontContext()->init();
@@ -380,7 +380,7 @@ void CanvasText::createGlyphs(KSVGTextChunk *textChunk, KSVGCanvas *canvas, cons
params->setTextPathStartOffset(pathAdvance);
if(tp && tp->dy()->baseVal()->numberOfItems() > 0)
pathDy += tp->dy()->baseVal()->getItem(0)->value();
- QString shift = QString("%1%%").arg((pathDy / font->fontParams()->size()) * -100.0);
+ TQString shift = TQString("%1%%").arg((pathDy / font->fontParams()->size()) * -100.0);
params->setBaselineShift(shift.latin1());
}
@@ -484,7 +484,7 @@ void CanvasText::createGlyphs(KSVGTextChunk *textChunk, KSVGCanvas *canvas, cons
// #####
-void MarkerHelper::doMarker(SVGShapeImpl *shape, SVGStylableImpl *style, double x, double y, double angle, const QString &markerId)
+void MarkerHelper::doMarker(SVGShapeImpl *shape, SVGStylableImpl *style, double x, double y, double angle, const TQString &markerId)
{
SVGMarkerElementImpl *marker = dynamic_cast<SVGMarkerElementImpl *>(shape->ownerSVGElement()->getElementById(markerId));
if(marker)
diff --git a/ksvg/core/CanvasItems.h b/ksvg/core/CanvasItems.h
index 8959d6ba..9f5eed43 100644
--- a/ksvg/core/CanvasItems.h
+++ b/ksvg/core/CanvasItems.h
@@ -21,7 +21,7 @@
#ifndef CANVASITEMS_H
#define CANVASITEMS_H
-#include <qptrlist.h>
+#include <tqptrlist.h>
#include "CanvasItem.h"
#include "SVGTextElementImpl.h"
#include "SVGTextPathElementImpl.h"
@@ -85,7 +85,7 @@ protected:
void doEndMarker(SVGShapeImpl *shape, SVGStylableImpl *style, double x, double y, double angle = 0.0);
private:
- void doMarker(SVGShapeImpl *shape, SVGStylableImpl *style, double x, double y, double angle, const QString &marker);
+ void doMarker(SVGShapeImpl *shape, SVGStylableImpl *style, double x, double y, double angle, const TQString &marker);
};
class CanvasText : public CanvasItem
@@ -120,7 +120,7 @@ public:
bool finalized() { return m_finalized; }
virtual void finalizePaintServer() = 0;
- virtual void reference(const QString &href) = 0;
+ virtual void reference(const TQString &href) = 0;
private:
bool m_finalized;
diff --git a/ksvg/core/DocumentFactory.cpp b/ksvg/core/DocumentFactory.cpp
index bcc0ddcb..4ae743be 100644
--- a/ksvg/core/DocumentFactory.cpp
+++ b/ksvg/core/DocumentFactory.cpp
@@ -18,7 +18,7 @@
Boston, MA 02110-1301, USA.
*/
-#include <qobject.h>
+#include <tqobject.h>
#include <kdebug.h>
#include <kstaticdeleter.h>
@@ -42,7 +42,7 @@ namespace KSVG
SVGDocumentImpl *doc() const { return m_docs.current(); }
private:
- QPtrList<SVGDocumentImpl> m_docs;
+ TQPtrList<SVGDocumentImpl> m_docs;
};
}
@@ -65,10 +65,10 @@ DocumentFactory *DocumentFactory::self()
return s_factory;
}
-SVGDocument *DocumentFactory::requestDocument(QObject *notifyObject, const char *notifySlot) const
+SVGDocument *DocumentFactory::requestDocument(TQObject *notifyObject, const char *notifySlot) const
{
SVGDocumentImpl *impl = requestDocumentImpl(false);
- QObject::connect(impl, SIGNAL(finishedParsing(bool, const QString &)), notifyObject, notifySlot);
+ TQObject::connect(impl, TQT_SIGNAL(finishedParsing(bool, const TQString &)), notifyObject, notifySlot);
return new SVGDocument(impl);
}
diff --git a/ksvg/core/DocumentFactory.h b/ksvg/core/DocumentFactory.h
index 290d54ac..6225b37d 100644
--- a/ksvg/core/DocumentFactory.h
+++ b/ksvg/core/DocumentFactory.h
@@ -22,7 +22,7 @@
#define DocumentFactory_H
#include <kurl.h>
-#include <qobject.h>
+#include <tqobject.h>
namespace KSVG
{
@@ -39,7 +39,7 @@ public:
static DocumentFactory *self();
// Creates a document and connects the parsingFinished() signal to the notifySlot...
- SVGDocument *requestDocument(QObject *notifyObject, const char *notifySlot) const;
+ SVGDocument *requestDocument(TQObject *notifyObject, const char *notifySlot) const;
// Loads 'url' and emits parsingFinisihed() signal, when done
bool startParsing(SVGDocument *document, const KURL &url);
diff --git a/ksvg/core/KSVGCanvas.cpp b/ksvg/core/KSVGCanvas.cpp
index d4e75d79..1f504c02 100644
--- a/ksvg/core/KSVGCanvas.cpp
+++ b/ksvg/core/KSVGCanvas.cpp
@@ -32,10 +32,10 @@
#include <kdebug.h>
#include <kglobal.h>
-#include <qstring.h>
-#include <qdatetime.h>
-#include <qpaintdevicemetrics.h>
-#include <qwmatrix.h>
+#include <tqstring.h>
+#include <tqdatetime.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqwmatrix.h>
#include <X11/Xlib.h>
@@ -63,12 +63,12 @@ KSVGCanvas::KSVGCanvas(unsigned int width, unsigned int height) : m_viewportWidt
m_buffer = 0;
- m_backgroundColor = QColor(250, 250, 250);
+ m_backgroundColor = TQColor(250, 250, 250);
m_immediateUpdate = false;
}
-void KSVGCanvas::setup(QPaintDevice *drawWindow, QPaintDevice *directWindow)
+void KSVGCanvas::setup(TQPaintDevice *drawWindow, TQPaintDevice *directWindow)
{
m_drawWindow = drawWindow;
m_directWindow = directWindow;
@@ -151,10 +151,10 @@ void KSVGCanvas::resize(unsigned int w, unsigned int h)
int diffw = w - m_width;
int diffh = h - m_height;
- QRect r(m_width, 0, diffw, m_height + diffh);
- QRect r3(0, m_height, m_width + diffw, diffh);
+ TQRect r(m_width, 0, diffw, m_height + diffh);
+ TQRect r3(0, m_height, m_width + diffw, diffh);
- QWMatrix mtx;
+ TQWMatrix mtx;
mtx.translate(m_pan.x(), m_pan.y());
mtx.scale(m_zoom, m_zoom);
@@ -169,7 +169,7 @@ void KSVGCanvas::resize(unsigned int w, unsigned int h)
CanvasItemList drawables;
if(diffw > 0)
{
- QRect r2 = mtx.invert().map(r);
+ TQRect r2 = mtx.invert().map(r);
// Recalc items
for(int j = r2.top() / int(m_chunkSizeVer); j <= r2.bottom() / int(m_chunkSizeVer); j++)
@@ -191,7 +191,7 @@ void KSVGCanvas::resize(unsigned int w, unsigned int h)
if(diffh > 0)
{
- QRect r4 = mtx.invert().map(r3);
+ TQRect r4 = mtx.invert().map(r3);
// Recalc items
for(int j = r4.top() / int(m_chunkSizeVer); j <= r4.bottom() / int(m_chunkSizeVer); j++)
@@ -234,7 +234,7 @@ void KSVGCanvas::setRenderBufferSize(int w, int h)
if(needsRedraw)
{
- QPaintDeviceMetrics metrics(m_drawWindow);
+ TQPaintDeviceMetrics metrics(m_drawWindow);
m_width = kMin(int(w), metrics.width());
m_height = kMin(int(h), metrics.height());
@@ -248,9 +248,9 @@ void KSVGCanvas::setRenderBufferSize(int w, int h)
fill();
}
-void KSVGCanvas::clear(const QRect &r)
+void KSVGCanvas::clear(const TQRect &r)
{
- QRect r2 = r & QRect(0, 0, m_width, m_height);
+ TQRect r2 = r & TQRect(0, 0, m_width, m_height);
if(!r2.isEmpty() && m_buffer)
{
for(int i = 0; i < r2.height(); i++)
@@ -322,7 +322,7 @@ T2P::FontVisualParams *KSVGCanvas::fontVisualParams(SVGStylableImpl *style) cons
// Calc weight & slant
int weight = 0, slant = 0;
EFontStyle fontStyle = style->getFontStyle();
- QString fontWeight = style->getFontWeight();
+ TQString fontWeight = style->getFontWeight();
if(fontWeight.contains("bold"))
weight |= FC_WEIGHT_DEMIBOLD;
@@ -372,7 +372,7 @@ void KSVGCanvas::invalidate(CanvasItem *item, bool recalc)
addToChunks(item);
}
- QPtrListIterator<CanvasChunk> it = m_chunksByItem[item];
+ TQPtrListIterator<CanvasChunk> it = m_chunksByItem[item];
for(it.toFirst(); it.current(); ++it)
{
(*it)->setDirty();
@@ -389,7 +389,7 @@ void KSVGCanvas::insert(CanvasItem *item, int z)
if(z == -1)
{
item->setZIndex(m_chunksByItem.size());
- m_chunksByItem[item] = QPtrList<CanvasChunk>();
+ m_chunksByItem[item] = TQPtrList<CanvasChunk>();
addToChunks(item);
m_items.append(item);
@@ -402,7 +402,7 @@ void KSVGCanvas::insert(CanvasItem *item, int z)
if(visible)
{
item->draw();
- QRect bbox = item->bbox();
+ TQRect bbox = item->bbox();
blit(bbox, true);
}
}
@@ -425,7 +425,7 @@ void KSVGCanvas::removeItem(CanvasItem *item)
void KSVGCanvas::removeFromChunks(CanvasItem *item)
{
- QPtrListIterator<CanvasChunk> it = m_chunksByItem[item];
+ TQPtrListIterator<CanvasChunk> it = m_chunksByItem[item];
for(it.toFirst(); it.current(); ++it)
{
(*it)->remove(item);
@@ -437,8 +437,8 @@ void KSVGCanvas::removeFromChunks(CanvasItem *item)
void KSVGCanvas::addToChunks(CanvasItem *item)
{
- QRect bbox = item->bbox();
- QWMatrix mtx;
+ TQRect bbox = item->bbox();
+ TQWMatrix mtx;
mtx.translate(m_pan.x(), m_pan.y());
mtx.scale(m_zoom, m_zoom);
@@ -498,10 +498,10 @@ unsigned int KSVGCanvas::setElementItemZIndexRecursive(SVGElementImpl *element,
return z;
}
-void KSVGCanvas::update(const QPoint &panPoint, bool erase)
+void KSVGCanvas::update(const TQPoint &panPoint, bool erase)
{
#ifdef USE_TIMER
- QTime t;
+ TQTime t;
t.start();
#endif
@@ -513,16 +513,16 @@ void KSVGCanvas::update(const QPoint &panPoint, bool erase)
fill();
// reset clip paths
- QDictIterator<CanvasClipPath> itr(m_clipPaths);
+ TQDictIterator<CanvasClipPath> itr(m_clipPaths);
for(; itr.current(); ++itr)
(*itr)->update(UPDATE_TRANSFORM);
- QWMatrix mtx;
+ TQWMatrix mtx;
mtx.translate(m_pan.x(), m_pan.y());
mtx.scale(m_zoom, m_zoom);
- QRect r(0, 0, m_width, m_height);
- QRect r2 = mtx.invert().map(r);
+ TQRect r(0, 0, m_width, m_height);
+ TQRect r2 = mtx.invert().map(r);
// pan all items
for(unsigned int i = 0; i < m_items.count(); i++)
@@ -530,7 +530,7 @@ void KSVGCanvas::update(const QPoint &panPoint, bool erase)
// recalc items
CanvasItemList drawables;
- QPtrListIterator<CanvasItem> it = m_items;
+ TQPtrListIterator<CanvasItem> it = m_items;
for(int j = r2.top() / m_chunkSizeVer; j <= (r2.bottom() / m_chunkSizeVer); j++)
{
for(int i = r2.left() / m_chunkSizeHor; i <= (r2.right() / m_chunkSizeHor); i++)
@@ -552,7 +552,7 @@ void KSVGCanvas::update(const QPoint &panPoint, bool erase)
(*it)->draw();
if(m_drawWindow)
- blit(QRect(0, 0, m_width, m_height), false);
+ blit(TQRect(0, 0, m_width, m_height), false);
m_dirtyChunks.clear();
@@ -564,7 +564,7 @@ void KSVGCanvas::update(const QPoint &panPoint, bool erase)
void KSVGCanvas::update(float zoomFactor)
{
#ifdef USE_TIMER
- QTime t;
+ TQTime t;
t.start();
#endif
@@ -578,18 +578,18 @@ void KSVGCanvas::update(float zoomFactor)
fill();
// reset clip paths
- QDictIterator<CanvasClipPath> itr(m_clipPaths);
+ TQDictIterator<CanvasClipPath> itr(m_clipPaths);
for(; itr.current(); ++itr)
(*itr)->update(UPDATE_TRANSFORM);
m_zoom = zoomFactor;
- QWMatrix mtx;
+ TQWMatrix mtx;
mtx.translate(m_pan.x(), m_pan.y());
mtx.scale(m_zoom, m_zoom);
- QRect r(0, 0, m_width, m_height);
- QRect r2 = mtx.invert().map(r);
+ TQRect r(0, 0, m_width, m_height);
+ TQRect r2 = mtx.invert().map(r);
// zoom all items
for(unsigned int i = 0; i < m_items.count(); i++)
@@ -597,7 +597,7 @@ void KSVGCanvas::update(float zoomFactor)
// recalc items
CanvasItemList drawables;
- QPtrListIterator<CanvasItem> it = m_items;
+ TQPtrListIterator<CanvasItem> it = m_items;
for(int j = r2.top() / m_chunkSizeVer; j <= (r2.bottom() / m_chunkSizeVer); j++)
{
for(int i = r2.left() / m_chunkSizeHor; i <= (r2.right() / m_chunkSizeHor); i++)
@@ -619,7 +619,7 @@ void KSVGCanvas::update(float zoomFactor)
(*it)->draw();
if(m_drawWindow)
- blit(QRect(0, 0, m_width, m_height), false);
+ blit(TQRect(0, 0, m_width, m_height), false);
m_dirtyChunks.clear();
@@ -642,24 +642,24 @@ void KSVGCanvas::reset()
void KSVGCanvas::update()
{
#ifdef USE_TIMER
- QTime t;
+ TQTime t;
t.start();
#endif
- QWMatrix mtx;
+ TQWMatrix mtx;
mtx.translate(m_pan.x(), m_pan.y());
mtx.scale(m_zoom, m_zoom);
// Process dirty chunks
- QPtrList<CanvasChunk> chunkList;
+ TQPtrList<CanvasChunk> chunkList;
CanvasItemList drawables;
for(unsigned int i = 0; i < m_dirtyChunks.count(); i++)
{
CanvasChunk *chunk = m_dirtyChunks[i];
Q_ASSERT(chunk->isDirty());
- QRect r = chunk->bbox();
- QRect chunkbox(mtx.map(r.topLeft()), mtx.map(r.bottomRight()));
+ TQRect r = chunk->bbox();
+ TQRect chunkbox(mtx.map(r.topLeft()), mtx.map(r.bottomRight()));
clear(chunkbox);
chunkList.append(chunk);
@@ -686,11 +686,11 @@ void KSVGCanvas::update()
}
// Blit dirty chunks
- QPtrListIterator<CanvasChunk> it = chunkList;
+ TQPtrListIterator<CanvasChunk> it = chunkList;
for(it.toFirst(); it.current(); ++it)
{
- QRect r = (*it)->bbox();
- QRect chunkbox(mtx.map(r.topLeft()), mtx.map(r.bottomRight()));
+ TQRect r = (*it)->bbox();
+ TQRect chunkbox(mtx.map(r.topLeft()), mtx.map(r.bottomRight()));
blit(chunkbox, false);
}
@@ -701,13 +701,13 @@ void KSVGCanvas::update()
#endif
}
-CanvasItemList KSVGCanvas::collisions(const QPoint &p, bool exact) const
+CanvasItemList KSVGCanvas::collisions(const TQPoint &p, bool exact) const
{
- QWMatrix mtx;
+ TQWMatrix mtx;
mtx.translate(m_pan.x(), m_pan.y());
mtx.scale(m_zoom, m_zoom);
- QPoint p2 = mtx.invert().map(p);
+ TQPoint p2 = mtx.invert().map(p);
if(p2.x() < 0 || p2.y() < 0)
return CanvasItemList();
@@ -734,7 +734,7 @@ CanvasItemList KSVGCanvas::collisions(const QPoint &p, bool exact) const
return list;
}
-void KSVGCanvas::blit(const QRect &rect, bool direct)
+void KSVGCanvas::blit(const TQRect &rect, bool direct)
{
if(m_drawWindow && m_width && m_height)
{
@@ -761,12 +761,12 @@ void KSVGCanvas::blit(const QRect &rect, bool direct)
void KSVGCanvas::blit()
{
- return blit(QRect(0, 0, m_width, m_height), false);
+ return blit(TQRect(0, 0, m_width, m_height), false);
}
void KSVGCanvas::ChunkManager::addChunk(CanvasChunk *chunk)
{
- QString key = QString("%1 %2").arg(chunk->x()).arg(chunk->y());
+ TQString key = TQString("%1 %2").arg(chunk->x()).arg(chunk->y());
// kdDebug(26005) << k_funcinfo << "Adding chunk : " << chunk << endl;
m_chunks.insert(key, chunk);
}
@@ -774,7 +774,7 @@ void KSVGCanvas::ChunkManager::addChunk(CanvasChunk *chunk)
CanvasChunk *KSVGCanvas::ChunkManager::getChunk(short x, short y) const
{
// kdDebug(26005) << k_funcinfo << "getting chunk from : " << x << ", " << y << endl;
- QString key = QString("%1 %2").arg(x).arg(y);
+ TQString key = TQString("%1 %2").arg(x).arg(y);
return m_chunks[key];
}
diff --git a/ksvg/core/KSVGCanvas.h b/ksvg/core/KSVGCanvas.h
index 7b26997c..aa41e6c2 100644
--- a/ksvg/core/KSVGCanvas.h
+++ b/ksvg/core/KSVGCanvas.h
@@ -21,12 +21,12 @@
#ifndef KSVGCANVAS_H
#define KSVGCANVAS_H
-#include <qmap.h>
-#include <qdict.h>
-#include <qcolor.h>
-#include <qobject.h>
-#include <qptrlist.h>
-#include <qdict.h>
+#include <tqmap.h>
+#include <tqdict.h>
+#include <tqcolor.h>
+#include <tqobject.h>
+#include <tqptrlist.h>
+#include <tqdict.h>
#include <Converter.h>
@@ -55,7 +55,7 @@ class CanvasItemList;
class CanvasClipPath;
class CanvasPaintServer;
-// Must be a QObject to be able to be loaded by KLibLoader...
+// Must be a TQObject to be able to be loaded by KLibLoader...
class KSVGCanvas : public QObject
{
Q_OBJECT
@@ -65,25 +65,25 @@ public:
void setViewportDimension(unsigned int w, unsigned int h);
- void setup(QPaintDevice *drawWidget, QPaintDevice *directWindow);
+ void setup(TQPaintDevice *drawWidget, TQPaintDevice *directWindow);
void setup(unsigned char *buffer, unsigned int width = 0, unsigned int height = 0);
void reset();
void update();
void update(float zoomFactor);
- void update(const QPoint &panPoint, bool erase = true);
+ void update(const TQPoint &panPoint, bool erase = true);
void resize(unsigned int w, unsigned int h);
void retune(unsigned int csh, unsigned int csv);
void invalidate(CanvasItem *item, bool recalc = true);
- CanvasItemList collisions(const QPoint &p, bool exact = false) const;
+ CanvasItemList collisions(const TQPoint &p, bool exact = false) const;
- void setBackgroundColor(const QColor &c) { m_backgroundColor = c; }
+ void setBackgroundColor(const TQColor &c) { m_backgroundColor = c; }
void blit();
- void blit(const QRect &rect, bool direct);
+ void blit(const TQRect &rect, bool direct);
float zoom() const { return m_zoom; }
- QPoint pan() const { return m_pan; }
- void setPan(const QPoint &pan) { m_pan = pan; }
+ TQPoint pan() const { return m_pan; }
+ void setPan(const TQPoint &pan) { m_pan = pan; }
int width() const { return m_width; }
int height() const { return m_height; }
@@ -112,15 +112,15 @@ public:
void setImmediateUpdate(bool immediateUpdate) { m_immediateUpdate = immediateUpdate; }
bool immediateUpdate() const { return m_immediateUpdate; }
- QPtrList<CanvasItem> allItems() const { return m_items; }
+ TQPtrList<CanvasItem> allItems() const { return m_items; }
unsigned char *renderingBuffer() const { return m_buffer; }
unsigned int nrChannels() const { return m_nrChannels; }
unsigned int rowStride() const { return m_nrChannels * m_width; }
T2P::Converter *fontContext() { return m_fontContext; }
- QPaintDevice *drawWindow() { return m_drawWindow; }
- QPaintDevice *directWindow() { return m_directWindow; }
+ TQPaintDevice *drawWindow() { return m_drawWindow; }
+ TQPaintDevice *directWindow() { return m_directWindow; }
T2P::FontVisualParams *fontVisualParams(SVGStylableImpl *style) const;
virtual T2P::BezierPath *toBezierPath(CanvasItem *item) const { Q_UNUSED(item); return 0; }
@@ -136,7 +136,7 @@ protected:
void initVars();
void fill();
- void clear(const QRect &r);
+ void clear(const TQRect &r);
virtual void setBuffer(unsigned char *buffer);
@@ -151,25 +151,25 @@ protected:
void clear();
private:
- QDict<CanvasChunk> m_chunks;
+ TQDict<CanvasChunk> m_chunks;
} m_chunkManager;
- QValueList<CanvasChunk *> m_dirtyChunks;
+ TQValueList<CanvasChunk *> m_dirtyChunks;
- QMap<CanvasItem *, QPtrList<CanvasChunk> > m_chunksByItem;
- QPtrList<CanvasItem> m_items;
+ TQMap<CanvasItem *, TQPtrList<CanvasChunk> > m_chunksByItem;
+ TQPtrList<CanvasItem> m_items;
- QDict<CanvasClipPath> m_clipPaths;
+ TQDict<CanvasClipPath> m_clipPaths;
unsigned int m_viewportWidth, m_viewportHeight;
int m_width, m_height;
int m_chunkSizeHor, m_chunkSizeVer;
- QPaintDevice *m_drawWindow;
- QPaintDevice *m_directWindow;
+ TQPaintDevice *m_drawWindow;
+ TQPaintDevice *m_directWindow;
float m_zoom;
- QPoint m_pan;
+ TQPoint m_pan;
GC m_gc;
@@ -178,7 +178,7 @@ protected:
unsigned char *m_buffer;
unsigned int m_nrChannels;
- QColor m_backgroundColor;
+ TQColor m_backgroundColor;
bool m_immediateUpdate;
};
diff --git a/ksvg/core/KSVGHelper.h b/ksvg/core/KSVGHelper.h
index e310889f..27c8b88f 100644
--- a/ksvg/core/KSVGHelper.h
+++ b/ksvg/core/KSVGHelper.h
@@ -23,8 +23,8 @@
#ifdef __cplusplus
-#include <qcolor.h>
-#include <qvaluevector.h>
+#include <tqcolor.h>
+#include <tqvaluevector.h>
#include "Affine.h"
#include "Point.h"
#include "SVGMatrixImpl.h"
@@ -62,21 +62,21 @@ public:
KSVGHelper::matrixToAffine(matrix, affine.data());
}
- static QString toColorString(QColor color)
+ static TQString toColorString(TQColor color)
{
int r = color.red();
int g = color.green();
int b = color.blue();
- return "rgb(" + QString::number(r) + "," + QString::number(g) + "," + QString::number(b) + ")";
+ return "rgb(" + TQString::number(r) + "," + TQString::number(g) + "," + TQString::number(b) + ")";
}
- static unsigned int toArtColor(const QColor &color)
+ static unsigned int toArtColor(const TQColor &color)
{
return (qRed(color.rgb()) << 24) | (qGreen(color.rgb()) << 16) | ( qBlue(color.rgb()) << 8) | (qAlpha(color.rgb()));
}
- static unsigned int toArtColor(const QColor &color, short opacity)
+ static unsigned int toArtColor(const TQColor &color, short opacity)
{
return (qRed(color.rgb()) << 24) | (qGreen(color.rgb()) << 16) | ( qBlue(color.rgb()) << 8) | (opacity);
}
@@ -113,7 +113,7 @@ public:
void clear() { m_points.clear(); }
private:
- QValueVector<KSVGPoint> m_points;
+ TQValueVector<KSVGPoint> m_points;
};
class KSVGRectangle : public KSVGPolygon
diff --git a/ksvg/core/KSVGLoader.cpp b/ksvg/core/KSVGLoader.cpp
index 7f7591d7..63c3efc8 100644
--- a/ksvg/core/KSVGLoader.cpp
+++ b/ksvg/core/KSVGLoader.cpp
@@ -18,10 +18,10 @@
Boston, MA 02110-1301, USA.
*/
-#include <qxml.h>
-#include <qfile.h>
-#include <qimage.h>
-#include <qbuffer.h>
+#include <tqxml.h>
+#include <tqfile.h>
+#include <tqimage.h>
+#include <tqbuffer.h>
#include <kurl.h>
#include <kdebug.h>
@@ -46,21 +46,21 @@ KSVGLoader::~KSVGLoader()
{
}
-QString KSVGLoader::loadXML(::KURL url)
+TQString KSVGLoader::loadXML(::KURL url)
{
- QString tmpFile;
+ TQString tmpFile;
if(KIO::NetAccess::download(url, tmpFile, 0))
{
- QIODevice *dev = KFilterDev::deviceForFile(tmpFile, "application/x-gzip", true);
- QByteArray contents;
+ TQIODevice *dev = KFilterDev::deviceForFile(tmpFile, "application/x-gzip", true);
+ TQByteArray contents;
if(dev->open(IO_ReadOnly))
contents = dev->readAll();
delete dev;
KIO::NetAccess::removeTempFile(tmpFile);
- return QString(contents);
+ return TQString(contents);
}
- return QString::null;
+ return TQString::null;
}
void KSVGLoader::getSVGContent(::KURL url)
@@ -72,8 +72,8 @@ void KSVGLoader::getSVGContent(::KURL url)
m_job->setAutoErrorHandlingEnabled(true);
- connect(m_job, SIGNAL(data(KIO::Job *, const QByteArray &)), this, SLOT(slotData(KIO::Job *, const QByteArray &)));
- connect(m_job, SIGNAL(result(KIO::Job *)), this, SLOT(slotResult(KIO::Job *)));
+ connect(m_job, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)), this, TQT_SLOT(slotData(KIO::Job *, const TQByteArray &)));
+ connect(m_job, TQT_SIGNAL(result(KIO::Job *)), this, TQT_SLOT(slotResult(KIO::Job *)));
}
}
@@ -86,31 +86,31 @@ void KSVGLoader::newImageJob(SVGImageElementImpl *image, ::KURL baseURL)
}
ImageStreamMap *map = new ImageStreamMap();
- map->data = new QByteArray();
+ map->data = new TQByteArray();
map->imageElement = image;
KIO::TransferJob *imageJob = KIO::get(::KURL(baseURL, map->imageElement->fileName()), false, false);
- connect(imageJob, SIGNAL(data(KIO::Job *, const QByteArray &)), this, SLOT(slotData(KIO::Job *, const QByteArray &)));
- connect(imageJob, SIGNAL(result(KIO::Job *)), this, SLOT(slotResult(KIO::Job *)));
+ connect(imageJob, TQT_SIGNAL(data(KIO::Job *, const TQByteArray &)), this, TQT_SLOT(slotData(KIO::Job *, const TQByteArray &)));
+ connect(imageJob, TQT_SIGNAL(result(KIO::Job *)), this, TQT_SLOT(slotResult(KIO::Job *)));
m_imageJobs.insert(imageJob, map);
}
-void KSVGLoader::slotData(KIO::Job *job, const QByteArray &data)
+void KSVGLoader::slotData(KIO::Job *job, const TQByteArray &data)
{
if(job == m_job)
{
- QDataStream dataStream(m_data, IO_WriteOnly | IO_Append);
+ TQDataStream dataStream(m_data, IO_WriteOnly | IO_Append);
dataStream.writeRawBytes(data.data(), data.size());
}
else
{
- QMap<KIO::TransferJob *, ImageStreamMap *>::Iterator it;
+ TQMap<KIO::TransferJob *, ImageStreamMap *>::Iterator it;
for(it = m_imageJobs.begin(); it != m_imageJobs.end(); ++it)
{
if(it.key() == job)
{
- QDataStream dataStream(*(it.data())->data, IO_WriteOnly | IO_Append);
+ TQDataStream dataStream(*(it.data())->data, IO_WriteOnly | IO_Append);
dataStream.writeRawBytes(data.data(), data.size());
break;
}
@@ -124,18 +124,18 @@ void KSVGLoader::slotResult(KIO::Job *job)
{
if(m_job->error() == 0)
{
- QString check = static_cast<KIO::TransferJob *>(job)->url().prettyURL();
+ TQString check = static_cast<KIO::TransferJob *>(job)->url().prettyURL();
if(check.contains(".svgz") || check.contains(".svg.gz"))
{
// decode the gzipped svg and emit it
- QIODevice *dev = KFilterDev::device(new QBuffer(m_data), "application/x-gzip");
+ TQIODevice *dev = KFilterDev::device(new TQBuffer(m_data), "application/x-gzip");
dev->open(IO_ReadOnly);
emit gotResult(dev);
}
else
{
m_job = 0;
- emit gotResult(new QBuffer(m_data));
+ emit gotResult(new TQBuffer(m_data));
m_data.resize(0);
}
}
@@ -151,29 +151,29 @@ void KSVGLoader::slotResult(KIO::Job *job)
}
else
{
- QMap<KIO::TransferJob *, ImageStreamMap *>::Iterator it;
+ TQMap<KIO::TransferJob *, ImageStreamMap *>::Iterator it;
for(it = m_imageJobs.begin(); it != m_imageJobs.end(); ++it)
{
if(it.key() == job)
{
ImageStreamMap *streamMap = it.data();
- QBuffer buffer(*(streamMap->data));
+ TQBuffer buffer(*(streamMap->data));
if(buffer.open(IO_ReadOnly))
{
- const char *imageFormat = QImageIO::imageFormat(&buffer);
+ const char *imageFormat = TQImageIO::imageFormat(&buffer);
if(imageFormat != 0)
{
- QImageIO imageIO(&buffer, imageFormat);
+ TQImageIO imageIO(&buffer, imageFormat);
// Gamma correction
imageIO.setGamma(1/0.45454);
if(imageIO.read())
{
- QImage *image = new QImage(imageIO.image());
+ TQImage *image = new TQImage(imageIO.image());
image->detach();
(streamMap->imageElement)->setImage(image);
}
@@ -193,16 +193,16 @@ void KSVGLoader::slotResult(KIO::Job *job)
}
}
-QString KSVGLoader::getUrl(::KURL url, bool local)
+TQString KSVGLoader::getUrl(::KURL url, bool local)
{
// Security issue: Only retrieve http and https
if(local || (!url.prettyURL().isEmpty()) && ((url.protocol() == "http") || (url.protocol() == "https")))
return loadXML(url);
- return QString::null;
+ return TQString::null;
}
-void KSVGLoader::postUrl(::KURL url, const QByteArray &data, const QString &mimeType, KJS::ExecState *exec, KJS::Object &callBackFunction, KJS::Object &status)
+void KSVGLoader::postUrl(::KURL url, const TQByteArray &data, const TQString &mimeType, KJS::ExecState *exec, KJS::Object &callBackFunction, KJS::Object &status)
{
KIO::TransferJob *job = KIO::http_post(url, data, false);
job->addMetaData("content-type", mimeType);
@@ -212,13 +212,13 @@ void KSVGLoader::postUrl(::KURL url, const QByteArray &data, const QString &mime
m_postUrlData.status = &status;
m_postUrlData.callBackFunction = &callBackFunction;
- connect(job, SIGNAL(result(KIO::Job *)), SLOT(slotResult(KIO::Job *)));
+ connect(job, TQT_SIGNAL(result(KIO::Job *)), TQT_SLOT(slotResult(KIO::Job *)));
}
class CharacterDataSearcher : public QXmlDefaultHandler
{
public:
- CharacterDataSearcher(const QString &id) : m_id(id) { }
+ CharacterDataSearcher(const TQString &id) : m_id(id) { }
virtual bool startDocument()
{
@@ -226,7 +226,7 @@ public:
return true;
}
- virtual bool startElement(const QString &, const QString &, const QString &qName, const QXmlAttributes &atts)
+ virtual bool startElement(const TQString &, const TQString &, const TQString &qName, const TQXmlAttributes &atts)
{
kdDebug(26001) << "CharacterDataSearcher::startElement, qName " << qName << endl;
@@ -240,7 +240,7 @@ public:
return true;
}
- virtual bool endElement(const QString &, const QString &, const QString &qName)
+ virtual bool endElement(const TQString &, const TQString &, const TQString &qName)
{
if(m_tagFound == qName && m_foundCount > 0)
{
@@ -252,7 +252,7 @@ public:
return true;
}
- virtual bool characters(const QString &ch)
+ virtual bool characters(const TQString &ch)
{
kdDebug(26001) << "CharacterDataSearcher::characters, read " << ch.latin1() << endl;
@@ -262,24 +262,24 @@ public:
return true;
}
- QString result() { return m_result; }
+ TQString result() { return m_result; }
private:
- QString m_id, m_result, m_tagFound;
+ TQString m_id, m_result, m_tagFound;
int m_foundCount;
};
-QString KSVGLoader::getCharacterData(::KURL url, const QString &id)
+TQString KSVGLoader::getCharacterData(::KURL url, const TQString &id)
{
- QXmlSimpleReader reader;
+ TQXmlSimpleReader reader;
CharacterDataSearcher searcher(id);
reader.setContentHandler(&searcher);
reader.setErrorHandler(&searcher);
- QString s = loadXML(url);
+ TQString s = loadXML(url);
- QXmlInputSource source;
+ TQXmlInputSource source;
source.setData(s);
reader.parse(&source);
@@ -292,7 +292,7 @@ QString KSVGLoader::getCharacterData(::KURL url, const QString &id)
class SVGFragmentSearcher : public QXmlDefaultHandler
{
public:
- SVGFragmentSearcher(SVGDocumentImpl *doc, const QString &id, ::KURL url) : m_id(id), m_url(url), m_doc(doc) { }
+ SVGFragmentSearcher(SVGDocumentImpl *doc, const TQString &id, ::KURL url) : m_id(id), m_url(url), m_doc(doc) { }
virtual bool startDocument()
{
@@ -302,7 +302,7 @@ public:
return true;
}
- virtual bool startElement(const QString &namespaceURI, const QString &, const QString &qName, const QXmlAttributes &attrs)
+ virtual bool startElement(const TQString &namespaceURI, const TQString &, const TQString &qName, const TQXmlAttributes &attrs)
{
kdDebug(26001) << "SVGFragmentSearcher::startElement, namespaceURI " << namespaceURI << ", qName " << qName << endl;
bool parse = m_result;
@@ -324,12 +324,12 @@ public:
else
m_result = newElement;
- QXmlAttributes newAttrs;
+ TQXmlAttributes newAttrs;
for(int i = 0; i < attrs.count(); i++)
{
- QString name = attrs.localName(i);
- QString value = attrs.value(i);
+ TQString name = attrs.localName(i);
+ TQString value = attrs.value(i);
if(name == "id")
{
@@ -346,7 +346,7 @@ public:
value.remove(0, 1);
// Convert the id to its mangled version.
- QString id = "@fragment@" + m_url.prettyURL() + "@" + value;
+ TQString id = "@fragment@" + m_url.prettyURL() + "@" + value;
if(m_idMap.contains(id))
{
@@ -373,7 +373,7 @@ public:
return true;
}
- virtual bool endElement(const QString &, const QString &, const QString &)
+ virtual bool endElement(const TQString &, const TQString &, const TQString &)
{
if(m_result)
{
@@ -388,7 +388,7 @@ public:
return true;
}
- virtual bool characters(const QString &ch)
+ virtual bool characters(const TQString &ch)
{
kdDebug(26001) << "SVGFragmentSearcher::characters, read " << ch.latin1() << endl;
@@ -397,7 +397,7 @@ public:
SVGElementImpl *element = m_result->ownerDoc()->getElementFromHandle(m_currentNode->handle());
if(element)
{
- QString t = ch;
+ TQString t = ch;
SVGLangSpaceImpl *langSpace = dynamic_cast<SVGLangSpaceImpl *>(element);
if(langSpace)
@@ -417,28 +417,28 @@ public:
SVGElementImpl *result() { return m_result; }
private:
- QString m_id;
+ TQString m_id;
::KURL m_url;
SVGDocumentImpl *m_doc;
SVGElementImpl *m_result;
DOM::Node *m_currentNode, m_parentNode;
- QMap<QString, SVGElementImpl *> m_idMap;
+ TQMap<TQString, SVGElementImpl *> m_idMap;
};
-SVGElementImpl *KSVGLoader::getSVGFragment(::KURL url, SVGDocumentImpl *doc, const QString &id)
+SVGElementImpl *KSVGLoader::getSVGFragment(::KURL url, SVGDocumentImpl *doc, const TQString &id)
{
- QXmlSimpleReader reader;
+ TQXmlSimpleReader reader;
kdDebug(26001) << "getSVGFragment: " << url.prettyURL() << "#" << id << endl;
SVGFragmentSearcher searcher(doc, id, url);
reader.setContentHandler(&searcher);
reader.setErrorHandler(&searcher);
- QString s = loadXML(url);
+ TQString s = loadXML(url);
- QXmlInputSource source;
+ TQXmlInputSource source;
source.setData(s);
reader.parse(&source);
diff --git a/ksvg/core/KSVGLoader.h b/ksvg/core/KSVGLoader.h
index d0418411..443d0fb7 100644
--- a/ksvg/core/KSVGLoader.h
+++ b/ksvg/core/KSVGLoader.h
@@ -21,7 +21,7 @@
#ifndef KSVGLoader_H
#define KSVGLoader_H
-#include <qobject.h>
+#include <tqobject.h>
class KURL;
@@ -62,27 +62,27 @@ public:
void getSVGContent(::KURL url);
void newImageJob(SVGImageElementImpl *impl, ::KURL url);
- static QString getUrl(::KURL url, bool local = false);
- void postUrl(::KURL url, const QByteArray &data, const QString &mimeType, KJS::ExecState *exec, KJS::Object &callBackFunction, KJS::Object &status);
- static QString getCharacterData(::KURL url, const QString &id);
- static SVGElementImpl *getSVGFragment(::KURL, SVGDocumentImpl *doc, const QString &id);
+ static TQString getUrl(::KURL url, bool local = false);
+ void postUrl(::KURL url, const TQByteArray &data, const TQString &mimeType, KJS::ExecState *exec, KJS::Object &callBackFunction, KJS::Object &status);
+ static TQString getCharacterData(::KURL url, const TQString &id);
+ static SVGElementImpl *getSVGFragment(::KURL, SVGDocumentImpl *doc, const TQString &id);
signals:
- void gotResult(QIODevice *);
+ void gotResult(TQIODevice *);
void imageReady(SVGImageElementImpl *);
private slots:
- void slotData(KIO::Job *, const QByteArray &);
+ void slotData(KIO::Job *, const TQByteArray &);
void slotResult(KIO::Job *);
private:
- static QString loadXML(::KURL);
+ static TQString loadXML(::KURL);
PostUrlData m_postUrlData;
- QByteArray m_data;
+ TQByteArray m_data;
KIO::TransferJob *m_job;
- QMap<KIO::TransferJob *, ImageStreamMap *> m_imageJobs;
+ TQMap<KIO::TransferJob *, ImageStreamMap *> m_imageJobs;
};
}
diff --git a/ksvg/core/KSVGReader.cc b/ksvg/core/KSVGReader.cc
index dd73e420..e479b9a1 100644
--- a/ksvg/core/KSVGReader.cc
+++ b/ksvg/core/KSVGReader.cc
@@ -21,7 +21,7 @@
#include <dom/dom_exception.h>
#include <kdebug.h>
#include <klocale.h>
-#include <qmap.h>
+#include <tqmap.h>
#include <ksimpleconfig.h>
#include <KSVGCanvas.h>
#include "KSVGReader.moc"
@@ -54,18 +54,18 @@ public:
void addSVGElement(SVGSVGElementImpl *one, DOM::NodeImpl *two) { m_svgMap.insert(two, one); }
SVGSVGElementImpl *nextSVGElement(SVGElementImpl *elem);
SVGSVGElementImpl *nextSVGElement(DOM::Node elem);
- void setFinished(bool error, const QString &errorDesc = "") { m_reader->setFinished(error, errorDesc); }
+ void setFinished(bool error, const TQString &errorDesc = "") { m_reader->setFinished(error, errorDesc); }
// Error handling
- void setErrorDescription(const QString &err) { m_errorDesc = err; }
- QString errorDescription() { return m_errorDesc; }
+ void setErrorDescription(const TQString &err) { m_errorDesc = err; }
+ TQString errorDescription() { return m_errorDesc; }
bool hasError() const { return !m_errorDesc.isEmpty(); }
bool getURLMode() const { return m_getURLMode; }
void setGetURLMode(bool mode) { m_getURLMode = mode; }
- QString SVGFragmentId() const { return m_SVGFragmentId; }
- void setSVGFragmentId(const QString &SVGFragmentId) { m_SVGFragmentId = SVGFragmentId; }
+ TQString SVGFragmentId() const { return m_SVGFragmentId; }
+ void setSVGFragmentId(const TQString &SVGFragmentId) { m_SVGFragmentId = SVGFragmentId; }
protected:
Helper(KSVGReader *reader);
@@ -76,12 +76,12 @@ private:
Helper &operator=(const Helper &rhs);
static Helper *m_instance;
- QMap<DOM::NodeImpl *, SVGSVGElementImpl *> m_svgMap;
+ TQMap<DOM::NodeImpl *, SVGSVGElementImpl *> m_svgMap;
KSVGReader *m_reader;
bool m_bFit;
bool m_getURLMode;
- QString m_errorDesc;
- QString m_SVGFragmentId;
+ TQString m_errorDesc;
+ TQString m_SVGFragmentId;
};
class InputHandler : public QXmlDefaultHandler
@@ -89,17 +89,17 @@ class InputHandler : public QXmlDefaultHandler
public:
virtual bool startDocument();
virtual bool endDocument();
- virtual bool startElement(const QString &namespaceURI,
- const QString &localName,
- const QString &qName,
- const QXmlAttributes &atts);
- virtual bool endElement(const QString &namespaceURI,
- const QString &localName,
- const QString &qName);
- virtual bool characters(const QString &ch);
- virtual bool warning(const QXmlParseException &e);
- virtual bool error(const QXmlParseException &e);
- virtual bool fatalError(const QXmlParseException &e);
+ virtual bool startElement(const TQString &namespaceURI,
+ const TQString &localName,
+ const TQString &qName,
+ const TQXmlAttributes &atts);
+ virtual bool endElement(const TQString &namespaceURI,
+ const TQString &localName,
+ const TQString &qName);
+ virtual bool characters(const TQString &ch);
+ virtual bool warning(const TQXmlParseException &e);
+ virtual bool error(const TQXmlParseException &e);
+ virtual bool fatalError(const TQXmlParseException &e);
private:
DOM::Node *m_rootNode;
@@ -186,14 +186,14 @@ bool InputHandler::endDocument()
return true;
}
-bool InputHandler::characters(const QString &ch)
+bool InputHandler::characters(const TQString &ch)
{
kdDebug(26001) << "InputHandler::characters, read " << ch << endl;
if(ch.simplifyWhiteSpace().isEmpty())
return true;
- QString t = ch;
+ TQString t = ch;
SVGSVGElementImpl *root = Helper::self()->nextSVGElement(*m_currentNode);
if(root)
@@ -214,7 +214,7 @@ bool InputHandler::characters(const QString &ch)
return true;
}
-bool InputHandler::startElement(const QString &namespaceURI, const QString &, const QString &qName, const QXmlAttributes &attrs)
+bool InputHandler::startElement(const TQString &namespaceURI, const TQString &, const TQString &qName, const TQXmlAttributes &attrs)
{
kdDebug(26001) << "InputHandler::startElement, namespaceURI " << namespaceURI << " qName " << qName << endl;
@@ -245,14 +245,14 @@ bool InputHandler::startElement(const QString &namespaceURI, const QString &, co
SVGLengthImpl *height = SVGSVGElementImpl::createSVGLength();
width->setValueAsString(svg->getAttribute("width").string());
height->setValueAsString(svg->getAttribute("height").string());
- QString viewbox = QString("0 0 %1 %2").arg(width->value()).arg(height->value());
+ TQString viewbox = TQString("0 0 %1 %2").arg(width->value()).arg(height->value());
//kdDebug(26001) << "VIEWBOX : " << viewbox.latin1() << endl;
svg->setAttribute("viewBox", viewbox);
width->deref();
height->deref();
}
- svg->setAttribute("width", QString::number(Helper::self()->canvas()->width()));
- svg->setAttribute("height", QString::number(Helper::self()->canvas()->height()));
+ svg->setAttribute("width", TQString::number(Helper::self()->canvas()->width()));
+ svg->setAttribute("height", TQString::number(Helper::self()->canvas()->height()));
}
if(!Helper::self()->SVGFragmentId().isEmpty())
@@ -341,7 +341,7 @@ bool InputHandler::startElement(const QString &namespaceURI, const QString &, co
return !Helper::self()->hasError();
}
-bool InputHandler::endElement(const QString &, const QString &, const QString &qName)
+bool InputHandler::endElement(const TQString &, const TQString &, const TQString &qName)
{
kdDebug(26001) << "InputHandler::endElement, qName " << qName << endl;
@@ -364,12 +364,12 @@ bool InputHandler::endElement(const QString &, const QString &, const QString &q
Helper::self()->canvas()->blit();
- QValueList<SVGUseElementImpl *> forwardReferencingUseElements = Helper::self()->doc()->forwardReferencingUseElements();
+ TQValueList<SVGUseElementImpl *> forwardReferencingUseElements = Helper::self()->doc()->forwardReferencingUseElements();
if(!forwardReferencingUseElements.isEmpty())
{
// Create the elements again now that we have parsed the whole document.
- QValueList<SVGUseElementImpl *>::iterator it;
+ TQValueList<SVGUseElementImpl *>::iterator it;
Helper::self()->canvas()->setImmediateUpdate(false);
@@ -407,29 +407,29 @@ bool InputHandler::endElement(const QString &, const QString &, const QString &q
return true;
}
-bool InputHandler::warning(const QXmlParseException &e)
+bool InputHandler::warning(const TQXmlParseException &e)
{
kdDebug(26001) << "[" << e.lineNumber() << ":" << e.columnNumber() << "]: WARNING: " << e.message() << endl;
return true;
}
-bool InputHandler::error(const QXmlParseException &e)
+bool InputHandler::error(const TQXmlParseException &e)
{
kdDebug(26001) << "[" << e.lineNumber() << ":" << e.columnNumber() << "]: ERROR: " << e.message() << endl;
return true;
}
-bool InputHandler::fatalError(const QXmlParseException &e)
+bool InputHandler::fatalError(const TQXmlParseException &e)
{
- QString error;
+ TQString error;
if(Helper::self()->hasError())
{
error = Helper::self()->errorDescription();
- Helper::self()->setErrorDescription(QString::null);
+ Helper::self()->setErrorDescription(TQString::null);
}
else
- error = QString("[%1:%2]: FATAL ERROR: %3").arg(e.lineNumber()).arg(e.columnNumber()).arg(e.message());
+ error = TQString("[%1:%2]: FATAL ERROR: %3").arg(e.lineNumber()).arg(e.columnNumber()).arg(e.message());
kdDebug(26001) << "InputHandler::fatalError, " << error << endl;
@@ -439,18 +439,18 @@ bool InputHandler::fatalError(const QXmlParseException &e)
struct KSVGReader::Private
{
- QXmlSimpleReader *reader;
+ TQXmlSimpleReader *reader;
InputHandler *inputHandler;
SVGDocumentImpl *doc;
KSVGCanvas *canvas;
};
-KSVGReader::KSVGReader(SVGDocumentImpl *doc, KSVGCanvas *canvas, ParsingArgs args) : QObject(), d(new Private)
+KSVGReader::KSVGReader(SVGDocumentImpl *doc, KSVGCanvas *canvas, ParsingArgs args) : TQObject(), d(new Private)
{
d->doc = doc;
d->canvas = canvas;
- d->reader = new QXmlSimpleReader();
+ d->reader = new TQXmlSimpleReader();
d->inputHandler = new InputHandler();
Helper::self(this);
@@ -471,17 +471,17 @@ KSVGReader::~KSVGReader()
delete d;
}
-void KSVGReader::parse(QXmlInputSource *source)
+void KSVGReader::parse(TQXmlInputSource *source)
{
d->reader->parse(source);
}
-void KSVGReader::finishParsing(bool, const QString &errorDesc)
+void KSVGReader::finishParsing(bool, const TQString &errorDesc)
{
Helper::self()->setErrorDescription(errorDesc);
}
-void KSVGReader::setFinished(bool error, const QString &errorDesc)
+void KSVGReader::setFinished(bool error, const TQString &errorDesc)
{
kdDebug(26001) << "KSVGReader::setFinished" << endl;
emit finished(error, errorDesc);
diff --git a/ksvg/core/KSVGReader.h b/ksvg/core/KSVGReader.h
index 722720e1..49259d7d 100644
--- a/ksvg/core/KSVGReader.h
+++ b/ksvg/core/KSVGReader.h
@@ -21,8 +21,8 @@
#ifndef KSVGReader_H
#define KSVGReader_H
-#include <qxml.h>
-#include <qobject.h>
+#include <tqxml.h>
+#include <tqobject.h>
namespace KSVG
{
@@ -37,17 +37,17 @@ public:
bool fit;
bool getURLMode;
- QString SVGFragmentId;
+ TQString SVGFragmentId;
};
KSVGReader(SVGDocumentImpl *doc, KSVGCanvas *canvas, ParsingArgs args);
virtual ~KSVGReader();
- void parse(QXmlInputSource *source);
- void finishParsing(bool, const QString &);
+ void parse(TQXmlInputSource *source);
+ void finishParsing(bool, const TQString &);
signals:
- void finished(bool, const QString &);
+ void finished(bool, const TQString &);
protected:
friend class Helper;
@@ -55,7 +55,7 @@ protected:
SVGDocumentImpl *doc();
KSVGCanvas *canvas();
- void setFinished(bool error, const QString &errorDesc = 0);
+ void setFinished(bool error, const TQString &errorDesc = 0);
private:
struct Private;
diff --git a/ksvg/core/KSVGTextChunk.cpp b/ksvg/core/KSVGTextChunk.cpp
index b8eddcad..4d8111e8 100644
--- a/ksvg/core/KSVGTextChunk.cpp
+++ b/ksvg/core/KSVGTextChunk.cpp
@@ -38,7 +38,7 @@ unsigned int KSVGTextChunk::count() const
return m_text.count();
}
-QString KSVGTextChunk::getText(unsigned int index) const
+TQString KSVGTextChunk::getText(unsigned int index) const
{
return m_text[index];
}
@@ -60,7 +60,7 @@ void KSVGTextChunk::clear()
m_textElements.clear();
}
-void KSVGTextChunk::addText(const QString &text, SVGTextContentElementImpl *textElement)
+void KSVGTextChunk::addText(const TQString &text, SVGTextContentElementImpl *textElement)
{
m_text.append(text);
m_textElements.append(textElement);
diff --git a/ksvg/core/KSVGTextChunk.h b/ksvg/core/KSVGTextChunk.h
index d684087a..21efa055 100644
--- a/ksvg/core/KSVGTextChunk.h
+++ b/ksvg/core/KSVGTextChunk.h
@@ -21,7 +21,7 @@
#ifndef KSVGTEXTCHUNK_H
#define KSVGTEXTCHUNK_H
-#include <qstringlist.h>
+#include <tqstringlist.h>
namespace KSVG
{
@@ -35,16 +35,16 @@ public:
~KSVGTextChunk();
unsigned int count() const;
- QString getText(unsigned int index) const;
+ TQString getText(unsigned int index) const;
SVGTextPositioningElementImpl *getTextElement(unsigned int index);
SVGTextContentElementImpl *getTextContentElement(unsigned int index);
void clear();
- void addText(const QString &text, SVGTextContentElementImpl *textElement);
+ void addText(const TQString &text, SVGTextContentElementImpl *textElement);
private:
- QStringList m_text;
- QPtrList<SVGTextContentElementImpl> m_textElements;
+ TQStringList m_text;
+ TQPtrList<SVGTextContentElementImpl> m_textElements;
};
}