summaryrefslogtreecommitdiffstats
path: root/kdecore/svgicons
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-03 04:12:51 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-03 04:12:51 +0000
commit560378aaca1784ba19806a0414a32b20c744de39 (patch)
treece0dfd7c3febf2a1adc7603d1019a8be2083c415 /kdecore/svgicons
parentd4d5af1cdbd3cc65d095e0afc5b1f4260091cf5d (diff)
downloadtdelibs-560378aaca1784ba19806a0414a32b20c744de39.tar.gz
tdelibs-560378aaca1784ba19806a0414a32b20c744de39.zip
Automated conversion for enhanced compatibility with TQt for Qt4 3.4.0 TP1
NOTE: This will not compile with Qt4 (yet), however it does compile with Qt3 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1211081 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kdecore/svgicons')
-rw-r--r--kdecore/svgicons/ksvgiconengine.cpp34
-rw-r--r--kdecore/svgicons/ksvgiconpainter.cpp162
-rw-r--r--kdecore/svgicons/ksvgiconpainter.h8
3 files changed, 102 insertions, 102 deletions
diff --git a/kdecore/svgicons/ksvgiconengine.cpp b/kdecore/svgicons/ksvgiconengine.cpp
index dd54e99be..858a210bb 100644
--- a/kdecore/svgicons/ksvgiconengine.cpp
+++ b/kdecore/svgicons/ksvgiconengine.cpp
@@ -64,7 +64,7 @@ public:
oldOffset = newOffset;
TQString temp = element.attribute("offset");
- if(temp.contains("%"))
+ if(temp.tqcontains("%"))
{
temp = temp.left(temp.length() - 1);
newOffset = temp.toFloat() / 100.0;
@@ -127,12 +127,12 @@ public:
TQColor qStopColor = m_engine->painter()->parseColor(parseColor);
// Convert in a libart suitable form
- Q_UINT32 stopColor = m_engine->painter()->toArtColor(qStopColor);
+ TQ_UINT32 stopColor = m_engine->painter()->toArtColor(qStopColor);
int opacity = m_engine->painter()->parseOpacity(parseOpacity);
- Q_UINT32 rgba = (stopColor << 8) | opacity;
- Q_UINT32 r, g, b, a;
+ TQ_UINT32 rgba = (stopColor << 8) | opacity;
+ TQ_UINT32 r, g, b, a;
// Convert from separated to premultiplied alpha
a = rgba & 0xff;
@@ -170,12 +170,12 @@ public:
points = points.simplifyWhiteSpace();
- if(points.contains(",,") || points.contains(", ,"))
+ if(points.tqcontains(",,") || points.tqcontains(", ,"))
return TQPointArray();
- points.replace(',', ' ');
- points.replace('\r', TQString::null);
- points.replace('\n', TQString::null);
+ points.tqreplace(',', ' ');
+ points.tqreplace('\r', TQString::null);
+ points.tqreplace('\n', TQString::null);
points = points.simplifyWhiteSpace();
@@ -201,7 +201,7 @@ public:
// Combine new and old matrix
TQWMatrix matrix = m_engine->painter()->parseTransform(transform);
- TQWMatrix *current = m_engine->painter()->worldMatrix();
+ TQWMatrix *current = m_engine->painter()->tqworldMatrix();
*current = matrix * *current;
}
@@ -221,9 +221,9 @@ public:
TQPtrList<TQDomNamedNodeMap> applyList;
applyList.setAutoDelete(true);
- TQDomNode shape = node.parentNode();
- for(; !shape.isNull() ; shape = shape.parentNode())
- applyList.prepend(new TQDomNamedNodeMap(shape.attributes()));
+ TQDomNode tqshape = node.parentNode();
+ for(; !tqshape.isNull() ; tqshape = tqshape.parentNode())
+ applyList.prepend(new TQDomNamedNodeMap(tqshape.attributes()));
// Apply parent attributes
for(TQDomNamedNodeMap *map = applyList.first(); map != 0; map = applyList.next())
@@ -403,10 +403,10 @@ public:
{
bool filled = true;
- if(element.hasAttribute("fill") && element.attribute("fill").contains("none"))
+ if(element.hasAttribute("fill") && element.attribute("fill").tqcontains("none"))
filled = false;
- if(element.attribute("style").contains("fill") && element.attribute("style").stripWhiteSpace().contains("fill:none"))
+ if(element.attribute("style").tqcontains("fill") && element.attribute("style").stripWhiteSpace().tqcontains("fill:none"))
filled = false;
m_engine->painter()->drawPath(element.attribute("d"), filled);
@@ -622,7 +622,7 @@ bool KSVGIconEngine::load(int width, int height, const TQString &path)
d->width = w;
d->height = h;
- d->painter->worldMatrix()->scale(vratiow, vratioh);
+ d->painter->tqworldMatrix()->scale(vratiow, vratioh);
}
else
{
@@ -631,10 +631,10 @@ bool KSVGIconEngine::load(int width, int height, const TQString &path)
double ratiow = width / d->width;
double ratioh = height / d->height;
- d->painter->worldMatrix()->scale(ratiow, ratioh);
+ d->painter->tqworldMatrix()->scale(ratiow, ratioh);
}
- TQWMatrix initialMatrix = *d->painter->worldMatrix();
+ TQWMatrix initialMatrix = *d->painter->tqworldMatrix();
d->helper->m_initialMatrix = initialMatrix;
// Apply transform
diff --git a/kdecore/svgicons/ksvgiconpainter.cpp b/kdecore/svgicons/ksvgiconpainter.cpp
index 811dfe918..d24f56662 100644
--- a/kdecore/svgicons/ksvgiconpainter.cpp
+++ b/kdecore/svgicons/ksvgiconpainter.cpp
@@ -65,7 +65,7 @@ public:
m_useFillGradient = false;
m_useStrokeGradient = false;
- m_worldMatrix = new TQWMatrix();
+ m_tqworldMatrix = new TQWMatrix();
// Create new image with alpha support
m_image = new TQImage(width, height, 32);
@@ -102,7 +102,7 @@ public:
art_free(m_buffer);
delete m_image;
- delete m_worldMatrix;
+ delete m_tqworldMatrix;
for(TQMap<TQString, ArtGradientLinear *>::Iterator it = m_linearGradientMap.begin(); it != m_linearGradientMap.end(); ++it)
{
@@ -185,7 +185,7 @@ public:
m_tempBuffer = 0;
}
- Q_UINT32 toArtColor(const TQColor &color)
+ TQ_UINT32 toArtColor(const TQColor &color)
{
// Convert in a libart suitable form
TQString tempName = color.name();
@@ -211,7 +211,7 @@ public:
return result;
}
- void drawSVP(ArtSVP *svp, Q_UINT32 rgb, int opacity)
+ void drawSVP(ArtSVP *svp, TQ_UINT32 rgb, int opacity)
{
if(!svp)
return;
@@ -233,12 +233,12 @@ public:
void drawBPath(ArtBpath *bpath)
{
double affine[6];
- affine[0] = m_worldMatrix->m11();
- affine[1] = m_worldMatrix->m12();
- affine[2] = m_worldMatrix->m21();
- affine[3] = m_worldMatrix->m22();
- affine[4] = m_worldMatrix->dx();
- affine[5] = m_worldMatrix->dy();
+ affine[0] = m_tqworldMatrix->m11();
+ affine[1] = m_tqworldMatrix->m12();
+ affine[2] = m_tqworldMatrix->m21();
+ affine[3] = m_tqworldMatrix->m22();
+ affine[4] = m_tqworldMatrix->dx();
+ affine[5] = m_tqworldMatrix->dy();
ArtBpath *temp = art_bpath_affine_transform(bpath, affine);
ArtVpath *vec = art_bez_path_to_vec(temp, 0.25);
@@ -249,12 +249,12 @@ public:
void drawVPath(ArtVpath *vec)
{
double affine[6];
- affine[0] = m_worldMatrix->m11();
- affine[1] = m_worldMatrix->m12();
- affine[2] = m_worldMatrix->m21();
- affine[3] = m_worldMatrix->m22();
- affine[4] = m_worldMatrix->dx();
- affine[5] = m_worldMatrix->dy();
+ affine[0] = m_tqworldMatrix->m11();
+ affine[1] = m_tqworldMatrix->m12();
+ affine[2] = m_tqworldMatrix->m21();
+ affine[3] = m_tqworldMatrix->m22();
+ affine[4] = m_tqworldMatrix->dx();
+ affine[5] = m_tqworldMatrix->dy();
ArtVpath *temp = art_vpath_affine_transform(vec, affine);
art_free(vec);
@@ -267,7 +267,7 @@ public:
ArtSVP *svp;
ArtSVP *fillSVP = 0, *strokeSVP = 0;
- Q_UINT32 fillColor = 0, strokeColor = 0;
+ TQ_UINT32 fillColor = 0, strokeColor = 0;
// Filling
{
@@ -461,10 +461,10 @@ public:
m.map(x1, y1, &x1, &y1);
m.map(x2, y2, &x2, &y2);
- double x1n = x1 * m_worldMatrix->m11() + y1 * m_worldMatrix->m21() + m_worldMatrix->dx();
- double y1n = x1 * m_worldMatrix->m12() + y1 * m_worldMatrix->m22() + m_worldMatrix->dy();
- double x2n = x2 * m_worldMatrix->m11() + y2 * m_worldMatrix->m21() + m_worldMatrix->dx();
- double y2n = x2 * m_worldMatrix->m12() + y2 * m_worldMatrix->m22() + m_worldMatrix->dy();
+ double x1n = x1 * m_tqworldMatrix->m11() + y1 * m_tqworldMatrix->m21() + m_tqworldMatrix->dx();
+ double y1n = x1 * m_tqworldMatrix->m12() + y1 * m_tqworldMatrix->m22() + m_tqworldMatrix->dy();
+ double x2n = x2 * m_tqworldMatrix->m11() + y2 * m_tqworldMatrix->m21() + m_tqworldMatrix->dx();
+ double y2n = x2 * m_tqworldMatrix->m12() + y2 * m_tqworldMatrix->m22() + m_tqworldMatrix->dy();
double dx = x2n - x1n;
double dy = y2n - y1n;
@@ -515,12 +515,12 @@ public:
else
fy = cy;
- radial->affine[0] = m_worldMatrix->m11();
- radial->affine[1] = m_worldMatrix->m12();
- radial->affine[2] = m_worldMatrix->m21();
- radial->affine[3] = m_worldMatrix->m22();
- radial->affine[4] = m_worldMatrix->dx();
- radial->affine[5] = m_worldMatrix->dy();
+ radial->affine[0] = m_tqworldMatrix->m11();
+ radial->affine[1] = m_tqworldMatrix->m12();
+ radial->affine[2] = m_tqworldMatrix->m21();
+ radial->affine[3] = m_tqworldMatrix->m22();
+ radial->affine[4] = m_tqworldMatrix->dx();
+ radial->affine[5] = m_tqworldMatrix->dy();
radial->fx = (fx - cx) / r;
radial->fy = (fy - cy) / r;
@@ -674,7 +674,7 @@ public:
{
QRgb *sl = reinterpret_cast<QRgb *>(m_image->scanLine(y));
for(int x = 0; x < m_width; x++)
- sl[x] = qRgba(line[x * 4], line[x * 4 + 1], line[x * 4 + 2], line[x * 4 + 3]);
+ sl[x] = tqRgba(line[x * 4], line[x * 4 + 1], line[x * 4 + 2], line[x * 4 + 3]);
line += m_rowstride;
}
@@ -1123,7 +1123,7 @@ private:
ArtSVP *m_clipSVP;
TQImage *m_image;
- TQWMatrix *m_worldMatrix;
+ TQWMatrix *m_tqworldMatrix;
TQString m_fillRule;
TQString m_joinStyle;
@@ -1211,17 +1211,17 @@ TQImage *KSVGIconPainter::image()
return new TQImage(*d->helper->m_image);
}
-TQWMatrix *KSVGIconPainter::worldMatrix()
+TQWMatrix *KSVGIconPainter::tqworldMatrix()
{
- return d->helper->m_worldMatrix;
+ return d->helper->m_tqworldMatrix;
}
void KSVGIconPainter::setWorldMatrix(TQWMatrix *matrix)
{
- if(d->helper->m_worldMatrix)
- delete d->helper->m_worldMatrix;
+ if(d->helper->m_tqworldMatrix)
+ delete d->helper->m_tqworldMatrix;
- d->helper->m_worldMatrix = matrix;
+ d->helper->m_tqworldMatrix = matrix;
}
void KSVGIconPainter::setStrokeWidth(double width)
@@ -1263,8 +1263,8 @@ void KSVGIconPainter::setStrokeColor(const TQString &stroke)
TQString url = stroke;
- unsigned int start = url.find("#") + 1;
- unsigned int end = url.findRev(")");
+ unsigned int start = url.tqfind("#") + 1;
+ unsigned int end = url.tqfindRev(")");
d->helper->m_strokeGradientReference = url.mid(start, end - start);
}
@@ -1291,8 +1291,8 @@ void KSVGIconPainter::setFillColor(const TQString &fill)
TQString url = fill;
- unsigned int start = url.find("#") + 1;
- unsigned int end = url.findRev(")");
+ unsigned int start = url.tqfind("#") + 1;
+ unsigned int end = url.tqfindRev(")");
d->helper->m_fillGradientReference = url.mid(start, end - start);
}
@@ -1315,7 +1315,7 @@ void KSVGIconPainter::setFillRule(const TQString &fillRule)
d->helper->m_fillRule = fillRule;
}
-Q_UINT32 KSVGIconPainter::parseOpacity(const TQString &data)
+TQ_UINT32 KSVGIconPainter::parseOpacity(const TQString &data)
{
int opacity = 255;
@@ -1323,7 +1323,7 @@ Q_UINT32 KSVGIconPainter::parseOpacity(const TQString &data)
{
double temp;
- if(data.contains("%"))
+ if(data.tqcontains("%"))
{
TQString tempString = data.left(data.length() - 1);
temp = double(255 * tempString.toDouble()) / 100.0;
@@ -1736,7 +1736,7 @@ void KSVGIconPainter::drawPath(const TQString &data, bool filled)
double curx = 0.0, cury = 0.0, contrlx = 0.0, contrly = 0.0, xc, yc;
unsigned int lastCommand = 0;
- TQString _d = value.replace(",", " ");
+ TQString _d = value.tqreplace(",", " ");
_d = _d.simplifyWhiteSpace();
const char *ptr = _d.latin1();
const char *end = _d.latin1() + _d.length() + 1;
@@ -1759,12 +1759,12 @@ void KSVGIconPainter::drawPath(const TQString &data, bool filled)
if(index != -1 && lastCommand != 'z')
{
// Find last subpath
- int find = -1;
+ int tqfind = -1;
for(int i = index; i >= 0; i--)
{
if(vec[i].code == ART_MOVETO_OPEN || vec[i].code == ART_MOVETO)
{
- find = i;
+ tqfind = i;
break;
}
}
@@ -1775,8 +1775,8 @@ void KSVGIconPainter::drawPath(const TQString &data, bool filled)
vec.resize(index + 1);
vec[index].code = (ArtPathcode)ART_END2;
- vec[index].x3 = vec[find].x3;
- vec[index].y3 = vec[find].y3;
+ vec[index].x3 = vec[tqfind].x3;
+ vec[index].y3 = vec[tqfind].y3;
}
curx += tox;
@@ -1798,12 +1798,12 @@ void KSVGIconPainter::drawPath(const TQString &data, bool filled)
if(index != -1 && lastCommand != 'z')
{
// Find last subpath
- int find = -1;
+ int tqfind = -1;
for(int i = index; i >= 0; i--)
{
if(vec[i].code == ART_MOVETO_OPEN || vec[i].code == ART_MOVETO)
{
- find = i;
+ tqfind = i;
break;
}
}
@@ -1814,8 +1814,8 @@ void KSVGIconPainter::drawPath(const TQString &data, bool filled)
vec.resize(index + 1);
vec[index].code = (ArtPathcode)ART_END2;
- vec[index].x3 = vec[find].x3;
- vec[index].y3 = vec[find].y3;
+ vec[index].x3 = vec[tqfind].x3;
+ vec[index].y3 = vec[tqfind].y3;
}
curx = tox;
@@ -2137,34 +2137,34 @@ void KSVGIconPainter::drawPath(const TQString &data, bool filled)
break;
case 'z':
case 'Z':
- int find;
- find = -1;
+ int tqfind;
+ tqfind = -1;
for(int i = index; i >= 0; i--)
{
if(vec[i].code == ART_MOVETO_OPEN || vec[i].code == ART_MOVETO)
{
- find = i;
+ tqfind = i;
break;
}
}
- if(find != -1)
+ if(tqfind != -1)
{
- if(vec[find].x3 != curx || vec[find].y3 != cury)
+ if(vec[tqfind].x3 != curx || vec[tqfind].y3 != cury)
{
index++;
d->helper->ensureSpace(vec, index);
vec[index].code = ART_LINETO;
- vec[index].x3 = vec[find].x3;
- vec[index].y3 = vec[find].y3;
+ vec[index].x3 = vec[tqfind].x3;
+ vec[index].y3 = vec[tqfind].y3;
}
}
// reset for next (sub)path
- curx = vec[find].x3;
- cury = vec[find].y3;
+ curx = vec[tqfind].x3;
+ cury = vec[tqfind].y3;
lastCommand = 'z';
break;
@@ -2231,20 +2231,20 @@ void KSVGIconPainter::drawPath(const TQString &data, bool filled)
}
// Find last subpath
- int find = -1;
+ int tqfind = -1;
for(int i = index; i >= 0; i--)
{
if(vec[i].code == ART_MOVETO_OPEN || vec[i].code == ART_MOVETO)
{
- find = i;
+ tqfind = i;
break;
}
}
// Fix a problem where the .svg file used doubles as values... (sofico.svg)
- if(curx != vec[find].x3 && cury != vec[find].y3)
+ if(curx != vec[tqfind].x3 && cury != vec[tqfind].y3)
{
- if((int) curx == (int) vec[find].x3 && (int) cury == (int) vec[find].y3)
+ if((int) curx == (int) vec[tqfind].x3 && (int) cury == (int) vec[tqfind].y3)
{
index++;
@@ -2252,18 +2252,18 @@ void KSVGIconPainter::drawPath(const TQString &data, bool filled)
vec.resize(index + 1);
vec[index].code = ART_LINETO;
- vec[index].x3 = vec[find].x3;
- vec[index].y3 = vec[find].y3;
+ vec[index].x3 = vec[tqfind].x3;
+ vec[index].y3 = vec[tqfind].y3;
- curx = vec[find].x3;
- cury = vec[find].y3;
+ curx = vec[tqfind].x3;
+ cury = vec[tqfind].y3;
}
}
// Handle filled paths that are not closed explicitly
if(filled)
{
- if((int) curx != (int) vec[find].x3 || (int) cury != (int) vec[find].y3)
+ if((int) curx != (int) vec[tqfind].x3 || (int) cury != (int) vec[tqfind].y3)
{
index++;
@@ -2271,11 +2271,11 @@ void KSVGIconPainter::drawPath(const TQString &data, bool filled)
vec.resize(index + 1);
vec[index].code = (ArtPathcode)ART_END2;
- vec[index].x3 = vec[find].x3;
- vec[index].y3 = vec[find].y3;
+ vec[index].x3 = vec[tqfind].x3;
+ vec[index].y3 = vec[tqfind].y3;
- curx = vec[find].x3;
- cury = vec[find].y3;
+ curx = vec[tqfind].x3;
+ cury = vec[tqfind].y3;
}
}
@@ -2310,12 +2310,12 @@ void KSVGIconPainter::drawImage(double x, double y, TQImage &image)
image = image.convertDepth(32);
double affine[6];
- affine[0] = d->helper->m_worldMatrix->m11();
- affine[1] = d->helper->m_worldMatrix->m12();
- affine[2] = d->helper->m_worldMatrix->m21();
- affine[3] = d->helper->m_worldMatrix->m22();
+ affine[0] = d->helper->m_tqworldMatrix->m11();
+ affine[1] = d->helper->m_tqworldMatrix->m12();
+ affine[2] = d->helper->m_tqworldMatrix->m21();
+ affine[3] = d->helper->m_tqworldMatrix->m22();
// use the world matrix to convert the coordinates
- d->helper->m_worldMatrix->map(x, y, &affine[4], &affine[5]);
+ d->helper->m_tqworldMatrix->map(x, y, &affine[4], &affine[5]);
d->helper->art_rgba_rgba_affine(d->helper->m_buffer, 0, 0, d->helper->m_width, d->helper->m_height,
d->helper->m_rowstride, image.bits(), image.width(), image.height(),
@@ -2338,19 +2338,19 @@ TQColor KSVGIconPainter::parseColor(const TQString &param)
TQString g = colors[1];
TQString b = colors[2].left((colors[2].length() - 1));
- if(r.contains("%"))
+ if(r.tqcontains("%"))
{
r = r.left(r.length() - 1);
r = TQString::number(int((double(255 * r.toDouble()) / 100.0)));
}
- if(g.contains("%"))
+ if(g.tqcontains("%"))
{
g = g.left(g.length() - 1);
g = TQString::number(int((double(255 * g.toDouble()) / 100.0)));
}
- if(b.contains("%"))
+ if(b.tqcontains("%"))
{
b = b.left(b.length() - 1);
b = TQString::number(int((double(255 * b.toDouble()) / 100.0)));
@@ -2560,7 +2560,7 @@ TQColor KSVGIconPainter::parseColor(const TQString &param)
return TQColor(245, 255, 250);
else if(rgbColor == "mistyrose")
return TQColor(255, 228, 225);
- else if(rgbColor == "moccasin")
+ else if(rgbColor == "tqmoccasin")
return TQColor(255, 228, 181);
else if(rgbColor == "navajowhite")
return TQColor(255, 222, 173);
@@ -2753,7 +2753,7 @@ void KSVGIconPainter::addRadialGradientElement(ArtGradientRadial *gradient, TQDo
d->helper->m_radialGradientElementMap.insert(gradient, element);
}
-Q_UINT32 KSVGIconPainter::toArtColor(const TQColor &color)
+TQ_UINT32 KSVGIconPainter::toArtColor(const TQColor &color)
{
return d->helper->toArtColor(color);
}
diff --git a/kdecore/svgicons/ksvgiconpainter.h b/kdecore/svgicons/ksvgiconpainter.h
index 9ba44d2cf..6b00d9d7c 100644
--- a/kdecore/svgicons/ksvgiconpainter.h
+++ b/kdecore/svgicons/ksvgiconpainter.h
@@ -41,7 +41,7 @@ public:
TQImage *image();
- TQWMatrix *worldMatrix();
+ TQWMatrix *tqworldMatrix();
void finish();
@@ -61,7 +61,7 @@ public:
void setStrokeDashOffset(const TQString &dashOffset);
void setStrokeDashArray(const TQString &dashes);
- void setWorldMatrix(TQWMatrix *worldMatrix);
+ void setWorldMatrix(TQWMatrix *tqworldMatrix);
void setClippingRect(int x, int y, int w, int h);
void drawRectangle(double x, double y, double w, double h, double rx, double ry);
@@ -73,8 +73,8 @@ public:
void drawImage(double x, double y, TQImage &image);
TQColor parseColor(const TQString &param);
- Q_UINT32 toArtColor(const TQColor &color);
- Q_UINT32 parseOpacity(const TQString &data);
+ TQ_UINT32 toArtColor(const TQColor &color);
+ TQ_UINT32 parseOpacity(const TQString &data);
double toPixel(const TQString &s, bool hmode);
double dpi();