From 67e29a054cfcb1b0d2fe6b0a316cf6b3eec087b7 Mon Sep 17 00:00:00 2001 From: tpearson Date: Wed, 13 Apr 2011 00:46:47 +0000 Subject: Initial conversion of kdepim to TQt This will probably require some tweaking before it will build under Qt4, however Qt3 builds are OK. Any alterations this commit makes to kdepim behaviour under Qt3 are unintentional and should be fixed. git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdepim@1227832 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ktnef/gui/attachpropertydialog.cpp | 18 +-- ktnef/gui/attachpropertydialog.h | 2 +- ktnef/gui/attachpropertydialogbase.ui | 36 ++--- ktnef/gui/ktnefmain.cpp | 32 ++-- ktnef/gui/ktnefmain.h | 9 +- ktnef/gui/ktnefview.cpp | 16 +- ktnef/gui/ktnefview.h | 3 +- ktnef/gui/messagepropertydialog.cpp | 4 +- ktnef/gui/messagepropertydialog.h | 3 +- ktnef/gui/metafuncs.h | 144 +++++++++--------- ktnef/gui/qwmf.cpp | 268 +++++++++++++++++----------------- ktnef/gui/qwmf.h | 22 +-- ktnef/gui/wmfstruct.h | 6 +- ktnef/ktnef/ktnefdefs.h | 2 +- ktnef/ktnef/ktnefparser.h | 2 +- ktnef/ktnef/ktnefpropertyset.h | 4 +- ktnef/lib/ktnefmessage.cpp | 2 +- ktnef/lib/ktnefparser.cpp | 94 ++++++------ ktnef/lib/ktnefproperty.cpp | 4 +- ktnef/lib/ktnefpropertyset.cpp | 10 +- ktnef/lib/ktnefwriter.cpp | 10 +- ktnef/lib/mapi.cpp | 8 +- ktnef/tests/mapi_attach_data_obj.tnef | Bin 348479 -> 348541 bytes 23 files changed, 351 insertions(+), 348 deletions(-) (limited to 'ktnef') diff --git a/ktnef/gui/attachpropertydialog.cpp b/ktnef/gui/attachpropertydialog.cpp index 06e2685d6..7fd6cacf5 100644 --- a/ktnef/gui/attachpropertydialog.cpp +++ b/ktnef/gui/attachpropertydialog.cpp @@ -33,8 +33,8 @@ #include #include -AttachPropertyDialog::AttachPropertyDialog(TQWidget *parent, const char *name) - : AttachPropertyDialogBase(parent, name, true) +AttachPropertyDialog::AttachPropertyDialog(TQWidget *tqparent, const char *name) + : AttachPropertyDialogBase(tqparent, name, true) { } @@ -44,7 +44,7 @@ AttachPropertyDialog::~AttachPropertyDialog() void AttachPropertyDialog::setAttachment(KTNEFAttach *attach) { - QString s = (attach->fileName().isEmpty() ? attach->name() : attach->fileName()); + TQString s = (attach->fileName().isEmpty() ? attach->name() : attach->fileName()); filename_->setText(""+s+""); setCaption(s); display_->setText(attach->displayName()); @@ -113,19 +113,19 @@ void formatPropertySet( KTNEFPropertySet *pSet, TQListView *lv ) formatProperties( pSet->attributes(), 0, item, "attr" ); } -void saveProperty( TQListView *lv, KTNEFPropertySet *pSet, TQWidget *parent ) +void saveProperty( TQListView *lv, KTNEFPropertySet *pSet, TQWidget *tqparent ) { TQListViewItem *item = lv->selectedItem(); if ( !item ) - KMessageBox::error( parent, i18n( "Select an item." ) ); + KMessageBox::error( tqparent, i18n( "Select an item." ) ); else if ( item->text( 2 ).isEmpty() ) - KMessageBox::error( parent, i18n( "The selected item cannot be saved." ) ); + KMessageBox::error( tqparent, i18n( "The selected item cannot be saved." ) ); else { TQString tag = item->text( 2 ); int key = tag.mid( 5 ).toInt(); TQVariant prop = ( tag.startsWith( "attr_" ) ? pSet->attribute( key ) : pSet->property( key ) ); - TQString filename = KFileDialog::getSaveFileName( tag, TQString::null, parent ); + TQString filename = KFileDialog::getSaveFileName( tag, TQString(), tqparent ); if ( !filename.isEmpty() ) { TQFile f( filename ); @@ -146,7 +146,7 @@ void saveProperty( TQListView *lv, KTNEFPropertySet *pSet, TQWidget *parent ) f.close(); } else - KMessageBox::error( parent, i18n( "Unable to open file for writing, check file permissions." ) ); + KMessageBox::error( tqparent, i18n( "Unable to open file for writing, check file permissions." ) ); } } } @@ -170,7 +170,7 @@ TQPixmap loadRenderingPixmap( KTNEFPropertySet *pSet, const TQColor& bgColor ) if ( type == 1 && w > 0 && h > 0 ) { // Load WMF data - QWinMetaFile wmfLoader; + TQWinMetaFile wmfLoader; TQBuffer wmfBuffer( wmf.asByteArray() ); wmfBuffer.open( IO_ReadOnly ); wmfLoader.setBbox( TQRect( 0, 0, w, h ) ); diff --git a/ktnef/gui/attachpropertydialog.h b/ktnef/gui/attachpropertydialog.h index aa5e2bf3a..b390caffe 100644 --- a/ktnef/gui/attachpropertydialog.h +++ b/ktnef/gui/attachpropertydialog.h @@ -31,7 +31,7 @@ class TQListViewItem; class AttachPropertyDialog : public AttachPropertyDialogBase { public: - AttachPropertyDialog(TQWidget *parent = 0, const char *name = 0); + AttachPropertyDialog(TQWidget *tqparent = 0, const char *name = 0); ~AttachPropertyDialog(); void setAttachment(KTNEFAttach *attach); diff --git a/ktnef/gui/attachpropertydialogbase.ui b/ktnef/gui/attachpropertydialogbase.ui index a06db962b..eaf9a5989 100644 --- a/ktnef/gui/attachpropertydialogbase.ui +++ b/ktnef/gui/attachpropertydialogbase.ui @@ -1,6 +1,6 @@ AttachPropertyDialogBase - + AttachPropertyDialogBase @@ -22,7 +22,7 @@ 6 - + display_ @@ -35,7 +35,7 @@ - + description_ @@ -48,7 +48,7 @@ - + mime_ @@ -61,7 +61,7 @@ - + size_ @@ -74,7 +74,7 @@ - + index_ @@ -101,7 +101,7 @@ Horizontal - + displayLabel_ @@ -117,7 +117,7 @@ Comment: - + descriptionLabel_ @@ -125,7 +125,7 @@ Description: - + mimeLabel_ @@ -133,7 +133,7 @@ Mime type: - + sizeLabel_ @@ -141,7 +141,7 @@ File size: - + indexLabel_ @@ -149,7 +149,7 @@ Index: - + filename_ @@ -165,7 +165,7 @@ RichText - + icon_ @@ -209,7 +209,7 @@ AllColumns - + tqlayout2 @@ -234,7 +234,7 @@ - + save_ @@ -242,7 +242,7 @@ &Save - + close_ @@ -271,9 +271,9 @@ saveClicked() - + saveClicked() - + klistview.h diff --git a/ktnef/gui/ktnefmain.cpp b/ktnef/gui/ktnefmain.cpp index ea44edbe1..fd9438e6c 100644 --- a/ktnef/gui/ktnefmain.cpp +++ b/ktnef/gui/ktnefmain.cpp @@ -57,8 +57,8 @@ #define NOT_IMPLEMENTED TQMessageBox::information(this, "ktnef", "Not implemented yet", TQMessageBox::Ok|TQMessageBox::Default, 0) -KTNEFMain::KTNEFMain(TQWidget *parent, const char *name) - : KMainWindow(parent, name) +KTNEFMain::KTNEFMain(TQWidget *tqparent, const char *name) + : KMainWindow(tqparent, name) { setupActions(); setupStatusbar(); @@ -154,7 +154,7 @@ void KTNEFMain::loadFile(const TQString& filename) else { TQPtrList list = parser_->message()->attachmentList(); - QString msg; + TQString msg; msg = i18n( "%n attachment found", "%n attachments found", list.count() ); statusBar()->changeItem(msg, 0); view_->setAttachments(&list); @@ -165,7 +165,7 @@ void KTNEFMain::loadFile(const TQString& filename) void KTNEFMain::openFile() { - QString filename = KFileDialog::getOpenFileName(0,0,this,0); + TQString filename = KFileDialog::getOpenFileName(0,0,this,0); if (!filename.isEmpty()) loadFile(filename); } @@ -173,7 +173,7 @@ void KTNEFMain::viewFile() { KTNEFAttach *attach = view_->getSelection()->first(); KURL url("file:"+extractTemp(attach)); - QString mimename(attach->mimeTag()); + TQString mimename(attach->mimeTag()); if (mimename.isEmpty() || mimename == "application/octet-stream") { @@ -189,7 +189,7 @@ void KTNEFMain::viewFile() TQString KTNEFMain::extractTemp(KTNEFAttach *att) { - QString dir = KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp/"; + TQString dir = KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp/"; parser_->extractFileTo(att->name(), dir); dir.append(att->name()); return dir; @@ -210,7 +210,7 @@ void KTNEFMain::extractFile() void KTNEFMain::extractFileTo() { - QString dir = KFileDialog::getExistingDirectory(lastdir_, this); + TQString dir = KFileDialog::getExistingDirectory(lastdir_, this); if (!dir.isEmpty()) { extractTo(dir); @@ -220,7 +220,7 @@ void KTNEFMain::extractFileTo() void KTNEFMain::extractAllFiles() { - QString dir = KFileDialog::getExistingDirectory(lastdir_, this); + TQString dir = KFileDialog::getExistingDirectory(lastdir_, this); if (!dir.isEmpty()) { lastdir_ = dir; @@ -230,7 +230,7 @@ void KTNEFMain::extractAllFiles() for (;it.current();++it) if (!parser_->extractFileTo(it.current()->name(), dir)) { - QString msg = i18n( "Unable to extract file \"%1\"" ).arg( it.current()->name() ); + TQString msg = i18n( "Unable to extract file \"%1\"" ).arg( it.current()->name() ); TQMessageBox::critical(this,i18n("Error"),msg,TQMessageBox::Ok|TQMessageBox::Default,0); return; } @@ -247,7 +247,7 @@ void KTNEFMain::propertiesFile() void KTNEFMain::optionDefaultDir() { - QString dirname = KFileDialog::getExistingDirectory(defaultdir_, this); + TQString dirname = KFileDialog::getExistingDirectory(defaultdir_, this); if (!dirname.isEmpty()) { defaultdir_ = dirname; @@ -285,23 +285,23 @@ void KTNEFMain::enableSingleAction(bool on) void KTNEFMain::cleanup() { - QDir d(KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp/"); - const QFileInfoList *list = d.entryInfoList(TQDir::Files|TQDir::Hidden,TQDir::Unsorted); - QFileInfoListIterator it(*list); + TQDir d(KGlobal::dirs()->localkdedir() + "/share/apps/ktnef/tmp/"); + const TQFileInfoList *list = d.entryInfoList(TQDir::Files|TQDir::Hidden,TQDir::Unsorted); + TQFileInfoListIterator it(*list); for (;it.current();++it) d.remove(it.current()->absFilePath()); } void KTNEFMain::extractTo(const TQString& dirname) { - QString dir = dirname; + TQString dir = dirname; if (dir.right(1) != "/") dir.append("/"); TQPtrList *list = view_->getSelection(); TQPtrListIterator 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() ); + TQString msg = i18n("Unable to extract file \"%1\"").arg( it.current()->name() ); TQMessageBox::critical(this,i18n("Error"),msg,TQMessageBox::Ok|TQMessageBox::Default,0); return; } @@ -390,7 +390,7 @@ void KTNEFMain::slotShowMessageText() void KTNEFMain::slotSaveMessageText() { TQString rtf = parser_->message()->rtfString(); - TQString filename = KFileDialog::getSaveFileName( TQString::null, TQString::null, this ); + TQString filename = KFileDialog::getSaveFileName( TQString(), TQString(), this ); if ( !filename.isEmpty() ) { TQFile f( filename ); diff --git a/ktnef/gui/ktnefmain.h b/ktnef/gui/ktnefmain.h index 5f15f3d95..1b645d1e5 100644 --- a/ktnef/gui/ktnefmain.h +++ b/ktnef/gui/ktnefmain.h @@ -29,9 +29,10 @@ class KTNEFAttach; class KTNEFMain : public KMainWindow { Q_OBJECT + TQ_OBJECT public: - KTNEFMain(TQWidget *parent = 0, const char *name = 0); + KTNEFMain(TQWidget *tqparent = 0, const char *name = 0); ~KTNEFMain(); void loadFile(const TQString& filename); @@ -73,9 +74,9 @@ private: private: KTNEFView *view_; KTNEFParser *parser_; - QString filename_; - QString defaultdir_; - QString lastdir_; + TQString filename_; + TQString defaultdir_; + TQString lastdir_; }; #endif diff --git a/ktnef/gui/ktnefview.cpp b/ktnef/gui/ktnefview.cpp index 79d5f073b..dcf401ab3 100644 --- a/ktnef/gui/ktnefview.cpp +++ b/ktnef/gui/ktnefview.cpp @@ -30,10 +30,10 @@ #include -class Attachment : public QListViewItem +class Attachment : public TQListViewItem { public: - Attachment(TQListView *parent, KTNEFAttach *attach); + Attachment(TQListView *tqparent, KTNEFAttach *attach); ~Attachment(); KTNEFAttach* getAttachment() const { return attach_; } @@ -42,14 +42,14 @@ private: KTNEFAttach *attach_; }; -Attachment::Attachment(TQListView *parent, KTNEFAttach *attach) - : TQListViewItem(parent, attach->name()), attach_(attach) +Attachment::Attachment(TQListView *tqparent, KTNEFAttach *attach) + : TQListViewItem(tqparent, attach->name()), attach_(attach) { 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()); - TQPixmap pix = loadRenderingPixmap( attach, parent->tqcolorGroup().base() ); + TQPixmap pix = loadRenderingPixmap( attach, tqparent->tqcolorGroup().base() ); if ( !pix.isNull() ) setPixmap( 0, pix ); else @@ -63,8 +63,8 @@ Attachment::~Attachment() //------------------------------------------------------------------------------------------------------ -KTNEFView::KTNEFView(TQWidget *parent, const char *name) - : KListView(parent,name) +KTNEFView::KTNEFView(TQWidget *tqparent, const char *name) + : KListView(tqparent,name) { attachments_.setAutoDelete(false); addColumn(i18n("File Name")); @@ -103,7 +103,7 @@ void KTNEFView::resizeEvent(TQResizeEvent *e) TQPtrList* KTNEFView::getSelection() { attachments_.clear(); - QListViewItem *item = firstChild(); + TQListViewItem *item = firstChild(); while (item) { if (item->isSelected()) attachments_.append(((Attachment*)item)->getAttachment()); diff --git a/ktnef/gui/ktnefview.h b/ktnef/gui/ktnefview.h index faa3262ae..8fbe5e4bf 100644 --- a/ktnef/gui/ktnefview.h +++ b/ktnef/gui/ktnefview.h @@ -27,9 +27,10 @@ class KTNEFAttach; class KDE_EXPORT KTNEFView : public KListView { Q_OBJECT + TQ_OBJECT public: - KTNEFView(TQWidget *parent = 0, const char *name = 0); + KTNEFView(TQWidget *tqparent = 0, const char *name = 0); ~KTNEFView(); void setAttachments(TQPtrList *list); diff --git a/ktnef/gui/messagepropertydialog.cpp b/ktnef/gui/messagepropertydialog.cpp index a2b1f75f9..075b4823b 100644 --- a/ktnef/gui/messagepropertydialog.cpp +++ b/ktnef/gui/messagepropertydialog.cpp @@ -22,8 +22,8 @@ #include #include -MessagePropertyDialog::MessagePropertyDialog( TQWidget *parent, KTNEFMessage *msg ) - : KDialogBase( parent, "MessagePropertyDialog", true, i18n( "Message Properties" ), +MessagePropertyDialog::MessagePropertyDialog( TQWidget *tqparent, KTNEFMessage *msg ) + : KDialogBase( tqparent, "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 7d1ee7aa6..d7db44def 100644 --- a/ktnef/gui/messagepropertydialog.h +++ b/ktnef/gui/messagepropertydialog.h @@ -26,8 +26,9 @@ class KTNEFMessage; class MessagePropertyDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - MessagePropertyDialog( TQWidget *parent, KTNEFMessage *msg ); + MessagePropertyDialog( TQWidget *tqparent, KTNEFMessage *msg ); protected slots: void slotUser1(); diff --git a/ktnef/gui/metafuncs.h b/ktnef/gui/metafuncs.h index 8675851e0..e8f1232de 100644 --- a/ktnef/gui/metafuncs.h +++ b/ktnef/gui/metafuncs.h @@ -4,86 +4,86 @@ #ifndef metafunc_h #define metafunc_h -class QWinMetaFile; +class TQWinMetaFile; static const struct MetaFuncRec { const char* name; unsigned short func; - void ( QWinMetaFile::*method )( long, short* ); + void ( TQWinMetaFile::*method )( long, short* ); } metaFuncTab[] = { - { "SETBKCOLOR", 0x0201, &QWinMetaFile::setBkColor }, - { "SETBKMODE", 0x0102, &QWinMetaFile::setBkMode }, - { "SETMAPMODE", 0x0103, &QWinMetaFile::noop }, - { "SETROP2", 0x0104, &QWinMetaFile::setRop }, - { "SETRELABS", 0x0105, &QWinMetaFile::noop }, - { "SETPOLYFILLMODE", 0x0106, &QWinMetaFile::setPolyFillMode }, - { "SETSTRETCHBLTMODE", 0x0107, &QWinMetaFile::noop }, - { "SETTEXTCHAREXTRA", 0x0108, &QWinMetaFile::noop }, - { "SETTEXTCOLOR", 0x0209, &QWinMetaFile::setTextColor }, - { "SETTEXTJUSTIFICATION", 0x020A, &QWinMetaFile::noop }, - { "SETWINDOWORG", 0x020B, &QWinMetaFile::setWindowOrg }, - { "SETWINDOWEXT", 0x020C, &QWinMetaFile::setWindowExt }, - { "SETVIEWPORTORG", 0x020D, &QWinMetaFile::noop }, - { "SETVIEWPORTEXT", 0x020E, &QWinMetaFile::noop }, - { "OFFSETWINDOWORG", 0x020F, &QWinMetaFile::noop }, - { "SCALEWINDOWEXT", 0x0410, &QWinMetaFile::noop }, - { "OFFSETVIEWPORTORG", 0x0211, &QWinMetaFile::noop }, - { "SCALEVIEWPORTEXT", 0x0412, &QWinMetaFile::noop }, - { "LINETO", 0x0213, &QWinMetaFile::lineTo }, - { "MOVETO", 0x0214, &QWinMetaFile::moveTo }, - { "EXCLUDECLIPRECT", 0x0415, &QWinMetaFile::excludeClipRect }, - { "INTERSECTCLIPRECT", 0x0416, &QWinMetaFile::intersectClipRect }, - { "ARC", 0x0817, &QWinMetaFile::arc }, - { "ELLIPSE", 0x0418, &QWinMetaFile::ellipse }, - { "FLOODFILL", 0x0419, &QWinMetaFile::noop }, - { "PIE", 0x081A, &QWinMetaFile::pie }, - { "RECTANGLE", 0x041B, &QWinMetaFile::rectangle }, - { "ROUNDRECT", 0x061C, &QWinMetaFile::roundRect }, - { "PATBLT", 0x061D, &QWinMetaFile::noop }, - { "SAVEDC", 0x001E, &QWinMetaFile::saveDC }, - { "SETPIXEL", 0x041F, &QWinMetaFile::setPixel }, - { "OFFSETCLIPRGN", 0x0220, &QWinMetaFile::noop }, - { "TEXTOUT", 0x0521, &QWinMetaFile::textOut }, - { "BITBLT", 0x0922, &QWinMetaFile::noop }, - { "STRETCHBLT", 0x0B23, &QWinMetaFile::noop }, - { "POLYGON", 0x0324, &QWinMetaFile::polygon }, - { "POLYLINE", 0x0325, &QWinMetaFile::polyline }, - { "ESCAPE", 0x0626, &QWinMetaFile::noop }, - { "RESTOREDC", 0x0127, &QWinMetaFile::restoreDC }, - { "FILLREGION", 0x0228, &QWinMetaFile::noop }, - { "FRAMEREGION", 0x0429, &QWinMetaFile::noop }, - { "INVERTREGION", 0x012A, &QWinMetaFile::noop }, - { "PAINTREGION", 0x012B, &QWinMetaFile::noop }, - { "SELECTCLIPREGION", 0x012C, &QWinMetaFile::noop }, - { "SELECTOBJECT", 0x012D, &QWinMetaFile::selectObject }, - { "SETTEXTALIGN", 0x012E, &QWinMetaFile::setTextAlign }, - { "CHORD", 0x0830, &QWinMetaFile::chord }, - { "SETMAPPERFLAGS", 0x0231, &QWinMetaFile::noop }, - { "EXTTEXTOUT", 0x0a32, &QWinMetaFile::extTextOut }, - { "SETDIBTODEV", 0x0d33, &QWinMetaFile::noop }, - { "SELECTPALETTE", 0x0234, &QWinMetaFile::noop }, - { "REALIZEPALETTE", 0x0035, &QWinMetaFile::noop }, - { "ANIMATEPALETTE", 0x0436, &QWinMetaFile::noop }, - { "SETPALENTRIES", 0x0037, &QWinMetaFile::noop }, - { "POLYPOLYGON", 0x0538, &QWinMetaFile::polyPolygon }, - { "RESIZEPALETTE", 0x0139, &QWinMetaFile::noop }, - { "DIBBITBLT", 0x0940, &QWinMetaFile::dibBitBlt }, - { "DIBSTRETCHBLT", 0x0b41, &QWinMetaFile::dibStretchBlt }, - { "DIBCREATEPATTERNBRUSH", 0x0142, &QWinMetaFile::dibCreatePatternBrush }, - { "STRETCHDIB", 0x0f43, &QWinMetaFile::stretchDib }, - { "EXTFLOODFILL", 0x0548, &QWinMetaFile::noop }, - { "DELETEOBJECT", 0x01f0, &QWinMetaFile::deleteObject }, - { "CREATEPALETTE", 0x00f7, &QWinMetaFile::createEmptyObject }, - { "CREATEPATTERNBRUSH", 0x01F9, &QWinMetaFile::createEmptyObject }, - { "CREATEPENINDIRECT", 0x02FA, &QWinMetaFile::createPenIndirect }, - { "CREATEFONTINDIRECT", 0x02FB, &QWinMetaFile::createFontIndirect }, - { "CREATEBRUSHINDIRECT", 0x02FC, &QWinMetaFile::createBrushIndirect }, - { "CREATEREGION", 0x06FF, &QWinMetaFile::createEmptyObject }, - { "END", 0, &QWinMetaFile::end }, + { "SETBKCOLOR", 0x0201, &TQWinMetaFile::setBkColor }, + { "SETBKMODE", 0x0102, &TQWinMetaFile::setBkMode }, + { "SETMAPMODE", 0x0103, &TQWinMetaFile::noop }, + { "SETROP2", 0x0104, &TQWinMetaFile::setRop }, + { "SETRELABS", 0x0105, &TQWinMetaFile::noop }, + { "SETPOLYFILLMODE", 0x0106, &TQWinMetaFile::setPolyFillMode }, + { "SETSTRETCHBLTMODE", 0x0107, &TQWinMetaFile::noop }, + { "SETTEXTCHAREXTRA", 0x0108, &TQWinMetaFile::noop }, + { "SETTEXTCOLOR", 0x0209, &TQWinMetaFile::setTextColor }, + { "SETTEXTJUSTIFICATION", 0x020A, &TQWinMetaFile::noop }, + { "SETWINDOWORG", 0x020B, &TQWinMetaFile::setWindowOrg }, + { "SETWINDOWEXT", 0x020C, &TQWinMetaFile::setWindowExt }, + { "SETVIEWPORTORG", 0x020D, &TQWinMetaFile::noop }, + { "SETVIEWPORTEXT", 0x020E, &TQWinMetaFile::noop }, + { "OFFSETWINDOWORG", 0x020F, &TQWinMetaFile::noop }, + { "SCALEWINDOWEXT", 0x0410, &TQWinMetaFile::noop }, + { "OFFSETVIEWPORTORG", 0x0211, &TQWinMetaFile::noop }, + { "SCALEVIEWPORTEXT", 0x0412, &TQWinMetaFile::noop }, + { "LINETO", 0x0213, &TQWinMetaFile::lineTo }, + { "MOVETO", 0x0214, &TQWinMetaFile::moveTo }, + { "EXCLUDECLIPRECT", 0x0415, &TQWinMetaFile::excludeClipRect }, + { "INTERSECTCLIPRECT", 0x0416, &TQWinMetaFile::intersectClipRect }, + { "ARC", 0x0817, &TQWinMetaFile::arc }, + { "ELLIPSE", 0x0418, &TQWinMetaFile::ellipse }, + { "FLOODFILL", 0x0419, &TQWinMetaFile::noop }, + { "PIE", 0x081A, &TQWinMetaFile::pie }, + { "RECTANGLE", 0x041B, &TQWinMetaFile::rectangle }, + { "ROUNDRECT", 0x061C, &TQWinMetaFile::roundRect }, + { "PATBLT", 0x061D, &TQWinMetaFile::noop }, + { "SAVEDC", 0x001E, &TQWinMetaFile::saveDC }, + { "SETPIXEL", 0x041F, &TQWinMetaFile::setPixel }, + { "OFFSETCLIPRGN", 0x0220, &TQWinMetaFile::noop }, + { "TEXTOUT", 0x0521, &TQWinMetaFile::textOut }, + { "BITBLT", 0x0922, &TQWinMetaFile::noop }, + { "STRETCHBLT", 0x0B23, &TQWinMetaFile::noop }, + { "POLYGON", 0x0324, &TQWinMetaFile::polygon }, + { "POLYLINE", 0x0325, &TQWinMetaFile::polyline }, + { "ESCAPE", 0x0626, &TQWinMetaFile::noop }, + { "RESTOREDC", 0x0127, &TQWinMetaFile::restoreDC }, + { "FILLREGION", 0x0228, &TQWinMetaFile::noop }, + { "FRAMEREGION", 0x0429, &TQWinMetaFile::noop }, + { "INVERTREGION", 0x012A, &TQWinMetaFile::noop }, + { "PAINTREGION", 0x012B, &TQWinMetaFile::noop }, + { "SELECTCLIPREGION", 0x012C, &TQWinMetaFile::noop }, + { "SELECTOBJECT", 0x012D, &TQWinMetaFile::selectObject }, + { "SETTEXTALIGN", 0x012E, &TQWinMetaFile::setTextAlign }, + { "CHORD", 0x0830, &TQWinMetaFile::chord }, + { "SETMAPPERFLAGS", 0x0231, &TQWinMetaFile::noop }, + { "EXTTEXTOUT", 0x0a32, &TQWinMetaFile::extTextOut }, + { "SETDIBTODEV", 0x0d33, &TQWinMetaFile::noop }, + { "SELECTPALETTE", 0x0234, &TQWinMetaFile::noop }, + { "REALIZEPALETTE", 0x0035, &TQWinMetaFile::noop }, + { "ANIMATEPALETTE", 0x0436, &TQWinMetaFile::noop }, + { "SETPALENTRIES", 0x0037, &TQWinMetaFile::noop }, + { "POLYPOLYGON", 0x0538, &TQWinMetaFile::polyPolygon }, + { "RESIZEPALETTE", 0x0139, &TQWinMetaFile::noop }, + { "DIBBITBLT", 0x0940, &TQWinMetaFile::dibBitBlt }, + { "DIBSTRETCHBLT", 0x0b41, &TQWinMetaFile::dibStretchBlt }, + { "DIBCREATEPATTERNBRUSH", 0x0142, &TQWinMetaFile::dibCreatePatternBrush }, + { "STRETCHDIB", 0x0f43, &TQWinMetaFile::stretchDib }, + { "EXTFLOODFILL", 0x0548, &TQWinMetaFile::noop }, + { "DELETEOBJECT", 0x01f0, &TQWinMetaFile::deleteObject }, + { "CREATEPALETTE", 0x00f7, &TQWinMetaFile::createEmptyObject }, + { "CREATEPATTERNBRUSH", 0x01F9, &TQWinMetaFile::createEmptyObject }, + { "CREATEPENINDIRECT", 0x02FA, &TQWinMetaFile::createPenIndirect }, + { "CREATEFONTINDIRECT", 0x02FB, &TQWinMetaFile::createFontIndirect }, + { "CREATEBRUSHINDIRECT", 0x02FC, &TQWinMetaFile::createBrushIndirect }, + { "CREATEREGION", 0x06FF, &TQWinMetaFile::createEmptyObject }, + { "END", 0, &TQWinMetaFile::end }, // always the latest in the table : in case of unknown function - { NULL, 0, &QWinMetaFile::noop }, + { NULL, 0, &TQWinMetaFile::noop }, }; diff --git a/ktnef/gui/qwmf.cpp b/ktnef/gui/qwmf.cpp index f8e19411e..8f8cd4d28 100644 --- a/ktnef/gui/qwmf.cpp +++ b/ktnef/gui/qwmf.cpp @@ -33,7 +33,7 @@ bool qwmfDebug = false; #include "wmfstruct.h" #include "metafuncs.h" -#define QWMF_DEBUG 0 +#define TQWMF_DEBUG 0 class WmfCmd @@ -112,7 +112,7 @@ void WinObjFontHandle::apply( TQPainter& p ) //----------------------------------------------------------------------------- -QWinMetaFile::QWinMetaFile() +TQWinMetaFile::TQWinMetaFile() { mValid = false; mFirstCmd = NULL; @@ -122,7 +122,7 @@ QWinMetaFile::QWinMetaFile() //----------------------------------------------------------------------------- -QWinMetaFile::~QWinMetaFile() +TQWinMetaFile::~TQWinMetaFile() { if ( mFirstCmd ) delete mFirstCmd; if ( mObjHandleTab ) delete[] mObjHandleTab; @@ -130,7 +130,7 @@ QWinMetaFile::~QWinMetaFile() //----------------------------------------------------------------------------- -bool QWinMetaFile::load( const TQString &filename ) +bool TQWinMetaFile::load( const TQString &filename ) { TQFile file( filename ); @@ -155,7 +155,7 @@ bool QWinMetaFile::load( const TQString &filename ) } //----------------------------------------------------------------------------- -bool QWinMetaFile::load( TQBuffer &buffer ) +bool TQWinMetaFile::load( TQBuffer &buffer ) { TQDataStream st; WmfEnhMetaHeader eheader; @@ -169,12 +169,12 @@ bool QWinMetaFile::load( TQBuffer &buffer ) mTextAlign = 0; mRotation = 0; - mTextColor = Qt::black; + mTextColor = TQt::black; if ( mFirstCmd ) delete mFirstCmd; mFirstCmd = NULL; st.setDevice( &buffer ); - st.setByteOrder( TQDataStream::LittleEndian ); // Great, I love Qt ! + st.setByteOrder( TQDataStream::LittleEndian ); // Great, I love TQt ! //----- Read placeable metafile header st >> pheader.key; @@ -198,7 +198,7 @@ bool QWinMetaFile::load( TQBuffer &buffer ) mBBox.setRight( pheader.bbox.right ); mBBox.setBottom( pheader.bbox.bottom ); mHeaderBoundingBox = mBBox; - if ( QWMF_DEBUG ) + if ( TQWMF_DEBUG ) { kdDebug() << endl << "-------------------------------------------------" << endl; kdDebug() << "WMF Placeable Header ( " << static_cast(sizeof( pheader ) ) << "):" << endl; @@ -240,7 +240,7 @@ bool QWinMetaFile::load( TQBuffer &buffer ) st >> eheader.szlMillimeters.width; st >> eheader.szlMillimeters.height; - if ( QWMF_DEBUG ) + if ( TQWMF_DEBUG ) { kdDebug() << endl << "-------------------------------------------------" << endl; kdDebug() << "WMF Extended Header:" << endl; @@ -265,7 +265,7 @@ bool QWinMetaFile::load( TQBuffer &buffer ) st >> header.mtNoObjects; st >> header.mtMaxRecord; st >> header.mtNoParameters; - if ( QWMF_DEBUG ) { + if ( TQWMF_DEBUG ) { kdDebug() << "WMF Header: " << "mtSize=" << header.mtSize << endl; } } @@ -329,7 +329,7 @@ bool QWinMetaFile::load( TQBuffer &buffer ) //----------------------------------------------------------------------------- -bool QWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) +bool TQWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) { int idx, i; WmfCmd* cmd; @@ -349,7 +349,7 @@ bool QWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) mAbsoluteCoord = absolute; mPainter.begin( aTarget ); - if ( QWMF_DEBUG ) { + if ( TQWMF_DEBUG ) { kdDebug() << "Bounding box : " << mBBox.left() << " " << mBBox.top() << " " << mBBox.right() << " " << mBBox.bottom() << endl; } @@ -364,12 +364,12 @@ bool QWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) idx = cmd->funcIndex; ( this->*metaFuncTab[ idx ].method )( cmd->numParm, cmd->parm ); - if ( QWMF_DEBUG ) { + if ( TQWMF_DEBUG ) { TQString str = "", param; if ( metaFuncTab[ idx ].name == NULL ) { str += "UNKNOWN "; } - if ( metaFuncTab[ idx ].method == &QWinMetaFile::noop ) { + if ( metaFuncTab[ idx ].method == &TQWinMetaFile::noop ) { str += "UNIMPLEMENTED "; } str += metaFuncTab[ idx ].name; @@ -389,7 +389,7 @@ bool QWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) mWindowsCoord += 1; if ( mWindowsCoord == 2 ) { kdDebug() << "DRAW ANGLES " << endl; - mPainter.setPen( Qt::white ); + mPainter.setPen( TQt::white ); mPainter.drawPoint( mBBox.left(), mBBox.top() ); mPainter.drawPoint( mBBox.right(), mBBox.bottom() ); } @@ -402,7 +402,7 @@ bool QWinMetaFile::paint( const TQPaintDevice* aTarget, bool absolute ) //----------------s------------------------------------------------------------- // Metafile painter methods //----------------------------------------------------------------------------- -void QWinMetaFile::setWindowOrg( long, short* parm ) +void TQWinMetaFile::setWindowOrg( long, short* parm ) { if ( mAbsoluteCoord ) { TQRect r = mPainter.window(); @@ -421,9 +421,9 @@ void QWinMetaFile::setWindowOrg( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::setWindowExt( long, short* parm ) +void TQWinMetaFile::setWindowExt( long, short* parm ) { - // negative value allowed for width and height : QABS() forbidden + // negative value allowed for width and height : TQABS() forbidden if ( mAbsoluteCoord ) { TQRect r = mPainter.window(); mPainter.setWindow( r.left(), r.top(), parm[ 1 ], parm[ 0 ] ); @@ -456,28 +456,28 @@ void QWinMetaFile::setWindowExt( long, short* parm ) //----------------------------------------------------------------------------- // Drawing //----------------------------------------------------------------------------- -void QWinMetaFile::lineTo( long, short* parm ) +void TQWinMetaFile::lineTo( long, short* parm ) { mPainter.lineTo( parm[ 1 ], parm[ 0 ] ); } //----------------------------------------------------------------------------- -void QWinMetaFile::moveTo( long, short* parm ) +void TQWinMetaFile::moveTo( long, short* parm ) { mPainter.moveTo( parm[ 1 ], parm[ 0 ] ); } //----------------------------------------------------------------------------- -void QWinMetaFile::ellipse( long, short* parm ) +void TQWinMetaFile::ellipse( long, short* parm ) { mPainter.drawEllipse( parm[ 3 ], parm[ 2 ], parm[ 1 ]-parm[ 3 ], parm[ 0 ]-parm[ 2 ] ); } //----------------------------------------------------------------------------- -void QWinMetaFile::polygon( long, short* parm ) +void TQWinMetaFile::polygon( long, short* parm ) { TQPointArray* pa; @@ -487,7 +487,7 @@ void QWinMetaFile::polygon( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::polyPolygon( long, short* parm ) +void TQWinMetaFile::polyPolygon( long, short* parm ) { TQRegion region; int i, j, startPolygon; @@ -512,9 +512,9 @@ void QWinMetaFile::polyPolygon( long, short* parm ) mPainter.fillRect( win.left(), win.top(), win.width(), win.height(), mPainter.brush() ); // draw polygon's border if necessary - if ( mPainter.pen().style() != Qt::NoPen ) { + if ( mPainter.pen().style() != TQt::NoPen ) { mPainter.setClipping( false ); - mPainter.setBrush( Qt::NoBrush ); + mPainter.setBrush( TQt::NoBrush ); TQPointArray* pa; int idxPolygon = 1 + parm[ 0 ]; @@ -530,7 +530,7 @@ void QWinMetaFile::polyPolygon( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::polyline( long, short* parm ) +void TQWinMetaFile::polyline( long, short* parm ) { TQPointArray* pa; @@ -540,14 +540,14 @@ void QWinMetaFile::polyline( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::rectangle( long, short* parm ) +void TQWinMetaFile::rectangle( long, short* parm ) { mPainter.drawRect( parm[ 3 ], parm[ 2 ], parm[ 1 ]-parm[ 3 ], parm[ 0 ]-parm[ 2 ] ); } //----------------------------------------------------------------------------- -void QWinMetaFile::roundRect( long, short* parm ) +void TQWinMetaFile::roundRect( long, short* parm ) { int xRnd = 0, yRnd = 0; @@ -562,7 +562,7 @@ void QWinMetaFile::roundRect( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::arc( long, short* parm ) +void TQWinMetaFile::arc( long, short* parm ) { int xCenter, yCenter, angleStart, aLength; @@ -576,7 +576,7 @@ void QWinMetaFile::arc( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::chord( long, short* parm ) +void TQWinMetaFile::chord( long, short* parm ) { int xCenter, yCenter, angleStart, aLength; @@ -590,7 +590,7 @@ void QWinMetaFile::chord( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::pie( long, short* parm ) +void TQWinMetaFile::pie( long, short* parm ) { int xCenter, yCenter, angleStart, aLength; @@ -604,29 +604,29 @@ void QWinMetaFile::pie( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::setPolyFillMode( long, short* parm ) +void TQWinMetaFile::setPolyFillMode( long, short* parm ) { mWinding = parm[ 0 ]; } //----------------------------------------------------------------------------- -void QWinMetaFile::setBkColor( long, short* parm ) +void TQWinMetaFile::setBkColor( long, short* parm ) { mPainter.setBackgroundColor( color( parm ) ); } //----------------------------------------------------------------------------- -void QWinMetaFile::setBkMode( long, short* parm ) +void TQWinMetaFile::setBkMode( long, short* parm ) { - if ( parm[ 0 ]==1 ) mPainter.setBackgroundMode( Qt::TransparentMode ); - else mPainter.setBackgroundMode( Qt::OpaqueMode ); + if ( parm[ 0 ]==1 ) mPainter.setBackgroundMode( TQt::TransparentMode ); + else mPainter.setBackgroundMode( TQt::OpaqueMode ); } //----------------------------------------------------------------------------- -void QWinMetaFile::setPixel( long, short* parm ) +void TQWinMetaFile::setPixel( long, short* parm ) { TQPen pen = mPainter.pen(); mPainter.setPen( color( parm ) ); @@ -636,21 +636,21 @@ void QWinMetaFile::setPixel( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::setRop( long, short* parm ) +void TQWinMetaFile::setRop( long, short* parm ) { - mPainter.setRasterOp( winToQtRaster( parm[ 0 ] ) ); + mPainter.setRasterOp( winToTQtRaster( parm[ 0 ] ) ); } //----------------------------------------------------------------------------- -void QWinMetaFile::saveDC( long, short* ) +void TQWinMetaFile::saveDC( long, short* ) { mPainter.save(); } //----------------------------------------------------------------------------- -void QWinMetaFile::restoreDC( long, short *parm ) +void TQWinMetaFile::restoreDC( long, short *parm ) { for ( int i=0; i > parm[ 0 ] ; i-- ) mPainter.restore(); @@ -658,7 +658,7 @@ void QWinMetaFile::restoreDC( long, short *parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::intersectClipRect( long, short* parm ) +void TQWinMetaFile::intersectClipRect( long, short* parm ) { /* TODO: better implementation : need QT 3.0.2 TQRegion region = mPainter.clipRegion(); @@ -675,7 +675,7 @@ void QWinMetaFile::intersectClipRect( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::excludeClipRect( long, short* parm ) +void TQWinMetaFile::excludeClipRect( long, short* parm ) { /* TODO: better implementation : need QT 3.0.2 TQRegion region = mPainter.clipRegion(); @@ -694,21 +694,21 @@ void QWinMetaFile::excludeClipRect( long, short* parm ) //----------------------------------------------------------------------------- // Text //----------------------------------------------------------------------------- -void QWinMetaFile::setTextColor( long, short* parm ) +void TQWinMetaFile::setTextColor( long, short* parm ) { mTextColor = color( parm ); } //----------------------------------------------------------------------------- -void QWinMetaFile::setTextAlign( long, short* parm ) +void TQWinMetaFile::setTextAlign( long, short* parm ) { mTextAlign = parm[ 0 ]; } //----------------------------------------------------------------------------- -void QWinMetaFile::textOut( long num, short* parm ) +void TQWinMetaFile::textOut( long num, short* parm ) { short *copyParm = new short[ num + 1 ]; @@ -727,7 +727,7 @@ void QWinMetaFile::textOut( long num, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::extTextOut( long num, short* parm ) +void TQWinMetaFile::extTextOut( long num, short* parm ) { char* ptStr; int x, y, width, height; @@ -773,14 +773,14 @@ void QWinMetaFile::extTextOut( long num, short* parm ) if ( ( parm[ 2 ] > 1 ) && ( num >= (idxOffset + parm[ 2 ]) ) && ( parm[ 3 ] == 0 ) ) { // offset for each char int left = x; - mPainter.drawText( left, y, width, height, Qt::AlignLeft | Qt::AlignTop, text.mid(0, 1) ); + mPainter.drawText( left, y, width, height, TQt::AlignLeft | TQt::AlignTop, text.mid(0, 1) ); for ( int i = 1; i < parm[ 2 ] ; i++ ) { left += parm[ idxOffset + i - 1 ]; - mPainter.drawText( left, y, width, height, Qt::AlignLeft | Qt::AlignTop, text.mid(i, 1) ); + mPainter.drawText( left, y, width, height, TQt::AlignLeft | TQt::AlignTop, text.mid(i, 1) ); } } else { - mPainter.drawText( x, y, width, height, Qt::AlignLeft | Qt::AlignTop, text ); + mPainter.drawText( x, y, width, height, TQt::AlignLeft | TQt::AlignTop, text ); } mPainter.restore(); @@ -792,7 +792,7 @@ void QWinMetaFile::extTextOut( long num, short* parm ) //----------------------------------------------------------------------------- // Bitmap //----------------------------------------------------------------------------- -void QWinMetaFile::dibBitBlt( long num, short* parm ) +void TQWinMetaFile::dibBitBlt( long num, short* parm ) { if ( num > 9 ) { // DIB image TQImage bmpSrc; @@ -800,7 +800,7 @@ void QWinMetaFile::dibBitBlt( long num, short* parm ) if ( dibToBmp( bmpSrc, (char*)&parm[ 8 ], (num - 8) * 2 ) ) { long raster = toDWord( parm ); - mPainter.setRasterOp( winToQtRaster( raster ) ); + mPainter.setRasterOp( winToTQtRaster( raster ) ); // wmf file allow negative width or height mPainter.save(); @@ -817,20 +817,20 @@ void QWinMetaFile::dibBitBlt( long num, short* parm ) } } else { - kdDebug() << "QWinMetaFile::dibBitBlt without image: not implemented " << endl; + kdDebug() << "TQWinMetaFile::dibBitBlt without image: not implemented " << endl; } } //----------------------------------------------------------------------------- -void QWinMetaFile::dibStretchBlt( long num, short* parm ) +void TQWinMetaFile::dibStretchBlt( long num, short* parm ) { TQImage bmpSrc; if ( dibToBmp( bmpSrc, (char*)&parm[ 10 ], (num - 10) * 2 ) ) { long raster = toDWord( parm ); - mPainter.setRasterOp( winToQtRaster( raster ) ); + mPainter.setRasterOp( winToTQtRaster( raster ) ); // wmf file allow negative width or height mPainter.save(); @@ -852,14 +852,14 @@ void QWinMetaFile::dibStretchBlt( long num, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::stretchDib( long num, short* parm ) +void TQWinMetaFile::stretchDib( long num, short* parm ) { TQImage bmpSrc; if ( dibToBmp( bmpSrc, (char*)&parm[ 11 ], (num - 11) * 2 ) ) { long raster = toDWord( parm ); - mPainter.setRasterOp( winToQtRaster( raster ) ); + mPainter.setRasterOp( winToTQtRaster( raster ) ); // wmf file allow negative width or height mPainter.save(); @@ -881,7 +881,7 @@ void QWinMetaFile::stretchDib( long num, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::dibCreatePatternBrush( long num, short* parm ) +void TQWinMetaFile::dibCreatePatternBrush( long num, short* parm ) { WinObjPatternBrushHandle* handle = new WinObjPatternBrushHandle; addHandle( handle ); @@ -897,7 +897,7 @@ void QWinMetaFile::dibCreatePatternBrush( long num, short* parm ) //----------------------------------------------------------------------------- // Object handle //----------------------------------------------------------------------------- -void QWinMetaFile::selectObject( long, short* parm ) +void TQWinMetaFile::selectObject( long, short* parm ) { int idx = parm[ 0 ]; if ( idx>=0 && idx < MAX_OBJHANDLE && mObjHandleTab[ idx ] ) @@ -906,45 +906,45 @@ void QWinMetaFile::selectObject( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::deleteObject( long, short* parm ) +void TQWinMetaFile::deleteObject( long, short* parm ) { deleteHandle( parm[ 0 ] ); } //----------------------------------------------------------------------------- -void QWinMetaFile::createEmptyObject( long, short* ) +void TQWinMetaFile::createEmptyObject( long, short* ) { // allocation of an empty object (to keep object counting in sync) WinObjPenHandle* handle = new WinObjPenHandle; addHandle( handle ); - kdDebug() << "QWinMetaFile: unimplemented createObject " << endl; + kdDebug() << "TQWinMetaFile: unimplemented createObject " << endl; } //----------------------------------------------------------------------------- -void QWinMetaFile::createBrushIndirect( long, short* parm ) +void TQWinMetaFile::createBrushIndirect( long, short* parm ) { - static Qt::BrushStyle hatchedStyleTab[] = + static TQt::BrushStyle hatchedStyleTab[] = { - Qt::HorPattern, - Qt::FDiagPattern, - Qt::BDiagPattern, - Qt::CrossPattern, - Qt::DiagCrossPattern + TQt::HorPattern, + TQt::FDiagPattern, + TQt::BDiagPattern, + TQt::CrossPattern, + TQt::DiagCrossPattern }; - static Qt::BrushStyle styleTab[] = - { Qt::SolidPattern, - Qt::NoBrush, - Qt::FDiagPattern, /* hatched */ - Qt::Dense4Pattern, /* should be custom bitmap pattern */ - Qt::HorPattern, /* should be BS_INDEXED (?) */ - Qt::VerPattern, /* should be device-independent bitmap */ - Qt::Dense6Pattern, /* should be device-independent packed-bitmap */ - Qt::Dense2Pattern, /* should be BS_PATTERN8x8 */ - Qt::Dense3Pattern /* should be device-independent BS_DIBPATTERN8x8 */ + static TQt::BrushStyle styleTab[] = + { TQt::SolidPattern, + TQt::NoBrush, + TQt::FDiagPattern, /* hatched */ + TQt::Dense4Pattern, /* should be custom bitmap pattern */ + TQt::HorPattern, /* should be BS_INDEXED (?) */ + TQt::VerPattern, /* should be tqdevice-independent bitmap */ + TQt::Dense6Pattern, /* should be tqdevice-independent packed-bitmap */ + TQt::Dense2Pattern, /* should be BS_PATTERN8x8 */ + TQt::Dense3Pattern /* should be tqdevice-independent BS_DIBPATTERN8x8 */ }; - Qt::BrushStyle style; + TQt::BrushStyle style; short arg; WinObjBrushHandle* handle = new WinObjBrushHandle; addHandle( handle ); @@ -956,16 +956,16 @@ void QWinMetaFile::createBrushIndirect( long, short* parm ) if ( arg>=0 && arg<5 ) style = hatchedStyleTab[ arg ]; else { - kdDebug() << "QWinMetaFile::createBrushIndirect: invalid hatched brush " << arg << endl; - style = Qt::SolidPattern; + kdDebug() << "TQWinMetaFile::createBrushIndirect: invalid hatched brush " << arg << endl; + style = TQt::SolidPattern; } } else if ( arg>=0 && arg<9 ) style = styleTab[ arg ]; else { - kdDebug() << "QWinMetaFile::createBrushIndirect: invalid brush " << arg << endl; - style = Qt::SolidPattern; + kdDebug() << "TQWinMetaFile::createBrushIndirect: invalid brush " << arg << endl; + style = TQt::SolidPattern; } handle->brush.setStyle( style ); handle->brush.setColor( color( parm+1 ) ); @@ -973,28 +973,28 @@ void QWinMetaFile::createBrushIndirect( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::createPenIndirect( long, short* parm ) +void TQWinMetaFile::createPenIndirect( long, short* parm ) { - static Qt::PenStyle styleTab[] = - { Qt::SolidLine, Qt::DashLine, Qt::DotLine, Qt::DashDotLine, Qt::DashDotDotLine, - Qt::NoPen, Qt::SolidLine }; - Qt::PenStyle style; + static TQt::PenStyle styleTab[] = + { TQt::SolidLine, TQt::DashLine, TQt::DotLine, TQt::DashDotLine, TQt::DashDotDotLine, + TQt::NoPen, TQt::SolidLine }; + TQt::PenStyle style; WinObjPenHandle* handle = new WinObjPenHandle; addHandle( handle ); if ( parm[ 0 ]>=0 && parm[ 0 ]<6 ) style=styleTab[ parm[ 0 ] ]; else { - kdDebug() << "QWinMetaFile::createPenIndirect: invalid pen " << parm[ 0 ] << endl; - style = Qt::SolidLine; + kdDebug() << "TQWinMetaFile::createPenIndirect: invalid pen " << parm[ 0 ] << endl; + style = TQt::SolidLine; } handle->pen.setStyle( style ); handle->pen.setColor( color( parm+3 ) ); - handle->pen.setCapStyle( Qt::RoundCap ); + handle->pen.setCapStyle( TQt::RoundCap ); //int width = 0; - // TODO : width of pen proportional to device context width + // TODO : width of pen proportional to tqdevice context width // DOESN'T WORK /* TQRect devRec; @@ -1010,7 +1010,7 @@ void QWinMetaFile::createPenIndirect( long, short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::createFontIndirect( long , short* parm) +void TQWinMetaFile::createFontIndirect( long , short* parm) { WinObjFontHandle* handle = new WinObjFontHandle; addHandle( handle ); @@ -1022,7 +1022,7 @@ void QWinMetaFile::createFontIndirect( long , short* parm) handle->font.setFamily( family ); handle->font.setFixedPitch( ((parm[ 8 ] & 0x01) == 0) ); // TODO: investigation why some test case need -2. (size of font in logical point) - handle->font.setPointSize( QABS(parm[ 0 ]) - 2 ); + handle->font.setPointSize( TQABS(parm[ 0 ]) - 2 ); handle->font.setWeight( (parm[ 4 ] >> 3) ); handle->font.setItalic( (parm[ 5 ] & 0x01) ); handle->font.setUnderline( (parm[ 5 ] & 0x100) ); @@ -1032,12 +1032,12 @@ void QWinMetaFile::createFontIndirect( long , short* parm) //----------------------------------------------------------------------------- // Misc //----------------------------------------------------------------------------- -void QWinMetaFile::noop( long, short* ) +void TQWinMetaFile::noop( long, short* ) { } -void QWinMetaFile::end( long, short* ) +void TQWinMetaFile::end( long, short* ) { // end of file : // kdDebug() << "END bbox=( " << mBBox.left() << "; " << mBBox.top() << "; " << mBBox.width() << "; " << mBBox.height() << ")" << endl; @@ -1045,7 +1045,7 @@ void QWinMetaFile::end( long, short* ) //----------------------------------------------------------------------------- -unsigned short QWinMetaFile::calcCheckSum( WmfPlaceableHeader* apmfh ) +unsigned short TQWinMetaFile::calcCheckSum( WmfPlaceableHeader* apmfh ) { WORD* lpWord; WORD wResult, i; @@ -1062,7 +1062,7 @@ unsigned short QWinMetaFile::calcCheckSum( WmfPlaceableHeader* apmfh ) //----------------------------------------------------------------------------- -int QWinMetaFile::findFunc( unsigned short aFunc ) const +int TQWinMetaFile::findFunc( unsigned short aFunc ) const { int i; @@ -1074,7 +1074,7 @@ int QWinMetaFile::findFunc( unsigned short aFunc ) const } //----------------------------------------------------------------------------- -TQPointArray* QWinMetaFile::pointArray( short num, short* parm ) +TQPointArray* TQWinMetaFile::pointArray( short num, short* parm ) { int i; @@ -1087,7 +1087,7 @@ TQPointArray* QWinMetaFile::pointArray( short num, short* parm ) } //----------------------------------------------------------------------------- -unsigned int QWinMetaFile::toDWord( short* parm ) +unsigned int TQWinMetaFile::toDWord( short* parm ) { unsigned int l; @@ -1109,7 +1109,7 @@ unsigned int QWinMetaFile::toDWord( short* parm ) //----------------------------------------------------------------------------- -TQColor QWinMetaFile::color( short* parm ) +TQColor TQWinMetaFile::color( short* parm ) { unsigned int colorRef; int red, green, blue; @@ -1124,7 +1124,7 @@ TQColor QWinMetaFile::color( short* parm ) //----------------------------------------------------------------------------- -void QWinMetaFile::xyToAngle( int xStart, int yStart, int xEnd, int yEnd, int& angleStart, int& angleLength ) +void TQWinMetaFile::xyToAngle( int xStart, int yStart, int xEnd, int yEnd, int& angleStart, int& angleLength ) { float aStart, aLength; @@ -1138,7 +1138,7 @@ void QWinMetaFile::xyToAngle( int xStart, int yStart, int xEnd, int yEnd, int& a //----------------------------------------------------------------------------- -void QWinMetaFile::addHandle( WinObjHandle* handle ) +void TQWinMetaFile::addHandle( WinObjHandle* handle ) { int idx; @@ -1148,11 +1148,11 @@ void QWinMetaFile::addHandle( WinObjHandle* handle ) if ( idx < MAX_OBJHANDLE ) mObjHandleTab[ idx ] = handle; else - kdDebug() << "QWinMetaFile error: handle table full !" << endl; + kdDebug() << "TQWinMetaFile error: handle table full !" << endl; } //----------------------------------------------------------------------------- -void QWinMetaFile::deleteHandle( int idx ) +void TQWinMetaFile::deleteHandle( int idx ) { if ( idx >= 0 && idx < MAX_OBJHANDLE && mObjHandleTab[ idx ] ) { @@ -1162,25 +1162,25 @@ void QWinMetaFile::deleteHandle( int idx ) } //----------------------------------------------------------------------------- -Qt::RasterOp QWinMetaFile::winToQtRaster( short parm ) const +TQt::RasterOp TQWinMetaFile::winToTQtRaster( short parm ) const { - static const Qt::RasterOp opTab[] = + static const TQt::RasterOp opTab[] = { - Qt::CopyROP, - Qt::ClearROP, Qt::NandROP, Qt::NotAndROP, Qt::NotCopyROP, - Qt::AndNotROP, Qt::NotROP, Qt::XorROP, Qt::NorROP, - Qt::AndROP, Qt::NotXorROP, Qt::NopROP, Qt::NotOrROP, - Qt::CopyROP, Qt::OrNotROP, Qt::OrROP, Qt::SetROP + TQt::CopyROP, + TQt::ClearROP, TQt::NandROP, TQt::NotAndROP, TQt::NotCopyROP, + TQt::AndNotROP, TQt::NotROP, TQt::XorROP, TQt::NorROP, + TQt::AndROP, TQt::NotXorROP, TQt::NopROP, TQt::NotOrROP, + TQt::CopyROP, TQt::OrNotROP, TQt::OrROP, TQt::SetROP }; if ( parm > 0 && parm <= 16 ) return opTab[ parm ]; else - return Qt::CopyROP; + return TQt::CopyROP; } //----------------------------------------------------------------------------- -Qt::RasterOp QWinMetaFile::winToQtRaster( long parm ) const +TQt::RasterOp TQWinMetaFile::winToTQtRaster( long parm ) const { /* TODO: Ternary raster operations 0x00C000CA dest = (source AND pattern) @@ -1190,24 +1190,24 @@ Qt::RasterOp QWinMetaFile::winToQtRaster( long parm ) const static const struct OpTab { long winRasterOp; - Qt::RasterOp qtRasterOp; + TQt::RasterOp qtRasterOp; } opTab[] = { - { 0x00CC0020, Qt::CopyROP }, - { 0x00EE0086, Qt::OrROP }, - { 0x008800C6, Qt::AndROP }, - { 0x00660046, Qt::XorROP }, - { 0x00440328, Qt::AndNotROP }, - { 0x00330008, Qt::NotCopyROP }, - { 0x001100A6, Qt::NandROP }, - { 0x00C000CA, Qt::CopyROP }, - { 0x00BB0226, Qt::NotOrROP }, - { 0x00F00021, Qt::CopyROP }, - { 0x00FB0A09, Qt::CopyROP }, - { 0x005A0049, Qt::CopyROP }, - { 0x00550009, Qt::NotROP }, - { 0x00000042, Qt::ClearROP }, - { 0x00FF0062, Qt::SetROP } + { 0x00CC0020, TQt::CopyROP }, + { 0x00EE0086, TQt::OrROP }, + { 0x008800C6, TQt::AndROP }, + { 0x00660046, TQt::XorROP }, + { 0x00440328, TQt::AndNotROP }, + { 0x00330008, TQt::NotCopyROP }, + { 0x001100A6, TQt::NandROP }, + { 0x00C000CA, TQt::CopyROP }, + { 0x00BB0226, TQt::NotOrROP }, + { 0x00F00021, TQt::CopyROP }, + { 0x00FB0A09, TQt::CopyROP }, + { 0x005A0049, TQt::CopyROP }, + { 0x00550009, TQt::NotROP }, + { 0x00000042, TQt::ClearROP }, + { 0x00FF0062, TQt::SetROP } }; int i; @@ -1218,11 +1218,11 @@ Qt::RasterOp QWinMetaFile::winToQtRaster( long parm ) const if ( i < 15 ) return opTab[ i ].qtRasterOp; else - return Qt::CopyROP; + return TQt::CopyROP; } //----------------------------------------------------------------------------- -bool QWinMetaFile::dibToBmp( TQImage& bmp, const char* dib, long size ) +bool TQWinMetaFile::dibToBmp( TQImage& bmp, const char* dib, long size ) { typedef struct _BMPFILEHEADER { WORD bmType; @@ -1245,7 +1245,7 @@ bool QWinMetaFile::dibToBmp( TQImage& bmp, const char* dib, long size ) bmpHeader->bmSize = sizeBmp; if ( !bmp.loadFromData( (const uchar*)bmpHeader, pattern.size(), "BMP" ) ) { - kdDebug() << "QWinMetaFile::dibToBmp: invalid bitmap " << endl; + kdDebug() << "TQWinMetaFile::dibToBmp: invalid bitmap " << endl; return false; } else { diff --git a/ktnef/gui/qwmf.h b/ktnef/gui/qwmf.h index 5717b3938..2ac861d77 100644 --- a/ktnef/gui/qwmf.h +++ b/ktnef/gui/qwmf.h @@ -37,21 +37,21 @@ class WinObjBrushHandle; struct WmfPlaceableHeader; /** - * QWinMetaFile is a WMF viewer based on QT toolkit - * How to use QWinMetaFile : + * TQWinMetaFile is a WMF viewer based on QT toolkit + * How to use TQWinMetaFile : * #include "qwmf.h" - * QWinMetaFile wmf; + * TQWinMetaFile wmf; * TQPicture pic; // or TQImage pic; * if ( wmf.load( filename ) *   wmf.paint( &pic ); */ -class QWinMetaFile +class TQWinMetaFile { public: - QWinMetaFile(); - virtual ~QWinMetaFile(); + TQWinMetaFile(); + virtual ~TQWinMetaFile(); /** * Load WMF file. Returns true on success. @@ -60,7 +60,7 @@ public: virtual bool load( TQBuffer &buffer ); /** - * Paint metafile to given paint-device using absolute or relative coordinate. + * Paint metafile to given paint-tqdevice using absolute or relative coordinate. * abosute coord. reset the world transfomation Matrix * relative coord. use the existing world transfomation Matrix * Returns true on success. @@ -124,9 +124,9 @@ public: // should be protected but cannot void setPixel( long num, short* parms ); // Set raster operation mode void setRop( long num, short* parms ); - /* save device context */ + /* save tqdevice context */ void saveDC( long num, short* parms ); - /* restore device context */ + /* restore tqdevice context */ void restoreDC( long num, short* parms ); /* clipping region is the intersection of this region and the original region */ void intersectClipRect( long num, short* parms ); @@ -198,8 +198,8 @@ protected: void deleteHandle( int ); /** Convert windows rasterOp in QT rasterOp */ - Qt::RasterOp winToQtRaster( short parm ) const; - Qt::RasterOp winToQtRaster( long parm ) const; + TQt::RasterOp winToTQtRaster( short parm ) const; + TQt::RasterOp winToTQtRaster( long parm ) const; /** Converts DIB to BMP */ bool dibToBmp( TQImage& bmp, const char* dib, long size); diff --git a/ktnef/gui/wmfstruct.h b/ktnef/gui/wmfstruct.h index 33a4a67c2..5e50f022e 100644 --- a/ktnef/gui/wmfstruct.h +++ b/ktnef/gui/wmfstruct.h @@ -43,7 +43,7 @@ struct WmfEnhMetaHeader DWORD iType; // Record type EMR_HEADER DWORD nSize; // Record size in bytes. This may be greater // than the sizeof( ENHMETAHEADER ). - RECTL rclBounds; // Inclusive-inclusive bounds in device units + RECTL rclBounds; // Inclusive-inclusive bounds in tqdevice units RECTL rclFrame; // Inclusive-inclusive Picture Frame of metafile // in .01 mm units DWORD dSignature; // Signature. Must be ENHMETA_SIGNATURE. @@ -58,8 +58,8 @@ struct WmfEnhMetaHeader DWORD offDescription; // Offset to the metafile description record. // This is 0 if there is no description string DWORD nPalEntries; // Number of entries in the metafile palette. - SIZEL szlDevice; // Size of the reference device in pels - SIZEL szlMillimeters; // Size of the reference device in millimeters + SIZEL szlDevice; // Size of the reference tqdevice in pels + SIZEL szlMillimeters; // Size of the reference tqdevice in millimeters }; #define ENHMETA_SIGNATURE 0x464D4520 diff --git a/ktnef/ktnef/ktnefdefs.h b/ktnef/ktnef/ktnefdefs.h index d2e57aa58..06ec3bdbb 100644 --- a/ktnef/ktnef/ktnefdefs.h +++ b/ktnef/ktnef/ktnefdefs.h @@ -85,7 +85,7 @@ #define MAPI_TAG_DATA 0x3701 #define MAPI_TAG_ATTACHENCODING 0x3702 #define MAPI_TAG_EXTENSION 0x3703 -#define MAPI_TAG_ATTACHQT_METHOD 0x3705 +#define MAPI_TAG_ATTACHTQT_METHOD 0x3705 #define MAPI_TAG_RENDERINGPOS 0x370b #define MAPI_TAG_MIMETAG 0x370e #define MAPI_TAG_ATTACHFLAGS 0x3714 diff --git a/ktnef/ktnef/ktnefparser.h b/ktnef/ktnef/ktnefparser.h index ff48ab083..06754df55 100644 --- a/ktnef/ktnef/ktnefparser.h +++ b/ktnef/ktnef/ktnefparser.h @@ -34,7 +34,7 @@ public: ~KTNEFParser(); bool openFile(const TQString& filename); - bool openDevice( TQIODevice *device ); + bool openDevice( TQIODevice *tqdevice ); bool extractFile(const TQString& filename); bool extractFileTo(const TQString& filename, const TQString& dirname); bool extractAll(); diff --git a/ktnef/ktnef/ktnefpropertyset.h b/ktnef/ktnef/ktnefpropertyset.h index 841cf950b..6a5ec75a6 100644 --- a/ktnef/ktnef/ktnefpropertyset.h +++ b/ktnef/ktnef/ktnefpropertyset.h @@ -32,8 +32,8 @@ public: /* MAPI properties interface */ void addProperty( int key, int type, const TQVariant& value, const TQVariant& name = TQVariant(), bool overwrite = false ); - TQString findProp( int key, const TQString& fallback=TQString::null, bool convertToUpper=false); - TQString findNamedProp(const TQString& name, const TQString& fallback=TQString::null, bool convertToUpper=false); + TQString findProp( int key, const TQString& fallback=TQString(), bool convertToUpper=false); + TQString findNamedProp(const TQString& name, const TQString& fallback=TQString(), bool convertToUpper=false); TQMap& properties(); const TQMap& properties() const; TQVariant property( int key ) const; diff --git a/ktnef/lib/ktnefmessage.cpp b/ktnef/lib/ktnefmessage.cpp index 8f2648c3a..8a8bf0655 100644 --- a/ktnef/lib/ktnefmessage.cpp +++ b/ktnef/lib/ktnefmessage.cpp @@ -70,7 +70,7 @@ TQString KTNEFMessage::rtfString() { TQVariant prop = property( 0x1009 ); if ( prop.isNull() || prop.type() != TQVariant::ByteArray) - return TQString::null; + return TQString(); else { TQByteArray rtf; diff --git a/ktnef/lib/ktnefparser.cpp b/ktnef/lib/ktnefparser.cpp index a73a1d547..cd0063466 100644 --- a/ktnef/lib/ktnefparser.cpp +++ b/ktnef/lib/ktnefparser.cpp @@ -70,7 +70,7 @@ public: defaultdir_ = "/tmp/"; current_ = 0; deleteDevice_ = false; - device_ = 0; + tqdevice_ = 0; message_ = new KTNEFMessage; } ~ParserPrivate() @@ -79,7 +79,7 @@ public: } TQDataStream stream_; - TQIODevice *device_; + TQIODevice *tqdevice_; bool deleteDevice_; TQString defaultdir_; KTNEFAttach *current_; @@ -105,8 +105,8 @@ KTNEFMessage* KTNEFParser::message() const void KTNEFParser::deleteDevice() { if ( d->deleteDevice_ ) - delete d->device_; - d->device_ = 0; + delete d->tqdevice_; + d->tqdevice_ = 0; d->deleteDevice_ = false; } @@ -124,7 +124,7 @@ bool KTNEFParser::decodeMessage() // read data length d->stream_ >> i2; // offset after reading the value - off = d->device_->at() + i2; + off = d->tqdevice_->at() + i2; switch ( tag ) { case attAIDOWNER: @@ -158,9 +158,9 @@ bool KTNEFParser::decodeMessage() kdDebug() << "Message MAPI Properties" << " (length=" << i2 << ")" << endl; { int nProps = d->message_->properties().count(); - i2 += d->device_->at(); + i2 += d->tqdevice_->at(); readMAPIProperties( d->message_->properties(), 0 ); - d->device_->at( i2 ); + d->tqdevice_->at( i2 ); kdDebug() << "Properties: " << d->message_->properties().count() << endl; value = TQString( "< %1 properties >" ).arg( d->message_->properties().count() - nProps ); } @@ -171,7 +171,7 @@ bool KTNEFParser::decodeMessage() break; case attFROM: d->message_->addProperty( 0x0024, MAPI_TYPE_STRING8, readTNEFAddress( d->stream_ ) ); - d->device_->at( d->device_->at() - i2 ); + d->tqdevice_->at( d->tqdevice_->at() - i2 ); value = readTNEFData( d->stream_, i2 ); kdDebug() << "Message From" << " (length=" << i2 << ")" << endl; break; @@ -198,7 +198,7 @@ bool KTNEFParser::decodeMessage() d->message_->addProperty( 0x0E07, MAPI_TYPE_ULONG, flag ); value = c; } - kdDebug() << "Message Status" << " (length=" << i2 << ")" << endl; + kdDebug() << "Message tqStatus" << " (length=" << i2 << ")" << endl; break; case attRECIPTABLE: { @@ -212,7 +212,7 @@ bool KTNEFParser::decodeMessage() recipTable << formatRecipient( props ); } d->message_->addProperty( 0x0E12, MAPI_TYPE_STRING8, recipTable ); - d->device_->at( d->device_->at() - i2 ); + d->tqdevice_->at( d->tqdevice_->at() - i2 ); value = readTNEFData( d->stream_, i2 ); } kdDebug() << "Message Recipient Table" << " (length=" << i2 << ")" << endl; @@ -242,13 +242,13 @@ bool KTNEFParser::decodeMessage() break; } // skip data - if ( d->device_->at() != off && !d->device_->at( off ) ) + if ( d->tqdevice_->at() != off && !d->tqdevice_->at( off ) ) return false; // get checksum d->stream_ >> u; // add TNEF attribute d->message_->addAttribute( tag, type, value, true ); - //kdDebug() << "stream: " << d->device_->at() << endl; + //kdDebug() << "stream: " << d->tqdevice_->at() << endl; return true; } @@ -273,15 +273,15 @@ bool KTNEFParser::decodeAttachment() break; case attATTACHDATA: d->current_->setSize( i ); - d->current_->setOffset( d->device_->at() ); - d->device_->at( d->device_->at() + i ); + d->current_->setOffset( d->tqdevice_->at() ); + d->tqdevice_->at( d->tqdevice_->at() + i ); value = TQString( "< size=%1 >" ).arg( i ); kdDebug() << "Attachment Data: size=" << i << endl; break; case attATTACHMENT: // try to get attachment info - i += d->device_->at(); + i += d->tqdevice_->at(); readMAPIProperties( d->current_->properties(), d->current_ ); - d->device_->at( i ); + d->tqdevice_->at( i ); d->current_->setIndex( d->current_->property( MAPI_TAG_INDEX ).toUInt() ); d->current_->setDisplaySize( d->current_->property( MAPI_TAG_SIZE ).toUInt() ); str = d->current_->property( MAPI_TAG_DISPLAYNAME ).toString(); @@ -305,7 +305,7 @@ bool KTNEFParser::decodeAttachment() case attATTACHMETAFILE: kdDebug() << "Attachment Metafile: size=" << i << endl; //value = TQString( "< size=%1 >" ).arg( i ); - //d->device_->at( d->device_->at()+i ); + //d->tqdevice_->at( d->tqdevice_->at()+i ); value = readTNEFData( d->stream_, i ); break; default: @@ -316,7 +316,7 @@ bool KTNEFParser::decodeAttachment() d->stream_ >> u; // u <- checksum // add TNEF attribute d->current_->addAttribute( tag, type, value, true ); - //kdDebug() << "stream: " << d->device_->at() << endl; + //kdDebug() << "stream: " << d->tqdevice_->at() << endl; return true; } @@ -339,19 +339,19 @@ bool KTNEFParser::parseDevice() d->current_ = 0; } - if ( !d->device_->open( IO_ReadOnly ) ) { - kdDebug() << "Couldn't open device" << endl; + if ( !d->tqdevice_->open( IO_ReadOnly ) ) { + kdDebug() << "Couldn't open tqdevice" << endl; return false; } - d->stream_.setDevice( d->device_ ); + d->stream_.setDevice( d->tqdevice_ ); d->stream_.setByteOrder( TQDataStream::LittleEndian ); d->stream_ >> i; if (i == TNEF_SIGNATURE) { d->stream_ >> u; kdDebug().form( "Attachment cross reference key: 0x%04x\n",u ); - //kdDebug() << "stream: " << d->device_->at() << endl; + //kdDebug() << "stream: " << d->tqdevice_->at() << endl; while (!d->stream_.eof()) { d->stream_ >> c; @@ -364,7 +364,7 @@ bool KTNEFParser::parseDevice() if (!decodeAttachment()) goto end; break; default: - kdDebug() << "Unknown Level: " << c << ", at offset " << d->device_->at() << endl; + kdDebug() << "Unknown Level: " << c << ", at offset " << d->tqdevice_->at() << endl; goto end; } } @@ -381,7 +381,7 @@ bool KTNEFParser::parseDevice() else { kdDebug() << "This is not a TNEF file" << endl; -end: d->device_->close(); +end: d->tqdevice_->close(); return false; } } @@ -395,10 +395,10 @@ bool KTNEFParser::extractFile(const TQString& filename) bool KTNEFParser::extractAttachmentTo(KTNEFAttach *att, const TQString& dirname) { - QString filename = dirname + "/" + att->name(); - if (!d->device_->isOpen()) + TQString filename = dirname + "/" + att->name(); + if (!d->tqdevice_->isOpen()) return false; - if (!d->device_->at(att->offset())) + if (!d->tqdevice_->at(att->offset())) return false; KSaveFile saveFile( filename ); TQFile *outfile = saveFile.file(); @@ -411,7 +411,7 @@ bool KTNEFParser::extractAttachmentTo(KTNEFAttach *att, const TQString& dirname) bool ok(true); while (ok && len > 0) { - n = d->device_->readBlock(buf,QMIN(sz,len)); + n = d->tqdevice_->readBlock(buf,TQMIN(sz,len)); if (n < 0) ok = false; else @@ -447,15 +447,15 @@ bool KTNEFParser::openFile(const TQString& filename) deleteDevice(); delete d->message_; d->message_ = new KTNEFMessage(); - d->device_ = new TQFile( filename ); + d->tqdevice_ = new TQFile( filename ); d->deleteDevice_ = true; return parseDevice(); } -bool KTNEFParser::openDevice( TQIODevice *device ) +bool KTNEFParser::openDevice( TQIODevice *tqdevice ) { deleteDevice(); - d->device_ = device; + d->tqdevice_ = tqdevice; return parseDevice(); } @@ -478,16 +478,16 @@ void KTNEFParser::checkCurrent( int key ) // and/or content (using at most 32 bytes) KMimeType::Ptr mimetype; if ( !d->current_->fileName().isEmpty() ) - mimetype = KMimeType::tqfindByPath( d->current_->fileName(), 0, true ); + mimetype = KMimeType::findByPath( d->current_->fileName(), 0, true ); if (!mimetype) return; // FIXME if ( mimetype->name() == "application/octet-stream" && d->current_->size() > 0 ) { - int oldOffset = d->device_->at(); - TQByteArray buffer( QMIN( 32, d->current_->size() ) ); - d->device_->at( d->current_->offset() ); - d->device_->readBlock( buffer.data(), buffer.size() ); - mimetype = KMimeType::tqfindByContent( buffer ); - d->device_->at( oldOffset ); + int oldOffset = d->tqdevice_->at(); + TQByteArray buffer( TQMIN( 32, d->current_->size() ) ); + d->tqdevice_->at( d->current_->offset() ); + d->tqdevice_->readBlock( buffer.data(), buffer.size() ); + mimetype = KMimeType::findByContent( buffer ); + d->tqdevice_->at( oldOffset ); } d->current_->setMimeTag( mimetype->name() ); } @@ -554,11 +554,11 @@ TQString formatRecipient( const TQMap& props ) { TQString s, dn, addr, t; TQMap::ConstIterator it; - if ( ( it = props.find( 0x3001 ) ) != props.end() ) + if ( ( it = props.tqfind( 0x3001 ) ) != props.end() ) dn = ( *it )->valueString(); - if ( ( it = props.find( 0x3003 ) ) != props.end() ) + if ( ( it = props.tqfind( 0x3003 ) ) != props.end() ) addr = ( *it )->valueString(); - if ( ( it = props.find( 0x0C15 ) ) != props.end() ) + if ( ( it = props.tqfind( 0x0C15 ) ) != props.end() ) switch ( ( *it )->value().toInt() ) { case 0: t = "From:"; break; @@ -791,20 +791,20 @@ bool KTNEFParser::readMAPIProperties( TQMap& props, KTNEFAtt TQByteArray data = mapi.value.toByteArray(); int len = data.size(); ALIGN( len, 4 ); - d->device_->at( d->device_->at()-len ); + d->tqdevice_->at( d->tqdevice_->at()-len ); TQ_UINT32 interface_ID; d->stream_ >> interface_ID; if ( interface_ID == MAPI_IID_IMessage ) { // embedded TNEF file attach->unsetDataParser(); - attach->setOffset( d->device_->at()+12 ); + attach->setOffset( d->tqdevice_->at()+12 ); attach->setSize( data.size()-16 ); attach->setMimeTag( "application/ms-tnef" ); attach->setDisplayName( "Embedded Message" ); kdDebug() << "MAPI Embedded Message: size=" << data.size() << endl; } - d->device_->at( d->device_->at() + ( len-4 ) ); + d->tqdevice_->at( d->tqdevice_->at() + ( len-4 ) ); break; } else if ( mapi.type == MAPI_TYPE_BINARY && attach && attach->offset() < 0 ) @@ -813,7 +813,7 @@ bool KTNEFParser::readMAPIProperties( TQMap& props, KTNEFAtt int len = mapi.value.toByteArray().size(); ALIGN( len, 4 ) attach->setSize( len ); - attach->setOffset( d->device_->at() - len ); + attach->setOffset( d->tqdevice_->at() - len ); attach->addAttribute( attATTACHDATA, atpBYTE, TQString( "< size=%1 >" ).arg( len ), false ); } } @@ -855,12 +855,12 @@ bool KTNEFParser::readMAPIProperties( TQMap& props, KTNEFAtt break; } // do not remove potential existing similar entry - if ( ( it = props.find( key ) ) == props.end() ) + if ( ( it = props.tqfind( key ) ) == props.end() ) { p = new KTNEFProperty( key, ( mapi.type & 0x0FFF ), mapi.value, mapi.name.value ); props[ p->key() ] = p; } - //kdDebug() << "stream: " << d->device_->at() << endl; + //kdDebug() << "stream: " << d->tqdevice_->at() << endl; } if ( foundAttachment && attach ) diff --git a/ktnef/lib/ktnefproperty.cpp b/ktnef/lib/ktnefproperty.cpp index df04a388d..ae43236fb 100644 --- a/ktnef/lib/ktnefproperty.cpp +++ b/ktnef/lib/ktnefproperty.cpp @@ -55,13 +55,13 @@ TQString KTNEFProperty::formatValue( const TQVariant& value, bool beautify ) // printable characters TQByteArray arr = value.toByteArray(); bool printable = true; - for ( int i=QMIN( arr.size(), 8 )-1; i>=0 && printable; i-- ) + for ( int i=TQMIN( arr.size(), 8 )-1; i>=0 && printable; i-- ) printable = ( isprint( arr[ i ] ) != 0 ); if ( !printable ) { TQString s; uint i; - uint txtCount = beautify ? QMIN( arr.size(), 32 ) : arr.size(); + uint txtCount = beautify ? TQMIN( arr.size(), 32 ) : arr.size(); for ( i=0; i < txtCount; ++i ) { s.append( TQString().sprintf( "%02X", ( uchar )arr[ i ] ) ); diff --git a/ktnef/lib/ktnefpropertyset.cpp b/ktnef/lib/ktnefpropertyset.cpp index ec3ee2b51..b67c1ffba 100644 --- a/ktnef/lib/ktnefpropertyset.cpp +++ b/ktnef/lib/ktnefpropertyset.cpp @@ -30,7 +30,7 @@ KTNEFPropertySet::~KTNEFPropertySet() void KTNEFPropertySet::addProperty( int key, int type, const TQVariant& value, const TQVariant& name, bool overwrite ) { - TQMap::ConstIterator it = properties_.find( key ); + TQMap::ConstIterator it = properties_.tqfind( key ); if ( it != properties_.end() ) { if ( overwrite ) @@ -45,7 +45,7 @@ void KTNEFPropertySet::addProperty( int key, int type, const TQVariant& value, c TQString KTNEFPropertySet::findProp(int key, const TQString& fallback, bool upper) { - TQMap::Iterator it = properties_.find( key ); + TQMap::Iterator it = properties_.tqfind( key ); if( properties_.end() != it ) return upper ? KTNEFProperty::formatValue( (*it)->value(), false ).upper() : KTNEFProperty::formatValue( (*it)->value(), false ); @@ -100,7 +100,7 @@ const TQMap& KTNEFPropertySet::properties() const TQVariant KTNEFPropertySet::property( int key ) const { - TQMap::ConstIterator it = properties_.find( key ); + TQMap::ConstIterator it = properties_.tqfind( key ); if ( it == properties_.end() ) return TQVariant(); else @@ -122,7 +122,7 @@ void KTNEFPropertySet::clear( bool deleteAll ) void KTNEFPropertySet::addAttribute( int key, int type, const TQVariant& value, bool overwrite ) { - TQMap::ConstIterator it = attributes_.find( key ); + TQMap::ConstIterator it = attributes_.tqfind( key ); if ( it != attributes_.end() ) { if ( overwrite ) @@ -146,7 +146,7 @@ const TQMap& KTNEFPropertySet::attributes() const TQVariant KTNEFPropertySet::attribute( int key ) const { - TQMap::ConstIterator it = attributes_.find( key ); + TQMap::ConstIterator it = attributes_.tqfind( key ); if ( it == attributes_.end() ) return TQVariant(); else diff --git a/ktnef/lib/ktnefwriter.cpp b/ktnef/lib/ktnefwriter.cpp index 3da4dc1e0..2264b15ec 100644 --- a/ktnef/lib/ktnefwriter.cpp +++ b/ktnef/lib/ktnefwriter.cpp @@ -100,7 +100,7 @@ TQ_UINT32 mergeTagAndType( TQ_UINT32 tag, TQ_UINT32 type ) { */ bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) { TQMap& properties = mData->properties.properties(); - TQMap::Iterator it = properties.find( tag ); + TQMap::Iterator it = properties.tqfind( tag ); if ( it == properties.end() ) return false; @@ -179,7 +179,7 @@ bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) { case attSUBJECT: case attBODY: case attMSGID: - // QCString + // TQCString cs = property->value().toString().local8Bit(); addToChecksum( cs, checksum ); @@ -236,7 +236,7 @@ bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) { case attDATESENT: case attDATERECD: case attDATEMODIFIED: - // QDateTime + // TQDateTime dt = property->value().toDateTime(); time = dt.time(); date = dt.date(); @@ -287,7 +287,7 @@ bool KTNEFWriter::writeProperty( TQDataStream &stream, int &bytes, int tag) { addToChecksum( i, checksum ); // from reader: d->message_->addProperty( 0x0E07, MAPI_TYPE_ULONG, flag ); } - kdDebug() << "Message Status" << " (length=" << i2 << ")" << endl; + kdDebug() << "Message tqStatus" << " (length=" << i2 << ")" << endl; break; */ @@ -417,7 +417,7 @@ void KTNEFWriter::addAttendee( const TQString& /*cn*/, Role /*r*/, PartStat /*p* // I assume this is the same as the sender? // U also assume that this is like "Name
" void KTNEFWriter::setOrganizer( const TQString& organizer ) { - int i = organizer.find( '<' ); + int i = organizer.tqfind( '<' ); if ( i == -1 ) return; diff --git a/ktnef/lib/mapi.cpp b/ktnef/lib/mapi.cpp index bf84f1fd7..e4f6f85cf 100644 --- a/ktnef/lib/mapi.cpp +++ b/ktnef/lib/mapi.cpp @@ -130,7 +130,7 @@ static struct { 0x8004, I18N_NOOP( "Subject" ) }, { 0x8005, I18N_NOOP( "Date Sent" ) }, { 0x8006, I18N_NOOP( "Date Received" ) }, - { 0x8007, I18N_NOOP( "Message Status" ) }, + { 0x8007, I18N_NOOP( "Message tqStatus" ) }, { 0x8008, I18N_NOOP( "Message Class" ) }, { 0x8009, I18N_NOOP( "Message ID" ) }, { 0x800A, I18N_NOOP( "Parent ID" ) }, @@ -176,7 +176,7 @@ MAPI_NamedTagStrings[] = { 0x820D, I18N_NOOP( "Appointment Start Date" ) }, { 0x820E, I18N_NOOP( "Appointment End Date" ) }, { 0x8213, I18N_NOOP( "Appointment Duration" ) }, - { 0x8218, I18N_NOOP( "Appointment Response Status" ) }, + { 0x8218, I18N_NOOP( "Appointment Response tqStatus" ) }, { 0x8223, I18N_NOOP( "Appointment Is Recurring" ) }, { 0x8231, I18N_NOOP( "Appointment Recurrence Type" ) }, { 0x8232, I18N_NOOP( "Appointment Recurrence Pattern" ) }, @@ -197,7 +197,7 @@ TQString mapiTagString( int key ) for ( int i=0; MAPI_TagStrings[ i ].str; i++ ) MAPI_TagMap[ MAPI_TagStrings[ i ].tag ] = i18n(MAPI_TagStrings[ i ].str); } - TQMap::ConstIterator it = MAPI_TagMap.find( key ); + TQMap::ConstIterator it = MAPI_TagMap.tqfind( key ); if ( it == MAPI_TagMap.end() ) return TQString().sprintf( "0x%04X", key ); else @@ -211,7 +211,7 @@ TQString mapiNamedTagString( int key, int tag ) for ( int i=0; MAPI_NamedTagStrings[ i ].str; i++ ) MAPI_NamedTagMap[ MAPI_NamedTagStrings[ i ].tag ] = i18n(MAPI_NamedTagStrings[ i ].str); } - TQMap::ConstIterator it = MAPI_NamedTagMap.find( key ); + TQMap::ConstIterator it = MAPI_NamedTagMap.tqfind( key ); if ( it == MAPI_NamedTagMap.end() ) if ( tag >= 0 ) return TQString().sprintf( "0x%04X [0x%04X]: ", tag, key ) + *it; diff --git a/ktnef/tests/mapi_attach_data_obj.tnef b/ktnef/tests/mapi_attach_data_obj.tnef index aea529ec2..2c5b64731 100644 Binary files a/ktnef/tests/mapi_attach_data_obj.tnef and b/ktnef/tests/mapi_attach_data_obj.tnef differ -- cgit v1.2.1