diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:53:50 +0000 |
commit | 7be55ffa061c026e35e2d6a0effe1161ddb0d41f (patch) | |
tree | 8474f9b444b2756228600050f07a7ff25de532b2 /ktnef/gui | |
parent | f587f20a6d09f1729dd0a8c1cd8ee0110aec7451 (diff) | |
download | tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.tar.gz tdepim-7be55ffa061c026e35e2d6a0effe1161ddb0d41f.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1157655 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'ktnef/gui')
-rw-r--r-- | ktnef/gui/attachpropertydialog.cpp | 72 | ||||
-rw-r--r-- | ktnef/gui/attachpropertydialog.h | 14 | ||||
-rw-r--r-- | ktnef/gui/ktnefmain.cpp | 118 | ||||
-rw-r--r-- | ktnef/gui/ktnefmain.h | 20 | ||||
-rw-r--r-- | ktnef/gui/ktnefview.cpp | 42 | ||||
-rw-r--r-- | ktnef/gui/ktnefview.h | 14 | ||||
-rw-r--r-- | ktnef/gui/messagepropertydialog.cpp | 2 | ||||
-rw-r--r-- | ktnef/gui/messagepropertydialog.h | 2 | ||||
-rw-r--r-- | ktnef/gui/qwmf.cpp | 150 | ||||
-rw-r--r-- | ktnef/gui/qwmf.h | 46 |
10 files changed, 240 insertions, 240 deletions
diff --git a/ktnef/gui/attachpropertydialog.cpp b/ktnef/gui/attachpropertydialog.cpp index 8675b6baa..35cd65848 100644 --- a/ktnef/gui/attachpropertydialog.cpp +++ b/ktnef/gui/attachpropertydialog.cpp @@ -22,18 +22,18 @@ #include <ktnef/ktnefdefs.h> #include "qwmf.h" -#include <qlabel.h> +#include <tqlabel.h> #include <klistview.h> #include <kmimetype.h> #include <kdebug.h> #include <klocale.h> #include <kmessagebox.h> #include <kfiledialog.h> -#include <qbuffer.h> -#include <qdatastream.h> -#include <qpicture.h> +#include <tqbuffer.h> +#include <tqdatastream.h> +#include <tqpicture.h> -AttachPropertyDialog::AttachPropertyDialog(QWidget *parent, const char *name) +AttachPropertyDialog::AttachPropertyDialog(TQWidget *parent, const char *name) : AttachPropertyDialogBase(parent, name, true) { } @@ -53,7 +53,7 @@ void AttachPropertyDialog::setAttachment(KTNEFAttach *attach) s.append(" bytes"); size_->setText(s); KMimeType::Ptr mimetype = KMimeType::mimeType(attach->mimeTag()); - QPixmap pix = loadRenderingPixmap( attach, colorGroup().background() ); + TQPixmap pix = loadRenderingPixmap( attach, colorGroup().background() ); if ( !pix.isNull() ) icon_->setPixmap( pix ); else @@ -71,74 +71,74 @@ void AttachPropertyDialog::saveClicked() saveProperty( properties_, m_attach, this ); } -void formatProperties( const QMap<int,KTNEFProperty*>& props, QListView *lv, QListViewItem *item, const QString& prefix ) +void formatProperties( const TQMap<int,KTNEFProperty*>& props, TQListView *lv, TQListViewItem *item, const TQString& prefix ) { - for ( QMap<int,KTNEFProperty*>::ConstIterator it=props.begin(); it!=props.end(); ++it ) + for ( TQMap<int,KTNEFProperty*>::ConstIterator it=props.begin(); it!=props.end(); ++it ) { - QListViewItem *newItem = 0; + TQListViewItem *newItem = 0; if ( lv ) - newItem = new QListViewItem( lv, ( *it )->keyString() ); + newItem = new TQListViewItem( lv, ( *it )->keyString() ); else if ( item ) - newItem = new QListViewItem( item, ( *it )->keyString() ); + newItem = new TQListViewItem( item, ( *it )->keyString() ); else { kdWarning() << "formatProperties() called with no listview and no item" << endl; return; } - QVariant value = ( *it )->value(); - if ( value.type() == QVariant::List ) + TQVariant value = ( *it )->value(); + if ( value.type() == TQVariant::List ) { newItem->setOpen( true ); - newItem->setText( 0, newItem->text( 0 ) + " [" + QString::number( value.asList().count() ) + "]" ); + newItem->setText( 0, newItem->text( 0 ) + " [" + TQString::number( value.asList().count() ) + "]" ); int i = 0; - for ( QValueList<QVariant>::ConstIterator lit=value.listBegin(); lit!=value.listEnd(); ++lit, i++ ) - new QListViewItem( newItem, "[" + QString::number( i ) + "]", KTNEFProperty::formatValue( *lit ) ); + for ( TQValueList<TQVariant>::ConstIterator lit=value.listBegin(); lit!=value.listEnd(); ++lit, i++ ) + new TQListViewItem( newItem, "[" + TQString::number( i ) + "]", KTNEFProperty::formatValue( *lit ) ); } - else if ( value.type() == QVariant::DateTime ) + else if ( value.type() == TQVariant::DateTime ) newItem->setText( 1, value.asDateTime().toString() ); else { newItem->setText( 1, ( *it )->valueString() ); - newItem->setText( 2, prefix + "_" + QString::number( it.key() ) ); + newItem->setText( 2, prefix + "_" + TQString::number( it.key() ) ); } } } -void formatPropertySet( KTNEFPropertySet *pSet, QListView *lv ) +void formatPropertySet( KTNEFPropertySet *pSet, TQListView *lv ) { formatProperties( pSet->properties(), lv, 0, "prop" ); - QListViewItem *item = new QListViewItem( lv, i18n( "TNEF Attributes" ) ); + TQListViewItem *item = new TQListViewItem( lv, i18n( "TNEF Attributes" ) ); item->setOpen( true ); formatProperties( pSet->attributes(), 0, item, "attr" ); } -void saveProperty( QListView *lv, KTNEFPropertySet *pSet, QWidget *parent ) +void saveProperty( TQListView *lv, KTNEFPropertySet *pSet, TQWidget *parent ) { - QListViewItem *item = lv->selectedItem(); + TQListViewItem *item = lv->selectedItem(); if ( !item ) KMessageBox::error( parent, i18n( "Select an item." ) ); else if ( item->text( 2 ).isEmpty() ) KMessageBox::error( parent, i18n( "The selected item cannot be saved." ) ); else { - QString tag = item->text( 2 ); + TQString tag = item->text( 2 ); int key = tag.mid( 5 ).toInt(); - QVariant prop = ( tag.startsWith( "attr_" ) ? pSet->attribute( key ) : pSet->property( key ) ); - QString filename = KFileDialog::getSaveFileName( tag, QString::null, parent ); + TQVariant prop = ( tag.startsWith( "attr_" ) ? pSet->attribute( key ) : pSet->property( key ) ); + TQString filename = KFileDialog::getSaveFileName( tag, TQString::null, parent ); if ( !filename.isEmpty() ) { - QFile f( filename ); + TQFile f( filename ); if ( f.open( IO_WriteOnly ) ) { switch ( prop.type() ) { - case QVariant::ByteArray: + case TQVariant::ByteArray: f.writeBlock( prop.asByteArray().data(), prop.asByteArray().size() ); break; default: { - QTextStream t( &f ); + TQTextStream t( &f ); t << prop.toString(); break; } @@ -151,17 +151,17 @@ void saveProperty( QListView *lv, KTNEFPropertySet *pSet, QWidget *parent ) } } -QPixmap loadRenderingPixmap( KTNEFPropertySet *pSet, const QColor& bgColor ) +TQPixmap loadRenderingPixmap( KTNEFPropertySet *pSet, const TQColor& bgColor ) { - QPixmap pix; - QVariant rendData = pSet->attribute( attATTACHRENDDATA ), wmf = pSet->attribute( attATTACHMETAFILE ); + TQPixmap pix; + TQVariant rendData = pSet->attribute( attATTACHRENDDATA ), wmf = pSet->attribute( attATTACHMETAFILE ); if ( !rendData.isNull() && !wmf.isNull() ) { // Get rendering size - QBuffer rendBuffer( rendData.asByteArray() ); + TQBuffer rendBuffer( rendData.asByteArray() ); rendBuffer.open( IO_ReadOnly ); - QDataStream rendStream( &rendBuffer ); - rendStream.setByteOrder( QDataStream::LittleEndian ); + TQDataStream rendStream( &rendBuffer ); + rendStream.setByteOrder( TQDataStream::LittleEndian ); Q_UINT16 type, w, h; rendStream >> type >> w >> w; // read type and skip 4 bytes rendStream >> w >> h; @@ -171,9 +171,9 @@ QPixmap loadRenderingPixmap( KTNEFPropertySet *pSet, const QColor& bgColor ) { // Load WMF data QWinMetaFile wmfLoader; - QBuffer wmfBuffer( wmf.asByteArray() ); + TQBuffer wmfBuffer( wmf.asByteArray() ); wmfBuffer.open( IO_ReadOnly ); - wmfLoader.setBbox( QRect( 0, 0, w, h ) ); + wmfLoader.setBbox( TQRect( 0, 0, w, h ) ); if ( wmfLoader.load( wmfBuffer ) ) { pix.resize( w, h ); diff --git a/ktnef/gui/attachpropertydialog.h b/ktnef/gui/attachpropertydialog.h index a731572eb..b7a78bbc1 100644 --- a/ktnef/gui/attachpropertydialog.h +++ b/ktnef/gui/attachpropertydialog.h @@ -19,8 +19,8 @@ #define ATTACHPROPERTYDLG_H #include "attachpropertydialogbase.h" -#include <qmap.h> -#include <qpixmap.h> +#include <tqmap.h> +#include <tqpixmap.h> class KTNEFAttach; class KTNEFProperty; @@ -31,7 +31,7 @@ class QListViewItem; class AttachPropertyDialog : public AttachPropertyDialogBase { public: - AttachPropertyDialog(QWidget *parent = 0, const char *name = 0); + AttachPropertyDialog(TQWidget *parent = 0, const char *name = 0); ~AttachPropertyDialog(); void setAttachment(KTNEFAttach *attach); @@ -43,9 +43,9 @@ private: KTNEFAttach *m_attach; }; -void formatProperties( const QMap<int,KTNEFProperty*>&, QListView*, QListViewItem*, const QString& = "prop" ); -void formatPropertySet( KTNEFPropertySet*, QListView* ); -void saveProperty( QListView*, KTNEFPropertySet*, QWidget* ); -QPixmap loadRenderingPixmap( KTNEFPropertySet*, const QColor& ); +void formatProperties( const TQMap<int,KTNEFProperty*>&, TQListView*, TQListViewItem*, const TQString& = "prop" ); +void formatPropertySet( KTNEFPropertySet*, TQListView* ); +void saveProperty( TQListView*, KTNEFPropertySet*, TQWidget* ); +TQPixmap loadRenderingPixmap( KTNEFPropertySet*, const TQColor& ); #endif diff --git a/ktnef/gui/ktnefmain.cpp b/ktnef/gui/ktnefmain.cpp index a31d40161..4c158a21d 100644 --- a/ktnef/gui/ktnefmain.cpp +++ b/ktnef/gui/ktnefmain.cpp @@ -25,16 +25,16 @@ #include "attachpropertydialog.h" #include "messagepropertydialog.h" -#include <qpopupmenu.h> +#include <tqpopupmenu.h> #include <klistview.h> #include <klocale.h> #include <kapplication.h> #include <kiconloader.h> -#include <qpixmap.h> +#include <tqpixmap.h> #include <kstdaccel.h> -#include <qmessagebox.h> +#include <tqmessagebox.h> #include <kfiledialog.h> -#include <qdir.h> +#include <tqdir.h> #include <kprocess.h> #include <kglobal.h> #include <kstandarddirs.h> @@ -55,9 +55,9 @@ #include <kurldrag.h> -#define NOT_IMPLEMENTED QMessageBox::information(this, "ktnef", "Not implemented yet", QMessageBox::Ok|QMessageBox::Default, 0) +#define NOT_IMPLEMENTED TQMessageBox::information(this, "ktnef", "Not implemented yet", TQMessageBox::Ok|TQMessageBox::Default, 0) -KTNEFMain::KTNEFMain(QWidget *parent, const char *name) +KTNEFMain::KTNEFMain(TQWidget *parent, const char *name) : KMainWindow(parent, name) { setupActions(); @@ -85,19 +85,19 @@ KTNEFMain::~KTNEFMain() void KTNEFMain::setupActions() { // File menu - KStdAction::open(this, SLOT(openFile()), actionCollection()); - KStdAction::quit(kapp, SLOT(quit()), actionCollection()); + KStdAction::open(this, TQT_SLOT(openFile()), actionCollection()); + KStdAction::quit(kapp, TQT_SLOT(quit()), actionCollection()); // Action menu - new KAction(i18n("View"), QString("viewmag"), 0, this, SLOT(viewFile()), actionCollection(), "view_file"); - new KAction(i18n("View With..."), QString("package_applications"), 0, this, SLOT(viewFileAs()), actionCollection(), "view_file_as"); - new KAction(i18n("Extract"), 0, this, SLOT(extractFile()), actionCollection(), "extract_file"); - new KAction(i18n("Extract To..."), QString("ktnef_extract_to"), 0, this, SLOT(extractFileTo()), actionCollection(), "extract_file_to"); - new KAction(i18n("Extract All To..."), QString("ktnef_extract_all_to"), 0, this, SLOT(extractAllFiles()), actionCollection(), "extract_all_files"); - new KAction( i18n( "Message Properties" ), "help", 0, this, SLOT( slotShowMessageProperties() ), actionCollection(), "msg_properties" ); - new KAction(i18n("Properties"), QString("contents"), 0, this, SLOT(propertiesFile()), actionCollection(), "properties_file"); - new KAction( i18n( "Show Message Text" ), "mail_generic", 0, this, SLOT( slotShowMessageText() ), actionCollection(), "msg_text" ); - new KAction( i18n( "Save Message Text As..." ), "filesave", 0, this, SLOT( slotSaveMessageText() ), actionCollection(), "msg_save" ); + new KAction(i18n("View"), TQString("viewmag"), 0, this, TQT_SLOT(viewFile()), actionCollection(), "view_file"); + new KAction(i18n("View With..."), TQString("package_applications"), 0, this, TQT_SLOT(viewFileAs()), actionCollection(), "view_file_as"); + new KAction(i18n("Extract"), 0, this, TQT_SLOT(extractFile()), actionCollection(), "extract_file"); + new KAction(i18n("Extract To..."), TQString("ktnef_extract_to"), 0, this, TQT_SLOT(extractFileTo()), actionCollection(), "extract_file_to"); + new KAction(i18n("Extract All To..."), TQString("ktnef_extract_all_to"), 0, this, TQT_SLOT(extractAllFiles()), actionCollection(), "extract_all_files"); + new KAction( i18n( "Message Properties" ), "help", 0, this, TQT_SLOT( slotShowMessageProperties() ), actionCollection(), "msg_properties" ); + new KAction(i18n("Properties"), TQString("contents"), 0, this, TQT_SLOT(propertiesFile()), actionCollection(), "properties_file"); + new KAction( i18n( "Show Message Text" ), "mail_generic", 0, this, TQT_SLOT( slotShowMessageText() ), actionCollection(), "msg_text" ); + new KAction( i18n( "Save Message Text As..." ), "filesave", 0, this, TQT_SLOT( slotSaveMessageText() ), actionCollection(), "msg_save" ); actionCollection()->action("view_file")->setEnabled(false); actionCollection()->action("view_file_as")->setEnabled(false); actionCollection()->action("extract_file")->setEnabled(false); @@ -106,12 +106,12 @@ void KTNEFMain::setupActions() actionCollection()->action("properties_file")->setEnabled(false); // Option menu - new KAction(i18n("Default Folder..."), QString("folder_open"), 0, this, SLOT(optionDefaultDir()), actionCollection(), "options_default_dir"); + new KAction(i18n("Default Folder..."), TQString("folder_open"), 0, this, TQT_SLOT(optionDefaultDir()), actionCollection(), "options_default_dir"); createStandardStatusBarAction(); setStandardToolBarMenuEnabled(true); - KStdAction::configureToolbars(this, SLOT(slotEditToolbars()), actionCollection()); - KStdAction::keyBindings( this, SLOT( slotConfigureKeys() ), actionCollection() ); + KStdAction::configureToolbars(this, TQT_SLOT(slotEditToolbars()), actionCollection()); + KStdAction::keyBindings( this, TQT_SLOT( slotConfigureKeys() ), actionCollection() ); createGUI(); } @@ -135,25 +135,25 @@ void KTNEFMain::setupTNEF() parser_ = new KTNEFParser; setCentralWidget(view_); - connect(view_, SIGNAL(selectionChanged()), SLOT(viewSelectionChanged())); - connect(view_, SIGNAL(rightButtonPressed(QListViewItem*,const QPoint&,int)), SLOT(viewRightButtonPressed(QListViewItem*,const QPoint&,int))); - connect(view_, SIGNAL(doubleClicked(QListViewItem*)), SLOT(viewDoubleClicked(QListViewItem*))); - connect(view_, SIGNAL(dragRequested(const QValueList<KTNEFAttach*>&)), SLOT(viewDragRequested(const QValueList<KTNEFAttach*>&))); + connect(view_, TQT_SIGNAL(selectionChanged()), TQT_SLOT(viewSelectionChanged())); + connect(view_, TQT_SIGNAL(rightButtonPressed(TQListViewItem*,const TQPoint&,int)), TQT_SLOT(viewRightButtonPressed(TQListViewItem*,const TQPoint&,int))); + connect(view_, TQT_SIGNAL(doubleClicked(TQListViewItem*)), TQT_SLOT(viewDoubleClicked(TQListViewItem*))); + connect(view_, TQT_SIGNAL(dragRequested(const TQValueList<KTNEFAttach*>&)), TQT_SLOT(viewDragRequested(const TQValueList<KTNEFAttach*>&))); } -void KTNEFMain::loadFile(const QString& filename) +void KTNEFMain::loadFile(const TQString& filename) { filename_ = filename; setCaption(filename_); if (!parser_->openFile(filename)) { - QMessageBox::critical(this, i18n("Error"), i18n("Unable to open file."), QMessageBox::Ok|QMessageBox::Default, 0); + TQMessageBox::critical(this, i18n("Error"), i18n("Unable to open file."), TQMessageBox::Ok|TQMessageBox::Default, 0); view_->setAttachments(0); enableExtractAll(false); } else { - QPtrList<KTNEFAttach> list = parser_->message()->attachmentList(); + TQPtrList<KTNEFAttach> list = parser_->message()->attachmentList(); QString msg; msg = i18n( "%n attachment found", "%n attachments found", list.count() ); statusBar()->changeItem(msg, 0); @@ -187,7 +187,7 @@ void KTNEFMain::viewFile() KRun::runURL(url, mimename); } -QString KTNEFMain::extractTemp(KTNEFAttach *att) +TQString KTNEFMain::extractTemp(KTNEFAttach *att) { QString dir = KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp/"; parser_->extractFileTo(att->name(), dir); @@ -225,13 +225,13 @@ void KTNEFMain::extractAllFiles() { lastdir_ = dir; dir.append("/"); - QPtrList<KTNEFAttach> list = parser_->message()->attachmentList(); - QPtrListIterator<KTNEFAttach> it(list); + TQPtrList<KTNEFAttach> list = parser_->message()->attachmentList(); + TQPtrListIterator<KTNEFAttach> it(list); for (;it.current();++it) if (!parser_->extractFileTo(it.current()->name(), dir)) { QString msg = i18n( "Unable to extract file \"%1\"" ).arg( it.current()->name() ); - QMessageBox::critical(this,i18n("Error"),msg,QMessageBox::Ok|QMessageBox::Default,0); + TQMessageBox::critical(this,i18n("Error"),msg,TQMessageBox::Ok|TQMessageBox::Default,0); return; } } @@ -258,7 +258,7 @@ void KTNEFMain::optionDefaultDir() void KTNEFMain::viewSelectionChanged() { - QPtrList<KTNEFAttach> *list = view_->getSelection(); + TQPtrList<KTNEFAttach> *list = view_->getSelection(); bool on1 = (list->count() == 1u), on2 = (list->count() > 0u); actionCollection()->action("view_file")->setEnabled(on1); actionCollection()->action("view_file_as")->setEnabled(on1); @@ -286,51 +286,51 @@ void KTNEFMain::enableSingleAction(bool on) void KTNEFMain::cleanup() { QDir d(KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp/"); - const QFileInfoList *list = d.entryInfoList(QDir::Files|QDir::Hidden,QDir::Unsorted); + const QFileInfoList *list = d.entryInfoList(TQDir::Files|TQDir::Hidden,TQDir::Unsorted); QFileInfoListIterator it(*list); for (;it.current();++it) d.remove(it.current()->absFilePath()); } -void KTNEFMain::extractTo(const QString& dirname) +void KTNEFMain::extractTo(const TQString& dirname) { QString dir = dirname; if (dir.right(1) != "/") dir.append("/"); - QPtrList<KTNEFAttach> *list = view_->getSelection(); - QPtrListIterator<KTNEFAttach> it(*list); + TQPtrList<KTNEFAttach> *list = view_->getSelection(); + TQPtrListIterator<KTNEFAttach> it(*list); for (;it.current();++it) if (!parser_->extractFileTo(it.current()->name(), dir)) { QString msg = i18n("Unable to extract file \"%1\"").arg( it.current()->name() ); - QMessageBox::critical(this,i18n("Error"),msg,QMessageBox::Ok|QMessageBox::Default,0); + TQMessageBox::critical(this,i18n("Error"),msg,TQMessageBox::Ok|TQMessageBox::Default,0); return; } } /* This breaks the saveMainWindowSettings stuff.... - void KTNEFMain::closeEvent(QCloseEvent *e) + void KTNEFMain::closeEvent(TQCloseEvent *e) { e->accept(); }*/ -void KTNEFMain::viewRightButtonPressed(QListViewItem*, const QPoint& p, int) +void KTNEFMain::viewRightButtonPressed(TQListViewItem*, const TQPoint& p, int) { - QPtrList<KTNEFAttach> *list = view_->getSelection(); - QPopupMenu m; + TQPtrList<KTNEFAttach> *list = view_->getSelection(); + TQPopupMenu m; if (list->count() > 0u) { if (list->count() == 1u) { - m.insertItem(SmallIcon("viewmag"), i18n("View"), this, SLOT(viewFile())); - m.insertItem(SmallIcon("package_applications"), i18n("View With..."), this, SLOT(viewFileAs())); + m.insertItem(SmallIcon("viewmag"), i18n("View"), this, TQT_SLOT(viewFile())); + m.insertItem(SmallIcon("package_applications"), i18n("View With..."), this, TQT_SLOT(viewFileAs())); m.insertSeparator(); } - m.insertItem(i18n("Extract"), this, SLOT(extractFile())); - m.insertItem(SmallIcon("ktnef_extract_to"), i18n("Extract To..."), this, SLOT(extractFileTo())); + m.insertItem(i18n("Extract"), this, TQT_SLOT(extractFile())); + m.insertItem(SmallIcon("ktnef_extract_to"), i18n("Extract To..."), this, TQT_SLOT(extractFileTo())); if (list->count() == 1u) { m.insertSeparator(); - m.insertItem(SmallIcon("contents"), i18n("Properties"), this, SLOT(propertiesFile())); + m.insertItem(SmallIcon("contents"), i18n("Properties"), this, TQT_SLOT(propertiesFile())); } } else if ( list->count() == 0 ) @@ -338,16 +338,16 @@ void KTNEFMain::viewRightButtonPressed(QListViewItem*, const QPoint& p, int) m.exec( p ); } -void KTNEFMain::viewDoubleClicked(QListViewItem *item) +void KTNEFMain::viewDoubleClicked(TQListViewItem *item) { if (item && item->isSelected()) viewFile(); } -void KTNEFMain::viewDragRequested( const QValueList<KTNEFAttach*>& list ) +void KTNEFMain::viewDragRequested( const TQValueList<KTNEFAttach*>& list ) { KURL::List urlList; - for ( QValueList<KTNEFAttach*>::ConstIterator it=list.constBegin(); it!=list.constEnd(); ++it ) + for ( TQValueList<KTNEFAttach*>::ConstIterator it=list.constBegin(); it!=list.constEnd(); ++it ) urlList << KURL( extractTemp( *it ) ); if ( !list.isEmpty() ) { @@ -358,16 +358,16 @@ void KTNEFMain::viewDragRequested( const QValueList<KTNEFAttach*>& list ) void KTNEFMain::slotEditToolbars() { - saveMainWindowSettings( KGlobal::config(), QString::fromLatin1("MainWindow") ); + saveMainWindowSettings( KGlobal::config(), TQString::fromLatin1("MainWindow") ); KEditToolbar dlg(actionCollection()); - connect(&dlg, SIGNAL( newToolbarConfig() ), this, SLOT( slotNewToolbarConfig() )); + connect(&dlg, TQT_SIGNAL( newToolbarConfig() ), this, TQT_SLOT( slotNewToolbarConfig() )); dlg.exec(); } void KTNEFMain::slotNewToolbarConfig() { createGUI(); - applyMainWindowSettings( KGlobal::config(), QString::fromLatin1("MainWindow") ); + applyMainWindowSettings( KGlobal::config(), TQString::fromLatin1("MainWindow") ); } void KTNEFMain::slotShowMessageProperties() @@ -378,7 +378,7 @@ void KTNEFMain::slotShowMessageProperties() void KTNEFMain::slotShowMessageText() { - QString rtf = parser_->message()->rtfString(); + TQString rtf = parser_->message()->rtfString(); qDebug( "%s", rtf.latin1() ); KTempFile tmpFile( KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp/", "rtf"); *( tmpFile.textStream() ) << rtf; @@ -389,20 +389,20 @@ void KTNEFMain::slotShowMessageText() void KTNEFMain::slotSaveMessageText() { - QString rtf = parser_->message()->rtfString(); - QString filename = KFileDialog::getSaveFileName( QString::null, QString::null, this ); + TQString rtf = parser_->message()->rtfString(); + TQString filename = KFileDialog::getSaveFileName( TQString::null, TQString::null, this ); if ( !filename.isEmpty() ) { - QFile f( filename ); + TQFile f( filename ); if ( f.open( IO_WriteOnly ) ) { - QTextStream t( &f ); + TQTextStream t( &f ); t << rtf; } else - QMessageBox::critical( this, i18n( "Error" ), + TQMessageBox::critical( this, i18n( "Error" ), i18n( "Unable to open file for writing, check file permissions." ), - QMessageBox::Ok|QMessageBox::Default, 0); + TQMessageBox::Ok|TQMessageBox::Default, 0); } } diff --git a/ktnef/gui/ktnefmain.h b/ktnef/gui/ktnefmain.h index 30f5a171f..5f15f3d95 100644 --- a/ktnef/gui/ktnefmain.h +++ b/ktnef/gui/ktnefmain.h @@ -19,8 +19,8 @@ #define KTNEFMAIN_H #include <kmainwindow.h> -#include <qstring.h> -#include <qlistview.h> +#include <tqstring.h> +#include <tqlistview.h> class KTNEFView; class KTNEFParser; @@ -31,10 +31,10 @@ class KTNEFMain : public KMainWindow Q_OBJECT public: - KTNEFMain(QWidget *parent = 0, const char *name = 0); + KTNEFMain(TQWidget *parent = 0, const char *name = 0); ~KTNEFMain(); - void loadFile(const QString& filename); + void loadFile(const TQString& filename); protected slots: void openFile(); @@ -52,12 +52,12 @@ protected slots: void slotSaveMessageText(); void viewSelectionChanged(); - void viewRightButtonPressed(QListViewItem *item, const QPoint& p, int c); - void viewDoubleClicked(QListViewItem*); - void viewDragRequested( const QValueList<KTNEFAttach*>& list ); + void viewRightButtonPressed(TQListViewItem *item, const TQPoint& p, int c); + void viewDoubleClicked(TQListViewItem*); + void viewDragRequested( const TQValueList<KTNEFAttach*>& list ); void slotConfigureKeys(); //protected: -// void closeEvent(QCloseEvent *e); +// void closeEvent(TQCloseEvent *e); private: void setupStatusbar(); @@ -67,8 +67,8 @@ private: void enableSingleAction(bool on = true); void cleanup(); - void extractTo(const QString& dirname); - QString extractTemp(KTNEFAttach *att); + void extractTo(const TQString& dirname); + TQString extractTemp(KTNEFAttach *att); private: KTNEFView *view_; diff --git a/ktnef/gui/ktnefview.cpp b/ktnef/gui/ktnefview.cpp index abee5a73b..a77098350 100644 --- a/ktnef/gui/ktnefview.cpp +++ b/ktnef/gui/ktnefview.cpp @@ -19,9 +19,9 @@ #include <ktnef/ktnefattach.h> #include "attachpropertydialog.h" -#include <qheader.h> -#include <qpixmap.h> -#include <qtimer.h> +#include <tqheader.h> +#include <tqpixmap.h> +#include <tqtimer.h> #include <kapplication.h> #include <kiconloader.h> @@ -33,7 +33,7 @@ class Attachment : public QListViewItem { public: - Attachment(QListView *parent, KTNEFAttach *attach); + Attachment(TQListView *parent, KTNEFAttach *attach); ~Attachment(); KTNEFAttach* getAttachment() const { return attach_; } @@ -42,14 +42,14 @@ private: KTNEFAttach *attach_; }; -Attachment::Attachment(QListView *parent, KTNEFAttach *attach) - : QListViewItem(parent, attach->name()), attach_(attach) +Attachment::Attachment(TQListView *parent, KTNEFAttach *attach) + : TQListViewItem(parent, attach->name()), attach_(attach) { - setText(2, QString::number( attach_->size() )); + setText(2, TQString::number( attach_->size() )); if (!attach_->fileName().isEmpty()) setText(0, attach_->fileName()); KMimeType::Ptr mimeType = KMimeType::mimeType( attach_->mimeTag() ); setText(1, mimeType->comment()); - QPixmap pix = loadRenderingPixmap( attach, parent->colorGroup().base() ); + TQPixmap pix = loadRenderingPixmap( attach, parent->colorGroup().base() ); if ( !pix.isNull() ) setPixmap( 0, pix ); else @@ -63,44 +63,44 @@ Attachment::~Attachment() //------------------------------------------------------------------------------------------------------ -KTNEFView::KTNEFView(QWidget *parent, const char *name) +KTNEFView::KTNEFView(TQWidget *parent, const char *name) : KListView(parent,name) { attachments_.setAutoDelete(false); addColumn(i18n("File Name")); addColumn(i18n("File Type")); addColumn(i18n("Size")); - setFrameStyle(QFrame::WinPanel|QFrame::Sunken); + setFrameStyle(TQFrame::WinPanel|TQFrame::Sunken); setLineWidth(1); - setSelectionMode(QListView::Extended); - setHScrollBarMode(QScrollView::AlwaysOff); - setVScrollBarMode(QScrollView::AlwaysOn); - QTimer::singleShot( 0, this, SLOT(adjustColumnWidth()) ); + setSelectionMode(TQListView::Extended); + setHScrollBarMode(TQScrollView::AlwaysOff); + setVScrollBarMode(TQScrollView::AlwaysOn); + TQTimer::singleShot( 0, this, TQT_SLOT(adjustColumnWidth()) ); } KTNEFView::~KTNEFView() { } -void KTNEFView::setAttachments(QPtrList<KTNEFAttach> *list) +void KTNEFView::setAttachments(TQPtrList<KTNEFAttach> *list) { clear(); if (list) { - QPtrListIterator<KTNEFAttach> it(*list); + TQPtrListIterator<KTNEFAttach> it(*list); for (;it.current();++it) new Attachment(this, it.current()); } } -void KTNEFView::resizeEvent(QResizeEvent *e) +void KTNEFView::resizeEvent(TQResizeEvent *e) { adjustColumnWidth(); resizeContents(visibleWidth(),visibleHeight()); - if (e) QListView::resizeEvent(e); + if (e) TQListView::resizeEvent(e); } -QPtrList<KTNEFAttach>* KTNEFView::getSelection() +TQPtrList<KTNEFAttach>* KTNEFView::getSelection() { attachments_.clear(); QListViewItem *item = firstChild(); @@ -114,8 +114,8 @@ QPtrList<KTNEFAttach>* KTNEFView::getSelection() void KTNEFView::startDrag() { - QListViewItemIterator it( this, QListViewItemIterator::Selected ); - QValueList<KTNEFAttach*> list; + TQListViewItemIterator it( this, TQListViewItemIterator::Selected ); + TQValueList<KTNEFAttach*> list; while ( it.current() ) { list << static_cast<Attachment*>( it.current() )->getAttachment(); diff --git a/ktnef/gui/ktnefview.h b/ktnef/gui/ktnefview.h index 00c49b7c7..faa3262ae 100644 --- a/ktnef/gui/ktnefview.h +++ b/ktnef/gui/ktnefview.h @@ -19,7 +19,7 @@ #define KTNEFWIDGET_H #include <klistview.h> -#include <qptrlist.h> +#include <tqptrlist.h> #include <kdepimmacros.h> class KTNEFAttach; @@ -29,24 +29,24 @@ class KDE_EXPORT KTNEFView : public KListView Q_OBJECT public: - KTNEFView(QWidget *parent = 0, const char *name = 0); + KTNEFView(TQWidget *parent = 0, const char *name = 0); ~KTNEFView(); - void setAttachments(QPtrList<KTNEFAttach> *list); - QPtrList<KTNEFAttach>* getSelection(); + void setAttachments(TQPtrList<KTNEFAttach> *list); + TQPtrList<KTNEFAttach>* getSelection(); signals: - void dragRequested( const QValueList<KTNEFAttach*>& list ); + void dragRequested( const TQValueList<KTNEFAttach*>& list ); protected: - void resizeEvent(QResizeEvent *e); + void resizeEvent(TQResizeEvent *e); void startDrag(); private slots: void adjustColumnWidth(); private: - QPtrList<KTNEFAttach> attachments_; + TQPtrList<KTNEFAttach> attachments_; }; #endif diff --git a/ktnef/gui/messagepropertydialog.cpp b/ktnef/gui/messagepropertydialog.cpp index 0e098c35c..a2b1f75f9 100644 --- a/ktnef/gui/messagepropertydialog.cpp +++ b/ktnef/gui/messagepropertydialog.cpp @@ -22,7 +22,7 @@ #include <klistview.h> #include <klocale.h> -MessagePropertyDialog::MessagePropertyDialog( QWidget *parent, KTNEFMessage *msg ) +MessagePropertyDialog::MessagePropertyDialog( TQWidget *parent, KTNEFMessage *msg ) : KDialogBase( parent, "MessagePropertyDialog", true, i18n( "Message Properties" ), KDialogBase::Close|KDialogBase::User1, KDialogBase::Close, false, KStdGuiItem::save() ) diff --git a/ktnef/gui/messagepropertydialog.h b/ktnef/gui/messagepropertydialog.h index 7b357b716..7d1ee7aa6 100644 --- a/ktnef/gui/messagepropertydialog.h +++ b/ktnef/gui/messagepropertydialog.h @@ -27,7 +27,7 @@ class MessagePropertyDialog : public KDialogBase { Q_OBJECT public: - MessagePropertyDialog( QWidget *parent, KTNEFMessage *msg ); + MessagePropertyDialog( TQWidget *parent, KTNEFMessage *msg ); protected slots: void slotUser1(); diff --git a/ktnef/gui/qwmf.cpp b/ktnef/gui/qwmf.cpp index 6a10cc006..41b908d1c 100644 --- a/ktnef/gui/qwmf.cpp +++ b/ktnef/gui/qwmf.cpp @@ -19,12 +19,12 @@ #include <math.h> #include <assert.h> -#include <qfileinfo.h> -#include <qpixmap.h> -#include <qpainter.h> -#include <qdatastream.h> -#include <qapplication.h> -#include <qbuffer.h> +#include <tqfileinfo.h> +#include <tqpixmap.h> +#include <tqpainter.h> +#include <tqdatastream.h> +#include <tqapplication.h> +#include <tqbuffer.h> #include <kdebug.h> bool qwmfDebug = false; @@ -50,59 +50,59 @@ public: class WinObjHandle { public: - virtual void apply( QPainter& p ) = 0; + virtual void apply( TQPainter& p ) = 0; }; class WinObjBrushHandle: public WinObjHandle { public: - virtual void apply( QPainter& p ); - QBrush brush; + virtual void apply( TQPainter& p ); + TQBrush brush; virtual ~WinObjBrushHandle() {}; }; class WinObjPenHandle: public WinObjHandle { public: - virtual void apply( QPainter& p ); - QPen pen; + virtual void apply( TQPainter& p ); + TQPen pen; virtual ~WinObjPenHandle() {}; }; class WinObjPatternBrushHandle: public WinObjHandle { public: - virtual void apply( QPainter& p ); - QBrush brush; - QPixmap image; + virtual void apply( TQPainter& p ); + TQBrush brush; + TQPixmap image; virtual ~WinObjPatternBrushHandle() {}; }; class WinObjFontHandle: public WinObjHandle { public: - virtual void apply( QPainter& p ); - QFont font; + virtual void apply( TQPainter& p ); + TQFont font; int rotation; virtual ~WinObjFontHandle() {}; }; -void WinObjBrushHandle::apply( QPainter& p ) +void WinObjBrushHandle::apply( TQPainter& p ) { p.setBrush( brush ); } -void WinObjPenHandle::apply( QPainter& p ) +void WinObjPenHandle::apply( TQPainter& p ) { p.setPen( pen ); } -void WinObjPatternBrushHandle::apply( QPainter& p ) +void WinObjPatternBrushHandle::apply( TQPainter& p ) { p.setBrush( brush ); } -void WinObjFontHandle::apply( QPainter& p ) +void WinObjFontHandle::apply( TQPainter& p ) { p.setFont( font ); } @@ -130,34 +130,34 @@ QWinMetaFile::~QWinMetaFile() //----------------------------------------------------------------------------- -bool QWinMetaFile::load( const QString &filename ) +bool QWinMetaFile::load( const TQString &filename ) { - QFile file( filename ); + TQFile file( filename ); if ( !file.exists() ) { - kdDebug() << "File " << QFile::encodeName(filename) << " does not exist" << endl; + kdDebug() << "File " << TQFile::encodeName(filename) << " does not exist" << endl; return false; } if ( !file.open( IO_ReadOnly ) ) { - kdDebug() << "Cannot open file " << QFile::encodeName(filename) << endl; + kdDebug() << "Cannot open file " << TQFile::encodeName(filename) << endl; return false; } - QByteArray ba = file.readAll(); + TQByteArray ba = file.readAll(); file.close(); - QBuffer buffer( ba ); + TQBuffer buffer( ba ); buffer.open( IO_ReadOnly ); return load( buffer ); } //----------------------------------------------------------------------------- -bool QWinMetaFile::load( QBuffer &buffer ) +bool QWinMetaFile::load( TQBuffer &buffer ) { - QDataStream st; + TQDataStream st; WmfEnhMetaHeader eheader; WmfMetaHeader header; WmfPlaceableHeader pheader; @@ -174,7 +174,7 @@ bool QWinMetaFile::load( QBuffer &buffer ) mFirstCmd = NULL; st.setDevice( &buffer ); - st.setByteOrder( QDataStream::LittleEndian ); // Great, I love Qt ! + st.setByteOrder( TQDataStream::LittleEndian ); // Great, I love Qt ! //----- Read placeable metafile header st >> pheader.key; @@ -329,7 +329,7 @@ bool QWinMetaFile::load( QBuffer &buffer ) //----------------------------------------------------------------------------- -bool QWinMetaFile::paint( const QPaintDevice* aTarget, bool absolute ) +bool QWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) { int idx, i; WmfCmd* cmd; @@ -365,7 +365,7 @@ bool QWinMetaFile::paint( const QPaintDevice* aTarget, bool absolute ) ( this->*metaFuncTab[ idx ].method )( cmd->numParm, cmd->parm ); if ( QWMF_DEBUG ) { - QString str = "", param; + TQString str = "", param; if ( metaFuncTab[ idx ].name == NULL ) { str += "UNKNOWN "; } @@ -384,8 +384,8 @@ bool QWinMetaFile::paint( const QPaintDevice* aTarget, bool absolute ) } } /* - // TODO: cleanup this code when QPicture::setBoundingBox() is possible in KOClipart (QT31) - // because actually QPicture::boundingBox() != mBBox() + // TODO: cleanup this code when TQPicture::setBoundingBox() is possible in KOClipart (QT31) + // because actually TQPicture::boundingBox() != mBBox() mWindowsCoord += 1; if ( mWindowsCoord == 2 ) { kdDebug() << "DRAW ANGLES " << endl; @@ -405,7 +405,7 @@ bool QWinMetaFile::paint( const QPaintDevice* aTarget, bool absolute ) void QWinMetaFile::setWindowOrg( long, short* parm ) { if ( mAbsoluteCoord ) { - QRect r = mPainter.window(); + TQRect r = mPainter.window(); mPainter.setWindow( parm[ 1 ], parm[ 0 ], r.width(), r.height() ); } else { @@ -425,12 +425,12 @@ void QWinMetaFile::setWindowExt( long, short* parm ) { // negative value allowed for width and height : QABS() forbidden if ( mAbsoluteCoord ) { - QRect r = mPainter.window(); + TQRect r = mPainter.window(); mPainter.setWindow( r.left(), r.top(), parm[ 1 ], parm[ 0 ] ); } else { if ( (parm[ 0 ] != 0) && (parm[ 1 ] != 0) ) { - QRect r = mPainter.window(); + TQRect r = mPainter.window(); double dx = mInternalWorldMatrix.dx(); double dy = mInternalWorldMatrix.dy(); double sx = mInternalWorldMatrix.m11(); @@ -479,7 +479,7 @@ void QWinMetaFile::ellipse( long, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::polygon( long, short* parm ) { - QPointArray* pa; + TQPointArray* pa; pa = pointArray( parm[ 0 ], &parm[ 1 ] ); mPainter.drawPolygon( *pa, mWinding ); @@ -489,24 +489,24 @@ void QWinMetaFile::polygon( long, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::polyPolygon( long, short* parm ) { - QRegion region; + TQRegion region; int i, j, startPolygon; mPainter.save(); // define clipping region - QRect win = bbox(); + TQRect win = bbox(); startPolygon = 1+parm[ 0 ]; for ( i=0 ; i < parm[ 0 ] ; i++ ) { - QPointArray pa1( parm[ 1+i ] ); + TQPointArray pa1( parm[ 1+i ] ); for ( j=0 ; j < parm[ 1+i ] ; j++) { pa1.setPoint ( j, parm[ startPolygon ], parm[ startPolygon+1 ] ); startPolygon += 2; } - QRegion r( pa1 ); + TQRegion r( pa1 ); region = region.eor( r ); } - mPainter.setClipRegion( region, QPainter::CoordPainter ); + mPainter.setClipRegion( region, TQPainter::CoordPainter ); // fill polygons mPainter.fillRect( win.left(), win.top(), win.width(), win.height(), mPainter.brush() ); @@ -516,7 +516,7 @@ void QWinMetaFile::polyPolygon( long, short* parm ) mPainter.setClipping( false ); mPainter.setBrush( Qt::NoBrush ); - QPointArray* pa; + TQPointArray* pa; int idxPolygon = 1 + parm[ 0 ]; for ( i=0 ; i < parm[ 0 ] ; i++ ) { pa = pointArray( parm[ 1+i ], &parm[ idxPolygon ] ); @@ -532,7 +532,7 @@ void QWinMetaFile::polyPolygon( long, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::polyline( long, short* parm ) { - QPointArray* pa; + TQPointArray* pa; pa = pointArray( parm[ 0 ], &parm[ 1 ] ); mPainter.drawPolyline( *pa ); @@ -628,7 +628,7 @@ void QWinMetaFile::setBkMode( long, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::setPixel( long, short* parm ) { - QPen pen = mPainter.pen(); + TQPen pen = mPainter.pen(); mPainter.setPen( color( parm ) ); mPainter.drawPoint( parm[ 3 ], parm[ 2 ] ); mPainter.setPen( pen ); @@ -661,16 +661,16 @@ void QWinMetaFile::restoreDC( long, short *parm ) void QWinMetaFile::intersectClipRect( long, short* parm ) { /* TODO: better implementation : need QT 3.0.2 - QRegion region = mPainter.clipRegion(); + TQRegion region = mPainter.clipRegion(); if ( region.isEmpty() ) region = bbox(); */ - QRegion region( bbox() ); + TQRegion region( bbox() ); - QRegion newRegion( parm[ 3 ], parm[ 2 ], parm[ 1 ] - parm[ 3 ], parm[ 0 ] - parm[ 2 ] ); + TQRegion newRegion( parm[ 3 ], parm[ 2 ], parm[ 1 ] - parm[ 3 ], parm[ 0 ] - parm[ 2 ] ); region = region.intersect( newRegion ); - mPainter.setClipRegion( region, QPainter::CoordPainter ); + mPainter.setClipRegion( region, TQPainter::CoordPainter ); } @@ -678,16 +678,16 @@ void QWinMetaFile::intersectClipRect( long, short* parm ) void QWinMetaFile::excludeClipRect( long, short* parm ) { /* TODO: better implementation : need QT 3.0.2 - QRegion region = mPainter.clipRegion(); + TQRegion region = mPainter.clipRegion(); if ( region.isEmpty() ) region = bbox(); */ - QRegion region( bbox() ); + TQRegion region( bbox() ); - QRegion newRegion( parm[ 3 ], parm[ 2 ], parm[ 1 ] - parm[ 3 ], parm[ 0 ] - parm[ 2 ] ); + TQRegion newRegion( parm[ 3 ], parm[ 2 ], parm[ 1 ] - parm[ 3 ], parm[ 0 ] - parm[ 2 ] ); region = region.subtract( newRegion ); - mPainter.setClipRegion( region, QPainter::CoordPainter ); + mPainter.setClipRegion( region, TQPainter::CoordPainter ); } @@ -738,16 +738,16 @@ void QWinMetaFile::extTextOut( long num, short* parm ) else ptStr = (char*)&parm[ 4 ]; - QCString text( ptStr, parm[ 2 ] + 1 ); + TQCString text( ptStr, parm[ 2 ] + 1 ); - QFontMetrics fm( mPainter.font() ); + TQFontMetrics fm( mPainter.font() ); width = fm.width( text ) + fm.descent(); // because fm.width(text) isn't rigth with Italic text height = fm.height(); mPainter.save(); if ( mTextAlign & 0x01 ) { // (left, top) position = current logical position - QPoint pos = mPainter.pos(); + TQPoint pos = mPainter.pos(); x = pos.x(); y = pos.y(); } @@ -795,7 +795,7 @@ void QWinMetaFile::extTextOut( long num, short* parm ) void QWinMetaFile::dibBitBlt( long num, short* parm ) { if ( num > 9 ) { // DIB image - QImage bmpSrc; + TQImage bmpSrc; if ( dibToBmp( bmpSrc, (char*)&parm[ 8 ], (num - 8) * 2 ) ) { long raster = toDWord( parm ); @@ -805,11 +805,11 @@ void QWinMetaFile::dibBitBlt( long num, short* parm ) // wmf file allow negative width or height mPainter.save(); if ( parm[ 5 ] < 0 ) { // width < 0 => horizontal flip - QWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); + TQWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); mPainter.setWorldMatrix( m, true ); } if ( parm[ 4 ] < 0 ) { // height < 0 => vertical flip - QWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); + TQWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); mPainter.setWorldMatrix( m, true ); } mPainter.drawImage( parm[ 7 ], parm[ 6 ], bmpSrc, parm[ 3 ], parm[ 2 ], parm[ 5 ], parm[ 4 ] ); @@ -825,7 +825,7 @@ void QWinMetaFile::dibBitBlt( long num, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::dibStretchBlt( long num, short* parm ) { - QImage bmpSrc; + TQImage bmpSrc; if ( dibToBmp( bmpSrc, (char*)&parm[ 10 ], (num - 10) * 2 ) ) { long raster = toDWord( parm ); @@ -835,15 +835,15 @@ void QWinMetaFile::dibStretchBlt( long num, short* parm ) // wmf file allow negative width or height mPainter.save(); if ( parm[ 7 ] < 0 ) { // width < 0 => horizontal flip - QWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); + TQWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); mPainter.setWorldMatrix( m, true ); } if ( parm[ 6 ] < 0 ) { // height < 0 => vertical flip - QWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); + TQWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); mPainter.setWorldMatrix( m, true ); } bmpSrc = bmpSrc.copy( parm[ 5 ], parm[ 4 ], parm[ 3 ], parm[ 2 ] ); - // TODO: scale the bitmap ( QImage::scale(parm[ 7 ], parm[ 6 ]) is actually too slow ) + // TODO: scale the bitmap ( TQImage::scale(parm[ 7 ], parm[ 6 ]) is actually too slow ) mPainter.drawImage( parm[ 9 ], parm[ 8 ], bmpSrc ); mPainter.restore(); @@ -854,7 +854,7 @@ void QWinMetaFile::dibStretchBlt( long num, short* parm ) //----------------------------------------------------------------------------- void QWinMetaFile::stretchDib( long num, short* parm ) { - QImage bmpSrc; + TQImage bmpSrc; if ( dibToBmp( bmpSrc, (char*)&parm[ 11 ], (num - 11) * 2 ) ) { long raster = toDWord( parm ); @@ -864,15 +864,15 @@ void QWinMetaFile::stretchDib( long num, short* parm ) // wmf file allow negative width or height mPainter.save(); if ( parm[ 8 ] < 0 ) { // width < 0 => horizontal flip - QWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); + TQWMatrix m( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); mPainter.setWorldMatrix( m, true ); } if ( parm[ 7 ] < 0 ) { // height < 0 => vertical flip - QWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); + TQWMatrix m( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); mPainter.setWorldMatrix( m, true ); } bmpSrc = bmpSrc.copy( parm[ 6 ], parm[ 5 ], parm[ 4 ], parm[ 3 ] ); - // TODO: scale the bitmap ( QImage::scale(parm[ 8 ], parm[ 7 ]) is actually too slow ) + // TODO: scale the bitmap ( TQImage::scale(parm[ 8 ], parm[ 7 ]) is actually too slow ) mPainter.drawImage( parm[ 10 ], parm[ 9 ], bmpSrc ); mPainter.restore(); @@ -885,7 +885,7 @@ void QWinMetaFile::dibCreatePatternBrush( long num, short* parm ) { WinObjPatternBrushHandle* handle = new WinObjPatternBrushHandle; addHandle( handle ); - QImage bmpSrc; + TQImage bmpSrc; if ( dibToBmp( bmpSrc, (char*)&parm[ 2 ], (num - 2) * 2 ) ) { handle->image = bmpSrc; @@ -997,7 +997,7 @@ void QWinMetaFile::createPenIndirect( long, short* parm ) // TODO : width of pen proportional to device context width // DOESN'T WORK /* - QRect devRec; + TQRect devRec; devRec = mPainter.xForm( mBBox ); width = ( parm[ 0 ] * devRec.width() ) / mBBox.width() ; kdDebug() << "CreatePenIndirect: " << endl; @@ -1015,7 +1015,7 @@ void QWinMetaFile::createFontIndirect( long , short* parm) WinObjFontHandle* handle = new WinObjFontHandle; addHandle( handle ); - QString family( (const char*)&parm[ 9 ] ); + TQString family( (const char*)&parm[ 9 ] ); mRotation = -parm[ 2 ] / 10; // text rotation (in 1/10 degree) // TODO: memorisation of rotation in object Font @@ -1074,7 +1074,7 @@ int QWinMetaFile::findFunc( unsigned short aFunc ) const } //----------------------------------------------------------------------------- -QPointArray* QWinMetaFile::pointArray( short num, short* parm ) +TQPointArray* QWinMetaFile::pointArray( short num, short* parm ) { int i; @@ -1109,7 +1109,7 @@ unsigned int QWinMetaFile::toDWord( short* parm ) //----------------------------------------------------------------------------- -QColor QWinMetaFile::color( short* parm ) +TQColor QWinMetaFile::color( short* parm ) { unsigned int colorRef; int red, green, blue; @@ -1119,7 +1119,7 @@ QColor QWinMetaFile::color( short* parm ) green = ( colorRef>>8 ) & 255; blue = ( colorRef>>16 ) & 255; - return QColor( red, green, blue ); + return TQColor( red, green, blue ); } @@ -1222,7 +1222,7 @@ Qt::RasterOp QWinMetaFile::winToQtRaster( long parm ) const } //----------------------------------------------------------------------------- -bool QWinMetaFile::dibToBmp( QImage& bmp, const char* dib, long size ) +bool QWinMetaFile::dibToBmp( TQImage& bmp, const char* dib, long size ) { typedef struct _BMPFILEHEADER { WORD bmType; @@ -1234,7 +1234,7 @@ bool QWinMetaFile::dibToBmp( QImage& bmp, const char* dib, long size ) int sizeBmp = size + 14; - QByteArray pattern( sizeBmp ); // BMP header and DIB data + TQByteArray pattern( sizeBmp ); // BMP header and DIB data pattern.fill(0); memcpy( &pattern[ 14 ], dib, size ); diff --git a/ktnef/gui/qwmf.h b/ktnef/gui/qwmf.h index b655a3fd3..051979df3 100644 --- a/ktnef/gui/qwmf.h +++ b/ktnef/gui/qwmf.h @@ -19,14 +19,14 @@ #ifndef qwmf_h #define qwmf_h -#include <qstring.h> -#include <qpainter.h> -#include <qwmatrix.h> -#include <qpointarray.h> -#include <qpen.h> -#include <qcolor.h> -#include <qimage.h> -#include <qrect.h> +#include <tqstring.h> +#include <tqpainter.h> +#include <tqwmatrix.h> +#include <tqpointarray.h> +#include <tqpen.h> +#include <tqcolor.h> +#include <tqimage.h> +#include <tqrect.h> class QBuffer; class QString; @@ -41,7 +41,7 @@ struct WmfPlaceableHeader; * How to use QWinMetaFile : * #include "qwmf.h" * QWinMetaFile wmf; - * QPicture pic; // or QImage pic; + * TQPicture pic; // or TQImage pic; * if ( wmf.load( filename ) * wmf.paint( &pic ); */ @@ -56,8 +56,8 @@ public: /** * Load WMF file. Returns true on success. */ - virtual bool load( const QString &fileName ); - virtual bool load( QBuffer &buffer ); + virtual bool load( const TQString &fileName ); + virtual bool load( TQBuffer &buffer ); /** * Paint metafile to given paint-device using absolute or relative coordinate. @@ -65,7 +65,7 @@ public: * relative coord. use the existing world transfomation Matrix * Returns true on success. */ - virtual bool paint( const QPaintDevice* target, bool absolute=false ); + virtual bool paint( const TQPaintDevice* target, bool absolute=false ); /** * Returns true if the metafile is placeable. @@ -80,8 +80,8 @@ public: /** * Returns bounding rectangle */ - QRect bbox( void ) const { return mBBox; } - void setBbox( QRect r ) { mBBox = r; } + TQRect bbox( void ) const { return mBBox; } + void setBbox( TQRect r ) { mBBox = r; } public: // should be protected but cannot /** Metafile painter methods */ @@ -182,10 +182,10 @@ protected: virtual int findFunc( unsigned short aFunc ) const; /** Fills given parms into mPoints. */ - QPointArray* pointArray( short num, short* parms ); + TQPointArray* pointArray( short num, short* parms ); /** Returns color given by the two parameters */ - QColor color( short* parm ); + TQColor color( short* parm ); /** Converts two parameters to long */ unsigned int toDWord( short* parm ); @@ -202,26 +202,26 @@ protected: Qt::RasterOp winToQtRaster( long parm ) const; /** Converts DIB to BMP */ - bool dibToBmp( QImage& bmp, const char* dib, long size); + bool dibToBmp( TQImage& bmp, const char* dib, long size); protected: - QPainter mPainter; + TQPainter mPainter; bool mIsPlaceable, mIsEnhanced, mValid; // coordinate system bool mAbsoluteCoord; - QWMatrix mInternalWorldMatrix; // memorisation of WMF matrix transformation - QRect mHeaderBoundingBox; - QRect mBBox; + TQWMatrix mInternalWorldMatrix; // memorisation of WMF matrix transformation + TQRect mHeaderBoundingBox; + TQRect mBBox; // informtion shared between Metafile Functions - QColor mTextColor; + TQColor mTextColor; int mTextAlign, mRotation; bool mWinding; WmfCmd* mFirstCmd; WinObjHandle** mObjHandleTab; - QPointArray mPoints; + TQPointArray mPoints; int mDpi; }; |