summaryrefslogtreecommitdiffstats
path: root/src/kernel/qpicture.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/kernel/qpicture.cpp')
-rw-r--r--src/kernel/qpicture.cpp104
1 files changed, 52 insertions, 52 deletions
diff --git a/src/kernel/qpicture.cpp b/src/kernel/qpicture.cpp
index 64245179a..b9d350a0e 100644
--- a/src/kernel/qpicture.cpp
+++ b/src/kernel/qpicture.cpp
@@ -104,8 +104,8 @@
static const char *mfhdr_tag = "TQPIC"; // header tag
-static const Q_UINT16 mfhdr_maj = 5; // major version #
-static const Q_UINT16 mfhdr_min = 0; // minor version #
+static const TQ_UINT16 mfhdr_maj = 5; // major version #
+static const TQ_UINT16 mfhdr_min = 0; // minor version #
/*!
@@ -397,13 +397,13 @@ bool TQPicture::play( TQPainter *painter )
s.device()->at( 10 ); // go directly to the data
s.setVersion( d->formatMajor == 4 ? 3 : d->formatMajor );
- Q_UINT8 c, clen;
- Q_UINT32 nrecords;
+ TQ_UINT8 c, clen;
+ TQ_UINT32 nrecords;
s >> c >> clen;
Q_ASSERT( c == PdcBegin );
// bounding rect was introduced in ver 4. Read in checkFormat().
if ( d->formatMajor >= 4 ) {
- Q_INT32 dummy;
+ TQ_INT32 dummy;
s >> dummy >> dummy >> dummy >> dummy;
}
s >> nrecords;
@@ -430,12 +430,12 @@ bool TQPicture::exec( TQPainter *painter, TQDataStream &s, int nrecords )
#if defined(QT_DEBUG)
int strm_pos;
#endif
- Q_UINT8 c; // command id
- Q_UINT8 tiny_len; // 8-bit length descriptor
- Q_INT32 len; // 32-bit length descriptor
- Q_INT16 i_16, i1_16, i2_16; // parameters...
- Q_INT8 i_8;
- Q_UINT32 ul;
+ TQ_UINT8 c; // command id
+ TQ_UINT8 tiny_len; // 8-bit length descriptor
+ TQ_INT32 len; // 32-bit length descriptor
+ TQ_INT16 i_16, i1_16, i2_16; // parameters...
+ TQ_INT8 i_8;
+ TQ_UINT32 ul;
TQCString str1;
TQString str;
TQPoint p, p1, p2;
@@ -676,7 +676,7 @@ bool TQPicture::exec( TQPainter *painter, TQDataStream &s, int nrecords )
}
#if defined(QT_DEBUG)
//tqDebug( "device->at(): %i, strm_pos: %i len: %i", s.device()->at(), strm_pos, len );
- Q_ASSERT( Q_INT32(s.device()->at() - strm_pos) == len );
+ Q_ASSERT( TQ_INT32(s.device()->at() - strm_pos) == len );
#endif
}
return FALSE;
@@ -710,40 +710,40 @@ bool TQPicture::TQPicturePrivate::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
pictb.setBuffer( empty ); // reset byte array in buffer
pictb.open( IO_WriteOnly );
s.writeRawBytes( mfhdr_tag, 4 );
- s << (Q_UINT16)0 << (Q_UINT16)formatMajor << (Q_UINT16)formatMinor;
- s << (Q_UINT8)c << (Q_UINT8)sizeof(Q_INT32);
+ s << (TQ_UINT16)0 << (TQ_UINT16)formatMajor << (TQ_UINT16)formatMinor;
+ s << (TQ_UINT8)c << (TQ_UINT8)sizeof(TQ_INT32);
brect = TQRect();
if ( formatMajor >= 4 ) {
- s << (Q_INT32)brect.left() << (Q_INT32)brect.top()
- << (Q_INT32)brect.width() << (Q_INT32)brect.height();
+ s << (TQ_INT32)brect.left() << (TQ_INT32)brect.top()
+ << (TQ_INT32)brect.width() << (TQ_INT32)brect.height();
}
trecs = 0;
- s << (Q_UINT32)trecs; // total number of records
+ s << (TQ_UINT32)trecs; // total number of records
formatOk = FALSE;
return TRUE;
} else if ( c == PdcEnd ) { // end; calc checksum and close
trecs++;
- s << (Q_UINT8)c << (Q_UINT8)0;
+ s << (TQ_UINT8)c << (TQ_UINT8)0;
TQByteArray buf = pictb.buffer();
- int cs_start = sizeof(Q_UINT32); // pos of checksum word
- int data_start = cs_start + sizeof(Q_UINT16);
- int brect_start = data_start + 2*sizeof(Q_INT16) + 2*sizeof(Q_UINT8);
+ int cs_start = sizeof(TQ_UINT32); // pos of checksum word
+ int data_start = cs_start + sizeof(TQ_UINT16);
+ int brect_start = data_start + 2*sizeof(TQ_INT16) + 2*sizeof(TQ_UINT8);
int pos = pictb.at();
pictb.at( brect_start );
if ( formatMajor >= 4 ) { // bounding rectangle
- s << (Q_INT32)brect.left() << (Q_INT32)brect.top()
- << (Q_INT32)brect.width() << (Q_INT32)brect.height();
+ s << (TQ_INT32)brect.left() << (TQ_INT32)brect.top()
+ << (TQ_INT32)brect.width() << (TQ_INT32)brect.height();
}
- s << (Q_UINT32)trecs; // write number of records
+ s << (TQ_UINT32)trecs; // write number of records
pictb.at( cs_start );
- Q_UINT16 cs = (Q_UINT16)tqChecksum( buf.data()+data_start, pos-data_start );
+ TQ_UINT16 cs = (TQ_UINT16)tqChecksum( buf.data()+data_start, pos-data_start );
s << cs; // write checksum
pictb.close();
return TRUE;
}
trecs++;
- s << (Q_UINT8)c; // write cmd to stream
- s << (Q_UINT8)0; // write dummy length info
+ 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
@@ -772,7 +772,7 @@ bool TQPicture::TQPicturePrivate::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
case PdcDrawArc:
case PdcDrawPie:
case PdcDrawChord:
- s << *p[0].rect << (Q_INT16)p[1].ival << (Q_INT16)p[2].ival;
+ s << *p[0].rect << (TQ_INT16)p[1].ival << (TQ_INT16)p[2].ival;
br = *p[0].rect;
corr = TRUE;
break;
@@ -790,14 +790,14 @@ bool TQPicture::TQPicturePrivate::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
break;
#endif
case PdcDrawPolygon:
- s << *p[0].ptarr << (Q_INT8)p[1].ival;
+ s << *p[0].ptarr << (TQ_INT8)p[1].ival;
br = p[0].ptarr->boundingRect();
corr = TRUE;
break;
case PdcDrawText2:
if ( formatMajor == 1 ) {
pictb.at( pos - 2 );
- s << (Q_UINT8)PdcDrawText << (Q_UINT8)0;
+ s << (TQ_UINT8)PdcDrawText << (TQ_UINT8)0;
TQCString str1( (*p[1].str).latin1() );
s << *p[0].point << str1;
}
@@ -810,12 +810,12 @@ bool TQPicture::TQPicturePrivate::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
case PdcDrawText2Formatted:
if ( formatMajor == 1 ) {
pictb.at( pos - 2 );
- s << (Q_UINT8)PdcDrawTextFormatted << (Q_UINT8)0;
+ s << (TQ_UINT8)PdcDrawTextFormatted << (TQ_UINT8)0;
TQCString str1( (*p[2].str).latin1() );
- s << *p[0].rect << (Q_INT16)p[1].ival << str1;
+ s << *p[0].rect << (TQ_INT16)p[1].ival << str1;
}
else {
- s << *p[0].rect << (Q_INT16)p[1].ival << *p[2].str;
+ s << *p[0].rect << (TQ_INT16)p[1].ival << *p[2].str;
}
br = *p[0].rect;
break;
@@ -850,7 +850,7 @@ bool TQPicture::TQPicturePrivate::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
break;
case PdcSetBkMode:
case PdcSetROP:
- s << (Q_INT8)p[0].ival;
+ s << (TQ_INT8)p[0].ival;
break;
case PdcSetFont: {
TQFont fnt = *p[0].font;
@@ -868,21 +868,21 @@ bool TQPicture::TQPicturePrivate::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
s << *p[0].brush;
break;
case PdcSetTabStops:
- s << (Q_INT16)p[0].ival;
+ s << (TQ_INT16)p[0].ival;
break;
case PdcSetTabArray:
- s << (Q_INT16)p[0].ival;
+ s << (TQ_INT16)p[0].ival;
if ( p[0].ival ) {
int *ta = p[1].ivec;
for ( int i=0; i<p[0].ival; i++ )
- s << (Q_INT16)ta[i];
+ s << (TQ_INT16)ta[i];
}
break;
case PdcSetUnit:
case PdcSetVXform:
case PdcSetWXform:
case PdcSetClip:
- s << (Q_INT8)p[0].ival;
+ s << (TQ_INT8)p[0].ival;
break;
#ifndef QT_NO_TRANSFORMATIONS
case PdcSetWindow:
@@ -890,12 +890,12 @@ bool TQPicture::TQPicturePrivate::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
s << *p[0].rect;
break;
case PdcSetWMatrix:
- s << *p[0].matrix << (Q_INT8)p[1].ival;
+ s << *p[0].matrix << (TQ_INT8)p[1].ival;
break;
#endif
case PdcSetClipRegion:
s << *p[0].rgn;
- s << (Q_INT8)p[1].ival;
+ s << (TQ_INT8)p[1].ival;
break;
#if defined(QT_CHECK_RANGE)
default:
@@ -906,14 +906,14 @@ bool TQPicture::TQPicturePrivate::cmd( int c, TQPainter *pt, TQPDevCmdParam *p )
int length = newpos - pos;
if ( length < 255 ) { // write 8-bit length
pictb.at(pos - 1); // position to right index
- s << (Q_UINT8)length;
+ s << (TQ_UINT8)length;
} else { // write 32-bit length
- s << (Q_UINT32)0; // extend the buffer
+ s << (TQ_UINT32)0; // extend the buffer
pictb.at(pos - 1); // position to right index
- s << (Q_UINT8)255; // indicate 32-bit length
+ s << (TQ_UINT8)255; // indicate 32-bit length
char *p = pictb.buffer().data();
memmove( p+pos+4, p+pos, length ); // make room for 4 byte
- s << (Q_UINT32)length;
+ s << (TQ_UINT32)length;
newpos += 4;
}
pictb.at( newpos ); // set to new position
@@ -1126,9 +1126,9 @@ bool TQPicture::TQPicturePrivate::checkFormat()
return FALSE;
}
- int cs_start = sizeof(Q_UINT32); // pos of checksum word
- int data_start = cs_start + sizeof(Q_UINT16);
- Q_UINT16 cs,ccs;
+ int cs_start = sizeof(TQ_UINT32); // pos of checksum word
+ int data_start = cs_start + sizeof(TQ_UINT16);
+ TQ_UINT16 cs,ccs;
TQByteArray buf = pictb.buffer(); // pointer to data
s >> cs; // read checksum
ccs = tqChecksum( buf.data() + data_start, buf.size() - data_start );
@@ -1141,7 +1141,7 @@ bool TQPicture::TQPicturePrivate::checkFormat()
return FALSE;
}
- Q_UINT16 major, minor;
+ TQ_UINT16 major, minor;
s >> major >> minor; // read version number
if ( major > mfhdr_maj ) { // new, incompatible version
#if defined(QT_CHECK_RANGE)
@@ -1153,11 +1153,11 @@ bool TQPicture::TQPicturePrivate::checkFormat()
}
s.setVersion( major != 4 ? major : 3 );
- Q_UINT8 c, clen;
+ TQ_UINT8 c, clen;
s >> c >> clen;
if ( c == PdcBegin ) {
if ( !( major >= 1 && major <= 3 )) {
- Q_INT32 l, t, w, h;
+ TQ_INT32 l, t, w, h;
s >> l >> t >> w >> h;
brect = TQRect( l, t, w, h );
}
@@ -1189,7 +1189,7 @@ bool TQPicture::TQPicturePrivate::checkFormat()
TQDataStream &operator<<( TQDataStream &s, const TQPicture &r )
{
- Q_UINT32 size = r.d->pictb.buffer().size();
+ TQ_UINT32 size = r.d->pictb.buffer().size();
s << size;
// null picture ?
if ( size == 0 )
@@ -1213,7 +1213,7 @@ TQDataStream &operator>>( TQDataStream &s, TQPicture &r )
// "init"; this code is similar to the beginning of TQPicture::cmd()
sr.setDevice( &r.d->pictb );
sr.setVersion( r.d->formatMajor );
- Q_UINT32 len;
+ TQ_UINT32 len;
s >> len;
TQByteArray data( len );
if ( len > 0 )