summaryrefslogtreecommitdiffstats
path: root/karbon/render/vkopainter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'karbon/render/vkopainter.cc')
-rw-r--r--karbon/render/vkopainter.cc78
1 files changed, 39 insertions, 39 deletions
diff --git a/karbon/render/vkopainter.cc b/karbon/render/vkopainter.cc
index 21ab911c..98ae826e 100644
--- a/karbon/render/vkopainter.cc
+++ b/karbon/render/vkopainter.cc
@@ -25,10 +25,10 @@
#include "vcolor.h"
#include "vpattern.h"
-#include <qpaintdevice.h>
-#include <qpixmap.h>
-#include <qpointarray.h>
-#include <qimage.h>
+#include <tqpaintdevice.h>
+#include <tqpixmap.h>
+#include <tqpointarray.h>
+#include <tqimage.h>
#include "libart_lgpl/art_vpath.h"
#include <libart_lgpl/art_bpath.h>
@@ -67,7 +67,7 @@
#define INITIAL_ALLOC 300
#define ALLOC_INCREMENT 100
-VKoPainter::VKoPainter( QPaintDevice *target, unsigned int w, unsigned int h, bool bDrawNodes )
+VKoPainter::VKoPainter( TQPaintDevice *target, unsigned int w, unsigned int h, bool bDrawNodes )
: VPainter( target, w, h ), m_target( target ), m_bDrawNodes( bDrawNodes )
{
//kdDebug(38000) << "w : " << w << endl;
@@ -180,18 +180,18 @@ void
VKoPainter::clear()
{
if( m_buffer )
- memset( m_buffer, qRgba( 255, 255, 255, 255 ), m_width * m_height * 4 );
+ memset( m_buffer, tqRgba( 255, 255, 255, 255 ), m_width * m_height * 4 );
}
void
-VKoPainter::clear( const QColor &c )
+VKoPainter::clear( const TQColor &c )
{
if( m_buffer )
memset( m_buffer, c.rgb(), m_width * m_height * 4 );
}
void
-VKoPainter::clear( const KoRect &r, const QColor &c )
+VKoPainter::clear( const KoRect &r, const TQColor &c )
{
unsigned int color = c.rgb();
int x = KMAX( 0, int( r.x() ) );
@@ -202,12 +202,12 @@ VKoPainter::clear( const KoRect &r, const QColor &c )
{
for( int i = y;i < height;i++)
memset( m_buffer + int( x * 4) + int( i * ( m_width * 4 ) ),
- qRgba( qRed( color ), qGreen( color ), qBlue( color ), 100 ), int( width * 4 ) );
+ tqRgba( tqRed( color ), tqGreen( color ), tqBlue( color ), 100 ), int( width * 4 ) );
}
}
void
-VKoPainter::setWorldMatrix( const QWMatrix &mat )
+VKoPainter::setWorldMatrix( const TQWMatrix &mat )
{
m_matrix = mat;
}
@@ -293,25 +293,25 @@ VKoPainter::fillPath()
if( m_index == 0 ) return;
// find begin of last subpath
- int find = -1;
+ int tqfind = -1;
for( int i = m_index - 1; i >= 0; i-- )
{
if( m_path[i].code == ART_MOVETO_OPEN || m_path[i].code == ART_MOVETO )
{
- find = i;
+ tqfind = i;
break;
}
}
// for now, always close
- if( find != -1 && ( m_path[ find ].x3 != m_path[ m_index - 1 ].x3 ||
- m_path[ find ].y3 != m_path[ m_index - 1 ].y3 ) )
+ if( tqfind != -1 && ( m_path[ tqfind ].x3 != m_path[ m_index - 1 ].x3 ||
+ m_path[ tqfind ].y3 != m_path[ m_index - 1 ].y3 ) )
{
ensureSpace( m_index + 1 );
m_path[ m_index ].code = ART_LINETO;
- m_path[ m_index ].x3 = m_path[ find ].x3;
- m_path[ m_index ].y3 = m_path[ find ].y3;
+ m_path[ m_index ].x3 = m_path[ tqfind ].x3;
+ m_path[ m_index ].y3 = m_path[ tqfind ].y3;
m_index++;
m_path[ m_index ].code = ART_END;
@@ -368,7 +368,7 @@ VKoPainter::setPen( const VStroke &stroke )
}
void
-VKoPainter::setPen( const QColor &c )
+VKoPainter::setPen( const TQColor &c )
{
delete m_stroke;
m_stroke = new VStroke;
@@ -385,7 +385,7 @@ VKoPainter::setPen( const QColor &c )
void
VKoPainter::setPen( Qt::PenStyle style )
{
- if( style == Qt::NoPen )
+ if( style == TQt::NoPen )
{
delete m_stroke;
m_stroke = 0L;
@@ -393,7 +393,7 @@ VKoPainter::setPen( Qt::PenStyle style )
}
void
-VKoPainter::setBrush( const QColor &c )
+VKoPainter::setBrush( const TQColor &c )
{
delete m_fill;
m_fill = new VFill;
@@ -408,9 +408,9 @@ VKoPainter::setBrush( const QColor &c )
}
void
-VKoPainter::setBrush( Qt::BrushStyle style )
+VKoPainter::setBrush( TQt::BrushStyle style )
{
- if( style == Qt::NoBrush )
+ if( style == TQt::NoBrush )
{
delete m_fill;
m_fill = 0L;
@@ -436,7 +436,7 @@ VKoPainter::restore()
}
void
-VKoPainter::setRasterOp( Qt::RasterOp )
+VKoPainter::setRasterOp( TQt::RasterOp )
{
}
@@ -501,11 +501,11 @@ VKoPainter::drawVPath( ArtVpath *vec )
art_u32 fillColor = 0;
// filling
- QColor color;
+ TQColor color;
if( m_fill && m_fill->type() != VFill::none )
{
color = m_fill->color();
- af = qRound( 255 * m_fill->color().opacity() );
+ af = tqRound( 255 * m_fill->color().opacity() );
fillColor = ( 0 << 24 ) | ( color.blue() << 16 ) | ( color.green() << 8 ) | color.red();
ArtSvpWriter *swr;
@@ -532,7 +532,7 @@ VKoPainter::drawVPath( ArtVpath *vec )
// TODO : non rgb support ?
color = m_stroke->color();
- as = qRound( 255 * m_stroke->color().opacity() );
+ as = tqRound( 255 * m_stroke->color().opacity() );
strokeColor = ( 0 << 24 ) | ( color.blue() << 16 ) | ( color.green() << 8 ) | color.red();
double ratio = m_zoomFactor;//sqrt(pow(affine[0], 2) + pow(affine[3], 2)) / sqrt(2);
@@ -809,7 +809,7 @@ ArtGradientStop *
VKoPainter::buildStopArray( VGradient &gradient, int &offsets )
{
// TODO : make this generic
- QPtrVector<VColorStop> colorStops = gradient.colorStops();
+ TQPtrVector<VColorStop> colorStops = gradient.colorStops();
offsets = colorStops.count();
ArtGradientStop *stopArray = art_new( ArtGradientStop, offsets * 2 - 1 );
@@ -820,11 +820,11 @@ VKoPainter::buildStopArray( VGradient &gradient, int &offsets )
//double mid = colorStops[ offset ]->midPoint;
stopArray[ offset * 2 ].offset = ramp;
- QColor qStopColor = colorStops[ offset ]->color;
- int r = qRed( qStopColor.rgb() );
- int g = qGreen( qStopColor.rgb() );
- int b = qBlue( qStopColor.rgb() );
- art_u32 rgba = (r << 24) | (g << 16) | (b << 8) | qAlpha(qStopColor.rgb());
+ TQColor qStopColor = colorStops[ offset ]->color;
+ int r = tqRed( qStopColor.rgb() );
+ int g = tqGreen( qStopColor.rgb() );
+ int b = tqBlue( qStopColor.rgb() );
+ art_u32 rgba = (r << 24) | (g << 16) | (b << 8) | tqAlpha(qStopColor.rgb());
/* convert from separated to premultiplied alpha */
int a = int( colorStops[ offset]->color.opacity() * 255.0 );
r = (rgba >> 24) * a + 0x80;
@@ -842,11 +842,11 @@ VKoPainter::buildStopArray( VGradient &gradient, int &offsets )
{
stopArray[ offset * 2 + 1 ].offset = ramp + ( colorStops[ offset + 1 ]->rampPoint - ramp ) * colorStops[ offset ]->midPoint;
- QColor qStopColor2 = colorStops[ offset + 1 ]->color;
- rgba = int(r + ((qRed(qStopColor2.rgb()) - r)) * 0.5) << 24 |
- int(g + ((qGreen(qStopColor2.rgb()) - g)) * 0.5) << 16 |
- int(b + ((qBlue(qStopColor2.rgb()) - b)) * 0.5) << 8 |
- qAlpha(qStopColor2.rgb());
+ TQColor qStopColor2 = colorStops[ offset + 1 ]->color;
+ rgba = int(r + ((tqRed(qStopColor2.rgb()) - r)) * 0.5) << 24 |
+ int(g + ((tqGreen(qStopColor2.rgb()) - g)) * 0.5) << 16 |
+ int(b + ((tqBlue(qStopColor2.rgb()) - b)) * 0.5) << 8 |
+ tqAlpha(qStopColor2.rgb());
/* convert from separated to premultiplied alpha */
int a = int( colorStops[ offset]->color.opacity() * 255.0 );
r = (rgba >> 24) * a + 0x80;
@@ -871,7 +871,7 @@ VKoPainter::drawNode( const KoPoint& p, int width )
{
if( !m_bDrawNodes ) return;
- KoPoint _p( m_matrix.map( QPoint( int( p.x() * m_zoomFactor ), int( p.y() * m_zoomFactor ) ) ) );
+ KoPoint _p( m_matrix.map( TQPoint( int( p.x() * m_zoomFactor ), int( p.y() * m_zoomFactor ) ) ) );
int x1 = int( _p.x() - width );
int x2 = int( _p.x() + width );
int y1 = int( _p.y() - width );
@@ -881,7 +881,7 @@ VKoPainter::drawNode( const KoPoint& p, int width )
int baseindex = 4 * x1 + ( m_width * 4 * y1 );
- QColor color = m_fill->color();
+ TQColor color = m_fill->color();
for( int i = 0; i < y2 - y1; i++ )
{
for( int j = 0; j < x2 - x1; j++ )
@@ -895,7 +895,7 @@ VKoPainter::drawNode( const KoPoint& p, int width )
}
void
-VKoPainter::drawImage( const QImage &image, const QWMatrix &affine )
+VKoPainter::drawImage( const TQImage &image, const TQWMatrix &affine )
{
// set up world matrix
double affineresult[6];