diff options
Diffstat (limited to 'lib/kofficecore/KoChild.cpp')
-rw-r--r-- | lib/kofficecore/KoChild.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/lib/kofficecore/KoChild.cpp b/lib/kofficecore/KoChild.cpp index 8207d086..85d54939 100644 --- a/lib/kofficecore/KoChild.cpp +++ b/lib/kofficecore/KoChild.cpp @@ -19,7 +19,7 @@ #include <KoChild.h> -#include <qpainter.h> +#include <tqpainter.h> #include <kdebug.h> @@ -34,24 +34,24 @@ public: { } - QRect m_geometry; + TQRect m_tqgeometry; double m_rotation; double m_shearX; double m_shearY; - QPoint m_rotationPoint; + TQPoint m_rotationPoint; double m_scaleX; double m_scaleY; - QWMatrix m_matrix; + TQWMatrix m_matrix; bool m_lock; - QPointArray m_old; + TQPointArray m_old; bool m_transparent; int m_contentsX; int m_contentsY; }; -KoChild::KoChild( QObject *parent, const char *name ) -: QObject( parent, name ) +KoChild::KoChild( TQObject *tqparent, const char *name ) +: TQObject( tqparent, name ) { d = new KoChildPrivate; @@ -69,19 +69,19 @@ KoChild::~KoChild() delete d; } -void KoChild::setGeometry( const QRect &rect, bool noEmit ) +void KoChild::setGeometry( const TQRect &rect, bool noEmit ) { if ( !d->m_lock ) d->m_old = framePointArray(); - d->m_geometry = rect; + d->m_tqgeometry = rect; // Embedded objects should have a minimum size of 3, so they can be selected - if( d->m_geometry.width() < 3 ) - d->m_geometry.setWidth( 3 ); + if( d->m_tqgeometry.width() < 3 ) + d->m_tqgeometry.setWidth( 3 ); - if( d->m_geometry.height() < 3 ) - d->m_geometry.setHeight( 3 ); + if( d->m_tqgeometry.height() < 3 ) + d->m_tqgeometry.setHeight( 3 ); updateMatrix(); @@ -89,27 +89,27 @@ void KoChild::setGeometry( const QRect &rect, bool noEmit ) emit changed( this ); } -QRect KoChild::geometry() const +TQRect KoChild::tqgeometry() const { - return d->m_geometry; + return d->m_tqgeometry; } -QRegion KoChild::region( const QWMatrix &matrix ) const +TQRegion KoChild::region( const TQWMatrix &matrix ) const { - return QRegion( pointArray( matrix ) ); + return TQRegion( pointArray( matrix ) ); } -QPointArray KoChild::pointArray( const QWMatrix &matrix ) const +TQPointArray KoChild::pointArray( const TQWMatrix &matrix ) const { - return pointArray( QRect( 0, 0, d->m_geometry.width(), d->m_geometry.height() ), matrix ); + return pointArray( TQRect( 0, 0, d->m_tqgeometry.width(), d->m_tqgeometry.height() ), matrix ); } -//bool KoChild::contains( const QPoint &point ) const +//bool KoChild::tqcontains( const TQPoint &point ) const //{ -// return region().contains( point ); +// return region().tqcontains( point ); //} -QRect KoChild::boundingRect() const +TQRect KoChild::boundingRect() const { return pointArray().boundingRect(); } @@ -119,13 +119,13 @@ bool KoChild::isRectangle() const return !( d->m_shearX != 0.0 || d->m_shearY != 0.0 || d->m_rotation != 0.0 ); } -void KoChild::setClipRegion( QPainter &painter, bool combine ) +void KoChild::setClipRegion( TQPainter &painter, bool combine ) { painter.setClipping( true ); if ( combine && !painter.clipRegion().isEmpty() ) - painter.setClipRegion( region( painter.worldMatrix() ).intersect( painter.clipRegion() ) ); + painter.setClipRegion( region( painter.tqworldMatrix() ).intersect( painter.clipRegion() ) ); else - painter.setClipRegion( region( painter.worldMatrix() ) ); + painter.setClipRegion( region( painter.tqworldMatrix() ) ); } void KoChild::setScaling( double x, double y ) @@ -197,7 +197,7 @@ double KoChild::rotation() const return d->m_rotation; } -void KoChild::setRotationPoint( const QPoint &pos ) +void KoChild::setRotationPoint( const TQPoint &pos ) { if ( !d->m_lock ) d->m_old = framePointArray(); @@ -209,16 +209,16 @@ void KoChild::setRotationPoint( const QPoint &pos ) emit changed( this ); } -QPoint KoChild::rotationPoint() const +TQPoint KoChild::rotationPoint() const { return d->m_rotationPoint; } -void KoChild::transform( QPainter &painter ) +void KoChild::transform( TQPainter &painter ) { setClipRegion( painter, true ); - QWMatrix m = painter.worldMatrix(); + TQWMatrix m = painter.tqworldMatrix(); m = d->m_matrix * m; m.scale( d->m_scaleX, d->m_scaleY ); painter.setWorldMatrix( m ); @@ -230,37 +230,37 @@ void KoChild::setContentsPos( int x, int y ) d->m_contentsY = y; } -QRect KoChild::contentRect() const +TQRect KoChild::contentRect() const { - return QRect( d->m_contentsX, d->m_contentsY, int(d->m_geometry.width() / d->m_scaleX), - int(d->m_geometry.height() / d->m_scaleY) ); + return TQRect( d->m_contentsX, d->m_contentsY, int(d->m_tqgeometry.width() / d->m_scaleX), + int(d->m_tqgeometry.height() / d->m_scaleY) ); } -QPointArray KoChild::framePointArray( const QWMatrix &matrix ) const +TQPointArray KoChild::framePointArray( const TQWMatrix &matrix ) const { - return pointArray( QRect( -6, -6, d->m_geometry.width() + 12, d->m_geometry.height() + 12 ), matrix ); + return pointArray( TQRect( -6, -6, d->m_tqgeometry.width() + 12, d->m_tqgeometry.height() + 12 ), matrix ); } -QRegion KoChild::frameRegion( const QWMatrix &matrix, bool solid ) const +TQRegion KoChild::frameRegion( const TQWMatrix &matrix, bool solid ) const { - const QPointArray arr = framePointArray( matrix ); - const QRegion frameReg( arr ); + const TQPointArray arr = framePointArray( matrix ); + const TQRegion frameReg( arr ); if ( solid ) return frameReg; - const QRegion reg = region( matrix ); + const TQRegion reg = region( matrix ); return frameReg.subtract( reg ); } -QPointArray KoChild::pointArray( const QRect &r, const QWMatrix &matrix ) const +TQPointArray KoChild::pointArray( const TQRect &r, const TQWMatrix &matrix ) const { - QPoint topleft = d->m_matrix.map( QPoint( r.left(), r.top() ) ); - QPoint topright = d->m_matrix.map( QPoint( r.right(), r.top() ) ); - QPoint bottomleft = d->m_matrix.map( QPoint( r.left(), r.bottom() ) ); - QPoint bottomright = d->m_matrix.map( QPoint( r.right(), r.bottom() ) ); + TQPoint topleft = d->m_matrix.map( TQPoint( r.left(), r.top() ) ); + TQPoint topright = d->m_matrix.map( TQPoint( r.right(), r.top() ) ); + TQPoint bottomleft = d->m_matrix.map( TQPoint( r.left(), r.bottom() ) ); + TQPoint bottomright = d->m_matrix.map( TQPoint( r.right(), r.bottom() ) ); - QPointArray arr( 4 ); + TQPointArray arr( 4 ); arr.setPoint( 0, topleft ); arr.setPoint( 1, topright ); arr.setPoint( 2, bottomright ); @@ -274,21 +274,21 @@ QPointArray KoChild::pointArray( const QRect &r, const QWMatrix &matrix ) const void KoChild::updateMatrix() { - QWMatrix r; + TQWMatrix r; r.rotate( - d->m_rotation ); - QPoint p = r.map( QPoint( d->m_rotationPoint.x(), + TQPoint p = r.map( TQPoint( d->m_rotationPoint.x(), d->m_rotationPoint.y() ) ); - QWMatrix m; + TQWMatrix m; m.rotate( d->m_rotation ); - m.translate( -d->m_rotationPoint.x() + d->m_geometry.x(), -d->m_rotationPoint.y() + d->m_geometry.y() ); + m.translate( -d->m_rotationPoint.x() + d->m_tqgeometry.x(), -d->m_rotationPoint.y() + d->m_tqgeometry.y() ); m.translate( p.x(), p.y() ); m.shear( d->m_shearX, d->m_shearY ); d->m_matrix = m; } -QWMatrix KoChild::matrix() const +TQWMatrix KoChild::matrix() const { return d->m_matrix; } @@ -316,9 +316,9 @@ bool KoChild::locked() const return d->m_lock; } -QPointArray KoChild::oldPointArray( const QWMatrix &matrix ) +TQPointArray KoChild::oldPointArray( const TQWMatrix &matrix ) { - QPointArray arr = d->m_old; + TQPointArray arr = d->m_old; for( int i = 0; i < 4; ++i ) arr.setPoint( i, matrix.map( arr.point( i ) ) ); @@ -336,28 +336,28 @@ bool KoChild::isTransparent() const return d->m_transparent; } -KoChild::Gadget KoChild::gadgetHitTest( const QPoint &p ) +KoChild::Gadget KoChild::gadgetHitTest( const TQPoint &p ) { - if ( !frameRegion().contains( p ) ) + if ( !frameRegion().tqcontains( p ) ) return NoGadget; - if ( QRegion( pointArray( QRect( -5, -5, 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( -5, -5, 5, 5 ) ) ).tqcontains( p ) ) return TopLeft; - if ( QRegion( pointArray( QRect( d->m_geometry.width() / 2 - 3, -5, 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width() / 2 - 3, -5, 5, 5 ) ) ).tqcontains( p ) ) return TopMid; - if ( QRegion( pointArray( QRect( d->m_geometry.width(), -5, 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width(), -5, 5, 5 ) ) ).tqcontains( p ) ) return TopRight; - if ( QRegion( pointArray( QRect( -5, d->m_geometry.height() / 2 - 3, 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( -5, d->m_tqgeometry.height() / 2 - 3, 5, 5 ) ) ).tqcontains( p ) ) return MidLeft; - if ( QRegion( pointArray( QRect( -5, d->m_geometry.height(), 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( -5, d->m_tqgeometry.height(), 5, 5 ) ) ).tqcontains( p ) ) return BottomLeft; - if ( QRegion( pointArray( QRect( d->m_geometry.width() / 2 - 3, - d->m_geometry.height(), 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width() / 2 - 3, + d->m_tqgeometry.height(), 5, 5 ) ) ).tqcontains( p ) ) return BottomMid; - if ( QRegion( pointArray( QRect( d->m_geometry.width(), d->m_geometry.height(), 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width(), d->m_tqgeometry.height(), 5, 5 ) ) ).tqcontains( p ) ) return BottomRight; - if ( QRegion( pointArray( QRect( d->m_geometry.width(), - d->m_geometry.height() / 2 - 3, 5, 5 ) ) ).contains( p ) ) + if ( TQRegion( pointArray( TQRect( d->m_tqgeometry.width(), + d->m_tqgeometry.height() / 2 - 3, 5, 5 ) ) ).tqcontains( p ) ) return MidRight; return Move; |