TQt port tqt3integration

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1259732 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 337f18fe5d
commit a9cfcd75da

@ -23,26 +23,26 @@
#include <assert.h> #include <assert.h>
#include <dcopclient.h> #include <dcopclient.h>
#include <dcoptypes.h> #include <dcoptypes.h>
#include <qapplication.h> #include <tqapplication.h>
#include <qregexp.h> #include <tqregexp.h>
#include <qstringlist.h> #include <tqstringlist.h>
#include <qwidget.h> #include <tqwidget.h>
#include <unistd.h> #include <unistd.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
extern Time qt_x_time; extern Time qt_x_time;
static QString convertFileFilter( const QString& filter ) static TQString convertFileFilter( const TQString& filter )
{ {
if( filter.isEmpty()) if( filter.isEmpty())
return filter; return filter;
QString f2 = filter; TQString f2 = filter;
f2.replace( '\n', ";;" ); // Qt says separator is ";;", but it also silently accepts newline f2.replace( '\n', ";;" ); // TQt says separator is ";;", but it also silently accepts newline
f2.replace( '/', "\\/" ); // escape /'s for KFileDialog f2.replace( '/', "\\/" ); // escape /'s for KFileDialog
QStringList items = QStringList::split( ";;", f2 ); TQStringList items = TQStringList::split( ";;", f2 );
QRegExp reg( "\\((.*)\\)" ); TQRegExp reg( "\\((.*)\\)" );
for( QStringList::Iterator it = items.begin(); for( TQStringList::Iterator it = items.begin();
it != items.end(); it != items.end();
++it ) ++it )
{ {
@ -52,12 +52,12 @@ static QString convertFileFilter( const QString& filter )
return items.join( "\n" ); return items.join( "\n" );
} }
static QString convertBackFileFilter( const QString& filter ) static TQString convertBackFileFilter( const TQString& filter )
{ {
if( filter.isEmpty()) if( filter.isEmpty())
return filter; return filter;
QStringList items = QStringList::split( "\n", filter ); TQStringList items = TQStringList::split( "\n", filter );
for( QStringList::Iterator it = items.begin(); for( TQStringList::Iterator it = items.begin();
it != items.end(); it != items.end();
++it ) ++it )
{ {
@ -84,13 +84,13 @@ static DCOPClient* dcopClient()
static bool prepared = false; static bool prepared = false;
if( !prepared ) if( !prepared )
{ {
assert( qApp != NULL ); // TODO assert( tqApp != NULL ); // TODO
prepared = true; prepared = true;
dcop->bindToApp(); dcop->bindToApp();
if( !qApp->inherits( "KApplication" )) // KApp takes care of input blocking if( !tqApp->inherits( "KApplication" )) // KApp takes care of input blocking
{ {
static qtkde_EventLoop* loop = new qtkde_EventLoop; static qtkde_EventLoop* loop = new qtkde_EventLoop;
QObject::connect( dcop, SIGNAL( blockUserInput( bool )), loop, SLOT( block( bool ))); TQObject::connect( dcop, TQT_SIGNAL( blockUserInput( bool )), loop, TQT_SLOT( block( bool )));
} }
} }
return dcop; return dcop;
@ -131,7 +131,7 @@ void qtkde_EventLoop::block( bool b )
} }
// duped in kded module // duped in kded module
static QString getHostname() static TQString getHostname()
{ {
char hostname[ 256 ]; char hostname[ 256 ];
if( gethostname( hostname, 255 ) == 0 ) if( gethostname( hostname, 255 ) == 0 )
@ -142,6 +142,6 @@ static QString getHostname()
return ""; return "";
} }
#include "qtkde_functions.cpp" #include "tqtkde_functions.cpp"
#include "qtkde.moc" #include "qtkde.moc"

@ -18,15 +18,16 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifndef _QTKDE_H #ifndef _TQTKDE_H
#define _QTKDE_H #define _TQTKDE_H
#include <qobject.h> #include <tqobject.h>
class qtkde_EventLoop class qtkde_EventLoop
: public QObject : public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public slots: public slots:
void block( bool ); void block( bool );
}; };

@ -29,7 +29,7 @@
#include <klocale.h> #include <klocale.h>
#include <krecentdocument.h> #include <krecentdocument.h>
#include <kwin.h> #include <kwin.h>
#include <qtimer.h> #include <tqtimer.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
#include <kmessagebox.h> #include <kmessagebox.h>
@ -38,7 +38,7 @@
extern "C" extern "C"
{ {
KDE_EXPORT KDEDModule *create_kdeintegration( const QCString& obj ) KDE_EXPORT KDEDModule *create_kdeintegration( const TQCString& obj )
{ {
return new KDEIntegration::Module( obj ); return new KDEIntegration::Module( obj );
} }
@ -47,7 +47,7 @@ extern "C"
namespace KDEIntegration namespace KDEIntegration
{ {
static void prepareDialog( QWidget* w, long parent, const QCString& wmclass1, const QCString& wmclass2 ) static void prepareDialog( TQWidget* w, long parent, const TQCString& wmclass1, const TQCString& wmclass2 )
{ {
XClassHint hints; XClassHint hints;
hints.res_name = ( char* ) ( const char* ) wmclass1; hints.res_name = ( char* ) ( const char* ) wmclass1;
@ -57,12 +57,12 @@ static void prepareDialog( QWidget* w, long parent, const QCString& wmclass1, co
KWin::setState( w->winId(), NET::Modal ); KWin::setState( w->winId(), NET::Modal );
KWin::WindowInfo info = KWin::windowInfo( parent, (unsigned long)NET::WMGeometry ); KWin::WindowInfo info = KWin::windowInfo( parent, (unsigned long)NET::WMGeometry );
if( info.valid()) if( info.valid())
w->move( info.geometry().x() + ( info.geometry().width() - w->width())/2, w->move( info.tqgeometry().x() + ( info.tqgeometry().width() - w->width())/2,
info.geometry().y() + ( info.geometry().height()- w->height())/2 ); info.tqgeometry().y() + ( info.tqgeometry().height()- w->height())/2 );
} }
// duped in qtkde // duped in qtkde
static QString getHostname() static TQString getHostname()
{ {
char hostname[ 256 ]; char hostname[ 256 ];
if( gethostname( hostname, 255 ) == 0 ) if( gethostname( hostname, 255 ) == 0 )
@ -73,7 +73,7 @@ static QString getHostname()
return ""; return "";
} }
bool Module::initializeIntegration( const QString& hostname ) bool Module::initializeIntegration( const TQString& hostname )
{ {
if( hostname != getHostname()) if( hostname != getHostname())
return false; return false;
@ -83,9 +83,9 @@ bool Module::initializeIntegration( const QString& hostname )
return true; return true;
} }
void* Module::getOpenFileNames( const QString& filter, QString workingDirectory, long parent, void* Module::getOpenFileNames( const TQString& filter, TQString workingDirectory, long parent,
const QCString& name, const QString& caption, QString /*selectedFilter*/, bool multiple, const TQCString& name, const TQString& caption, TQString /*selectedFilter*/, bool multiple,
const QCString& wmclass1, const QCString& wmclass2 ) const TQCString& wmclass1, const TQCString& wmclass2 )
{ {
KFileDialog* dlg = new KFileDialog( workingDirectory, filter, 0, name.isEmpty() ? "filedialog" : name, false); KFileDialog* dlg = new KFileDialog( workingDirectory, filter, 0, name.isEmpty() ? "filedialog" : name, false);
prepareDialog( dlg, parent, wmclass1, wmclass2 ); prepareDialog( dlg, parent, wmclass1, wmclass2 );
@ -93,50 +93,50 @@ void* Module::getOpenFileNames( const QString& filter, QString workingDirectory,
dlg->setMode(( multiple ? KFile::Files : KFile::File ) | KFile::LocalOnly ); dlg->setMode(( multiple ? KFile::Files : KFile::File ) | KFile::LocalOnly );
dlg->setPlainCaption( caption.isNull() ? i18n("Open") : caption ); dlg->setPlainCaption( caption.isNull() ? i18n("Open") : caption );
// TODO dlg->ops->clearHistory(); // TODO dlg->ops->clearHistory();
connect( dlg, SIGNAL( dialogDone( int )), SLOT( dialogDone( int ))); connect( dlg, TQT_SIGNAL( dialogDone( int )), TQT_SLOT( dialogDone( int )));
dlg->show(); dlg->show();
return dlg; return dlg;
} }
void* Module::getSaveFileName( const QString& initialSelection, const QString& filter, void* Module::getSaveFileName( const TQString& initialSelection, const TQString& filter,
QString workingDirectory, long parent, const QCString& name, const QString& caption, QString /*selectedFilter*/, TQString workingDirectory, long parent, const TQCString& name, const TQString& caption, TQString /*selectedFilter*/,
const QCString& wmclass1, const QCString& wmclass2 ) const TQCString& wmclass1, const TQCString& wmclass2 )
{ {
QString initial = workingDirectory; TQString initial = workingDirectory;
if( !initialSelection.isEmpty()) if( !initialSelection.isEmpty())
{ {
if( initial.right( 1 ) != QChar( '/' )) if( initial.right( 1 ) != TQChar( '/' ))
initial += '/'; initial += '/';
initial += initialSelection; initial += initialSelection;
} }
bool specialDir = initial.at(0) == ':'; bool specialDir = initial.at(0) == ':';
KFileDialog* dlg = new KFileDialog( specialDir ? initial : QString::null, filter, 0, KFileDialog* dlg = new KFileDialog( specialDir ? initial : TQString(), filter, 0,
name.isEmpty() ? "filedialog" : name, false); name.isEmpty() ? "filedialog" : name, false);
if ( !specialDir ) if ( !specialDir )
dlg->setSelection( initial ); // may also be a filename dlg->setSelection( initial ); // may also be a filename
prepareDialog( dlg, parent, wmclass1, wmclass2 ); prepareDialog( dlg, parent, wmclass1, wmclass2 );
dlg->setOperationMode( KFileDialog::Saving ); dlg->setOperationMode( KFileDialog::Saving );
dlg->setPlainCaption( caption.isNull() ? i18n("Save As") : caption ); dlg->setPlainCaption( caption.isNull() ? i18n("Save As") : caption );
connect( dlg, SIGNAL( dialogDone( int )), SLOT( dialogDone( int ))); connect( dlg, TQT_SIGNAL( dialogDone( int )), TQT_SLOT( dialogDone( int )));
dlg->show(); dlg->show();
return dlg; return dlg;
} }
void* Module::getExistingDirectory( const QString& initialDirectory, long parent, void* Module::getExistingDirectory( const TQString& initialDirectory, long parent,
const QCString& name, const QString& caption, const QCString& wmclass1, const QCString& wmclass2 ) const TQCString& name, const TQString& caption, const TQCString& wmclass1, const TQCString& wmclass2 )
{ {
KDirSelectDialog* dlg = new KDirSelectDialog( initialDirectory, true, 0, KDirSelectDialog* dlg = new KDirSelectDialog( initialDirectory, true, 0,
name.isEmpty() ? name : "kdirselect dialog", false ); name.isEmpty() ? name : "kdirselect dialog", false );
prepareDialog( dlg, parent, wmclass1, wmclass2 ); prepareDialog( dlg, parent, wmclass1, wmclass2 );
dlg->setPlainCaption( caption.isNull() ? i18n( "Select Folder" ) : caption ); dlg->setPlainCaption( caption.isNull() ? i18n( "Select Folder" ) : caption );
connect( dlg, SIGNAL( dialogDone( int )), SLOT( dialogDone( int ))); connect( dlg, TQT_SIGNAL( dialogDone( int )), TQT_SLOT( dialogDone( int )));
dlg->show(); dlg->show();
return dlg; return dlg;
} }
void* Module::getColor( const QColor& color, long parent, const QCString& name, void* Module::getColor( const TQColor& color, long parent, const TQCString& name,
const QCString& wmclass1, const QCString& wmclass2 ) const TQCString& wmclass1, const TQCString& wmclass2 )
{ {
KColorDialog* dlg = new KColorDialog( NULL, name.isEmpty() ? name : "colordialog", true ); KColorDialog* dlg = new KColorDialog( NULL, name.isEmpty() ? name : "colordialog", true );
dlg->setModal( false ); // KColorDialog creates its buttons depending on modality :( dlg->setModal( false ); // KColorDialog creates its buttons depending on modality :(
@ -144,19 +144,19 @@ void* Module::getColor( const QColor& color, long parent, const QCString& name,
dlg->setColor( color ); dlg->setColor( color );
prepareDialog( dlg, parent, wmclass1, wmclass2 ); prepareDialog( dlg, parent, wmclass1, wmclass2 );
dlg->setPlainCaption( i18n( "Select Color" )); dlg->setPlainCaption( i18n( "Select Color" ));
connect( dlg, SIGNAL( dialogDone( int )), SLOT( dialogDone( int ))); connect( dlg, TQT_SIGNAL( dialogDone( int )), TQT_SLOT( dialogDone( int )));
dlg->show(); dlg->show();
return dlg; return dlg;
} }
void* Module::getFont( bool /*ok*/, const QFont& def, long parent, const QCString& name, void* Module::getFont( bool /*ok*/, const TQFont& def, long parent, const TQCString& name,
const QCString& wmclass1, const QCString& wmclass2 ) const TQCString& wmclass1, const TQCString& wmclass2 )
{ {
KFontDialog* dlg = new KFontDialog( NULL, name.isEmpty() ? name : "Font Selector", false, false ); KFontDialog* dlg = new KFontDialog( NULL, name.isEmpty() ? name : "Font Selector", false, false );
dlg->setFont( def, false ); dlg->setFont( def, false );
prepareDialog( dlg, parent, wmclass1, wmclass2 ); prepareDialog( dlg, parent, wmclass1, wmclass2 );
dlg->setPlainCaption( i18n( "Select Font" )); dlg->setPlainCaption( i18n( "Select Font" ));
connect( dlg, SIGNAL( dialogDone( int )), SLOT( dialogDone( int ))); connect( dlg, TQT_SIGNAL( dialogDone( int )), TQT_SLOT( dialogDone( int )));
dlg->show(); dlg->show();
return dlg; return dlg;
} }
@ -168,47 +168,47 @@ struct btns
int buttons[ 3 ]; int buttons[ 3 ];
}; };
} }
static QMap< KDialogBase*, btns > msgbox1_buttons; static TQMap< KDialogBase*, btns > msgbox1_buttons;
void* Module::messageBox1( int type, long parent, const QString& caption, const QString& text, void* Module::messageBox1( int type, long parent, const TQString& caption, const TQString& text,
int button0, int button1, int button2, const QCString& wmclass1, const QCString& wmclass2 ) int button0, int button1, int button2, const TQCString& wmclass1, const TQCString& wmclass2 )
{ {
static const char* const caps[ 4 ] static const char* const caps[ 4 ]
= { I18N_NOOP( "Information" ), I18N_NOOP( "Question" ), I18N_NOOP( "Warning" ), I18N_NOOP( "Error" )}; = { I18N_NOOP( "Information" ), I18N_NOOP( "Question" ), I18N_NOOP( "Warning" ), I18N_NOOP( "Error" )};
int buttons[ 3 ] = { button0 & QMessageBox::ButtonMask, int buttons[ 3 ] = { button0 & TQMessageBox::ButtonMask,
button1 & QMessageBox::ButtonMask, button2 & QMessageBox::ButtonMask }; button1 & TQMessageBox::ButtonMask, button2 & TQMessageBox::ButtonMask };
KGuiItem buttonItems[ 3 ]; KGuiItem buttonItems[ 3 ];
for( int i = 0; for( int i = 0;
i < 3; i < 3;
++i ) ++i )
switch( buttons[ i ] ) switch( buttons[ i ] )
{ {
case QMessageBox::Ok: case TQMessageBox::Ok:
buttonItems[ i ] = KStdGuiItem::ok(); buttonItems[ i ] = KStdGuiItem::ok();
break; break;
case QMessageBox::Cancel: case TQMessageBox::Cancel:
buttonItems[ i ] = KStdGuiItem::cancel(); buttonItems[ i ] = KStdGuiItem::cancel();
break; break;
case QMessageBox::Yes: case TQMessageBox::Yes:
buttonItems[ i ] = KStdGuiItem::yes(); buttonItems[ i ] = KStdGuiItem::yes();
break; break;
case QMessageBox::No: case TQMessageBox::No:
buttonItems[ i ] = KStdGuiItem::no(); buttonItems[ i ] = KStdGuiItem::no();
break; break;
case QMessageBox::Abort: case TQMessageBox::Abort:
buttonItems[ i ] = KGuiItem( i18n( "&Abort" )); buttonItems[ i ] = KGuiItem( i18n( "&Abort" ));
break; break;
case QMessageBox::Retry: case TQMessageBox::Retry:
buttonItems[ i ] = KGuiItem( "&Retry" ); buttonItems[ i ] = KGuiItem( "&Retry" );
break; break;
case QMessageBox::Ignore: case TQMessageBox::Ignore:
buttonItems[ i ] = KGuiItem( "&Ignore" ); buttonItems[ i ] = KGuiItem( "&Ignore" );
break; break;
case QMessageBox::YesAll: case TQMessageBox::YesAll:
buttonItems[ i ] = KStdGuiItem::yes(); buttonItems[ i ] = KStdGuiItem::yes();
buttonItems[ i ].setText( i18n( "Yes to &All" )); buttonItems[ i ].setText( i18n( "Yes to &All" ));
break; break;
case QMessageBox::NoAll: case TQMessageBox::NoAll:
buttonItems[ i ] = KStdGuiItem::no(); buttonItems[ i ] = KStdGuiItem::no();
buttonItems[ i ].setText( i18n( "N&o to All" )); buttonItems[ i ].setText( i18n( "N&o to All" ));
break; break;
@ -216,36 +216,36 @@ void* Module::messageBox1( int type, long parent, const QString& caption, const
break; break;
}; };
KDialogBase::ButtonCode defaultButton = KDialogBase::NoDefault; KDialogBase::ButtonCode defaultButton = KDialogBase::NoDefault;
if( button0 & QMessageBox::Default ) if( button0 & TQMessageBox::Default )
defaultButton = KDialogBase::Yes; defaultButton = KDialogBase::Yes;
else if( button1 & QMessageBox::Default ) else if( button1 & TQMessageBox::Default )
defaultButton = KDialogBase::No; defaultButton = KDialogBase::No;
else if( button2 & QMessageBox::Default ) else if( button2 & TQMessageBox::Default )
defaultButton = KDialogBase::Cancel; defaultButton = KDialogBase::Cancel;
else // TODO KDialogBase's handling of NoDefault has strange focus effects else // TODO KDialogBase's handling of NoDefault has strange focus effects
defaultButton = KDialogBase::Yes; defaultButton = KDialogBase::Yes;
KDialogBase::ButtonCode escapeButton = KDialogBase::Cancel; KDialogBase::ButtonCode escapeButton = KDialogBase::Cancel;
if( button0 & QMessageBox::Escape ) if( button0 & TQMessageBox::Escape )
escapeButton = KDialogBase::Yes; escapeButton = KDialogBase::Yes;
else if( button1 & QMessageBox::Escape ) else if( button1 & TQMessageBox::Escape )
escapeButton = KDialogBase::No; escapeButton = KDialogBase::No;
else if( button2 & QMessageBox::Escape ) else if( button2 & TQMessageBox::Escape )
escapeButton = KDialogBase::Cancel; escapeButton = KDialogBase::Cancel;
KDialogBase *dialog= new KDialogBase( KDialogBase *dialog= new KDialogBase(
caption.isEmpty() ? i18n( caps[ type ] ) : caption, caption.isEmpty() ? i18n( caps[ type ] ) : caption,
KDialogBase::Yes KDialogBase::Yes
| ( buttons[ 1 ] == QMessageBox::NoButton ? 0 : int( KDialogBase::No )) | ( buttons[ 1 ] == TQMessageBox::NoButton ? 0 : int( KDialogBase::No ))
| ( buttons[ 2 ] == QMessageBox::NoButton ? 0 : int( KDialogBase::Cancel )), | ( buttons[ 2 ] == TQMessageBox::NoButton ? 0 : int( KDialogBase::Cancel )),
defaultButton, escapeButton, defaultButton, escapeButton,
NULL, "messageBox2", true, true, NULL, "messageBox2", true, true,
buttonItems[ 0 ], buttonItems[ 1 ],buttonItems[ 2 ] ); buttonItems[ 0 ], buttonItems[ 1 ],buttonItems[ 2 ] );
bool checkboxResult = false; bool checkboxResult = false;
KMessageBox::createKMessageBox(dialog, static_cast< QMessageBox::Icon >( type ), text, QStringList(), KMessageBox::createKMessageBox(dialog, static_cast< TQMessageBox::Icon >( type ), text, TQStringList(),
QString::null, TQString(),
&checkboxResult, KMessageBox::Notify | KMessageBox::NoExec); &checkboxResult, KMessageBox::Notify | KMessageBox::NoExec);
prepareDialog( dialog, parent, wmclass1, wmclass2 ); prepareDialog( dialog, parent, wmclass1, wmclass2 );
dialog->setPlainCaption( caption ); dialog->setPlainCaption( caption );
connect( dialog, SIGNAL( dialogDone( int )), SLOT( dialogDone( int ))); connect( dialog, TQT_SIGNAL( dialogDone( int )), TQT_SLOT( dialogDone( int )));
btns b; btns b;
b.buttons[ 0 ] = buttons[ 0 ]; b.buttons[ 0 ] = buttons[ 0 ];
b.buttons[ 1 ] = buttons[ 1 ]; b.buttons[ 1 ] = buttons[ 1 ];
@ -255,9 +255,9 @@ void* Module::messageBox1( int type, long parent, const QString& caption, const
return dialog; return dialog;
} }
void* Module::messageBox2( int type, long parent, const QString& caption, const QString& text, const QString& button0Text, void* Module::messageBox2( int type, long parent, const TQString& caption, const TQString& text, const TQString& button0Text,
const QString& button1Text, const QString& button2Text, int defaultButton, int escapeButton, const TQString& button1Text, const TQString& button2Text, int defaultButton, int escapeButton,
const QCString& wmclass1, const QCString& wmclass2 ) const TQCString& wmclass1, const TQCString& wmclass2 )
{ {
static KDialogBase::ButtonCode map[ 4 ] static KDialogBase::ButtonCode map[ 4 ]
= { KDialogBase::NoDefault, KDialogBase::Yes, KDialogBase::No, KDialogBase::Cancel }; = { KDialogBase::NoDefault, KDialogBase::Yes, KDialogBase::No, KDialogBase::Cancel };
@ -272,12 +272,12 @@ void* Module::messageBox2( int type, long parent, const QString& caption, const
NULL, "messageBox2", true, true, NULL, "messageBox2", true, true,
button0Text.isEmpty() ? KStdGuiItem::ok() : KGuiItem( button0Text ), button1Text,button2Text); button0Text.isEmpty() ? KStdGuiItem::ok() : KGuiItem( button0Text ), button1Text,button2Text);
bool checkboxResult = false; bool checkboxResult = false;
KMessageBox::createKMessageBox(dialog, static_cast< QMessageBox::Icon >( type ), text, QStringList(), KMessageBox::createKMessageBox(dialog, static_cast< TQMessageBox::Icon >( type ), text, TQStringList(),
QString::null, TQString(),
&checkboxResult, KMessageBox::Notify | KMessageBox::NoExec); &checkboxResult, KMessageBox::Notify | KMessageBox::NoExec);
prepareDialog( dialog, parent, wmclass1, wmclass2 ); prepareDialog( dialog, parent, wmclass1, wmclass2 );
dialog->setPlainCaption( caption ); dialog->setPlainCaption( caption );
connect( dialog, SIGNAL( dialogDone( int )), SLOT( dialogDone( int ))); connect( dialog, TQT_SIGNAL( dialogDone( int )), TQT_SLOT( dialogDone( int )));
dialog->show(); dialog->show();
return dialog; return dialog;
} }
@ -291,7 +291,7 @@ void Module::dialogDone( int result )
case JobData::GetOpenFileNames: case JobData::GetOpenFileNames:
{ {
KFileDialog* dlg = static_cast< KFileDialog* >( handle ); KFileDialog* dlg = static_cast< KFileDialog* >( handle );
post_getOpenFileNames( dlg, result == QDialog::Accepted ? dlg->selectedFiles() : QStringList(), post_getOpenFileNames( dlg, result == TQDialog::Accepted ? dlg->selectedFiles() : TQStringList(),
dlg->baseURL().path(), dlg->currentFilter()); dlg->baseURL().path(), dlg->currentFilter());
dlg->deleteLater(); dlg->deleteLater();
break; break;
@ -299,7 +299,7 @@ void Module::dialogDone( int result )
case JobData::GetSaveFileName: case JobData::GetSaveFileName:
{ {
KFileDialog* dlg = static_cast< KFileDialog* >( handle ); KFileDialog* dlg = static_cast< KFileDialog* >( handle );
QString filename = result == QDialog::Accepted ? dlg->selectedFile() : QString(); TQString filename = result == TQDialog::Accepted ? dlg->selectedFile() : TQString();
if (!filename.isEmpty()) if (!filename.isEmpty())
KRecentDocument::add(filename); KRecentDocument::add(filename);
post_getSaveFileName( dlg, filename, dlg->baseURL().path(), dlg->currentFilter()); post_getSaveFileName( dlg, filename, dlg->baseURL().path(), dlg->currentFilter());
@ -309,21 +309,21 @@ void Module::dialogDone( int result )
case JobData::GetExistingDirectory: case JobData::GetExistingDirectory:
{ {
KDirSelectDialog* dlg = static_cast< KDirSelectDialog* >( handle ); KDirSelectDialog* dlg = static_cast< KDirSelectDialog* >( handle );
post_getExistingDirectory( dlg, result == QDialog::Accepted ? dlg->url().path() : QString()); post_getExistingDirectory( dlg, result == TQDialog::Accepted ? dlg->url().path() : TQString());
dlg->deleteLater(); dlg->deleteLater();
break; break;
} }
case JobData::GetColor: case JobData::GetColor:
{ {
KColorDialog* dlg = static_cast< KColorDialog* >( handle ); KColorDialog* dlg = static_cast< KColorDialog* >( handle );
post_getColor( dlg, result == QDialog::Accepted ? dlg->color() : QColor()); post_getColor( dlg, result == TQDialog::Accepted ? dlg->color() : TQColor());
dlg->deleteLater(); dlg->deleteLater();
break; break;
} }
case JobData::GetFont: case JobData::GetFont:
{ {
KFontDialog* dlg = static_cast< KFontDialog* >( handle ); KFontDialog* dlg = static_cast< KFontDialog* >( handle );
post_getFont( dlg, result == QDialog::Accepted ? dlg->font() : QFont(), result == QDialog::Accepted ); post_getFont( dlg, result == TQDialog::Accepted ? dlg->font() : TQFont(), result == TQDialog::Accepted );
dlg->deleteLater(); dlg->deleteLater();
break; break;
} }
@ -366,7 +366,7 @@ void Module::dialogDone( int result )
} }
} }
Module::Module( const QCString& obj ) Module::Module( const TQCString& obj )
: KDEDModule( obj ) : KDEDModule( obj )
{ {
} }

@ -37,11 +37,12 @@ class Module
: public KDEDModule : public KDEDModule
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
Module( const QCString& obj ); Module( const TQCString& obj );
// DCOP // DCOP
virtual bool process(const QCString &fun, const QByteArray &data, virtual bool process(const TQCString &fun, const TQByteArray &data,
QCString &replyType, QByteArray &replyData); TQCString &replyType, TQByteArray &replyData);
virtual QCStringList functions(); virtual QCStringList functions();
virtual QCStringList interfaces(); virtual QCStringList interfaces();
private slots: private slots:
@ -61,7 +62,7 @@ class Module
MessageBox2 MessageBox2
} type; } type;
}; };
QMap< void*, JobData > jobs; TQMap< void*, JobData > jobs;
#include "module_functions.h" #include "module_functions.h"
}; };
@ -69,9 +70,10 @@ class KFileDialog
: public ::KFileDialog : public ::KFileDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KFileDialog(const QString& startDir, const QString& filter, KFileDialog(const TQString& startDir, const TQString& filter,
QWidget *parent, const char *name, bool modal) TQWidget *parent, const char *name, bool modal)
: ::KFileDialog( startDir, filter, parent, name, modal ) : ::KFileDialog( startDir, filter, parent, name, modal )
{} {}
signals: signals:
@ -85,9 +87,10 @@ class KDirSelectDialog
: public ::KDirSelectDialog : public ::KDirSelectDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KDirSelectDialog(const QString& startDir, bool localOnly, KDirSelectDialog(const TQString& startDir, bool localOnly,
QWidget *parent, const char *name, bool modal) TQWidget *parent, const char *name, bool modal)
: ::KDirSelectDialog( startDir, localOnly, parent, name, modal ) : ::KDirSelectDialog( startDir, localOnly, parent, name, modal )
{} {}
signals: signals:
@ -101,8 +104,9 @@ class KColorDialog
: public ::KColorDialog : public ::KColorDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KColorDialog( QWidget *parent, const char *name, bool modal ) KColorDialog( TQWidget *parent, const char *name, bool modal )
: ::KColorDialog( parent, name, modal ) : ::KColorDialog( parent, name, modal )
{} {}
signals: signals:
@ -115,10 +119,11 @@ class KFontDialog
: public ::KFontDialog : public ::KFontDialog
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KFontDialog( QWidget *parent, const char *name, bool onlyFixed, bool modal, KFontDialog( TQWidget *parent, const char *name, bool onlyFixed, bool modal,
const QStringList &fontlist = QStringList(), bool makeFrame = true, const TQStringList &fontlist = TQStringList(), bool makeFrame = true,
bool diff = false, QButton::ToggleState *sizeIsRelativeState = 0L ) bool diff = false, TQButton::ToggleState *sizeIsRelativeState = 0L )
: ::KFontDialog( parent, name, onlyFixed, modal, fontlist, makeFrame, diff, sizeIsRelativeState ) : ::KFontDialog( parent, name, onlyFixed, modal, fontlist, makeFrame, diff, sizeIsRelativeState )
{} {}
signals: signals:
@ -131,10 +136,11 @@ class KDialogBase
: public ::KDialogBase : public ::KDialogBase
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KDialogBase( const QString &caption, int buttonMask=Yes|No|Cancel, KDialogBase( const TQString &caption, int buttonMask=Yes|No|Cancel,
ButtonCode defaultButton=Yes, ButtonCode escapeButton=Cancel, ButtonCode defaultButton=Yes, ButtonCode escapeButton=Cancel,
QWidget *parent=0, const char *name=0, TQWidget *parent=0, const char *name=0,
bool modal=true, bool separator=false, bool modal=true, bool separator=false,
const KGuiItem &yes = KStdGuiItem::yes(), // i18n("&Yes") const KGuiItem &yes = KStdGuiItem::yes(), // i18n("&Yes")
const KGuiItem &no = KStdGuiItem::no(), // i18n("&No"), const KGuiItem &no = KStdGuiItem::no(), // i18n("&No"),

@ -18,9 +18,9 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#include <qfile.h> #include <tqfile.h>
#include <qstring.h> #include <tqstring.h>
#include <qvaluelist.h> #include <tqvaluelist.h>
#include <stdlib.h> #include <stdlib.h>
// TODO includes, forwards // TODO includes, forwards
@ -36,7 +36,7 @@ FUNCTION <name>
ADD_APPINFO - generate wmclass arguments ADD_APPINFO - generate wmclass arguments
ARG <name> ARG <name>
TYPE <type> TYPE <type>
ORIG_TYPE <type> - for example when the function accepts QWidget*, but WId is really used ORIG_TYPE <type> - for example when the function accepts TQWidget*, but WId is really used
ORIG_CONVERSION <conversion> ORIG_CONVERSION <conversion>
IGNORE IGNORE
NEEDS_DEREF NEEDS_DEREF
@ -44,7 +44,7 @@ FUNCTION <name>
OUT_ARGUMENT OUT_ARGUMENT
CONVERSION <function> CONVERSION <function>
BACK_CONVERSION <function> - for out arguments BACK_CONVERSION <function> - for out arguments
CREATE <function> - doesn't exist in Qt, create in qtkde using function CREATE <function> - doesn't exist in TQt, create in qtkde using function
PARENT - the argument is a parent window to be used for windows PARENT - the argument is a parent window to be used for windows
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
@ -54,38 +54,38 @@ ENDFUNCTION
struct Arg struct Arg
{ {
Arg() : ignore( false ), needs_deref( false ), const_ref( false ), out_argument( false ), parent( false ) {} Arg() : ignore( false ), needs_deref( false ), const_ref( false ), out_argument( false ), parent( false ) {}
QString name; TQString name;
QString type; TQString type;
QString orig_type; TQString orig_type;
QString orig_conversion; TQString orig_conversion;
bool ignore; bool ignore;
bool needs_deref; bool needs_deref;
bool const_ref; bool const_ref;
bool out_argument; bool out_argument;
QString conversion; TQString conversion;
QString back_conversion; TQString back_conversion;
QString create; TQString create;
bool parent; bool parent;
}; };
struct Function struct Function
{ {
Function() : delayed_return( false ), skip_qt( false ), only_qt( false ), add_appinfo( false ) {} Function() : delayed_return( false ), skip_qt( false ), only_qt( false ), add_appinfo( false ) {}
QString name; TQString name;
QString return_type; TQString return_type;
bool delayed_return; bool delayed_return;
bool skip_qt; bool skip_qt;
bool only_qt; bool only_qt;
bool add_appinfo; bool add_appinfo;
QValueList< Arg > args; TQValueList< Arg > args;
void stripNonOutArguments(); void stripNonOutArguments();
void stripCreatedArguments(); void stripCreatedArguments();
}; };
void Function::stripNonOutArguments() void Function::stripNonOutArguments()
{ {
QValueList< Arg > new_args; TQValueList< Arg > new_args;
for( QValueList< Arg >::ConstIterator it = args.begin(); for( TQValueList< Arg >::ConstIterator it = args.begin();
it != args.end(); it != args.end();
++it ) ++it )
{ {
@ -98,8 +98,8 @@ void Function::stripNonOutArguments()
void Function::stripCreatedArguments() void Function::stripCreatedArguments()
{ {
QValueList< Arg > new_args; TQValueList< Arg > new_args;
for( QValueList< Arg >::ConstIterator it = args.begin(); for( TQValueList< Arg >::ConstIterator it = args.begin();
it != args.end(); it != args.end();
++it ) ++it )
{ {
@ -110,11 +110,11 @@ void Function::stripCreatedArguments()
args = new_args; args = new_args;
} }
QValueList< Function > functions; TQValueList< Function > functions;
QFile* input_file = NULL; TQFile* input_file = NULL;
QTextStream* input_stream = NULL; TQTextStream* input_stream = NULL;
static QString last_line; static TQString last_line;
int last_lineno = 0; int last_lineno = 0;
#define check( arg ) my_check( __FILE__, __LINE__, arg ) #define check( arg ) my_check( __FILE__, __LINE__, arg )
@ -133,29 +133,29 @@ void my_check( const char* file, int line, bool arg )
my_error( file, line ); my_error( file, line );
} }
void openInputFile( const QString& filename ) void openInputFile( const TQString& filename )
{ {
check( input_file == NULL ); check( input_file == NULL );
input_file = new QFile( filename ); input_file = new TQFile( filename );
printf("[INFO] Reading bindings definitions from file %s\n\r", filename.ascii()); printf("[INFO] Reading bindings definitions from file %s\n\r", filename.ascii());
if( !input_file->open( IO_ReadOnly )) if( !input_file->open( IO_ReadOnly ))
error(); error();
input_stream = new QTextStream( input_file ); input_stream = new TQTextStream( input_file );
last_lineno = 0; last_lineno = 0;
} }
QString getInputLine() TQString getInputLine()
{ {
while( !input_stream->atEnd()) while( !input_stream->atEnd())
{ {
QString line = input_stream->readLine().stripWhiteSpace(); TQString line = input_stream->readLine().stripWhiteSpace();
++last_lineno; ++last_lineno;
last_line = line; last_line = line;
if( line.isEmpty() || line[ 0 ] == '#' ) if( line.isEmpty() || line[ 0 ] == '#' )
continue; continue;
return line; return line;
} }
return QString::null; return TQString();
} }
void closeInputFile() void closeInputFile()
@ -166,11 +166,11 @@ void closeInputFile()
input_file = NULL; input_file = NULL;
} }
void parseArg( Function& function, const QString& details ) void parseArg( Function& function, const TQString& details )
{ {
Arg arg; Arg arg;
arg.name = details; arg.name = details;
QString line = getInputLine(); TQString line = getInputLine();
while( !line.isNull() ) while( !line.isNull() )
{ {
if( line.startsWith( "ENDARG" )) if( line.startsWith( "ENDARG" ))
@ -242,11 +242,11 @@ void parseArg( Function& function, const QString& details )
error(); error();
} }
void parseFunction( const QString& details ) void parseFunction( const TQString& details )
{ {
Function function; Function function;
function.name = details; function.name = details;
QString line = getInputLine(); TQString line = getInputLine();
while( !line.isNull() ) while( !line.isNull() )
{ {
if( line.startsWith( "ENDFUNCTION" )) if( line.startsWith( "ENDFUNCTION" ))
@ -255,7 +255,7 @@ void parseFunction( const QString& details )
{ {
Arg arg; Arg arg;
arg.name = "wmclass1"; arg.name = "wmclass1";
arg.type = "QCString"; arg.type = "TQCString";
arg.const_ref = true; arg.const_ref = true;
arg.create = "qAppName"; arg.create = "qAppName";
function.args.append( arg ); function.args.append( arg );
@ -294,7 +294,7 @@ void parseFunction( const QString& details )
void parse(TQString filename) void parse(TQString filename)
{ {
openInputFile( filename ); openInputFile( filename );
QString line = getInputLine(); TQString line = getInputLine();
while( !line.isNull() ) while( !line.isNull() )
{ {
if( line.startsWith( "FUNCTION" )) if( line.startsWith( "FUNCTION" ))
@ -308,21 +308,21 @@ void parse(TQString filename)
closeInputFile(); closeInputFile();
} }
QString makeIndent( int indent ) TQString makeIndent( int indent )
{ {
return indent > 0 ? QString().fill( ' ', indent ) : ""; return indent > 0 ? TQString().fill( ' ', indent ) : "";
} }
void generateFunction( QTextStream& stream, const Function& function, const QString name, void generateFunction( TQTextStream& stream, const Function& function, const TQString name,
int indent, bool staticf, bool orig_type, bool ignore_deref, int ignore_level ) int indent, bool staticf, bool orig_type, bool ignore_deref, int ignore_level )
{ {
QString line; TQString line;
line += makeIndent( indent ); line += makeIndent( indent );
if( staticf ) if( staticf )
line += "static "; line += "static ";
line += function.return_type + " " + name + "("; line += function.return_type + " " + name + "(";
bool need_comma = false; bool need_comma = false;
for( QValueList< Arg >::ConstIterator it = function.args.begin(); for( TQValueList< Arg >::ConstIterator it = function.args.begin();
it != function.args.end(); it != function.args.end();
++it ) ++it )
{ {
@ -364,13 +364,13 @@ void generateFunction( QTextStream& stream, const Function& function, const QStr
stream << line; stream << line;
} }
void generateQtH() void generateTQtH()
{ {
QFile file( "qtkdeintegration_x11_p.h.gen" ); TQFile file( "qtkdeintegration_x11_p.h.gen" );
if( !file.open( IO_WriteOnly )) if( !file.open( IO_WriteOnly ))
error(); error();
QTextStream stream( &file ); TQTextStream stream( &file );
for( QValueList< Function >::ConstIterator it = functions.begin(); for( TQValueList< Function >::ConstIterator it = functions.begin();
it != functions.end(); it != functions.end();
++it ) ++it )
{ {
@ -384,13 +384,13 @@ void generateQtH()
} }
} }
void generateQtCpp() void generateTQtCpp()
{ {
QFile file( "qtkdeintegration_x11.cpp.gen" ); TQFile file( "qtkdeintegration_x11.cpp.gen" );
if( !file.open( IO_WriteOnly )) if( !file.open( IO_WriteOnly ))
error(); error();
QTextStream stream( &file ); TQTextStream stream( &file );
for( QValueList< Function >::ConstIterator it = functions.begin(); for( TQValueList< Function >::ConstIterator it = functions.begin();
it != functions.end(); it != functions.end();
++it ) ++it )
{ {
@ -404,20 +404,20 @@ void generateQtCpp()
} }
stream << stream <<
"\n" "\n"
"void QKDEIntegration::initLibrary()\n" "void TQKDEIntegration::initLibrary()\n"
" {\n" " {\n"
" if( !inited )\n" " if( !inited )\n"
" {\n" " {\n"
" enable = false;\n" " enable = false;\n"
" inited = true;\n" " inited = true;\n"
" QString libpath = findLibrary();\n" " TQString libpath = findLibrary();\n"
" if( libpath.isEmpty())\n" " if( libpath.isEmpty())\n"
" return;\n" " return;\n"
" QLibrary lib( libpath );\n" " TQLibrary lib( libpath );\n"
" if( !QFile::exists( lib.library())) // avoid stupid Qt warning\n" " if( !TQFile::exists( lib.library())) // avoid stupid TQt warning\n"
" return;\n" " return;\n"
" lib.setAutoUnload( false );\n"; " lib.setAutoUnload( false );\n";
for( QValueList< Function >::ConstIterator it = functions.begin(); for( TQValueList< Function >::ConstIterator it = functions.begin();
it != functions.end(); it != functions.end();
++it ) ++it )
{ {
@ -438,7 +438,7 @@ void generateQtCpp()
" }\n" " }\n"
" }\n" " }\n"
"\n"; "\n";
for( QValueList< Function >::ConstIterator it1 = functions.begin(); for( TQValueList< Function >::ConstIterator it1 = functions.begin();
it1 != functions.end(); it1 != functions.end();
++it1 ) ++it1 )
{ {
@ -453,7 +453,7 @@ void generateQtCpp()
stream << makeIndent( 4 ) + "return qtkde_" + function.name + "(\n"; stream << makeIndent( 4 ) + "return qtkde_" + function.name + "(\n";
stream << makeIndent( 8 ); stream << makeIndent( 8 );
bool need_comma = false; bool need_comma = false;
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -473,19 +473,19 @@ void generateQtCpp()
} }
} }
void generateQt() void generateTQt()
{ {
generateQtH(); generateTQtH();
generateQtCpp(); generateTQtCpp();
} }
void generateQtKde() void generateTQtKde()
{ {
QFile file( "qtkde_functions.cpp" ); TQFile file( "tqtkde_functions.cpp" );
if( !file.open( IO_WriteOnly )) if( !file.open( IO_WriteOnly ))
error(); error();
QTextStream stream( &file ); TQTextStream stream( &file );
for( QValueList< Function >::ConstIterator it1 = functions.begin(); for( TQValueList< Function >::ConstIterator it1 = functions.begin();
it1 != functions.end(); it1 != functions.end();
++it1 ) ++it1 )
{ {
@ -502,8 +502,8 @@ void generateQtKde()
" {\n" " {\n"
" if( qt_xdisplay() != NULL )\n" " if( qt_xdisplay() != NULL )\n"
" XSync( qt_xdisplay(), False );\n"; " XSync( qt_xdisplay(), False );\n";
QString parent_arg; TQString parent_arg;
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -522,13 +522,13 @@ void generateQtKde()
stream << " DCOPRef( \"kded\", \"MainApplication-Interface\" ).call( \"updateUserTimestamp\", qt_x_time );\n"; stream << " DCOPRef( \"kded\", \"MainApplication-Interface\" ).call( \"updateUserTimestamp\", qt_x_time );\n";
} }
stream << stream <<
" QByteArray data, replyData;\n" " TQByteArray data, replyData;\n"
" QCString replyType;\n"; " TQCString replyType;\n";
if( !function.args.isEmpty()) if( !function.args.isEmpty())
{ {
stream << " QDataStream datastream( data, IO_WriteOnly );\n"; stream << " TQDataStream datastream( data, IO_WriteOnly );\n";
stream << " datastream"; stream << " datastream";
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -554,7 +554,7 @@ void generateQtKde()
} }
stream << " if( !dcopClient()->call( \"kded\", \"kdeintegration\",\"" + function.name + "("; stream << " if( !dcopClient()->call( \"kded\", \"kdeintegration\",\"" + function.name + "(";
bool need_comma = false; bool need_comma = false;
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -578,7 +578,7 @@ void generateQtKde()
stream << " return;\n"; stream << " return;\n";
stream << " }\n"; stream << " }\n";
bool return_data = false; bool return_data = false;
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
!return_data && it2 != function.args.end(); !return_data && it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -586,7 +586,7 @@ void generateQtKde()
return_data = true; return_data = true;
} }
if( return_data || function.return_type != "void" ) if( return_data || function.return_type != "void" )
stream << " QDataStream replystream( replyData, IO_ReadOnly );\n"; stream << " TQDataStream replystream( replyData, IO_ReadOnly );\n";
if( function.return_type != "void" ) if( function.return_type != "void" )
{ {
stream << " " + function.return_type << " ret;\n"; stream << " " + function.return_type << " ret;\n";
@ -594,7 +594,7 @@ void generateQtKde()
} }
if( return_data ) if( return_data )
{ {
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -603,7 +603,7 @@ void generateQtKde()
stream << " " << arg.type << " " << arg.name + "_dummy;\n"; stream << " " << arg.type << " " << arg.name + "_dummy;\n";
} }
stream << " replystream"; stream << " replystream";
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -623,7 +623,7 @@ void generateQtKde()
} }
} }
stream << ";\n"; stream << ";\n";
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -640,13 +640,13 @@ void generateQtKde()
} }
} }
void generateKdeDcop( QTextStream& stream ) void generateKdeDcop( TQTextStream& stream )
{ {
stream << stream <<
"bool Module::process(const QCString &fun, const QByteArray &data,\n" "bool Module::process(const TQCString &fun, const TQByteArray &data,\n"
" QCString &replyType, QByteArray &replyData)\n" " TQCString &replyType, TQByteArray &replyData)\n"
" {\n"; " {\n";
for( QValueList< Function >::ConstIterator it1 = functions.begin(); for( TQValueList< Function >::ConstIterator it1 = functions.begin();
it1 != functions.end(); it1 != functions.end();
++it1 ) ++it1 )
{ {
@ -655,7 +655,7 @@ void generateKdeDcop( QTextStream& stream )
continue; continue;
stream << " if( fun == \"" + function.name + "("; stream << " if( fun == \"" + function.name + "(";
bool need_comma = false; bool need_comma = false;
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -687,7 +687,7 @@ void generateKdeDcop( QTextStream& stream )
"QCStringList Module::functions()\n" "QCStringList Module::functions()\n"
" {\n" " {\n"
" QCStringList funcs = KDEDModule::functions();\n"; " QCStringList funcs = KDEDModule::functions();\n";
for( QValueList< Function >::ConstIterator it1 = functions.begin(); for( TQValueList< Function >::ConstIterator it1 = functions.begin();
it1 != functions.end(); it1 != functions.end();
++it1 ) ++it1 )
{ {
@ -696,7 +696,7 @@ void generateKdeDcop( QTextStream& stream )
continue; continue;
stream << " funcs << \"" + function.name + "("; stream << " funcs << \"" + function.name + "(";
bool need_comma = false; bool need_comma = false;
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -723,27 +723,27 @@ void generateKdeDcop( QTextStream& stream )
"\n"; "\n";
} }
void generateKdePreStub( QTextStream& stream ) void generateKdePreStub( TQTextStream& stream )
{ {
for( QValueList< Function >::ConstIterator it1 = functions.begin(); for( TQValueList< Function >::ConstIterator it1 = functions.begin();
it1 != functions.end(); it1 != functions.end();
++it1 ) ++it1 )
{ {
const Function& function = *it1; const Function& function = *it1;
if( function.only_qt ) if( function.only_qt )
continue; continue;
stream << "void Module::pre_" + function.name + "( const QByteArray& " stream << "void Module::pre_" + function.name + "( const TQByteArray& "
+ ( function.args.isEmpty() ? "" : "data" ) + ( function.args.isEmpty() ? "" : "data" )
+ ( function.delayed_return ? "" : ", QByteArray& replyData" ) + ( function.delayed_return ? "" : ", TQByteArray& replyData" )
+ " )\n"; + " )\n";
stream << " {\n"; stream << " {\n";
if( function.delayed_return ) if( function.delayed_return )
{ {
stream << " JobData job;\n"; stream << " JobData job;\n";
stream << " job.transaction = kapp->dcopClient()->beginTransaction();\n"; stream << " job.transaction = kapp->dcopClient()->beginTransaction();\n";
stream << " job.type = JobData::" + QString( function.name[ 0 ].upper()) + function.name.mid( 1 ) + ";\n"; stream << " job.type = JobData::" + TQString( function.name[ 0 ].upper()) + function.name.mid( 1 ) + ";\n";
} }
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -754,9 +754,9 @@ void generateKdePreStub( QTextStream& stream )
} }
if( !function.args.isEmpty()) if( !function.args.isEmpty())
{ {
stream << " QDataStream datastream( data, IO_ReadOnly );\n"; stream << " TQDataStream datastream( data, IO_ReadOnly );\n";
stream << " datastream"; stream << " datastream";
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -772,7 +772,7 @@ void generateKdePreStub( QTextStream& stream )
else else
stream << " post_" + function.name + "( " + function.name + "( "; stream << " post_" + function.name + "( " + function.name + "( ";
bool need_comma = false; bool need_comma = false;
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -796,9 +796,9 @@ void generateKdePreStub( QTextStream& stream )
} }
} }
void generateKdePostStub( QTextStream& stream ) void generateKdePostStub( TQTextStream& stream )
{ {
for( QValueList< Function >::ConstIterator it1 = functions.begin(); for( TQValueList< Function >::ConstIterator it1 = functions.begin();
it1 != functions.end(); it1 != functions.end();
++it1 ) ++it1 )
{ {
@ -819,7 +819,7 @@ void generateKdePostStub( QTextStream& stream )
needs_comma = true; needs_comma = true;
stream << function.return_type + " ret"; stream << function.return_type + " ret";
} }
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -833,7 +833,7 @@ void generateKdePostStub( QTextStream& stream )
} }
} }
if( !function.delayed_return ) if( !function.delayed_return )
stream << ( needs_comma ? "," : "" ) << " QByteArray& replyData"; stream << ( needs_comma ? "," : "" ) << " TQByteArray& replyData";
stream << " )\n"; stream << " )\n";
stream << " {\n"; stream << " {\n";
if( function.delayed_return ) if( function.delayed_return )
@ -841,11 +841,11 @@ void generateKdePostStub( QTextStream& stream )
stream << " assert( jobs.contains( handle ));\n"; stream << " assert( jobs.contains( handle ));\n";
stream << " JobData job = jobs[ handle ];\n"; stream << " JobData job = jobs[ handle ];\n";
stream << " jobs.remove( handle );\n"; stream << " jobs.remove( handle );\n";
stream << " QByteArray replyData;\n"; stream << " TQByteArray replyData;\n";
stream << " QCString replyType = \"qtkde\";\n"; stream << " TQCString replyType = \"qtkde\";\n";
} }
bool return_data = false; bool return_data = false;
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
!return_data && it2 != function.args.end(); !return_data && it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -853,13 +853,13 @@ void generateKdePostStub( QTextStream& stream )
return_data = true; return_data = true;
} }
if( function.return_type != "void" || return_data ) if( function.return_type != "void" || return_data )
stream << " QDataStream replystream( replyData, IO_WriteOnly );\n"; stream << " TQDataStream replystream( replyData, IO_WriteOnly );\n";
if( function.return_type != "void" ) if( function.return_type != "void" )
stream << " replystream << ret;\n"; stream << " replystream << ret;\n";
if( return_data ) if( return_data )
{ {
stream << " replystream"; stream << " replystream";
for( QValueList< Arg >::ConstIterator it2 = function.args.begin(); for( TQValueList< Arg >::ConstIterator it2 = function.args.begin();
it2 != function.args.end(); it2 != function.args.end();
++it2 ) ++it2 )
{ {
@ -876,7 +876,7 @@ void generateKdePostStub( QTextStream& stream )
} }
} }
void generateKdeStubs( QTextStream& stream ) void generateKdeStubs( TQTextStream& stream )
{ {
generateKdePreStub( stream ); generateKdePreStub( stream );
generateKdePostStub( stream ); generateKdePostStub( stream );
@ -885,21 +885,21 @@ void generateKdeStubs( QTextStream& stream )
void generateKdeCpp() void generateKdeCpp()
{ {
QFile file( "module_functions.cpp" ); TQFile file( "module_functions.cpp" );
if( !file.open( IO_WriteOnly )) if( !file.open( IO_WriteOnly ))
error(); error();
QTextStream stream( &file ); TQTextStream stream( &file );
generateKdeDcop( stream ); generateKdeDcop( stream );
generateKdeStubs( stream ); generateKdeStubs( stream );
} }
void generateKdeH() void generateKdeH()
{ {
QFile file( "module_functions.h" ); TQFile file( "module_functions.h" );
if( !file.open( IO_WriteOnly )) if( !file.open( IO_WriteOnly ))
error(); error();
QTextStream stream( &file ); TQTextStream stream( &file );
for( QValueList< Function >::ConstIterator it1 = functions.begin(); for( TQValueList< Function >::ConstIterator it1 = functions.begin();
it1 != functions.end(); it1 != functions.end();
++it1 ) ++it1 )
{ {
@ -912,8 +912,8 @@ void generateKdeH()
generateFunction( stream, real_function, real_function.name, 8, generateFunction( stream, real_function, real_function.name, 8,
false /*static*/, false /*orig type*/, true /*ignore deref*/, 2 /*ignore level*/ ); false /*static*/, false /*orig type*/, true /*ignore deref*/, 2 /*ignore level*/ );
stream << ";\n"; stream << ";\n";
stream << makeIndent( 8 ) + "void pre_" + function.name + "( const QByteArray& data" stream << makeIndent( 8 ) + "void pre_" + function.name + "( const TQByteArray& data"
+ ( function.delayed_return ? "" : ", QByteArray& replyData" ) + " );\n"; + ( function.delayed_return ? "" : ", TQByteArray& replyData" ) + " );\n";
Function post_function = function; Function post_function = function;
post_function.stripNonOutArguments(); post_function.stripNonOutArguments();
if( function.return_type != "void" ) if( function.return_type != "void" )
@ -934,7 +934,7 @@ void generateKdeH()
{ {
Arg handle_arg; Arg handle_arg;
handle_arg.name = "replyData"; handle_arg.name = "replyData";
handle_arg.type = "QByteArray&"; handle_arg.type = "TQByteArray&";
post_function.args.append( handle_arg ); post_function.args.append( handle_arg );
} }
post_function.return_type = "void"; post_function.return_type = "void";
@ -952,8 +952,8 @@ void generateKde()
void generate() void generate()
{ {
generateQt(); generateTQt();
generateQtKde(); generateTQtKde();
generateKde(); generateKde();
} }

@ -3,46 +3,46 @@
FUNCTION initializeIntegration FUNCTION initializeIntegration
RETURN_TYPE bool RETURN_TYPE bool
ARG hostname ARG hostname
TYPE QString TYPE TQString
CONST_REF CONST_REF
CREATE getHostname CREATE getHostname
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# QStringList getOpenFileNames( const QString &filter, # TQStringList getOpenFileNames( const TQString &filter,
# QString* workingDirectory, QWidget *parent, const char* name, # TQString* workingDirectory, TQWidget *parent, const char* name,
# const QString& caption, QString* selectedFilter, bool multiple ); # const TQString& caption, TQString* selectedFilter, bool multiple );
# #
FUNCTION getOpenFileNames FUNCTION getOpenFileNames
RETURN_TYPE QStringList RETURN_TYPE TQStringList
DELAYED_RETURN DELAYED_RETURN
ADD_APPINFO ADD_APPINFO
ARG filter ARG filter
TYPE QString TYPE TQString
CONST_REF CONST_REF
CONVERSION convertFileFilter CONVERSION convertFileFilter
ENDARG ENDARG
ARG workingDirectory ARG workingDirectory
TYPE QString TYPE TQString
NEEDS_DEREF NEEDS_DEREF
OUT_ARGUMENT OUT_ARGUMENT
ENDARG ENDARG
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG name ARG name
TYPE QCString TYPE TQCString
CONST_REF CONST_REF
ORIG_TYPE const char* ORIG_TYPE const char*
ENDARG ENDARG
ARG caption ARG caption
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG selectedFilter ARG selectedFilter
TYPE QString TYPE TQString
NEEDS_DEREF NEEDS_DEREF
OUT_ARGUMENT OUT_ARGUMENT
CONVERSION convertFileFilter CONVERSION convertFileFilter
@ -53,45 +53,45 @@ FUNCTION getOpenFileNames
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# QString getSaveFileName( const QString &initialSelection, # TQString getSaveFileName( const TQString &initialSelection,
# const QString &filter, QString* workingDirectory, QWidget *parent, # const TQString &filter, TQString* workingDirectory, TQWidget *parent,
# const char* name, const QString& caption, QString* selectedFilter ); # const char* name, const TQString& caption, TQString* selectedFilter );
# #
FUNCTION getSaveFileName FUNCTION getSaveFileName
RETURN_TYPE QString RETURN_TYPE TQString
DELAYED_RETURN DELAYED_RETURN
ADD_APPINFO ADD_APPINFO
ARG initialSelection ARG initialSelection
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG filter ARG filter
TYPE QString TYPE TQString
CONST_REF CONST_REF
CONVERSION convertFileFilter CONVERSION convertFileFilter
ENDARG ENDARG
ARG workingDirectory ARG workingDirectory
TYPE QString TYPE TQString
NEEDS_DEREF NEEDS_DEREF
OUT_ARGUMENT OUT_ARGUMENT
ENDARG ENDARG
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG name ARG name
TYPE QCString TYPE TQCString
CONST_REF CONST_REF
ORIG_TYPE const char* ORIG_TYPE const char*
ENDARG ENDARG
ARG caption ARG caption
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG selectedFilter ARG selectedFilter
TYPE QString TYPE TQString
NEEDS_DEREF NEEDS_DEREF
OUT_ARGUMENT OUT_ARGUMENT
CONVERSION convertFileFilter CONVERSION convertFileFilter
@ -99,60 +99,60 @@ FUNCTION getSaveFileName
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# QString getExistingDirectory( const QString &initialDirectory, # TQString getExistingDirectory( const TQString &initialDirectory,
# QWidget* parent, const char* name, const QString& caption ); # TQWidget* parent, const char* name, const TQString& caption );
# #
FUNCTION getExistingDirectory FUNCTION getExistingDirectory
RETURN_TYPE QString RETURN_TYPE TQString
DELAYED_RETURN DELAYED_RETURN
ADD_APPINFO ADD_APPINFO
ARG initialDirectory ARG initialDirectory
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG name ARG name
TYPE QCString TYPE TQCString
CONST_REF CONST_REF
ORIG_TYPE const char* ORIG_TYPE const char*
ENDARG ENDARG
ARG caption ARG caption
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# QColor getColor( const QColor& color, QWidget* parent, const char* name ); # TQColor getColor( const TQColor& color, TQWidget* parent, const char* name );
# #
FUNCTION getColor FUNCTION getColor
RETURN_TYPE QColor RETURN_TYPE TQColor
DELAYED_RETURN DELAYED_RETURN
ADD_APPINFO ADD_APPINFO
ARG color ARG color
TYPE QColor TYPE TQColor
CONST_REF CONST_REF
ENDARG ENDARG
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG name ARG name
TYPE QCString TYPE TQCString
CONST_REF CONST_REF
ORIG_TYPE const char* ORIG_TYPE const char*
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# QFont getFont( bool* ok, const QFont* def, QWidget *parent, const char* name); # TQFont getFont( bool* ok, const TQFont* def, TQWidget *parent, const char* name);
FUNCTION getFont FUNCTION getFont
RETURN_TYPE QFont RETURN_TYPE TQFont
DELAYED_RETURN DELAYED_RETURN
ADD_APPINFO ADD_APPINFO
ARG ok ARG ok
@ -161,25 +161,25 @@ FUNCTION getFont
OUT_ARGUMENT OUT_ARGUMENT
ENDARG ENDARG
ARG def ARG def
TYPE QFont TYPE TQFont
ORIG_TYPE const QFont* ORIG_TYPE const TQFont*
ORIG_CONVERSION fontPtrToFontRef ORIG_CONVERSION fontPtrToFontRef
CONST_REF CONST_REF
ENDARG ENDARG
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG name ARG name
TYPE QCString TYPE TQCString
CONST_REF CONST_REF
ORIG_TYPE const char* ORIG_TYPE const char*
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# int messageBox1( int type, QWidget *parent, const QString& caption, const QString& text, # int messageBox1( int type, TQWidget *parent, const TQString& caption, const TQString& text,
# int button0, int button1, int button2 ); # int button0, int button1, int button2 );
FUNCTION messageBox1 FUNCTION messageBox1
RETURN_TYPE int RETURN_TYPE int
@ -190,16 +190,16 @@ FUNCTION messageBox1
ENDARG ENDARG
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG caption ARG caption
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG text ARG text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button0 ARG button0
@ -213,7 +213,7 @@ FUNCTION messageBox1
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# int information( QWidget *parent, const QString& caption, const QString& text, # int information( TQWidget *parent, const TQString& caption, const TQString& text,
# int button0, int button1, int button2 ); # int button0, int button1, int button2 );
FUNCTION information FUNCTION information
RETURN_TYPE int RETURN_TYPE int
@ -221,16 +221,16 @@ FUNCTION information
ONLY_QT ONLY_QT
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG caption ARG caption
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG text ARG text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button0 ARG button0
@ -244,7 +244,7 @@ FUNCTION information
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# int question( QWidget *parent, const QString& caption, const QString& text, # int question( TQWidget *parent, const TQString& caption, const TQString& text,
# int button0, int button1, int button2 ); # int button0, int button1, int button2 );
FUNCTION question FUNCTION question
RETURN_TYPE int RETURN_TYPE int
@ -252,16 +252,16 @@ FUNCTION question
ONLY_QT ONLY_QT
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG caption ARG caption
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG text ARG text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button0 ARG button0
@ -275,7 +275,7 @@ FUNCTION question
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# int warning( QWidget *parent, const QString& caption, const QString& text, # int warning( TQWidget *parent, const TQString& caption, const TQString& text,
# int button0, int button1, int button2 ); # int button0, int button1, int button2 );
FUNCTION warning FUNCTION warning
RETURN_TYPE int RETURN_TYPE int
@ -283,16 +283,16 @@ FUNCTION warning
ONLY_QT ONLY_QT
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG caption ARG caption
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG text ARG text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button0 ARG button0
@ -306,7 +306,7 @@ FUNCTION warning
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# int critical( QWidget *parent, const QString& caption, const QString& text, # int critical( TQWidget *parent, const TQString& caption, const TQString& text,
# int button0, int button1, int button2 ); # int button0, int button1, int button2 );
FUNCTION critical FUNCTION critical
RETURN_TYPE int RETURN_TYPE int
@ -314,16 +314,16 @@ FUNCTION critical
ONLY_QT ONLY_QT
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG caption ARG caption
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG text ARG text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button0 ARG button0
@ -337,8 +337,8 @@ FUNCTION critical
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# int messageBox2( int type, QWidget* parent, const QString& caption, const QString& text, # int messageBox2( int type, TQWidget* parent, const TQString& caption, const TQString& text,
# const QString& button0Text, const QString& button1Text, const QString& button2Text, # const TQString& button0Text, const TQString& button1Text, const TQString& button2Text,
# int defaultButton, int escapeButton ); # int defaultButton, int escapeButton );
FUNCTION messageBox2 FUNCTION messageBox2
RETURN_TYPE int RETURN_TYPE int
@ -349,28 +349,28 @@ FUNCTION messageBox2
ENDARG ENDARG
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG caption ARG caption
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG text ARG text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button0Text ARG button0Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button1Text ARG button1Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button2Text ARG button2Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG defaultButton ARG defaultButton
@ -381,8 +381,8 @@ FUNCTION messageBox2
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# int information( QWidget* parent, const QString& caption, const QString& text, # int information( TQWidget* parent, const TQString& caption, const TQString& text,
# const QString& button0Text, const QString& button1Text, const QString& button2Text, # const TQString& button0Text, const TQString& button1Text, const TQString& button2Text,
# int defaultButton, int escapeButton ); # int defaultButton, int escapeButton );
FUNCTION information FUNCTION information
RETURN_TYPE int RETURN_TYPE int
@ -390,28 +390,28 @@ FUNCTION information
ONLY_QT ONLY_QT
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG caption ARG caption
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG text ARG text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button0Text ARG button0Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button1Text ARG button1Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button2Text ARG button2Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG defaultButton ARG defaultButton
@ -422,8 +422,8 @@ FUNCTION information
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# int question( QWidget* parent, const QString& caption, const QString& text, # int question( TQWidget* parent, const TQString& caption, const TQString& text,
# const QString& button0Text, const QString& button1Text, const QString& button2Text, # const TQString& button0Text, const TQString& button1Text, const TQString& button2Text,
# int defaultButton, int escapeButton ); # int defaultButton, int escapeButton );
FUNCTION question FUNCTION question
RETURN_TYPE int RETURN_TYPE int
@ -431,28 +431,28 @@ FUNCTION question
ONLY_QT ONLY_QT
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG caption ARG caption
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG text ARG text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button0Text ARG button0Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button1Text ARG button1Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button2Text ARG button2Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG defaultButton ARG defaultButton
@ -463,8 +463,8 @@ FUNCTION question
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# int warning( QWidget* parent, const QString& caption, const QString& text, # int warning( TQWidget* parent, const TQString& caption, const TQString& text,
# const QString& button0Text, const QString& button1Text, const QString& button2Text, # const TQString& button0Text, const TQString& button1Text, const TQString& button2Text,
# int defaultButton, int escapeButton ); # int defaultButton, int escapeButton );
FUNCTION warning FUNCTION warning
RETURN_TYPE int RETURN_TYPE int
@ -472,28 +472,28 @@ FUNCTION warning
ONLY_QT ONLY_QT
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG caption ARG caption
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG text ARG text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button0Text ARG button0Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button1Text ARG button1Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button2Text ARG button2Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG defaultButton ARG defaultButton
@ -504,8 +504,8 @@ FUNCTION warning
ENDARG ENDARG
ENDFUNCTION ENDFUNCTION
# int critical( QWidget* parent, const QString& caption, const QString& text, # int critical( TQWidget* parent, const TQString& caption, const TQString& text,
# const QString& button0Text, const QString& button1Text, const QString& button2Text, # const TQString& button0Text, const TQString& button1Text, const TQString& button2Text,
# int defaultButton, int escapeButton ); # int defaultButton, int escapeButton );
FUNCTION critical FUNCTION critical
RETURN_TYPE int RETURN_TYPE int
@ -513,28 +513,28 @@ FUNCTION critical
ONLY_QT ONLY_QT
ARG parent ARG parent
TYPE long TYPE long
ORIG_TYPE QWidget* ORIG_TYPE TQWidget*
ORIG_CONVERSION parentToWinId ORIG_CONVERSION parentToWinId
PARENT PARENT
ENDARG ENDARG
ARG caption ARG caption
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG text ARG text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button0Text ARG button0Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button1Text ARG button1Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG button2Text ARG button2Text
TYPE QString TYPE TQString
CONST_REF CONST_REF
ENDARG ENDARG
ARG defaultButton ARG defaultButton

@ -1 +1 @@
#define QTKDELIBDIR @PLUGIN_INSTALL_DIR@/plugins/integration #define TQTKDELIBDIR @PLUGIN_INSTALL_DIR@/plugins/integration

@ -18,56 +18,56 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#include "qtkdeintegration_x11_p.h" #include "tqtkdeintegration_x11_p.h"
#include <qcolordialog.h> #include <tqcolordialog.h>
#include <qfiledialog.h> #include <tqfiledialog.h>
#include <qfontdialog.h> #include <tqfontdialog.h>
#include <qlibrary.h> #include <tqlibrary.h>
#include <qregexp.h> #include <tqregexp.h>
#include <qmessagebox.h> #include <tqmessagebox.h>
#include <qapplication.h> #include <tqapplication.h>
#include <stdlib.h> #include <stdlib.h>
bool QKDEIntegration::inited = false; bool TQKDEIntegration::inited = false;
bool QKDEIntegration::enable = false; bool TQKDEIntegration::enable = false;
bool QKDEIntegration::enabled() bool TQKDEIntegration::enabled()
{ {
if( !inited ) if( !inited )
initLibrary(); initLibrary();
return enable; return enable;
} }
static QCString findLibrary() static TQCString findLibrary()
{ {
if( getenv( "KDE_FULL_SESSION" ) == NULL ) if( getenv( "KDE_FULL_SESSION" ) == NULL )
return ""; return "";
if( getenv( "KDE_FULL_SESSION" )[ 0 ] != 't' && getenv( "KDE_FULL_SESSION" )[ 0 ] != '1' ) if( getenv( "KDE_FULL_SESSION" )[ 0 ] != 't' && getenv( "KDE_FULL_SESSION" )[ 0 ] != '1' )
return ""; return "";
if( getenv( "QT_NO_KDE_INTEGRATION" ) == NULL if( getenv( "TQT_NO_KDE_INTEGRATION" ) == NULL
|| getenv( "QT_NO_KDE_INTEGRATION" )[ 0 ] == '0' ) || getenv( "TQT_NO_KDE_INTEGRATION" )[ 0 ] == '0' )
{ {
return QCString( QTKDELIBDIR ) + "/libqtkde"; return TQCString( TQTKDELIBDIR ) + "/libqtkde";
} }
return ""; return "";
} }
static long parentToWinId( const QWidget* w ) static long parentToWinId( const TQWidget* w )
{ {
if( w != NULL ) if( w != NULL )
return w->topLevelWidget()->winId(); return w->tqtopLevelWidget()->winId();
// try to find some usable parent // try to find some usable parent
if( qApp->activeWindow() && w != qApp->activeWindow()) if( tqApp->activeWindow() && w != tqApp->activeWindow())
return qApp->activeWindow()->winId(); return tqApp->activeWindow()->winId();
if( qApp->mainWidget() && w != qApp->mainWidget()) if( tqApp->mainWidget() && w != tqApp->mainWidget())
return qApp->mainWidget()->winId(); return tqApp->mainWidget()->winId();
return 0; return 0;
} }
inline static QFont fontPtrToFontRef( const QFont* f ) inline static TQFont fontPtrToFontRef( const TQFont* f )
{ {
return f != NULL ? *f : QFont(); return f != NULL ? *f : TQFont();
} }
// --- // ---

@ -20,62 +20,62 @@
// --- // ---
int QKDEIntegration::information( QWidget* parent, const QString& caption, int TQKDEIntegration::information( TQWidget* parent, const TQString& caption,
const QString& text, int button0, int button1, int button2 ) const TQString& text, int button0, int button1, int button2 )
{ {
return qtkde_messageBox1( return qtkde_messageBox1(
QMessageBox::Information, parentToWinId( parent ), caption, text, button0, button1, button2 ); TQMessageBox::Information, parentToWinId( parent ), caption, text, button0, button1, button2 );
} }
int QKDEIntegration::question( QWidget* parent, const QString& caption, int TQKDEIntegration::question( TQWidget* parent, const TQString& caption,
const QString& text, int button0, int button1, int button2 ) const TQString& text, int button0, int button1, int button2 )
{ {
return qtkde_messageBox1( return qtkde_messageBox1(
QMessageBox::Question, parentToWinId( parent ), caption, text, button0, button1, button2 ); TQMessageBox::Question, parentToWinId( parent ), caption, text, button0, button1, button2 );
} }
int QKDEIntegration::warning( QWidget* parent, const QString& caption, int TQKDEIntegration::warning( TQWidget* parent, const TQString& caption,
const QString& text, int button0, int button1, int button2 ) const TQString& text, int button0, int button1, int button2 )
{ {
return qtkde_messageBox1( return qtkde_messageBox1(
QMessageBox::Warning, parentToWinId( parent ), caption, text, button0, button1, button2 ); TQMessageBox::Warning, parentToWinId( parent ), caption, text, button0, button1, button2 );
} }
int QKDEIntegration::critical( QWidget* parent, const QString& caption, int TQKDEIntegration::critical( TQWidget* parent, const TQString& caption,
const QString& text, int button0, int button1, int button2 ) const TQString& text, int button0, int button1, int button2 )
{ {
return qtkde_messageBox1( return qtkde_messageBox1(
QMessageBox::Critical, parentToWinId( parent ), caption, text, button0, button1, button2 ); TQMessageBox::Critical, parentToWinId( parent ), caption, text, button0, button1, button2 );
} }
int QKDEIntegration::information( QWidget* parent, const QString& caption, int TQKDEIntegration::information( TQWidget* parent, const TQString& caption,
const QString& text, const QString& button0Text, const QString& button1Text, const QString& button2Text, const TQString& text, const TQString& button0Text, const TQString& button1Text, const TQString& button2Text,
int defaultButton, int escapeButton ) int defaultButton, int escapeButton )
{ {
return qtkde_messageBox2( return qtkde_messageBox2(
QMessageBox::Information, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); TQMessageBox::Information, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton );
} }
int QKDEIntegration::question( QWidget* parent, const QString& caption, int TQKDEIntegration::question( TQWidget* parent, const TQString& caption,
const QString& text, const QString& button0Text, const QString& button1Text, const QString& button2Text, const TQString& text, const TQString& button0Text, const TQString& button1Text, const TQString& button2Text,
int defaultButton, int escapeButton ) int defaultButton, int escapeButton )
{ {
return qtkde_messageBox2( return qtkde_messageBox2(
QMessageBox::Question, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); TQMessageBox::Question, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton );
} }
int QKDEIntegration::warning( QWidget* parent, const QString& caption, int TQKDEIntegration::warning( TQWidget* parent, const TQString& caption,
const QString& text, const QString& button0Text, const QString& button1Text, const QString& button2Text, const TQString& text, const TQString& button0Text, const TQString& button1Text, const TQString& button2Text,
int defaultButton, int escapeButton ) int defaultButton, int escapeButton )
{ {
return qtkde_messageBox2( return qtkde_messageBox2(
QMessageBox::Warning, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); TQMessageBox::Warning, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton );
} }
int QKDEIntegration::critical( QWidget* parent, const QString& caption, int TQKDEIntegration::critical( TQWidget* parent, const TQString& caption,
const QString& text, const QString& button0Text, const QString& button1Text, const QString& button2Text, const TQString& text, const TQString& button0Text, const TQString& button1Text, const TQString& button2Text,
int defaultButton, int escapeButton ) int defaultButton, int escapeButton )
{ {
return qtkde_messageBox2( return qtkde_messageBox2(
QMessageBox::Critical, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton ); TQMessageBox::Critical, parentToWinId( parent ), caption, text, button0Text, button1Text, button2Text, defaultButton, escapeButton );
} }

@ -18,17 +18,17 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/ */
#ifndef QKDEINTEGRATION_H #ifndef TQKDEINTEGRATION_H
#define QKDEINTEGRATION_H #define TQKDEINTEGRATION_H
#include <qstringlist.h> #include <tqstringlist.h>
class QLibrary; class TQLibrary;
class QWidget; class TQWidget;
class QColor; class TQColor;
class QFont; class TQFont;
class QKDEIntegration class TQKDEIntegration
{ {
public: public:
static bool enabled(); static bool enabled();

Loading…
Cancel
Save