diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 16:20:48 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2011-12-05 16:20:48 -0600 |
commit | e63beeb5bdb82987b1e00bc35178667786fbad48 (patch) | |
tree | ab77b6ac830b7944d5d1eb9ce8f81feb8fdab948 /qtruby/rubylib | |
parent | 67557a2b56c0678c22ab1b00c4fd0224c5e9ed99 (diff) | |
download | tdebindings-e63beeb5bdb82987b1e00bc35178667786fbad48.tar.gz tdebindings-e63beeb5bdb82987b1e00bc35178667786fbad48.zip |
Fix incorrect conversion
Diffstat (limited to 'qtruby/rubylib')
-rw-r--r-- | qtruby/rubylib/designer/rbuic/domtool.cpp | 150 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/domtool.h | 22 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/embed.cpp | 40 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/form.cpp | 198 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/globaldefs.h | 12 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/main.cpp | 42 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/object.cpp | 162 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/parser.cpp | 22 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/parser.h | 2 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/subclassing.cpp | 40 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/uic.cpp | 396 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/uic.h | 182 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/widgetdatabase.cpp | 148 | ||||
-rw-r--r-- | qtruby/rubylib/designer/rbuic/widgetdatabase.h | 32 | ||||
-rw-r--r-- | qtruby/rubylib/designer/uilib/qui.cpp | 40 | ||||
-rw-r--r-- | qtruby/rubylib/qtruby/Qt.cpp | 300 | ||||
-rw-r--r-- | qtruby/rubylib/qtruby/handlers.cpp | 394 | ||||
-rw-r--r-- | qtruby/rubylib/qtruby/smokeruby.h | 2 |
18 files changed, 1092 insertions, 1092 deletions
diff --git a/qtruby/rubylib/designer/rbuic/domtool.cpp b/qtruby/rubylib/designer/rbuic/domtool.cpp index e42933b9..65ea3a71 100644 --- a/qtruby/rubylib/designer/rbuic/domtool.cpp +++ b/qtruby/rubylib/designer/rbuic/domtool.cpp @@ -51,9 +51,9 @@ \sa hasProperty() */ -TTQVariant DomTool::readProperty( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue, TTQString& comment ) +TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ) { - TTQDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" ) { if ( n.attribute( "name" ) != name ) @@ -68,9 +68,9 @@ TTQVariant DomTool::readProperty( const TTQDomElement& e, const TTQString& name, /*! \overload */ -TTQVariant DomTool::readProperty( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue ) +TQVariant DomTool::readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue ) { - TTQString comment; + TQString comment; return readProperty( e, name, defValue, comment ); } @@ -79,9 +79,9 @@ TTQVariant DomTool::readProperty( const TTQDomElement& e, const TTQString& name, \sa readProperty() */ -bool DomTool::hasProperty( const TTQDomElement& e, const TTQString& name ) +bool DomTool::hasProperty( const TQDomElement& e, const TQString& name ) { - TTQDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" ) { if ( n.attribute( "name" ) != name ) @@ -92,13 +92,13 @@ bool DomTool::hasProperty( const TTQDomElement& e, const TTQString& name ) return false; } -TTQStringList DomTool::propertiesOfType( const TTQDomElement& e, const TTQString& type ) +TQStringList DomTool::propertiesOfType( const TQDomElement& e, const TQString& type ) { - TTQStringList result; - TTQDomElement n; + TQStringList result; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" ) { - TTQDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); if ( n2.tagName() == type ) result += n.attribute( "name" ); } @@ -107,20 +107,20 @@ TTQStringList DomTool::propertiesOfType( const TTQDomElement& e, const TTQString } -TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& defValue ) +TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue ) { - TTQString dummy; + TQString dummy; return elementToVariant( e, defValue, dummy ); } /*! Interprets element \a e as variant and returns the result of the interpretation. */ -TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& defValue, TTQString &comment ) +TQVariant DomTool::elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment ) { - TTQVariant v; + TQVariant v; if ( e.tagName() == "rect" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int x = 0, y = 0, w = 0, h = 0; while ( !n3.isNull() ) { if ( n3.tagName() == "x" ) @@ -133,9 +133,9 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& h = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( TTQRect( x, y, w, h ) ); + v = TQVariant( TQRect( x, y, w, h ) ); } else if ( e.tagName() == "point" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int x = 0, y = 0; while ( !n3.isNull() ) { if ( n3.tagName() == "x" ) @@ -144,9 +144,9 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& y = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( TTQPoint( x, y ) ); + v = TQVariant( TQPoint( x, y ) ); } else if ( e.tagName() == "size" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int w = 0, h = 0; while ( !n3.isNull() ) { if ( n3.tagName() == "width" ) @@ -155,12 +155,12 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& h = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( TTQSize( w, h ) ); + v = TQVariant( TQSize( w, h ) ); } else if ( e.tagName() == "color" ) { - v = TTQVariant( readColor( e ) ); + v = TQVariant( readColor( e ) ); } else if ( e.tagName() == "font" ) { - TTQDomElement n3 = e.firstChild().toElement(); - TTQFont f( defValue.toFont() ); + TQDomElement n3 = e.firstChild().toElement(); + TQFont f( defValue.toFont() ); while ( !n3.isNull() ) { if ( n3.tagName() == "family" ) f.setFamily( n3.firstChild().toText().data() ); @@ -176,58 +176,58 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& f.setStrikeOut( n3.firstChild().toText().data().toInt() ); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( f ); + v = TQVariant( f ); } else if ( e.tagName() == "string" ) { - v = TTQVariant( e.firstChild().toText().data() ); - TTQDomElement n = e; + v = TQVariant( e.firstChild().toText().data() ); + TQDomElement n = e; n = n.nextSibling().toElement(); if ( n.tagName() == "comment" ) comment = n.firstChild().toText().data(); } else if ( e.tagName() == "cstring" ) { - v = TTQVariant( TTQCString( e.firstChild().toText().data() ) ); + v = TQVariant( TQCString( e.firstChild().toText().data() ) ); } else if ( e.tagName() == "number" ) { bool ok = true; - v = TTQVariant( e.firstChild().toText().data().toInt( &ok ) ); + v = TQVariant( e.firstChild().toText().data().toInt( &ok ) ); if ( !ok ) - v = TTQVariant( e.firstChild().toText().data().toDouble() ); + v = TQVariant( e.firstChild().toText().data().toDouble() ); } else if ( e.tagName() == "bool" ) { - TTQString t = e.firstChild().toText().data(); - v = TTQVariant( t == "true" || t == "1", 0 ); + TQString t = e.firstChild().toText().data(); + v = TQVariant( t == "true" || t == "1", 0 ); } else if ( e.tagName() == "pixmap" ) { - v = TTQVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "iconset" ) { - v = TTQVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "image" ) { - v = TTQVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "enum" ) { - v = TTQVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "set" ) { - v = TTQVariant( e.firstChild().toText().data() ); + v = TQVariant( e.firstChild().toText().data() ); } else if ( e.tagName() == "sizepolicy" ) { - TTQDomElement n3 = e.firstChild().toElement(); - TTQSizePolicy sp; + TQDomElement n3 = e.firstChild().toElement(); + TQSizePolicy sp; while ( !n3.isNull() ) { if ( n3.tagName() == "hsizetype" ) - sp.setHorData( (TTQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); else if ( n3.tagName() == "vsizetype" ) - sp.setVerData( (TTQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); else if ( n3.tagName() == "horstretch" ) sp.setHorStretch( n3.firstChild().toText().data().toInt() ); else if ( n3.tagName() == "verstretch" ) sp.setVerStretch( n3.firstChild().toText().data().toInt() ); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( sp ); + v = TQVariant( sp ); } else if ( e.tagName() == "cursor" ) { - v = TTQVariant( TTQCursor( e.firstChild().toText().data().toInt() ) ); + v = TQVariant( TQCursor( e.firstChild().toText().data().toInt() ) ); } else if ( e.tagName() == "stringlist" ) { - TTQStringList lst; - TTQDomElement n; + TQStringList lst; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) lst << n.firstChild().toText().data(); - v = TTQVariant( lst ); + v = TQVariant( lst ); } else if ( e.tagName() == "date" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int y, m, d; y = m = d = 0; while ( !n3.isNull() ) { @@ -239,9 +239,9 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& d = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( TTQDate( y, m, d ) ); + v = TQVariant( TQDate( y, m, d ) ); } else if ( e.tagName() == "time" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int h, m, s; h = m = s = 0; while ( !n3.isNull() ) { @@ -253,9 +253,9 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& s = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( TTQTime( h, m, s ) ); + v = TQVariant( TQTime( h, m, s ) ); } else if ( e.tagName() == "datetime" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int h, mi, s, y, mo, d ; h = mi = s = y = mo = d = 0; while ( !n3.isNull() ) { @@ -273,7 +273,7 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& d = n3.firstChild().toText().data().toInt(); n3 = n3.nextSibling().toElement(); } - v = TTQVariant( TTQDateTime( TTQDate( y, mo, d ), TTQTime( h, mi, s ) ) ); + v = TQVariant( TQDateTime( TQDate( y, mo, d ), TQTime( h, mi, s ) ) ); } return v; } @@ -282,9 +282,9 @@ TTQVariant DomTool::elementToVariant( const TTQDomElement& e, const TTQVariant& /*! Returns the color which is returned in the dom element \a e. */ -TTQColor DomTool::readColor( const TTQDomElement &e ) +TQColor DomTool::readColor( const TQDomElement &e ) { - TTQDomElement n = e.firstChild().toElement(); + TQDomElement n = e.firstChild().toElement(); int r= 0, g = 0, b = 0; while ( !n.isNull() ) { if ( n.tagName() == "red" ) @@ -296,7 +296,7 @@ TTQColor DomTool::readColor( const TTQDomElement &e ) n = n.nextSibling().toElement(); } - return TTQColor( r, g, b ); + return TQColor( r, g, b ); } /*! @@ -306,9 +306,9 @@ TTQColor DomTool::readColor( const TTQDomElement &e ) \sa hasAttribute() */ -TTQVariant DomTool::readAttribute( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue, TTQString& comment ) +TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ) { - TTQDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "attribute" ) { if ( n.attribute( "name" ) != name ) @@ -322,9 +322,9 @@ TTQVariant DomTool::readAttribute( const TTQDomElement& e, const TTQString& name /*! \overload */ -TTQVariant DomTool::readAttribute( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue ) +TQVariant DomTool::readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue ) { - TTQString comment; + TQString comment; return readAttribute( e, name, defValue, comment ); } @@ -333,9 +333,9 @@ TTQVariant DomTool::readAttribute( const TTQDomElement& e, const TTQString& name \sa readAttribute() */ -bool DomTool::hasAttribute( const TTQDomElement& e, const TTQString& name ) +bool DomTool::hasAttribute( const TQDomElement& e, const TQString& name ) { - TTQDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "attribute" ) { if ( n.attribute( "name" ) != name ) @@ -346,7 +346,7 @@ bool DomTool::hasAttribute( const TTQDomElement& e, const TTQString& name ) return false; } -static bool toBool( const TTQString& s ) +static bool toBool( const TQString& s ) { return s == "true" || s.toInt() != 0; } @@ -354,11 +354,11 @@ static bool toBool( const TTQString& s ) /*! Convert Qt 2.x format to Qt 3.0 format if necessary */ -void DomTool::fixDocument( TTQDomDocument& doc ) +void DomTool::fixDocument( TQDomDocument& doc ) { - TTQDomElement e; - TTQDomNode n; - TTQDomNodeList nl; + TQDomElement e; + TQDomNode n; + TQDomNodeList nl; int i = 0; e = doc.firstChild().toElement(); @@ -374,8 +374,8 @@ void DomTool::fixDocument( TTQDomDocument& doc ) // in 3.0, we need to fix a spelling error if ( e.hasAttribute("version") && e.attribute("version").toDouble() == 3.0 ) { for ( i = 0; i < (int) nl.length(); i++ ) { - TTQDomElement el = nl.item(i).toElement(); - TTQString s = el.attribute( "name" ); + TQDomElement el = nl.item(i).toElement(); + TQString s = el.attribute( "name" ); if ( s == "resizeable" ) { el.removeAttribute( "name" ); el.setAttribute( "name", "resizable" ); @@ -391,8 +391,8 @@ void DomTool::fixDocument( TTQDomDocument& doc ) e.setAttribute("stdsetdef", 1 ); for ( i = 0; i < (int) nl.length(); i++ ) { e = nl.item(i).toElement(); - TTQString name; - TTQDomElement n2 = e.firstChild().toElement(); + TQString name; + TQDomElement n2 = e.firstChild().toElement(); if ( n2.tagName() == "name" ) { name = n2.firstChild().toText().data(); if ( name == "resizeable" ) @@ -416,8 +416,8 @@ void DomTool::fixDocument( TTQDomDocument& doc ) nl = doc.elementsByTagName( "attribute" ); for ( i = 0; i < (int) nl.length(); i++ ) { e = nl.item(i).toElement(); - TTQString name; - TTQDomElement n2 = e.firstChild().toElement(); + TQString name; + TQDomElement n2 = e.firstChild().toElement(); if ( n2.tagName() == "name" ) { name = n2.firstChild().toText().data(); e.setAttribute( "name", name ); @@ -428,8 +428,8 @@ void DomTool::fixDocument( TTQDomDocument& doc ) nl = doc.elementsByTagName( "image" ); for ( i = 0; i < (int) nl.length(); i++ ) { e = nl.item(i).toElement(); - TTQString name; - TTQDomElement n2 = e.firstChild().toElement(); + TQString name; + TQDomElement n2 = e.firstChild().toElement(); if ( n2.tagName() == "name" ) { name = n2.firstChild().toText().data(); e.setAttribute( "name", name ); @@ -440,8 +440,8 @@ void DomTool::fixDocument( TTQDomDocument& doc ) nl = doc.elementsByTagName( "widget" ); for ( i = 0; i < (int) nl.length(); i++ ) { e = nl.item(i).toElement(); - TTQString name; - TTQDomElement n2 = e.firstChild().toElement(); + TQString name; + TQDomElement n2 = e.firstChild().toElement(); if ( n2.tagName() == "class" ) { name = n2.firstChild().toText().data(); e.setAttribute( "class", name ); diff --git a/qtruby/rubylib/designer/rbuic/domtool.h b/qtruby/rubylib/designer/rbuic/domtool.h index cf3bfc65..8f3aa67c 100644 --- a/qtruby/rubylib/designer/rbuic/domtool.h +++ b/qtruby/rubylib/designer/rbuic/domtool.h @@ -36,17 +36,17 @@ class TQDomDocument; class DomTool : public Qt { public: - static TTQVariant readProperty( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue ); - static TTQVariant readProperty( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue, TTQString& comment ); - static bool hasProperty( const TTQDomElement& e, const TTQString& name ); - static TTQStringList propertiesOfType( const TTQDomElement& e, const TTQString& type ); - static TTQVariant elementToVariant( const TTQDomElement& e, const TTQVariant& defValue ); - static TTQVariant elementToVariant( const TTQDomElement& e, const TTQVariant& defValue, TTQString &comment ); - static TTQVariant readAttribute( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue ); - static TTQVariant readAttribute( const TTQDomElement& e, const TTQString& name, const TTQVariant& defValue, TTQString& comment ); - static bool hasAttribute( const TTQDomElement& e, const TTQString& name ); - static TTQColor readColor( const TTQDomElement &e ); - static void fixDocument( TTQDomDocument& ); + static TQVariant readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue ); + static TQVariant readProperty( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ); + static bool hasProperty( const TQDomElement& e, const TQString& name ); + static TQStringList propertiesOfType( const TQDomElement& e, const TQString& type ); + static TQVariant elementToVariant( const TQDomElement& e, const TQVariant& defValue ); + static TQVariant elementToVariant( const TQDomElement& e, const TQVariant& defValue, TQString &comment ); + static TQVariant readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue ); + static TQVariant readAttribute( const TQDomElement& e, const TQString& name, const TQVariant& defValue, TQString& comment ); + static bool hasAttribute( const TQDomElement& e, const TQString& name ); + static TQColor readColor( const TQDomElement &e ); + static void fixDocument( TQDomDocument& ); }; diff --git a/qtruby/rubylib/designer/rbuic/embed.cpp b/qtruby/rubylib/designer/rbuic/embed.cpp index 365eaf7d..3377a1b0 100644 --- a/qtruby/rubylib/designer/rbuic/embed.cpp +++ b/qtruby/rubylib/designer/rbuic/embed.cpp @@ -52,14 +52,14 @@ struct EmbedImage int width, height, depth; int numColors; TQRgb* colorTable; - TTQString name; - TTQString cname; + TQString name; + TQString cname; bool alpha; }; -static TTQString convertToCIdentifier( const char *s ) +static TQString convertToCIdentifier( const char *s ) { - TTQString r = s; + TQString r = s; int len = r.length(); if ( len > 0 && !isalpha( (char)r[0].latin1() ) ) r[0] = '_'; @@ -71,16 +71,16 @@ static TTQString convertToCIdentifier( const char *s ) } -static ulong embedData( TTQTextStream& out, const uchar* input, int nbytes ) +static ulong embedData( TQTextStream& out, const uchar* input, int nbytes ) { #ifndef QT_NO_IMAGE_COLLECTION_COMPRESSION - TTQByteArray bazip( qCompress( input, nbytes ) ); + TQByteArray bazip( qCompress( input, nbytes ) ); ulong len = bazip.size(); #else ulong len = nbytes; #endif static const char hexdigits[] = "0123456789abcdef"; - TTQString s; + TQString s; for ( int i=0; i<(int)len; i++ ) { if ( (i%14) == 0 ) { s += "\n "; @@ -105,7 +105,7 @@ static ulong embedData( TTQTextStream& out, const uchar* input, int nbytes ) return len; } -static void embedData( TTQTextStream& out, const TQRgb* input, int n ) +static void embedData( TQTextStream& out, const TQRgb* input, int n ) { out << hex; const TQRgb *v = input; @@ -120,19 +120,19 @@ static void embedData( TTQTextStream& out, const TQRgb* input, int n ) out << dec; // back to decimal mode } -void Uic::embed( TTQTextStream& out, const char* project, const TTQStringList& images ) +void Uic::embed( TQTextStream& out, const char* project, const TQStringList& images ) { - TTQString cProject = convertToCIdentifier( project ); + TQString cProject = convertToCIdentifier( project ); - TTQStringList::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: " << TTQDateTime::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( TTQTextStream& out, const char* project, const TTQStringList& i out << indent << "class MimeSourceFactory_" << cProject << " < TQt::MimeSourceFactory" << endl; out << endl; - TTQPtrList<EmbedImage> list_image; + TQPtrList<EmbedImage> list_image; int image_count = 0; for ( it = images.begin(); it != images.end(); ++it ) { - TTQImage 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( TTQTextStream& out, const char* project, const TTQStringList& i e->colorTable = new TQRgb[e->numColors]; e->alpha = img.hasAlphaBuffer(); memcpy(e->colorTable, img.colorTable(), e->numColors*sizeof(TQRgb)); - TTQFileInfo fi( *it ); + TQFileInfo fi( *it ); e->name = fi.fileName(); - e->cname = TTQString("@@image_%1").arg( image_count++); + e->cname = TQString("@@image_%1").arg( image_count++); list_image.append( e ); out << "# " << *it << endl; - TTQString imgname = (const char *)e->cname; + TQString imgname = (const char *)e->cname; - TTQString s; + TQString s; if ( e->depth == 1 ) - img = img.convertBitOrder(TTQImage::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( TTQTextStream& out, const char* project, const TTQStringList& i { out << indent << "\"" << e->name << "\"" << " => [" << e->cname << "_data, " << e->width << ", " << e->height << ", " << e->depth << ", " - << (e->numColors ? e->cname + "_ctable" : TTQString::fromLatin1( "[]" ) ) << ", " + << (e->numColors ? e->cname + "_ctable" : TQString::fromLatin1( "[]" ) ) << ", " << (e->alpha ? "true" : "false") << "]," << endl; e = list_image.next(); } diff --git a/qtruby/rubylib/designer/rbuic/form.cpp b/qtruby/rubylib/designer/rbuic/form.cpp index eb9d6ee7..bbb0c7f6 100644 --- a/qtruby/rubylib/designer/rbuic/form.cpp +++ b/qtruby/rubylib/designer/rbuic/form.cpp @@ -42,7 +42,7 @@ #include <zlib.h> -static TTQByteArray unzipXPM( TTQString data, ulong& length ) +static TQByteArray unzipXPM( TQString data, ulong& length ) { const int lengthOffset = 4; int baSize = data.length() / 2 + lengthOffset; @@ -68,13 +68,13 @@ static TTQByteArray unzipXPM( TTQString data, ulong& length ) ba[1] = ( length & 0x00ff0000 ) >> 16; ba[2] = ( length & 0x0000ff00 ) >> 8; ba[3] = ( length & 0x000000ff ); - TTQByteArray baunzip = qUncompress( ba, baSize ); + TQByteArray baunzip = qUncompress( ba, baSize ); delete[] ba; return baunzip; } -static TTQString imageDataName(TTQString name) { - TTQString result = name + "_data"; +static TQString imageDataName(TQString name) { + TQString result = name + "_data"; result.replace("@", "@@"); return result; } @@ -84,15 +84,15 @@ static TTQString imageDataName(TTQString name) { \sa createFormDecl(), createObjectImpl() */ -void Uic::createFormImpl( const TTQDomElement &e ) +void Uic::createFormImpl( const TQDomElement &e ) { - TTQDomElement n; - TTQDomNodeList nl; + TQDomElement n; + TQDomNodeList nl; int i; - TTQString objClass = getClassName( e ); + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; - TTQString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if (hasKDEwidget) { out << indent << "retquire 'Korundum'" << endl << endl; @@ -101,16 +101,16 @@ void Uic::createFormImpl( const TTQDomElement &e ) } // generate local and local includes retquired - TTQStringList globalIncludes, localIncludes; - TTQStringList::Iterator it; - TTQStringList sqlClasses; + TQStringList globalIncludes, localIncludes; + TQStringList::Iterator it; + TQStringList sqlClasses; - TTQMap<TTQString, CustomInclude> customWidgetIncludes; - TTQMap<TTQString, TTQString> functionImpls; + TQMap<TQString, CustomInclude> customWidgetIncludes; + TQMap<TQString, TQString> functionImpls; // find additional slots - TTQStringList extraSlots; - TTQStringList extraSlotTypes; + TQStringList extraSlots; + TQStringList extraSlotTypes; nl = e.parentNode().toElement().elementsByTagName( "slot" ); for ( i = 0; i < (int) nl.length(); i++ ) { n = nl.item(i).toElement(); @@ -119,7 +119,7 @@ void Uic::createFormImpl( const TTQDomElement &e ) continue; if ( n.attribute( "language", "C++" ) != "C++" ) continue; - TTQString slotName = n.firstChild().toText().data().stripWhiteSpace(); + TQString slotName = n.firstChild().toText().data().stripWhiteSpace(); if ( slotName.endsWith( ";" ) ) slotName = slotName.left( slotName.length() - 1 ); @@ -128,7 +128,7 @@ void Uic::createFormImpl( const TTQDomElement &e ) } // find signals - TTQStringList extraSignals; + TQStringList extraSignals; nl = e.parentNode().toElement().elementsByTagName( "signal" ); for ( i = 0; i < (int) nl.length(); i++ ) { n = nl.item(i).toElement(); @@ -137,19 +137,19 @@ void Uic::createFormImpl( const TTQDomElement &e ) continue; if ( n.attribute( "language", "C++" ) != "C++" ) continue; - TTQString sigName = n.firstChild().toText().data().stripWhiteSpace(); + TQString sigName = n.firstChild().toText().data().stripWhiteSpace(); if ( sigName.endsWith( ";" ) ) sigName = sigName.left( sigName.length() - 1 ); extraSignals += sigName; } //find additional functions - TTQStringList extraFunctions; + TQStringList extraFunctions; for ( n = e; !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "functions" ) { // compatibility - for ( TTQDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + for ( TQDomElement n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { if ( n2.tagName() == "function" ) { - TTQString fname; + TQString fname; if( !n2.attribute("name").isNull() ) { fname = n2.attribute( "name" ); @@ -165,11 +165,11 @@ void Uic::createFormImpl( const TTQDomElement &e ) } } } else if ( n.tagName() == "customwidgets" ) { - TTQDomElement n2 = n.firstChild().toElement(); + TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "customwidget" ) { - TTQDomElement n3 = n2.firstChild().toElement(); - TTQString cl, header; + TQDomElement n3 = n2.firstChild().toElement(); + TQString cl, header; WidgetDatabaseRecord *r = new WidgetDatabaseRecord; while ( !n3.isNull() ) { if ( n3.tagName() == "class" ) { @@ -253,7 +253,7 @@ void Uic::createFormImpl( const TTQDomElement &e ) ++indent; // additional attributes (from Designer) - TTQStringList publicVars, protectedVars, privateVars; + TQStringList publicVars, protectedVars, privateVars; nl = e.parentNode().toElement().elementsByTagName( "variable" ); for ( i = 0; i < (int)nl.length(); i++ ) { n = nl.item( i ).toElement(); @@ -261,8 +261,8 @@ void Uic::createFormImpl( const TTQDomElement &e ) // Someday it should be uncommented. //if ( n.parentNode().toElement().tagName() != "variables" ) // continue; - TTQString access = n.attribute( "access", "protected" ); - TTQString var = n.firstChild().toText().data().stripWhiteSpace(); + TQString access = n.attribute( "access", "protected" ); + TQString var = n.firstChild().toText().data().stripWhiteSpace(); if ( var.endsWith( ";" ) ) var.truncate(var.length() - 1); if ( access == "public" ) @@ -288,10 +288,10 @@ void Uic::createFormImpl( const TTQDomElement &e ) // additional includes (local or global ) and forward declaractions nl = e.parentNode().toElement().elementsByTagName( "include" ); for ( i = 0; i < (int) nl.length(); i++ ) { - TTQDomElement n2 = nl.item(i).toElement(); - TTQString s = n2.firstChild().toText().data(); + TQDomElement n2 = nl.item(i).toElement(); + TQString s = n2.firstChild().toText().data(); if ( n2.attribute( "location" ) != "local" ) { - if ( s.right( 5 ) == ".ui.h" && !TTQFile::exists( s ) ) + if ( s.right( 5 ) == ".ui.h" && !TQFile::exists( s ) ) continue; if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" ) continue; @@ -301,10 +301,10 @@ void Uic::createFormImpl( const TTQDomElement &e ) // do the local includes afterwards, since global includes have priority on clashes for ( i = 0; i < (int) nl.length(); i++ ) { - TTQDomElement n2 = nl.item(i).toElement(); - TTQString s = n2.firstChild().toText().data(); + TQDomElement n2 = nl.item(i).toElement(); + TQString s = n2.firstChild().toText().data(); if ( n2.attribute( "location" ) == "local" &&!globalIncludes.contains( s ) ) { - if ( s.right( 5 ) == ".ui.h" && !TTQFile::exists( s ) ) + if ( s.right( 5 ) == ".ui.h" && !TQFile::exists( s ) ) continue; if ( n2.attribute( "impldecl", "in implementation" ) != "in implementation" ) continue; @@ -315,8 +315,8 @@ void Uic::createFormImpl( const TTQDomElement &e ) // additional custom widget headers nl = e.parentNode().toElement().elementsByTagName( "header" ); for ( i = 0; i < (int) nl.length(); i++ ) { - TTQDomElement n2 = nl.item(i).toElement(); - TTQString s = n2.firstChild().toText().data(); + TQDomElement n2 = nl.item(i).toElement(); + TQString s = n2.firstChild().toText().data(); if ( n2.attribute( "location" ) != "local" ) globalIncludes += s; else @@ -325,17 +325,17 @@ void Uic::createFormImpl( const TTQDomElement &e ) // grab slots/funcs defined in ui.h files - for(TTQStringList::Iterator it = localIncludes.begin(); it != localIncludes.end(); ++it) + for(TQStringList::Iterator it = localIncludes.begin(); it != localIncludes.end(); ++it) { if((*it).right( 5 ) == ".ui.h") { - TTQFile f((*it)); + TQFile f((*it)); if( f.open( IO_ReadOnly ) ) { - TTQRegExp re("^def\\s+([a-zA-Z0-9_]+)\\s.*$"); - TTQRegExp re2("^end\\s*$"); - TTQTextStream t( &f ); - TTQString s, s2, s3; + TQRegExp re("^def\\s+([a-zA-Z0-9_]+)\\s.*$"); + TQRegExp re2("^end\\s*$"); + TQTextStream t( &f ); + TQString s, s2, s3; while ( !t.eof() ) { s = t.readLine(); @@ -366,7 +366,7 @@ void Uic::createFormImpl( const TTQDomElement &e ) for ( it = tags.begin(); it != tags.end(); ++it ) { nl = e.parentNode().toElement().elementsByTagName( *it ); for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget - TTQString name = getClassName( nl.item(i).toElement() ); + TQString name = getClassName( nl.item(i).toElement() ); if ( name == "Spacer" ) { globalIncludes += "tqlayout.h"; globalIncludes += "tqapplication.h"; @@ -375,8 +375,8 @@ void Uic::createFormImpl( const TTQDomElement &e ) if ( name.mid( 4 ) == "ListView" ) globalIncludes += "tqheader.h"; if ( name != objClass ) { - int wid = WidgetDatabase::idFromClassName( name.replace( TTQRegExp("^TQt::"), "Q" ) ); - TTQMap<TTQString, CustomInclude>::Iterator it = customWidgetIncludes.find( name ); + int wid = WidgetDatabase::idFromClassName( name.replace( TQRegExp("^TQt::"), "Q" ) ); + TQMap<TQString, CustomInclude>::Iterator it = customWidgetIncludes.find( name ); if ( it == customWidgetIncludes.end() ) globalIncludes += WidgetDatabase::includeFile( wid ); } @@ -417,22 +417,22 @@ void Uic::createFormImpl( const TTQDomElement &e ) out << endl; // find out what images are retquired - TTQStringList retquiredImages; + TQStringList retquiredImages; static const char *imgTags[] = { "pixmap", "iconset", 0 }; for ( i = 0; imgTags[i] != 0; i++ ) { nl = e.parentNode().toElement().elementsByTagName( imgTags[i] ); for ( int j = 0; j < (int) nl.length(); j++ ) { - TTQString img = "@"; + TQString img = "@"; retquiredImages += (img + nl.item(j).firstChild().toText().data()); } } // register the object and unify its name - TTQString loadFunction(objName); + TQString loadFunction(objName); objName = registerObject( objName ); - TTQStringList images; - TTQStringList xpmImages; + TQStringList images; + TQStringList xpmImages; if ( pixmapLoaderFunction.isEmpty() && !externPixmaps ) { // create images @@ -443,19 +443,19 @@ void Uic::createFormImpl( const TTQDomElement &e ) nl = n.elementsByTagName( "image" ); for ( i = 0; i < (int) nl.length(); i++ ) { - TTQString img = registerObject( nl.item(i).toElement().attribute( "name" ) ); + TQString img = registerObject( nl.item(i).toElement().attribute( "name" ) ); if ( !retquiredImages.contains( img ) ) continue; - TTQDomElement tmp = nl.item(i).firstChild().toElement(); + TQDomElement tmp = nl.item(i).firstChild().toElement(); if ( tmp.tagName() != "data" ) continue; - TTQString format = tmp.attribute("format", "PNG" ); - TTQString data = tmp.firstChild().toText().data(); + TQString format = tmp.attribute("format", "PNG" ); + TQString data = tmp.firstChild().toText().data(); if ( format == "XPM.GZ" ) { xpmImages += img; ulong length = tmp.attribute("length").toULong(); - TTQByteArray baunzip = unzipXPM( data, length ); + TQByteArray baunzip = unzipXPM( data, length ); // shouldn't we test the initial `length' against the // resulting `length' to catch corrupt UIC files? int a = 0; @@ -484,13 +484,13 @@ void Uic::createFormImpl( const TTQDomElement &e ) ++indent; int a ; for ( a = 0; a < (int) (data.length()/2)-1; a++ ) { - out << "0x" << TTQString(data[2*a]) << TTQString(data[2*a+1]) << ","; + out << "0x" << TQString(data[2*a]) << TQString(data[2*a+1]) << ","; if ( a % 12 == 11 ) out << endl << " "; else out << " "; } - out << "0x" << TTQString(data[2*a]) << TTQString(data[2*a+1]) << " ].pack \"C*\"" << endl; + out << "0x" << TQString(data[2*a]) << TQString(data[2*a+1]) << " ].pack \"C*\"" << endl; --indent; out << endl; } @@ -548,7 +548,7 @@ void Uic::createFormImpl( const TTQDomElement &e ) // create pixmaps for all images if ( !images.isEmpty() ) { - TTQStringList::Iterator it; + TQStringList::Iterator it; for ( it = images.begin(); it != images.end(); ++it ) { out << indent << (*it) << " = TQt::Pixmap.new()" << endl; out << indent << (*it) << ".loadFromData(" << imageDataName(*it) << ", " << imageDataName(*it) << ".length, \"PNG\")" << endl; @@ -567,21 +567,21 @@ void Uic::createFormImpl( const TTQDomElement &e ) out << indent << "statusBar()" << endl; // set the properties - TTQSize geometry( 0, 0 ); + TQSize geometry( 0, 0 ); for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" ) { bool stdset = stdsetdef; if ( n.hasAttribute( "stdset" ) ) stdset = toBool( n.attribute( "stdset" ) ); - TTQString prop = n.attribute("name"); - TTQDomElement n2 = n.firstChild().toElement(); - TTQString value = setObjectProperty( objClass, TTQString::null, prop, n2, stdset ); + TQString prop = n.attribute("name"); + TQDomElement n2 = n.firstChild().toElement(); + TQString value = setObjectProperty( objClass, TQString::null, prop, n2, stdset ); if ( value.isEmpty() ) continue; if ( prop == "geometry" && n2.tagName() == "rect") { - TTQDomElement n3 = n2.firstChild().toElement(); + TQDomElement n3 = n2.firstChild().toElement(); while ( !n3.isNull() ) { if ( n3.tagName() == "width" ) geometry.setWidth( n3.firstChild().toText().data().toInt() ); @@ -590,7 +590,7 @@ void Uic::createFormImpl( const TTQDomElement &e ) n3 = n3.nextSibling().toElement(); } } else { - TTQString call; + TQString call; if ( stdset ) { call = mkStdSet( prop ) + "(" + value + ")"; } else { @@ -620,12 +620,12 @@ void Uic::createFormImpl( const TTQDomElement &e ) { if ( tags.contains( n.tagName() ) ) { - TTQString page = createObjectImpl( n, objClass, "self" ); - TTQString comment; - TTQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); + TQString page = createObjectImpl( n, objClass, "self" ); + TQString comment; + TQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); out << indent << "addPage(" << page << ", "<< trcall( label ) << ")" << endl; trout << indent << "setTitle( " << page << ", " << trcall( label, comment ) << " )" << endl; - TTQVariant def( false, 0 ); + TQVariant def( false, 0 ); if ( DomTool::hasAttribute( n, "backEnabled" ) ) out << indent << "setBackEnabled(" << page << "," << mkBool( DomTool::readAttribute( n, "backEnabled", def).toBool() ) << ");" << endl; if ( DomTool::hasAttribute( n, "nextEnabled" ) ) @@ -661,13 +661,13 @@ void Uic::createFormImpl( const TTQDomElement &e ) nl = e.parentNode().toElement().elementsByTagName( "widget" ); for ( i = 1; i < (int) nl.length(); i++ ) { // start at 1, 0 is the toplevel widget n = nl.item(i).toElement(); - TTQString s = getClassName( n ); + TQString s = getClassName( n ); if ( s == "TQt::DataBrowser" || s == "TQt::DataView" ) { - TTQString objName = getObjectName( n ); - TTQString tab = getDatabaseInfo( n, "table" ); - TTQString con = getDatabaseInfo( n, "connection" ); + TQString objName = getObjectName( n ); + TQString tab = getDatabaseInfo( n, "table" ); + TQString con = getDatabaseInfo( n, "connection" ); out << indent << objName << "Form = TQt::SqlForm.new(self, \"" << objName << "Form\")" << endl; - TTQDomElement n2; + TQDomElement n2; for ( n2 = n.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) createFormImpl( n2, objName, con, tab ); out << indent << objName << ".setForm(" << objName << "Form)" << endl; @@ -724,8 +724,8 @@ void Uic::createFormImpl( const TTQDomElement &e ) out << endl; nl = n.elementsByTagName( "connection" ); for ( i = 0; i < (int) nl.length(); i++ ) { - TTQString sender, receiver, signal, slot; - for ( TTQDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + TQString sender, receiver, signal, slot; + for ( TQDomElement n2 = nl.item(i).firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { if ( n2.tagName() == "sender" ) sender = n2.firstChild().toText().data(); else if ( n2.tagName() == "receiver" ) @@ -756,11 +756,11 @@ void Uic::createFormImpl( const TTQDomElement &e ) } else if ( n.tagName() == "tabstops" ) { // setup tab order out << endl; - TTQString lastName; - TTQDomElement n2 = n.firstChild().toElement(); + TQString lastName; + TQDomElement n2 = n.firstChild().toElement(); while ( !n2.isNull() ) { if ( n2.tagName() == "tabstop" ) { - TTQString name = n2.firstChild().toText().data(); + TQString name = n2.firstChild().toText().data(); name = registeredName( name ); if ( !lastName.isEmpty() ) out << indent << "setTabOrder(" << lastName << ", " << name << ")" << endl; @@ -774,7 +774,7 @@ void Uic::createFormImpl( const TTQDomElement &e ) // QtRuby - FIXME: what the heck is this ? // buddies bool firstBuddy = true; - for ( TTQValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) { + for ( TQValueList<Buddy>::Iterator buddy = buddies.begin(); buddy != buddies.end(); ++buddy ) { if ( isObjectRegistered( (*buddy).buddy ) ) { if ( firstBuddy ) { out << endl; @@ -803,7 +803,7 @@ void Uic::createFormImpl( const TTQDomElement &e ) for ( i = 0; i < (int) nl.length(); i++ ) { if ( !DomTool::propertiesOfType( nl.item(i).toElement() , "font" ).isEmpty() ) needFontEventHandler = true; - TTQString s = getClassName( nl.item(i).toElement() ); + TQString s = getClassName( nl.item(i).toElement() ); if ( s == "TQt::DataTable" || s == "TQt::DataBrowser" ) { if ( !isFrameworkCodeGenerated( nl.item(i).toElement() ) ) continue; @@ -832,7 +832,7 @@ void Uic::createFormImpl( const TTQDomElement &e ) out << " if ev.type() == TQt::Event::ApplicationFontChange " << endl; for ( i = 0; i < (int) nl.length(); i++ ) { n = nl.item(i).toElement(); - TTQStringList list = DomTool::propertiesOfType( n, "font" ); + TQStringList list = DomTool::propertiesOfType( n, "font" ); for ( it = list.begin(); it != list.end(); ++it ) createExclusiveProperty( n, *it ); } @@ -854,12 +854,12 @@ void Uic::createFormImpl( const TTQDomElement &e ) ++indent; if ( needSqlTableEventHandler ) { for ( i = 0; i < (int) nl.length(); i++ ) { - TTQString s = getClassName( nl.item(i).toElement() ); + TQString s = getClassName( nl.item(i).toElement() ); if ( s == "TQt::DataTable" ) { n = nl.item(i).toElement(); - TTQString c = TTQString("@") + getObjectName( n ); - TTQString conn = getDatabaseInfo( n, "connection" ); - TTQString tab = getDatabaseInfo( n, "table" ); + TQString c = TQString("@") + getObjectName( n ); + TQString conn = getDatabaseInfo( n, "connection" ); + TQString tab = getDatabaseInfo( n, "table" ); if ( !( conn.isEmpty() || tab.isEmpty() ) ) { out << indent << "if " << "!" << c << ".nil?" << endl; ++indent; @@ -894,12 +894,12 @@ void Uic::createFormImpl( const TTQDomElement &e ) if ( needSqlDataBrowserEventHandler ) { nl = e.elementsByTagName( "widget" ); for ( i = 0; i < (int) nl.length(); i++ ) { - TTQString s = getClassName( nl.item(i).toElement() ); + TQString s = getClassName( nl.item(i).toElement() ); if ( s == "TQt::DataBrowser" ) { - TTQString obj = getObjectName( nl.item(i).toElement() ); - TTQString tab = getDatabaseInfo( nl.item(i).toElement(), + TQString obj = getObjectName( nl.item(i).toElement() ); + TQString tab = getDatabaseInfo( nl.item(i).toElement(), "table" ); - TTQString conn = getDatabaseInfo( nl.item(i).toElement(), + TQString conn = getDatabaseInfo( nl.item(i).toElement(), "connection" ); if ( !(tab).isEmpty() ) { out << indent << "if " << obj << endl; @@ -942,11 +942,11 @@ void Uic::createFormImpl( const TTQDomElement &e ) int astart = (*it).find('('); out << indent << "def " << (*it).left(astart) << "(*k)" << endl; bool createWarning = true; - TTQString fname = Parser::cleanArgs( *it ); - TTQMap<TTQString, TTQString>::Iterator fit = functionImpls.find( fname ); + TQString fname = Parser::cleanArgs( *it ); + TQMap<TQString, TQString>::Iterator fit = functionImpls.find( fname ); if ( fit != functionImpls.end() ) { int begin = (*fit).find( "{" ); - TTQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); + TQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); createWarning = body.simplifyWhiteSpace().isEmpty(); if ( !createWarning ) out << body << endl; @@ -967,11 +967,11 @@ void Uic::createFormImpl( const TTQDomElement &e ) out << endl; int astart = (*it).find('('); out << indent << "def " << (*it).left(astart) << "(*k)" << endl; - TTQString fname = Parser::cleanArgs( *it ); - TTQMap<TTQString, TTQString>::Iterator fit = functionImpls.find( fname ); + TQString fname = Parser::cleanArgs( *it ); + TQMap<TQString, TQString>::Iterator fit = functionImpls.find( fname ); if ( fit != functionImpls.end() ) { int begin = (*fit).find( "{" ); - TTQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); + TQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); body.simplifyWhiteSpace().isEmpty(); out << body << endl; } @@ -992,17 +992,17 @@ void Uic::createFormImpl( const TTQDomElement &e ) Traverses recursively over all children. */ -void Uic::createFormImpl( const TTQDomElement& e, const TTQString& form, const TTQString& connection, const TTQString& table ) +void Uic::createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table ) { if ( e.tagName() == "widget" && e.attribute( "class" ) != "TQt::DataTable" ) { - TTQString field = getDatabaseInfo( e, "field" ); + TQString field = getDatabaseInfo( e, "field" ); if ( !field.isEmpty() ) { if ( isWidgetInTable( e, connection, table ) ) out << indent << form << "Form.insert(" << getObjectName( e ) << ", " << fixString( field ) << ")" << endl; } } - TTQDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { createFormImpl( n, form, connection, table ); } @@ -1011,7 +1011,7 @@ void Uic::createFormImpl( const TTQDomElement& e, const TTQString& form, const T // Generate a QtRuby signal/slot definition. -void Uic::rubySlot(TTQStringList::Iterator &it) +void Uic::rubySlot(TQStringList::Iterator &it) { out << indent << "'" << (*it) << "'"; } diff --git a/qtruby/rubylib/designer/rbuic/globaldefs.h b/qtruby/rubylib/designer/rbuic/globaldefs.h index 4286ec03..aebf63c3 100644 --- a/qtruby/rubylib/designer/rbuic/globaldefs.h +++ b/qtruby/rubylib/designer/rbuic/globaldefs.h @@ -27,17 +27,17 @@ #define BOXLAYOUT_DEFAULT_SPACING 6 #ifndef NO_STATIC_COLORS -static TTQColor *backColor1 = 0; -static TTQColor *backColor2 = 0; -static TTQColor *selectedBack = 0; +static TQColor *backColor1 = 0; +static TQColor *backColor2 = 0; +static TQColor *selectedBack = 0; static void init_colors() { if ( backColor1 ) return; - backColor1 = new TTQColor( 236, 245, 255 ); - backColor2 = new TTQColor( 250, 250, 250 ); - selectedBack = new TTQColor( 221, 221, 221 ); + backColor1 = new TQColor( 236, 245, 255 ); + backColor2 = new TQColor( 250, 250, 250 ); + selectedBack = new TQColor( 221, 221, 221 ); } #endif diff --git a/qtruby/rubylib/designer/rbuic/main.cpp b/qtruby/rubylib/designer/rbuic/main.cpp index 7e2a4f83..b3cb6905 100644 --- a/qtruby/rubylib/designer/rbuic/main.cpp +++ b/qtruby/rubylib/designer/rbuic/main.cpp @@ -48,7 +48,7 @@ #include <zlib.h> #define RBUIC_VERSION "0.9" -void getDBConnections( Uic& uic, TTQString& s); +void getDBConnections( Uic& uic, TQString& s); int main( int argc, char * argv[] ) { @@ -56,7 +56,7 @@ int main( int argc, char * argv[] ) bool execCode = false; bool subcl = false; bool imagecollection = false; - TTQStringList images; + TQStringList images; const char *error = 0; const char* fileName = 0; const char* className = 0; @@ -66,14 +66,14 @@ int main( int argc, char * argv[] ) bool nofwd = false; bool useKDE = false; bool fix = false; - TTQApplication app(argc, argv, false); - TTQString uicClass; + TQApplication app(argc, argv, false); + TQString uicClass; for ( int n = 1; n < argc && error == 0; n++ ) { - TTQCString arg = argv[n]; + TQCString arg = argv[n]; if ( arg[0] == '-' ) { // option - TTQCString opt = &arg[1]; + TQCString opt = &arg[1]; if ( opt[0] == 'o' ) { // output redirection if ( opt[1] == '\0' ) { if ( !(n < argc-1) ) { @@ -132,7 +132,7 @@ int main( int argc, char * argv[] ) error = "Missing indent"; break; } - tabstop = TTQCString(argv[++n]).toUInt(&ok); + tabstop = TQCString(argv[++n]).toUInt(&ok); } else tabstop = opt.mid(1).toUInt(&ok); @@ -185,7 +185,7 @@ int main( int argc, char * argv[] ) Uic::setIndent(indent); - TTQFile fileOut; + TQFile fileOut; if ( outputFile ) { fileOut.setName( outputFile ); if (!fileOut.open( IO_WriteOnly ) ) @@ -193,25 +193,25 @@ int main( int argc, char * argv[] ) } else { fileOut.open( IO_WriteOnly, stdout ); } - TTQTextStream out( &fileOut ); + TQTextStream out( &fileOut ); if ( imagecollection ) { - out.setEncoding( TTQTextStream::Latin1 ); + out.setEncoding( TQTextStream::Latin1 ); Uic::embed( out, projectName, images ); return 0; } - out.setEncoding( TTQTextStream::UnicodeUTF8 ); - TTQFile file( fileName ); + out.setEncoding( TQTextStream::UnicodeUTF8 ); + TQFile file( fileName ); if ( !file.open( IO_ReadOnly ) ) qFatal( "rbuic: Could not open file '%s' ", fileName ); - TTQDomDocument doc; - TTQString errMsg; + TQDomDocument doc; + TQString errMsg; int errLine; if ( !doc.setContent( &file, &errMsg, &errLine ) ) - qFatal( TTQString("rbuic: Failed to parse %s: ") + errMsg + TTQString (" in line %d\n"), fileName, errLine ); + qFatal( TQString("rbuic: Failed to parse %s: ") + errMsg + TQString (" in line %d\n"), fileName, errLine ); DomTool::fixDocument( doc ); @@ -223,7 +223,7 @@ int main( int argc, char * argv[] ) if ( !subcl ) { out << "# Form implementation generated from reading ui file '" << fileName << "'" << endl; out << "#" << endl; - out << "# Created: " << TTQDateTime::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; @@ -244,10 +244,10 @@ int main( int argc, char * argv[] ) } else { out << indent << "a = TQt::Application.new(ARGV)" << endl; } - TTQString s; + TQString s; getDBConnections( uic, s); out << s; - out << indent << "w = " << (subcl? TTQString::fromLatin1(className) : uicClass) << ".new" << endl; + out << indent << "w = " << (subcl? TQString::fromLatin1(className) : uicClass) << ".new" << endl; out << indent << "a.mainWidget = w" << endl; out << indent << "w.show" << endl; out << indent << "a.exec" << endl; @@ -258,12 +258,12 @@ int main( int argc, char * argv[] ) return 0; } -void getDBConnections( Uic& uic, TTQString& s) +void getDBConnections( Uic& uic, TQString& s) { int num = 0; - for ( TTQStringList::Iterator it = uic.dbConnections.begin(); it != uic.dbConnections.end(); ++it ) { + for ( TQStringList::Iterator it = uic.dbConnections.begin(); it != uic.dbConnections.end(); ++it ) { if ( !(*it).isEmpty()) { - TTQString inc = (num ? TTQString::number(num+1) : TTQString::null); + TQString inc = (num ? TQString::number(num+1) : TQString::null); s += "\n # Connection to database " + (*it) + "\n\n"; s += " DRIVER" + inc + " =\t\t'TQMYSQL3'" + (inc?"":" # appropriate driver") + "\n"; s += " DATABASE" + inc + " =\t\t'foo'" + (inc?"":" # name of your database") + "\n"; diff --git a/qtruby/rubylib/designer/rbuic/object.cpp b/qtruby/rubylib/designer/rbuic/object.cpp index bb1422b1..512da9ed 100644 --- a/qtruby/rubylib/designer/rbuic/object.cpp +++ b/qtruby/rubylib/designer/rbuic/object.cpp @@ -41,15 +41,15 @@ \sa createObjectImpl() */ -void Uic::createObjectDecl( const TTQDomElement& e ) +void Uic::createObjectDecl( const TQDomElement& e ) { if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) { out << indent << registerObject(getLayoutName(e) ) << endl; } else { - TTQString objClass = getClassName( e ); + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; - TTQString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if ( objName.isEmpty() ) return; // ignore TQLayoutWidgets @@ -68,15 +68,15 @@ void Uic::createObjectDecl( const TTQDomElement& e ) Children are not traversed recursively. */ -void Uic::createAttrDecl( const TTQDomElement& e ) +void Uic::createAttrDecl( const TQDomElement& e ) { if ( e.tagName() == "vbox" || e.tagName() == "hbox" || e.tagName() == "grid" ) { // out << indent << registerObject(getLayoutName(e) ) << endl; } else { - TTQString objClass = getClassName( e ); + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; - TTQString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if ( objName.isEmpty() ) return; // ignore TQLayoutWidgets @@ -84,11 +84,11 @@ void Uic::createAttrDecl( const TTQDomElement& e ) return; // register the object and unify its name objName = registerObject( objName ); - TTQString attr(objName); - attr.replace(TTQChar('@'), "attr_reader :"); + TQString attr(objName); + attr.replace(TQChar('@'), "attr_reader :"); out << indent << attr << endl; - TTQDomElement n = getObjectProperty( e, "font"); + TQDomElement n = getObjectProperty( e, "font"); // if ( !n.isNull() ) // out << indent << objName + "_font" << endl; } @@ -107,17 +107,17 @@ void Uic::createAttrDecl( const TTQDomElement& e ) static bool createdCentralWidget = false; -TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parentClass, const TTQString& par, const TTQString& layout ) +TQString Uic::createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& par, const TQString& layout ) { - TTQString parent( par ); + TQString parent( par ); if ( parent == "self" && isMainWindow ) { if ( !createdCentralWidget ) out << indent << "setCentralWidget(TQt::Widget.new(self, \"qt_central_widget\"))" << endl; createdCentralWidget = true; parent = "centralWidget()"; } - TTQDomElement n; - TTQString objClass, objName, fullObjName; + TQDomElement n; + TQString objClass, objName, fullObjName; int numItems = 0; int numColumns = 0; int numRows = 0; @@ -130,7 +130,7 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent return objName; objName = getObjectName( e ); - TTQString definedName = objName; + TQString definedName = objName; bool isTmpObject = objName.isEmpty() || objClass == "TQt::LayoutWidget"; if ( isTmpObject ) { if ( objClass[0] == 'Q' ) @@ -148,10 +148,10 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent if ( layout.isEmpty() ) { // register the object and unify its name objName = registerObject( objName ); - out << indent << (isTmpObject ? TTQString::fromLatin1("") : TTQString::null) << objName << " = TQt::Widget.new(" << parent << ", '" << objName << "')" << endl; + out << indent << (isTmpObject ? TQString::fromLatin1("") : TQString::null) << objName << " = TQt::Widget.new(" << parent << ", '" << objName << "')" << endl; } else { // the layout widget is not necessary, hide it by creating its child in the parent - TTQString result; + TQString result; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if (tags.contains( n.tagName() ) ) result = createObjectImpl( n, parentClass, parent, layout ); @@ -175,7 +175,7 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent fullObjName = objName; if ( objClass == "TQt::AxWidget" ) { - TTQString controlId; + TQString controlId; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "property" && n.attribute( "name" ) == "control" ) { controlId = n.firstChild().toElement().text(); @@ -193,10 +193,10 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent bool stdset = stdsetdef; if ( n.hasAttribute( "stdset" ) ) stdset = toBool( n.attribute( "stdset" ) ); - TTQString prop = n.attribute("name"); + TQString prop = n.attribute("name"); if ( prop == "database" ) continue; - TTQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); + TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); if ( value.isEmpty() ) continue; if ( prop == "name" ) @@ -226,10 +226,10 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent if ( prop == "frameworkCode" ) continue; if ( objClass == "TQt::MultiLineEdit" && - TTQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) ) + TQRegExp("echoMode|hMargin|maxLength|maxLines|undoEnabled").exactMatch(prop) ) continue; - TTQString call = fullObjName + "."; + TQString call = fullObjName + "."; if (! call.startsWith("@")) { call.prepend("@"); } @@ -249,8 +249,8 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent out << indent << call << endl; } } else if ( n.tagName() == "item" ) { - TTQString call; - TTQString value; + TQString call; + TQString value; if ( objClass.mid( 4 ) == "ListBox" ) { call = createListBoxItemImpl( n, fullObjName, &value ); @@ -274,7 +274,7 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent trout << indent << call << endl; } } else if ( objClass.mid( 4 ) == "ListView" ) { - call = createListViewItemImpl( n, fullObjName, TTQString::null ); + call = createListViewItemImpl( n, fullObjName, TQString::null ); if ( !call.isEmpty() ) { if ( numItems == 0 ) trout << indent << fullObjName << ".clear()" << endl; @@ -284,8 +284,8 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent if ( !call.isEmpty() ) numItems++; } else if ( n.tagName() == "column" || n.tagName() == "row" ) { - TTQString call; - TTQString value; + TQString call; + TQString value; if ( objClass.mid( 4 ) == "ListView" ) { call = createListViewColumnImpl( n, fullObjName, &value ); @@ -314,9 +314,9 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent if ( objClass == "TQt::TabWidget" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - TTQString page = createObjectImpl( n, objClass, fullObjName ); - TTQString comment; - TTQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); + TQString page = createObjectImpl( n, objClass, fullObjName ); + TQString comment; + TQString label = DomTool::readAttribute( n, "title", "", comment ).toString(); out << indent << fullObjName << ".insertTab(" << page << ", " << trcall( label ) << ")" << endl; trout << indent << fullObjName << ".changeTab( " << page << ", " << trcall( label, comment ) << " )" << endl; @@ -325,7 +325,7 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent } else if ( objClass == "TQt::WidgetStack" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - TTQString page = createObjectImpl( n, objClass, objName ); + TQString page = createObjectImpl( n, objClass, objName ); int id = DomTool::readAttribute( n, "id", "" ).toInt(); out << indent << fullObjName << ".addWidget( " << page << ", " << id << " )" << endl; } @@ -333,9 +333,9 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent } else if ( objClass == "TQt::ToolBox" ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( tags.contains( n.tagName() ) ) { - TTQString page = createObjectImpl( n, objClass, objName ); - TTQString comment; - TTQString label = DomTool::readAttribute( n, "label", comment ).toString(); + TQString page = createObjectImpl( n, objClass, objName ); + TQString comment; + TQString label = DomTool::readAttribute( n, "label", comment ).toString(); out << indent << fullObjName << ".addItem( " << page << ", \"\" )" << endl; trout << indent << fullObjName << ".setItemLabel( " << fullObjName << ".indexOf(" << page << "), " << trcall( label, comment ) @@ -364,13 +364,13 @@ TTQString Uic::createObjectImpl( const TTQDomElement &e, const TTQString& parent application font or palette change handlers in createFormImpl(). */ -void Uic::createExclusiveProperty( const TTQDomElement & e, const TTQString& exclusiveProp ) +void Uic::createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp ) { - TTQDomElement n; - TTQString objClass = getClassName( e ); + TQDomElement n; + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; - TTQString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if ( objClass.isEmpty() ) return; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { @@ -378,10 +378,10 @@ void Uic::createExclusiveProperty( const TTQDomElement & e, const TTQString& exc bool stdset = stdsetdef; if ( n.hasAttribute( "stdset" ) ) stdset = toBool( n.attribute( "stdset" ) ); - TTQString prop = n.attribute("name"); + TQString prop = n.attribute("name"); if ( prop != exclusiveProp ) continue; - TTQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); + TQString value = setObjectProperty( objClass, objName, prop, n.firstChild().toElement(), stdset ); if ( value.isEmpty() ) continue; out << indent << indent << objName << ".setProperty(\"" << prop << "\", TQt::Variant.new(" << value << "))" << endl; @@ -394,11 +394,11 @@ void Uic::createExclusiveProperty( const TTQDomElement & e, const TTQString& exc Resource::saveProperty() and DomTool::elementToVariant. If you change one, change all. */ -TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& obj, const TTQString &prop, const TTQDomElement &e, bool stdset ) +TQString Uic::setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset ) { - TTQString v; + TQString v; if ( e.tagName() == "rect" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int x = 0, y = 0, w = 0, h = 0; while ( !n3.isNull() ) { if ( n3.tagName() == "x" ) @@ -415,7 +415,7 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = v.arg(x).arg(y).arg(w).arg(h); } else if ( e.tagName() == "point" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int x = 0, y = 0; while ( !n3.isNull() ) { if ( n3.tagName() == "x" ) @@ -427,7 +427,7 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::Point.new(%1, %2)"; v = v.arg(x).arg(y); } else if ( e.tagName() == "size" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int w = 0, h = 0; while ( !n3.isNull() ) { if ( n3.tagName() == "width" ) @@ -439,7 +439,7 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::Size.new(%1, %2)"; v = v.arg(w).arg(h); } else if ( e.tagName() == "color" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int r= 0, g = 0, b = 0; while ( !n3.isNull() ) { if ( n3.tagName() == "red" ) @@ -453,8 +453,8 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::Color.new(%1, %2, %3)"; v = v.arg(r).arg(g).arg(b); } else if ( e.tagName() == "font" ) { - TTQDomElement n3 = e.firstChild().toElement(); - TTQString fontname; + TQDomElement n3 = e.firstChild().toElement(); + TQString fontname; if ( !obj.isEmpty() ) { fontname = obj + "_font"; out << indent << fontname << " = TQt::Font.new(" << obj << ".font())" << endl; @@ -487,8 +487,8 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = fontname; } } else if ( e.tagName() == "string" ) { - TTQString txt = e.firstChild().toText().data(); - TTQString com = getComment( e.parentNode() ); + TQString txt = e.firstChild().toText().data(); + TQString com = getComment( e.parentNode() ); if ( prop == "toolTip" && objClass != "TQt::Action" && objClass != "TQt::ActionGroup" ) { if ( !obj.isEmpty() ) @@ -511,7 +511,7 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "\"%1\""; v = v.arg( e.firstChild().toText().data() ); } else if ( e.tagName() == "number" ) { - // FIXME: hack. QtRuby needs a TTQKeySequence to build an accel + // FIXME: hack. QtRuby needs a TQKeySequence to build an accel if( e.parentNode().toElement().attribute("name") == "accel" ) v = "TQt::KeySequence.new(%1)"; else @@ -528,15 +528,15 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob if( !externPixmaps ) v.prepend( '@' ); if ( !pixmapLoaderFunction.isEmpty() ) { - v.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - v.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + v.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + v.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } else if ( e.tagName() == "iconset" ) { v = "TQt::IconSet.new(%1)"; - TTQString s = e.firstChild().toText().data(); + TQString s = e.firstChild().toText().data(); if ( !pixmapLoaderFunction.isEmpty() ) { - s.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - s.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + s.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + s.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } else { s.prepend("@"); } @@ -545,22 +545,22 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = e.firstChild().toText().data() + ".convertToImage()"; } else if ( e.tagName() == "enum" ) { v = "%1::%2"; - TTQString oc = objClass; - TTQString ev = e.firstChild().toText().data(); - if ( oc == "TQt::ListView" && ev == "Manual" ) // #### workaround, rename TTQListView::Manual of WithMode enum in 3.0 + TQString oc = objClass; + TQString ev = e.firstChild().toText().data(); + if ( oc == "TQt::ListView" && ev == "Manual" ) // #### workaround, rename TQListView::Manual of WithMode enum in 3.0 oc = "TQt::ScrollView"; v = v.arg( oc ).arg( ev ); } else if ( e.tagName() == "set" ) { - TTQString keys( e.firstChild().toText().data() ); - TTQStringList lst = TTQStringList::split( '|', keys ); + TQString keys( e.firstChild().toText().data() ); + TQStringList lst = TQStringList::split( '|', keys ); v = ""; #if defined(Q_CC_EDG) // workaround for EDG bug reproduced with MIPSpro C++ 7.3.? // and KAI C++ 4.0e that will be fixed in KAI C++ 4.0f - TTQStringList::Iterator it = lst.begin(); + TQStringList::Iterator it = lst.begin(); for ( ; it != lst.end(); ++it ) { #else - for ( TTQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { + for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { #endif v += objClass + "::" + *it; if ( it != lst.fromLast() ) @@ -568,30 +568,30 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob } v += ""; } else if ( e.tagName() == "sizepolicy" ) { - TTQDomElement n3 = e.firstChild().toElement(); - TTQSizePolicy sp; + TQDomElement n3 = e.firstChild().toElement(); + TQSizePolicy sp; while ( !n3.isNull() ) { if ( n3.tagName() == "hsizetype" ) - sp.setHorData( (TTQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + sp.setHorData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); else if ( n3.tagName() == "vsizetype" ) - sp.setVerData( (TTQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); + sp.setVerData( (TQSizePolicy::SizeType)n3.firstChild().toText().data().toInt() ); else if ( n3.tagName() == "horstretch" ) sp.setHorStretch( n3.firstChild().toText().data().toInt() ); else if ( n3.tagName() == "verstretch" ) sp.setVerStretch( n3.firstChild().toText().data().toInt() ); n3 = n3.nextSibling().toElement(); } - TTQString tmp = (obj.isEmpty() ? TTQString::fromLatin1("self") : obj) + "."; + TQString tmp = (obj.isEmpty() ? TQString::fromLatin1("self") : obj) + "."; v = "TQt::SizePolicy.new(%1, %2, %3, %4, " + tmp + "sizePolicy().hasHeightForWidth())"; v = v.arg( (int)sp.horData() ).arg( (int)sp.verData() ).arg( sp.horStretch() ).arg( sp.verStretch() ); } else if ( e.tagName() == "palette" ) { - TTQPalette pal; + TQPalette pal; bool no_pixmaps = e.elementsByTagName( "pixmap" ).count() == 0; - TTQDomElement n; + TQDomElement n; if ( no_pixmaps ) { n = e.firstChild().toElement(); while ( !n.isNull() ) { - TTQColorGroup cg; + TQColorGroup cg; if ( n.tagName() == "active" ) { cg = loadColorGroup( n ); pal.setActive( cg ); @@ -605,17 +605,17 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob n = n.nextSibling().toElement(); } } - if ( no_pixmaps && pal == TTQPalette( pal.active().button(), pal.active().background() ) ) { + if ( no_pixmaps && pal == TQPalette( pal.active().button(), pal.active().background() ) ) { v = "TQt::Palette.new(TQt::Color.new(%1,%2,%3), TQt::Color.new(%1,%2,%3))"; v = v.arg( pal.active().button().red() ).arg( pal.active().button().green() ).arg( pal.active().button().blue() ); v = v.arg( pal.active().background().red() ).arg( pal.active().background().green() ).arg( pal.active().background().blue() ); } else { - TTQString palette = "pal"; + TQString palette = "pal"; if ( !pal_used ) { out << indent << palette << " = TQt::Palette.new()" << endl; pal_used = true; } - TTQString cg = "cg"; + TQString cg = "cg"; if ( !cg_used ) { out << indent << cg << " = TQt::ColorGroup.new()" << endl; cg_used = true; @@ -643,7 +643,7 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::Cursor.new(%1)"; v = v.arg( e.firstChild().toText().data() ); } else if ( e.tagName() == "date" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int y, m, d; y = m = d = 0; while ( !n3.isNull() ) { @@ -658,7 +658,7 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::Date.new(%1,%2,%3)"; v = v.arg(y).arg(m).arg(d); } else if ( e.tagName() == "time" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int h, m, s; h = m = s = 0; while ( !n3.isNull() ) { @@ -673,7 +673,7 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::Time.new(%1, %2, %3)"; v = v.arg(h).arg(m).arg(s); } else if ( e.tagName() == "datetime" ) { - TTQDomElement n3 = e.firstChild().toElement(); + TQDomElement n3 = e.firstChild().toElement(); int h, mi, s, y, mo, d; h = mi = s = y = mo = d = 0; while ( !n3.isNull() ) { @@ -694,9 +694,9 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob v = "TQt::DateTime.new(TQt::Date.new(%1, %2, %3), TQt::Time.new(%4, %5, %6))"; v = v.arg(y).arg(mo).arg(d).arg(h).arg(mi).arg(s); } else if ( e.tagName() == "stringlist" ) { - TTQStringList l; - TTQDomElement n3 = e.firstChild().toElement(); - TTQString listname; + TQStringList l; + TQDomElement n3 = e.firstChild().toElement(); + TQString listname; if ( !obj.isEmpty() ) { listname = obj + "_strlist"; out << indent << listname << " = ["; @@ -736,9 +736,9 @@ TTQString Uic::setObjectProperty( const TTQString& objClass, const TTQString& ob /*! Extracts a named object property from \a e. */ -TTQDomElement Uic::getObjectProperty( const TTQDomElement& e, const TTQString& name ) +TQDomElement Uic::getObjectProperty( const TQDomElement& e, const TQString& name ) { - TTQDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { diff --git a/qtruby/rubylib/designer/rbuic/parser.cpp b/qtruby/rubylib/designer/rbuic/parser.cpp index 8cfe5da4..8c264a63 100644 --- a/qtruby/rubylib/designer/rbuic/parser.cpp +++ b/qtruby/rubylib/designer/rbuic/parser.cpp @@ -30,22 +30,22 @@ class NormalizeObject : public TQObject { public: - NormalizeObject() : TTQObject() {} - static TTQCString normalizeSignalSlot( const char *signalSlot ) { return TTQObject::normalizeSignalSlot( signalSlot ); } + NormalizeObject() : TQObject() {} + static TQCString normalizeSignalSlot( const char *signalSlot ) { return TQObject::normalizeSignalSlot( signalSlot ); } }; -TTQString Parser::cleanArgs( const TTQString &func ) +TQString Parser::cleanArgs( const TQString &func ) { - TTQString slot( func ); + TQString slot( func ); int begin = slot.find( "(" ) + 1; - TTQString args = slot.mid( begin ); + TQString args = slot.mid( begin ); args = args.left( args.find( ")" ) ); - TTQStringList lst = TTQStringList::split( ',', args ); - TTQString res = slot.left( begin ); - for ( TTQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { + TQStringList lst = TQStringList::split( ',', args ); + TQString res = slot.left( begin ); + for ( TQStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { if ( it != lst.begin() ) res += ","; - TTQString arg = *it; + TQString arg = *it; int pos = 0; if ( ( pos = arg.find( "&" ) ) != -1 ) { arg = arg.left( pos + 1 ); @@ -55,7 +55,7 @@ TTQString Parser::cleanArgs( const TTQString &func ) arg = arg.simplifyWhiteSpace(); if ( ( pos = arg.find( ':' ) ) != -1 ) arg = arg.left( pos ).simplifyWhiteSpace() + ":" + arg.mid( pos + 1 ).simplifyWhiteSpace(); - TTQStringList l = TTQStringList::split( ' ', arg ); + TQStringList l = TQStringList::split( ' ', arg ); if ( l.count() == 2 ) { if ( l[ 0 ] != "const" && l[ 0 ] != "unsigned" && l[ 0 ] != "var" ) arg = l[ 0 ]; @@ -67,5 +67,5 @@ TTQString Parser::cleanArgs( const TTQString &func ) } res += ")"; - return TTQString::fromLatin1( NormalizeObject::normalizeSignalSlot( res.latin1() ) ); + return TQString::fromLatin1( NormalizeObject::normalizeSignalSlot( res.latin1() ) ); } diff --git a/qtruby/rubylib/designer/rbuic/parser.h b/qtruby/rubylib/designer/rbuic/parser.h index e03f1b1c..ace96d9e 100644 --- a/qtruby/rubylib/designer/rbuic/parser.h +++ b/qtruby/rubylib/designer/rbuic/parser.h @@ -26,7 +26,7 @@ class Parser { public: - static TTQString cleanArgs( const TTQString &func ); + static TQString cleanArgs( const TQString &func ); }; diff --git a/qtruby/rubylib/designer/rbuic/subclassing.cpp b/qtruby/rubylib/designer/rbuic/subclassing.cpp index ef19cf53..0a093a43 100644 --- a/qtruby/rubylib/designer/rbuic/subclassing.cpp +++ b/qtruby/rubylib/designer/rbuic/subclassing.cpp @@ -39,14 +39,14 @@ \sa createSubDecl() */ -void Uic::createSubImpl( const TTQDomElement &e, const TTQString& subClass ) +void Uic::createSubImpl( const TQDomElement &e, const TQString& subClass ) { - TTQDomElement n; - TTQDomNodeList nl; + TQDomElement n; + TQDomNodeList nl; int i; - TTQStringList::Iterator it, it2, it3; + TQStringList::Iterator it, it2, it3; - TTQString objClass = getClassName( e ); + TQString objClass = getClassName( e ); if ( objClass.isEmpty() ) return; if (hasKDEwidget) { @@ -82,10 +82,10 @@ void Uic::createSubImpl( const TTQDomElement &e, const TTQString& subClass ) out << endl; // find additional slots - TTQStringList publicSlots, protectedSlots, privateSlots; - TTQStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes; - TTQStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier; - TTQMap<TTQString, TTQString> functionImpls; + TQStringList publicSlots, protectedSlots, privateSlots; + TQStringList publicSlotTypes, protectedSlotTypes, privateSlotTypes; + TQStringList publicSlotSpecifier, protectedSlotSpecifier, privateSlotSpecifier; + TQMap<TQString, TQString> functionImpls; nl = e.parentNode().toElement().elementsByTagName( "slot" ); for ( i = 0; i < (int) nl.length(); i++ ) { n = nl.item(i).toElement(); @@ -94,12 +94,12 @@ void Uic::createSubImpl( const TTQDomElement &e, const TTQString& subClass ) continue; if ( n.attribute( "language", "C++" ) != "C++" ) continue; - TTQString returnType = n.attribute( "returnType", "void" ); - TTQString slotName = n.firstChild().toText().data().stripWhiteSpace(); + TQString returnType = n.attribute( "returnType", "void" ); + TQString slotName = n.firstChild().toText().data().stripWhiteSpace(); if ( slotName.endsWith( ";" ) ) slotName = slotName.left( slotName.length() - 1 ); - TTQString specifier = n.attribute( "specifier" ); - TTQString access = n.attribute( "access" ); + TQString specifier = n.attribute( "specifier" ); + TQString access = n.attribute( "access" ); if ( access == "protected" ) { protectedSlots += slotName; protectedSlotTypes += returnType; @@ -119,7 +119,7 @@ void Uic::createSubImpl( const TTQDomElement &e, const TTQString& subClass ) // compatibility with early 3.0 betas nl = e.parentNode().toElement().elementsByTagName( "function" ); for ( i = 0; i < (int) nl.length(); i++ ) { - TTQString fname = n.attribute( "name" ); + TQString fname = n.attribute( "name" ); fname = Parser::cleanArgs( fname ); functionImpls.insert( fname, n.firstChild().toText().data() ); } @@ -127,8 +127,8 @@ void Uic::createSubImpl( const TTQDomElement &e, const TTQString& subClass ) if ( !publicSlots.isEmpty() ) { for ( it = publicSlots.begin(), it2 = publicSlotTypes.begin(), it3 = publicSlotSpecifier.begin(); it != publicSlots.end(); ++it, ++it2, ++it3 ) { - TTQString pure; - TTQString type = *it2; + TQString pure; + TQString type = *it2; if ( type.isEmpty() ) type = "void"; if ( *it3 == "non virtual" ) @@ -149,8 +149,8 @@ void Uic::createSubImpl( const TTQDomElement &e, const TTQString& subClass ) if ( !protectedSlots.isEmpty() ) { for ( it = protectedSlots.begin(), it2 = protectedSlotTypes.begin(), it3 = protectedSlotSpecifier.begin(); it != protectedSlots.end(); ++it, ++it2, ++it3 ) { - TTQString pure; - TTQString type = *it2; + TQString pure; + TQString type = *it2; if ( type.isEmpty() ) type = "void"; if ( *it3 == "non virtual" ) @@ -173,8 +173,8 @@ void Uic::createSubImpl( const TTQDomElement &e, const TTQString& subClass ) if ( !privateSlots.isEmpty() ) { for ( it = privateSlots.begin(), it2 = privateSlotTypes.begin(), it3 = privateSlotSpecifier.begin(); it != privateSlots.end(); ++it, ++it2, ++it3 ) { - TTQString pure; - TTQString type = *it2; + TQString pure; + TQString type = *it2; if ( type.isEmpty() ) type = "void"; if ( *it3 == "non virtual" ) diff --git a/qtruby/rubylib/designer/rbuic/uic.cpp b/qtruby/rubylib/designer/rbuic/uic.cpp index 106e9879..9343b4e6 100644 --- a/qtruby/rubylib/designer/rbuic/uic.cpp +++ b/qtruby/rubylib/designer/rbuic/uic.cpp @@ -67,42 +67,42 @@ void RubyIndent::calc() } -TTQString Uic::getComment( const TTQDomNode& n ) +TQString Uic::getComment( const TQDomNode& n ) { - TTQDomNode child = n.firstChild(); + TQDomNode child = n.firstChild(); while ( !child.isNull() ) { if ( child.toElement().tagName() == "comment" ) return child.toElement().firstChild().toText().data(); child = child.nextSibling(); } - return TTQString::null; + return TQString::null; } -TTQString Uic::mkBool( bool b ) +TQString Uic::mkBool( bool b ) { return b? "true" : "false"; } -TTQString Uic::mkBool( const TTQString& s ) +TQString Uic::mkBool( const TQString& s ) { return mkBool( s == "true" || s == "1" ); } -bool Uic::toBool( const TTQString& s ) +bool Uic::toBool( const TQString& s ) { return s == "true" || s.toInt() != 0; } -TTQString Uic::fixString( const TTQString &str ) +TQString Uic::fixString( const TQString &str ) { - TTQString s( str ); - s.replace( TTQRegExp( "\\\\" ), "\\\\" ); - s.replace( TTQRegExp( "\"" ), "\\\"" ); - s.replace( TTQRegExp( "\r?\n" ), "\\n\" +\n" + indent + "\"" ); + TQString s( str ); + s.replace( TQRegExp( "\\\\" ), "\\\\" ); + s.replace( TQRegExp( "\"" ), "\\\"" ); + s.replace( TQRegExp( "\r?\n" ), "\\n\" +\n" + indent + "\"" ); return "\"" + s + "\""; } -TTQString Uic::trcall( const TTQString& sourceText, const TTQString& comment ) +TQString Uic::trcall( const TQString& sourceText, const TQString& comment ) { if ( sourceText.isEmpty() && comment.isEmpty() ) return "nil"; @@ -112,19 +112,19 @@ TTQString Uic::trcall( const TTQString& sourceText, const TTQString& comment ) return trmacro + "(" + fixString( sourceText ) + "," + fixString( comment ) + ")"; } -TTQString Uic::mkStdSet( const TTQString& prop ) +TQString Uic::mkStdSet( const TQString& prop ) { - return TTQString( "set" ) + prop[0].upper() + prop.mid(1); + return TQString( "set" ) + prop[0].upper() + prop.mid(1); } -bool Uic::isEmptyFunction( const TTQString& fname ) +bool Uic::isEmptyFunction( const TQString& fname ) { - TTQMap<TTQString, TTQString>::Iterator fit = functionImpls.find( Parser::cleanArgs( fname ) ); + TQMap<TQString, TQString>::Iterator fit = functionImpls.find( Parser::cleanArgs( fname ) ); if ( fit != functionImpls.end() ) { int begin = (*fit).find( "{" ); - TTQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); + TQString body = (*fit).mid( begin + 1, (*fit).findRev( "}" ) - begin - 1 ); return body.simplifyWhiteSpace().isEmpty(); } // For now ruby functions are always empty, until a rubyeditor Qt Designer plugin exists.. @@ -139,9 +139,9 @@ bool Uic::isEmptyFunction( const TTQString& fname ) The class Uic encapsulates the user interface compiler (uic). */ -Uic::Uic( const TTQString &fn, TTQTextStream &outStream, TTQDomDocument doc, - bool subcl, const TTQString &trm, const TTQString& subClass, - bool omitForwardDecls, TTQString &uicClass, bool useKDE ) +Uic::Uic( const TQString &fn, TQTextStream &outStream, TQDomDocument doc, + bool subcl, const TQString &trm, const TQString& subClass, + bool omitForwardDecls, TQString &uicClass, bool useKDE ) : out( outStream ), trout( &languageChangeBody ), trmacro( trm ), nofwd( omitForwardDecls ) { @@ -164,16 +164,16 @@ Uic::Uic( const TTQString &fn, TTQTextStream &outStream, TTQDomDocument doc, uiFileVersion = doc.firstChild().toElement().attribute("version"); stdsetdef = toBool( doc.firstChild().toElement().attribute("stdsetdef") ); - TTQDomElement e = doc.firstChild().firstChild().toElement(); - TTQDomElement widget; + TQDomElement e = doc.firstChild().firstChild().toElement(); + TQDomElement widget; while ( !e.isNull() ) { if ( e.tagName() == "widget" ) { widget = e; } else if ( e.tagName() == "pixmapinproject" ) { externPixmaps = true; } else if ( e.tagName() == "layoutdefaults" ) { - defSpacing = e.attribute( "spacing", TTQString::number( defSpacing ) ).toInt(); - defMargin = e.attribute( "margin", TTQString::number( defMargin ) ).toInt(); + defSpacing = e.attribute( "spacing", TQString::number( defSpacing ) ).toInt(); + defMargin = e.attribute( "margin", TQString::number( defMargin ) ).toInt(); } e = e.nextSibling().toElement(); } @@ -193,26 +193,26 @@ Uic::Uic( const TTQString &fn, TTQTextStream &outStream, TTQDomDocument doc, /*! Extracts a pixmap loader function from \a e */ -TTQString Uic::getPixmapLoaderFunction( const TTQDomElement& e ) +TQString Uic::getPixmapLoaderFunction( const TQDomElement& e ) { - TTQDomElement n; + TQDomElement n; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "pixmapfunction" ) return n.firstChild().toText().data(); } - return TTQString::null; + return TQString::null; } /*! Extracts the forms class name from \a e */ -TTQString Uic::getFormClassName( const TTQDomElement& e ) +TQString Uic::getFormClassName( const TQDomElement& e ) { - TTQDomElement n; - TTQString cn; + TQDomElement n; + TQString cn; for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "class" ) { - TTQString s = n.firstChild().toText().data(); + TQString s = n.firstChild().toText().data(); int i; while ( ( i = s.find(' ' )) != -1 ) s[i] = '_'; @@ -224,16 +224,16 @@ TTQString Uic::getFormClassName( const TTQDomElement& e ) /*! Extracts a Ruby class name from \a e. */ -TTQString Uic::getClassName( const TTQDomElement& e ) +TQString Uic::getClassName( const TQDomElement& e ) { - TTQString s = e.attribute( "class" ); + TQString s = e.attribute( "class" ); if ( s.isEmpty() && e.tagName() == "toolbar" ) s = "TQt::ToolBar"; else if ( s.isEmpty() && e.tagName() == "menubar" ) s = "TQt::MenuBar"; else { - TTQRegExp r("^([QK])(\\S+)"); + TQRegExp r("^([QK])(\\S+)"); if( r.search( s ) != -1 ) { if (r.cap(1) == "K") { hasKDEwidget = true; @@ -255,11 +255,11 @@ TTQString Uic::getClassName( const TTQDomElement& e ) /*! Returns TRUE if database framework code is generated, else FALSE. */ -bool Uic::isFrameworkCodeGenerated( const TTQDomElement& e ) +bool Uic::isFrameworkCodeGenerated( const TQDomElement& e ) { - TTQDomElement n = getObjectProperty( e, "frameworkCode" ); + TQDomElement n = getObjectProperty( e, "frameworkCode" ); if ( n.attribute("name") == "frameworkCode" && - !DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant( true, 0 ) ).toBool() ) + !DomTool::elementToVariant( n.firstChild().toElement(), TQVariant( true, 0 ) ).toBool() ) return false; return true; } @@ -267,36 +267,36 @@ bool Uic::isFrameworkCodeGenerated( const TTQDomElement& e ) /*! Extracts an object name from \a e. It's stored in the 'name' property. */ -TTQString Uic::getObjectName( const TTQDomElement& e ) +TQString Uic::getObjectName( const TQDomElement& e ) { - TTQDomElement n = getObjectProperty( e, "name" ); + TQDomElement n = getObjectProperty( e, "name" ); if ( n.firstChild().toElement().tagName() == "cstring" ) return n.firstChild().toElement().firstChild().toText().data(); - return TTQString::null; + return TQString::null; } /*! Extracts an layout name from \a e. It's stored in the 'name' property of the preceeding sibling (the first child of a TQLayoutWidget). */ -TTQString Uic::getLayoutName( const TTQDomElement& e ) +TQString Uic::getLayoutName( const TQDomElement& e ) { - TTQDomElement p = e.parentNode().toElement(); - TTQString tail = TTQString::null; + TQDomElement p = e.parentNode().toElement(); + TQString tail = TQString::null; if ( getClassName(p) != "TQt::LayoutWidget" ) tail = "Layout"; - TTQDomElement n = getObjectProperty( p, "name" ); + TQDomElement n = getObjectProperty( p, "name" ); if ( n.firstChild().toElement().tagName() == "cstring" ) return n.firstChild().toElement().firstChild().toText().data() + tail; return e.tagName(); } -TTQString Uic::getDatabaseInfo( const TTQDomElement& e, const TTQString& tag ) +TQString Uic::getDatabaseInfo( const TQDomElement& e, const TQString& tag ) { - TTQDomElement n; - TTQDomElement n1; + TQDomElement n; + TQDomElement n1; int child = 0; // database info is a stringlist stored in this order if ( tag == "connection" ) @@ -306,27 +306,27 @@ TTQString Uic::getDatabaseInfo( const TTQDomElement& e, const TTQString& tag ) else if ( tag == "field" ) child = 2; else - return TTQString::null; + return TQString::null; n = getObjectProperty( e, "database" ); if ( n.firstChild().toElement().tagName() == "stringlist" ) { // find correct stringlist entry - TTQDomElement n1 = n.firstChild().firstChild().toElement(); + TQDomElement n1 = n.firstChild().firstChild().toElement(); for ( int i = 0; i < child && !n1.isNull(); ++i ) n1 = n1.nextSibling().toElement(); if ( n1.isNull() ) - return TTQString::null; + return TQString::null; return n1.firstChild().toText().data(); } - return TTQString::null; + return TQString::null; } -void Uic::registerLayouts( const TTQDomElement &e ) +void Uic::registerLayouts( const TQDomElement &e ) { if ( layouts.contains(e.tagName()) ) createObjectDecl(e); - TTQDomNodeList nl = e.childNodes(); + TQDomNodeList nl = e.childNodes(); for ( int i = 0; i < (int) nl.length(); ++i ) registerLayouts( nl.item(i).toElement() ); } @@ -335,32 +335,32 @@ void Uic::registerLayouts( const TTQDomElement &e ) /*! Returns include file for class \a className or a null string. */ -TTQString Uic::getInclude( const TTQString& className ) +TQString Uic::getInclude( const TQString& className ) { int wid = WidgetDatabase::idFromClassName( className ); if ( wid != -1 ) return WidgetDatabase::includeFile( wid ); - return TTQString::null; + return TQString::null; } -void Uic::createActionDecl( const TTQDomElement& e ) +void Uic::createActionDecl( const TQDomElement& e ) { - TTQString objName = getObjectName( e ); + TQString objName = getObjectName( e ); if ( objName.isEmpty() ) return; out << indent << objName << endl; if ( e.tagName() == "actiongroup" ) { - for ( TTQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + for ( TQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "action" || n.tagName() == "actiongroup" ) createActionDecl( n ); } } } -void Uic::createActionImpl( const TTQDomElement &n, const TTQString &parent ) +void Uic::createActionImpl( const TQDomElement &n, const TQString &parent ) { - for ( TTQDomElement ae = n; !ae.isNull(); ae = ae.nextSibling().toElement() ) { - TTQString objName = registerObject( getObjectName( ae ) ); + for ( TQDomElement ae = n; !ae.isNull(); ae = ae.nextSibling().toElement() ) { + TQString objName = registerObject( getObjectName( ae ) ); if ( ae.tagName() == "action" ) out << indent << objName << "= TQt::Action.new(" << parent << ", \"" << objName.mid(1) << "\")" << endl; else if ( ae.tagName() == "actiongroup" ) @@ -369,20 +369,20 @@ void Uic::createActionImpl( const TTQDomElement &n, const TTQString &parent ) continue; bool subActionsDone = false; bool hasMenuText = false; - TTQString actionText; - for ( TTQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + TQString actionText; + for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { if ( n2.tagName() == "property" ) { bool stdset = stdsetdef; if ( n2.hasAttribute( "stdset" ) ) stdset = toBool( n2.attribute( "stdset" ) ); - TTQString prop = n2.attribute("name"); + TQString prop = n2.attribute("name"); if ( prop == "name" ) continue; - TTQString value = setObjectProperty( "TQt::Action", objName, prop, n2.firstChild().toElement(), stdset ); + TQString value = setObjectProperty( "TQt::Action", objName, prop, n2.firstChild().toElement(), stdset ); if ( value.isEmpty() ) continue; - TTQString call = objName + "."; + TQString call = objName + "."; if ( stdset ) { call += mkStdSet( prop ) + "(" + value + ")"; } else { @@ -405,13 +405,13 @@ void Uic::createActionImpl( const TTQDomElement &n, const TTQString &parent ) subActionsDone = true; } } - // workaround for loading pre-3.3 files expecting bogus TTQAction behavior + // workaround for loading pre-3.3 files expecting bogus TQAction behavior if (!hasMenuText && !actionText.isEmpty() && uiFileVersion < "3.3") trout << indent << objName << ".setMenuText(" << actionText << ")" << endl; } } -TTQString get_dock( const TTQString &d ) +TQString get_dock( const TQString &d ) { if ( d == "0" ) return "DockUnmanaged"; @@ -430,16 +430,16 @@ TTQString get_dock( const TTQString &d ) return ""; } -void Uic::createToolbarImpl( const TTQDomElement &n, const TTQString &parentClass, const TTQString &parent ) +void Uic::createToolbarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent ) { - TTQDomNodeList nl = n.elementsByTagName( "toolbar" ); + TQDomNodeList nl = n.elementsByTagName( "toolbar" ); for ( int i = 0; i < (int) nl.length(); i++ ) { - TTQDomElement ae = nl.item( i ).toElement(); - TTQString dock = get_dock( ae.attribute( "dock" ) ); - TTQString objName = "@" + getObjectName( ae ); + TQDomElement ae = nl.item( i ).toElement(); + TQString dock = get_dock( ae.attribute( "dock" ) ); + TQString objName = "@" + getObjectName( ae ); out << indent << objName << " = TQt::ToolBar.new(\"\", self, " << dock << ")" << endl; createObjectImpl( ae, parentClass, parent ); - for ( TTQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { + for ( TQDomElement n2 = ae.firstChild().toElement(); !n2.isNull(); n2 = n2.nextSibling().toElement() ) { if ( n2.tagName() == "action" ) { out << indent << "@" << n2.attribute( "name" ) << ".addTo( " << objName << " )" << endl; } else if ( n2.tagName() == "separator" ) { @@ -448,7 +448,7 @@ void Uic::createToolbarImpl( const TTQDomElement &n, const TTQString &parentClas if ( n2.attribute( "class" ) != "Spacer" ) { createObjectImpl( n2, "TQt::ToolBar", objName ); } else { - TTQString child = createSpacerImpl( n2, parentClass, parent, objName ); + TQString child = createSpacerImpl( n2, parentClass, parent, objName ); out << indent << "TQt::Application.sendPostedEvents( " << objName << ", TQt::Event::ChildInserted)" << endl; out << indent << objName << ".boxLayout().addItem(" << child << ")" << endl; @@ -458,21 +458,21 @@ void Uic::createToolbarImpl( const TTQDomElement &n, const TTQString &parentClas } } -void Uic::createMenuBarImpl( const TTQDomElement &n, const TTQString &parentClass, const TTQString &parent ) +void Uic::createMenuBarImpl( const TQDomElement &n, const TQString &parentClass, const TQString &parent ) { - TTQString objName = "@" + getObjectName( n ); + TQString objName = "@" + getObjectName( n ); out << indent << objName << " = TQt::MenuBar.new( self, \"" << objName.mid(1) << "\" )" << endl; createObjectImpl( n, parentClass, parent ); int i = 0; - TTQDomElement c = n.firstChild().toElement(); + TQDomElement c = n.firstChild().toElement(); while ( !c.isNull() ) { if ( c.tagName() == "item" ) { - TTQString itemName = "@" + c.attribute( "name" ); + TQString itemName = "@" + c.attribute( "name" ); out << endl; out << indent << itemName << " = TQt::PopupMenu.new( self )" << endl; createPopupMenuImpl( c, parentClass, itemName ); out << indent << objName << ".insertItem( \"\", " << itemName << ", " << i << " )" << endl; - TTQString findItem(objName + ".findItem(%1)"); + TQString findItem(objName + ".findItem(%1)"); findItem = findItem.arg(i); trout << indent << "if !" << findItem << ".nil?" << endl; trout << indent << indent << findItem << ".setText( " << trcall( c.attribute( "text" ) ) << " )" << endl; @@ -486,15 +486,15 @@ void Uic::createMenuBarImpl( const TTQDomElement &n, const TTQString &parentClas } } -void Uic::createPopupMenuImpl( const TTQDomElement &e, const TTQString &parentClass, const TTQString &parent ) +void Uic::createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ) { int i = 0; - for ( TTQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { + for ( TQDomElement n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "action" || n.tagName() == "actiongroup" ) { - TTQDomElement n2 = n.nextSibling().toElement(); + TQDomElement n2 = n.nextSibling().toElement(); if ( n2.tagName() == "item" ) { // the action has a sub menu - TTQString itemName = "@" + n2.attribute( "name" ); - TTQString itemText = n2.attribute( "text" ); + TQString itemName = "@" + n2.attribute( "name" ); + TQString itemText = n2.attribute( "text" ); out << indent << itemName << " = TQt::PopupMenu.new( self )" << endl; out << indent << indent << parent << ".insertItem( @" << n.attribute( "name" ) << ".iconSet(),"; out << trcall( itemText ) << ", " << itemName << " )" << endl; @@ -516,17 +516,17 @@ void Uic::createPopupMenuImpl( const TTQDomElement &e, const TTQString &parentCl Creates implementation of an listbox item tag. */ -TTQString Uic::createListBoxItemImpl( const TTQDomElement &e, const TTQString &parent, - TTQString *value ) +TQString Uic::createListBoxItemImpl( const TQDomElement &e, const TQString &parent, + TQString *value ) { - TTQDomElement n = e.firstChild().toElement(); - TTQString txt; - TTQString com; - TTQString pix; + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - TTQString attrib = n.attribute("name"); - TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() ); + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) { txt = v.toString(); com = getComment( n ); @@ -536,8 +536,8 @@ TTQString Uic::createListBoxItemImpl( const TTQDomElement &e, const TTQString &p pix.prepend("@"); } if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } } @@ -557,16 +557,16 @@ TTQString Uic::createListBoxItemImpl( const TTQDomElement &e, const TTQString &p Creates implementation of an iconview item tag. */ -TTQString Uic::createIconViewItemImpl( const TTQDomElement &e, const TTQString &parent ) +TQString Uic::createIconViewItemImpl( const TQDomElement &e, const TQString &parent ) { - TTQDomElement n = e.firstChild().toElement(); - TTQString txt; - TTQString com; - TTQString pix; + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - TTQString attrib = n.attribute("name"); - TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() ); + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) { txt = v.toString(); com = getComment( n ); @@ -576,8 +576,8 @@ TTQString Uic::createIconViewItemImpl( const TTQDomElement &e, const TTQString & pix.prepend("@"); } if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } } @@ -594,15 +594,15 @@ TTQString Uic::createIconViewItemImpl( const TTQDomElement &e, const TTQString & Creates implementation of an listview item tag. */ -TTQString Uic::createListViewItemImpl( const TTQDomElement &e, const TTQString &parent, - const TTQString &parentItem ) +TQString Uic::createListViewItemImpl( const TQDomElement &e, const TQString &parent, + const TQString &parentItem ) { - TTQString s; + TQString s; - TTQDomElement n = e.firstChild().toElement(); + TQDomElement n = e.firstChild().toElement(); bool hasChildren = e.elementsByTagName( "item" ).count() > 0; - TTQString item; + TQString item; if ( hasChildren ) { item = registerObject( "item" ); @@ -623,22 +623,22 @@ TTQString Uic::createListViewItemImpl( const TTQDomElement &e, const TTQString & else s += "TQt::ListViewItem.new(" + parent + ", " + lastItem + ")\n"; - TTQStringList textes; - TTQStringList pixmaps; + TQStringList textes; + TQStringList pixmaps; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - TTQString attrib = n.attribute("name"); - TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() ); + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) textes << v.toString(); else if ( attrib == "pixmap" ) { - TTQString pix = v.toString(); + TQString pix = v.toString(); if (!pix.isEmpty()) { pix.prepend("@"); } if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } pixmaps << pix; } @@ -651,9 +651,9 @@ TTQString Uic::createListViewItemImpl( const TTQDomElement &e, const TTQString & for ( int i = 0; i < (int)textes.count(); ++i ) { if ( !textes[ i ].isEmpty() ) - s += indent + item + ".setText(" + TTQString::number( i ) + ", " + trcall( textes[ i ] ) + ")\n"; + s += indent + item + ".setText(" + TQString::number( i ) + ", " + trcall( textes[ i ] ) + ")\n"; if ( !pixmaps[ i ].isEmpty() ) - s += indent + item + ".setPixmap(" + TTQString::number( i ) + ", " + pixmaps[ i ] + ")\n"; + s += indent + item + ".setPixmap(" + TQString::number( i ) + ", " + pixmaps[ i ] + ")\n"; } lastItem = item; @@ -664,18 +664,18 @@ TTQString Uic::createListViewItemImpl( const TTQDomElement &e, const TTQString & Creates implementation of an listview column tag. */ -TTQString Uic::createListViewColumnImpl( const TTQDomElement &e, const TTQString &parent, - TTQString *value ) +TQString Uic::createListViewColumnImpl( const TQDomElement &e, const TQString &parent, + TQString *value ) { - TTQDomElement n = e.firstChild().toElement(); - TTQString txt; - TTQString com; - TTQString pix; + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; bool clickable = false, resizeable = false; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - TTQString attrib = n.attribute("name"); - TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() ); + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) { txt = v.toString(); com = getComment( n ); @@ -685,8 +685,8 @@ TTQString Uic::createListViewColumnImpl( const TTQDomElement &e, const TTQString pix.prepend("@"); } if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } else if ( attrib == "clickable" ) clickable = v.toBool(); @@ -699,7 +699,7 @@ TTQString Uic::createListViewColumnImpl( const TTQDomElement &e, const TTQString if ( value ) *value = trcall( txt, com ); - TTQString s; + TQString s; s = indent + parent + ".addColumn(" + trcall( txt, com ) + ")\n"; if ( !pix.isEmpty() ) s += indent + parent + ".header().setLabel(" + parent + ".header().count() - 1," + pix + ", " + trcall( txt, com ) + ")\n"; @@ -711,28 +711,28 @@ TTQString Uic::createListViewColumnImpl( const TTQDomElement &e, const TTQString return s; } -TTQString Uic::createTableRowColumnImpl( const TTQDomElement &e, const TTQString &parent, - TTQString *value ) +TQString Uic::createTableRowColumnImpl( const TQDomElement &e, const TQString &parent, + TQString *value ) { - TTQString objClass = getClassName( e.parentNode().toElement() ); - TTQDomElement n = e.firstChild().toElement(); - TTQString txt; - TTQString com; - TTQString pix; - TTQString field; + TQString objClass = getClassName( e.parentNode().toElement() ); + TQDomElement n = e.firstChild().toElement(); + TQString txt; + TQString com; + TQString pix; + TQString field; bool isRow = e.tagName() == "row"; while ( !n.isNull() ) { if ( n.tagName() == "property" ) { - TTQString attrib = n.attribute("name"); - TTQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TTQVariant() ); + TQString attrib = n.attribute("name"); + TQVariant v = DomTool::elementToVariant( n.firstChild().toElement(), TQVariant() ); if ( attrib == "text" ) { txt = v.toString(); com = getComment( n ); } else if ( attrib == "pixmap" ) { pix = v.toString(); if ( !pix.isEmpty() && !pixmapLoaderFunction.isEmpty() ) { - pix.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - pix.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + pix.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pix.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } } else if ( attrib == "field" ) field = v.toString(); @@ -745,9 +745,9 @@ TTQString Uic::createTableRowColumnImpl( const TTQDomElement &e, const TTQString // ### This generated code sucks! We have to set the number of // rows/cols before and then only do setLabel/() - // ### careful, though, since TTQDataTable has an API which makes this code pretty good + // ### careful, though, since TQDataTable has an API which makes this code pretty good - TTQString s; + TQString s; if ( isRow ) { s = indent + parent + ".setNumRows(" + parent + ".numRows() + 1 )\n"; if ( pix.isEmpty() ) @@ -780,13 +780,13 @@ TTQString Uic::createTableRowColumnImpl( const TTQDomElement &e, const TTQString /*! Creates the implementation of a layout tag. Called from createObjectImpl(). */ -TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parentClass, const TTQString& parent, const TTQString& layout ) +TQString Uic::createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout ) { - TTQDomElement n; - TTQString objClass, objName; + TQDomElement n; + TQString objClass, objName; objClass = e.tagName(); - TTQString qlayout = "TQt::VBoxLayout.new"; + TQString qlayout = "TQt::VBoxLayout.new"; if ( objClass == "hbox" ) qlayout = "TQt::HBoxLayout.new"; else if ( objClass == "grid" ) @@ -796,11 +796,11 @@ TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parent objName = registerObject( getLayoutName( e ) ); layoutObjects += objName; - TTQString margin = DomTool::readProperty( e, "margin", defMargin ).toString(); - TTQString spacing = DomTool::readProperty( e, "spacing", defSpacing ).toString(); - TTQString resizeMode = DomTool::readProperty( e, "resizeMode", TTQString::null ).toString(); + TQString margin = DomTool::readProperty( e, "margin", defMargin ).toString(); + TQString spacing = DomTool::readProperty( e, "spacing", defSpacing ).toString(); + TQString resizeMode = DomTool::readProperty( e, "resizeMode", TQString::null ).toString(); - TTQString optcells; + TQString optcells; if ( isGrid ) optcells = "1, 1, "; if ( (parentClass == "TQt::GroupBox" || parentClass == "TQt::ButtonGroup") && layout.isEmpty() ) { @@ -827,10 +827,10 @@ TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parent if ( !isGrid ) { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { if ( n.tagName() == "spacer" ) { - TTQString child = createSpacerImpl( n, parentClass, parent, objName ); + TQString child = createSpacerImpl( n, parentClass, parent, objName ); out << indent << objName << ".addItem(" << child << ")" << endl; } else if ( tags.contains( n.tagName() ) ) { - TTQString child = createObjectImpl( n, parentClass, parent, objName ); + TQString child = createObjectImpl( n, parentClass, parent, objName ); if ( isLayout( child ) ) out << indent << objName << ".addLayout(" << child << ")" << endl; else @@ -839,7 +839,7 @@ TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parent } } else { for ( n = e.firstChild().toElement(); !n.isNull(); n = n.nextSibling().toElement() ) { - TTQDomElement ae = n; + TQDomElement ae = n; int row = ae.attribute( "row" ).toInt(); int col = ae.attribute( "column" ).toInt(); int rowspan = ae.attribute( "rowspan" ).toInt(); @@ -849,7 +849,7 @@ TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parent if ( colspan < 1 ) colspan = 1; if ( n.tagName() == "spacer" ) { - TTQString child = createSpacerImpl( n, parentClass, parent, objName ); + TQString child = createSpacerImpl( n, parentClass, parent, objName ); if ( rowspan * colspan != 1 ) out << indent << objName << ".addMultiCell(" << child << ", " << row << ", " << row + rowspan - 1 << ", " << col << ", " << col + colspan - 1 << ")" << endl; @@ -857,9 +857,9 @@ TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parent out << indent << objName << ".addItem(" << child << ", " << row << ", " << col << ")" << endl; } else if ( tags.contains( n.tagName() ) ) { - TTQString child = createObjectImpl( n, parentClass, parent, objName ); + TQString child = createObjectImpl( n, parentClass, parent, objName ); out << endl; - TTQString o = "Widget"; + TQString o = "Widget"; if ( isLayout( child ) ) o = "Layout"; if ( rowspan * colspan != 1 ) @@ -877,20 +877,20 @@ TTQString Uic::createLayoutImpl( const TTQDomElement &e, const TTQString& parent -TTQString Uic::createSpacerImpl( const TTQDomElement &e, const TTQString& /*parentClass*/, const TTQString& /*parent*/, const TTQString& /*layout*/) +TQString Uic::createSpacerImpl( const TQDomElement &e, const TQString& /*parentClass*/, const TQString& /*parent*/, const TQString& /*layout*/) { - TTQDomElement n; - TTQString objClass, objName; + TQDomElement n; + TQString objClass, objName; objClass = e.tagName(); objName = registerObject( getObjectName( e ) ); - TTQSize size = DomTool::readProperty( e, "sizeHint", TTQSize( 0, 0 ) ).toSize(); - TTQString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString(); + TQSize size = DomTool::readProperty( e, "sizeHint", TQSize( 0, 0 ) ).toSize(); + TQString sizeType = DomTool::readProperty( e, "sizeType", "Expanding" ).toString(); bool isVspacer = DomTool::readProperty( e, "orientation", "Horizontal" ) == "Vertical"; if ( sizeType != "Expanding" && sizeType != "MinimumExpanding" && DomTool::hasProperty( e, "geometry" ) ) { // compatibility Qt 2.2 - TTQRect geom = DomTool::readProperty( e, "geometry", TTQRect(0,0,0,0) ).toRect(); + TQRect geom = DomTool::readProperty( e, "geometry", TQRect(0,0,0,0) ).toRect(); size = geom.size(); } @@ -916,16 +916,16 @@ static const char* const ColorRole[] = { /*! Creates a colorgroup with name \a name from the color group \a cg */ -void Uic::createColorGroupImpl( const TTQString& name, const TTQDomElement& e ) +void Uic::createColorGroupImpl( const TQString& name, const TQDomElement& e ) { - TTQColorGroup cg; + TQColorGroup cg; int r = -1; - TTQDomElement n = e.firstChild().toElement(); - TTQString color; + TQDomElement n = e.firstChild().toElement(); + TQString color; while ( !n.isNull() ) { if ( n.tagName() == "color" ) { r++; - TTQColor col = DomTool::readColor( n ); + TQColor col = DomTool::readColor( n ); color = "TQt::Color.new(%1,%2,%3)"; color = color.arg( col.red() ).arg( col.green() ).arg( col.blue() ); if ( col == white ) @@ -936,11 +936,11 @@ void Uic::createColorGroupImpl( const TTQString& name, const TTQDomElement& e ) out << indent << name << ".setColor(TQt::ColorGroup::" << ColorRole[r] << ", " << color << ")" << endl; } } else if ( n.tagName() == "pixmap" ) { - TTQString pixmap = n.firstChild().toText().data(); + TQString pixmap = n.firstChild().toText().data(); pixmap.prepend("@"); if ( !pixmapLoaderFunction.isEmpty() ) { - pixmap.prepend( pixmapLoaderFunction + "(" + TTQString( externPixmaps ? "\"" : "" ) ); - pixmap.append( TTQString( externPixmaps ? "\"" : "" ) + ")" ); + pixmap.prepend( pixmapLoaderFunction + "(" + TQString( externPixmaps ? "\"" : "" ) ); + pixmap.append( TQString( externPixmaps ? "\"" : "" ) + ")" ); } out << indent << name << ".setBrush(TQt::ColorGroup::" << ColorRole[r] << ", TQt::Brush.new(" << color << ", " << pixmap << "))" << endl; @@ -953,16 +953,16 @@ void Uic::createColorGroupImpl( const TTQString& name, const TTQDomElement& e ) Auxiliary function to load a color group. The colorgroup must not contain pixmaps. */ -TTQColorGroup Uic::loadColorGroup( const TTQDomElement &e ) +TQColorGroup Uic::loadColorGroup( const TQDomElement &e ) { - TTQColorGroup cg; + TQColorGroup cg; int r = -1; - TTQDomElement n = e.firstChild().toElement(); - TTQColor col; + TQDomElement n = e.firstChild().toElement(); + TQColor col; while ( !n.isNull() ) { if ( n.tagName() == "color" ) { r++; - cg.setColor( (TTQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) ); + cg.setColor( (TQColorGroup::ColorRole)r, (col = DomTool::readColor( n ) ) ); } n = n.nextSibling().toElement(); } @@ -973,10 +973,10 @@ TTQColorGroup Uic::loadColorGroup( const TTQDomElement &e ) the database \a connection and \a table. */ -bool Uic::isWidgetInTable( const TTQDomElement& e, const TTQString& connection, const TTQString& table ) +bool Uic::isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table ) { - TTQString conn = getDatabaseInfo( e, "connection" ); - TTQString tab = getDatabaseInfo( e, "table" ); + TQString conn = getDatabaseInfo( e, "connection" ); + TQString tab = getDatabaseInfo( e, "table" ); if ( conn == connection && tab == table ) return true; return false; @@ -986,17 +986,17 @@ bool Uic::isWidgetInTable( const TTQDomElement& e, const TTQString& connection, Registers all database connections, cursors and forms. */ -void Uic::registerDatabases( const TTQDomElement& e ) +void Uic::registerDatabases( const TQDomElement& e ) { - TTQDomElement n; - TTQDomNodeList nl; + TQDomElement n; + TQDomNodeList nl; int i; nl = e.parentNode().toElement().elementsByTagName( "widget" ); for ( i = 0; i < (int) nl.length(); ++i ) { n = nl.item(i).toElement(); - TTQString conn = getDatabaseInfo( n, "connection" ); - TTQString tab = getDatabaseInfo( n, "table" ); - TTQString fld = getDatabaseInfo( n, "field" ); + TQString conn = getDatabaseInfo( n, "connection" ); + TQString tab = getDatabaseInfo( n, "table" ); + TQString fld = getDatabaseInfo( n, "field" ); if ( !conn.isNull() ) { dbConnections += conn; if ( !tab.isNull() ) { @@ -1016,7 +1016,7 @@ void Uic::registerDatabases( const TTQDomElement& e ) \sa registeredName(), isObjectRegistered() */ -TTQString Uic::registerObject( const TTQString& name ) +TQString Uic::registerObject( const TQString& name ) { if ( objectNames.isEmpty() ) { // some temporary variables we need @@ -1025,7 +1025,7 @@ TTQString Uic::registerObject( const TTQString& name ) objectNames += "cg"; objectNames += "pal"; } - TTQString result("@"); + TQString result("@"); result += name; int i; while ( ( i = result.find(' ' )) != -1 ) { @@ -1034,10 +1034,10 @@ TTQString Uic::registerObject( const TTQString& name ) if ( objectNames.contains( result ) ) { int i = 2; - while ( objectNames.contains( result + "_" + TTQString::number(i) ) ) + while ( objectNames.contains( result + "_" + TQString::number(i) ) ) i++; result += "_"; - result += TTQString::number(i); + result += TQString::number(i); } objectNames += result; objectMapper.insert( name, result ); @@ -1050,7 +1050,7 @@ TTQString Uic::registerObject( const TTQString& name ) \sa registerObject(), isObjectRegistered() */ -TTQString Uic::registeredName( const TTQString& name ) +TQString Uic::registeredName( const TQString& name ) { if ( !objectMapper.contains( name ) ) return name; @@ -1060,24 +1060,24 @@ TTQString Uic::registeredName( const TTQString& name ) /*! Returns whether the object \a name was registered yet or not. */ -bool Uic::isObjectRegistered( const TTQString& name ) +bool Uic::isObjectRegistered( const TQString& name ) { return objectMapper.contains( name ); } /*! - Unifies the entries in stringlist \a list. Should really be a TTQStringList feature. + Unifies the entries in stringlist \a list. Should really be a TQStringList feature. */ -TTQStringList Uic::unique( const TTQStringList& list ) +TQStringList Uic::unique( const TQStringList& list ) { - TTQStringList result; + TQStringList result; if ( list.isEmpty() ) return result; - TTQStringList l = list; + TQStringList l = list; l.sort(); result += l.first(); - for ( TTQStringList::Iterator it = l.begin(); it != l.end(); ++it ) { + for ( TQStringList::Iterator it = l.begin(); it != l.end(); ++it ) { if ( *it != result.last() ) result += *it; } @@ -1089,7 +1089,7 @@ TTQStringList Uic::unique( const TTQStringList& list ) /*! Creates an instance of class \a objClass, with parent \a parent and name \a objName */ -TTQString Uic::createObjectInstance( const TTQString& objClass, const TTQString& parent, const TTQString& objName ) +TQString Uic::createObjectInstance( const TQString& objClass, const TQString& parent, const TQString& objName ) { if ( objClass.mid( 4 ) == "ComboBox" ) { @@ -1098,7 +1098,7 @@ TTQString Uic::createObjectInstance( const TTQString& objClass, const TTQString& return objClass + ".new(" + parent + ", \"" + objName.mid(1) + "\")"; } -bool Uic::isLayout( const TTQString& name ) const +bool Uic::isLayout( const TQString& name ) const { return layoutObjects.contains( name ); } diff --git a/qtruby/rubylib/designer/rbuic/uic.h b/qtruby/rubylib/designer/rbuic/uic.h index 18177ee7..ddfcc1be 100644 --- a/qtruby/rubylib/designer/rbuic/uic.h +++ b/qtruby/rubylib/designer/rbuic/uic.h @@ -37,12 +37,12 @@ public: void setTabStop(uint n) {tabStop = n; calc();} void operator++() {++current; calc();} void operator--() {--current; calc();} - operator TTQString() {return indstr;} + operator TQString() {return indstr;} private: uint tabStop; uint current; - TTQString indstr; + TQString indstr; void calc(); }; @@ -51,95 +51,95 @@ private: class Uic : public Qt { public: - Uic( const TTQString &fn, TTQTextStream& out, TTQDomDocument doc, bool subcl, - const TTQString &trm, const TTQString& subclname, bool omitForwardDecls, - TTQString &uicClass, bool useKDE ); + Uic( const TQString &fn, TQTextStream& out, TQDomDocument doc, bool subcl, + const TQString &trm, const TQString& subclname, bool omitForwardDecls, + TQString &uicClass, bool useKDE ); static void setIndent(const RubyIndent &rubyind) {indent = rubyind;} - void createFormImpl( const TTQDomElement &e ); - - void createSubImpl( const TTQDomElement &e, const TTQString& subclname ); - - void createObjectDecl( const TTQDomElement& e ); - void createAttrDecl( const TTQDomElement& e ); - void createActionDecl( const TTQDomElement& e ); - void createActionImpl( const TTQDomElement& e, const TTQString &parent ); - void createToolbarImpl( const TTQDomElement &e, const TTQString &parentClass, const TTQString &parent ); - void createMenuBarImpl( const TTQDomElement &e, const TTQString &parentClass, const TTQString &parent ); - void createPopupMenuImpl( const TTQDomElement &e, const TTQString &parentClass, const TTQString &parent ); - TTQString createObjectImpl( const TTQDomElement &e, const TTQString& parentClass, const TTQString& parent, const TTQString& layout = TTQString::null ); - TTQString createLayoutImpl( const TTQDomElement &e, const TTQString& parentClass, const TTQString& parent, const TTQString& layout = TTQString::null ); - TTQString createObjectInstance( const TTQString& objClass, const TTQString& parent, const TTQString& objName ); - TTQString createSpacerImpl( const TTQDomElement &e, const TTQString& parentClass, const TTQString& parent, const TTQString& layout = TTQString::null ); - void createExclusiveProperty( const TTQDomElement & e, const TTQString& exclusiveProp ); - TTQString createListBoxItemImpl( const TTQDomElement &e, const TTQString &parent, TTQString *value = 0 ); - TTQString createIconViewItemImpl( const TTQDomElement &e, const TTQString &parent ); - TTQString createListViewColumnImpl( const TTQDomElement &e, const TTQString &parent, TTQString *value = 0 ); - TTQString createTableRowColumnImpl( const TTQDomElement &e, const TTQString &parent, TTQString *value = 0 ); - TTQString createListViewItemImpl( const TTQDomElement &e, const TTQString &parent, - const TTQString &parentItem ); - void createColorGroupImpl( const TTQString& cg, const TTQDomElement& e ); - TTQColorGroup loadColorGroup( const TTQDomElement &e ); - - TTQDomElement getObjectProperty( const TTQDomElement& e, const TTQString& name ); - TTQString getPixmapLoaderFunction( const TTQDomElement& e ); - TTQString getFormClassName( const TTQDomElement& e ); - TTQString getClassName( const TTQDomElement& e ); - TTQString getObjectName( const TTQDomElement& e ); - TTQString getLayoutName( const TTQDomElement& e ); - TTQString getInclude( const TTQString& className ); - - TTQString setObjectProperty( const TTQString& objClass, const TTQString& obj, const TTQString &prop, const TTQDomElement &e, bool stdset ); - - TTQString registerObject( const TTQString& name ); - TTQString registeredName( const TTQString& name ); - bool isObjectRegistered( const TTQString& name ); - TTQStringList unique( const TTQStringList& ); - - TTQString trcall( const TTQString& sourceText, const TTQString& comment = "" ); - - static void embed( TTQTextStream& out, const char* project, const TTQStringList& images ); - - friend void getDBConnections(Uic& uic, TTQString& s); + void createFormImpl( const TQDomElement &e ); + + void createSubImpl( const TQDomElement &e, const TQString& subclname ); + + void createObjectDecl( const TQDomElement& e ); + void createAttrDecl( const TQDomElement& e ); + void createActionDecl( const TQDomElement& e ); + void createActionImpl( const TQDomElement& e, const TQString &parent ); + void createToolbarImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ); + void createMenuBarImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ); + void createPopupMenuImpl( const TQDomElement &e, const TQString &parentClass, const TQString &parent ); + TQString createObjectImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null ); + TQString createLayoutImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null ); + TQString createObjectInstance( const TQString& objClass, const TQString& parent, const TQString& objName ); + TQString createSpacerImpl( const TQDomElement &e, const TQString& parentClass, const TQString& parent, const TQString& layout = TQString::null ); + void createExclusiveProperty( const TQDomElement & e, const TQString& exclusiveProp ); + TQString createListBoxItemImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 ); + TQString createIconViewItemImpl( const TQDomElement &e, const TQString &parent ); + TQString createListViewColumnImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 ); + TQString createTableRowColumnImpl( const TQDomElement &e, const TQString &parent, TQString *value = 0 ); + TQString createListViewItemImpl( const TQDomElement &e, const TQString &parent, + const TQString &parentItem ); + void createColorGroupImpl( const TQString& cg, const TQDomElement& e ); + TQColorGroup loadColorGroup( const TQDomElement &e ); + + TQDomElement getObjectProperty( const TQDomElement& e, const TQString& name ); + TQString getPixmapLoaderFunction( const TQDomElement& e ); + TQString getFormClassName( const TQDomElement& e ); + TQString getClassName( const TQDomElement& e ); + TQString getObjectName( const TQDomElement& e ); + TQString getLayoutName( const TQDomElement& e ); + TQString getInclude( const TQString& className ); + + TQString setObjectProperty( const TQString& objClass, const TQString& obj, const TQString &prop, const TQDomElement &e, bool stdset ); + + TQString registerObject( const TQString& name ); + TQString registeredName( const TQString& name ); + bool isObjectRegistered( const TQString& name ); + TQStringList unique( const TQStringList& ); + + TQString trcall( const TQString& sourceText, const TQString& comment = "" ); + + static void embed( TQTextStream& out, const char* project, const TQStringList& images ); + + friend void getDBConnections(Uic& uic, TQString& s); static bool hasKDEwidget; private: - void registerLayouts ( const TTQDomElement& e ); - - TTQTextStream& out; - TTQTextOStream trout; - TTQString languageChangeBody; - TTQStringList objectNames; - TTQMap<TTQString,TTQString> objectMapper; - TTQStringList tags; - TTQStringList layouts; - TTQString formName; - TTQString lastItem; - TTQString trmacro; + void registerLayouts ( const TQDomElement& e ); + + TQTextStream& out; + TQTextOStream trout; + TQString languageChangeBody; + TQStringList objectNames; + TQMap<TQString,TQString> objectMapper; + TQStringList tags; + TQStringList layouts; + TQString formName; + TQString lastItem; + TQString trmacro; bool nofwd; static RubyIndent indent; struct Buddy { - Buddy( const TTQString& k, const TTQString& b ) + Buddy( const TQString& k, const TQString& b ) : key( k ), buddy( b ) {} Buddy(){} // for valuelist - TTQString key; - TTQString buddy; + TQString key; + TQString buddy; bool operator==( const Buddy& other ) const { return (key == other.key); } }; struct CustomInclude { - TTQString header; - TTQString location; + TQString header; + TQString location; }; - TTQValueList<Buddy> buddies; + TQValueList<Buddy> buddies; - TTQStringList layoutObjects; - bool isLayout( const TTQString& name ) const; + TQStringList layoutObjects; + bool isLayout( const TQString& name ) const; uint item_used : 1; uint cg_used : 1; @@ -147,35 +147,35 @@ private: uint stdsetdef : 1; uint externPixmaps : 1; - TTQString uiFileVersion; - TTQString nameOfClass; - TTQString pixmapLoaderFunction; + TQString uiFileVersion; + TQString nameOfClass; + TQString pixmapLoaderFunction; - void registerDatabases( const TTQDomElement& e ); - bool isWidgetInTable( const TTQDomElement& e, const TTQString& connection, const TTQString& table ); - bool isFrameworkCodeGenerated( const TTQDomElement& e ); - TTQString getDatabaseInfo( const TTQDomElement& e, const TTQString& tag ); - void createFormImpl( const TTQDomElement& e, const TTQString& form, const TTQString& connection, const TTQString& table ); - TTQStringList dbConnections; - TTQMap< TTQString, TTQStringList > dbCursors; - TTQMap< TTQString, TTQStringList > dbForms; + void registerDatabases( const TQDomElement& e ); + bool isWidgetInTable( const TQDomElement& e, const TQString& connection, const TQString& table ); + bool isFrameworkCodeGenerated( const TQDomElement& e ); + TQString getDatabaseInfo( const TQDomElement& e, const TQString& tag ); + void createFormImpl( const TQDomElement& e, const TQString& form, const TQString& connection, const TQString& table ); + TQStringList dbConnections; + TQMap< TQString, TQStringList > dbCursors; + TQMap< TQString, TQStringList > dbForms; static bool isMainWindow; - static TTQString mkBool( bool b ); - static TTQString mkBool( const TTQString& s ); - bool toBool( const TTQString& s ); - static TTQString fixString( const TTQString &str ); + static TQString mkBool( bool b ); + static TQString mkBool( const TQString& s ); + bool toBool( const TQString& s ); + static TQString fixString( const TQString &str ); static bool onlyAscii; - static TTQString mkStdSet( const TTQString& prop ); - static TTQString getComment( const TTQDomNode& n ); + static TQString mkStdSet( const TQString& prop ); + static TQString getComment( const TQDomNode& n ); int defSpacing, defMargin; - TTQString fileName; + TQString fileName; bool writeSlotImpl; - bool isEmptyFunction( const TTQString& fname ); - TTQMap<TTQString, TTQString> functionImpls; + bool isEmptyFunction( const TQString& fname ); + TQMap<TQString, TQString> functionImpls; - void rubySlot(TTQStringList::Iterator &it); + void rubySlot(TQStringList::Iterator &it); }; #endif diff --git a/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp b/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp index cc4779a2..f8a0f0fd 100644 --- a/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp +++ b/qtruby/rubylib/designer/rbuic/widgetdatabase.cpp @@ -41,17 +41,17 @@ const int dbsize = 300; const int dbcustom = 200; const int dbdictsize = 211; static WidgetDatabaseRecord* db[ dbsize ]; -static TTQDict<int> *className2Id = 0; +static TQDict<int> *className2Id = 0; static int dbcount = 0; static int dbcustomcount = 200; -static TTQStrList *wGroups; -static TTQStrList *invisibleGroups; +static TQStrList *wGroups; +static TQStrList *invisibleGroups; static bool whatsThisLoaded = false; static TQPluginManager<WidgetInterface> *widgetPluginManager = 0; static bool plugins_set_up = false; static bool was_in_setup = false; -TTQCleanupHandler<TQPluginManager<WidgetInterface> > cleanup_manager; +TQCleanupHandler<TQPluginManager<WidgetInterface> > cleanup_manager; WidgetDatabaseRecord::WidgetDatabaseRecord() { @@ -117,14 +117,14 @@ void WidgetDatabase::setupDataBase( int id ) invisibleGroups = new TQStrList; invisibleGroups->append( "Forms" ); invisibleGroups->append( "Temp" ); - className2Id = new TTQDict<int>( dbdictsize ); + className2Id = new TQDict<int>( dbdictsize ); className2Id->setAutoDelete( true ); WidgetDatabaseRecord *r = 0; r = new WidgetDatabaseRecord; r->iconSet = "pushbutton.xpm"; - r->name = "TTQPushButton"; + r->name = "TQPushButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Push Button"; @@ -132,7 +132,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "toolbutton.xpm"; - r->name = "TTQToolButton"; + r->name = "TQToolButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Tool Button"; @@ -140,7 +140,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "radiobutton.xpm"; - r->name = "TTQRadioButton"; + r->name = "TQRadioButton"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Radio Button"; @@ -148,7 +148,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "checkbox.xpm"; - r->name = "TTQCheckBox"; + r->name = "TQCheckBox"; r->group = widgetGroup( "Buttons" ); r->toolTip = "Check Box"; @@ -156,7 +156,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "groupbox.xpm"; - r->name = "TTQGroupBox"; + r->name = "TQGroupBox"; r->group = widgetGroup( "Containers" ); r->toolTip = "Group Box"; r->isContainer = true; @@ -165,7 +165,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "buttongroup.xpm"; - r->name = "TTQButtonGroup"; + r->name = "TQButtonGroup"; r->group = widgetGroup( "Containers" ); r->toolTip = "Button Group"; r->isContainer = true; @@ -174,7 +174,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "frame.xpm"; - r->name = "TTQFrame"; + r->name = "TQFrame"; r->group = widgetGroup( "Containers" ); r->toolTip = "Frame"; r->isContainer = true; @@ -183,7 +183,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "tabwidget.xpm"; - r->name = "TTQTabWidget"; + r->name = "TQTabWidget"; r->group = widgetGroup( "Containers" ); r->toolTip = "Tabwidget"; r->isContainer = true; @@ -193,7 +193,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "listbox.xpm"; - r->name = "TTQListBox"; + r->name = "TQListBox"; r->group = widgetGroup( "Views" ); r->toolTip = "List Box"; @@ -201,7 +201,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "listview.xpm"; - r->name = "TTQListView"; + r->name = "TQListView"; r->group = widgetGroup( "Views" ); r->toolTip = "List View"; @@ -210,7 +210,7 @@ void WidgetDatabase::setupDataBase( int id ) #if !defined(QT_NO_ICONVIEW) || defined(UIC) r = new WidgetDatabaseRecord; r->iconSet = "iconview.xpm"; - r->name = "TTQIconView"; + r->name = "TQIconView"; r->group = widgetGroup( "Views" ); r->toolTip = "Icon View"; @@ -220,7 +220,7 @@ void WidgetDatabase::setupDataBase( int id ) #if !defined(QT_NO_TABLE) r = new WidgetDatabaseRecord; r->iconSet = "table.xpm"; - r->name = "TTQTable"; + r->name = "TQTable"; r->group = widgetGroup( "Views" ); r->toolTip = "Table"; @@ -231,7 +231,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "datatable.xpm"; r->includeFile = "tqdatatable.h"; - r->name = "TTQDataTable"; + r->name = "TQDataTable"; r->group = widgetGroup( "Database" ); r->toolTip = "Data Table"; @@ -240,7 +240,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "lineedit.xpm"; - r->name = "TTQLineEdit"; + r->name = "TQLineEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Line Edit"; @@ -248,7 +248,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "spinbox.xpm"; - r->name = "TTQSpinBox"; + r->name = "TQSpinBox"; r->group = widgetGroup( "Input" ); r->toolTip = "Spin Box"; @@ -283,7 +283,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "multilineedit.xpm"; - r->name = "TTQMultiLineEdit"; + r->name = "TQMultiLineEdit"; r->group = widgetGroup( "Temp" ); r->toolTip = "Multi Line Edit"; @@ -291,7 +291,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "richtextedit.xpm"; - r->name = "TTQTextEdit"; + r->name = "TQTextEdit"; r->group = widgetGroup( "Input" ); r->toolTip = "Richtext Editor"; @@ -299,7 +299,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "combobox.xpm"; - r->name = "TTQComboBox"; + r->name = "TQComboBox"; r->group = widgetGroup( "Input" ); r->toolTip = "Combo Box"; @@ -307,7 +307,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "slider.xpm"; - r->name = "TTQSlider"; + r->name = "TQSlider"; r->group = widgetGroup( "Input" ); r->toolTip = "Slider"; @@ -315,7 +315,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "scrollbar.xpm"; - r->name = "TTQScrollBar"; + r->name = "TQScrollBar"; r->group = widgetGroup( "Input" ); r->toolTip = "Scrollbar"; @@ -323,7 +323,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "dial.xpm"; - r->name = "TTQDial"; + r->name = "TQDial"; r->group = widgetGroup( "Input" ); r->toolTip = "Dial"; @@ -331,7 +331,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "label.xpm"; - r->name = "TTQLabel"; + r->name = "TQLabel"; r->group = widgetGroup( "Temp" ); r->toolTip = "Label"; @@ -375,7 +375,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "progress.xpm"; - r->name = "TTQProgressBar"; + r->name = "TQProgressBar"; r->group = widgetGroup( "Display" ); r->toolTip = "Progress Bar"; @@ -383,7 +383,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "textview.xpm"; - r->name = "TTQTextView"; + r->name = "TQTextView"; r->group = widgetGroup( "Temp" ); r->toolTip = "Text View"; @@ -391,7 +391,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = "textbrowser.xpm"; - r->name = "TTQTextBrowser"; + r->name = "TQTextBrowser"; r->group = widgetGroup( "Display" ); r->toolTip = "Text Browser"; @@ -407,21 +407,21 @@ void WidgetDatabase::setupDataBase( int id ) append( r ); r = new WidgetDatabaseRecord; - r->name = "TTQWidget"; + r->name = "TQWidget"; r->isForm = true; r->group = widgetGroup( "Forms" ); append( r ); r = new WidgetDatabaseRecord; - r->name = "TTQDialog"; + r->name = "TQDialog"; r->group = widgetGroup( "Forms" ); r->isForm = true; append( r ); r = new WidgetDatabaseRecord; - r->name = "TTQWizard"; + r->name = "TQWizard"; r->group = widgetGroup( "Forms" ); r->isContainer = true; @@ -443,7 +443,7 @@ void WidgetDatabase::setupDataBase( int id ) append( r ); r = new WidgetDatabaseRecord; - r->name = "TTQSplitter"; + r->name = "TQSplitter"; r->group = widgetGroup( "Temp" ); r->includeFile = "tqsplitter.h"; r->isContainer = true; @@ -476,7 +476,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "TTQMainWindow"; + r->name = "TQMainWindow"; r->includeFile = "tqmainwindow.h"; r->group = widgetGroup( "Temp" ); r->isContainer = true; @@ -486,7 +486,7 @@ void WidgetDatabase::setupDataBase( int id ) #ifndef QT_NO_SQL r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "TTQDataBrowser"; + r->name = "TQDataBrowser"; r->includeFile = "tqdatabrowser.h"; r->group = widgetGroup( "Database" ); r->toolTip = "Data Browser"; @@ -497,7 +497,7 @@ void WidgetDatabase::setupDataBase( int id ) r = new WidgetDatabaseRecord; r->iconSet = ""; - r->name = "TTQDataView"; + r->name = "TQDataView"; r->includeFile = "tqdataview.h"; r->group = widgetGroup( "Database" ); r->toolTip = "Data View"; @@ -517,8 +517,8 @@ void WidgetDatabase::setupPlugins() if ( plugins_set_up ) return; plugins_set_up = true; - TTQStringList widgets = widgetManager()->featureList(); - for ( TTQStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) { + TQStringList widgets = widgetManager()->featureList(); + for ( TQStringList::Iterator it = widgets.begin(); it != widgets.end(); ++it ) { if ( hasWidget( *it ) ) continue; WidgetDatabaseRecord *r = new WidgetDatabaseRecord; @@ -528,11 +528,11 @@ void WidgetDatabase::setupPlugins() continue; #ifndef UIC - TTQIconSet icon = iface->iconSet( *it ); + TQIconSet icon = iface->iconSet( *it ); if ( !icon.pixmap().isNull() ) - r->icon = new TTQIconSet( icon ); + r->icon = new TQIconSet( icon ); #endif - TTQString grp = iface->group( *it ); + TQString grp = iface->group( *it ); if ( grp.isEmpty() ) grp = "3rd party widgets"; r->group = widgetGroup( grp ); @@ -570,19 +570,19 @@ int WidgetDatabase::startCustom() Returns the iconset which represents the class registered as \a id. */ -TTQIconSet WidgetDatabase::iconSet( int id ) +TQIconSet WidgetDatabase::iconSet( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return TTQIconSet(); + return TQIconSet(); #if !defined(UIC) && !defined(RESOURCE) if ( !r->icon ) - r->icon = new TTQIconSet( PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Small ), + r->icon = new TQIconSet( PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Small ), PixmapChooser::loadPixmap( r->iconSet, PixmapChooser::Large ) ); return *r->icon; #else - return TTQIconSet(); + return TQIconSet(); #endif } @@ -590,12 +590,12 @@ TTQIconSet WidgetDatabase::iconSet( int id ) Returns the classname of the widget which is registered as \a id. */ -TTQString WidgetDatabase::className( int id ) +TQString WidgetDatabase::className( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return TTQString::null; + return TQString::null; return r->name; } @@ -603,12 +603,12 @@ TTQString WidgetDatabase::className( int id ) Returns the group to which the widget registered as \a id belongs. */ -TTQString WidgetDatabase::group( int id ) +TQString WidgetDatabase::group( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return TTQString::null; + return TQString::null; return r->group; } @@ -616,12 +616,12 @@ TTQString WidgetDatabase::group( int id ) id. */ -TTQString WidgetDatabase::toolTip( int id ) +TQString WidgetDatabase::toolTip( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return TTQString::null; + return TQString::null; return r->toolTip; } @@ -629,12 +629,12 @@ TTQString WidgetDatabase::toolTip( int id ) as \a id. */ -TTQString WidgetDatabase::whatsThis( int id ) +TQString WidgetDatabase::whatsThis( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return TTQString::null; + return TQString::null; return r->whatsThis; } @@ -642,12 +642,12 @@ TTQString WidgetDatabase::whatsThis( int id ) Returns the include file if the widget which is registered as \a id. */ -TTQString WidgetDatabase::includeFile( int id ) +TQString WidgetDatabase::includeFile( int id ) { setupDataBase( id ); WidgetDatabaseRecord *r = at( id ); if ( !r ) - return TTQString::null; + return TQString::null; if ( r->includeFile.isNull() ) return r->name.lower() + ".h"; return r->includeFile; @@ -677,10 +677,10 @@ bool WidgetDatabase::isContainer( int id ) return r->isContainer || r->isForm; } -TTQString WidgetDatabase::createWidgetName( int id ) +TQString WidgetDatabase::createWidgetName( int id ) { setupDataBase( id ); - TTQString n = className( id ); + TQString n = className( id ); if ( n == "TQLayoutWidget" ) n = "Layout"; if ( n[ 0 ] == 'Q' ) @@ -688,13 +688,13 @@ TTQString WidgetDatabase::createWidgetName( int id ) WidgetDatabaseRecord *r = at( id ); if ( !r ) return n; - n += TTQString::number( ++r->nameCounter ); + n += TQString::number( ++r->nameCounter ); return n; } /*! Returns the id for \a name or -1 if \a name is unknown. */ -int WidgetDatabase::idFromClassName( const TTQString &name ) +int WidgetDatabase::idFromClassName( const TQString &name ) { setupDataBase( -1 ); if ( name.isEmpty() ) @@ -715,7 +715,7 @@ int WidgetDatabase::idFromClassName( const TTQString &name ) return -1; } -bool WidgetDatabase::hasWidget( const TTQString &name ) +bool WidgetDatabase::hasWidget( const TQString &name ) { return className2Id->find( name ) != 0; } @@ -748,14 +748,14 @@ void WidgetDatabase::append( WidgetDatabaseRecord *r ) insert( dbcount++, r ); } -TTQString WidgetDatabase::widgetGroup( const TTQString &g ) +TQString WidgetDatabase::widgetGroup( const TQString &g ) { if ( wGroups->find( g ) == -1 ) wGroups->append( g ); return g; } -bool WidgetDatabase::isGroupEmpty( const TTQString &grp ) +bool WidgetDatabase::isGroupEmpty( const TQString &grp ) { WidgetDatabaseRecord *r = 0; for ( int i = 0; i < dbcount; ++i ) { @@ -767,12 +767,12 @@ bool WidgetDatabase::isGroupEmpty( const TTQString &grp ) return true; } -TTQString WidgetDatabase::widgetGroup( int i ) +TQString WidgetDatabase::widgetGroup( int i ) { setupDataBase( -1 ); if ( i >= 0 && i < (int)wGroups->count() ) return wGroups->at( i ); - return TTQString::null; + return TQString::null; } int WidgetDatabase::numWidgetGroups() @@ -781,7 +781,7 @@ int WidgetDatabase::numWidgetGroups() return wGroups->count(); } -bool WidgetDatabase::isGroupVisible( const TTQString &g ) +bool WidgetDatabase::isGroupVisible( const TQString &g ) { setupDataBase( -1 ); return invisibleGroups->find( g ) == -1; @@ -805,16 +805,16 @@ bool WidgetDatabase::isWhatsThisLoaded() return whatsThisLoaded; } -void WidgetDatabase::loadWhatsThis( const TTQString &docPath ) +void WidgetDatabase::loadWhatsThis( const TQString &docPath ) { - TTQString whatsthisFile = docPath + "/whatsthis"; - TTQFile f( whatsthisFile ); + TQString whatsthisFile = docPath + "/whatsthis"; + TQFile f( whatsthisFile ); if ( !f.open( IO_ReadOnly ) ) return; - TTQTextStream ts( &f ); + TQTextStream ts( &f ); while ( !ts.atEnd() ) { - TTQString s = ts.readLine(); - TTQStringList l = TTQStringList::split( " | ", s ); + TQString s = ts.readLine(); + TQStringList l = TQStringList::split( " | ", s ); int id = idFromClassName( l[ 1 ] ); WidgetDatabaseRecord *r = at( id ); if ( r ) @@ -823,10 +823,10 @@ void WidgetDatabase::loadWhatsThis( const TTQString &docPath ) whatsThisLoaded = true; } -TTQPluginManager<WidgetInterface> *widgetManager() +TQPluginManager<WidgetInterface> *widgetManager() { if ( !widgetPluginManager ) { - widgetPluginManager = new TQPluginManager<WidgetInterface>( IID_Widget, TTQApplication::libraryPaths(), "/designer" ); + widgetPluginManager = new TQPluginManager<WidgetInterface>( IID_Widget, TQApplication::libraryPaths(), "/designer" ); cleanup_manager.add( &widgetPluginManager ); } return widgetPluginManager; diff --git a/qtruby/rubylib/designer/rbuic/widgetdatabase.h b/qtruby/rubylib/designer/rbuic/widgetdatabase.h index ebcfc00d..63ccd829 100644 --- a/qtruby/rubylib/designer/rbuic/widgetdatabase.h +++ b/qtruby/rubylib/designer/rbuic/widgetdatabase.h @@ -33,10 +33,10 @@ struct WidgetDatabaseRecord { WidgetDatabaseRecord(); ~WidgetDatabaseRecord(); - TTQString iconSet, name, group, toolTip, whatsThis, includeFile; + TQString iconSet, name, group, toolTip, whatsThis, includeFile; uint isContainer : 1; uint isForm : 1; - TTQIconSet *icon; + TQIconSet *icon; int nameCounter; }; @@ -50,35 +50,35 @@ public: static int count(); static int startCustom(); - static TTQIconSet iconSet( int id ); - static TTQString className( int id ); - static TTQString group( int id ); - static TTQString toolTip( int id ); - static TTQString whatsThis( int id ); - static TTQString includeFile( int id ); + static TQIconSet iconSet( int id ); + static TQString className( int id ); + static TQString group( int id ); + static TQString toolTip( int id ); + static TQString whatsThis( int id ); + static TQString includeFile( int id ); static bool isForm( int id ); static bool isContainer( int id ); - static int idFromClassName( const TTQString &name ); - static TTQString createWidgetName( int id ); + static int idFromClassName( const TQString &name ); + static TQString createWidgetName( int id ); static WidgetDatabaseRecord *at( int index ); static void insert( int index, WidgetDatabaseRecord *r ); static void append( WidgetDatabaseRecord *r ); - static TTQString widgetGroup( const TTQString &g ); - static TTQString widgetGroup( int i ); + static TQString widgetGroup( const TQString &g ); + static TQString widgetGroup( int i ); static int numWidgetGroups(); - static bool isGroupVisible( const TTQString &g ); - static bool isGroupEmpty( const TTQString &grp ); + static bool isGroupVisible( const TQString &g ); + static bool isGroupEmpty( const TQString &grp ); static int addCustomWidget( WidgetDatabaseRecord *r ); static bool isCustomWidget( int id ); static bool isWhatsThisLoaded(); - static void loadWhatsThis( const TTQString &docPath ); + static void loadWhatsThis( const TQString &docPath ); - static bool hasWidget( const TTQString &name ); + static bool hasWidget( const TQString &name ); }; diff --git a/qtruby/rubylib/designer/uilib/qui.cpp b/qtruby/rubylib/designer/uilib/qui.cpp index 912918f6..05b094bb 100644 --- a/qtruby/rubylib/designer/uilib/qui.cpp +++ b/qtruby/rubylib/designer/uilib/qui.cpp @@ -1,5 +1,5 @@ /*************************************************************************** - tqui.cpp - A ruby wrapper for the TTQWidgetFactory class + tqui.cpp - A ruby wrapper for the TQWidgetFactory class ------------------- begin : Wed Mar 14 2004 copyright : (C) 2004 by Richard Dale @@ -47,31 +47,31 @@ static VALUE qwidget_factory_class; static VALUE create(int argc, VALUE * argv, VALUE /*klass*/) { - TTQWidget * topLevelWidget = 0; + TQWidget * topLevelWidget = 0; VALUE result = Qnil; if (argc == 0 || argc > 4) { rb_raise(rb_eArgError, "wrong number of arguments (%d)\n", argc); } - TTQObject * connector = 0; + TQObject * connector = 0; if (argc >= 2) { if (TYPE(argv[1]) == T_DATA) { smokeruby_object *o = value_obj_info(argv[1]); if (o != 0) { - connector = (TTQObject *) o->ptr; + connector = (TQObject *) o->ptr; } } else { rb_raise(rb_eArgError, "invalid argument type\n"); } } - TTQWidget * parent = 0; + TQWidget * parent = 0; if (argc >= 3) { if (TYPE(argv[2]) == T_DATA) { smokeruby_object *o = value_obj_info(argv[2]); if (o != 0) { - parent = (TTQWidget *) o->ptr; + parent = (TQWidget *) o->ptr; } } else { rb_raise(rb_eArgError, "invalid argument type\n"); @@ -88,18 +88,18 @@ create(int argc, VALUE * argv, VALUE /*klass*/) } if (TYPE(argv[0]) == T_STRING) { - topLevelWidget = TTQWidgetFactory::create(TTQString(StringValuePtr(argv[0])), connector, parent, name); + topLevelWidget = TQWidgetFactory::create(TQString(StringValuePtr(argv[0])), connector, parent, name); } else if (TYPE(argv[0]) == T_DATA) { - TTQIODevice * dev = 0; + TQIODevice * dev = 0; smokeruby_object *o = value_obj_info(argv[0]); if (o != 0 && o->ptr != 0 && o->classId == qt_Smoke->idClass("TQIODevice")) { - dev = (TTQIODevice *) o->ptr; + dev = (TQIODevice *) o->ptr; } else { rb_raise(rb_eArgError, "invalid argument type\n"); } - topLevelWidget = TTQWidgetFactory::create(dev, connector, parent, name); + topLevelWidget = TQWidgetFactory::create(dev, connector, parent, name); } else { rb_raise(rb_eArgError, "invalid argument type\n"); } @@ -121,7 +121,7 @@ create(int argc, VALUE * argv, VALUE /*klass*/) static VALUE load_images(VALUE klass, VALUE dir) { - TTQWidgetFactory::loadImages(TTQString(StringValuePtr(dir))); + TQWidgetFactory::loadImages(TQString(StringValuePtr(dir))); return klass; } @@ -129,14 +129,14 @@ static VALUE widgets(VALUE /*self*/) { VALUE result = rb_ary_new(); - TTQStringList widgetList = TTQWidgetFactory::widgets(); + TQStringList widgetList = TQWidgetFactory::widgets(); - for (TTQStringList::Iterator it = widgetList.begin(); it != widgetList.end(); ++it) { - TTQString widgetName = *it; + for (TQStringList::Iterator it = widgetList.begin(); it != widgetList.end(); ++it) { + TQString widgetName = *it; if (widgetName.startsWith("Q")) { - widgetName.replace(0, 1, TTQString("TQt::")); + widgetName.replace(0, 1, TQString("TQt::")); } else if (widgetName.startsWith("K")) { - widgetName.replace(0, 1, TTQString("KDE::")); + widgetName.replace(0, 1, TQString("KDE::")); } rb_ary_push(result, rb_str_new2(widgetName.latin1())); } @@ -147,15 +147,15 @@ widgets(VALUE /*self*/) static VALUE supports_widget(VALUE /*self*/, VALUE widget) { - TTQString widgetName(StringValuePtr(widget)); + TQString widgetName(StringValuePtr(widget)); if (widgetName.startsWith("TQt::")) { - widgetName.replace(0, 4, TTQString("Q")); + widgetName.replace(0, 4, TQString("Q")); } else if (widgetName.startsWith("KDE::")) { - widgetName.replace(0, 5, TTQString("K")); + widgetName.replace(0, 5, TQString("K")); } - return TTQWidgetFactory::supportsWidget(widgetName) ? Qtrue : Qfalse; + return TQWidgetFactory::supportsWidget(widgetName) ? Qtrue : Qfalse; } void diff --git a/qtruby/rubylib/qtruby/Qt.cpp b/qtruby/rubylib/qtruby/Qt.cpp index 4d849725..225adaa8 100644 --- a/qtruby/rubylib/qtruby/Qt.cpp +++ b/qtruby/rubylib/qtruby/Qt.cpp @@ -76,13 +76,13 @@ int do_debug = qtdb_gc; int do_debug = qtdb_none; #endif -TTQPtrDict<VALUE> pointer_map(2179); +TQPtrDict<VALUE> pointer_map(2179); int object_count = 0; -TTQAsciiDict<Smoke::Index> methcache(2179); -TTQAsciiDict<Smoke::Index> classcache(2179); +TQAsciiDict<Smoke::Index> methcache(2179); +TQAsciiDict<Smoke::Index> classcache(2179); // Maps from a classname in the form TQt::Widget to an int id -TTQIntDict<char> classname(2179); +TQIntDict<char> classname(2179); extern "C" { VALUE qt_module = Qnil; @@ -138,7 +138,7 @@ void *value_to_ptr(VALUE ruby_value) { // ptr on success, null on fail VALUE getPointerObject(void *ptr); bool isTQObject(Smoke *smoke, Smoke::Index classId) { - if(qstrcmp(smoke->classes[classId].className, "TTQObject") == 0) + if(qstrcmp(smoke->classes[classId].className, "TQObject") == 0) return true; for(Smoke::Index *p = smoke->inheritanceList + smoke->classes[classId].parents; *p; @@ -431,7 +431,7 @@ public: if(_called) return; _called = true; - TTQString className(_smoke->className(method().classId)); + TQString className(_smoke->className(method().classId)); if ( ! className.endsWith(_smoke->methodNames[method().name]) && TYPE(_target) != T_DATA @@ -471,10 +471,10 @@ public: } }; -class UnencapsulatedTQObject : public TTQObject { +class UnencapsulatedTQObject : public TQObject { public: - TTQConnectionList *public_receivers(int signal) const { return receivers(signal); } - void public_activate_signal(TTQConnectionList *clist, TQUObject *o) { activate_signal(clist, o); } + TQConnectionList *public_receivers(int signal) const { return receivers(signal); } + void public_activate_signal(TQConnectionList *clist, TQUObject *o) { activate_signal(clist, o); } }; class EmitSignal : public Marshall { @@ -487,7 +487,7 @@ class EmitSignal : public Marshall { Smoke::Stack _stack; bool _called; public: - EmitSignal(TTQObject *qobj, int id, int items, VALUE args, VALUE *sp) : + EmitSignal(TQObject *qobj, int id, int items, VALUE args, VALUE *sp) : _qobj((UnencapsulatedTQObject*)qobj), _id(id), _sp(sp), _items(items), _cur(-1), _called(false) { @@ -511,7 +511,7 @@ public: if(_called) return; _called = true; - TTQConnectionList *clist = _qobj->public_receivers(_id); + TQConnectionList *clist = _qobj->public_receivers(_id); if(!clist) return; TQUObject *o = new TQUObject[_items + 1]; @@ -532,7 +532,7 @@ public: static_QUType_charstar.set(po, (char*)si->s_voidp); break; case xmoc_QString: - static_QUType_TQString.set(po, *(TTQString*)si->s_voidp); + static_QUType_TQString.set(po, *(TQString*)si->s_voidp); break; default: { @@ -778,7 +778,7 @@ public: if (do_debug & qtdb_virtual) { Smoke::Method & meth = smoke->methods[method]; - TTQCString signature(smoke->methodNames[meth.name]); + TQCString signature(smoke->methodNames[meth.name]); signature += "("; for (int i = 0; i < meth.numArgs; i++) { @@ -876,19 +876,19 @@ set_obj_info(const char * className, smokeruby_object * o) o->classId = (int)*r; } - // If the instance is a subclass of TTQObject, then check to see if the - // className from its TTQMetaObject is in the Smoke library. If not then + // If the instance is a subclass of TQObject, then check to see if the + // className from its TQMetaObject is in the Smoke library. If not then // create a Ruby class for it dynamically. Remove the first letter from // any class names beginning with 'Q' or 'K' and put them under the TQt:: // or KDE:: modules respectively. - if (isDerivedFrom(o->smoke, o->classId, o->smoke->idClass("TTQObject"))) { - TTQObject * qobject = (TTQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQObject")); - TTQMetaObject * meta = qobject->metaObject(); + if (isDerivedFrom(o->smoke, o->classId, o->smoke->idClass("TQObject"))) { + TQObject * qobject = (TQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQObject")); + TQMetaObject * meta = qobject->metaObject(); int classId = o->smoke->idClass(meta->className()); // The class isn't in the Smoke lib.. if (classId == 0) { VALUE new_klass = Qnil; - TTQString className(meta->className()); + TQString className(meta->className()); // The konsolePart class is in tdebase, and so it can't be in the Smoke library. // This hack instantiates a Ruby KDE::KonsolePart instance if (className == "konsolePart") { @@ -908,7 +908,7 @@ set_obj_info(const char * className, smokeruby_object * o) } // Add a TQt::Object.metaObject method which will do dynamic despatch on the - // metaObject() virtual method so that the true TTQMetaObject of the class + // metaObject() virtual method so that the true TQMetaObject of the class // is returned, rather than for the one for the parent class that is in // the Smoke library. rb_define_method(klass, "metaObject", (VALUE (*) (...)) qobject_metaobject, 0); @@ -1012,24 +1012,24 @@ receivers_qobject(VALUE self) smokeruby_object * o = 0; Data_Get_Struct(self, smokeruby_object, o); - UnencapsulatedTQObject * qobject = (UnencapsulatedTQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQObject")); + UnencapsulatedTQObject * qobject = (UnencapsulatedTQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQObject")); VALUE result = rb_hash_new(); - TTQStrList signalNames = qobject->metaObject()->signalNames(true); + TQStrList signalNames = qobject->metaObject()->signalNames(true); for (int sig = 0; sig < qobject->metaObject()->numSignals(true); sig++) { - TTQConnectionList * clist = qobject->public_receivers(sig); + TQConnectionList * clist = qobject->public_receivers(sig); if (clist != 0) { VALUE name = rb_str_new2(signalNames.at(sig)); VALUE members = rb_ary_new(); - for ( TTQConnection * connection = clist->first(); + for ( TQConnection * connection = clist->first(); connection != 0; connection = clist->next() ) { VALUE obj = getPointerObject(connection); if (obj == Qnil) { smokeruby_object * c = ALLOC(smokeruby_object); - c->classId = o->smoke->idClass("TTQConnection"); + c->classId = o->smoke->idClass("TQConnection"); c->smoke = o->smoke; c->ptr = connection; c->allocated = false; @@ -1046,36 +1046,36 @@ receivers_qobject(VALUE self) return result; } -// Takes a variable name and a TQProperty with TTQVariant value, and returns a ' +// Takes a variable name and a TQProperty with TQVariant value, and returns a ' // variable=value' pair with the value in ruby inspect style static TQCString -inspectProperty(Smoke * smoke, const TTQMetaProperty * property, const char * name, TTQVariant & value) +inspectProperty(Smoke * smoke, const TQMetaProperty * property, const char * name, TQVariant & value) { if (property->isEnumType()) { - TTQMetaObject * metaObject = *(property->meta); - return TTQCString().sprintf( " %s=%s::%s", + TQMetaObject * metaObject = *(property->meta); + return TQCString().sprintf( " %s=%s::%s", name, smoke->binding->className(smoke->idClass(metaObject->className())), property->valueToKey(value.toInt()) ); } switch (value.type()) { - case TTQVariant::String: - case TTQVariant::CString: + case TQVariant::String: + case TQVariant::CString: { if (value.toString().isNull()) { - return TTQCString().sprintf(" %s=nil", name); + return TQCString().sprintf(" %s=nil", name); } else { - return TTQCString().sprintf( " %s=\"%s\"", + return TQCString().sprintf( " %s=\"%s\"", name, value.toString().latin1() ); } } - case TTQVariant::Bool: + case TQVariant::Bool: { - TTQString rubyName; - TTQRegExp name_re("^(is|has)(.)(.*)"); + TQString rubyName; + TQRegExp name_re("^(is|has)(.)(.*)"); if (name_re.search(name) != -1) { rubyName = name_re.cap(2).lower() + name_re.cap(3) + "?"; @@ -1083,86 +1083,86 @@ inspectProperty(Smoke * smoke, const TTQMetaProperty * property, const char * na rubyName = name; } - return TTQCString().sprintf(" %s=%s", rubyName.latin1(), value.toString().latin1()); + return TQCString().sprintf(" %s=%s", rubyName.latin1(), value.toString().latin1()); } - case TTQVariant::Color: + case TQVariant::Color: { - TTQColor c = value.toColor(); - return TTQCString().sprintf(" %s=#<TQt::Color:0x0 %s>", name, c.name().latin1()); + TQColor c = value.toColor(); + return TQCString().sprintf(" %s=#<TQt::Color:0x0 %s>", name, c.name().latin1()); } - case TTQVariant::Cursor: + case TQVariant::Cursor: { - TTQCursor c = value.toCursor(); - return TTQCString().sprintf(" %s=#<TQt::Cursor:0x0 shape=%d>", name, c.shape()); + TQCursor c = value.toCursor(); + return TQCString().sprintf(" %s=#<TQt::Cursor:0x0 shape=%d>", name, c.shape()); } - case TTQVariant::Double: + case TQVariant::Double: { - return TTQCString().sprintf(" %s=%.4f", name, value.toDouble()); + return TQCString().sprintf(" %s=%.4f", name, value.toDouble()); } - case TTQVariant::Font: + case TQVariant::Font: { - TTQFont f = value.toFont(); - return TTQCString().sprintf( " %s=#<TQt::Font:0x0 family=%s, pointSize=%d, weight=%d, italic=%s, bold=%s, underline=%s, strikeOut=%s>", + TQFont f = value.toFont(); + return TQCString().sprintf( " %s=#<TQt::Font:0x0 family=%s, pointSize=%d, weight=%d, italic=%s, bold=%s, underline=%s, strikeOut=%s>", name, f.family().latin1(), f.pointSize(), f.weight(), f.italic() ? "true" : "false", f.bold() ? "true" : "false", f.underline() ? "true" : "false", f.strikeOut() ? "true" : "false" ); } - case TTQVariant::Point: + case TQVariant::Point: { - TTQPoint p = value.toPoint(); - return TTQCString().sprintf( " %s=#<TQt::Point:0x0 x=%d, y=%d>", + TQPoint p = value.toPoint(); + return TQCString().sprintf( " %s=#<TQt::Point:0x0 x=%d, y=%d>", name, p.x(), p.y() ); } - case TTQVariant::Rect: + case TQVariant::Rect: { - TTQRect r = value.toRect(); - return TTQCString().sprintf( " %s=#<TQt::Rect:0x0 left=%d, right=%d, top=%d, bottom=%d>", + TQRect r = value.toRect(); + return TQCString().sprintf( " %s=#<TQt::Rect:0x0 left=%d, right=%d, top=%d, bottom=%d>", name, r.left(), r.right(), r.top(), r.bottom() ); } - case TTQVariant::Size: + case TQVariant::Size: { - TTQSize s = value.toSize(); - return TTQCString().sprintf( " %s=#<TQt::Size:0x0 width=%d, height=%d>", + TQSize s = value.toSize(); + return TQCString().sprintf( " %s=#<TQt::Size:0x0 width=%d, height=%d>", name, s.width(), s.height() ); } - case TTQVariant::SizePolicy: + case TQVariant::SizePolicy: { - TTQSizePolicy s = value.toSizePolicy(); - return TTQCString().sprintf( " %s=#<TQt::SizePolicy:0x0 horData=%d, verData=%d>", + TQSizePolicy s = value.toSizePolicy(); + return TQCString().sprintf( " %s=#<TQt::SizePolicy:0x0 horData=%d, verData=%d>", name, s.horData(), s.verData() ); } - case TTQVariant::Brush: - case TTQVariant::ColorGroup: - case TTQVariant::Image: - case TTQVariant::Palette: - case TTQVariant::Pixmap: - case TTQVariant::Region: + case TQVariant::Brush: + case TQVariant::ColorGroup: + case TQVariant::Image: + case TQVariant::Palette: + case TQVariant::Pixmap: + case TQVariant::Region: { - return TTQCString().sprintf(" %s=#<TQt::%s:0x0>", name, value.typeName() + 1); + return TQCString().sprintf(" %s=#<TQt::%s:0x0>", name, value.typeName() + 1); } default: - return TTQCString().sprintf( " %s=%s", + return TQCString().sprintf( " %s=%s", name, (value.isNull() || value.toString().isNull()) ? "nil" : value.toString().latin1() ); } } -// Retrieves the properties for a TTQObject and returns them as 'name=value' pairs +// Retrieves the properties for a TQObject and returns them as 'name=value' pairs // in a ruby inspect string. For example: // // #<TQt::HBoxLayout:0x30139030 name=unnamed, margin=0, spacing=0, resizeMode=3> @@ -1181,14 +1181,14 @@ inspect_qobject(VALUE self) smokeruby_object * o = 0; Data_Get_Struct(self, smokeruby_object, o); - TTQObject * qobject = (TTQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQObject")); + TQObject * qobject = (TQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQObject")); - TTQCString value_list; - value_list.append(TTQCString().sprintf(" name=\"%s\"", qobject->name())); + TQCString value_list; + value_list.append(TQCString().sprintf(" name=\"%s\"", qobject->name())); if (qobject->isWidgetType()) { - TTQWidget * w = (TTQWidget *) qobject; - value_list.append(TTQCString().sprintf( ", x=%d, y=%d, width=%d, height=%d", + TQWidget * w = (TQWidget *) qobject; + value_list.append(TQCString().sprintf( ", x=%d, y=%d, width=%d, height=%d", w->x(), w->y(), w->width(), @@ -1201,7 +1201,7 @@ inspect_qobject(VALUE self) return inspect_str; } -// Retrieves the properties for a TTQObject and pretty_prints them as 'name=value' pairs +// Retrieves the properties for a TQObject and pretty_prints them as 'name=value' pairs // For example: // // #<TQt::HBoxLayout:0x30139030 @@ -1226,13 +1226,13 @@ pretty_print_qobject(VALUE self, VALUE pp) smokeruby_object * o = 0; Data_Get_Struct(self, smokeruby_object, o); - UnencapsulatedTQObject * qobject = (UnencapsulatedTQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQObject")); - TTQStrList names = qobject->metaObject()->propertyNames(true); + UnencapsulatedTQObject * qobject = (UnencapsulatedTQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQObject")); + TQStrList names = qobject->metaObject()->propertyNames(true); - TTQCString value_list; + TQCString value_list; if (qobject->parent() != 0) { - TTQCString parentInspectString; + TQCString parentInspectString; VALUE obj = getPointerObject(qobject->parent()); if (obj != Qnil) { VALUE parent_inspect_str = rb_funcall(obj, rb_intern("to_s"), 0, 0); @@ -1243,8 +1243,8 @@ pretty_print_qobject(VALUE self, VALUE pp) } if (qobject->parent()->isWidgetType()) { - TTQWidget * w = (TTQWidget *) qobject->parent(); - value_list = TTQCString().sprintf( " parent=%s name=\"%s\", x=%d, y=%d, width=%d, height=%d>,\n", + TQWidget * w = (TQWidget *) qobject->parent(); + value_list = TQCString().sprintf( " parent=%s name=\"%s\", x=%d, y=%d, width=%d, height=%d>,\n", parentInspectString.data(), w->name(), w->x(), @@ -1252,7 +1252,7 @@ pretty_print_qobject(VALUE self, VALUE pp) w->width(), w->height() ); } else { - value_list = TTQCString().sprintf( " parent=%s name=\"%s\">,\n", + value_list = TQCString().sprintf( " parent=%s name=\"%s\">,\n", parentInspectString.data(), qobject->parent()->name() ); } @@ -1261,23 +1261,23 @@ pretty_print_qobject(VALUE self, VALUE pp) } if (qobject->children() != 0) { - value_list = TTQCString().sprintf(" children=Array (%d element(s)),\n", qobject->children()->count()); + value_list = TQCString().sprintf(" children=Array (%d element(s)),\n", qobject->children()->count()); rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(value_list.data())); } - value_list = TTQCString(" metaObject=#<TQt::MetaObject:0x0"); - value_list.append(TTQCString().sprintf(" className=%s", qobject->metaObject()->className())); + value_list = TQCString(" metaObject=#<TQt::MetaObject:0x0"); + value_list.append(TQCString().sprintf(" className=%s", qobject->metaObject()->className())); if (qobject->metaObject()->superClass() != 0) { - value_list.append(TTQCString().sprintf(", superClass=#<TQt::MetaObject:0x0>", qobject->metaObject()->superClass())); + value_list.append(TQCString().sprintf(", superClass=#<TQt::MetaObject:0x0>", qobject->metaObject()->superClass())); } if (qobject->metaObject()->numSignals() > 0) { - value_list.append(TTQCString().sprintf(", signalNames=Array (%d element(s))", qobject->metaObject()->numSignals())); + value_list.append(TQCString().sprintf(", signalNames=Array (%d element(s))", qobject->metaObject()->numSignals())); } if (qobject->metaObject()->numSlots() > 0) { - value_list.append(TTQCString().sprintf(", slotNames=Array (%d element(s))", qobject->metaObject()->numSlots())); + value_list.append(TQCString().sprintf(", slotNames=Array (%d element(s))", qobject->metaObject()->numSlots())); } value_list.append(">,\n"); @@ -1285,14 +1285,14 @@ pretty_print_qobject(VALUE self, VALUE pp) int signalCount = 0; for (int sig = 0; sig < qobject->metaObject()->numSignals(true); sig++) { - TTQConnectionList * clist = qobject->public_receivers(sig); + TQConnectionList * clist = qobject->public_receivers(sig); if (clist != 0) { signalCount++; } } if (signalCount > 0) { - value_list = TTQCString().sprintf(" receivers=Hash (%d element(s)),\n", signalCount); + value_list = TQCString().sprintf(" receivers=Hash (%d element(s)),\n", signalCount); rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(value_list.data())); } @@ -1300,8 +1300,8 @@ pretty_print_qobject(VALUE self, VALUE pp) const char * name = names.first(); if (name != 0) { - TTQVariant value = qobject->property(name); - const TTQMetaProperty * property = qobject->metaObject()->property(index, true); + TQVariant value = qobject->property(name); + const TQMetaProperty * property = qobject->metaObject()->property(index, true); value_list = " " + inspectProperty(o->smoke, property, name, value); rb_funcall(pp, rb_intern("text"), 1, rb_str_new2(value_list.data())); index++; @@ -1335,8 +1335,8 @@ static VALUE qobject_metaobject(VALUE self) { smokeruby_object * o = value_obj_info(self); - TTQObject * qobject = (TTQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQObject")); - TTQMetaObject * meta = qobject->metaObject(); + TQObject * qobject = (TQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQObject")); + TQMetaObject * meta = qobject->metaObject(); VALUE obj = getPointerObject(meta); if (obj != Qnil) { return obj; @@ -1344,7 +1344,7 @@ qobject_metaobject(VALUE self) smokeruby_object * m = (smokeruby_object *) malloc(sizeof(smokeruby_object)); m->smoke = o->smoke; - m->classId = m->smoke->idClass("TTQMetaObject"); + m->classId = m->smoke->idClass("TQMetaObject"); m->ptr = meta; m->allocated = false; obj = set_obj_info("TQt::MetaObject", m); @@ -1359,15 +1359,15 @@ static Smoke::Index new_qvariant_qmap = 0; if (new_qvariant_qlist == 0) { Smoke::Index nameId = qt_Smoke->idMethodName("TQVariant?"); - Smoke::Index meth = qt_Smoke->findMethod(qt_Smoke->idClass("TTQVariant"), nameId); + Smoke::Index meth = qt_Smoke->findMethod(qt_Smoke->idClass("TQVariant"), nameId); Smoke::Index i = qt_Smoke->methodMaps[meth].method; i = -i; // turn into ambiguousMethodList index while (qt_Smoke->ambiguousMethodList[i] != 0) { const char * argType = qt_Smoke->types[qt_Smoke->argumentList[qt_Smoke->methods[qt_Smoke->ambiguousMethodList[i]].args]].name; - if (qstrcmp(argType, "const TTQValueList<TTQVariant>&" ) == 0) { + if (qstrcmp(argType, "const TQValueList<TQVariant>&" ) == 0) { new_qvariant_qlist = qt_Smoke->ambiguousMethodList[i]; - } else if (qstrcmp(argType, "const TTQMap<TTQString,TTQVariant>&" ) == 0) { + } else if (qstrcmp(argType, "const TQMap<TQString,TQVariant>&" ) == 0) { new_qvariant_qmap = qt_Smoke->ambiguousMethodList[i]; } @@ -1394,13 +1394,13 @@ static Smoke::Index new_qvariant_qmap = 0; return rb_call_super(argc, argv); } -static TTQCString * +static TQCString * find_cached_selector(int argc, VALUE * argv, VALUE klass, const char * methodName) { // Look in the cache -static TTQCString * mcid = 0; +static TQCString * mcid = 0; if (mcid == 0) { - mcid = new TTQCString(); + mcid = new TQCString(); } *mcid = rb_class2name(klass); *mcid += ';'; @@ -1436,9 +1436,9 @@ method_missing(int argc, VALUE * argv, VALUE self) VALUE klass = rb_funcall(self, rb_intern("class"), 0); // Look for 'thing?' methods, and try to match isThing() or hasThing() in the Smoke runtime -static TTQString * pred = 0; +static TQString * pred = 0; if (pred == 0) { - pred = new TTQString(); + pred = new TQString(); } *pred = methodName; @@ -1452,11 +1452,11 @@ static TTQString * pred = 0; pred->replace(pred->length() - 1, 1, ""); pred->replace(0, 1, pred->at(0).upper()); - pred->replace(0, 0, TTQString("is")); + pred->replace(0, 0, TQString("is")); Smoke::Index meth = o->smoke->findMethod(o->smoke->classes[o->classId].className, pred->latin1()); if (meth == 0) { - pred->replace(0, 2, TTQString("has")); + pred->replace(0, 2, TQString("has")); meth = o->smoke->findMethod(o->smoke->classes[o->classId].className, pred->latin1()); } @@ -1475,7 +1475,7 @@ static TTQString * pred = 0; } { - TTQCString * mcid = find_cached_selector(argc+3, temp_stack, klass, methodName); + TQCString * mcid = find_cached_selector(argc+3, temp_stack, klass, methodName); if (_current_method == -1) { // Find the C++ method to call. Do that from Ruby for now @@ -1505,22 +1505,22 @@ static TTQString * pred = 0; smokeruby_object *o = value_obj_info(self); if ( o != 0 && o->ptr != 0 - && isDerivedFrom(o->smoke, o->classId, o->smoke->idClass("TTQObject")) ) + && isDerivedFrom(o->smoke, o->classId, o->smoke->idClass("TQObject")) ) { - TTQObject * qobject = (TTQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQObject")); -static TTQString * prop = 0; + TQObject * qobject = (TQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQObject")); +static TQString * prop = 0; if (prop == 0) { - prop = new TTQString(); + prop = new TQString(); } *prop = rb_id2name(SYM2ID(argv[0])); - TTQMetaObject * meta = qobject->metaObject(); + TQMetaObject * meta = qobject->metaObject(); if (argc == 1) { if (prop->endsWith("?")) { prop->replace(0, 1, pred->at(0).upper()); - prop->replace(0, 0, TTQString("is")); + prop->replace(0, 0, TQString("is")); if (meta->findProperty(prop->latin1(), true) == -1) { - prop->replace(0, 2, TTQString("has")); + prop->replace(0, 2, TQString("has")); } } @@ -1568,7 +1568,7 @@ class_method_missing(int argc, VALUE * argv, VALUE klass) } { - TTQCString * mcid = find_cached_selector(argc+3, temp_stack, klass, methodName); + TQCString * mcid = find_cached_selector(argc+3, temp_stack, klass, methodName); if (_current_method == -1) { VALUE retval = rb_funcall2(qt_internal_module, rb_intern("do_method_missing"), argc+3, temp_stack); @@ -1581,9 +1581,9 @@ class_method_missing(int argc, VALUE * argv, VALUE klass) } if (_current_method == -1) { -static TTQRegExp * rx = 0; +static TQRegExp * rx = 0; if (rx == 0) { - rx = new TTQRegExp("[a-zA-Z]+"); + rx = new TQRegExp("[a-zA-Z]+"); } if (rx->search(methodName) == -1) { @@ -1629,7 +1629,7 @@ class LCDRange < TQt::Widget init() ... -For a case such as the above, the TTQWidget can't be instantiated until +For a case such as the above, the TQWidget can't be instantiated until the initializer has been run up to the point where 'super(parent, name)' is called. Only then, can the number and type of arguments passed to the constructor be known. However, the rest of the intializer @@ -1637,7 +1637,7 @@ can't be run until 'self' is a proper T_DATA object with a wrapped C++ instance. The solution is to run the initialize code twice. First, only up to the -'super(parent, name)' call, where the TTQWidget would get instantiated in +'super(parent, name)' call, where the TQWidget would get instantiated in initialize_qt(). And then rb_throw() jumps out of the initializer returning the wrapped object as a result. @@ -1674,7 +1674,7 @@ initialize_qt(int argc, VALUE * argv, VALUE self) { // Put this in a C block so that the mcid will be de-allocated at the end of the block, // rather than on f'n exit, to avoid the longjmp problem described below - TTQCString * mcid = find_cached_selector(argc+4, temp_stack, klass, rb_class2name(klass)); + TQCString * mcid = find_cached_selector(argc+4, temp_stack, klass, rb_class2name(klass)); if (_current_method == -1) { retval = rb_funcall2(qt_internal_module, rb_intern("do_method_missing"), argc+4, temp_stack); @@ -1777,7 +1777,7 @@ getmetainfo(VALUE self, int &offset, int &index) smokeruby_object *ometa = value_obj_info(metaObject_value); if(!ometa) return 0; - TTQMetaObject *metaobject = (TTQMetaObject*)ometa->ptr; + TQMetaObject *metaobject = (TQMetaObject*)ometa->ptr; offset = metaobject->signalOffset(); @@ -1796,7 +1796,7 @@ getslotinfo(VALUE self, int id, char *&slotname, int &index, bool isSignal = fal smokeruby_object *ometa = value_obj_info(metaObject_value); if(!ometa) return Qnil; - TTQMetaObject *metaobject = (TTQMetaObject*)ometa->ptr; + TQMetaObject *metaobject = (TQMetaObject*)ometa->ptr; int offset = isSignal ? metaobject->signalOffset() : metaobject->slotOffset(); @@ -1819,10 +1819,10 @@ static VALUE qt_signal(int argc, VALUE * argv, VALUE self) { smokeruby_object *o = value_obj_info(self); - TTQObject *qobj = (TTQObject*)o->smoke->cast( + TQObject *qobj = (TQObject*)o->smoke->cast( o->ptr, o->classId, - o->smoke->idClass("TTQObject") + o->smoke->idClass("TQObject") ); if(qobj->signalsBlocked()) return Qfalse; @@ -1853,10 +1853,10 @@ qt_invoke(int /*argc*/, VALUE * argv, VALUE self) } smokeruby_object *o = value_obj_info(self); - (void) (TTQObject*)o->smoke->cast( + (void) (TQObject*)o->smoke->cast( o->ptr, o->classId, - o->smoke->idClass("TTQObject") + o->smoke->idClass("TQObject") ); // Now, I need to find out if this means me @@ -1883,10 +1883,10 @@ qt_invoke(int /*argc*/, VALUE * argv, VALUE self) o->smoke->classes[o->classId].className ); } - TTQString name(slotname); -static TTQRegExp * rx = 0; + TQString name(slotname); +static TQRegExp * rx = 0; if (rx == 0) { - rx = new TTQRegExp("\\(.*"); + rx = new TQRegExp("\\(.*"); } name.replace(*rx, ""); @@ -1951,8 +1951,8 @@ getIsa(VALUE /*self*/, VALUE classId) return parents_list; } -// Return the class name of a TTQObject. Note that the name will be in the -// form of TQt::Widget rather than TTQWidget. Is this a bug or a feature? +// Return the class name of a TQObject. Note that the name will be in the +// form of TQt::Widget rather than TQWidget. Is this a bug or a feature? static VALUE class_name(VALUE self) { @@ -1986,7 +1986,7 @@ qbytearray_data(VALUE self) if (o == 0 || o->ptr == 0) { return Qnil; } - TTQByteArray * dataArray = (TTQByteArray*) o->ptr; + TQByteArray * dataArray = (TQByteArray*) o->ptr; return rb_str_new(dataArray->data(), (long) dataArray->size()); } @@ -1997,7 +1997,7 @@ qbytearray_size(VALUE self) if (o == 0 || o->ptr == 0) { return Qnil; } - TTQByteArray * dataArray = (TTQByteArray*) o->ptr; + TQByteArray * dataArray = (TQByteArray*) o->ptr; return UINT2NUM(dataArray->size()); } @@ -2008,7 +2008,7 @@ qbytearray_setRawData(VALUE self, VALUE data) if (o == 0 || o->ptr == 0) { return Qnil; } - TTQByteArray * dataArray = (TTQByteArray*) o->ptr; + TQByteArray * dataArray = (TQByteArray*) o->ptr; dataArray->setRawData(StringValuePtr(data), RSTRING(data)->len); return self; } @@ -2050,7 +2050,7 @@ setMocType(VALUE /*self*/, VALUE ptr, VALUE idx_value, VALUE name_value, VALUE s arg[idx].argType = xmoc_double; else if(qstrcmp(static_type, "char*") == 0) arg[idx].argType = xmoc_charstar; - else if(qstrcmp(static_type, "TTQString") == 0) + else if(qstrcmp(static_type, "TQString") == 0) arg[idx].argType = xmoc_QString; return Qtrue; } @@ -2164,8 +2164,8 @@ make_QUParameter(VALUE /*self*/, VALUE name_value, VALUE type_value, VALUE /*ext p->type = &static_QUType_double; else if(qstrcmp(type, "char*") == 0 || qstrcmp(type, "const char*") == 0) p->type = &static_QUType_charstar; - else if(qstrcmp(type, "TTQString") == 0 || qstrcmp(type, "TTQString&") == 0 || - qstrcmp(type, "const TTQString") == 0 || qstrcmp(type, "const TTQString&") == 0) + else if(qstrcmp(type, "TQString") == 0 || qstrcmp(type, "TQString&") == 0 || + qstrcmp(type, "const TQString") == 0 || qstrcmp(type, "const TQString&") == 0) p->type = &static_QUType_TQString; else p->type = &static_QUType_ptr; @@ -2252,8 +2252,8 @@ make_metaObject(VALUE /*self*/, VALUE className_value, VALUE parent, VALUE slot_ rb_raise(rb_eRuntimeError, "Cannot create metaObject\n"); } - TTQMetaObject *meta = TTQMetaObject::new_metaobject( - className, (TTQMetaObject*)po->ptr, + TQMetaObject *meta = TQMetaObject::new_metaobject( + className, (TQMetaObject*)po->ptr, (const TQMetaData*)slot_tbl, slot_count, // slots (const TQMetaData*)signal_tbl, signal_count, // signals 0, 0, // properties @@ -2262,7 +2262,7 @@ make_metaObject(VALUE /*self*/, VALUE className_value, VALUE parent, VALUE slot_ smokeruby_object * o = (smokeruby_object *) malloc(sizeof(smokeruby_object)); o->smoke = qt_Smoke; - o->classId = qt_Smoke->idClass("TTQMetaObject"); + o->classId = qt_Smoke->idClass("TQMetaObject"); o->ptr = meta; o->allocated = true; @@ -2534,9 +2534,9 @@ findAllMethods(int argc, VALUE * argv, VALUE /*self*/) static VALUE findAllMethodNames(VALUE /*self*/, VALUE result, VALUE classid, VALUE flags_value) { - TTQRegExp predicate_re("^(is|has)(.)(.*)"); - TTQRegExp set_re("^(set)([A-Z])(.*)"); - TTQRegExp op_re("operator(.*)(([-%~/+|&*])|(>>)|(<<)|(&&)|(\\|\\|)|(\\*\\*))=$"); + TQRegExp predicate_re("^(is|has)(.)(.*)"); + TQRegExp set_re("^(set)([A-Z])(.*)"); + TQRegExp op_re("operator(.*)(([-%~/+|&*])|(>>)|(<<)|(&&)|(\\|\\|)|(\\*\\*))=$"); unsigned short flags = (unsigned short) NUM2UINT(flags_value); if (classid != Qnil) { @@ -2658,10 +2658,10 @@ static VALUE kde_package_to_class(const char * package, VALUE base_class) { VALUE klass = Qnil; - TTQString packageName(package); -static TTQRegExp * scope_op = 0; + TQString packageName(package); +static TQRegExp * scope_op = 0; if (scope_op == 0) { - scope_op = new TTQRegExp("^([^:]+)::([^:]+)$"); + scope_op = new TQRegExp("^([^:]+)::([^:]+)$"); } if (packageName.startsWith("KDE::ConfigSkeleton::ItemEnum::")) { @@ -2718,7 +2718,7 @@ static TTQRegExp * scope_op = 0; VALUE module = rb_define_module(scope_op->cap(1).latin1()); klass = rb_define_class_under(module, scope_op->cap(2).latin1(), base_class); } else if ( packageName.startsWith("K") - && packageName.mid(1, 1).contains(TTQRegExp("[A-Z]")) == 1 ) + && packageName.mid(1, 1).contains(TQRegExp("[A-Z]")) == 1 ) { klass = rb_define_class_under(kde_module, package+strlen("K"), base_class); } else { @@ -2735,13 +2735,13 @@ create_qobject_class(VALUE /*self*/, VALUE package_value) const char *package = StringValuePtr(package_value); VALUE klass; - if (TTQString(package).startsWith("TQt::")) { + if (TQString(package).startsWith("TQt::")) { klass = rb_define_class_under(qt_module, package+strlen("TQt::"), qt_base_class); if (qstrcmp(package, "TQt::Application") == 0) { rb_define_singleton_method(klass, "new", (VALUE (*) (...)) new_qapplication, -1); rb_define_method(klass, "ARGV", (VALUE (*) (...)) qapplication_argv, 0); } - } else if (TTQString(package).startsWith("Qext::")) { + } else if (TQString(package).startsWith("Qext::")) { if (qext_scintilla_module == Qnil) { qext_scintilla_module = rb_define_module("Qext"); } @@ -2767,9 +2767,9 @@ create_qt_class(VALUE /*self*/, VALUE package_value) const char *package = StringValuePtr(package_value); VALUE klass; - if (TTQString(package).startsWith("TQt::")) { + if (TQString(package).startsWith("TQt::")) { klass = rb_define_class_under(qt_module, package+strlen("TQt::"), qt_base_class); - } else if (TTQString(package).startsWith("Qext::")) { + } else if (TQString(package).startsWith("Qext::")) { if (qext_scintilla_module == Qnil) { qext_scintilla_module = rb_define_module("Qext"); } diff --git a/qtruby/rubylib/qtruby/handlers.cpp b/qtruby/rubylib/qtruby/handlers.cpp index 3cb04df8..c3feee77 100644 --- a/qtruby/rubylib/qtruby/handlers.cpp +++ b/qtruby/rubylib/qtruby/handlers.cpp @@ -70,16 +70,16 @@ set_kde_resolve_classname(const char * (*kde_resolve_classname) (Smoke*, int, vo }; void -mark_qobject_children(TTQObject * qobject) +mark_qobject_children(TQObject * qobject) { VALUE obj; - const TTQObjectList *l = qobject->children(); + const TQObjectList *l = qobject->children(); if (l == 0) { return; } - TTQObjectListIt it( *l ); // iterate over the children - TTQObject *child; + TQObjectListIt it( *l ); // iterate over the children + TQObject *child; while ( (child = it.current()) != 0 ) { ++it; @@ -103,10 +103,10 @@ smokeruby_mark(void * p) if(do_debug & qtdb_gc) qWarning("Checking for mark (%s*)%p\n", className, o->ptr); if(o->ptr && o->allocated) { - if (isDerivedFromByName(o->smoke, className, "TTQListView")) { - TTQListView * listview = (TTQListView *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQListView")); - TTQListViewItemIterator it(listview); - TTQListViewItem *item; + if (isDerivedFromByName(o->smoke, className, "TQListView")) { + TQListView * listview = (TQListView *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQListView")); + TQListViewItemIterator it(listview); + TQListViewItem *item; while ( (item = it.current()) != 0 ) { ++it; @@ -119,9 +119,9 @@ smokeruby_mark(void * p) return; } - if (isDerivedFromByName(o->smoke, className, "TTQTable")) { - TTQTable * table = (TTQTable *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQTable")); - TTQTableItem *item; + if (isDerivedFromByName(o->smoke, className, "TQTable")) { + TQTable * table = (TQTable *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQTable")); + TQTableItem *item; for ( int row = 0; row < table->numRows(); row++ ) { for ( int col = 0; col < table->numCols(); col++ ) { @@ -136,10 +136,10 @@ smokeruby_mark(void * p) return; } - if (isDerivedFromByName(o->smoke, className, "TTQCanvas")) { - TTQCanvas * canvas = (TTQCanvas *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQCanvas")); - TTQCanvasItemList list = canvas->allItems(); - for ( TTQCanvasItemList::iterator it = list.begin(); it != list.end(); ++it ) { + if (isDerivedFromByName(o->smoke, className, "TQCanvas")) { + TQCanvas * canvas = (TQCanvas *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQCanvas")); + TQCanvasItemList list = canvas->allItems(); + for ( TQCanvasItemList::iterator it = list.begin(); it != list.end(); ++it ) { obj = getPointerObject(*it); if (obj != Qnil) { if(do_debug & qtdb_gc) qWarning("Marking (%s*)%p -> %p\n", className, *it, (void*)obj); @@ -149,19 +149,19 @@ smokeruby_mark(void * p) return; } - if (isDerivedFromByName(o->smoke, className, "TTQCanvasItem")) { - TTQCanvasItem * item = (TTQCanvasItem *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQCanvasItem")); - TTQCanvas * canvas = item->canvas(); + if (isDerivedFromByName(o->smoke, className, "TQCanvasItem")) { + TQCanvasItem * item = (TQCanvasItem *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQCanvasItem")); + TQCanvas * canvas = item->canvas(); obj = getPointerObject(canvas); if (obj != Qnil) { - if(do_debug & qtdb_gc) qWarning("Marking (%s*)%p -> %p\n", "TTQCanvas", canvas, (void*)obj); + if(do_debug & qtdb_gc) qWarning("Marking (%s*)%p -> %p\n", "TQCanvas", canvas, (void*)obj); rb_gc_mark(obj); } return; } - if (isDerivedFromByName(o->smoke, className, "TTQObject")) { - TTQObject * qobject = (TTQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQObject")); + if (isDerivedFromByName(o->smoke, className, "TQObject")) { + TQObject * qobject = (TQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQObject")); mark_qobject_children(qobject); return; } @@ -184,63 +184,63 @@ smokeruby_free(void * p) unmapPointer(o, o->classId, 0); object_count --; - if ( qstrcmp(className, "TTQObject") == 0 - || qstrcmp(className, "TTQListBoxItem") == 0 - || qstrcmp(className, "TTQStyleSheetItem") == 0 + if ( qstrcmp(className, "TQObject") == 0 + || qstrcmp(className, "TQListBoxItem") == 0 + || qstrcmp(className, "TQStyleSheetItem") == 0 || qstrcmp(className, "KCommand") == 0 || qstrcmp(className, "KNamedCommand") == 0 || qstrcmp(className, "KMacroCommand") == 0 || qstrcmp(className, "KAboutData") == 0 || qstrcmp(className, "KCmdLineArgs") == 0 - || qstrcmp(className, "TTQSqlCursor") == 0 ) + || qstrcmp(className, "TQSqlCursor") == 0 ) { // Don't delete instances of these classes for now free(o); return; - } else if (isDerivedFromByName(o->smoke, className, "TTQLayoutItem")) { - TTQLayoutItem * item = (TTQLayoutItem *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQLayoutItem")); + } else if (isDerivedFromByName(o->smoke, className, "TQLayoutItem")) { + TQLayoutItem * item = (TQLayoutItem *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQLayoutItem")); if (item->layout() != 0 || item->widget() != 0 || item->spacerItem() != 0) { free(o); return; } - } else if (qstrcmp(className, "TTQIconViewItem") == 0) { - TTQIconViewItem * item = (TTQIconViewItem *) o->ptr; + } else if (qstrcmp(className, "TQIconViewItem") == 0) { + TQIconViewItem * item = (TQIconViewItem *) o->ptr; if (item->iconView() != 0) { free(o); return; } - } else if (qstrcmp(className, "TTQCheckListItem") == 0) { - TTQCheckListItem * item = (TTQCheckListItem *) o->ptr; + } else if (qstrcmp(className, "TQCheckListItem") == 0) { + TQCheckListItem * item = (TQCheckListItem *) o->ptr; if (item->parent() != 0 || item->listView() != 0) { free(o); return; } - } else if (qstrcmp(className, "TTQListViewItem") == 0) { - TTQListViewItem * item = (TTQListViewItem *) o->ptr; + } else if (qstrcmp(className, "TQListViewItem") == 0) { + TQListViewItem * item = (TQListViewItem *) o->ptr; if (item->parent() != 0 || item->listView() != 0) { free(o); return; } - } else if (isDerivedFromByName(o->smoke, className, "TTQTableItem")) { - TTQTableItem * item = (TTQTableItem *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQTableItem")); + } else if (isDerivedFromByName(o->smoke, className, "TQTableItem")) { + TQTableItem * item = (TQTableItem *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQTableItem")); if (item->table() != 0) { free(o); return; } - } else if (qstrcmp(className, "TTQPopupMenu") == 0) { - TTQPopupMenu * item = (TTQPopupMenu *) o->ptr; + } else if (qstrcmp(className, "TQPopupMenu") == 0) { + TQPopupMenu * item = (TQPopupMenu *) o->ptr; if (item->parentWidget(false) != 0) { free(o); return; } - } else if (isDerivedFromByName(o->smoke, className, "TTQWidget")) { - TTQWidget * qwidget = (TTQWidget *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQWidget")); + } else if (isDerivedFromByName(o->smoke, className, "TQWidget")) { + TQWidget * qwidget = (TQWidget *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQWidget")); if (qwidget->parentWidget(true) != 0) { free(o); return; } - } else if (isDerivedFromByName(o->smoke, className, "TTQObject")) { - TTQObject * qobject = (TTQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TTQObject")); + } else if (isDerivedFromByName(o->smoke, className, "TQObject")) { + TQObject * qobject = (TQObject *) o->smoke->cast(o->ptr, o->classId, o->smoke->idClass("TQObject")); if (qobject->parent() != 0) { free(o); return; @@ -273,65 +273,65 @@ smokeruby_free(void * p) static const char * resolve_classname(Smoke* smoke, int classId, void * ptr) { - if (isDerivedFromByName(smoke, smoke->classes[classId].className, "TTQEvent")) { - TTQEvent * qevent = (TTQEvent *) smoke->cast(ptr, classId, smoke->idClass("TTQEvent")); + if (isDerivedFromByName(smoke, smoke->classes[classId].className, "TQEvent")) { + TQEvent * qevent = (TQEvent *) smoke->cast(ptr, classId, smoke->idClass("TQEvent")); switch (qevent->type()) { - case TTQEvent::ChildInserted: - case TTQEvent::ChildRemoved: + case TQEvent::ChildInserted: + case TQEvent::ChildRemoved: return "TQt::ChildEvent"; - case TTQEvent::Close: + case TQEvent::Close: return "TQt::CloseEvent"; - case TTQEvent::ContextMenu: + case TQEvent::ContextMenu: return "TQt::ContextMenuEvent"; -// case TTQEvent::User: +// case TQEvent::User: // return "TQt::CustomEvent"; - case TTQEvent::DragEnter: + case TQEvent::DragEnter: return "TQt::DragEnterEvent"; - case TTQEvent::DragLeave: + case TQEvent::DragLeave: return "TQt::DragLeaveEvent"; - case TTQEvent::DragMove: + case TQEvent::DragMove: return "TQt::DragMoveEvent"; - case TTQEvent::DragResponse: + case TQEvent::DragResponse: return "TQt::DragResponseEvent"; - case TTQEvent::Drop: + case TQEvent::Drop: return "TQt::DropEvent"; - case TTQEvent::FocusIn: - case TTQEvent::FocusOut: + case TQEvent::FocusIn: + case TQEvent::FocusOut: return "TQt::FocusEvent"; - case TTQEvent::Hide: + case TQEvent::Hide: return "TQt::HideEvent"; - case TTQEvent::KeyPress: - case TTQEvent::KeyRelease: + case TQEvent::KeyPress: + case TQEvent::KeyRelease: return "TQt::KeyEvent"; - case TTQEvent::IMStart: - case TTQEvent::IMCompose: - case TTQEvent::IMEnd: + case TQEvent::IMStart: + case TQEvent::IMCompose: + case TQEvent::IMEnd: return "TQt::IMEvent"; - case TTQEvent::MouseButtonPress: - case TTQEvent::MouseButtonRelease: - case TTQEvent::MouseButtonDblClick: - case TTQEvent::MouseMove: + case TQEvent::MouseButtonPress: + case TQEvent::MouseButtonRelease: + case TQEvent::MouseButtonDblClick: + case TQEvent::MouseMove: return "TQt::MouseEvent"; - case TTQEvent::Move: + case TQEvent::Move: return "TQt::MoveEvent"; - case TTQEvent::Paint: + case TQEvent::Paint: return "TQt::PaintEvent"; - case TTQEvent::Resize: + case TQEvent::Resize: return "TQt::ResizeEvent"; - case TTQEvent::Show: + case TQEvent::Show: return "TQt::ShowEvent"; - // case TTQEvent::Tablet: + // case TQEvent::Tablet: // return "TQt::TabletEvent"; - case TTQEvent::Timer: + case TQEvent::Timer: return "TQt::TimerEvent"; - case TTQEvent::Wheel: + case TQEvent::Wheel: return "TQt::WheelEvent"; default: break; } - } else if (isDerivedFromByName(smoke, smoke->classes[classId].className, "TTQObject")) { - TTQObject * qobject = (TTQObject *) smoke->cast(ptr, classId, smoke->idClass("TTQObject")); - TTQMetaObject * meta = qobject->metaObject(); + } else if (isDerivedFromByName(smoke, smoke->classes[classId].className, "TQObject")) { + TQObject * qobject = (TQObject *) smoke->cast(ptr, classId, smoke->idClass("TQObject")); + TQMetaObject * meta = qobject->metaObject(); while (meta != 0) { Smoke::Index classId = smoke->idClass(meta->className()); @@ -341,30 +341,30 @@ resolve_classname(Smoke* smoke, int classId, void * ptr) meta = meta->superClass(); } - } else if (isDerivedFromByName(smoke, smoke->classes[classId].className, "TTQCanvasItem")) { - TTQCanvasItem * qcanvasitem = (TTQCanvasItem *) smoke->cast(ptr, classId, smoke->idClass("TTQCanvasItem")); + } else if (isDerivedFromByName(smoke, smoke->classes[classId].className, "TQCanvasItem")) { + TQCanvasItem * qcanvasitem = (TQCanvasItem *) smoke->cast(ptr, classId, smoke->idClass("TQCanvasItem")); switch (qcanvasitem->rtti()) { - case TTQCanvasItem::Rtti_Sprite: + case TQCanvasItem::Rtti_Sprite: return "TQt::CanvasSprite"; - case TTQCanvasItem::Rtti_PolygonalItem: + case TQCanvasItem::Rtti_PolygonalItem: return "TQt::CanvasPolygonalItem"; - case TTQCanvasItem::Rtti_Text: + case TQCanvasItem::Rtti_Text: return "TQt::CanvasText"; - case TTQCanvasItem::Rtti_Polygon: + case TQCanvasItem::Rtti_Polygon: return "TQt::CanvasPolygon"; - case TTQCanvasItem::Rtti_Rectangle: + case TQCanvasItem::Rtti_Rectangle: return "TQt::CanvasRectangle"; - case TTQCanvasItem::Rtti_Ellipse: + case TQCanvasItem::Rtti_Ellipse: return "TQt::CanvasEllipse"; - case TTQCanvasItem::Rtti_Line: + case TQCanvasItem::Rtti_Line: return "TQt::CanvasLine"; - case TTQCanvasItem::Rtti_Spline: + case TQCanvasItem::Rtti_Spline: return "TQt::CanvasSpline"; default: break; } - } else if (isDerivedFromByName(smoke, smoke->classes[classId].className, "TTQListViewItem")) { - TTQListViewItem * item = (TTQListViewItem *) smoke->cast(ptr, classId, smoke->idClass("TTQListViewItem")); + } else if (isDerivedFromByName(smoke, smoke->classes[classId].className, "TQListViewItem")) { + TQListViewItem * item = (TQListViewItem *) smoke->cast(ptr, classId, smoke->idClass("TQListViewItem")); switch (item->rtti()) { case 0: return "TQt::ListViewItem"; @@ -374,8 +374,8 @@ resolve_classname(Smoke* smoke, int classId, void * ptr) return "TQt::ListViewItem"; break; } - } else if (isDerivedFromByName(smoke, smoke->classes[classId].className, "TTQTableItem")) { - TTQTableItem * item = (TTQTableItem *) smoke->cast(ptr, classId, smoke->idClass("TTQTableItem")); + } else if (isDerivedFromByName(smoke, smoke->classes[classId].className, "TQTableItem")) { + TQTableItem * item = (TQTableItem *) smoke->cast(ptr, classId, smoke->idClass("TQTableItem")); switch (item->rtti()) { case 0: return "TQt::TableItem"; @@ -803,41 +803,41 @@ void marshall_ucharP(Marshall *m) { } static const char * KCODE = 0; -static TTQTextCodec *codec = 0; +static TQTextCodec *codec = 0; static void init_codec() { VALUE temp = rb_gv_get("$KCODE"); KCODE = StringValuePtr(temp); if (qstrcmp(KCODE, "EUC") == 0) { - codec = TTQTextCodec::codecForName("eucJP"); + codec = TQTextCodec::codecForName("eucJP"); } else if (qstrcmp(KCODE, "SJIS") == 0) { - codec = TTQTextCodec::codecForName("Shift-JIS"); + codec = TQTextCodec::codecForName("Shift-JIS"); } } -TTQString* +TQString* qstringFromRString(VALUE rstring) { if (KCODE == 0) { init_codec(); } - TTQString * s; + TQString * s; if (qstrcmp(KCODE, "UTF8") == 0) - s = new TTQString(TTQString::fromUtf8(StringValuePtr(rstring), RSTRING(rstring)->len)); + s = new TQString(TQString::fromUtf8(StringValuePtr(rstring), RSTRING(rstring)->len)); else if (qstrcmp(KCODE, "EUC") == 0) - s = new TTQString(codec->toUnicode(StringValuePtr(rstring))); + s = new TQString(codec->toUnicode(StringValuePtr(rstring))); else if (qstrcmp(KCODE, "SJIS") == 0) - s = new TTQString(codec->toUnicode(StringValuePtr(rstring))); + s = new TQString(codec->toUnicode(StringValuePtr(rstring))); else if(qstrcmp(KCODE, "NONE") == 0) - s = new TTQString(TTQString::fromLatin1(StringValuePtr(rstring))); + s = new TQString(TQString::fromLatin1(StringValuePtr(rstring))); else - s = new TTQString(TTQString::fromLocal8Bit(StringValuePtr(rstring), RSTRING(rstring)->len)); + s = new TQString(TQString::fromLocal8Bit(StringValuePtr(rstring), RSTRING(rstring)->len)); return s; } VALUE -rstringFromTQString(TTQString * s) { +rstringFromTQString(TQString * s) { if (KCODE == 0) { init_codec(); } @@ -858,11 +858,11 @@ static void marshall_QString(Marshall *m) { switch(m->action()) { case Marshall::FromVALUE: { - TTQString* s = 0; + TQString* s = 0; if ( *(m->var()) != Qnil) { s = qstringFromRString(*(m->var())); } else { - s = new TTQString(TTQString::null); + s = new TQString(TQString::null); } m->item().s_voidp = s; @@ -881,7 +881,7 @@ static void marshall_QString(Marshall *m) { break; case Marshall::ToVALUE: { - TTQString *s = (TTQString*)m->item().s_voidp; + TQString *s = (TQString*)m->item().s_voidp; if (s != 0) { if (s->isNull()) { *(m->var()) = Qnil; @@ -902,8 +902,8 @@ static void marshall_QString(Marshall *m) { } } -// The only way to convert a TTQChar to a TTQString is to -// pass a TTQChar to a TTQString constructor. However, +// The only way to convert a TQChar to a TQString is to +// pass a TQChar to a TQString constructor. However, // TQStrings aren't in the QtRuby api, so add this // convenience method 'TQt::Char.to_s' to get a ruby // string from a TQt::Char. @@ -915,8 +915,8 @@ qchar_to_s(VALUE self) return Qnil; } - TTQChar * qchar = (TTQChar*) o->ptr; - TTQString s(*qchar); + TQChar * qchar = (TQChar*) o->ptr; + TQString s(*qchar); return rstringFromTQString(&s); } @@ -938,13 +938,13 @@ static void marshall_QCString(Marshall *m) { switch(m->action()) { case Marshall::FromVALUE: { - TTQCString *s = 0; + TQCString *s = 0; VALUE rv = *(m->var()); if (rv == Qnil) { - s = new TTQCString(); + s = new TQCString(); } else { - // Add 1 to the ruby string length to allow for a TTQCString '\0' terminator - s = new TTQCString(StringValuePtr(*(m->var())), RSTRING(*(m->var()))->len + 1); + // Add 1 to the ruby string length to allow for a TQCString '\0' terminator + s = new TQCString(StringValuePtr(*(m->var())), RSTRING(*(m->var()))->len + 1); } m->item().s_voidp = s; @@ -960,7 +960,7 @@ static void marshall_QCString(Marshall *m) { break; case Marshall::ToVALUE: { - TTQCString *s = (TTQCString*)m->item().s_voidp; + TQCString *s = (TQCString*)m->item().s_voidp; if(s && (const char *) *s != 0) { *(m->var()) = rb_str_new2((const char *)*s); // const char * p = (const char *)*s; @@ -968,7 +968,7 @@ static void marshall_QCString(Marshall *m) { // if(not_ascii(p,len)) // { // #if PERL_VERSION == 6 && PERL_SUBVERSION == 0 -// TTQTextCodec* c = TTQTextCodec::codecForMib(106); // utf8 +// TQTextCodec* c = TQTextCodec::codecForMib(106); // utf8 // if(c->heuristicContentMatch(p,len) >= 0) // #else // if(is_utf8_string((U8 *)p,len)) @@ -1208,12 +1208,12 @@ void marshall_QStringList(Marshall *m) { } int count = RARRAY(list)->len; - TTQStringList *stringlist = new TQStringList; + TQStringList *stringlist = new TQStringList; for(long i = 0; i < count; i++) { VALUE item = rb_ary_entry(list, i); if(TYPE(item) != T_STRING) { - stringlist->append(TTQString()); + stringlist->append(TQString()); continue; } stringlist->append(*(qstringFromRString(item))); @@ -1225,7 +1225,7 @@ void marshall_QStringList(Marshall *m) { if (stringlist != 0 && !m->type().isConst()) { rb_ary_clear(list); - for(TTQStringList::Iterator it = stringlist->begin(); it != stringlist->end(); ++it) + for(TQStringList::Iterator it = stringlist->begin(); it != stringlist->end(); ++it) rb_ary_push(list, rstringFromTQString(&(*it))); } @@ -1235,14 +1235,14 @@ void marshall_QStringList(Marshall *m) { } case Marshall::ToVALUE: { - TTQStringList *stringlist = static_cast<TTQStringList *>(m->item().s_voidp); + TQStringList *stringlist = static_cast<TQStringList *>(m->item().s_voidp); if(!stringlist) { *(m->var()) = Qnil; break; } VALUE av = rb_ary_new(); - for(TTQStringList::Iterator it = stringlist->begin(); it != stringlist->end(); ++it) { + for(TQStringList::Iterator it = stringlist->begin(); it != stringlist->end(); ++it) { VALUE rv = rstringFromTQString(&(*it)); rb_ary_push(av, rv); } @@ -1270,15 +1270,15 @@ void marshall_QStrList(Marshall *m) { } int count = RARRAY(list)->len; - TTQStrList *stringlist = new TQStrList; + TQStrList *stringlist = new TQStrList; for(long i = 0; i < count; i++) { VALUE item = rb_ary_entry(list, i); if(TYPE(item) != T_STRING) { - stringlist->append(TTQString()); + stringlist->append(TQString()); continue; } - stringlist->append(TTQString::fromUtf8(StringValuePtr(item), RSTRING(item)->len)); + stringlist->append(TQString::fromUtf8(StringValuePtr(item), RSTRING(item)->len)); } m->item().s_voidp = stringlist; @@ -1297,7 +1297,7 @@ void marshall_QStrList(Marshall *m) { } case Marshall::ToVALUE: { - TTQStrList *stringlist = static_cast<TTQStrList *>(m->item().s_voidp); + TQStrList *stringlist = static_cast<TQStrList *>(m->item().s_voidp); if(!stringlist) { *(m->var()) = Qnil; break; @@ -1422,7 +1422,7 @@ void marshall_QValueListInt(Marshall *m) { break; } int count = RARRAY(list)->len; - TTQValueList<int> *valuelist = new TTQValueList<int>; + TQValueList<int> *valuelist = new TQValueList<int>; long i; for(i = 0; i < count; i++) { VALUE item = rb_ary_entry(list, i); @@ -1438,7 +1438,7 @@ void marshall_QValueListInt(Marshall *m) { if (!m->type().isConst()) { rb_ary_clear(list); - for(TTQValueListIterator<int> it = valuelist->begin(); + for(TQValueListIterator<int> it = valuelist->begin(); it != valuelist->end(); ++it) rb_ary_push(list, INT2NUM((int)*it)); @@ -1451,7 +1451,7 @@ void marshall_QValueListInt(Marshall *m) { break; case Marshall::ToVALUE: { - TTQValueList<int> *valuelist = (TTQValueList<int>*)m->item().s_voidp; + TQValueList<int> *valuelist = (TQValueList<int>*)m->item().s_voidp; if(!valuelist) { *(m->var()) = Qnil; break; @@ -1459,7 +1459,7 @@ void marshall_QValueListInt(Marshall *m) { VALUE av = rb_ary_new(); - for(TTQValueListIterator<int> it = valuelist->begin(); + for(TQValueListIterator<int> it = valuelist->begin(); it != valuelist->end(); ++it) rb_ary_push(av, INT2NUM(*it)); @@ -1508,7 +1508,7 @@ void marshall_QMapTQStringTQString(Marshall *m) { break; } - TTQMap<TTQString,TTQString> * map = new TTQMap<TTQString,TTQString>; + TQMap<TQString,TQString> * map = new TQMap<TQString,TQString>; // Convert the ruby hash to an array of key/value arrays VALUE temp = rb_funcall(hash, rb_intern("to_a"), 0); @@ -1516,7 +1516,7 @@ void marshall_QMapTQStringTQString(Marshall *m) { for (long i = 0; i < RARRAY(temp)->len; i++) { VALUE key = rb_ary_entry(rb_ary_entry(temp, i), 0); VALUE value = rb_ary_entry(rb_ary_entry(temp, i), 1); - (*map)[TTQString(StringValuePtr(key))] = TTQString(StringValuePtr(value)); + (*map)[TQString(StringValuePtr(key))] = TQString(StringValuePtr(value)); } m->item().s_voidp = map; @@ -1528,7 +1528,7 @@ void marshall_QMapTQStringTQString(Marshall *m) { break; case Marshall::ToVALUE: { - TTQMap<TTQString,TTQString> *map = (TTQMap<TTQString,TTQString>*)m->item().s_voidp; + TQMap<TQString,TQString> *map = (TQMap<TQString,TQString>*)m->item().s_voidp; if(!map) { *(m->var()) = Qnil; break; @@ -1536,9 +1536,9 @@ void marshall_QMapTQStringTQString(Marshall *m) { VALUE hv = rb_hash_new(); - TTQMap<TTQString,TTQString>::Iterator it; + TQMap<TQString,TQString>::Iterator it; for (it = map->begin(); it != map->end(); ++it) { - rb_hash_aset(hv, rstringFromTQString((TTQString*)&(it.key())), rstringFromTQString((TTQString*) &(it.data()))); + rb_hash_aset(hv, rstringFromTQString((TQString*)&(it.key())), rstringFromTQString((TQString*) &(it.data()))); } *(m->var()) = hv; @@ -1564,7 +1564,7 @@ void marshall_QMapTQStringTQVariant(Marshall *m) { break; } - TTQMap<TTQString,TTQVariant> * map = new TTQMap<TTQString,TTQVariant>; + TQMap<TQString,TQVariant> * map = new TQMap<TQString,TQVariant>; // Convert the ruby hash to an array of key/value arrays VALUE temp = rb_funcall(hash, rb_intern("to_a"), 0); @@ -1574,7 +1574,7 @@ void marshall_QMapTQStringTQVariant(Marshall *m) { VALUE value = rb_ary_entry(rb_ary_entry(temp, i), 1); smokeruby_object *o = value_obj_info(value); - if (!o || !o->ptr || o->classId != o->smoke->idClass("TTQVariant")) { + if (!o || !o->ptr || o->classId != o->smoke->idClass("TQVariant")) { // If the value isn't a TQt::Variant, then try and construct // a TQt::Variant from it value = rb_funcall(qvariant_class, rb_intern("new"), 1, value); @@ -1585,9 +1585,9 @@ void marshall_QMapTQStringTQVariant(Marshall *m) { } void * ptr = o->ptr; - ptr = o->smoke->cast(ptr, o->classId, o->smoke->idClass("TTQVariant")); + ptr = o->smoke->cast(ptr, o->classId, o->smoke->idClass("TQVariant")); - (*map)[TTQString(StringValuePtr(key))] = (TTQVariant)*(TTQVariant*)ptr; + (*map)[TQString(StringValuePtr(key))] = (TQVariant)*(TQVariant*)ptr; } m->item().s_voidp = map; @@ -1599,7 +1599,7 @@ void marshall_QMapTQStringTQVariant(Marshall *m) { break; case Marshall::ToVALUE: { - TTQMap<TTQString,TTQVariant> *map = (TTQMap<TTQString,TTQVariant>*)m->item().s_voidp; + TQMap<TQString,TQVariant> *map = (TQMap<TQString,TQVariant>*)m->item().s_voidp; if(!map) { *(m->var()) = Qnil; break; @@ -1607,21 +1607,21 @@ void marshall_QMapTQStringTQVariant(Marshall *m) { VALUE hv = rb_hash_new(); - TTQMap<TTQString,TTQVariant>::Iterator it; + TQMap<TQString,TQVariant>::Iterator it; for (it = map->begin(); it != map->end(); ++it) { - void *p = new TTQVariant(it.data()); + void *p = new TQVariant(it.data()); VALUE obj = getPointerObject(p); if (obj == Qnil) { smokeruby_object * o = ALLOC(smokeruby_object); - o->classId = m->smoke()->idClass("TTQVariant"); + o->classId = m->smoke()->idClass("TQVariant"); o->smoke = m->smoke(); o->ptr = p; o->allocated = true; obj = set_obj_info("TQt::Variant", o); } - rb_hash_aset(hv, rstringFromTQString((TTQString*)&(it.key())), obj); + rb_hash_aset(hv, rstringFromTQString((TQString*)&(it.key())), obj); } *(m->var()) = hv; @@ -1749,16 +1749,16 @@ void marshall_QPairintint(Marshall *m) { #include <tqtabbar.h> #if QT_VERSION >= 0x030200 -DEF_LIST_MARSHALLER( TQPtrListTQNetworkOperation, TTQPtrList<TTQNetworkOperation>, TTQNetworkOperation, TTQPtrListStdIterator<TTQNetworkOperation> ) -DEF_LIST_MARSHALLER( TQPtrListTQToolBar, TTQPtrList<TTQToolBar>, TTQToolBar, TTQPtrListStdIterator<TTQToolBar> ) -DEF_LIST_MARSHALLER( TQPtrListTQTab, TTQPtrList<TTQTab>, TTQTab, TTQPtrListStdIterator<TTQTab> ) -DEF_LIST_MARSHALLER( TQPtrListTQDockWindow, TTQPtrList<TTQDockWindow>, TTQDockWindow, TTQPtrListStdIterator<TTQDockWindow> ) -DEF_LIST_MARSHALLER( TQFileInfoList, TQFileInfoList, TTQFileInfo, TQFileInfoList::Iterator ) -DEF_LIST_MARSHALLER( TTQObjectList, TTQObjectList, TTQObject, TTQPtrListStdIterator<TTQObject> ) -DEF_LIST_MARSHALLER( TTQWidgetList, TTQWidgetList, TTQWidget, TTQPtrListStdIterator<TTQWidget> ) +DEF_LIST_MARSHALLER( TQPtrListTQNetworkOperation, TQPtrList<TQNetworkOperation>, TQNetworkOperation, TQPtrListStdIterator<TQNetworkOperation> ) +DEF_LIST_MARSHALLER( TQPtrListTQToolBar, TQPtrList<TQToolBar>, TQToolBar, TQPtrListStdIterator<TQToolBar> ) +DEF_LIST_MARSHALLER( TQPtrListTQTab, TQPtrList<TQTab>, TQTab, TQPtrListStdIterator<TQTab> ) +DEF_LIST_MARSHALLER( TQPtrListTQDockWindow, TQPtrList<TQDockWindow>, TQDockWindow, TQPtrListStdIterator<TQDockWindow> ) +DEF_LIST_MARSHALLER( TQFileInfoList, TQFileInfoList, TQFileInfo, TQFileInfoList::Iterator ) +DEF_LIST_MARSHALLER( TQObjectList, TQObjectList, TQObject, TQPtrListStdIterator<TQObject> ) +DEF_LIST_MARSHALLER( TQWidgetList, TQWidgetList, TQWidget, TQPtrListStdIterator<TQWidget> ) #endif -DEF_LIST_MARSHALLER( TTQCanvasItemList, TTQCanvasItemList, TTQCanvasItem, TTQValueListIterator<TTQCanvasItem*> ) +DEF_LIST_MARSHALLER( TQCanvasItemList, TQCanvasItemList, TQCanvasItem, TQValueListIterator<TQCanvasItem*> ) template <class Item, class ItemList, class ItemListIterator, const char *ItemSTR > void marshall_ValueItemList(Marshall *m) { @@ -1778,9 +1778,9 @@ void marshall_ValueItemList(Marshall *m) { // TODO do type checking! smokeruby_object *o = value_obj_info(item); - // Special case for the TTQValueList<TTQVariant> type - if ( qstrcmp(ItemSTR, "TTQVariant") == 0 - && (!o || !o->ptr || o->classId != o->smoke->idClass("TTQVariant")) ) + // Special case for the TQValueList<TQVariant> type + if ( qstrcmp(ItemSTR, "TQVariant") == 0 + && (!o || !o->ptr || o->classId != o->smoke->idClass("TQVariant")) ) { // If the value isn't a TQt::Variant, then try and construct // a TQt::Variant from it @@ -1871,27 +1871,27 @@ void marshall_ValueItemList(Marshall *m) { #define DEF_VALUELIST_MARSHALLER(ListIdent,ItemList,Item,Itr) namespace dummy { char ListIdent##STR[] = #Item; }; \ Marshall::HandlerFn marshall_##ListIdent = marshall_ValueItemList<Item,ItemList,Itr,dummy::ListIdent##STR>; -DEF_VALUELIST_MARSHALLER( TQVariantList, TTQValueList<TTQVariant>, TTQVariant, TTQValueList<TTQVariant>::Iterator ) -DEF_VALUELIST_MARSHALLER( TQPixmapList, TTQValueList<TTQPixmap>, TTQPixmap, TTQValueList<TTQPixmap>::Iterator ) -DEF_VALUELIST_MARSHALLER( TQIconDragItemList, TTQValueList<TTQIconDragItem>, TTQIconDragItem, TTQValueList<TTQIconDragItem>::Iterator ) -DEF_VALUELIST_MARSHALLER( TQImageTextKeyLangList, TTQValueList<TTQImageTextKeyLang>, TTQImageTextKeyLang, TTQValueList<TTQImageTextKeyLang>::Iterator ) -DEF_VALUELIST_MARSHALLER( TQUrlInfoList, TTQValueList<TTQUrlInfo>, TTQUrlInfo, TTQValueList<TTQUrlInfo>::Iterator ) -DEF_VALUELIST_MARSHALLER( TQTranslatorMessageList, TTQValueList<TQTranslatorMessage>, TQTranslatorMessage, TTQValueList<TQTranslatorMessage>::Iterator ) -DEF_VALUELIST_MARSHALLER( TQHostAddressList, TTQValueList<TTQHostAddress>, TTQHostAddress, TTQValueList<TTQHostAddress>::Iterator ) +DEF_VALUELIST_MARSHALLER( TQVariantList, TQValueList<TQVariant>, TQVariant, TQValueList<TQVariant>::Iterator ) +DEF_VALUELIST_MARSHALLER( TQPixmapList, TQValueList<TQPixmap>, TQPixmap, TQValueList<TQPixmap>::Iterator ) +DEF_VALUELIST_MARSHALLER( TQIconDragItemList, TQValueList<TQIconDragItem>, TQIconDragItem, TQValueList<TQIconDragItem>::Iterator ) +DEF_VALUELIST_MARSHALLER( TQImageTextKeyLangList, TQValueList<TQImageTextKeyLang>, TQImageTextKeyLang, TQValueList<TQImageTextKeyLang>::Iterator ) +DEF_VALUELIST_MARSHALLER( TQUrlInfoList, TQValueList<TQUrlInfo>, TQUrlInfo, TQValueList<TQUrlInfo>::Iterator ) +DEF_VALUELIST_MARSHALLER( TQTranslatorMessageList, TQValueList<TQTranslatorMessage>, TQTranslatorMessage, TQValueList<TQTranslatorMessage>::Iterator ) +DEF_VALUELIST_MARSHALLER( TQHostAddressList, TQValueList<TQHostAddress>, TQHostAddress, TQValueList<TQHostAddress>::Iterator ) TypeHandler Qt_handlers[] = { - { "TTQString", marshall_QString }, - { "TTQString&", marshall_QString }, - { "TTQString*", marshall_QString }, - { "TTQCString", marshall_QCString }, - { "TTQCString&", marshall_QCString }, - { "TTQCString*", marshall_QCString }, - { "TTQStringList", marshall_QStringList }, - { "TTQStringList&", marshall_QStringList }, - { "TTQStringList*", marshall_QStringList }, - { "TTQStrList", marshall_QStrList }, - { "TTQStrList&", marshall_QStrList }, - { "TTQStrList*", marshall_QStrList }, + { "TQString", marshall_QString }, + { "TQString&", marshall_QString }, + { "TQString*", marshall_QString }, + { "TQCString", marshall_QCString }, + { "TQCString&", marshall_QCString }, + { "TQCString*", marshall_QCString }, + { "TQStringList", marshall_QStringList }, + { "TQStringList&", marshall_QStringList }, + { "TQStringList*", marshall_QStringList }, + { "TQStrList", marshall_QStrList }, + { "TQStrList&", marshall_QStrList }, + { "TQStrList*", marshall_QStrList }, { "long long int", marshall_longlong }, { "long long int&", marshall_longlong }, { "Q_INT64", marshall_longlong }, @@ -1919,39 +1919,39 @@ TypeHandler Qt_handlers[] = { { "TQUObject*", marshall_QUObject }, { "const TQCOORD*", marshall_QCOORD_array }, { "void", marshall_void }, - { "TTQValueList<int>", marshall_QValueListInt }, - { "TTQValueList<int>&", marshall_QValueListInt }, - { "TTQValueList<TTQVariant>", marshall_QVariantList }, - { "TTQValueList<TTQVariant>&", marshall_QVariantList }, - { "TTQValueList<TTQPixmap>", marshall_QPixmapList }, - { "TTQValueList<TTQIconDragItem>&", marshall_QIconDragItemList }, - { "TTQValueList<TTQImageTextKeyLang>", marshall_QImageTextKeyLangList }, - { "TTQValueList<TTQUrlInfo>&", marshall_QUrlInfoList }, - { "TTQValueList<TQTranslatorMessage>", marshall_QTranslatorMessageList }, - { "TTQValueList<TTQHostAddress>", marshall_QHostAddressList }, - { "TTQCanvasItemList", marshall_TTQCanvasItemList }, - { "TTQMap<TTQString,TTQString>", marshall_QMapTQStringTQString }, - { "TTQMap<TTQString,TTQString>&", marshall_QMapTQStringTQString }, - { "TTQMap<TTQString,TTQVariant>", marshall_QMapTQStringTQVariant }, - { "TTQMap<TTQString,TTQVariant>&", marshall_QMapTQStringTQVariant }, + { "TQValueList<int>", marshall_QValueListInt }, + { "TQValueList<int>&", marshall_QValueListInt }, + { "TQValueList<TQVariant>", marshall_QVariantList }, + { "TQValueList<TQVariant>&", marshall_QVariantList }, + { "TQValueList<TQPixmap>", marshall_QPixmapList }, + { "TQValueList<TQIconDragItem>&", marshall_QIconDragItemList }, + { "TQValueList<TQImageTextKeyLang>", marshall_QImageTextKeyLangList }, + { "TQValueList<TQUrlInfo>&", marshall_QUrlInfoList }, + { "TQValueList<TQTranslatorMessage>", marshall_QTranslatorMessageList }, + { "TQValueList<TQHostAddress>", marshall_QHostAddressList }, + { "TQCanvasItemList", marshall_TQCanvasItemList }, + { "TQMap<TQString,TQString>", marshall_QMapTQStringTQString }, + { "TQMap<TQString,TQString>&", marshall_QMapTQStringTQString }, + { "TQMap<TQString,TQVariant>", marshall_QMapTQStringTQVariant }, + { "TQMap<TQString,TQVariant>&", marshall_QMapTQStringTQVariant }, #if QT_VERSION >= 0x030200 - { "TTQWidgetList", marshall_TTQWidgetList }, - { "TTQWidgetList*", marshall_TTQWidgetList }, - { "TTQWidgetList&", marshall_TTQWidgetList }, - { "TTQObjectList*", marshall_TTQObjectList }, - { "TTQObjectList&", marshall_TTQObjectList }, + { "TQWidgetList", marshall_TQWidgetList }, + { "TQWidgetList*", marshall_TQWidgetList }, + { "TQWidgetList&", marshall_TQWidgetList }, + { "TQObjectList*", marshall_TQObjectList }, + { "TQObjectList&", marshall_TQObjectList }, { "TQFileInfoList*", marshall_QFileInfoList }, - { "TTQPtrList<TTQToolBar>", marshall_QPtrListTQToolBar }, - { "TTQPtrList<TTQTab>*", marshall_QPtrListTQTab }, - { "TTQPtrList<TTQDockWindow>", marshall_QPtrListTQDockWindow }, - { "TTQPtrList<TTQDockWindow>*", marshall_QPtrListTQDockWindow }, - { "TTQPtrList<TTQNetworkOperation>", marshall_QPtrListTQNetworkOperation }, - { "TTQPtrList<TTQNetworkOperation>&", marshall_QPtrListTQNetworkOperation }, + { "TQPtrList<TQToolBar>", marshall_QPtrListTQToolBar }, + { "TQPtrList<TQTab>*", marshall_QPtrListTQTab }, + { "TQPtrList<TQDockWindow>", marshall_QPtrListTQDockWindow }, + { "TQPtrList<TQDockWindow>*", marshall_QPtrListTQDockWindow }, + { "TQPtrList<TQNetworkOperation>", marshall_QPtrListTQNetworkOperation }, + { "TQPtrList<TQNetworkOperation>&", marshall_QPtrListTQNetworkOperation }, #endif { 0, 0 } }; -TTQAsciiDict<TypeHandler> type_handlers(199); +TQAsciiDict<TypeHandler> type_handlers(199); void install_handlers(TypeHandler *h) { while(h->name) { diff --git a/qtruby/rubylib/qtruby/smokeruby.h b/qtruby/rubylib/qtruby/smokeruby.h index dcbddf6a..dd3b81bb 100644 --- a/qtruby/rubylib/qtruby/smokeruby.h +++ b/qtruby/rubylib/qtruby/smokeruby.h @@ -288,7 +288,7 @@ public: * Type handling by moc is simple. * * If the type name matches /^(?:const\s+)?\Q$types\E&?$/, use the - * static_QUType, where $types is join('|', qw(bool int double char* TTQString); + * static_QUType, where $types is join('|', qw(bool int double char* TQString); * * Everything else is passed as a pointer! There are types which aren't * Smoke::tf_ptr but will have to be passed as a pointer. Make sure to keep |