summaryrefslogtreecommitdiffstats
path: root/dcopjava/dcopidl2java/skel.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'dcopjava/dcopidl2java/skel.cpp')
-rw-r--r--dcopjava/dcopidl2java/skel.cpp92
1 files changed, 46 insertions, 46 deletions
diff --git a/dcopjava/dcopidl2java/skel.cpp b/dcopjava/dcopidl2java/skel.cpp
index 55065dad..68f1b46b 100644
--- a/dcopjava/dcopidl2java/skel.cpp
+++ b/dcopjava/dcopidl2java/skel.cpp
@@ -20,12 +20,12 @@ AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
******************************************************************/
-#include <qdom.h>
-#include <qfile.h>
-#include <qtextstream.h>
-#include <qstring.h>
-#include <qvaluelist.h>
-#include <qstringlist.h>
+#include <tqdom.h>
+#include <tqfile.h>
+#include <tqtextstream.h>
+#include <tqstring.h>
+#include <tqvaluelist.h>
+#include <tqstringlist.h>
#include <string.h>
#include <stdlib.h>
@@ -52,23 +52,23 @@ static int const primes[] =
struct Function
{
Function(){};
- Function( const QString& t, const QString& n, const QString&fn ) : type( t ), name( n ), fullName( fn ){}
- QString type;
- QString name;
- QString fullName;
+ Function( const TQString& t, const TQString& n, const TQString&fn ) : type( t ), name( n ), fullName( fn ){}
+ TQString type;
+ TQString name;
+ TQString fullName;
};
/**
* Writes the skeleton
*/
-void generateSkel( const QString& idl, const QString& filename, QDomElement de )
+void generateSkel( const TQString& idl, const TQString& filename, TQDomElement de )
{
- QFile skel( filename );
+ TQFile skel( filename );
if ( !skel.open( IO_WriteOnly ) )
qFatal("Could not write to %s", filename.latin1() );
- QTextStream str( &skel );
+ TQTextStream str( &skel );
str << "/****************************************************************************" << endl;
str << "**" << endl;
@@ -79,41 +79,41 @@ void generateSkel( const QString& idl, const QString& filename, QDomElement de )
str << "*****************************************************************************/" << endl;
str << endl;
- QDomElement e = de.firstChild().toElement();
+ TQDomElement e = de.firstChild().toElement();
if ( e.tagName() == "SOURCE" ) {
str << "#include \"" << e.firstChild().toText().data() << "\"" << endl << endl;
}
for( ; !e.isNull(); e = e.nextSibling().toElement() ) {
if ( e.tagName() == "CLASS" ) {
- QDomElement n = e.firstChild().toElement();
+ TQDomElement n = e.firstChild().toElement();
ASSERT( n.tagName() == "NAME" );
- QString className = n.firstChild().toText().data();
+ TQString className = n.firstChild().toText().data();
// find dcop parent ( rightmost super class )
- QString DCOPParent;
- QDomElement s = n.nextSibling().toElement();
+ TQString DCOPParent;
+ TQDomElement s = n.nextSibling().toElement();
for( ; !s.isNull(); s = s.nextSibling().toElement() ) {
if ( s.tagName() == "SUPER" )
DCOPParent = s.firstChild().toText().data();
}
// get function table
- QValueList<Function> functions;
+ TQValueList<Function> functions;
s = n.nextSibling().toElement();
for( ; !s.isNull(); s = s.nextSibling().toElement() ) {
if ( s.tagName() == "FUNC" ) {
- QDomElement r = s.firstChild().toElement();
+ TQDomElement r = s.firstChild().toElement();
ASSERT( r.tagName() == "TYPE" );
- QString funcType = r.firstChild().toText().data();
+ TQString funcType = r.firstChild().toText().data();
r = r.nextSibling().toElement();
ASSERT ( r.tagName() == "NAME" );
- QString funcName = r.firstChild().toText().data();
- QStringList argtypes;
- QStringList argnames;
+ TQString funcName = r.firstChild().toText().data();
+ TQStringList argtypes;
+ TQStringList argnames;
r = r.nextSibling().toElement();
for( ; !r.isNull(); r = r.nextSibling().toElement() ) {
ASSERT( r.tagName() == "ARG" );
- QDomElement a = r.firstChild().toElement();
+ TQDomElement a = r.firstChild().toElement();
ASSERT( a.tagName() == "TYPE" );
argtypes.append( a.firstChild().toText().data() );
a = a.nextSibling().toElement();
@@ -121,14 +121,14 @@ void generateSkel( const QString& idl, const QString& filename, QDomElement de )
ASSERT( a.tagName() == "NAME" );
argnames.append( a.firstChild().toText().data() );
} else {
- argnames.append( QString::null );
+ argnames.append( TQString::null );
}
}
funcName += '(';
- QString fullFuncName = funcName;
+ TQString fullFuncName = funcName;
bool first = TRUE;
- QStringList::Iterator ittype = argtypes.begin();
- QStringList::Iterator itname = argnames.begin();
+ TQStringList::Iterator ittype = argtypes.begin();
+ TQStringList::Iterator itname = argnames.begin();
while ( ittype != argtypes.end() && itname != argnames.end() ) {
if ( !first ) {
funcName += ',';
@@ -164,11 +164,11 @@ void generateSkel( const QString& idl, const QString& filename, QDomElement de )
bool useHashing = functions.count() > 7;
if ( useHashing ) {
- str << "#include <qasciidict.h>" << endl;
+ str << "#include <tqasciidict.h>" << endl;
str << "static const int " << className << "_fhash = " << fhash << ";" << endl;
}
str << "static const char* const " << className << "_ftable[" << functions.count() + 1 << "][3] = {" << endl;
- for( QValueList<Function>::Iterator it = functions.begin(); it != functions.end(); ++it ){
+ for( TQValueList<Function>::Iterator it = functions.begin(); it != functions.end(); ++it ){
str << " { \"" << (*it).type << "\", \"" << (*it).name << "\", \"" << (*it).fullName << "\" }," << endl;
}
str << " { 0, 0, 0 }" << endl;
@@ -179,13 +179,13 @@ void generateSkel( const QString& idl, const QString& filename, QDomElement de )
// Write dispatcher
str << "bool " << className;
- str << "::process(const QCString &fun, const QByteArray &data, QCString& replyType, QByteArray &replyData)" << endl;
+ str << "::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)" << endl;
str << "{" << endl;
if ( useHashing ) {
- str << " static QAsciiDict<int>* fdict = 0;" << endl;
+ str << " static TQAsciiDict<int>* fdict = 0;" << endl;
str << " if ( !fdict ) {" << endl;
- str << "\tfdict = new QAsciiDict<int>( " << className << "_fhash, TRUE, FALSE );" << endl;
+ str << "\tfdict = new TQAsciiDict<int>( " << className << "_fhash, TRUE, FALSE );" << endl;
str << "\tfor ( int i = 0; " << className << "_ftable[i][1]; i++ )" << endl;
str << "\t fdict->insert( " << className << "_ftable[i][1], new int( i ) );" << endl;
str << " }" << endl;
@@ -198,28 +198,28 @@ void generateSkel( const QString& idl, const QString& filename, QDomElement de )
bool firstFunc = TRUE;
for( ; !s.isNull(); s = s.nextSibling().toElement() ) {
if ( s.tagName() == "FUNC" ) {
- QDomElement r = s.firstChild().toElement();
+ TQDomElement r = s.firstChild().toElement();
ASSERT( r.tagName() == "TYPE" );
- QString funcType = r.firstChild().toText().data();
+ TQString funcType = r.firstChild().toText().data();
if ( funcType == "ASYNC" )
funcType = "void";
r = r.nextSibling().toElement();
ASSERT ( r.tagName() == "NAME" );
- QString funcName = r.firstChild().toText().data();
- QStringList args;
- QStringList argtypes;
+ TQString funcName = r.firstChild().toText().data();
+ TQStringList args;
+ TQStringList argtypes;
r = r.nextSibling().toElement();
for( ; !r.isNull(); r = r.nextSibling().toElement() ) {
ASSERT( r.tagName() == "ARG" );
- QDomElement a = r.firstChild().toElement();
+ TQDomElement a = r.firstChild().toElement();
ASSERT( a.tagName() == "TYPE" );
argtypes.append( a.firstChild().toText().data() );
- args.append( QString("arg" ) + QString::number( args.count() ) );
+ args.append( TQString("arg" ) + TQString::number( args.count() ) );
}
- QString plainFuncName = funcName;
+ TQString plainFuncName = funcName;
funcName += '(';
bool first = TRUE;
- for( QStringList::Iterator argtypes_count = argtypes.begin(); argtypes_count != argtypes.end(); ++argtypes_count ){
+ for( TQStringList::Iterator argtypes_count = argtypes.begin(); argtypes_count != argtypes.end(); ++argtypes_count ){
if ( !first )
funcName += ',';
first = FALSE;
@@ -237,8 +237,8 @@ void generateSkel( const QString& idl, const QString& filename, QDomElement de )
firstFunc = FALSE;
}
if ( !args.isEmpty() ) {
- QStringList::Iterator ittypes = argtypes.begin();
- QStringList::Iterator args_count;
+ TQStringList::Iterator ittypes = argtypes.begin();
+ TQStringList::Iterator args_count;
for( args_count = args.begin(); args_count != args.end(); ++args_count ){
str << '\t'<< *ittypes << " " << *args_count << ";" << endl;
++ittypes;
@@ -258,7 +258,7 @@ void generateSkel( const QString& idl, const QString& filename, QDomElement de )
}
first = TRUE;
- for ( QStringList::Iterator args_count = args.begin(); args_count != args.end(); ++args_count ){
+ for ( TQStringList::Iterator args_count = args.begin(); args_count != args.end(); ++args_count ){
if ( !first )
str << ", ";
first = FALSE;