summaryrefslogtreecommitdiffstats
path: root/qtruby/rubylib/designer/rbuic/embed.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'qtruby/rubylib/designer/rbuic/embed.cpp')
-rw-r--r--qtruby/rubylib/designer/rbuic/embed.cpp52
1 files changed, 26 insertions, 26 deletions
diff --git a/qtruby/rubylib/designer/rbuic/embed.cpp b/qtruby/rubylib/designer/rbuic/embed.cpp
index 89985968..a1cf0a3f 100644
--- a/qtruby/rubylib/designer/rbuic/embed.cpp
+++ b/qtruby/rubylib/designer/rbuic/embed.cpp
@@ -35,14 +35,14 @@
**********************************************************************/
#include "uic.h"
-#include <qfile.h>
-#include <qimage.h>
-#include <qstringlist.h>
-#include <qdatetime.h>
-#include <qfileinfo.h>
+#include <tqfile.h>
+#include <tqimage.h>
+#include <tqstringlist.h>
+#include <tqdatetime.h>
+#include <tqfileinfo.h>
#define NO_STATIC_COLORS
#include <globaldefs.h>
-#include <qregexp.h>
+#include <tqregexp.h>
#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
@@ -52,14 +52,14 @@ struct EmbedImage
int width, height, depth;
int numColors;
QRgb* colorTable;
- QString name;
- QString cname;
+ TQString name;
+ TQString cname;
bool alpha;
};
-static QString convertToCIdentifier( const char *s )
+static TQString convertToCIdentifier( const char *s )
{
- QString r = s;
+ TQString r = s;
int len = r.length();
if ( len > 0 && !isalpha( (char)r[0].latin1() ) )
r[0] = '_';
@@ -71,16 +71,16 @@ static QString convertToCIdentifier( const char *s )
}
-static ulong embedData( QTextStream& out, const uchar* input, int nbytes )
+static ulong embedData( TQTextStream& out, const uchar* input, int nbytes )
{
#ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION
- QByteArray bazip( qCompress( input, nbytes ) );
+ TQByteArray bazip( qCompress( input, nbytes ) );
ulong len = bazip.size();
#else
ulong len = nbytes;
#endif
static const char hexdigits[] = "0123456789abcdef";
- QString s;
+ TQString s;
for ( int i=0; i<(int)len; i++ ) {
if ( (i%14) == 0 ) {
s += "\n ";
@@ -105,7 +105,7 @@ static ulong embedData( QTextStream& out, const uchar* input, int nbytes )
return len;
}
-static void embedData( QTextStream& out, const QRgb* input, int n )
+static void embedData( TQTextStream& out, const QRgb* input, int n )
{
out << hex;
const QRgb *v = input;
@@ -120,19 +120,19 @@ static void embedData( QTextStream& out, const QRgb* input, int n )
out << dec; // back to decimal mode
}
-void Uic::embed( QTextStream& out, const char* project, const QStringList& images )
+void Uic::embed( TQTextStream& out, const char* project, const TQStringList& images )
{
- QString cProject = convertToCIdentifier( project );
+ TQString cProject = convertToCIdentifier( project );
- QStringList::ConstIterator it;
+ TQStringList::ConstIterator it;
out << "# Image collection for project '" << project << "'." << endl;
out << "#" << endl;
out << "# Generated from reading image files: " << endl;
for ( it = images.begin(); it != images.end(); ++it )
out << "# " << *it << endl;
out << "#" << endl;
- out << "# Created: " << QDateTime::currentDateTime().toString() << endl;
+ out << "# Created: " << TQDateTime::currentDateTime().toString() << endl;
out << "# by: The QtRuby User Interface Compiler (rbuic)" << endl;
out << "#" << endl;
out << "# WARNING! All changes made in this file will be lost!" << endl;
@@ -147,10 +147,10 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
out << indent << "class MimeSourceFactory_" << cProject << " < Qt::MimeSourceFactory" << endl;
out << endl;
- QPtrList<EmbedImage> list_image;
+ TQPtrList<EmbedImage> list_image;
int image_count = 0;
for ( it = images.begin(); it != images.end(); ++it ) {
- QImage img;
+ TQImage img;
if ( !img.load( *it ) ) {
fprintf( stderr, "rbuic: cannot load image file %s\n", (*it).latin1() );
continue;
@@ -163,16 +163,16 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
e->colorTable = new QRgb[e->numColors];
e->alpha = img.hasAlphaBuffer();
memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(QRgb));
- QFileInfo fi( *it );
+ TQFileInfo fi( *it );
e->name = fi.fileName();
- e->cname = QString("@@image_%1").arg( image_count++);
+ e->cname = TQString("@@image_%1").arg( image_count++);
list_image.append( e );
out << "# " << *it << endl;
- QString imgname = (const char *)e->cname;
+ TQString imgname = (const char *)e->cname;
- QString s;
+ TQString s;
if ( e->depth == 1 )
- img = img.convertBitOrder(QImage::BigEndian);
+ img = img.convertBitOrder(TQImage::BigEndian);
out << indent << imgname << "_data = [";
embedData( out, img.bits(), img.numBytes() );
out << "]\n\n";
@@ -192,7 +192,7 @@ void Uic::embed( QTextStream& out, const char* project, const QStringList& image
{
out << indent << "\"" << e->name << "\"" << " => [" << e->cname << "_data, "
<< e->width << ", " << e->height << ", " << e->depth << ", "
- << (e->numColors ? e->cname + "_ctable" : QString::fromLatin1( "[]" ) ) << ", "
+ << (e->numColors ? e->cname + "_ctable" : TQString::fromLatin1( "[]" ) ) << ", "
<< (e->alpha ? "true" : "false") << "]," << endl;
e = list_image.next();
}