diff options
Diffstat (limited to 'kpresenter/KPrUtils.cpp')
-rw-r--r-- | kpresenter/KPrUtils.cpp | 156 |
1 files changed, 78 insertions, 78 deletions
diff --git a/kpresenter/KPrUtils.cpp b/kpresenter/KPrUtils.cpp index 0387de48..fbf91cc9 100644 --- a/kpresenter/KPrUtils.cpp +++ b/kpresenter/KPrUtils.cpp @@ -31,22 +31,22 @@ #include <KoTextZoomHandler.h> #include <KoPoint.h> -#include <qpainter.h> -#include <qpointarray.h> -#include <qpoint.h> -#include <qcolor.h> -#include <qsize.h> -#include <qbitmap.h> -#include <qcursor.h> -#include <qdatetime.h> -#include <qdom.h> - -void drawFigure( LineEnd figure, QPainter* painter, const KoPoint &coord, const QColor &color, +#include <tqpainter.h> +#include <tqpointarray.h> +#include <tqpoint.h> +#include <tqcolor.h> +#include <tqsize.h> +#include <tqbitmap.h> +#include <tqcursor.h> +#include <tqdatetime.h> +#include <tqdom.h> + +void drawFigure( LineEnd figure, TQPainter* painter, const KoPoint &coord, const TQColor &color, int _w, float angle, KoZoomHandler* _zoomHandler) { painter->save(); - painter->setPen( Qt::NoPen ); - painter->setBrush( Qt::NoBrush ); + painter->setPen( TQt::NoPen ); + painter->setBrush( TQt::NoBrush ); switch ( figure ) { @@ -77,7 +77,7 @@ void drawFigure( LineEnd figure, QPainter* painter, const KoPoint &coord, const KoPoint p1( -10 - _w, -3 - _w / 2 ); KoPoint p2( 0 , 0 ); KoPoint p3( -10 - _w, 3 + _w / 2 ); - QPointArray pArray( 3 ); + TQPointArray pArray( 3 ); pArray.setPoint( 0, _zoomHandler->zoomPoint(p1) ); pArray.setPoint( 1, _zoomHandler->zoomPoint(p2) ); pArray.setPoint( 2, _zoomHandler->zoomPoint(p3) ); @@ -91,23 +91,23 @@ void drawFigure( LineEnd figure, QPainter* painter, const KoPoint &coord, const case L_LINE_ARROW: { painter->translate( _zoomHandler->zoomItX(coord.x()),_zoomHandler->zoomItY( coord.y()) ); - painter->setPen( QPen(color , _zoomHandler->zoomItX( _w )) ); + painter->setPen( TQPen(color , _zoomHandler->zoomItX( _w )) ); painter->rotate( angle ); painter->scale( 1, 1 ); - QPoint p1( _zoomHandler->zoomItX(-10 - _w), _zoomHandler->zoomItY(-3 - _w / 2) ); - QPoint p2( _zoomHandler->zoomItX(0), _zoomHandler->zoomItY(0) ); - QPoint p3( _zoomHandler->zoomItX(-10 - _w), _zoomHandler->zoomItY(3 + _w / 2) ); + TQPoint p1( _zoomHandler->zoomItX(-10 - _w), _zoomHandler->zoomItY(-3 - _w / 2) ); + TQPoint p2( _zoomHandler->zoomItX(0), _zoomHandler->zoomItY(0) ); + TQPoint p3( _zoomHandler->zoomItX(-10 - _w), _zoomHandler->zoomItY(3 + _w / 2) ); painter->drawLine( p2, p1); painter->drawLine( p2, p3); }break; case L_DIMENSION_LINE: { painter->translate( _zoomHandler->zoomItX(coord.x()),_zoomHandler->zoomItY( coord.y()) ); - painter->setPen( QPen(color , _zoomHandler->zoomItX( _w )) ); + painter->setPen( TQPen(color , _zoomHandler->zoomItX( _w )) ); painter->rotate( angle ); painter->scale( 1, 1 ); - QPoint p1( _zoomHandler->zoomItX(- _w / 2), _zoomHandler->zoomItY(-5 - _w / 2) ); - QPoint p2( _zoomHandler->zoomItX(- _w / 2), _zoomHandler->zoomItY(5 + _w / 2 ) ); + TQPoint p1( _zoomHandler->zoomItX(- _w / 2), _zoomHandler->zoomItY(-5 - _w / 2) ); + TQPoint p2( _zoomHandler->zoomItX(- _w / 2), _zoomHandler->zoomItY(5 + _w / 2 ) ); painter->drawLine( p1, p2); }break; case L_DOUBLE_ARROW: @@ -125,7 +125,7 @@ void drawFigure( LineEnd figure, QPainter* painter, const KoPoint &coord, const KoPoint p5( -10, 0 ); KoPoint p6( -20 - _w, 3 + _w / 2 ); - QPointArray pArray( 3 ); + TQPointArray pArray( 3 ); pArray.setPoint( 0, _zoomHandler->zoomPoint(p1) ); pArray.setPoint( 1, _zoomHandler->zoomPoint(p2) ); pArray.setPoint( 2, _zoomHandler->zoomPoint(p3) ); @@ -139,12 +139,12 @@ void drawFigure( LineEnd figure, QPainter* painter, const KoPoint &coord, const case L_DOUBLE_LINE_ARROW: { painter->translate( _zoomHandler->zoomItX(coord.x()),_zoomHandler->zoomItY( coord.y()) ); - painter->setPen( QPen(color , _zoomHandler->zoomItX( _w )) ); + painter->setPen( TQPen(color , _zoomHandler->zoomItX( _w )) ); painter->rotate( angle ); painter->scale( 1, 1 ); - QPoint p1( _zoomHandler->zoomItX(-10 - _w), _zoomHandler->zoomItY(-3 - _w / 2) ); - QPoint p2( _zoomHandler->zoomItX(0), _zoomHandler->zoomItY(0) ); - QPoint p3( _zoomHandler->zoomItX(-10 - _w), _zoomHandler->zoomItY(3 + _w / 2) ); + TQPoint p1( _zoomHandler->zoomItX(-10 - _w), _zoomHandler->zoomItY(-3 - _w / 2) ); + TQPoint p2( _zoomHandler->zoomItX(0), _zoomHandler->zoomItY(0) ); + TQPoint p3( _zoomHandler->zoomItX(-10 - _w), _zoomHandler->zoomItY(3 + _w / 2) ); painter->drawLine( p2, p1); painter->drawLine( p2, p3); @@ -159,7 +159,7 @@ void drawFigure( LineEnd figure, QPainter* painter, const KoPoint &coord, const painter->restore(); } -void drawFigureWithOffset( LineEnd figure, QPainter* painter, const QPoint &coord, const QColor &color, +void drawFigureWithOffset( LineEnd figure, TQPainter* painter, const TQPoint &coord, const TQColor &color, int _w, float angle, KoZoomHandler*_zoomHandler) { KoSize diff = getOffset( figure, _w, angle ); @@ -168,7 +168,7 @@ void drawFigureWithOffset( LineEnd figure, QPainter* painter, const QPoint &coor drawFigure( figure, painter, offsetPoint, color, _w, angle,_zoomHandler ); } -void drawFigureWithOffset( LineEnd figure, QPainter* painter, const KoPoint &coord, const QColor &color, +void drawFigureWithOffset( LineEnd figure, TQPainter* painter, const KoPoint &coord, const TQColor &color, int w, float angle, KoZoomHandler*_zoomHandler, bool begin ) { KoSize diff = getOffset( figure, w, angle ); @@ -253,31 +253,31 @@ KoSize getOffset( LineEnd figure, int _w, float angle ) return KoSize( x * cos( angle * M_PI / 180.0 ), y * sin( angle * M_PI / 180 ) ); } -QString lineEndBeginName( LineEnd type ) +TQString lineEndBeginName( LineEnd type ) { switch(type) { case L_NORMAL: - return QString("NORMAL"); + return TQString("NORMAL"); case L_ARROW: - return QString("ARROW"); + return TQString("ARROW"); case L_SQUARE: - return QString("SQUARE"); + return TQString("SQUARE"); case L_CIRCLE: - return QString("CIRCLE"); + return TQString("CIRCLE"); case L_LINE_ARROW: - return QString("LINE_ARROW"); + return TQString("LINE_ARROW"); case L_DIMENSION_LINE: - return QString("DIMENSION_LINE"); + return TQString("DIMENSION_LINE"); case L_DOUBLE_ARROW: - return QString("DOUBLE_ARROW"); + return TQString("DOUBLE_ARROW"); case L_DOUBLE_LINE_ARROW: - return QString("DOUBLE_LINE_ARROW"); + return TQString("DOUBLE_LINE_ARROW"); } - return QString::null; + return TQString(); } -LineEnd lineEndBeginFromString( const QString & type ) +LineEnd lineEndBeginFromString( const TQString & type ) { if(type=="NORMAL") return L_NORMAL; @@ -296,13 +296,13 @@ LineEnd lineEndBeginFromString( const QString & type ) else if (type=="DOUBLE_LINE_ARROW") return L_DOUBLE_LINE_ARROW; else - kdDebug(33001)<<"Error in LineEnd lineEndBeginFromString( const QString & name )\n"; + kdDebug(33001)<<"Error in LineEnd lineEndBeginFromString( const TQString & name )\n"; return L_NORMAL; } -QString lineEndBeginSvg( LineEnd element ) +TQString lineEndBeginSvg( LineEnd element ) { - QString str; + TQString str; switch( element ) { case L_NORMAL: @@ -334,7 +334,7 @@ QString lineEndBeginSvg( LineEnd element ) return str; } -QCursor KPrUtils::penCursor() +TQCursor KPrUtils::penCursor() { static unsigned char pen_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x1c, 0x00, 0x00, 0x3a, 0x00, 0x00, 0x7d, @@ -344,16 +344,16 @@ QCursor KPrUtils::penCursor() 0xd0, 0x0f, 0x00, 0x88, 0x07, 0x00, 0x88, 0x03, 0x00, 0xe4, 0x01, 0x00, 0x7c, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00}; - QBitmap pen_bitmap( 24, 24, pen_bits, true ); - QBitmap pen_mask( 24, 24 ); - QPixmap pix( pen_bitmap ); - pen_mask = pix.createHeuristicMask( false ); - pix.setMask( pen_mask ); + TQBitmap pen_bitmap( 24, 24, pen_bits, true ); + TQBitmap pen_tqmask( 24, 24 ); + TQPixmap pix( pen_bitmap ); + pen_tqmask = pix.createHeuristicMask( false ); + pix.setMask( pen_tqmask ); - return QCursor( pix, 1, 22 ); + return TQCursor( pix, 1, 22 ); } -QCursor KPrUtils::rotateCursor() +TQCursor KPrUtils::rotateCursor() { static unsigned char rotate_bits[] = { 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0xc0, 0xf3, 0x00, 0xe0, 0xff, 0x01, @@ -363,33 +363,33 @@ QCursor KPrUtils::rotateCursor() 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; - QBitmap rotate_bitmap( 22, 22, rotate_bits, true ); - QBitmap rotate_mask( 22, 22 ); - QPixmap pix( rotate_bitmap ); - rotate_mask = pix.createHeuristicMask( false ); - pix.setMask( rotate_mask ); + TQBitmap rotate_bitmap( 22, 22, rotate_bits, true ); + TQBitmap rotate_tqmask( 22, 22 ); + TQPixmap pix( rotate_bitmap ); + rotate_tqmask = pix.createHeuristicMask( false ); + pix.setMask( rotate_tqmask ); - return QCursor( pix, 11, 13 ); + return TQCursor( pix, 11, 13 ); } -QString saveOasisTimer( int second ) +TQString saveOasisTimer( int second ) { - QTime time; + TQTime time; time = time.addSecs( second ); - QString hours( QString::number( time.hour() ).rightJustify( 2, '0' ) ); - QString ms( QString::number( time.minute() ).rightJustify( 2, '0' ) ); - QString sec( QString::number( time.second() ).rightJustify( 2, '0' ) ); + TQString hours( TQString::number( time.hour() ).rightJustify( 2, '0' ) ); + TQString ms( TQString::number( time.minute() ).rightJustify( 2, '0' ) ); + TQString sec( TQString::number( time.second() ).rightJustify( 2, '0' ) ); //ISO8601 chapter 5.5.3.2 - //QDate doesn't encode it as this format. - QString timeIso = QString( "PT%1H%2M%3S" ).arg( hours ).arg( ms ).arg( sec ); + //TQDate doesn't encode it as this format. + TQString timeIso = TQString( "PT%1H%2M%3S" ).tqarg( hours ).tqarg( ms ).tqarg( sec ); return timeIso; } -int loadOasisTimer( const QString & timer ) +int loadOasisTimer( const TQString & timer ) { - QString str( timer ); + TQString str( timer ); //convert date duration int hour( str.mid( 2, 2 ).toInt() ); int minute( str.mid( 5, 2 ).toInt() ); @@ -399,12 +399,12 @@ int loadOasisTimer( const QString & timer ) } -int readOasisSettingsInt( const QDomElement & element ) +int readOasisSettingsInt( const TQDomElement & element ) { if ( element.hasAttributeNS( KoXmlNS::config, "type" ) ) { - QString type = element.attributeNS( KoXmlNS::config, "type", QString::null ); - QString str = element.text(); + TQString type = element.attributeNS( KoXmlNS::config, "type", TQString() ); + TQString str = element.text(); bool b; int value = str.toInt( &b ); return ( b ? value : 0 ); @@ -412,12 +412,12 @@ int readOasisSettingsInt( const QDomElement & element ) return 0; } -double readOasisSettingsDouble( const QDomElement & element ) +double readOasisSettingsDouble( const TQDomElement & element ) { if ( element.hasAttributeNS( KoXmlNS::config, "type" ) ) { - QString type = element.attributeNS( KoXmlNS::config, "type", QString::null ); - QString str = element.text(); + TQString type = element.attributeNS( KoXmlNS::config, "type", TQString() ); + TQString str = element.text(); bool b; double value = str.toDouble( &b ); return ( b ? value : 0 ); @@ -425,24 +425,24 @@ double readOasisSettingsDouble( const QDomElement & element ) return 0.0; } -bool readOasisSettingsBool( const QDomElement & element ) +bool readOasisSettingsBool( const TQDomElement & element ) { if ( element.hasAttributeNS( KoXmlNS::config, "type" ) ) { - QString type = element.attributeNS( KoXmlNS::config, "type", QString::null ); - QString str = element.text(); + TQString type = element.attributeNS( KoXmlNS::config, "type", TQString() ); + TQString str = element.text(); return ( str == "true" ? true : false ); } return false; } -QString readOasisSettingsString( const QDomElement & element ) +TQString readOasisSettingsString( const TQDomElement & element ) { if ( element.hasAttributeNS( KoXmlNS::config, "type" ) ) { - QString type = element.attributeNS( KoXmlNS::config, "type", QString::null ); - QString str = element.text(); + TQString type = element.attributeNS( KoXmlNS::config, "type", TQString() ); + TQString str = element.text(); return str; } - return QString::null; + return TQString(); } |