diff options
Diffstat (limited to 'src/gvcore')
103 files changed, 2734 insertions, 2693 deletions
diff --git a/src/gvcore/archive.cpp b/src/gvcore/archive.cpp index d3cc20b..a0e78ed 100644 --- a/src/gvcore/archive.cpp +++ b/src/gvcore/archive.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -29,7 +29,7 @@ namespace Gwenview { namespace Archive { -typedef QMap<QString,QString> MimeTypeProtocols; +typedef TQMap<TQString,TQString> MimeTypeProtocols; static const char* KDE_PROTOCOL = "X-KDE-LocalProtocol"; @@ -39,8 +39,8 @@ static const MimeTypeProtocols& mimeTypeProtocols() { KMimeType::List list = KMimeType::allMimeTypes(); KMimeType::List::Iterator it=list.begin(), end=list.end(); for (; it!=end; ++it) { - if ( (*it)->propertyNames().findIndex(KDE_PROTOCOL)!= -1 ) { - QString protocol = (*it)->property(KDE_PROTOCOL).toString(); + if ( (*it)->propertyNames().tqfindIndex(KDE_PROTOCOL)!= -1 ) { + TQString protocol = (*it)->property(KDE_PROTOCOL).toString(); map[(*it)->name()] = protocol; } } @@ -50,14 +50,14 @@ static const MimeTypeProtocols& mimeTypeProtocols() { bool fileItemIsArchive(const KFileItem* item) { - return mimeTypeProtocols().contains(item->mimetype()); + return mimeTypeProtocols().tqcontains(item->mimetype()); } bool fileItemIsDirOrArchive(const KFileItem* item) { return item->isDir() || Archive::fileItemIsArchive(item); } -bool protocolIsArchive(const QString& protocol) { +bool protocolIsArchive(const TQString& protocol) { const MimeTypeProtocols& map=mimeTypeProtocols(); MimeTypeProtocols::ConstIterator it; for (it=map.begin();it!=map.end();++it) { @@ -66,19 +66,19 @@ bool protocolIsArchive(const QString& protocol) { return false; } -QStringList mimeTypes() { +TQStringList mimeTypes() { const MimeTypeProtocols& map=mimeTypeProtocols(); MimeTypeProtocols::ConstIterator it; - QStringList strlist; + TQStringList strlist; for (it=map.begin();it!=map.end();++it) { strlist+=it.key(); } return strlist; - //return mimeTypeProtocols().keys(); // keys() does not exist in Qt 3.0 + //return mimeTypeProtocols().keys(); // keys() does not exist in TQt 3.0 } -QString protocolForMimeType(const QString& mimeType) { +TQString protocolForMimeType(const TQString& mimeType) { return mimeTypeProtocols()[mimeType]; } diff --git a/src/gvcore/archive.h b/src/gvcore/archive.h index 6e2090b..7e65c36 100644 --- a/src/gvcore/archive.h +++ b/src/gvcore/archive.h @@ -22,8 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef ARCHIVE_H #define ARCHIVE_H -// Qt includes -#include <qstringlist.h> +// TQt includes +#include <tqstringlist.h> #include "libgwenview_export.h" class KFileItem; namespace Gwenview { @@ -35,9 +35,9 @@ namespace Archive { LIBGWENVIEW_EXPORT bool fileItemIsArchive(const KFileItem*); LIBGWENVIEW_EXPORT bool fileItemIsDirOrArchive(const KFileItem*); -bool protocolIsArchive(const QString&); -QStringList mimeTypes(); -QString protocolForMimeType(const QString&); +bool protocolIsArchive(const TQString&); +TQStringList mimeTypes(); +TQString protocolForMimeType(const TQString&); } diff --git a/src/gvcore/bcgdialog.cpp b/src/gvcore/bcgdialog.cpp index 9f1486a..58f3149 100644 --- a/src/gvcore/bcgdialog.cpp +++ b/src/gvcore/bcgdialog.cpp @@ -21,9 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Self #include "bcgdialog.moc" -// Qt -#include <qslider.h> -#include <qvbox.h> +// TQt +#include <tqslider.h> +#include <tqvbox.h> // KDE #include <klocale.h> @@ -49,15 +49,15 @@ BCGDialog::BCGDialog(ImageView* view) d->mView=view; d->mContent=new BCGDialogBase(this); setMainWidget(d->mContent); - connect(d->mContent->mBSlider, SIGNAL(valueChanged(int)), - view, SLOT(setBrightness(int)) ); - connect(d->mContent->mCSlider, SIGNAL(valueChanged(int)), - view, SLOT(setContrast(int)) ); - connect(d->mContent->mGSlider, SIGNAL(valueChanged(int)), - view, SLOT(setGamma(int)) ); + connect(d->mContent->mBSlider, TQT_SIGNAL(valueChanged(int)), + view, TQT_SLOT(setBrightness(int)) ); + connect(d->mContent->mCSlider, TQT_SIGNAL(valueChanged(int)), + view, TQT_SLOT(setContrast(int)) ); + connect(d->mContent->mGSlider, TQT_SIGNAL(valueChanged(int)), + view, TQT_SLOT(setGamma(int)) ); - connect(view, SIGNAL(bcgChanged()), - this, SLOT(updateFromImageView()) ); + connect(view, TQT_SIGNAL(bcgChanged()), + this, TQT_SLOT(updateFromImageView()) ); } diff --git a/src/gvcore/bcgdialog.h b/src/gvcore/bcgdialog.h index 43e4958..d6238b4 100644 --- a/src/gvcore/bcgdialog.h +++ b/src/gvcore/bcgdialog.h @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // KDE #include <kdialogbase.h> -class QShowEvent; +class TQShowEvent; namespace Gwenview { @@ -32,6 +32,7 @@ class ImageView; class BCGDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: BCGDialog(ImageView*); ~BCGDialog(); diff --git a/src/gvcore/bcgdialogbase.ui b/src/gvcore/bcgdialogbase.ui index 81a79a3..3f992e5 100644 --- a/src/gvcore/bcgdialogbase.ui +++ b/src/gvcore/bcgdialogbase.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>BCGDialogBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>BCGDialogBase</cstring> </property> - <property name="geometry"> + <property name="tqgeometry"> <rect> <x>0</x> <y>0</y> @@ -19,7 +19,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -30,7 +30,7 @@ <cstring>mCSlider</cstring> </property> </widget> - <widget class="QLabel" row="2" column="0"> + <widget class="TQLabel" row="2" column="0"> <property name="name"> <cstring>textLabel2_2</cstring> </property> @@ -41,7 +41,7 @@ <cstring>mGSlider</cstring> </property> </widget> - <widget class="QSlider" row="0" column="1"> + <widget class="TQSlider" row="0" column="1"> <property name="name"> <cstring>mBSlider</cstring> </property> @@ -55,7 +55,7 @@ <enum>Horizontal</enum> </property> </widget> - <widget class="QSlider" row="1" column="1"> + <widget class="TQSlider" row="1" column="1"> <property name="name"> <cstring>mCSlider</cstring> </property> @@ -69,7 +69,7 @@ <enum>Horizontal</enum> </property> </widget> - <widget class="QSlider" row="2" column="1"> + <widget class="TQSlider" row="2" column="1"> <property name="name"> <cstring>mGSlider</cstring> </property> @@ -83,7 +83,7 @@ <enum>Horizontal</enum> </property> </widget> - <widget class="QSpinBox" row="0" column="2"> + <widget class="TQSpinBox" row="0" column="2"> <property name="name"> <cstring>mBSpinBox</cstring> </property> @@ -94,7 +94,7 @@ <number>-100</number> </property> </widget> - <widget class="QSpinBox" row="1" column="2"> + <widget class="TQSpinBox" row="1" column="2"> <property name="name"> <cstring>mCSpinBox</cstring> </property> @@ -105,7 +105,7 @@ <number>-100</number> </property> </widget> - <widget class="QSpinBox" row="2" column="2"> + <widget class="TQSpinBox" row="2" column="2"> <property name="name"> <cstring>mGSpinBox</cstring> </property> @@ -116,7 +116,7 @@ <number>-100</number> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -175,5 +175,5 @@ <tabstop>mGSlider</tabstop> <tabstop>mGSpinBox</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/src/gvcore/busylevelmanager.cpp b/src/gvcore/busylevelmanager.cpp index a08e146..326fdf1 100644 --- a/src/gvcore/busylevelmanager.cpp +++ b/src/gvcore/busylevelmanager.cpp @@ -19,8 +19,8 @@ Copyright 2000-2004 Aurélien Gâteau */ -// Qt -#include <qtimer.h> +// TQt +#include <tqtimer.h> // KDE #include <kdebug.h> @@ -41,8 +41,8 @@ namespace Gwenview { BusyLevelManager::BusyLevelManager() : mCurrentBusyLevel( BUSY_NONE ) { - connect( &mDelayedBusyLevelTimer, SIGNAL( timeout()), - this, SLOT( delayedBusyLevelChanged())); + connect( &mDelayedBusyLevelTimer, TQT_SIGNAL( timeout()), + this, TQT_SLOT( delayedBusyLevelChanged())); } BusyLevelManager* BusyLevelManager::instance() { @@ -64,22 +64,22 @@ BusyLevelManager* BusyLevelManager::instance() { // so if one object is responsible for more operations, // it needs to use helper objects for setBusyLevel(). -void BusyLevelManager::setBusyLevel( QObject* obj, BusyLevel level ) { +void BusyLevelManager::setBusyLevel( TQObject* obj, BusyLevel level ) { LOG("BUSY:" << level << ":" << obj << ":" << obj->className() ); if( level > BUSY_NONE ) { - if( mBusyLevels.contains( obj ) && mBusyLevels[ obj ] == level ) return; - if( !mBusyLevels.contains( obj )) { - connect( obj, SIGNAL( destroyed( QObject* )), this, SLOT( objectDestroyed( QObject* ))); + if( mBusyLevels.tqcontains( obj ) && mBusyLevels[ obj ] == level ) return; + if( !mBusyLevels.tqcontains( obj )) { + connect( obj, TQT_SIGNAL( destroyed( TQObject* )), this, TQT_SLOT( objectDestroyed( TQObject* ))); } mBusyLevels[ obj ] = level; } else { mBusyLevels.remove( obj ); - disconnect( obj, SIGNAL( destroyed( QObject* )), this, SLOT( objectDestroyed( QObject* ))); + disconnect( obj, TQT_SIGNAL( destroyed( TQObject* )), this, TQT_SLOT( objectDestroyed( TQObject* ))); } mDelayedBusyLevelTimer.start( 0, true ); } -void BusyLevelManager::objectDestroyed( QObject* obj ) { +void BusyLevelManager::objectDestroyed( TQObject* obj ) { LOG("DESTROYED:" << obj ); mBusyLevels.remove( obj ); mDelayedBusyLevelTimer.start( 0, true ); @@ -87,10 +87,10 @@ void BusyLevelManager::objectDestroyed( QObject* obj ) { void BusyLevelManager::delayedBusyLevelChanged() { BusyLevel newLevel = BUSY_NONE; - for( QMap< QObject*, BusyLevel >::ConstIterator it = mBusyLevels.begin(); + for( TQMap< TQObject*, BusyLevel >::ConstIterator it = mBusyLevels.begin(); it != mBusyLevels.end(); ++it ) { - newLevel = QMAX( newLevel, *it ); + newLevel = TQMAX( newLevel, *it ); } if( newLevel != mCurrentBusyLevel ) { diff --git a/src/gvcore/busylevelmanager.h b/src/gvcore/busylevelmanager.h index 9959c56..e1f8a43 100644 --- a/src/gvcore/busylevelmanager.h +++ b/src/gvcore/busylevelmanager.h @@ -21,8 +21,8 @@ Copyright 2000-2004 Aurélien Gâteau #ifndef BUSYLEVELMANAGER_H #define BUSYLEVELMANAGER_H -// Qt -#include <qtimer.h> +// TQt +#include <tqtimer.h> namespace Gwenview { // KDE @@ -42,15 +42,16 @@ enum BusyLevel { BUSY_CHECKING_NEW_IMAGE }; -class LIBGWENVIEW_EXPORT BusyLevelManager : public QObject { +class LIBGWENVIEW_EXPORT BusyLevelManager : public TQObject { Q_OBJECT + TQ_OBJECT public: static BusyLevelManager* instance(); /** * Announces that the given object is busy. */ - void setBusyLevel( QObject* obj, BusyLevel level ); + void setBusyLevel( TQObject* obj, BusyLevel level ); /** * Returns the busy level of the whole application (i.e. maximum). @@ -67,13 +68,13 @@ signals: private slots: void delayedBusyLevelChanged(); - void objectDestroyed( QObject* obj ); + void objectDestroyed( TQObject* obj ); private: BusyLevelManager(); - QMap< QObject*, BusyLevel > mBusyLevels; + TQMap< TQObject*, BusyLevel > mBusyLevels; BusyLevel mCurrentBusyLevel; - QTimer mDelayedBusyLevelTimer; + TQTimer mDelayedBusyLevelTimer; }; @@ -81,8 +82,9 @@ private: Helper class. Constructor sets its busy level to the given level, destructor resets the busy level to none. */ -class BusyLevelHelper : public QObject { +class BusyLevelHelper : public TQObject { Q_OBJECT + TQ_OBJECT public: BusyLevelHelper( BusyLevel level ); ~BusyLevelHelper(); diff --git a/src/gvcore/cache.cpp b/src/gvcore/cache.cpp index 99ab9fc..ccebb47 100644 --- a/src/gvcore/cache.cpp +++ b/src/gvcore/cache.cpp @@ -21,7 +21,7 @@ Copyright 2000-2004 Aurélien Gâteau #include "cache.h" -// Qt +// TQt // KDE #include <kconfig.h> @@ -52,24 +52,24 @@ const char CONFIG_CACHE_MAXSIZE[]="maxSize"; struct ImageData : public KShared { - ImageData( const KURL& url, const QDateTime& _timestamp ) + ImageData( const KURL& url, const TQDateTime& _timestamp ) : timestamp(_timestamp) , age(0) , fast_url( url.isLocalFile() && !KIO::probably_slow_mounted( url.path())) , priority( false ) { } - void addFile( const QByteArray& file ); - void addImage( const ImageFrames& frames, const QCString& format ); - void addThumbnail( const QPixmap& thumbnail, QSize imagesize ); + void addFile( const TQByteArray& file ); + void addImage( const ImageFrames& frames, const TQCString& format ); + void addThumbnail( const TQPixmap& thumbnail, TQSize imagesize ); long long cost() const; int size() const; - QByteArray file; + TQByteArray file; ImageFrames frames; - QPixmap thumbnail; - QSize imagesize; - QCString format; - QDateTime timestamp; + TQPixmap thumbnail; + TQSize imagesize; + TQCString format; + TQDateTime timestamp; mutable int age; bool fast_url; bool priority; @@ -82,28 +82,28 @@ struct ImageData : public KShared { typedef KSharedPtr<ImageData> Ptr; }; -typedef QMap<KURL, ImageData::Ptr> ImageMap; +typedef TQMap<KURL, ImageData::Ptr> ImageMap; struct Cache::Private { ImageMap mImages; int mMaxSize; int mThumbnailSize; - QValueList< KURL > mPriorityURLs; + TQValueList< KURL > mPriorityURLs; /** * This function tries to returns a valid ImageData for url and timestamp. * If it can't find one, it will create a new one and return it. */ - ImageData::Ptr getOrCreateImageData(const KURL& url, const QDateTime& timestamp) { - if (mImages.contains(url)) { + ImageData::Ptr getOrCreateImageData(const KURL& url, const TQDateTime& timestamp) { + if (mImages.tqcontains(url)) { ImageData::Ptr data = mImages[url]; if (data->timestamp == timestamp) return data; } ImageData::Ptr data = new ImageData(url, timestamp); mImages[url] = data; - if (mPriorityURLs.contains(url)) data->priority = true; + if (mPriorityURLs.tqcontains(url)) data->priority = true; return data; } }; @@ -144,12 +144,12 @@ Cache* Cache::instance() { void Cache::setPriorityURL( const KURL& url, bool set ) { if( set ) { d->mPriorityURLs.append( url ); - if( d->mImages.contains( url )) { + if( d->mImages.tqcontains( url )) { d->mImages[ url ]->priority = true; } } else { d->mPriorityURLs.remove( url ); - if( d->mImages.contains( url )) { + if( d->mImages.tqcontains( url )) { d->mImages[ url ]->priority = false; } checkMaxSize(); @@ -157,21 +157,21 @@ void Cache::setPriorityURL( const KURL& url, bool set ) { } -void Cache::addFile( const KURL& url, const QByteArray& file, const QDateTime& timestamp ) { +void Cache::addFile( const KURL& url, const TQByteArray& file, const TQDateTime& timestamp ) { LOG(url.prettyURL()); updateAge(); d->getOrCreateImageData(url, timestamp)->addFile(file); checkMaxSize(); } -void Cache::addImage( const KURL& url, const ImageFrames& frames, const QCString& format, const QDateTime& timestamp ) { +void Cache::addImage( const KURL& url, const ImageFrames& frames, const TQCString& format, const TQDateTime& timestamp ) { LOG(url.prettyURL()); updateAge(); d->getOrCreateImageData(url, timestamp)->addImage(frames, format); checkMaxSize(); } -void Cache::addThumbnail( const KURL& url, const QPixmap& thumbnail, QSize imagesize, const QDateTime& timestamp ) { +void Cache::addThumbnail( const KURL& url, const TQPixmap& thumbnail, TQSize imagesize, const TQDateTime& timestamp ) { // Thumbnails are many and often - things would age too quickly. Therefore // when adding thumbnails updateAge() is called from the outside only once for all of them. // updateAge(); @@ -179,34 +179,34 @@ void Cache::addThumbnail( const KURL& url, const QPixmap& thumbnail, QSize image checkMaxSize(); } -void Cache::invalidate( const KURL& url ) { +void Cache::tqinvalidate( const KURL& url ) { d->mImages.remove( url ); } -QDateTime Cache::timestamp( const KURL& url ) const { +TQDateTime Cache::timestamp( const KURL& url ) const { LOG(url.prettyURL()); - if( d->mImages.contains( url )) return d->mImages[ url ]->timestamp; - return QDateTime(); + if( d->mImages.tqcontains( url )) return d->mImages[ url ]->timestamp; + return TQDateTime(); } -QByteArray Cache::file( const KURL& url ) const { +TQByteArray Cache::file( const KURL& url ) const { LOG(url.prettyURL()); - if( d->mImages.contains( url )) { + if( d->mImages.tqcontains( url )) { const ImageData::Ptr data = d->mImages[ url ]; - if( data->file.isNull()) return QByteArray(); + if( data->file.isNull()) return TQByteArray(); data->age = 0; return data->file; } - return QByteArray(); + return TQByteArray(); } -void Cache::getFrames( const KURL& url, ImageFrames* frames, QCString* format ) const { +void Cache::getFrames( const KURL& url, ImageFrames* frames, TQCString* format ) const { LOG(url.prettyURL()); Q_ASSERT(frames); Q_ASSERT(format); frames->clear(); - *format = QCString(); - if( d->mImages.contains( url )) { + *format = TQCString(); + if( d->mImages.tqcontains( url )) { const ImageData::Ptr data = d->mImages[ url ]; if( data->frames.isEmpty()) return; *frames = data->frames; @@ -215,15 +215,15 @@ void Cache::getFrames( const KURL& url, ImageFrames* frames, QCString* format ) } } -QPixmap Cache::thumbnail( const KURL& url, QSize& imagesize ) const { - if( d->mImages.contains( url )) { +TQPixmap Cache::thumbnail( const KURL& url, TQSize& imagesize ) const { + if( d->mImages.tqcontains( url )) { const ImageData::Ptr data = d->mImages[ url ]; - if( data->thumbnail.isNull()) return QPixmap(); + if( data->thumbnail.isNull()) return TQPixmap(); imagesize = data->imagesize; // data.age = 0; return data->thumbnail; } - return QPixmap(); + return TQPixmap(); } void Cache::updateAge() { @@ -298,33 +298,33 @@ void Cache::checkMaxSize() { } } -void Cache::readConfig(KConfig* config,const QString& group) { +void Cache::readConfig(KConfig* config,const TQString& group) { KConfigGroupSaver saver( config, group ); d->mMaxSize = config->readNumEntry( CONFIG_CACHE_MAXSIZE, d->mMaxSize ); checkMaxSize(); } -void ImageData::addFile( const QByteArray& f ) { +void ImageData::addFile( const TQByteArray& f ) { file = f; file.detach(); // explicit sharing age = 0; } -void ImageData::addImage( const ImageFrames& fs, const QCString& f ) { +void ImageData::addImage( const ImageFrames& fs, const TQCString& f ) { frames = fs; format = f; age = 0; } -void ImageData::addThumbnail( const QPixmap& thumb, QSize imgsize ) { +void ImageData::addThumbnail( const TQPixmap& thumb, TQSize imgsize ) { thumbnail = thumb; imagesize = imgsize; // age = 0; } int ImageData::size() const { - return QMAX( fileSize() + imageSize() + thumbnailSize(), 100 ); // some minimal size per item + return TQMAX( fileSize() + imageSize() + thumbnailSize(), 100 ); // some minimal size per item } int ImageData::fileSize() const { @@ -345,7 +345,7 @@ int ImageData::imageSize() const { bool ImageData::reduceSize() { if( !file.isNull() && fast_url && !frames.isEmpty()) { - file = QByteArray(); + file = TQByteArray(); #ifdef DEBUG_CACHE kdDebug() << "Cache: Dumping fast file: " << _cache_url.prettyURL() << ":" << cost() << endl; #endif @@ -355,7 +355,7 @@ bool ImageData::reduceSize() { #ifdef DEBUG_CACHE kdDebug() << "Cache: Dumping thumbnail: " << _cache_url.prettyURL() << ":" << cost() << endl; #endif - thumbnail = QPixmap(); + thumbnail = TQPixmap(); return true; } if( !file.isNull() && !frames.isEmpty()) { @@ -367,7 +367,7 @@ bool ImageData::reduceSize() { kdDebug() << "Cache: Dumping images: " << _cache_url.prettyURL() << ":" << cost() << endl; #endif } else { - file = QByteArray(); + file = TQByteArray(); #ifdef DEBUG_CACHE kdDebug() << "Cache: Dumping file: " << _cache_url.prettyURL() << ":" << cost() << endl; #endif diff --git a/src/gvcore/cache.h b/src/gvcore/cache.h index 272cf8f..199bc46 100644 --- a/src/gvcore/cache.h +++ b/src/gvcore/cache.h @@ -21,13 +21,13 @@ Copyright 2000-2004 Aurélien Gâteau #ifndef CACHE_H #define CACHE_H -// Qt -#include <qcstring.h> -#include <qdatetime.h> -#include <qimage.h> -#include <qobject.h> -#include <qtimer.h> -#include <qvaluelist.h> +// TQt +#include <tqcstring.h> +#include <tqdatetime.h> +#include <tqimage.h> +#include <tqobject.h> +#include <tqtimer.h> +#include <tqvaluelist.h> // KDE #include <kurl.h> @@ -38,22 +38,23 @@ Copyright 2000-2004 Aurélien Gâteau class KConfig; namespace Gwenview { -class LIBGWENVIEW_EXPORT Cache : public QObject { +class LIBGWENVIEW_EXPORT Cache : public TQObject { Q_OBJECT + TQ_OBJECT public: static Cache* instance(); ~Cache(); - void addImage( const KURL& url, const ImageFrames& frames, const QCString& format, const QDateTime& timestamp ); - void addFile( const KURL& url, const QByteArray& file, const QDateTime& timestamp ); - void addThumbnail( const KURL& url, const QPixmap& thumbnail, QSize imagesize, const QDateTime& timestamp ); - QDateTime timestamp( const KURL& url ) const; - QByteArray file( const KURL& url ) const; - void getFrames( const KURL& url, ImageFrames* frames, QCString* format ) const; - QPixmap thumbnail( const KURL& url, QSize& imagesize ) const; + void addImage( const KURL& url, const ImageFrames& frames, const TQCString& format, const TQDateTime& timestamp ); + void addFile( const KURL& url, const TQByteArray& file, const TQDateTime& timestamp ); + void addThumbnail( const KURL& url, const TQPixmap& thumbnail, TQSize imagesize, const TQDateTime& timestamp ); + TQDateTime timestamp( const KURL& url ) const; + TQByteArray file( const KURL& url ) const; + void getFrames( const KURL& url, ImageFrames* frames, TQCString* format ) const; + TQPixmap thumbnail( const KURL& url, TQSize& imagesize ) const; void setPriorityURL( const KURL& url, bool set ); - void invalidate( const KURL& url ); + void tqinvalidate( const KURL& url ); void checkThumbnailSize( int size ); - void readConfig(KConfig*,const QString& group); + void readConfig(KConfig*,const TQString& group); void updateAge(); enum { DEFAULT_MAXSIZE = 16 * 1024 * 1024 }; // 16MiB private: diff --git a/src/gvcore/captionformatter.cpp b/src/gvcore/captionformatter.cpp index 4acbc11..ca34a51 100644 --- a/src/gvcore/captionformatter.cpp +++ b/src/gvcore/captionformatter.cpp @@ -27,28 +27,28 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace Gwenview { -QString CaptionFormatter::format(const QString& format) { - QString comment=mComment; +TQString CaptionFormatter::format(const TQString& format) { + TQString comment=mComment; if (comment.isNull()) { comment=i18n("(No comment)"); } - QString resolution; + TQString resolution; if (mImageSize.isValid()) { - resolution = QString( "%1x%2" ).arg( mImageSize.width()).arg( mImageSize.height()); + resolution = TQString( "%1x%2" ).tqarg( mImageSize.width()).tqarg( mImageSize.height()); } - QString str=format; - str.replace("%f", mFileName); - str.replace("%p", mPath); - str.replace("%c", comment); - str.replace("%r", resolution); - str.replace("%n", QString::number(mPosition)); - str.replace("%N", QString::number(mCount)); - str.replace("%a", mAperture); - str.replace("%t", mExposureTime); - str.replace("%i", mIso); - str.replace("%l", mFocalLength); + TQString str=format; + str.tqreplace("%f", mFileName); + str.tqreplace("%p", mPath); + str.tqreplace("%c", comment); + str.tqreplace("%r", resolution); + str.tqreplace("%n", TQString::number(mPosition)); + str.tqreplace("%N", TQString::number(mCount)); + str.tqreplace("%a", mAperture); + str.tqreplace("%t", mExposureTime); + str.tqreplace("%i", mIso); + str.tqreplace("%l", mFocalLength); return str; } diff --git a/src/gvcore/captionformatter.h b/src/gvcore/captionformatter.h index 29aa3a9..2438a26 100644 --- a/src/gvcore/captionformatter.h +++ b/src/gvcore/captionformatter.h @@ -21,9 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef CAPTIONFORMATTER_H #define CAPTIONFORMATTER_H -// Qt -#include <qsize.h> -#include <qstring.h> +// TQt +#include <tqsize.h> +#include <tqstring.h> // Local #include "libgwenview_export.h" @@ -38,18 +38,18 @@ namespace Gwenview { */ class LIBGWENVIEW_EXPORT CaptionFormatter { public: - QString mPath; - QString mFileName; - QString mComment; - QString mAperture; - QString mFocalLength; - QString mExposureTime; - QString mIso; - - QSize mImageSize; + TQString mPath; + TQString mFileName; + TQString mComment; + TQString mAperture; + TQString mFocalLength; + TQString mExposureTime; + TQString mIso; + + TQSize mImageSize; int mPosition; int mCount; - QString format(const QString& format); + TQString format(const TQString& format); }; } // namespace diff --git a/src/gvcore/clicklineedit.cpp b/src/gvcore/clicklineedit.cpp index a1728a0..f35cbe3 100644 --- a/src/gvcore/clicklineedit.cpp +++ b/src/gvcore/clicklineedit.cpp @@ -22,12 +22,12 @@ #include "clicklineedit.h" -#include "qpainter.h" +#include "tqpainter.h" namespace Gwenview { -ClickLineEdit::ClickLineEdit(QWidget *parent, const char* name ) : - KLineEdit( parent, name ) +ClickLineEdit::ClickLineEdit(TQWidget *tqparent, const char* name ) : + KLineEdit( tqparent, name ) { mDrawClickMsg = true; } @@ -37,17 +37,17 @@ ClickLineEdit::ClickLineEdit(QWidget *parent, const char* name ) : // PUBLIC ///////////////////////////////////////////////////////////////////////////////////// -void ClickLineEdit::setClickMessage( const QString &msg ) +void ClickLineEdit::setClickMessage( const TQString &msg ) { mClickMessage = msg; - repaint(); + tqrepaint(); } -void ClickLineEdit::setText( const QString &txt ) +void ClickLineEdit::setText( const TQString &txt ) { mDrawClickMsg = txt.isEmpty(); - repaint(); + tqrepaint(); KLineEdit::setText( txt ); } @@ -57,14 +57,14 @@ void ClickLineEdit::setText( const QString &txt ) ///////////////////////////////////////////////////////////////////////////////////// //#include <kiconloader.h> -void ClickLineEdit::drawContents( QPainter *p ) +void ClickLineEdit::drawContents( TQPainter *p ) { KLineEdit::drawContents( p ); if ( mDrawClickMsg == true && !hasFocus() ) { - QPen tmp = p->pen(); - p->setPen( palette().color( QPalette::Disabled, QColorGroup::Text ) ); - QRect cr = contentsRect(); + TQPen tmp = p->pen(); + p->setPen( palette().color( TQPalette::Disabled, TQColorGroup::Text ) ); + TQRect cr = contentsRect(); //p->drawPixmap( 3, 3, SmallIcon("filter") ); @@ -75,30 +75,30 @@ void ClickLineEdit::drawContents( QPainter *p ) } } -void ClickLineEdit::dropEvent( QDropEvent *ev ) +void ClickLineEdit::dropEvent( TQDropEvent *ev ) { mDrawClickMsg = false; KLineEdit::dropEvent( ev ); } -void ClickLineEdit::focusInEvent( QFocusEvent *ev ) +void ClickLineEdit::focusInEvent( TQFocusEvent *ev ) { if ( mDrawClickMsg == true ) { mDrawClickMsg = false; - repaint(); + tqrepaint(); } - QLineEdit::focusInEvent( ev ); + TQLineEdit::focusInEvent( ev ); } -void ClickLineEdit::focusOutEvent( QFocusEvent *ev ) +void ClickLineEdit::focusOutEvent( TQFocusEvent *ev ) { if ( text().isEmpty() ) { mDrawClickMsg = true; - repaint(); + tqrepaint(); } - QLineEdit::focusOutEvent( ev ); + TQLineEdit::focusOutEvent( ev ); } } // namespace diff --git a/src/gvcore/clicklineedit.h b/src/gvcore/clicklineedit.h index 05624eb..84259e8 100644 --- a/src/gvcore/clicklineedit.h +++ b/src/gvcore/clicklineedit.h @@ -35,23 +35,24 @@ namespace Gwenview { class ClickLineEdit : public KLineEdit { Q_OBJECT - Q_PROPERTY( QString clickMessage READ clickMessage WRITE setClickMessage ) + TQ_OBJECT + TQ_PROPERTY( TQString clickMessage READ clickMessage WRITE setClickMessage ) public: - ClickLineEdit(QWidget *parent, const char* name = 0 ); + ClickLineEdit(TQWidget *tqparent, const char* name = 0 ); - void setClickMessage( const QString &msg ); - QString clickMessage() const { return mClickMessage; } + void setClickMessage( const TQString &msg ); + TQString clickMessage() const { return mClickMessage; } - virtual void setText( const QString& txt ); + virtual void setText( const TQString& txt ); protected: - virtual void drawContents( QPainter *p ); - virtual void dropEvent( QDropEvent *ev ); - virtual void focusInEvent( QFocusEvent *ev ); - virtual void focusOutEvent( QFocusEvent *ev ); + virtual void drawContents( TQPainter *p ); + virtual void dropEvent( TQDropEvent *ev ); + virtual void focusInEvent( TQFocusEvent *ev ); + virtual void focusOutEvent( TQFocusEvent *ev ); private: - QString mClickMessage; + TQString mClickMessage; bool mDrawClickMsg; }; diff --git a/src/gvcore/cursortracker.cpp b/src/gvcore/cursortracker.cpp index 0d3060d..44e38ac 100644 --- a/src/gvcore/cursortracker.cpp +++ b/src/gvcore/cursortracker.cpp @@ -21,14 +21,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "cursortracker.h" -// Qt -#include <qevent.h> -#include <qtooltip.h> +// TQt +#include <tqevent.h> +#include <tqtooltip.h> namespace Gwenview { -CursorTracker::CursorTracker(const QString& txt, QWidget* reference) -: QLabel(txt, 0, "", WX11BypassWM) { +CursorTracker::CursorTracker(const TQString& txt, TQWidget* reference) +: TQLabel(txt, 0, "", WX11BypassWM) { reference->setMouseTracking(true); reference->installEventFilter(this); } @@ -37,19 +37,19 @@ CursorTracker::CursorTracker(const QString& txt, QWidget* reference) /** * Overload to make sure the widget size is correct */ -void CursorTracker::setText(const QString& txt) { - QLabel::setText(txt); +void CursorTracker::setText(const TQString& txt) { + TQLabel::setText(txt); adjustSize(); } -bool CursorTracker::eventFilter(QObject* object, QEvent* _event) { - QWidget* widget=static_cast<QWidget*>(object); +bool CursorTracker::eventFilter(TQObject* object, TQEvent* _event) { + TQWidget* widget=TQT_TQWIDGET(object); switch (_event->type()) { - case QEvent::MouseMove: { - QMouseEvent* event=static_cast<QMouseEvent*>(_event); - if (widget->rect().contains(event->pos()) || (event->stateAfter() & LeftButton)) { + case TQEvent::MouseMove: { + TQMouseEvent* event=TQT_TQMOUSEEVENT(_event); + if (TQT_TQRECT_OBJECT(widget->rect()).tqcontains(event->pos()) || (event->stateAfter() & Qt::LeftButton)) { show(); move(event->globalPos().x() + 15, event->globalPos().y() + 15); } else { @@ -58,9 +58,9 @@ bool CursorTracker::eventFilter(QObject* object, QEvent* _event) { break; } - case QEvent::MouseButtonRelease: { - QMouseEvent* event=static_cast<QMouseEvent*>(_event); - if ( !widget->rect().contains(event->pos()) ) { + case TQEvent::MouseButtonRelease: { + TQMouseEvent* event=TQT_TQMOUSEEVENT(_event); + if ( !TQT_TQRECT_OBJECT(widget->rect()).tqcontains(event->pos()) ) { hide(); } break; @@ -74,12 +74,12 @@ bool CursorTracker::eventFilter(QObject* object, QEvent* _event) { } -TipTracker::TipTracker(const QString& txt, QWidget* reference) +TipTracker::TipTracker(const TQString& txt, TQWidget* reference) : CursorTracker(txt, reference) { - setPalette(QToolTip::palette()); - setFrameStyle(QFrame::Plain | QFrame::Box); + setPalette(TQToolTip::palette()); + setFrameStyle(TQFrame::Plain | TQFrame::Box); setLineWidth(1); - setAlignment(AlignAuto | AlignTop); + tqsetAlignment(AlignAuto | AlignTop); } diff --git a/src/gvcore/cursortracker.h b/src/gvcore/cursortracker.h index 2d2f6eb..9472223 100644 --- a/src/gvcore/cursortracker.h +++ b/src/gvcore/cursortracker.h @@ -22,8 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef CURSORTRACKER_H #define CURSORTRACKER_H -// Qt -#include <qlabel.h> +// TQt +#include <tqlabel.h> namespace Gwenview { @@ -31,14 +31,14 @@ namespace Gwenview { * This class implements a decoration-less window which will follow the cursor * when it's over a specified widget. */ -class CursorTracker : public QLabel { +class CursorTracker : public TQLabel { public: - CursorTracker(const QString& txt, QWidget* reference); + CursorTracker(const TQString& txt, TQWidget* reference); - void setText(const QString& txt); + void setText(const TQString& txt); protected: - bool eventFilter(QObject*, QEvent*); + bool eventFilter(TQObject*, TQEvent*); }; @@ -47,7 +47,7 @@ protected: */ class TipTracker : public CursorTracker { public: - TipTracker(const QString& txt, QWidget* reference); + TipTracker(const TQString& txt, TQWidget* reference); }; diff --git a/src/gvcore/deletedialog.cpp b/src/gvcore/deletedialog.cpp index 19c34ba..cc0010e 100644 --- a/src/gvcore/deletedialog.cpp +++ b/src/gvcore/deletedialog.cpp @@ -24,14 +24,14 @@ #include <kstdguiitem.h> #include <kurl.h> -#include <qstringlist.h> -#include <qcheckbox.h> -#include <qlayout.h> -#include <qlabel.h> -#include <qtimer.h> -#include <qvbox.h> -#include <qhbox.h> -#include <qpushbutton.h> +#include <tqstringlist.h> +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqlabel.h> +#include <tqtimer.h> +#include <tqvbox.h> +#include <tqhbox.h> +#include <tqpushbutton.h> #include "fileoperationconfig.h" #include "deletedialog.h" @@ -39,8 +39,8 @@ namespace Gwenview { -DeleteDialog::DeleteDialog(QWidget *parent, const char *name) : - KDialogBase(Swallow, WStyle_DialogBorder, parent, name, +DeleteDialog::DeleteDialog(TQWidget *tqparent, const char *name) : + KDialogBase(Swallow, WStyle_DialogBorder, tqparent, name, true /* modal */, i18n("About to delete selected files"), Ok | Cancel, Cancel /* Default */, true /* separator */), m_trashGuiItem(i18n("&Send to Trash"), "trashcan_full") @@ -55,7 +55,7 @@ DeleteDialog::DeleteDialog(QWidget *parent, const char *name) : bool deleteInstead = ! FileOperationConfig::deleteToTrash(); m_widget->ddShouldDelete->setChecked(deleteInstead); - connect(m_widget->ddShouldDelete, SIGNAL(toggled(bool)), SLOT(updateUI())); + connect(m_widget->ddShouldDelete, TQT_SIGNAL(toggled(bool)), TQT_SLOT(updateUI())); } void DeleteDialog::setURLList(const KURL::List &files) @@ -79,7 +79,7 @@ void DeleteDialog::accept() void DeleteDialog::updateUI() { - QString msg, iconName; + TQString msg, iconName; int fileCount = m_widget->ddFileList->count(); bool reallyDelete = m_widget->ddShouldDelete->isChecked(); @@ -98,7 +98,7 @@ void DeleteDialog::updateUI() fileCount); iconName = "trashcan_full"; } - QPixmap icon = KGlobal::iconLoader()->loadIcon(iconName, KIcon::NoGroup, KIcon::SizeMedium); + TQPixmap icon = KGlobal::iconLoader()->loadIcon(iconName, KIcon::NoGroup, KIcon::SizeMedium); m_widget->ddDeleteText->setText(msg); m_widget->ddWarningIcon->setPixmap(icon); @@ -113,9 +113,9 @@ bool DeleteDialog::shouldDelete() const { } -QSize DeleteDialog::sizeHint() const { +TQSize DeleteDialog::tqsizeHint() const { m_widget->adjustSize(); - QSize hint = m_widget->minimumSize(); + TQSize hint = m_widget->tqminimumSize(); hint = calculateSize(hint.width(), hint.height()); // For some reason calculateSize does not return a correct height. As I'm diff --git a/src/gvcore/deletedialog.h b/src/gvcore/deletedialog.h index 0340e09..dbb2d9d 100644 --- a/src/gvcore/deletedialog.h +++ b/src/gvcore/deletedialog.h @@ -28,14 +28,15 @@ namespace Gwenview { class DeleteDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - DeleteDialog(QWidget *parent, const char *name = "delete_dialog"); + DeleteDialog(TQWidget *tqparent, const char *name = "delete_dialog"); void setURLList(const KURL::List &files); bool shouldDelete() const; - QSize sizeHint() const; + TQSize tqsizeHint() const; protected slots: virtual void accept(); diff --git a/src/gvcore/deletedialogbase.ui b/src/gvcore/deletedialogbase.ui index dd338ea..92285a7 100644 --- a/src/gvcore/deletedialogbase.ui +++ b/src/gvcore/deletedialogbase.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>DeleteDialogBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>DeleteDialogBase</cstring> </property> - <property name="geometry"> + <property name="tqgeometry"> <rect> <x>0</x> <y>0</y> @@ -19,15 +19,15 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>ddWarningIcon</cstring> </property> @@ -43,11 +43,11 @@ <string>Icon Placeholder, not in GUI</string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>ddDeleteText</cstring> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>0</width> <height>60</height> @@ -56,7 +56,7 @@ <property name="text"> <string>Deletion method placeholder, not in GUI</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>WordBreak|AlignCenter</set> </property> </widget> @@ -73,18 +73,18 @@ <enum>NoSelection</enum> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>ddNumFiles</cstring> </property> <property name="text"> <string>Placeholder for number of files, not in GUI</string> </property> - <property name="alignment"> + <property name="tqalignment"> <set>AlignVCenter|AlignRight</set> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>ddShouldDelete</cstring> </property> @@ -104,7 +104,7 @@ </widget> <customwidgets> </customwidgets> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klistbox.h</includehint> </includehints> diff --git a/src/gvcore/document.cpp b/src/gvcore/document.cpp index 14a6410..3069ae5 100644 --- a/src/gvcore/document.cpp +++ b/src/gvcore/document.cpp @@ -21,12 +21,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <sys/stat.h> // For S_ISDIR -// Qt -#include <qfileinfo.h> -#include <qguardedptr.h> -#include <qpaintdevicemetrics.h> -#include <qpainter.h> -#include <qwmatrix.h> +// TQt +#include <tqfileinfo.h> +#include <tqguardedptr.h> +#include <tqpaintdevicemetrics.h> +#include <tqpainter.h> +#include <tqwmatrix.h> // KDE #include <kapplication.h> @@ -73,9 +73,9 @@ const char* CONFIG_SAVE_AUTOMATICALLY="save automatically"; /** - * Returns a widget suitable to use as a dialog parent + * Returns a widget suitable to use as a dialog tqparent */ -static QWidget* dialogParentWidget() { +static TQWidget* dialogParentWidget() { return KApplication::kApplication()->mainWidget(); } @@ -88,11 +88,11 @@ class DocumentPrivate { public: KURL mURL; bool mModified; - QImage mImage; - QString mMimeType; - QCString mImageFormat; + TQImage mImage; + TQString mMimeType; + TQCString mImageFormat; DocumentImpl* mImpl; - QGuardedPtr<KIO::StatJob> mStatJob; + TQGuardedPtr<KIO::StatJob> mStatJob; int mFileSize; }; @@ -102,8 +102,8 @@ public: // Document // //------------------------------------------------------------------- -Document::Document(QObject* parent) -: QObject(parent) { +Document::Document(TQObject* tqparent) +: TQObject(tqparent) { d=new DocumentPrivate; d->mModified=false; d->mImpl=new DocumentEmptyImpl(this); @@ -114,9 +114,9 @@ Document::Document(QObject* parent) KImageIO::registerFormats(); XCFImageFormat::registerFormat(); - // First load Qt's plugins, so that Gwenview's decoders that + // First load TQt's plugins, so that Gwenview's decoders that // override some of them are installed later and thus come first. - QImageIO::inputFormats(); + TQImageIO::inputFormats(); { static Gwenview::JPEGFormatType sJPEGFormatType; static Gwenview::PNGFormatType sPNGFormatType; @@ -125,10 +125,10 @@ Document::Document(QObject* parent) static Gwenview::XCursorFormatType sXCursorFormatType; } - connect( this, SIGNAL( loading()), - this, SLOT( slotLoading())); - connect( this, SIGNAL( loaded(const KURL&)), - this, SLOT( slotLoaded())); + connect( this, TQT_SIGNAL( loading()), + this, TQT_SLOT( slotLoading())); + connect( this, TQT_SIGNAL( loaded(const KURL&)), + this, TQT_SLOT( slotLoaded())); } @@ -143,11 +143,11 @@ Document::~Document() { // Properties // //--------------------------------------------------------------------- -QString Document::mimeType() const { +TQString Document::mimeType() const { return d->mMimeType; } -void Document::setMimeType(const QString& mimeType) { +void Document::setMimeType(const TQString& mimeType) { d->mMimeType = mimeType; } @@ -188,7 +188,7 @@ void Document::setURL(const KURL& paramURL) { // Fix wrong protocol if (Archive::protocolIsArchive(localURL.protocol())) { - QFileInfo info(localURL.path()); + TQFileInfo info(localURL.path()); if (info.exists()) { localURL.setProtocol("file"); } @@ -197,8 +197,8 @@ void Document::setURL(const KURL& paramURL) { d->mURL = localURL; // this may be fixed after stat() is complete, but set at least something d->mStatJob = KIO::stat( localURL, !localURL.isLocalFile() ); d->mStatJob->setWindow(KApplication::kApplication()->mainWidget()); - connect( d->mStatJob, SIGNAL( result (KIO::Job *) ), - this, SLOT( slotStatResult (KIO::Job *) ) ); + connect( d->mStatJob, TQT_SIGNAL( result (KIO::Job *) ), + this, TQT_SLOT( slotStatResult (KIO::Job *) ) ); } @@ -242,11 +242,11 @@ void Document::setDirURL(const KURL& paramURL) { } -const QImage& Document::image() const { +const TQImage& Document::image() const { return d->mImage; } -void Document::setImage(QImage img) { +void Document::setImage(TQImage img) { bool sizechange = d->mImage.size() != img.size(); d->mImage = img; if( sizechange ) emit sizeUpdated(); @@ -263,15 +263,15 @@ KURL Document::dirURL() const { } } -QString Document::filename() const { +TQString Document::filename() const { return d->mURL.filename(false); } -const QCString& Document::imageFormat() const { +const TQCString& Document::imageFormat() const { return d->mImageFormat; } -void Document::setImageFormat(const QCString& format) { +void Document::setImageFormat(const TQCString& format) { d->mImageFormat=format; } @@ -279,27 +279,27 @@ void Document::setFileSize(int size) { d->mFileSize=size; } -QString Document::comment() const { +TQString Document::comment() const { return d->mImpl->comment(); } -QString Document::aperture() const { +TQString Document::aperture() const { return d->mImpl->aperture(); } -QString Document::exposureTime() const { +TQString Document::exposureTime() const { return d->mImpl->exposureTime(); } -QString Document::iso() const { +TQString Document::iso() const { return d->mImpl->iso(); } -QString Document::focalLength() const { +TQString Document::focalLength() const { return d->mImpl->focalLength(); } -void Document::setComment(const QString& comment) { +void Document::setComment(const TQString& comment) { d->mImpl->setComment(comment); d->mModified=true; emit modified(); @@ -343,43 +343,43 @@ void Document::slotLoaded() { // //--------------------------------------------------------------------- void Document::reload() { - Cache::instance()->invalidate( url()); + Cache::instance()->tqinvalidate( url()); load(); emit reloaded(url()); } void Document::print(KPrinter *pPrinter) { - QPainter printPainter; + TQPainter printPainter; printPainter.begin(pPrinter); doPaint(pPrinter, &printPainter); printPainter.end(); } -void Document::doPaint(KPrinter *printer, QPainter *painter) { +void Document::doPaint(KPrinter *printer, TQPainter *painter) { // will contain the final image to print - QImage image = d->mImage; + TQImage image = d->mImage; image.detach(); - // We use a QPaintDeviceMetrics to know the actual page size in pixel, + // We use a TQPaintDeviceMetrics to know the actual page size in pixel, // this gives the real painting area - QPaintDeviceMetrics pdMetrics(painter->device()); + TQPaintDeviceMetrics pdMetrics(painter->device()); const int margin = pdMetrics.logicalDpiY() / 2; // half-inch margin painter->setFont( KGlobalSettings::generalFont() ); - QFontMetrics fMetrics = painter->fontMetrics(); + TQFontMetrics fMetrics = painter->fontMetrics(); int x = 0; int y = 0; int pdWidth = pdMetrics.width(); int pdHeight = pdMetrics.height(); - QString t = "true"; - QString f = "false"; + TQString t = "true"; + TQString f = "false"; - int alignment = (printer->option("app-gwenview-position").isEmpty() ? - Qt::AlignCenter : printer->option("app-gwenview-position").toInt()); + int tqalignment = (printer->option("app-gwenview-position").isEmpty() ? + TQt::AlignCenter : printer->option("app-gwenview-position").toInt()); // Compute filename offset int filenameOffset = 0; @@ -403,11 +403,11 @@ void Document::doPaint(KPrinter *printer, QPainter *painter) { // Apply scaling int scaling = printer->option( "app-gwenview-scale" ).toInt(); - QSize size = image.size(); + TQSize size = image.size(); if (scaling==GV_FITTOPAGE /* Fit to page */) { bool enlargeToFit = printer->option( "app-gwenview-enlargeToFit" ) != f; if ((image.width() > pdWidth || image.height() > pdHeight) || enlargeToFit) { - size.scale( pdWidth, pdHeight, QSize::ScaleMin ); + size.tqscale( pdWidth, pdHeight, TQSize::ScaleMin ); } } else { if (scaling==GV_SCALE /* Scale To */) { @@ -445,38 +445,38 @@ void Document::doPaint(KPrinter *printer, QPainter *painter) { if (size.width() > pdWidth || size.height() > pdHeight) { int resp = KMessageBox::warningYesNoCancel(dialogParentWidget(), i18n("The image will not fit on the page, what do you want to do?"), - QString::null,KStdGuiItem::cont(), + TQString(),KStdGuiItem::cont(), i18n("Shrink") ); if (resp==KMessageBox::Cancel) { printer->abort(); return; } else if (resp == KMessageBox::No) { // Shrink - size.scale(pdWidth, pdHeight, QSize::ScaleMin); + size.tqscale(pdWidth, pdHeight, TQSize::ScaleMin); } } } // Compute x and y - if ( alignment & Qt::AlignHCenter ) + if ( tqalignment & TQt::AlignHCenter ) x = (pdWidth - size.width())/2; - else if ( alignment & Qt::AlignLeft ) + else if ( tqalignment & TQt::AlignLeft ) x = 0; - else if ( alignment & Qt::AlignRight ) + else if ( tqalignment & TQt::AlignRight ) x = pdWidth - size.width(); - if ( alignment & Qt::AlignVCenter ) + if ( tqalignment & TQt::AlignVCenter ) y = (pdHeight - size.height())/2; - else if ( alignment & Qt::AlignTop ) + else if ( tqalignment & TQt::AlignTop ) y = 0; - else if ( alignment & Qt::AlignBottom ) + else if ( tqalignment & TQt::AlignBottom ) y = pdHeight - size.height(); // Draw, the image will be scaled to fit the given area if necessary - painter->drawImage( QRect( x, y, size.width(), size.height()), image ); + painter->drawImage( TQRect( x, y, size.width(), size.height()), image ); if ( printFilename ) { - QString fname = KStringHandler::cPixelSqueeze( filename(), fMetrics, pdWidth ); + TQString fname = KStringHandler::cPixelSqueeze( filename(), fMetrics, pdWidth ); if ( !fname.isEmpty() ) { int fw = fMetrics.width( fname ); int x = (pdWidth - fw)/2; @@ -485,7 +485,7 @@ void Document::doPaint(KPrinter *printer, QPainter *painter) { } } if ( printComment ) { - QString comm = comment(); + TQString comm = comment(); if ( !comm.isEmpty() ) { int fw = fMetrics.width( comm ); int x = (pdWidth - fw)/2; @@ -504,7 +504,7 @@ void Document::transform(ImageUtils::Orientation orientation) { void Document::save() { - QString msg=saveInternal(url(), d->mImageFormat); + TQString msg=saveInternal(url(), d->mImageFormat); if (!msg.isNull()) { KMessageBox::error(dialogParentWidget(), msg); // If it can't be saved we leave it as modified, because user @@ -520,7 +520,7 @@ void Document::saveAs() { dialog.setSelection(url().fileName()); if (!dialog.exec()) return; - QString msg=saveInternal(saveURL, dialog.imageFormat() ); + TQString msg=saveInternal(saveURL, dialog.imageFormat() ); if (!msg.isNull()) { // If it can't be saved we leave it as modified, because user // could choose a wrong readonly path from dialog and retry to @@ -531,10 +531,10 @@ void Document::saveAs() { void Document::saveBeforeClosing() { if (!d->mModified) return; - QString msg=i18n("<qt>The image <b>%1</b> has been modified, do you want to save the changes?</qt>") - .arg(url().prettyURL()); + TQString msg=i18n("<qt>The image <b>%1</b> has been modified, do you want to save the changes?</qt>") + .tqarg(url().prettyURL()); - int result=KMessageBox::questionYesNo(dialogParentWidget(), msg, QString::null, + int result=KMessageBox::questionYesNo(dialogParentWidget(), msg, TQString(), KStdGuiItem::save(), KStdGuiItem::discard(), CONFIG_SAVE_AUTOMATICALLY); if (result == KMessageBox::Yes) { @@ -561,12 +561,12 @@ void Document::switchToImpl(DocumentImpl* impl) { delete d->mImpl; d->mImpl=impl; - connect(d->mImpl, SIGNAL(finished(bool)), - this, SLOT(slotFinished(bool)) ); - connect(d->mImpl, SIGNAL(sizeUpdated()), - this, SIGNAL(sizeUpdated()) ); - connect(d->mImpl, SIGNAL(rectUpdated(const QRect&)), - this, SIGNAL(rectUpdated(const QRect&)) ); + connect(d->mImpl, TQT_SIGNAL(finished(bool)), + this, TQT_SLOT(slotFinished(bool)) ); + connect(d->mImpl, TQT_SIGNAL(sizeUpdated()), + this, TQT_SIGNAL(sizeUpdated()) ); + connect(d->mImpl, TQT_SIGNAL(rectUpdated(const TQRect&)), + this, TQT_SIGNAL(rectUpdated(const TQRect&)) ); d->mImpl->init(); } @@ -594,18 +594,18 @@ void Document::slotFinished(bool success) { } -QString Document::saveInternal(const KURL& url, const QCString& format) { - QString msg=d->mImpl->save(url, format); +TQString Document::saveInternal(const KURL& url, const TQCString& format) { + TQString msg=d->mImpl->save(url, format); if (msg.isNull()) { emit saved(url); d->mModified=false; - return QString::null; + return TQString(); } LOG("Save failed: " << msg); - return QString("<qt><b>%1</b><br/>") - .arg(i18n("Could not save the image to %1.").arg(url.prettyURL())) + return TQString("<qt><b>%1</b><br/>") + .tqarg(i18n("Could not save the image to %1.").tqarg(url.prettyURL())) + msg + "</qt>"; } diff --git a/src/gvcore/document.h b/src/gvcore/document.h index d49811d..36fa235 100644 --- a/src/gvcore/document.h +++ b/src/gvcore/document.h @@ -21,10 +21,10 @@ Copyright 2000-2006 Aurelien Gateau #ifndef DOCUMENT_H #define DOCUMENT_H -// Qt -#include <qcstring.h> -#include <qobject.h> -#include <qimage.h> +// TQt +#include <tqcstring.h> +#include <tqobject.h> +#include <tqimage.h> // KDE #include <kurl.h> @@ -52,22 +52,23 @@ class DocumentImpl; * - image is being loaded * - loaded() is emitted */ -class LIBGWENVIEW_EXPORT Document : public QObject { +class LIBGWENVIEW_EXPORT Document : public TQObject { Q_OBJECT + TQ_OBJECT public: enum CommentState { NONE=0, READ_ONLY=1, WRITABLE=2 }; - Document(QObject*); + Document(TQObject*); ~Document(); // Properties - const QImage& image() const; + const TQImage& image() const; KURL url() const; KURL dirURL() const; - QString filename() const; - const QCString& imageFormat() const; + TQString filename() const; + const TQCString& imageFormat() const; int fileSize() const; - QString mimeType() const; + TQString mimeType() const; MimeTypeUtils::Kind urlKind() const; bool isModified() const; @@ -82,12 +83,12 @@ public: int height() const { return image().height(); } Document::CommentState commentState() const; - QString comment() const; - void setComment(const QString&); - QString aperture() const; - QString exposureTime() const; - QString iso() const; - QString focalLength() const; + TQString comment() const; + void setComment(const TQString&); + TQString aperture() const; + TQString exposureTime() const; + TQString iso() const; + TQString focalLength() const; int duration() const; @@ -143,7 +144,7 @@ signals: /** * Emitted to show a part of the image must be refreshed */ - void rectUpdated(const QRect& rect); + void rectUpdated(const TQRect& rect); /** * Emitted when the size is known @@ -153,7 +154,7 @@ signals: /** * Emitted when something goes wrong, like when save fails */ - void errorHappened(const QString& message); + void errorHappened(const TQString& message); private slots: void slotStatResult(KIO::Job*); @@ -169,20 +170,20 @@ private: // These methods are used by DocumentImpl and derived void switchToImpl(DocumentImpl*); - void setImage(QImage); - void setImageFormat(const QCString&); - void setMimeType(const QString&); + void setImage(TQImage); + void setImageFormat(const TQCString&); + void setMimeType(const TQString&); void setFileSize(int); void reset(); void load(); - void doPaint(KPrinter *pPrinter, QPainter *p); + void doPaint(KPrinter *pPrinter, TQPainter *p); /** * The returned string is null if the image was successfully saved, * otherwise it's the translated error message. */ - QString saveInternal(const KURL& url, const QCString& format); + TQString saveInternal(const KURL& url, const TQCString& format); Document(const Document&); Document &operator=(const Document&); diff --git a/src/gvcore/documentanimatedloadedimpl.cpp b/src/gvcore/documentanimatedloadedimpl.cpp index aaaed2f..db4e72c 100644 --- a/src/gvcore/documentanimatedloadedimpl.cpp +++ b/src/gvcore/documentanimatedloadedimpl.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -21,9 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "documentanimatedloadedimpl.moc" -// Qt -#include <qstring.h> -#include <qtimer.h> +// TQt +#include <tqstring.h> +#include <tqtimer.h> // KDE #include <kdebug.h> @@ -45,7 +45,7 @@ class DocumentAnimatedLoadedImplPrivate { public: ImageFrames mFrames; int mCurrentFrame; - QTimer mFrameTimer; + TQTimer mFrameTimer; }; @@ -55,7 +55,7 @@ DocumentAnimatedLoadedImpl::DocumentAnimatedLoadedImpl(Document* document, const d=new DocumentAnimatedLoadedImplPrivate; d->mFrames = frames; d->mCurrentFrame = -1; - connect( &d->mFrameTimer, SIGNAL( timeout()), SLOT( nextFrame())); + connect( &d->mFrameTimer, TQT_SIGNAL( timeout()), TQT_SLOT( nextFrame())); } void DocumentAnimatedLoadedImpl::init() { @@ -66,7 +66,7 @@ void DocumentAnimatedLoadedImpl::init() { void DocumentAnimatedLoadedImpl::nextFrame() { ++d->mCurrentFrame; if( d->mCurrentFrame == int( d->mFrames.count())) d->mCurrentFrame = 0; - d->mFrameTimer.start( QMAX( 10, d->mFrames[ d->mCurrentFrame ].delay )); + d->mFrameTimer.start( TQMAX( 10, d->mFrames[ d->mCurrentFrame ].delay )); // NOTE! If this ever gets changed to already animate the picture while it's still // loading, with MNG the frame delay gets announced only after the frame is ready. // See ImageLoader::frameDone() . @@ -90,7 +90,7 @@ void DocumentAnimatedLoadedImpl::transform(ImageUtils::Orientation orientation) } -QString DocumentAnimatedLoadedImpl::localSave(QFile* /*file*/, const QCString& /*format*/) const { +TQString DocumentAnimatedLoadedImpl::localSave(TQFile* /*file*/, const TQCString& /*format*/) const { return i18n("Sorry, cannot save animated images."); } diff --git a/src/gvcore/documentanimatedloadedimpl.h b/src/gvcore/documentanimatedloadedimpl.h index a7493fc..91a5288 100644 --- a/src/gvcore/documentanimatedloadedimpl.h +++ b/src/gvcore/documentanimatedloadedimpl.h @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -21,17 +21,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef DOCUMENTANIMATEDIMPL_H #define DOCUMENTANIMATEDIMPL_H -// Qt -#include <qimage.h> -#include <qvaluevector.h> +// TQt +#include <tqimage.h> +#include <tqvaluevector.h> // Local #include "documentloadedimpl.h" #include "imageutils/imageutils.h" #include "imageframe.h" -class QFile; -class QCString; +class TQFile; +class TQCString; namespace Gwenview { class Document; @@ -40,6 +40,7 @@ class DocumentAnimatedLoadedImplPrivate; class DocumentAnimatedLoadedImpl : public DocumentLoadedImpl { Q_OBJECT + TQ_OBJECT public: DocumentAnimatedLoadedImpl(Document* document, const ImageFrames& frames); ~DocumentAnimatedLoadedImpl(); @@ -49,7 +50,7 @@ public: virtual bool canBeSaved() const { return false; } protected: - QString localSave(QFile*, const QCString& format) const; + TQString localSave(TQFile*, const TQCString& format) const; private slots: void nextFrame(); diff --git a/src/gvcore/documentimpl.cpp b/src/gvcore/documentimpl.cpp index 97a32c5..34f5216 100644 --- a/src/gvcore/documentimpl.cpp +++ b/src/gvcore/documentimpl.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -37,7 +37,7 @@ void DocumentImpl::switchToImpl(DocumentImpl* impl) { mDocument->switchToImpl(impl); } -void DocumentImpl::setImage(QImage img) { +void DocumentImpl::setImage(TQImage img) { if (img.depth() == 1) { // 1 bit depth images are difficult to scale. Let's convert to 8 bit // depth. See bug #155518. @@ -50,11 +50,11 @@ void DocumentImpl::emitImageRectUpdated() { emit rectUpdated(mDocument->image().rect()); } -void DocumentImpl::setImageFormat(const QCString& format) { +void DocumentImpl::setImageFormat(const TQCString& format) { mDocument->setImageFormat(format); } -void DocumentImpl::setMimeType(const QString& mimeType) { +void DocumentImpl::setMimeType(const TQString& mimeType) { mDocument->setMimeType(mimeType); } @@ -62,31 +62,31 @@ void DocumentImpl::setFileSize(int size) const { mDocument->setFileSize(size); } -QString DocumentImpl::aperture() const { - return QString::null; +TQString DocumentImpl::aperture() const { + return TQString(); } -QString DocumentImpl::exposureTime() const { - return QString::null; +TQString DocumentImpl::exposureTime() const { + return TQString(); } -QString DocumentImpl::iso() const { - return QString::null; +TQString DocumentImpl::iso() const { + return TQString(); } -QString DocumentImpl::focalLength() const { - return QString::null; +TQString DocumentImpl::focalLength() const { + return TQString(); } -QString DocumentImpl::comment() const { - return QString::null; +TQString DocumentImpl::comment() const { + return TQString(); } Document::CommentState DocumentImpl::commentState() const { return Document::NONE; } -void DocumentImpl::setComment(const QString&) { +void DocumentImpl::setComment(const TQString&) { } int DocumentImpl::duration() const { @@ -96,7 +96,7 @@ int DocumentImpl::duration() const { void DocumentImpl::transform(ImageUtils::Orientation) { } -QString DocumentImpl::save(const KURL&, const QCString&) const { +TQString DocumentImpl::save(const KURL&, const TQCString&) const { return i18n("No document to save"); } diff --git a/src/gvcore/documentimpl.h b/src/gvcore/documentimpl.h index 94e23f4..c6e5697 100644 --- a/src/gvcore/documentimpl.h +++ b/src/gvcore/documentimpl.h @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -21,9 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef DOCUMENTIMPL_H #define DOCUMENTIMPL_H -// Qt -#include <qobject.h> -#include <qrect.h> +// TQt +#include <tqobject.h> +#include <tqrect.h> // Local #include "document.h" @@ -31,8 +31,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace Gwenview { -class DocumentImpl : public QObject { +class DocumentImpl : public TQObject { Q_OBJECT + TQ_OBJECT public: DocumentImpl(Document* document); virtual ~DocumentImpl(); @@ -43,9 +44,9 @@ public: virtual void init(); void switchToImpl(DocumentImpl*); - void setImage(QImage); - void setMimeType(const QString&); - void setImageFormat(const QCString&); + void setImage(TQImage); + void setMimeType(const TQString&); + void setImageFormat(const TQCString&); void setFileSize(int) const; /** @@ -53,18 +54,18 @@ public: */ void emitImageRectUpdated(); - virtual QString aperture() const; - virtual QString exposureTime() const; - virtual QString iso() const; - virtual QString focalLength() const; + virtual TQString aperture() const; + virtual TQString exposureTime() const; + virtual TQString iso() const; + virtual TQString focalLength() const; - virtual QString comment() const; + virtual TQString comment() const; virtual Document::CommentState commentState() const; - virtual void setComment(const QString&); + virtual void setComment(const TQString&); virtual int duration() const; virtual void transform(ImageUtils::Orientation); - virtual QString save(const KURL&, const QCString& format) const; + virtual TQString save(const KURL&, const TQCString& format) const; virtual MimeTypeUtils::Kind urlKind() const=0; @@ -74,7 +75,7 @@ public: signals: void finished(bool success); void sizeUpdated(); - void rectUpdated(const QRect&); + void rectUpdated(const TQRect&); protected: Document* mDocument; @@ -84,7 +85,7 @@ class DocumentEmptyImpl : public DocumentImpl { public: DocumentEmptyImpl(Document* document) : DocumentImpl(document) { - setImage(QImage()); + setImage(TQImage()); setImageFormat(0); setMimeType("application/x-zerosize"); } diff --git a/src/gvcore/documentjpegloadedimpl.cpp b/src/gvcore/documentjpegloadedimpl.cpp index 0b4caec..e56a31c 100644 --- a/src/gvcore/documentjpegloadedimpl.cpp +++ b/src/gvcore/documentjpegloadedimpl.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -18,11 +18,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Qt -#include <qcstring.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qtimer.h> +// TQt +#include <tqcstring.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqtimer.h> // KDE #include <kdebug.h> @@ -54,7 +54,7 @@ public: }; -DocumentJPEGLoadedImpl::DocumentJPEGLoadedImpl(Document* document, const QByteArray& rawData) +DocumentJPEGLoadedImpl::DocumentJPEGLoadedImpl(Document* document, const TQByteArray& rawData) : DocumentLoadedImpl(document) { LOG("" << mDocument->url().prettyURL() << ", data size: " << rawData.size() ); d=new DocumentJPEGLoadedImplPrivate; @@ -89,13 +89,13 @@ void DocumentJPEGLoadedImpl::transform(ImageUtils::Orientation orientation) { } -QString DocumentJPEGLoadedImpl::localSave(QFile* file, const QCString& format) const { +TQString DocumentJPEGLoadedImpl::localSave(TQFile* file, const TQCString& format) const { if (qstrcmp(format, "JPEG")==0) { LOG("JPEG Reset orientation"); d->mJPEGContent.resetOrientation(); if (!d->mJPEGContent.thumbnail().isNull()) { d->mJPEGContent.setThumbnail( ImageUtils::scale( - mDocument->image(), 128, 128, ImageUtils::SMOOTH_FAST, QImage::ScaleMin)); + mDocument->image(), 128, 128, ImageUtils::SMOOTH_FAST, TQ_ScaleMin)); } LOG("JPEG Lossless save"); @@ -103,35 +103,35 @@ QString DocumentJPEGLoadedImpl::localSave(QFile* file, const QCString& format) c return i18n("Could not save this JPEG file."); } } else { - QString msg=DocumentLoadedImpl::localSave(file, format); + TQString msg=DocumentLoadedImpl::localSave(file, format); if (!msg.isNull()) return msg; } - return QString::null; + return TQString(); } -QString DocumentJPEGLoadedImpl::comment() const { +TQString DocumentJPEGLoadedImpl::comment() const { return d->mJPEGContent.comment(); } -void DocumentJPEGLoadedImpl::setComment(const QString& comment) { +void DocumentJPEGLoadedImpl::setComment(const TQString& comment) { d->mJPEGContent.setComment(comment); } -QString DocumentJPEGLoadedImpl::aperture() const { +TQString DocumentJPEGLoadedImpl::aperture() const { return d->mJPEGContent.aperture(); } -QString DocumentJPEGLoadedImpl::exposureTime() const { +TQString DocumentJPEGLoadedImpl::exposureTime() const { return d->mJPEGContent.exposureTime(); } -QString DocumentJPEGLoadedImpl::iso() const { +TQString DocumentJPEGLoadedImpl::iso() const { return d->mJPEGContent.iso(); } -QString DocumentJPEGLoadedImpl::focalLength() const { +TQString DocumentJPEGLoadedImpl::focalLength() const { return d->mJPEGContent.focalLength(); } diff --git a/src/gvcore/documentjpegloadedimpl.h b/src/gvcore/documentjpegloadedimpl.h index 94e9e00..2b2a83a 100644 --- a/src/gvcore/documentjpegloadedimpl.h +++ b/src/gvcore/documentjpegloadedimpl.h @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef DOCUMENTJPEGLOADEDIMPL_H #define DOCUMENTJPEGLOADEDIMPL_H -// Qt -#include <qimage.h> +// TQt +#include <tqimage.h> // Local #include "documentloadedimpl.h" @@ -34,24 +34,25 @@ class DocumentJPEGLoadedImplPrivate; class DocumentJPEGLoadedImpl : public DocumentLoadedImpl { Q_OBJECT + TQ_OBJECT public: - DocumentJPEGLoadedImpl(Document* document, const QByteArray& rawData); + DocumentJPEGLoadedImpl(Document* document, const TQByteArray& rawData); ~DocumentJPEGLoadedImpl(); void init(); - QString comment() const; - void setComment(const QString&); + TQString comment() const; + void setComment(const TQString&); Document::CommentState commentState() const; - QString aperture() const; - QString exposureTime() const; - QString iso() const; - QString focalLength() const; + TQString aperture() const; + TQString exposureTime() const; + TQString iso() const; + TQString focalLength() const; void transform(ImageUtils::Orientation); protected: - QString localSave(QFile*, const QCString& format) const; + TQString localSave(TQFile*, const TQCString& format) const; private: DocumentJPEGLoadedImplPrivate* d; diff --git a/src/gvcore/documentloadedimpl.cpp b/src/gvcore/documentloadedimpl.cpp index 04fef67..35a07b0 100644 --- a/src/gvcore/documentloadedimpl.cpp +++ b/src/gvcore/documentloadedimpl.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab: /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -25,10 +25,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <unistd.h> #include <sys/stat.h> -// Qt -#include <qdir.h> -#include <qfileinfo.h> -#include <qtimer.h> +// TQt +#include <tqdir.h> +#include <tqfileinfo.h> +#include <tqtimer.h> // KDE #include <kapplication.h> @@ -54,7 +54,7 @@ namespace Gwenview { class DocumentLoadedImplPrivate { int mSize; - QDateTime mModified; + TQDateTime mModified; }; DocumentLoadedImpl::DocumentLoadedImpl(Document* document) @@ -78,12 +78,12 @@ void DocumentLoadedImpl::transform(ImageUtils::Orientation orientation) { } -QString DocumentLoadedImpl::save(const KURL& _url, const QCString& format) const { - if (!QImageIO::outputFormats().contains(format)) { +TQString DocumentLoadedImpl::save(const KURL& _url, const TQCString& format) const { + if (!TQImageIO::outputFormats().tqcontains(format)) { return i18n("Gwenview cannot write files in this format."); } - QString msg; + TQString msg; KURL url(_url); // Use the umask to determine default mode (will be used if the dest file @@ -95,17 +95,17 @@ QString DocumentLoadedImpl::save(const KURL& _url, const QCString& format) const if (url.isLocalFile()) { // If the file is a link, dereference it but take care of circular // links - QFileInfo info(url.path()); + TQFileInfo info(url.path()); if (info.isSymLink()) { - QStringList links; + TQStringList links; while (info.isSymLink()) { links.append(info.filePath()); - QString path=info.readLink(); + TQString path=info.readLink(); if (path[0]!='/') { path=info.dirPath(true) + '/' + path; } - path=QDir::cleanDirPath(path); - if (links.contains(path)) { + path=TQDir::cleanDirPath(path); + if (links.tqcontains(path)) { return i18n("This is a circular link."); } info.setFile(path); @@ -122,7 +122,7 @@ QString DocumentLoadedImpl::save(const KURL& _url, const QCString& format) const if (info.exists()) { // Get current file mode KDE_struct_stat st; - if (KDE_stat(QFile::encodeName(info.filePath()), &st)==0) { + if (KDE_stat(TQFile::encodeName(info.filePath()), &st)==0) { mode=st.st_mode & 07777; } else { // This should not happen @@ -130,17 +130,17 @@ QString DocumentLoadedImpl::save(const KURL& _url, const QCString& format) const } } else { - QFileInfo parent=QFileInfo(info.dirPath()); - if (!parent.isWritable()) { + TQFileInfo tqparent=TQFileInfo(info.dirPath()); + if (!tqparent.isWritable()) { return i18n("The %1 folder is read-only.") - .arg(parent.filePath()); + .tqarg(tqparent.filePath()); } } } // Save the file to a tmp file - QString prefix; + TQString prefix; if (url.isLocalFile()) { // We set the prefix to url.path() so that the temp file is on the // same partition as the destination file. If we don't do this, rename @@ -150,48 +150,48 @@ QString DocumentLoadedImpl::save(const KURL& _url, const QCString& format) const KTempFile tmp(prefix, "gwenview", mode); tmp.setAutoDelete(true); if (tmp.status()!=0) { - QString reason( strerror(tmp.status()) ); + TQString reason( strerror(tmp.status()) ); return i18n("Could not create a temporary file.\nReason: %1.") - .arg(reason); + .tqarg(reason); } - QFile* file=tmp.file(); + TQFile* file=tmp.file(); msg=localSave(file, format); if (!msg.isNull()) return msg; file->close(); if (tmp.status()!=0) { - QString reason( strerror(tmp.status()) ); + TQString reason( strerror(tmp.status()) ); return i18n("Saving image to a temporary file failed.\nReason: %1.") - .arg(reason); + .tqarg(reason); } - QString tmpName=tmp.name(); - int tmpSize=QFileInfo(tmpName).size(); + TQString tmpName=tmp.name(); + int tmpSize=TQFileInfo(tmpName).size(); setFileSize(tmpSize); // Move the tmp file to the final dest if (url.isLocalFile()) { - if( ::rename( QFile::encodeName(tmpName), QFile::encodeName( url.path())) < 0 ) { - return i18n("Could not write to %1.").arg(url.path()); + if( ::rename( TQFile::encodeName(tmpName), TQFile::encodeName( url.path())) < 0 ) { + return i18n("Could not write to %1.").tqarg(url.path()); } } else { if (!KIO::NetAccess::upload(tmp.name(), url, KApplication::kApplication()->mainWidget() )) { - return i18n("Could not upload the file to %1.").arg(url.prettyURL()); + return i18n("Could not upload the file to %1.").tqarg(url.prettyURL()); } } - return QString::null; + return TQString(); } -QString DocumentLoadedImpl::localSave(QFile* file, const QCString& format) const { - QImageIO iio(file, format); +TQString DocumentLoadedImpl::localSave(TQFile* file, const TQCString& format) const { + TQImageIO iio(file, format); iio.setImage(mDocument->image()); if (!iio.write()) { return i18n("An error happened while saving."); } - return QString::null; + return TQString(); } diff --git a/src/gvcore/documentloadedimpl.h b/src/gvcore/documentloadedimpl.h index 6951090..42b8b0b 100644 --- a/src/gvcore/documentloadedimpl.h +++ b/src/gvcore/documentloadedimpl.h @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -21,32 +21,33 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef DOCUMENTLOADEDIMPL_H #define DOCUMENTLOADEDIMPL_H -// Qt -#include <qimage.h> +// TQt +#include <tqimage.h> // Local #include "documentimpl.h" -class QFile; +class TQFile; namespace Gwenview { class Document; class DocumentLoadedImpl : public DocumentImpl { Q_OBJECT + TQ_OBJECT public: DocumentLoadedImpl(Document* document); void init(); ~DocumentLoadedImpl(); void transform(ImageUtils::Orientation); - QString save(const KURL&, const QCString& format) const; + TQString save(const KURL&, const TQCString& format) const; virtual MimeTypeUtils::Kind urlKind() const { return MimeTypeUtils::KIND_RASTER_IMAGE; } virtual bool canBeSaved() const { return true; } protected: - virtual QString localSave(QFile* file, const QCString& format) const; + virtual TQString localSave(TQFile* file, const TQCString& format) const; }; } // namespace diff --git a/src/gvcore/documentloadingimpl.cpp b/src/gvcore/documentloadingimpl.cpp index 2a6efd7..072229e 100644 --- a/src/gvcore/documentloadingimpl.cpp +++ b/src/gvcore/documentloadingimpl.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -21,7 +21,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "documentloadingimpl.moc" -// Qt +// TQt // KDE #include <kmimetype.h> @@ -86,20 +86,20 @@ void DocumentLoadingImpl::init() { switchToImpl(new DocumentOtherLoadedImpl(mDocument)); return; } - connect( d->mLoader, SIGNAL( urlKindDetermined()), SLOT( slotURLKindDetermined() )); - connect( d->mLoader, SIGNAL( sizeLoaded( int, int )), SLOT( sizeLoaded( int, int ))); - connect( d->mLoader, SIGNAL( imageChanged( const QRect& )), SLOT( imageChanged( const QRect& ))); - connect( d->mLoader, SIGNAL( imageLoaded( bool )), SLOT( imageLoaded( bool ))); + connect( d->mLoader, TQT_SIGNAL( urlKindDetermined()), TQT_SLOT( slotURLKindDetermined() )); + connect( d->mLoader, TQT_SIGNAL( sizeLoaded( int, int )), TQT_SLOT( sizeLoaded( int, int ))); + connect( d->mLoader, TQT_SIGNAL( imageChanged( const TQRect& )), TQT_SLOT( imageChanged( const TQRect& ))); + connect( d->mLoader, TQT_SIGNAL( imageLoaded( bool )), TQT_SLOT( imageLoaded( bool ))); // it's possible the loader already has the whole or at least part of the image loaded - QImage image = d->mLoader->processedImage(); + TQImage image = d->mLoader->processedImage(); if (!image.isNull()) { if( d->mLoader->frames().count() > 0 ) { setImage( d->mLoader->frames().first().image); emitImageRectUpdated(); } else { setImage(image); - QMemArray< QRect > rects = d->mLoader->loadedRegion().rects(); + TQMemArray< TQRect > rects = TQRegion(d->mLoader->loadedRegion()).tqrects(); for( unsigned int i = 0; i < rects.count(); ++i ) { emit rectUpdated(rects[i]); } @@ -121,7 +121,7 @@ void DocumentLoadingImpl::slotURLKindDetermined() { void DocumentLoadingImpl::imageLoaded( bool ok ) { LOG(""); - QCString format = d->mLoader->imageFormat(); + TQCString format = d->mLoader->imageFormat(); if ( !ok || format.isEmpty()) { // Unknown format, no need to go further emit finished(false); @@ -145,7 +145,7 @@ void DocumentLoadingImpl::imageLoaded( bool ok ) { } -void DocumentLoadingImpl::imageChanged(const QRect& rect) { +void DocumentLoadingImpl::imageChanged(const TQRect& rect) { LOG(rect); setImage(d->mLoader->processedImage()); emit rectUpdated(rect); diff --git a/src/gvcore/documentloadingimpl.h b/src/gvcore/documentloadingimpl.h index 83543a9..a5bba3f 100644 --- a/src/gvcore/documentloadingimpl.h +++ b/src/gvcore/documentloadingimpl.h @@ -33,6 +33,7 @@ class DocumentLoadingImplPrivate; class DocumentLoadingImpl : public DocumentImpl { Q_OBJECT + TQ_OBJECT public: DocumentLoadingImpl(Document* document); ~DocumentLoadingImpl(); @@ -46,7 +47,7 @@ private: private slots: void slotURLKindDetermined(); void sizeLoaded(int, int); - void imageChanged(const QRect&); + void imageChanged(const TQRect&); void imageLoaded( bool ok ); }; diff --git a/src/gvcore/documentotherloadedimpl.h b/src/gvcore/documentotherloadedimpl.h index 8343d05..b3b91b0 100644 --- a/src/gvcore/documentotherloadedimpl.h +++ b/src/gvcore/documentotherloadedimpl.h @@ -32,7 +32,7 @@ class DocumentOtherLoadedImpl : public DocumentImpl { public: DocumentOtherLoadedImpl(Document* document) : DocumentImpl(document) { - setImage(QImage()); + setImage(TQImage()); setImageFormat(0); } diff --git a/src/gvcore/dragpixmapgenerator.h b/src/gvcore/dragpixmapgenerator.h index d73d776..efbbd93 100644 --- a/src/gvcore/dragpixmapgenerator.h +++ b/src/gvcore/dragpixmapgenerator.h @@ -21,12 +21,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef DRAGPIXMAPGENERATOR_H #define DRAGPIXMAPGENERATOR_H -// Qt -#include <qapplication.h> -#include <qpixmap.h> -#include <qtooltip.h> -#include <qvaluelist.h> -#include <qvaluevector.h> +// TQt +#include <tqapplication.h> +#include <tqpixmap.h> +#include <tqtooltip.h> +#include <tqvaluelist.h> +#include <tqvaluevector.h> // KDE #include <klocale.h> @@ -47,8 +47,8 @@ public: virtual void setGenerator(DragPixmapGenerator<T>* generator) { mGenerator = generator; } - virtual QSize itemSize(T)=0; - virtual void drawItem(QPainter*, int left, int top, T)=0; + virtual TQSize itemSize(T)=0; + virtual void drawItem(TQPainter*, int left, int top, T)=0; virtual int spacing() const { return 0; } @@ -58,7 +58,7 @@ protected: }; -QPixmap dragPixmapGeneratorHelper(QValueVector<QPixmap> pixmapVector); +TQPixmap dragPixmapGeneratorHelper(TQValueVector<TQPixmap> pixmapVector); template <class T> @@ -104,23 +104,23 @@ public: drawer->setGenerator(this); } - QPixmap generate() { + TQPixmap generate() { int width = 0, height = 0; int dragCount = 0; int spacing = mItemDrawer->spacing(); bool listCropped; - QString bottomText; - QFontMetrics fm = QApplication::fontMetrics(); + TQString bottomText; + TQFontMetrics fm = TQApplication::fontMetrics(); // Compute pixmap size and update dragCount - QValueListIterator<T> it = mItemList.begin(); - QValueListIterator<T> end = mItemList.end(); + TQValueListIterator<T> it = mItemList.begin(); + TQValueListIterator<T> end = mItemList.end(); height = -spacing; for (; it!= end && height < MAX_HEIGHT; ++dragCount, ++it) { - QSize itemSize = mItemDrawer->itemSize(*it); + TQSize itemSize = mItemDrawer->itemSize(*it); Q_ASSERT(itemSize.width() <= ITEM_MAX_WIDTH); - width = QMAX(width, itemSize.width()); + width = TQMAX(width, itemSize.width()); height += itemSize.height() + spacing; } @@ -128,18 +128,18 @@ public: if (listCropped) { // If list has been cropped, leave space for item count text height += fm.height(); - bottomText = i18n("%1 items").arg(mItemList.count()); - width = QMAX(width, fm.width("... " + bottomText)); + bottomText = i18n("%1 items").tqarg(mItemList.count()); + width = TQMAX(width, fm.width("... " + bottomText)); } mPixmapWidth = width; // Init pixmap - QPixmap pixmap(width + 2*DRAG_MARGIN, height + 2*DRAG_MARGIN); - QColorGroup cg = QToolTip::palette().active(); + TQPixmap pixmap(width + 2*DRAG_MARGIN, height + 2*DRAG_MARGIN); + TQColorGroup cg = TQToolTip::palette().active(); pixmap.fill(cg.base()); - QPainter painter(&pixmap); + TQPainter painter(&pixmap); // Draw border painter.setPen(cg.dark()); @@ -156,7 +156,7 @@ public: // Draw text if necessary if (listCropped) { int posY= height + fm.ascent(); - painter.drawText(DRAG_MARGIN, posY, "..."); + painter.drawText(DRAG_MARGIN, posY, TQString("...")); int offset = width - fm.width(bottomText); painter.drawText(DRAG_MARGIN + offset, posY, bottomText); } @@ -167,7 +167,7 @@ public: private: - QValueList<T> mItemList; + TQValueList<T> mItemList; DragPixmapItemDrawer<T>* mItemDrawer; int mPixmapWidth; }; diff --git a/src/gvcore/externaltoolaction.cpp b/src/gvcore/externaltoolaction.cpp index f8e4ad6..4953e8d 100644 --- a/src/gvcore/externaltoolaction.cpp +++ b/src/gvcore/externaltoolaction.cpp @@ -18,8 +18,8 @@ Copyright 2000-2004 Aurélien Gâteau Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Qt -#include <qdir.h> +// TQt +#include <tqdir.h> // KDE #include <kdebug.h> @@ -31,25 +31,25 @@ Copyright 2000-2004 Aurélien Gâteau namespace Gwenview { ExternalToolAction::ExternalToolAction( - QObject* parent, const KService* service, + TQObject* tqparent, const KService* service, const KURL::List& urls) -: KAction(parent) +: KAction(tqparent) , mService(service) , mURLs(urls) { setText(service->name()); setIcon(service->icon()); - connect(this, SIGNAL(activated()), - this, SLOT(openExternalTool()) ); + connect(this, TQT_SIGNAL(activated()), + this, TQT_SLOT(openExternalTool()) ); } void ExternalToolAction::openExternalTool() { - QString dir=mURLs.first().directory(); - QDir::setCurrent(dir); + TQString dir=mURLs.first().directory(); + TQDir::setCurrent(dir); - QStringList args=KRun::processDesktopExec(*mService, mURLs, true); + TQStringList args=KRun::processDesktopExec(*mService, mURLs, true); KRun::runCommand(args.join(" "), mService->name(), mService->icon()); } diff --git a/src/gvcore/externaltoolaction.h b/src/gvcore/externaltoolaction.h index d2c450e..287938a 100644 --- a/src/gvcore/externaltoolaction.h +++ b/src/gvcore/externaltoolaction.h @@ -34,8 +34,9 @@ namespace Gwenview { */ class ExternalToolAction : public KAction { Q_OBJECT + TQ_OBJECT public: - ExternalToolAction(QObject* parent, const KService*, const KURL::List&); + ExternalToolAction(TQObject* tqparent, const KService*, const KURL::List&); private slots: void openExternalTool(); diff --git a/src/gvcore/externaltoolcontext.cpp b/src/gvcore/externaltoolcontext.cpp index 24456e5..a82f900 100644 --- a/src/gvcore/externaltoolcontext.cpp +++ b/src/gvcore/externaltoolcontext.cpp @@ -36,10 +36,10 @@ Copyright 2000-2004 Aurélien Gâteau namespace Gwenview { ExternalToolContext::ExternalToolContext( - QObject* parent, + TQObject* tqparent, std::list<KService*> services, KURL::List urls) -: QObject(parent) +: TQObject(tqparent) , mServices(services) , mURLs(urls) {} @@ -56,8 +56,8 @@ void ExternalToolContext::showOpenWithDialog() { } -QPopupMenu* ExternalToolContext::popupMenu() { - QPopupMenu* menu=new QPopupMenu(); +TQPopupMenu* ExternalToolContext::popupMenu() { + TQPopupMenu* menu=new TQPopupMenu(); std::list<KService*>::const_iterator it=mServices.begin(); std::list<KService*>::const_iterator itEnd=mServices.end(); for (;it!=itEnd; ++it) { @@ -68,11 +68,11 @@ QPopupMenu* ExternalToolContext::popupMenu() { menu->insertSeparator(); menu->insertItem(i18n("Other..."), - this, SLOT(showOpenWithDialog()) ); + this, TQT_SLOT(showOpenWithDialog()) ); menu->insertItem( SmallIcon("configure"), i18n("Configure External Tools..."), - this, SLOT(showExternalToolDialog()) ); + this, TQT_SLOT(showExternalToolDialog()) ); return menu; } diff --git a/src/gvcore/externaltoolcontext.h b/src/gvcore/externaltoolcontext.h index 01a3574..0c61e1c 100644 --- a/src/gvcore/externaltoolcontext.h +++ b/src/gvcore/externaltoolcontext.h @@ -24,8 +24,8 @@ Copyright 2000-2004 Aurélien Gâteau // STL #include <list> -// Qt -#include <qobject.h> +// TQt +#include <tqobject.h> // KDE #include <kurl.h> @@ -33,17 +33,18 @@ Copyright 2000-2004 Aurélien Gâteau // Local #include "libgwenview_export.h" -class QPopupMenu; +class TQPopupMenu; class KService; namespace Gwenview { -class LIBGWENVIEW_EXPORT ExternalToolContext : public QObject { +class LIBGWENVIEW_EXPORT ExternalToolContext : public TQObject { Q_OBJECT + TQ_OBJECT public: - ExternalToolContext(QObject* parent, + ExternalToolContext(TQObject* tqparent, std::list<KService*> services, KURL::List urls); - QPopupMenu* popupMenu(); + TQPopupMenu* popupMenu(); private slots: void showExternalToolDialog(); diff --git a/src/gvcore/externaltooldialog.cpp b/src/gvcore/externaltooldialog.cpp index e8b0809..1835fc9 100644 --- a/src/gvcore/externaltooldialog.cpp +++ b/src/gvcore/externaltooldialog.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -18,10 +18,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Qt -#include <qbuttongroup.h> -#include <qheader.h> -#include <qwhatsthis.h> +// TQt +#include <tqbuttongroup.h> +#include <tqheader.h> +#include <tqwhatsthis.h> // KDE #include <kdebug.h> @@ -51,8 +51,8 @@ enum { ID_ALL_IMAGES=0, ID_ALL_FILES, ID_CUSTOM }; class ToolListViewItem : public KListViewItem { public: - ToolListViewItem(KListView* parent, const QString& label) - : KListViewItem(parent, label), mDesktopFile(0L) {} + ToolListViewItem(KListView* tqparent, const TQString& label) + : KListViewItem(tqparent, label), mDesktopFile(0L) {} void setDesktopFile(KDesktopFile* df) { mDesktopFile=df; @@ -69,7 +69,7 @@ private: struct ExternalToolDialogPrivate { ExternalToolDialogBase* mContent; - QPtrList<KDesktopFile> mDeletedTools; + TQPtrList<KDesktopFile> mDeletedTools; ToolListViewItem* mSelectedItem; @@ -77,21 +77,21 @@ struct ExternalToolDialogPrivate { : mSelectedItem(0L) {} void fillMimeTypeListView() { - QStringList mimeTypes=MimeTypeUtils::rasterImageMimeTypes(); + TQStringList mimeTypes=MimeTypeUtils::rasterImageMimeTypes(); mimeTypes.append("inode/directory"); mimeTypes+=Archive::mimeTypes(); - QStringList::const_iterator it=mimeTypes.begin(); + TQStringList::const_iterator it=mimeTypes.begin(); for(; it!=mimeTypes.end(); ++it) { - (void)new QCheckListItem(mContent->mMimeTypeListView, *it, QCheckListItem::CheckBox); + (void)new TQCheckListItem(mContent->mMimeTypeListView, *it, TQCheckListItem::CheckBox); } } void fillToolListView() { - QDict<KDesktopFile> desktopFiles=ExternalToolManager::instance()->desktopFiles(); + TQDict<KDesktopFile> desktopFiles=ExternalToolManager::instance()->desktopFiles(); - QDictIterator<KDesktopFile> it(desktopFiles); + TQDictIterator<KDesktopFile> it(desktopFiles); for (; it.current(); ++it) { ToolListViewItem* item=new ToolListViewItem(mContent->mToolListView, it.current()->readName()); item->setPixmap(0, SmallIcon(it.current()->readIcon()) ); @@ -103,7 +103,7 @@ struct ExternalToolDialogPrivate { void writeServiceTypes(KDesktopFile* desktopFile) { - QButton* button=mContent->mFileAssociationGroup->selected(); + TQButton* button=mContent->mFileAssociationGroup->selected(); if (!button) { desktopFile->writeEntry("ServiceTypes", "*"); return; @@ -119,10 +119,10 @@ struct ExternalToolDialogPrivate { return; } - QStringList mimeTypes; - QListViewItem* item=mContent->mMimeTypeListView->firstChild(); + TQStringList mimeTypes; + TQListViewItem* item=mContent->mMimeTypeListView->firstChild(); for (; item; item=item->nextSibling()) { - if (static_cast<QCheckListItem*>(item)->isOn()) { + if (static_cast<TQCheckListItem*>(item)->isOn()) { mimeTypes.append(item->text(0)); } } @@ -134,17 +134,17 @@ struct ExternalToolDialogPrivate { if (!mSelectedItem) return true; // Check name - QString name=mContent->mName->text().stripWhiteSpace(); + TQString name=mContent->mName->text().stripWhiteSpace(); if (name.isEmpty()) { KMessageBox::sorry(mContent, i18n("The tool name cannot be empty")); return false; } - QListViewItem* item=mContent->mToolListView->firstChild(); + TQListViewItem* item=mContent->mToolListView->firstChild(); for (; item; item=item->nextSibling()) { if (item==mSelectedItem) continue; if (name==item->text(0)) { - KMessageBox::sorry(mContent, i18n("There is already a tool named \"%1\"").arg(name)); + KMessageBox::sorry(mContent, i18n("There is already a tool named \"%1\"").tqarg(name)); return false; } } @@ -172,10 +172,10 @@ struct ExternalToolDialogPrivate { } - void updateFileAssociationGroup(const QStringList& serviceTypes) { - QListViewItem* item=mContent->mMimeTypeListView->firstChild(); + void updateFileAssociationGroup(const TQStringList& serviceTypes) { + TQListViewItem* item=mContent->mMimeTypeListView->firstChild(); for (; item; item=item->nextSibling()) { - static_cast<QCheckListItem*>(item)->setOn(false); + static_cast<TQCheckListItem*>(item)->setOn(false); } if (serviceTypes.size()==0) { @@ -183,7 +183,7 @@ struct ExternalToolDialogPrivate { return; } if (serviceTypes.size()==1) { - QString serviceType=serviceTypes[0]; + TQString serviceType=serviceTypes[0]; if (serviceType=="image/*") { mContent->mFileAssociationGroup->setButton(ID_ALL_IMAGES); return; @@ -195,11 +195,11 @@ struct ExternalToolDialogPrivate { } mContent->mFileAssociationGroup->setButton(ID_CUSTOM); - QStringList::ConstIterator it=serviceTypes.begin(); + TQStringList::ConstIterator it=serviceTypes.begin(); for (;it!=serviceTypes.end(); ++it) { - QListViewItem* item= - mContent->mMimeTypeListView->findItem(*it, 0, Qt::ExactMatch); - if (item) static_cast<QCheckListItem*>(item)->setOn(true); + TQListViewItem* item= + mContent->mMimeTypeListView->tqfindItem(*it, 0, TQt::ExactMatch); + if (item) static_cast<TQCheckListItem*>(item)->setOn(true); } } @@ -213,21 +213,21 @@ struct ExternalToolDialogPrivate { mContent->mName->setText(desktopFile->readName()); mContent->mCommand->setURL(desktopFile->readEntry("Exec")); mContent->mIconButton->setIcon(desktopFile->readIcon()); - QStringList serviceTypes=desktopFile->readListEntry("ServiceTypes"); + TQStringList serviceTypes=desktopFile->readListEntry("ServiceTypes"); updateFileAssociationGroup(serviceTypes); return; } } - mContent->mName->setText(QString::null); - mContent->mCommand->setURL(QString::null); - mContent->mIconButton->setIcon(QString::null); + mContent->mName->setText(TQString()); + mContent->mCommand->setURL(TQString()); + mContent->mIconButton->setIcon(TQString()); mContent->mFileAssociationGroup->setButton(ID_ALL_IMAGES); } bool apply() { if (!saveChanges()) return false; - QPtrListIterator<KDesktopFile> it(mDeletedTools); + TQPtrListIterator<KDesktopFile> it(mDeletedTools); for(; it.current(); ++it) { ExternalToolManager::instance()->hideDesktopFile(it.current()); } @@ -241,25 +241,25 @@ struct ExternalToolDialogPrivate { * This event filter object is here to prevent the user from selecting a * different tool in the tool list view if the current tool could not be saved. */ -class ToolListViewFilterObject : public QObject { +class ToolListViewFilterObject : public TQObject { ExternalToolDialogPrivate* d; public: - ToolListViewFilterObject(QObject* parent, ExternalToolDialogPrivate* _d) - : QObject(parent), d(_d) {} + ToolListViewFilterObject(TQObject* tqparent, ExternalToolDialogPrivate* _d) + : TQObject(tqparent), d(_d) {} - bool eventFilter(QObject*, QEvent* event) { - if (event->type()!=QEvent::MouseButtonPress) return false; + bool eventFilter(TQObject*, TQEvent* event) { + if (event->type()!=TQEvent::MouseButtonPress) return false; return !d->saveChanges(); } }; -ExternalToolDialog::ExternalToolDialog(QWidget* parent) +ExternalToolDialog::ExternalToolDialog(TQWidget* tqparent) : KDialogBase( - parent,0, false, QString::null, KDialogBase::Ok|KDialogBase::Apply|KDialogBase::Cancel, + tqparent,0, false, TQString(), KDialogBase::Ok|KDialogBase::Apply|KDialogBase::Cancel, KDialogBase::Ok, true) { - setWFlags(getWFlags() | Qt::WDestructiveClose); + setWFlags(getWFlags() | TQt::WDestructiveClose); d=new ExternalToolDialogPrivate; d->mContent=new ExternalToolDialogBase(this); @@ -272,18 +272,18 @@ ExternalToolDialog::ExternalToolDialog(QWidget* parent) d->fillMimeTypeListView(); d->fillToolListView(); d->mContent->mToolListView->viewport()->installEventFilter( - new ToolListViewFilterObject(this, d)); - - connect( d->mContent->mToolListView, SIGNAL(selectionChanged(QListViewItem*)), - this, SLOT(slotSelectionChanged(QListViewItem*)) ); - connect( d->mContent->mAddButton, SIGNAL(clicked()), - this, SLOT(addTool()) ); - connect( d->mContent->mDeleteButton, SIGNAL(clicked()), - this, SLOT(deleteTool()) ); - connect( d->mContent->mHelp, SIGNAL(leftClickedURL()), - this, SLOT(showCommandHelp()) ); - connect( d->mContent->mMoreTools, SIGNAL(leftClickedURL(const QString&)), - this, SLOT(openURL(const QString&)) ); + new ToolListViewFilterObject(TQT_TQOBJECT(this), d)); + + connect( d->mContent->mToolListView, TQT_SIGNAL(selectionChanged(TQListViewItem*)), + this, TQT_SLOT(slotSelectionChanged(TQListViewItem*)) ); + connect( d->mContent->mAddButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(addTool()) ); + connect( d->mContent->mDeleteButton, TQT_SIGNAL(clicked()), + this, TQT_SLOT(deleteTool()) ); + connect( d->mContent->mHelp, TQT_SIGNAL(leftClickedURL()), + this, TQT_SLOT(showCommandHelp()) ); + connect( d->mContent->mMoreTools, TQT_SIGNAL(leftClickedURL(const TQString&)), + this, TQT_SLOT(openURL(const TQString&)) ); KListView* view=d->mContent->mToolListView; if (view->firstChild()) { @@ -314,7 +314,7 @@ void ExternalToolDialog::slotCancel() { } -void ExternalToolDialog::slotSelectionChanged(QListViewItem* item) { +void ExternalToolDialog::slotSelectionChanged(TQListViewItem* item) { d->mSelectedItem=static_cast<ToolListViewItem*>(item); d->updateDetails(); } @@ -322,7 +322,7 @@ void ExternalToolDialog::slotSelectionChanged(QListViewItem* item) { void ExternalToolDialog::addTool() { KListView* view=d->mContent->mToolListView; - QString name=i18n("<Unnamed tool>"); + TQString name=i18n("<Unnamed tool>"); ToolListViewItem* item=new ToolListViewItem(view, name); view->setSelected(item, true); } @@ -343,12 +343,12 @@ void ExternalToolDialog::deleteTool() { void ExternalToolDialog::showCommandHelp() { KURLRequester* lbl=d->mContent->mCommand; - QWhatsThis::display(QWhatsThis::textFor(lbl), + TQWhatsThis::display(TQWhatsThis::textFor(lbl), lbl->mapToGlobal( lbl->rect().bottomRight() ) ); } -void ExternalToolDialog::openURL(const QString& url) { +void ExternalToolDialog::openURL(const TQString& url) { new KRun(KURL(url)); } diff --git a/src/gvcore/externaltooldialog.h b/src/gvcore/externaltooldialog.h index 890644f..149817b 100644 --- a/src/gvcore/externaltooldialog.h +++ b/src/gvcore/externaltooldialog.h @@ -33,8 +33,9 @@ namespace Gwenview { class ExternalToolDialogPrivate; class LIBGWENVIEW_EXPORT ExternalToolDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - ExternalToolDialog(QWidget* parent); + ExternalToolDialog(TQWidget* tqparent); ~ExternalToolDialog(); protected slots: @@ -43,11 +44,11 @@ protected slots: void slotCancel(); private slots: - void slotSelectionChanged(QListViewItem*); + void slotSelectionChanged(TQListViewItem*); void addTool(); void deleteTool(); void showCommandHelp(); - void openURL(const QString& url); + void openURL(const TQString& url); private: ExternalToolDialogPrivate* d; diff --git a/src/gvcore/externaltooldialogbase.ui b/src/gvcore/externaltooldialogbase.ui index 7b17ed4..7166a3d 100644 --- a/src/gvcore/externaltooldialogbase.ui +++ b/src/gvcore/externaltooldialogbase.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>ExternalToolDialogBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ExternalToolDialogBase</cstring> </property> - <property name="geometry"> + <property name="tqgeometry"> <rect> <x>0</x> <y>0</y> @@ -20,7 +20,7 @@ <verstretch>0</verstretch> </sizepolicy> </property> - <property name="minimumSize"> + <property name="tqminimumSize"> <size> <width>720</width> <height>0</height> @@ -49,14 +49,14 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>487</width> <height>16</height> </size> </property> </spacer> - <widget class="QPushButton" row="1" column="1"> + <widget class="TQPushButton" row="1" column="1"> <property name="name"> <cstring>mDeleteButton</cstring> </property> @@ -64,7 +64,7 @@ <string>&Delete</string> </property> </widget> - <widget class="QPushButton" row="1" column="0"> + <widget class="TQPushButton" row="1" column="0"> <property name="name"> <cstring>mAddButton</cstring> </property> @@ -113,7 +113,7 @@ <bool>true</bool> </property> </widget> - <widget class="QFrame" row="0" column="2" rowspan="1" colspan="2"> + <widget class="TQFrame" row="0" column="2" rowspan="1" colspan="2"> <property name="name"> <cstring>mDetails</cstring> </property> @@ -130,7 +130,7 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -151,9 +151,9 @@ <string>File Associations</string> </property> </widget> - <widget class="QLayoutWidget" row="0" column="0"> + <widget class="TQLayoutWidget" row="0" column="0"> <property name="name"> - <cstring>layout3</cstring> + <cstring>tqlayout3</cstring> </property> <grid> <property name="name"> @@ -175,7 +175,7 @@ <string></string> </property> </widget> - <widget class="QLabel" row="0" column="0"> + <widget class="TQLabel" row="0" column="0"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -194,7 +194,7 @@ <string></string> </property> </widget> - <widget class="QLabel" row="1" column="0"> + <widget class="TQLabel" row="1" column="0"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -233,7 +233,7 @@ You can use keywords in the Command field: </widget> </grid> </widget> - <widget class="QButtonGroup" row="2" column="0"> + <widget class="TQButtonGroup" row="2" column="0"> <property name="name"> <cstring>mFileAssociationGroup</cstring> </property> @@ -261,7 +261,7 @@ You can use keywords in the Command field: <property name="spacing"> <number>6</number> </property> - <widget class="QRadioButton" row="0" column="0" rowspan="1" colspan="2"> + <widget class="TQRadioButton" row="0" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>radioButton1</cstring> </property> @@ -275,7 +275,7 @@ You can use keywords in the Command field: <number>0</number> </property> </widget> - <widget class="QRadioButton" row="1" column="0" rowspan="1" colspan="2"> + <widget class="TQRadioButton" row="1" column="0" rowspan="1" colspan="2"> <property name="name"> <cstring>radioButton2</cstring> </property> @@ -286,7 +286,7 @@ You can use keywords in the Command field: <number>1</number> </property> </widget> - <widget class="QRadioButton" row="2" column="0"> + <widget class="TQRadioButton" row="2" column="0"> <property name="name"> <cstring>radioButton3</cstring> </property> @@ -304,7 +304,7 @@ You can use keywords in the Command field: <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>21</width> <height>140</height> @@ -358,7 +358,7 @@ You can use keywords in the Command field: <tabstop>radioButton1</tabstop> <tabstop>mMimeTypeListView</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>klistview.h</includehint> <includehint>kurllabel.h</includehint> diff --git a/src/gvcore/externaltoolmanager.cpp b/src/gvcore/externaltoolmanager.cpp index 9e6fc9e..3471bc0 100644 --- a/src/gvcore/externaltoolmanager.cpp +++ b/src/gvcore/externaltoolmanager.cpp @@ -21,8 +21,8 @@ Copyright 2000-2004 Aurélien Gâteau // STL #include <list> -// Qt -#include <qdir.h> +// TQt +#include <tqdir.h> // KDE #include <kdebug.h> @@ -47,7 +47,7 @@ namespace Gwenview { #endif // Helper functions for createContextInternal -inline bool mimeTypeMatches(const QString& candidate, const QString& reference) { +inline bool mimeTypeMatches(const TQString& candidate, const TQString& reference) { if (reference=="*") return true; if (reference.right(1)=="*") { @@ -57,15 +57,15 @@ inline bool mimeTypeMatches(const QString& candidate, const QString& reference) } } -inline bool isSubSetOf(const QStringList& subSet, const QStringList& set) { +inline bool isSubSetOf(const TQStringList& subSet, const TQStringList& set) { // Simple implementation, might need some optimization - QStringList::ConstIterator itSubSet=subSet.begin(); - QStringList::ConstIterator itSetBegin=set.begin(); - QStringList::ConstIterator itSetEnd=set.end(); + TQStringList::ConstIterator itSubSet=subSet.begin(); + TQStringList::ConstIterator itSetBegin=set.begin(); + TQStringList::ConstIterator itSetEnd=set.end(); for (; itSubSet!=subSet.end(); ++itSubSet) { bool matchFound=false; - QStringList::ConstIterator itSet=itSetBegin; + TQStringList::ConstIterator itSet=itSetBegin; for (; itSet!=itSetEnd; ++itSet) { if (mimeTypeMatches(*itSubSet, *itSet)) { matchFound=true; @@ -81,9 +81,9 @@ inline bool isSubSetOf(const QStringList& subSet, const QStringList& set) { struct ExternalToolManagerPrivate { - QDict<KDesktopFile> mDesktopFiles; - QPtrList<KService> mServices; - QString mUserToolDir; + TQDict<KDesktopFile> mDesktopFiles; + TQPtrList<KService> mServices; + TQString mUserToolDir; /** * Helper function for createContextInternal @@ -95,49 +95,49 @@ struct ExternalToolManagerPrivate { } ExternalToolContext* createContextInternal( - QObject* parent, const KURL::List& urls, const QStringList& mimeTypes) + TQObject* tqparent, const KURL::List& urls, const TQStringList& mimeTypes) { bool onlyOneURL=urls.size()==1; // Only add to selectionServices the services which can handle all the // different mime types present in the selection // - // We use std::list instead of QValueList because it's not possible to + // We use std::list instead of TQValueList because it's not possible to // pass a sort functor to qHeapSort std::list<KService*> selectionServices; - QPtrListIterator<KService> it(mServices); + TQPtrListIterator<KService> it(mServices); for (; it.current(); ++it) { KService* service=it.current(); if (!onlyOneURL && !service->allowMultipleFiles()) { continue; } - QStringList serviceTypes=service->serviceTypes(); + TQStringList serviceTypes=service->serviceTypes(); if (isSubSetOf(mimeTypes, serviceTypes)) { selectionServices.push_back(service); } } selectionServices.sort(compareKServicePtrByName); - return new ExternalToolContext(parent, selectionServices, urls); + return new ExternalToolContext(tqparent, selectionServices, urls); } }; // Helper function for ctor -void loadDesktopFiles(QDict<KDesktopFile>& dict, const QString& dirString) { - QDir dir(dirString); - QStringList list=dir.entryList("*.desktop"); - QStringList::ConstIterator it=list.begin(); +void loadDesktopFiles(TQDict<KDesktopFile>& dict, const TQString& dirString) { + TQDir dir(dirString); + TQStringList list=dir.entryList("*.desktop"); + TQStringList::ConstIterator it=list.begin(); for (; it!=list.end(); ++it) { KDesktopFile* df=new KDesktopFile( dir.filePath(*it) ); dict.insert(*it, df); } } -inline QString addSlash(const QString& _str) { - QString str(_str); +inline TQString addSlash(const TQString& _str) { + TQString str(_str); if (str.right(1)!="/") str.append('/'); return str; } @@ -151,12 +151,12 @@ ExternalToolManager::ExternalToolManager() { Q_ASSERT(!d->mUserToolDir.isEmpty()); LOG("d->mUserToolDir:" << d->mUserToolDir); - QStringList dirs=KGlobal::dirs()->findDirs("appdata", "tools"); + TQStringList dirs=KGlobal::dirs()->findDirs("appdata", "tools"); LOG("dirs:" << dirs.join(",")); // Loading desktop files - QDict<KDesktopFile> systemDesktopFiles; - QStringList::ConstIterator it; + TQDict<KDesktopFile> systemDesktopFiles; + TQStringList::ConstIterator it; for (it=dirs.begin(); it!=dirs.end(); ++it) { if (addSlash(*it)==d->mUserToolDir) { LOG("skipping " << *it); @@ -165,18 +165,18 @@ ExternalToolManager::ExternalToolManager() { LOG("loading system desktop files from " << *it); loadDesktopFiles(systemDesktopFiles, *it); } - QDict<KDesktopFile> userDesktopFiles; + TQDict<KDesktopFile> userDesktopFiles; loadDesktopFiles(userDesktopFiles, d->mUserToolDir); // Merge system and user desktop files into our KDesktopFile dictionary d->mDesktopFiles=systemDesktopFiles; d->mDesktopFiles.setAutoDelete(true); - QDictIterator<KDesktopFile> itDict(userDesktopFiles); + TQDictIterator<KDesktopFile> itDict(userDesktopFiles); for (; itDict.current(); ++itDict) { - QString name=itDict.currentKey(); + TQString name=itDict.currentKey(); KDesktopFile* df=itDict.current(); - if (d->mDesktopFiles.find(name)) { + if (d->mDesktopFiles.tqfind(name)) { d->mDesktopFiles.remove(name); } if (df->readBoolEntry("Hidden")) { @@ -204,7 +204,7 @@ ExternalToolManager* ExternalToolManager::instance() { void ExternalToolManager::updateServices() { d->mServices.clear(); - QDictIterator<KDesktopFile> it(d->mDesktopFiles); + TQDictIterator<KDesktopFile> it(d->mDesktopFiles); for (; it.current(); ++it) { KDesktopFile* desktopFile=it.current(); // If sync() is not called, KService does not read up to date content @@ -215,14 +215,14 @@ void ExternalToolManager::updateServices() { } -QDict<KDesktopFile>& ExternalToolManager::desktopFiles() const { +TQDict<KDesktopFile>& ExternalToolManager::desktopFiles() const { return d->mDesktopFiles; } void ExternalToolManager::hideDesktopFile(KDesktopFile* desktopFile) { - QFileInfo fi(desktopFile->fileName()); - QString name=QString("%1.desktop").arg( fi.baseName(true) ); + TQFileInfo fi(desktopFile->fileName()); + TQString name=TQString("%1.desktop").tqarg( fi.baseName(true) ); d->mDesktopFiles.take(name); if (desktopFile->isReadOnly()) { @@ -237,57 +237,57 @@ void ExternalToolManager::hideDesktopFile(KDesktopFile* desktopFile) { KDesktopFile* ExternalToolManager::editSystemDesktopFile(const KDesktopFile* desktopFile) { Q_ASSERT(desktopFile); - QFileInfo fi(desktopFile->fileName()); + TQFileInfo fi(desktopFile->fileName()); - QString name=fi.baseName(true); - d->mDesktopFiles.remove(QString("%1.desktop").arg(name)); + TQString name=fi.baseName(true); + d->mDesktopFiles.remove(TQString("%1.desktop").tqarg(name)); return createUserDesktopFile(name); } -KDesktopFile* ExternalToolManager::createUserDesktopFile(const QString& name) { +KDesktopFile* ExternalToolManager::createUserDesktopFile(const TQString& name) { Q_ASSERT(!name.isEmpty()); KDesktopFile* desktopFile=new KDesktopFile( d->mUserToolDir + "/" + name + ".desktop", false); - d->mDesktopFiles.insert(QString("%1.desktop").arg(name), desktopFile); + d->mDesktopFiles.insert(TQString("%1.desktop").tqarg(name), desktopFile); return desktopFile; } ExternalToolContext* ExternalToolManager::createContext( - QObject* parent, const KFileItemList* items) + TQObject* tqparent, const KFileItemList* items) { KURL::List urls; - QStringList mimeTypes; + TQStringList mimeTypes; // Create our URL list and a list of the different mime types present in // the selection - QPtrListIterator<KFileItem> it(*items); + TQPtrListIterator<KFileItem> it(*items); for (; it.current(); ++it) { urls.append(it.current()->url()); - QString mimeType=it.current()->mimetype(); - if (!mimeTypes.contains(mimeType)) { + TQString mimeType=it.current()->mimetype(); + if (!mimeTypes.tqcontains(mimeType)) { mimeTypes.append(mimeType); } } - return d->createContextInternal(parent, urls, mimeTypes); + return d->createContextInternal(tqparent, urls, mimeTypes); } ExternalToolContext* ExternalToolManager::createContext( - QObject* parent, const KURL& url) + TQObject* tqparent, const KURL& url) { KURL::List urls; - QStringList mimeTypes; + TQStringList mimeTypes; urls.append(url); - QString mimeType=KMimeType::findByURL(url, 0, url.isLocalFile(), true)->name(); + TQString mimeType=KMimeType::findByURL(url, 0, url.isLocalFile(), true)->name(); mimeTypes.append(mimeType); - return d->createContextInternal(parent, urls, mimeTypes); + return d->createContextInternal(tqparent, urls, mimeTypes); } diff --git a/src/gvcore/externaltoolmanager.h b/src/gvcore/externaltoolmanager.h index fd767e3..96a6706 100644 --- a/src/gvcore/externaltoolmanager.h +++ b/src/gvcore/externaltoolmanager.h @@ -21,9 +21,9 @@ Copyright 2000-2004 Aurélien Gâteau #ifndef EXTERNALTOOLMANAGER_H #define EXTERNALTOOLMANAGER_H -// Qt -#include <qdict.h> -#include <qptrlist.h> +// TQt +#include <tqdict.h> +#include <tqptrlist.h> // KDE #include <kfileitem.h> @@ -42,16 +42,16 @@ class LIBGWENVIEW_EXPORT ExternalToolManager { public: ~ExternalToolManager(); - ExternalToolContext* createContext(QObject* parent, const KFileItemList*); - ExternalToolContext* createContext(QObject* parent, const KURL&); + ExternalToolContext* createContext(TQObject* tqparent, const KFileItemList*); + ExternalToolContext* createContext(TQObject* tqparent, const KURL&); static ExternalToolManager* instance(); - QDict<KDesktopFile>& desktopFiles() const; + TQDict<KDesktopFile>& desktopFiles() const; void hideDesktopFile(KDesktopFile*); // Create a new desktop file - KDesktopFile* createUserDesktopFile(const QString& name); + KDesktopFile* createUserDesktopFile(const TQString& name); // Create a desktop file based on a existing (system) desktop file KDesktopFile* editSystemDesktopFile(const KDesktopFile* desktopFile); diff --git a/src/gvcore/filedetailview.cpp b/src/gvcore/filedetailview.cpp index 9ba2c0d..5cce441 100644 --- a/src/gvcore/filedetailview.cpp +++ b/src/gvcore/filedetailview.cpp @@ -22,13 +22,13 @@ Boston, MA 02110-1301, USA. */ -// Qt -#include <qbitmap.h> -#include <qevent.h> -#include <qheader.h> -#include <qkeycode.h> -#include <qpainter.h> -#include <qpixmap.h> +// TQt +#include <tqbitmap.h> +#include <tqevent.h> +#include <tqheader.h> +#include <tqkeycode.h> +#include <tqpainter.h> +#include <tqpixmap.h> // KDE #include <kapplication.h> @@ -49,18 +49,18 @@ namespace Gwenview { -static QPixmap createShownItemPixmap(int size, const QColor& color) { - QPixmap pix(size, size); - pix.fill(Qt::red); - QPainter painter(&pix); +static TQPixmap createShownItemPixmap(int size, const TQColor& color) { + TQPixmap pix(size, size); + pix.fill(TQt::red); + TQPainter painter(&pix); int margin = 2; - QPointArray pa(3); + TQPointArray pa(3); int arrowSize = size/2 - margin; int center = size/2 - 1; - pa[0] = QPoint((size - arrowSize) / 2, center - arrowSize); - pa[1] = QPoint((size + arrowSize) / 2, center); - pa[2] = QPoint(pa[0].x(), center + arrowSize); + pa[0] = TQPoint((size - arrowSize) / 2, center - arrowSize); + pa[1] = TQPoint((size + arrowSize) / 2, center); + pa[2] = TQPoint(pa[0].x(), center + arrowSize); painter.setBrush(color); painter.setPen(color); @@ -73,8 +73,8 @@ static QPixmap createShownItemPixmap(int size, const QColor& color) { } -FileDetailView::FileDetailView(QWidget *parent, const char *name) - : KListView(parent, name), FileViewBase() +FileDetailView::FileDetailView(TQWidget *tqparent, const char *name) + : KListView(tqparent, name), FileViewBase() { mSortingCol = COL_NAME; mBlockSortingSignal = false; @@ -88,29 +88,29 @@ FileDetailView::FileDetailView(QWidget *parent, const char *name) setShowSortIndicator( TRUE ); setAllColumnsShowFocus( TRUE ); - connect( header(), SIGNAL( sectionClicked(int)), - SLOT(slotSortingChanged(int) )); + connect( header(), TQT_SIGNAL( sectionClicked(int)), + TQT_SLOT(slotSortingChanged(int) )); - connect( this, SIGNAL( returnPressed(QListViewItem *) ), - SLOT( slotActivate( QListViewItem *) ) ); + connect( this, TQT_SIGNAL( returnPressed(TQListViewItem *) ), + TQT_SLOT( slotActivate( TQListViewItem *) ) ); - connect( this, SIGNAL( clicked(QListViewItem *, const QPoint&, int)), - SLOT( selected( QListViewItem *) ) ); - connect( this, SIGNAL( doubleClicked(QListViewItem *, const QPoint&, int)), - SLOT( slotActivate( QListViewItem *) ) ); + connect( this, TQT_SIGNAL( clicked(TQListViewItem *, const TQPoint&, int)), + TQT_SLOT( selected( TQListViewItem *) ) ); + connect( this, TQT_SIGNAL( doubleClicked(TQListViewItem *, const TQPoint&, int)), + TQT_SLOT( slotActivate( TQListViewItem *) ) ); - connect( this, SIGNAL(contextMenuRequested( QListViewItem *, - const QPoint &, int )), - this, SLOT( slotActivateMenu( QListViewItem *, const QPoint& ))); + connect( this, TQT_SIGNAL(contextMenuRequested( TQListViewItem *, + const TQPoint &, int )), + this, TQT_SLOT( slotActivateMenu( TQListViewItem *, const TQPoint& ))); - QListView::setSelectionMode( QListView::Extended ); - connect( this, SIGNAL( selectionChanged() ), - SLOT( slotSelectionChanged() )); + TQListView::setSelectionMode( TQListView::Extended ); + connect( this, TQT_SIGNAL( selectionChanged() ), + TQT_SLOT( slotSelectionChanged() )); // FileViewStack need to be aware of sort changes, to update the sort menu - connect( sig, SIGNAL(sortingChanged(QDir::SortSpec)), - this, SIGNAL(sortingChanged(QDir::SortSpec)) ); + connect( sig, TQT_SIGNAL(sortingChanged(TQDir::SortSpec)), + this, TQT_SIGNAL(sortingChanged(TQDir::SortSpec)) ); setSorting( sorting() ); @@ -125,8 +125,8 @@ FileDetailView::FileDetailView(QWidget *parent, const char *name) setDropHighlighter(false); int size = IconSize(KIcon::Small); - mShownItemUnselectedPixmap = createShownItemPixmap(size, colorGroup().highlight()); - mShownItemSelectedPixmap = createShownItemPixmap(size, colorGroup().highlightedText()); + mShownItemUnselectedPixmap = createShownItemPixmap(size, tqcolorGroup().highlight()); + mShownItemSelectedPixmap = createShownItemPixmap(size, tqcolorGroup().highlightedText()); } @@ -173,7 +173,7 @@ void FileDetailView::invertSelection() KListView::invertSelection(); } -void FileDetailView::slotActivateMenu (QListViewItem *item,const QPoint& pos ) +void FileDetailView::slotActivateMenu (TQListViewItem *item,const TQPoint& pos ) { if ( !item ) { sig->activateMenu( 0, pos ); @@ -194,7 +194,7 @@ void FileDetailView::insertItem( KFileItem *i ) { KFileView::insertItem( i ); - FileDetailViewItem *item = new FileDetailViewItem( (QListView*) this, i ); + FileDetailViewItem *item = new FileDetailViewItem( (TQListView*) this, i ); setSortingKey( item, i ); @@ -204,7 +204,7 @@ void FileDetailView::insertItem( KFileItem *i ) mResolver->m_lstPendingMimeIconItems.append( item ); } -void FileDetailView::slotActivate( QListViewItem *item ) +void FileDetailView::slotActivate( TQListViewItem *item ) { if ( !item ) return; @@ -212,7 +212,7 @@ void FileDetailView::slotActivate( QListViewItem *item ) if ( fi ) sig->activate( fi ); } -void FileDetailView::selected( QListViewItem *item ) +void FileDetailView::selected( TQListViewItem *item ) { if ( !item ) return; @@ -223,7 +223,7 @@ void FileDetailView::selected( QListViewItem *item ) } } -void FileDetailView::highlighted( QListViewItem *item ) +void FileDetailView::highlighted( TQListViewItem *item ) { if ( !item ) return; @@ -245,7 +245,7 @@ void FileDetailView::updateView( bool b ) { if ( !b ) return; - QListViewItemIterator it( (QListView*)this ); + TQListViewItemIterator it( (TQListView*)this ); for ( ; it.current(); ++it ) { FileDetailViewItem *item=static_cast<FileDetailViewItem *>(it.current()); item->setPixmap( 0, item->fileInfo()->pixmap(KIcon::SizeSmall) ); @@ -266,15 +266,15 @@ void FileDetailView::updateView( const KFileItem *i ) void FileDetailView::setSortingKey( FileDetailViewItem *dvItem, const KFileItem *item) { - QDir::SortSpec spec = KFileView::sorting(); + TQDir::SortSpec spec = KFileView::sorting(); bool isDirOrArchive=item->isDir() || Archive::fileItemIsArchive(item); - QString key; - if ( spec & QDir::Time ) { + TQString key; + if ( spec & TQDir::Time ) { time_t time = TimeUtils::getTime(item); key=sortingKey(time, isDirOrArchive, spec); - } else if ( spec & QDir::Size ) { + } else if ( spec & TQDir::Size ) { key=sortingKey( item->size(), isDirOrArchive, spec ); } else { @@ -300,46 +300,46 @@ void FileDetailView::removeItem( const KFileItem *i ) void FileDetailView::slotSortingChanged( int col ) { - QDir::SortSpec sort = sorting(); + TQDir::SortSpec sort = sorting(); int sortSpec = -1; - bool reversed = col == mSortingCol && (sort & QDir::Reversed) == 0; + bool reversed = col == mSortingCol && (sort & TQDir::Reversed) == 0; mSortingCol = col; switch( col ) { case COL_NAME: - sortSpec = (sort & ~QDir::SortByMask | QDir::Name); + sortSpec = (sort & ~TQDir::SortByMask | TQDir::Name); break; case COL_SIZE: - sortSpec = (sort & ~QDir::SortByMask | QDir::Size); + sortSpec = (sort & ~TQDir::SortByMask | TQDir::Size); break; case COL_DATE: - sortSpec = (sort & ~QDir::SortByMask | QDir::Time); + sortSpec = (sort & ~TQDir::SortByMask | TQDir::Time); break; - // the following columns have no equivalent in QDir, so we set it - // to QDir::Unsorted and remember the column (mSortingCol) + // the following columns have no equivalent in TQDir, so we set it + // to TQDir::Unsorted and remember the column (mSortingCol) case COL_OWNER: case COL_GROUP: case COL_PERM: - // grmbl, QDir::Unsorted == SortByMask. - sortSpec = (sort & ~QDir::SortByMask);// | QDir::Unsorted; + // grmbl, TQDir::Unsorted == SortByMask. + sortSpec = (sort & ~TQDir::SortByMask);// | TQDir::Unsorted; break; default: break; } if ( reversed ) - sortSpec |= QDir::Reversed; + sortSpec |= TQDir::Reversed; else - sortSpec &= ~QDir::Reversed; + sortSpec &= ~TQDir::Reversed; - if ( sort & QDir::IgnoreCase ) - sortSpec |= QDir::IgnoreCase; + if ( sort & TQDir::IgnoreCase ) + sortSpec |= TQDir::IgnoreCase; else - sortSpec &= ~QDir::IgnoreCase; + sortSpec &= ~TQDir::IgnoreCase; - KFileView::setSorting( static_cast<QDir::SortSpec>( sortSpec ) ); + KFileView::setSorting( static_cast<TQDir::SortSpec>( sortSpec ) ); KFileItem *item; KFileItemListIterator it( *items() ); @@ -352,30 +352,30 @@ void FileDetailView::slotSortingChanged( int col ) KListView::setSorting( mSortingCol, !reversed ); KListView::sort(); - if (!mBlockSortingSignal) sig->changeSorting( static_cast<QDir::SortSpec>( sortSpec ) ); + if (!mBlockSortingSignal) sig->changeSorting( static_cast<TQDir::SortSpec>( sortSpec ) ); } -void FileDetailView::setSorting( QDir::SortSpec spec ) +void FileDetailView::setSorting( TQDir::SortSpec spec ) { int col = 0; - if ( spec & QDir::Time ) + if ( spec & TQDir::Time ) col = COL_DATE; - else if ( spec & QDir::Size ) + else if ( spec & TQDir::Size ) col = COL_SIZE; - else if ( spec & QDir::Unsorted ) + else if ( spec & TQDir::Unsorted ) col = mSortingCol; else col = COL_NAME; // inversed, because slotSortingChanged will reverse it - if ( spec & QDir::Reversed ) - spec = (QDir::SortSpec) (spec & ~QDir::Reversed); + if ( spec & TQDir::Reversed ) + spec = (TQDir::SortSpec) (spec & ~TQDir::Reversed); else - spec = (QDir::SortSpec) (spec | QDir::Reversed); + spec = (TQDir::SortSpec) (spec | TQDir::Reversed); mSortingCol = col; - KFileView::setSorting( (QDir::SortSpec) spec ); + KFileView::setSorting( (TQDir::SortSpec) spec ); // don't emit sortingChanged() when called via setSorting() @@ -432,7 +432,7 @@ KFileItem * FileDetailView::prevItem( const KFileItem *fileItem ) const return firstFileItem(); } -void FileDetailView::keyPressEvent( QKeyEvent *e ) +void FileDetailView::keyPressEvent( TQKeyEvent *e ) { KListView::keyPressEvent( e ); @@ -469,19 +469,19 @@ void FileDetailView::startDrag() * The item drawer for DragPixmapGenerator */ struct ItemDrawer : public DragPixmapItemDrawer<KFileItem*> { - ItemDrawer(const QFontMetrics& fontMetrics) + ItemDrawer(const TQFontMetrics& fontMetrics) : mFontMetrics(fontMetrics) {} - QSize itemSize(KFileItem* fileItem) { - if (!fileItem) return QSize(); - QString name = fileItem->name(); - int width = QMIN(mGenerator->maxWidth(), mFontMetrics.width(name)); + TQSize itemSize(KFileItem* fileItem) { + if (!fileItem) return TQSize(); + TQString name = fileItem->name(); + int width = TQMIN(mGenerator->maxWidth(), mFontMetrics.width(name)); int height = mFontMetrics.height(); - return QSize(width, height); + return TQSize(width, height); } - void drawItem(QPainter* painter, int left, int top, KFileItem* fileItem) { - QString name = fileItem->name(); + void drawItem(TQPainter* painter, int left, int top, KFileItem* fileItem) { + TQString name = fileItem->name(); painter->save(); KWordWrap::drawFadeoutText(painter, left, top + mFontMetrics.ascent(), @@ -489,7 +489,7 @@ void FileDetailView::startDrag() painter->restore(); } - QFontMetrics mFontMetrics; + TQFontMetrics mFontMetrics; }; ItemDrawer drawer(fontMetrics()); @@ -510,10 +510,10 @@ void FileDetailView::startDrag() return; } - QDragObject* drag=new KURLDrag(urls, this, 0); - QPixmap dragPixmap = generator.generate(); + TQDragObject* drag=new KURLDrag(urls, this, 0); + TQPixmap dragPixmap = generator.generate(); - drag->setPixmap( dragPixmap, QPoint(-generator.DRAG_OFFSET, -generator.DRAG_OFFSET)); + drag->setPixmap( dragPixmap, TQPoint(-generator.DRAG_OFFSET, -generator.DRAG_OFFSET)); drag->dragCopy(); } @@ -525,8 +525,8 @@ void FileDetailView::setShownFileItem(KFileItem* fileItem) FileDetailViewItem* newShownItem=viewItem(fileItem); FileViewBase::setShownFileItem(fileItem); - if (oldShownItem) oldShownItem->repaint(); - if (newShownItem) newShownItem->repaint(); + if (oldShownItem) oldShownItem->tqrepaint(); + if (newShownItem) newShownItem->tqrepaint(); } @@ -535,13 +535,13 @@ void FileDetailView::setShownFileItem(KFileItem* fileItem) // Drop support // //---------------------------------------------------------------------- -bool FileDetailView::acceptDrag(QDropEvent* event) const { +bool FileDetailView::acceptDrag(TQDropEvent* event) const { return KURLDrag::canDecode(event); } -void FileDetailView::contentsDropEvent(QDropEvent *event) { +void FileDetailView::contentsDropEvent(TQDropEvent *event) { KFileItem* fileItem=0L; - QListViewItem *item=itemAt(contentsToViewport(event->pos() ) ); + TQListViewItem *item=itemAt(contentsToViewport(event->pos() ) ); if (item) { fileItem=static_cast<FileDetailViewItem*>(item)->fileInfo(); diff --git a/src/gvcore/filedetailview.h b/src/gvcore/filedetailview.h index 2d8c988..346f618 100644 --- a/src/gvcore/filedetailview.h +++ b/src/gvcore/filedetailview.h @@ -25,11 +25,11 @@ #define FILEDETAILVIEW_H class KFileItem; -class QWidget; -class QKeyEvent; +class TQWidget; +class TQKeyEvent; -// Qt includes -#include <qdir.h> +// TQt includes +#include <tqdir.h> // KDE includes #include <klistview.h> @@ -44,14 +44,15 @@ class FileDetailViewItem; class FileDetailView : public KListView, public FileViewBase { Q_OBJECT + TQ_OBJECT friend class FileDetailViewItem; public: - FileDetailView(QWidget* parent, const char* name); + FileDetailView(TQWidget* tqparent, const char* name); virtual ~FileDetailView(); - virtual QWidget* widget() { return this; } + virtual TQWidget* widget() { return this; } virtual void clearView(); virtual void updateView( bool ); @@ -74,25 +75,25 @@ public: virtual void insertItem( KFileItem* i ); // implemented to get noticed about sorting changes (for sortingIndicator) - virtual void setSorting( QDir::SortSpec ); + virtual void setSorting( TQDir::SortSpec ); void ensureItemVisible( const KFileItem* ); // for KMimeTypeResolver void mimeTypeDeterminationFinished(); void determineIcon( FileDetailViewItem* item ); - QScrollView* scrollWidget() { return this; } + TQScrollView* scrollWidget() { return this; } void setShownFileItem(KFileItem* fileItem); signals: - void dropped(QDropEvent* event, KFileItem* item); - void sortingChanged(QDir::SortSpec); + void dropped(TQDropEvent* event, KFileItem* item); + void sortingChanged(TQDir::SortSpec); protected: - virtual bool acceptDrag(QDropEvent*) const; - virtual void contentsDropEvent(QDropEvent*); - virtual void keyPressEvent(QKeyEvent*); + virtual bool acceptDrag(TQDropEvent*) const; + virtual void contentsDropEvent(TQDropEvent*); + virtual void keyPressEvent(TQKeyEvent*); int mSortingCol; @@ -101,18 +102,18 @@ protected slots: private slots: void slotSortingChanged( int ); - void selected( QListViewItem* item ); - void slotActivate( QListViewItem* item ); - void highlighted( QListViewItem* item ); - void slotActivateMenu ( QListViewItem* item, const QPoint& pos ); + void selected( TQListViewItem* item ); + void slotActivate( TQListViewItem* item ); + void highlighted( TQListViewItem* item ); + void slotActivateMenu ( TQListViewItem* item, const TQPoint& pos ); private: bool mBlockSortingSignal; KMimeTypeResolver<FileDetailViewItem,FileDetailView>* mResolver; - virtual void insertItem(QListViewItem* i) { KListView::insertItem(i); } + virtual void insertItem(TQListViewItem* i) { KListView::insertItem(i); } virtual void setSorting(int i, bool b) { KListView::setSorting(i, b); } - virtual void setSelected(QListViewItem* i, bool b) { KListView::setSelected(i, b); } + virtual void setSelected(TQListViewItem* i, bool b) { KListView::setSelected(i, b); } FileDetailViewItem* viewItem( const KFileItem* item ) const { if (item) return (FileDetailViewItem*)item->extraData(this); @@ -123,8 +124,8 @@ private: void startDrag(); - QPixmap mShownItemSelectedPixmap; - QPixmap mShownItemUnselectedPixmap; + TQPixmap mShownItemSelectedPixmap; + TQPixmap mShownItemUnselectedPixmap; }; diff --git a/src/gvcore/filedetailviewitem.cpp b/src/gvcore/filedetailviewitem.cpp index d879744..6d5fead 100644 --- a/src/gvcore/filedetailviewitem.cpp +++ b/src/gvcore/filedetailviewitem.cpp @@ -47,8 +47,8 @@ void FileDetailViewItem::init() } -const QPixmap* FileDetailViewItem::pixmap(int column) const { - const QPixmap* normalPix = KListViewItem::pixmap(column); +const TQPixmap* FileDetailViewItem::pixmap(int column) const { + const TQPixmap* normalPix = KListViewItem::pixmap(column); if (column!=0) { return normalPix; } diff --git a/src/gvcore/filedetailviewitem.h b/src/gvcore/filedetailviewitem.h index c67a34b..ef769a9 100644 --- a/src/gvcore/filedetailviewitem.h +++ b/src/gvcore/filedetailviewitem.h @@ -39,22 +39,22 @@ namespace Gwenview { class FileDetailViewItem : public KListViewItem { public: - FileDetailViewItem( QListView* parent, const QString &text, - const QPixmap &icon, KFileItem* fi ) - : KListViewItem( parent, text ), inf( fi ) { + FileDetailViewItem( TQListView* tqparent, const TQString &text, + const TQPixmap &icon, KFileItem* fi ) + : KListViewItem( tqparent, text ), inf( fi ) { setPixmap( 0, icon ); setText( 0, text ); } - FileDetailViewItem( QListView* parent, KFileItem* fi ) - : KListViewItem( parent ), inf( fi ) { + FileDetailViewItem( TQListView* tqparent, KFileItem* fi ) + : KListViewItem( tqparent ), inf( fi ) { init(); } - FileDetailViewItem( QListView* parent, const QString &text, - const QPixmap &icon, KFileItem* fi, - QListViewItem* after) - : KListViewItem( parent, after ), inf( fi ) { + FileDetailViewItem( TQListView* tqparent, const TQString &text, + const TQPixmap &icon, KFileItem* fi, + TQListViewItem* after) + : KListViewItem( tqparent, after ), inf( fi ) { setPixmap( 0, icon ); setText( 0, text ); } @@ -65,23 +65,23 @@ public: KFileItem* fileInfo() const { return inf; } - virtual QString key( int /*column*/, bool /*ascending*/ ) const { return m_key; } + virtual TQString key( int /*column*/, bool /*ascending*/ ) const { return m_key; } - void setKey( const QString& key ) { m_key = key; } + void setKey( const TQString& key ) { m_key = key; } - QRect rect() const + TQRect rect() const { - QRect r = listView()->itemRect(this); - return QRect( listView()->viewportToContents( r.topLeft() ), - QSize( r.width(), r.height() ) ); + TQRect r = listView()->tqitemRect(this); + return TQRect( listView()->viewportToContents( r.topLeft() ), + TQSize( r.width(), r.height() ) ); } void init(); - virtual const QPixmap* pixmap(int column) const; + virtual const TQPixmap* pixmap(int column) const; private: KFileItem* inf; - QString m_key; + TQString m_key; }; } // namespace diff --git a/src/gvcore/fileoperation.cpp b/src/gvcore/fileoperation.cpp index fd113cc..8213fcb 100644 --- a/src/gvcore/fileoperation.cpp +++ b/src/gvcore/fileoperation.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -21,10 +21,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Self #include "fileoperation.moc" -// Qt -#include <qcursor.h> -#include <qpopupmenu.h> -#include <qobject.h> +// TQt +#include <tqcursor.h> +#include <tqpopupmenu.h> +#include <tqobject.h> // KDE #include <kconfig.h> @@ -40,69 +40,69 @@ namespace Gwenview { namespace FileOperation { -void copyTo(const KURL::List& srcURL,QWidget* parent) { - FileOpObject* op=new FileOpCopyToObject(srcURL,parent); +void copyTo(const KURL::List& srcURL,TQWidget* tqparent) { + FileOpObject* op=new FileOpCopyToObject(srcURL,tqparent); (*op)(); } -void linkTo(const KURL::List& srcURL,QWidget* parent) { - FileOpObject* op=new FileOpLinkToObject(srcURL,parent); +void linkTo(const KURL::List& srcURL,TQWidget* tqparent) { + FileOpObject* op=new FileOpLinkToObject(srcURL,tqparent); (*op)(); } -void moveTo(const KURL::List& srcURL,QWidget* parent,QObject* receiver,const char* slot) { - FileOpObject* op=new FileOpMoveToObject(srcURL,parent); - if (receiver && slot) QObject::connect(op,SIGNAL(success()),receiver,slot); +void moveTo(const KURL::List& srcURL,TQWidget* tqparent,TQObject* receiver,const char* slot) { + FileOpObject* op=new FileOpMoveToObject(srcURL,tqparent); + if (receiver && slot) TQObject::connect(op,TQT_SIGNAL(success()),receiver,slot); (*op)(); } -void makeDir(const KURL& parentURL, QWidget* parent, QObject* receiver, const char* slot) { - FileOpObject* op=new FileOpMakeDirObject(parentURL, parent); - if (receiver && slot) QObject::connect(op,SIGNAL(success()),receiver,slot); +void makeDir(const KURL& tqparentURL, TQWidget* tqparent, TQObject* receiver, const char* slot) { + FileOpObject* op=new FileOpMakeDirObject(tqparentURL, tqparent); + if (receiver && slot) TQObject::connect(op,TQT_SIGNAL(success()),receiver,slot); (*op)(); } -void del(const KURL::List& url,QWidget* parent,QObject* receiver,const char* slot) { - FileOpObject* op = new FileOpDelObject(url,parent); - if (receiver && slot) QObject::connect(op,SIGNAL(success()),receiver,slot); +void del(const KURL::List& url,TQWidget* tqparent,TQObject* receiver,const char* slot) { + FileOpObject* op = new FileOpDelObject(url,tqparent); + if (receiver && slot) TQObject::connect(op,TQT_SIGNAL(success()),receiver,slot); (*op)(); } -void trash(const KURL::List& url, QWidget* parent, QObject* receiver, const char* slot) { - FileOpObject* op = new FileOpTrashObject(url,parent); - if (receiver && slot) QObject::connect(op,SIGNAL(success()),receiver,slot); +void trash(const KURL::List& url, TQWidget* tqparent, TQObject* receiver, const char* slot) { + FileOpObject* op = new FileOpTrashObject(url,tqparent); + if (receiver && slot) TQObject::connect(op,TQT_SIGNAL(success()),receiver,slot); (*op)(); } -void realDelete(const KURL::List& url, QWidget* parent, QObject* receiver, const char* slot) { - FileOpObject* op = new FileOpRealDeleteObject(url,parent); - if (receiver && slot) QObject::connect(op,SIGNAL(success()),receiver,slot); +void realDelete(const KURL::List& url, TQWidget* tqparent, TQObject* receiver, const char* slot) { + FileOpObject* op = new FileOpRealDeleteObject(url,tqparent); + if (receiver && slot) TQObject::connect(op,TQT_SIGNAL(success()),receiver,slot); (*op)(); } -void rename(const KURL& url,QWidget* parent,QObject* receiver,const char* slot) { - FileOpObject* op=new FileOpRenameObject(url,parent); - if (receiver && slot) QObject::connect(op,SIGNAL(renamed(const QString&)),receiver,slot); +void rename(const KURL& url,TQWidget* tqparent,TQObject* receiver,const char* slot) { + FileOpObject* op=new FileOpRenameObject(url,tqparent); + if (receiver && slot) TQObject::connect(op,TQT_SIGNAL(renamed(const TQString&)),receiver,slot); (*op)(); } -void fillDropURLMenu(QPopupMenu* menu, const KURL::List& urls, const KURL& target, bool* wasMoved) { - DropMenuContext* context=new DropMenuContext(menu, urls, target, wasMoved); +void fillDropURLMenu(TQPopupMenu* menu, const KURL::List& urls, const KURL& target, bool* wasMoved) { + DropMenuContext* context=new DropMenuContext(TQT_TQOBJECT(menu), urls, target, wasMoved); menu->insertItem( SmallIcon("goto"), i18n("&Move Here"), - context, SLOT(move()) ); + context, TQT_SLOT(move()) ); menu->insertItem( SmallIcon("editcopy"), i18n("&Copy Here"), - context, SLOT(copy()) ); + context, TQT_SLOT(copy()) ); menu->insertItem( SmallIcon("www"), i18n("&Link Here"), - context, SLOT(link()) ); + context, TQT_SLOT(link()) ); } -void openDropURLMenu(QWidget* parent, const KURL::List& urls, const KURL& target, bool* wasMoved) { - QPopupMenu menu(parent); +void openDropURLMenu(TQWidget* tqparent, const KURL::List& urls, const KURL& target, bool* wasMoved) { + TQPopupMenu menu(tqparent); if (wasMoved) *wasMoved=false; fillDropURLMenu(&menu, urls, target, wasMoved); @@ -110,7 +110,7 @@ void openDropURLMenu(QWidget* parent, const KURL::List& urls, const KURL& target menu.insertItem( SmallIcon("cancel"), i18n("Cancel") ); menu.setMouseTracking(true); - menu.exec(QCursor::pos()); + menu.exec(TQCursor::pos()); } diff --git a/src/gvcore/fileoperation.h b/src/gvcore/fileoperation.h index 5ac7115..163682b 100644 --- a/src/gvcore/fileoperation.h +++ b/src/gvcore/fileoperation.h @@ -27,8 +27,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "libgwenview_export.h" -class QPopupMenu; -class QWidget; +class TQPopupMenu; +class TQWidget; namespace Gwenview { /** @@ -39,24 +39,25 @@ namespace Gwenview { */ namespace FileOperation { -LIBGWENVIEW_EXPORT void copyTo(const KURL::List&,QWidget* parent=0L); -LIBGWENVIEW_EXPORT void moveTo(const KURL::List&,QWidget* parent,QObject* receiver=0L,const char* slot=0L); -LIBGWENVIEW_EXPORT void linkTo(const KURL::List& srcURL,QWidget* parent); -LIBGWENVIEW_EXPORT void makeDir(const KURL& parentURL, QWidget* parent, QObject* receiver=0L, const char* slot=0L); -LIBGWENVIEW_EXPORT void del(const KURL::List&,QWidget* parent,QObject* receiver=0L,const char* slot=0L); -LIBGWENVIEW_EXPORT void trash(const KURL::List&,QWidget* parent,QObject* receiver=0L,const char* slot=0L); -LIBGWENVIEW_EXPORT void realDelete(const KURL::List&,QWidget* parent,QObject* receiver=0L,const char* slot=0L); -LIBGWENVIEW_EXPORT void rename(const KURL&,QWidget* parent,QObject* receiver=0L,const char* slot=0L); +LIBGWENVIEW_EXPORT void copyTo(const KURL::List&,TQWidget* tqparent=0L); +LIBGWENVIEW_EXPORT void moveTo(const KURL::List&,TQWidget* tqparent,TQObject* receiver=0L,const char* slot=0L); +LIBGWENVIEW_EXPORT void linkTo(const KURL::List& srcURL,TQWidget* tqparent); +LIBGWENVIEW_EXPORT void makeDir(const KURL& tqparentURL, TQWidget* tqparent, TQObject* receiver=0L, const char* slot=0L); +LIBGWENVIEW_EXPORT void del(const KURL::List&,TQWidget* tqparent,TQObject* receiver=0L,const char* slot=0L); +LIBGWENVIEW_EXPORT void trash(const KURL::List&,TQWidget* tqparent,TQObject* receiver=0L,const char* slot=0L); +LIBGWENVIEW_EXPORT void realDelete(const KURL::List&,TQWidget* tqparent,TQObject* receiver=0L,const char* slot=0L); +LIBGWENVIEW_EXPORT void rename(const KURL&,TQWidget* tqparent,TQObject* receiver=0L,const char* slot=0L); /** * @internal */ -class DropMenuContext : public QObject { +class DropMenuContext : public TQObject { Q_OBJECT + TQ_OBJECT public: - DropMenuContext(QObject* parent, const KURL::List& src, const KURL& dst, bool* wasMoved) - : QObject(parent) + DropMenuContext(TQObject* tqparent, const KURL::List& src, const KURL& dst, bool* wasMoved) + : TQObject(tqparent) , mSrc(src) , mDst(dst) , mWasMoved(wasMoved) @@ -85,8 +86,8 @@ private: }; -LIBGWENVIEW_EXPORT void fillDropURLMenu(QPopupMenu*, const KURL::List&, const KURL& target, bool* wasMoved=0L); -LIBGWENVIEW_EXPORT void openDropURLMenu(QWidget* parent, const KURL::List&, const KURL& target, bool* wasMoved=0L); +LIBGWENVIEW_EXPORT void fillDropURLMenu(TQPopupMenu*, const KURL::List&, const KURL& target, bool* wasMoved=0L); +LIBGWENVIEW_EXPORT void openDropURLMenu(TQWidget* tqparent, const KURL::List&, const KURL& target, bool* wasMoved=0L); } // namespace diff --git a/src/gvcore/fileopobject.cpp b/src/gvcore/fileopobject.cpp index 0d565b5..38dbe6b 100644 --- a/src/gvcore/fileopobject.cpp +++ b/src/gvcore/fileopobject.cpp @@ -19,10 +19,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Qt -#include <qfile.h> -#include <qstylesheet.h> -#include <qwidget.h> +// TQt +#include <tqfile.h> +#include <tqstylesheet.h> +#include <tqwidget.h> // KDE #include <kdeversion.h> @@ -51,8 +51,8 @@ namespace Gwenview { */ class DirSelectDialog : public KFileDialog { public: - DirSelectDialog(const QString& startDir, QWidget* parent) - : KFileDialog(startDir, QString::null, parent, "dirselectdialog", true) { + DirSelectDialog(const TQString& startDir, TQWidget* tqparent) + : KFileDialog(startDir, TQString(), tqparent, "dirselectdialog", true) { locationEdit->setEnabled(false); filterWidget->setEnabled(false); setMode(KFile::Directory | KFile::ExistingOnly); @@ -64,15 +64,15 @@ public: //-FileOpObject-------------------------------------------------------------------- -FileOpObject::FileOpObject(const KURL& url,QWidget* parent) -: mParent(parent) +FileOpObject::FileOpObject(const KURL& url,TQWidget* tqparent) +: mParent(tqparent) { mURLList.append(url); } -FileOpObject::FileOpObject(const KURL::List& list,QWidget* parent) -: mParent(parent), mURLList(list) +FileOpObject::FileOpObject(const KURL::List& list,TQWidget* tqparent) +: mParent(tqparent), mURLList(list) {} @@ -89,9 +89,9 @@ void FileOpObject::slotResult(KIO::Job* job) { void FileOpObject::polishJob(KIO::Job* job) { - job->setWindow(mParent->topLevelWidget()); - connect( job, SIGNAL( result(KIO::Job*) ), - this, SLOT( slotResult(KIO::Job*) ) ); + job->setWindow(mParent->tqtopLevelWidget()); + connect( job, TQT_SIGNAL( result(KIO::Job*) ), + this, TQT_SLOT( slotResult(KIO::Job*) ) ); } @@ -102,13 +102,13 @@ void FileOpCopyToObject::operator()() { KURL destURL; if (FileOperationConfig::confirmCopy()) { - QString destDir = FileOperationConfig::destDir(); + TQString destDir = FileOperationConfig::destDir(); if( !destDir.isEmpty()) { destDir += "/"; } if (mURLList.size()==1) { destURL=KFileDialog::getSaveURL(destDir + mURLList.first().fileName(), - QString::null, mParent, i18n("Copy File")); + TQString(), mParent, i18n("Copy File")); } else { DirSelectDialog dialog(destDir, mParent); dialog.setCaption(i18n("Select Folder Where Files Will be Copied")); @@ -134,13 +134,13 @@ void FileOpLinkToObject::operator()() { KURL destURL; if (FileOperationConfig::confirmCopy()) { - QString destDir = FileOperationConfig::destDir(); + TQString destDir = FileOperationConfig::destDir(); if( !destDir.isEmpty()) { destDir += "/"; } if (mURLList.size()==1) { destURL=KFileDialog::getSaveURL(destDir + mURLList.first().fileName(), - QString::null, mParent, i18n("Link File")); + TQString(), mParent, i18n("Link File")); } else { DirSelectDialog dialog(destDir, mParent); dialog.setCaption(i18n("Select Folder Where the Files Will be Linked")); @@ -163,13 +163,13 @@ void FileOpMoveToObject::operator()() { KURL destURL; if (FileOperationConfig::confirmMove()) { - QString destDir = FileOperationConfig::destDir(); + TQString destDir = FileOperationConfig::destDir(); if( !destDir.isEmpty()) { destDir += "/"; } if (mURLList.size()==1) { destURL=KFileDialog::getSaveURL(destDir + mURLList.first().fileName(), - QString::null, mParent, i18n("Move File")); + TQString(), mParent, i18n("Move File")); } else { DirSelectDialog dialog(destDir, mParent); dialog.setCaption(i18n("Select Folder Where Files Will be Moved")); @@ -195,7 +195,7 @@ void FileOpMakeDirObject::operator()() { dlg.setButtonOK( KGuiItem(i18n("Create Folder"), "folder_new") ); if (!dlg.exec()) return; - QString newDir = dlg.lineEdit()->text(); + TQString newDir = dlg.lineEdit()->text(); KURL newURL(mURLList.first()); newURL.addPath(newDir); @@ -249,7 +249,7 @@ void FileOpTrashObject::operator()() { if (FileOperationConfig::confirmDelete()) { int response; if (mURLList.count()>1) { - QStringList fileList; + TQStringList fileList; KURL::List::ConstIterator it=mURLList.begin(); for (; it!=mURLList.end(); ++it) { fileList.append((*it).filename()); @@ -257,9 +257,9 @@ void FileOpTrashObject::operator()() { response=KMessageBox::warningContinueCancelList(mParent, i18n("Do you really want to trash these files?"),fileList,i18n("Trash used as a verb", "Trash Files"),KGuiItem(i18n("Trash used as a verb", "&Trash"),"edittrash")); } else { - QString filename=QStyleSheet::escape(mURLList.first().filename()); + TQString filename=TQStyleSheet::escape(mURLList.first().filename()); response=KMessageBox::warningContinueCancel(mParent, - i18n("<p>Do you really want to move <b>%1</b> to the trash?</p>").arg(filename),i18n("Trash used as a verb", "Trash File"),KGuiItem(i18n("Trash used as a verb", "&Trash"),"edittrash")); + i18n("<p>Do you really want to move <b>%1</b> to the trash?</p>").tqarg(filename),i18n("Trash used as a verb", "Trash File"),KGuiItem(i18n("Trash used as a verb", "&Trash"),"edittrash")); } if (response!=KMessageBox::Continue) return; } @@ -274,7 +274,7 @@ void FileOpRealDeleteObject::operator()() { if (FileOperationConfig::confirmDelete()) { int response; if (mURLList.count()>1) { - QStringList fileList; + TQStringList fileList; KURL::List::ConstIterator it=mURLList.begin(); for (; it!=mURLList.end(); ++it) { fileList.append((*it).filename()); @@ -285,9 +285,9 @@ void FileOpRealDeleteObject::operator()() { KStdGuiItem::del() ); } else { - QString filename=QStyleSheet::escape(mURLList.first().filename()); + TQString filename=TQStyleSheet::escape(mURLList.first().filename()); response=KMessageBox::warningContinueCancel(mParent, - i18n("<p>Do you really want to delete <b>%1</b>?</p>").arg(filename), + i18n("<p>Do you really want to delete <b>%1</b>?</p>").tqarg(filename), i18n("Delete File"), KStdGuiItem::del() ); @@ -306,14 +306,14 @@ void FileOpRenameObject::operator()() { KURL srcURL=mURLList.first(); // Prompt for the new filename - QString filename = srcURL.filename(); + TQString filename = srcURL.filename(); InputDialog dlg(mParent); dlg.setCaption(i18n("Renaming File")); - dlg.setLabel(i18n("<p>Rename file <b>%1</b> to:</p>").arg(QStyleSheet::escape(filename))); + dlg.setLabel(i18n("<p>Rename file <b>%1</b> to:</p>").tqarg(TQStyleSheet::escape(filename))); dlg.setButtonOK( KGuiItem(i18n("&Rename"), "edit") ); dlg.lineEdit()->setText(filename); - int extPos = filename.findRev('.'); + int extPos = filename.tqfindRev('.'); if (extPos != -1) { if (filename.mid(extPos - 4, 4) == ".tar") { // Special case: *.tar.* diff --git a/src/gvcore/fileopobject.h b/src/gvcore/fileopobject.h index a792685..9ec3429 100644 --- a/src/gvcore/fileopobject.h +++ b/src/gvcore/fileopobject.h @@ -21,15 +21,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef FILEOPOBJECT_H #define FILEOPOBJECT_H -// Qt includes -#include <qobject.h> -#include <qstring.h> +// TQt includes +#include <tqobject.h> +#include <tqstring.h> // KDE includes #include <kio/job.h> #include <kurl.h> -class QWidget; +class TQWidget; namespace Gwenview { @@ -42,11 +42,12 @@ namespace Gwenview { * * All these classes are used by the @FileOperation namespace-like class */ -class FileOpObject : public QObject { +class FileOpObject : public TQObject { Q_OBJECT + TQ_OBJECT public: - FileOpObject(const KURL&,QWidget* parent=0L); - FileOpObject(const KURL::List&,QWidget* parent=0L); + FileOpObject(const KURL&,TQWidget* tqparent=0L); + FileOpObject(const KURL::List&,TQWidget* tqparent=0L); virtual void operator()()=0; signals: @@ -56,7 +57,7 @@ protected slots: virtual void slotResult(KIO::Job*); protected: - QWidget* mParent; + TQWidget* mParent; KURL::List mURLList; void polishJob(KIO::Job*); @@ -65,76 +66,84 @@ protected: class FileOpCopyToObject : public FileOpObject { Q_OBJECT + TQ_OBJECT public: - FileOpCopyToObject(const KURL& url,QWidget* parent=0L) : FileOpObject(url,parent) {} - FileOpCopyToObject(const KURL::List& urlList,QWidget* parent=0L) : FileOpObject(urlList,parent) {} + FileOpCopyToObject(const KURL& url,TQWidget* tqparent=0L) : FileOpObject(url,tqparent) {} + FileOpCopyToObject(const KURL::List& urlList,TQWidget* tqparent=0L) : FileOpObject(urlList,tqparent) {} void operator()(); }; class FileOpLinkToObject : public FileOpObject { Q_OBJECT + TQ_OBJECT public: - FileOpLinkToObject(const KURL& url,QWidget* parent=0L) : FileOpObject(url,parent) {} - FileOpLinkToObject(const KURL::List& urlList,QWidget* parent=0L) : FileOpObject(urlList,parent) {} + FileOpLinkToObject(const KURL& url,TQWidget* tqparent=0L) : FileOpObject(url,tqparent) {} + FileOpLinkToObject(const KURL::List& urlList,TQWidget* tqparent=0L) : FileOpObject(urlList,tqparent) {} void operator()(); }; class FileOpMoveToObject : public FileOpObject { Q_OBJECT + TQ_OBJECT public: - FileOpMoveToObject(const KURL& url,QWidget* parent=0L) : FileOpObject(url,parent) {} - FileOpMoveToObject(const KURL::List& urlList,QWidget* parent=0L) : FileOpObject(urlList,parent) {} + FileOpMoveToObject(const KURL& url,TQWidget* tqparent=0L) : FileOpObject(url,tqparent) {} + FileOpMoveToObject(const KURL::List& urlList,TQWidget* tqparent=0L) : FileOpObject(urlList,tqparent) {} void operator()(); }; class FileOpMakeDirObject : public FileOpObject { Q_OBJECT + TQ_OBJECT public: - FileOpMakeDirObject(const KURL& url, QWidget* parent=0L) : FileOpObject(url, parent) {} + FileOpMakeDirObject(const KURL& url, TQWidget* tqparent=0L) : FileOpObject(url, tqparent) {} void operator()(); }; class FileOpDelObject : public FileOpObject { Q_OBJECT + TQ_OBJECT public: - FileOpDelObject(const KURL& url,QWidget* parent=0L) : FileOpObject(url,parent) {} - FileOpDelObject(const KURL::List& urlList,QWidget* parent=0L) : FileOpObject(urlList,parent) {} + FileOpDelObject(const KURL& url,TQWidget* tqparent=0L) : FileOpObject(url,tqparent) {} + FileOpDelObject(const KURL::List& urlList,TQWidget* tqparent=0L) : FileOpObject(urlList,tqparent) {} void operator()(); }; class FileOpTrashObject : public FileOpObject { Q_OBJECT + TQ_OBJECT public: - FileOpTrashObject(const KURL& url,QWidget* parent=0L) : FileOpObject(url,parent) {} - FileOpTrashObject(const KURL::List& urlList,QWidget* parent=0L) : FileOpObject(urlList,parent) {} + FileOpTrashObject(const KURL& url,TQWidget* tqparent=0L) : FileOpObject(url,tqparent) {} + FileOpTrashObject(const KURL::List& urlList,TQWidget* tqparent=0L) : FileOpObject(urlList,tqparent) {} void operator()(); }; class FileOpRealDeleteObject : public FileOpObject { Q_OBJECT + TQ_OBJECT public: - FileOpRealDeleteObject(const KURL& url,QWidget* parent=0L) : FileOpObject(url,parent) {} - FileOpRealDeleteObject(const KURL::List& urlList,QWidget* parent=0L) : FileOpObject(urlList,parent) {} + FileOpRealDeleteObject(const KURL& url,TQWidget* tqparent=0L) : FileOpObject(url,tqparent) {} + FileOpRealDeleteObject(const KURL::List& urlList,TQWidget* tqparent=0L) : FileOpObject(urlList,tqparent) {} void operator()(); }; class FileOpRenameObject : public FileOpObject { Q_OBJECT + TQ_OBJECT public: - FileOpRenameObject(const KURL& url,QWidget* parent=0L) : FileOpObject(url,parent) {} + FileOpRenameObject(const KURL& url,TQWidget* tqparent=0L) : FileOpObject(url,tqparent) {} void operator()(); signals: - void renamed(const QString& newName); + void renamed(const TQString& newName); protected slots: virtual void slotResult(KIO::Job*); private: - QString mNewFilename; + TQString mNewFilename; }; diff --git a/src/gvcore/filethumbnailview.cpp b/src/gvcore/filethumbnailview.cpp index 8deaf09..e9dff61 100644 --- a/src/gvcore/filethumbnailview.cpp +++ b/src/gvcore/filethumbnailview.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab: /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -19,15 +19,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Qt -#include <qframe.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qpen.h> -#include <qpixmap.h> -#include <qpushbutton.h> -#include <qtimer.h> -#include <qvaluevector.h> +// TQt +#include <tqframe.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqpen.h> +#include <tqpixmap.h> +#include <tqpushbutton.h> +#include <tqtimer.h> +#include <tqvaluevector.h> // KDE #include <kapplication.h> @@ -70,18 +70,18 @@ static const int THUMBNAIL_UPDATE_DELAY=500; static const int RIGHT_TEXT_WIDTH=128; static const int BOTTOM_MIN_TEXT_WIDTH=96; -class ProgressWidget : public QFrame { +class ProgressWidget : public TQFrame { KProgress* mProgressBar; - QPushButton* mStop; + TQPushButton* mStop; public: ProgressWidget(FileThumbnailView* view, int count) - : QFrame(view) + : TQFrame(view) { - QHBoxLayout* layout=new QHBoxLayout(this, 3, 3); - layout->setAutoAdd(true); - setFrameStyle( QFrame::StyledPanel | QFrame::Raised ); + TQHBoxLayout* tqlayout=new TQHBoxLayout(this, 3, 3); + tqlayout->setAutoAdd(true); + setFrameStyle( TQFrame::StyledPanel | TQFrame::Raised ); - mStop=new QPushButton(this); + mStop=new TQPushButton(this); mStop->setPixmap(SmallIcon("stop")); mStop->setFlat(true); @@ -92,31 +92,31 @@ public: } void polish() { - QFrame::polish(); - setMinimumWidth(layout()->minimumSize().width()); + TQFrame::polish(); + setMinimumWidth(tqlayout()->tqminimumSize().width()); //setFixedHeight( mProgressBar->height() ); setFixedHeight( mStop->height() ); } - void showEvent(QShowEvent*) { + void showEvent(TQShowEvent*) { updatePosition(); } - bool eventFilter(QObject*, QEvent* event) { - if (event->type()==QEvent::Resize) { + bool eventFilter(TQObject*, TQEvent* event) { + if (event->type()==TQEvent::Resize) { updatePosition(); } return false; } void updatePosition() { - FileThumbnailView* view=static_cast<FileThumbnailView*>(parent()); - QSize tmp=view->clipper()->size() - size(); + FileThumbnailView* view=static_cast<FileThumbnailView*>(TQT_TQWIDGET(tqparent())); + TQSize tmp=view->clipper()->size() - size(); move(tmp.width() - 2, tmp.height() - 2); } KProgress* progressBar() const { return mProgressBar; } - QPushButton* stopButton() const { return mStop; } + TQPushButton* stopButton() const { return mStop; } }; @@ -124,13 +124,13 @@ struct FileThumbnailView::Private { int mThumbnailSize; int mMarginSize; bool mUpdateThumbnailsOnNextShow; - QPixmap mWaitPixmap; // The wait pixmap (32 x 32) - QPixmap mWaitThumbnail; // The wait thumbnail (mThumbnailSize x mThumbnailSize) + TQPixmap mWaitPixmap; // The wait pixmap (32 x 32) + TQPixmap mWaitThumbnail; // The wait thumbnail (mThumbnailSize x mThumbnailSize) ProgressWidget* mProgressWidget; - QGuardedPtr<ThumbnailLoadJob> mThumbnailLoadJob; + TQGuardedPtr<ThumbnailLoadJob> mThumbnailLoadJob; - QTimer* mThumbnailUpdateTimer; + TQTimer* mThumbnailUpdateTimer; int mItemDetails; @@ -138,11 +138,11 @@ struct FileThumbnailView::Private { ThumbnailDetailsDialog* mThumbnailsDetailDialog; void updateWaitThumbnail(const FileThumbnailView* view) { - mWaitThumbnail=QPixmap(mThumbnailSize, mThumbnailSize); + mWaitThumbnail=TQPixmap(mThumbnailSize, mThumbnailSize); mWaitThumbnail.fill(view->paletteBackgroundColor()); - QPainter painter(&mWaitThumbnail); + TQPainter painter(&mWaitThumbnail); - painter.setPen(view->colorGroup().button()); + painter.setPen(view->tqcolorGroup().button()); painter.drawRect(0,0,mThumbnailSize,mThumbnailSize); painter.drawPixmap( (mThumbnailSize-mWaitPixmap.width())/2, @@ -159,24 +159,24 @@ static FileThumbnailViewItem* viewItem(const FileThumbnailView* view, const KFil } -FileThumbnailView::FileThumbnailView(QWidget* parent) -: KIconView(parent), FileViewBase() +FileThumbnailView::FileThumbnailView(TQWidget* tqparent) +: KIconView(tqparent), FileViewBase() { d=new Private; d->mUpdateThumbnailsOnNextShow=false; d->mThumbnailLoadJob=0L; - d->mWaitPixmap=QPixmap(::locate("appdata", "thumbnail/wait.png")); + d->mWaitPixmap=TQPixmap(::locate("appdata", "thumbnail/wait.png")); d->mProgressWidget=0L; - d->mThumbnailUpdateTimer=new QTimer(this); + d->mThumbnailUpdateTimer=new TQTimer(this); d->mMarginSize=FileViewConfig::thumbnailMarginSize(); d->mItemDetails=FileViewConfig::thumbnailDetails(); d->mPrefetch = NULL; d->mThumbnailSize = 0; d->mThumbnailsDetailDialog = 0; - setItemTextPos( QIconView::ItemTextPos(FileViewConfig::thumbnailTextPos()) ); + setItemTextPos( TQIconView::ItemTextPos(FileViewConfig::thumbnailTextPos()) ); setAutoArrange(true); - QIconView::setSorting(true); + TQIconView::setSorting(true); setItemsMovable(false); setResizeMode(Adjust); setShowToolTips(true); @@ -187,25 +187,25 @@ FileThumbnailView::FileThumbnailView(QWidget* parent) // item is unselected after being clicked, so we use KIconView::Select mode // and emit the execute() signal with slotClicked() ourself. setMode(KIconView::Select); - connect(this, SIGNAL(clicked(QIconViewItem*)), - this, SLOT(slotClicked(QIconViewItem*)) ); - connect(this, SIGNAL(doubleClicked(QIconViewItem*)), - this, SLOT(slotDoubleClicked(QIconViewItem*)) ); + connect(this, TQT_SIGNAL(clicked(TQIconViewItem*)), + this, TQT_SLOT(slotClicked(TQIconViewItem*)) ); + connect(this, TQT_SIGNAL(doubleClicked(TQIconViewItem*)), + this, TQT_SLOT(slotDoubleClicked(TQIconViewItem*)) ); - connect(this, SIGNAL(dropped(QDropEvent*,const QValueList<QIconDragItem>&)), - this, SLOT(slotDropped(QDropEvent*)) ); - connect(this, SIGNAL( contentsMoving( int, int )), - this, SLOT( slotContentsMoving( int, int ))); - connect(this, SIGNAL(currentChanged(QIconViewItem*)), - this, SLOT(slotCurrentChanged(QIconViewItem*)) ); + connect(this, TQT_SIGNAL(dropped(TQDropEvent*,const TQValueList<TQIconDragItem>&)), + this, TQT_SLOT(slotDropped(TQDropEvent*)) ); + connect(this, TQT_SIGNAL( contentsMoving( int, int )), + this, TQT_SLOT( slotContentsMoving( int, int ))); + connect(this, TQT_SIGNAL(currentChanged(TQIconViewItem*)), + this, TQT_SLOT(slotCurrentChanged(TQIconViewItem*)) ); - QIconView::setSelectionMode(Extended); + TQIconView::setSelectionMode(Extended); - connect(BusyLevelManager::instance(), SIGNAL(busyLevelChanged(BusyLevel)), - this, SLOT( slotBusyLevelChanged(BusyLevel))); + connect(BusyLevelManager::instance(), TQT_SIGNAL(busyLevelChanged(BusyLevel)), + this, TQT_SLOT( slotBusyLevelChanged(BusyLevel))); - connect(d->mThumbnailUpdateTimer, SIGNAL(timeout()), - this, SLOT( startThumbnailUpdate()) ); + connect(d->mThumbnailUpdateTimer, TQT_SIGNAL(timeout()), + this, TQT_SLOT( startThumbnailUpdate()) ); } @@ -226,8 +226,8 @@ void FileThumbnailView::setThumbnailSize(int value) { KFileItemListIterator it( *items() ); for ( ; it.current(); ++it ) { KFileItem *item=it.current(); - QPixmap pixmap=createItemPixmap(item); - QIconViewItem* iconItem=viewItem(this, item); + TQPixmap pixmap=createItemPixmap(item); + TQIconViewItem* iconItem=viewItem(this, item); if (iconItem) iconItem->setPixmap(pixmap); } arrangeItemsInGrid(); @@ -244,7 +244,7 @@ int FileThumbnailView::thumbnailSize() const { * Overriden to call updateGrid */ void FileThumbnailView::setItemTextPos(ItemTextPos pos) { - QIconView::setItemTextPos(pos); + TQIconView::setItemTextPos(pos); updateGrid(); } @@ -263,7 +263,7 @@ int FileThumbnailView::marginSize() const { void FileThumbnailView::setItemDetails(int details) { d->mItemDetails=details; - for (QIconViewItem* item=firstItem(); item; item=item->nextItem()) { + for (TQIconViewItem* item=firstItem(); item; item=item->nextItem()) { static_cast<FileThumbnailViewItem*>(item)->updateLines(); } arrangeItemsInGrid(); @@ -275,7 +275,7 @@ int FileThumbnailView::itemDetails() const { } -void FileThumbnailView::setThumbnailPixmap(const KFileItem* fileItem, const QPixmap& thumbnail, const QSize& size) { +void FileThumbnailView::setThumbnailPixmap(const KFileItem* fileItem, const TQPixmap& thumbnail, const TQSize& size) { FileThumbnailViewItem* iconItem=viewItem(this, fileItem); if (!iconItem) return; @@ -285,7 +285,7 @@ void FileThumbnailView::setThumbnailPixmap(const KFileItem* fileItem, const QPix if (size.isValid()) { iconItem->setImageSize(size); } - iconItem->repaint(); + iconItem->tqrepaint(); // Notify progress if (d->mProgressWidget) { @@ -305,8 +305,8 @@ void FileThumbnailView::setShownFileItem(KFileItem* fileItem) { FileThumbnailViewItem* newShownItem=viewItem(this, fileItem); FileViewBase::setShownFileItem(fileItem); - if (oldShownItem) repaintItem(oldShownItem); - if (newShownItem) repaintItem(newShownItem); + if (oldShownItem) tqrepaintItem(oldShownItem); + if (newShownItem) tqrepaintItem(newShownItem); } @@ -315,7 +315,7 @@ void FileThumbnailView::setShownFileItem(KFileItem* fileItem) { // Thumbnail code // //----------------------------------------------------------------------------- -QPixmap FileThumbnailView::createItemPixmap(const KFileItem* item) const { +TQPixmap FileThumbnailView::createItemPixmap(const KFileItem* item) const { bool isDirOrArchive=item->isDir() || Archive::fileItemIsArchive(item); if (!isDirOrArchive) { if (d->mWaitThumbnail.width()!=d->mThumbnailSize) { @@ -324,12 +324,12 @@ QPixmap FileThumbnailView::createItemPixmap(const KFileItem* item) const { return d->mWaitThumbnail; } - QPixmap thumbnail(d->mThumbnailSize, d->mThumbnailSize); + TQPixmap thumbnail(d->mThumbnailSize, d->mThumbnailSize); thumbnail.fill(paletteBackgroundColor()); - QPainter painter(&thumbnail); + TQPainter painter(&thumbnail); // Load the icon - QPixmap itemPix=item->pixmap(QMIN(d->mThumbnailSize, ThumbnailSize::NORMAL)); + TQPixmap itemPix=item->pixmap(TQMIN(d->mThumbnailSize, ThumbnailSize::NORMAL)); painter.drawPixmap( (d->mThumbnailSize-itemPix.width())/2, (d->mThumbnailSize-itemPix.height())/2, @@ -352,9 +352,9 @@ void FileThumbnailView::startThumbnailUpdate() { void FileThumbnailView::doStartThumbnailUpdate(const KFileItemList* list) { - QValueVector<const KFileItem*> imageList; + TQValueVector<const KFileItem*> imageList; imageList.reserve( list->count()); - QPtrListIterator<KFileItem> it(*list); + TQPtrListIterator<KFileItem> it(*list); for (;it.current(); ++it) { KFileItem* item=it.current(); if (!item->isDir() && !Archive::fileItemIsArchive(item)) { @@ -363,21 +363,21 @@ void FileThumbnailView::doStartThumbnailUpdate(const KFileItemList* list) { } if (imageList.empty()) return; - BusyLevelManager::instance()->setBusyLevel( this, BUSY_THUMBNAILS ); + BusyLevelManager::instance()->setBusyLevel( TQT_TQOBJECT(this), BUSY_THUMBNAILS ); Q_ASSERT(!d->mProgressWidget); d->mProgressWidget=new ProgressWidget(this, imageList.count() ); - connect(d->mProgressWidget->stopButton(), SIGNAL(clicked()), - this, SLOT(stopThumbnailUpdate()) ); + connect(d->mProgressWidget->stopButton(), TQT_SIGNAL(clicked()), + this, TQT_SLOT(stopThumbnailUpdate()) ); d->mProgressWidget->show(); d->mThumbnailLoadJob = new ThumbnailLoadJob(&imageList, d->mThumbnailSize); - connect(d->mThumbnailLoadJob, SIGNAL(thumbnailLoaded(const KFileItem*, const QPixmap&, const QSize&)), - this, SLOT(setThumbnailPixmap(const KFileItem*,const QPixmap&, const QSize&)) ); - connect(d->mThumbnailLoadJob, SIGNAL(result(KIO::Job*)), - this, SLOT(slotUpdateEnded()) ); + connect(d->mThumbnailLoadJob, TQT_SIGNAL(thumbnailLoaded(const KFileItem*, const TQPixmap&, const TQSize&)), + this, TQT_SLOT(setThumbnailPixmap(const KFileItem*,const TQPixmap&, const TQSize&)) ); + connect(d->mThumbnailLoadJob, TQT_SIGNAL(result(KIO::Job*)), + this, TQT_SLOT(slotUpdateEnded()) ); slotBusyLevelChanged( BusyLevelManager::instance()->busyLevel()); // start updating at visible position @@ -398,7 +398,7 @@ void FileThumbnailView::slotUpdateEnded() { delete d->mProgressWidget; d->mProgressWidget=0L; - BusyLevelManager::instance()->setBusyLevel( this, BUSY_NONE ); + BusyLevelManager::instance()->setBusyLevel( TQT_TQOBJECT(this), BUSY_NONE ); } @@ -437,7 +437,7 @@ void FileThumbnailView::slotBusyLevelChanged(BusyLevel level) { void FileThumbnailView::clearView() { stopThumbnailUpdate(); mShownFileItem=0L; - QIconView::clear(); + TQIconView::clear(); } @@ -445,7 +445,7 @@ void FileThumbnailView::insertItem(KFileItem* item) { if (!item) return; bool isDirOrArchive=item->isDir() || Archive::fileItemIsArchive(item); - QPixmap thumbnail=createItemPixmap(item); + TQPixmap thumbnail=createItemPixmap(item); FileThumbnailViewItem* iconItem=new FileThumbnailViewItem(this,item->text(),thumbnail,item); iconItem->setDropEnabled(isDirOrArchive); @@ -470,7 +470,7 @@ void FileThumbnailView::ensureItemVisible(const KFileItem* fileItem) { if (!fileItem) return; FileThumbnailViewItem* iconItem=viewItem(this, fileItem); - if (iconItem) QIconView::ensureItemVisible(iconItem); + if (iconItem) TQIconView::ensureItemVisible(iconItem); } @@ -478,7 +478,7 @@ void FileThumbnailView::setCurrentItem(const KFileItem* fileItem) { if (!fileItem) return; FileThumbnailViewItem* iconItem=viewItem(this, fileItem); - if (iconItem) QIconView::setCurrentItem(iconItem); + if (iconItem) TQIconView::setCurrentItem(iconItem); } @@ -486,7 +486,7 @@ void FileThumbnailView::setSelected(const KFileItem* fileItem,bool enable) { if (!fileItem) return; FileThumbnailViewItem* iconItem=viewItem(this, fileItem); - if (iconItem) QIconView::setSelected(iconItem, enable, true /* do not unselect others */); + if (iconItem) TQIconView::setSelected(iconItem, enable, true /* do not unselect others */); } @@ -536,7 +536,7 @@ KFileItem* FileThumbnailView::prevItem(const KFileItem* fileItem) const { KFileItem* FileThumbnailView::currentFileItem() const { - const QIconViewItem* iconItem=currentItem(); + const TQIconViewItem* iconItem=currentItem(); if (!iconItem) return 0L; return static_cast<const FileThumbnailViewItem*>(iconItem)->fileItem(); @@ -554,18 +554,18 @@ KFileItem* FileThumbnailView::nextItem(const KFileItem* fileItem) const { } -void FileThumbnailView::setSorting(QDir::SortSpec spec) { +void FileThumbnailView::setSorting(TQDir::SortSpec spec) { KFileView::setSorting(spec); KFileItem *item; KFileItemListIterator it( *items() ); for ( ; (item = it.current() ); ++it ) { - QIconViewItem* iconItem=viewItem(this, item); + TQIconViewItem* iconItem=viewItem(this, item); if (iconItem) setSortingKey(iconItem, item); } - KIconView::sort(! (spec & QDir::Reversed) ); + KIconView::sort(! (spec & TQDir::Reversed) ); } //-------------------------------------------------------------------------- @@ -573,22 +573,22 @@ void FileThumbnailView::setSorting(QDir::SortSpec spec) { // Drop support // //-------------------------------------------------------------------------- -void FileThumbnailView::contentsDragEnterEvent(QDragEnterEvent* event) { +void FileThumbnailView::contentsDragEnterEvent(TQDragEnterEvent* event) { return event->accept( KURLDrag::canDecode(event) ); } -void FileThumbnailView::slotDropped(QDropEvent* event) { +void FileThumbnailView::slotDropped(TQDropEvent* event) { emit dropped(event,0L); } -void FileThumbnailView::showEvent(QShowEvent* event) { +void FileThumbnailView::showEvent(TQShowEvent* event) { KIconView::showEvent(event); if (!d->mUpdateThumbnailsOnNextShow) return; d->mUpdateThumbnailsOnNextShow=false; - QTimer::singleShot(0, this, SLOT(startThumbnailUpdate())); + TQTimer::singleShot(0, this, TQT_SLOT(startThumbnailUpdate())); } @@ -605,25 +605,25 @@ void FileThumbnailView::updateGrid() { + RIGHT_TEXT_WIDTH); } else { setGridX( - QMAX(d->mThumbnailSize, BOTTOM_MIN_TEXT_WIDTH) + TQMAX(d->mThumbnailSize, BOTTOM_MIN_TEXT_WIDTH) + FileThumbnailViewItem::PADDING*2); } setSpacing(d->mMarginSize); } -void FileThumbnailView::setSortingKey(QIconViewItem *iconItem, const KFileItem *item) +void FileThumbnailView::setSortingKey(TQIconViewItem *iconItem, const KFileItem *item) { // see also setSorting() - QDir::SortSpec spec = KFileView::sorting(); + TQDir::SortSpec spec = KFileView::sorting(); bool isDirOrArchive=item->isDir() || Archive::fileItemIsArchive(item); - QString key; - if ( spec & QDir::Time ) { + TQString key; + if ( spec & TQDir::Time ) { time_t time = TimeUtils::getTime(item); key=sortingKey(time, isDirOrArchive, spec); - } else if ( spec & QDir::Size ) { + } else if ( spec & TQDir::Size ) { key=sortingKey( item->size(), isDirOrArchive, spec ); } else { @@ -640,7 +640,7 @@ void FileThumbnailView::setSortingKey(QIconViewItem *iconItem, const KFileItem * // Private slots // //-------------------------------------------------------------------------- -void FileThumbnailView::slotDoubleClicked(QIconViewItem* iconItem) { +void FileThumbnailView::slotDoubleClicked(TQIconViewItem* iconItem) { if (!iconItem) return; if (KGlobalSettings::singleClick()) return; FileThumbnailViewItem* thumbItem=static_cast<FileThumbnailViewItem*>(iconItem); @@ -653,7 +653,7 @@ void FileThumbnailView::slotDoubleClicked(QIconViewItem* iconItem) { } -void FileThumbnailView::slotClicked(QIconViewItem* iconItem) { +void FileThumbnailView::slotClicked(TQIconViewItem* iconItem) { if (!iconItem) return; if (!KGlobalSettings::singleClick()) return; FileThumbnailViewItem* thumbItem=static_cast<FileThumbnailViewItem*>(iconItem); @@ -669,12 +669,12 @@ void FileThumbnailView::slotContentsMoving( int x, int y ) { updateVisibilityInfo( x, y ); // use x,y, the signal is emitted before moving } -void FileThumbnailView::slotCurrentChanged(QIconViewItem* item ) { +void FileThumbnailView::slotCurrentChanged(TQIconViewItem* item ) { // trigger generating thumbnails from the current one updateVisibilityInfo( contentsX(), contentsY()); prefetchDone(); // if the first image is selected, no matter how, preload the next one - for( QIconViewItem* pos = item; + for( TQIconViewItem* pos = item; pos != NULL; pos = pos->nextItem()) { FileThumbnailViewItem* cur = static_cast< FileThumbnailViewItem* >( pos ); @@ -682,8 +682,8 @@ void FileThumbnailView::slotCurrentChanged(QIconViewItem* item ) { if( pos == item && pos->nextItem() != NULL ) { d->mPrefetch = ImageLoader::loader( static_cast<const FileThumbnailViewItem*>( cur->nextItem() )->fileItem()->url(), - this, BUSY_PRELOADING ); - connect( d->mPrefetch, SIGNAL( imageLoaded( bool )), SLOT( prefetchDone())); + TQT_TQOBJECT(this), BUSY_PRELOADING ); + connect( d->mPrefetch, TQT_SIGNAL( imageLoaded( bool )), TQT_SLOT( prefetchDone())); } } } @@ -696,14 +696,14 @@ void FileThumbnailView::slotCurrentChanged(QIconViewItem* item ) { void FileThumbnailView::updateVisibilityInfo( int x, int y ) { if (d->mThumbnailLoadJob.isNull()) return; - QRect rect( x, y, visibleWidth(), visibleHeight()); - FileThumbnailViewItem* first = static_cast< FileThumbnailViewItem* >( findFirstVisibleItem( rect )); + TQRect rect( x, y, visibleWidth(), visibleHeight()); + FileThumbnailViewItem* first = static_cast< FileThumbnailViewItem* >( tqfindFirstVisibleItem( rect )); if (!first) { d->mThumbnailLoadJob->setPriorityItems(NULL,NULL,NULL); return; } - FileThumbnailViewItem* last = static_cast< FileThumbnailViewItem* >( findLastVisibleItem( rect )); + FileThumbnailViewItem* last = static_cast< FileThumbnailViewItem* >( tqfindLastVisibleItem( rect )); Q_ASSERT(last); // If we get a first item, then there must be a last if (currentItem() && currentItem()->intersects(rect)) { @@ -719,16 +719,16 @@ void FileThumbnailView::updateVisibilityInfo( int x, int y ) { last->fileItem()); } -void FileThumbnailView::keyPressEvent( QKeyEvent* e ) { +void FileThumbnailView::keyPressEvent( TQKeyEvent* e ) { // When the user presses e.g. the Down key, try to preload the next image in that direction. if( e->key() != Key_Left && e->key() != Key_Right && e->key() != Key_Up && e->key() != Key_Down ) return KIconView::keyPressEvent( e ); - QIconViewItem* current = currentItem(); + TQIconViewItem* current = currentItem(); KIconView::keyPressEvent( e ); - QIconViewItem* next = NULL; + TQIconViewItem* next = NULL; if( current != currentItem() && currentItem() != NULL ) { // it actually moved switch( e->key()) { case Key_Left: @@ -757,14 +757,14 @@ void FileThumbnailView::keyPressEvent( QKeyEvent* e ) { if( next != NULL ) { d->mPrefetch = ImageLoader::loader( static_cast<const FileThumbnailViewItem*>( next )->fileItem()->url(), - this, BUSY_PRELOADING ); - connect( d->mPrefetch, SIGNAL( imageLoaded( bool )), SLOT( prefetchDone())); + TQT_TQOBJECT(this), BUSY_PRELOADING ); + connect( d->mPrefetch, TQT_SIGNAL( imageLoaded( bool )), TQT_SLOT( prefetchDone())); } } void FileThumbnailView::prefetchDone() { if( d->mPrefetch != NULL ) { - d->mPrefetch->release( this ); + d->mPrefetch->release( TQT_TQOBJECT(this) ); d->mPrefetch = NULL; } } @@ -782,11 +782,11 @@ void FileThumbnailView::startDrag() { ItemDrawer(FileThumbnailView* view) : mView(view) {} - QSize itemSize(KFileItem* fileItem) { - QPixmap* pix = pixmapFromFileItem(fileItem); - if (!pix) return QSize(); + TQSize itemSize(KFileItem* fileItem) { + TQPixmap* pix = pixmapFromFileItem(fileItem); + if (!pix) return TQSize(); - QSize size = pix->size(); + TQSize size = pix->size(); int maxWidth = mGenerator->maxWidth(); if (size.width() > maxWidth) { size.rheight() = size.height() * maxWidth / size.width(); @@ -799,28 +799,28 @@ void FileThumbnailView::startDrag() { return 2; } - void drawItem(QPainter* painter, int left, int top, KFileItem* fileItem) { - QPixmap* pix = pixmapFromFileItem(fileItem); + void drawItem(TQPainter* painter, int left, int top, KFileItem* fileItem) { + TQPixmap* pix = pixmapFromFileItem(fileItem); if (!pix) return; - QSize size = itemSize(fileItem); + TQSize size = itemSize(fileItem); left += (mGenerator->pixmapWidth() - size.width()) / 2; if (size == pix->size()) { painter->drawPixmap(left, top, *pix); return; } - QImage img = pix->convertToImage(); - img = img.smoothScale(size, QImage::ScaleMin); + TQImage img = pix->convertToImage(); + img = img.smoothScale(size, TQ_ScaleMin); painter->drawImage(left, top, img); } - QPixmap* pixmapFromFileItem(KFileItem* fileItem) { + TQPixmap* pixmapFromFileItem(KFileItem* fileItem) { FileThumbnailViewItem* iconItem = viewItem(mView, fileItem); Q_ASSERT(iconItem); if (!iconItem) return 0; - QPixmap* pix = iconItem->pixmap(); + TQPixmap* pix = iconItem->pixmap(); Q_ASSERT(pix); if (!pix) return 0; return pix; @@ -847,10 +847,10 @@ void FileThumbnailView::startDrag() { return; } - QDragObject* drag=new KURLDrag(urls, this, 0); - QPixmap dragPixmap = generator.generate(); + TQDragObject* drag=new KURLDrag(urls, this, 0); + TQPixmap dragPixmap = generator.generate(); - drag->setPixmap( dragPixmap, QPoint(generator.DRAG_OFFSET, -generator.DRAG_OFFSET)); + drag->setPixmap( dragPixmap, TQPoint(generator.DRAG_OFFSET, -generator.DRAG_OFFSET)); drag->dragCopy(); } diff --git a/src/gvcore/filethumbnailview.h b/src/gvcore/filethumbnailview.h index c27b855..8cc2776 100644 --- a/src/gvcore/filethumbnailview.h +++ b/src/gvcore/filethumbnailview.h @@ -21,9 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef FILETHUMBNAILVIEW_H #define FILETHUMBNAILVIEW_H -// Qt includes -#include <qguardedptr.h> -#include <qptrlist.h> +// TQt includes +#include <tqguardedptr.h> +#include <tqptrlist.h> // KDE includes #include <kiconview.h> @@ -33,32 +33,33 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "busylevelmanager.h" #include "libgwenview_export.h" -class QDragEnterEvent; -class QIconViewItem; -class QPopupMenu; -class QShowEvent; +class TQDragEnterEvent; +class TQIconViewItem; +class TQPopupMenu; +class TQShowEvent; class KConfig; class KFileItem; -typedef QPtrList<KFileItem> KFileItemList; +typedef TQPtrList<KFileItem> KFileItemList; namespace Gwenview { class FileThumbnailViewItem; class LIBGWENVIEW_EXPORT FileThumbnailView : public KIconView, public FileViewBase { Q_OBJECT + TQ_OBJECT friend class FileThumbnailViewItem; public: enum ItemDetail { FILENAME=1, FILESIZE=2, FILEDATE=4, IMAGESIZE=8 }; - FileThumbnailView(QWidget* parent); + FileThumbnailView(TQWidget* tqparent); ~FileThumbnailView(); - QWidget* widget() { return this; } + TQWidget* widget() { return this; } // KFileView methods void clearView(); - void clearSelection() { QIconView::clearSelection(); } + void clearSelection() { TQIconView::clearSelection(); } void insertItem(KFileItem* item); void ensureItemVisible(const KFileItem* item); void setCurrentItem(const KFileItem* item); @@ -66,7 +67,7 @@ public: bool isSelected(const KFileItem* item) const; void removeItem(const KFileItem* item); void updateView(const KFileItem* item); - void setSorting(QDir::SortSpec); + void setSorting(TQDir::SortSpec); KFileItem* firstFileItem() const; KFileItem* prevItem( const KFileItem*) const; @@ -89,37 +90,37 @@ public: void updateThumbnail(const KFileItem*); public slots: - void setThumbnailPixmap(const KFileItem*,const QPixmap&, const QSize&); + void setThumbnailPixmap(const KFileItem*,const TQPixmap&, const TQSize&); void startThumbnailUpdate(); void stopThumbnailUpdate(); void showThumbnailDetailsDialog(); signals: - void dropped(QDropEvent*, KFileItem* target); + void dropped(TQDropEvent*, KFileItem* target); protected: - void showEvent(QShowEvent*); - void contentsDragEnterEvent(QDragEnterEvent*); + void showEvent(TQShowEvent*); + void contentsDragEnterEvent(TQDragEnterEvent*); void startDrag(); - virtual void keyPressEvent( QKeyEvent* ); + virtual void keyPressEvent( TQKeyEvent* ); private: class Private; Private* d; void updateGrid(); - QPixmap createItemPixmap(const KFileItem*) const; + TQPixmap createItemPixmap(const KFileItem*) const; void doStartThumbnailUpdate(const KFileItemList*); - void setSortingKey(QIconViewItem*, const KFileItem*); + void setSortingKey(TQIconViewItem*, const KFileItem*); void updateVisibilityInfo( int x, int y ); private slots: - void slotClicked(QIconViewItem*); - void slotDoubleClicked(QIconViewItem*); - void slotDropped(QDropEvent*); + void slotClicked(TQIconViewItem*); + void slotDoubleClicked(TQIconViewItem*); + void slotDropped(TQDropEvent*); void slotContentsMoving( int, int ); - void slotCurrentChanged(QIconViewItem*); + void slotCurrentChanged(TQIconViewItem*); void slotBusyLevelChanged( BusyLevel ); void slotUpdateEnded(); void prefetchDone(); diff --git a/src/gvcore/filethumbnailviewitem.cpp b/src/gvcore/filethumbnailviewitem.cpp index 00f3c89..65da494 100644 --- a/src/gvcore/filethumbnailviewitem.cpp +++ b/src/gvcore/filethumbnailviewitem.cpp @@ -21,12 +21,12 @@ the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Qt includes -#include <qapplication.h> -#include <qcolor.h> -#include <qpainter.h> -#include <qpen.h> -#include <qpixmap.h> +// TQt includes +#include <tqapplication.h> +#include <tqcolor.h> +#include <tqpainter.h> +#include <tqpen.h> +#include <tqpixmap.h> // KDE includes #include <kdebug.h> @@ -45,7 +45,7 @@ namespace Gwenview { const int SHOWN_ITEM_INDICATOR_SIZE = 8; #if 0 -static void printRect(const QString& txt,const QRect& rect) { +static void printRect(const TQString& txt,const TQRect& rect) { kdWarning() << txt << " : " << rect.x() << "x" << rect.y() << " " << rect.width() << "x" << rect.height() << endl; } #endif @@ -56,11 +56,11 @@ static void printRect(const QString& txt,const QRect& rect) { */ class FileThumbnailViewItem::Line { protected: - const QIconViewItem* mItem; - QString mTxt; + const TQIconViewItem* mItem; + TQString mTxt; int mWidth; public: - Line(const QIconViewItem* item, const QString& txt) + Line(const TQIconViewItem* item, const TQString& txt) : mItem(item) , mTxt(txt) , mWidth(-1) { @@ -73,7 +73,7 @@ public: virtual int height() const=0; - void paint(QPainter* p, int textX, int textY, int align) const { + void paint(TQPainter* p, int textX, int textY, int align) const { Q_ASSERT(mWidth!=-1); int length=fontMetrics().width(mTxt); if (length<=mWidth ) { @@ -96,14 +96,14 @@ protected: return static_cast<const FileThumbnailView*>(mItem->iconView()); } - QFontMetrics fontMetrics() const { + TQFontMetrics fontMetrics() const { return view()->fontMetrics(); } /** * Called when the text won't fit the available space */ - virtual void complexPaint(QPainter* p, int textX, int textY, int align) const=0; + virtual void complexPaint(TQPainter* p, int textX, int textY, int align) const=0; }; @@ -112,14 +112,14 @@ protected: */ class FileThumbnailViewItem::CroppedLine : public FileThumbnailViewItem::Line { public: - CroppedLine(const QIconViewItem* item, const QString& txt) + CroppedLine(const TQIconViewItem* item, const TQString& txt) : Line(item, txt) {} int height() const { return fontMetrics().height(); } - void complexPaint(QPainter* p, int textX, int textY, int /*align*/) const { + void complexPaint(TQPainter* p, int textX, int textY, int /*align*/) const { KWordWrap::drawFadeoutText(p, textX, textY + fontMetrics().ascent(), @@ -135,7 +135,7 @@ public: class FileThumbnailViewItem::WrappedLine : public FileThumbnailViewItem::Line { KWordWrap* mWordWrap; public: - WrappedLine(const QIconViewItem* item, const QString& txt) + WrappedLine(const TQIconViewItem* item, const TQString& txt) : Line(item, txt) , mWordWrap(0) {} @@ -156,14 +156,14 @@ public: if (width==mWidth) return; mWidth=width; delete mWordWrap; - QFontMetrics fm=fontMetrics(); + TQFontMetrics fm=fontMetrics(); mWordWrap=KWordWrap::formatText(fm, - QRect(0, 0, mWidth, fm.height()*3), + TQRect(0, 0, mWidth, fm.height()*3), 0 /*flags*/, mTxt); } - void complexPaint(QPainter* p, int textX, int textY, int align) const { + void complexPaint(TQPainter* p, int textX, int textY, int align) const { Q_ASSERT(mWordWrap); if (!mWordWrap) return; @@ -180,16 +180,16 @@ public: }; -FileThumbnailViewItem::FileThumbnailViewItem(QIconView* view,const QString& text,const QPixmap& icon, KFileItem* fileItem) -: QIconViewItem(view,text,icon), mFileItem(fileItem) { +FileThumbnailViewItem::FileThumbnailViewItem(TQIconView* view,const TQString& text,const TQPixmap& icon, KFileItem* fileItem) +: TQIconViewItem(view,text,icon), mFileItem(fileItem) { updateLines(); calcRect(); } FileThumbnailViewItem::~FileThumbnailViewItem() { - QValueVector<Line*>::ConstIterator it=mLines.begin(); - QValueVector<Line*>::ConstIterator itEnd=mLines.end(); + TQValueVector<Line*>::ConstIterator it=mLines.begin(); + TQValueVector<Line*>::ConstIterator itEnd=mLines.end(); for (;it!=itEnd; ++it) { delete *it; } @@ -197,8 +197,8 @@ FileThumbnailViewItem::~FileThumbnailViewItem() { void FileThumbnailViewItem::updateLines() { - QValueVector<Line*>::ConstIterator it=mLines.begin(); - QValueVector<Line*>::ConstIterator itEnd=mLines.end(); + TQValueVector<Line*>::ConstIterator it=mLines.begin(); + TQValueVector<Line*>::ConstIterator itEnd=mLines.end(); for (;it!=itEnd; ++it) { delete *it; } @@ -206,14 +206,14 @@ void FileThumbnailViewItem::updateLines() { if (!mFileItem) return; bool isDir=mFileItem->isDir(); - if (iconView()->itemTextPos()==QIconView::Right) { + if (iconView()->itemTextPos()==TQIconView::Right) { // Text is on the right, show everything time_t time = TimeUtils::getTime(mFileItem); mLines.append( new WrappedLine(this, mFileItem->name()) ); mLines.append( new CroppedLine(this, TimeUtils::formatTime(time)) ); if (mImageSize.isValid()) { - QString txt=QString::number(mImageSize.width())+"x"+QString::number(mImageSize.height()); + TQString txt=TQString::number(mImageSize.width())+"x"+TQString::number(mImageSize.height()); mLines.append( new CroppedLine(this, txt) ); } if (!isDir) { @@ -235,9 +235,9 @@ void FileThumbnailViewItem::updateLines() { mLines.append( new CroppedLine(this, TimeUtils::formatTime(time)) ); } if (details & FileThumbnailView::IMAGESIZE) { - QString txt; + TQString txt; if (mImageSize.isValid()) { - txt=QString::number(mImageSize.width())+"x"+QString::number(mImageSize.height()); + txt=TQString::number(mImageSize.width())+"x"+TQString::number(mImageSize.height()); } mLines.append( new CroppedLine(this, txt) ); } @@ -251,9 +251,9 @@ void FileThumbnailViewItem::updateLines() { } -void FileThumbnailViewItem::calcRect(const QString&) { +void FileThumbnailViewItem::calcRect(const TQString&) { FileThumbnailView *view=static_cast<FileThumbnailView*>(iconView()); - bool isRight=view->itemTextPos()==QIconView::Right; + bool isRight=view->itemTextPos()==TQIconView::Right; int textW=view->gridX(); int thumbnailSize=FileViewConfig::thumbnailSize(); @@ -264,23 +264,23 @@ void FileThumbnailViewItem::calcRect(const QString&) { } int textH=0; - QValueVector<Line*>::ConstIterator it=mLines.begin(); - QValueVector<Line*>::ConstIterator itEnd=mLines.end(); + TQValueVector<Line*>::ConstIterator it=mLines.begin(); + TQValueVector<Line*>::ConstIterator itEnd=mLines.end(); for (;it!=itEnd; ++it) { (*it)->setWidth(textW); textH+=(*it)->height(); } - QRect itemRect(x(), y(), view->gridX(), 0); - QRect itemPixmapRect(PADDING, PADDING, thumbnailSize, thumbnailSize); - QRect itemTextRect(0, 0, textW, textH); + TQRect tqitemRect(x(), y(), view->gridX(), 0); + TQRect itemPixmapRect(PADDING, PADDING, thumbnailSize, thumbnailSize); + TQRect itemTextRect(0, 0, textW, textH); if (isRight) { - itemRect.setHeight( QMAX(thumbnailSize + PADDING*2, textH) ); + tqitemRect.setHeight( TQMAX(thumbnailSize + PADDING*2, textH) ); itemTextRect.moveLeft(thumbnailSize + PADDING * 2 ); - itemTextRect.moveTop((itemRect.height() - textH)/2); + itemTextRect.moveTop((tqitemRect.height() - textH)/2); } else { - itemPixmapRect.moveLeft( (itemRect.width() - itemPixmapRect.width()) / 2 ); - itemRect.setHeight(thumbnailSize + PADDING*3 + textH); + itemPixmapRect.moveLeft( (tqitemRect.width() - itemPixmapRect.width()) / 2 ); + tqitemRect.setHeight(thumbnailSize + PADDING*3 + textH); itemTextRect.moveLeft(PADDING); itemTextRect.moveTop(thumbnailSize + PADDING * 2); } @@ -292,18 +292,18 @@ void FileThumbnailViewItem::calcRect(const QString&) { if ( itemTextRect != textRect() ) { setTextRect( itemTextRect ); } - if ( itemRect != rect() ) { - setItemRect( itemRect ); + if ( tqitemRect != rect() ) { + setItemRect( tqitemRect ); } } -void FileThumbnailViewItem::paintItem(QPainter *p, const QColorGroup &cg) { +void FileThumbnailViewItem::paintItem(TQPainter *p, const TQColorGroup &cg) { FileThumbnailView *view=static_cast<FileThumbnailView*>(iconView()); Q_ASSERT(view); if (!view) return; - bool isRight=view->itemTextPos()==QIconView::Right; + bool isRight=view->itemTextPos()==TQIconView::Right; bool isShownItem=view->shownFileItem() && view->shownFileItem()->extraData(view)==this; bool isImage=!Archive::fileItemIsDirOrArchive(mFileItem); int textX, textY, textW, textH; @@ -315,12 +315,12 @@ void FileThumbnailViewItem::paintItem(QPainter *p, const QColorGroup &cg) { textH=textRect(false).height(); // Draw pixmap - QRect pRect = pixmapRect(false); + TQRect pRect = pixmapRect(false); int pixX = pRect.left() + ( thumbnailSize - pixmap()->width() ) / 2; int pixY = pRect.top() + ( thumbnailSize - pixmap()->height() ) / 2; p->drawPixmap( pixX, pixY, *pixmap() ); - QColor bg; + TQColor bg; if ( isSelected() ) { bg=cg.highlight(); } else { @@ -329,7 +329,7 @@ void FileThumbnailViewItem::paintItem(QPainter *p, const QColorGroup &cg) { // Draw shown item indicator if (isShownItem) { - QPointArray pa(3); + TQPointArray pa(3); pa[0] = pixmapRect(false).bottomLeft(); pa[0].rx() += pixmapRect(false).width() / 2; pa[0].ry() += PADDING - 1; @@ -349,10 +349,10 @@ void FileThumbnailViewItem::paintItem(QPainter *p, const QColorGroup &cg) { if (isImage || isSelected()) { // Draw frame - QRect frmRect=pixmapRect(false); + TQRect frmRect=pixmapRect(false); frmRect.addCoords(-PADDING, -PADDING, PADDING, PADDING); - p->setBrush(QBrush()); + p->setBrush(TQBrush()); p->setPen(bg); p->drawRect(frmRect); if (isSelected()) { @@ -366,8 +366,8 @@ void FileThumbnailViewItem::paintItem(QPainter *p, const QColorGroup &cg) { p->setBackgroundColor(cg.base()); int align = (isRight ? AlignAuto : AlignHCenter) | AlignTop; - QValueVector<Line*>::ConstIterator it=mLines.begin(); - QValueVector<Line*>::ConstIterator itEnd=mLines.end(); + TQValueVector<Line*>::ConstIterator it=mLines.begin(); + TQValueVector<Line*>::ConstIterator itEnd=mLines.end(); for (;it!=itEnd; ++it) { const Line* line=*it; line->paint(p, textX, textY, align); @@ -376,17 +376,17 @@ void FileThumbnailViewItem::paintItem(QPainter *p, const QColorGroup &cg) { } -bool FileThumbnailViewItem::acceptDrop(const QMimeSource* source) const { +bool FileThumbnailViewItem::acceptDrop(const TQMimeSource* source) const { return KURLDrag::canDecode(source); } -void FileThumbnailViewItem::dropped(QDropEvent* event, const QValueList<QIconDragItem>&) { +void FileThumbnailViewItem::dropped(TQDropEvent* event, const TQValueList<TQIconDragItem>&) { FileThumbnailView *view=static_cast<FileThumbnailView*>(iconView()); emit view->dropped(event,mFileItem); } -void FileThumbnailViewItem::setImageSize(const QSize& size) { +void FileThumbnailViewItem::setImageSize(const TQSize& size) { mImageSize=size; updateLines(); } diff --git a/src/gvcore/filethumbnailviewitem.h b/src/gvcore/filethumbnailviewitem.h index 0a817bf..55b2c98 100644 --- a/src/gvcore/filethumbnailviewitem.h +++ b/src/gvcore/filethumbnailviewitem.h @@ -22,46 +22,46 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef FILETHUMBNAILVIEWITEM_H #define FILETHUMBNAILVIEWITEM_H -// Qt -#include <qiconview.h> -#include <qpixmap.h> -#include <qstring.h> -#include <qvaluevector.h> +// TQt +#include <tqiconview.h> +#include <tqpixmap.h> +#include <tqstring.h> +#include <tqvaluevector.h> class KFileItem; namespace Gwenview { /** - * We override the QIconViewItem to control the look of selected items + * We override the TQIconViewItem to control the look of selected items * and get a pointer to our KFileItem */ -class FileThumbnailViewItem : public QIconViewItem { +class FileThumbnailViewItem : public TQIconViewItem { public: class Line; class CroppedLine; class WrappedLine; enum { PADDING=4 }; - FileThumbnailViewItem(QIconView* parent,const QString& text,const QPixmap& icon, KFileItem* fileItem); + FileThumbnailViewItem(TQIconView* tqparent,const TQString& text,const TQPixmap& icon, KFileItem* fileItem); ~FileThumbnailViewItem(); KFileItem* fileItem() const { return mFileItem; } - void setImageSize(const QSize&); + void setImageSize(const TQSize&); void updateLines(); protected: - void paintItem(QPainter* painter, const QColorGroup& colorGroup); - void calcRect( const QString& text_=QString::null ); - void paintFocus(QPainter*, const QColorGroup&) {} - bool acceptDrop(const QMimeSource*) const; - void dropped(QDropEvent*, const QValueList<QIconDragItem>&); + void paintItem(TQPainter* painter, const TQColorGroup& tqcolorGroup); + void calcRect( const TQString& text_=TQString() ); + void paintFocus(TQPainter*, const TQColorGroup&) {} + bool acceptDrop(const TQMimeSource*) const; + void dropped(TQDropEvent*, const TQValueList<TQIconDragItem>&); KFileItem* mFileItem; - QValueVector<Line*> mLines; + TQValueVector<Line*> mLines; - QSize mImageSize; + TQSize mImageSize; }; } // namespace diff --git a/src/gvcore/fileviewbase.h b/src/gvcore/fileviewbase.h index 0802310..37c8690 100644 --- a/src/gvcore/fileviewbase.h +++ b/src/gvcore/fileviewbase.h @@ -22,8 +22,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef FILEVIEWBASE_H #define FILEVIEWBASE_H -// Qt includes -#include <qcolor.h> +// TQt includes +#include <tqcolor.h> // KDE includes #include <kfileview.h> diff --git a/src/gvcore/fileviewconfig.kcfg b/src/gvcore/fileviewconfig.kcfg index 0ef5f1a..9ec2ed6 100644 --- a/src/gvcore/fileviewconfig.kcfg +++ b/src/gvcore/fileviewconfig.kcfg @@ -1,7 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd"> <kcfg> - <include>qiconview.h</include> + <include>tqiconview.h</include> <kcfgfile name="gwenviewrc"/> <group name="file widget"> <entry name="showDirs" key="show dirs" type="Bool"> @@ -14,7 +14,7 @@ <default>true</default> </entry> <entry name="thumbnailTextPos" key="item text pos" type="Int"> - <default code="true">QIconView::Right</default> + <default code="true">TQIconView::Right</default> </entry> <entry name="thumbnailSize" key="thumbnail size" type="Int"> <default>48</default> diff --git a/src/gvcore/fileviewcontroller.cpp b/src/gvcore/fileviewcontroller.cpp index 95dc47c..e58e654 100644 --- a/src/gvcore/fileviewcontroller.cpp +++ b/src/gvcore/fileviewcontroller.cpp @@ -19,15 +19,15 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Qt -#include <qcheckbox.h> -#include <qdatetimeedit.h> -#include <qhbox.h> -#include <qlayout.h> -#include <qpopupmenu.h> -#include <qpushbutton.h> -#include <qtooltip.h> -#include <qwidgetstack.h> +// TQt +#include <tqcheckbox.h> +#include <tqdatetimeedit.h> +#include <tqhbox.h> +#include <tqlayout.h> +#include <tqpopupmenu.h> +#include <tqpushbutton.h> +#include <tqtooltip.h> +#include <tqwidgetstack.h> // KDE #include <kaction.h> @@ -116,7 +116,7 @@ public: mCheck = c; } - void setDateFilter(const QDate& from, const QDate& to) { + void setDateFilter(const TQDate& from, const TQDate& to) { mFromDate = from; mToDate =to; } @@ -129,10 +129,10 @@ public: public: virtual bool matchesMimeFilter(const KFileItem* item) const { // Do mime filtering ourself because we use startsWith instead of == - QStringList lst = mimeFilters(); - QStringList::Iterator it = lst.begin(), end = lst.end(); + TQStringList lst = mimeFilters(); + TQStringList::Iterator it = lst.begin(), end = lst.end(); bool result = false; - QString type = item->mimetype(); + TQString type = item->mimetype(); for (; it!=end; ++it) { if (type.startsWith(*it)) { result = true; @@ -148,11 +148,11 @@ public: if (!mFromDate.isValid() && !mToDate.isValid()) return result; - // Convert item time to a QDate + // Convert item time to a TQDate time_t time=TimeUtils::getTime(item); - QDateTime dateTime; + TQDateTime dateTime; dateTime.setTime_t(time); - QDate date=dateTime.date(); + TQDate date=dateTime.date(); if (mFromDate.isValid() && date < mFromDate) return false; if (mToDate.isValid() && date > mToDate) return false; @@ -162,8 +162,8 @@ public: private: mutable bool mError; bool mCheck; - QDate mFromDate; - QDate mToDate; + TQDate mFromDate; + TQDate mToDate; }; @@ -180,60 +180,60 @@ public: FileViewController* that; FilterBar* mFilterBar; KToolBar* mToolBar; - QWidgetStack* mStack; + TQWidgetStack* mStack; KSelectAction* mSortAction; KToggleAction* mRevertSortAction; TipTracker* mSliderTracker; - QHBox* mFilterHBox; - QComboBox* mFilterComboBox; - QCheckBox* mShowFilterBarCheckBox; + TQHBox* mFilterHBox; + TQComboBox* mFilterComboBox; + TQCheckBox* mShowFilterBarCheckBox; void initFilterBar() { mFilterBar=new FilterBar(that); - mFilterBar->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed); + mFilterBar->tqsetSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed); mFilterBar->hide(); - QIconSet resetIS=BarIcon("locationbar_erase"); + TQIconSet resetIS=BarIcon("locationbar_erase"); mFilterBar->mResetNameCombo->setIconSet(resetIS); mFilterBar->mResetFrom->setIconSet(resetIS); mFilterBar->mResetTo->setIconSet(resetIS); - QObject::connect( - mFilterBar->mResetNameCombo, SIGNAL(clicked()), - that, SLOT(resetNameFilter()) ); - QObject::connect( - mFilterBar->mResetFrom, SIGNAL(clicked()), - that, SLOT(resetFromFilter()) ); - QObject::connect( - mFilterBar->mResetTo, SIGNAL(clicked()), - that, SLOT(resetToFilter()) ); - - QObject::connect( - mFilterBar->mFilterButton, SIGNAL(clicked()), - that, SLOT(applyFilter()) ); + TQObject::connect( + mFilterBar->mResetNameCombo, TQT_SIGNAL(clicked()), + that, TQT_SLOT(resetNameFilter()) ); + TQObject::connect( + mFilterBar->mResetFrom, TQT_SIGNAL(clicked()), + that, TQT_SLOT(resetFromFilter()) ); + TQObject::connect( + mFilterBar->mResetTo, TQT_SIGNAL(clicked()), + that, TQT_SLOT(resetToFilter()) ); + + TQObject::connect( + mFilterBar->mFilterButton, TQT_SIGNAL(clicked()), + that, TQT_SLOT(applyFilter()) ); } void initFilterCombo() { - mFilterHBox=new QHBox(mToolBar, "kde toolbar widget"); + mFilterHBox=new TQHBox(mToolBar, "kde toolbar widget"); mFilterHBox->setSpacing(KDialog::spacingHint()); - mFilterComboBox=new QComboBox(mFilterHBox); + mFilterComboBox=new TQComboBox(mFilterHBox); mFilterComboBox->insertItem(i18n("All files"), ALL); mFilterComboBox->insertItem(i18n("Images only"), IMAGES_ONLY); mFilterComboBox->insertItem(i18n("Videos only"), VIDEOS_ONLY); - QObject::connect( - mFilterComboBox, SIGNAL(activated(int)), - that, SLOT(applyFilter()) ); - - mShowFilterBarCheckBox = new QCheckBox(i18n("More"), mFilterHBox); - QObject::connect( - mShowFilterBarCheckBox, SIGNAL(toggled(bool)), - mFilterBar, SLOT(setShown(bool)) ); - QObject::connect( - mShowFilterBarCheckBox, SIGNAL(toggled(bool)), - that, SLOT(applyFilter()) ); + TQObject::connect( + mFilterComboBox, TQT_SIGNAL(activated(int)), + that, TQT_SLOT(applyFilter()) ); + + mShowFilterBarCheckBox = new TQCheckBox(i18n("More"), mFilterHBox); + TQObject::connect( + mShowFilterBarCheckBox, TQT_SIGNAL(toggled(bool)), + mFilterBar, TQT_SLOT(setShown(bool)) ); + TQObject::connect( + mShowFilterBarCheckBox, TQT_SIGNAL(toggled(bool)), + that, TQT_SLOT(applyFilter()) ); } @@ -252,11 +252,11 @@ public: // FileViewController // //----------------------------------------------------------------------- -FileViewController::FileViewController(QWidget* parent,KActionCollection* actionCollection) -: QWidget(parent) +FileViewController::FileViewController(TQWidget* tqparent,KActionCollection* actionCollection) +: TQWidget(tqparent) , mMode(FILE_LIST) , mPrefetch( NULL ) -, mChangeDirStatus(CHANGE_DIR_STATUS_NONE) +, mChangeDirtqStatus(CHANGE_DIR_STATUS_NONE) , mBrowsing(false) , mSelecting(false) { @@ -266,158 +266,158 @@ FileViewController::FileViewController(QWidget* parent,KActionCollection* action d->mToolBar=new KToolBar(this, "", true); d->initFilterBar(); d->initFilterCombo(); - d->mStack=new QWidgetStack(this); + d->mStack=new TQWidgetStack(this); - QVBoxLayout *layout=new QVBoxLayout(this); - layout->addWidget(d->mToolBar); - layout->addWidget(d->mFilterBar); - layout->addWidget(d->mStack); + TQVBoxLayout *tqlayout=new TQVBoxLayout(this); + tqlayout->addWidget(d->mToolBar); + tqlayout->addWidget(d->mFilterBar); + tqlayout->addWidget(d->mStack); // Actions mSelectFirst=new KAction(i18n("&First"), - QApplication::reverseLayout() ? "2rightarrow":"2leftarrow", Key_Home, - this,SLOT(slotSelectFirst()), actionCollection, "first"); + TQApplication::reverseLayout() ? "2rightarrow":"2leftarrow", Key_Home, + TQT_TQOBJECT(this),TQT_SLOT(slotSelectFirst()), actionCollection, "first"); mSelectLast=new KAction(i18n("&Last"), - QApplication::reverseLayout() ? "2leftarrow":"2rightarrow", Key_End, - this,SLOT(slotSelectLast()), actionCollection, "last"); + TQApplication::reverseLayout() ? "2leftarrow":"2rightarrow", Key_End, + TQT_TQOBJECT(this),TQT_SLOT(slotSelectLast()), actionCollection, "last"); mSelectPrevious=new KAction(i18n("&Previous"), - QApplication::reverseLayout() ? "1rightarrow":"1leftarrow", Key_BackSpace, - this,SLOT(slotSelectPrevious()), actionCollection, "previous"); + TQApplication::reverseLayout() ? "1rightarrow":"1leftarrow", Key_BackSpace, + TQT_TQOBJECT(this),TQT_SLOT(slotSelectPrevious()), actionCollection, "previous"); mSelectNext=new KAction(i18n("&Next"), - QApplication::reverseLayout() ? "1leftarrow":"1rightarrow", Key_Space, - this,SLOT(slotSelectNext()), actionCollection, "next"); + TQApplication::reverseLayout() ? "1leftarrow":"1rightarrow", Key_Space, + TQT_TQOBJECT(this),TQT_SLOT(slotSelectNext()), actionCollection, "next"); mSelectPreviousDir=new KAction(i18n("&Previous Folder"), - QApplication::reverseLayout() ? "player_fwd":"player_rew", ALT + Key_BackSpace, - this,SLOT(slotSelectPreviousDir()), actionCollection, "previous_folder"); + TQApplication::reverseLayout() ? "player_fwd":"player_rew", ALT + Key_BackSpace, + TQT_TQOBJECT(this),TQT_SLOT(slotSelectPreviousDir()), actionCollection, "previous_folder"); mSelectNextDir=new KAction(i18n("&Next Folder"), - QApplication::reverseLayout() ? "player_rew":"player_fwd", ALT + Key_Space, - this,SLOT(slotSelectNextDir()), actionCollection, "next_folder"); + TQApplication::reverseLayout() ? "player_rew":"player_fwd", ALT + Key_Space, + TQT_TQOBJECT(this),TQT_SLOT(slotSelectNextDir()), actionCollection, "next_folder"); mSelectFirstSubDir=new KAction(i18n("&First Sub Folder"), "down", ALT + Key_Down, - this,SLOT(slotSelectFirstSubDir()), actionCollection, "first_sub_folder"); + TQT_TQOBJECT(this),TQT_SLOT(slotSelectFirstSubDir()), actionCollection, "first_sub_folder"); - mListMode=new KRadioAction(i18n("Details"),"view_detailed",0,this,SLOT(updateViewMode()),actionCollection,"list_mode"); + mListMode=new KRadioAction(i18n("Details"),"view_detailed",0,TQT_TQOBJECT(this),TQT_SLOT(updateViewMode()),actionCollection,"list_mode"); mListMode->setExclusiveGroup("thumbnails"); - mSideThumbnailMode=new KRadioAction(i18n("Thumbnails with Info on Side"),"view_multicolumn",0,this,SLOT(updateViewMode()),actionCollection,"side_thumbnail_mode"); + mSideThumbnailMode=new KRadioAction(i18n("Thumbnails with Info on Side"),"view_multicolumn",0,TQT_TQOBJECT(this),TQT_SLOT(updateViewMode()),actionCollection,"side_thumbnail_mode"); mSideThumbnailMode->setExclusiveGroup("thumbnails"); - mBottomThumbnailMode=new KRadioAction(i18n("Thumbnails with Info on Bottom"),"view_icon",0,this,SLOT(updateViewMode()),actionCollection,"bottom_thumbnail_mode"); + mBottomThumbnailMode=new KRadioAction(i18n("Thumbnails with Info on Bottom"),"view_icon",0,TQT_TQOBJECT(this),TQT_SLOT(updateViewMode()),actionCollection,"bottom_thumbnail_mode"); mBottomThumbnailMode->setExclusiveGroup("thumbnails"); // Size slider - mSizeSlider=new QSlider(Horizontal, d->mToolBar); + mSizeSlider=new TQSlider(Qt::Horizontal, d->mToolBar); mSizeSlider->setFixedWidth(120); mSizeSlider->setRange( ThumbnailSize::MIN/SLIDER_RESOLUTION, ThumbnailSize::LARGE/SLIDER_RESOLUTION); mSizeSlider->setValue(FileViewConfig::thumbnailSize() / SLIDER_RESOLUTION); - connect(mSizeSlider, SIGNAL(valueChanged(int)), this, SLOT(updateThumbnailSize(int)) ); - connect(mListMode, SIGNAL(toggled(bool)), mSizeSlider, SLOT(setDisabled(bool)) ); + connect(mSizeSlider, TQT_SIGNAL(valueChanged(int)), TQT_TQOBJECT(this), TQT_SLOT(updateThumbnailSize(int)) ); + connect(mListMode, TQT_SIGNAL(toggled(bool)), mSizeSlider, TQT_SLOT(setDisabled(bool)) ); KAction* sliderAction=new KWidgetAction(mSizeSlider, i18n("Thumbnail Size"), 0, 0, 0, actionCollection, "size_slider"); d->mSliderTracker=new TipTracker("", mSizeSlider); // /Size slider - mShowDotFiles=new KToggleAction(i18n("Show &Hidden Files"),CTRL + Key_H,this,SLOT(toggleShowDotFiles()),actionCollection,"show_dot_files"); + mShowDotFiles=new KToggleAction(i18n("Show &Hidden Files"),CTRL + Key_H,TQT_TQOBJECT(this),TQT_SLOT(toggleShowDotFiles()),actionCollection,"show_dot_files"); - d->mSortAction=new KSelectAction(i18n("Sort"), 0, this, SLOT(setSorting()), actionCollection, "view_sort"); - QStringList sortItems; + d->mSortAction=new KSelectAction(i18n("Sort"), 0, TQT_TQOBJECT(this), TQT_SLOT(setSorting()), actionCollection, "view_sort"); + TQStringList sortItems; sortItems << i18n("By Name") << i18n("By Date") << i18n("By Size"); d->mSortAction->setItems(sortItems); d->mSortAction->setCurrentItem(0); - d->mRevertSortAction=new KToggleAction(i18n("Descending"),0, this, SLOT(setSorting()), actionCollection, "descending"); - QPopupMenu* sortMenu=d->mSortAction->popupMenu(); + d->mRevertSortAction=new KToggleAction(i18n("Descending"),0, TQT_TQOBJECT(this), TQT_SLOT(setSorting()), actionCollection, "descending"); + TQPopupMenu* sortMenu=d->mSortAction->popupMenu(); Q_ASSERT(sortMenu); sortMenu->insertSeparator(); d->mRevertSortAction->plug(sortMenu); // Dir lister mDirLister=new DirLister; - mDirLister->setMainWindow(topLevelWidget()); - connect(mDirLister,SIGNAL(clear()), - this,SLOT(dirListerClear()) ); + mDirLister->setMainWindow(tqtopLevelWidget()); + connect(mDirLister,TQT_SIGNAL(clear()), + TQT_TQOBJECT(this),TQT_SLOT(dirListerClear()) ); - connect(mDirLister,SIGNAL(newItems(const KFileItemList&)), - this,SLOT(dirListerNewItems(const KFileItemList&)) ); + connect(mDirLister,TQT_SIGNAL(newItems(const KFileItemList&)), + TQT_TQOBJECT(this),TQT_SLOT(dirListerNewItems(const KFileItemList&)) ); - connect(mDirLister,SIGNAL(deleteItem(KFileItem*)), - this,SLOT(dirListerDeleteItem(KFileItem*)) ); + connect(mDirLister,TQT_SIGNAL(deleteItem(KFileItem*)), + TQT_TQOBJECT(this),TQT_SLOT(dirListerDeleteItem(KFileItem*)) ); - connect(mDirLister,SIGNAL(refreshItems(const KFileItemList&)), - this,SLOT(dirListerRefreshItems(const KFileItemList&)) ); + connect(mDirLister,TQT_SIGNAL(refreshItems(const KFileItemList&)), + TQT_TQOBJECT(this),TQT_SLOT(dirListerRefreshItems(const KFileItemList&)) ); - connect(mDirLister,SIGNAL(started(const KURL&)), - this,SLOT(dirListerStarted()) ); + connect(mDirLister,TQT_SIGNAL(started(const KURL&)), + TQT_TQOBJECT(this),TQT_SLOT(dirListerStarted()) ); - connect(mDirLister,SIGNAL(completed()), - this,SLOT(dirListerCompleted()) ); + connect(mDirLister,TQT_SIGNAL(completed()), + TQT_TQOBJECT(this),TQT_SLOT(dirListerCompleted()) ); - connect(mDirLister,SIGNAL(canceled()), - this,SLOT(dirListerCanceled()) ); + connect(mDirLister,TQT_SIGNAL(canceled()), + TQT_TQOBJECT(this),TQT_SLOT(dirListerCanceled()) ); // Propagate canceled signals - connect(mDirLister,SIGNAL(canceled()), - this,SIGNAL(canceled()) ); + connect(mDirLister,TQT_SIGNAL(canceled()), + this,TQT_SIGNAL(canceled()) ); // File detail widget mFileDetailView=new FileDetailView(d->mStack, "filedetailview"); d->mStack->addWidget(mFileDetailView,0); mFileDetailView->viewport()->installEventFilter(this); - connect(mFileDetailView,SIGNAL(executed(QListViewItem*)), - this,SLOT(slotViewExecuted()) ); - connect(mFileDetailView,SIGNAL(returnPressed(QListViewItem*)), - this,SLOT(slotViewExecuted()) ); - connect(mFileDetailView,SIGNAL(currentChanged(QListViewItem*)), - this,SLOT(slotViewClicked()) ); - connect(mFileDetailView,SIGNAL(selectionChanged()), - this,SLOT(slotViewClicked()) ); - connect(mFileDetailView,SIGNAL(clicked(QListViewItem*)), - this,SLOT(slotViewClicked()) ); - connect(mFileDetailView,SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), - this,SLOT(openContextMenu(KListView*, QListViewItem*, const QPoint&)) ); - connect(mFileDetailView,SIGNAL(dropped(QDropEvent*,KFileItem*)), - this,SLOT(openDropURLMenu(QDropEvent*, KFileItem*)) ); - connect(mFileDetailView, SIGNAL(sortingChanged(QDir::SortSpec)), - this, SLOT(updateSortMenu(QDir::SortSpec)) ); - connect(mFileDetailView, SIGNAL(doubleClicked(QListViewItem*)), - this, SLOT(slotViewDoubleClicked()) ); - connect(mFileDetailView, SIGNAL(selectionChanged()), - this, SIGNAL(selectionChanged()) ); + connect(mFileDetailView,TQT_SIGNAL(executed(TQListViewItem*)), + TQT_TQOBJECT(this),TQT_SLOT(slotViewExecuted()) ); + connect(mFileDetailView,TQT_SIGNAL(returnPressed(TQListViewItem*)), + TQT_TQOBJECT(this),TQT_SLOT(slotViewExecuted()) ); + connect(mFileDetailView,TQT_SIGNAL(currentChanged(TQListViewItem*)), + TQT_TQOBJECT(this),TQT_SLOT(slotViewClicked()) ); + connect(mFileDetailView,TQT_SIGNAL(selectionChanged()), + TQT_TQOBJECT(this),TQT_SLOT(slotViewClicked()) ); + connect(mFileDetailView,TQT_SIGNAL(clicked(TQListViewItem*)), + TQT_TQOBJECT(this),TQT_SLOT(slotViewClicked()) ); + connect(mFileDetailView,TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)), + TQT_TQOBJECT(this),TQT_SLOT(openContextMenu(KListView*, TQListViewItem*, const TQPoint&)) ); + connect(mFileDetailView,TQT_SIGNAL(dropped(TQDropEvent*,KFileItem*)), + TQT_TQOBJECT(this),TQT_SLOT(openDropURLMenu(TQDropEvent*, KFileItem*)) ); + connect(mFileDetailView, TQT_SIGNAL(sortingChanged(TQDir::SortSpec)), + this, TQT_SLOT(updateSortMenu(TQDir::SortSpec)) ); + connect(mFileDetailView, TQT_SIGNAL(doubleClicked(TQListViewItem*)), + this, TQT_SLOT(slotViewDoubleClicked()) ); + connect(mFileDetailView, TQT_SIGNAL(selectionChanged()), + this, TQT_SIGNAL(selectionChanged()) ); // Thumbnail widget mFileThumbnailView=new FileThumbnailView(d->mStack); d->mStack->addWidget(mFileThumbnailView,1); mFileThumbnailView->viewport()->installEventFilter(this); - connect(mFileThumbnailView,SIGNAL(executed(QIconViewItem*)), - this,SLOT(slotViewExecuted()) ); - connect(mFileThumbnailView,SIGNAL(returnPressed(QIconViewItem*)), - this,SLOT(slotViewExecuted()) ); - connect(mFileThumbnailView,SIGNAL(currentChanged(QIconViewItem*)), - this,SLOT(slotViewClicked()) ); - connect(mFileThumbnailView,SIGNAL(selectionChanged()), - this,SLOT(slotViewClicked()) ); - connect(mFileThumbnailView,SIGNAL(clicked(QIconViewItem*)), - this,SLOT(slotViewClicked()) ); - connect(mFileThumbnailView,SIGNAL(contextMenuRequested(QIconViewItem*,const QPoint&)), - this,SLOT(openContextMenu(QIconViewItem*,const QPoint&)) ); - connect(mFileThumbnailView,SIGNAL(dropped(QDropEvent*,KFileItem*)), - this,SLOT(openDropURLMenu(QDropEvent*, KFileItem*)) ); - connect(mFileThumbnailView, SIGNAL(doubleClicked(QIconViewItem*)), - this, SLOT(slotViewDoubleClicked()) ); - connect(mFileThumbnailView, SIGNAL(selectionChanged()), - this, SIGNAL(selectionChanged()) ); + connect(mFileThumbnailView,TQT_SIGNAL(executed(TQIconViewItem*)), + TQT_TQOBJECT(this),TQT_SLOT(slotViewExecuted()) ); + connect(mFileThumbnailView,TQT_SIGNAL(returnPressed(TQIconViewItem*)), + TQT_TQOBJECT(this),TQT_SLOT(slotViewExecuted()) ); + connect(mFileThumbnailView,TQT_SIGNAL(currentChanged(TQIconViewItem*)), + TQT_TQOBJECT(this),TQT_SLOT(slotViewClicked()) ); + connect(mFileThumbnailView,TQT_SIGNAL(selectionChanged()), + TQT_TQOBJECT(this),TQT_SLOT(slotViewClicked()) ); + connect(mFileThumbnailView,TQT_SIGNAL(clicked(TQIconViewItem*)), + TQT_TQOBJECT(this),TQT_SLOT(slotViewClicked()) ); + connect(mFileThumbnailView,TQT_SIGNAL(contextMenuRequested(TQIconViewItem*,const TQPoint&)), + TQT_TQOBJECT(this),TQT_SLOT(openContextMenu(TQIconViewItem*,const TQPoint&)) ); + connect(mFileThumbnailView,TQT_SIGNAL(dropped(TQDropEvent*,KFileItem*)), + TQT_TQOBJECT(this),TQT_SLOT(openDropURLMenu(TQDropEvent*, KFileItem*)) ); + connect(mFileThumbnailView, TQT_SIGNAL(doubleClicked(TQIconViewItem*)), + this, TQT_SLOT(slotViewDoubleClicked()) ); + connect(mFileThumbnailView, TQT_SIGNAL(selectionChanged()), + this, TQT_SIGNAL(selectionChanged()) ); // Thumbnail details dialog - KAction* thumbnailDetailsDialogAction=new KAction(i18n("Edit Thumbnail Details..."), "configure", 0, mFileThumbnailView, SLOT(showThumbnailDetailsDialog()), actionCollection, "thumbnail_details_dialog"); - connect(mBottomThumbnailMode, SIGNAL(toggled(bool)), - thumbnailDetailsDialogAction, SLOT(setEnabled(bool)) ); + KAction* thumbnailDetailsDialogAction=new KAction(i18n("Edit Thumbnail Details..."), "configure", 0, TQT_TQOBJECT(mFileThumbnailView), TQT_SLOT(showThumbnailDetailsDialog()), actionCollection, "thumbnail_details_dialog"); + connect(mBottomThumbnailMode, TQT_SIGNAL(toggled(bool)), + thumbnailDetailsDialogAction, TQT_SLOT(setEnabled(bool)) ); // Fill toolbar mListMode->plug(d->mToolBar); @@ -438,7 +438,7 @@ FileViewController::FileViewController(QWidget* parent,KActionCollection* action mSizeSlider->setEnabled(startWithThumbnails); if (startWithThumbnails) { - if (mFileThumbnailView->itemTextPos()==QIconView::Right) { + if (mFileThumbnailView->itemTextPos()==TQIconView::Right) { mSideThumbnailMode->setChecked(true); } else { mBottomThumbnailMode->setChecked(true); @@ -485,11 +485,11 @@ void FileViewController::setFocus() { * Do not let double click events propagate if Ctrl or Shift is down, to avoid * toggling fullscreen */ -bool FileViewController::eventFilter(QObject*, QEvent* event) { - if (event->type()!=QEvent::MouseButtonDblClick) return false; +bool FileViewController::eventFilter(TQObject*, TQEvent* event) { + if (event->type()!=TQEvent::MouseButtonDblClick) return false; - QMouseEvent* mouseEvent=static_cast<QMouseEvent*>(event); - if (mouseEvent->state() & Qt::ControlButton || mouseEvent->state() & Qt::ShiftButton) { + TQMouseEvent* mouseEvent=TQT_TQMOUSEEVENT(event); + if (mouseEvent->state() & TQt::ControlButton || mouseEvent->state() & TQt::ShiftButton) { return true; } return false; @@ -521,7 +521,7 @@ void FileViewController::setDirURL(const KURL& url) { mDirLister->clearError(); currentFileView()->setShownFileItem(0L); - mFileNameToSelect=QString::null; + mFileNameToSelect=TQString(); mDirLister->openURL(mDirURL); emit urlChanged(mDirURL); emit directoryChanged(mDirURL); @@ -533,7 +533,7 @@ void FileViewController::setDirURL(const KURL& url) { * Sets the file to select once the dir lister is done. If it's not running, * immediatly selects the file. */ -void FileViewController::setFileNameToSelect(const QString& fileName) { +void FileViewController::setFileNameToSelect(const TQString& fileName) { mFileNameToSelect=fileName; if (mDirLister->isFinished()) { browseToFileNameToSelect(); @@ -543,13 +543,13 @@ void FileViewController::setFileNameToSelect(const QString& fileName) { void FileViewController::prefetch( KFileItem* item ) { prefetchDone(); if( item == NULL ) return; - mPrefetch = ImageLoader::loader( item->url(), this, BUSY_PRELOADING ); - connect( mPrefetch, SIGNAL( imageLoaded( bool )), SLOT( prefetchDone())); + mPrefetch = ImageLoader::loader( item->url(), TQT_TQOBJECT(this), BUSY_PRELOADING ); + connect( mPrefetch, TQT_SIGNAL( imageLoaded( bool )), TQT_SLOT( prefetchDone())); } void FileViewController::prefetchDone() { if( mPrefetch != NULL ) { - mPrefetch->release( this ); + mPrefetch->release( TQT_TQOBJECT(this) ); mPrefetch = NULL; } } @@ -575,13 +575,13 @@ void FileViewController::slotSelectNext() { } void FileViewController::slotSelectPreviousDir() { - mChangeDirStatus = CHANGE_DIR_STATUS_PREV; + mChangeDirtqStatus = CHANGE_DIR_STATUS_PREV; mDirLister->clearError(); mDirLister->openURL(mDirURL.upURL()); } void FileViewController::slotSelectNextDir() { - mChangeDirStatus = CHANGE_DIR_STATUS_NEXT; + mChangeDirtqStatus = CHANGE_DIR_STATUS_NEXT; mDirLister->clearError(); mDirLister->openURL(mDirURL.upURL()); } @@ -611,12 +611,12 @@ void FileViewController::resetNameFilter() { void FileViewController::resetFromFilter() { - d->mFilterBar->mFromDateEdit->setDate(QDate()); + d->mFilterBar->mFromDateEdit->setDate(TQDate()); } void FileViewController::resetToFilter() { - d->mFilterBar->mToDateEdit->setDate(QDate()); + d->mFilterBar->mToDateEdit->setDate(TQDate()); } @@ -642,7 +642,7 @@ void FileViewController::browseToFileNameToSelect() { // There's something to select if (!mFileNameToSelect.isEmpty()) { browseTo(findItemByFileName(mFileNameToSelect)); - mFileNameToSelect=QString::null; + mFileNameToSelect=TQString(); return; } @@ -722,9 +722,9 @@ void FileViewController::updateViewMode() { return; } if (mSideThumbnailMode->isChecked()) { - mFileThumbnailView->setItemTextPos(QIconView::Right); + mFileThumbnailView->setItemTextPos(TQIconView::Right); } else { - mFileThumbnailView->setItemTextPos(QIconView::Bottom); + mFileThumbnailView->setItemTextPos(TQIconView::Bottom); } // Only switch the view if we are going from no thumbs to either side or @@ -747,7 +747,7 @@ void FileViewController::updateViewMode() { void FileViewController::updateThumbnailSize(int size) { size*=SLIDER_RESOLUTION; - d->mSliderTracker->setText(i18n("Thumbnail size: %1x%2").arg(size).arg(size)); + d->mSliderTracker->setText(i18n("Thumbnail size: %1x%2").tqarg(size).tqarg(size)); FileViewConfig::setThumbnailSize(size); mFileThumbnailView->setThumbnailSize(size); Cache::instance()->checkThumbnailSize(size); @@ -760,17 +760,17 @@ void FileViewController::toggleShowDotFiles() { } -void FileViewController::updateSortMenu(QDir::SortSpec _spec) { - int spec=_spec & (QDir::Name | QDir::Time | QDir::Size); +void FileViewController::updateSortMenu(TQDir::SortSpec _spec) { + int spec=_spec & (TQDir::Name | TQDir::Time | TQDir::Size); int item; switch (spec) { - case QDir::Name: + case TQDir::Name: item=0; break; - case QDir::Time: + case TQDir::Time: item=1; break; - case QDir::Size: + case TQDir::Size: item=2; break; default: @@ -782,25 +782,25 @@ void FileViewController::updateSortMenu(QDir::SortSpec _spec) { void FileViewController::setSorting() { - QDir::SortSpec spec; + TQDir::SortSpec spec; switch (d->mSortAction->currentItem()) { case 0: // Name - spec=QDir::Name; + spec=TQDir::Name; break; case 1: // Date - spec=QDir::Time; + spec=TQDir::Time; break; case 2: // Size - spec=QDir::Size; + spec=TQDir::Size; break; default: return; } if (d->mRevertSortAction->isChecked()) { - spec=QDir::SortSpec(spec | QDir::Reversed); + spec=TQDir::SortSpec(spec | TQDir::Reversed); } - currentFileView()->setSorting(QDir::SortSpec(spec | QDir::DirsFirst)); + currentFileView()->setSorting(TQDir::SortSpec(spec | TQDir::DirsFirst)); emit sortingChanged(); } @@ -810,12 +810,12 @@ void FileViewController::setSorting() { // Context menu // //----------------------------------------------------------------------- -void FileViewController::openContextMenu(KListView*,QListViewItem* item,const QPoint& pos) { +void FileViewController::openContextMenu(KListView*,TQListViewItem* item,const TQPoint& pos) { emit requestContextMenu(pos, item!=0); } -void FileViewController::openContextMenu(QIconViewItem* item,const QPoint& pos) { +void FileViewController::openContextMenu(TQIconViewItem* item,const TQPoint& pos) { emit requestContextMenu(pos, item!=0); } @@ -825,7 +825,7 @@ void FileViewController::openContextMenu(QIconViewItem* item,const QPoint& pos) // Drop URL menu // //----------------------------------------------------------------------- -void FileViewController::openDropURLMenu(QDropEvent* event, KFileItem* item) { +void FileViewController::openDropURLMenu(TQDropEvent* event, KFileItem* item) { KURL dest; if (item) { @@ -884,7 +884,7 @@ KURL::List FileViewController::selectedImageURLs() const { // Properties // //----------------------------------------------------------------------- -QString FileViewController::fileName() const { +TQString FileViewController::fileName() const { KFileItem* item=currentFileView()->currentFileItem(); if (!item) return ""; return item->text(); @@ -1064,7 +1064,7 @@ void FileViewController::refreshItems(const KURL::List& urls) { it != urls.end(); ++it ) { KURL dir = *it; - dir.setFileName( QString::null ); + dir.setFileName( TQString() ); if( dir != mDirURL ) continue; // TODO this could be quite slow for many images? KFileItem* item = findItemByFileName( (*it).filename()); @@ -1089,7 +1089,7 @@ void FileViewController::dirListerCompleted() { LOG(""); // Delay the code to be executed when the dir lister has completed its job // to avoid crash in KDirLister (see bug #57991) - QTimer::singleShot(0,this,SLOT(delayedDirListerCompleted())); + TQTimer::singleShot(0,TQT_TQOBJECT(this),TQT_SLOT(delayedDirListerCompleted())); } @@ -1102,12 +1102,12 @@ void FileViewController::delayedDirListerCompleted() { mFileThumbnailView->sort(mFileThumbnailView->sortDirection()); } - if (mChangeDirStatus != CHANGE_DIR_STATUS_NONE) { + if (mChangeDirtqStatus != CHANGE_DIR_STATUS_NONE) { KFileItem *item; - QString fileName = mDirURL.filename(); + TQString fileName = mDirURL.filename(); for (item=currentFileView()->firstFileItem(); item; item=currentFileView()->nextItem(item) ) { if (item->name() == fileName) { - if (mChangeDirStatus == CHANGE_DIR_STATUS_NEXT) { + if (mChangeDirtqStatus == CHANGE_DIR_STATUS_NEXT) { do { item=currentFileView()->nextItem(item); } while (item && !Archive::fileItemIsDirOrArchive(item)); @@ -1119,7 +1119,7 @@ void FileViewController::delayedDirListerCompleted() { break; }; } - mChangeDirStatus = CHANGE_DIR_STATUS_NONE; + mChangeDirtqStatus = CHANGE_DIR_STATUS_NONE; if (!item) { mDirLister->openURL(mDirURL); } else { @@ -1161,23 +1161,23 @@ void FileViewController::setFilterMode(int mode) { } -void FileViewController::setFilterName(const QString& name) { +void FileViewController::setFilterName(const TQString& name) { d->mFilterBar->mNameEdit->setText(name); } -void FileViewController::setFilterFromDate(const QDate& date) { +void FileViewController::setFilterFromDate(const TQDate& date) { d->mFilterBar->mFromDateEdit->setDate(date); } -void FileViewController::setFilterToDate(const QDate& date) { +void FileViewController::setFilterToDate(const TQDate& date) { d->mFilterBar->mToDateEdit->setDate(date); } void FileViewController::applyFilter() { - QStringList mimeTypes; + TQStringList mimeTypes; FilterMode filterMode = static_cast<FilterMode>( d->mFilterComboBox->currentItem() ); if (FileViewConfig::showDirs()) { @@ -1195,15 +1195,15 @@ void FileViewController::applyFilter() { } if (d->mShowFilterBarCheckBox->isChecked()) { - QString txt=d->mFilterBar->mNameEdit->text(); - QDate from=d->mFilterBar->mFromDateEdit->date(); - QDate to=d->mFilterBar->mToDateEdit->date(); + TQString txt=d->mFilterBar->mNameEdit->text(); + TQDate from=d->mFilterBar->mFromDateEdit->date(); + TQDate to=d->mFilterBar->mToDateEdit->date(); mDirLister->setNameFilter(txt); mDirLister->setDateFilter(from, to); } else { - mDirLister->setNameFilter(QString::null); - mDirLister->setDateFilter(QDate(), QDate()); + mDirLister->setNameFilter(TQString()); + mDirLister->setDateFilter(TQDate(), TQDate()); } mDirLister->setShowingDotFiles(mShowDotFiles->isChecked()); @@ -1305,7 +1305,7 @@ KFileItem* FileViewController::findNextImage() const { return item; } -KFileItem* FileViewController::findItemByFileName(const QString& fileName) const { +KFileItem* FileViewController::findItemByFileName(const TQString& fileName) const { KFileItem *item; if (fileName.isEmpty()) return 0L; for (item=currentFileView()->firstFileItem(); diff --git a/src/gvcore/fileviewcontroller.h b/src/gvcore/fileviewcontroller.h index 81d1269..8aae0d0 100644 --- a/src/gvcore/fileviewcontroller.h +++ b/src/gvcore/fileviewcontroller.h @@ -21,10 +21,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef FILEVIEWCONTROLLER_H #define FILEVIEWCONTROLLER_H -// Qt -#include <qdir.h> -#include <qslider.h> -#include <qwidget.h> +// TQt +#include <tqdir.h> +#include <tqslider.h> +#include <tqwidget.h> // KDE #include <kdirlister.h> @@ -33,9 +33,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <kurl.h> #include "libgwenview_export.h" -class QIconViewItem; -class QListViewItem; -class QPopupMenu; +class TQIconViewItem; +class TQListViewItem; +class TQPopupMenu; class KAccel; class KAction; @@ -54,20 +54,21 @@ class ImageLoader; class DirLister; -class LIBGWENVIEW_EXPORT FileViewController : public QWidget { +class LIBGWENVIEW_EXPORT FileViewController : public TQWidget { Q_OBJECT + TQ_OBJECT public: enum Mode { FILE_LIST, THUMBNAIL}; enum FilterMode { ALL, IMAGES_ONLY, VIDEOS_ONLY }; - FileViewController(QWidget* parent,KActionCollection*); + FileViewController(TQWidget* tqparent,KActionCollection*); ~FileViewController(); // Properties void setMode(Mode); - QString fileName() const; + TQString fileName() const; KURL url() const; KURL dirURL() const; uint fileCount() const; @@ -112,7 +113,7 @@ public: public slots: void setDirURL(const KURL&); - void setFileNameToSelect(const QString&); + void setFileNameToSelect(const TQString&); void slotSelectFirst(); void slotSelectLast(); @@ -129,9 +130,9 @@ public slots: void setShowFilterBar(bool); // 'int' suck, but I don't want to #include fileviewconfig.h void setFilterMode(int); - void setFilterName(const QString&); - void setFilterFromDate(const QDate&); - void setFilterToDate(const QDate&); + void setFilterName(const TQString&); + void setFilterFromDate(const TQDate&); + void setFilterToDate(const TQDate&); void applyFilter(); signals: @@ -147,7 +148,7 @@ signals: void imageDoubleClicked(); void shownFileItemRefreshed(const KFileItem*); void sortingChanged(); - void requestContextMenu(const QPoint& pos, bool onItem); + void requestContextMenu(const TQPoint& pos, bool onItem); private slots: void delayedDirListerCompleted(); @@ -161,9 +162,9 @@ private slots: void slotViewDoubleClicked(); // These two methods forward the context menu requests from either view to - // openContextMenu(const QPoint&); - void openContextMenu(KListView*, QListViewItem*, const QPoint&); - void openContextMenu(QIconViewItem*,const QPoint&); + // openContextMenu(const TQPoint&); + void openContextMenu(KListView*, TQListViewItem*, const TQPoint&); + void openContextMenu(TQIconViewItem*,const TQPoint&); // Get called by the thumbnail mode actions void updateViewMode(); @@ -173,7 +174,7 @@ private slots: void toggleShowDotFiles(); void setSorting(); - void updateSortMenu(QDir::SortSpec); + void updateSortMenu(TQDir::SortSpec); // Dir lister slots void dirListerDeleteItem(KFileItem* item); @@ -184,7 +185,7 @@ private slots: void dirListerCanceled(); void dirListerCompleted(); - void openDropURLMenu(QDropEvent*, KFileItem*); + void openDropURLMenu(TQDropEvent*, KFileItem*); void prefetchDone(); @@ -215,18 +216,18 @@ private: KRadioAction* mSideThumbnailMode; KRadioAction* mBottomThumbnailMode; - QSlider* mSizeSlider; + TQSlider* mSizeSlider; KToggleAction* mShowDotFiles; // Temp data used by the dir lister bool mThumbnailsNeedUpdate; - QString mFileNameToSelect; + TQString mFileNameToSelect; enum ChangeDirStatusVals { CHANGE_DIR_STATUS_NONE, CHANGE_DIR_STATUS_PREV, CHANGE_DIR_STATUS_NEXT - } mChangeDirStatus; + } mChangeDirtqStatus; bool mBrowsing; bool mSelecting; @@ -245,9 +246,9 @@ private: KFileItem* findLastImage() const; KFileItem* findPreviousImage() const; KFileItem* findNextImage() const; - KFileItem* findItemByFileName(const QString& fileName) const; + KFileItem* findItemByFileName(const TQString& fileName) const; - bool eventFilter(QObject*, QEvent*); + bool eventFilter(TQObject*, TQEvent*); }; diff --git a/src/gvcore/filterbar.ui b/src/gvcore/filterbar.ui index 461e9f7..5b33bed 100644 --- a/src/gvcore/filterbar.ui +++ b/src/gvcore/filterbar.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>FilterBar</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>FilterBar</cstring> </property> - <property name="geometry"> + <property name="tqgeometry"> <rect> <x>0</x> <y>0</y> @@ -27,7 +27,7 @@ <property name="margin"> <number>3</number> </property> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>mResetNameCombo</cstring> </property> @@ -64,14 +64,14 @@ <property name="sizeType"> <enum>Maximum</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>16</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>mResetFrom</cstring> </property> @@ -87,7 +87,7 @@ <string></string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -106,7 +106,7 @@ <cstring>mFromDateEdit</cstring> </property> </widget> - <widget class="QDateEdit"> + <widget class="TQDateEdit"> <property name="name"> <cstring>mFromDateEdit</cstring> </property> @@ -125,14 +125,14 @@ equal to this date</string> <property name="sizeType"> <enum>Maximum</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>16</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>mResetTo</cstring> </property> @@ -148,7 +148,7 @@ equal to this date</string> <string></string> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -167,7 +167,7 @@ equal to this date</string> <cstring>mToDateEdit</cstring> </property> </widget> - <widget class="QDateEdit"> + <widget class="TQDateEdit"> <property name="name"> <cstring>mToDateEdit</cstring> </property> @@ -185,14 +185,14 @@ equal to this date</string> <property name="sizeType"> <enum>Maximum</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>16</height> </size> </property> </spacer> - <widget class="QPushButton"> + <widget class="TQPushButton"> <property name="name"> <cstring>mFilterButton</cstring> </property> @@ -210,7 +210,7 @@ equal to this date</string> <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>16</height> @@ -251,5 +251,5 @@ equal to this date</string> <tabstop>mToDateEdit</tabstop> <tabstop>mFilterButton</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/src/gvcore/fullscreenbar.cpp b/src/gvcore/fullscreenbar.cpp index bd3b3de..46f0af8 100644 --- a/src/gvcore/fullscreenbar.cpp +++ b/src/gvcore/fullscreenbar.cpp @@ -18,12 +18,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Qt -#include <qbitmap.h> -#include <qevent.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qtimer.h> +// TQt +#include <tqbitmap.h> +#include <tqevent.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqtimer.h> // KDE #include <kdebug.h> @@ -42,7 +42,7 @@ const int SLIDE_OUT_INTERVAL = 12; const int SLIDE_STEP = 4; -static void fillMask(QPainter& painter, const QRect& rect) { +static void fillMask(TQPainter& painter, const TQRect& rect) { painter.fillRect( rect.left(), rect.top(), @@ -69,31 +69,31 @@ enum BarState { OUT, SLIDING_OUT, SLIDING_IN, IN }; struct FullScreenBar::Private { - QTimer mTimer; + TQTimer mTimer; BarState mState; bool mFirstShow; }; -FullScreenBar::FullScreenBar(QWidget* parent) -: KToolBar(parent, "FullScreenBar") { +FullScreenBar::FullScreenBar(TQWidget* tqparent) +: KToolBar(tqparent, "FullScreenBar") { d=new Private; d->mState=OUT; d->mFirstShow=true; setIconSize(FULLSCREEN_ICON_SIZE); setMovingEnabled(false); - QColor bg=colorGroup().highlight(); - QColor fg=colorGroup().highlightedText(); - QPalette pal(palette()); - pal.setColor(QColorGroup::Background, bg); - pal.setColor(QColorGroup::Foreground, fg); - pal.setColor(QColorGroup::Button, bg); - pal.setColor(QColorGroup::ButtonText, fg); + TQColor bg=tqcolorGroup().highlight(); + TQColor fg=tqcolorGroup().highlightedText(); + TQPalette pal(palette()); + pal.setColor(TQColorGroup::Background, bg); + pal.setColor(TQColorGroup::Foreground, fg); + pal.setColor(TQColorGroup::Button, bg); + pal.setColor(TQColorGroup::ButtonText, fg); setPalette(pal); // Timer - connect(&d->mTimer, SIGNAL(timeout()), this, SLOT(slotUpdateSlide()) ); + connect(&d->mTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotUpdateSlide()) ); } @@ -102,28 +102,28 @@ FullScreenBar::~FullScreenBar() { } -void FullScreenBar::resizeEvent(QResizeEvent* event) { +void FullScreenBar::resizeEvent(TQResizeEvent* event) { KToolBar::resizeEvent(event); - // Create a mask - QPainter painter; - QBitmap mask(size(), true); - painter.begin(&mask); - painter.setBrush(Qt::white); + // Create a tqmask + TQPainter painter; + TQBitmap tqmask(size(), true); + painter.begin(&tqmask); + painter.setBrush(TQt::white); fillMask(painter, rect()); painter.end(); - setMask(mask); + setMask(tqmask); } -void FullScreenBar::showEvent(QShowEvent* event) { +void FullScreenBar::showEvent(TQShowEvent* event) { KToolBar::showEvent(event); // Make sure the bar position corresponds to the OUT state if (!d->mFirstShow) return; d->mFirstShow=false; move(0, -height()); - layout()->setResizeMode(QLayout::Fixed); + tqlayout()->setResizeMode(TQLayout::Fixed); } diff --git a/src/gvcore/fullscreenbar.h b/src/gvcore/fullscreenbar.h index 8322aa4..729b69c 100644 --- a/src/gvcore/fullscreenbar.h +++ b/src/gvcore/fullscreenbar.h @@ -25,23 +25,24 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // KDE #include <ktoolbar.h> -class QResizeEvent; -class QShowEvent; -class QString; +class TQResizeEvent; +class TQShowEvent; +class TQString; namespace Gwenview { class FullScreenBar : public KToolBar { Q_OBJECT + TQ_OBJECT public: - FullScreenBar(QWidget* parent); + FullScreenBar(TQWidget* tqparent); ~FullScreenBar(); void slideIn(); void slideOut(); protected: - virtual void resizeEvent(QResizeEvent*); - virtual void showEvent(QShowEvent*); + virtual void resizeEvent(TQResizeEvent*); + virtual void showEvent(TQShowEvent*); private slots: void slotUpdateSlide(); diff --git a/src/gvcore/gimp.h b/src/gvcore/gimp.h index b93b491..552916b 100644 --- a/src/gvcore/gimp.h +++ b/src/gvcore/gimp.h @@ -1,6 +1,6 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* -*- c++ -*- - * gimp.h: Header for a Qt 3 plug-in for reading GIMP XCF image files + * gimp.h: Header for a TQt 3 plug-in for reading GIMP XCF image files * Copyright (C) 2001 lignum Computing, Inc. <allen@lignumcomputing.com> * * This plug-in is free software; you can redistribute it and/or @@ -42,9 +42,9 @@ const uchar OPAQUE_OPACITY = 255; //!< Opaque value for 8-bit alpha component. // From GIMP "apptypes.h" v1.2 -//! Basic GIMP image type. QImage converter may produce a deeper image +//! Basic GIMP image type. TQImage converter may produce a deeper image //! than is specified here. For example, a grayscale image with an -//! alpha channel must (currently) use a 32-bit Qt image. +//! alpha channel must (currently) use a 32-bit TQt image. typedef enum { diff --git a/src/gvcore/imageframe.h b/src/gvcore/imageframe.h index 13d4854..1ff3c33 100644 --- a/src/gvcore/imageframe.h +++ b/src/gvcore/imageframe.h @@ -21,21 +21,21 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef IMAGEFRAME_H #define IMAGEFRAME_H -// Qt -#include <qimage.h> -#include <qvaluevector.h> +// TQt +#include <tqimage.h> +#include <tqvaluevector.h> namespace Gwenview { // Local struct ImageFrame { - ImageFrame( const QImage& i, int d ) : image( i ), delay( d ) {}; - ImageFrame() : delay( 0 ) {} // stupid Qt containers - QImage image; + ImageFrame( const TQImage& i, int d ) : image( i ), delay( d ) {}; + ImageFrame() : delay( 0 ) {} // stupid TQt containers + TQImage image; int delay; // how long this frame should be shown in the animation }; -typedef QValueVector< ImageFrame > ImageFrames; +typedef TQValueVector< ImageFrame > ImageFrames; } // namespace #endif /* IMAGEFRAME_H */ diff --git a/src/gvcore/imageloader.cpp b/src/gvcore/imageloader.cpp index 8cbc442..c14de6e 100644 --- a/src/gvcore/imageloader.cpp +++ b/src/gvcore/imageloader.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -23,9 +23,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <assert.h> -// Qt -#include <qtimer.h> -#include <qwmatrix.h> +// TQt +#include <tqtimer.h> +#include <tqwmatrix.h> // KDE #include <kapplication.h> @@ -64,59 +64,59 @@ const int IMAGE_UPDATE_INTERVAL=100; #define LOG2(x) ; #endif -static QMap< KURL, ImageLoader* > sLoaders; +static TQMap< KURL, ImageLoader* > sLoaders; //--------------------------------------------------------------------- // // CancellableBuffer -// This class acts like QBuffer, but will simulates a truncated file if the +// This class acts like TQBuffer, but will simulates a truncated file if the // TSThread which was passed to its constructor has been asked for cancellation // //--------------------------------------------------------------------- -class CancellableBuffer : public QBuffer { +class CancellableBuffer : public TQBuffer { public: - CancellableBuffer(QByteArray buffer, TSThread* thread) - : QBuffer(buffer), mThread(thread) {} + CancellableBuffer(TQByteArray buffer, TSThread* thread) + : TQBuffer(buffer), mThread(thread) {} bool atEnd() const { if (mThread->testCancel()) { LOG("cancel detected"); return true; } - return QBuffer::atEnd(); + return TQBuffer::atEnd(); } - Q_LONG readBlock(char * data, Q_ULONG maxlen) { + TQ_LONG readBlock(char * data, TQ_ULONG maxlen) { if (mThread->testCancel()) { LOG("cancel detected"); return 0; } - return QBuffer::readBlock(data, maxlen); + return TQBuffer::readBlock(data, maxlen); } - Q_LONG readLine(char * data, Q_ULONG maxlen) { + TQ_LONG readLine(char * data, TQ_ULONG maxlen) { if (mThread->testCancel()) { LOG("cancel detected"); return 0; } - return QBuffer::readLine(data, maxlen); + return TQBuffer::readLine(data, maxlen); } - QByteArray readAll() { + TQByteArray readAll() { if (mThread->testCancel()) { LOG("cancel detected"); - return QByteArray(); + return TQByteArray(); } - return QBuffer::readAll(); + return TQBuffer::readAll(); } int getch() { if (mThread->testCancel()) { LOG("cancel detected"); - setStatus(IO_ReadError); + setqStatus(IO_ReadError); return -1; } - return QBuffer::getch(); + return TQBuffer::getch(); } private: @@ -130,17 +130,17 @@ private: // //--------------------------------------------------------------------- void DecoderThread::run() { - QMutexLocker locker(&mMutex); + TQMutexLocker locker(&mMutex); LOG(""); // This block makes sure imageIO won't access the image after the signal // has been posted { - QImageIO imageIO; + TQImageIO imageIO; CancellableBuffer buffer(mRawData, this); buffer.open(IO_ReadOnly); - imageIO.setIODevice(&buffer); + imageIO.setIODevice(TQT_TQIODEVICE(&buffer)); bool ok=imageIO.read(); if (testCancel()) { LOG("cancelled"); @@ -149,7 +149,7 @@ void DecoderThread::run() { if (!ok) { LOG("failed"); - postSignal( this, SIGNAL(failed()) ); + postSignal( this, TQT_SIGNAL(failed()) ); return; } @@ -158,20 +158,20 @@ void DecoderThread::run() { } LOG("succeeded, emitting signal"); - postSignal( this, SIGNAL(succeeded()) ); + postSignal( this, TQT_SIGNAL(succeeded()) ); } -void DecoderThread::setRawData(const QByteArray& data) { - QMutexLocker locker(&mMutex); +void DecoderThread::setRawData(const TQByteArray& data) { + TQMutexLocker locker(&mMutex); mRawData=data.copy(); } -QImage DecoderThread::popLoadedImage() { - QMutexLocker locker(&mMutex); - QImage img=mImage; - mImage=QImage(); +TQImage DecoderThread::popLoadedImage() { + TQMutexLocker locker(&mMutex); + TQImage img=mImage; + mImage=TQImage(); return img; } @@ -183,7 +183,7 @@ QImage DecoderThread::popLoadedImage() { // //--------------------------------------------------------------------- struct OwnerData { - const QObject* owner; + const TQObject* owner; BusyLevel priority; }; @@ -229,24 +229,24 @@ public: KURL mURL; // The file timestamp - QDateTime mTimestamp; + TQDateTime mTimestamp; // The raw data we get - QByteArray mRawData; + TQByteArray mRawData; // The async decoder and it's waking timer - QImageDecoder mDecoder; - QTimer mDecoderTimer; + TQImageDecoder mDecoder; + TQTimer mDecoderTimer; // The decoder thread DecoderThread mDecoderThread; // A rect of recently loaded pixels that the rest of the application has // not been notified about with the imageChanged() signal - QRect mLoadChangedRect; + TQRect mLoadChangedRect; // The time since we last emitted the imageChanged() signal - QTime mTimeSinceLastUpdate; + TQTime mTimeSinceLastUpdate; // Whether the loading should be suspended bool mSuspended; @@ -256,27 +256,27 @@ public: bool mWasFrameData; - QImage mProcessedImage; // image frame currently being decoded + TQImage mProcessedImage; // image frame currently being decoded - QRegion mLoadedRegion; // loaded parts of mProcessedImage + TQRegion mLoadedRegion; // loaded parts of mProcessedImage ImageFrames mFrames; - QCString mImageFormat; + TQCString mImageFormat; ImageUtils::Orientation mOrientation; - QString mMimeType; + TQString mMimeType; MimeTypeUtils::Kind mURLKind; - QValueVector< OwnerData > mOwners; // loaders may be shared + TQValueVector< OwnerData > mOwners; // loaders may be shared void determineImageFormat() { Q_ASSERT(mRawData.size()>0); - QBuffer buffer(mRawData); + TQBuffer buffer(mRawData); buffer.open(IO_ReadOnly); - mImageFormat = QImageIO::imageFormat(&buffer); + mImageFormat = TQImageIO::imageFormat(TQT_TQIODEVICE(&buffer)); } }; @@ -289,8 +289,8 @@ public: ImageLoader::ImageLoader() { LOG(""); d = new ImageLoaderPrivate(this); - connect( BusyLevelManager::instance(), SIGNAL( busyLevelChanged(BusyLevel)), - this, SLOT( slotBusyLevelChanged(BusyLevel))); + connect( BusyLevelManager::instance(), TQT_SIGNAL( busyLevelChanged(BusyLevel)), + this, TQT_SLOT( slotBusyLevelChanged(BusyLevel))); } @@ -313,12 +313,12 @@ void ImageLoader::startLoading() { d->mTimestamp = Cache::instance()->timestamp( d->mURL ); slotBusyLevelChanged( BusyLevelManager::instance()->busyLevel()); - connect(&d->mDecoderTimer, SIGNAL(timeout()), this, SLOT(decodeChunk()) ); + connect(&d->mDecoderTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(decodeChunk()) ); - connect(&d->mDecoderThread, SIGNAL(succeeded()), - this, SLOT(slotDecoderThreadSucceeded()) ); - connect(&d->mDecoderThread, SIGNAL(failed()), - this, SLOT(slotDecoderThreadFailed()) ); + connect(&d->mDecoderThread, TQT_SIGNAL(succeeded()), + this, TQT_SLOT(slotDecoderThreadSucceeded()) ); + connect(&d->mDecoderThread, TQT_SIGNAL(failed()), + this, TQT_SLOT(slotDecoderThreadFailed()) ); checkPendingStat(); } @@ -328,8 +328,8 @@ void ImageLoader::checkPendingStat() { KIO::Job* job=KIO::stat( d->mURL, false ); job->setWindow(KApplication::kApplication()->mainWidget()); - connect(job, SIGNAL(result(KIO::Job*)), - this, SLOT(slotStatResult(KIO::Job*)) ); + connect(job, TQT_SIGNAL(result(KIO::Job*)), + this, TQT_SLOT(slotStatResult(KIO::Job*)) ); d->mGetState = GET_STATING; } @@ -339,7 +339,7 @@ void ImageLoader::slotStatResult(KIO::Job* job) { // Get modification time of the original file KIO::UDSEntry entry = static_cast<KIO::StatJob*>(job)->statResult(); KIO::UDSEntry::ConstIterator it= entry.begin(); - QDateTime urlTimestamp; + TQDateTime urlTimestamp; for (; it!=entry.end(); it++) { if ((*it).m_uds == KIO::UDS_MODIFICATION_TIME) { urlTimestamp.setTime_t( (*it).m_long ); @@ -395,11 +395,11 @@ void ImageLoader::checkPendingGet() { KIO::Job* getJob=KIO::get( d->mURL, false, false); getJob->setWindow(KApplication::kApplication()->mainWidget()); - connect(getJob, SIGNAL(data(KIO::Job*, const QByteArray&)), - this, SLOT(slotDataReceived(KIO::Job*, const QByteArray&)) ); + connect(getJob, TQT_SIGNAL(data(KIO::Job*, const TQByteArray&)), + this, TQT_SLOT(slotDataReceived(KIO::Job*, const TQByteArray&)) ); - connect(getJob, SIGNAL(result(KIO::Job*)), - this, SLOT(slotGetResult(KIO::Job*)) ); + connect(getJob, TQT_SIGNAL(result(KIO::Job*)), + this, TQT_SLOT(slotGetResult(KIO::Job*)) ); d->mTimeSinceLastUpdate.start(); d->mGetState = GET_GETTING; @@ -441,15 +441,15 @@ void ImageLoader::slotGetResult(KIO::Job* job) { // There is no way in KImageIO to get the mimeType from the image format. // This function assumes KImageIO::types and KImageIO::mimeTypes return items // in the same order (which they do, according to the source code). -static QString mimeTypeFromFormat(const char* format) { - QStringList formats = KImageIO::types(KImageIO::Reading); - QStringList mimeTypes = KImageIO::mimeTypes(KImageIO::Reading); - int pos = formats.findIndex(QString::fromAscii(format)); +static TQString mimeTypeFromFormat(const char* format) { + TQStringList formats = KImageIO::types(KImageIO::Reading); + TQStringList mimeTypes = KImageIO::mimeTypes(KImageIO::Reading); + int pos = formats.tqfindIndex(TQString::fromAscii(format)); Q_ASSERT(pos != -1); return mimeTypes[pos]; } -void ImageLoader::slotDataReceived(KIO::Job* job, const QByteArray& chunk) { +void ImageLoader::slotDataReceived(KIO::Job* job, const TQByteArray& chunk) { LOG2("size: " << chunk.size()); if (chunk.size()<=0) return; @@ -459,9 +459,9 @@ void ImageLoader::slotDataReceived(KIO::Job* job, const QByteArray& chunk) { if (oldSize==0) { // Try to determine the data type - QBuffer buffer(d->mRawData); + TQBuffer buffer(d->mRawData); buffer.open(IO_ReadOnly); - const char* format = QImageIO::imageFormat(&buffer); + const char* format = TQImageIO::imageFormat(TQT_TQIODEVICE(&buffer)); if (format) { // This is a raster image, get the mime type now d->mURLKind = MimeTypeUtils::KIND_RASTER_IMAGE; @@ -498,7 +498,7 @@ void ImageLoader::decodeChunk() { return; } - int chunkSize = QMIN(DECODE_CHUNK_SIZE, int(d->mRawData.size())-d->mDecodedSize); + int chunkSize = TQMIN(DECODE_CHUNK_SIZE, int(d->mRawData.size())-d->mDecodedSize); int decodedSize = 0; if (chunkSize>0) { decodedSize = d->mDecoder.decode( @@ -581,9 +581,9 @@ void ImageLoader::finish( bool ok ) { if (!ok) { d->mFrames.clear(); - d->mRawData = QByteArray(); - d->mImageFormat = QCString(); - d->mProcessedImage = QImage(); + d->mRawData = TQByteArray(); + d->mImageFormat = TQCString(); + d->mProcessedImage = TQImage(); emit imageLoaded( false ); return; } @@ -599,10 +599,10 @@ void ImageLoader::finish( bool ok ) { BusyLevel ImageLoader::priority() const { BusyLevel mylevel = BUSY_NONE; - for( QValueVector< OwnerData >::ConstIterator it = d->mOwners.begin(); + for( TQValueVector< OwnerData >::ConstIterator it = d->mOwners.begin(); it != d->mOwners.end(); ++it ) { - mylevel = QMAX( mylevel, (*it).priority ); + mylevel = TQMAX( mylevel, (*it).priority ); } return mylevel; } @@ -633,7 +633,7 @@ void ImageLoader::resumeLoading() { //--------------------------------------------------------------------- // -// QImageConsumer +// TQImageConsumer // //--------------------------------------------------------------------- void ImageLoader::end() { @@ -656,7 +656,7 @@ void ImageLoader::end() { // when we return from this function we will be in decodeChunk(), after the // call to decode(), so we don't want to switch to a new impl yet, since // this means deleting "this". - QTimer::singleShot(0, this, SLOT(callFinish()) ); + TQTimer::singleShot(0, this, TQT_SLOT(callFinish()) ); } @@ -665,9 +665,9 @@ void ImageLoader::callFinish() { } -void ImageLoader::changed(const QRect& constRect) { +void ImageLoader::changed(const TQRect& constRect) { LOG2(""); - QRect rect = constRect; + TQRect rect = constRect; if (d->mLoadedRegion.isEmpty()) { // This is the first time we get called. Init mProcessedImage and emit @@ -690,8 +690,8 @@ void ImageLoader::changed(const QRect& constRect) { d->mOrientation = content.orientation(); if (MiscConfig::autoRotateImages() && d->mOrientation != ImageUtils::NOT_AVAILABLE && d->mOrientation != ImageUtils::NORMAL) { - QSize size = content.size(); - d->mProcessedImage = QImage(size, d->mDecoder.image().depth()); + TQSize size = content.size(); + d->mProcessedImage = TQImage(size, d->mDecoder.image().depth()); } d->mProcessedImage.setDotsPerMeterX(content.dotsPerMeterX()); d->mProcessedImage.setDotsPerMeterY(content.dotsPerMeterY()); @@ -711,7 +711,7 @@ void ImageLoader::changed(const QRect& constRect) { // image, rotate the temp image and copy it to mProcessedImage // Copy loaded rect - QImage temp(rect.size(), d->mProcessedImage.depth()); + TQImage temp(rect.size(), d->mProcessedImage.depth()); bitBlt(&temp, 0, 0, &d->mDecoder.image(), rect.left(), rect.top(), rect.width(), rect.height()); @@ -719,9 +719,9 @@ void ImageLoader::changed(const QRect& constRect) { temp = ImageUtils::transform(temp, d->mOrientation); // Compute destination rect - QWMatrix matrix = ImageUtils::transformMatrix(d->mOrientation); + TQWMatrix matrix = ImageUtils::transformMatrix(d->mOrientation); - QRect imageRect = d->mDecoder.image().rect(); + TQRect imageRect = d->mDecoder.image().rect(); imageRect = matrix.mapRect(imageRect); rect = matrix.mapRect(rect); @@ -740,17 +740,17 @@ void ImageLoader::changed(const QRect& constRect) { LOG("emitting imageChanged " << d->mLoadChangedRect); d->mTimeSinceLastUpdate.start(); emit imageChanged(d->mLoadChangedRect); - d->mLoadChangedRect = QRect(); + d->mLoadChangedRect = TQRect(); } } void ImageLoader::frameDone() { - frameDone( QPoint( 0, 0 ), d->mDecoder.image().rect()); + frameDone( TQPoint( 0, 0 ), d->mDecoder.image().rect()); } -void ImageLoader::frameDone(const QPoint& offset, const QRect& rect) { +void ImageLoader::frameDone(const TQPoint& offset, const TQRect& rect) { LOG(""); - // Another case where the image loading in Qt's is a bit borken. + // Another case where the image loading in TQt's is a bit borken. // It's possible to get several notes about a frame being done for one frame (with MNG). if( !d->mWasFrameData ) { // To make it even more fun, with MNG the sequence is actually @@ -769,22 +769,22 @@ void ImageLoader::frameDone(const QPoint& offset, const QRect& rect) { d->mWasFrameData = false; if( !d->mLoadChangedRect.isEmpty()) { emit imageChanged(d->mLoadChangedRect); - d->mLoadChangedRect = QRect(); + d->mLoadChangedRect = TQRect(); d->mTimeSinceLastUpdate.start(); } - d->mLoadedRegion = QRegion(); + d->mLoadedRegion = TQRegion(); - QImage image; + TQImage image; if (d->mProcessedImage.isNull()) { image = d->mDecoder.image().copy(); } else { image = d->mProcessedImage.copy(); } - if( offset != QPoint( 0, 0 ) || rect != image.rect()) { + if( offset != TQPoint( 0, 0 ) || rect != image.rect()) { // Blit last frame below 'image' if( !d->mFrames.isEmpty()) { - QImage im = d->mFrames.last().image.copy(); + TQImage im = d->mFrames.last().image.copy(); bitBlt( &im, offset.x(), offset.y(), &image, rect.x(), rect.y(), rect.width(), rect.height()); image = im; } @@ -809,7 +809,7 @@ void ImageLoader::setSize(int, int) { } -QImage ImageLoader::processedImage() const { +TQImage ImageLoader::processedImage() const { return d->mProcessedImage; } @@ -819,17 +819,17 @@ ImageFrames ImageLoader::frames() const { } -QCString ImageLoader::imageFormat() const { +TQCString ImageLoader::imageFormat() const { return d->mImageFormat; } -QByteArray ImageLoader::rawData() const { +TQByteArray ImageLoader::rawData() const { return d->mRawData; } -QString ImageLoader::mimeType() const { +TQString ImageLoader::mimeType() const { return d->mMimeType; } @@ -844,7 +844,7 @@ KURL ImageLoader::url() const { } -QRegion ImageLoader::loadedRegion() const { +TQRegion ImageLoader::loadedRegion() const { return d->mLoadedRegion; } @@ -854,16 +854,16 @@ bool ImageLoader::completed() const { } -void ImageLoader::ref( const QObject* owner, BusyLevel priority ) { +void ImageLoader::ref( const TQObject* owner, BusyLevel priority ) { OwnerData data; data.owner = owner; data.priority = priority; d->mOwners.append( data ); - connect( owner, SIGNAL( destroyed()), SLOT( ownerDestroyed())); + connect( owner, TQT_SIGNAL( destroyed()), TQT_SLOT( ownerDestroyed())); } -void ImageLoader::deref( const QObject* owner ) { - for( QValueVector< OwnerData >::Iterator it = d->mOwners.begin(); +void ImageLoader::deref( const TQObject* owner ) { + for( TQValueVector< OwnerData >::Iterator it = d->mOwners.begin(); it != d->mOwners.end(); ++it ) { if( (*it).owner == owner ) { @@ -878,13 +878,13 @@ void ImageLoader::deref( const QObject* owner ) { assert( false ); } -void ImageLoader::release( const QObject* owner ) { +void ImageLoader::release( const TQObject* owner ) { disconnect( owner ); deref( owner ); } void ImageLoader::ownerDestroyed() { - deref( sender()); + deref( TQT_TQOBJECT(sender())); } //--------------------------------------------------------------------- @@ -893,8 +893,8 @@ void ImageLoader::ownerDestroyed() { // //--------------------------------------------------------------------- -ImageLoader* ImageLoader::loader( const KURL& url, const QObject* owner, BusyLevel priority ) { - if( sLoaders.contains( url )) { +ImageLoader* ImageLoader::loader( const KURL& url, const TQObject* owner, BusyLevel priority ) { + if( sLoaders.tqcontains( url )) { ImageLoader* loader = sLoaders[ url ]; loader->ref( owner, priority ); // resume if this owner has high priority @@ -910,7 +910,7 @@ ImageLoader* ImageLoader::loader( const KURL& url, const QObject* owner, BusyLev // This also helps with preloading jobs, since BUSY_LOADING busy level is not entered immediately // when a new picture is selected, so preloading jobs without this delay could start working // immediately. - QTimer::singleShot( priority >= BUSY_LOADING ? 0 : 10, loader, SLOT( startLoading())); + TQTimer::singleShot( priority >= BUSY_LOADING ? 0 : 10, loader, TQT_SLOT( startLoading())); return loader; } diff --git a/src/gvcore/imageloader.h b/src/gvcore/imageloader.h index 1a61749..e972fc9 100644 --- a/src/gvcore/imageloader.h +++ b/src/gvcore/imageloader.h @@ -21,10 +21,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef IMAGELOADER_H #define IMAGELOADER_H -// Qt -#include <qasyncimageio.h> -#include <qbuffer.h> -#include <qcstring.h> +// TQt +#include <tqasyncimageio.h> +#include <tqbuffer.h> +#include <tqcstring.h> // KDE #include <kio/job.h> @@ -39,9 +39,10 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace Gwenview { class DecoderThread : public TSThread { Q_OBJECT + TQ_OBJECT public: - void setRawData(const QByteArray&); - QImage popLoadedImage(); + void setRawData(const TQByteArray&); + TQImage popLoadedImage(); signals: void failed(); @@ -51,38 +52,39 @@ protected: void run(); private: - QMutex mMutex; - QByteArray mRawData; - QImage mImage; + TQMutex mMutex; + TQByteArray mRawData; + TQImage mImage; }; class ImageLoaderPrivate; -class LIBGWENVIEW_EXPORT ImageLoader : public QObject, public QImageConsumer { +class LIBGWENVIEW_EXPORT ImageLoader : public TQObject, public TQImageConsumer { Q_OBJECT + TQ_OBJECT public: - static ImageLoader* loader( const KURL& url, const QObject* owner, BusyLevel priority ); // use this instead of ctor - void release( const QObject* owner ); // use this instead of dtor + static ImageLoader* loader( const KURL& url, const TQObject* owner, BusyLevel priority ); // use this instead of ctor + void release( const TQObject* owner ); // use this instead of dtor - QImage processedImage() const; + TQImage processedImage() const; ImageFrames frames() const; - QCString imageFormat() const; - QByteArray rawData() const; - QString mimeType() const; + TQCString imageFormat() const; + TQByteArray rawData() const; + TQString mimeType() const; MimeTypeUtils::Kind urlKind() const; KURL url() const; - QRegion loadedRegion() const; // valid parts of processedImage() + TQRegion loadedRegion() const; // valid parts of processedImage() bool completed() const; signals: void urlKindDetermined(); void sizeLoaded(int, int); - void imageChanged(const QRect&); + void imageChanged(const TQRect&); void imageLoaded( bool ok ); private slots: void slotStatResult(KIO::Job*); - void slotDataReceived(KIO::Job*, const QByteArray& chunk); + void slotDataReceived(KIO::Job*, const TQByteArray& chunk); void slotGetResult(KIO::Job*); void decodeChunk(); void slotDecoderThreadFailed(); @@ -95,8 +97,8 @@ private slots: private: ImageLoader(); ~ImageLoader(); - void ref( const QObject* owner, BusyLevel priority ); - void deref( const QObject* owner ); + void ref( const TQObject* owner, BusyLevel priority ); + void deref( const TQObject* owner ); void suspendLoading(); void resumeLoading(); void finish( bool ok ); @@ -106,11 +108,11 @@ private: void checkPendingGet(); BusyLevel priority() const; - // QImageConsumer methods + // TQImageConsumer methods void end(); - void changed(const QRect&); + void changed(const TQRect&); void frameDone(); - void frameDone(const QPoint& offset, const QRect& rect); + void frameDone(const TQPoint& offset, const TQRect& rect); void setLooping(int); void setFramePeriod(int milliseconds); void setSize(int, int); diff --git a/src/gvcore/imagesavedialog.cpp b/src/gvcore/imagesavedialog.cpp index edb4f5b..81e4a44 100644 --- a/src/gvcore/imagesavedialog.cpp +++ b/src/gvcore/imagesavedialog.cpp @@ -18,8 +18,8 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Qt includes -#include <qtimer.h> +// TQt includes +#include <tqtimer.h> // KDE includes #include <kdebug.h> @@ -34,18 +34,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. namespace Gwenview { -static int findFormatInFilterList(const QStringList& filters, const QString& format) { +static int findFormatInFilterList(const TQStringList& filters, const TQString& format) { int pos=0; - for(QStringList::const_iterator it=filters.begin(); it!=filters.end(); ++it,++pos) { - QStringList list=QStringList::split("|",*it); + for(TQStringList::const_iterator it=filters.begin(); it!=filters.end(); ++it,++pos) { + TQStringList list=TQStringList::split("|",*it); if ( list[1].startsWith(format) ) return pos; } return -1; } -ImageSaveDialog::ImageSaveDialog(KURL& url, const QCString& imageFormat, QWidget* parent) -: KFileDialog(":ImageSaveDialog",QString::null,parent,"imagesavedialog",true) +ImageSaveDialog::ImageSaveDialog(KURL& url, const TQCString& imageFormat, TQWidget* tqparent) +: KFileDialog(":ImageSaveDialog",TQString(),tqparent,"imagesavedialog",true) , mURL(url) , mImageFormat(imageFormat) { @@ -55,27 +55,27 @@ ImageSaveDialog::ImageSaveDialog(KURL& url, const QCString& imageFormat, QWidget KMimeType::List types; setFilterMimeType(i18n("Format:"),types,KMimeType::mimeType("")); - QStringList filters; + TQStringList filters; // Create our filter list - QStringList mimeTypes=KImageIO::mimeTypes(); - for(QStringList::const_iterator it=mimeTypes.begin(); it!=mimeTypes.end(); ++it) { - QString format=KImageIO::typeForMime(*it); + TQStringList mimeTypes=KImageIO::mimeTypes(); + for(TQStringList::const_iterator it=mimeTypes.begin(); it!=mimeTypes.end(); ++it) { + TQString format=KImageIO::typeForMime(*it); // Create the pattern part of the filter string KMimeType::Ptr mt=KMimeType::mimeType(*it); - QStringList patterns; - for (QStringList::const_iterator patIt=mt->patterns().begin();patIt!=mt->patterns().end();++patIt) { - QString pattern=(*patIt).lower(); - if (!patterns.contains(pattern)) patterns.append(pattern); + TQStringList patterns; + for (TQStringList::const_iterator patIt=mt->patterns().begin();patIt!=mt->patterns().end();++patIt) { + TQString pattern=(*patIt).lower(); + if (!patterns.tqcontains(pattern)) patterns.append(pattern); } if (patterns.isEmpty()) { - patterns.append( QString("*.%1").arg(format.lower()) ); + patterns.append( TQString("*.%1").tqarg(format.lower()) ); } - QString patternString=patterns.join(" "); + TQString patternString=patterns.join(" "); // Create the filter string - QString filter=patternString + "|" + TQString filter=patternString + "|" + format + " - " + mt->comment() + " (" + patternString + ")"; @@ -98,12 +98,12 @@ ImageSaveDialog::ImageSaveDialog(KURL& url, const QCString& imageFormat, QWidget // Tweak the filter widget filterWidget->setEditable(false); - connect(filterWidget,SIGNAL(activated(const QString&)), - this,SLOT(updateImageFormat(const QString&)) ); + connect(filterWidget,TQT_SIGNAL(activated(const TQString&)), + this,TQT_SLOT(updateImageFormat(const TQString&)) ); // Call slotFilterChanged() to get the list filtered by the filter we // selected. If we don't use a single shot, it leads to a crash :-/ - QTimer::singleShot(0,this,SLOT(slotFilterChanged())); + TQTimer::singleShot(0,this,TQT_SLOT(slotFilterChanged())); } @@ -113,13 +113,13 @@ void ImageSaveDialog::accept() { } -void ImageSaveDialog::updateImageFormat(const QString& text) { - QStringList list=QStringList::split(" ",text); +void ImageSaveDialog::updateImageFormat(const TQString& text) { + TQStringList list=TQStringList::split(" ",text); mImageFormat=list[0].local8Bit(); - QString name=locationEdit->currentText(); - QString suffix=KImageIO::suffix(mImageFormat); - int dotPos=name.findRev('.'); + TQString name=locationEdit->currentText(); + TQString suffix=KImageIO::suffix(mImageFormat); + int dotPos=name.tqfindRev('.'); if (dotPos>-1) { name=name.left(dotPos); } diff --git a/src/gvcore/imagesavedialog.h b/src/gvcore/imagesavedialog.h index 0a31c21..6cd33f8 100644 --- a/src/gvcore/imagesavedialog.h +++ b/src/gvcore/imagesavedialog.h @@ -24,28 +24,29 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // KDE includes #include <kfiledialog.h> -class QString; -class QWidget; +class TQString; +class TQWidget; class KURL; namespace Gwenview { class ImageSaveDialog : public KFileDialog { Q_OBJECT + TQ_OBJECT public: - ImageSaveDialog(KURL& url,const QCString& imageFormat,QWidget* parent); - QCString imageFormat() const { return mImageFormat; } + ImageSaveDialog(KURL& url,const TQCString& imageFormat,TQWidget* tqparent); + TQCString imageFormat() const { return mImageFormat; } protected slots: void accept(); private slots: - void updateImageFormat(const QString&); + void updateImageFormat(const TQString&); private: KURL& mURL; - QCString mImageFormat; - QMap<QString,QString> mImageFormats; + TQCString mImageFormat; + TQMap<TQString,TQString> mImageFormats; }; } // namespace diff --git a/src/gvcore/imageview.cpp b/src/gvcore/imageview.cpp index cd8a828..174d4f9 100644 --- a/src/gvcore/imageview.cpp +++ b/src/gvcore/imageview.cpp @@ -26,17 +26,17 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <assert.h> #include <math.h> -// Qt -#include <qcolor.h> -#include <qcombobox.h> -#include <qcursor.h> -#include <qdatetime.h> -#include <qevent.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qlabel.h> -#include <qtimer.h> -#include <qvaluevector.h> +// TQt +#include <tqcolor.h> +#include <tqcombobox.h> +#include <tqcursor.h> +#include <tqdatetime.h> +#include <tqevent.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqlabel.h> +#include <tqtimer.h> +#include <tqvaluevector.h> // KDE #include <kaction.h> @@ -65,7 +65,7 @@ namespace Gwenview { Coordinates: The image can be zoomed, can have a position offset, and additionally there is -QScrollView's viewport. This means there are several coordinate systems. +TQScrollView's viewport. This means there are several coordinate systems. @@ -113,7 +113,7 @@ as approximate as possible). However when converting from widget to image and ba this can result in the final rectangle being smaller than the original. The widgetToImageBounding() function converts from widget to image coordinates in a way which makes sure the reverse conversion will be at least as large -as the original geometry. +as the original tqgeometry. There are no conversion functions for only width/height, as their conversion depends on the position (because of the rounding etc.). For similar reasons @@ -122,7 +122,7 @@ but with the point next to it. -For conversions from/to QScrollView's viewport, usually QScrollView methods should +For conversions from/to TQScrollView's viewport, usually TQScrollView methods should be used: contentsX(), contentsY(), contentsWidth(), contentsHeight(), visibleWidth(), visibleHeight(), contentsToViewport() and viewportToContents(). @@ -159,13 +159,13 @@ struct ImageView::Private { int mGamma, mBrightness, mContrast; // Our actions - QComboBox* mZoomCombo; + TQComboBox* mZoomCombo; // We do not use KSelectAction because it's not possible to set the combo text KWidgetAction* mZoomComboAction; KToggleAction* mZoomToFit; KToggleAction* mZoomToWidth; KToggleAction* mZoomToHeight; - QValueVector<KToggleAction*> mZoomComboActions; + TQValueVector<KToggleAction*> mZoomComboActions; KAction* mZoomIn; KAction* mZoomOut; KAction* mResetZoom; @@ -188,13 +188,13 @@ struct ImageView::Private { double mZoomBeforeAuto; int mXCenterBeforeAuto, mYCenterBeforeAuto; - QMap< long long, PendingPaint > mPendingPaints; - QRegion mPendingNormalRegion; - QRegion mPendingSmoothRegion; + TQMap< long long, PendingPaint > mPendingPaints; + TQRegion mPendingNormalRegion; + TQRegion mPendingSmoothRegion; int mPendingOperations; - QTimer mPendingPaintTimer; + TQTimer mPendingPaintTimer; bool mSmoothingSuspended; - QRegion mValidImageArea; + TQRegion mValidImageArea; int imageToWidgetX( int x ) const { if( mZoom == 1.0 ) return x + mXOffset; @@ -206,14 +206,14 @@ struct ImageView::Private { return lround( y * mZoom ) + mYOffset; } - QPoint imageToWidget( const QPoint& p ) const { - return QPoint( imageToWidgetX( p.x()), imageToWidgetY( p.y())); + TQPoint imageToWidget( const TQPoint& p ) const { + return TQPoint( imageToWidgetX( p.x()), imageToWidgetY( p.y())); } - QRect imageToWidget( const QRect& r ) const { - return QRect( imageToWidget( r.topLeft()), + TQRect imageToWidget( const TQRect& r ) const { + return TQRect( imageToWidget( r.topLeft()), // don't use bottomright corner for conversion, but the one next to it - imageToWidget( r.bottomRight() + QPoint( 1, 1 )) - QPoint( 1, 1 )); + imageToWidget( r.bottomRight() + TQPoint( 1, 1 )) - TQPoint( 1, 1 )); } int widgetToImageX( int x ) const { @@ -226,19 +226,19 @@ struct ImageView::Private { return lround( ( y - mYOffset ) / mZoom ); } - QPoint widgetToImage( const QPoint& p ) const { - return QPoint( widgetToImageX( p.x()), widgetToImageY( p.y())); + TQPoint widgetToImage( const TQPoint& p ) const { + return TQPoint( widgetToImageX( p.x()), widgetToImageY( p.y())); } - QRect widgetToImage( const QRect& r ) const { - return QRect( widgetToImage( r.topLeft()), + TQRect widgetToImage( const TQRect& r ) const { + return TQRect( widgetToImage( r.topLeft()), // don't use bottomright corner for conversion, but the one next to it - widgetToImage( r.bottomRight() + QPoint( 1, 1 )) - QPoint( 1, 1 )); + widgetToImage( r.bottomRight() + TQPoint( 1, 1 )) - TQPoint( 1, 1 )); } - QRect widgetToImageBounding( const QRect& r, int extra ) const { - QRect ret = widgetToImage( r ); - // make sure converting to image and back always returns QRect at least as large as 'r' + TQRect widgetToImageBounding( const TQRect& r, int extra ) const { + TQRect ret = widgetToImage( r ); + // make sure converting to image and back always returns TQRect at least as large as 'r' extra += mZoom == 1.0 ? 0 : int( ceil( 1 / mZoom )); ret.addCoords( -extra, -extra, extra, extra ); return ret; @@ -246,18 +246,18 @@ struct ImageView::Private { void initZoomCombo() { mZoomCombo->clear(); - for (QValueVector<KToggleAction*>::iterator it=mZoomComboActions.begin(); + for (TQValueVector<KToggleAction*>::iterator it=mZoomComboActions.begin(); it!=mZoomComboActions.end(); ++it) { - QString txt=(*it)->plainText(); + TQString txt=(*it)->plainText(); mZoomCombo->insertItem(txt); } const double zoomValues[] = { 0.5, 1, 2 }; int nbValues=sizeof(zoomValues) / sizeof(double); for (int pos=0; pos<nbValues; ++pos) { - QString txt=QString("%1%").arg( int(zoomValues[pos]*100) ); + TQString txt=TQString("%1%").tqarg( int(zoomValues[pos]*100) ); mZoomCombo->insertItem(txt); } } @@ -270,18 +270,18 @@ inline bool doDelayedSmoothing() { } -class ImageView::EventFilter : public QObject { +class ImageView::EventFilter : public TQObject { public: - EventFilter(ImageView* parent) - : QObject(parent) {} + EventFilter(ImageView* tqparent) + : TQObject(tqparent) {} - bool eventFilter(QObject*, QEvent* event) { + bool eventFilter(TQObject*, TQEvent* event) { switch (event->type()) { - case QEvent::KeyPress: - case QEvent::KeyRelease: - case QEvent::AccelOverride: - return static_cast< ImageView* >( parent()) - ->viewportKeyEvent(static_cast<QKeyEvent*>(event)); + case TQEvent::KeyPress: + case TQEvent::KeyRelease: + case TQEvent::AccelOverride: + return static_cast< ImageView* >( TQT_TQWIDGET(tqparent())) + ->viewportKeyEvent(TQT_TQKEYEVENT(event)); default: break; } @@ -291,8 +291,8 @@ public: -ImageView::ImageView(QWidget* parent,Document* document, KActionCollection* actionCollection) -: QScrollView(parent,0L,WResizeNoErase|WRepaintNoErase|WPaintClever) +ImageView::ImageView(TQWidget* tqparent,Document* document, KActionCollection* actionCollection) +: TQScrollView(tqparent,0L,WResizeNoErase|WRepaintNoErase|WPaintClever) { d=new Private; d->mDocument=document; @@ -312,7 +312,7 @@ ImageView::ImageView(QWidget* parent,Document* document, KActionCollection* acti d->mContrast = 100; d->mBCGDialog = 0; - viewport()->setFocusPolicy(WheelFocus); + viewport()->setFocusPolicy(TQ_WheelFocus); setFrameStyle(NoFrame); setAcceptDrops( true ); viewport()->setAcceptDrops( true ); @@ -326,32 +326,32 @@ ImageView::ImageView(QWidget* parent,Document* document, KActionCollection* acti // Create actions d->mZoomToFit=new KToggleAction(i18n("Fit to &Window"),"viewmagfit",0,d->mActionCollection,"view_zoom_to_fit"); - connect(d->mZoomToFit,SIGNAL(toggled(bool)), - this,SLOT(setZoomToFit(bool)) ); + connect(d->mZoomToFit,TQT_SIGNAL(toggled(bool)), + TQT_TQOBJECT(this), TQT_SLOT(setZoomToFit(bool)) ); d->mZoomToWidth=new KToggleAction(i18n("Fit to &Width"),0,0,d->mActionCollection,"view_zoom_to_width"); - connect(d->mZoomToWidth,SIGNAL(toggled(bool)), - this,SLOT(setZoomToWidth(bool)) ); + connect(d->mZoomToWidth,TQT_SIGNAL(toggled(bool)), + TQT_TQOBJECT(this), TQT_SLOT(setZoomToWidth(bool)) ); d->mZoomToHeight=new KToggleAction(i18n("Fit to &Height"),0,0,d->mActionCollection,"view_zoom_to_height"); - connect(d->mZoomToHeight,SIGNAL(toggled(bool)), - this,SLOT(setZoomToHeight(bool)) ); + connect(d->mZoomToHeight,TQT_SIGNAL(toggled(bool)), + TQT_TQOBJECT(this), TQT_SLOT(setZoomToHeight(bool)) ); - d->mZoomIn=KStdAction::zoomIn(this,SLOT(slotZoomIn()),d->mActionCollection); + d->mZoomIn=KStdAction::zoomIn(TQT_TQOBJECT(this),TQT_SLOT(slotZoomIn()),d->mActionCollection); - d->mZoomOut=KStdAction::zoomOut(this,SLOT(slotZoomOut()),d->mActionCollection); + d->mZoomOut=KStdAction::zoomOut(TQT_TQOBJECT(this),TQT_SLOT(slotZoomOut()),d->mActionCollection); - d->mResetZoom=KStdAction::actualSize(this,SLOT(slotResetZoom()),d->mActionCollection); + d->mResetZoom=KStdAction::actualSize(TQT_TQOBJECT(this),TQT_SLOT(slotResetZoom()),d->mActionCollection); d->mResetZoom->setIcon("viewmag1"); d->mLockZoom=new KToggleAction(i18n("&Lock Zoom"),"lock",0,d->mActionCollection,"view_zoom_lock"); d->mLockZoom->setChecked(ImageViewConfig::lockZoom()); - connect(d->mLockZoom,SIGNAL(toggled(bool)), - this,SLOT(setLockZoom(bool)) ); + connect(d->mLockZoom,TQT_SIGNAL(toggled(bool)), + TQT_TQOBJECT(this), TQT_SLOT(setLockZoom(bool)) ); - d->mZoomCombo=new QComboBox(true); + d->mZoomCombo=new TQComboBox(true); // Avoid stealing focus - d->mZoomCombo->setFocusPolicy(ClickFocus); - connect(d->mZoomCombo, SIGNAL(activated(int)), - this, SLOT(slotSelectZoom()) ); + d->mZoomCombo->setFocusPolicy(TQ_ClickFocus); + connect(d->mZoomCombo, TQT_SIGNAL(activated(int)), + TQT_TQOBJECT(this), TQT_SLOT(slotSelectZoom()) ); d->mZoomComboAction=new KWidgetAction(d->mZoomCombo, i18n("Zoom"), 0, 0, 0, d->mActionCollection, "view_zoom_to"); @@ -364,45 +364,45 @@ ImageView::ImageView(QWidget* parent,Document* document, KActionCollection* acti d->initZoomCombo(); d->mAdjustBCG=new KAction(i18n("Adjust Brightness/Contrast/Gamma"), "colorize", 0, - this, SLOT(showBCGDialog()), d->mActionCollection, "adjust_bcg"); + TQT_TQOBJECT(this), TQT_SLOT(showBCGDialog()), d->mActionCollection, "adjust_bcg"); d->mIncreaseGamma=new KAction(i18n("Increase Gamma"),0,CTRL+Key_G, - this,SLOT(increaseGamma()),d->mActionCollection,"increase_gamma"); + TQT_TQOBJECT(this), TQT_SLOT(increaseGamma()),d->mActionCollection,"increase_gamma"); d->mDecreaseGamma=new KAction(i18n("Decrease Gamma"),0,SHIFT+CTRL+Key_G, - this,SLOT(decreaseGamma()),d->mActionCollection,"decrease_gamma"); + TQT_TQOBJECT(this), TQT_SLOT(decreaseGamma()),d->mActionCollection,"decrease_gamma"); d->mIncreaseBrightness=new KAction(i18n("Increase Brightness" ),0,CTRL+Key_B, - this,SLOT(increaseBrightness()),d->mActionCollection,"increase_brightness"); + TQT_TQOBJECT(this), TQT_SLOT(increaseBrightness()),d->mActionCollection,"increase_brightness"); d->mDecreaseBrightness=new KAction(i18n("Decrease Brightness" ),0,SHIFT+CTRL+Key_B, - this,SLOT(decreaseBrightness()),d->mActionCollection,"decrease_brightness"); + TQT_TQOBJECT(this), TQT_SLOT(decreaseBrightness()),d->mActionCollection,"decrease_brightness"); d->mIncreaseContrast=new KAction(i18n("Increase Contrast" ),0,CTRL+Key_C, - this,SLOT(increaseContrast()),d->mActionCollection,"increase_contrast"); + TQT_TQOBJECT(this), TQT_SLOT(increaseContrast()),d->mActionCollection,"increase_contrast"); d->mDecreaseContrast=new KAction(i18n("Decrease Contrast" ),0,SHIFT+CTRL+Key_C, - this,SLOT(decreaseContrast()),d->mActionCollection,"decrease_contrast"); + TQT_TQOBJECT(this), TQT_SLOT(decreaseContrast()),d->mActionCollection,"decrease_contrast"); // Connect to some interesting signals - connect(d->mDocument,SIGNAL(loaded(const KURL&)), - this,SLOT(slotLoaded()) ); + connect(d->mDocument,TQT_SIGNAL(loaded(const KURL&)), + TQT_TQOBJECT(this), TQT_SLOT(slotLoaded()) ); - connect(d->mDocument,SIGNAL(loading()), - this,SLOT( loadingStarted()) ); + connect(d->mDocument,TQT_SIGNAL(loading()), + TQT_TQOBJECT(this), TQT_SLOT( loadingStarted()) ); - connect(d->mDocument,SIGNAL(modified()), - this,SLOT(slotModified()) ); + connect(d->mDocument,TQT_SIGNAL(modified()), + TQT_TQOBJECT(this), TQT_SLOT(slotModified()) ); - connect(d->mDocument, SIGNAL(sizeUpdated()), - this, SLOT(slotImageSizeUpdated()) ); + connect(d->mDocument, TQT_SIGNAL(sizeUpdated()), + TQT_TQOBJECT(this), TQT_SLOT(slotImageSizeUpdated()) ); - connect(d->mDocument, SIGNAL(rectUpdated(const QRect&)), - this, SLOT(slotImageRectUpdated(const QRect&)) ); + connect(d->mDocument, TQT_SIGNAL(rectUpdated(const TQRect&)), + TQT_TQOBJECT(this), TQT_SLOT(slotImageRectUpdated(const TQRect&)) ); - connect(&d->mPendingPaintTimer,SIGNAL(timeout()), - this,SLOT(checkPendingOperations()) ); + connect(&d->mPendingPaintTimer,TQT_SIGNAL(timeout()), + TQT_TQOBJECT(this), TQT_SLOT(checkPendingOperations()) ); - connect(BusyLevelManager::instance(),SIGNAL(busyLevelChanged(BusyLevel)), - this,SLOT(slotBusyLevelChanged(BusyLevel) )); + connect(BusyLevelManager::instance(),TQT_SIGNAL(busyLevelChanged(BusyLevel)), + TQT_TQOBJECT(this), TQT_SLOT(slotBusyLevelChanged(BusyLevel) )); // This event filter is here to make sure the pixmap view is aware of the changes // in the keyboard modifiers, even if it isn't focused. However, making this widget - // itself the filter would lead to doubled paint events, because QScrollView + // itself the filter would lead to doubled paint events, because TQScrollView // installs an event filter on its viewport, and doesn't filter out the paint // events -> it'd get it twice, first from app filter, second from viewport filter. EventFilter* filter=new EventFilter(this); @@ -423,7 +423,7 @@ ImageView::~ImageView() { void ImageView::slotLoaded() { if (d->mDocument->isNull()) { resizeContents(0,0); - viewport()->repaint(false); + viewport()->tqrepaint(false); return; } @@ -446,7 +446,7 @@ void ImageView::slotModified() { void ImageView::loadingStarted() { cancelPending(); d->mSmoothingSuspended = true; - d->mValidImageArea = QRegion(); + d->mValidImageArea = TQRegion(); d->mGamma = 100; d->mBrightness = 0; d->mContrast = 100; @@ -471,8 +471,8 @@ bool ImageView::fullScreen() const { } -QPoint ImageView::offset() const { - return QPoint(d->mXOffset, d->mYOffset); +TQPoint ImageView::offset() const { + return TQPoint(d->mXOffset, d->mYOffset); } @@ -488,7 +488,7 @@ KToggleAction* ImageView::zoomToFit() const { void ImageView::updateFromSettings() { - // Reset, so that next repaint doesn't possibly take longer because of + // Reset, so that next tqrepaint doesn't possibly take longer because of // smoothing ImageViewConfig::setMaxRepaintSize(DEFAULT_MAX_REPAINT_SIZE); ImageViewConfig::setMaxScaleRepaintSize(DEFAULT_MAX_REPAINT_SIZE); @@ -594,8 +594,8 @@ void ImageView::setFullScreen(bool fullScreen) { // Overloaded methods // //------------------------------------------------------------------------ -void ImageView::resizeEvent(QResizeEvent* event) { - QScrollView::resizeEvent(event); +void ImageView::resizeEvent(TQResizeEvent* event) { + TQScrollView::resizeEvent(event); if (d->mZoomMode!=ZOOM_FREE) { updateZoom(d->mZoomMode); } else { @@ -617,22 +617,22 @@ inline void composite(uint* rgba,uint value) { } } -void ImageView::drawContents(QPainter* painter,int clipx,int clipy,int clipw,int cliph) { +void ImageView::drawContents(TQPainter* painter,int clipx,int clipy,int clipw,int cliph) { // Erase borders - QRect imageRect(0, 0, d->mDocument->width(), d->mDocument->height()); + TQRect imageRect(0, 0, d->mDocument->width(), d->mDocument->height()); imageRect = d->imageToWidget(imageRect); - QRect widgetRect = QRect(0, 0, visibleWidth(), visibleHeight()); + TQRect widgetRect = TQRect(0, 0, visibleWidth(), visibleHeight()); - QRegion region = QRegion(widgetRect) - imageRect; - QMemArray<QRect> rects = region.rects(); + TQRegion region = TQRegion(widgetRect) - imageRect; + TQMemArray<TQRect> rects = region.tqrects(); for(unsigned int pos = 0; pos < rects.count(); ++pos ) { painter->eraseRect(rects[pos]); } // Repaint if( !d->mValidImageArea.isEmpty()) { - addPendingPaint( false, QRect( clipx, clipy, clipw, cliph )); + addPendingPaint( false, TQRect( clipx, clipy, clipw, cliph )); } } @@ -640,34 +640,34 @@ void ImageView::drawContents(QPainter* painter,int clipx,int clipy,int clipw,int // There's a queue of areas to paint (each with bool saying whether it's smooth pass). // Also, there's a bitfield of pending operations, operations are handled only after // there's nothing more to paint (so that smooth pass is started). -void ImageView::addPendingPaint( bool smooth, QRect rect ) { +void ImageView::addPendingPaint( bool smooth, TQRect rect ) { if( d->mSmoothingSuspended && smooth ) return; // try to avoid scheduling already scheduled areas - QRegion& region = smooth ? d->mPendingSmoothRegion : d->mPendingNormalRegion; - if( region.intersect( rect ) == QRegion( rect )) + TQRegion& region = smooth ? d->mPendingSmoothRegion : d->mPendingNormalRegion; + if( region.intersect( rect ) == TQRegion( rect )) return; // whole rect has already pending paints // at least try to remove the part that's already scheduled - rect = ( QRegion( rect ) - region ).boundingRect(); + rect = ( TQRegion( rect ) - region ).boundingRect(); region += rect; if( rect.isEmpty()) return; addPendingPaintInternal( smooth, rect ); } -void ImageView::addPendingPaintInternal( bool smooth, QRect rect ) { +void ImageView::addPendingPaintInternal( bool smooth, TQRect rect ) { const long long MAX_DIM = 1000000; // if monitors get larger than this, we're in trouble :) - // QMap will ensure ordering (non-smooth first, top-to-bottom, left-to-right) + // TQMap will ensure ordering (non-smooth first, top-to-bottom, left-to-right) long long key = ( smooth ? MAX_DIM * MAX_DIM : 0 ) + rect.y() * MAX_DIM + rect.x(); // handle the case of two different paints at the same position (just in case) key *= 100; bool insert = true; - while( d->mPendingPaints.contains( key )) { - if( d->mPendingPaints[ key ].rect.contains( rect )) { + while( d->mPendingPaints.tqcontains( key )) { + if( d->mPendingPaints[ key ].rect.tqcontains( rect )) { insert = false; break; } - if( rect.contains( d->mPendingPaints[ key ].rect )) { + if( rect.tqcontains( d->mPendingPaints[ key ].rect )) { break; } ++key; @@ -700,10 +700,10 @@ void ImageView::limitPaintSize( PendingPaint& paint ) { } // don't paint more than max_size pixels at a time int maxHeight = ( maxSize + paint.rect.width() - 1 ) / paint.rect.width(); // round up - maxHeight = QMAX( maxHeight, 5 ); // at least 5 lines together - // can't repaint whole paint at once, adjust height and schedule the rest + maxHeight = TQMAX( maxHeight, 5 ); // at least 5 lines together + // can't tqrepaint whole paint at once, adjust height and schedule the rest if( maxHeight < paint.rect.height()) { - QRect remaining = paint.rect; + TQRect remaining = paint.rect; remaining.setTop( remaining.top() + maxHeight ); addPendingPaintInternal( paint.smooth, remaining ); paint.rect.setHeight( maxHeight ); @@ -718,12 +718,12 @@ void ImageView::checkPendingOperationsInternal() { PendingPaint paint = *d->mPendingPaints.begin(); d->mPendingPaints.remove( d->mPendingPaints.begin()); limitPaintSize( paint ); // modifies paint.rect if necessary - QRegion& region = paint.smooth ? d->mPendingSmoothRegion : d->mPendingNormalRegion; + TQRegion& region = paint.smooth ? d->mPendingSmoothRegion : d->mPendingNormalRegion; region -= paint.rect; - QRect visibleRect( contentsX(), contentsY(), visibleWidth(), visibleHeight()); - QRect paintRect = paint.rect.intersect( visibleRect ); + TQRect visibleRect( contentsX(), contentsY(), visibleWidth(), visibleHeight()); + TQRect paintRect = paint.rect.intersect( visibleRect ); if( !paintRect.isEmpty()) { - QPainter painter( viewport()); + TQPainter painter( viewport()); painter.translate( -contentsX(), -contentsY()); performPaint( &painter, paintRect.x(), paintRect.y(), paintRect.width(), paintRect.height(), paint.smooth ); @@ -733,7 +733,7 @@ void ImageView::checkPendingOperationsInternal() { if( d->mPendingOperations & SMOOTH_PASS ) { d->mSmoothingSuspended = false; if( doDelayedSmoothing() ) { - QRect visibleRect( contentsX(), contentsY(), visibleWidth(), visibleHeight()); + TQRect visibleRect( contentsX(), contentsY(), visibleWidth(), visibleHeight()); addPendingPaint( true, visibleRect ); } d->mPendingOperations &= ~SMOOTH_PASS; @@ -750,12 +750,12 @@ void ImageView::scheduleOperation( Operation operation ) void ImageView::updateBusyLevels() { if( !d->mPendingPaintTimer.isActive()) { - BusyLevelManager::instance()->setBusyLevel( this, BUSY_NONE ); + BusyLevelManager::instance()->setBusyLevel( TQT_TQOBJECT(this), BUSY_NONE ); } else if( !d->mPendingPaints.isEmpty() && !(*d->mPendingPaints.begin()).smooth ) { - BusyLevelManager::instance()->setBusyLevel( this, BUSY_PAINTING ); + BusyLevelManager::instance()->setBusyLevel( TQT_TQOBJECT(this), BUSY_PAINTING ); } else if(( d->mPendingOperations & SMOOTH_PASS ) || ( !d->mPendingPaints.isEmpty() && (*d->mPendingPaints.begin()).smooth )) { - BusyLevelManager::instance()->setBusyLevel( this, BUSY_SMOOTHING ); + BusyLevelManager::instance()->setBusyLevel( TQT_TQOBJECT(this), BUSY_SMOOTHING ); } else { assert( false ); } @@ -779,20 +779,20 @@ void ImageView::slotBusyLevelChanged( BusyLevel level ) { } // How to do painting: -// When something needs to be erased: QPainter on viewport and eraseRect() -// When whole picture needs to be repainted: fullRepaint() -// When a part of the picture needs to be updated: viewport()->repaint(area,false) +// When something needs to be erased: TQPainter on viewport and eraseRect() +// When whole picture needs to be tqrepainted: fullRepaint() +// When a part of the picture needs to be updated: viewport()->tqrepaint(area,false) // All other paints will be changed to progressive painting. void ImageView::fullRepaint() { if( !viewport()->isUpdatesEnabled()) return; cancelPending(); - viewport()->repaint(false); + viewport()->tqrepaint(false); } void ImageView::cancelPending() { d->mPendingPaints.clear(); - d->mPendingNormalRegion = QRegion(); - d->mPendingSmoothRegion = QRegion(); + d->mPendingNormalRegion = TQRegion(); + d->mPendingSmoothRegion = TQRegion(); d->mPendingPaintTimer.stop(); d->mPendingOperations = 0; updateBusyLevels(); @@ -801,13 +801,13 @@ void ImageView::cancelPending() { //#define DEBUG_RECTS // do the actual painting -void ImageView::performPaint( QPainter* painter, int clipx, int clipy, int clipw, int cliph, bool secondPass ) { +void ImageView::performPaint( TQPainter* painter, int clipx, int clipy, int clipw, int cliph, bool secondPass ) { #ifdef DEBUG_RECTS - static QColor colors[4]={QColor(255,0,0),QColor(0,255,0),QColor(0,0,255),QColor(255,255,0) }; + static TQColor colors[4]={TQColor(255,0,0),TQColor(0,255,0),TQColor(0,0,255),TQColor(255,255,0) }; static int numColor=0; #endif - QTime t; + TQTime t; t.start(); if (d->mDocument->isNull()) { @@ -822,7 +822,7 @@ void ImageView::performPaint( QPainter* painter, int clipx, int clipy, int clipw if( zoom() != 1.0 ) { if (doDelayedSmoothing() && !secondPass) { // Add a second, smoothing pass - addPendingPaint( true, QRect( clipx, clipy, clipw, cliph )); + addPendingPaint( true, TQRect( clipx, clipy, clipw, cliph )); } else { // We need to smooth now smoothAlgo = static_cast<ImageUtils::SmoothAlgorithm>( ImageViewConfig::smoothAlgorithm() ); @@ -830,31 +830,31 @@ void ImageView::performPaint( QPainter* painter, int clipx, int clipy, int clipw } int extraPixels = ImageUtils::extraScalePixels( smoothAlgo, zoom()); - QRect imageRect = d->widgetToImageBounding( QRect(clipx,clipy,clipw,cliph), extraPixels ); - imageRect = imageRect.intersect( QRect( 0, 0, d->mDocument->width(), d->mDocument->height())); - QMemArray< QRect > rects = d->mValidImageArea.intersect( imageRect ).rects(); + TQRect imageRect = d->widgetToImageBounding( TQRect(clipx,clipy,clipw,cliph), extraPixels ); + imageRect = imageRect.intersect( TQRect( 0, 0, d->mDocument->width(), d->mDocument->height())); + TQMemArray< TQRect > rects = TQRegion(d->mValidImageArea.intersect( imageRect )).tqrects(); for( unsigned int i = 1; i < rects.count(); ++i ) { addPendingPaint( secondPass, d->imageToWidget( rects[ i ] )); } - imageRect = rects.count() > 0 ? rects[ 0 ] : QRect(); + imageRect = rects.count() > 0 ? rects[ 0 ] : TQRect(); if (imageRect.isEmpty()) { painter->eraseRect(clipx,clipy,clipw,cliph); return; } - QRect widgetRect = d->imageToWidget( imageRect ); + TQRect widgetRect = d->imageToWidget( imageRect ); if (widgetRect.isEmpty() || imageRect.isEmpty()) { painter->eraseRect(clipx,clipy,clipw,cliph); return; } -// With very large images, just getting a subimage using QImage::copy( QRect ) takes a significant +// With very large images, just getting a subimage using TQImage::copy( TQRect ) takes a significant // portion of time here (even though it's just copying of data - probably because it's a lot of data). -// So don't do any subimage copying but instead use CroppedQImage which just manipulates scanline +// So don't do any subimage copying but instead use CroppedTQImage which just manipulates scanline // pointers. Note however that it's a bit hackish and there may be trouble if any code accesses -// the image data directly as a whole. See CroppedQImage for details. +// the image data directly as a whole. See CroppedTQImage for details. -// QImage image = d->mDocument->image().copy( imageRect ); - ImageUtils::CroppedQImage image( d->mDocument->image(), imageRect ); +// TQImage image = d->mDocument->image().copy( imageRect ); + ImageUtils::CroppedTQImage image( d->mDocument->image(), imageRect ); if( zoom() != 1.0 ) { image=ImageUtils::scale(image,widgetRect.width(),widgetRect.height(), smoothAlgo ); @@ -875,9 +875,9 @@ void ImageView::performPaint( QPainter* painter, int clipx, int clipy, int clipw image = ImageUtils::changeGamma( image, d->mGamma ); } -// Calling normalize() here would make image to be a proper QImage without modified scanlines, -// so that even calling QImage::copy() would work. However, it seems it's not necessary to call -// it here. The code above checks that QImage::copy() or similar doesn't occur (that zoom() != 1.0 +// Calling normalize() here would make image to be a proper TQImage without modified scanlines, +// so that even calling TQImage::copy() would work. However, it seems it's not necessary to call +// it here. The code above checks that TQImage::copy() or similar doesn't occur (that zoom() != 1.0 // is there primarily to avoid that). If any kind of redraw trouble occurs, try uncommenting this // line below first. // image.normalize(); // make it use its own data, if needed @@ -905,10 +905,10 @@ void ImageView::performPaint( QPainter* painter, int clipx, int clipy, int clipw image.setAlphaBuffer(false); } - QRect paintRect( clipx, clipy, clipw, cliph ); - QPixmap buffer( paintRect.size()); + TQRect paintRect( clipx, clipy, clipw, cliph ); + TQPixmap buffer( paintRect.size()); { - QPainter bufferPainter(&buffer); + TQPainter bufferPainter(&buffer); bufferPainter.setBackgroundColor(painter->backgroundColor()); bufferPainter.eraseRect(0,0,paintRect.width(),paintRect.height()); bufferPainter.drawImage(widgetRect.topLeft()-paintRect.topLeft(),image, @@ -916,9 +916,9 @@ void ImageView::performPaint( QPainter* painter, int clipx, int clipy, int clipw } painter->drawPixmap(paintRect.topLeft(),buffer); - if( paintRect.width() * paintRect.height() >= 10000 ) { // ignore small repaints + if( paintRect.width() * paintRect.height() >= 10000 ) { // ignore small tqrepaints // try to do one step in 0.1sec - int size = paintRect.width() * paintRect.height() * 100 / QMAX( t.elapsed(), 1 ); + int size = paintRect.width() * paintRect.height() * 100 / TQMAX( t.elapsed(), 1 ); int maxRepaintSize; if (zoom() == 1.0) { @@ -952,11 +952,11 @@ void ImageView::performPaint( QPainter* painter, int clipx, int clipy, int clipw painter->drawRect(paintRect); #endif - QApplication::flushX(); + TQApplication::flushX(); } -void ImageView::viewportMousePressEvent(QMouseEvent* event) { +void ImageView::viewportMousePressEvent(TQMouseEvent* event) { viewport()->setFocus(); switch (event->button()) { case Qt::LeftButton: @@ -971,13 +971,13 @@ void ImageView::viewportMousePressEvent(QMouseEvent* event) { } -void ImageView::viewportMouseMoveEvent(QMouseEvent* event) { +void ImageView::viewportMouseMoveEvent(TQMouseEvent* event) { selectTool(event->state(), true); d->mTools[d->mToolID]->mouseMoveEvent(event); } -void ImageView::viewportMouseReleaseEvent(QMouseEvent* event) { +void ImageView::viewportMouseReleaseEvent(TQMouseEvent* event) { switch (event->button()) { case Qt::LeftButton: if (event->stateAfter() & Qt::RightButton) { @@ -1011,26 +1011,26 @@ void ImageView::viewportMouseReleaseEvent(QMouseEvent* event) { } -bool ImageView::eventFilter(QObject* obj, QEvent* event) { +bool ImageView::eventFilter(TQObject* obj, TQEvent* event) { switch (event->type()) { - case QEvent::KeyPress: - case QEvent::KeyRelease: - case QEvent::AccelOverride: - return viewportKeyEvent(static_cast<QKeyEvent*>(event)); + case TQEvent::KeyPress: + case TQEvent::KeyRelease: + case TQEvent::AccelOverride: + return viewportKeyEvent(TQT_TQKEYEVENT(event)); - case QEvent::MouseButtonDblClick: + case TQEvent::MouseButtonDblClick: if (d->mToolID==ZOOM) return false; emit doubleClicked(); return true; - // Getting/loosing focus causes repaints, but repainting here is expensive, - // and there's no need to repaint on focus changes, as the focus is not + // Getting/loosing focus causes tqrepaints, but tqrepainting here is expensive, + // and there's no need to tqrepaint on focus changes, as the focus is not // indicated. - case QEvent::FocusIn: - case QEvent::FocusOut: + case TQEvent::FocusIn: + case TQEvent::FocusOut: return true; - case QEvent::Enter: + case TQEvent::Enter: selectTool( kapp->keyboardMouseState(), true ); emitRequestHintDisplay(); break; @@ -1038,29 +1038,29 @@ bool ImageView::eventFilter(QObject* obj, QEvent* event) { default: break; } - return QScrollView::eventFilter(obj,event); + return TQScrollView::eventFilter(obj,event); } -bool ImageView::viewportKeyEvent(QKeyEvent* event) { +bool ImageView::viewportKeyEvent(TQKeyEvent* event) { selectTool(event->stateAfter(), false); return false; } -void ImageView::contentsDragEnterEvent(QDragEnterEvent* event) { - event->accept( QUriDrag::canDecode( event )); +void ImageView::contentsDragEnterEvent(TQDragEnterEvent* event) { + event->accept( TQUriDrag::canDecode( event )); } -void ImageView::contentsDropEvent(QDropEvent* event) { +void ImageView::contentsDropEvent(TQDropEvent* event) { KURL::List list; if( KURLDrag::decode( event, list )) { d->mDocument->setURL( list.first()); } } -void ImageView::keyPressEvent( QKeyEvent *event ) { - QScrollView::keyPressEvent( event ); +void ImageView::keyPressEvent( TQKeyEvent *event ) { + TQScrollView::keyPressEvent( event ); int deltaX, deltaY; if (event->state() != Qt::NoButton) { @@ -1112,7 +1112,7 @@ void ImageView::selectTool(ButtonState state, bool force) { } -void ImageView::wheelEvent(QWheelEvent* event) { +void ImageView::wheelEvent(TQWheelEvent* event) { d->mTools[d->mToolID]->wheelEvent(event); } @@ -1141,8 +1141,8 @@ void ImageView::slotSelectZoom() { int currentItem=d->mZoomCombo->currentItem(); if (currentItem>=int(d->mZoomComboActions.count()) ) { - QString txt=d->mZoomCombo->currentText(); - txt=txt.left(txt.find('%')); + TQString txt=d->mZoomCombo->currentText(); + txt=txt.left(txt.tqfind('%')); double value=KGlobal::locale()->readNumber(txt) / 100.0; updateZoom(ZOOM_FREE, value); } else { @@ -1280,7 +1280,7 @@ void ImageView::slotImageSizeUpdated() { d->mXOffset=0; d->mYOffset=0; - d->mValidImageArea = QRegion(); + d->mValidImageArea = TQRegion(); if (d->mZoomMode!=ZOOM_FREE) { d->mXCenterBeforeAuto=0; d->mYCenterBeforeAuto=0; @@ -1311,9 +1311,9 @@ void ImageView::slotImageSizeUpdated() { fullRepaint(); } -void ImageView::slotImageRectUpdated(const QRect& imageRect) { +void ImageView::slotImageRectUpdated(const TQRect& imageRect) { d->mValidImageArea += imageRect; - viewport()->repaint( d->imageToWidget( imageRect ), false ); + viewport()->tqrepaint( d->imageToWidget( imageRect ), false ); } @@ -1338,8 +1338,8 @@ double ImageView::computeZoomToFit() const { if (d->mDocument->isNull()) { return 1.0; } - QSize size=d->mDocument->image().size(); - size.scale(width(),height(),QSize::ScaleMin); + TQSize size=d->mDocument->image().size(); + size.tqscale(width(),height(),TQSize::ScaleMin); double zoom=double(size.width())/d->mDocument->width(); if (zoom>1.0 && !ImageViewConfig::enlargeSmallImages()) return 1.0; @@ -1350,7 +1350,7 @@ double ImageView::computeZoomToWidth() const { if (d->mDocument->isNull()) { return 1.0; } - int sw = verticalScrollBar()->sizeHint().width(); // geometry is not valid before first show() + int sw = verticalScrollBar()->tqsizeHint().width(); // tqgeometry is not valid before first show() int w = width(); int dw = d->mDocument->width(); switch( vScrollBarMode()) { @@ -1370,7 +1370,7 @@ double ImageView::computeZoomToHeight() const { if (d->mDocument->isNull()) { return 1.0; } - int sh = horizontalScrollBar()->sizeHint().height(); + int sh = horizontalScrollBar()->tqsizeHint().height(); int h = height(); int dh = d->mDocument->height(); switch( vScrollBarMode()) { @@ -1425,15 +1425,15 @@ void ImageView::updateImageOffset() { int zpixHeight=int(d->mDocument->height() * d->mZoom); if (zpixWidth>viewWidth && hScrollBarMode()!=AlwaysOff) { - // use sizeHint() - geometry is not valid before first show() - viewHeight-=horizontalScrollBar()->sizeHint().height(); + // use tqsizeHint() - tqgeometry is not valid before first show() + viewHeight-=horizontalScrollBar()->tqsizeHint().height(); } if (zpixHeight>viewHeight && vScrollBarMode()!=AlwaysOff) { - viewWidth-=verticalScrollBar()->sizeHint().width(); + viewWidth-=verticalScrollBar()->tqsizeHint().width(); } - d->mXOffset=QMAX(0,(viewWidth-zpixWidth)/2); - d->mYOffset=QMAX(0,(viewHeight-zpixHeight)/2); + d->mXOffset=TQMAX(0,(viewWidth-zpixWidth)/2); + d->mYOffset=TQMAX(0,(viewHeight-zpixHeight)/2); } @@ -1457,7 +1457,7 @@ void ImageView::updateZoomActions() { if (d->mZoomMode==ZOOM_FREE) { d->mZoomIn->setEnabled(d->mZoom<MAX_ZOOM); d->mZoomOut->setEnabled(d->mZoom>1/MAX_ZOOM); - QString zoomText=QString("%1%").arg(int(d->mZoom*100)); + TQString zoomText=TQString("%1%").tqarg(int(d->mZoom*100)); d->mZoomCombo->setCurrentText(zoomText); } else { d->mZoomIn->setEnabled(true); diff --git a/src/gvcore/imageview.h b/src/gvcore/imageview.h index 7c1d919..f688e27 100644 --- a/src/gvcore/imageview.h +++ b/src/gvcore/imageview.h @@ -23,32 +23,33 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef IMAGEVIEW_H #define IMAGEVIEW_H -// Qt -#include <qmap.h> -#include <qscrollview.h> -#include <qtimer.h> -#include <qvaluelist.h> +// TQt +#include <tqmap.h> +#include <tqscrollview.h> +#include <tqtimer.h> +#include <tqvaluelist.h> // Local #include "busylevelmanager.h" #include "imageutils/imageutils.h" #include "libgwenview_export.h" -class QEvent; -class QLabel; -class QMouseEvent; -class QPainter; -class QTimer; -class QWheelEvent; +class TQEvent; +class TQLabel; +class TQMouseEvent; +class TQPainter; +class TQTimer; +class TQWheelEvent; class KAction; class KActionCollection; class KToggleAction; -typedef QValueList<KAction *> KActionPtrList; +typedef TQValueList<KAction *> KActionPtrList; namespace Gwenview { class Document; -class LIBGWENVIEW_EXPORT ImageView : public QScrollView { +class LIBGWENVIEW_EXPORT ImageView : public TQScrollView { Q_OBJECT + TQ_OBJECT public: class ToolBase; @@ -64,9 +65,9 @@ public: enum ToolID { SCROLL, ZOOM }; enum ZoomMode { ZOOM_FIT, ZOOM_FIT_WIDTH, ZOOM_FIT_HEIGHT, ZOOM_FREE }; - typedef QMap<ToolID,ToolBase*> Tools; + typedef TQMap<ToolID,ToolBase*> Tools; - ImageView(QWidget* parent,Document*,KActionCollection*); + ImageView(TQWidget* tqparent,Document*,KActionCollection*); ~ImageView(); // Properties @@ -89,34 +90,34 @@ signals: void selectPrevious(); void selectNext(); void doubleClicked(); - void requestContextMenu(const QPoint&); + void requestContextMenu(const TQPoint&); // Emitted whenever an hint should be displayed - void requestHintDisplay(const QString& hint); + void requestHintDisplay(const TQString& hint); // Emitted whenever brightness, contrast or gamma changes void bcgChanged(); protected: - virtual void contentsDragEnterEvent(QDragEnterEvent*); - virtual void contentsDropEvent(QDropEvent*); - virtual void keyPressEvent(QKeyEvent*); + virtual void contentsDragEnterEvent(TQDragEnterEvent*); + virtual void contentsDropEvent(TQDropEvent*); + virtual void keyPressEvent(TQKeyEvent*); private: struct Private; Private* d; struct PendingPaint { - PendingPaint( bool s, const QRect& r ) : rect( r ), smooth( s ) {}; - PendingPaint() {}; // stupid Qt containers - QRect rect; + PendingPaint( bool s, const TQRect& r ) : rect( r ), smooth( s ) {}; + PendingPaint() {}; // stupid TQt containers + TQRect rect; bool smooth; }; enum Operation { CHECK_OPERATIONS = 0, SMOOTH_PASS = 1 << 0 }; - void addPendingPaint( bool smooth, QRect rect = QRect()); - void addPendingPaintInternal( bool smooth, QRect rect = QRect()); - void performPaint( QPainter* painter, int clipx, int clipy, int clipw, int cliph, bool smooth ); + void addPendingPaint( bool smooth, TQRect rect = TQRect()); + void addPendingPaintInternal( bool smooth, TQRect rect = TQRect()); + void performPaint( TQPainter* painter, int clipx, int clipy, int clipw, int cliph, bool smooth ); void limitPaintSize( PendingPaint& paint ); void fullRepaint(); void cancelPending(); @@ -145,7 +146,7 @@ private: void emitSelectNext() { emit selectNext(); } // Used by the zoom tool - QPoint offset() const; + TQPoint offset() const; bool canZoom(bool in) const; KToggleAction* zoomToFit() const; @@ -167,7 +168,7 @@ private slots: void increaseContrast(); void decreaseContrast(); void slotImageSizeUpdated(); - void slotImageRectUpdated(const QRect&); + void slotImageRectUpdated(const TQRect&); void checkPendingOperations(); void loadingStarted(); void slotBusyLevelChanged(BusyLevel); @@ -175,14 +176,14 @@ private slots: protected: // Overloaded methods - bool eventFilter(QObject*, QEvent*); - void viewportMousePressEvent(QMouseEvent*); - void viewportMouseMoveEvent(QMouseEvent*); - void viewportMouseReleaseEvent(QMouseEvent*); - bool viewportKeyEvent(QKeyEvent*); // This one is not inherited, it's called from the eventFilter - void wheelEvent(QWheelEvent* event); - void resizeEvent(QResizeEvent* event); - void drawContents(QPainter* p,int clipx,int clipy,int clipw,int cliph); + bool eventFilter(TQObject*, TQEvent*); + void viewportMousePressEvent(TQMouseEvent*); + void viewportMouseMoveEvent(TQMouseEvent*); + void viewportMouseReleaseEvent(TQMouseEvent*); + bool viewportKeyEvent(TQKeyEvent*); // This one is not inherited, it's called from the eventFilter + void wheelEvent(TQWheelEvent* event); + void resizeEvent(TQResizeEvent* event); + void drawContents(TQPainter* p,int clipx,int clipy,int clipw,int cliph); }; } // namespace diff --git a/src/gvcore/imageviewconfig.kcfg b/src/gvcore/imageviewconfig.kcfg index f13dfad..6424202 100644 --- a/src/gvcore/imageviewconfig.kcfg +++ b/src/gvcore/imageviewconfig.kcfg @@ -1,8 +1,8 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE kcfg SYSTEM "http://www.kde.org/standards/kcfg/1.0/kcfg.dtd"> <kcfg> - <include>qapplication.h</include> - <include>qpalette.h</include> + <include>tqapplication.h</include> + <include>tqpalette.h</include> <kcfgfile name="gwenviewrc"/> <group name="pixmap widget"> <entry name="smoothAlgorithm" key="smooth scale" type="Enum"> @@ -18,7 +18,7 @@ <default>false</default> </entry> <entry name="backgroundColor" key="background color" type="Color"> - <default code="true">QApplication::palette().active().dark()</default> + <default code="true">TQApplication::tqpalette().active().dark()</default> </entry> <entry name="enlargeSmallImages" key="enlarge small images" type="Bool"> <default>false</default> diff --git a/src/gvcore/imageviewcontroller.cpp b/src/gvcore/imageviewcontroller.cpp index cc88687..1ec4218 100644 --- a/src/gvcore/imageviewcontroller.cpp +++ b/src/gvcore/imageviewcontroller.cpp @@ -20,12 +20,12 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include <imageviewcontroller.moc> -// Qt -#include <qcursor.h> -#include <qlayout.h> -#include <qpopupmenu.h> -#include <qvbox.h> -#include <qwidgetstack.h> +// TQt +#include <tqcursor.h> +#include <tqlayout.h> +#include <tqpopupmenu.h> +#include <tqvbox.h> +#include <tqwidgetstack.h> // KDE #include <kaction.h> @@ -64,11 +64,11 @@ namespace Gwenview { */ class XMLGUIBuilder : public KXMLGUIBuilder { public: - XMLGUIBuilder(QWidget* parent) : KXMLGUIBuilder(parent) {} + XMLGUIBuilder(TQWidget* tqparent) : KXMLGUIBuilder(tqparent) {} - virtual QWidget* createContainer(QWidget *parent, int index, const QDomElement &element, int &id) { + virtual TQWidget* createContainer(TQWidget *tqparent, int index, const TQDomElement &element, int &id) { if (element.tagName().lower() == "toolbar") { - return KXMLGUIBuilder::createContainer(parent, index, element, id); + return KXMLGUIBuilder::createContainer(tqparent, index, element, id); } else { return 0; } @@ -89,17 +89,17 @@ struct ImageViewController::Private { Document* mDocument; KActionCollection* mActionCollection; - QWidget* mContainer; + TQWidget* mContainer; KToolBar* mToolBar; KXMLGUIFactory* mFactory; XMLGUIBuilder* mBuilder; - QWidgetStack* mStack; + TQWidgetStack* mStack; ImageView* mImageView; KActionPtrList mImageViewActions; // Hide cursor stuff - QTimer* mAutoHideTimer; + TQTimer* mAutoHideTimer; bool mCursorHidden; KParts::ReadOnlyPart* mPlayerPart; @@ -111,7 +111,7 @@ struct ImageViewController::Private { void setXMLGUIClient(KXMLGUIClient* client) { - QPtrList<KXMLGUIClient> list=mFactory->clients(); + TQPtrList<KXMLGUIClient> list=mFactory->clients(); KXMLGUIClient* oldClient=list.getFirst(); if (oldClient) { mFactory->removeClient(oldClient); @@ -144,17 +144,17 @@ struct ImageViewController::Private { } mPlayerPart=0; - QString mimeType=KMimeType::findByURL(mDocument->url())->name(); + TQString mimeType=KMimeType::findByURL(mDocument->url())->name(); KService::Ptr service = KServiceTypeProfile::preferredService(mimeType, "KParts/ReadOnlyPart"); if (!service) { kdWarning() << "Couldn't find a KPart for " << mimeType << endl; return; } - QString library=service->library(); + TQString library=service->library(); Q_ASSERT(!library.isNull()); LOG("Library:" << library); - mPlayerPart = KParts::ComponentFactory::createPartInstanceFromService<KParts::ReadOnlyPart>(service, mStack, 0, mStack, 0); + mPlayerPart = KParts::ComponentFactory::createPartInstanceFromService<KParts::ReadOnlyPart>(service, TQT_TQWIDGET(mStack), 0, TQT_TQOBJECT(mStack), 0); if (!mPlayerPart) { kdWarning() << "Failed to instantiate KPart from library " << library << endl; return; @@ -219,7 +219,7 @@ struct ImageViewController::Private { void updateFullScreenBarPosition() { - int mouseY=mStack->mapFromGlobal(QCursor::pos()).y(); + int mouseY=mStack->mapFromGlobal(TQCursor::pos()).y(); bool visible = mFullScreenBar->y()==0; if (visible && mouseY>mFullScreenBar->height()) { @@ -264,23 +264,23 @@ struct ImageViewController::Private { //------------------------------------------------------------------------ -ImageViewController::ImageViewController(QWidget* parent, Document* document, KActionCollection* actionCollection) -: QObject(parent) { +ImageViewController::ImageViewController(TQWidget* tqparent, Document* document, KActionCollection* actionCollection) +: TQObject(tqparent) { d=new Private; d->mImageViewController=this; d->mDocument=document; d->mActionCollection=actionCollection; - d->mAutoHideTimer=new QTimer(this); + d->mAutoHideTimer=new TQTimer(this); d->mCursorHidden=false; - d->mContainer=new QWidget(parent); + d->mContainer=new TQWidget(tqparent); d->mContainer->setMinimumWidth(1); // Make sure we can resize the toolbar smaller than its minimum size - QVBoxLayout* layout=new QVBoxLayout(d->mContainer); + TQVBoxLayout* tqlayout=new TQVBoxLayout(d->mContainer); d->mToolBar=new KToolBar(d->mContainer, "", true); - layout->add(d->mToolBar); - d->mStack=new QWidgetStack(d->mContainer); - layout->add(d->mStack); + tqlayout->add(d->mToolBar); + d->mStack=new TQWidgetStack(d->mContainer); + tqlayout->add(d->mStack); d->mImageView=new ImageView(d->mStack, document, actionCollection); d->mStack->addWidget(d->mImageView); @@ -294,22 +294,22 @@ ImageViewController::ImageViewController(QWidget* parent, Document* document, KA d->mFullScreen=false; d->mFullScreenBar=0; - connect(d->mDocument,SIGNAL(loaded(const KURL&)), - this,SLOT(slotLoaded()) ); + connect(d->mDocument,TQT_SIGNAL(loaded(const KURL&)), + this,TQT_SLOT(slotLoaded()) ); - connect(d->mImageView, SIGNAL(requestContextMenu(const QPoint&)), - this, SLOT(openImageViewContextMenu(const QPoint&)) ); + connect(d->mImageView, TQT_SIGNAL(requestContextMenu(const TQPoint&)), + this, TQT_SLOT(openImageViewContextMenu(const TQPoint&)) ); - connect(d->mImageView, SIGNAL(requestHintDisplay(const QString&)), - this, SIGNAL(requestHintDisplay(const QString&)) ); + connect(d->mImageView, TQT_SIGNAL(requestHintDisplay(const TQString&)), + this, TQT_SIGNAL(requestHintDisplay(const TQString&)) ); - connect(d->mAutoHideTimer,SIGNAL(timeout()), - this,SLOT(slotAutoHide()) ); + connect(d->mAutoHideTimer,TQT_SIGNAL(timeout()), + this,TQT_SLOT(slotAutoHide()) ); // Forward Image view signals - connect(d->mImageView, SIGNAL(selectPrevious()), SIGNAL(selectPrevious()) ); - connect(d->mImageView, SIGNAL(selectNext()), SIGNAL(selectNext()) ); - connect(d->mImageView, SIGNAL(doubleClicked()), SIGNAL(doubleClicked()) ); + connect(d->mImageView, TQT_SIGNAL(selectPrevious()), TQT_SIGNAL(selectPrevious()) ); + connect(d->mImageView, TQT_SIGNAL(selectNext()), TQT_SIGNAL(selectNext()) ); + connect(d->mImageView, TQT_SIGNAL(doubleClicked()), TQT_SIGNAL(doubleClicked()) ); } @@ -320,7 +320,7 @@ ImageViewController::~ImageViewController() { void ImageViewController::setFocus() { - QWidget* view; + TQWidget* view; if (d->mPlayerPart) { view = d->mPlayerPart->widget(); } else { @@ -351,7 +351,7 @@ void ImageViewController::setFullScreen(bool fullScreen) { } } else { d->mAutoHideTimer->stop(); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); d->mCursorHidden=false; } @@ -387,23 +387,23 @@ void ImageViewController::setImageViewActions(const KActionPtrList& actions) { void ImageViewController::slotAutoHide() { if (d->mFullScreenBar) { // Do not auto hide if the cursor is over the bar - QPoint pos=d->mFullScreenBar->mapFromGlobal(QCursor::pos()); - if (d->mFullScreenBar->rect().contains(pos)) { + TQPoint pos=d->mFullScreenBar->mapFromGlobal(TQCursor::pos()); + if (TQT_TQRECT_OBJECT(d->mFullScreenBar->rect()).tqcontains(pos)) { d->restartAutoHideTimer(); return; } } // Only hide cursor if we are not over a dialog - QWidget* widget = KApplication::kApplication()->activeWindow(); - if (!widget || !widget->inherits("QDialog")) { - QApplication::setOverrideCursor(blankCursor); + TQWidget* widget = TQT_TQWIDGET(KApplication::kApplication()->activeWindow()); + if (!widget || !widget->inherits(TQDIALOG_OBJECT_NAME_STRING)) { + TQApplication::setOverrideCursor(blankCursor); d->mCursorHidden=true; } } -QWidget* ImageViewController::widget() const { +TQWidget* ImageViewController::widget() const { return d->mContainer; } @@ -417,16 +417,16 @@ void ImageViewController::updateFromSettings() { * This event filter monitors mouse moves and make sure the position of the * fullscreen bar is updated. */ -bool ImageViewController::eventFilter(QObject* object, QEvent* event) { +bool ImageViewController::eventFilter(TQObject* object, TQEvent* event) { if (!d->mFullScreen) return false; - if (!event->type()==QEvent::MouseMove) return false; + if (!event->type()==TQEvent::MouseMove) return false; // Check we must filter this object. This is an application filter, so we // have to check we are not dealing with another object. bool isAChildOfStack=false; - QObject* parentObject; - for (parentObject=object->parent(); parentObject; parentObject=parentObject->parent()) { - if (parentObject==d->mStack) { + TQObject* tqparentObject; + for (tqparentObject=object->tqparent(); tqparentObject; tqparentObject=tqparentObject->tqparent()) { + if (TQT_BASE_OBJECT(tqparentObject)==TQT_BASE_OBJECT(d->mStack)) { isAChildOfStack=true; break; } @@ -435,15 +435,15 @@ bool ImageViewController::eventFilter(QObject* object, QEvent* event) { d->updateFullScreenBarPosition(); - if (event->type()==QEvent::MouseMove) { + if (event->type()==TQEvent::MouseMove) { d->mCursorHidden=false; d->restartAutoHideTimer(); } if (d->mCursorHidden) { - QApplication::setOverrideCursor(blankCursor,true); + TQApplication::setOverrideCursor(blankCursor,true); } else { - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } return false; @@ -453,14 +453,14 @@ bool ImageViewController::eventFilter(QObject* object, QEvent* event) { /** * Little helper to plug an action if it exists */ -inline void plugAction(QPopupMenu* menu, KActionCollection* actionCollection, const char* actionName) { +inline void plugAction(TQPopupMenu* menu, KActionCollection* actionCollection, const char* actionName) { KAction* action=actionCollection->action(actionName); if (action) action->plug(menu); } -void ImageViewController::openImageViewContextMenu(const QPoint& pos) { - QPopupMenu menu(d->mImageView); +void ImageViewController::openImageViewContextMenu(const TQPoint& pos) { + TQPopupMenu menu(d->mImageView); bool noImage=d->mDocument->filename().isEmpty(); bool validImage=!d->mDocument->isNull(); @@ -490,7 +490,7 @@ void ImageViewController::openImageViewContextMenu(const QPoint& pos) { if (validImage) { menu.insertSeparator(); - QPopupMenu* editMenu=new QPopupMenu(&menu); + TQPopupMenu* editMenu=new TQPopupMenu(&menu); plugAction(editMenu, d->mActionCollection, "rotate_left"); plugAction(editMenu, d->mActionCollection, "rotate_right"); plugAction(editMenu, d->mActionCollection, "mirror"); diff --git a/src/gvcore/imageviewcontroller.h b/src/gvcore/imageviewcontroller.h index 9fe775e..641660b 100644 --- a/src/gvcore/imageviewcontroller.h +++ b/src/gvcore/imageviewcontroller.h @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef IMAGEVIEWCONTROLLER_H #define IMAGEVIEWCONTROLLER_H -// Qt -#include <qobject.h> +// TQt +#include <tqobject.h> // KDE #include <kaction.h> @@ -30,8 +30,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Local #include "libgwenview_export.h" -class QPoint; -class QWidget; +class TQPoint; +class TQWidget; class KToolBar; @@ -42,13 +42,14 @@ class Document; class ImageView; -class LIBGWENVIEW_EXPORT ImageViewController : public QObject { +class LIBGWENVIEW_EXPORT ImageViewController : public TQObject { Q_OBJECT + TQ_OBJECT public: - ImageViewController(QWidget* parent, Document*, KActionCollection*); + ImageViewController(TQWidget* tqparent, Document*, KActionCollection*); ~ImageViewController(); - QWidget* widget() const; + TQWidget* widget() const; void setImageViewActions(const KActionPtrList&); @@ -58,20 +59,20 @@ public: void setFocus(); protected: - virtual bool eventFilter(QObject*, QEvent*); + virtual bool eventFilter(TQObject*, TQEvent*); public slots: void updateFromSettings(); signals: - void requestHintDisplay(const QString&); + void requestHintDisplay(const TQString&); void selectPrevious(); void selectNext(); void doubleClicked(); private slots: void slotLoaded(); - void openImageViewContextMenu(const QPoint&); + void openImageViewContextMenu(const TQPoint&); void slotAutoHide(); private: diff --git a/src/gvcore/imageviewtools.cpp b/src/gvcore/imageviewtools.cpp index 5cb8fdd..699868a 100644 --- a/src/gvcore/imageviewtools.cpp +++ b/src/gvcore/imageviewtools.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aurélien Gâteau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -34,10 +34,10 @@ namespace Gwenview { // Helper function -static QCursor loadCursor(const QString& name) { - QString path; - path=locate("data", QString("gwenview/cursors/%1.png").arg(name)); - return QCursor(QPixmap(path)); +static TQCursor loadCursor(const TQString& name) { + TQString path; + path=locate("data", TQString("gwenview/cursors/%1.png").tqarg(name)); + return TQCursor(TQPixmap(path)); } @@ -52,22 +52,22 @@ ImageView::ToolBase::ToolBase(ImageView* view) ImageView::ToolBase::~ToolBase() {} -void ImageView::ToolBase::mouseMoveEvent(QMouseEvent*) {} -void ImageView::ToolBase::leftButtonPressEvent(QMouseEvent*) {} -void ImageView::ToolBase::leftButtonReleaseEvent(QMouseEvent*) {} +void ImageView::ToolBase::mouseMoveEvent(TQMouseEvent*) {} +void ImageView::ToolBase::leftButtonPressEvent(TQMouseEvent*) {} +void ImageView::ToolBase::leftButtonReleaseEvent(TQMouseEvent*) {} -void ImageView::ToolBase::midButtonReleaseEvent(QMouseEvent*) { +void ImageView::ToolBase::midButtonReleaseEvent(TQMouseEvent*) { mView->zoomToFit()->activate(); } -void ImageView::ToolBase::rightButtonPressEvent(QMouseEvent* event) { +void ImageView::ToolBase::rightButtonPressEvent(TQMouseEvent* event) { emit mView->requestContextMenu(event->globalPos()); } -void ImageView::ToolBase::rightButtonReleaseEvent(QMouseEvent*) { +void ImageView::ToolBase::rightButtonReleaseEvent(TQMouseEvent*) { } -void ImageView::ToolBase::wheelEvent(QWheelEvent* event) { +void ImageView::ToolBase::wheelEvent(TQWheelEvent* event) { event->accept(); } @@ -87,12 +87,12 @@ ImageView::ZoomTool::ZoomTool(ImageView* view) } -void ImageView::ZoomTool::zoomTo(const QPoint& pos, bool in) { +void ImageView::ZoomTool::zoomTo(const TQPoint& pos, bool in) { if (!mView->canZoom(in)) return; - QPoint centerPos=QPoint(mView->visibleWidth(), mView->visibleHeight())/2; + TQPoint centerPos=TQPoint(mView->visibleWidth(), mView->visibleHeight())/2; // Compute image position - QPoint imgPos=mView->viewportToContents(pos) - mView->offset(); + TQPoint imgPos=mView->viewportToContents(pos) - mView->offset(); double newZoom=mView->computeZoom(in); imgPos*=newZoom/mView->zoom(); @@ -101,22 +101,22 @@ void ImageView::ZoomTool::zoomTo(const QPoint& pos, bool in) { } -void ImageView::ZoomTool::leftButtonReleaseEvent(QMouseEvent* event) { +void ImageView::ZoomTool::leftButtonReleaseEvent(TQMouseEvent* event) { zoomTo(event->pos(), true); } -void ImageView::ZoomTool::wheelEvent(QWheelEvent* event) { +void ImageView::ZoomTool::wheelEvent(TQWheelEvent* event) { zoomTo(event->pos(), event->delta()>0); event->accept(); } -void ImageView::ZoomTool::rightButtonPressEvent(QMouseEvent*) { +void ImageView::ZoomTool::rightButtonPressEvent(TQMouseEvent*) { } -void ImageView::ZoomTool::rightButtonReleaseEvent(QMouseEvent* event) { +void ImageView::ZoomTool::rightButtonReleaseEvent(TQMouseEvent* event) { zoomTo(event->pos(), false); } @@ -126,7 +126,7 @@ void ImageView::ZoomTool::updateCursor() { } -QString ImageView::ZoomTool::hint() const { +TQString ImageView::ZoomTool::hint() const { return i18n("Left click to zoom in, right click to zoom out. You can also use the mouse wheel."); } @@ -143,7 +143,7 @@ ImageView::ScrollTool::ScrollTool(ImageView* view) } -void ImageView::ScrollTool::leftButtonPressEvent(QMouseEvent* event) { +void ImageView::ScrollTool::leftButtonPressEvent(TQMouseEvent* event) { mScrollStartX=event->x(); mScrollStartY=event->y(); mView->viewport()->setCursor(SizeAllCursor); @@ -151,7 +151,7 @@ void ImageView::ScrollTool::leftButtonPressEvent(QMouseEvent* event) { } -void ImageView::ScrollTool::mouseMoveEvent(QMouseEvent* event) { +void ImageView::ScrollTool::mouseMoveEvent(TQMouseEvent* event) { if (!mDragStarted) return; int deltaX,deltaY; @@ -165,7 +165,7 @@ void ImageView::ScrollTool::mouseMoveEvent(QMouseEvent* event) { } -void ImageView::ScrollTool::leftButtonReleaseEvent(QMouseEvent*) { +void ImageView::ScrollTool::leftButtonReleaseEvent(TQMouseEvent*) { if (!mDragStarted) return; mDragStarted=false; @@ -173,11 +173,11 @@ void ImageView::ScrollTool::leftButtonReleaseEvent(QMouseEvent*) { } -void ImageView::ScrollTool::wheelEvent(QWheelEvent* event) { +void ImageView::ScrollTool::wheelEvent(TQWheelEvent* event) { if (ImageViewConfig::mouseWheelScroll()) { int deltaX, deltaY; - if (event->state() & AltButton || event->orientation()==Horizontal) { + if (event->state() & AltButton || event->orientation()==Qt::Horizontal) { deltaX = event->delta(); deltaY = 0; } else { @@ -205,7 +205,7 @@ void ImageView::ScrollTool::updateCursor() { } -QString ImageView::ScrollTool::hint() const { +TQString ImageView::ScrollTool::hint() const { return i18n("Drag to move the image, middle-click to toggle auto-zoom. Hold the Control key to switch to the zoom tool."); } diff --git a/src/gvcore/imageviewtools.h b/src/gvcore/imageviewtools.h index f0d175b..5e23694 100644 --- a/src/gvcore/imageviewtools.h +++ b/src/gvcore/imageviewtools.h @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef IMAGEVIEWTOOLS_H #define IMAGEVIEWTOOLS_H -// Qt -#include <qcursor.h> +// TQt +#include <tqcursor.h> // Local #include "imageview.h" @@ -36,42 +36,42 @@ protected: public: ToolBase(ImageView* view); virtual ~ToolBase(); - virtual void mouseMoveEvent(QMouseEvent*); + virtual void mouseMoveEvent(TQMouseEvent*); - virtual void leftButtonPressEvent(QMouseEvent*); - virtual void leftButtonReleaseEvent(QMouseEvent*); + virtual void leftButtonPressEvent(TQMouseEvent*); + virtual void leftButtonReleaseEvent(TQMouseEvent*); - virtual void midButtonReleaseEvent(QMouseEvent*); + virtual void midButtonReleaseEvent(TQMouseEvent*); - virtual void rightButtonPressEvent(QMouseEvent* event); - virtual void rightButtonReleaseEvent(QMouseEvent*); + virtual void rightButtonPressEvent(TQMouseEvent* event); + virtual void rightButtonReleaseEvent(TQMouseEvent*); - virtual void wheelEvent(QWheelEvent* event); + virtual void wheelEvent(TQWheelEvent* event); virtual void updateCursor(); /** * Return a hint about the use of the tool */ - virtual QString hint() const=0; + virtual TQString hint() const=0; }; class ImageView::ZoomTool : public ImageView::ToolBase { private: - QCursor mZoomCursor; - void zoomTo(const QPoint& pos, bool in); + TQCursor mZoomCursor; + void zoomTo(const TQPoint& pos, bool in); public: ZoomTool(ImageView* view); - void leftButtonReleaseEvent(QMouseEvent* event); + void leftButtonReleaseEvent(TQMouseEvent* event); - void wheelEvent(QWheelEvent* event); - void rightButtonPressEvent(QMouseEvent*); - void rightButtonReleaseEvent(QMouseEvent* event); + void wheelEvent(TQWheelEvent* event); + void rightButtonPressEvent(TQMouseEvent*); + void rightButtonReleaseEvent(TQMouseEvent* event); void updateCursor(); - virtual QString hint() const; + virtual TQString hint() const; }; @@ -81,13 +81,13 @@ class ImageView::ScrollTool : public ImageView::ToolBase { public: ScrollTool(ImageView* view); - void leftButtonPressEvent(QMouseEvent* event); - void mouseMoveEvent(QMouseEvent* event); - void leftButtonReleaseEvent(QMouseEvent*); - void wheelEvent(QWheelEvent* event); + void leftButtonPressEvent(TQMouseEvent* event); + void mouseMoveEvent(TQMouseEvent* event); + void leftButtonReleaseEvent(TQMouseEvent*); + void wheelEvent(TQWheelEvent* event); void updateCursor(); - virtual QString hint() const; + virtual TQString hint() const; }; diff --git a/src/gvcore/inputdialog.cpp b/src/gvcore/inputdialog.cpp index e273969..cdd4267 100644 --- a/src/gvcore/inputdialog.cpp +++ b/src/gvcore/inputdialog.cpp @@ -21,9 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // Self #include "inputdialog.moc" -// Qt -#include <qlabel.h> -#include <qvbox.h> +// TQt +#include <tqlabel.h> +#include <tqvbox.h> // KDE #include <klineedit.h> @@ -32,25 +32,25 @@ namespace Gwenview { struct InputDialog::Private { KLineEdit* mLineEdit; - QLabel* mLabel; + TQLabel* mLabel; }; -InputDialog::InputDialog(QWidget* parent) -: KDialogBase(parent, "InputDialog", true, QString::null, +InputDialog::InputDialog(TQWidget* tqparent) +: KDialogBase(tqparent, "InputDialog", true, TQString(), KDialogBase::Ok|KDialogBase::Cancel) { d = new Private; - QVBox* page = makeVBoxMainWidget(); - d->mLabel = new QLabel(page); + TQVBox* page = makeVBoxMainWidget(); + d->mLabel = new TQLabel(page); d->mLineEdit = new KLineEdit(page); d->mLineEdit->setFocus(); setMinimumWidth(350); - connect(d->mLineEdit, SIGNAL(textChanged(const QString&)), - this, SLOT(updateButtons()) ); + connect(d->mLineEdit, TQT_SIGNAL(textChanged(const TQString&)), + this, TQT_SLOT(updateButtons()) ); } @@ -59,7 +59,7 @@ InputDialog::~InputDialog() { } -void InputDialog::setLabel(const QString& label) { +void InputDialog::setLabel(const TQString& label) { d->mLabel->setText(label); } diff --git a/src/gvcore/inputdialog.h b/src/gvcore/inputdialog.h index 09817d7..d34d465 100644 --- a/src/gvcore/inputdialog.h +++ b/src/gvcore/inputdialog.h @@ -36,10 +36,11 @@ namespace Gwenview { */ class InputDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - InputDialog(QWidget* parent); + InputDialog(TQWidget* tqparent); ~InputDialog(); - void setLabel(const QString& label); + void setLabel(const TQString& label); KLineEdit* lineEdit() const; private slots: diff --git a/src/gvcore/jpegformattype.cpp b/src/gvcore/jpegformattype.cpp index ccb020e..26dee4e 100644 --- a/src/gvcore/jpegformattype.cpp +++ b/src/gvcore/jpegformattype.cpp @@ -35,8 +35,8 @@ extern "C" { #undef const } -// Qt -#include <qdatetime.h> +// TQt +#include <tqdatetime.h> // KDE #include <kdebug.h> @@ -72,9 +72,9 @@ struct JPEGSourceManager : public jpeg_source_mgr { int valid_buffer_length; size_t skip_input_bytes; bool at_eof; - QRect change_rect; - QRect old_change_rect; - QTime decoder_timestamp; + TQRect change_rect; + TQRect old_change_rect; + TQTime decoder_timestamp; bool final_pass; bool decoding_done; bool do_progressive; @@ -169,13 +169,13 @@ struct JPEGSourceManager : public jpeg_source_mgr { // JPEGFormat // //----------------------------------------------------------------------------- -class JPEGFormat : public QImageFormat { +class JPEGFormat : public TQImageFormat { public: JPEGFormat(); virtual ~JPEGFormat(); - virtual int decode(QImage& img, QImageConsumer* consumer, + virtual int decode(TQImage& img, TQImageConsumer* consumer, const uchar* buffer, int length); private: @@ -216,7 +216,7 @@ JPEGFormat::~JPEGFormat() { * return < 0 means "fatal error in image decoding, don't call me ever again" */ -int JPEGFormat::decode(QImage& image, QImageConsumer* consumer, const uchar* buffer, int length) { +int JPEGFormat::decode(TQImage& image, TQImageConsumer* consumer, const uchar* buffer, int length) { #ifdef JPEG_DEBUG qDebug("JPEGFormat::decode(%p, %p, %p, %d)", &image, consumer, buffer, length); @@ -278,7 +278,7 @@ int JPEGFormat::decode(QImage& image, QImageConsumer* consumer, const uchar* buf mDecompress.src->bytes_in_buffer = (size_t) mSourceManager.valid_buffer_length; #ifdef BUFFER_DEBUG - qDebug("buffer contains %d bytes", mSourceManager.valid_buffer_length); + qDebug("buffer tqcontains %d bytes", mSourceManager.valid_buffer_length); #endif if(mState == INIT) { @@ -319,7 +319,7 @@ int JPEGFormat::decode(QImage& image, QImageConsumer* consumer, const uchar* buf } else if ( mDecompress.output_components == 1 ) { image.create( mDecompress.output_width, mDecompress.output_height, 8, 256 ); for (int i=0; i<256; i++) { - image.setColor(i, qRgb(i,i,i)); + image.setColor(i, tqRgb(i,i,i)); } } @@ -388,17 +388,17 @@ again: // Expand 24->32 bpp. for (int j=oldoutput_scanline; j<oldoutput_scanline+completed_scanlines; j++) { uchar *in = image.scanLine(j) + mDecompress.output_width * 3; - QRgb *out = (QRgb*)image.scanLine(j); + TQRgb *out = (TQRgb*)image.scanLine(j); for (uint i=mDecompress.output_width; i--; ) { in-=3; - out[i] = qRgb(in[0], in[1], in[2]); + out[i] = tqRgb(in[0], in[1], in[2]); } } } if(consumer && completed_scanlines) { - QRect r(0, oldoutput_scanline, mDecompress.output_width, completed_scanlines); + TQRect r(0, oldoutput_scanline, mDecompress.output_width, completed_scanlines); #ifdef JPEG_DEBUG qDebug("changing %d/%d %d/%d", r.x(), r.y(), r.width(), r.height()); #endif @@ -407,10 +407,10 @@ again: if ( mSourceManager.decoder_timestamp.elapsed() >= MAX_CONSUMING_TIME ) { if( !mSourceManager.old_change_rect.isEmpty()) { consumer->changed(mSourceManager.old_change_rect); - mSourceManager.old_change_rect = QRect(); + mSourceManager.old_change_rect = TQRect(); } consumer->changed(mSourceManager.change_rect); - mSourceManager.change_rect = QRect(); + mSourceManager.change_rect = TQRect(); mSourceManager.decoder_timestamp.restart(); } } @@ -422,7 +422,7 @@ again: mSourceManager.decoding_done = mSourceManager.final_pass && mDecompress.input_scan_number == mDecompress.output_scan_number; if ( !mSourceManager.decoding_done ) { mSourceManager.old_change_rect |= mSourceManager.change_rect; - mSourceManager.change_rect = QRect(); + mSourceManager.change_rect = TQRect(); } } else { mSourceManager.decoding_done = true; @@ -508,7 +508,7 @@ again: // JPEGFormatType // //----------------------------------------------------------------------------- -QImageFormat* JPEGFormatType::decoderFor(const uchar* buffer, int length) { +TQImageFormat* JPEGFormatType::decoderFor(const uchar* buffer, int length) { if(length < 3) return 0; if(buffer[0] == 0377 && diff --git a/src/gvcore/jpegformattype.h b/src/gvcore/jpegformattype.h index b92b69d..3aeed7a 100644 --- a/src/gvcore/jpegformattype.h +++ b/src/gvcore/jpegformattype.h @@ -29,7 +29,7 @@ #ifndef gvjpegformattype_h #define gvjpegformattype_h -#include <qasyncimageio.h> +#include <tqasyncimageio.h> namespace Gwenview { @@ -38,9 +38,9 @@ namespace Gwenview { * * An incremental loader factory for JPEG's. */ -class JPEGFormatType : public QImageFormatType { +class JPEGFormatType : public TQImageFormatType { public: - QImageFormat* decoderFor(const uchar* buffer, int length); + TQImageFormat* decoderFor(const uchar* buffer, int length); const char* formatName() const; }; diff --git a/src/gvcore/mimetypeutils.cpp b/src/gvcore/mimetypeutils.cpp index b2a7fb9..e5a210e 100644 --- a/src/gvcore/mimetypeutils.cpp +++ b/src/gvcore/mimetypeutils.cpp @@ -20,8 +20,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #include "mimetypeutils.h" -// Qt -#include <qstringlist.h> +// TQt +#include <tqstringlist.h> // KDE #include <kapplication.h> @@ -39,8 +39,8 @@ namespace Gwenview { namespace MimeTypeUtils { -const QStringList& rasterImageMimeTypes() { - static QStringList list; +const TQStringList& rasterImageMimeTypes() { + static TQStringList list; if (list.isEmpty()) { list=KImageIO::mimeTypes(KImageIO::Reading); list.append("image/x-xcf-gimp"); @@ -52,14 +52,14 @@ const QStringList& rasterImageMimeTypes() { } -Kind mimeTypeKind(const QString& mimeType) { +Kind mimeTypeKind(const TQString& mimeType) { if (mimeType.startsWith("inode/directory")) { return KIND_DIR; } - if (Archive::mimeTypes().contains(mimeType)) { + if (Archive::mimeTypes().tqcontains(mimeType)) { return KIND_ARCHIVE; } - if (rasterImageMimeTypes().contains(mimeType)) { + if (rasterImageMimeTypes().tqcontains(mimeType)) { return KIND_RASTER_IMAGE; } @@ -73,7 +73,7 @@ Kind fileItemKind(const KFileItem* item) { Kind urlKind(const KURL& url) { - QString mimeType; + TQString mimeType; if (url.isLocalFile()) { mimeType=KMimeType::findByURL(url)->name(); } else { diff --git a/src/gvcore/mimetypeutils.h b/src/gvcore/mimetypeutils.h index 0c13a5f..24dd21b 100644 --- a/src/gvcore/mimetypeutils.h +++ b/src/gvcore/mimetypeutils.h @@ -27,18 +27,18 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. class KFileItem; class KURL; -class QString; -class QStringList; +class TQString; +class TQStringList; namespace Gwenview { namespace MimeTypeUtils { enum Kind { KIND_UNKNOWN, KIND_DIR, KIND_ARCHIVE, KIND_FILE, KIND_RASTER_IMAGE }; -LIBGWENVIEW_EXPORT const QStringList& rasterImageMimeTypes(); +LIBGWENVIEW_EXPORT const TQStringList& rasterImageMimeTypes(); Kind fileItemKind(const KFileItem*); Kind urlKind(const KURL&); -Kind mimeTypeKind(const QString& mimeType); +Kind mimeTypeKind(const TQString& mimeType); } // namespace FileUtils diff --git a/src/gvcore/mngformattype.cpp b/src/gvcore/mngformattype.cpp index 60f64ef..f94f475 100644 --- a/src/gvcore/mngformattype.cpp +++ b/src/gvcore/mngformattype.cpp @@ -1,11 +1,11 @@ -// this code is copied from Qt, with fixes for not finishing decoding +// this code is copied from TQt, with fixes for not finishing decoding // prematurely /* The actual patch is: ===== --- /opt/_q/src/kernel/qmngio.cpp 2004-05-04 18:28:15.000000000 +0200 +++ gvmngformattype.cpp 2005-04-13 16:11:50.000000000 +0200 -@@ -411,8 +417,11 @@ int QMNGFormat::decode( QImage& img, QIm +@@ -411,8 +417,11 @@ int TQMNGFormat::decode( TQImage& img, TQIm } losttime += losingtimer.elapsed(); @@ -19,7 +19,7 @@ losingtimer.start(); image = 0; -@@ -422,6 +431,13 @@ int QMNGFormat::decode( QImage& img, QIm +@@ -422,6 +431,13 @@ int TQMNGFormat::decode( TQImage& img, TQIm // Move back unused tail memcpy(buffer,buffer+ubuffer,nbuffer); } @@ -39,33 +39,33 @@ /**************************************************************************** ** ** -** Implementation of MNG QImage IOHandler +** Implementation of MNG TQImage IOHandler ** ** Created : 970521 ** ** Copyright (C) 1997-2004 Trolltech AS. All rights reserved. ** -** This file is part of the kernel module of the Qt GUI Toolkit. +** This file is part of the kernel module of the TQt GUI Toolkit. ** ** This file may be distributed under the terms of the Q Public License ** as defined by Trolltech AS of Norway and appearing in the file -** LICENSE.QPL included in the packaging of this file. +** LICENSE.TQPL included in the packaging of this file. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. -** See http://www.trolltech.com/qpl/ for QPL licensing information. +** information about TQt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for TQPL licensing information. ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are @@ -75,40 +75,40 @@ #include <config.h> -#ifndef QT_CLEAN_NAMESPACE -#define QT_CLEAN_NAMESPACE +#ifndef TQT_CLEAN_NAMESPACE +#define TQT_CLEAN_NAMESPACE #endif -#include "qdatetime.h" +#include "tqdatetime.h" #include "mngformattype.h" -//#ifndef QT_NO_IMAGEIO_MNG +//#ifndef TQT_NO_IMAGEIO_MNG #ifdef HAVE_LIBMNG -#include "qimage.h" -#include "qasyncimageio.h" -#include "qiodevice.h" +#include "tqimage.h" +#include "tqasyncimageio.h" +#include "tqiodevice.h" // Define XMD_H prohibits the included headers of libmng.h to typedef INT32. // This is needed for Borland with STL support, since in that case, INT32 is // already defined by some Borland header. #define XMD_H -#if defined(Q_OS_UNIXWARE) +#if defined(TQ_OS_UNIXWARE) # define HAVE_BOOLEAN // libjpeg under Unixware seems to need this #endif #include <libmng.h> #include <stdlib.h> -#ifndef QT_NO_ASYNC_IMAGE_IO +#ifndef TQT_NO_ASYNC_IMAGE_IO namespace Gwenview { -class MNGFormat : public QImageFormat { +class MNGFormat : public TQImageFormat { public: MNGFormat(); virtual ~MNGFormat(); - int decode(QImage& img, QImageConsumer* consumer, + int decode(TQImage& img, TQImageConsumer* consumer, const uchar* buffer, int length); bool openstream() @@ -177,7 +177,7 @@ public: memset(image->bits(),0,iWidth*iHeight*4); consumer->setSize(iWidth,iHeight); mng_set_canvasstyle(handle, - QImage::systemByteOrder() == QImage::LittleEndian + TQImage::systemByteOrder() == TQImage::LittleEndian ? MNG_CANVAS_BGRA8 : MNG_CANVAS_ARGB8 ); return TRUE; } @@ -187,7 +187,7 @@ public: } mng_bool refresh( mng_uint32 x, mng_uint32 y, mng_uint32 w, mng_uint32 h ) { - QRect r(x,y,w,h); + TQRect r(x,y,w,h); consumer->changed(r); consumer->setFramePeriod(0); consumer->frameDone(); @@ -220,8 +220,8 @@ private: uint nbuffer; // Timing - QTime timer; - QTime losingtimer; + TQTime timer; + TQTime losingtimer; int losttime; void enlargeBuffer(uint n) @@ -236,25 +236,25 @@ private: const uchar* data; uint ndata; uint ubuffer; - QImageConsumer* consumer; - QImage* image; + TQImageConsumer* consumer; + TQImage* image; }; -class MNGFormatType : public QImageFormatType +class MNGFormatType : public TQImageFormatType { - QImageFormat* decoderFor(const uchar* buffer, int length); + TQImageFormat* decoderFor(const uchar* buffer, int length); const char* formatName() const; }; /* - \class QMNGFormat qmngio.h + \class TQMNGFormat qmngio.h \brief Incremental image decoder for MNG image format. \ingroup images \ingroup graphics - This subclass of QImageFormat decodes MNG format images, + This subclass of TQImageFormat decodes MNG format images, including animated MNGs. Animated MNG images are standard MNG images. The MNG standard @@ -280,20 +280,20 @@ TODO: decide on this point. gIFg gives disposal types, so it can be done. */ /* - \class QMNGFormatType qasyncimageio.h + \class TQMNGFormatType qasyncimageio.h \brief Incremental image decoder for MNG image format. \ingroup images \ingroup graphics \ingroup io - This subclass of QImageFormatType recognizes MNG - format images, creating a QMNGFormat when required. An instance + This subclass of TQImageFormatType recognizes MNG + format images, creating a TQMNGFormat when required. An instance of this class is created automatically before any other factories, so you should have no need for such objects. */ -QImageFormat* MNGFormatType::decoderFor( const uchar* buffer, int length ) +TQImageFormat* MNGFormatType::decoderFor( const uchar* buffer, int length ) { if (length < 8) return 0; @@ -313,7 +313,7 @@ QImageFormat* MNGFormatType::decoderFor( const uchar* buffer, int length ) && buffer[5]==10 && buffer[6]==26 && buffer[7]==10 -#ifdef QT_NO_IMAGEIO_PNG // if we don't have native PNG support use libmng +#ifdef TQT_NO_IMAGEIO_PNG // if we don't have native PNG support use libmng || buffer[0]==137 // PNG signature && buffer[1]=='P' && buffer[2]=='N' @@ -335,7 +335,7 @@ const char* MNGFormatType::formatName() const /*! - Constructs a QMNGFormat. + Constructs a TQMNGFormat. */ MNGFormat::MNGFormat() { @@ -348,7 +348,7 @@ MNGFormat::MNGFormat() } /* - Destroys a QMNGFormat. + Destroys a TQMNGFormat. */ MNGFormat::~MNGFormat() { @@ -425,7 +425,7 @@ static void memfree( mng_ptr iPtr, mng_size_t /*iLen*/ ) Returns the number of bytes consumed. */ -int MNGFormat::decode( QImage& img, QImageConsumer* cons, +int MNGFormat::decode( TQImage& img, TQImageConsumer* cons, const uchar* buf, int length ) { consumer = cons; @@ -486,9 +486,9 @@ int MNGFormat::decode( QImage& img, QImageConsumer* cons, static MNGFormatType* globalMngFormatTypeObject = 0; -#endif // QT_NO_ASYNC_IMAGE_IO +#endif // TQT_NO_ASYNC_IMAGE_IO -#ifndef QT_NO_ASYNC_IMAGE_IO +#ifndef TQT_NO_ASYNC_IMAGE_IO void gvCleanupMngIO() { if ( globalMngFormatTypeObject ) { @@ -503,7 +503,7 @@ void gvInitMngIO() static bool done = FALSE; if ( !done ) { done = TRUE; -#ifndef QT_NO_ASYNC_IMAGE_IO +#ifndef TQT_NO_ASYNC_IMAGE_IO globalMngFormatTypeObject = new MNGFormatType; qAddPostRoutine( gvCleanupMngIO ); #endif diff --git a/src/gvcore/mngformattype.h b/src/gvcore/mngformattype.h index 9e60b64..39d5c46 100644 --- a/src/gvcore/mngformattype.h +++ b/src/gvcore/mngformattype.h @@ -1,36 +1,36 @@ -// this code is copied from Qt, with fixes for not finishing decoding +// this code is copied from TQt, with fixes for not finishing decoding // prematurely /**************************************************************************** ** ** -** Definition of MNG QImage IOHandler +** Definition of MNG TQImage IOHandler ** ** Created : 970521 ** ** Copyright (C) 2000 Trolltech AS. All rights reserved. ** -** This file is part of the kernel module of the Qt GUI Toolkit. +** This file is part of the kernel module of the TQt GUI Toolkit. ** ** This file may be distributed under the terms of the Q Public License ** as defined by Trolltech AS of Norway and appearing in the file -** LICENSE.QPL included in the packaging of this file. +** LICENSE.TQPL included in the packaging of this file. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. -** See http://www.trolltech.com/qpl/ for QPL licensing information. +** information about TQt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for TQPL licensing information. ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are @@ -38,11 +38,11 @@ ** **********************************************************************/ -#ifndef QMNGIO_H -#define QMNGIO_H +#ifndef TQMNGIO_H +#define TQMNGIO_H -#ifndef QT_H -#endif // QT_H +#ifndef TQT_H +#endif // TQT_H namespace Gwenview { class MNG @@ -52,4 +52,4 @@ public: }; } // namespace -#endif // QMNGIO_H +#endif // TQMNGIO_H diff --git a/src/gvcore/pngformattype.cpp b/src/gvcore/pngformattype.cpp index 36c1064..d89032a 100644 --- a/src/gvcore/pngformattype.cpp +++ b/src/gvcore/pngformattype.cpp @@ -1,36 +1,36 @@ -// this code is copied from Qt, with code added to actually call consumer +// this code is copied from TQt, with code added to actually call consumer // methods that inform about the progress of loading /**************************************************************************** ** ** -** Implementation of PNG QImage IOHandler +** Implementation of PNG TQImage IOHandler ** ** Created : 970521 ** ** Copyright (C) 1992-2003 Trolltech AS. All rights reserved. ** -** This file is part of the kernel module of the Qt GUI Toolkit. +** This file is part of the kernel module of the TQt GUI Toolkit. ** ** This file may be distributed under the terms of the Q Public License ** as defined by Trolltech AS of Norway and appearing in the file -** LICENSE.QPL included in the packaging of this file. +** LICENSE.TQPL included in the packaging of this file. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. -** See http://www.trolltech.com/qpl/ for QPL licensing information. +** information about TQt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for TQPL licensing information. ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are @@ -44,12 +44,12 @@ namespace Gwenview { -class PNGFormat : public QImageFormat { +class PNGFormat : public TQImageFormat { public: PNGFormat(); virtual ~PNGFormat(); - int decode(QImage& img, QImageConsumer* consumer, + int decode(TQImage& img, TQImageConsumer* consumer, const uchar* buffer, int length); void info(png_structp png_ptr, png_infop info); @@ -73,21 +73,21 @@ private: png_infop info_ptr; // Temporary locals during single data-chunk processing - QImageConsumer* consumer; - QImage* image; + TQImageConsumer* consumer; + TQImage* image; int unused_data; - QRect changed_rect; + TQRect changed_rect; }; /* - \class QPNGFormat qpngio.h - \brief The QPNGFormat class provides an incremental image decoder for PNG + \class TQPNGFormat qpngio.h + \brief The TQPNGFormat class provides an incremental image decoder for PNG image format. \ingroup images \ingroup graphics - This subclass of QImageFormat decodes PNG format images, + This subclass of TQImageFormat decodes PNG format images, including animated PNGs. Animated PNG images are standard PNG images. The PNG standard @@ -113,21 +113,21 @@ private: */ /* - \class QPNGFormatType qasyncimageio.h - \brief The QPNGFormatType class provides an incremental image decoder + \class TQPNGFormatType qasyncimageio.h + \brief The TQPNGFormatType class provides an incremental image decoder for PNG image format. \ingroup images \ingroup graphics \ingroup io - This subclass of QImageFormatType recognizes PNG format images, creating - a QPNGFormat when required. An instance of this class is created + This subclass of TQImageFormatType recognizes PNG format images, creating + a TQPNGFormat when required. An instance of this class is created automatically before any other factories, so you should have no need for such objects. */ -QImageFormat* PNGFormatType::decoderFor( +TQImageFormat* PNGFormatType::decoderFor( const uchar* buffer, int length) { if (length < 8) return 0; @@ -192,7 +192,7 @@ static void qt_png_warning(png_structp /*png_ptr*/, png_const_charp message) } static -void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr ) +void setup_qt( TQImage& image, png_structp png_ptr, png_infop info_ptr ) { // For now, we will use the PC monitor gamma, if you own a Mac, you'd better use 1.8 const double SCREEN_GAMMA=2.2; @@ -214,10 +214,10 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr ) if ( bit_depth == 1 && info_ptr->channels == 1 ) { png_set_invert_mono( png_ptr ); png_read_update_info( png_ptr, info_ptr ); - if (!image.create( width, height, 1, 2, QImage::BigEndian )) + if (!image.create( width, height, 1, 2, TQImage::BigEndian )) return; - image.setColor( 1, qRgb(0,0,0) ); - image.setColor( 0, qRgb(255,255,255) ); + image.setColor( 1, tqRgb(0,0,0) ); + image.setColor( 0, tqRgb(255,255,255) ); } else if (bit_depth == 16 && png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { png_set_expand(png_ptr); png_set_strip_16(png_ptr); @@ -227,7 +227,7 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr ) return; image.setAlphaBuffer(TRUE); - if (QImage::systemByteOrder() == QImage::BigEndian) + if (TQImage::systemByteOrder() == TQImage::BigEndian) png_set_swap_alpha(png_ptr); png_read_update_info(png_ptr, info_ptr); @@ -242,13 +242,13 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr ) return; for (int i=0; i<ncols; i++) { int c = i*255/(ncols-1); - image.setColor( i, qRgba(c,c,c,0xff) ); + image.setColor( i, tqRgba(c,c,c,0xff) ); } if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) { const int g = info_ptr->trans_values.gray; if (g < ncols) { image.setAlphaBuffer(TRUE); - image.setColor(g, image.color(g) & RGB_MASK); + image.setColor(g, image.color(g) & TQRGB_MASK); } } } @@ -263,13 +263,13 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr ) png_get_IHDR(png_ptr, info_ptr, &width, &height, &bit_depth, &color_type, 0, 0, 0); if (!image.create(width, height, bit_depth, info_ptr->num_palette, - QImage::BigEndian)) + TQImage::BigEndian)) return; int i = 0; if ( png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS) ) { image.setAlphaBuffer( TRUE ); while ( i < info_ptr->num_trans ) { - image.setColor(i, qRgba( + image.setColor(i, tqRgba( info_ptr->palette[i].red, info_ptr->palette[i].green, info_ptr->palette[i].blue, @@ -280,7 +280,7 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr ) } } while ( i < info_ptr->num_palette ) { - image.setColor(i, qRgba( + image.setColor(i, tqRgba( info_ptr->palette[i].red, info_ptr->palette[i].green, info_ptr->palette[i].blue, @@ -306,22 +306,22 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr ) if (!(color_type & PNG_COLOR_MASK_ALPHA) && !png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS)) { png_set_filler(png_ptr, 0xff, - QImage::systemByteOrder() == QImage::BigEndian ? + TQImage::systemByteOrder() == TQImage::BigEndian ? PNG_FILLER_BEFORE : PNG_FILLER_AFTER); // We want 4 bytes, but it isn't an alpha channel } else { image.setAlphaBuffer(TRUE); } - if ( QImage::systemByteOrder() == QImage::BigEndian ) { + if ( TQImage::systemByteOrder() == TQImage::BigEndian ) { png_set_swap_alpha(png_ptr); } png_read_update_info(png_ptr, info_ptr); } - // Qt==ARGB==Big(ARGB)==Little(BGRA) - if ( QImage::systemByteOrder() == QImage::LittleEndian ) { + // TQt==ARGB==Big(ARGB)==Little(BGRA) + if ( TQImage::systemByteOrder() == TQImage::LittleEndian ) { png_set_bgr(png_ptr); } } @@ -329,7 +329,7 @@ void setup_qt( QImage& image, png_structp png_ptr, png_infop info_ptr ) /*! - Constructs a QPNGFormat object. + Constructs a TQPNGFormat object. */ PNGFormat::PNGFormat() { @@ -343,7 +343,7 @@ PNGFormat::PNGFormat() /*! - Destroys a QPNGFormat object. + Destroys a TQPNGFormat object. */ PNGFormat::~PNGFormat() { @@ -357,7 +357,7 @@ PNGFormat::~PNGFormat() Returns the number of bytes consumed. */ -int PNGFormat::decode(QImage& img, QImageConsumer* cons, +int PNGFormat::decode(TQImage& img, TQImageConsumer* cons, const uchar* buffer, int length) { consumer = cons; @@ -404,7 +404,7 @@ int PNGFormat::decode(QImage& img, QImageConsumer* cons, } state = Inside; - changed_rect = QRect(); + changed_rect = TQRect(); } if ( !png_ptr ) return 0; @@ -421,7 +421,7 @@ int PNGFormat::decode(QImage& img, QImageConsumer* cons, if( !changed_rect.isNull()) { consumer->changed( changed_rect ); - changed_rect = QRect(); + changed_rect = TQRect(); } if ( state != Inside ) { @@ -445,7 +445,7 @@ void PNGFormat::row(png_structp png, png_bytep new_row, { uchar* old_row = image->scanLine(row_num); png_progressive_combine_row(png, old_row, new_row); - changed_rect |= QRect( 0, row_num, image->width(), 1 ); + changed_rect |= TQRect( 0, row_num, image->width(), 1 ); } @@ -458,7 +458,7 @@ void PNGFormat::end(png_structp png, png_infop info) base_offy = offy; first_frame = 0; } - image->setOffset(QPoint(offx,offy)); + image->setOffset(TQPoint(offx,offy)); image->setDotsPerMeterX(png_get_x_pixels_per_meter(png,info)); image->setDotsPerMeterY(png_get_y_pixels_per_meter(png,info)); png_textp text_ptr; @@ -470,10 +470,10 @@ void PNGFormat::end(png_structp png, png_infop info) } if( !changed_rect.isNull()) { consumer->changed( changed_rect ); - changed_rect = QRect(); + changed_rect = TQRect(); } - QRect r(0,0,image->width(),image->height()); - consumer->frameDone(QPoint(offx,offy),r); + TQRect r(0,0,image->width(),image->height()); + consumer->frameDone(TQPoint(offx,offy),r); consumer->end(); state = FrameStart; unused_data = (int)png->buffer_size; // Since libpng doesn't tell us @@ -482,7 +482,7 @@ void PNGFormat::end(png_structp png, png_infop info) #ifdef PNG_USER_CHUNKS_SUPPORTED /* -#ifndef QT_NO_IMAGE_TEXT +#ifndef TQT_NO_IMAGE_TEXT static bool skip(png_uint_32& max, png_bytep& data) { while (*data) { @@ -506,15 +506,15 @@ int PNGFormat::user_chunk(png_structp png, if ( 0==qstrcmp((char*)png->chunk_name, "gIFg") && length == 4 ) { - //QPNGImageWriter::DisposalMethod disposal = - // (QPNGImageWriter::DisposalMethod)data[0]; + //TQPNGImageWriter::DisposalMethod disposal = + // (TQPNGImageWriter::DisposalMethod)data[0]; // ### TODO: use the disposal method int ms_delay = ((data[2] << 8) | data[3])*10; consumer->setFramePeriod(ms_delay); return 1; } else if ( 0==qstrcmp((char*)png->chunk_name, "gIFx") && length == 13 ) { - if ( qstrncmp((char*)data,"NETSCAPE2.0",11)==0 ) { + if ( tqstrncmp((char*)data,"NETSCAPE2.0",11)==0 ) { int looping = (data[0xC]<<8)|data[0xB]; consumer->setLooping(looping); return 1; @@ -546,7 +546,7 @@ int PNGFormat::user_chunk(png_structp png, if ( !skip(length,data) ) return 0; const char* text_utf8 = (const char*)data; if ( !skip(length,data) ) return 0; - QString text = QString::fromUtf8(text_utf8); + TQString text = TQString::fromUtf8(text_utf8); image->setText(keyword,lang[0] ? lang : 0,text); return 1; } diff --git a/src/gvcore/pngformattype.h b/src/gvcore/pngformattype.h index 920ee0c..80d9c20 100644 --- a/src/gvcore/pngformattype.h +++ b/src/gvcore/pngformattype.h @@ -1,36 +1,36 @@ -// this code is copied from Qt, with code added to actually call consumer +// this code is copied from TQt, with code added to actually call consumer // methods that inform about the progress of loading /**************************************************************************** ** ** -** Implementation of PNG QImage IOHandler +** Implementation of PNG TQImage IOHandler ** ** Created : 970521 ** ** Copyright (C) 1992-2003 Trolltech AS. All rights reserved. ** -** This file is part of the kernel module of the Qt GUI Toolkit. +** This file is part of the kernel module of the TQt GUI Toolkit. ** ** This file may be distributed under the terms of the Q Public License ** as defined by Trolltech AS of Norway and appearing in the file -** LICENSE.QPL included in the packaging of this file. +** LICENSE.TQPL included in the packaging of this file. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. -** See http://www.trolltech.com/qpl/ for QPL licensing information. +** information about TQt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for TQPL licensing information. ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are @@ -41,7 +41,7 @@ #ifndef gvpngformattype_h #define gvpngformattype_h -#include <qasyncimageio.h> +#include <tqasyncimageio.h> namespace Gwenview { @@ -50,9 +50,9 @@ namespace Gwenview { * * An incremental loader factory for PNG's. */ -class PNGFormatType : public QImageFormatType { +class PNGFormatType : public TQImageFormatType { public: - QImageFormat* decoderFor(const uchar* buffer, int length); + TQImageFormat* decoderFor(const uchar* buffer, int length); const char* formatName() const; }; diff --git a/src/gvcore/printdialog.cpp b/src/gvcore/printdialog.cpp index cce06fb..2359793 100644 --- a/src/gvcore/printdialog.cpp +++ b/src/gvcore/printdialog.cpp @@ -18,12 +18,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -// Qt -#include <qcheckbox.h> -#include <qlayout.h> -#include <qpainter.h> -#include <qradiobutton.h> -#include <qvbuttongroup.h> +// TQt +#include <tqcheckbox.h> +#include <tqlayout.h> +#include <tqpainter.h> +#include <tqradiobutton.h> +#include <tqvbuttongroup.h> // KDE #include <kcombobox.h> @@ -44,7 +44,7 @@ namespace Gwenview { const char* STR_TRUE="true"; const char* STR_FALSE="false"; -static inline Unit stringToUnit(const QString& unit) { +static inline Unit stringToUnit(const TQString& unit) { if (unit == i18n("Millimeters")) { return GV_MILLIMETERS; } else if (unit == i18n("Centimeters")) { @@ -54,7 +54,7 @@ static inline Unit stringToUnit(const QString& unit) { } } -static inline QString unitToString(Unit unit) { +static inline TQString unitToString(Unit unit) { if (unit == GV_MILLIMETERS) { return i18n("Millimeters"); } else if (unit == GV_CENTIMETERS) { @@ -76,30 +76,30 @@ static inline double unitToMM(Unit unit) { } -PrintDialogPage::PrintDialogPage( Document* document, QWidget *parent, const char *name ) - : KPrintDialogPage( parent, name ) { +PrintDialogPage::PrintDialogPage( Document* document, TQWidget *tqparent, const char *name ) + : KPrintDialogPage( tqparent, name ) { mDocument = document; mContent = new PrintDialogPageBase(this); setTitle( mContent->caption() ); - QVBoxLayout *layout = new QVBoxLayout( this ); - layout->addWidget( mContent ); + TQVBoxLayout *tqlayout = new TQVBoxLayout( this ); + tqlayout->addWidget( mContent ); - connect(mContent->mWidth, SIGNAL( valueChanged( double )), SLOT( slotWidthChanged( double ))); - connect(mContent->mHeight, SIGNAL( valueChanged( double )), SLOT( slotHeightChanged( double ))); - connect(mContent->mKeepRatio, SIGNAL( toggled( bool )), SLOT( toggleRatio( bool ))); - connect(mContent->mUnit, SIGNAL(activated(const QString &)), SLOT(slotUnitChanged(const QString& ))); + connect(mContent->mWidth, TQT_SIGNAL( valueChanged( double )), TQT_SLOT( slotWidthChanged( double ))); + connect(mContent->mHeight, TQT_SIGNAL( valueChanged( double )), TQT_SLOT( slotHeightChanged( double ))); + connect(mContent->mKeepRatio, TQT_SIGNAL( toggled( bool )), TQT_SLOT( toggleRatio( bool ))); + connect(mContent->mUnit, TQT_SIGNAL(activated(const TQString &)), TQT_SLOT(slotUnitChanged(const TQString& ))); mPreviousUnit = GV_MILLIMETERS; } PrintDialogPage::~PrintDialogPage() {} -void PrintDialogPage::getOptions( QMap<QString,QString>& opts, bool /*incldef*/ ) { - opts["app-gwenview-position"] = QString::number(getPosition(mContent->mPosition->currentText())); +void PrintDialogPage::getOptions( TQMap<TQString,TQString>& opts, bool /*incldef*/ ) { + opts["app-gwenview-position"] = TQString::number(getPosition(mContent->mPosition->currentText())); opts["app-gwenview-printFilename"] = mContent->mAddFileName->isChecked() ? STR_TRUE : STR_FALSE; opts["app-gwenview-printComment"] = mContent->mAddComment->isChecked() ? STR_TRUE : STR_FALSE; - opts["app-gwenview-scale"] = QString::number( + opts["app-gwenview-scale"] = TQString::number( mContent->mNoScale->isChecked() ? GV_NOSCALE : mContent->mFitToPage->isChecked() ? GV_FITTOPAGE : GV_SCALE); @@ -107,16 +107,16 @@ void PrintDialogPage::getOptions( QMap<QString,QString>& opts, bool /*incldef*/ opts["app-gwenview-enlargeToFit"] = mContent->mEnlargeToFit->isChecked() ? STR_TRUE : STR_FALSE; opts["app-gwenview-scaleKeepRatio"] = mContent->mKeepRatio->isChecked() ? STR_TRUE : STR_FALSE; - opts["app-gwenview-scaleUnit"] = QString::number(stringToUnit(mContent->mUnit->currentText())); - opts["app-gwenview-scaleWidth"] = QString::number( scaleWidth() ); - opts["app-gwenview-scaleHeight"] = QString::number( scaleHeight() ); + opts["app-gwenview-scaleUnit"] = TQString::number(stringToUnit(mContent->mUnit->currentText())); + opts["app-gwenview-scaleWidth"] = TQString::number( scaleWidth() ); + opts["app-gwenview-scaleHeight"] = TQString::number( scaleHeight() ); } -void PrintDialogPage::setOptions( const QMap<QString,QString>& opts ) { +void PrintDialogPage::setOptions( const TQMap<TQString,TQString>& opts ) { int val; bool ok; - QString stVal; + TQString stVal; val = opts["app-gwenview-position"].toInt( &ok ); if (ok) { @@ -168,58 +168,58 @@ void PrintDialogPage::setScaleHeight( double value ) { mContent->mHeight->setValue(value); } -int PrintDialogPage::getPosition(const QString& align) { - int alignment; +int PrintDialogPage::getPosition(const TQString& align) { + int tqalignment; if (align == i18n("Central-Left")) { - alignment = Qt::AlignLeft | Qt::AlignVCenter; + tqalignment = TQt::AlignLeft | TQt::AlignVCenter; } else if (align == i18n("Central-Right")) { - alignment = Qt::AlignRight | Qt::AlignVCenter; + tqalignment = TQt::AlignRight | TQt::AlignVCenter; } else if (align == i18n("Top-Left")) { - alignment = Qt::AlignTop | Qt::AlignLeft; + tqalignment = TQt::AlignTop | TQt::AlignLeft; } else if (align == i18n("Top-Right")) { - alignment = Qt::AlignTop | Qt::AlignRight; + tqalignment = TQt::AlignTop | TQt::AlignRight; } else if (align == i18n("Bottom-Left")) { - alignment = Qt::AlignBottom | Qt::AlignLeft; + tqalignment = TQt::AlignBottom | TQt::AlignLeft; } else if (align == i18n("Bottom-Right")) { - alignment = Qt::AlignBottom | Qt::AlignRight; + tqalignment = TQt::AlignBottom | TQt::AlignRight; } else if (align == i18n("Top-Central")) { - alignment = Qt::AlignTop | Qt::AlignHCenter; + tqalignment = TQt::AlignTop | TQt::AlignHCenter; } else if (align == i18n("Bottom-Central")) { - alignment = Qt::AlignBottom | Qt::AlignHCenter; + tqalignment = TQt::AlignBottom | TQt::AlignHCenter; } else { // Central - alignment = Qt::AlignCenter; // Qt::AlignHCenter || Qt::AlignVCenter + tqalignment = TQt::AlignCenter; // TQt::AlignHCenter || TQt::AlignVCenter } - return alignment; + return tqalignment; } -QString PrintDialogPage::setPosition(int align) { - QString alignment; - - if (align == (Qt::AlignLeft | Qt::AlignVCenter)) { - alignment = i18n("Central-Left"); - } else if (align == (Qt::AlignRight | Qt::AlignVCenter)) { - alignment = i18n("Central-Right"); - } else if (align == (Qt::AlignTop | Qt::AlignLeft)) { - alignment = i18n("Top-Left"); - } else if (align == (Qt::AlignTop | Qt::AlignRight)) { - alignment = i18n("Top-Right"); - } else if (align == (Qt::AlignBottom | Qt::AlignLeft)) { - alignment = i18n("Bottom-Left"); - } else if (align == (Qt::AlignBottom | Qt::AlignRight)) { - alignment = i18n("Bottom-Right"); - } else if (align == (Qt::AlignTop | Qt::AlignHCenter)) { - alignment = i18n("Top-Central"); - } else if (align == (Qt::AlignBottom | Qt::AlignHCenter)) { - alignment = i18n("Bottom-Central"); +TQString PrintDialogPage::setPosition(int align) { + TQString tqalignment; + + if (align == (TQt::AlignLeft | TQt::AlignVCenter)) { + tqalignment = i18n("Central-Left"); + } else if (align == (TQt::AlignRight | TQt::AlignVCenter)) { + tqalignment = i18n("Central-Right"); + } else if (align == (TQt::AlignTop | TQt::AlignLeft)) { + tqalignment = i18n("Top-Left"); + } else if (align == (TQt::AlignTop | TQt::AlignRight)) { + tqalignment = i18n("Top-Right"); + } else if (align == (TQt::AlignBottom | TQt::AlignLeft)) { + tqalignment = i18n("Bottom-Left"); + } else if (align == (TQt::AlignBottom | TQt::AlignRight)) { + tqalignment = i18n("Bottom-Right"); + } else if (align == (TQt::AlignTop | TQt::AlignHCenter)) { + tqalignment = i18n("Top-Central"); + } else if (align == (TQt::AlignBottom | TQt::AlignHCenter)) { + tqalignment = i18n("Bottom-Central"); } else { - // Central: Qt::AlignCenter or (Qt::AlignHCenter || Qt::AlignVCenter) - alignment = i18n("Central"); + // Central: TQt::AlignCenter or (TQt::AlignHCenter || TQt::AlignVCenter) + tqalignment = i18n("Central"); } - return alignment; + return tqalignment; } // SLOTS @@ -275,7 +275,7 @@ void PrintDialogPage::toggleRatio(bool enable) { } -void PrintDialogPage::slotUnitChanged(const QString& string) { +void PrintDialogPage::slotUnitChanged(const TQString& string) { Unit newUnit = stringToUnit(string); double ratio = unitToMM(mPreviousUnit) / unitToMM(newUnit); diff --git a/src/gvcore/printdialog.h b/src/gvcore/printdialog.h index 63ff4d7..2dc9f24 100644 --- a/src/gvcore/printdialog.h +++ b/src/gvcore/printdialog.h @@ -21,9 +21,9 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef PRINTDIALOG_H #define PRINTDIALOG_H -//Qt -#include <qfontmetrics.h> -#include <qstring.h> +//TQt +#include <tqfontmetrics.h> +#include <tqstring.h> // KDE #include <kdockwidget.h> @@ -48,17 +48,18 @@ enum ScaleId { class LIBGWENVIEW_EXPORT PrintDialogPage : public KPrintDialogPage { Q_OBJECT + TQ_OBJECT public: - PrintDialogPage( Document* document, QWidget *parent = 0L, const char *name = 0 ); + PrintDialogPage( Document* document, TQWidget *tqparent = 0L, const char *name = 0 ); ~PrintDialogPage(); - virtual void getOptions(QMap<QString,QString>& opts, bool incldef = false); - virtual void setOptions(const QMap<QString,QString>& opts); + virtual void getOptions(TQMap<TQString,TQString>& opts, bool incldef = false); + virtual void setOptions(const TQMap<TQString,TQString>& opts); private slots: void toggleRatio(bool enable); - void slotUnitChanged(const QString& string); + void slotUnitChanged(const TQString& string); void slotHeightChanged(double value); void slotWidthChanged(double value); @@ -67,8 +68,8 @@ private: double scaleHeight() const; void setScaleWidth(double pixels); void setScaleHeight(double pixels); - int getPosition(const QString& align); - QString setPosition(int align); + int getPosition(const TQString& align); + TQString setPosition(int align); Document *mDocument; PrintDialogPageBase* mContent; diff --git a/src/gvcore/printdialogpagebase.ui b/src/gvcore/printdialogpagebase.ui index f5d5c8c..5cd3c40 100644 --- a/src/gvcore/printdialogpagebase.ui +++ b/src/gvcore/printdialogpagebase.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.2" stdsetdef="1"> <class>PrintDialogPageBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>PrintDialogPageBase</cstring> </property> - <property name="geometry"> + <property name="tqgeometry"> <rect> <x>0</x> <y>0</y> @@ -22,15 +22,15 @@ <property name="margin"> <number>0</number> </property> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout2</cstring> + <cstring>tqlayout2</cstring> </property> <hbox> <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -98,7 +98,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>101</width> <height>21</height> @@ -107,7 +107,7 @@ </spacer> </hbox> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>mAddFileName</cstring> </property> @@ -118,7 +118,7 @@ <bool>true</bool> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>mAddComment</cstring> </property> @@ -129,7 +129,7 @@ <string></string> </property> </widget> - <widget class="QButtonGroup"> + <widget class="TQButtonGroup"> <property name="name"> <cstring>mScaleGroup</cstring> </property> @@ -140,7 +140,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>mNoScale</cstring> </property> @@ -154,7 +154,7 @@ <number>1</number> </property> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>mFitToPage</cstring> </property> @@ -168,9 +168,9 @@ <number>2</number> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout4</cstring> + <cstring>tqlayout4</cstring> </property> <hbox> <property name="name"> @@ -186,14 +186,14 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> </size> </property> </spacer> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>mEnlargeToFit</cstring> </property> @@ -214,7 +214,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>240</width> <height>21</height> @@ -223,7 +223,7 @@ </spacer> </hbox> </widget> - <widget class="QRadioButton"> + <widget class="TQRadioButton"> <property name="name"> <cstring>mScale</cstring> </property> @@ -234,9 +234,9 @@ <number>3</number> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout4</cstring> + <cstring>tqlayout4</cstring> </property> <hbox> <property name="name"> @@ -252,7 +252,7 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>20</width> <height>20</height> @@ -279,7 +279,7 @@ <number>2</number> </property> </widget> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel2</cstring> </property> @@ -330,7 +330,7 @@ <bool>false</bool> </property> </widget> - <widget class="QCheckBox"> + <widget class="TQCheckBox"> <property name="name"> <cstring>mKeepRatio</cstring> </property> @@ -351,7 +351,7 @@ <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>16</width> <height>20</height> @@ -398,7 +398,7 @@ <slot>setEnabled(bool)</slot> </connection> </connections> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> <includehints> <includehint>kcombobox.h</includehint> <includehint>knuminput.h</includehint> diff --git a/src/gvcore/qxcfi.cpp b/src/gvcore/qxcfi.cpp index d25e0f0..f6da18f 100644 --- a/src/gvcore/qxcfi.cpp +++ b/src/gvcore/qxcfi.cpp @@ -1,5 +1,5 @@ /* - * qxcfi.cpp: A Qt 3 plug-in for reading GIMP XCF image files + * qxcfi.cpp: A TQt 3 plug-in for reading GIMP XCF image files * Copyright (C) 2001 lignum Computing, Inc. <allen@lignumcomputing.com> * $Id: qxcfi.cpp 531593 2006-04-19 15:46:52Z gateau $ * @@ -19,16 +19,16 @@ * */ -#include <qiodevice.h> +#include <tqiodevice.h> #include <kdeversion.h> #include <stdlib.h> #include "qxcfi.h" -// Change a QRgb value's alpha only. (an optimization) -inline QRgb qRgba ( QRgb rgb, int a ) +// Change a TQRgb value's alpha only. (an optimization) +inline TQRgb tqRgba ( TQRgb rgb, int a ) { - return ( ( a & 0xff ) << 24 | ( rgb & RGB_MASK ) ); + return ( ( a & 0xff ) << 24 | ( rgb & TQRGB_MASK ) ); } @@ -379,8 +379,8 @@ XCFImageFormat::XCFImageFormat() { } -bool XCFImageFormat::installIOHandler ( const QString& ) { - QImageIO::defineIOHandler( "XCF", "gimp xcf", 0, +bool XCFImageFormat::installIOHandler ( const TQString& ) { + TQImageIO::defineIOHandler( "XCF", "gimp xcf", 0, &XCFImageFormat::readXCF, #ifdef TMP_WRITE &XCFImageFormat::writeXCF ); @@ -392,13 +392,13 @@ bool XCFImageFormat::installIOHandler ( const QString& ) { void XCFImageFormat::registerFormat() { - QImageIO::defineIOHandler( "XCF","^gimp xcf", + TQImageIO::defineIOHandler( "XCF","^gimp xcf", 0,XCFImageFormat::readXCF,0L); } /*! - * The Qt QImageIO architecture invokes this routine to read the image. + * The TQt TQImageIO architecture invokes this routine to read the image. * The file (or other data stream) is already open and the * initial string indicating a XCF file has been matched (but the stream * is positioned at its beginning). @@ -410,11 +410,11 @@ void XCFImageFormat::registerFormat() { * is suspect. * * Any failures while reading the XCF image are reported by the - * QImage::status() method. + * TQImage::status() method. * - * \param image_io the QImageIO object connected to the XCF image. + * \param image_io the TQImageIO object connected to the XCF image. */ -void XCFImageFormat::readXCF ( QImageIO* image_io ) +void XCFImageFormat::readXCF ( TQImageIO* image_io ) { XCFImage xcf_image; @@ -446,10 +446,10 @@ void XCFImageFormat::readXCF ( QImageIO* image_io ) // all the data of all layers before beginning to construct the // merged image). - QValueStack< Q_INT32 > layer_offsets; + TQValueStack< TQ_INT32 > layer_offsets; while ( true ) { - Q_INT32 layer_offset; + TQ_INT32 layer_offset; xcf_io >> layer_offset; @@ -473,7 +473,7 @@ void XCFImageFormat::readXCF ( QImageIO* image_io ) // Load each layer and add it to the image while ( !layer_offsets.isEmpty() ) { - Q_INT32 layer_offset = layer_offsets.pop(); + TQ_INT32 layer_offset = layer_offsets.pop(); xcf_io.device()->at( layer_offset ); @@ -486,14 +486,14 @@ void XCFImageFormat::readXCF ( QImageIO* image_io ) } image_io->setImage( xcf_image.image ); - image_io->setStatus( 0 ); + image_io->setqStatus( 0 ); } /*! - * Construct the QImage which will eventually be returned to the QImage + * Construct the TQImage which will eventually be returned to the TQImage * loader. * - * There are a couple of situations which require that the QImage is not + * There are a couple of situations which require that the TQImage is not * exactly the same as The GIMP's representation. The full table is: * \verbatim * Grayscale opaque : 8 bpp indexed @@ -507,7 +507,7 @@ void XCFImageFormat::readXCF ( QImageIO* image_io ) * \endverbatim * Whether the image is translucent or not is determined by the bottom layer's * alpha channel. However, even if the bottom layer lacks an alpha channel, - * it can still have an opacity < 1. In this case, the QImage is promoted + * it can still have an opacity < 1. In this case, the TQImage is promoted * to 32-bit. (Note this is different from the output from the GIMP image * exporter, which seems to ignore this attribute.) * @@ -521,19 +521,19 @@ void XCFImageFormat::initializeImage ( XCFImage& xcf_image ) { // (Aliases to make the code look a little better.) Layer& layer( xcf_image.layer ); - QImage& image( xcf_image.image ); + TQImage& image( xcf_image.image ); switch ( layer.type ) { case RGB_GIMAGE: if ( layer.opacity == OPAQUE_OPACITY ) { image.create( xcf_image.width, xcf_image.height, 32 ); - image.fill( qRgb( 255, 255, 255 ) ); + image.fill( tqRgb( 255, 255, 255 ) ); break; } // else, fall through to 32-bit representation case RGBA_GIMAGE: image.create( xcf_image.width, xcf_image.height, 32 ); - image.fill( qRgba( 255, 255, 255, 0 ) ); + image.fill( tqRgba( 255, 255, 255, 0 ) ); // Turning this on prevents fill() from affecting the alpha channel, // by the way. image.setAlphaBuffer( true ); @@ -549,7 +549,7 @@ void XCFImageFormat::initializeImage ( XCFImage& xcf_image ) case GRAYA_GIMAGE: image.create( xcf_image.width, xcf_image.height, 32 ); - image.fill( qRgba( 255, 255, 255, 0 ) ); + image.fill( tqRgba( 255, 255, 255, 0 ) ); image.setAlphaBuffer( true ); break; @@ -560,8 +560,8 @@ void XCFImageFormat::initializeImage ( XCFImage& xcf_image ) // supported by The GIMP for indexed images) and the number of // individual colors. - // Note: Qt treats a bitmap with a Black and White color palette - // as a mask, so only the "on" bits are drawn, regardless of the + // Note: TQt treats a bitmap with a Black and White color palette + // as a tqmask, so only the "on" bits are drawn, regardless of the // order color table entries. Otherwise (i.e., at least one of the // color table entries is not black or white), it obeys the one- // or two-color palette. Have to ask about this... @@ -569,7 +569,7 @@ void XCFImageFormat::initializeImage ( XCFImage& xcf_image ) if ( xcf_image.num_colors <= 2 ) { image.create( xcf_image.width, xcf_image.height, 1, xcf_image.num_colors, - QImage::LittleEndian ); + TQImage::LittleEndian ); image.fill( 0 ); setPalette( xcf_image, image ); } @@ -577,7 +577,7 @@ void XCFImageFormat::initializeImage ( XCFImage& xcf_image ) else if ( xcf_image.num_colors <= 256 ) { image.create( xcf_image.width, xcf_image.height, 8, xcf_image.num_colors, - QImage::LittleEndian ); + TQImage::LittleEndian ); image.fill( 0 ); setPalette( xcf_image, image ); } @@ -593,11 +593,11 @@ void XCFImageFormat::initializeImage ( XCFImage& xcf_image ) xcf_image.num_colors++; xcf_image.palette.resize( xcf_image.num_colors ); xcf_image.palette[1] = xcf_image.palette[0]; - xcf_image.palette[0] = qRgba( 255, 255, 255, 0 ); + xcf_image.palette[0] = tqRgba( 255, 255, 255, 0 ); image.create( xcf_image.width, xcf_image.height, 1, xcf_image.num_colors, - QImage::LittleEndian ); + TQImage::LittleEndian ); image.fill( 0 ); setPalette( xcf_image, image ); image.setAlphaBuffer( true ); @@ -611,7 +611,7 @@ void XCFImageFormat::initializeImage ( XCFImage& xcf_image ) xcf_image.palette.resize( xcf_image.num_colors ); for ( int c = xcf_image.num_colors-1; c >= 1; c-- ) xcf_image.palette[c] = xcf_image.palette[c-1]; - xcf_image.palette[0] = qRgba( 255, 255, 255, 0 ); + xcf_image.palette[0] = tqRgba( 255, 255, 255, 0 ); image.create( xcf_image.width, xcf_image.height, 8, xcf_image.num_colors ); @@ -625,7 +625,7 @@ void XCFImageFormat::initializeImage ( XCFImage& xcf_image ) // true color. (There is no equivalent PNG representation output // from The GIMP as of v1.2.) image.create( xcf_image.width, xcf_image.height, 32 ); - image.fill( qRgba( 255, 255, 255, 0 ) ); + image.fill( tqRgba( 255, 255, 255, 0 ) ); image.setAlphaBuffer( true ); } @@ -638,7 +638,7 @@ void XCFImageFormat::initializeImage ( XCFImage& xcf_image ) /*! * Compute the number of tiles in the current layer and allocate - * QImage structures for each of them. + * TQImage structures for each of them. * \param xcf_image contains the current layer. */ void XCFImageFormat::composeTiles ( XCFImage& xcf_image ) @@ -653,8 +653,8 @@ void XCFImageFormat::composeTiles ( XCFImage& xcf_image ) if ( layer.type == GRAYA_GIMAGE || layer.type == INDEXEDA_GIMAGE ) layer.alpha_tiles.resize( layer.nrows ); - if ( layer.mask_offset != 0 ) - layer.mask_tiles.resize( layer.nrows ); + if ( layer.tqmask_offset != 0 ) + layer.tqmask_tiles.resize( layer.nrows ); for ( uint j = 0; j < layer.nrows; j++ ) { layer.image_tiles[j].resize( layer.ncols ); @@ -662,8 +662,8 @@ void XCFImageFormat::composeTiles ( XCFImage& xcf_image ) if ( layer.type == GRAYA_GIMAGE || layer.type == INDEXEDA_GIMAGE ) layer.alpha_tiles[j].resize( layer.ncols ); - if ( layer.mask_offset != 0 ) - layer.mask_tiles[j].resize( layer.ncols ); + if ( layer.tqmask_offset != 0 ) + layer.tqmask_tiles[j].resize( layer.ncols ); } for ( uint j = 0; j < layer.nrows; j++ ) { @@ -675,74 +675,74 @@ void XCFImageFormat::composeTiles ( XCFImage& xcf_image ) uint tile_height = (j+1) * TILE_HEIGHT <= layer.height ? TILE_HEIGHT : layer.height - j*TILE_HEIGHT; - // Try to create the most appropriate QImage (each GIMP layer + // Try to create the most appropriate TQImage (each GIMP layer // type is treated slightly differently) switch ( layer.type ) { case RGB_GIMAGE: - layer.image_tiles[j][i] = QImage( tile_width, tile_height, 32, 0 ); + layer.image_tiles[j][i] = TQImage( tile_width, tile_height, 32, 0 ); layer.image_tiles[j][i].setAlphaBuffer( false ); break; case RGBA_GIMAGE: - layer.image_tiles[j][i] = QImage( tile_width, tile_height, 32, 0 ); + layer.image_tiles[j][i] = TQImage( tile_width, tile_height, 32, 0 ); layer.image_tiles[j][i].setAlphaBuffer( true ); break; case GRAY_GIMAGE: - layer.image_tiles[j][i] = QImage( tile_width, tile_height, 8, 256 ); + layer.image_tiles[j][i] = TQImage( tile_width, tile_height, 8, 256 ); setGrayPalette( layer.image_tiles[j][i] ); break; case GRAYA_GIMAGE: - layer.image_tiles[j][i] = QImage( tile_width, tile_height, 8, 256 ); + layer.image_tiles[j][i] = TQImage( tile_width, tile_height, 8, 256 ); setGrayPalette( layer.image_tiles[j][i] ); - layer.alpha_tiles[j][i] = QImage( tile_width, tile_height, 8, 256 ); + layer.alpha_tiles[j][i] = TQImage( tile_width, tile_height, 8, 256 ); setGrayPalette( layer.alpha_tiles[j][i] ); break; case INDEXED_GIMAGE: - layer.image_tiles[j][i] = QImage( tile_width, tile_height, 8, + layer.image_tiles[j][i] = TQImage( tile_width, tile_height, 8, xcf_image.num_colors ); setPalette( xcf_image, layer.image_tiles[j][i] ); break; case INDEXEDA_GIMAGE: - layer.image_tiles[j][i] = QImage( tile_width, tile_height, 8, + layer.image_tiles[j][i] = TQImage( tile_width, tile_height, 8, xcf_image.num_colors ); setPalette( xcf_image, layer.image_tiles[j][i] ); - layer.alpha_tiles[j][i] = QImage( tile_width, tile_height, 8, 256 ); + layer.alpha_tiles[j][i] = TQImage( tile_width, tile_height, 8, 256 ); setGrayPalette( layer.alpha_tiles[j][i] ); } - if ( layer.mask_offset != 0 ) { - layer.mask_tiles[j][i] = QImage( tile_width, tile_height, 8, 256 ); - setGrayPalette( layer.mask_tiles[j][i] ); + if ( layer.tqmask_offset != 0 ) { + layer.tqmask_tiles[j][i] = TQImage( tile_width, tile_height, 8, 256 ); + setGrayPalette( layer.tqmask_tiles[j][i] ); } } } } /*! - * Apply a grayscale palette to the QImage. Note that Qt does not distinguish + * Apply a grayscale palette to the TQImage. Note that TQt does not distinguish * between grayscale and indexed images. A grayscale image is just * an indexed image with a 256-color, grayscale palette. * \param image image to set to a grayscale palette. */ -void XCFImageFormat::setGrayPalette ( QImage& image ) +void XCFImageFormat::setGrayPalette ( TQImage& image ) { for ( int i = 0; i < 256; i++ ) - image.setColor( i, qRgb(i,i,i) ); + image.setColor( i, tqRgb(i,i,i) ); } /*! - * Copy the indexed palette from the XCF image into the QImage. + * Copy the indexed palette from the XCF image into the TQImage. * \param xcf_image XCF image containing the palette read from the data stream. * \param image image to apply the palette to. */ -void XCFImageFormat::setPalette ( XCFImage& xcf_image, QImage& image ) +void XCFImageFormat::setPalette ( XCFImage& xcf_image, TQImage& image ) { for ( int i = 0; i < xcf_image.num_colors; i++ ) image.setColor( i, xcf_image.palette[i] ); @@ -750,7 +750,7 @@ void XCFImageFormat::setPalette ( XCFImage& xcf_image, QImage& image ) /*! * An XCF file can contain an arbitrary number of properties associated - * with the image (and layer and mask). + * with the image (and layer and tqmask). * \param xcf_io the data stream connected to the XCF image * \param xcf_image XCF image data. * \return true if there were no I/O errors. @@ -760,14 +760,14 @@ bool XCFImageFormat::loadImageProperties ( SafeDataStream& xcf_io, { while ( true ) { PropType type; - QByteArray bytes; + TQByteArray bytes; if ( !loadProperty( xcf_io, type, bytes ) ) { qDebug( "XCF: error loading global image properties" ); return false; } - QDataStream property( bytes, IO_ReadOnly ); + TQDataStream property( bytes, IO_ReadOnly ); switch ( type ) { case PROP_END: @@ -792,11 +792,11 @@ bool XCFImageFormat::loadImageProperties ( SafeDataStream& xcf_io, case PROP_PARASITES: while ( !property.atEnd() ) { char* tag; - Q_UINT32 size; + TQ_UINT32 size; property.readBytes( tag, size ); - Q_UINT32 flags; + TQ_UINT32 flags; char* data; property >> flags >> data; @@ -828,7 +828,7 @@ bool XCFImageFormat::loadImageProperties ( SafeDataStream& xcf_io, for ( int i = 0; i < xcf_image.num_colors; i++ ) { uchar r, g, b; property >> r >> g >> b; - xcf_image.palette.push_back( qRgb(r,g,b) ); + xcf_image.palette.push_back( tqRgb(r,g,b) ); } break; @@ -872,16 +872,16 @@ bool XCFImageFormat::loadLayer ( SafeDataStream& xcf_io, XCFImage& xcf_image ) if ( layer.visible == 0 ) return true; - // If there are any more layers, merge them into the final QImage. + // If there are any more layers, merge them into the final TQImage. - xcf_io >> layer.hierarchy_offset >> layer.mask_offset; + xcf_io >> layer.hierarchy_offset >> layer.tqmask_offset; if ( xcf_io.failed() ) { qDebug( "XCF: read failure on layer image offsets" ); return false; } - // Allocate the individual tile QImages based on the size and type + // Allocate the individual tile TQImages based on the size and type // of this layer. composeTiles( xcf_image ); @@ -896,15 +896,15 @@ bool XCFImageFormat::loadLayer ( SafeDataStream& xcf_io, XCFImage& xcf_image ) if ( !loadHierarchy( xcf_io, layer ) ) return false; - if ( layer.mask_offset != 0 ) { - xcf_io.device()->at( layer.mask_offset ); + if ( layer.tqmask_offset != 0 ) { + xcf_io.device()->at( layer.tqmask_offset ); if ( !loadMask( xcf_io, layer ) ) return false; } // Now we should have enough information to initialize the final - // QImage. The first visible layer determines the attributes - // of the QImage. + // TQImage. The first visible layer determines the attributes + // of the TQImage. if ( !xcf_image.initialized ) { initializeImage( xcf_image ); @@ -930,14 +930,14 @@ bool XCFImageFormat::loadLayerProperties ( SafeDataStream& xcf_io, Layer& layer { while ( true ) { PropType type; - QByteArray bytes; + TQByteArray bytes; if ( !loadProperty( xcf_io, type, bytes ) ) { qDebug( "XCF: error loading layer properties" ); return false; } - QDataStream property( bytes, IO_ReadOnly ); + TQDataStream property( bytes, IO_ReadOnly ); switch ( type ) { case PROP_END: @@ -964,15 +964,15 @@ bool XCFImageFormat::loadLayerProperties ( SafeDataStream& xcf_io, Layer& layer break; case PROP_APPLY_MASK: - property >> layer.apply_mask; + property >> layer.apply_tqmask; break; case PROP_EDIT_MASK: - property >> layer.edit_mask; + property >> layer.edit_tqmask; break; case PROP_SHOW_MASK: - property >> layer.show_mask; + property >> layer.show_tqmask; break; case PROP_OFFSETS: @@ -995,47 +995,47 @@ bool XCFImageFormat::loadLayerProperties ( SafeDataStream& xcf_io, Layer& layer /*! * An XCF file can contain an arbitrary number of properties associated - * with a channel. Note that this routine only reads mask channel properties. + * with a channel. Note that this routine only reads tqmask channel properties. * \param xcf_io the data stream connected to the XCF image. - * \param layer layer containing the mask channel to collect the properties. + * \param layer layer containing the tqmask channel to collect the properties. * \return true if there were no I/O errors. */ bool XCFImageFormat::loadChannelProperties ( SafeDataStream& xcf_io, Layer& layer ) { while ( true ) { PropType type; - QByteArray bytes; + TQByteArray bytes; if ( !loadProperty( xcf_io, type, bytes ) ) { qDebug( "XCF: error loading channel properties" ); return false; } - QDataStream property( bytes, IO_ReadOnly ); + TQDataStream property( bytes, IO_ReadOnly ); switch ( type ) { case PROP_END: return true; case PROP_OPACITY: - property >> layer.mask_channel.opacity; + property >> layer.tqmask_channel.opacity; break; case PROP_VISIBLE: - property >> layer.mask_channel.visible; + property >> layer.tqmask_channel.visible; break; case PROP_SHOW_MASKED: - property >> layer.mask_channel.show_masked; + property >> layer.tqmask_channel.show_tqmasked; break; case PROP_COLOR: - property >> layer.mask_channel.red >> layer.mask_channel.green - >> layer.mask_channel.blue; + property >> layer.tqmask_channel.red >> layer.tqmask_channel.green + >> layer.tqmask_channel.blue; break; case PROP_TATTOO: - property >> layer.mask_channel.tattoo; + property >> layer.tqmask_channel.tattoo; break; default: @@ -1045,7 +1045,7 @@ bool XCFImageFormat::loadChannelProperties ( SafeDataStream& xcf_io, Layer& laye } /*! - * The GIMP stores images in a "mipmap"-like hierarchy. As far as the QImage + * The GIMP stores images in a "mipmap"-like hierarchy. As far as the TQImage * is concerned, however, only the top level (i.e., the full resolution image) * is used. * \param xcf_io the data stream connected to the XCF image. @@ -1054,10 +1054,10 @@ bool XCFImageFormat::loadChannelProperties ( SafeDataStream& xcf_io, Layer& laye */ bool XCFImageFormat::loadHierarchy ( SafeDataStream& xcf_io, Layer& layer ) { - Q_INT32 width; - Q_INT32 height; - Q_INT32 bpp; - Q_UINT32 offset; + TQ_INT32 width; + TQ_INT32 height; + TQ_INT32 bpp; + TQ_UINT32 offset; xcf_io >> width >> height >> bpp >> offset; @@ -1070,7 +1070,7 @@ bool XCFImageFormat::loadHierarchy ( SafeDataStream& xcf_io, Layer& layer ) // increasingly lower resolution). Only the top level is used here, // however. - Q_UINT32 junk; + TQ_UINT32 junk; do { xcf_io >> junk; @@ -1080,7 +1080,7 @@ bool XCFImageFormat::loadHierarchy ( SafeDataStream& xcf_io, Layer& layer ) } } while ( junk != 0 ); - QIODevice::Offset saved_pos = xcf_io.device()->at(); + TQIODevice::Offset saved_pos = xcf_io.device()->at(); xcf_io.device()->at( offset ); @@ -1099,11 +1099,11 @@ bool XCFImageFormat::loadHierarchy ( SafeDataStream& xcf_io, Layer& layer ) * \return true if there were no I/O errors. * \sa loadTileRLE(). */ -bool XCFImageFormat::loadLevel ( SafeDataStream& xcf_io, Layer& layer, Q_INT32 bpp ) +bool XCFImageFormat::loadLevel ( SafeDataStream& xcf_io, Layer& layer, TQ_INT32 bpp ) { - Q_INT32 width; - Q_INT32 height; - Q_UINT32 offset; + TQ_INT32 width; + TQ_INT32 height; + TQ_UINT32 offset; xcf_io >> width >> height >> offset; @@ -1122,9 +1122,9 @@ bool XCFImageFormat::loadLevel ( SafeDataStream& xcf_io, Layer& layer, Q_INT32 b return false; } - QIODevice::Offset saved_pos = xcf_io.device()->at(); + TQIODevice::Offset saved_pos = xcf_io.device()->at(); - Q_UINT32 offset2; + TQ_UINT32 offset2; xcf_io >> offset2; @@ -1147,7 +1147,7 @@ bool XCFImageFormat::loadLevel ( SafeDataStream& xcf_io, Layer& layer, Q_INT32 b return false; // The bytes in the layer tile are juggled differently depending on - // the target QImage. The caller has set layer.assignBytes to the + // the target TQImage. The caller has set layer.assignBytes to the // appropriate routine. layer.assignBytes( layer, i, j ); @@ -1167,21 +1167,21 @@ bool XCFImageFormat::loadLevel ( SafeDataStream& xcf_io, Layer& layer, Q_INT32 b } /*! - * A layer can have a one channel image which is used as a mask. + * A layer can have a one channel image which is used as a tqmask. * \param xcf_io the data stream connected to the XCF image. - * \param layer the layer to collect the mask image. + * \param layer the layer to collect the tqmask image. * \return true if there were no I/O errors. */ bool XCFImageFormat::loadMask ( SafeDataStream& xcf_io, Layer& layer ) { - Q_INT32 width; - Q_INT32 height; + TQ_INT32 width; + TQ_INT32 height; char* name; xcf_io >> width >> height >> name; if ( xcf_io.failed() ) { - qDebug( "XCF: read failure on mask info" ); + qDebug( "XCF: read failure on tqmask info" ); return false; } @@ -1189,12 +1189,12 @@ bool XCFImageFormat::loadMask ( SafeDataStream& xcf_io, Layer& layer ) if ( !loadChannelProperties( xcf_io, layer ) ) return false; - Q_UINT32 hierarchy_offset; + TQ_UINT32 hierarchy_offset; xcf_io >> hierarchy_offset; if ( xcf_io.failed() ) { - qDebug( "XCF: read failure on mask image offset" ); + qDebug( "XCF: read failure on tqmask image offset" ); return false; } @@ -1231,7 +1231,7 @@ bool XCFImageFormat::loadMask ( SafeDataStream& xcf_io, Layer& layer ) * the RLE data. */ bool XCFImageFormat::loadTileRLE ( SafeDataStream& xcf_io, uchar* tile, int image_size, - int data_length, Q_INT32 bpp ) + int data_length, TQ_INT32 bpp ) { uchar* data; @@ -1288,7 +1288,7 @@ bool XCFImageFormat::loadTileRLE ( SafeDataStream& xcf_io, uchar* tile, int imag while ( length-- > 0 ) { *data = *xcfdata++; - data += sizeof(QRgb); + data += sizeof(TQRgb); } } else { @@ -1315,7 +1315,7 @@ bool XCFImageFormat::loadTileRLE ( SafeDataStream& xcf_io, uchar* tile, int imag while ( length-- > 0 ) { *data = val; - data += sizeof(QRgb); + data += sizeof(TQRgb); } } } @@ -1332,7 +1332,7 @@ bool XCFImageFormat::loadTileRLE ( SafeDataStream& xcf_io, uchar* tile, int imag } /*! - * Copy the bytes from the tile buffer into the image tile QImage, taking into + * Copy the bytes from the tile buffer into the image tile TQImage, taking into * account all the myriad different modes. * \param layer layer containing the tile buffer and the image tile matrix. * \param i column index of current tile. @@ -1346,8 +1346,8 @@ void XCFImageFormat::assignImageBytes ( Layer& layer, uint i, uint j ) case RGB_GIMAGE: for ( int l = 0; l < layer.image_tiles[j][i].height(); l++ ) { for ( int k = 0; k < layer.image_tiles[j][i].width(); k++ ) { - layer.image_tiles[j][i].setPixel( k, l, qRgb( tile[0], tile[1], tile[2] ) ); - tile += sizeof(QRgb); + layer.image_tiles[j][i].setPixel( k, l, tqRgb( tile[0], tile[1], tile[2] ) ); + tile += sizeof(TQRgb); } } break; @@ -1356,8 +1356,8 @@ void XCFImageFormat::assignImageBytes ( Layer& layer, uint i, uint j ) for ( int l = 0; l < layer.image_tiles[j][i].height(); l++ ) { for ( int k = 0; k < layer.image_tiles[j][i].width(); k++ ) { layer.image_tiles[j][i].setPixel( k, l, - qRgba( tile[0], tile[1], tile[2], tile[3] ) ); - tile += sizeof(QRgb); + tqRgba( tile[0], tile[1], tile[2], tile[3] ) ); + tile += sizeof(TQRgb); } } break; @@ -1367,7 +1367,7 @@ void XCFImageFormat::assignImageBytes ( Layer& layer, uint i, uint j ) for ( int l = 0; l < layer.image_tiles[j][i].height(); l++ ) { for ( int k = 0; k < layer.image_tiles[j][i].width(); k++ ) { layer.image_tiles[j][i].setPixel( k, l, tile[0] ); - tile += sizeof(QRgb); + tile += sizeof(TQRgb); } } break; @@ -1377,7 +1377,7 @@ void XCFImageFormat::assignImageBytes ( Layer& layer, uint i, uint j ) for ( int l = 0; l < layer.image_tiles[j][i].height(); l++ ) { for ( int k = 0; k < layer.image_tiles[j][i].width(); k++ ) { - // The "if" here should not be necessary, but apparently there + // The "if" here should not be necessary, but aptqparently there // are some cases where the image can contain larger indices // than there are colors in the palette. (A bug in The GIMP?) @@ -1385,7 +1385,7 @@ void XCFImageFormat::assignImageBytes ( Layer& layer, uint i, uint j ) layer.image_tiles[j][i].setPixel( k, l, tile[0] ); layer.alpha_tiles[j][i].setPixel( k, l, tile[1] ); - tile += sizeof(QRgb); + tile += sizeof(TQRgb); } } break; @@ -1393,8 +1393,8 @@ void XCFImageFormat::assignImageBytes ( Layer& layer, uint i, uint j ) } /*! - * Copy the bytes from the tile buffer into the mask tile QImage. - * \param layer layer containing the tile buffer and the mask tile matrix. + * Copy the bytes from the tile buffer into the tqmask tile TQImage. + * \param layer layer containing the tile buffer and the tqmask tile matrix. * \param i column index of current tile. * \param j row index of current tile. */ @@ -1404,8 +1404,8 @@ void XCFImageFormat::assignMaskBytes ( Layer& layer, uint i, uint j ) for ( int l = 0; l < layer.image_tiles[j][i].height(); l++ ) { for ( int k = 0; k < layer.image_tiles[j][i].width(); k++ ) { - layer.mask_tiles[j][i].setPixel( k, l, tile[0] ); - tile += sizeof(QRgb); + layer.tqmask_tiles[j][i].setPixel( k, l, tile[0] ); + tile += sizeof(TQRgb); } } } @@ -1418,9 +1418,9 @@ void XCFImageFormat::assignMaskBytes ( Layer& layer, uint i, uint j ) * \param bytes returns with the property data. * \return true if there were no IO errors. */ bool XCFImageFormat::loadProperty ( SafeDataStream& xcf_io, PropType& type, - QByteArray& bytes ) + TQByteArray& bytes ) { - Q_UINT32 tmp; + TQ_UINT32 tmp; xcf_io >> tmp; type=static_cast<PropType>(tmp); @@ -1430,7 +1430,7 @@ bool XCFImageFormat::loadProperty ( SafeDataStream& xcf_io, PropType& type, } char* data; - Q_UINT32 size; + TQ_UINT32 size; // The COLORMAP property is tricky: in version of GIMP older than 2.0.2, the // property size was wrong (it was 4 + ncolors instead of 4 + 3*ncolors). @@ -1442,7 +1442,7 @@ bool XCFImageFormat::loadProperty ( SafeDataStream& xcf_io, PropType& type, // * See http://bugzilla.gnome.org/show_bug.cgi?id=142149 and // gimp/app/xcf-save.c, revision 1.42 if ( type == PROP_COLORMAP ) { - Q_UINT32 ignoredSize, ncolors; + TQ_UINT32 ignoredSize, ncolors; xcf_io >> ignoredSize; if ( xcf_io.failed() ) { qDebug( "XCF: read failure on property %d size", type ); @@ -1469,7 +1469,7 @@ bool XCFImageFormat::loadProperty ( SafeDataStream& xcf_io, PropType& type, else if ( type == PROP_USER_UNIT ) { float factor; - Q_INT32 digits; + TQ_INT32 digits; char* unit_strings; xcf_io >> size >> factor >> digits; @@ -1520,7 +1520,7 @@ bool XCFImageFormat::loadProperty ( SafeDataStream& xcf_io, PropType& type, void XCFImageFormat::copyLayerToImage ( XCFImage& xcf_image ) { Layer& layer( xcf_image.layer ); - QImage& image( xcf_image.image ); + TQImage& image( xcf_image.image ); PixelCopyOperation copy = 0; @@ -1555,7 +1555,7 @@ void XCFImageFormat::copyLayerToImage ( XCFImage& xcf_image ) // This seems the best place to apply the dissolve because it // depends on the global position of each tile's - // pixels. Apparently it's the only mode which can apply to a + // pixels. Aptqparently it's the only mode which can apply to a // single layer. if ( layer.mode == DISSOLVE_MODE ) { @@ -1596,22 +1596,22 @@ void XCFImageFormat::copyLayerToImage ( XCFImage& xcf_image ) * \param n y pixel of destination image. */ void XCFImageFormat::copyRGBToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { - QRgb src = layer.image_tiles[j][i].pixel( k, l ); + TQRgb src = layer.image_tiles[j][i].pixel( k, l ); uchar src_a = layer.opacity; if ( layer.type == RGBA_GIMAGE ) - src_a = INT_MULT( src_a, qAlpha( src ) ); + src_a = INT_MULT( src_a, tqAlpha( src ) ); - // Apply the mask (if any) + // Apply the tqmask (if any) - if ( layer.apply_mask == 1 && layer.mask_tiles.size() > j && - layer.mask_tiles[j].size() > i ) - src_a = INT_MULT( src_a, layer.mask_tiles[j][i].pixelIndex( k, l ) ); + if ( layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && + layer.tqmask_tiles[j].size() > i ) + src_a = INT_MULT( src_a, layer.tqmask_tiles[j][i].pixelIndex( k, l ) ); - image.setPixel( m, n, qRgba( src, src_a ) ); + image.setPixel( m, n, tqRgba( src, src_a ) ); } /*! @@ -1626,7 +1626,7 @@ void XCFImageFormat::copyRGBToRGB ( Layer& layer, uint i, uint j, int k, int l, * \param n y pixel of destination image. */ void XCFImageFormat::copyGrayToGray ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { int src = layer.image_tiles[j][i].pixelIndex( k, l ); @@ -1647,13 +1647,13 @@ void XCFImageFormat::copyGrayToGray ( Layer& layer, uint i, uint j, int k, int l * \param n y pixel of destination image. */ void XCFImageFormat::copyGrayToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { - QRgb src = layer.image_tiles[j][i].pixel( k, l ); + TQRgb src = layer.image_tiles[j][i].pixel( k, l ); uchar src_a = layer.opacity; - image.setPixel( m, n, qRgba( src, src_a ) ); + image.setPixel( m, n, tqRgba( src, src_a ) ); } /*! @@ -1670,21 +1670,21 @@ void XCFImageFormat::copyGrayToRGB ( Layer& layer, uint i, uint j, int k, int l, * \param n y pixel of destination image. */ void XCFImageFormat::copyGrayAToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { - QRgb src = layer.image_tiles[j][i].pixel( k, l ); + TQRgb src = layer.image_tiles[j][i].pixel( k, l ); uchar src_a = layer.alpha_tiles[j][i].pixelIndex( k, l ); src_a = INT_MULT( src_a, layer.opacity ); - // Apply the mask (if any) + // Apply the tqmask (if any) - if ( layer.apply_mask == 1 && layer.mask_tiles.size() > j && - layer.mask_tiles[j].size() > i ) - src_a = INT_MULT( src_a, layer.mask_tiles[j][i].pixelIndex( k, l ) ); + if ( layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && + layer.tqmask_tiles[j].size() > i ) + src_a = INT_MULT( src_a, layer.tqmask_tiles[j][i].pixelIndex( k, l ) ); - image.setPixel( m, n, qRgba( src, src_a ) ); + image.setPixel( m, n, tqRgba( src, src_a ) ); } /*! @@ -1699,7 +1699,7 @@ void XCFImageFormat::copyGrayAToRGB ( Layer& layer, uint i, uint j, int k, int l * \param n y pixel of destination image. */ void XCFImageFormat::copyIndexedToIndexed ( Layer& layer, uint i,uint j,int k,int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { int src = layer.image_tiles[j][i].pixelIndex( k, l ); @@ -1718,7 +1718,7 @@ void XCFImageFormat::copyIndexedToIndexed ( Layer& layer, uint i,uint j,int k,in * \param n y pixel of destination image. */ void XCFImageFormat::copyIndexedAToIndexed ( Layer& layer,uint i,uint j,int k,int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { uchar src = layer.image_tiles[j][i].pixelIndex( k, l ); @@ -1726,11 +1726,11 @@ void XCFImageFormat::copyIndexedAToIndexed ( Layer& layer,uint i,uint j,int k,in src_a = INT_MULT( src_a, layer.opacity ); - if ( layer.apply_mask == 1 && - layer.mask_tiles.size() > j && - layer.mask_tiles[j].size() > i ) + if ( layer.apply_tqmask == 1 && + layer.tqmask_tiles.size() > j && + layer.tqmask_tiles[j].size() > i ) src_a = INT_MULT( src_a, - layer.mask_tiles[j][i].pixelIndex( k, l ) ); + layer.tqmask_tiles[j][i].pixelIndex( k, l ) ); if ( src_a > 127 ) src++; @@ -1754,19 +1754,19 @@ void XCFImageFormat::copyIndexedAToIndexed ( Layer& layer,uint i,uint j,int k,in * \param n y pixel of destination image. */ void XCFImageFormat::copyIndexedAToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { - QRgb src = layer.image_tiles[j][i].pixel( k, l ); + TQRgb src = layer.image_tiles[j][i].pixel( k, l ); uchar src_a = layer.alpha_tiles[j][i].pixelIndex( k, l ); src_a = INT_MULT( src_a, layer.opacity ); - // Apply the mask (if any) + // Apply the tqmask (if any) - if ( layer.apply_mask == 1 && layer.mask_tiles.size() > j && - layer.mask_tiles[j].size() > i ) - src_a = INT_MULT( src_a, layer.mask_tiles[j][i].pixelIndex( k, l ) ); + if ( layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && + layer.tqmask_tiles[j].size() > i ) + src_a = INT_MULT( src_a, layer.tqmask_tiles[j][i].pixelIndex( k, l ) ); // This is what appears in the GIMP window @@ -1775,7 +1775,7 @@ void XCFImageFormat::copyIndexedAToRGB ( Layer& layer, uint i, uint j, int k, in else src_a = OPAQUE_OPACITY; - image.setPixel( m, n, qRgba( src, src_a ) ); + image.setPixel( m, n, tqRgba( src, src_a ) ); } /*! @@ -1785,7 +1785,7 @@ void XCFImageFormat::copyIndexedAToRGB ( Layer& layer, uint i, uint j, int k, in void XCFImageFormat::mergeLayerIntoImage ( XCFImage& xcf_image ) { Layer& layer( xcf_image.layer ); - QImage& image( xcf_image.image ); + TQImage& image( xcf_image.image ); PixelMergeOperation merge = 0; @@ -1822,7 +1822,7 @@ void XCFImageFormat::mergeLayerIntoImage ( XCFImage& xcf_image ) // This seems the best place to apply the dissolve because it // depends on the global position of each tile's - // pixels. Apparently it's the only mode which can apply to a + // pixels. Aptqparently it's the only mode which can apply to a // single layer. if ( layer.mode == DISSOLVE_MODE ) { @@ -1863,20 +1863,20 @@ void XCFImageFormat::mergeLayerIntoImage ( XCFImage& xcf_image ) * \param n y pixel of destination image. */ void XCFImageFormat::mergeRGBToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { - QRgb src = layer.image_tiles[j][i].pixel( k, l ); - QRgb dst = image.pixel( m, n ); + TQRgb src = layer.image_tiles[j][i].pixel( k, l ); + TQRgb dst = image.pixel( m, n ); - uchar src_r = qRed( src ); - uchar src_g = qGreen( src ); - uchar src_b = qBlue( src ); - uchar src_a = qAlpha( src ); + uchar src_r = tqRed( src ); + uchar src_g = tqGreen( src ); + uchar src_b = tqBlue( src ); + uchar src_a = tqAlpha( src ); - uchar dst_r = qRed( dst ); - uchar dst_g = qGreen( dst ); - uchar dst_b = qBlue( dst ); - uchar dst_a = qAlpha( dst ); + uchar dst_r = tqRed( dst ); + uchar dst_g = tqGreen( dst ); + uchar dst_b = tqBlue( dst ); + uchar dst_a = tqAlpha( dst ); switch ( layer.mode ) { case MULTIPLY_MODE: { @@ -2019,11 +2019,11 @@ void XCFImageFormat::mergeRGBToRGB ( Layer& layer, uint i, uint j, int k, int l, src_a = INT_MULT( src_a, layer.opacity ); - // Apply the mask (if any) + // Apply the tqmask (if any) - if ( layer.apply_mask == 1 && layer.mask_tiles.size() > j && - layer.mask_tiles[j].size() > i ) - src_a = INT_MULT( src_a, layer.mask_tiles[j][i].pixelIndex( k, l ) ); + if ( layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && + layer.tqmask_tiles[j].size() > i ) + src_a = INT_MULT( src_a, layer.tqmask_tiles[j][i].pixelIndex( k, l ) ); uchar new_r, new_g, new_b, new_a; @@ -2039,7 +2039,7 @@ void XCFImageFormat::mergeRGBToRGB ( Layer& layer, uint i, uint j, int k, int l, if ( !layer_modes[layer.mode].affect_alpha ) new_a = dst_a; - image.setPixel( m, n, qRgba( new_r, new_g, new_b, new_a ) ); + image.setPixel( m, n, tqRgba( new_r, new_g, new_b, new_a ) ); } /*! @@ -2054,7 +2054,7 @@ void XCFImageFormat::mergeRGBToRGB ( Layer& layer, uint i, uint j, int k, int l, * \param n y pixel of destination image. */ void XCFImageFormat::mergeGrayToGray ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { int src = layer.image_tiles[j][i].pixelIndex( k, l ); @@ -2073,9 +2073,9 @@ void XCFImageFormat::mergeGrayToGray ( Layer& layer, uint i, uint j, int k, int * \param n y pixel of destination image. */ void XCFImageFormat::mergeGrayAToGray ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { - int src = qGray( layer.image_tiles[j][i].pixel( k, l ) ); + int src = tqGray( layer.image_tiles[j][i].pixel( k, l ) ); int dst = image.pixelIndex( m, n ); uchar src_a = layer.alpha_tiles[j][i].pixelIndex( k, l ); @@ -2121,11 +2121,11 @@ void XCFImageFormat::mergeGrayAToGray ( Layer& layer, uint i, uint j, int k, int src_a = INT_MULT( src_a, layer.opacity ); - // Apply the mask (if any) + // Apply the tqmask (if any) - if ( layer.apply_mask == 1 && layer.mask_tiles.size() > j && - layer.mask_tiles[j].size() > i ) - src_a = INT_MULT( src_a, layer.mask_tiles[j][i].pixelIndex( k, l ) ); + if ( layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && + layer.tqmask_tiles[j].size() > i ) + src_a = INT_MULT( src_a, layer.tqmask_tiles[j][i].pixelIndex( k, l ) ); uchar new_a = OPAQUE_OPACITY; @@ -2151,13 +2151,13 @@ void XCFImageFormat::mergeGrayAToGray ( Layer& layer, uint i, uint j, int k, int * \param n y pixel of destination image. */ void XCFImageFormat::mergeGrayToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { - QRgb src = layer.image_tiles[j][i].pixel( k, l ); + TQRgb src = layer.image_tiles[j][i].pixel( k, l ); uchar src_a = layer.opacity; - image.setPixel( m, n, qRgba( src, src_a ) ); + image.setPixel( m, n, tqRgba( src, src_a ) ); } /*! @@ -2174,13 +2174,13 @@ void XCFImageFormat::mergeGrayToRGB ( Layer& layer, uint i, uint j, int k, int l * \param n y pixel of destination image. */ void XCFImageFormat::mergeGrayAToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { - int src = qGray( layer.image_tiles[j][i].pixel( k, l ) ); - int dst = qGray( image.pixel( m, n ) ); + int src = tqGray( layer.image_tiles[j][i].pixel( k, l ) ); + int dst = tqGray( image.pixel( m, n ) ); uchar src_a = layer.alpha_tiles[j][i].pixelIndex( k, l ); - uchar dst_a = qAlpha( image.pixel( m, n ) ); + uchar dst_a = tqAlpha( image.pixel( m, n ) ); switch ( layer.mode ) { case MULTIPLY_MODE: { @@ -2232,11 +2232,11 @@ void XCFImageFormat::mergeGrayAToRGB ( Layer& layer, uint i, uint j, int k, int src_a = INT_MULT( src_a, layer.opacity ); - // Apply the mask (if any) + // Apply the tqmask (if any) - if ( layer.apply_mask == 1 && layer.mask_tiles.size() > j && - layer.mask_tiles[j].size() > i ) - src_a = INT_MULT( src_a, layer.mask_tiles[j][i].pixelIndex( k, l ) ); + if ( layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && + layer.tqmask_tiles[j].size() > i ) + src_a = INT_MULT( src_a, layer.tqmask_tiles[j][i].pixelIndex( k, l ) ); uchar new_a = dst_a + INT_MULT( OPAQUE_OPACITY - dst_a, src_a ); @@ -2248,7 +2248,7 @@ void XCFImageFormat::mergeGrayAToRGB ( Layer& layer, uint i, uint j, int k, int if ( !layer_modes[layer.mode].affect_alpha ) new_a = dst_a; - image.setPixel( m, n, qRgba( new_g, new_g, new_g, new_a ) ); + image.setPixel( m, n, tqRgba( new_g, new_g, new_g, new_a ) ); } /*! @@ -2263,7 +2263,7 @@ void XCFImageFormat::mergeGrayAToRGB ( Layer& layer, uint i, uint j, int k, int * \param n y pixel of destination image. */ void XCFImageFormat::mergeIndexedToIndexed ( Layer& layer, uint i,uint j,int k,int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { int src = layer.image_tiles[j][i].pixelIndex( k, l ); @@ -2282,7 +2282,7 @@ void XCFImageFormat::mergeIndexedToIndexed ( Layer& layer, uint i,uint j,int k,i * \param n y pixel of destination image. */ void XCFImageFormat::mergeIndexedAToIndexed ( Layer& layer,uint i,uint j,int k,int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { uchar src = layer.image_tiles[j][i].pixelIndex( k, l ); @@ -2290,11 +2290,11 @@ void XCFImageFormat::mergeIndexedAToIndexed ( Layer& layer,uint i,uint j,int k,i src_a = INT_MULT( src_a, layer.opacity ); - if ( layer.apply_mask == 1 && - layer.mask_tiles.size() > j && - layer.mask_tiles[j].size() > i ) + if ( layer.apply_tqmask == 1 && + layer.tqmask_tiles.size() > j && + layer.tqmask_tiles[j].size() > i ) src_a = INT_MULT( src_a, - layer.mask_tiles[j][i].pixelIndex( k, l ) ); + layer.tqmask_tiles[j][i].pixelIndex( k, l ) ); if ( src_a > 127 ) { src++; @@ -2316,19 +2316,19 @@ void XCFImageFormat::mergeIndexedAToIndexed ( Layer& layer,uint i,uint j,int k,i * \param n y pixel of destination image. */ void XCFImageFormat::mergeIndexedAToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ) + TQImage& image, int m, int n ) { - QRgb src = layer.image_tiles[j][i].pixel( k, l ); + TQRgb src = layer.image_tiles[j][i].pixel( k, l ); uchar src_a = layer.alpha_tiles[j][i].pixelIndex( k, l ); src_a = INT_MULT( src_a, layer.opacity ); - // Apply the mask (if any) + // Apply the tqmask (if any) - if ( layer.apply_mask == 1 && layer.mask_tiles.size() > j && - layer.mask_tiles[j].size() > i ) - src_a = INT_MULT( src_a, layer.mask_tiles[j][i].pixelIndex( k, l ) ); + if ( layer.apply_tqmask == 1 && layer.tqmask_tiles.size() > j && + layer.tqmask_tiles[j].size() > i ) + src_a = INT_MULT( src_a, layer.tqmask_tiles[j][i].pixelIndex( k, l ) ); // This is what appears in the GIMP window @@ -2337,7 +2337,7 @@ void XCFImageFormat::mergeIndexedAToRGB ( Layer& layer, uint i, uint j, int k, i else src_a = OPAQUE_OPACITY; - image.setPixel( m, n, qRgba( src, src_a ) ); + image.setPixel( m, n, tqRgba( src, src_a ) ); } /*! @@ -2347,9 +2347,9 @@ void XCFImageFormat::mergeIndexedAToRGB ( Layer& layer, uint i, uint j, int k, i * \param x the global x position of the tile. * \param y the global y position of the tile. */ -void XCFImageFormat::dissolveRGBPixels ( QImage& image, int x, int y ) +void XCFImageFormat::dissolveRGBPixels ( TQImage& image, int x, int y ) { - // The apparently spurious rand() calls are to wind the random + // The aptqparently spurious rand() calls are to wind the random // numbers up to the same point for each tile. for ( int l = 0; l < image.height(); l++ ) { @@ -2360,10 +2360,10 @@ void XCFImageFormat::dissolveRGBPixels ( QImage& image, int x, int y ) for ( int k = 0; k < image.width(); k++ ) { int rand_val = rand() & 0xff; - QRgb pixel = image.pixel( k, l ); + TQRgb pixel = image.pixel( k, l ); - if ( rand_val > qAlpha( pixel ) ) { - image.setPixel( k, l, qRgba( pixel, 0 ) ); + if ( rand_val > tqAlpha( pixel ) ) { + image.setPixel( k, l, tqRgba( pixel, 0 ) ); } } } @@ -2378,9 +2378,9 @@ void XCFImageFormat::dissolveRGBPixels ( QImage& image, int x, int y ) * \param x the global x position of the tile. * \param y the global y position of the tile. */ -void XCFImageFormat::dissolveAlphaPixels ( QImage& image, int x, int y ) +void XCFImageFormat::dissolveAlphaPixels ( TQImage& image, int x, int y ) { - // The apparently spurious rand() calls are to wind the random + // The aptqparently spurious rand() calls are to wind the random // numbers up to the same point for each tile. for ( int l = 0; l < image.height(); l++ ) { diff --git a/src/gvcore/qxcfi.h b/src/gvcore/qxcfi.h index ac82173..e98f226 100644 --- a/src/gvcore/qxcfi.h +++ b/src/gvcore/qxcfi.h @@ -1,10 +1,10 @@ -#ifndef QXCFI_H -#define QXCFI_H +#ifndef TQXCFI_H +#define TQXCFI_H -#include <qimage.h> -#include <qimageformatplugin.h> -#include <qvaluestack.h> -#include <qvaluevector.h> +#include <tqimage.h> +#include <tqimageformatplugin.h> +#include <tqvaluestack.h> +#include <tqvaluevector.h> #include "gimp.h" namespace Gwenview { @@ -12,11 +12,11 @@ namespace Gwenview { // Safe readBlock helper functions class SafeDataStream { public: - SafeDataStream(QIODevice* device) + SafeDataStream(TQIODevice* device) : mDevice(device), mFailed(false) {} bool failed() const { return mFailed; } - QIODevice* device() const { return mDevice; } + TQIODevice* device() const { return mDevice; } SafeDataStream& readRawBytes(char* data, uint length) { if (mFailed) return *this; @@ -26,11 +26,11 @@ public: return *this; } - SafeDataStream& operator>>(Q_INT8& value) { + SafeDataStream& operator>>(TQ_INT8& value) { return readRawBytes((char*)&value, 1); } - SafeDataStream& operator>>(Q_UINT32& value) { + SafeDataStream& operator>>(TQ_UINT32& value) { if (mFailed) return *this; uchar *p = (uchar *)(&value); char b[4]; @@ -45,18 +45,18 @@ public: return *this; } - SafeDataStream& operator>>(Q_INT32& value) { - return *this >>((Q_UINT32&)value); + SafeDataStream& operator>>(TQ_INT32& value) { + return *this >>((TQ_UINT32&)value); } SafeDataStream& operator>>(float& value) { - return *this >>((Q_UINT32&)value); + return *this >>((TQ_UINT32&)value); } SafeDataStream& operator>>(char*& value) { if (mFailed) return *this; - Q_UINT32 len; + TQ_UINT32 len; *this >> len; if (mFailed) return *this; if ( len == 0 ) { @@ -95,17 +95,17 @@ public: int at() const; private: - QIODevice* mDevice; + TQIODevice* mDevice; bool mFailed; }; //! Plug-in for loading a GIMP XCF image file directly. /*! - * This class uses the Qt 3.0 Image format plug-in loader to provide + * This class uses the TQt 3.0 Image format plug-in loader to provide * the ability to read The GIMP XCF image files. This plug-in will * be dynamically loaded as needed. */ -class XCFImageFormat : public QImageFormatPlugin { +class XCFImageFormat : public TQImageFormatPlugin { /*! * Each layer in an XCF file is stored as a matrix of @@ -114,7 +114,7 @@ class XCFImageFormat : public QImageFormatPlugin { * parallel processing on a tile-by-tile basis. Here, though, * we just read them in en-masse and store them in a matrix. */ - typedef QValueVector< QValueVector< QImage > > Tiles; + typedef TQValueVector< TQValueVector< TQImage > > Tiles; /*! * Each GIMP image is composed of one or more layers. A layer can @@ -122,15 +122,15 @@ class XCFImageFormat : public QImageFormatPlugin { * optional alpha channel, there are six possible types altogether. * * Note: there is only ever one instance of this structure. The - * layer info is discarded after it is merged into the final QImage. + * layer info is discarded after it is merged into the final TQImage. */ struct Layer { - Q_UINT32 width; //!< Width of the layer - Q_UINT32 height; //!< Height of the layer - Q_INT32 type; //!< Type of the layer (GimpImageType) + TQ_UINT32 width; //!< Width of the layer + TQ_UINT32 height; //!< Height of the layer + TQ_INT32 type; //!< Type of the layer (GimpImageType) char* name; //!< Name of the layer - Q_UINT32 hierarchy_offset; //!< File position of Tile hierarchy - Q_UINT32 mask_offset; //!< File position of mask image + TQ_UINT32 hierarchy_offset; //!< File position of Tile hierarchy + TQ_UINT32 tqmask_offset; //!< File position of tqmask image uint nrows; //!< Number of rows of tiles (y direction) uint ncols; //!< Number of columns of tiles (x direction) @@ -139,36 +139,36 @@ class XCFImageFormat : public QImageFormatPlugin { //! For Grayscale and Indexed images, the alpha channel is stored //! separately (in this data structure, anyway). Tiles alpha_tiles; - Tiles mask_tiles; //!< The layer mask (optional) + Tiles tqmask_tiles; //!< The layer tqmask (optional) - //! Additional information about a layer mask. + //! Additional information about a layer tqmask. struct { - Q_UINT32 opacity; - Q_UINT32 visible; - Q_UINT32 show_masked; + TQ_UINT32 opacity; + TQ_UINT32 visible; + TQ_UINT32 show_tqmasked; uchar red, green, blue; - Q_UINT32 tattoo; - } mask_channel; + TQ_UINT32 tattoo; + } tqmask_channel; bool active; //!< Is this layer the active layer? - Q_UINT32 opacity; //!< The opacity of the layer - Q_UINT32 visible; //!< Is the layer visible? - Q_UINT32 linked; //!< Is this layer linked (geometrically) - Q_UINT32 preserve_transparency; //!< Preserve alpha when drawing on layer? - Q_UINT32 apply_mask; //!< Apply the layer mask? - Q_UINT32 edit_mask; //!< Is the layer mask the being edited? - Q_UINT32 show_mask; //!< Show the layer mask rather than the image? - Q_INT32 x_offset; //!< x offset of the layer relative to the image - Q_INT32 y_offset; //!< y offset of the layer relative to the image - Q_UINT32 mode; //!< Combining mode of layer (LayerModeEffects) - Q_UINT32 tattoo; //!< (unique identifier?) + TQ_UINT32 opacity; //!< The opacity of the layer + TQ_UINT32 visible; //!< Is the layer visible? + TQ_UINT32 linked; //!< Is this layer linked (geometrically) + TQ_UINT32 preserve_transparency; //!< Preserve alpha when drawing on layer? + TQ_UINT32 apply_tqmask; //!< Apply the layer tqmask? + TQ_UINT32 edit_tqmask; //!< Is the layer tqmask the being edited? + TQ_UINT32 show_tqmask; //!< Show the layer tqmask rather than the image? + TQ_INT32 x_offset; //!< x offset of the layer relative to the image + TQ_INT32 y_offset; //!< y offset of the layer relative to the image + TQ_UINT32 mode; //!< Combining mode of layer (LayerModeEffects) + TQ_UINT32 tattoo; //!< (unique identifier?) //! As each tile is read from the file, it is buffered here. - uchar tile[TILE_WIDTH * TILE_HEIGHT * sizeof(QRgb)]; + uchar tile[TILE_WIDTH * TILE_HEIGHT * sizeof(TQRgb)]; //! The data from tile buffer is copied to the Tile by this //! method. Depending on the type of the tile (RGB, Grayscale, - //! Indexed) and use (image or mask), the bytes in the buffer are + //! Indexed) and use (image or tqmask), the bytes in the buffer are //! copied in different ways. void (*assignBytes)( Layer& layer, uint i, uint j ); @@ -183,36 +183,36 @@ class XCFImageFormat : public QImageFormatPlugin { * metadata items, but is mostly a container for the layer information. */ struct XCFImage { - Q_UINT32 width; //!< width of the XCF image - Q_UINT32 height; //!< height of the XCF image - Q_INT32 type; //!< type of the XCF image (GimpImageBaseType) + TQ_UINT32 width; //!< width of the XCF image + TQ_UINT32 height; //!< height of the XCF image + TQ_INT32 type; //!< type of the XCF image (GimpImageBaseType) - Q_UINT8 compression; //!< tile compression method (CompressionType) + TQ_UINT8 compression; //!< tile compression method (CompressionType) float x_resolution; //!< x resolution in dots per inch float y_resolution; //!< y resolution in dots per inch - Q_INT32 tattoo; //!< (unique identifier?) - Q_UINT32 unit; //!< Units of The GIMP (inch, mm, pica, etc...) - Q_INT32 num_colors; //!< number of colors in an indexed image - QValueVector< QRgb > palette; //!< indexed image color palette + TQ_INT32 tattoo; //!< (unique identifier?) + TQ_UINT32 unit; //!< Units of The GIMP (inch, mm, pica, etc...) + TQ_INT32 num_colors; //!< number of colors in an indexed image + TQValueVector< TQRgb > palette; //!< indexed image color palette int num_layers; //!< number of layers Layer layer; //!< most recently read layer - bool initialized; //!< Is the QImage initialized? - QImage image; //!< final QImage + bool initialized; //!< Is the TQImage initialized? + TQImage image; //!< final TQImage //! Simple constructor. XCFImage ( void ) : initialized( false ) {} }; - //! The bottom-most layer is copied into the final QImage by this + //! The bottom-most layer is copied into the final TQImage by this //! routine. typedef void (*PixelCopyOperation) ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); - //! Higher layers are merged into the the final QImage by this routine. + //! Higher layers are merged into the the final TQImage by this routine. typedef void (*PixelMergeOperation) ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); //! In layer DISSOLVE mode, a random number is chosen to compare to a //! pixel's alpha. If the alpha is greater than the random number, the @@ -245,31 +245,31 @@ public: /*! * The image loader makes no (direct) use of dynamic memory - * and the Qt infrastructure takes care of constructing and destructing + * and the TQt infrastructure takes care of constructing and destructing * the loader so there is not much to do here. */ ~XCFImageFormat () {} /*! - * You can query Qt about the types of image file formats it knows about - * via QImage::inputFormats or QImage::inputFormatList(). + * You can query TQt about the types of image file formats it knows about + * via TQImage::inputFormats or TQImage::inputFormatList(). * This method returns "xcf". */ - QStringList keys () const { - return QStringList() << "XCF"; + TQStringList keys () const { + return TQStringList() << "XCF"; } /*! * This method installs the XCF reader on demand. */ - bool installIOHandler ( const QString& ); + bool installIOHandler ( const TQString& ); static void registerFormat(); private: - static void readXCF ( QImageIO* image_io ); + static void readXCF ( TQImageIO* image_io ); #ifdef TMP_WRITE - static void writeXCF ( QImageIO* ) {} + static void writeXCF ( TQImageIO* ) {} #endif static void initializeImage ( XCFImage& xcf_image ); static void composeTiles ( XCFImage& xcf_image ); @@ -279,52 +279,52 @@ private: static bool loadChannelProperties ( SafeDataStream& xcf_io, Layer& layer ); static bool loadHierarchy ( SafeDataStream& xcf_io, Layer& layer ); static bool loadMask ( SafeDataStream& xcf_io, Layer& layer ); - static bool loadLevel ( SafeDataStream& xcf_io, Layer& layer, Q_INT32 bpp ); + static bool loadLevel ( SafeDataStream& xcf_io, Layer& layer, TQ_INT32 bpp ); static bool loadTileRLE ( SafeDataStream& xcf_io, uchar* tile, int size, - int data_length, Q_INT32 bpp ); + int data_length, TQ_INT32 bpp ); static bool loadProperty ( SafeDataStream& xcf_io, PropType& type, - QByteArray& bytes ); - static void setGrayPalette ( QImage& image ); - static void setPalette ( XCFImage& xcf_image, QImage& image ); + TQByteArray& bytes ); + static void setGrayPalette ( TQImage& image ); + static void setPalette ( XCFImage& xcf_image, TQImage& image ); static void assignImageBytes ( Layer& layer, uint i, uint j ); static void assignMaskBytes ( Layer& layer, uint i, uint j ); static void copyLayerToImage ( XCFImage& xcf_image ); static void copyRGBToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void copyGrayToGray ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void copyGrayToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void copyGrayAToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void copyIndexedToIndexed ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void copyIndexedAToIndexed ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void copyIndexedAToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void mergeLayerIntoImage ( XCFImage& xcf_image ); static void mergeRGBToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void mergeGrayToGray ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void mergeGrayAToGray ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void mergeGrayToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void mergeGrayAToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void mergeIndexedToIndexed ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void mergeIndexedAToIndexed ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); static void mergeIndexedAToRGB ( Layer& layer, uint i, uint j, int k, int l, - QImage& image, int m, int n ); + TQImage& image, int m, int n ); - static void dissolveRGBPixels ( QImage& image, int x, int y ); - static void dissolveAlphaPixels ( QImage& image, int x, int y ); + static void dissolveRGBPixels ( TQImage& image, int x, int y ); + static void dissolveAlphaPixels ( TQImage& image, int x, int y ); }; } // namespace diff --git a/src/gvcore/slideshow.cpp b/src/gvcore/slideshow.cpp index a22b619..aef2a9c 100644 --- a/src/gvcore/slideshow.cpp +++ b/src/gvcore/slideshow.cpp @@ -1,5 +1,5 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab -// kate: indent-mode csands; indent-width 4; replace-tabs-save off; replace-tabs off; replace-trailing-space-save off; space-indent off; tabs-indents on; tab-width 4; +// kate: indent-mode csands; indent-width 4; tqreplace-tabs-save off; tqreplace-tabs off; tqreplace-trailing-space-save off; space-indent off; tabs-indents on; tab-width 4; /* Gwenview - A simple image viewer for KDE Copyright 2000-2004 Aur�ien G�eau @@ -23,8 +23,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. // STL #include <algorithm> -// Qt -#include <qtimer.h> +// TQt +#include <tqtimer.h> // KDE #include <kconfig.h> @@ -51,11 +51,11 @@ namespace Gwenview { SlideShow::SlideShow(Document* document) : mDocument(document), mStarted(false), mPrefetch( NULL ) { - mTimer=new QTimer(this); - connect(mTimer, SIGNAL(timeout()), - this, SLOT(slotTimeout()) ); - connect(mDocument, SIGNAL(loaded(const KURL&)), - this, SLOT(slotLoaded()) ); + mTimer=new TQTimer(this); + connect(mTimer, TQT_SIGNAL(timeout()), + this, TQT_SLOT(slotTimeout()) ); + connect(mDocument, TQT_SIGNAL(loaded(const KURL&)), + this, TQT_SLOT(slotLoaded()) ); } SlideShow::~SlideShow() { @@ -82,12 +82,12 @@ int SlideShow::timerInterval() { void SlideShow::start(const KURL::List& urls) { mURLs.resize(urls.size()); - qCopy(urls.begin(), urls.end(), mURLs.begin()); + tqCopy(urls.begin(), urls.end(), mURLs.begin()); if (SlideShowConfig::random()) { std::random_shuffle(mURLs.begin(), mURLs.end()); } - mStartIt=qFind(mURLs.begin(), mURLs.end(), mDocument->url()); + mStartIt=tqFind(mURLs.begin(), mURLs.end(), mDocument->url()); if (mStartIt==mURLs.end()) { kdWarning() << k_funcinfo << "Current URL not found in list, aborting.\n"; return; @@ -111,8 +111,8 @@ void SlideShow::stop() { } -QValueVector<KURL>::ConstIterator SlideShow::findNextURL() const { - QValueVector<KURL>::ConstIterator it=qFind(mURLs.begin(), mURLs.end(), mDocument->url()); +TQValueVector<KURL>::ConstIterator SlideShow::findNextURL() const { + TQValueVector<KURL>::ConstIterator it=tqFind(mURLs.begin(), mURLs.end(), mDocument->url()); if (it==mURLs.end()) { kdWarning() << k_funcinfo << "Current URL not found in list. This should not happen.\n"; return it; @@ -143,7 +143,7 @@ void SlideShow::slotTimeout() { return; } - QValueVector<KURL>::ConstIterator it=findNextURL(); + TQValueVector<KURL>::ConstIterator it=findNextURL(); if (it==mURLs.end()) { stop(); return; @@ -162,7 +162,7 @@ void SlideShow::slotLoaded() { void SlideShow::prefetch() { LOG(""); - QValueVector<KURL>::ConstIterator it=findNextURL(); + TQValueVector<KURL>::ConstIterator it=findNextURL(); if (it==mURLs.end()) { return; } @@ -175,8 +175,8 @@ void SlideShow::prefetch() { if( !mPriorityURL.isEmpty()) Cache::instance()->setPriorityURL( mPriorityURL, false ); mPriorityURL = *it; Cache::instance()->setPriorityURL( mPriorityURL, true ); // make sure it will stay in the cache - connect( mPrefetch, SIGNAL( urlKindDetermined()), SLOT( slotUrlKindDetermined())); - connect( mPrefetch, SIGNAL( imageLoaded( bool )), SLOT( prefetchDone())); + connect( mPrefetch, TQT_SIGNAL( urlKindDetermined()), TQT_SLOT( slotUrlKindDetermined())); + connect( mPrefetch, TQT_SIGNAL( imageLoaded( bool )), TQT_SLOT( prefetchDone())); if (mPrefetch->urlKind()==MimeTypeUtils::KIND_FILE) { // Prefetch is already done, and this is not a raster image diff --git a/src/gvcore/slideshow.h b/src/gvcore/slideshow.h index 1539347..59cf81d 100644 --- a/src/gvcore/slideshow.h +++ b/src/gvcore/slideshow.h @@ -1,5 +1,5 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab -// kate: indent-mode csands; indent-width 4; replace-tabs-save off; replace-tabs off; replace-trailing-space-save off; space-indent off; tabs-indents on; tab-width 4; +// kate: indent-mode csands; indent-width 4; tqreplace-tabs-save off; tqreplace-tabs off; tqreplace-trailing-space-save off; space-indent off; tabs-indents on; tab-width 4; /* Gwenview - A simple image viewer for KDE Copyright 2000-2004 Aur�ien G�eau @@ -23,14 +23,14 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #ifndef SLIDESHOW_H #define SLIDESHOW_H -// Qt -#include <qobject.h> -#include <qvaluevector.h> +// TQt +#include <tqobject.h> +#include <tqvaluevector.h> // KDE #include <kurl.h> #include "libgwenview_export.h" -class QTimer; +class TQTimer; class KConfig; @@ -38,9 +38,10 @@ namespace Gwenview { class Document; class ImageLoader; -class LIBGWENVIEW_EXPORT SlideShow : public QObject +class LIBGWENVIEW_EXPORT SlideShow : public TQObject { Q_OBJECT + TQ_OBJECT public: SlideShow(Document* document); virtual ~SlideShow(); @@ -68,15 +69,15 @@ private slots: void prefetchDone(); private: - QValueVector<KURL>::ConstIterator findNextURL() const; + TQValueVector<KURL>::ConstIterator findNextURL() const; void prefetch(); int timerInterval(); - QTimer* mTimer; + TQTimer* mTimer; Document* mDocument; bool mStarted; - QValueVector<KURL> mURLs; - QValueVector<KURL>::ConstIterator mStartIt; + TQValueVector<KURL> mURLs; + TQValueVector<KURL>::ConstIterator mStartIt; ImageLoader* mPrefetch; KURL mPriorityURL; }; diff --git a/src/gvcore/threadgate.cpp b/src/gvcore/threadgate.cpp index fb0c65b..290059d 100644 --- a/src/gvcore/threadgate.cpp +++ b/src/gvcore/threadgate.cpp @@ -33,8 +33,8 @@ namespace Gwenview { // there's even no need to do any locking. ThreadGate::ThreadGate() { - connect( this, SIGNAL( signalColor( QColor&, const char* )), - this, SLOT( slotColor( QColor&, const char* ))); + connect( this, TQT_SIGNAL( signalColor( TQColor&, const char* )), + this, TQT_SLOT( slotColor( TQColor&, const char* ))); } ThreadGate* ThreadGate::instance() { @@ -42,19 +42,19 @@ ThreadGate* ThreadGate::instance() { return &gate; } -QColor ThreadGate::color( const char* name ) { +TQColor ThreadGate::color( const char* name ) { if( name == NULL || name[ 0 ] == '\0' || name[ 0 ] == '#' ) - return QColor( name ); + return TQColor( name ); // named color ... needs to be created in the main thread if( TSThread::currentThread() == TSThread::mainThread()) - return QColor( name ); - QColor col; - TSThread::currentThread()->emitCancellableSignal( this, SIGNAL( signalColor( QColor&, const char* )), col, name ); + return TQColor( name ); + TQColor col; + TSThread::currentThread()->emitCancellableSignal( this, TQT_SIGNAL( signalColor( TQColor&, const char* )), col, name ); return col; } -void ThreadGate::slotColor( QColor& col, const char* name ) { - col = QColor( name ); +void ThreadGate::slotColor( TQColor& col, const char* name ) { + col = TQColor( name ); } } // namespace diff --git a/src/gvcore/threadgate.h b/src/gvcore/threadgate.h index f88fffb..57c7654 100644 --- a/src/gvcore/threadgate.h +++ b/src/gvcore/threadgate.h @@ -22,22 +22,23 @@ Copyright 2000-2004 Aurélien Gâteau #ifndef THREADGATE_H #define THREADGATE_H -#include <qobject.h> -#include <qcolor.h> +#include <tqobject.h> +#include <tqcolor.h> namespace Gwenview { -class ThreadGate : public QObject +class ThreadGate : public TQObject { Q_OBJECT + TQ_OBJECT public: static ThreadGate* instance(); - QColor color( const char* name ); + TQColor color( const char* name ); private: ThreadGate(); signals: - void signalColor( QColor&, const char* ); + void signalColor( TQColor&, const char* ); private slots: - void slotColor( QColor&, const char* ); + void slotColor( TQColor&, const char* ); }; } // namespace diff --git a/src/gvcore/thumbnaildetailsdialog.cpp b/src/gvcore/thumbnaildetailsdialog.cpp index 0610488..2ed2ec9 100644 --- a/src/gvcore/thumbnaildetailsdialog.cpp +++ b/src/gvcore/thumbnaildetailsdialog.cpp @@ -21,8 +21,8 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "thumbnaildetailsdialog.moc" -// Qt -#include <qcheckbox.h> +// TQt +#include <tqcheckbox.h> // Local #include "filethumbnailview.h" @@ -38,7 +38,7 @@ struct ThumbnailDetailsDialog::Private { ThumbnailDetailsDialog::ThumbnailDetailsDialog(FileThumbnailView* view) : KDialogBase( - view, 0, false /* modal */, QString::null, KDialogBase::Close, + view, 0, false /* modal */, TQString(), KDialogBase::Close, KDialogBase::Close, true /* separator */) , d(new ThumbnailDetailsDialog::Private) { @@ -53,10 +53,10 @@ ThumbnailDetailsDialog::ThumbnailDetailsDialog(FileThumbnailView* view) d->mContent->mShowFileSize->setChecked(details & FileThumbnailView::FILESIZE); d->mContent->mShowImageSize->setChecked(details & FileThumbnailView::IMAGESIZE); - connect(d->mContent->mShowFileName, SIGNAL(toggled(bool)), SLOT(applyChanges()) ); - connect(d->mContent->mShowFileDate, SIGNAL(toggled(bool)), SLOT(applyChanges()) ); - connect(d->mContent->mShowFileSize, SIGNAL(toggled(bool)), SLOT(applyChanges()) ); - connect(d->mContent->mShowImageSize, SIGNAL(toggled(bool)), SLOT(applyChanges()) ); + connect(d->mContent->mShowFileName, TQT_SIGNAL(toggled(bool)), TQT_SLOT(applyChanges()) ); + connect(d->mContent->mShowFileDate, TQT_SIGNAL(toggled(bool)), TQT_SLOT(applyChanges()) ); + connect(d->mContent->mShowFileSize, TQT_SIGNAL(toggled(bool)), TQT_SLOT(applyChanges()) ); + connect(d->mContent->mShowImageSize, TQT_SIGNAL(toggled(bool)), TQT_SLOT(applyChanges()) ); } ThumbnailDetailsDialog::~ThumbnailDetailsDialog() { diff --git a/src/gvcore/thumbnaildetailsdialog.h b/src/gvcore/thumbnaildetailsdialog.h index b6ce6ad..c3e152a 100644 --- a/src/gvcore/thumbnaildetailsdialog.h +++ b/src/gvcore/thumbnaildetailsdialog.h @@ -30,6 +30,7 @@ class FileThumbnailView; class ThumbnailDetailsDialog : public KDialogBase { Q_OBJECT + TQ_OBJECT public: ThumbnailDetailsDialog(FileThumbnailView* view); ~ThumbnailDetailsDialog(); diff --git a/src/gvcore/thumbnaildetailsdialogbase.ui b/src/gvcore/thumbnaildetailsdialogbase.ui index 4057968..748480c 100644 --- a/src/gvcore/thumbnaildetailsdialogbase.ui +++ b/src/gvcore/thumbnaildetailsdialogbase.ui @@ -1,10 +1,10 @@ <!DOCTYPE UI><UI version="3.1" stdsetdef="1"> <class>ThumbnailDetailsDialogBase</class> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>ThumbnailDetailsDialogBase</cstring> </property> - <property name="geometry"> + <property name="tqgeometry"> <rect> <x>0</x> <y>0</y> @@ -19,7 +19,7 @@ <property name="name"> <cstring>unnamed</cstring> </property> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1</cstring> </property> @@ -27,9 +27,9 @@ <string>Information to display in the thumbnail text:</string> </property> </widget> - <widget class="QLayoutWidget"> + <widget class="TQLayoutWidget"> <property name="name"> - <cstring>layout6</cstring> + <cstring>tqlayout6</cstring> </property> <grid> <property name="name"> @@ -45,14 +45,14 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>21</width> <height>20</height> </size> </property> </spacer> - <widget class="QCheckBox" row="0" column="1"> + <widget class="TQCheckBox" row="0" column="1"> <property name="name"> <cstring>mShowFileName</cstring> </property> @@ -60,7 +60,7 @@ <string>File name</string> </property> </widget> - <widget class="QCheckBox" row="3" column="1"> + <widget class="TQCheckBox" row="3" column="1"> <property name="name"> <cstring>mShowImageSize</cstring> </property> @@ -68,7 +68,7 @@ <string>Image size</string> </property> </widget> - <widget class="QCheckBox" row="2" column="1"> + <widget class="TQCheckBox" row="2" column="1"> <property name="name"> <cstring>mShowFileSize</cstring> </property> @@ -76,7 +76,7 @@ <string>File size</string> </property> </widget> - <widget class="QCheckBox" row="1" column="1"> + <widget class="TQCheckBox" row="1" column="1"> <property name="name"> <cstring>mShowFileDate</cstring> </property> @@ -96,14 +96,14 @@ <property name="sizeType"> <enum>Fixed</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>21</width> <height>21</height> </size> </property> </spacer> - <widget class="QLabel"> + <widget class="TQLabel"> <property name="name"> <cstring>textLabel1_2</cstring> </property> @@ -113,5 +113,5 @@ </widget> </vbox> </widget> -<layoutdefaults spacing="6" margin="11"/> +<tqlayoutdefaults spacing="6" margin="11"/> </UI> diff --git a/src/gvcore/thumbnailloadjob.cpp b/src/gvcore/thumbnailloadjob.cpp index 09cec44..f4335df 100644 --- a/src/gvcore/thumbnailloadjob.cpp +++ b/src/gvcore/thumbnailloadjob.cpp @@ -1,6 +1,6 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab: /* Gwenview - A simple image viewer for KDE - Copyright 2000-2004 Aurélien Gâteau + Copyright 2000-2004 Aur�lien G�teau This class is based on the ImagePreviewJob class from Konqueror. Original copyright follows. */ @@ -29,12 +29,12 @@ #include <unistd.h> #include <assert.h> -// Qt -#include <qdir.h> -#include <qfile.h> -#include <qimage.h> -#include <qpixmap.h> -#include <qtimer.h> +// TQt +#include <tqdir.h> +#include <tqfile.h> +#include <tqimage.h> +#include <tqpixmap.h> +#include <tqtimer.h> // KDE #include <kapplication.h> @@ -74,17 +74,17 @@ namespace Gwenview { #endif -static QString generateOriginalURI(KURL url) { +static TQString generateOriginalURI(KURL url) { // Don't include the password if any - url.setPass(QString::null); + url.setPass(TQString()); return url.url(); } -static QString generateThumbnailPath(const QString& uri, int size) { - KMD5 md5( QFile::encodeName(uri) ); - QString baseDir=ThumbnailLoadJob::thumbnailBaseDir(size); - return baseDir + QString(QFile::encodeName( md5.hexDigest())) + ".png"; +static TQString generateThumbnailPath(const TQString& uri, int size) { + KMD5 md5( TQFile::encodeName(uri).data() ); + TQString baseDir=ThumbnailLoadJob::thumbnailBaseDir(size); + return baseDir + TQString(TQFile::encodeName( md5.hexDigest())) + ".png"; } //------------------------------------------------------------------------ @@ -93,12 +93,12 @@ static QString generateThumbnailPath(const QString& uri, int size) { // //------------------------------------------------------------------------ void ThumbnailThread::load( - const QString& originalURI, time_t originalTime, int originalSize, const QString& originalMimeType, - const QString& pixPath, - const QString& thumbnailPath, + const TQString& originalURI, time_t originalTime, int originalSize, const TQString& originalMimeType, + const TQString& pixPath, + const TQString& thumbnailPath, int size, bool storeThumbnail) { - QMutexLocker lock( &mMutex ); + TQMutexLocker lock( &mMutex ); assert( mPixPath.isNull()); mOriginalURI = TSDeepCopy(originalURI); @@ -114,7 +114,7 @@ void ThumbnailThread::load( } void ThumbnailThread::run() { - QMutexLocker lock( &mMutex ); + TQMutexLocker lock( &mMutex ); while( !testCancel()) { // empty mPixPath means nothing to do while( mPixPath.isNull()) { @@ -122,14 +122,14 @@ void ThumbnailThread::run() { if( testCancel()) return; } loadThumbnail(); - mPixPath = QString(); // done, ready for next - QSize size(mOriginalWidth, mOriginalHeight); - emitCancellableSignal( this, SIGNAL( done( const QImage&, const QSize&)), mImage, size); + mPixPath = TQString(); // done, ready for next + TQSize size(mOriginalWidth, mOriginalHeight); + emitCancellableSignal( this, TQT_SIGNAL( done( const TQImage&, const TQSize&)), mImage, size); } } void ThumbnailThread::loadThumbnail() { - mImage = QImage(); + mImage = TQImage(); bool loaded=false; bool needCaching=true; @@ -156,9 +156,9 @@ void ThumbnailThread::loadThumbnail() { mImage=ImageUtils::transform(mImage,orientation); } } - // File is not a JPEG, or JPEG optimized load failed, load file using Qt + // File is not a JPEG, or JPEG optimized load failed, load file using TQt if (!loaded) { - QImage originalImage; + TQImage originalImage; if (originalImage.load(mPixPath)) { mOriginalWidth=originalImage.width(); mOriginalHeight=originalImage.height(); @@ -166,11 +166,11 @@ void ThumbnailThread::loadThumbnail() { if( testCancel()) return; - if (QMAX(mOriginalWidth, mOriginalHeight)<=thumbSize ) { + if (TQMAX(mOriginalWidth, mOriginalHeight)<=thumbSize ) { mImage=originalImage; needCaching = false; } else { - mImage=ImageUtils::scale(originalImage,thumbSize,thumbSize,ImageUtils::SMOOTH_FAST,QImage::ScaleMin); + mImage=ImageUtils::scale(originalImage,thumbSize,thumbSize,ImageUtils::SMOOTH_FAST,TQ_ScaleMin); } loaded = true; } @@ -180,20 +180,20 @@ void ThumbnailThread::loadThumbnail() { if( mStoreThumbnailsInCache && needCaching ) { mImage.setText("Thumb::URI", 0, mOriginalURI); - mImage.setText("Thumb::MTime", 0, QString::number(mOriginalTime)); - mImage.setText("Thumb::Size", 0, QString::number(mOriginalSize)); + mImage.setText("Thumb::MTime", 0, TQString::number(mOriginalTime)); + mImage.setText("Thumb::Size", 0, TQString::number(mOriginalSize)); mImage.setText("Thumb::Mimetype", 0, mOriginalMimeType); - mImage.setText("Thumb::Image::Width", 0, QString::number(mOriginalWidth)); - mImage.setText("Thumb::Image::Height", 0, QString::number(mOriginalHeight)); + mImage.setText("Thumb::Image::Width", 0, TQString::number(mOriginalWidth)); + mImage.setText("Thumb::Image::Height", 0, TQString::number(mOriginalHeight)); mImage.setText("Software", 0, "Gwenview"); - QString thumbnailDir = ThumbnailLoadJob::thumbnailBaseDir(mThumbnailSize); + TQString thumbnailDir = ThumbnailLoadJob::thumbnailBaseDir(mThumbnailSize); KStandardDirs::makeDir(thumbnailDir, 0700); KTempFile tmp(thumbnailDir + "/gwenview", ".png"); tmp.setAutoDelete(true); if (tmp.status()!=0) { - QString reason( strerror(tmp.status()) ); + TQString reason( strerror(tmp.status()) ); kdWarning() << "Could not create a temporary file.\nReason: " << reason << endl; return; } @@ -203,13 +203,13 @@ void ThumbnailThread::loadThumbnail() { return; } - rename(QFile::encodeName(tmp.name()), QFile::encodeName(mThumbnailPath)); + rename(TQFile::encodeName(tmp.name()), TQFile::encodeName(mThumbnailPath)); } } bool ThumbnailThread::isJPEG() { - QString format=QImageIO::imageFormat(mPixPath); + TQString format=TQImageIO::imageFormat(mPixPath); return format=="JPEG"; } @@ -229,7 +229,7 @@ bool ThumbnailThread::loadJPEG() { struct jpeg_decompress_struct cinfo; // Open file - FILE* inputFile=fopen(QFile::encodeName( mPixPath ).data(), "rb"); + FILE* inputFile=fopen(TQFile::encodeName( mPixPath ).data(), "rb"); if(!inputFile) return false; // Error handling @@ -249,7 +249,7 @@ bool ThumbnailThread::loadJPEG() { // Get image size and check if we need a thumbnail int size= mThumbnailSize <= ThumbnailSize::NORMAL ? ThumbnailSize::NORMAL : ThumbnailSize::LARGE; - int imgSize = QMAX(cinfo.image_width, cinfo.image_height); + int imgSize = TQMAX(cinfo.image_width, cinfo.image_height); if (imgSize<=size) { fclose(inputFile); @@ -266,7 +266,7 @@ bool ThumbnailThread::loadJPEG() { cinfo.scale_num=1; cinfo.scale_denom=scale; - // Create QImage + // Create TQImage jpeg_start_decompress(&cinfo); switch(cinfo.output_components) { @@ -277,7 +277,7 @@ bool ThumbnailThread::loadJPEG() { case 1: // B&W image mImage.create( cinfo.output_width, cinfo.output_height, 8, 256 ); for (int i=0; i<256; i++) - mImage.setColor(i, qRgb(i,i,i)); + mImage.setColor(i, tqRgb(i,i,i)); break; default: jpeg_destroy_decompress(&cinfo); @@ -295,16 +295,16 @@ bool ThumbnailThread::loadJPEG() { if ( cinfo.output_components == 3 ) { for (uint j=0; j<cinfo.output_height; j++) { uchar *in = mImage.scanLine(j) + cinfo.output_width*3; - QRgb *out = (QRgb*)( mImage.scanLine(j) ); + TQRgb *out = (TQRgb*)( mImage.scanLine(j) ); for (uint i=cinfo.output_width; i--; ) { in-=3; - out[i] = qRgb(in[0], in[1], in[2]); + out[i] = tqRgb(in[0], in[1], in[2]); } } } - int newMax = QMAX(cinfo.output_width, cinfo.output_height); + int newMax = TQMAX(cinfo.output_width, cinfo.output_height); int newx = size*cinfo.output_width / newMax; int newy = size*cinfo.output_height / newMax; @@ -322,16 +322,16 @@ bool ThumbnailThread::loadJPEG() { // ThumbnailLoadJob static methods // //------------------------------------------------------------------------ -QString ThumbnailLoadJob::thumbnailBaseDir() { - static QString dir; +TQString ThumbnailLoadJob::thumbnailBaseDir() { + static TQString dir; if (!dir.isEmpty()) return dir; - dir=QDir::homeDirPath() + "/.thumbnails/"; + dir=TQDir::homeDirPath() + "/.thumbnails/"; return dir; } -QString ThumbnailLoadJob::thumbnailBaseDir(int size) { - QString dir = thumbnailBaseDir(); +TQString ThumbnailLoadJob::thumbnailBaseDir(int size) { + TQString dir = thumbnailBaseDir(); if (size<=ThumbnailSize::NORMAL) { dir+="normal/"; } else { @@ -342,9 +342,9 @@ QString ThumbnailLoadJob::thumbnailBaseDir(int size) { void ThumbnailLoadJob::deleteImageThumbnail(const KURL& url) { - QString uri=generateOriginalURI(url); - QFile::remove(generateThumbnailPath(uri, ThumbnailSize::NORMAL)); - QFile::remove(generateThumbnailPath(uri, ThumbnailSize::LARGE)); + TQString uri=generateOriginalURI(url); + TQFile::remove(generateThumbnailPath(uri, ThumbnailSize::NORMAL)); + TQFile::remove(generateThumbnailPath(uri, ThumbnailSize::LARGE)); } @@ -371,7 +371,7 @@ void ThumbnailLoadJob::deleteImageThumbnail(const KURL& url) { updateItemsOrder() builds mItems from mAllItems */ -ThumbnailLoadJob::ThumbnailLoadJob(const QValueVector<const KFileItem*>* items, int size) +ThumbnailLoadJob::ThumbnailLoadJob(const TQValueVector<const KFileItem*>* items, int size) : KIO::Job(false), mState( STATE_NEXTTHUMB ), mCurrentVisibleIndex( -1 ), mFirstVisibleIndex( -1 ), mLastVisibleIndex( -1 ), mThumbnailSize(size), mSuspended( false ) @@ -385,11 +385,11 @@ ThumbnailLoadJob::ThumbnailLoadJob(const QValueVector<const KFileItem*>* items, Q_ASSERT(!items->empty()); mAllItems=*items; mProcessedState.resize( mAllItems.count()); - qFill( mProcessedState.begin(), mProcessedState.end(), false ); + tqFill( mProcessedState.begin(), mProcessedState.end(), false ); mCurrentItem = NULL; - connect(&mThumbnailThread, SIGNAL(done(const QImage&, const QSize&)), - SLOT(thumbnailReady(const QImage&, const QSize&)) ); + connect(&mThumbnailThread, TQT_SIGNAL(done(const TQImage&, const TQSize&)), + TQT_SLOT(thumbnailReady(const TQImage&, const TQSize&)) ); Cache::instance()->updateAge(); // see addThumbnail in Cache } @@ -547,9 +547,9 @@ void ThumbnailLoadJob::determineNextIcon() { if( mCurrentURL.isLocalFile() && !KIO::probably_slow_mounted( mCurrentURL.path())) { KDE_struct_stat buff; - if ( KDE_stat( QFile::encodeName(mCurrentURL.path()), &buff ) == 0 ) { + if ( KDE_stat( TQFile::encodeName(mCurrentURL.path()), &buff ) == 0 ) { mOriginalTime = buff.st_mtime; - QTimer::singleShot( 0, this, SLOT( checkThumbnail())); + TQTimer::singleShot( 0, this, TQT_SLOT( checkThumbnail())); } } if( mOriginalTime == 0 ) { // KIO must be used @@ -598,8 +598,8 @@ void ThumbnailLoadJob::slotResult(KIO::Job * job) { if (job->error()) { emitThumbnailLoadingFailed(); LOG("Delete temp file " << mTempPath); - QFile::remove(mTempPath); - mTempPath = QString::null; + TQFile::remove(mTempPath); + mTempPath = TQString(); determineNextIcon(); } else { startCreatingThumbnail(mTempPath); @@ -613,9 +613,9 @@ void ThumbnailLoadJob::slotResult(KIO::Job * job) { } -void ThumbnailLoadJob::thumbnailReady( const QImage& im, const QSize& _size) { - QImage img = TSDeepCopy( im ); - QSize size = _size; +void ThumbnailLoadJob::thumbnailReady( const TQImage& im, const TQSize& _size) { + TQImage img = TSDeepCopy( im ); + TQSize size = _size; if ( !img.isNull()) { emitThumbnailLoaded(img, size); } else { @@ -623,8 +623,8 @@ void ThumbnailLoadJob::thumbnailReady( const QImage& im, const QSize& _size) { } if( !mTempPath.isEmpty()) { LOG("Delete temp file " << mTempPath); - QFile::remove(mTempPath); - mTempPath = QString::null; + TQFile::remove(mTempPath); + mTempPath = TQString(); } determineNextIcon(); } @@ -634,14 +634,14 @@ void ThumbnailLoadJob::checkThumbnail() { if (mCurrentURL.isLocalFile() && mCurrentURL.directory(false).startsWith(thumbnailBaseDir()) ) { - QImage image(mCurrentURL.path()); + TQImage image(mCurrentURL.path()); emitThumbnailLoaded(image, image.size()); determineNextIcon(); return; } - QSize imagesize; + TQSize imagesize; if( mOriginalTime == time_t( Cache::instance()->timestamp( mCurrentURL ).toTime_t())) { - QPixmap cached = Cache::instance()->thumbnail( mCurrentURL, imagesize ); + TQPixmap cached = Cache::instance()->thumbnail( mCurrentURL, imagesize ); if( !cached.isNull()) { emit thumbnailLoaded(mCurrentItem, cached, imagesize); determineNextIcon(); @@ -654,19 +654,19 @@ void ThumbnailLoadJob::checkThumbnail() { LOG("Stat thumb " << mThumbnailPath); - QImage thumb; + TQImage thumb; if ( thumb.load(mThumbnailPath) ) { if (thumb.text("Thumb::URI", 0) == mOriginalURI && thumb.text("Thumb::MTime", 0).toInt() == mOriginalTime ) { int width=0, height=0; - QSize size; + TQSize size; bool ok; width=thumb.text("Thumb::Image::Width", 0).toInt(&ok); if (ok) height=thumb.text("Thumb::Image::Height", 0).toInt(&ok); if (ok) { - size=QSize(width, height); + size=TQSize(width, height); } else { LOG("Thumbnail for " << mOriginalURI << " does not contain correct image size information"); KFileMetaInfo fmi(mCurrentURL); @@ -688,7 +688,7 @@ void ThumbnailLoadJob::checkThumbnail() { } // Thumbnail not found or not valid - if ( MimeTypeUtils::rasterImageMimeTypes().contains(mCurrentItem->mimetype()) ) { + if ( MimeTypeUtils::rasterImageMimeTypes().tqcontains(mCurrentItem->mimetype()) ) { // This is a raster image if (mCurrentURL.isLocalFile()) { // Original is a local file, create the thumbnail @@ -712,16 +712,16 @@ void ThumbnailLoadJob::checkThumbnail() { list.append(mCurrentItem); KIO::Job* job=KIO::filePreview(list, mThumbnailSize); job->setWindow(KApplication::kApplication()->mainWidget()); - connect(job, SIGNAL(gotPreview(const KFileItem*, const QPixmap&)), - this, SLOT(slotGotPreview(const KFileItem*, const QPixmap&)) ); - connect(job, SIGNAL(failed(const KFileItem*)), - this, SLOT(emitThumbnailLoadingFailed()) ); + connect(job, TQT_SIGNAL(gotPreview(const KFileItem*, const TQPixmap&)), + this, TQT_SLOT(slotGotPreview(const KFileItem*, const TQPixmap&)) ); + connect(job, TQT_SIGNAL(failed(const KFileItem*)), + this, TQT_SLOT(emitThumbnailLoadingFailed()) ); addSubjob(job); return; } } -void ThumbnailLoadJob::startCreatingThumbnail(const QString& pixPath) { +void ThumbnailLoadJob::startCreatingThumbnail(const TQString& pixPath) { LOG("Creating thumbnail from " << pixPath); mThumbnailThread.load( mOriginalURI, mOriginalTime, mCurrentItem->size(), mCurrentItem->mimetype(), pixPath, mThumbnailPath, mThumbnailSize, @@ -729,33 +729,33 @@ void ThumbnailLoadJob::startCreatingThumbnail(const QString& pixPath) { } -void ThumbnailLoadJob::slotGotPreview(const KFileItem* item, const QPixmap& pixmap) { +void ThumbnailLoadJob::slotGotPreview(const KFileItem* item, const TQPixmap& pixmap) { LOG(""); - QSize size; + TQSize size; emit thumbnailLoaded(item, pixmap, size); } -void ThumbnailLoadJob::emitThumbnailLoaded(const QImage& img, QSize size) { - int biggestDimension=QMAX(img.width(), img.height()); +void ThumbnailLoadJob::emitThumbnailLoaded(const TQImage& img, TQSize size) { + int biggestDimension=TQMAX(img.width(), img.height()); - QImage thumbImg; + TQImage thumbImg; if (biggestDimension>mThumbnailSize) { // Scale down thumbnail if necessary - thumbImg=ImageUtils::scale(img,mThumbnailSize, mThumbnailSize, ImageUtils::SMOOTH_FAST,QImage::ScaleMin); + thumbImg=ImageUtils::scale(img,mThumbnailSize, mThumbnailSize, ImageUtils::SMOOTH_FAST,TQ_ScaleMin); } else { thumbImg=img; } - QDateTime tm; + TQDateTime tm; tm.setTime_t( mOriginalTime ); - QPixmap thumb( thumbImg ); // store as QPixmap in cache (faster to retrieve, no conversion needed) + TQPixmap thumb( thumbImg ); // store as TQPixmap in cache (faster to retrieve, no conversion needed) Cache::instance()->addThumbnail( mCurrentURL, thumb, size, tm ); emit thumbnailLoaded(mCurrentItem, thumb, size); } void ThumbnailLoadJob::emitThumbnailLoadingFailed() { - QSize size; + TQSize size; emit thumbnailLoaded(mCurrentItem, mBrokenPixmap, size); } diff --git a/src/gvcore/thumbnailloadjob.h b/src/gvcore/thumbnailloadjob.h index fd7791e..fc33fdf 100644 --- a/src/gvcore/thumbnailloadjob.h +++ b/src/gvcore/thumbnailloadjob.h @@ -1,6 +1,6 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE - Copyright 2000-2004 Aurélien Gâteau + Copyright 2000-2004 Aur�lien G�teau This class is based on the ImagePreviewJob class from Konqueror. Original copyright follows. */ @@ -25,11 +25,11 @@ #ifndef THUMBNAILLOADJOB_H #define THUMBNAILLOADJOB_H -// Qt -#include <qimage.h> -#include <qpixmap.h> -#include <qvaluelist.h> -#include <qvaluevector.h> +// TQt +#include <tqimage.h> +#include <tqpixmap.h> +#include <tqvaluelist.h> +#include <tqvaluevector.h> // KDE #include <kio/job.h> @@ -42,39 +42,40 @@ class KConfig; class KFileItem; -typedef QPtrList<KFileItem> KFileItemList; +typedef TQPtrList<KFileItem> KFileItemList; namespace Gwenview { class ThumbnailThread : public TSThread { Q_OBJECT + TQ_OBJECT public: void load( - const QString& originalURI, + const TQString& originalURI, time_t originalTime, int originalSize, - const QString& originalMimeType, - const QString& pixPath, - const QString& thumbnailPath, + const TQString& originalMimeType, + const TQString& pixPath, + const TQString& thumbnailPath, int size, bool storeThumbnail); protected: virtual void run(); signals: - void done( const QImage&, const QSize&); + void done( const TQImage&, const TQSize&); private: bool isJPEG(); bool loadJPEG(); void loadThumbnail(); - QImage mImage; - QString mPixPath; - QString mThumbnailPath; - QString mOriginalURI; + TQImage mImage; + TQString mPixPath; + TQString mThumbnailPath; + TQString mOriginalURI; time_t mOriginalTime; int mOriginalSize; - QString mOriginalMimeType; + TQString mOriginalMimeType; int mOriginalWidth; int mOriginalHeight; - QMutex mMutex; + TQMutex mMutex; TSWaitCondition mCond; int mThumbnailSize; bool mStoreThumbnailsInCache; @@ -85,11 +86,12 @@ private: */ class LIBGWENVIEW_EXPORT ThumbnailLoadJob : public KIO::Job { Q_OBJECT + TQ_OBJECT public: /** * Create a job for determining the pixmaps of the images in the @p itemList */ - ThumbnailLoadJob(const QValueVector<const KFileItem*>* itemList, int size); + ThumbnailLoadJob(const TQValueVector<const KFileItem*>* itemList, int size); virtual ~ThumbnailLoadJob(); /** @@ -128,12 +130,12 @@ public: /** * Returns the thumbnail base dir, independent of the thumbnail size */ - static QString thumbnailBaseDir(); + static TQString thumbnailBaseDir(); /** * Returns the thumbnail base dir, for the @p size */ - static QString thumbnailBaseDir(int size); + static TQString thumbnailBaseDir(int size); /** @@ -145,21 +147,21 @@ signals: /** * Emitted when the thumbnail for the @p item has been loaded */ - void thumbnailLoaded(const KFileItem* item, const QPixmap&, const QSize&); + void thumbnailLoaded(const KFileItem* item, const TQPixmap&, const TQSize&); private slots: void slotResult( KIO::Job *job ); - void slotGotPreview(const KFileItem*, const QPixmap&); + void slotGotPreview(const KFileItem*, const TQPixmap&); void checkThumbnail(); - void thumbnailReady(const QImage& im, const QSize&); + void thumbnailReady(const TQImage& im, const TQSize&); void emitThumbnailLoadingFailed(); private: enum { STATE_STATORIG, STATE_DOWNLOADORIG, STATE_PREVIEWJOB, STATE_NEXTTHUMB } mState; - QValueList<const KFileItem*> mItems; - QValueVector<const KFileItem* > mAllItems; - QValueVector< bool > mProcessedState; + TQValueList<const KFileItem*> mItems; + TQValueVector<const KFileItem* > mAllItems; + TQValueVector< bool > mProcessedState; const KFileItem *mCurrentItem; int thumbnailIndex( const KFileItem* item ) const; void updateItemsOrder(); @@ -171,37 +173,37 @@ private: KURL mCurrentURL; // The URI of the original image (might be different from mCurrentURL.url()) - QString mOriginalURI; + TQString mOriginalURI; // The modification time of the original image time_t mOriginalTime; // The thumbnail path - QString mThumbnailPath; + TQString mThumbnailPath; // The temporary path for remote urls - QString mTempPath; + TQString mTempPath; // Thumbnail size int mThumbnailSize; - QPixmap mBrokenPixmap; + TQPixmap mBrokenPixmap; bool mSuspended; ThumbnailThread mThumbnailThread; void determineNextIcon(); - void startCreatingThumbnail(const QString& path); + void startCreatingThumbnail(const TQString& path); - void emitThumbnailLoaded(const QImage& img, QSize size); + void emitThumbnailLoaded(const TQImage& img, TQSize size); void updateItemsOrderHelper( int forward, int backward, int first, int last ); }; inline int ThumbnailLoadJob::thumbnailIndex( const KFileItem* item ) const { - QValueVector<const KFileItem* >::ConstIterator pos = qFind( mAllItems.begin(), mAllItems.end(), item ); + TQValueVector<const KFileItem* >::ConstIterator pos = tqFind( mAllItems.begin(), mAllItems.end(), item ); if( pos != mAllItems.end()) return pos - mAllItems.begin(); return -1; } diff --git a/src/gvcore/timeutils.cpp b/src/gvcore/timeutils.cpp index 3893aa5..bed1157 100644 --- a/src/gvcore/timeutils.cpp +++ b/src/gvcore/timeutils.cpp @@ -33,8 +33,8 @@ namespace TimeUtils { time_t getTime(const KFileItem* item) { const KFileMetaInfo& info = item->metaInfo(); if (info.isValid()) { - QVariant value = info.value("Date/time"); - QDateTime dt = value.toDateTime(); + TQVariant value = info.value("Date/time"); + TQDateTime dt = value.toDateTime(); if (dt.isValid()) { return dt.toTime_t(); } @@ -42,8 +42,8 @@ time_t getTime(const KFileItem* item) { return item->time(KIO::UDS_MODIFICATION_TIME); } -QString formatTime(time_t time) { - QDateTime dt; +TQString formatTime(time_t time) { + TQDateTime dt; dt.setTime_t(time); return KGlobal::locale()->formatDateTime(dt); } diff --git a/src/gvcore/timeutils.h b/src/gvcore/timeutils.h index db50bdd..e59469e 100644 --- a/src/gvcore/timeutils.h +++ b/src/gvcore/timeutils.h @@ -24,7 +24,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include <time.h> class KFileItem; -class QString; +class TQString; namespace Gwenview { namespace TimeUtils { @@ -34,7 +34,7 @@ namespace TimeUtils { */ time_t getTime(const KFileItem*); -QString formatTime(time_t); +TQString formatTime(time_t); } // namespace TimeUtils } // namespace Gwenview diff --git a/src/gvcore/xcursor.cpp b/src/gvcore/xcursor.cpp index 79df377..d3c3acc 100644 --- a/src/gvcore/xcursor.cpp +++ b/src/gvcore/xcursor.cpp @@ -24,9 +24,9 @@ #include "xcursor.h" -#include <qimage.h> +#include <tqimage.h> #include <kdebug.h> -#include <qvaluevector.h> +#include <tqvaluevector.h> #ifdef GV_HAVE_XCURSOR #include <X11/Xlib.h> @@ -37,12 +37,12 @@ namespace Gwenview { #ifdef GV_HAVE_XCURSOR -class XCursorFormat : public QImageFormat { +class XCursorFormat : public TQImageFormat { public: XCursorFormat(); - virtual int decode(QImage& img, QImageConsumer* consumer, + virtual int decode(TQImage& img, TQImageConsumer* consumer, const uchar* buffer, int length); - QByteArray array; + TQByteArray array; int pos; bool was_seek_error; }; @@ -89,7 +89,7 @@ XCursorFormat::XCursorFormat() { } -int XCursorFormat::decode(QImage& img, QImageConsumer* cons, +int XCursorFormat::decode(TQImage& img, TQImageConsumer* cons, const uchar* buffer, int length) { if( length > 0 ) @@ -98,11 +98,11 @@ int XCursorFormat::decode(QImage& img, QImageConsumer* cons, array.resize( old_size + length ); memcpy( array.data() + old_size, buffer, length ); } -// Qt's image async IO and Xcursor library have so nicely incompatible data reading :-/ +// TQt's image async IO and Xcursor library have so nicely incompatible data reading :-/ // Xcursor can read a file only as a whole. One can provide XcursorFile with functions // for reading, writing and seeking. And seeking is the stupid part on Xcursor's side, // as there's no way to suspend reading until more data is available. This means we -// basically have to read the whole file first. However, Qt's image async IO just keeps +// basically have to read the whole file first. However, TQt's image async IO just keeps // feeding data and when there's end of the data it just does nothing and doesn't tell // the decoder. // So the trick will be calling XcursorXcFileLoadImage() but whenever there will be @@ -124,19 +124,19 @@ int XCursorFormat::decode(QImage& img, QImageConsumer* cons, ++cur ) { XcursorImage* cursor = cursors->images[ cur ]; - img = QImage( reinterpret_cast<uchar *>( cursor->pixels ), - cursor->width, cursor->height, 32, NULL, 0, QImage::BigEndian ); + img = TQImage( reinterpret_cast<uchar *>( cursor->pixels ), + cursor->width, cursor->height, 32, NULL, 0, TQImage::BigEndian ); img.setAlphaBuffer( true ); // Convert the image to non-premultiplied alpha - Q_UINT32 *pixels = reinterpret_cast<Q_UINT32 *>( img.bits() ); + TQ_UINT32 *pixels = reinterpret_cast<TQ_UINT32 *>( img.bits() ); for ( int i = 0; i < (img.width() * img.height()); i++ ) { - float alpha = qAlpha( pixels[i] ) / 255.0; + float alpha = tqAlpha( pixels[i] ) / 255.0; if ( alpha > 0.0 && alpha < 1.0 ) - pixels[i] = qRgba( int( qRed(pixels[i]) / alpha ), - int( qGreen(pixels[i]) / alpha ), - int( qBlue(pixels[i]) / alpha ), - qAlpha(pixels[i]) ); + pixels[i] = tqRgba( int( tqRed(pixels[i]) / alpha ), + int( tqGreen(pixels[i]) / alpha ), + int( tqBlue(pixels[i]) / alpha ), + tqAlpha(pixels[i]) ); } // Create a deep copy of the image so the image data is preserved img = img.copy(); @@ -148,7 +148,7 @@ int XCursorFormat::decode(QImage& img, QImageConsumer* cons, if( cursors->nimage > 1 ) cons->setLooping( 0 ); } - cons->changed( QRect( QPoint( 0, 0 ), img.size())); + cons->changed( TQRect( TQPoint( 0, 0 ), img.size())); cons->frameDone(); cons->setFramePeriod( cursor->delay ); } @@ -164,7 +164,7 @@ int XCursorFormat::decode(QImage& img, QImageConsumer* cons, } #endif -QImageFormat* XCursorFormatType::decoderFor( +TQImageFormat* XCursorFormatType::decoderFor( const uchar* buffer, int length) { #ifdef GV_HAVE_XCURSOR diff --git a/src/gvcore/xcursor.h b/src/gvcore/xcursor.h index 27bec9a..977b93b 100644 --- a/src/gvcore/xcursor.h +++ b/src/gvcore/xcursor.h @@ -21,13 +21,13 @@ #ifndef gvxcursor_h #define gvxcursor_h -#include <qasyncimageio.h> +#include <tqasyncimageio.h> namespace Gwenview { -class XCursorFormatType : public QImageFormatType { +class XCursorFormatType : public TQImageFormatType { public: - QImageFormat* decoderFor(const uchar* buffer, int length); + TQImageFormat* decoderFor(const uchar* buffer, int length); const char* formatName() const; }; diff --git a/src/gvcore/xpm.cpp b/src/gvcore/xpm.cpp index ce7656f..49acb8e 100644 --- a/src/gvcore/xpm.cpp +++ b/src/gvcore/xpm.cpp @@ -4,33 +4,33 @@ /**************************************************************************** ** ** -** Implementation of QImage and QImageIO classes +** Implementation of TQImage and TQImageIO classes ** ** Created : 950207 ** ** Copyright (C) 1992-2003 Trolltech AS. All rights reserved. ** -** This file is part of the kernel module of the Qt GUI Toolkit. +** This file is part of the kernel module of the TQt GUI Toolkit. ** ** This file may be distributed under the terms of the Q Public License ** as defined by Trolltech AS of Norway and appearing in the file -** LICENSE.QPL included in the packaging of this file. +** LICENSE.TQPL included in the packaging of this file. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. -** See http://www.trolltech.com/qpl/ for QPL licensing information. +** information about TQt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for TQPL licensing information. ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are @@ -42,7 +42,7 @@ This code is xpm loader copied from qimage.cpp, with changes making it possible to use this class from another thread. The problem is that - QColor::setNamedColor() isn't reentrant without thread-safe Xlib, + TQColor::setNamedColor() isn't reentrant without thread-safe Xlib, i.e. without XInitThreads() called. Current KDE applications don't call XInitThreads(), and since it needs to be the very first Xlib function called, and Gwenview is also a KPart, it's not possible @@ -56,25 +56,25 @@ #include "xpm.h" -#include <qimage.h> -#include <qmap.h> -#include <qregexp.h> +#include <tqimage.h> +#include <tqmap.h> +#include <tqregexp.h> #include "threadgate.h" namespace Gwenview { -// Qt code start --------------------------- -static QString fbname( const QString &fileName ) // get file basename (sort of) +// TQt code start --------------------------- +static TQString fbname( const TQString &fileName ) // get file basename (sort of) { - QString s = fileName; + TQString s = fileName; if ( !s.isEmpty() ) { int i; - if ( (i = s.findRev('/')) >= 0 ) + if ( (i = s.tqfindRev('/')) >= 0 ) s = s.mid( i ); - if ( (i = s.findRev('\\')) >= 0 ) + if ( (i = s.tqfindRev('\\')) >= 0 ) s = s.mid( i ); - QRegExp r( QString::fromLatin1("[a-zA-Z][a-zA-Z0-9_]*") ); + TQRegExp r( TQString::tqfromLatin1("[a-zA-Z][a-zA-Z0-9_]*") ); int p = r.search( s ); if ( p == -1 ) s.truncate( 0 ); @@ -82,7 +82,7 @@ static QString fbname( const QString &fileName ) // get file basename (sort of) s = s.mid( p, r.matchedLength() ); } if ( s.isEmpty() ) - s = QString::fromLatin1( "dummy" ); + s = TQString::tqfromLatin1( "dummy" ); return s; } @@ -94,7 +94,7 @@ static QString fbname( const QString &fileName ) // get file basename (sort of) // Skip until ", read until the next ", return the rest in *buf // Returns FALSE on error, TRUE on success -static bool read_xpm_string( QCString &buf, QIODevice *d, +static bool read_xpm_string( TQCString &buf, TQIODevice *d, const char * const *source, int &index ) { if ( source ) { @@ -130,42 +130,42 @@ static bool read_xpm_string( QCString &buf, QIODevice *d, -static int nextColorSpec(const QCString & buf) +static int nextColorSpec(const TQCString & buf) { - int i = buf.find(" c "); + int i = buf.tqfind(" c "); if (i < 0) - i = buf.find(" g "); + i = buf.tqfind(" g "); if (i < 0) - i = buf.find(" g4 "); + i = buf.tqfind(" g4 "); if (i < 0) - i = buf.find(" m "); + i = buf.tqfind(" m "); if (i < 0) - i = buf.find(" s "); + i = buf.tqfind(" s "); return i; } // // INTERNAL // -// Reads an .xpm from either the QImageIO or from the QString *. +// Reads an .xpm from either the TQImageIO or from the TQString *. // One of the two HAS to be 0, the other one is used. // -static void read_xpm_image_or_array( QImageIO * iio, const char * const * source, - QImage & image) +static void read_xpm_image_or_array( TQImageIO * iio, const char * const * source, + TQImage & image) { - QCString buf; - QIODevice *d = 0; + TQCString buf; + TQIODevice *d = 0; buf.resize( 200 ); int i, cpp, ncols, w, h, index = 0; if ( iio ) { - iio->setStatus( 1 ); + iio->setqStatus( 1 ); d = iio ? iio->ioDevice() : 0; d->readLine( buf.data(), buf.size() ); // "/* XPM */" - QRegExp r( QString::fromLatin1("/\\*.XPM.\\*/") ); - if ( buf.find(r) == -1 ) + TQRegExp r( TQString::tqfromLatin1("/\\*.XPM.\\*/") ); + if ( buf.tqfind(r) == -1 ) return; // bad magic } else if ( !source ) { return; @@ -189,24 +189,24 @@ static void read_xpm_image_or_array( QImageIO * iio, const char * const * source if (image.isNull()) return; - QMap<QString, int> colorMap; + TQMap<TQString, int> colorMap; int currentColor; for( currentColor=0; currentColor < ncols; ++currentColor ) { if ( !read_xpm_string( buf, d, source, index ) ) { -#if defined(QT_CHECK_RANGE) - qWarning( "QImage: XPM color specification missing"); +#if defined(TQT_CHECK_RANGE) + qWarning( "TQImage: XPM color specification missing"); #endif return; } - QString index; + TQString index; index = buf.left( cpp ); buf = buf.mid( cpp ).simplifyWhiteSpace().lower(); buf.prepend( " " ); i = nextColorSpec(buf); if ( i < 0 ) { -#if defined(QT_CHECK_RANGE) - qWarning( "QImage: XPM color specification is missing: %s", buf.data()); +#if defined(TQT_CHECK_RANGE) + qWarning( "TQImage: XPM color specification is missing: %s", buf.data()); #endif return; // no c/g/g4/m/s specification at all } @@ -221,10 +221,10 @@ static void read_xpm_image_or_array( QImageIO * iio, const char * const * source int transparentColor = currentColor; if ( image.depth() == 8 ) { image.setColor( transparentColor, - RGB_MASK & qRgb(198,198,198) ); + TQRGB_MASK & tqRgb(198,198,198) ); colorMap.insert( index, transparentColor ); } else { - QRgb rgb = RGB_MASK & qRgb(198,198,198); + TQRgb rgb = TQRGB_MASK & tqRgb(198,198,198); colorMap.insert( index, rgb ); } } else { @@ -232,15 +232,15 @@ static void read_xpm_image_or_array( QImageIO * iio, const char * const * source buf.truncate (((buf.length()-1) / 4 * 3) + 1); // remove alpha channel left by imagemagick } #ifdef GV_XPM_CHANGES - QColor c = ThreadGate::instance()->color( buf.data()); + TQColor c = ThreadGate::instance()->color( buf.data()); #else - QColor c( buf.data() ); + TQColor c( buf.data() ); #endif if ( image.depth() == 8 ) { image.setColor( currentColor, 0xff000000 | c.rgb() ); colorMap.insert( index, currentColor ); } else { - QRgb rgb = 0xff000000 | c.rgb(); + TQRgb rgb = 0xff000000 | c.rgb(); colorMap.insert( index, rgb ); } } @@ -249,8 +249,8 @@ static void read_xpm_image_or_array( QImageIO * iio, const char * const * source // Read pixels for( int y=0; y<h; y++ ) { if ( !read_xpm_string( buf, d, source, index ) ) { -#if defined(QT_CHECK_RANGE) - qWarning( "QImage: XPM pixels missing on image line %d", y); +#if defined(TQT_CHECK_RANGE) + qWarning( "TQImage: XPM pixels missing on image line %d", y); #endif return; } @@ -276,7 +276,7 @@ static void read_xpm_image_or_array( QImageIO * iio, const char * const * source } } } else { - QRgb *p = (QRgb*)image.scanLine(y); + TQRgb *p = (TQRgb*)image.scanLine(y); uchar *d = (uchar *)buf.data(); uchar *end = d + buf.length(); int x; @@ -284,21 +284,21 @@ static void read_xpm_image_or_array( QImageIO * iio, const char * const * source b[cpp] = '\0'; for ( x=0; x<w && d<end; x++ ) { strncpy( b, (char *)d, cpp ); - *p++ = (QRgb)colorMap[b]; + *p++ = (TQRgb)colorMap[b]; d += cpp; } } } if ( iio ) { iio->setImage( image ); - iio->setStatus( 0 ); // image ok + iio->setqStatus( 0 ); // image ok } } -static void read_xpm_image( QImageIO * iio ) +static void read_xpm_image( TQImageIO * iio ) { - QImage i; + TQImage i; (void)read_xpm_image_or_array( iio, 0, i ); return; } @@ -308,7 +308,7 @@ static const char* xpm_color_name( int cpp, int index ) { static char returnable[5]; static const char code[] = ".#abcdefghijklmnopqrstuvwxyzABCD" - "EFGHIJKLMNOPQRSTUVWXYZ0123456789"; + "EFGHIJKLMNOPTQRSTUVWXYZ0123456789"; // cpp is limited to 4 and index is limited to 64^cpp if ( cpp > 1 ) { if ( cpp > 2 ) { @@ -337,31 +337,31 @@ static const char* xpm_color_name( int cpp, int index ) // write XPM image data -static void write_xpm_image( QImageIO * iio ) +static void write_xpm_image( TQImageIO * iio ) { if ( iio ) - iio->setStatus( 1 ); + iio->setqStatus( 1 ); else return; // ### 8-bit case could be made faster - QImage image; + TQImage image; if ( iio->image().depth() != 32 ) image = iio->image().convertDepth( 32 ); else image = iio->image(); - QMap<QRgb, int> colorMap; + TQMap<TQRgb, int> colorMap; int w = image.width(), h = image.height(), ncolors = 0; int x, y; // build color table for( y=0; y<h; y++ ) { - QRgb * yp = (QRgb *)image.scanLine( y ); + TQRgb * yp = (TQRgb *)image.scanLine( y ); for( x=0; x<w; x++ ) { - QRgb color = *(yp + x); - if ( !colorMap.contains(color) ) + TQRgb color = *(yp + x); + if ( !colorMap.tqcontains(color) ) colorMap.insert( color, ncolors++ ); } } @@ -376,27 +376,27 @@ static void write_xpm_image( QImageIO * iio ) break; } - QString line; + TQString line; // write header - QTextStream s( iio->ioDevice() ); + TQTextStream s( iio->ioDevice() ); s << "/* XPM */" << endl << "static char *" << fbname(iio->fileName()) << "[]={" << endl << "\"" << w << " " << h << " " << ncolors << " " << cpp << "\""; // write palette - QMap<QRgb, int>::Iterator c = colorMap.begin(); + TQMap<TQRgb, int>::Iterator c = colorMap.begin(); while ( c != colorMap.end() ) { - QRgb color = c.key(); - if ( image.hasAlphaBuffer() && color == (color & RGB_MASK) ) + TQRgb color = c.key(); + if ( image.hasAlphaBuffer() && color == (color & TQRGB_MASK) ) line.sprintf( "\"%s c None\"", xpm_color_name(cpp, *c) ); else line.sprintf( "\"%s c #%02x%02x%02x\"", xpm_color_name(cpp, *c), - qRed(color), - qGreen(color), - qBlue(color) ); + tqRed(color), + tqGreen(color), + tqBlue(color) ); ++c; s << "," << endl << line; } @@ -404,11 +404,11 @@ static void write_xpm_image( QImageIO * iio ) // write pixels, limit to 4 characters per pixel line.truncate( cpp*w ); for( y=0; y<h; y++ ) { - QRgb * yp = (QRgb *) image.scanLine( y ); + TQRgb * yp = (TQRgb *) image.scanLine( y ); int cc = 0; for( x=0; x<w; x++ ) { int color = (int)(*(yp + x)); - QCString chars = xpm_color_name( cpp, colorMap[color] ); + TQCString chars = xpm_color_name( cpp, colorMap[color] ); line[cc++] = chars[0]; if ( cpp > 1 ) { line[cc++] = chars[1]; @@ -424,15 +424,15 @@ static void write_xpm_image( QImageIO * iio ) } s << "};" << endl; - iio->setStatus( 0 ); + iio->setqStatus( 0 ); } -// Qt code end --------------------------- +// TQt code end --------------------------- XPM::XPM() { - QImageIO::inputFormats(); // trigger registration of Qt's handlers - QImageIO::defineIOHandler( "XPM", "/\\*.XPM.\\*/", "T", + TQImageIO::inputFormats(); // trigger registration of TQt's handlers + TQImageIO::defineIOHandler( "XPM", "/\\*.XPM.\\*/", "T", read_xpm_image, write_xpm_image ); } diff --git a/src/gvcore/xpm.h b/src/gvcore/xpm.h index f506ea6..bec456b 100644 --- a/src/gvcore/xpm.h +++ b/src/gvcore/xpm.h @@ -4,33 +4,33 @@ /**************************************************************************** ** ** -** Implementation of QImage and QImageIO classes +** Implementation of TQImage and TQImageIO classes ** ** Created : 950207 ** ** Copyright (C) 1992-2003 Trolltech AS. All rights reserved. ** -** This file is part of the kernel module of the Qt GUI Toolkit. +** This file is part of the kernel module of the TQt GUI Toolkit. ** ** This file may be distributed under the terms of the Q Public License ** as defined by Trolltech AS of Norway and appearing in the file -** LICENSE.QPL included in the packaging of this file. +** LICENSE.TQPL included in the packaging of this file. ** ** This file may be distributed and/or modified under the terms of the ** GNU General Public License version 2 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. ** -** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition -** licenses may use this file in accordance with the Qt Commercial License +** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition +** licenses may use this file in accordance with the TQt Commercial License ** Agreement provided with the Software. ** ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. ** ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for -** information about Qt Commercial License Agreements. -** See http://www.trolltech.com/qpl/ for QPL licensing information. +** information about TQt Commercial License Agreements. +** See http://www.trolltech.com/qpl/ for TQPL licensing information. ** See http://www.trolltech.com/gpl/ for GPL licensing information. ** ** Contact info@trolltech.com if any conditions of this licensing are |