summaryrefslogtreecommitdiffstats
path: root/src/kernel/tqpicture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/tqpicture.cpp')
-rw-r--r--src/kernel/tqpicture.cpp94
1 files changed, 47 insertions, 47 deletions
diff --git a/src/kernel/tqpicture.cpp b/src/kernel/tqpicture.cpp
index c0fb3d008..692e9087a 100644
--- a/src/kernel/tqpicture.cpp
+++ b/src/kernel/tqpicture.cpp
@@ -145,7 +145,7 @@ TQPicture::TQPicture( int formatVersion )
if ( formatVersion > 0 && formatVersion != (int)mfhdr_maj ) {
d->formatMajor = formatVersion;
d->formatMinor = 0;
- d->formatOk = FALSE;
+ d->formatOk = false;
}
else {
d->resetFormat();
@@ -176,8 +176,8 @@ TQPicture::~TQPicture()
/*!
\fn bool TQPicture::isNull() const
- Returns TRUE if the picture contains no data; otherwise returns
- FALSE.
+ Returns true if the picture contains no data; otherwise returns
+ false.
*/
/*!
@@ -217,7 +217,7 @@ void TQPicture::setData( const char* data, uint size )
/*!
Loads a picture from the file specified by \a fileName and returns
- TRUE if successful; otherwise returns FALSE.
+ true if successful; otherwise returns false.
By default, the file will be interpreted as being in the native
TQPicture format. Specifying the \a format string is optional and
@@ -236,7 +236,7 @@ bool TQPicture::load( const TQString &fileName, const char *format )
{
TQFile f( fileName );
if ( !f.open(IO_ReadOnly) )
- return FALSE;
+ return false;
return load( &f, format );
}
@@ -252,7 +252,7 @@ bool TQPicture::load( TQIODevice *dev, const char *format )
if ( qstrcmp( format, "svg" ) == 0 ) {
TQSvgDevice svg;
if ( !svg.load( dev ) )
- return FALSE;
+ return false;
TQPainter p( this );
bool b = svg.play( &p );
d->brect = svg.boundingRect();
@@ -261,7 +261,7 @@ bool TQPicture::load( TQIODevice *dev, const char *format )
#endif
if ( format ) {
tqWarning( "TQPicture::load: No such picture format: %s", format );
- return FALSE;
+ return false;
}
detach();
@@ -272,7 +272,7 @@ bool TQPicture::load( TQIODevice *dev, const char *format )
/*!
Saves a picture to the file specified by \a fileName and returns
- TRUE if successful; otherwise returns FALSE.
+ true if successful; otherwise returns false.
Specifying the file \a format string is optional. It's not
recommended unless you intend to export the picture data for
@@ -294,7 +294,7 @@ bool TQPicture::save( const TQString &fileName, const char *format )
tqWarning( "TQPicture::save: still being painted on. "
"Call TQPainter::end() first" );
#endif
- return FALSE;
+ return false;
}
#ifndef TQT_NO_SVG
@@ -304,7 +304,7 @@ bool TQPicture::save( const TQString &fileName, const char *format )
TQSvgDevice svg;
TQPainter p( &svg );
if ( !play( &p ) )
- return FALSE;
+ return false;
svg.setBoundingRect( boundingRect() );
return svg.save( fileName );
}
@@ -312,7 +312,7 @@ bool TQPicture::save( const TQString &fileName, const char *format )
TQFile f( fileName );
if ( !f.open(IO_WriteOnly) )
- return FALSE;
+ return false;
return save( &f, format );
}
@@ -329,7 +329,7 @@ bool TQPicture::save( TQIODevice *dev, const char *format )
tqWarning( "TQPicture::save: still being painted on. "
"Call TQPainter::end() first" );
#endif
- return FALSE;
+ return false;
}
#ifndef TQT_NO_SVG
@@ -337,18 +337,18 @@ bool TQPicture::save( TQIODevice *dev, const char *format )
TQSvgDevice svg;
TQPainter p( &svg );
if ( !play( &p ) )
- return FALSE;
+ return false;
svg.setBoundingRect( boundingRect() );
return svg.save( dev );
}
#endif
if ( format ) {
tqWarning( "TQPicture::save: No such picture format: %s", format );
- return FALSE;
+ return false;
}
dev->writeBlock( d->pictb.buffer().data(), d->pictb.buffer().size() );
- return TRUE;
+ return true;
}
/*!
@@ -376,8 +376,8 @@ void TQPicture::setBoundingRect( const TQRect &r )
}
/*!
- Replays the picture using \a painter, and returns TRUE if
- successful; otherwise returns FALSE.
+ Replays the picture using \a painter, and returns true if
+ successful; otherwise returns false.
This function does exactly the same as TQPainter::drawPicture()
with (x, y) = (0, 0).
@@ -386,10 +386,10 @@ void TQPicture::setBoundingRect( const TQRect &r )
bool TQPicture::play( TQPainter *painter )
{
if ( d->pictb.size() == 0 ) // nothing recorded
- return TRUE;
+ return true;
if ( !d->formatOk && !d->checkFormat() )
- return FALSE;
+ return false;
d->pictb.open( IO_ReadOnly ); // open buffer device
TQDataStream s;
@@ -412,10 +412,10 @@ bool TQPicture::play( TQPainter *painter )
tqWarning( "TQPicture::play: Format error" );
#endif
d->pictb.close();
- return FALSE;
+ return false;
}
d->pictb.close();
- return TRUE; // no end-command
+ return true; // no end-command
}
@@ -562,11 +562,11 @@ bool TQPicture::exec( TQPainter *painter, TQDataStream &s, int nrecords )
case PdcBegin:
s >> ul; // number of records
if ( !exec( painter, s, ul ) )
- return FALSE;
+ return false;
break;
case PdcEnd:
if ( nrecords == 0 )
- return TRUE;
+ return true;
break;
case PdcSave:
painter->save();
@@ -679,7 +679,7 @@ bool TQPicture::exec( TQPainter *painter, TQDataStream &s, int nrecords )
Q_ASSERT( TQ_INT32(s.device()->at() - strm_pos) == len );
#endif
}
- return FALSE;
+ return false;
}
@@ -719,8 +719,8 @@ bool TQPicture::TQPicturePrivate::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
}
trecs = 0;
s << (TQ_UINT32)trecs; // total number of records
- formatOk = FALSE;
- return TRUE;
+ formatOk = false;
+ return true;
} else if ( c == PdcEnd ) { // end; calc checksum and close
trecs++;
s << (TQ_UINT8)c << (TQ_UINT8)0;
@@ -739,14 +739,14 @@ bool TQPicture::TQPicturePrivate::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
TQ_UINT16 cs = (TQ_UINT16)tqChecksum( buf.data()+data_start, pos-data_start );
s << cs; // write checksum
pictb.close();
- return TRUE;
+ return true;
}
trecs++;
s << (TQ_UINT8)c; // write cmd to stream
s << (TQ_UINT8)0; // write dummy length info
int pos = (int)pictb.at(); // save position
TQRect br; // bounding rect addition
- bool corr = FALSE; // correction for pen width
+ bool corr = false; // correction for pen width
switch ( c ) {
case PdcDrawPoint:
@@ -755,18 +755,18 @@ bool TQPicture::TQPicturePrivate::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
case PdcSetBrushOrigin:
s << *p[0].point;
br = TQRect( *p[0].point, TQSize( 1, 1 ) );
- corr = TRUE;
+ corr = true;
break;
case PdcDrawLine:
s << *p[0].point << *p[1].point;
br = TQRect( *p[0].point, *p[1].point ).normalize();
- corr = TRUE;
+ corr = true;
break;
case PdcDrawRect:
case PdcDrawEllipse:
s << *p[0].rect;
br = *p[0].rect;
- corr = TRUE;
+ corr = true;
break;
case PdcDrawRoundRect:
case PdcDrawArc:
@@ -774,25 +774,25 @@ bool TQPicture::TQPicturePrivate::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
case PdcDrawChord:
s << *p[0].rect << (TQ_INT16)p[1].ival << (TQ_INT16)p[2].ival;
br = *p[0].rect;
- corr = TRUE;
+ corr = true;
break;
case PdcDrawLineSegments:
case PdcDrawPolyline:
s << *p[0].ptarr;
br = p[0].ptarr->boundingRect();
- corr = TRUE;
+ corr = true;
break;
#ifndef TQT_NO_BEZIER
case PdcDrawCubicBezier:
s << *p[0].ptarr;
br = p[0].ptarr->cubicBezier().boundingRect();
- corr = TRUE;
+ corr = true;
break;
#endif
case PdcDrawPolygon:
s << *p[0].ptarr << (TQ_INT8)p[1].ival;
br = p[0].ptarr->boundingRect();
- corr = TRUE;
+ corr = true;
break;
case PdcDrawText2:
if ( formatMajor == 1 ) {
@@ -935,7 +935,7 @@ bool TQPicture::TQPicturePrivate::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
brect |= br; // merge with existing rect
}
- return TRUE;
+ return true;
}
@@ -1087,12 +1087,12 @@ TQPicture& TQPicture::operator= (const TQPicture& p)
/*!
\internal
- Sets formatOk to FALSE and resets the format version numbers to default
+ Sets formatOk to false and resets the format version numbers to default
*/
void TQPicture::TQPicturePrivate::resetFormat()
{
- formatOk = FALSE;
+ formatOk = false;
formatMajor = mfhdr_maj;
formatMinor = mfhdr_min;
}
@@ -1100,8 +1100,8 @@ void TQPicture::TQPicturePrivate::resetFormat()
/*!
\internal
- Checks data integrity and format version number. Set formatOk to TRUE
- on success, to FALSE otherwise. Returns the resulting formatOk value.
+ Checks data integrity and format version number. Set formatOk to true
+ on success, to false otherwise. Returns the resulting formatOk value.
*/
bool TQPicture::TQPicturePrivate::checkFormat()
@@ -1110,7 +1110,7 @@ bool TQPicture::TQPicturePrivate::checkFormat()
// can't check anything in an empty buffer
if ( pictb.size() == 0 )
- return FALSE;
+ return false;
pictb.open( IO_ReadOnly ); // open buffer device
TQDataStream s;
@@ -1123,7 +1123,7 @@ bool TQPicture::TQPicturePrivate::checkFormat()
tqWarning( "TQPicture::checkFormat: Incorrect header" );
#endif
pictb.close();
- return FALSE;
+ return false;
}
int cs_start = sizeof(TQ_UINT32); // pos of checksum word
@@ -1138,7 +1138,7 @@ bool TQPicture::TQPicturePrivate::checkFormat()
ccs, cs );
#endif
pictb.close();
- return FALSE;
+ return false;
}
TQ_UINT16 major, minor;
@@ -1149,7 +1149,7 @@ bool TQPicture::TQPicturePrivate::checkFormat()
major, minor);
#endif
pictb.close();
- return FALSE;
+ return false;
}
s.setVersion( major != 4 ? major : 3 );
@@ -1166,14 +1166,14 @@ bool TQPicture::TQPicturePrivate::checkFormat()
tqWarning( "TQPicture::checkFormat: Format error" );
#endif
pictb.close();
- return FALSE;
+ return false;
}
pictb.close();
- formatOk = TRUE; // picture seems to be ok
+ formatOk = true; // picture seems to be ok
formatMajor = major;
formatMinor = minor;
- return TRUE;
+ return true;
}
/*****************************************************************************