From 1e9fa8e06de5da7fcc268e9cccb2d6b21c5f53a3 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Sat, 20 Jul 2024 20:15:52 +0900 Subject: Rename graphics class nt* related files to equivalent tq* (part 2) Signed-off-by: Michele Calgaro --- doc/html/desktop-example.html | 68 +++++++++++++++++++++---------------------- 1 file changed, 34 insertions(+), 34 deletions(-) (limited to 'doc/html/desktop-example.html') diff --git a/doc/html/desktop-example.html b/doc/html/desktop-example.html index 64ccac086..11d07cc15 100644 --- a/doc/html/desktop-example.html +++ b/doc/html/desktop-example.html @@ -94,17 +94,17 @@ void poly() static int yvel[maxpoints]; int head = 0; int tail = -maxcurves + 2; - TQPointArray *a = new TQPointArray[ maxcurves ]; + TQPointArray *a = new TQPointArray[ maxcurves ]; TQPointArray *p; - TQRect r = d->rect(); // desktop rectangle + TQRect r = d->rect(); // desktop rectangle int i; for ( i=0; i<maxcurves; i++ ) a[i].resize( maxpoints ); p = &a[0]; for ( i=0; i<maxpoints; i++ ) { // setup first polygon points - p->setPoint( i, (kindaRand()&0x7fff) % r.width(), - (kindaRand()&0x7fff) % r.height() ); + p->setPoint( i, (kindaRand()&0x7fff) % r.width(), + (kindaRand()&0x7fff) % r.height() ); xvel[i] = velocity(i); yvel[i] = velocity(i); } @@ -118,8 +118,8 @@ void poly() if ( ++tail >= maxcurves ) tail = 0; - int minx=r.left(), maxx=r.right(); - int miny=r.top(), maxy=r.bottom(); + int minx=r.left(), maxx=r.right(); + int miny=r.top(), maxy=r.bottom(); int x, y; p = &a[head]; if ( ++head >= maxcurves ) @@ -170,16 +170,16 @@ void rotate() *p++ = (x+y)%128; } - TQPixmap pm; + TQPixmap pm; pm = image; // convert image to pixmap - pm.setOptimization( TQPixmap::BestOptim ); // rotation will be faster + pm.setOptimization( TQPixmap::BestOptim ); // rotation will be faster TQWidget *d = TQApplication::desktop(); // w = desktop widget for ( i=0; i<=360; i += 2 ) { - TQWMatrix m; - m.rotate( i ); // rotate coordinate system - TQPixmap rpm = pm.xForm( m ); // rpm = rotated pixmap + TQWMatrix m; + m.rotate( i ); // rotate coordinate system + TQPixmap rpm = pm.xForm( m ); // rpm = rotated pixmap d->setBackgroundPixmap( rpm ); // set desktop pixmap d->update(); // repaint desktop } @@ -189,17 +189,17 @@ void rotate() // Generates a marble-like pattern in pm. // -void generateStone( TQPixmap *pm, +void generateStone( TQPixmap *pm, const TQColor &c1, const TQColor &c2, const TQColor &c3 ) { TQPainter p; - TQPen p1 ( c1, 0 ); - TQPen p2 ( c2, 0 ); - TQPen p3 ( c3, 0 ); + TQPen p1 ( c1, 0 ); + TQPen p2 ( c2, 0 ); + TQPen p3 ( c3, 0 ); p.begin( pm ); - for( int i = 0 ; i < pm->width() ; i++ ) - for( int j = 0 ; j < pm->height() ; j++ ) { + for( int i = 0 ; i < pm->width() ; i++ ) + for( int j = 0 ; j < pm->height() ; j++ ) { int r = kindaRand(); if ( r < KINDA_RAND_MAX / 3 ) p.setPen( p1 ); @@ -251,7 +251,7 @@ public: void dropEvent( TQDropEvent * e ) { - TQPixmap pmp; + TQPixmap pmp; if ( TQImageDrag::decode( e, pmp ) ) { setBackgroundPixmap( pmp ); update(); @@ -259,7 +259,7 @@ public: } private: - TQPixmap *pm; + TQPixmap *pm; TQString text; }; @@ -282,19 +282,19 @@ void DesktopWidget::paintEvent( TQColor c2 = c1.light(104); TQColor c3 = c1.dark(106); if ( !pm ) { - pm = new TQPixmap( 64, 64 ); + pm = new TQPixmap( 64, 64 ); generateStone( pm, c1, c2, c3 ); setBackgroundPixmap( *pm ); update(); } - TQRect br = fontMetrics().boundingRect( text ); - TQPixmap offscreen( br.width(), br.height() ); - int x = width()/2 - br.width()/2; - int y = height()/2 - br.height()/2; - offscreen.fill( this, x, y ); + TQRect br = fontMetrics().boundingRect( text ); + TQPixmap offscreen( br.width(), br.height() ); + int x = width()/2 - br.width()/2; + int y = height()/2 - br.height()/2; + offscreen.fill( this, x, y ); TQPainter p; p.begin( &offscreen ); - drawShadeText( &p, -br.x(), -br.y(), text, c2, c3, 3 ); + drawShadeText( &p, -br.x(), -br.y(), text, c2, c3, 3 ); p.end(); bitBlt( this, x, y, &offscreen ); } @@ -315,24 +315,24 @@ void desktopText( const char *s = "Trolltech" ) TQColor c2 = c1.light(104); TQColor c3 = c1.dark(106); - TQPixmap pm(10,10); + TQPixmap pm(10,10); TQPainter p; p.begin( &pm ); - TQRect r = p.fontMetrics().boundingRect( s ); + TQRect r = p.fontMetrics().boundingRect( s ); p.end(); int appWidth = tqApp->desktop()->width(); int appHeight = tqApp->desktop()->height(); - if ( r.width() > appWidth - border*2 ) - r.setWidth( appWidth - border*2 ); - if ( r.height() > appHeight - border*2 ) - r.setHeight( appHeight - border*2 ); + if ( r.width() > appWidth - border*2 ) + r.setWidth( appWidth - border*2 ); + if ( r.height() > appHeight - border*2 ) + r.setHeight( appHeight - border*2 ); - pm.resize( r.size() + TQSize( border*2, border*2 ) ); + pm.resize( r.size() + TQSize( border*2, border*2 ) ); generateStone( &pm, c1, c2, c3 ); p.begin( &pm ); - drawShadeText( &p, -r.x() + border, -r.y() + border, s, c2, c3 ); + drawShadeText( &p, -r.x() + border, -r.y() + border, s, c2, c3 ); p.end(); tqApp->desktop()->setBackgroundPixmap( pm ); -- cgit v1.2.3