summaryrefslogtreecommitdiffstats
path: root/kimgio/ico.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-13 08:32:36 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-01-13 08:32:36 +0000
commitf7e71d47719ab6094cf4a9fafffa5ea351973522 (patch)
tree30834aa632d442019e14f88685001d94657d060b /kimgio/ico.cpp
parentb31cfd9a1ee986fe2ae9a693f3afd7f171dd897c (diff)
downloadtdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.tar.gz
tdelibs-f7e71d47719ab6094cf4a9fafffa5ea351973522.zip
Initial conversion for TQt for Qt4 3.4.0 TP2
This will also compile with TQt for Qt3, and should not cause any problems with dependent modules such as kdebase. If it does then it needs to be fixed! git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdelibs@1214149 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kimgio/ico.cpp')
-rw-r--r--kimgio/ico.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/kimgio/ico.cpp b/kimgio/ico.cpp
index 01ee37a1b..daaeb3de7 100644
--- a/kimgio/ico.cpp
+++ b/kimgio/ico.cpp
@@ -29,9 +29,9 @@ namespace
struct IcoHeader
{
enum Type { Icon = 1, Cursor };
- Q_UINT16 reserved;
- Q_UINT16 type;
- Q_UINT16 count;
+ TQ_UINT16 reserved;
+ TQ_UINT16 type;
+ TQ_UINT16 count;
};
inline TQDataStream& operator >>( TQDataStream& s, IcoHeader& h )
@@ -43,21 +43,21 @@ namespace
// (c) 1992-2002 Trolltech AS.
struct BMP_INFOHDR
{
- static const Q_UINT32 Size = 40;
- Q_UINT32 biSize; // size of this struct
- Q_UINT32 biWidth; // pixmap width
- Q_UINT32 biHeight; // pixmap height
- Q_UINT16 biPlanes; // should be 1
- Q_UINT16 biBitCount; // number of bits per pixel
+ static const TQ_UINT32 Size = 40;
+ TQ_UINT32 biSize; // size of this struct
+ TQ_UINT32 biWidth; // pixmap width
+ TQ_UINT32 biHeight; // pixmap height
+ TQ_UINT16 biPlanes; // should be 1
+ TQ_UINT16 biBitCount; // number of bits per pixel
enum Compression { RGB = 0 };
- Q_UINT32 biCompression; // compression method
- Q_UINT32 biSizeImage; // size of image
- Q_UINT32 biXPelsPerMeter; // horizontal resolution
- Q_UINT32 biYPelsPerMeter; // vertical resolution
- Q_UINT32 biClrUsed; // number of colors used
- Q_UINT32 biClrImportant; // number of important colors
+ TQ_UINT32 biCompression; // compression method
+ TQ_UINT32 biSizeImage; // size of image
+ TQ_UINT32 biXPelsPerMeter; // horizontal resolution
+ TQ_UINT32 biYPelsPerMeter; // vertical resolution
+ TQ_UINT32 biClrUsed; // number of colors used
+ TQ_UINT32 biClrImportant; // number of important colors
};
- const Q_UINT32 BMP_INFOHDR::Size;
+ const TQ_UINT32 BMP_INFOHDR::Size;
TQDataStream& operator >>( TQDataStream &s, BMP_INFOHDR &bi )
{
@@ -92,11 +92,11 @@ namespace
{
unsigned char width;
unsigned char height;
- Q_UINT16 colors;
- Q_UINT16 hotspotX;
- Q_UINT16 hotspotY;
- Q_UINT32 size;
- Q_UINT32 offset;
+ TQ_UINT16 colors;
+ TQ_UINT16 hotspotX;
+ TQ_UINT16 hotspotY;
+ TQ_UINT32 size;
+ TQ_UINT32 offset;
};
inline TQDataStream& operator >>( TQDataStream& s, IconRec& r )
@@ -177,7 +177,7 @@ namespace
unsigned char rgb[ 4 ];
stream.readRawBytes( reinterpret_cast< char* >( &rgb ),
sizeof( rgb ) );
- colorTable[ i ] = qRgb( rgb[ 2 ], rgb[ 1 ], rgb[ 0 ] );
+ colorTable[ i ] = tqRgb( rgb[ 2 ], rgb[ 1 ], rgb[ 0 ] );
}
unsigned bpl = ( rec.width * header.biBitCount + 31 ) / 32 * 4;
@@ -207,13 +207,13 @@ namespace
break;
case 24:
for ( unsigned x = 0; x < rec.width; ++x )
- *p++ = qRgb( pixel[ 3 * x + 2 ],
+ *p++ = tqRgb( pixel[ 3 * x + 2 ],
pixel[ 3 * x + 1 ],
pixel[ 3 * x ] );
break;
case 32:
for ( unsigned x = 0; x < rec.width; ++x )
- *p++ = qRgba( pixel[ 4 * x + 2 ],
+ *p++ = tqRgba( pixel[ 4 * x + 2 ],
pixel[ 4 * x + 1 ],
pixel[ 4 * x ],
pixel[ 4 * x + 3] );
@@ -233,7 +233,7 @@ namespace
QRgb* p = reinterpret_cast< QRgb* >( lines[ y ] );
for ( unsigned x = 0; x < rec.width; ++x, ++p )
if ( ( ( buf[ x / 8 ] >> ( 7 - ( x & 0x07 ) ) ) & 1 ) )
- *p &= RGB_MASK;
+ *p &= TQRGB_MASK;
}
delete[] buf;
}
@@ -306,7 +306,7 @@ extern "C" KDE_EXPORT void kimgio_ico_read( TQImageIO* io )
icon.setText( "X-HotspotY", 0, TQString::number( selected->hotspotY ) );
}
io->setImage(icon);
- io->setStatus(0);
+ io->setqStatus(0);
}
}