diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-19 19:03:33 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-19 19:03:33 +0000 |
commit | e69e8b1d09fb579316595b4e6a850e717358a8b1 (patch) | |
tree | a24fc20865f65772f530d16177520190594ffdd2 /ksvg/core | |
parent | eecec9afb81fdebb0f22e9da22635874c403f854 (diff) | |
download | tdegraphics-e69e8b1d09fb579316595b4e6a850e717358a8b1.tar.gz tdegraphics-e69e8b1d09fb579316595b4e6a850e717358a8b1.zip |
TQt4 port kdegraphics
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1237557 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ksvg/core')
-rw-r--r-- | ksvg/core/CanvasFactory.cpp | 2 | ||||
-rw-r--r-- | ksvg/core/CanvasItems.cpp | 32 | ||||
-rw-r--r-- | ksvg/core/CanvasItems.h | 8 | ||||
-rw-r--r-- | ksvg/core/KSVGCanvas.cpp | 86 | ||||
-rw-r--r-- | ksvg/core/KSVGCanvas.h | 7 | ||||
-rw-r--r-- | ksvg/core/KSVGHelper.h | 4 | ||||
-rw-r--r-- | ksvg/core/KSVGLoader.cpp | 18 | ||||
-rw-r--r-- | ksvg/core/KSVGLoader.h | 3 | ||||
-rw-r--r-- | ksvg/core/KSVGReader.cc | 52 | ||||
-rw-r--r-- | ksvg/core/KSVGReader.h | 3 |
10 files changed, 109 insertions, 106 deletions
diff --git a/ksvg/core/CanvasFactory.cpp b/ksvg/core/CanvasFactory.cpp index e03bf9ea..d1278334 100644 --- a/ksvg/core/CanvasFactory.cpp +++ b/ksvg/core/CanvasFactory.cpp @@ -149,7 +149,7 @@ TQString CanvasFactory::internalNameFor(const TQString &name) ++it; } - return TQString::null; + return TQString(); } void CanvasFactory::deleteCanvas(KSVGCanvas *canvas) diff --git a/ksvg/core/CanvasItems.cpp b/ksvg/core/CanvasItems.cpp index 333f4608..b5b5681f 100644 --- a/ksvg/core/CanvasItems.cpp +++ b/ksvg/core/CanvasItems.cpp @@ -107,7 +107,7 @@ void CanvasText::handleTSpan(KSVGCanvas *canvas, const SVGMatrixImpl *screenCTM, TQString text = tspan->text(); if(!text.isEmpty()) { - T2P::GlyphLayoutParams *params = tspan->layoutParams(); + T2P::GlyphLayoutParams *params = tspan->tqlayoutParams(); if(bMultipleX || bMultipleY) { @@ -265,7 +265,7 @@ KSVGTextChunk *CanvasText::createTextChunk(KSVGCanvas *canvas, const SVGMatrixIm curx = usex; cury = usey; - T2P::GlyphLayoutParams *params = tpath->layoutParams(); + T2P::GlyphLayoutParams *params = tpath->tqlayoutParams(); if(!params->tb()) curx += endx; @@ -290,7 +290,7 @@ void CanvasText::createGlyphs(KSVGTextChunk *textChunk, KSVGCanvas *canvas, cons TQMemArray<double> _cury(1); _cury[0] = double(cury); - T2P::GlyphLayoutParams *params = m_text->layoutParams(); + T2P::GlyphLayoutParams *params = m_text->tqlayoutParams(); SVGTextPositioningElementImpl *tp = textChunk->getTextElement(0); SVGTextContentElementImpl *tc = textChunk->getTextContentElement(0); SVGTextContentElementImpl *tc0 = tc; @@ -373,14 +373,14 @@ void CanvasText::createGlyphs(KSVGTextChunk *textChunk, KSVGCanvas *canvas, cons } { - T2P::GlyphLayoutParams *params = tc->layoutParams(); + T2P::GlyphLayoutParams *params = tc->tqlayoutParams(); params->setLetterSpacing(params->letterSpacing() + addLetterSpacing); if(bpath) { params->setTextPathStartOffset(pathAdvance); if(tp && tp->dy()->baseVal()->numberOfItems() > 0) pathDy += tp->dy()->baseVal()->getItem(0)->value(); - TQString shift = TQString("%1%%").arg((pathDy / font->fontParams()->size()) * -100.0); + TQString shift = TQString("%1%%").tqarg((pathDy / font->fontParams()->size()) * -100.0); params->setBaselineShift(shift.latin1()); } @@ -429,7 +429,7 @@ void CanvasText::createGlyphs(KSVGTextChunk *textChunk, KSVGCanvas *canvas, cons return; // Draw 'text-decoration' - // TODO: Currently just ignore text-decoration on vertical layouts, is that correct? + // TODO: Currently just ignore text-decoration on vertical tqlayouts, is that correct? // Underline and overline have to be drawn before the glyphs are rendered if(tc0->getTextDecoration() & UNDERLINE && !params->tb()) addTextDecoration(tc0, (curx - anchor), (cury + (glyph->underlinePosition() - glyph->pixelBaseline())), @@ -444,7 +444,7 @@ void CanvasText::createGlyphs(KSVGTextChunk *textChunk, KSVGCanvas *canvas, cons SVGTextContentElementImpl *style = textChunk->getTextContentElement(j); // Draw 'text-decoration' - // TODO: Currently just ignore text-decoration on vertical layouts, is that correct? + // TODO: Currently just ignore text-decoration on vertical tqlayouts, is that correct? // Underline and overline have to be drawn before the glyphs are rendered if(style->getAttribute("text-decoration") == "underline" && !params->tb()) addTextDecoration(style, glyph->bboxX() - anchor, (cury + (glyph->underlinePosition() - glyph->pixelBaseline())), @@ -484,26 +484,26 @@ void CanvasText::createGlyphs(KSVGTextChunk *textChunk, KSVGCanvas *canvas, cons // ##### -void MarkerHelper::doMarker(SVGShapeImpl *shape, SVGStylableImpl *style, double x, double y, double angle, const TQString &markerId) +void MarkerHelper::doMarker(SVGShapeImpl *tqshape, SVGStylableImpl *style, double x, double y, double angle, const TQString &markerId) { - SVGMarkerElementImpl *marker = dynamic_cast<SVGMarkerElementImpl *>(shape->ownerSVGElement()->getElementById(markerId)); + SVGMarkerElementImpl *marker = dynamic_cast<SVGMarkerElementImpl *>(tqshape->ownerSVGElement()->getElementById(markerId)); if(marker) - marker->draw(shape, x, y, style->getStrokeWidth()->baseVal()->value(), angle); + marker->draw(tqshape, x, y, style->getStrokeWidth()->baseVal()->value(), angle); } -void MarkerHelper::doStartMarker(SVGShapeImpl *shape, SVGStylableImpl *style, double x, double y, double angle) +void MarkerHelper::doStartMarker(SVGShapeImpl *tqshape, SVGStylableImpl *style, double x, double y, double angle) { - doMarker(shape, style, x, y, angle, style->getStartMarker()); + doMarker(tqshape, style, x, y, angle, style->getStartMarker()); } -void MarkerHelper::doMidMarker(SVGShapeImpl *shape, SVGStylableImpl *style, double x, double y, double angle) +void MarkerHelper::doMidMarker(SVGShapeImpl *tqshape, SVGStylableImpl *style, double x, double y, double angle) { - doMarker(shape, style, x, y, angle, style->getMidMarker()); + doMarker(tqshape, style, x, y, angle, style->getMidMarker()); } -void MarkerHelper::doEndMarker(SVGShapeImpl *shape, SVGStylableImpl *style, double x, double y, double angle) +void MarkerHelper::doEndMarker(SVGShapeImpl *tqshape, SVGStylableImpl *style, double x, double y, double angle) { - doMarker(shape, style, x, y, angle, style->getEndMarker()); + doMarker(tqshape, style, x, y, angle, style->getEndMarker()); } // vim:ts=4:noet diff --git a/ksvg/core/CanvasItems.h b/ksvg/core/CanvasItems.h index 9f5eed43..45818712 100644 --- a/ksvg/core/CanvasItems.h +++ b/ksvg/core/CanvasItems.h @@ -80,12 +80,12 @@ protected: class MarkerHelper { protected: - void doStartMarker(SVGShapeImpl *shape, SVGStylableImpl *style, double x, double y, double angle = 0.0); - void doMidMarker(SVGShapeImpl *shape, SVGStylableImpl *style, double x, double y, double angle = 0.0); - void doEndMarker(SVGShapeImpl *shape, SVGStylableImpl *style, double x, double y, double angle = 0.0); + void doStartMarker(SVGShapeImpl *tqshape, SVGStylableImpl *style, double x, double y, double angle = 0.0); + void doMidMarker(SVGShapeImpl *tqshape, SVGStylableImpl *style, double x, double y, double angle = 0.0); + void doEndMarker(SVGShapeImpl *tqshape, SVGStylableImpl *style, double x, double y, double angle = 0.0); private: - void doMarker(SVGShapeImpl *shape, SVGStylableImpl *style, double x, double y, double angle, const TQString &marker); + void doMarker(SVGShapeImpl *tqshape, SVGStylableImpl *style, double x, double y, double angle, const TQString &marker); }; class CanvasText : public CanvasItem diff --git a/ksvg/core/KSVGCanvas.cpp b/ksvg/core/KSVGCanvas.cpp index 1f504c02..d20264bf 100644 --- a/ksvg/core/KSVGCanvas.cpp +++ b/ksvg/core/KSVGCanvas.cpp @@ -181,7 +181,7 @@ void KSVGCanvas::resize(unsigned int w, unsigned int h) { for(CanvasItemList::ConstIterator it = chunk->list().begin(); it != chunk->list().end(); ++it) { - if(!drawables.contains(*it)) + if(!drawables.tqcontains(*it)) drawables.append(*it); } } @@ -203,7 +203,7 @@ void KSVGCanvas::resize(unsigned int w, unsigned int h) { for(CanvasItemList::ConstIterator it = chunk->list().begin(); it != chunk->list().end(); ++it) { - if(!drawables.contains(*it)) + if(!drawables.tqcontains(*it)) drawables.append(*it); } } @@ -254,7 +254,7 @@ void KSVGCanvas::clear(const TQRect &r) if(!r2.isEmpty() && m_buffer) { for(int i = 0; i < r2.height(); i++) - memset(m_buffer + int(r2.x() * m_nrChannels) + int((r2.y() + i) * (m_width * m_nrChannels)), qRgba(250, 250, 250, 250), r2.width() * m_nrChannels); + memset(m_buffer + int(r2.x() * m_nrChannels) + int((r2.y() + i) * (m_width * m_nrChannels)), tqRgba(250, 250, 250, 250), r2.width() * m_nrChannels); } } @@ -284,13 +284,13 @@ void KSVGCanvas::fill() } else { - Q_UINT32 *p = reinterpret_cast<Q_UINT32 *>(m_buffer); - unsigned char a = qAlpha(m_backgroundColor.rgb()); + TQ_UINT32 *p = reinterpret_cast<TQ_UINT32 *>(m_buffer); + unsigned char a = tqAlpha(m_backgroundColor.rgb()); #if X_BYTE_ORDER == X_LITTLE_ENDIAN - Q_UINT32 rgba = (a << 24) | (b << 16) | (g << 8) | r; + TQ_UINT32 rgba = (a << 24) | (b << 16) | (g << 8) | r; #else - Q_UINT32 rgba = (r << 24) | (g << 16) | (b << 8) | a; + TQ_UINT32 rgba = (r << 24) | (g << 16) | (b << 8) | a; #endif for(int i = 0; i < m_width * m_height; i++) *p++ = rgba; @@ -302,17 +302,17 @@ void KSVGCanvas::fill() void KSVGCanvas::clipToBuffer(int &x0, int &y0, int &x1, int &y1) const { // clamp to viewport - x0 = QMAX(x0, 0); - x0 = QMIN(x0, int(m_width - 1)); + x0 = TQMAX(x0, 0); + x0 = TQMIN(x0, int(m_width - 1)); - y0 = QMAX(y0, 0); - y0 = QMIN(y0, int(m_height - 1)); + y0 = TQMAX(y0, 0); + y0 = TQMIN(y0, int(m_height - 1)); - x1 = QMAX(x1, 0); - x1 = QMIN(x1, int(m_width - 1)); + x1 = TQMAX(x1, 0); + x1 = TQMIN(x1, int(m_width - 1)); - y1 = QMAX(y1, 0); - y1 = QMIN(y1, int(m_height - 1)); + y1 = TQMAX(y1, 0); + y1 = TQMIN(y1, int(m_height - 1)); } T2P::FontVisualParams *KSVGCanvas::fontVisualParams(SVGStylableImpl *style) const @@ -324,11 +324,11 @@ T2P::FontVisualParams *KSVGCanvas::fontVisualParams(SVGStylableImpl *style) cons EFontStyle fontStyle = style->getFontStyle(); TQString fontWeight = style->getFontWeight(); - if(fontWeight.contains("bold")) + if(fontWeight.tqcontains("bold")) weight |= FC_WEIGHT_DEMIBOLD; - if(fontWeight.contains("bolder")) + if(fontWeight.tqcontains("bolder")) weight |= FC_WEIGHT_BOLD; - if(fontWeight.contains("lighter")) + if(fontWeight.tqcontains("lighter")) weight |= FC_WEIGHT_LIGHT; bool ok = true; @@ -341,7 +341,7 @@ T2P::FontVisualParams *KSVGCanvas::fontVisualParams(SVGStylableImpl *style) cons slant |= FC_SLANT_ROMAN; else if(fontStyle == ITALIC) slant |= FC_SLANT_ITALIC; - else if(fontStyle == OBLIQUE) + else if(fontStyle == OBLITQUE) slant |= FC_SLANT_OBLIQUE; // Calc font names @@ -362,9 +362,9 @@ T2P::FontVisualParams *KSVGCanvas::fontVisualParams(SVGStylableImpl *style) cons return fontVisualParams; } -void KSVGCanvas::invalidate(CanvasItem *item, bool recalc) +void KSVGCanvas::tqinvalidate(CanvasItem *item, bool recalc) { - if(m_chunksByItem.find(item) != m_chunksByItem.end()) + if(m_chunksByItem.tqfind(item) != m_chunksByItem.end()) { if(recalc) { @@ -376,7 +376,7 @@ void KSVGCanvas::invalidate(CanvasItem *item, bool recalc) for(it.toFirst(); it.current(); ++it) { (*it)->setDirty(); - if(!m_dirtyChunks.contains(*it)) + if(!m_dirtyChunks.tqcontains(*it)) m_dirtyChunks.append(*it); } } @@ -395,7 +395,7 @@ void KSVGCanvas::insert(CanvasItem *item, int z) bool visible = item->isVisible(); if(visible) - invalidate(item, false); + tqinvalidate(item, false); if(m_immediateUpdate) { @@ -429,7 +429,7 @@ void KSVGCanvas::removeFromChunks(CanvasItem *item) for(it.toFirst(); it.current(); ++it) { (*it)->remove(item); - if(!m_dirtyChunks.contains(*it)) + if(!m_dirtyChunks.tqcontains(*it)) m_dirtyChunks.append(*it); } m_chunksByItem.remove(item); @@ -462,15 +462,15 @@ void KSVGCanvas::addToChunks(CanvasItem *item) unsigned int KSVGCanvas::setElementItemZIndexRecursive(SVGElementImpl *element, unsigned int z) { - SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element); + SVGShapeImpl *tqshape = dynamic_cast<SVGShapeImpl *>(element); - if(shape) + if(tqshape) { - CanvasItem *item = shape->item(); + CanvasItem *item = tqshape->item(); if(item) { - SVGImageElementImpl *image = dynamic_cast<SVGImageElementImpl *>(shape); + SVGImageElementImpl *image = dynamic_cast<SVGImageElementImpl *>(tqshape); if(image && image->svgImageRootElement()) { @@ -481,7 +481,7 @@ unsigned int KSVGCanvas::setElementItemZIndexRecursive(SVGElementImpl *element, else { item->setZIndex(z); - invalidate(item, false); + tqinvalidate(item, false); z++; } } @@ -540,7 +540,7 @@ void KSVGCanvas::update(const TQPoint &panPoint, bool erase) { for(CanvasItemList::ConstIterator it = chunk->list().begin(); it != chunk->list().end(); ++it) { - if(!drawables.contains(*it)) + if(!drawables.tqcontains(*it)) drawables.append(*it); } } @@ -607,7 +607,7 @@ void KSVGCanvas::update(float zoomFactor) { for(CanvasItemList::ConstIterator it = chunk->list().begin(); it != chunk->list().end(); ++it) { - if(!drawables.contains(*it)) + if(!drawables.tqcontains(*it)) drawables.append(*it); } } @@ -666,7 +666,7 @@ void KSVGCanvas::update() for(CanvasItemList::ConstIterator it = chunk->list().begin(); it != chunk->list().end(); ++it) { // kdDebug(26005) << k_funcinfo << " Checking: " << *it << endl; - if(!drawables.contains(*it)) + if(!drawables.tqcontains(*it)) { // kdDebug(26005) << k_funcinfo << " Yes, appending to update list!" << endl; drawables.append(*it); @@ -724,7 +724,7 @@ CanvasItemList KSVGCanvas::collisions(const TQPoint &p, bool exact) const { for(CanvasItemList::Iterator it = list.begin(); it != list.end(); ++it) { - if((*it)->fillContains(p) || (*it)->strokeContains(p) || (*it)->bbox().contains(p)) + if((*it)->fillContains(p) || (*it)->strokeContains(p) || (*it)->bbox().tqcontains(p)) result.append(*it); } @@ -740,20 +740,20 @@ void KSVGCanvas::blit(const TQRect &rect, bool direct) { // clamp to viewport int x0 = rect.x(); - x0 = QMAX(x0, 0); - x0 = QMIN(x0, int(m_width - 1)); + x0 = TQMAX(x0, 0); + x0 = TQMIN(x0, int(m_width - 1)); int y0 = rect.y(); - y0 = QMAX(y0, 0); - y0 = QMIN(y0, int(m_height - 1)); + y0 = TQMAX(y0, 0); + y0 = TQMIN(y0, int(m_height - 1)); int x1 = rect.x() + rect.width() + 1; - x1 = QMAX(x1, 0); - x1 = QMIN(x1, int(m_width)); + x1 = TQMAX(x1, 0); + x1 = TQMIN(x1, int(m_width)); int y1 = rect.y() + rect.height() + 1; - y1 = QMAX(y1, 0); - y1 = QMIN(y1, int(m_height)); + y1 = TQMAX(y1, 0); + y1 = TQMIN(y1, int(m_height)); xlib_draw_rgb_image(direct ? m_directWindow->handle() : m_drawWindow->handle(), m_gc, x0, y0, x1 - x0, y1 - y0, XLIB_RGB_DITHER_NONE, m_buffer + (m_width * y0 + x0) * m_nrChannels, m_width * m_nrChannels); } @@ -766,7 +766,7 @@ void KSVGCanvas::blit() void KSVGCanvas::ChunkManager::addChunk(CanvasChunk *chunk) { - TQString key = TQString("%1 %2").arg(chunk->x()).arg(chunk->y()); + TQString key = TQString("%1 %2").tqarg(chunk->x()).tqarg(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; - TQString key = TQString("%1 %2").arg(x).arg(y); + TQString key = TQString("%1 %2").tqarg(x).tqarg(y); return m_chunks[key]; } diff --git a/ksvg/core/KSVGCanvas.h b/ksvg/core/KSVGCanvas.h index aa41e6c2..367d17d4 100644 --- a/ksvg/core/KSVGCanvas.h +++ b/ksvg/core/KSVGCanvas.h @@ -56,9 +56,10 @@ class CanvasClipPath; class CanvasPaintServer; // Must be a TQObject to be able to be loaded by KLibLoader... -class KSVGCanvas : public QObject +class KSVGCanvas : public TQObject { Q_OBJECT + TQ_OBJECT public: KSVGCanvas(unsigned int width, unsigned int height); virtual ~KSVGCanvas(); @@ -74,7 +75,7 @@ public: 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); + void tqinvalidate(CanvasItem *item, bool recalc = true); CanvasItemList collisions(const TQPoint &p, bool exact = false) const; void setBackgroundColor(const TQColor &c) { m_backgroundColor = c; } @@ -125,7 +126,7 @@ public: T2P::FontVisualParams *fontVisualParams(SVGStylableImpl *style) const; virtual T2P::BezierPath *toBezierPath(CanvasItem *item) const { Q_UNUSED(item); return 0; } - // Assign z indices to the element and its children, starting with z, and + // Assign z indices to the element and its tqchildren, starting with z, and // return the next z value to be used. unsigned int setElementItemZIndexRecursive(SVGElementImpl *element, unsigned int z); diff --git a/ksvg/core/KSVGHelper.h b/ksvg/core/KSVGHelper.h index 27c8b88f..fe68b77e 100644 --- a/ksvg/core/KSVGHelper.h +++ b/ksvg/core/KSVGHelper.h @@ -73,12 +73,12 @@ public: static unsigned int toArtColor(const TQColor &color) { - return (qRed(color.rgb()) << 24) | (qGreen(color.rgb()) << 16) | ( qBlue(color.rgb()) << 8) | (qAlpha(color.rgb())); + return (tqRed(color.rgb()) << 24) | (tqGreen(color.rgb()) << 16) | ( tqBlue(color.rgb()) << 8) | (tqAlpha(color.rgb())); } static unsigned int toArtColor(const TQColor &color, short opacity) { - return (qRed(color.rgb()) << 24) | (qGreen(color.rgb()) << 16) | ( qBlue(color.rgb()) << 8) | (opacity); + return (tqRed(color.rgb()) << 24) | (tqGreen(color.rgb()) << 16) | ( tqBlue(color.rgb()) << 8) | (opacity); } static int linearRGBFromsRGB(int sRGB8bit) { return m_linearRGBFromsRGB[sRGB8bit]; } diff --git a/ksvg/core/KSVGLoader.cpp b/ksvg/core/KSVGLoader.cpp index 63c3efc8..9e8c5c54 100644 --- a/ksvg/core/KSVGLoader.cpp +++ b/ksvg/core/KSVGLoader.cpp @@ -60,7 +60,7 @@ TQString KSVGLoader::loadXML(::KURL url) return TQString(contents); } - return TQString::null; + return TQString(); } void KSVGLoader::getSVGContent(::KURL url) @@ -125,17 +125,17 @@ void KSVGLoader::slotResult(KIO::Job *job) if(m_job->error() == 0) { TQString check = static_cast<KIO::TransferJob *>(job)->url().prettyURL(); - if(check.contains(".svgz") || check.contains(".svg.gz")) + if(check.tqcontains(".svgz") || check.tqcontains(".svg.gz")) { // decode the gzipped svg and emit it - TQIODevice *dev = KFilterDev::device(new TQBuffer(m_data), "application/x-gzip"); + TQIODevice *dev = KFilterDev::device(TQT_TQIODEVICE(new TQBuffer(m_data)), "application/x-gzip"); dev->open(IO_ReadOnly); emit gotResult(dev); } else { m_job = 0; - emit gotResult(new TQBuffer(m_data)); + emit gotResult(TQT_TQIODEVICE(new TQBuffer(m_data))); m_data.resize(0); } } @@ -162,7 +162,7 @@ void KSVGLoader::slotResult(KIO::Job *job) if(buffer.open(IO_ReadOnly)) { - const char *imageFormat = TQImageIO::imageFormat(&buffer); + const char *imageFormat = TQImageIO::imageFormat(TQT_TQIODEVICE(&buffer)); if(imageFormat != 0) { @@ -199,7 +199,7 @@ TQString KSVGLoader::getUrl(::KURL url, bool local) if(local || (!url.prettyURL().isEmpty()) && ((url.protocol() == "http") || (url.protocol() == "https"))) return loadXML(url); - return TQString::null; + return TQString(); } void KSVGLoader::postUrl(::KURL url, const TQByteArray &data, const TQString &mimeType, KJS::ExecState *exec, KJS::Object &callBackFunction, KJS::Object &status) @@ -215,7 +215,7 @@ void KSVGLoader::postUrl(::KURL url, const TQByteArray &data, const TQString &mi connect(job, TQT_SIGNAL(result(KIO::Job *)), TQT_SLOT(slotResult(KIO::Job *))); } -class CharacterDataSearcher : public QXmlDefaultHandler +class CharacterDataSearcher : public TQXmlDefaultHandler { public: CharacterDataSearcher(const TQString &id) : m_id(id) { } @@ -289,7 +289,7 @@ TQString KSVGLoader::getCharacterData(::KURL url, const TQString &id) -class SVGFragmentSearcher : public QXmlDefaultHandler +class SVGFragmentSearcher : public TQXmlDefaultHandler { public: SVGFragmentSearcher(SVGDocumentImpl *doc, const TQString &id, ::KURL url) : m_id(id), m_url(url), m_doc(doc) { } @@ -348,7 +348,7 @@ public: // Convert the id to its mangled version. TQString id = "@fragment@" + m_url.prettyURL() + "@" + value; - if(m_idMap.contains(id)) + if(m_idMap.tqcontains(id)) { // This is a local reference to an element within the fragment. // Just convert the href. diff --git a/ksvg/core/KSVGLoader.h b/ksvg/core/KSVGLoader.h index 443d0fb7..28ebda01 100644 --- a/ksvg/core/KSVGLoader.h +++ b/ksvg/core/KSVGLoader.h @@ -52,9 +52,10 @@ typedef struct class SVGImageElementImpl; class SVGElementImpl; class SVGDocumentImpl; -class KSVGLoader : public QObject +class KSVGLoader : public TQObject { Q_OBJECT + TQ_OBJECT public: KSVGLoader(); ~KSVGLoader(); diff --git a/ksvg/core/KSVGReader.cc b/ksvg/core/KSVGReader.cc index e479b9a1..690069ba 100644 --- a/ksvg/core/KSVGReader.cc +++ b/ksvg/core/KSVGReader.cc @@ -84,7 +84,7 @@ private: TQString m_SVGFragmentId; }; -class InputHandler : public QXmlDefaultHandler +class InputHandler : public TQXmlDefaultHandler { public: virtual bool startDocument(); @@ -146,13 +146,13 @@ SVGSVGElementImpl *Helper::nextSVGElement(SVGElementImpl *elem) SVGSVGElementImpl *Helper::nextSVGElement(DOM::Node elem) { DOM::Node foundSVG; - DOM::Node shape = elem.parentNode(); + DOM::Node tqshape = elem.parentNode(); - for(; !shape.isNull(); shape = shape.parentNode()) + for(; !tqshape.isNull(); tqshape = tqshape.parentNode()) { - if(reinterpret_cast<DOM::Element &>(shape).nodeName() == "svg") + if(reinterpret_cast<DOM::Element &>(tqshape).nodeName() == "svg") { - foundSVG = shape; + foundSVG = tqshape; break; } } @@ -245,7 +245,7 @@ bool InputHandler::startElement(const TQString &namespaceURI, const TQString &, SVGLengthImpl *height = SVGSVGElementImpl::createSVGLength(); width->setValueAsString(svg->getAttribute("width").string()); height->setValueAsString(svg->getAttribute("height").string()); - TQString viewbox = TQString("0 0 %1 %2").arg(width->value()).arg(height->value()); + TQString viewbox = TQString("0 0 %1 %2").tqarg(width->value()).tqarg(height->value()); //kdDebug(26001) << "VIEWBOX : " << viewbox.latin1() << endl; svg->setAttribute("viewBox", viewbox); width->deref(); @@ -289,7 +289,7 @@ bool InputHandler::startElement(const TQString &namespaceURI, const TQString &, Helper::self()->doc()->appendChild(*newElement); // Special logics: - if(qName == "switch" || qName == "pattern" || qName == "mask") + if(qName == "switch" || qName == "pattern" || qName == "tqmask") m_noRendering = true; } @@ -300,13 +300,13 @@ bool InputHandler::startElement(const TQString &namespaceURI, const TQString &, if(svg && svg->ownerSVGElement() == 0) { - SVGImageElementImpl *parentImage = Helper::self()->doc()->parentImage(); + SVGImageElementImpl *tqparentImage = Helper::self()->doc()->tqparentImage(); - if(parentImage) + if(tqparentImage) { // We're being displayed in a document via an 'image' element. Set // us up to fit into it's rectangle. - parentImage->setupSVGElement(svg); + tqparentImage->setupSVGElement(svg); } } @@ -316,25 +316,25 @@ bool InputHandler::startElement(const TQString &namespaceURI, const TQString &, { // Set up the cached screenCTM SVGLocatableImpl *locatableParent = 0; - DOM::Node parentNode = newElement->parentNode(); + DOM::Node tqparentNode = newElement->parentNode(); - if(!parentNode.isNull()) + if(!tqparentNode.isNull()) { - SVGElementImpl *parent = Helper::self()->doc()->getElementFromHandle(parentNode.handle()); + SVGElementImpl *tqparent = Helper::self()->doc()->getElementFromHandle(tqparentNode.handle()); - if(parent) - locatableParent = dynamic_cast<SVGLocatableImpl *>(parent); + if(tqparent) + locatableParent = dynamic_cast<SVGLocatableImpl *>(tqparent); } - SVGMatrixImpl *parentMatrix = 0; + SVGMatrixImpl *tqparentMatrix = 0; if(locatableParent) - parentMatrix = locatableParent->getScreenCTM(); + tqparentMatrix = locatableParent->getScreenCTM(); else - parentMatrix = SVGSVGElementImpl::createSVGMatrix(); + tqparentMatrix = SVGSVGElementImpl::createSVGMatrix(); - locatable->updateCachedScreenCTM(parentMatrix); - parentMatrix->deref(); + locatable->updateCachedScreenCTM(tqparentMatrix); + tqparentMatrix->deref(); } m_currentNode = newElement; @@ -349,7 +349,7 @@ bool InputHandler::endElement(const TQString &, const TQString &, const TQString SVGSVGElementImpl *root = Helper::self()->nextSVGElement(*m_currentNode); SVGElementImpl *element = root ? root->ownerDoc()->getElementFromHandle(m_currentNode->handle()) : Helper::self()->doc()->getElementFromHandle(m_currentNode->handle()); - SVGShapeImpl *shape = dynamic_cast<SVGShapeImpl *>(element); + SVGShapeImpl *tqshape = dynamic_cast<SVGShapeImpl *>(element); SVGTestsImpl *tests = dynamic_cast<SVGTestsImpl *>(element); SVGStylableImpl *style = dynamic_cast<SVGStylableImpl *>(element); @@ -386,18 +386,18 @@ bool InputHandler::endElement(const TQString &, const TQString &, const TQString if(haveCanvas && (tests ? tests->ok() : true)) { - if((shape && !shape->isContainer()) || (!shape && element)) + if((tqshape && !tqshape->isContainer()) || (!tqshape && element)) element->createItem(); } } // Special logics: - if(qName == "switch" || qName == "pattern" || qName == "mask") + if(qName == "switch" || qName == "pattern" || qName == "tqmask") { m_noRendering = false; bool ok = tests ? tests->ok() : true; - if(haveCanvas && element && style && ok && style->getDisplay() && style->getVisible() && qName == "pattern" || (shape && shape->directRender())) + if(haveCanvas && element && style && ok && style->getDisplay() && style->getVisible() && qName == "pattern" || (tqshape && tqshape->directRender())) element->createItem(); } @@ -426,10 +426,10 @@ bool InputHandler::fatalError(const TQXmlParseException &e) if(Helper::self()->hasError()) { error = Helper::self()->errorDescription(); - Helper::self()->setErrorDescription(TQString::null); + Helper::self()->setErrorDescription(TQString()); } else - error = TQString("[%1:%2]: FATAL ERROR: %3").arg(e.lineNumber()).arg(e.columnNumber()).arg(e.message()); + error = TQString("[%1:%2]: FATAL ERROR: %3").tqarg(e.lineNumber()).tqarg(e.columnNumber()).tqarg(e.message()); kdDebug(26001) << "InputHandler::fatalError, " << error << endl; diff --git a/ksvg/core/KSVGReader.h b/ksvg/core/KSVGReader.h index 49259d7d..136b145f 100644 --- a/ksvg/core/KSVGReader.h +++ b/ksvg/core/KSVGReader.h @@ -28,9 +28,10 @@ namespace KSVG { class SVGDocumentImpl; -class KSVGReader : public QObject +class KSVGReader : public TQObject { Q_OBJECT + TQ_OBJECT public: struct ParsingArgs { |