summaryrefslogtreecommitdiffstats
path: root/karbon/render/vqpainter.cc
diff options
context:
space:
mode:
Diffstat (limited to 'karbon/render/vqpainter.cc')
-rw-r--r--karbon/render/vqpainter.cc100
1 files changed, 50 insertions, 50 deletions
diff --git a/karbon/render/vqpainter.cc b/karbon/render/vqpainter.cc
index 31e5593e..7f380287 100644
--- a/karbon/render/vqpainter.cc
+++ b/karbon/render/vqpainter.cc
@@ -25,47 +25,47 @@
#include "vcolor.h"
#include "vfill.h"
-#include <qpainter.h>
-#include <qpaintdevice.h>
-#include <qpen.h>
+#include <tqpainter.h>
+#include <tqpaintdevice.h>
+#include <tqpen.h>
#include <KoPoint.h>
#include <kdebug.h>
-VQPainter::VQPainter( QPaintDevice *target, unsigned int w, unsigned int h ) : VPainter( target, w, h ), m_painter( 0L ), m_target( target ), m_width( w ), m_height( h )
+VTQPainter::VTQPainter( TQPaintDevice *target, unsigned int w, unsigned int h ) : VPainter( target, w, h ), m_painter( 0L ), m_target( target ), m_width( w ), m_height( h )
{
m_zoomFactor = 1;
m_index = 0;
- m_painter = new QPainter( target );
+ m_painter = new TQPainter( target );
}
-VQPainter::~VQPainter()
+VTQPainter::~VTQPainter()
{
delete m_painter;
}
void
-VQPainter::resize( unsigned int w, unsigned int h )
+VTQPainter::resize( unsigned int w, unsigned int h )
{
m_width = w;
m_height = h;
}
void
-VQPainter::blit( const KoRect & )
+VTQPainter::blit( const KoRect & )
{
end();
}
void
-VQPainter::clear( const QColor &c )
+VTQPainter::clear( const TQColor &c )
{
m_painter->setBackgroundColor( c );
m_painter->eraseRect( 0, 0, m_width, m_height );
}
void
-VQPainter::begin()
+VTQPainter::begin()
{
if( !m_painter->isActive() )
{
@@ -75,34 +75,34 @@ VQPainter::begin()
}
void
-VQPainter::end()
+VTQPainter::end()
{
m_painter->end();
}
-const QWMatrix
-VQPainter::worldMatrix()
+const TQWMatrix
+VTQPainter::tqworldMatrix()
{
- return m_painter->worldMatrix();
+ return m_painter->tqworldMatrix();
}
void
-VQPainter::setWorldMatrix( const QWMatrix& mat )
+VTQPainter::setWorldMatrix( const TQWMatrix& mat )
{
m_painter->setWorldMatrix( mat );
}
void
-VQPainter::setZoomFactor( double zoomFactor )
+VTQPainter::setZoomFactor( double zoomFactor )
{
m_zoomFactor = zoomFactor;
- /*QWMatrix mat;
+ /*TQWMatrix mat;
mat.scale( zoomFactor, zoomFactor );
m_painter->setWorldMatrix( mat );*/
}
void
-VQPainter::moveTo( const KoPoint &p )
+VTQPainter::moveTo( const KoPoint &p )
{
//m_index = 0;
if( m_pa.size() <= m_index )
@@ -114,7 +114,7 @@ VQPainter::moveTo( const KoPoint &p )
}
void
-VQPainter::lineTo( const KoPoint &p )
+VTQPainter::lineTo( const KoPoint &p )
{
if( m_pa.size() <= m_index )
m_pa.resize( m_index + 10 );
@@ -125,16 +125,16 @@ VQPainter::lineTo( const KoPoint &p )
}
void
-VQPainter::curveTo( const KoPoint &p1, const KoPoint &p2, const KoPoint &p3 )
+VTQPainter::curveTo( const KoPoint &p1, const KoPoint &p2, const KoPoint &p3 )
{
- // calculate cubic bezier using a temp QPointArray
- QPointArray pa( 4 );
+ // calculate cubic bezier using a temp TQPointArray
+ TQPointArray pa( 4 );
pa.setPoint( 0, m_pa.point( m_index - 1 ).x(), m_pa.point( m_index - 1 ).y() );
pa.setPoint( 1, static_cast<int>(p1.x() * m_zoomFactor), static_cast<int>(p1.y() * m_zoomFactor) );
pa.setPoint( 2, static_cast<int>(p2.x() * m_zoomFactor), static_cast<int>(p2.y() * m_zoomFactor) );
pa.setPoint( 3, static_cast<int>(p3.x() * m_zoomFactor), static_cast<int>(p3.y() * m_zoomFactor) );
- QPointArray pa2( pa.cubicBezier() );
+ TQPointArray pa2( pa.cubicBezier() );
m_pa.resize( m_index + pa2.size() );
m_pa.putPoints( m_index, pa2.size(), pa2 );
@@ -143,30 +143,30 @@ VQPainter::curveTo( const KoPoint &p1, const KoPoint &p2, const KoPoint &p3 )
}
void
-VQPainter::newPath()
+VTQPainter::newPath()
{
m_index = 0;
}
void
-VQPainter::fillPath()
+VTQPainter::fillPath()
{
// we probably dont need filling for qpainter
//m_index = 0;
- m_painter->drawPolygon( m_pa, FALSE, 0, m_index );
+ m_painter->tqdrawPolygon( m_pa, FALSE, 0, m_index );
}
void
-VQPainter::strokePath()
+VTQPainter::strokePath()
{
- m_painter->drawPolyline( m_pa, 0, m_index );
+ m_painter->tqdrawPolyline( m_pa, 0, m_index );
m_index = 0;
}
void
-VQPainter::setPen( const VStroke &stroke )
+VTQPainter::setPen( const VStroke &stroke )
{
- QPen pen;
+ TQPen pen;
// color + linewidth
pen.setColor( stroke.color() );
@@ -184,23 +184,23 @@ VQPainter::setPen( const VStroke &stroke )
}
void
-VQPainter::setBrush( const VFill &fill )
+VTQPainter::setBrush( const VFill &fill )
{
switch( fill.type() )
{
case VFill::none:
- m_painter->setBrush( Qt::NoBrush );
+ m_painter->setBrush( TQt::NoBrush );
break;
case VFill::solid:
- m_painter->setBrush( QBrush( fill.color(), Qt::SolidPattern ) );
+ m_painter->setBrush( TQBrush( fill.color(), TQt::SolidPattern ) );
break;
case VFill::grad:
// gradients are nor supported by qpainter
- m_painter->setBrush( Qt::NoBrush );
+ m_painter->setBrush( TQt::NoBrush );
break;
case VFill::patt:
// pixmap brushes not supported for printing
- m_painter->setBrush( QBrush( fill.color(), fill.pattern().pixmap() ) );
+ m_painter->setBrush( TQBrush( fill.color(), fill.pattern().pixmap() ) );
break;
default:
break;
@@ -208,64 +208,64 @@ VQPainter::setBrush( const VFill &fill )
}
void
-VQPainter::setPen( const QColor &c )
+VTQPainter::setPen( const TQColor &c )
{
m_painter->setPen( c );
}
void
-VQPainter::setPen( Qt::PenStyle style )
+VTQPainter::setPen( Qt::PenStyle style )
{
m_painter->setPen( style );
}
void
-VQPainter::setBrush( const QColor &c )
+VTQPainter::setBrush( const TQColor &c )
{
m_painter->setBrush( c );
}
void
-VQPainter::setBrush( Qt::BrushStyle style )
+VTQPainter::setBrush( TQt::BrushStyle style )
{
m_painter->setBrush( style );
}
void
-VQPainter::save()
+VTQPainter::save()
{
m_painter->save();
}
void
-VQPainter::restore()
+VTQPainter::restore()
{
m_painter->restore();
}
void
-VQPainter::setRasterOp( Qt::RasterOp r )
+VTQPainter::setRasterOp( TQt::RasterOp r )
{
m_painter->setRasterOp( r );
}
void
-VQPainter::drawNode( const KoPoint &p, int width )
+VTQPainter::drawNode( const KoPoint &p, int width )
{
- m_painter->drawRect( QRect( int( p.x() * m_zoomFactor ) - width, int( p.y() * m_zoomFactor ) - width,
+ m_painter->drawRect( TQRect( int( p.x() * m_zoomFactor ) - width, int( p.y() * m_zoomFactor ) - width,
2 * width + 1, 2 * width + 1 ) );
}
void
-VQPainter::drawRect( const KoRect &rect )
+VTQPainter::drawRect( const KoRect &rect )
{
- m_painter->drawRect( QRect( int( rect.x() ), int( rect.y() ), int( rect.width() ), int( rect.height() ) ) );
+ m_painter->drawRect( TQRect( int( rect.x() ), int( rect.y() ), int( rect.width() ), int( rect.height() ) ) );
}
void
-VQPainter::drawImage( const QImage &image, const QWMatrix &affine )
+VTQPainter::drawImage( const TQImage &image, const TQWMatrix &affine )
{
- QWMatrix matrix = m_painter->worldMatrix();
+ TQWMatrix matrix = m_painter->tqworldMatrix();
double m11 = affine.m11() * matrix.m11() * m_zoomFactor + affine.m12() * matrix.m21();
double m12 = (affine.m11() * matrix.m12() + affine.m12() * matrix.m22() ) * m_zoomFactor;
@@ -274,11 +274,11 @@ VQPainter::drawImage( const QImage &image, const QWMatrix &affine )
double dx = matrix.dx() + affine.dx() * m_zoomFactor;
double dy = matrix.dy() - affine.dy() * m_zoomFactor;
- QWMatrix world( m11, m12, m21, m22, dx, dy );
+ TQWMatrix world( m11, m12, m21, m22, dx, dy );
m_painter->setWorldMatrix( world );
- m_painter->drawImage( QPoint( 0, 0 ), image );
+ m_painter->drawImage( TQPoint( 0, 0 ), image );
// restore old world matrix
m_painter->setWorldMatrix( matrix );
}