summaryrefslogtreecommitdiffstats
path: root/kpdf
diff options
context:
space:
mode:
Diffstat (limited to 'kpdf')
-rw-r--r--kpdf/conf/dlggeneral.ui.h2
-rw-r--r--kpdf/conf/dlgperformance.ui.h2
-rw-r--r--kpdf/conf/preferencesdialog.cpp2
-rw-r--r--kpdf/conf/preferencesdialog.h4
-rw-r--r--kpdf/core/document.cpp302
-rw-r--r--kpdf/core/document.h38
-rw-r--r--kpdf/core/generator.h12
-rw-r--r--kpdf/core/generator_kimgio/generator_kimgio.cpp12
-rw-r--r--kpdf/core/generator_kimgio/generator_kimgio.h4
-rw-r--r--kpdf/core/generator_pdf/generator_pdf.cpp146
-rw-r--r--kpdf/core/generator_pdf/generator_pdf.h32
-rw-r--r--kpdf/core/generator_pdf/gp_outputdev.cpp36
-rw-r--r--kpdf/core/generator_pdf/gp_outputdev.h16
-rw-r--r--kpdf/core/link.cpp12
-rw-r--r--kpdf/core/link.h36
-rw-r--r--kpdf/core/observer.h6
-rw-r--r--kpdf/core/page.cpp46
-rw-r--r--kpdf/core/page.h32
-rw-r--r--kpdf/error.cpp6
-rw-r--r--kpdf/part.cpp220
-rw-r--r--kpdf/part.h48
-rw-r--r--kpdf/shell/shell.cpp32
-rw-r--r--kpdf/ui/minibar.cpp162
-rw-r--r--kpdf/ui/minibar.h10
-rw-r--r--kpdf/ui/pagepainter.cpp46
-rw-r--r--kpdf/ui/pagepainter.h6
-rw-r--r--kpdf/ui/pageview.cpp334
-rw-r--r--kpdf/ui/pageview.h42
-rw-r--r--kpdf/ui/pageviewutils.cpp46
-rw-r--r--kpdf/ui/pageviewutils.h26
-rw-r--r--kpdf/ui/presentationwidget.cpp216
-rw-r--r--kpdf/ui/presentationwidget.h56
-rw-r--r--kpdf/ui/propertiesdialog.cpp42
-rw-r--r--kpdf/ui/propertiesdialog.h2
-rw-r--r--kpdf/ui/searchwidget.cpp32
-rw-r--r--kpdf/ui/searchwidget.h6
-rw-r--r--kpdf/ui/thumbnaillist.cpp102
-rw-r--r--kpdf/ui/thumbnaillist.h44
-rw-r--r--kpdf/ui/toc.cpp40
-rw-r--r--kpdf/ui/toc.h12
-rw-r--r--kpdf/xpdf/xpdf/GlobalParams.cc22
41 files changed, 1146 insertions, 1146 deletions
diff --git a/kpdf/conf/dlggeneral.ui.h b/kpdf/conf/dlggeneral.ui.h
index 8eafde39..316b009f 100644
--- a/kpdf/conf/dlggeneral.ui.h
+++ b/kpdf/conf/dlggeneral.ui.h
@@ -14,7 +14,7 @@
#include <config.h>
-void DlgGeneral::showEvent( QShowEvent * )
+void DlgGeneral::showEvent( TQShowEvent * )
{
#if KPDF_FORCE_DRM
kcfg_ObeyDRM->hide();
diff --git a/kpdf/conf/dlgperformance.ui.h b/kpdf/conf/dlgperformance.ui.h
index 4a13310e..4d6062b6 100644
--- a/kpdf/conf/dlgperformance.ui.h
+++ b/kpdf/conf/dlgperformance.ui.h
@@ -14,7 +14,7 @@
void DlgPerformance::init()
{
- QFont labelFont = descLabel->font();
+ TQFont labelFont = descLabel->font();
labelFont.setBold( true );
descLabel->setFont( labelFont );
}
diff --git a/kpdf/conf/preferencesdialog.cpp b/kpdf/conf/preferencesdialog.cpp
index 7968d3fd..61211008 100644
--- a/kpdf/conf/preferencesdialog.cpp
+++ b/kpdf/conf/preferencesdialog.cpp
@@ -18,7 +18,7 @@
// reimplementing this
#include "preferencesdialog.h"
-PreferencesDialog::PreferencesDialog( QWidget * parent, KConfigSkeleton * skeleton )
+PreferencesDialog::PreferencesDialog( TQWidget * parent, KConfigSkeleton * skeleton )
: KConfigDialog( parent, "preferences", skeleton )
{
m_general = new DlgGeneral(0);
diff --git a/kpdf/conf/preferencesdialog.h b/kpdf/conf/preferencesdialog.h
index 475320ab..36aaa909 100644
--- a/kpdf/conf/preferencesdialog.h
+++ b/kpdf/conf/preferencesdialog.h
@@ -13,7 +13,7 @@
#include <kconfigdialog.h>
#include "conf/settings.h"
-class QWidget;
+class TQWidget;
class KConfigSkeleton;
class DlgGeneral;
@@ -25,7 +25,7 @@ class PreferencesDialog : public KConfigDialog
{
public:
- PreferencesDialog( QWidget * parent, KConfigSkeleton * config );
+ PreferencesDialog( TQWidget * parent, KConfigSkeleton * config );
protected:
// void updateSettings(); // Called when OK/Apply is pressed.
diff --git a/kpdf/core/document.cpp b/kpdf/core/document.cpp
index 25e19d9a..02395747 100644
--- a/kpdf/core/document.cpp
+++ b/kpdf/core/document.cpp
@@ -9,14 +9,14 @@
***************************************************************************/
// qt/kde/system includes
-#include <qdir.h>
-#include <qfile.h>
-#include <qfileinfo.h>
-#include <qimage.h>
-#include <qtextstream.h>
-#include <qvaluevector.h>
-#include <qtimer.h>
-#include <qmap.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
+#include <tqimage.h>
+#include <tqtextstream.h>
+#include <tqvaluevector.h>
+#include <tqtimer.h>
+#include <tqmap.h>
#include <kdebug.h>
#include <kimageio.h>
#include <klocale.h>
@@ -43,7 +43,7 @@ class KPDFDocumentPrivate
{
public:
// find descriptors, mapped by ID (we handle multiple searches)
- QMap< int, RunningSearch * > searches;
+ TQMap< int, RunningSearch * > searches;
int m_lastSearchID;
// needed because for remote documents docFileName is a local file and
@@ -51,26 +51,26 @@ class KPDFDocumentPrivate
KURL url;
// cached stuff
- QString docFileName;
- QString xmlFileName;
+ TQString docFileName;
+ TQString xmlFileName;
// a list of the mimetypes qimage can understand
- QStringList kimgioMimes;
+ TQStringList kimgioMimes;
// viewport stuff
- QValueList< DocumentViewport > viewportHistory;
- QValueList< DocumentViewport >::iterator viewportIterator;
+ TQValueList< DocumentViewport > viewportHistory;
+ TQValueList< DocumentViewport >::iterator viewportIterator;
DocumentViewport nextDocumentViewport; // see KPDFLink::Goto for an explanation
// observers / requests / allocator stuff
- QMap< int, DocumentObserver * > observers;
- QValueList< PixmapRequest * > pixmapRequestsStack;
- QValueList< AllocatedPixmap * > allocatedPixmapsFifo;
+ TQMap< int, DocumentObserver * > observers;
+ TQValueList< PixmapRequest * > pixmapRequestsStack;
+ TQValueList< AllocatedPixmap * > allocatedPixmapsFifo;
int allocatedPixmapsTotalMemory;
// timers (memory checking / info saver)
- QTimer * memCheckTimer;
- QTimer * saveBookmarksTimer;
+ TQTimer * memCheckTimer;
+ TQTimer * saveBookmarksTimer;
};
struct AllocatedPixmap
@@ -88,37 +88,37 @@ struct RunningSearch
// store search properties
int continueOnPage;
NormalizedRect continueOnMatch;
- QValueList< int > highlightedPages;
+ TQValueList< int > highlightedPages;
// fields related to previous searches (used for 'continueSearch')
- QString cachedString;
+ TQString cachedString;
KPDFDocument::SearchType cachedType;
bool cachedCaseSensitive;
bool cachedViewportMove;
bool cachedNoDialogs;
- QColor cachedColor;
+ TQColor cachedColor;
};
#define foreachObserver( cmd ) {\
- QMap< int, DocumentObserver * >::iterator it=d->observers.begin(), end=d->observers.end();\
+ TQMap< int, DocumentObserver * >::iterator it=d->observers.begin(), end=d->observers.end();\
for ( ; it != end ; ++ it ) { (*it)-> cmd ; } }
/** KPDFDocument **/
-KPDFDocument::KPDFDocument(QWidget *widget)
- : QObject(widget), generator( 0 ), d( new KPDFDocumentPrivate )
+KPDFDocument::KPDFDocument(TQWidget *widget)
+ : TQObject(widget), generator( 0 ), d( new KPDFDocumentPrivate )
{
d->allocatedPixmapsTotalMemory = 0;
d->memCheckTimer = 0;
d->saveBookmarksTimer = 0;
d->m_lastSearchID = -1;
KImageIO::registerFormats();
- QStringList list = QImage::inputFormatList();
- QStringList::Iterator it = list.begin();
+ TQStringList list = TQImage::inputFormatList();
+ TQStringList::Iterator it = list.begin();
while( it != list.end() )
{
- d->kimgioMimes << KMimeType::findByPath(QString("foo.%1").arg(*it), 0, true)->name();
+ d->kimgioMimes << KMimeType::findByPath(TQString("foo.%1").arg(*it), 0, true)->name();
++it;
}
}
@@ -133,20 +133,20 @@ KPDFDocument::~KPDFDocument()
}
-bool KPDFDocument::openDocument( const QString & docFile, const KURL & url, const KMimeType::Ptr &mime )
+bool KPDFDocument::openDocument( const TQString & docFile, const KURL & url, const KMimeType::Ptr &mime )
{
- // docFile is always local so we can use QFile on it
- QFile fileReadTest( docFile );
+ // docFile is always local so we can use TQFile on it
+ TQFile fileReadTest( docFile );
if ( !fileReadTest.open( IO_ReadOnly ) )
{
- d->docFileName = QString::null;
+ d->docFileName = TQString::null;
return false;
}
// determine the related "xml document-info" filename
d->url = url;
d->docFileName = docFile;
- QString fn = docFile.contains('/') ? docFile.section('/', -1, -1) : docFile;
- fn = "kpdf/" + QString::number(fileReadTest.size()) + "." + fn + ".xml";
+ TQString fn = docFile.contains('/') ? docFile.section('/', -1, -1) : docFile;
+ fn = "kpdf/" + TQString::number(fileReadTest.size()) + "." + fn + ".xml";
fileReadTest.close();
d->xmlFileName = locateLocal( "data", fn );
@@ -157,7 +157,7 @@ bool KPDFDocument::openDocument( const QString & docFile, const KURL & url, cons
// kdError() << "PS generator not available" << endl;
else
{
- QStringList::Iterator it = d->kimgioMimes.begin();
+ TQStringList::Iterator it = d->kimgioMimes.begin();
while( it != d->kimgioMimes.end() )
{
kdDebug() << *it << endl;
@@ -176,9 +176,9 @@ bool KPDFDocument::openDocument( const QString & docFile, const KURL & url, cons
}
// 1. load Document (and set busy cursor while loading)
- QApplication::setOverrideCursor( waitCursor );
+ TQApplication::setOverrideCursor( waitCursor );
bool openOk = generator->loadDocument( docFile, pages_vector );
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
if ( !openOk || pages_vector.size() <= 0 )
{
delete generator;
@@ -203,16 +203,16 @@ bool KPDFDocument::openDocument( const QString & docFile, const KURL & url, cons
// start bookmark saver timer
if ( !d->saveBookmarksTimer )
{
- d->saveBookmarksTimer = new QTimer( this );
- connect( d->saveBookmarksTimer, SIGNAL( timeout() ), this, SLOT( saveDocumentInfo() ) );
+ d->saveBookmarksTimer = new TQTimer( this );
+ connect( d->saveBookmarksTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( saveDocumentInfo() ) );
}
d->saveBookmarksTimer->start( 5 * 60 * 1000 );
// start memory check timer
if ( !d->memCheckTimer )
{
- d->memCheckTimer = new QTimer( this );
- connect( d->memCheckTimer, SIGNAL( timeout() ), this, SLOT( slotTimedMemoryCheck() ) );
+ d->memCheckTimer = new TQTimer( this );
+ connect( d->memCheckTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTimedMemoryCheck() ) );
}
d->memCheckTimer->start( 2000 );
@@ -244,32 +244,32 @@ void KPDFDocument::closeDocument()
d->url = KURL();
// remove requests left in queue
- QValueList< PixmapRequest * >::iterator sIt = d->pixmapRequestsStack.begin();
- QValueList< PixmapRequest * >::iterator sEnd = d->pixmapRequestsStack.end();
+ TQValueList< PixmapRequest * >::iterator sIt = d->pixmapRequestsStack.begin();
+ TQValueList< PixmapRequest * >::iterator sEnd = d->pixmapRequestsStack.end();
for ( ; sIt != sEnd; ++sIt )
delete *sIt;
d->pixmapRequestsStack.clear();
// send an empty list to observers (to free their data)
- foreachObserver( notifySetup( QValueVector< KPDFPage * >(), true ) );
+ foreachObserver( notifySetup( TQValueVector< KPDFPage * >(), true ) );
// delete pages and clear 'pages_vector' container
- QValueVector< KPDFPage * >::iterator pIt = pages_vector.begin();
- QValueVector< KPDFPage * >::iterator pEnd = pages_vector.end();
+ TQValueVector< KPDFPage * >::iterator pIt = pages_vector.begin();
+ TQValueVector< KPDFPage * >::iterator pEnd = pages_vector.end();
for ( ; pIt != pEnd; ++pIt )
delete *pIt;
pages_vector.clear();
// clear 'memory allocation' descriptors
- QValueList< AllocatedPixmap * >::iterator aIt = d->allocatedPixmapsFifo.begin();
- QValueList< AllocatedPixmap * >::iterator aEnd = d->allocatedPixmapsFifo.end();
+ TQValueList< AllocatedPixmap * >::iterator aIt = d->allocatedPixmapsFifo.begin();
+ TQValueList< AllocatedPixmap * >::iterator aEnd = d->allocatedPixmapsFifo.end();
for ( ; aIt != aEnd; ++aIt )
delete *aIt;
d->allocatedPixmapsFifo.clear();
// clear 'running searches' descriptors
- QMap< int, RunningSearch * >::iterator rIt = d->searches.begin();
- QMap< int, RunningSearch * >::iterator rEnd = d->searches.end();
+ TQMap< int, RunningSearch * >::iterator rIt = d->searches.begin();
+ TQMap< int, RunningSearch * >::iterator rEnd = d->searches.end();
for ( ; rIt != rEnd; ++rIt )
delete *rIt;
d->searches.clear();
@@ -302,13 +302,13 @@ void KPDFDocument::removeObserver( DocumentObserver * pObserver )
{
// free observer's pixmap data
int observerId = pObserver->observerId();
- QValueVector<KPDFPage*>::iterator it = pages_vector.begin(), end = pages_vector.end();
+ TQValueVector<KPDFPage*>::iterator it = pages_vector.begin(), end = pages_vector.end();
for ( ; it != end; ++it )
(*it)->deletePixmap( observerId );
// [MEM] free observer's allocation descriptors
- QValueList< AllocatedPixmap * >::iterator aIt = d->allocatedPixmapsFifo.begin();
- QValueList< AllocatedPixmap * >::iterator aEnd = d->allocatedPixmapsFifo.end();
+ TQValueList< AllocatedPixmap * >::iterator aIt = d->allocatedPixmapsFifo.begin();
+ TQValueList< AllocatedPixmap * >::iterator aEnd = d->allocatedPixmapsFifo.end();
while ( aIt != aEnd )
{
AllocatedPixmap * p = *aIt;
@@ -332,13 +332,13 @@ void KPDFDocument::reparseConfig()
if ( generator && generator->reparseConfig() )
{
// invalidate pixmaps
- QValueVector<KPDFPage*>::iterator it = pages_vector.begin(), end = pages_vector.end();
+ TQValueVector<KPDFPage*>::iterator it = pages_vector.begin(), end = pages_vector.end();
for ( ; it != end; ++it )
(*it)->deletePixmapsAndRects();
// [MEM] remove allocation descriptors
- QValueList< AllocatedPixmap * >::iterator aIt = d->allocatedPixmapsFifo.begin();
- QValueList< AllocatedPixmap * >::iterator aEnd = d->allocatedPixmapsFifo.end();
+ TQValueList< AllocatedPixmap * >::iterator aIt = d->allocatedPixmapsFifo.begin();
+ TQValueList< AllocatedPixmap * >::iterator aEnd = d->allocatedPixmapsFifo.end();
for ( ; aIt != aEnd; ++aIt )
delete *aIt;
d->allocatedPixmapsFifo.clear();
@@ -355,9 +355,9 @@ void KPDFDocument::reparseConfig()
}
-QWidget *KPDFDocument::widget() const
+TQWidget *KPDFDocument::widget() const
{
- return static_cast<QWidget*>(parent());
+ return static_cast<TQWidget*>(parent());
}
bool KPDFDocument::isOpened() const
@@ -415,9 +415,9 @@ bool KPDFDocument::historyAtEnd() const
return d->viewportIterator == --(d->viewportHistory.end());
}
-QString KPDFDocument::getMetaData( const QString & key, const QString & option ) const
+TQString KPDFDocument::getMetaData( const TQString & key, const TQString & option ) const
{
- return generator ? generator->getMetaData( key, option ) : QString();
+ return generator ? generator->getMetaData( key, option ) : TQString();
}
bool KPDFDocument::supportsSearching() const
@@ -435,12 +435,12 @@ void KPDFDocument::putFontInfo(KListView *list)
if (generator) generator->putFontInfo(list);
}
-void KPDFDocument::requestPixmaps( const QValueList< PixmapRequest * > & requests )
+void KPDFDocument::requestPixmaps( const TQValueList< PixmapRequest * > & requests )
{
if ( !generator )
{
// delete requests..
- QValueList< PixmapRequest * >::const_iterator rIt = requests.begin(), rEnd = requests.end();
+ TQValueList< PixmapRequest * >::const_iterator rIt = requests.begin(), rEnd = requests.end();
for ( ; rIt != rEnd; ++rIt )
delete *rIt;
// ..and return
@@ -449,7 +449,7 @@ void KPDFDocument::requestPixmaps( const QValueList< PixmapRequest * > & request
// 1. [CLEAN STACK] remove previous requests of requesterID
int requesterID = requests.first()->id;
- QValueList< PixmapRequest * >::iterator sIt = d->pixmapRequestsStack.begin(), sEnd = d->pixmapRequestsStack.end();
+ TQValueList< PixmapRequest * >::iterator sIt = d->pixmapRequestsStack.begin(), sEnd = d->pixmapRequestsStack.end();
while ( sIt != sEnd )
{
if ( (*sIt)->id == requesterID )
@@ -464,7 +464,7 @@ void KPDFDocument::requestPixmaps( const QValueList< PixmapRequest * > & request
// 2. [ADD TO STACK] add requests to stack
bool threadingDisabled = !KpdfSettings::enableThreading();
- QValueList< PixmapRequest * >::const_iterator rIt = requests.begin(), rEnd = requests.end();
+ TQValueList< PixmapRequest * >::const_iterator rIt = requests.begin(), rEnd = requests.end();
for ( ; rIt != rEnd; ++rIt )
{
// set the 'page field' (see PixmapRequest) and check if it is valid
@@ -568,7 +568,7 @@ void KPDFDocument::setViewport( const DocumentViewport & viewport, int excludeId
}
// notify change to all other (different from id) observers
- QMap< int, DocumentObserver * >::iterator it = d->observers.begin(), end = d->observers.end();
+ TQMap< int, DocumentObserver * >::iterator it = d->observers.begin(), end = d->observers.end();
for ( ; it != end ; ++ it )
if ( it.key() != excludeId )
(*it)->notifyViewportChanged( smoothMove );
@@ -577,9 +577,9 @@ void KPDFDocument::setViewport( const DocumentViewport & viewport, int excludeId
if ( d->allocatedPixmapsFifo.count() > 1 )
{
const int page = viewport.pageNumber;
- QValueList< AllocatedPixmap * > viewportPixmaps;
- QValueList< AllocatedPixmap * >::iterator aIt = d->allocatedPixmapsFifo.begin();
- QValueList< AllocatedPixmap * >::iterator aEnd = d->allocatedPixmapsFifo.end();
+ TQValueList< AllocatedPixmap * > viewportPixmaps;
+ TQValueList< AllocatedPixmap * >::iterator aIt = d->allocatedPixmapsFifo.begin();
+ TQValueList< AllocatedPixmap * >::iterator aEnd = d->allocatedPixmapsFifo.end();
while ( aIt != aEnd )
{
if ( (*aIt)->page == page )
@@ -609,7 +609,7 @@ void KPDFDocument::setPrevViewport()
void KPDFDocument::setNextViewport()
// restore next viewport from the history
{
- QValueList< DocumentViewport >::iterator nextIterator = d->viewportIterator;
+ TQValueList< DocumentViewport >::iterator nextIterator = d->viewportIterator;
++nextIterator;
if ( nextIterator != d->viewportHistory.end() )
{
@@ -625,8 +625,8 @@ void KPDFDocument::setNextDocumentViewport( const DocumentViewport & viewport )
}
-bool KPDFDocument::searchText( int searchID, const QString & text, bool fromStart, bool caseSensitive,
- SearchType type, bool moveViewport, const QColor & color, bool noDialogs )
+bool KPDFDocument::searchText( int searchID, const TQString & text, bool fromStart, bool caseSensitive,
+ SearchType type, bool moveViewport, const TQColor & color, bool noDialogs )
{
// don't perform searches on empty docs
if ( !generator || pages_vector.isEmpty() )
@@ -657,23 +657,23 @@ bool KPDFDocument::searchText( int searchID, const QString & text, bool fromStar
// global data for search
bool foundAMatch = false;
- QValueList< int > pagesToNotify;
+ TQValueList< int > pagesToNotify;
// remove highlights from pages and queue them for notifying changes
pagesToNotify += s->highlightedPages;
- QValueList< int >::iterator it = s->highlightedPages.begin(), end = s->highlightedPages.end();
+ TQValueList< int >::iterator it = s->highlightedPages.begin(), end = s->highlightedPages.end();
for ( ; it != end; ++it )
pages_vector[ *it ]->deleteHighlights( searchID );
s->highlightedPages.clear();
// set hourglass cursor
- QApplication::setOverrideCursor( waitCursor );
+ TQApplication::setOverrideCursor( waitCursor );
// 1. ALLDOC - proces all document marking pages
if ( type == AllDoc )
{
// search and highlight text on all pages
- QValueVector< KPDFPage * >::iterator it = pages_vector.begin(), end = pages_vector.end();
+ TQValueVector< KPDFPage * >::iterator it = pages_vector.begin(), end = pages_vector.end();
for ( ; it != end; ++it )
{
// get page (from the first to the last)
@@ -713,7 +713,7 @@ bool KPDFDocument::searchText( int searchID, const QString & text, bool fromStar
}
// reset cursor to previous shape
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
// send page lists if found anything new
//if ( foundAMatch ) ?maybe?
@@ -747,7 +747,7 @@ bool KPDFDocument::searchText( int searchID, const QString & text, bool fromStar
{
if ( currentPage >= pageCount )
{
- if ( noDialogs || KMessageBox::questionYesNo(widget(), i18n("End of document reached.\nContinue from the beginning?"), QString::null, KStdGuiItem::cont(), KStdGuiItem::cancel()) == KMessageBox::Yes )
+ if ( noDialogs || KMessageBox::questionYesNo(widget(), i18n("End of document reached.\nContinue from the beginning?"), TQString::null, KStdGuiItem::cont(), KStdGuiItem::cancel()) == KMessageBox::Yes )
currentPage = 0;
else
break;
@@ -765,7 +765,7 @@ bool KPDFDocument::searchText( int searchID, const QString & text, bool fromStar
}
// reset cursor to previous shape
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
// if a match has been found..
if ( match )
@@ -804,12 +804,12 @@ bool KPDFDocument::searchText( int searchID, const QString & text, bool fromStar
{
// search and highlight every word in 'text' on all pages
bool matchAll = type == GoogleAll;
- QStringList words = QStringList::split( " ", text );
+ TQStringList words = TQStringList::split( " ", text );
int wordsCount = words.count(),
hueStep = (wordsCount > 1) ? (60 / (wordsCount - 1)) : 60,
baseHue, baseSat, baseVal;
color.getHsv( &baseHue, &baseSat, &baseVal );
- QValueVector< KPDFPage * >::iterator it = pages_vector.begin(), end = pages_vector.end();
+ TQValueVector< KPDFPage * >::iterator it = pages_vector.begin(), end = pages_vector.end();
for ( ; it != end; ++it )
{
// get page (from the first to the last)
@@ -825,11 +825,11 @@ bool KPDFDocument::searchText( int searchID, const QString & text, bool fromStar
anyMatched = false;
for ( int w = 0; w < wordsCount; w++ )
{
- QString word = words[ w ];
+ TQString word = words[ w ];
int newHue = baseHue - w * hueStep;
if ( newHue < 0 )
newHue += 360;
- QColor wordColor = QColor( newHue, baseSat, baseVal, QColor::Hsv );
+ TQColor wordColor = TQColor( newHue, baseSat, baseVal, TQColor::Hsv );
NormalizedRect * lastMatch = 0;
// add all highlights for current word
bool wordMatched = false;
@@ -866,14 +866,14 @@ bool KPDFDocument::searchText( int searchID, const QString & text, bool fromStar
}
// reset cursor to previous shape
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
// send page lists to update observers (since some filter on bookmarks)
foreachObserver( notifySetup( pages_vector, false ) );
}
// notify observers about highlights changes
- QValueList< int >::iterator nIt = pagesToNotify.begin(), nEnd = pagesToNotify.end();
+ TQValueList< int >::iterator nIt = pagesToNotify.begin(), nEnd = pagesToNotify.end();
for ( ; nIt != nEnd; ++nIt )
foreachObserver( notifyPageChanged( *nIt, DocumentObserver::Highlights ) );
@@ -904,7 +904,7 @@ void KPDFDocument::resetSearch( int searchID )
RunningSearch * s = d->searches[ searchID ];
// unhighlight pages and inform observers about that
- QValueList< int >::iterator it = s->highlightedPages.begin(), end = s->highlightedPages.end();
+ TQValueList< int >::iterator it = s->highlightedPages.begin(), end = s->highlightedPages.end();
for ( ; it != end; ++it )
{
int pageNumber = *it;
@@ -972,7 +972,7 @@ void KPDFDocument::processLink( const KPDFLink * link )
case KPDFLink::Execute: {
const KPDFLinkExecute * exe = static_cast< const KPDFLinkExecute * >( link );
- QString fileName = exe->fileName();
+ TQString fileName = exe->fileName();
if ( fileName.endsWith( ".pdf" ) || fileName.endsWith( ".PDF" ) )
{
openRelativeFile( fileName );
@@ -1071,7 +1071,7 @@ void KPDFDocument::processLink( const KPDFLink * link )
kapp->invokeMailer( browse->url() );
else
{
- QString url = browse->url();
+ TQString url = browse->url();
// fix for #100366, documents with relative links that are the form of http:foo.pdf
if (url.find("http:") == 0 && url.find("http://") == -1 && url.right(4) == ".pdf")
@@ -1105,8 +1105,8 @@ void KPDFDocument::requestDone( PixmapRequest * req )
#endif
// [MEM] 1.1 find and remove a previous entry for the same page and id
- QValueList< AllocatedPixmap * >::iterator aIt = d->allocatedPixmapsFifo.begin();
- QValueList< AllocatedPixmap * >::iterator aEnd = d->allocatedPixmapsFifo.end();
+ TQValueList< AllocatedPixmap * >::iterator aIt = d->allocatedPixmapsFifo.begin();
+ TQValueList< AllocatedPixmap * >::iterator aEnd = d->allocatedPixmapsFifo.end();
for ( ; aIt != aEnd; ++aIt )
if ( (*aIt)->page == req->pageNumber && (*aIt)->id == req->id )
{
@@ -1197,8 +1197,8 @@ void KPDFDocument::cleanupPixmapMemory( int /*sure? bytesOffset*/ )
{
// [MEM] free memory starting from older pixmaps
int pagesFreed = 0;
- QValueList< AllocatedPixmap * >::iterator pIt = d->allocatedPixmapsFifo.begin();
- QValueList< AllocatedPixmap * >::iterator pEnd = d->allocatedPixmapsFifo.end();
+ TQValueList< AllocatedPixmap * >::iterator pIt = d->allocatedPixmapsFifo.begin();
+ TQValueList< AllocatedPixmap * >::iterator pEnd = d->allocatedPixmapsFifo.end();
while ( (pIt != pEnd) && (memoryToFree > 0) )
{
AllocatedPixmap * p = *pIt;
@@ -1228,16 +1228,16 @@ int KPDFDocument::getTotalMemory()
#ifdef __linux__
// if /proc/meminfo doesn't exist, return 128MB
- QFile memFile( "/proc/meminfo" );
+ TQFile memFile( "/proc/meminfo" );
if ( !memFile.open( IO_ReadOnly ) )
return (cachedValue = 134217728);
// read /proc/meminfo and sum up the contents of 'MemFree', 'Buffers'
// and 'Cached' fields. consider swapped memory as used memory.
- QTextStream readStream( &memFile );
+ TQTextStream readStream( &memFile );
while ( !readStream.atEnd() )
{
- QString entry = readStream.readLine();
+ TQString entry = readStream.readLine();
if ( entry.startsWith( "MemTotal:" ) )
return (cachedValue = (1024 * entry.section( ' ', -2, -2 ).toInt()));
}
@@ -1247,23 +1247,23 @@ int KPDFDocument::getTotalMemory()
int KPDFDocument::getFreeMemory()
{
- static QTime lastUpdate = QTime::currentTime();
+ static TQTime lastUpdate = TQTime::currentTime();
static int cachedValue = 0;
- if ( lastUpdate.secsTo( QTime::currentTime() ) <= 2 )
+ if ( lastUpdate.secsTo( TQTime::currentTime() ) <= 2 )
return cachedValue;
#ifdef __linux__
// if /proc/meminfo doesn't exist, return MEMORY FULL
- QFile memFile( "/proc/meminfo" );
+ TQFile memFile( "/proc/meminfo" );
if ( !memFile.open( IO_ReadOnly ) )
return 0;
// read /proc/meminfo and sum up the contents of 'MemFree', 'Buffers'
// and 'Cached' fields. consider swapped memory as used memory.
int memoryFree = 0;
- QString entry;
- QTextStream readStream( &memFile );
+ TQString entry;
+ TQTextStream readStream( &memFile );
while ( !readStream.atEnd() )
{
entry = readStream.readLine();
@@ -1277,7 +1277,7 @@ int KPDFDocument::getFreeMemory()
}
memFile.close();
- lastUpdate = QTime::currentTime();
+ lastUpdate = TQTime::currentTime();
return ( cachedValue = ( 1024 * memoryFree ) );
#else
@@ -1291,12 +1291,12 @@ void KPDFDocument::loadDocumentInfo()
// are still uninitialized at this point so don't access them
{
//kdDebug() << "Using '" << d->xmlFileName << "' as document info file." << endl;
- QFile infoFile( d->xmlFileName );
+ TQFile infoFile( d->xmlFileName );
if ( !infoFile.exists() || !infoFile.open( IO_ReadOnly ) )
return;
// Load DOM from XML file
- QDomDocument doc( "documentInfo" );
+ TQDomDocument doc( "documentInfo" );
if ( !doc.setContent( &infoFile ) )
{
kdDebug() << "Could not set content" << endl;
@@ -1305,21 +1305,21 @@ void KPDFDocument::loadDocumentInfo()
}
infoFile.close();
- QDomElement root = doc.documentElement();
+ TQDomElement root = doc.documentElement();
if ( root.tagName() != "documentInfo" )
return;
// Parse the DOM tree
- QDomNode topLevelNode = root.firstChild();
+ TQDomNode topLevelNode = root.firstChild();
while ( topLevelNode.isElement() )
{
- QString catName = topLevelNode.toElement().tagName();
+ TQString catName = topLevelNode.toElement().tagName();
// Get bookmarks list from DOM
if ( catName == "bookmarkList" )
{
- QDomNode n = topLevelNode.firstChild();
- QDomElement e;
+ TQDomNode n = topLevelNode.firstChild();
+ TQDomElement e;
int pageNumber;
bool ok;
while ( n.isElement() )
@@ -1337,10 +1337,10 @@ void KPDFDocument::loadDocumentInfo()
// Get 'general info' from the DOM
else if ( catName == "generalInfo" )
{
- QDomNode infoNode = topLevelNode.firstChild();
+ TQDomNode infoNode = topLevelNode.firstChild();
while ( infoNode.isElement() )
{
- QDomElement infoElement = infoNode.toElement();
+ TQDomElement infoElement = infoNode.toElement();
// compatibility: [pre-3.4 viewport storage] @remove after 3.4 relase
if ( infoElement.tagName() == "activePage" )
@@ -1355,13 +1355,13 @@ void KPDFDocument::loadDocumentInfo()
// clear history
d->viewportHistory.clear();
// append old viewports
- QDomNode historyNode = infoNode.firstChild();
+ TQDomNode historyNode = infoNode.firstChild();
while ( historyNode.isElement() )
{
- QDomElement historyElement = historyNode.toElement();
+ TQDomElement historyElement = historyNode.toElement();
if ( historyElement.hasAttribute( "viewport" ) )
{
- QString vpString = historyElement.attribute( "viewport" );
+ TQString vpString = historyElement.attribute( "viewport" );
d->viewportIterator = d->viewportHistory.append(
DocumentViewport( vpString ) );
}
@@ -1378,17 +1378,17 @@ void KPDFDocument::loadDocumentInfo()
} // </documentInfo>
}
-QString KPDFDocument::giveAbsolutePath( const QString & fileName )
+TQString KPDFDocument::giveAbsolutePath( const TQString & fileName )
{
if ( !d->url.isValid() )
- return QString::null;
+ return TQString::null;
return d->url.upURL().url() + fileName;
}
-bool KPDFDocument::openRelativeFile( const QString & fileName )
+bool KPDFDocument::openRelativeFile( const TQString & fileName )
{
- QString absFileName = giveAbsolutePath( fileName );
+ TQString absFileName = giveAbsolutePath( fileName );
if ( absFileName.isNull() )
return false;
@@ -1404,35 +1404,35 @@ void KPDFDocument::saveDocumentInfo() const
if ( d->docFileName.isNull() )
return;
- QFile infoFile( d->xmlFileName );
+ TQFile infoFile( d->xmlFileName );
if (infoFile.open( IO_WriteOnly | IO_Truncate) )
{
// Create DOM
- QDomDocument doc( "documentInfo" );
- QDomElement root = doc.createElement( "documentInfo" );
+ TQDomDocument doc( "documentInfo" );
+ TQDomElement root = doc.createElement( "documentInfo" );
doc.appendChild( root );
// Add bookmark list to DOM
- QDomElement bookmarkList = doc.createElement( "bookmarkList" );
+ TQDomElement bookmarkList = doc.createElement( "bookmarkList" );
root.appendChild( bookmarkList );
for ( uint i = 0; i < pages_vector.count() ; i++ )
{
if ( pages_vector[i]->hasBookmark() )
{
- QDomElement page = doc.createElement( "page" );
- page.appendChild( doc.createTextNode( QString::number(i) ) );
+ TQDomElement page = doc.createElement( "page" );
+ page.appendChild( doc.createTextNode( TQString::number(i) ) );
bookmarkList.appendChild( page );
}
}
// Add general info to DOM
- QDomElement generalInfo = doc.createElement( "generalInfo" );
+ TQDomElement generalInfo = doc.createElement( "generalInfo" );
root.appendChild( generalInfo );
// <general info><history> ... </history> saves history up to 10 viewports
- QValueList< DocumentViewport >::iterator backIterator = d->viewportIterator;
+ TQValueList< DocumentViewport >::iterator backIterator = d->viewportIterator;
if ( backIterator != d->viewportHistory.end() )
{
// go back up to 10 steps from the current viewportIterator
@@ -1441,16 +1441,16 @@ void KPDFDocument::saveDocumentInfo() const
--backIterator;
// create history root node
- QDomElement historyNode = doc.createElement( "history" );
+ TQDomElement historyNode = doc.createElement( "history" );
generalInfo.appendChild( historyNode );
// add old[backIterator] and present[viewportIterator] items
- QValueList< DocumentViewport >::iterator endIt = d->viewportIterator;
+ TQValueList< DocumentViewport >::iterator endIt = d->viewportIterator;
++endIt;
while ( backIterator != endIt )
{
- QString name = (backIterator == d->viewportIterator) ? "current" : "oldPage";
- QDomElement historyEntry = doc.createElement( name );
+ TQString name = (backIterator == d->viewportIterator) ? "current" : "oldPage";
+ TQDomElement historyEntry = doc.createElement( name );
historyEntry.setAttribute( "viewport", (*backIterator).toString() );
historyNode.appendChild( historyEntry );
++backIterator;
@@ -1458,8 +1458,8 @@ void KPDFDocument::saveDocumentInfo() const
}
// Save DOM to XML file
- QString xml = doc.toString();
- QTextStream os( &infoFile );
+ TQString xml = doc.toString();
+ TQTextStream os( &infoFile );
os << xml;
}
infoFile.close();
@@ -1489,7 +1489,7 @@ DocumentViewport::DocumentViewport( int n )
autoFit.height = false;
}
-DocumentViewport::DocumentViewport( const QString & xmlDesc )
+DocumentViewport::DocumentViewport( const TQString & xmlDesc )
: pageNumber( -1 )
{
// default settings (maybe overridden below)
@@ -1508,7 +1508,7 @@ DocumentViewport::DocumentViewport( const QString & xmlDesc )
// decode the string
bool ok;
int field = 0;
- QString token = xmlDesc.section( ';', field, field );
+ TQString token = xmlDesc.section( ';', field, field );
while ( !token.isEmpty() )
{
// decode the current token
@@ -1545,18 +1545,18 @@ DocumentViewport::DocumentViewport( const QString & xmlDesc )
}
}
-QString DocumentViewport::toString() const
+TQString DocumentViewport::toString() const
{
// start string with page number
- QString s = QString::number( pageNumber );
+ TQString s = TQString::number( pageNumber );
// if has center coordinates, save them on string
if ( rePos.enabled )
- s += QString( ";C2:" ) + QString::number( rePos.normalizedX ) +
- ':' + QString::number( rePos.normalizedY ) +
- ':' + QString::number( rePos.pos );
+ s += TQString( ";C2:" ) + TQString::number( rePos.normalizedX ) +
+ ':' + TQString::number( rePos.normalizedY ) +
+ ':' + TQString::number( rePos.pos );
// if has autofit enabled, save its state on string
if ( autoFit.enabled )
- s += QString( ";AF1:" ) + (autoFit.width ? "T" : "F") +
+ s += TQString( ";AF1:" ) + (autoFit.width ? "T" : "F") +
':' + (autoFit.height ? "T" : "F");
return s;
}
@@ -1583,20 +1583,20 @@ bool DocumentViewport::operator==( const DocumentViewport & vp ) const
/** DocumentInfo **/
DocumentInfo::DocumentInfo()
- : QDomDocument( "DocumentInformation" )
+ : TQDomDocument( "DocumentInformation" )
{
- QDomElement docElement = createElement( "DocumentInfo" );
+ TQDomElement docElement = createElement( "DocumentInfo" );
appendChild( docElement );
}
-void DocumentInfo::set( const QString &key, const QString &value,
- const QString &title )
+void DocumentInfo::set( const TQString &key, const TQString &value,
+ const TQString &title )
{
- QDomElement docElement = documentElement();
- QDomElement element;
+ TQDomElement docElement = documentElement();
+ TQDomElement element;
// check whether key already exists
- QDomNodeList list = docElement.elementsByTagName( key );
+ TQDomNodeList list = docElement.elementsByTagName( key );
if ( list.count() > 0 )
element = list.item( 0 ).toElement();
else
@@ -1609,24 +1609,24 @@ void DocumentInfo::set( const QString &key, const QString &value,
docElement.appendChild( element );
}
-QString DocumentInfo::get( const QString &key ) const
+TQString DocumentInfo::get( const TQString &key ) const
{
- QDomElement docElement = documentElement();
- QDomElement element;
+ TQDomElement docElement = documentElement();
+ TQDomElement element;
// check whether key already exists
- QDomNodeList list = docElement.elementsByTagName( key );
+ TQDomNodeList list = docElement.elementsByTagName( key );
if ( list.count() > 0 )
return list.item( 0 ).toElement().attribute( "value" );
else
- return QString();
+ return TQString();
}
/** DocumentSynopsis **/
DocumentSynopsis::DocumentSynopsis()
- : QDomDocument( "DocumentSynopsis" )
+ : TQDomDocument( "DocumentSynopsis" )
{
// void implementation, only subclassed for naming
}
diff --git a/kpdf/core/document.h b/kpdf/core/document.h
index 8e4c1d8e..c1eb840a 100644
--- a/kpdf/core/document.h
+++ b/kpdf/core/document.h
@@ -11,10 +11,10 @@
#ifndef _KPDF_DOCUMENT_H_
#define _KPDF_DOCUMENT_H_
-#include <qobject.h>
-#include <qvaluevector.h>
-#include <qstring.h>
-#include <qdom.h>
+#include <tqobject.h>
+#include <tqvaluevector.h>
+#include <tqstring.h>
+#include <tqdom.h>
#include <kmimetype.h>
@@ -51,11 +51,11 @@ class KPDFDocument : public QObject
{
Q_OBJECT
public:
- KPDFDocument( QWidget *widget );
+ KPDFDocument( TQWidget *widget );
~KPDFDocument();
// document handling
- bool openDocument( const QString & docFile, const KURL & url, const KMimeType::Ptr &mime );
+ bool openDocument( const TQString & docFile, const KURL & url, const KMimeType::Ptr &mime );
void closeDocument();
// misc methods
@@ -67,7 +67,7 @@ class KPDFDocument : public QObject
enum Permission { AllowModify = 1, AllowCopy = 2, AllowPrint = 4, AllowNotes = 8 };
// returns the widget where the document is shown
- QWidget *widget() const;
+ TQWidget *widget() const;
// query methods (const ones)
bool isOpened() const;
@@ -81,7 +81,7 @@ class KPDFDocument : public QObject
bool isAllowed( int /*Document::Permisison(s)*/ ) const;
bool historyAtBegin() const;
bool historyAtEnd() const;
- QString getMetaData( const QString & key, const QString & option = QString() ) const;
+ TQString getMetaData( const TQString & key, const TQString & option = TQString() ) const;
bool supportsSearching() const;
bool hasFonts() const;
void putFontInfo(KListView *list);
@@ -92,12 +92,12 @@ class KPDFDocument : public QObject
void setPrevViewport();
void setNextViewport();
void setNextDocumentViewport( const DocumentViewport & viewport );
- void requestPixmaps( const QValueList< PixmapRequest * > & requests );
+ void requestPixmaps( const TQValueList< PixmapRequest * > & requests );
void requestTextPage( uint page );
enum SearchType { NextMatch, PrevMatch, AllDoc, GoogleAll, GoogleAny };
- bool searchText( int searchID, const QString & text, bool fromStart, bool caseSensitive,
- SearchType type, bool moveViewport, const QColor & color, bool noDialogs = false );
+ bool searchText( int searchID, const TQString & text, bool fromStart, bool caseSensitive,
+ SearchType type, bool moveViewport, const TQColor & color, bool noDialogs = false );
bool continueSearch( int searchID );
void resetSearch( int searchID );
bool continueLastSearch();
@@ -125,11 +125,11 @@ class KPDFDocument : public QObject
int getFreeMemory();
// more private functions
void loadDocumentInfo();
- QString giveAbsolutePath( const QString & fileName );
- bool openRelativeFile( const QString & fileName );
+ TQString giveAbsolutePath( const TQString & fileName );
+ bool openRelativeFile( const TQString & fileName );
Generator * generator;
- QValueVector< KPDFPage * > pages_vector;
+ TQValueVector< KPDFPage * > pages_vector;
class KPDFDocumentPrivate * d;
private slots:
@@ -173,8 +173,8 @@ class DocumentViewport
/** class methods **/
// allowed constructors, don't use others
DocumentViewport( int pageNumber = -1 );
- DocumentViewport( const QString & xmlDesc );
- QString toString() const;
+ DocumentViewport( const TQString & xmlDesc );
+ TQString toString() const;
bool operator==( const DocumentViewport & vp ) const;
};
@@ -193,14 +193,14 @@ class DocumentInfo : public QDomDocument
* Sets a value for a special key. The title should be an i18n'ed
* string, since it's used in the document information dialog.
*/
- void set( const QString &key, const QString &value,
- const QString &title = QString() );
+ void set( const TQString &key, const TQString &value,
+ const TQString &title = TQString() );
/**
* Returns the value for a given key or an empty string when the
* key doesn't exist.
*/
- QString get( const QString &key ) const;
+ TQString get( const TQString &key ) const;
};
/**
diff --git a/kpdf/core/generator.h b/kpdf/core/generator.h
index e0c892fd..841915a2 100644
--- a/kpdf/core/generator.h
+++ b/kpdf/core/generator.h
@@ -10,9 +10,9 @@
#ifndef _KPDF_GENERATOR_H_
#define _KPDF_GENERATOR_H_
-#include <qobject.h>
-#include <qvaluevector.h>
-#include <qstring.h>
+#include <tqobject.h>
+#include <tqvaluevector.h>
+#include <tqstring.h>
#include "core/document.h"
class KListView;
class KPrinter;
@@ -24,7 +24,7 @@ class PixmapRequest;
* Many observers may want to request data syncronously or asyncronously.
* - Sync requests. These should be done in-place.
* - Async request must be done in real background. That usually means a
- * thread, such as QThread derived classes.
+ * thread, such as TQThread derived classes.
* Once contents are available, they must be immediately stored in the
* KPDFPage they refer to, and a signal is emitted as soon as storing
* (even for sync or async queries) has been done.
@@ -45,7 +45,7 @@ class Generator : public QObject
public:
/** virtual methods to reimplement **/
// load a document and fill up the pagesVector
- virtual bool loadDocument( const QString & fileName, QValueVector< KPDFPage * > & pagesVector ) = 0;
+ virtual bool loadDocument( const TQString & fileName, TQValueVector< KPDFPage * > & pagesVector ) = 0;
// Document description and Table of contents
virtual const DocumentInfo * generateDocumentInfo() { return 0L; }
@@ -69,7 +69,7 @@ class Generator : public QObject
// print document using already configured kprinter
virtual bool print( KPrinter& /*printer*/ ) { return false; }
// access meta data of the generator
- virtual QString getMetaData( const QString &/*key*/, const QString &/*option*/ ) { return QString(); }
+ virtual TQString getMetaData( const TQString &/*key*/, const TQString &/*option*/ ) { return TQString(); }
// tell generator to re-parse configuration and return true if something changed
virtual bool reparseConfig() { return false; }
diff --git a/kpdf/core/generator_kimgio/generator_kimgio.cpp b/kpdf/core/generator_kimgio/generator_kimgio.cpp
index bb754686..82491ddc 100644
--- a/kpdf/core/generator_kimgio/generator_kimgio.cpp
+++ b/kpdf/core/generator_kimgio/generator_kimgio.cpp
@@ -7,8 +7,8 @@
* (at your option) any later version. *
***************************************************************************/
-#include <qpainter.h>
-#include <qpixmap.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
#include <kprinter.h>
#include "core/page.h"
@@ -23,9 +23,9 @@ KIMGIOGenerator::~KIMGIOGenerator()
delete m_pix;
}
-bool KIMGIOGenerator::loadDocument( const QString & fileName, QValueVector<KPDFPage*> & pagesVector )
+bool KIMGIOGenerator::loadDocument( const TQString & fileName, TQValueVector<KPDFPage*> & pagesVector )
{
- m_pix = new QPixmap(fileName);
+ m_pix = new TQPixmap(fileName);
pagesVector.resize( 1 );
@@ -42,7 +42,7 @@ bool KIMGIOGenerator::canGeneratePixmap()
void KIMGIOGenerator::generatePixmap( PixmapRequest * request )
{
- QPixmap *p = new QPixmap(*m_pix);
+ TQPixmap *p = new TQPixmap(*m_pix);
request->page->setPixmap(request->id, p);
}
@@ -66,7 +66,7 @@ void KIMGIOGenerator::putFontInfo( KListView * )
bool KIMGIOGenerator::print( KPrinter& printer )
{
- QPainter p(&printer);
+ TQPainter p(&printer);
p.drawPixmap(0, 0, *m_pix);
return true;
}
diff --git a/kpdf/core/generator_kimgio/generator_kimgio.h b/kpdf/core/generator_kimgio/generator_kimgio.h
index bda411f2..2e4606a7 100644
--- a/kpdf/core/generator_kimgio/generator_kimgio.h
+++ b/kpdf/core/generator_kimgio/generator_kimgio.h
@@ -19,7 +19,7 @@ class KIMGIOGenerator : public Generator
virtual ~KIMGIOGenerator();
// [INHERITED] load a document and fill up the pagesVector
- bool loadDocument( const QString & fileName, QValueVector<KPDFPage*> & pagesVector );
+ bool loadDocument( const TQString & fileName, TQValueVector<KPDFPage*> & pagesVector );
// [INHERITED] perform actions on document / pages
bool canGeneratePixmap();
@@ -37,7 +37,7 @@ class KIMGIOGenerator : public Generator
bool print( KPrinter& printer );
private:
- QPixmap *m_pix;
+ TQPixmap *m_pix;
};
#endif
diff --git a/kpdf/core/generator_pdf/generator_pdf.cpp b/kpdf/core/generator_pdf/generator_pdf.cpp
index 35020e56..9540d2fd 100644
--- a/kpdf/core/generator_pdf/generator_pdf.cpp
+++ b/kpdf/core/generator_pdf/generator_pdf.cpp
@@ -9,13 +9,13 @@
***************************************************************************/
// qt/kde includes
-#include <qfile.h>
-#include <qevent.h>
-#include <qimage.h>
-#include <qapplication.h>
-#include <qpaintdevicemetrics.h>
-#include <qregexp.h>
-#include <qvariant.h>
+#include <tqfile.h>
+#include <tqevent.h>
+#include <tqimage.h>
+#include <tqapplication.h>
+#include <tqpaintdevicemetrics.h>
+#include <tqregexp.h>
+#include <tqvariant.h>
#include <kapplication.h>
#include <klistview.h>
#include <klocale.h>
@@ -95,7 +95,7 @@ PDFGenerator::~PDFGenerator()
//BEGIN Generator inherited functions
-bool PDFGenerator::loadDocument( const QString & filePath, QValueVector<KPDFPage*> & pagesVector )
+bool PDFGenerator::loadDocument( const TQString & filePath, TQValueVector<KPDFPage*> & pagesVector )
{
#ifndef NDEBUG
if ( pdfdoc )
@@ -105,7 +105,7 @@ bool PDFGenerator::loadDocument( const QString & filePath, QValueVector<KPDFPage
}
#endif
// create PDFDoc for the given file
- pdfdoc = new PDFDoc( new GString( QFile::encodeName( filePath ) ), 0, 0 );
+ pdfdoc = new PDFDoc( new GString( TQFile::encodeName( filePath ) ), 0, 0 );
// if the file didn't open correctly it might be encrypted, so ask for a pass
bool firstInput = true;
@@ -114,12 +114,12 @@ bool PDFGenerator::loadDocument( const QString & filePath, QValueVector<KPDFPage
int keep = 1;
while ( !pdfdoc->isOk() && pdfdoc->getErrorCode() == errEncrypted )
{
- QCString password;
+ TQCString password;
// 1.A. try to retrieve the first password from the kde wallet system
if ( !triedWallet )
{
- QString walletName = KWallet::Wallet::NetworkWallet();
+ TQString walletName = KWallet::Wallet::NetworkWallet();
wallet = KWallet::Wallet::openWallet( walletName );
if ( wallet )
{
@@ -129,7 +129,7 @@ bool PDFGenerator::loadDocument( const QString & filePath, QValueVector<KPDFPage
wallet->setFolder( "KPdf" );
// look for the pass in that folder
- QString retrievedPass;
+ TQString retrievedPass;
if ( !wallet->readPassword( filePath.section('/', -1, -1), retrievedPass ) )
password = retrievedPass.local8Bit();
}
@@ -139,7 +139,7 @@ bool PDFGenerator::loadDocument( const QString & filePath, QValueVector<KPDFPage
// 1.B. if not retrieved, ask the password using the kde password dialog
if ( password.isNull() )
{
- QString prompt;
+ TQString prompt;
if ( firstInput )
prompt = i18n( "Please insert the password to read the document:" );
else
@@ -152,15 +152,15 @@ bool PDFGenerator::loadDocument( const QString & filePath, QValueVector<KPDFPage
}
// 2. reopen the document using the password
- GString * pwd2 = new GString( QString::fromLocal8Bit(password.data()).latin1() );
+ GString * pwd2 = new GString( TQString::fromLocal8Bit(password.data()).latin1() );
delete pdfdoc;
- pdfdoc = new PDFDoc( new GString( QFile::encodeName( filePath ) ), pwd2, pwd2 );
+ pdfdoc = new PDFDoc( new GString( TQFile::encodeName( filePath ) ), pwd2, pwd2 );
delete pwd2;
// 3. if the password is correct and the user chose to remember it, store it to the wallet
if ( pdfdoc->isOk() && wallet && /*safety check*/ wallet->isOpen() && keep > 0 )
{
- QString goodPass = QString::fromLocal8Bit( password.data() );
+ TQString goodPass = TQString::fromLocal8Bit( password.data() );
wallet->writePassword( filePath.section('/', -1, -1), goodPass );
}
}
@@ -209,12 +209,12 @@ const DocumentInfo * PDFGenerator::generateDocumentInfo()
if ( pdfdoc )
{
docInfo.set( "format", i18n( "PDF v. <version>", "PDF v. %1" )
- .arg( QString::number( pdfdoc->getPDFVersion() ) ), i18n( "Format" ) );
+ .arg( TQString::number( pdfdoc->getPDFVersion() ) ), i18n( "Format" ) );
docInfo.set( "encryption", pdfdoc->isEncrypted() ? i18n( "Encrypted" ) : i18n( "Unencrypted" ),
i18n("Security") );
docInfo.set( "optimization", pdfdoc->isLinearized() ? i18n( "Yes" ) : i18n( "No" ),
i18n("Optimized") );
- docInfo.set( "pages", QString::number( pdfdoc->getCatalog()->getNumPages() ), i18n("Pages") );
+ docInfo.set( "pages", TQString::number( pdfdoc->getCatalog()->getNumPages() ), i18n("Pages") );
}
else
{
@@ -381,7 +381,7 @@ void PDFGenerator::putFontInfo(KListView *list)
fonts = NULL;
fontsLen = fontsSize = 0;
- QValueVector<Ref> visitedXObjects;
+ TQValueVector<Ref> visitedXObjects;
for (pg = 1; pg <= pdfdoc->getNumPages(); ++pg)
{
page = pdfdoc->getCatalog()->getPage(pg);
@@ -414,7 +414,7 @@ void PDFGenerator::putFontInfo(KListView *list)
bool PDFGenerator::print( KPrinter& printer )
{
// PageSize is a CUPS artificially created setting
- QString ps = printer.option("PageSize");
+ TQString ps = printer.option("PageSize");
int paperWidth, paperHeight;
int marginTop, marginLeft, marginRight, marginBottom;
marginTop = (int)printer.option("kde-margin-top").toDouble();
@@ -423,7 +423,7 @@ bool PDFGenerator::print( KPrinter& printer )
marginBottom = (int)printer.option("kde-margin-bottom").toDouble();
bool forceRasterize = printer.option("kde-kpdf-forceRaster").toInt();
- if (ps.find(QRegExp("w\\d+h\\d+")) == 0)
+ if (ps.find(TQRegExp("w\\d+h\\d+")) == 0)
{
// size not supported by Qt, CUPS gives us the size as wWIDTHhHEIGHT, at least on the printers i tester
// remove the w
@@ -440,19 +440,19 @@ bool PDFGenerator::print( KPrinter& printer )
if (!ps.isEmpty()) qtPageSize = pageNameToPageSize(ps);
else qtPageSize = printer.pageSize();
- QPrinter dummy(QPrinter::PrinterResolution);
+ TQPrinter dummy(TQPrinter::PrinterResolution);
dummy.setFullPage(true);
- dummy.setPageSize((QPrinter::PageSize)qtPageSize);
+ dummy.setPageSize((TQPrinter::PageSize)qtPageSize);
- QPaintDeviceMetrics metrics(&dummy);
+ TQPaintDeviceMetrics metrics(&dummy);
paperWidth = metrics.width();
paperHeight = metrics.height();
}
- KTempFile tf( QString::null, ".ps" );
+ KTempFile tf( TQString::null, ".ps" );
globalParams->setPSPaperWidth(paperWidth);
globalParams->setPSPaperHeight(paperHeight);
- QString pstitle = getDocumentInfo("Title", true);
+ TQString pstitle = getDocumentInfo("Title", true);
if ( pstitle.isEmpty() )
{
pstitle = m_document->currentDocument().fileName( false );
@@ -460,7 +460,7 @@ bool PDFGenerator::print( KPrinter& printer )
// this looks non-unicode-safe and it is. anything other than ASCII is not specified
// and some printers actually stop printing when they encounter non-ASCII characters in the
// Postscript %%Title tag
- QCString pstitle8Bit = pstitle.latin1();
+ TQCString pstitle8Bit = pstitle.latin1();
const char* pstitlechar;
if (!pstitle.isEmpty())
{
@@ -492,7 +492,7 @@ bool PDFGenerator::print( KPrinter& printer )
if (result == KMessageBox::Yes) psOut->setScale(xScale, yScale);
}
- QValueList<int> pageList;
+ TQValueList<int> pageList;
if (!printer.previewOnly())
{
@@ -503,7 +503,7 @@ bool PDFGenerator::print( KPrinter& printer )
for(int i = 1; i <= pdfdoc->getNumPages(); i++) pageList.append(i);
}
- QValueList<int>::const_iterator pIt = pageList.begin(), pEnd = pageList.end();
+ TQValueList<int>::const_iterator pIt = pageList.begin(), pEnd = pageList.end();
docLock.lock();
for ( ; pIt != pEnd; ++pIt )
{
@@ -524,7 +524,7 @@ bool PDFGenerator::print( KPrinter& printer )
}
}
-static GString *QStringToGString(const QString &s) {
+static GString *QStringToGString(const TQString &s) {
int len = s.length();
char *cstring = (char *)gmallocn(s.length(), sizeof(char));
for (int i = 0; i < len; ++i)
@@ -532,20 +532,20 @@ static GString *QStringToGString(const QString &s) {
return new GString(cstring, len);
}
-static QString unicodeToQString(Unicode* u, int len) {
- QString ret;
+static TQString unicodeToQString(Unicode* u, int len) {
+ TQString ret;
ret.setLength(len);
- QChar* qch = (QChar*) ret.unicode();
+ TQChar* qch = (TQChar*) ret.unicode();
for (;len;--len)
- *qch++ = (QChar) *u++;
+ *qch++ = (TQChar) *u++;
return ret;
}
-static QString UnicodeParsedString(GString *s1) {
+static TQString UnicodeParsedString(GString *s1) {
GBool isUnicode;
int i;
Unicode u;
- QString result;
+ TQString result;
if ( ( s1->getChar(0) & 0xff ) == 0xfe && ( s1->getChar(1) & 0xff ) == 0xff )
{
isUnicode = gTrue;
@@ -573,7 +573,7 @@ static QString UnicodeParsedString(GString *s1) {
return result;
}
-QString PDFGenerator::getMetaData( const QString & key, const QString & option )
+TQString PDFGenerator::getMetaData( const TQString & key, const TQString & option )
{
if ( key == "StartFullScreen" )
{
@@ -603,13 +603,13 @@ QString PDFGenerator::getMetaData( const QString & key, const QString & option )
if ( pdfdoc->getCatalog()->getPageMode() == Catalog::UseOutlines )
return "yes";
}
- return QString();
+ return TQString();
}
bool PDFGenerator::reparseConfig()
{
// load paper color from Settings or use the white default color
- QColor color = ( (KpdfSettings::renderMode() == KpdfSettings::EnumRenderMode::Paper ) &&
+ TQColor color = ( (KpdfSettings::renderMode() == KpdfSettings::EnumRenderMode::Paper ) &&
KpdfSettings::changeColors() ) ? KpdfSettings::paperColor() : Qt::white;
// if paper color is changed we have to rebuild every visible pixmap in addition
// to the outputDevice. it's the 'heaviest' case, other effect are just recoloring
@@ -634,7 +634,7 @@ bool PDFGenerator::reparseConfig()
}
//END Generator inherited functions
-void PDFGenerator::scanFonts(Dict *resDict, KListView *list, Ref **fonts, int &fontsLen, int &fontsSize, QValueVector<Ref> *visitedXObjects)
+void PDFGenerator::scanFonts(Dict *resDict, KListView *list, Ref **fonts, int &fontsLen, int &fontsSize, TQValueVector<Ref> *visitedXObjects)
{
Object obj1, obj2, xObjDict, xObj, xObj2, resObj;
Ref r;
@@ -717,7 +717,7 @@ void PDFGenerator::scanFont(GfxFont *font, KListView *list, Ref **fonts, int &fo
GBool emb;
int i;
- QString fontTypeNames[12] = {
+ TQString fontTypeNames[12] = {
i18n("unknown"),
i18n("Type 1"),
i18n("Type 1C"),
@@ -750,7 +750,7 @@ void PDFGenerator::scanFont(GfxFont *font, KListView *list, Ref **fonts, int &fo
if (font->getType() == fontType3) emb = gTrue;
else emb = font->getEmbeddedFontID(&embRef);
- QString sName, sEmb, sPath;
+ TQString sName, sEmb, sPath;
if (name)
{
sName = name->getCString();
@@ -783,34 +783,34 @@ void PDFGenerator::scanFont(GfxFont *font, KListView *list, Ref **fonts, int &fo
(*fonts)[fontsLen++] = *font->getID();
}
-QString PDFGenerator::getDocumentInfo( const QString & data, bool canReturnNull ) const
+TQString PDFGenerator::getDocumentInfo( const TQString & data, bool canReturnNull ) const
// note: MUTEX is LOCKED while calling this
{
// [Albert] Code adapted from pdfinfo.cc on xpdf
Object info;
if ( !pdfdoc )
- return canReturnNull ? QString::null : i18n( "Unknown" );
+ return canReturnNull ? TQString::null : i18n( "Unknown" );
pdfdoc->getDocInfo( &info );
if ( !info.isDict() )
- return canReturnNull ? QString::null : i18n( "Unknown" );
+ return canReturnNull ? TQString::null : i18n( "Unknown" );
Object obj;
Dict *infoDict = info.getDict();
if ( infoDict->lookup( (char*)data.latin1(), &obj )->isString() )
{
- QString result = UnicodeParsedString(obj.getString());
+ TQString result = UnicodeParsedString(obj.getString());
obj.free();
info.free();
return result;
}
obj.free();
info.free();
- return canReturnNull ? QString::null : i18n( "Unknown" );
+ return canReturnNull ? TQString::null : i18n( "Unknown" );
}
-QString PDFGenerator::getDocumentDate( const QString & data ) const
+TQString PDFGenerator::getDocumentDate( const TQString & data ) const
// note: MUTEX is LOCKED while calling this
{
// [Albert] Code adapted from pdfinfo.cc on xpdf
@@ -826,23 +826,23 @@ QString PDFGenerator::getDocumentDate( const QString & data ) const
int year, mon, day, hour, min, sec;
Dict *infoDict = info.getDict();
UnicodeMap *uMap = globalParams->getTextEncoding();
- QString result;
+ TQString result;
if ( !uMap )
return i18n( "Unknown Date" );
if ( infoDict->lookup( (char*)data.latin1(), &obj )->isString() )
{
- QString s = UnicodeParsedString(obj.getString());
+ TQString s = UnicodeParsedString(obj.getString());
if ( s[0] == 'D' && s[1] == ':' )
s = s.mid(2);
if ( !s.isEmpty() && sscanf( s.latin1(), "%4d%2d%2d%2d%2d%2d", &year, &mon, &day, &hour, &min, &sec ) == 6 )
{
- QDate d( year, mon, day ); //CHECK: it was mon-1, Jan->0 (??)
- QTime t( hour, min, sec );
+ TQDate d( year, mon, day ); //CHECK: it was mon-1, Jan->0 (??)
+ TQTime t( hour, min, sec );
if ( d.isValid() && t.isValid() )
- result = KGlobal::locale()->formatDateTime( QDateTime(d, t), false, true );
+ result = KGlobal::locale()->formatDateTime( TQDateTime(d, t), false, true );
else
result = s;
}
@@ -856,7 +856,7 @@ QString PDFGenerator::getDocumentDate( const QString & data ) const
return result;
}
-void PDFGenerator::addSynopsisChildren( QDomNode * parent, GList * items )
+void PDFGenerator::addSynopsisChildren( TQDomNode * parent, GList * items )
{
int numItems = items->getLength();
for ( int i = 0; i < numItems; ++i )
@@ -865,13 +865,13 @@ void PDFGenerator::addSynopsisChildren( QDomNode * parent, GList * items )
OutlineItem * outlineItem = (OutlineItem *)items->get( i );
// 1. create element using outlineItem's title as tagName
- QString name;
+ TQString name;
Unicode * uniChar = outlineItem->getTitle();
int titleLength = outlineItem->getTitleLength();
name = unicodeToQString(uniChar, titleLength);
if ( name.isEmpty() )
continue;
- QDomElement item = docSyn.createElement( name );
+ TQDomElement item = docSyn.createElement( name );
parent->appendChild( item );
// 2. find the page the link refers to
@@ -888,9 +888,9 @@ void PDFGenerator::addSynopsisChildren( QDomNode * parent, GList * items )
// so better storing the reference and provide the viewport as metadata
// on demand
GString *s = g->getNamedDest();
- QChar *charArray = new QChar[s->getLength()];
- for (int i = 0; i < s->getLength(); ++i) charArray[i] = QChar(s->getCString()[i]);
- QString option(charArray, s->getLength());
+ TQChar *charArray = new QChar[s->getLength()];
+ for (int i = 0; i < s->getLength(); ++i) charArray[i] = TQChar(s->getCString()[i]);
+ TQString option(charArray, s->getLength());
item.setAttribute( "ViewportName", option );
delete[] charArray;
}
@@ -907,7 +907,7 @@ void PDFGenerator::addSynopsisChildren( QDomNode * parent, GList * items )
}
}
- item.setAttribute( "Open", QVariant( (bool)outlineItem->isOpen() ).toString() );
+ item.setAttribute( "Open", TQVariant( (bool)outlineItem->isOpen() ).toString() );
// 3. recursively descend over children
outlineItem->open();
@@ -1042,7 +1042,7 @@ void PDFGenerator::addTransition( int pageNumber, KPDFPage * page )
-void PDFGenerator::customEvent( QCustomEvent * event )
+void PDFGenerator::customEvent( TQCustomEvent * event )
{
// catch generator 'ready events' only
if ( event->type() != TGE_DATAREADY_ID )
@@ -1074,11 +1074,11 @@ void PDFGenerator::customEvent( QCustomEvent * event )
// 2. put thread's generated data into the KPDFPage
PixmapRequest * request = static_cast< PixmapRequest * >( event->data() );
- QImage * outImage = generatorThread->takeImage();
+ TQImage * outImage = generatorThread->takeImage();
TextPage * outTextPage = generatorThread->takeTextPage();
- QValueList< ObjectRect * > outRects = generatorThread->takeObjectRects();
+ TQValueList< ObjectRect * > outRects = generatorThread->takeObjectRects();
- request->page->setPixmap( request->id, new QPixmap( *outImage ) );
+ request->page->setPixmap( request->id, new TQPixmap( *outImage ) );
delete outImage;
if ( outTextPage )
request->page->setSearchPage( outTextPage );
@@ -1105,9 +1105,9 @@ struct PPGThreadPrivate
PixmapRequest * currentRequest;
// internal temp stored items. don't delete this.
- QImage * m_image;
+ TQImage * m_image;
TextPage * m_textPage;
- QValueList< ObjectRect * > m_rects;
+ TQValueList< ObjectRect * > m_rects;
bool m_rectsTaken;
};
@@ -1129,7 +1129,7 @@ PDFPixmapGeneratorThread::~PDFPixmapGeneratorThread()
delete d->m_textPage;
if ( !d->m_rectsTaken && d->m_rects.count() )
{
- QValueList< ObjectRect * >::iterator it = d->m_rects.begin(), end = d->m_rects.end();
+ TQValueList< ObjectRect * >::iterator it = d->m_rects.begin(), end = d->m_rects.end();
for ( ; it != end; ++it )
delete *it;
}
@@ -1161,7 +1161,7 @@ void PDFPixmapGeneratorThread::startGeneration( PixmapRequest * request )
#endif
// set generation parameters and run thread
d->currentRequest = request;
- start( QThread::InheritPriority );
+ start( TQThread::InheritPriority );
}
void PDFPixmapGeneratorThread::endGeneration()
@@ -1179,9 +1179,9 @@ void PDFPixmapGeneratorThread::endGeneration()
d->currentRequest = 0;
}
-QImage * PDFPixmapGeneratorThread::takeImage() const
+TQImage * PDFPixmapGeneratorThread::takeImage() const
{
- QImage * img = d->m_image;
+ TQImage * img = d->m_image;
d->m_image = 0;
return img;
}
@@ -1193,7 +1193,7 @@ TextPage * PDFPixmapGeneratorThread::takeTextPage() const
return tp;
}
-QValueList< ObjectRect * > PDFPixmapGeneratorThread::takeObjectRects() const
+TQValueList< ObjectRect * > PDFPixmapGeneratorThread::takeObjectRects() const
{
d->m_rectsTaken = true;
return d->m_rects;
@@ -1253,7 +1253,7 @@ void PDFPixmapGeneratorThread::run()
d->generator->docLock.unlock();
// notify the GUI thread that data is pending and can be read
- QCustomEvent * readyEvent = new QCustomEvent( TGE_DATAREADY_ID );
+ TQCustomEvent * readyEvent = new TQCustomEvent( TGE_DATAREADY_ID );
readyEvent->setData( d->currentRequest );
- QApplication::postEvent( d->generator, readyEvent );
+ TQApplication::postEvent( d->generator, readyEvent );
}
diff --git a/kpdf/core/generator_pdf/generator_pdf.h b/kpdf/core/generator_pdf/generator_pdf.h
index ca267b18..662c19fd 100644
--- a/kpdf/core/generator_pdf/generator_pdf.h
+++ b/kpdf/core/generator_pdf/generator_pdf.h
@@ -11,10 +11,10 @@
#ifndef _KPDF_GENERATOR_PDF_H_
#define _KPDF_GENERATOR_PDF_H_
-#include <qmutex.h>
-#include <qcolor.h>
-#include <qstring.h>
-#include <qthread.h>
+#include <tqmutex.h>
+#include <tqcolor.h>
+#include <tqstring.h>
+#include <tqthread.h>
#include "core/generator.h"
#include "core/document.h"
#include "core/link.h"
@@ -42,7 +42,7 @@ class PDFPixmapGeneratorThread;
* For generating page contents we tell PDFDoc to render a page and grab
* contents from out OutputDevs when rendering finishes.
*
- * Background asyncronous contents providing is done via a QThread inherited
+ * Background asyncronous contents providing is done via a TQThread inherited
* class defined at the bottom of the file.
*/
class PDFGenerator : public Generator
@@ -52,7 +52,7 @@ class PDFGenerator : public Generator
virtual ~PDFGenerator();
// [INHERITED] load a document and fill up the pagesVector
- bool loadDocument( const QString & fileName, QValueVector<KPDFPage*> & pagesVector );
+ bool loadDocument( const TQString & fileName, TQValueVector<KPDFPage*> & pagesVector );
// [INHERITED] document informations
const DocumentInfo * generateDocumentInfo();
@@ -77,7 +77,7 @@ class PDFGenerator : public Generator
bool print( KPrinter& printer );
// [INHERITED] reply to some metadata requests
- QString getMetaData( const QString & key, const QString & option );
+ TQString getMetaData( const TQString & key, const TQString & option );
// [INHERITED] reparse configuration
bool reparseConfig();
@@ -86,26 +86,26 @@ class PDFGenerator : public Generator
// friend class to access private document related variables
friend class PDFPixmapGeneratorThread;
- void scanFonts(Dict *resDict, KListView *list, Ref **fonts, int &fontsLen, int &fontsSize, QValueVector<Ref> *visitedXObjects);
+ void scanFonts(Dict *resDict, KListView *list, Ref **fonts, int &fontsLen, int &fontsSize, TQValueVector<Ref> *visitedXObjects);
void scanFont(GfxFont *font, KListView *list, Ref **fonts, int &fontsLen, int &fontsSize);
void fillViewportFromLink( DocumentViewport &viewport, LinkDest *destination );
// private functions for accessing document informations via PDFDoc
- QString getDocumentInfo( const QString & data, bool canReturnNull = false ) const;
- QString getDocumentDate( const QString & data ) const;
+ TQString getDocumentInfo( const TQString & data, bool canReturnNull = false ) const;
+ TQString getDocumentDate( const TQString & data ) const;
// private function for creating the document synopsis hieracy
- void addSynopsisChildren( QDomNode * parent, GList * items );
+ void addSynopsisChildren( TQDomNode * parent, GList * items );
// private function for creating the transition information
void addTransition( int pageNumber, KPDFPage * page );
// (async related) receive data from the generator thread
- void customEvent( QCustomEvent * );
+ void customEvent( TQCustomEvent * );
// xpdf dependant stuff
- QMutex docLock;
+ TQMutex docLock;
PDFDoc * pdfdoc;
KPDFOutputDev * kpdfOutputDev;
- QColor paperColor;
+ TQColor paperColor;
// asyncronous generation related stuff
PDFPixmapGeneratorThread * generatorThread;
@@ -136,9 +136,9 @@ class PDFPixmapGeneratorThread : public QThread
void endGeneration();
// methods for getting contents from the GUI thread
- QImage * takeImage() const;
+ TQImage * takeImage() const;
TextPage * takeTextPage() const;
- QValueList< ObjectRect * > takeObjectRects() const;
+ TQValueList< ObjectRect * > takeObjectRects() const;
private:
// can't be called from the outside (but from startGeneration)
diff --git a/kpdf/core/generator_pdf/gp_outputdev.cpp b/kpdf/core/generator_pdf/gp_outputdev.cpp
index c55ccd7c..df3fd85b 100644
--- a/kpdf/core/generator_pdf/gp_outputdev.cpp
+++ b/kpdf/core/generator_pdf/gp_outputdev.cpp
@@ -20,8 +20,8 @@
#endif
#include <kdebug.h>
-#include <qpixmap.h>
-#include <qimage.h>
+#include <tqpixmap.h>
+#include <tqimage.h>
#include "gp_outputdev.h"
#include "generator_pdf.h"
@@ -66,25 +66,25 @@ void KPDFOutputDev::setParams( int width, int height, bool genL, bool genI, bool
m_generateImages = genI;
}
-QPixmap * KPDFOutputDev::takePixmap()
+TQPixmap * KPDFOutputDev::takePixmap()
{
- QPixmap * pix = m_pixmap;
+ TQPixmap * pix = m_pixmap;
m_pixmap = 0;
return pix;
}
-QImage * KPDFOutputDev::takeImage()
+TQImage * KPDFOutputDev::takeImage()
{
- QImage * img = m_image;
+ TQImage * img = m_image;
m_image = 0;
return img;
}
-QValueList< ObjectRect * > KPDFOutputDev::takeObjectRects()
+TQValueList< ObjectRect * > KPDFOutputDev::takeObjectRects()
{
if ( m_rects.isEmpty() )
return m_rects;
- QValueList< ObjectRect * > rectsCopy( m_rects );
+ TQValueList< ObjectRect * > rectsCopy( m_rects );
m_rects.clear();
return rectsCopy;
}
@@ -101,8 +101,8 @@ void KPDFOutputDev::endPage()
// does not work
/* SplashColorPtr dataPtr = getBitmap()->getDataPtr();
// construct a qimage SHARING the raw bitmap data in memory
- QImage * img = new QImage( dataPtr, bw, bh, 32, 0, 0, QImage::IgnoreEndian );*/
- QImage * img = new QImage( bw, bh, 32 );
+ TQImage * img = new TQImage( dataPtr, bw, bh, 32, 0, 0, TQImage::IgnoreEndian );*/
+ TQImage * img = new TQImage( bw, bh, 32 );
SplashColorPtr pixel = new Guchar[4];
for (int i = 0; i < bw; i++)
{
@@ -114,26 +114,26 @@ void KPDFOutputDev::endPage()
}
delete [] pixel;
- // use the QImage or convert it immediately to QPixmap for better
+ // use the TQImage or convert it immediately to TQPixmap for better
// handling and memory unloading
if ( m_qtThreadSafety )
{
delete m_image;
// it may happen (in fact it doesn't) that we need a rescaling
if ( bw != m_pixmapWidth && bh != m_pixmapHeight )
- m_image = new QImage( img->smoothScale( m_pixmapWidth, m_pixmapHeight ) );
+ m_image = new TQImage( img->smoothScale( m_pixmapWidth, m_pixmapHeight ) );
else
// dereference image from the xpdf memory
- m_image = new QImage( img->copy() );
+ m_image = new TQImage( img->copy() );
}
else
{
delete m_pixmap;
// it may happen (in fact it doesn't) that we need a rescaling
if ( bw != m_pixmapWidth || bh != m_pixmapHeight )
- m_pixmap = new QPixmap( img->smoothScale( m_pixmapWidth, m_pixmapHeight ) );
+ m_pixmap = new TQPixmap( img->smoothScale( m_pixmapWidth, m_pixmapHeight ) );
else
- m_pixmap = new QPixmap( *img );
+ m_pixmap = new TQPixmap( *img );
}
// destroy the shared descriptor and (###) unload underlying xpdf bitmap
@@ -217,7 +217,7 @@ void KPDFOutputDev::clear()
// delete rects
if ( m_rects.count() )
{
- QValueList< ObjectRect * >::iterator it = m_rects.begin(), end = m_rects.end();
+ TQValueList< ObjectRect * >::iterator it = m_rects.begin(), end = m_rects.end();
for ( ; it != end; ++it )
delete *it;
m_rects.clear();
@@ -246,7 +246,7 @@ KPDFLink * KPDFOutputDev::generateLink( LinkAction * a )
{
LinkGoTo * g = (LinkGoTo *) a;
// ceate link: no ext file, namedDest, object pointer
- link = new KPDFLinkGoto( QString::null, decodeViewport( g->getNamedDest(), g->getDest() ) );
+ link = new KPDFLinkGoto( TQString::null, decodeViewport( g->getNamedDest(), g->getDest() ) );
}
break;
@@ -256,7 +256,7 @@ KPDFLink * KPDFOutputDev::generateLink( LinkAction * a )
// copy link file
const char * fileName = g->getFileName()->getCString();
// ceate link: fileName, namedDest, object pointer
- link = new KPDFLinkGoto( (QString)fileName, decodeViewport( g->getNamedDest(), g->getDest() ) );
+ link = new KPDFLinkGoto( (TQString)fileName, decodeViewport( g->getNamedDest(), g->getDest() ) );
}
break;
diff --git a/kpdf/core/generator_pdf/gp_outputdev.h b/kpdf/core/generator_pdf/gp_outputdev.h
index e08724e0..7788b1db 100644
--- a/kpdf/core/generator_pdf/gp_outputdev.h
+++ b/kpdf/core/generator_pdf/gp_outputdev.h
@@ -19,11 +19,11 @@
#pragma interface
#endif
-#include <qvaluelist.h>
+#include <tqvaluelist.h>
#include "xpdf/PDFDoc.h" // for 'Object'
#include "xpdf/SplashOutputDev.h"
-class QPixmap;
+class TQPixmap;
class KPDFLink;
class ObjectRect;
class DocumentViewport;
@@ -52,9 +52,9 @@ class KPDFOutputDev : public SplashOutputDev
bool decodeLinks, bool decodeImages, bool qtThreadSafety = false );
// takes pointers out of the class (so deletion it's up to others)
- QPixmap * takePixmap();
- QImage * takeImage();
- QValueList< ObjectRect * > takeObjectRects();
+ TQPixmap * takePixmap();
+ TQImage * takeImage();
+ TQValueList< ObjectRect * > takeObjectRects();
/** inherited from OutputDev */
// End a page.
@@ -82,9 +82,9 @@ class KPDFOutputDev : public SplashOutputDev
// Internal objects
PDFDoc * m_doc;
- QPixmap * m_pixmap;
- QImage * m_image;
- QValueList< ObjectRect * > m_rects; // objectRects (links/images)
+ TQPixmap * m_pixmap;
+ TQImage * m_image;
+ TQValueList< ObjectRect * > m_rects; // objectRects (links/images)
};
#endif
diff --git a/kpdf/core/link.cpp b/kpdf/core/link.cpp
index d8e47a49..33d0fe98 100644
--- a/kpdf/core/link.cpp
+++ b/kpdf/core/link.cpp
@@ -16,22 +16,22 @@ KPDFLink::~KPDFLink()
{
}
-QString KPDFLinkGoto::linkTip() const
+TQString KPDFLinkGoto::linkTip() const
{
- return m_extFileName.isEmpty() ? ( m_vp.pageNumber != -1 ? i18n( "Go to page %1" ).arg( m_vp.pageNumber + 1 ) : QString::null ) : i18n("Open external file");
+ return m_extFileName.isEmpty() ? ( m_vp.pageNumber != -1 ? i18n( "Go to page %1" ).arg( m_vp.pageNumber + 1 ) : TQString::null ) : i18n("Open external file");
}
-QString KPDFLinkExecute::linkTip() const
+TQString KPDFLinkExecute::linkTip() const
{
return i18n( "Execute '%1'..." ).arg( m_fileName );
}
-QString KPDFLinkBrowse::linkTip() const
+TQString KPDFLinkBrowse::linkTip() const
{
return m_url;
}
-QString KPDFLinkAction::linkTip() const
+TQString KPDFLinkAction::linkTip() const
{
switch ( m_type )
{
@@ -61,5 +61,5 @@ QString KPDFLinkAction::linkTip() const
default: ;
}
- return QString::null;
+ return TQString::null;
}
diff --git a/kpdf/core/link.h b/kpdf/core/link.h
index 10420c50..eff3573e 100644
--- a/kpdf/core/link.h
+++ b/kpdf/core/link.h
@@ -10,8 +10,8 @@
#ifndef _KPDF_LINK_H_
#define _KPDF_LINK_H_
-#include <qstring.h>
-#include <qrect.h>
+#include <tqstring.h>
+#include <tqrect.h>
#include "core/document.h" // for DocumentViewport
/**
@@ -27,7 +27,7 @@ class KPDFLink
// get link type (inherited classes mustreturn an unique identifier)
enum LinkType { Goto, Execute, Browse, Action, Movie };
virtual LinkType linkType() const = 0;
- virtual QString linkTip() const { return QString::null; }
+ virtual TQString linkTip() const { return TQString::null; }
// virtual destructor (remove warnings)
virtual ~KPDFLink();
@@ -40,16 +40,16 @@ class KPDFLinkGoto : public KPDFLink
public:
// query for goto parameters
bool isExternal() const { return !m_extFileName.isEmpty(); }
- const QString & fileName() const { return m_extFileName; }
+ const TQString & fileName() const { return m_extFileName; }
const DocumentViewport & destViewport() const { return m_vp; }
// create a KPDFLink_Goto
- KPDFLinkGoto( QString extFileName, const DocumentViewport & vp ) { m_extFileName = extFileName; m_vp = vp; }
+ KPDFLinkGoto( TQString extFileName, const DocumentViewport & vp ) { m_extFileName = extFileName; m_vp = vp; }
LinkType linkType() const { return Goto; }
- QString linkTip() const;
+ TQString linkTip() const;
private:
- QString m_extFileName;
+ TQString m_extFileName;
DocumentViewport m_vp;
};
@@ -58,17 +58,17 @@ class KPDFLinkExecute : public KPDFLink
{
public:
// query for filename / parameters
- const QString & fileName() const { return m_fileName; }
- const QString & parameters() const { return m_parameters; }
+ const TQString & fileName() const { return m_fileName; }
+ const TQString & parameters() const { return m_parameters; }
// create a KPDFLink_Execute
- KPDFLinkExecute( const QString & file, const QString & params ) { m_fileName = file; m_parameters = params; }
+ KPDFLinkExecute( const TQString & file, const TQString & params ) { m_fileName = file; m_parameters = params; }
LinkType linkType() const { return Execute; }
- QString linkTip() const;
+ TQString linkTip() const;
private:
- QString m_fileName;
- QString m_parameters;
+ TQString m_fileName;
+ TQString m_parameters;
};
/** Browse: an URL to open, ranging from 'http://' to 'mailto:' etc.. **/
@@ -76,15 +76,15 @@ class KPDFLinkBrowse : public KPDFLink
{
public:
// query for URL
- const QString & url() const { return m_url; }
+ const TQString & url() const { return m_url; }
// create a KPDFLink_Browse
- KPDFLinkBrowse( const QString &url ) { m_url = url; }
+ KPDFLinkBrowse( const TQString &url ) { m_url = url; }
LinkType linkType() const { return Browse; }
- QString linkTip() const;
+ TQString linkTip() const;
private:
- QString m_url;
+ TQString m_url;
};
/** Action: contains an action to perform on document / kpdf **/
@@ -100,7 +100,7 @@ class KPDFLinkAction : public KPDFLink
// create a KPDFLink_Action
KPDFLinkAction( enum ActionType actionType ) { m_type = actionType; }
LinkType linkType() const { return Action; }
- QString linkTip() const;
+ TQString linkTip() const;
private:
ActionType m_type;
diff --git a/kpdf/core/observer.h b/kpdf/core/observer.h
index 28f07bf5..ea0ce6c1 100644
--- a/kpdf/core/observer.h
+++ b/kpdf/core/observer.h
@@ -11,8 +11,8 @@
#ifndef _KPDF_DOCUMENTOBSERVER_H_
#define _KPDF_DOCUMENTOBSERVER_H_
-#include <qvaluevector.h>
-#include <qrect.h>
+#include <tqvaluevector.h>
+#include <tqrect.h>
/** IDs for observers. Globally defined here. **/
#define PRESENTATION_ID 1
@@ -46,7 +46,7 @@ class DocumentObserver
// commands from the Document to all observers
enum ChangedFlags { Pixmap = 1, Bookmark = 2, Highlights = 4 };
- virtual void notifySetup( const QValueVector< KPDFPage * > & /*pages*/, bool /*documentChanged*/ ) {};
+ virtual void notifySetup( const TQValueVector< KPDFPage * > & /*pages*/, bool /*documentChanged*/ ) {};
virtual void notifyViewportChanged( bool /*smoothMove*/ ) {};
virtual void notifyPageChanged( int /*pageNumber*/, int /*changedFlags*/ ) {};
virtual void notifyContentsCleared( int /*changedFlags*/ ) {};
diff --git a/kpdf/core/page.cpp b/kpdf/core/page.cpp
index 70bc71bc..6b611360 100644
--- a/kpdf/core/page.cpp
+++ b/kpdf/core/page.cpp
@@ -8,9 +8,9 @@
***************************************************************************/
// qt/kde includes
-#include <qpixmap.h>
-#include <qstring.h>
-#include <qmap.h>
+#include <tqpixmap.h>
+#include <tqstring.h>
+#include <tqmap.h>
#include <kdebug.h>
// local includes
@@ -78,7 +78,7 @@ bool KPDFPage::hasPixmap( int id, int width, int height ) const
return false;
if ( width == -1 || height == -1 )
return true;
- QPixmap * p = m_pixmaps[ id ];
+ TQPixmap * p = m_pixmaps[ id ];
return p ? ( p->width() == width && p->height() == height ) : false;
}
@@ -96,7 +96,7 @@ bool KPDFPage::hasObjectRect( double x, double y ) const
{
if ( m_rects.count() < 1 )
return false;
- QValueList< ObjectRect * >::const_iterator it = m_rects.begin(), end = m_rects.end();
+ TQValueList< ObjectRect * >::const_iterator it = m_rects.begin(), end = m_rects.end();
for ( ; it != end; ++it )
if ( (*it)->contains( x, y ) )
return true;
@@ -112,7 +112,7 @@ bool KPDFPage::hasHighlights( int s_id ) const
if ( s_id == -1 )
return true;
// iterate on the highlights list to find an entry by id
- QValueList< HighlightRect * >::const_iterator it = m_highlights.begin(), end = m_highlights.end();
+ TQValueList< HighlightRect * >::const_iterator it = m_highlights.begin(), end = m_highlights.end();
for ( ; it != end; ++it )
if ( (*it)->s_id == s_id )
return true;
@@ -125,15 +125,15 @@ bool KPDFPage::hasTransition() const
}
-NormalizedRect * KPDFPage::findText( const QString & text, bool strictCase, NormalizedRect * lastRect ) const
+NormalizedRect * KPDFPage::findText( const TQString & text, bool strictCase, NormalizedRect * lastRect ) const
{
if ( text.isEmpty() )
return 0;
// create a xpf's Unicode (unsigned int) array for the given text
- const QChar * str = text.unicode();
+ const TQChar * str = text.unicode();
int len = text.length();
- QMemArray<Unicode> u(len);
+ TQMemArray<Unicode> u(len);
for (int i = 0; i < len; ++i)
u[i] = str[i].unicode();
@@ -172,23 +172,23 @@ NormalizedRect * KPDFPage::findText( const QString & text, bool strictCase, Norm
return 0;
}
-const QString KPDFPage::getText( const NormalizedRect & rect ) const
+const TQString KPDFPage::getText( const NormalizedRect & rect ) const
{
if ( !m_text )
- return QString::null;
+ return TQString::null;
int left = (int)( rect.left * m_width ),
top = (int)( rect.top * m_height ),
right = (int)( rect.right * m_width ),
bottom = (int)( rect.bottom * m_height );
GString * text = m_text->getText( left, top, right, bottom );
- QString result = QString::fromUtf8( text->getCString() );
+ TQString result = TQString::fromUtf8( text->getCString() );
delete text;
return result;
}
const ObjectRect * KPDFPage::hasObject( ObjectRect::ObjectType type, double x, double y ) const
{
- QValueList< ObjectRect * >::const_iterator it = m_rects.begin(), end = m_rects.end();
+ TQValueList< ObjectRect * >::const_iterator it = m_rects.begin(), end = m_rects.end();
for ( ; it != end; ++it )
if ( (*it)->contains( x, y ) )
if ((*it)->objectType() == type) return *it;
@@ -201,7 +201,7 @@ const KPDFPageTransition * KPDFPage::getTransition() const
}
-void KPDFPage::setPixmap( int id, QPixmap * pixmap )
+void KPDFPage::setPixmap( int id, TQPixmap * pixmap )
{
if ( m_pixmaps.contains( id ) )
delete m_pixmaps[id];
@@ -219,15 +219,15 @@ void KPDFPage::setBookmark( bool state )
m_bookmarked = state;
}
-void KPDFPage::setObjectRects( const QValueList< ObjectRect * > rects )
+void KPDFPage::setObjectRects( const TQValueList< ObjectRect * > rects )
{
- QValueList< ObjectRect * >::iterator it = m_rects.begin(), end = m_rects.end();
+ TQValueList< ObjectRect * >::iterator it = m_rects.begin(), end = m_rects.end();
for ( ; it != end; ++it )
delete *it;
m_rects = rects;
}
-void KPDFPage::setHighlight( int s_id, NormalizedRect * &rect, const QColor & color )
+void KPDFPage::setHighlight( int s_id, NormalizedRect * &rect, const TQColor & color )
{
// create a HighlightRect descriptor taking values from params
HighlightRect * hr = new HighlightRect();
@@ -262,12 +262,12 @@ void KPDFPage::deletePixmap( int id )
void KPDFPage::deletePixmapsAndRects()
{
// delete all stored pixmaps
- QMap<int,QPixmap *>::iterator it = m_pixmaps.begin(), end = m_pixmaps.end();
+ TQMap<int,TQPixmap *>::iterator it = m_pixmaps.begin(), end = m_pixmaps.end();
for ( ; it != end; ++it )
delete *it;
m_pixmaps.clear();
// delete ObjectRects
- QValueList< ObjectRect * >::iterator rIt = m_rects.begin(), rEnd = m_rects.end();
+ TQValueList< ObjectRect * >::iterator rIt = m_rects.begin(), rEnd = m_rects.end();
for ( ; rIt != rEnd; ++rIt )
delete *rIt;
m_rects.clear();
@@ -276,7 +276,7 @@ void KPDFPage::deletePixmapsAndRects()
void KPDFPage::deleteHighlights( int s_id )
{
// delete highlights by ID
- QValueList< HighlightRect * >::iterator it = m_highlights.begin(), end = m_highlights.end();
+ TQValueList< HighlightRect * >::iterator it = m_highlights.begin(), end = m_highlights.end();
while ( it != end )
{
HighlightRect * highlight = *it;
@@ -300,7 +300,7 @@ NormalizedRect::NormalizedRect( double l, double t, double r, double b )
// note: check for swapping coords?
: left( l ), top( t ), right( r ), bottom( b ) {}
-NormalizedRect::NormalizedRect( const QRect & r, double xScale, double yScale )
+NormalizedRect::NormalizedRect( const TQRect & r, double xScale, double yScale )
: left( (double)r.left() / xScale ), top( (double)r.top() / yScale ),
right( (double)r.right() / xScale ), bottom( (double)r.bottom() / yScale ) {}
@@ -319,13 +319,13 @@ bool NormalizedRect::intersects( double l, double t, double r, double b ) const
return (l < right) && (r > left) && (t < bottom) && (b > top);
}
-QRect NormalizedRect::geometry( int xScale, int yScale ) const
+TQRect NormalizedRect::geometry( int xScale, int yScale ) const
{
int l = (int)( left * xScale ),
t = (int)( top * yScale ),
r = (int)( right * xScale ),
b = (int)( bottom * yScale );
- return QRect( l, t, r - l + 1, b - t + 1 );
+ return TQRect( l, t, r - l + 1, b - t + 1 );
}
diff --git a/kpdf/core/page.h b/kpdf/core/page.h
index 4a8be71d..2de7aceb 100644
--- a/kpdf/core/page.h
+++ b/kpdf/core/page.h
@@ -10,11 +10,11 @@
#ifndef _KPDF_PAGE_H_
#define _KPDF_PAGE_H_
-#include <qmap.h>
-#include <qvaluelist.h>
+#include <tqmap.h>
+#include <tqvaluelist.h>
-class QPixmap;
-class QRect;
+class TQPixmap;
+class TQRect;
class TextPage;
class KPDFPageTransition;
class HighlightRect;
@@ -30,13 +30,13 @@ class NormalizedRect
NormalizedRect();
NormalizedRect( double l, double t, double r, double b );
- NormalizedRect( const QRect & r, double xScale, double yScale );
+ NormalizedRect( const TQRect & r, double xScale, double yScale );
bool contains( double x, double y ) const;
bool intersects( const NormalizedRect & normRect ) const;
bool intersects( double l, double t, double r, double b ) const;
- QRect geometry( int xScale, int yScale ) const;
+ TQRect geometry( int xScale, int yScale ) const;
};
/**
@@ -102,18 +102,18 @@ class KPDFPage
//bool hasAnnotation( double x, double y ) const;
bool hasTransition() const;
- NormalizedRect * findText( const QString & text, bool keepCase, NormalizedRect * last = 0 ) const;
- const QString getText( const NormalizedRect & rect ) const;
+ NormalizedRect * findText( const TQString & text, bool keepCase, NormalizedRect * last = 0 ) const;
+ const TQString getText( const NormalizedRect & rect ) const;
const ObjectRect * hasObject( ObjectRect::ObjectType type, double x, double y ) const;
//const Annotation * getAnnotation( double x, double y ) const;
const KPDFPageTransition * getTransition() const;
// operations: set/delete contents (by KPDFDocument)
- void setPixmap( int p_id, QPixmap * pixmap );
+ void setPixmap( int p_id, TQPixmap * pixmap );
void setSearchPage( TextPage * text );
void setBookmark( bool state );
- void setObjectRects( const QValueList< ObjectRect * > rects );
- void setHighlight( int s_id, NormalizedRect * &r, const QColor & color );
+ void setObjectRects( const TQValueList< ObjectRect * > rects );
+ void setHighlight( int s_id, NormalizedRect * &r, const TQColor & color );
//void setAnnotation( Annotation * annotation );
void setTransition( KPDFPageTransition * transition );
void deletePixmap( int p_id );
@@ -129,11 +129,11 @@ class KPDFPage
float m_width, m_height;
bool m_bookmarked;
- QMap< int, QPixmap * > m_pixmaps;
+ TQMap< int, TQPixmap * > m_pixmaps;
TextPage * m_text;
- QValueList< ObjectRect * > m_rects;
- QValueList< HighlightRect * > m_highlights;
- //QValueList< Annotation * > m_annotations;
+ TQValueList< ObjectRect * > m_rects;
+ TQValueList< HighlightRect * > m_highlights;
+ //TQValueList< Annotation * > m_annotations;
KPDFPageTransition * m_transition;
};
@@ -146,7 +146,7 @@ struct HighlightRect : public NormalizedRect
// searchID of the highlight owner
int s_id;
// color of the highlight
- QColor color;
+ TQColor color;
};
#endif
diff --git a/kpdf/error.cpp b/kpdf/error.cpp
index 028fe7e3..00d3581e 100644
--- a/kpdf/error.cpp
+++ b/kpdf/error.cpp
@@ -18,13 +18,13 @@
#include "xpdf/GlobalParams.h"
#include "xpdf/Error.h"
-#include <qstring.h>
+#include <tqstring.h>
#include <kdebug.h>
void CDECL error(int pos, char *msg, ...) {
va_list args;
- QString emsg, tmsg;
+ TQString emsg, tmsg;
char buffer[1024]; // should be big enough
// NB: this can be called before the globalParams object is created
@@ -32,7 +32,7 @@ void CDECL error(int pos, char *msg, ...) {
return;
}
if (pos >= 0) {
- emsg = QString("Error (%1): ").arg(pos);
+ emsg = TQString("Error (%1): ").arg(pos);
} else {
emsg = "Error: ";
}
diff --git a/kpdf/part.cpp b/kpdf/part.cpp
index 69ad7f00..b2775255 100644
--- a/kpdf/part.cpp
+++ b/kpdf/part.cpp
@@ -22,16 +22,16 @@
***************************************************************************/
// qt/kde includes
-#include <qcheckbox.h>
-#include <qsplitter.h>
-#include <qpainter.h>
-#include <qlayout.h>
-#include <qlabel.h>
-#include <qvbox.h>
-#include <qtoolbox.h>
-#include <qtooltip.h>
-#include <qpushbutton.h>
-#include <qwhatsthis.h>
+#include <tqcheckbox.h>
+#include <tqsplitter.h>
+#include <tqpainter.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
+#include <tqvbox.h>
+#include <tqtoolbox.h>
+#include <tqtooltip.h>
+#include <tqpushbutton.h>
+#include <tqwhatsthis.h>
#include <dcopobject.h>
#include <dcopclient.h>
#include <kapplication.h>
@@ -80,27 +80,27 @@ class PDFOptionsPage : public KPrintDialogPage
PDFOptionsPage()
{
setTitle( i18n( "PDF Options" ) );
- QVBoxLayout *layout = new QVBoxLayout(this);
- m_forceRaster = new QCheckBox(i18n("Force rasterization"), this);
- QToolTip::add(m_forceRaster, i18n("Rasterize into an image before printing"));
- QWhatsThis::add(m_forceRaster, i18n("Forces the rasterization of each page into an image before printing it. This usually gives somewhat worse results, but is useful when printing documents that appear to print incorrectly."));
+ TQVBoxLayout *layout = new TQVBoxLayout(this);
+ m_forceRaster = new TQCheckBox(i18n("Force rasterization"), this);
+ TQToolTip::add(m_forceRaster, i18n("Rasterize into an image before printing"));
+ TQWhatsThis::add(m_forceRaster, i18n("Forces the rasterization of each page into an image before printing it. This usually gives somewhat worse results, but is useful when printing documents that appear to print incorrectly."));
layout->addWidget(m_forceRaster);
layout->addStretch(1);
}
- void getOptions( QMap<QString,QString>& opts, bool incldef = false )
+ void getOptions( TQMap<TQString,TQString>& opts, bool incldef = false )
{
Q_UNUSED(incldef);
- opts[ "kde-kpdf-forceRaster" ] = QString::number( m_forceRaster->isChecked() );
+ opts[ "kde-kpdf-forceRaster" ] = TQString::number( m_forceRaster->isChecked() );
}
- void setOptions( const QMap<QString,QString>& opts )
+ void setOptions( const TQMap<TQString,TQString>& opts )
{
m_forceRaster->setChecked( opts[ "kde-kpdf-forceRaster" ].toInt() );
}
private:
- QCheckBox *m_forceRaster;
+ TQCheckBox *m_forceRaster;
};
// definition of searchID for this class
@@ -113,18 +113,18 @@ using namespace KPDF;
unsigned int Part::m_count = 0;
-Part::Part(QWidget *parentWidget, const char *widgetName,
- QObject *parent, const char *name,
- const QStringList & /*args*/ )
+Part::Part(TQWidget *parentWidget, const char *widgetName,
+ TQObject *parent, const char *name,
+ const TQStringList & /*args*/ )
: DCOPObject("kpdf"), KParts::ReadOnlyPart(parent, name), m_showMenuBarAction(0), m_showFullScreenAction(0),
m_actionsSearched(false), m_searchStarted(false)
{
// connect the started signal to tell the job the mimetypes we like
- connect(this, SIGNAL(started(KIO::Job *)), this, SLOT(setMimeTypes(KIO::Job *)));
+ connect(this, TQT_SIGNAL(started(KIO::Job *)), this, TQT_SLOT(setMimeTypes(KIO::Job *)));
// connect the completed signal so we can put the window caption when loading remote files
- connect(this, SIGNAL(completed()), this, SLOT(emitWindowCaption()));
- connect(this, SIGNAL(canceled(const QString &)), this, SLOT(emitWindowCaption()));
+ connect(this, TQT_SIGNAL(completed()), this, TQT_SLOT(emitWindowCaption()));
+ connect(this, TQT_SIGNAL(canceled(const TQString &)), this, TQT_SLOT(emitWindowCaption()));
// load catalog for translation
KGlobal::locale()->insertCatalogue("kpdf");
@@ -144,86 +144,86 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
// build the document
m_document = new KPDFDocument(widget());
- connect( m_document, SIGNAL( linkFind() ), this, SLOT( slotFind() ) );
- connect( m_document, SIGNAL( linkGoToPage() ), this, SLOT( slotGoToPage() ) );
- connect( m_document, SIGNAL( linkPresentation() ), this, SLOT( slotShowPresentation() ) );
- connect( m_document, SIGNAL( linkEndPresentation() ), this, SLOT( slotHidePresentation() ) );
- connect( m_document, SIGNAL( openURL(const KURL &) ), this, SLOT( openURLFromDocument(const KURL &) ) );
- connect( m_document, SIGNAL( close() ), this, SLOT( close() ) );
+ connect( m_document, TQT_SIGNAL( linkFind() ), this, TQT_SLOT( slotFind() ) );
+ connect( m_document, TQT_SIGNAL( linkGoToPage() ), this, TQT_SLOT( slotGoToPage() ) );
+ connect( m_document, TQT_SIGNAL( linkPresentation() ), this, TQT_SLOT( slotShowPresentation() ) );
+ connect( m_document, TQT_SIGNAL( linkEndPresentation() ), this, TQT_SLOT( slotHidePresentation() ) );
+ connect( m_document, TQT_SIGNAL( openURL(const KURL &) ), this, TQT_SLOT( openURLFromDocument(const KURL &) ) );
+ connect( m_document, TQT_SIGNAL( close() ), this, TQT_SLOT( close() ) );
if (parent && parent->metaObject()->slotNames(true).contains("slotQuit()"))
- connect( m_document, SIGNAL( quit() ), parent, SLOT( slotQuit() ) );
+ connect( m_document, TQT_SIGNAL( quit() ), parent, TQT_SLOT( slotQuit() ) );
else
- connect( m_document, SIGNAL( quit() ), this, SLOT( cannotQuit() ) );
+ connect( m_document, TQT_SIGNAL( quit() ), this, TQT_SLOT( cannotQuit() ) );
// widgets: ^searchbar (toolbar containing label and SearchWidget)
// m_searchToolBar = new KToolBar( parentWidget, "searchBar" );
// m_searchToolBar->boxLayout()->setSpacing( KDialog::spacingHint() );
-// QLabel * sLabel = new QLabel( i18n( "&Search:" ), m_searchToolBar, "kde toolbar widget" );
+// TQLabel * sLabel = new TQLabel( i18n( "&Search:" ), m_searchToolBar, "kde toolbar widget" );
// m_searchWidget = new SearchWidget( m_searchToolBar, m_document );
// sLabel->setBuddy( m_searchWidget );
// m_searchToolBar->setStretchableWidget( m_searchWidget );
// widgets: [] splitter []
- m_splitter = new QSplitter( parentWidget, widgetName );
+ m_splitter = new TQSplitter( parentWidget, widgetName );
m_splitter->setOpaqueResize( true );
setWidget( m_splitter );
- m_showLeftPanel = new KToggleAction( i18n( "Show &Navigation Panel"), "show_side_panel", 0, this, SLOT( slotShowLeftPanel() ), actionCollection(), "show_leftpanel" );
+ m_showLeftPanel = new KToggleAction( i18n( "Show &Navigation Panel"), "show_side_panel", 0, this, TQT_SLOT( slotShowLeftPanel() ), actionCollection(), "show_leftpanel" );
m_showLeftPanel->setCheckedState( i18n( "Hide &Navigation Panel") );
m_showLeftPanel->setShortcut( "CTRL+L" );
m_showLeftPanel->setChecked( KpdfSettings::showLeftPanel() );
// widgets: [left panel] | []
- m_leftPanel = new QWidget( m_splitter );
+ m_leftPanel = new TQWidget( m_splitter );
m_leftPanel->setMinimumWidth( 90 );
m_leftPanel->setMaximumWidth( 300 );
- QVBoxLayout * leftPanelLayout = new QVBoxLayout( m_leftPanel );
+ TQVBoxLayout * leftPanelLayout = new TQVBoxLayout( m_leftPanel );
// widgets: [left toolbox/..] | []
- m_toolBox = new QToolBox( m_leftPanel );
+ m_toolBox = new TQToolBox( m_leftPanel );
leftPanelLayout->addWidget( m_toolBox );
int index;
// [left toolbox: Table of Contents] | []
// dummy wrapper with layout to enable horizontal scroll bars (bug: 147233)
- QWidget *tocWrapper = new QWidget(m_toolBox);
- QVBoxLayout *tocWrapperLayout = new QVBoxLayout(tocWrapper);
+ TQWidget *tocWrapper = new TQWidget(m_toolBox);
+ TQVBoxLayout *tocWrapperLayout = new TQVBoxLayout(tocWrapper);
m_tocFrame = new TOC( tocWrapper, m_document );
tocWrapperLayout->add(m_tocFrame);
- connect(m_tocFrame, SIGNAL(hasTOC(bool)), this, SLOT(enableTOC(bool)));
- index = m_toolBox->addItem( tocWrapper, QIconSet(SmallIcon("text_left")), i18n("Contents") );
+ connect(m_tocFrame, TQT_SIGNAL(hasTOC(bool)), this, TQT_SLOT(enableTOC(bool)));
+ index = m_toolBox->addItem( tocWrapper, TQIconSet(SmallIcon("text_left")), i18n("Contents") );
m_toolBox->setItemToolTip(index, i18n("Contents"));
enableTOC( false );
// [left toolbox: Thumbnails and Bookmarks] | []
- QVBox * thumbsBox = new ThumbnailsBox( m_toolBox );
+ TQVBox * thumbsBox = new ThumbnailsBox( m_toolBox );
m_searchWidget = new SearchWidget( thumbsBox, m_document );
m_thumbnailList = new ThumbnailList( thumbsBox, m_document );
// ThumbnailController * m_tc = new ThumbnailController( thumbsBox, m_thumbnailList );
- connect( m_thumbnailList, SIGNAL( urlDropped( const KURL& ) ), SLOT( openURLFromDocument( const KURL & )) );
- connect( m_thumbnailList, SIGNAL( rightClick(const KPDFPage *, const QPoint &) ), this, SLOT( slotShowMenu(const KPDFPage *, const QPoint &) ) );
+ connect( m_thumbnailList, TQT_SIGNAL( urlDropped( const KURL& ) ), TQT_SLOT( openURLFromDocument( const KURL & )) );
+ connect( m_thumbnailList, TQT_SIGNAL( rightClick(const KPDFPage *, const TQPoint &) ), this, TQT_SLOT( slotShowMenu(const KPDFPage *, const TQPoint &) ) );
// shrink the bottom controller toolbar (too hackish..)
thumbsBox->setStretchFactor( m_searchWidget, 100 );
thumbsBox->setStretchFactor( m_thumbnailList, 100 );
// thumbsBox->setStretchFactor( m_tc, 1 );
- index = m_toolBox->addItem( thumbsBox, QIconSet(SmallIcon("thumbnail")), i18n("Thumbnails") );
+ index = m_toolBox->addItem( thumbsBox, TQIconSet(SmallIcon("thumbnail")), i18n("Thumbnails") );
m_toolBox->setItemToolTip(index, i18n("Thumbnails"));
m_toolBox->setCurrentItem( thumbsBox );
slotShowLeftPanel();
/* // [left toolbox: Annotations] | []
- QFrame * editFrame = new QFrame( m_toolBox );
- int iIdx = m_toolBox->addItem( editFrame, QIconSet(SmallIcon("pencil")), i18n("Annotations") );
+ TQFrame * editFrame = new TQFrame( m_toolBox );
+ int iIdx = m_toolBox->addItem( editFrame, TQIconSet(SmallIcon("pencil")), i18n("Annotations") );
m_toolBox->setItemEnabled( iIdx, false );*/
// widgets: [../miniBarContainer] | []
- QWidget * miniBarContainer = new QWidget( m_leftPanel );
+ TQWidget * miniBarContainer = new TQWidget( m_leftPanel );
leftPanelLayout->addWidget( miniBarContainer );
- QVBoxLayout * miniBarLayout = new QVBoxLayout( miniBarContainer );
+ TQVBoxLayout * miniBarLayout = new TQVBoxLayout( miniBarContainer );
// widgets: [../[spacer/..]] | []
- QWidget * miniSpacer = new QWidget( miniBarContainer );
+ TQWidget * miniSpacer = new TQWidget( miniBarContainer );
miniSpacer->setFixedHeight( 6 );
miniBarLayout->addWidget( miniSpacer );
// widgets: [../[../MiniBar]] | []
@@ -234,8 +234,8 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
m_pageView = new PageView( m_splitter, m_document );
m_pageView->setFocus(); //usability setting
m_splitter->setFocusProxy(m_pageView);
- connect( m_pageView, SIGNAL( urlDropped( const KURL& ) ), SLOT( openURLFromDocument( const KURL & )));
- connect( m_pageView, SIGNAL( rightClick(const KPDFPage *, const QPoint &) ), this, SLOT( slotShowMenu(const KPDFPage *, const QPoint &) ) );
+ connect( m_pageView, TQT_SIGNAL( urlDropped( const KURL& ) ), TQT_SLOT( openURLFromDocument( const KURL & )));
+ connect( m_pageView, TQT_SIGNAL( rightClick(const KPDFPage *, const TQPoint &) ), this, TQT_SLOT( slotShowMenu(const KPDFPage *, const TQPoint &) ) );
// add document observers
m_document->addObserver( this );
@@ -248,60 +248,60 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
KActionCollection * ac = actionCollection();
// Page Traversal actions
- m_gotoPage = KStdAction::gotoPage( this, SLOT( slotGoToPage() ), ac, "goto_page" );
+ m_gotoPage = KStdAction::gotoPage( this, TQT_SLOT( slotGoToPage() ), ac, "goto_page" );
m_gotoPage->setShortcut( "CTRL+G" );
// dirty way to activate gotopage when pressing miniBar's button
- connect( m_miniBar, SIGNAL( gotoPage() ), m_gotoPage, SLOT( activate() ) );
+ connect( m_miniBar, TQT_SIGNAL( gotoPage() ), m_gotoPage, TQT_SLOT( activate() ) );
- m_prevPage = KStdAction::prior(this, SLOT(slotPreviousPage()), ac, "previous_page");
+ m_prevPage = KStdAction::prior(this, TQT_SLOT(slotPreviousPage()), ac, "previous_page");
m_prevPage->setWhatsThis( i18n( "Moves to the previous page of the document" ) );
m_prevPage->setShortcut( 0 );
// dirty way to activate prev page when pressing miniBar's button
- connect( m_miniBar, SIGNAL( prevPage() ), m_prevPage, SLOT( activate() ) );
+ connect( m_miniBar, TQT_SIGNAL( prevPage() ), m_prevPage, TQT_SLOT( activate() ) );
- m_nextPage = KStdAction::next(this, SLOT(slotNextPage()), ac, "next_page" );
+ m_nextPage = KStdAction::next(this, TQT_SLOT(slotNextPage()), ac, "next_page" );
m_nextPage->setWhatsThis( i18n( "Moves to the next page of the document" ) );
m_nextPage->setShortcut( 0 );
// dirty way to activate next page when pressing miniBar's button
- connect( m_miniBar, SIGNAL( nextPage() ), m_nextPage, SLOT( activate() ) );
+ connect( m_miniBar, TQT_SIGNAL( nextPage() ), m_nextPage, TQT_SLOT( activate() ) );
- m_firstPage = KStdAction::firstPage( this, SLOT( slotGotoFirst() ), ac, "first_page" );
+ m_firstPage = KStdAction::firstPage( this, TQT_SLOT( slotGotoFirst() ), ac, "first_page" );
m_firstPage->setWhatsThis( i18n( "Moves to the first page of the document" ) );
- m_lastPage = KStdAction::lastPage( this, SLOT( slotGotoLast() ), ac, "last_page" );
+ m_lastPage = KStdAction::lastPage( this, TQT_SLOT( slotGotoLast() ), ac, "last_page" );
m_lastPage->setWhatsThis( i18n( "Moves to the last page of the document" ) );
- m_historyBack = KStdAction::back( this, SLOT( slotHistoryBack() ), ac, "history_back" );
+ m_historyBack = KStdAction::back( this, TQT_SLOT( slotHistoryBack() ), ac, "history_back" );
m_historyBack->setWhatsThis( i18n( "Go to the place you were before" ) );
- m_historyNext = KStdAction::forward( this, SLOT( slotHistoryNext() ), ac, "history_forward" );
+ m_historyNext = KStdAction::forward( this, TQT_SLOT( slotHistoryNext() ), ac, "history_forward" );
m_historyNext->setWhatsThis( i18n( "Go to the place you were after" ) );
// Find and other actions
- m_find = KStdAction::find( this, SLOT( slotFind() ), ac, "find" );
+ m_find = KStdAction::find( this, TQT_SLOT( slotFind() ), ac, "find" );
m_find->setEnabled( false );
- m_findNext = KStdAction::findNext( this, SLOT( slotFindNext() ), ac, "find_next" );
+ m_findNext = KStdAction::findNext( this, TQT_SLOT( slotFindNext() ), ac, "find_next" );
m_findNext->setEnabled( false );
- m_saveAs = KStdAction::saveAs( this, SLOT( slotSaveFileAs() ), ac, "save" );
+ m_saveAs = KStdAction::saveAs( this, TQT_SLOT( slotSaveFileAs() ), ac, "save" );
m_saveAs->setEnabled( false );
- KAction * prefs = KStdAction::preferences( this, SLOT( slotPreferences() ), ac, "preferences" );
+ KAction * prefs = KStdAction::preferences( this, TQT_SLOT( slotPreferences() ), ac, "preferences" );
prefs->setText( i18n( "Configure KPDF..." ) );
- m_printPreview = KStdAction::printPreview( this, SLOT( slotPrintPreview() ), ac );
+ m_printPreview = KStdAction::printPreview( this, TQT_SLOT( slotPrintPreview() ), ac );
m_printPreview->setEnabled( false );
- m_showProperties = new KAction(i18n("&Properties"), "info", 0, this, SLOT(slotShowProperties()), ac, "properties");
+ m_showProperties = new KAction(i18n("&Properties"), "info", 0, this, TQT_SLOT(slotShowProperties()), ac, "properties");
m_showProperties->setEnabled( false );
- m_showPresentation = new KAction( i18n("P&resentation"), "kpresenter_kpr", "Ctrl+Shift+P", this, SLOT(slotShowPresentation()), ac, "presentation");
+ m_showPresentation = new KAction( i18n("P&resentation"), "kpresenter_kpr", "Ctrl+Shift+P", this, TQT_SLOT(slotShowPresentation()), ac, "presentation");
m_showPresentation->setEnabled( false );
// attach the actions of the children widgets too
m_pageView->setupActions( ac );
// apply configuration (both internal settings and GUI configured items)
- QValueList<int> splitterSizes = KpdfSettings::splitterSizes();
+ TQValueList<int> splitterSizes = KpdfSettings::splitterSizes();
if ( !splitterSizes.count() )
{
// the first time use 1/10 for the panel and 9/10 for the pageView
@@ -313,11 +313,11 @@ Part::Part(QWidget *parentWidget, const char *widgetName,
// by connecting to Qt4::QSplitter's sliderMoved())
m_pageView->installEventFilter( this );
m_watcher = new KDirWatch( this );
- connect( m_watcher, SIGNAL( dirty( const QString& ) ), this, SLOT( slotFileDirty( const QString& ) ) );
- m_dirtyHandler = new QTimer( this );
- connect( m_dirtyHandler, SIGNAL( timeout() ),this, SLOT( slotDoFileDirty() ) );
- m_saveSplitterSizeTimer = new QTimer( this );
- connect( m_saveSplitterSizeTimer, SIGNAL( timeout() ),this, SLOT( saveSplitterSize() ) );
+ connect( m_watcher, TQT_SIGNAL( dirty( const TQString& ) ), this, TQT_SLOT( slotFileDirty( const TQString& ) ) );
+ m_dirtyHandler = new TQTimer( this );
+ connect( m_dirtyHandler, TQT_SIGNAL( timeout() ),this, TQT_SLOT( slotDoFileDirty() ) );
+ m_saveSplitterSizeTimer = new TQTimer( this );
+ connect( m_saveSplitterSizeTimer, TQT_SIGNAL( timeout() ),this, TQT_SLOT( saveSplitterSize() ) );
slotNewConfig();
@@ -417,12 +417,12 @@ bool Part::openFile()
}
if ( (*mime).is( "application/postscript" ) )
{
- QString app = KStandardDirs::findExe( "ps2pdf" );
+ TQString app = KStandardDirs::findExe( "ps2pdf" );
if ( !app.isNull() )
{
- if ( QFile::exists(m_file) )
+ if ( TQFile::exists(m_file) )
{
- KTempFile tf( QString::null, ".pdf" );
+ KTempFile tf( TQString::null, ".pdf" );
if ( tf.status() == 0 )
{
tf.close();
@@ -432,7 +432,7 @@ bool Part::openFile()
*p << app;
*p << m_file << m_temporaryLocalFile;
m_pageView->showText(i18n("Converting from ps to pdf..."), 0);
- connect(p, SIGNAL(processExited(KProcess *)), this, SLOT(psTransformEnded()));
+ connect(p, TQT_SIGNAL(processExited(KProcess *)), this, TQT_SLOT(psTransformEnded()));
p -> start();
return true;
}
@@ -447,7 +447,7 @@ bool Part::openFile()
}
}
- m_temporaryLocalFile = QString::null;
+ m_temporaryLocalFile = TQString::null;
bool ok = m_document->openDocument( m_file, url(), mime );
@@ -482,7 +482,7 @@ bool Part::openFile()
// if the 'StartFullScreen' flag is set, start presentation
if ( m_document->getMetaData( "StartFullScreen" ) == "yes" )
{
- KMessageBox::information(m_presentationWidget, i18n("The document is going to be launched on presentation mode because the file requested it."), QString::null, "autoPresentationWarning");
+ KMessageBox::information(m_presentationWidget, i18n("The document is going to be launched on presentation mode because the file requested it."), TQString::null, "autoPresentationWarning");
slotShowPresentation();
}
@@ -502,7 +502,7 @@ bool Part::openURL(const KURL &url)
// if it matches then: download it (if not local) extract to a temp file using
// KTar and proceed with the URL of the temporary file
- m_jobMime = QString::null;
+ m_jobMime = TQString::null;
// this calls the above 'openURL' method
bool b = KParts::ReadOnlyPart::openURL(url);
@@ -527,11 +527,11 @@ void Part::setMimeTypes(KIO::Job *job)
if (job)
{
job->addMetaData("accept", "application/pdf, */*;q=0.5");
- connect(job, SIGNAL(mimetype(KIO::Job*,const QString&)), this, SLOT(readMimeType(KIO::Job*,const QString&)));
+ connect(job, TQT_SIGNAL(mimetype(KIO::Job*,const TQString&)), this, TQT_SLOT(readMimeType(KIO::Job*,const TQString&)));
}
}
-void Part::readMimeType(KIO::Job *, const QString &mime)
+void Part::readMimeType(KIO::Job *, const TQString &mime)
{
m_jobMime = mime;
}
@@ -547,8 +547,8 @@ bool Part::closeURL()
{
if (!m_temporaryLocalFile.isNull())
{
- QFile::remove( m_temporaryLocalFile );
- m_temporaryLocalFile = QString::null;
+ TQFile::remove( m_temporaryLocalFile );
+ m_temporaryLocalFile = TQString::null;
}
slotHidePresentation();
@@ -568,10 +568,10 @@ bool Part::closeURL()
return KParts::ReadOnlyPart::closeURL();
}
-bool Part::eventFilter( QObject * watched, QEvent * e )
+bool Part::eventFilter( TQObject * watched, TQEvent * e )
{
// if pageView has been resized, save splitter sizes
- if ( watched == m_pageView && e->type() == QEvent::Resize )
+ if ( watched == m_pageView && e->type() == TQEvent::Resize )
m_saveSplitterSizeTimer->start(500, true);
// only intercept events, don't block them
@@ -589,7 +589,7 @@ void Part::slotShowLeftPanel()
m_thumbnailList->setShown( showLeft );
}
-void Part::slotFileDirty( const QString& fileName )
+void Part::slotFileDirty( const TQString& fileName )
{
// The beauty of this is that each start cancels the previous one.
// This means that timeout() is only fired when there have
@@ -638,7 +638,7 @@ void Part::close()
{
closeURL();
}
- else KMessageBox::information(widget(), i18n("This link points to a close document action that does not work when using the embedded viewer."), QString::null, "warnNoCloseIfNotInKPDF");
+ else KMessageBox::information(widget(), i18n("This link points to a close document action that does not work when using the embedded viewer."), TQString::null, "warnNoCloseIfNotInKPDF");
}
void Part::updateViewActions()
@@ -675,7 +675,7 @@ void Part::enableTOC(bool enable)
void Part::psTransformEnded()
{
- QString aux = m_file;
+ TQString aux = m_file;
m_file = m_temporaryLocalFile;
openFile();
m_file = aux; // so watching works, we have to watch the ps file not the autogenerated pdf
@@ -686,7 +686,7 @@ void Part::psTransformEnded()
void Part::cannotQuit()
{
- KMessageBox::information(widget(), i18n("This link points to a quit application action that does not work when using the embedded viewer."), QString::null, "warnNoQuitIfNotInKPDF");
+ KMessageBox::information(widget(), i18n("This link points to a quit application action that does not work when using the embedded viewer."), TQString::null, "warnNoQuitIfNotInKPDF");
}
void Part::saveSplitterSize()
@@ -699,16 +699,16 @@ void Part::saveSplitterSize()
class KPDFGotoPageDialog : public KDialogBase
{
public:
- KPDFGotoPageDialog(QWidget *p, int current, int max) : KDialogBase(p, 0L, true, i18n("Go to Page"), Ok | Cancel, Ok) {
- QWidget *w = new QWidget(this);
+ KPDFGotoPageDialog(TQWidget *p, int current, int max) : KDialogBase(p, 0L, true, i18n("Go to Page"), Ok | Cancel, Ok) {
+ TQWidget *w = new TQWidget(this);
setMainWidget(w);
- QVBoxLayout *topLayout = new QVBoxLayout( w, 0, spacingHint() );
+ TQVBoxLayout *topLayout = new TQVBoxLayout( w, 0, spacingHint() );
e1 = new KIntNumInput(current, w);
e1->setRange(1, max);
e1->setEditFocus(true);
- QLabel *label = new QLabel( e1,i18n("&Page:"), w );
+ TQLabel *label = new TQLabel( e1,i18n("&Page:"), w );
topLayout->addWidget(label);
topLayout->addWidget(e1);
topLayout->addSpacing(spacingHint()); // A little bit extra space
@@ -728,7 +728,7 @@ public:
void Part::slotGoToPage()
{
KPDFGotoPageDialog pageDialog( m_pageView, m_document->currentPage() + 1, m_document->pages() );
- if ( pageDialog.exec() == QDialog::Accepted )
+ if ( pageDialog.exec() == TQDialog::Accepted )
m_document->setViewportPage( pageDialog.getPage() - 1 );
}
@@ -782,7 +782,7 @@ void Part::slotFind()
{
dlg.setOptions( dlg.options() | KFindDialog::CaseSensitive );
}
- if ( dlg.exec() == QDialog::Accepted )
+ if ( dlg.exec() == TQDialog::Accepted )
{
savedCaseSensitive = dlg.options() & KFindDialog::CaseSensitive;
m_searchHistory = dlg.findHistory();
@@ -801,7 +801,7 @@ void Part::slotFindNext()
void Part::slotSaveFileAs()
{
- KURL saveURL = KFileDialog::getSaveURL( url().isLocalFile() ? url().url() : url().fileName(), QString::null, widget() );
+ KURL saveURL = KFileDialog::getSaveURL( url().isLocalFile() ? url().url() : url().fileName(), TQString::null, widget() );
if ( saveURL.isValid() && !saveURL.isEmpty() )
{
if (saveURL == url())
@@ -811,7 +811,7 @@ void Part::slotSaveFileAs()
}
if ( KIO::NetAccess::exists( saveURL, false, widget() ) )
{
- if (KMessageBox::warningContinueCancel( widget(), i18n("A file named \"%1\" already exists. Are you sure you want to overwrite it?").arg(saveURL.filename()), QString::null, i18n("Overwrite")) != KMessageBox::Continue)
+ if (KMessageBox::warningContinueCancel( widget(), i18n("A file named \"%1\" already exists. Are you sure you want to overwrite it?").arg(saveURL.filename()), TQString::null, i18n("Overwrite")) != KMessageBox::Continue)
return;
}
@@ -830,7 +830,7 @@ void Part::slotPreferences()
// we didn't find an instance of this dialog, so lets create it
PreferencesDialog * dialog = new PreferencesDialog( m_pageView, KpdfSettings::self() );
// keep us informed when the user changes settings
- connect( dialog, SIGNAL( settingsChanged() ), this, SLOT( slotNewConfig() ) );
+ connect( dialog, TQT_SIGNAL( settingsChanged() ), this, TQT_SLOT( slotNewConfig() ) );
dialog->show();
}
@@ -855,8 +855,8 @@ void Part::slotNewConfig()
m_searchWidget->setShown( showSearch );
// Main View (pageView)
- QScrollView::ScrollBarMode scrollBarMode = KpdfSettings::showScrollBars() ?
- QScrollView::AlwaysOn : QScrollView::AlwaysOff;
+ TQScrollView::ScrollBarMode scrollBarMode = KpdfSettings::showScrollBars() ?
+ TQScrollView::AlwaysOn : TQScrollView::AlwaysOff;
if ( m_pageView->hScrollBarMode() != scrollBarMode )
{
m_pageView->setHScrollBarMode( scrollBarMode );
@@ -903,7 +903,7 @@ void Part::slotPrintPreview()
doPrint(printer);
}
-void Part::slotShowMenu(const KPDFPage *page, const QPoint &point)
+void Part::slotShowMenu(const KPDFPage *page, const TQPoint &point)
{
bool reallyShow = false;
if (!m_actionsSearched)
@@ -916,8 +916,8 @@ void Part::slotShowMenu(const KPDFPage *page, const QPoint &point)
if (factory())
{
- QPtrList<KXMLGUIClient> clients(factory()->clients());
- QPtrListIterator<KXMLGUIClient> clientsIt( clients );
+ TQPtrList<KXMLGUIClient> clients(factory()->clients());
+ TQPtrListIterator<KXMLGUIClient> clientsIt( clients );
for( ; (!m_showMenuBarAction || !m_showFullScreenAction) && clientsIt.current(); ++clientsIt)
{
client = clientsIt.current();
@@ -927,8 +927,8 @@ void Part::slotShowMenu(const KPDFPage *page, const QPoint &point)
begin = actions.begin();
for ( it = begin; it != end; ++it )
{
- if (QString((*it)->name()) == "options_show_menubar") m_showMenuBarAction = (KToggleAction*)(*it);
- if (QString((*it)->name()) == "fullscreen") m_showFullScreenAction = (KToggleAction*)(*it);
+ if (TQString((*it)->name()) == "options_show_menubar") m_showMenuBarAction = (KToggleAction*)(*it);
+ if (TQString((*it)->name()) == "fullscreen") m_showFullScreenAction = (KToggleAction*)(*it);
}
}
}
@@ -1070,7 +1070,7 @@ void Part::restoreDocument(KConfig* config)
KURL url ( config->readPathEntry( "URL" ) );
if ( url.isValid() )
{
- QString viewport = config->readEntry( "Viewport" );
+ TQString viewport = config->readEntry( "Viewport" );
if (!viewport.isEmpty()) m_document->setNextDocumentViewport( DocumentViewport( viewport ) );
openURL( url );
}
diff --git a/kpdf/part.h b/kpdf/part.h
index be572c5f..70a3119e 100644
--- a/kpdf/part.h
+++ b/kpdf/part.h
@@ -18,14 +18,14 @@
#include <kparts/browserextension.h>
#include <kparts/part.h>
-#include <qguardedptr.h>
+#include <tqguardedptr.h>
#include "core/document.h"
#include "core/observer.h"
#include "dcop.h"
-class QWidget;
-class QSplitter;
-class QToolBox;
+class TQWidget;
+class TQSplitter;
+class TQToolBox;
class KURL;
class KAction;
@@ -62,8 +62,8 @@ Q_OBJECT
public:
// Default constructor
- Part(QWidget* parentWidget, const char* widgetName,
- QObject* parent, const char* name, const QStringList& args);
+ Part(TQWidget* parentWidget, const char* widgetName,
+ TQObject* parent, const char* name, const TQStringList& args);
// Destructor
~Part();
@@ -89,7 +89,7 @@ protected:
bool openURL(const KURL &url);
bool closeURL();
// filter that watches for splitter size changes
- bool eventFilter( QObject * watched, QEvent * e );
+ bool eventFilter( TQObject * watched, TQEvent * e );
protected slots:
void openURLFromDocument(const KURL &url);
@@ -107,7 +107,7 @@ protected slots:
void slotPreferences();
void slotNewConfig();
void slotPrintPreview();
- void slotShowMenu(const KPDFPage *page, const QPoint &point);
+ void slotShowMenu(const KPDFPage *page, const TQPoint &point);
void slotShowProperties();
void slotShowLeftPanel();
void slotShowPresentation();
@@ -121,7 +121,7 @@ protected slots:
void cannotQuit();
void saveSplitterSize();
void setMimeTypes(KIO::Job *job);
- void readMimeType(KIO::Job *job, const QString &mime);
+ void readMimeType(KIO::Job *job, const TQString &mime);
void emitWindowCaption();
public slots:
@@ -129,7 +129,7 @@ public slots:
void slotPrint();
void restoreDocument(KConfig* config);
void saveDocumentRestoreInfo(KConfig* config);
- void slotFileDirty( const QString& );
+ void slotFileDirty( const TQString& );
void slotDoFileDirty();
private:
@@ -137,38 +137,38 @@ private:
// the document
KPDFDocument * m_document;
- QString m_temporaryLocalFile;
+ TQString m_temporaryLocalFile;
// main widgets
- QSplitter *m_splitter;
- QWidget *m_leftPanel;
- QToolBox *m_toolBox;
+ TQSplitter *m_splitter;
+ TQWidget *m_leftPanel;
+ TQToolBox *m_toolBox;
SearchWidget *m_searchWidget;
- QGuardedPtr<ThumbnailList> m_thumbnailList;
- QGuardedPtr<PageView> m_pageView;
- QGuardedPtr<TOC> m_tocFrame;
- QGuardedPtr<MiniBar> m_miniBar;
- QGuardedPtr<PresentationWidget> m_presentationWidget;
+ TQGuardedPtr<ThumbnailList> m_thumbnailList;
+ TQGuardedPtr<PageView> m_pageView;
+ TQGuardedPtr<TOC> m_tocFrame;
+ TQGuardedPtr<MiniBar> m_miniBar;
+ TQGuardedPtr<PresentationWidget> m_presentationWidget;
// static instances counter
static unsigned int m_count;
// this is a hack because we can not use writeConfig on part destructor
// and we don't want to writeconfig every time someone moves the splitter
- // so we use a QTimer each 500 ms
- QTimer *m_saveSplitterSizeTimer;
+ // so we use a TQTimer each 500 ms
+ TQTimer *m_saveSplitterSizeTimer;
KDirWatch *m_watcher;
- QTimer *m_dirtyHandler;
+ TQTimer *m_dirtyHandler;
DocumentViewport m_viewportDirty;
bool m_wasPresentationOpen;
int m_dirtyToolboxIndex;
// Remember the search history
- QStringList m_searchHistory;
+ TQStringList m_searchHistory;
// mimetype got from the job
- QString m_jobMime;
+ TQString m_jobMime;
// actions
KAction *m_gotoPage;
diff --git a/kpdf/shell/shell.cpp b/kpdf/shell/shell.cpp
index 82b18fa6..8b6d185a 100644
--- a/kpdf/shell/shell.cpp
+++ b/kpdf/shell/shell.cpp
@@ -18,8 +18,8 @@
***************************************************************************/
// qt/kde includes
-#include <qcursor.h>
-#include <qtimer.h>
+#include <tqcursor.h>
+#include <tqtimer.h>
#include <kaction.h>
#include <kapplication.h>
#include <kedittoolbar.h>
@@ -87,9 +87,9 @@ void Shell::init()
m_part = 0;
return;
}
- connect( this, SIGNAL( restoreDocument(KConfig*) ),m_part, SLOT( restoreDocument(KConfig*)));
- connect( this, SIGNAL( saveDocumentRestoreInfo(KConfig*) ), m_part, SLOT( saveDocumentRestoreInfo(KConfig*)));
- connect( m_part, SIGNAL( enablePrintAction(bool) ), m_printAction, SLOT( setEnabled(bool)));
+ connect( this, TQT_SIGNAL( restoreDocument(KConfig*) ),m_part, TQT_SLOT( restoreDocument(KConfig*)));
+ connect( this, TQT_SIGNAL( saveDocumentRestoreInfo(KConfig*) ), m_part, TQT_SLOT( saveDocumentRestoreInfo(KConfig*)));
+ connect( m_part, TQT_SIGNAL( enablePrintAction(bool) ), m_printAction, TQT_SLOT( setEnabled(bool)));
readSettings();
if (!KGlobal::config()->hasGroup("MainWindow"))
@@ -99,7 +99,7 @@ void Shell::init()
}
setAutoSaveSettings();
- if (m_openUrl.isValid()) QTimer::singleShot(0, this, SLOT(delayedOpen()));
+ if (m_openUrl.isValid()) TQTimer::singleShot(0, this, TQT_SLOT(delayedOpen()));
}
void Shell::delayedOpen()
@@ -146,19 +146,19 @@ void Shell::writeSettings()
void Shell::setupActions()
{
- KAction * openAction = KStdAction::open(this, SLOT(fileOpen()), actionCollection());
- m_recent = KStdAction::openRecent( this, SLOT( openURL( const KURL& ) ), actionCollection() );
- connect( m_recent, SIGNAL( activated() ), openAction, SLOT( activate() ) );
+ KAction * openAction = KStdAction::open(this, TQT_SLOT(fileOpen()), actionCollection());
+ m_recent = KStdAction::openRecent( this, TQT_SLOT( openURL( const KURL& ) ), actionCollection() );
+ connect( m_recent, TQT_SIGNAL( activated() ), openAction, TQT_SLOT( activate() ) );
m_recent->setWhatsThis( i18n( "<b>Click</b> to open a file or <b>Click and hold</b> to select a recent file" ) );
- m_printAction = KStdAction::print( m_part, SLOT( slotPrint() ), actionCollection() );
+ m_printAction = KStdAction::print( m_part, TQT_SLOT( slotPrint() ), actionCollection() );
m_printAction->setEnabled( false );
- KStdAction::quit(this, SLOT(slotQuit()), actionCollection());
+ KStdAction::quit(this, TQT_SLOT(slotQuit()), actionCollection());
setStandardToolBarMenuEnabled(true);
- m_showMenuBarAction = KStdAction::showMenubar( this, SLOT( slotShowMenubar() ), actionCollection());
- KStdAction::configureToolbars(this, SLOT(optionsConfigureToolbars()), actionCollection());
- m_fullScreenAction = KStdAction::fullScreen( this, SLOT( slotUpdateFullScreen() ), actionCollection(), this );
+ m_showMenuBarAction = KStdAction::showMenubar( this, TQT_SLOT( slotShowMenubar() ), actionCollection());
+ KStdAction::configureToolbars(this, TQT_SLOT(optionsConfigureToolbars()), actionCollection());
+ m_fullScreenAction = KStdAction::fullScreen( this, TQT_SLOT( slotUpdateFullScreen() ), actionCollection(), this );
}
void Shell::saveProperties(KConfig* config)
@@ -187,7 +187,7 @@ Shell::fileOpen()
// this slot is called whenever the File->Open menu is selected,
// the Open shortcut is pressed (usually CTRL+O) or the Open toolbar
// button is clicked
- KURL url = KFileDialog::getOpenURL( QString::null, "application/pdf application/postscript" );//getOpenFileName();
+ KURL url = KFileDialog::getOpenURL( TQString::null, "application/pdf application/postscript" );//getOpenFileName();
if (!url.isEmpty())
openURL(url);
@@ -197,7 +197,7 @@ Shell::fileOpen()
Shell::optionsConfigureToolbars()
{
KEditToolbar dlg(factory());
- connect(&dlg, SIGNAL(newToolbarConfig()), this, SLOT(applyNewToolbarConfig()));
+ connect(&dlg, TQT_SIGNAL(newToolbarConfig()), this, TQT_SLOT(applyNewToolbarConfig()));
dlg.exec();
}
diff --git a/kpdf/ui/minibar.cpp b/kpdf/ui/minibar.cpp
index 1a259add..be3c9383 100644
--- a/kpdf/ui/minibar.cpp
+++ b/kpdf/ui/minibar.cpp
@@ -9,13 +9,13 @@
***************************************************************************/
// qt / kde includes
-#include <qapplication.h>
-#include <qpushbutton.h>
-#include <qlabel.h>
-#include <qlineedit.h>
-#include <qlayout.h>
-#include <qvalidator.h>
-#include <qpainter.h>
+#include <tqapplication.h>
+#include <tqpushbutton.h>
+#include <tqlabel.h>
+#include <tqlineedit.h>
+#include <tqlayout.h>
+#include <tqvalidator.h>
+#include <tqpainter.h>
#include <kiconloader.h>
#include <kaccelmanager.h>
#include <kdeversion.h>
@@ -32,10 +32,10 @@ class ProgressWidget : public QWidget
void setProgress( float percentage );
protected:
- void mouseMoveEvent( QMouseEvent * e );
- void mousePressEvent( QMouseEvent * e );
- void wheelEvent( QWheelEvent * e );
- void paintEvent( QPaintEvent * e );
+ void mouseMoveEvent( TQMouseEvent * e );
+ void mousePressEvent( TQMouseEvent * e );
+ void wheelEvent( TQWheelEvent * e );
+ void paintEvent( TQPaintEvent * e );
private:
MiniBar * m_miniBar;
@@ -48,83 +48,83 @@ class PagesEdit : public QLineEdit
public:
PagesEdit( MiniBar * parent );
void setPagesNumber( int pages );
- void setText( const QString & );
+ void setText( const TQString & );
protected:
- void focusInEvent( QFocusEvent * e );
- void focusOutEvent( QFocusEvent * e );
- void mousePressEvent( QMouseEvent * e );
- void wheelEvent( QWheelEvent * e );
+ void focusInEvent( TQFocusEvent * e );
+ void focusOutEvent( TQFocusEvent * e );
+ void mousePressEvent( TQMouseEvent * e );
+ void wheelEvent( TQWheelEvent * e );
private:
MiniBar * m_miniBar;
bool m_eatClick;
- QString backString;
- QIntValidator * m_validator;
+ TQString backString;
+ TQIntValidator * m_validator;
};
// [private widget] a flat qpushbutton that enlights on hover
class HoverButton : public QPushButton
{
public:
- HoverButton( QWidget * parent );
+ HoverButton( TQWidget * parent );
protected:
- void paintEvent( QPaintEvent * e );
- void enterEvent( QPaintEvent * e );
- void leaveEvent( QPaintEvent * e );
+ void paintEvent( TQPaintEvent * e );
+ void enterEvent( TQPaintEvent * e );
+ void leaveEvent( TQPaintEvent * e );
};
/** MiniBar **/
-MiniBar::MiniBar( QWidget * parent, KPDFDocument * document )
- : QFrame( parent, "miniBar" ), m_document( document ),
+MiniBar::MiniBar( TQWidget * parent, KPDFDocument * document )
+ : TQFrame( parent, "miniBar" ), m_document( document ),
m_currentPage( -1 )
{
// left spacer
- QHBoxLayout * horLayout = new QHBoxLayout( this );
- QSpacerItem * spacerL = new QSpacerItem( 20, 10, QSizePolicy::Expanding );
+ TQHBoxLayout * horLayout = new TQHBoxLayout( this );
+ TQSpacerItem * spacerL = new TQSpacerItem( 20, 10, TQSizePolicy::Expanding );
horLayout->addItem( spacerL );
// central 2r by 3c grid layout that contains all components
- QGridLayout * gridLayout = new QGridLayout( 0, 3,5, 2,1 );
+ TQGridLayout * gridLayout = new TQGridLayout( 0, 3,5, 2,1 );
// top spacer 6x6 px
-// QSpacerItem * spacerTop = new QSpacerItem( 6, 6, QSizePolicy::Fixed, QSizePolicy::Fixed );
+// TQSpacerItem * spacerTop = new TQSpacerItem( 6, 6, TQSizePolicy::Fixed, TQSizePolicy::Fixed );
// gridLayout->addMultiCell( spacerTop, 0, 0, 0, 4 );
// center progress widget
m_progressWidget = new ProgressWidget( this );
gridLayout->addMultiCellWidget( m_progressWidget, 0, 0, 0, 4 );
// bottom: left prev_page button
m_prevButton = new HoverButton( this );
- m_prevButton->setIconSet( SmallIconSet( QApplication::reverseLayout() ? "1rightarrow" : "1leftarrow" ) );
+ m_prevButton->setIconSet( SmallIconSet( TQApplication::reverseLayout() ? "1rightarrow" : "1leftarrow" ) );
gridLayout->addWidget( m_prevButton, 1, 0 );
// bottom: left lineEdit (current page box)
m_pagesEdit = new PagesEdit( this );
gridLayout->addWidget( m_pagesEdit, 1, 1 );
// bottom: central '/' label
- gridLayout->addWidget( new QLabel( "/", this ), 1, 2 );
+ gridLayout->addWidget( new TQLabel( "/", this ), 1, 2 );
// bottom: right button
m_pagesButton = new HoverButton( this );
gridLayout->addWidget( m_pagesButton, 1, 3 );
// bottom: right next_page button
m_nextButton = new HoverButton( this );
- m_nextButton->setIconSet( SmallIconSet( QApplication::reverseLayout() ? "1leftarrow" : "1rightarrow" ) );
+ m_nextButton->setIconSet( SmallIconSet( TQApplication::reverseLayout() ? "1leftarrow" : "1rightarrow" ) );
gridLayout->addWidget( m_nextButton, 1, 4 );
horLayout->addLayout( gridLayout );
// right spacer
- QSpacerItem * spacerR = new QSpacerItem( 20, 10, QSizePolicy::Expanding );
+ TQSpacerItem * spacerR = new TQSpacerItem( 20, 10, TQSizePolicy::Expanding );
horLayout->addItem( spacerR );
// customize own look
- setFrameStyle( QFrame::StyledPanel | QFrame::Sunken );
+ setFrameStyle( TQFrame::StyledPanel | TQFrame::Sunken );
// connect signals from child widgets to internal handlers / signals bouncers
- connect( m_pagesEdit, SIGNAL( returnPressed() ), this, SLOT( slotChangePage() ) );
- connect( m_pagesButton, SIGNAL( clicked() ), this, SIGNAL( gotoPage() ) );
- connect( m_prevButton, SIGNAL( clicked() ), this, SIGNAL( prevPage() ) );
- connect( m_nextButton, SIGNAL( clicked() ), this, SIGNAL( nextPage() ) );
+ connect( m_pagesEdit, TQT_SIGNAL( returnPressed() ), this, TQT_SLOT( slotChangePage() ) );
+ connect( m_pagesButton, TQT_SIGNAL( clicked() ), this, TQT_SIGNAL( gotoPage() ) );
+ connect( m_prevButton, TQT_SIGNAL( clicked() ), this, TQT_SIGNAL( prevPage() ) );
+ connect( m_nextButton, TQT_SIGNAL( clicked() ), this, TQT_SIGNAL( nextPage() ) );
// widget starts hidden (will be shown after opening a document)
parent->hide();
@@ -135,7 +135,7 @@ MiniBar::~MiniBar()
m_document->removeObserver( this );
}
-void MiniBar::notifySetup( const QValueVector< KPDFPage * > & pageVector, bool changed )
+void MiniBar::notifySetup( const TQValueVector< KPDFPage * > & pageVector, bool changed )
{
// only process data when document changes
if ( !changed )
@@ -146,12 +146,12 @@ void MiniBar::notifySetup( const QValueVector< KPDFPage * > & pageVector, bool c
if ( pages < 1 )
{
m_currentPage = -1;
- static_cast<QWidget*>( parent() )->hide();
+ static_cast<TQWidget*>( parent() )->hide();
return;
}
// resize width of widgets
- int numberWidth = 10 + fontMetrics().width( QString::number( pages ) );
+ int numberWidth = 10 + fontMetrics().width( TQString::number( pages ) );
m_pagesEdit->setMinimumWidth( numberWidth );
m_pagesEdit->setMaximumWidth( 2 * numberWidth );
m_pagesButton->setMinimumWidth( numberWidth );
@@ -168,10 +168,10 @@ void MiniBar::notifySetup( const QValueVector< KPDFPage * > & pageVector, bool c
// update child widgets
m_pagesEdit->setPagesNumber( pages );
- m_pagesButton->setText( QString::number( pages ) );
+ m_pagesButton->setText( TQString::number( pages ) );
m_prevButton->setEnabled( false );
m_nextButton->setEnabled( false );
- static_cast<QWidget*>( parent() )->show();
+ static_cast<TQWidget*>( parent() )->show();
}
void MiniBar::notifyViewportChanged( bool /*smoothMove*/ )
@@ -191,14 +191,14 @@ void MiniBar::notifyViewportChanged( bool /*smoothMove*/ )
m_prevButton->setEnabled( page > 0 );
m_nextButton->setEnabled( page < ( pages - 1 ) );
// update text on widgets
- m_pagesEdit->setText( QString::number( page + 1 ) );
+ m_pagesEdit->setText( TQString::number( page + 1 ) );
}
}
-void MiniBar::resizeEvent( QResizeEvent * e )
+void MiniBar::resizeEvent( TQResizeEvent * e )
{
// auto-hide 'prev' and 'next' buttons if not enough space
- const QSize & myHint = minimumSizeHint();
+ const TQSize & myHint = minimumSizeHint();
bool shown = m_prevButton->isVisible() && m_nextButton->isVisible();
if ( shown && e->size().width() < myHint.width() )
{
@@ -221,7 +221,7 @@ void MiniBar::resizeEvent( QResizeEvent * e )
void MiniBar::slotChangePage()
{
// get text from the lineEdit
- QString pageNumber = m_pagesEdit->text();
+ TQString pageNumber = m_pagesEdit->text();
// convert it to page number and go to that page
bool ok;
@@ -260,7 +260,7 @@ void MiniBar::slotEmitPrevPage()
/** ProgressWidget **/
ProgressWidget::ProgressWidget( MiniBar * parent )
- : QWidget( parent, "progress", WNoAutoErase ),
+ : TQWidget( parent, "progress", WNoAutoErase ),
m_miniBar( parent ), m_progressPercentage( -1 )
{
setFixedHeight( 4 );
@@ -273,19 +273,19 @@ void ProgressWidget::setProgress( float percentage )
update();
}
-void ProgressWidget::mouseMoveEvent( QMouseEvent * e )
+void ProgressWidget::mouseMoveEvent( TQMouseEvent * e )
{
if ( e->state() == Qt::LeftButton && width() > 0 )
- m_miniBar->slotGotoNormalizedPage( (float)( QApplication::reverseLayout() ? width() - e->x() : e->x() ) / (float)width() );
+ m_miniBar->slotGotoNormalizedPage( (float)( TQApplication::reverseLayout() ? width() - e->x() : e->x() ) / (float)width() );
}
-void ProgressWidget::mousePressEvent( QMouseEvent * e )
+void ProgressWidget::mousePressEvent( TQMouseEvent * e )
{
if ( e->button() == Qt::LeftButton && width() > 0 )
- m_miniBar->slotGotoNormalizedPage( (float)( QApplication::reverseLayout() ? width() - e->x() : e->x() ) / (float)width() );
+ m_miniBar->slotGotoNormalizedPage( (float)( TQApplication::reverseLayout() ? width() - e->x() : e->x() ) / (float)width() );
}
-void ProgressWidget::wheelEvent( QWheelEvent * e )
+void ProgressWidget::wheelEvent( TQWheelEvent * e )
{
if ( e->delta() > 0 )
m_miniBar->slotEmitNextPage();
@@ -293,7 +293,7 @@ void ProgressWidget::wheelEvent( QWheelEvent * e )
m_miniBar->slotEmitPrevPage();
}
-void ProgressWidget::paintEvent( QPaintEvent * e )
+void ProgressWidget::paintEvent( TQPaintEvent * e )
{
if ( m_progressPercentage < 0.0 )
return;
@@ -302,11 +302,11 @@ void ProgressWidget::paintEvent( QPaintEvent * e )
int w = width(),
h = height(),
l = (int)( (float)w * m_progressPercentage );
- QRect cRect = ( QApplication::reverseLayout() ? QRect( 0, 0, w - l, h ) : QRect( l, 0, w - l, h ) ).intersect( e->rect() );
- QRect fRect = ( QApplication::reverseLayout() ? QRect( w - l, 0, l, h ) : QRect( 0, 0, l, h ) ).intersect( e->rect() );
+ TQRect cRect = ( TQApplication::reverseLayout() ? TQRect( 0, 0, w - l, h ) : TQRect( l, 0, w - l, h ) ).intersect( e->rect() );
+ TQRect fRect = ( TQApplication::reverseLayout() ? TQRect( w - l, 0, l, h ) : TQRect( 0, 0, l, h ) ).intersect( e->rect() );
// paint rects and a separator line
- QPainter p( this );
+ TQPainter p( this );
if ( cRect.isValid() )
p.fillRect( cRect, palette().active().highlightedText() );
if ( fRect.isValid() )
@@ -314,7 +314,7 @@ void ProgressWidget::paintEvent( QPaintEvent * e )
if ( l && l != w )
{
p.setPen( palette().active().highlight().dark( 120 ) );
- int delta = QApplication::reverseLayout() ? w - l : l;
+ int delta = TQApplication::reverseLayout() ? w - l : l;
p.drawLine( delta, 0, delta, h );
}
// draw a frame-like outline
@@ -326,14 +326,14 @@ void ProgressWidget::paintEvent( QPaintEvent * e )
/** PagesEdit **/
PagesEdit::PagesEdit( MiniBar * parent )
- : QLineEdit( parent ), m_miniBar( parent ), m_eatClick( false )
+ : TQLineEdit( parent ), m_miniBar( parent ), m_eatClick( false )
{
// customize look
- setFrameShadow( QFrame::Raised );
+ setFrameShadow( TQFrame::Raised );
focusOutEvent( 0 );
// use an integer validator
- m_validator = new QIntValidator( 1, 1, this );
+ m_validator = new TQIntValidator( 1, 1, this );
setValidator( m_validator );
// customize text properties
@@ -346,48 +346,48 @@ void PagesEdit::setPagesNumber( int pages )
m_validator->setTop( pages );
}
-void PagesEdit::setText( const QString & text )
+void PagesEdit::setText( const TQString & text )
{
// store a copy of the string
backString = text;
// call default handler if hasn't focus
if ( !hasFocus() )
- QLineEdit::setText( text );
+ TQLineEdit::setText( text );
}
-void PagesEdit::focusInEvent( QFocusEvent * e )
+void PagesEdit::focusInEvent( TQFocusEvent * e )
{
// select all text
selectAll();
- if ( e->reason() == QFocusEvent::Mouse )
+ if ( e->reason() == TQFocusEvent::Mouse )
m_eatClick = true;
// change background color to the default 'edit' color
setLineWidth( 2 );
setPaletteBackgroundColor( Qt::white );
// call default handler
- QLineEdit::focusInEvent( e );
+ TQLineEdit::focusInEvent( e );
}
-void PagesEdit::focusOutEvent( QFocusEvent * e )
+void PagesEdit::focusOutEvent( TQFocusEvent * e )
{
// change background color to a dark tone
setLineWidth( 1 );
setPaletteBackgroundColor( palette().active().background().light( 105 ) );
// restore text
- QLineEdit::setText( backString );
+ TQLineEdit::setText( backString );
// call default handler
- QLineEdit::focusOutEvent( e );
+ TQLineEdit::focusOutEvent( e );
}
-void PagesEdit::mousePressEvent( QMouseEvent * e )
+void PagesEdit::mousePressEvent( TQMouseEvent * e )
{
// if this click got the focus in, don't process the event
if ( !m_eatClick )
- QLineEdit::mousePressEvent( e );
+ TQLineEdit::mousePressEvent( e );
m_eatClick = false;
}
-void PagesEdit::wheelEvent( QWheelEvent * e )
+void PagesEdit::wheelEvent( TQWheelEvent * e )
{
if ( e->delta() > 0 )
m_miniBar->slotEmitNextPage();
@@ -398,8 +398,8 @@ void PagesEdit::wheelEvent( QWheelEvent * e )
/** HoverButton **/
-HoverButton::HoverButton( QWidget * parent )
- : QPushButton( parent )
+HoverButton::HoverButton( TQWidget * parent )
+ : TQPushButton( parent )
{
setMouseTracking( true );
#if KDE_IS_VERSION(3,3,90)
@@ -407,28 +407,28 @@ HoverButton::HoverButton( QWidget * parent )
#endif
}
-void HoverButton::enterEvent( QPaintEvent * e )
+void HoverButton::enterEvent( TQPaintEvent * e )
{
update();
- QPushButton::enterEvent( e );
+ TQPushButton::enterEvent( e );
}
-void HoverButton::leaveEvent( QPaintEvent * e )
+void HoverButton::leaveEvent( TQPaintEvent * e )
{
update();
- QPushButton::leaveEvent( e );
+ TQPushButton::leaveEvent( e );
}
-void HoverButton::paintEvent( QPaintEvent * e )
+void HoverButton::paintEvent( TQPaintEvent * e )
{
if ( hasMouse() )
{
- QPushButton::paintEvent( e );
+ TQPushButton::paintEvent( e );
}
else
{
- QPainter p( this );
- p.fillRect(e->rect(), parentWidget() ? parentWidget()->palette().brush(QPalette::Active, QColorGroup::Background) : paletteBackgroundColor());
+ TQPainter p( this );
+ p.fillRect(e->rect(), parentWidget() ? parentWidget()->palette().brush(TQPalette::Active, TQColorGroup::Background) : paletteBackgroundColor());
drawButtonLabel( &p );
}
}
diff --git a/kpdf/ui/minibar.h b/kpdf/ui/minibar.h
index 7c815e5e..f532999c 100644
--- a/kpdf/ui/minibar.h
+++ b/kpdf/ui/minibar.h
@@ -11,7 +11,7 @@
#ifndef _KPDF_MINIBAR_H_
#define _KPDF_MINIBAR_H_
-#include <qframe.h>
+#include <tqframe.h>
#include "core/observer.h"
class KPDFDocument;
@@ -22,16 +22,16 @@ class ProgressWidget;
/**
* @short A widget to display page number and change current page.
*/
-class MiniBar : public QFrame, public DocumentObserver
+class MiniBar : public TQFrame, public DocumentObserver
{
Q_OBJECT
public:
- MiniBar( QWidget *parent, KPDFDocument * document );
+ MiniBar( TQWidget *parent, KPDFDocument * document );
~MiniBar();
// [INHERITED] from DocumentObserver
uint observerId() const { return MINIBAR_ID; }
- void notifySetup( const QValueVector< KPDFPage * > & pages, bool );
+ void notifySetup( const TQValueVector< KPDFPage * > & pages, bool );
void notifyViewportChanged( bool smoothMove );
signals:
@@ -46,7 +46,7 @@ class MiniBar : public QFrame, public DocumentObserver
void slotEmitPrevPage();
protected:
- void resizeEvent( QResizeEvent * );
+ void resizeEvent( TQResizeEvent * );
private:
KPDFDocument * m_document;
diff --git a/kpdf/ui/pagepainter.cpp b/kpdf/ui/pagepainter.cpp
index f68df254..899be054 100644
--- a/kpdf/ui/pagepainter.cpp
+++ b/kpdf/ui/pagepainter.cpp
@@ -8,11 +8,11 @@
***************************************************************************/
// qt / kde includes
-#include <qrect.h>
-#include <qpainter.h>
-#include <qpixmap.h>
-#include <qimage.h>
-#include <qapplication.h>
+#include <tqrect.h>
+#include <tqpainter.h>
+#include <tqpixmap.h>
+#include <tqimage.h>
+#include <tqapplication.h>
#include <kimageeffect.h>
// local includes
@@ -21,9 +21,9 @@
#include "conf/settings.h"
void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags,
- QPainter * destPainter, const QRect & limits, int width, int height )
+ TQPainter * destPainter, const TQRect & limits, int width, int height )
{
- QPixmap * pixmap = 0;
+ TQPixmap * pixmap = 0;
// if a pixmap is present for given id, use it
if ( page->m_pixmaps.contains( id ) )
@@ -33,7 +33,7 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags,
else if ( !page->m_pixmaps.isEmpty() && width != -1 )
{
int minDistance = -1;
- QMap< int,QPixmap * >::const_iterator it = page->m_pixmaps.begin(), end = page->m_pixmaps.end();
+ TQMap< int,TQPixmap * >::const_iterator it = page->m_pixmaps.begin(), end = page->m_pixmaps.end();
for ( ; it != end; ++it )
{
int pixWidth = (*it)->width(),
@@ -49,7 +49,7 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags,
// if have no pixmap, draw blank page with gray cross and exit
if ( !pixmap )
{
- QColor color = Qt::white;
+ TQColor color = Qt::white;
if ( KpdfSettings::changeColors() )
{
switch ( KpdfSettings::renderMode() )
@@ -92,7 +92,7 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags,
nYMax = (double)limits.bottom() / (double)height;
// if no rect intersects limits, disable paintHighlights
paintHighlights = false;
- QValueList< HighlightRect * >::const_iterator hIt = page->m_highlights.begin(), hEnd = page->m_highlights.end();
+ TQValueList< HighlightRect * >::const_iterator hIt = page->m_highlights.begin(), hEnd = page->m_highlights.end();
for ( ; hIt != hEnd; ++hIt )
{
if ( (*hIt)->intersects( nXMin, nYMin, nXMax, nYMax ) )
@@ -105,13 +105,13 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags,
// use backBuffer if 'pixmap direct manipulation' is needed
bool backBuffer = paintAccessibility || paintHighlights;
- QPixmap * backPixmap = 0;
- QPainter * p = destPainter;
+ TQPixmap * backPixmap = 0;
+ TQPainter * p = destPainter;
if ( backBuffer )
{
// let's paint using a buffered painter
- backPixmap = new QPixmap( limits.width(), limits.height() );
- p = new QPainter( backPixmap );
+ backPixmap = new TQPixmap( limits.width(), limits.height() );
+ p = new TQPainter( backPixmap );
p->translate( -limits.left(), -limits.top() );
}
@@ -131,14 +131,14 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags,
// 2. mangle pixmap: convert it to 32-bit qimage and perform pixel-level manipulations
if ( backBuffer )
{
- QImage backImage = backPixmap->convertToImage();
+ TQImage backImage = backPixmap->convertToImage();
// 2.1. modify pixmap following accessibility settings
if ( paintAccessibility )
{
switch ( KpdfSettings::renderMode() )
{
case KpdfSettings::EnumRenderMode::Inverted:
- // Invert image pixels using QImage internal function
+ // Invert image pixels using TQImage internal function
backImage.invertPixels(false);
break;
case KpdfSettings::EnumRenderMode::Recolor:
@@ -174,11 +174,11 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags,
if ( paintHighlights )
{
// draw highlights that are inside the 'limits' paint region
- QValueList< HighlightRect * >::const_iterator hIt = page->m_highlights.begin(), hEnd = page->m_highlights.end();
+ TQValueList< HighlightRect * >::const_iterator hIt = page->m_highlights.begin(), hEnd = page->m_highlights.end();
for ( ; hIt != hEnd; ++hIt )
{
HighlightRect * r = *hIt;
- QRect highlightRect = r->geometry( width, height );
+ TQRect highlightRect = r->geometry( width, height );
if ( highlightRect.isValid() && highlightRect.intersects( limits ) )
{
// find out the rect to highlight on pixmap
@@ -213,20 +213,20 @@ void PagePainter::paintPageOnPainter( const KPDFPage * page, int id, int flags,
// 3. visually enchance links and images if requested
if ( enhanceLinks || enhanceImages )
{
- QColor normalColor = QApplication::palette().active().highlight();
- QColor lightColor = normalColor.light( 140 );
+ TQColor normalColor = TQApplication::palette().active().highlight();
+ TQColor lightColor = normalColor.light( 140 );
// enlarging limits for intersection is like growing the 'rectGeometry' below
- QRect limitsEnlarged = limits;
+ TQRect limitsEnlarged = limits;
limitsEnlarged.addCoords( -2, -2, 2, 2 );
// draw rects that are inside the 'limits' paint region as opaque rects
- QValueList< ObjectRect * >::const_iterator lIt = page->m_rects.begin(), lEnd = page->m_rects.end();
+ TQValueList< ObjectRect * >::const_iterator lIt = page->m_rects.begin(), lEnd = page->m_rects.end();
for ( ; lIt != lEnd; ++lIt )
{
ObjectRect * rect = *lIt;
if ( (enhanceLinks && rect->objectType() == ObjectRect::Link) ||
(enhanceImages && rect->objectType() == ObjectRect::Image) )
{
- QRect rectGeometry = rect->geometry( width, height );
+ TQRect rectGeometry = rect->geometry( width, height );
if ( rectGeometry.intersects( limitsEnlarged ) )
{
// expand rect and draw inner border
diff --git a/kpdf/ui/pagepainter.h b/kpdf/ui/pagepainter.h
index 21ef7629..8d6cde10 100644
--- a/kpdf/ui/pagepainter.h
+++ b/kpdf/ui/pagepainter.h
@@ -11,8 +11,8 @@
#define _KPDF_PAGEPAINTER_H_
class KPDFPage;
-class QPainter;
-class QRect;
+class TQPainter;
+class TQRect;
/**
* @short Paints a KPDFPage to an open painter using given flags.
@@ -30,7 +30,7 @@ class PagePainter
// 'width' and 'height' the expected size of page contents (used only
// to pick up an alternative pixmap if the pixmap of 'id' is missing.
static void paintPageOnPainter( const KPDFPage * page, int id, int flags,
- QPainter * p, const QRect & limits, int width = -1, int height = -1 );
+ TQPainter * p, const TQRect & limits, int width = -1, int height = -1 );
};
#endif
diff --git a/kpdf/ui/pageview.cpp b/kpdf/ui/pageview.cpp
index 866b8d66..3b0baecd 100644
--- a/kpdf/ui/pageview.cpp
+++ b/kpdf/ui/pageview.cpp
@@ -17,14 +17,14 @@
***************************************************************************/
// qt/kde includes
-#include <qcursor.h>
-#include <qpainter.h>
-#include <qtimer.h>
-#include <qdatetime.h>
-#include <qpushbutton.h>
-#include <qtooltip.h>
-#include <qapplication.h>
-#include <qclipboard.h>
+#include <tqcursor.h>
+#include <tqpainter.h>
+#include <tqtimer.h>
+#include <tqdatetime.h>
+#include <tqpushbutton.h>
+#include <tqtooltip.h>
+#include <tqapplication.h>
+#include <tqclipboard.h>
#include <dcopclient.h>
#include <kcursor.h>
#include <kiconloader.h>
@@ -65,35 +65,35 @@ class PageViewPrivate
public:
// the document, pageviewItems and the 'visible cache'
KPDFDocument * document;
- QValueVector< PageViewItem * > items;
- QValueList< PageViewItem * > visibleItems;
+ TQValueVector< PageViewItem * > items;
+ TQValueList< PageViewItem * > visibleItems;
// view layout (columns and continuous in Settings), zoom and mouse
PageView::ZoomMode zoomMode;
float zoomFactor;
int rotation;
PageView::MouseMode mouseMode;
- QPoint mouseGrabPos;
- QPoint mousePressPos;
+ TQPoint mouseGrabPos;
+ TQPoint mousePressPos;
int mouseMidStartY;
bool mouseOnRect;
- QRect mouseSelectionRect;
- QColor selectionRectColor;
+ TQRect mouseSelectionRect;
+ TQColor selectionRectColor;
// type ahead find
bool typeAheadActive;
- QString typeAheadString;
- QTimer * findTimeoutTimer;
+ TQString typeAheadString;
+ TQTimer * findTimeoutTimer;
// viewport move
bool viewportMoveActive;
- QTime viewportMoveTime;
- QPoint viewportMoveDest;
- QTimer * viewportMoveTimer;
+ TQTime viewportMoveTime;
+ TQPoint viewportMoveDest;
+ TQTimer * viewportMoveTimer;
// auto scroll
int scrollIncrement;
- QTimer * autoScrollTimer;
+ TQTimer * autoScrollTimer;
// other stuff
- QTimer * delayResizeTimer;
+ TQTimer * delayResizeTimer;
bool dirtyLayout;
bool blockViewport; // prevents changes to viewport
bool blockPixmapsRequest; // prevent pixmap requests
@@ -101,8 +101,8 @@ public:
PageViewTip * tip;
// drag scroll
- QPoint dragScrollVector;
- QTimer dragScrollTimer;
+ TQPoint dragScrollVector;
+ TQTimer dragScrollTimer;
// actions
KToggleAction * aMouseNormal;
@@ -123,7 +123,7 @@ class PageViewTip : public QToolTip
{
public:
PageViewTip( PageView * view )
- : QToolTip( view->viewport() ), m_view( view )
+ : TQToolTip( view->viewport() ), m_view( view )
{
}
@@ -134,15 +134,15 @@ class PageViewTip : public QToolTip
protected:
- void maybeTip( const QPoint &p );
+ void maybeTip( const TQPoint &p );
private:
PageView * m_view;
};
-void PageViewTip::maybeTip( const QPoint &_p )
+void PageViewTip::maybeTip( const TQPoint &_p )
{
- QPoint p( _p.x() + m_view->contentsX(), _p.y() + m_view->contentsY() );
+ TQPoint p( _p.x() + m_view->contentsX(), _p.y() + m_view->contentsY() );
PageViewItem * pageItem = m_view->pickItemOnPoint( p.x(), p.y() );
if ( pageItem && m_view->d->mouseMode == PageView::MouseNormal )
{
@@ -155,10 +155,10 @@ void PageViewTip::maybeTip( const QPoint &_p )
{
// set tooltip over link's rect
KPDFLink *link = (KPDFLink *)object->pointer();
- QString strtip = link->linkTip();
+ TQString strtip = link->linkTip();
if ( !strtip.isEmpty() )
{
- QRect linkRect = object->geometry( pageItem->width(), pageItem->height() );
+ TQRect linkRect = object->geometry( pageItem->width(), pageItem->height() );
linkRect.moveBy( - m_view->contentsX() + pageItem->geometry().left(), - m_view->contentsY() + pageItem->geometry().top() );
tip( linkRect, strtip );
}
@@ -178,8 +178,8 @@ void PageViewTip::maybeTip( const QPoint &_p )
* other misc functions: only slotRequestVisiblePixmaps and pickItemOnPoint noticeable,
* and many insignificant stuff like this comment :-)
*/
-PageView::PageView( QWidget *parent, KPDFDocument *document )
- : QScrollView( parent, "KPDF::pageView", WStaticContents | WNoAutoErase )
+PageView::PageView( TQWidget *parent, KPDFDocument *document )
+ : TQScrollView( parent, "KPDF::pageView", WStaticContents | WNoAutoErase )
{
// create and initialize private storage structure
d = new PageViewPrivate();
@@ -215,11 +215,11 @@ PageView::PageView( QWidget *parent, KPDFDocument *document )
viewport()->setMouseTracking( true );
// conntect the padding of the viewport to pixmaps requests
- connect( this, SIGNAL(contentsMoving(int, int)), this, SLOT(slotRequestVisiblePixmaps(int, int)) );
- connect( &d->dragScrollTimer, SIGNAL(timeout()), this, SLOT(slotDragScroll()) );
+ connect( this, TQT_SIGNAL(contentsMoving(int, int)), this, TQT_SLOT(slotRequestVisiblePixmaps(int, int)) );
+ connect( &d->dragScrollTimer, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotDragScroll()) );
// set a corner button to resize the view to the page size
-// QPushButton * resizeButton = new QPushButton( viewport() );
+// TQPushButton * resizeButton = new TQPushButton( viewport() );
// resizeButton->setPixmap( SmallIcon("crop") );
// setCornerWidget( resizeButton );
// resizeButton->setEnabled( false );
@@ -227,13 +227,13 @@ PageView::PageView( QWidget *parent, KPDFDocument *document )
setInputMethodEnabled( true );
// schedule the welcome message
- QTimer::singleShot( 0, this, SLOT( slotShowWelcome() ) );
+ TQTimer::singleShot( 0, this, TQT_SLOT( slotShowWelcome() ) );
}
PageView::~PageView()
{
// delete all widgets
- QValueVector< PageViewItem * >::iterator dIt = d->items.begin(), dEnd = d->items.end();
+ TQValueVector< PageViewItem * >::iterator dIt = d->items.begin(), dEnd = d->items.end();
for ( ; dIt != dEnd; ++dIt )
delete *dIt;
delete d->tip;
@@ -245,63 +245,63 @@ PageView::~PageView()
void PageView::setupActions( KActionCollection * ac )
{
// Zoom actions ( higher scales takes lots of memory! )
- d->aZoom = new KSelectAction( i18n( "Zoom" ), "viewmag", 0, this, SLOT( slotZoom() ), ac, "zoom_to" );
+ d->aZoom = new KSelectAction( i18n( "Zoom" ), "viewmag", 0, this, TQT_SLOT( slotZoom() ), ac, "zoom_to" );
d->aZoom->setEditable( true );
#if KDE_IS_VERSION(3,4,89)
d->aZoom->setMaxComboViewCount( 13 );
#endif
updateZoomText();
- KStdAction::zoomIn( this, SLOT( slotZoomIn() ), ac, "zoom_in" );
+ KStdAction::zoomIn( this, TQT_SLOT( slotZoomIn() ), ac, "zoom_in" );
- KStdAction::zoomOut( this, SLOT( slotZoomOut() ), ac, "zoom_out" );
+ KStdAction::zoomOut( this, TQT_SLOT( slotZoomOut() ), ac, "zoom_out" );
d->aZoomFitWidth = new KToggleAction( i18n("Fit to Page &Width"), "view_fit_width", 0, ac, "zoom_fit_width" );
- connect( d->aZoomFitWidth, SIGNAL( toggled( bool ) ), SLOT( slotFitToWidthToggled( bool ) ) );
+ connect( d->aZoomFitWidth, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotFitToWidthToggled( bool ) ) );
d->aZoomFitPage = new KToggleAction( i18n("Fit to &Page"), "view_fit_window", 0, ac, "zoom_fit_page" );
- connect( d->aZoomFitPage, SIGNAL( toggled( bool ) ), SLOT( slotFitToPageToggled( bool ) ) );
+ connect( d->aZoomFitPage, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotFitToPageToggled( bool ) ) );
d->aZoomFitText = new KToggleAction( i18n("Fit to &Text"), "viewmagfit", 0, ac, "zoom_fit_text" );
- connect( d->aZoomFitText, SIGNAL( toggled( bool ) ), SLOT( slotFitToTextToggled( bool ) ) );
+ connect( d->aZoomFitText, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotFitToTextToggled( bool ) ) );
// rotate actions
KAction *action;
action = new KAction( i18n("Rotate Right"), "rotate_cw", KShortcut( "Ctrl+Shift++" ),
- this, SLOT( slotRotateRight() ), ac, "rotate_right" );
+ this, TQT_SLOT( slotRotateRight() ), ac, "rotate_right" );
action = new KAction( i18n("Rotate Left"), "rotate_ccw", KShortcut( "Ctrl+Shift+-" ),
- this, SLOT( slotRotateLeft() ), ac, "rotate_left" );
+ this, TQT_SLOT( slotRotateLeft() ), ac, "rotate_left" );
// View-Layout actions
d->aViewTwoPages = new KToggleAction( i18n("&Two Pages"), "view_left_right", 0, ac, "view_twopages" );
- connect( d->aViewTwoPages, SIGNAL( toggled( bool ) ), SLOT( slotTwoPagesToggled( bool ) ) );
+ connect( d->aViewTwoPages, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotTwoPagesToggled( bool ) ) );
d->aViewTwoPages->setChecked( KpdfSettings::viewColumns() > 1 );
d->aViewContinuous = new KToggleAction( i18n("&Continuous"), "view_text", 0, ac, "view_continuous" );
- connect( d->aViewContinuous, SIGNAL( toggled( bool ) ), SLOT( slotContinuousToggled( bool ) ) );
+ connect( d->aViewContinuous, TQT_SIGNAL( toggled( bool ) ), TQT_SLOT( slotContinuousToggled( bool ) ) );
d->aViewContinuous->setChecked( KpdfSettings::viewContinuous() );
// Mouse-Mode actions
- d->aMouseNormal = new KRadioAction( i18n("&Browse Tool"), "mouse", 0, this, SLOT( slotSetMouseNormal() ), ac, "mouse_drag" );
+ d->aMouseNormal = new KRadioAction( i18n("&Browse Tool"), "mouse", 0, this, TQT_SLOT( slotSetMouseNormal() ), ac, "mouse_drag" );
d->aMouseNormal->setExclusiveGroup( "MouseType" );
d->aMouseNormal->setChecked( true );
- KToggleAction * mz = new KRadioAction( i18n("&Zoom Tool"), "viewmag", 0, this, SLOT( slotSetMouseZoom() ), ac, "mouse_zoom" );
+ KToggleAction * mz = new KRadioAction( i18n("&Zoom Tool"), "viewmag", 0, this, TQT_SLOT( slotSetMouseZoom() ), ac, "mouse_zoom" );
mz->setExclusiveGroup( "MouseType" );
- d->aMouseSelect = new KRadioAction( i18n("&Select Tool"), "frame_edit", 0, this, SLOT( slotSetMouseSelect() ), ac, "mouse_select" );
+ d->aMouseSelect = new KRadioAction( i18n("&Select Tool"), "frame_edit", 0, this, TQT_SLOT( slotSetMouseSelect() ), ac, "mouse_select" );
d->aMouseSelect->setExclusiveGroup( "MouseType" );
-/* d->aMouseEdit = new KRadioAction( i18n("Draw"), "edit", 0, this, SLOT( slotSetMouseDraw() ), ac, "mouse_draw" );
+/* d->aMouseEdit = new KRadioAction( i18n("Draw"), "edit", 0, this, TQT_SLOT( slotSetMouseDraw() ), ac, "mouse_draw" );
d->aMouseEdit->setExclusiveGroup("MouseType");
d->aMouseEdit->setEnabled( false ); // implement feature before removing this line*/
// Other actions
- KAction * su = new KAction( i18n("Scroll Up"), 0, this, SLOT( slotScrollUp() ), ac, "view_scroll_up" );
+ KAction * su = new KAction( i18n("Scroll Up"), 0, this, TQT_SLOT( slotScrollUp() ), ac, "view_scroll_up" );
su->setShortcut( "Shift+Up" );
- KAction * sd = new KAction( i18n("Scroll Down"), 0, this, SLOT( slotScrollDown() ), ac, "view_scroll_down" );
+ KAction * sd = new KAction( i18n("Scroll Down"), 0, this, TQT_SLOT( slotScrollDown() ), ac, "view_scroll_down" );
sd->setShortcut( "Shift+Down" );
}
@@ -317,7 +317,7 @@ void PageView::fitPageWidth( int /*page*/ )
}
//BEGIN DocumentObserver inherited methods
-void PageView::notifySetup( const QValueVector< KPDFPage * > & pageSet, bool documentChanged )
+void PageView::notifySetup( const TQValueVector< KPDFPage * > & pageSet, bool documentChanged )
{
// reuse current pages if nothing new
if ( ( pageSet.count() == d->items.count() ) && !documentChanged )
@@ -331,14 +331,14 @@ void PageView::notifySetup( const QValueVector< KPDFPage * > & pageSet, bool doc
}
// delete all widgets (one for each page in pageSet)
- QValueVector< PageViewItem * >::iterator dIt = d->items.begin(), dEnd = d->items.end();
+ TQValueVector< PageViewItem * >::iterator dIt = d->items.begin(), dEnd = d->items.end();
for ( ; dIt != dEnd; ++dIt )
delete *dIt;
d->items.clear();
d->visibleItems.clear();
// create children widgets
- QValueVector< KPDFPage * >::const_iterator setIt = pageSet.begin(), setEnd = pageSet.end();
+ TQValueVector< KPDFPage * >::const_iterator setIt = pageSet.begin(), setEnd = pageSet.end();
for ( ; setIt != setEnd; ++setIt )
d->items.push_back( new PageViewItem( *setIt ) );
@@ -348,12 +348,12 @@ void PageView::notifySetup( const QValueVector< KPDFPage * > & pageSet, bool doc
// Need slotRelayoutPages() here instead of d->dirtyLayout = true
// because opening a pdf from another pdf will not trigger a viewportchange
// so pages are never relayouted
- QTimer::singleShot(0, this, SLOT(slotRelayoutPages()));
+ TQTimer::singleShot(0, this, TQT_SLOT(slotRelayoutPages()));
else
{
// update the mouse cursor when closing because we may have close through a link and
// want the cursor to come back to the normal cursor
- updateCursor( viewportToContents( mapFromGlobal( QCursor::pos() ) ) );
+ updateCursor( viewportToContents( mapFromGlobal( TQCursor::pos() ) ) );
resizeContents( 0, 0 );
}
@@ -378,7 +378,7 @@ void PageView::notifyViewportChanged( bool smoothMove )
// find PageViewItem matching the viewport description
const DocumentViewport & vp = d->document->viewport();
PageViewItem * item = 0;
- QValueVector< PageViewItem * >::iterator iIt = d->items.begin(), iEnd = d->items.end();
+ TQValueVector< PageViewItem * >::iterator iIt = d->items.begin(), iEnd = d->items.end();
for ( ; iIt != iEnd; ++iIt )
if ( (*iIt)->pageNumber() == vp.pageNumber )
{
@@ -398,7 +398,7 @@ void PageView::notifyViewportChanged( bool smoothMove )
slotRelayoutPages();
// restore viewport center or use default {x-center,v-top} alignment
- const QRect & r = item->geometry();
+ const TQRect & r = item->geometry();
int newCenterX = r.left(),
newCenterY = r.top();
if ( vp.rePos.enabled )
@@ -430,9 +430,9 @@ void PageView::notifyViewportChanged( bool smoothMove )
d->viewportMoveDest.setY( newCenterY );
if ( !d->viewportMoveTimer )
{
- d->viewportMoveTimer = new QTimer( this );
- connect( d->viewportMoveTimer, SIGNAL( timeout() ),
- this, SLOT( slotMoveViewport() ) );
+ d->viewportMoveTimer = new TQTimer( this );
+ connect( d->viewportMoveTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( slotMoveViewport() ) );
}
d->viewportMoveTimer->start( 25 );
verticalScrollBar()->setEnabled( false );
@@ -453,7 +453,7 @@ void PageView::notifyViewportChanged( bool smoothMove )
updateZoomText();
// since the page has moved below cursor, update it
- updateCursor( viewportToContents( mapFromGlobal( QCursor::pos() ) ) );
+ updateCursor( viewportToContents( mapFromGlobal( TQCursor::pos() ) ) );
}
void PageView::notifyPageChanged( int pageNumber, int changedFlags )
@@ -463,12 +463,12 @@ void PageView::notifyPageChanged( int pageNumber, int changedFlags )
return;
// iterate over visible items: if page(pageNumber) is one of them, repaint it
- QValueList< PageViewItem * >::iterator iIt = d->visibleItems.begin(), iEnd = d->visibleItems.end();
+ TQValueList< PageViewItem * >::iterator iIt = d->visibleItems.begin(), iEnd = d->visibleItems.end();
for ( ; iIt != iEnd; ++iIt )
if ( (*iIt)->pageNumber() == pageNumber )
{
// update item's rectangle plus the little outline
- QRect expandedRect = (*iIt)->geometry();
+ TQRect expandedRect = (*iIt)->geometry();
expandedRect.addCoords( -1, -1, 3, 3 );
updateContents( expandedRect );
@@ -476,7 +476,7 @@ void PageView::notifyPageChanged( int pageNumber, int changedFlags )
if ( cursor().shape() != Qt::SizeVerCursor )
{
// since the page has been regenerated below cursor, update it
- updateCursor( viewportToContents( mapFromGlobal( QCursor::pos() ) ) );
+ updateCursor( viewportToContents( mapFromGlobal( TQCursor::pos() ) ) );
}
break;
}
@@ -492,7 +492,7 @@ void PageView::notifyContentsCleared( int changedFlags )
bool PageView::canUnloadPixmap( int pageNumber )
{
// if the item is visible, forbid unloading
- QValueList< PageViewItem * >::iterator vIt = d->visibleItems.begin(), vEnd = d->visibleItems.end();
+ TQValueList< PageViewItem * >::iterator vIt = d->visibleItems.begin(), vEnd = d->visibleItems.end();
for ( ; vIt != vEnd; ++vIt )
if ( (*vIt)->pageNumber() == pageNumber )
return false;
@@ -502,47 +502,47 @@ bool PageView::canUnloadPixmap( int pageNumber )
//END DocumentObserver inherited methods
-void PageView::showText( const QString &text, int ms )
+void PageView::showText( const TQString &text, int ms )
{
d->messageWindow->display(text, PageViewMessage::Info, ms );
}
//BEGIN widget events
-void PageView::viewportPaintEvent( QPaintEvent * pe )
+void PageView::viewportPaintEvent( TQPaintEvent * pe )
{
// create the rect into contents from the clipped screen rect
- QRect viewportRect = viewport()->rect();
- QRect contentsRect = pe->rect().intersect( viewportRect );
+ TQRect viewportRect = viewport()->rect();
+ TQRect contentsRect = pe->rect().intersect( viewportRect );
contentsRect.moveBy( contentsX(), contentsY() );
if ( !contentsRect.isValid() )
return;
// create the screen painter. a pixel painted ar contentsX,contentsY
// appears to the top-left corner of the scrollview.
- QPainter screenPainter( viewport(), true );
+ TQPainter screenPainter( viewport(), true );
screenPainter.translate( -contentsX(), -contentsY() );
// selectionRect is the normalized mouse selection rect
- QRect selectionRect = d->mouseSelectionRect;
+ TQRect selectionRect = d->mouseSelectionRect;
if ( !selectionRect.isNull() )
selectionRect = selectionRect.normalize();
// selectionRectInternal without the border
- QRect selectionRectInternal = selectionRect;
+ TQRect selectionRectInternal = selectionRect;
selectionRectInternal.addCoords( 1, 1, -1, -1 );
// color for blending
- QColor selBlendColor = (selectionRect.width() > 8 || selectionRect.height() > 8) ?
+ TQColor selBlendColor = (selectionRect.width() > 8 || selectionRect.height() > 8) ?
d->selectionRectColor : Qt::red;
// subdivide region into rects
- QMemArray<QRect> allRects = pe->region().rects();
+ TQMemArray<TQRect> allRects = pe->region().rects();
uint numRects = allRects.count();
// preprocess rects area to see if it worths or not using subdivision
uint summedArea = 0;
for ( uint i = 0; i < numRects; i++ )
{
- const QRect & r = allRects[i];
+ const TQRect & r = allRects[i];
summedArea += r.width() * r.height();
}
// very elementary check: SUMj(Region[j].area) is less than boundingRect.area
@@ -568,8 +568,8 @@ void PageView::viewportPaintEvent( QPaintEvent * pe )
if ( wantCompositing && KpdfSettings::enableCompositing() )
{
// create pixmap and open a painter over it (contents{left,top} becomes pixmap {0,0})
- QPixmap doubleBuffer( contentsRect.size() );
- QPainter pixmapPainter( &doubleBuffer );
+ TQPixmap doubleBuffer( contentsRect.size() );
+ TQPainter pixmapPainter( &doubleBuffer );
pixmapPainter.translate( -contentsRect.left(), -contentsRect.top() );
// 1) Layer 0: paint items and clear bg on unpainted rects
@@ -579,17 +579,17 @@ void PageView::viewportPaintEvent( QPaintEvent * pe )
if ( !selectionRect.isNull() && selectionRect.intersects( contentsRect ) &&
!selectionRectInternal.contains( contentsRect ) )
{
- QRect blendRect = selectionRectInternal.intersect( contentsRect );
+ TQRect blendRect = selectionRectInternal.intersect( contentsRect );
// skip rectangles covered by the selection's border
if ( blendRect.isValid() )
{
// grab current pixmap into a new one to colorize contents
- QPixmap blendedPixmap( blendRect.width(), blendRect.height() );
+ TQPixmap blendedPixmap( blendRect.width(), blendRect.height() );
copyBlt( &blendedPixmap, 0,0, &doubleBuffer,
blendRect.left() - contentsRect.left(), blendRect.top() - contentsRect.top(),
blendRect.width(), blendRect.height() );
// blend selBlendColor into the background pixmap
- QImage blendedImage = blendedPixmap.convertToImage();
+ TQImage blendedImage = blendedPixmap.convertToImage();
KImageEffect::blend( selBlendColor.dark(140), blendedImage, 0.2 );
// copy the blended pixmap back to its place
pixmapPainter.drawPixmap( blendRect.left(), blendRect.top(), blendedImage );
@@ -631,18 +631,18 @@ void PageView::viewportPaintEvent( QPaintEvent * pe )
}
}
-void PageView::viewportResizeEvent( QResizeEvent * )
+void PageView::viewportResizeEvent( TQResizeEvent * )
{
// start a timer that will refresh the pixmap after 0.5s
if ( !d->delayResizeTimer )
{
- d->delayResizeTimer = new QTimer( this );
- connect( d->delayResizeTimer, SIGNAL( timeout() ), this, SLOT( slotRelayoutPages() ) );
+ d->delayResizeTimer = new TQTimer( this );
+ connect( d->delayResizeTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotRelayoutPages() ) );
}
d->delayResizeTimer->start( 333, true );
}
-void PageView::keyPressEvent( QKeyEvent * e )
+void PageView::keyPressEvent( TQKeyEvent * e )
{
e->accept();
@@ -661,7 +661,7 @@ void PageView::keyPressEvent( QKeyEvent * e )
d->typeAheadString = d->typeAheadString.left( d->typeAheadString.length() - 1 );
bool found = d->document->searchText( PAGEVIEW_SEARCH_ID, d->typeAheadString, true, false,
KPDFDocument::NextMatch, true, qRgb( 128, 255, 128 ), true );
- QString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\".");
+ TQString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\".");
d->messageWindow->display( status.arg(d->typeAheadString.lower()),
found ? PageViewMessage::Find : PageViewMessage::Warning, 4000 );
d->findTimeoutTimer->start( 3000, true );
@@ -712,14 +712,14 @@ void PageView::keyPressEvent( QKeyEvent * e )
d->autoScrollTimer->stop();
}
// start type-adeas search
- d->typeAheadString = QString();
+ d->typeAheadString = TQString();
d->messageWindow->display( i18n("Starting -- find text as you type"), PageViewMessage::Find, 3000 );
d->typeAheadActive = true;
if ( !d->findTimeoutTimer )
{
// create the timer on demand
- d->findTimeoutTimer = new QTimer( this );
- connect( d->findTimeoutTimer, SIGNAL( timeout() ), this, SLOT( findAheadStop() ) );
+ d->findTimeoutTimer = new TQTimer( this );
+ connect( d->findTimeoutTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( findAheadStop() ) );
}
d->findTimeoutTimer->start( 3000, true );
// it is needed to grab the keyboard becase people may have Space assigned to a
@@ -786,7 +786,7 @@ void PageView::keyPressEvent( QKeyEvent * e )
break;
case Qt::Key_Escape:
selectionClear();
- d->mousePressPos = QPoint();
+ d->mousePressPos = TQPoint();
if ( d->aPrevAction )
{
d->aPrevAction->activate();
@@ -816,7 +816,7 @@ void PageView::keyPressEvent( QKeyEvent * e )
}
}
-void PageView::imEndEvent( QIMEvent * e )
+void PageView::imEndEvent( TQIMEvent * e )
{
if( d->typeAheadActive )
{
@@ -829,7 +829,7 @@ void PageView::imEndEvent( QIMEvent * e )
}
}
-void PageView::contentsMouseMoveEvent( QMouseEvent * e )
+void PageView::contentsMouseMoveEvent( TQMouseEvent * e )
{
// don't perform any mouse action when no document is shown
if ( d->items.isEmpty() )
@@ -862,7 +862,7 @@ void PageView::contentsMouseMoveEvent( QMouseEvent * e )
if ( !d->mouseGrabPos.isNull() )
{
// scroll page by position increment
- QPoint delta = d->mouseGrabPos - e->globalPos();
+ TQPoint delta = d->mouseGrabPos - e->globalPos();
scrollBy( delta.x(), delta.y() );
d->mouseGrabPos = e->globalPos();
}
@@ -876,7 +876,7 @@ void PageView::contentsMouseMoveEvent( QMouseEvent * e )
{
d->aPrevAction = d->aMouseNormal;
d->aMouseSelect->activate();
- QColor selColor = palette().active().highlight().light( 120 );
+ TQColor selColor = palette().active().highlight().light( 120 );
selectionStart( e->x() + deltaX, e->y() + deltaY, selColor, false );
selectionEndPoint( e->x(), e->y() );
break;
@@ -901,7 +901,7 @@ void PageView::contentsMouseMoveEvent( QMouseEvent * e )
}
}
-void PageView::contentsMousePressEvent( QMouseEvent * e )
+void PageView::contentsMousePressEvent( TQMouseEvent * e )
{
// don't perform any mouse action when no document is shown
if ( d->items.isEmpty() )
@@ -938,7 +938,7 @@ void PageView::contentsMousePressEvent( QMouseEvent * e )
case MouseNormal: // drag start / click / link following
if ( leftButton )
{
- d->mouseGrabPos = d->mouseOnRect ? QPoint() : d->mousePressPos;
+ d->mouseGrabPos = d->mouseOnRect ? TQPoint() : d->mousePressPos;
if ( !d->mouseOnRect )
setCursor( KCursor::sizeAllCursor() );
}
@@ -954,7 +954,7 @@ void PageView::contentsMousePressEvent( QMouseEvent * e )
case MouseSelect: // set first corner of the selection rect
if ( leftButton )
{
- QColor selColor = palette().active().highlight().light( 120 );
+ TQColor selColor = palette().active().highlight().light( 120 );
selectionStart( e->x(), e->y(), selColor, false );
}
break;
@@ -964,7 +964,7 @@ void PageView::contentsMousePressEvent( QMouseEvent * e )
}
}
-void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
+void PageView::contentsMouseReleaseEvent( TQMouseEvent * e )
{
// stop the drag scrolling
d->dragScrollTimer.stop();
@@ -1044,7 +1044,7 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
// if a selection rect has been defined, zoom into it
if ( leftButton && !d->mouseSelectionRect.isNull() )
{
- QRect selRect = d->mouseSelectionRect.normalize();
+ TQRect selRect = d->mouseSelectionRect.normalize();
if ( selRect.width() <= 8 && selRect.height() <= 8 )
{
selectionClear();
@@ -1087,7 +1087,7 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
d->mouseSelectionRect.isNull() )
break;
- QRect selectionRect = d->mouseSelectionRect.normalize();
+ TQRect selectionRect = d->mouseSelectionRect.normalize();
if ( selectionRect.width() <= 8 && selectionRect.height() <= 8 )
{
selectionClear();
@@ -1100,12 +1100,12 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
}
// grab text in selection by extracting it from all intersected pages
- QString selectedText;
- QValueVector< PageViewItem * >::iterator iIt = d->items.begin(), iEnd = d->items.end();
+ TQString selectedText;
+ TQValueVector< PageViewItem * >::iterator iIt = d->items.begin(), iEnd = d->items.end();
for ( ; iIt != iEnd; ++iIt )
{
PageViewItem * item = *iIt;
- const QRect & itemRect = item->geometry();
+ const TQRect & itemRect = item->geometry();
if ( selectionRect.intersects( itemRect ) )
{
// request the textpage if there isn't one
@@ -1113,7 +1113,7 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
if ( !kpdfPage->hasSearchPage() )
d->document->requestTextPage( kpdfPage->number() );
// grab text in the rect that intersects itemRect
- QRect relativeRect = selectionRect.intersect( itemRect );
+ TQRect relativeRect = selectionRect.intersect( itemRect );
relativeRect.moveBy( -itemRect.left(), -itemRect.top() );
NormalizedRect normRect( relativeRect, item->width(), item->height() );
selectedText += kpdfPage->getText( normRect );
@@ -1139,15 +1139,15 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
if ( choice > 2 )
{
// renders page into a pixmap
- QPixmap copyPix( selectionRect.width(), selectionRect.height() );
- QPainter copyPainter( &copyPix );
+ TQPixmap copyPix( selectionRect.width(), selectionRect.height() );
+ TQPainter copyPainter( &copyPix );
copyPainter.translate( -selectionRect.left(), -selectionRect.top() );
paintItems( &copyPainter, selectionRect );
if ( choice == 3 )
{
// [2] copy pixmap to clipboard
- QClipboard *cb = QApplication::clipboard();
+ QClipboard *cb = TQApplication::clipboard();
cb->setPixmap( copyPix, QClipboard::Clipboard );
if ( cb->supportsSelection() )
cb->setPixmap( copyPix, QClipboard::Selection );
@@ -1156,12 +1156,12 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
else if ( choice == 4 )
{
// [3] save pixmap to file
- QString fileName = KFileDialog::getSaveFileName( QString::null, "image/png image/jpeg", this );
+ TQString fileName = KFileDialog::getSaveFileName( TQString::null, "image/png image/jpeg", this );
if ( fileName.isNull() )
d->messageWindow->display( i18n( "File not saved." ), PageViewMessage::Warning );
else
{
- QString type( KImageIO::type( fileName ) );
+ TQString type( KImageIO::type( fileName ) );
if ( type.isNull() )
type = "PNG";
copyPix.save( fileName, type.latin1() );
@@ -1175,7 +1175,7 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
if ( choice == 1 )
{
// [1] copy text to clipboard
- QClipboard *cb = QApplication::clipboard();
+ QClipboard *cb = TQApplication::clipboard();
cb->setText( selectedText, QClipboard::Clipboard );
if ( cb->supportsSelection() )
cb->setText( selectedText, QClipboard::Selection );
@@ -1191,8 +1191,8 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
// If KTTSD not running, start it.
if (!client->isApplicationRegistered("kttsd"))
{
- QString error;
- if (KApplication::startServiceByDesktopName("kttsd", QStringList(), &error))
+ TQString error;
+ if (KApplication::startServiceByDesktopName("kttsd", TQStringList(), &error))
{
d->messageWindow->display( i18n("Starting KTTSD Failed: %1").arg(error) );
KpdfSettings::setUseKTTSD(false);
@@ -1203,17 +1203,17 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
{
// serialize the text to speech (selectedText) and the
// preferred reader ("" is the default voice) ...
- QByteArray data;
- QDataStream arg( data, IO_WriteOnly );
+ TQByteArray data;
+ TQDataStream arg( data, IO_WriteOnly );
arg << selectedText;
- arg << QString();
- QCString replyType;
- QByteArray replyData;
+ arg << TQString();
+ TQCString replyType;
+ TQByteArray replyData;
// ..and send it to KTTSD
- if (client->call( "kttsd", "KSpeech", "setText(QString,QString)", data, replyType, replyData, true ))
+ if (client->call( "kttsd", "KSpeech", "setText(TQString,TQString)", data, replyType, replyData, true ))
{
- QByteArray data2;
- QDataStream arg2(data2, IO_WriteOnly);
+ TQByteArray data2;
+ TQDataStream arg2(data2, IO_WriteOnly);
arg2 << 0;
client->send("kttsd", "KSpeech", "startText(uint)", data2 );
}
@@ -1237,10 +1237,10 @@ void PageView::contentsMouseReleaseEvent( QMouseEvent * e )
}
// reset mouse press / 'drag start' position
- d->mousePressPos = QPoint();
+ d->mousePressPos = TQPoint();
}
-void PageView::wheelEvent( QWheelEvent *e )
+void PageView::wheelEvent( TQWheelEvent *e )
{
// don't perform any mouse action when viewport is autoscrolling
if ( d->viewportMoveActive )
@@ -1248,7 +1248,7 @@ void PageView::wheelEvent( QWheelEvent *e )
if ( !d->document->isOpened() )
{
- QScrollView::wheelEvent( e );
+ TQScrollView::wheelEvent( e );
return;
}
@@ -1288,18 +1288,18 @@ void PageView::wheelEvent( QWheelEvent *e )
}
}
else
- QScrollView::wheelEvent( e );
+ TQScrollView::wheelEvent( e );
- QPoint cp = viewportToContents(e->pos());
+ TQPoint cp = viewportToContents(e->pos());
updateCursor(cp);
}
-void PageView::dragEnterEvent( QDragEnterEvent * ev )
+void PageView::dragEnterEvent( TQDragEnterEvent * ev )
{
ev->accept();
}
-void PageView::dropEvent( QDropEvent * ev )
+void PageView::dropEvent( TQDropEvent * ev )
{
KURL::List lst;
if ( KURLDrag::decode( ev, lst ) )
@@ -1307,19 +1307,19 @@ void PageView::dropEvent( QDropEvent * ev )
}
//END widget events
-void PageView::paintItems( QPainter * p, const QRect & contentsRect )
+void PageView::paintItems( TQPainter * p, const TQRect & contentsRect )
{
// when checking if an Item is contained in contentsRect, instead of
// growing PageViewItems rects (for keeping outline into account), we
// grow the contentsRect
- QRect checkRect = contentsRect;
+ TQRect checkRect = contentsRect;
checkRect.addCoords( -3, -3, 1, 1 );
// create a region from wich we'll subtract painted rects
- QRegion remainingArea( contentsRect );
+ TQRegion remainingArea( contentsRect );
- //QValueVector< PageViewItem * >::iterator iIt = d->visibleItems.begin(), iEnd = d->visibleItems.end();
- QValueVector< PageViewItem * >::iterator iIt = d->items.begin(), iEnd = d->items.end();
+ //TQValueVector< PageViewItem * >::iterator iIt = d->visibleItems.begin(), iEnd = d->visibleItems.end();
+ TQValueVector< PageViewItem * >::iterator iIt = d->items.begin(), iEnd = d->items.end();
for ( ; iIt != iEnd; ++iIt )
{
// check if a piece of the page intersects the contents rect
@@ -1327,14 +1327,14 @@ void PageView::paintItems( QPainter * p, const QRect & contentsRect )
continue;
PageViewItem * item = *iIt;
- QRect pixmapGeometry = item->geometry();
+ TQRect pixmapGeometry = item->geometry();
// translate the painter so we draw top-left pixmap corner in 0,0
p->save();
p->translate( pixmapGeometry.left(), pixmapGeometry.top() );
// item pixmap and outline geometry
- QRect outlineGeometry = pixmapGeometry;
+ TQRect outlineGeometry = pixmapGeometry;
outlineGeometry.addCoords( -1, -1, 3, 3 );
// draw the page outline (little black border and 2px shadow)
@@ -1352,7 +1352,7 @@ void PageView::paintItems( QPainter * p, const QRect & contentsRect )
b = Qt::gray.blue() / (levels + 2);
for ( int i = 0; i < levels; i++ )
{
- p->setPen( QColor( r * (i+2), g * (i+2), b * (i+2) ) );
+ p->setPen( TQColor( r * (i+2), g * (i+2), b * (i+2) ) );
p->drawLine( i, i + pixmapHeight + 1, i + pixmapWidth + 1, i + pixmapHeight + 1 );
p->drawLine( i + pixmapWidth + 1, i, i + pixmapWidth + 1, i + pixmapHeight );
p->setPen( Qt::gray );
@@ -1364,7 +1364,7 @@ void PageView::paintItems( QPainter * p, const QRect & contentsRect )
// draw the pixmap (note: this modifies the painter)
if ( contentsRect.intersects( pixmapGeometry ) )
{
- QRect pixmapRect = contentsRect.intersect( pixmapGeometry );
+ TQRect pixmapRect = contentsRect.intersect( pixmapGeometry );
pixmapRect.moveBy( -pixmapGeometry.left(), -pixmapGeometry.top() );
int flags = PagePainter::Accessibility | PagePainter::EnhanceLinks |
PagePainter::EnhanceImages | PagePainter::Highlights;
@@ -1378,7 +1378,7 @@ void PageView::paintItems( QPainter * p, const QRect & contentsRect )
}
// paint with background color the unpainted area
- QMemArray<QRect> backRects = remainingArea.rects();
+ TQMemArray<TQRect> backRects = remainingArea.rects();
uint backRectsNumber = backRects.count();
for ( uint jr = 0; jr < backRectsNumber; jr++ )
p->fillRect( backRects[ jr ], Qt::gray );
@@ -1420,11 +1420,11 @@ void PageView::updateItemSize( PageViewItem * item, int colWidth, int rowHeight
PageViewItem * PageView::pickItemOnPoint( int x, int y )
{
PageViewItem * item = 0;
- QValueList< PageViewItem * >::iterator iIt = d->visibleItems.begin(), iEnd = d->visibleItems.end();
+ TQValueList< PageViewItem * >::iterator iIt = d->visibleItems.begin(), iEnd = d->visibleItems.end();
for ( ; iIt != iEnd; ++iIt )
{
PageViewItem * i = *iIt;
- const QRect & r = i->geometry();
+ const TQRect & r = i->geometry();
if ( x < r.right() && x > r.left() && y < r.bottom() )
{
if ( y > r.top() )
@@ -1435,7 +1435,7 @@ PageViewItem * PageView::pickItemOnPoint( int x, int y )
return item;
}
-void PageView::selectionStart( int x, int y, const QColor & color, bool /*aboveAll*/ )
+void PageView::selectionStart( int x, int y, const TQColor & color, bool /*aboveAll*/ )
{
d->mouseSelectionRect.setRect( x, y, 1, 1 );
d->selectionRectColor = color;
@@ -1457,35 +1457,35 @@ void PageView::selectionEndPoint( int x, int y )
else if (contentsY() + viewport()->height() < y) d->dragScrollVector.setY(y - contentsY() - viewport()->height());
else d->dragScrollVector.setY(0);
- if (d->dragScrollVector != QPoint(0, 0))
+ if (d->dragScrollVector != TQPoint(0, 0))
{
if (!d->dragScrollTimer.isActive()) d->dragScrollTimer.start(100);
}
else d->dragScrollTimer.stop();
// clip selection to the viewport
- QRect viewportRect( contentsX(), contentsY(), visibleWidth(), visibleHeight() );
+ TQRect viewportRect( contentsX(), contentsY(), visibleWidth(), visibleHeight() );
x = QMAX( QMIN( x, viewportRect.right() ), viewportRect.left() );
y = QMAX( QMIN( y, viewportRect.bottom() ), viewportRect.top() );
// if selection changed update rect
if ( d->mouseSelectionRect.right() != x || d->mouseSelectionRect.bottom() != y )
{
// send incremental paint events
- QRect oldRect = d->mouseSelectionRect.normalize();
+ TQRect oldRect = d->mouseSelectionRect.normalize();
d->mouseSelectionRect.setRight( x );
d->mouseSelectionRect.setBottom( y );
- QRect newRect = d->mouseSelectionRect.normalize();
+ TQRect newRect = d->mouseSelectionRect.normalize();
// generate diff region: [ OLD.unite(NEW) - OLD.intersect(NEW) ]
- QRegion compoundRegion = QRegion( oldRect ).unite( newRect );
+ TQRegion compoundRegion = TQRegion( oldRect ).unite( newRect );
if ( oldRect.intersects( newRect ) )
{
- QRect intersection = oldRect.intersect( newRect );
+ TQRect intersection = oldRect.intersect( newRect );
intersection.addCoords( 1, 1, -1, -1 );
if ( intersection.width() > 20 && intersection.height() > 20 )
compoundRegion -= intersection;
}
// tassellate region with rects and enqueue paint events
- QMemArray<QRect> rects = compoundRegion.rects();
+ TQMemArray<TQRect> rects = compoundRegion.rects();
for ( uint i = 0; i < rects.count(); i++ )
updateContents( rects[i] );
}
@@ -1512,7 +1512,7 @@ void PageView::updateZoom( ZoomMode newZoomMode )
switch ( newZoomMode )
{
case ZoomFixed:{ //ZoomFixed case
- QString z = d->aZoom->currentText();
+ TQString z = d->aZoom->currentText();
newFactor = KGlobal::locale()->readNumber( z.remove( z.find( '%' ), 1 ) ) / 100.0;
}break;
case ZoomIn:
@@ -1577,11 +1577,11 @@ void PageView::updateZoomText()
d->aZoom->clear();
// add items that describe fit actions
- QStringList translated;
+ TQStringList translated;
translated << i18n("Fit Width") << i18n("Fit Page"); // << i18n("Fit Text");
// add percent items
- QString double_oh( "00" );
+ TQString double_oh( "00" );
const float zoomValue[10] = { 0.125, 0.25, 0.333, 0.5, 0.667, 0.75, 1, 1.25, 1.50, 2 };
int idx = 0,
selIdx = 2; // use 3 if "fit text" present
@@ -1597,9 +1597,9 @@ void PageView::updateZoomText()
inserted = true;
if ( !inserted )
selIdx++;
- QString localValue( KGlobal::locale()->formatNumber( value * 100.0, 2 ) );
+ TQString localValue( KGlobal::locale()->formatNumber( value * 100.0, 2 ) );
localValue.remove( KGlobal::locale()->decimalSymbol() + double_oh );
- translated << QString( "%1%" ).arg( localValue );
+ translated << TQString( "%1%" ).arg( localValue );
}
d->aZoom->setItems( translated );
@@ -1613,7 +1613,7 @@ void PageView::updateZoomText()
d->aZoom->setCurrentItem( selIdx );
}
-void PageView::updateCursor( const QPoint &p )
+void PageView::updateCursor( const TQPoint &p )
{
// detect the underlaying page (if present)
PageViewItem * pageItem = pickItemOnPoint( p.x(), p.y() );
@@ -1642,7 +1642,7 @@ void PageView::doTypeAheadSearch()
{
bool found = d->document->searchText( PAGEVIEW_SEARCH_ID, d->typeAheadString, false, false,
KPDFDocument::NextMatch, true, qRgb( 128, 255, 128 ), true );
- QString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\".");
+ TQString status = found ? i18n("Text found: \"%1\".") : i18n("Text not found: \"%1\".");
d->messageWindow->display( status.arg(d->typeAheadString.lower()),
found ? PageViewMessage::Find : PageViewMessage::Warning, 4000 );
d->findTimeoutTimer->start( 3000, true );
@@ -1670,12 +1670,12 @@ void PageView::slotRelayoutPages()
}
// common iterator used in this method and viewport parameters
- QValueVector< PageViewItem * >::iterator iIt, iEnd = d->items.end();
+ TQValueVector< PageViewItem * >::iterator iIt, iEnd = d->items.end();
int viewportWidth = visibleWidth(),
viewportHeight = visibleHeight(),
fullWidth = 0,
fullHeight = 0;
- QRect viewportRect( contentsX(), contentsY(), viewportWidth, viewportHeight );
+ TQRect viewportRect( contentsX(), contentsY(), viewportWidth, viewportHeight );
// set all items geometry and resize contents. handle 'continuous' and 'single' modes separately
if ( KpdfSettings::viewContinuous() )
@@ -1816,7 +1816,7 @@ void PageView::slotRelayoutPages()
{
int prevX = contentsX(),
prevY = contentsY();
- const QRect & geometry = d->items[ vp.pageNumber ]->geometry();
+ const TQRect & geometry = d->items[ vp.pageNumber ]->geometry();
double nX = vp.rePos.enabled ? vp.rePos.normalizedX : 0.5,
nY = vp.rePos.enabled ? vp.rePos.normalizedY : 0.0;
center( geometry.left() + ROUND( nX * (double)geometry.width() ),
@@ -1846,7 +1846,7 @@ void PageView::slotRequestVisiblePixmaps( int newLeft, int newTop )
// precalc view limits for intersecting with page coords inside the lOOp
bool isEvent = newLeft != -1 && newTop != -1 && !d->blockViewport;
- QRect viewportRect( isEvent ? newLeft : contentsX(),
+ TQRect viewportRect( isEvent ? newLeft : contentsX(),
isEvent ? newTop : contentsY(),
visibleWidth(), visibleHeight() );
@@ -1860,8 +1860,8 @@ void PageView::slotRequestVisiblePixmaps( int newLeft, int newTop )
// iterate over all items
d->visibleItems.clear();
- QValueList< PixmapRequest * > requestedPixmaps;
- QValueVector< PageViewItem * >::iterator iIt = d->items.begin(), iEnd = d->items.end();
+ TQValueList< PixmapRequest * > requestedPixmaps;
+ TQValueVector< PageViewItem * >::iterator iIt = d->items.begin(), iEnd = d->items.end();
for ( ; iIt != iEnd; ++iIt )
{
PageViewItem * i = *iIt;
@@ -1885,7 +1885,7 @@ void PageView::slotRequestVisiblePixmaps( int newLeft, int newTop )
// position between the item and the viewport center
if ( isEvent )
{
- const QRect & geometry = i->geometry();
+ const TQRect & geometry = i->geometry();
// compute distance between item center and viewport center
double distance = hypot( (geometry.left() + geometry.right()) / 2 - viewportCenterX,
(geometry.top() + geometry.bottom()) / 2 - viewportCenterY );
@@ -1980,8 +1980,8 @@ void PageView::slotAutoScoll()
// the first time create the timer
if ( !d->autoScrollTimer )
{
- d->autoScrollTimer = new QTimer( this );
- connect( d->autoScrollTimer, SIGNAL( timeout() ), this, SLOT( slotAutoScoll() ) );
+ d->autoScrollTimer = new TQTimer( this );
+ connect( d->autoScrollTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotAutoScoll() ) );
}
// if scrollIncrement is zero, stop the timer
@@ -2002,7 +2002,7 @@ void PageView::slotAutoScoll()
void PageView::slotDragScroll()
{
scrollBy(d->dragScrollVector.x(), d->dragScrollVector.y());
- QPoint p = viewportToContents( mapFromGlobal( QCursor::pos() ) );
+ TQPoint p = viewportToContents( mapFromGlobal( TQCursor::pos() ) );
selectionEndPoint( p.x(), p.y() );
}
@@ -2058,7 +2058,7 @@ void PageView::slotRotateRight()
{
d->rotation = ( d->rotation + 90 ) % 360;
- QValueVector< PageViewItem * >::iterator iIt = d->items.begin(), iEnd = d->items.end();
+ TQValueVector< PageViewItem * >::iterator iIt = d->items.begin(), iEnd = d->items.end();
for ( ; iIt != iEnd; ++iIt )
{
int r = const_cast<KPDFPage*>((*iIt)->page())->rotation();
@@ -2081,7 +2081,7 @@ void PageView::slotRotateLeft()
d->rotation -= 90;
if ( d->rotation < 0 ) d->rotation += 360;
- QValueVector< PageViewItem * >::iterator iIt = d->items.begin(), iEnd = d->items.end();
+ TQValueVector< PageViewItem * >::iterator iIt = d->items.begin(), iEnd = d->items.end();
for ( ; iIt != iEnd; ++iIt )
{
int r = const_cast<KPDFPage*>((*iIt)->page())->rotation();
diff --git a/kpdf/ui/pageview.h b/kpdf/ui/pageview.h
index be082bd4..3742e804 100644
--- a/kpdf/ui/pageview.h
+++ b/kpdf/ui/pageview.h
@@ -19,8 +19,8 @@
#ifndef _KPDF_PAGEVIEW_H_
#define _KPDF_PAGEVIEW_H_
-#include <qscrollview.h>
-#include <qvaluevector.h>
+#include <tqscrollview.h>
+#include <tqvaluevector.h>
#include "core/observer.h"
class KURL;
@@ -36,14 +36,14 @@ class PageViewTip;
* @short display of course :-)
* ...
*/
-class PageView : public QScrollView, public DocumentObserver
+class PageView : public TQScrollView, public DocumentObserver
{
Q_OBJECT
friend class PageViewTip;
public:
- PageView( QWidget *parent, KPDFDocument *document );
+ PageView( TQWidget *parent, KPDFDocument *document );
~PageView();
// Zoom mode ( last 4 are internally used only! )
@@ -60,44 +60,44 @@ class PageView : public QScrollView, public DocumentObserver
// inherited from DocumentObserver
uint observerId() const { return PAGEVIEW_ID; }
- void notifySetup( const QValueVector< KPDFPage * > & pages, bool documentChanged );
+ void notifySetup( const TQValueVector< KPDFPage * > & pages, bool documentChanged );
void notifyViewportChanged( bool smoothMove );
void notifyPageChanged( int pageNumber, int changedFlags );
void notifyContentsCleared( int changedFlags );
bool canUnloadPixmap( int pageNum );
- void showText( const QString &text, int ms );
+ void showText( const TQString &text, int ms );
signals:
void urlDropped( const KURL& );
- void rightClick( const KPDFPage *, const QPoint & );
+ void rightClick( const KPDFPage *, const TQPoint & );
protected:
// main draw loop, draws pageViews on viewport
- void viewportPaintEvent( QPaintEvent * pe );
- void viewportResizeEvent( QResizeEvent* );
+ void viewportPaintEvent( TQPaintEvent * pe );
+ void viewportResizeEvent( TQResizeEvent* );
// mouse / keyboard events
- void keyPressEvent( QKeyEvent* );
- void imEndEvent( QIMEvent * );
- void contentsMouseMoveEvent( QMouseEvent* );
- void contentsMousePressEvent( QMouseEvent* );
- void contentsMouseReleaseEvent( QMouseEvent* );
- void wheelEvent( QWheelEvent* );
+ void keyPressEvent( TQKeyEvent* );
+ void imEndEvent( TQIMEvent * );
+ void contentsMouseMoveEvent( TQMouseEvent* );
+ void contentsMousePressEvent( TQMouseEvent* );
+ void contentsMouseReleaseEvent( TQMouseEvent* );
+ void wheelEvent( TQWheelEvent* );
// drag and drop related events
- void dragEnterEvent( QDragEnterEvent* );
- void dropEvent( QDropEvent* );
+ void dragEnterEvent( TQDragEnterEvent* );
+ void dropEvent( TQDropEvent* );
private:
// draw items on the opened qpainter
- void paintItems( QPainter * p, const QRect & clipRect );
+ void paintItems( TQPainter * p, const TQRect & clipRect );
// update item width and height using current zoom parameters
void updateItemSize( PageViewItem * item, int columnWidth, int rowHeight );
// return the widget placed on a certain point or 0 if clicking on empty space
PageViewItem * pickItemOnPoint( int x, int y );
// start / modify / clear selection rectangle
- void selectionStart( int x, int y, const QColor & color, bool aboveAll = false );
+ void selectionStart( int x, int y, const TQColor & color, bool aboveAll = false );
void selectionEndPoint( int x, int y );
void selectionClear();
// update internal zoom values and end in a slotRelayoutPages();
@@ -105,7 +105,7 @@ class PageView : public QScrollView, public DocumentObserver
// update the text on the label using global zoom value or current page's one
void updateZoomText();
// updates cursor
- void updateCursor( const QPoint &p );
+ void updateCursor( const TQPoint &p );
// does the type ahead search
void doTypeAheadSearch();
@@ -113,7 +113,7 @@ class PageView : public QScrollView, public DocumentObserver
class PageViewPrivate * d;
private slots:
- // activated either directly or via QTimer on the viewportResizeEvent
+ // activated either directly or via TQTimer on the viewportResizeEvent
void slotRelayoutPages();
// activated either directly or via the contentsMoving(int,int) signal
void slotRequestVisiblePixmaps( int left = -1, int top = -1 );
diff --git a/kpdf/ui/pageviewutils.cpp b/kpdf/ui/pageviewutils.cpp
index b9d84137..eaf5fc95 100644
--- a/kpdf/ui/pageviewutils.cpp
+++ b/kpdf/ui/pageviewutils.cpp
@@ -8,10 +8,10 @@
***************************************************************************/
// qt/kde includes
-#include <qbitmap.h>
-#include <qpainter.h>
-#include <qimage.h>
-#include <qtimer.h>
+#include <tqbitmap.h>
+#include <tqpainter.h>
+#include <tqimage.h>
+#include <tqtimer.h>
#include <kapplication.h>
#include <kimageeffect.h>
#include <kiconloader.h>
@@ -21,20 +21,20 @@
#include "core/page.h"
#include "conf/settings.h"
-PageViewMessage::PageViewMessage( QWidget * parent )
- : QWidget( parent, "pageViewMessage" ), m_timer( 0 )
+PageViewMessage::PageViewMessage( TQWidget * parent )
+ : TQWidget( parent, "pageViewMessage" ), m_timer( 0 )
{
setFocusPolicy( NoFocus );
setBackgroundMode( NoBackground );
- setPaletteBackgroundColor(kapp->palette().color(QPalette::Active, QColorGroup::Background));
+ setPaletteBackgroundColor(kapp->palette().color(TQPalette::Active, TQColorGroup::Background));
// if the layout is LtR, we can safely place it in the right position
- if ( !QApplication::reverseLayout() )
+ if ( !TQApplication::reverseLayout() )
move( 10, 10 );
resize( 0, 0 );
hide();
}
-void PageViewMessage::display( const QString & message, Icon icon, int durationMs )
+void PageViewMessage::display( const TQString & message, Icon icon, int durationMs )
// give to Caesar what Caesar owns: code taken from Amarok's osd.h/.cpp
// "redde (reddite, pl.) cesari quae sunt cesaris", just btw. ;)
{
@@ -45,7 +45,7 @@ void PageViewMessage::display( const QString & message, Icon icon, int durationM
}
// determine text rectangle
- QRect textRect = fontMetrics().boundingRect( message );
+ TQRect textRect = fontMetrics().boundingRect( message );
textRect.moveBy( -textRect.left(), -textRect.top() );
textRect.addCoords( 0, 0, 2, 2 );
int width = textRect.width(),
@@ -55,7 +55,7 @@ void PageViewMessage::display( const QString & message, Icon icon, int durationM
shadowOffset = 1;
// load icon (if set) and update geometry
- QPixmap symbol;
+ TQPixmap symbol;
if ( icon != None )
{
switch ( icon )
@@ -73,7 +73,7 @@ void PageViewMessage::display( const QString & message, Icon icon, int durationM
symbol = SmallIcon( "messagebox_info" );
break;
}
- if ( QApplication::reverseLayout() )
+ if ( TQApplication::reverseLayout() )
{
iconXOffset = 2 + textRect.width();
}
@@ -84,23 +84,23 @@ void PageViewMessage::display( const QString & message, Icon icon, int durationM
width += 2 + symbol.width();
height = QMAX( height, symbol.height() );
}
- QRect geometry( 0, 0, width + 10, height + 8 );
+ TQRect geometry( 0, 0, width + 10, height + 8 );
// resize pixmap, mask and widget
- static QBitmap mask;
+ static TQBitmap mask;
mask.resize( geometry.size() );
m_pixmap.resize( geometry.size() );
resize( geometry.size() );
// create and set transparency mask
- QPainter maskPainter( &mask);
+ TQPainter maskPainter( &mask);
mask.fill( Qt::black );
maskPainter.setBrush( Qt::white );
maskPainter.drawRoundRect( geometry, 1600 / geometry.width(), 1600 / geometry.height() );
setMask( mask );
// draw background
- QPainter bufferPainter( &m_pixmap );
+ TQPainter bufferPainter( &m_pixmap );
bufferPainter.setPen( Qt::black );
bufferPainter.setBrush( paletteBackgroundColor() );
bufferPainter.drawRoundRect( geometry, 1600 / geometry.width(), 1600 / geometry.height() );
@@ -118,7 +118,7 @@ void PageViewMessage::display( const QString & message, Icon icon, int durationM
// if the layout is RtL, we can move it to the right place only after we
// know how much size it will take
- if ( QApplication::reverseLayout() )
+ if ( TQApplication::reverseLayout() )
move( parentWidget()->width() - geometry.width() - 10, 10 );
// show widget and schedule a repaint
@@ -130,21 +130,21 @@ void PageViewMessage::display( const QString & message, Icon icon, int durationM
{
if ( !m_timer )
{
- m_timer = new QTimer( this );
- connect( m_timer, SIGNAL( timeout() ), SLOT( hide() ) );
+ m_timer = new TQTimer( this );
+ connect( m_timer, TQT_SIGNAL( timeout() ), TQT_SLOT( hide() ) );
}
m_timer->start( durationMs, true );
} else if ( m_timer )
m_timer->stop();
}
-void PageViewMessage::paintEvent( QPaintEvent * e )
+void PageViewMessage::paintEvent( TQPaintEvent * e )
{
- QPainter p( this );
+ TQPainter p( this );
p.drawPixmap( e->rect().topLeft(), m_pixmap, e->rect() );
}
-void PageViewMessage::mousePressEvent( QMouseEvent * /*e*/ )
+void PageViewMessage::mousePressEvent( TQMouseEvent * /*e*/ )
{
if ( m_timer )
m_timer->stop();
@@ -168,7 +168,7 @@ int PageViewItem::pageNumber() const
return m_page->number();
}
-const QRect& PageViewItem::geometry() const
+const TQRect& PageViewItem::geometry() const
{
return m_geometry;
}
diff --git a/kpdf/ui/pageviewutils.h b/kpdf/ui/pageviewutils.h
index bde9b8d3..d1e5cecf 100644
--- a/kpdf/ui/pageviewutils.h
+++ b/kpdf/ui/pageviewutils.h
@@ -10,12 +10,12 @@
#ifndef _PAGEVIEW_UTILS_H
#define _PAGEVIEW_UTILS_H
-#include <qwidget.h>
-#include <qpixmap.h>
-#include <qpainter.h>
-#include <qrect.h>
+#include <tqwidget.h>
+#include <tqpixmap.h>
+#include <tqpainter.h>
+#include <tqrect.h>
-class QTimer;
+class TQTimer;
class PageView;
class KPDFPage;
@@ -33,7 +33,7 @@ class PageViewItem
const KPDFPage * page() const;
int pageNumber() const;
- const QRect& geometry() const;
+ const TQRect& geometry() const;
int width() const;
int height() const;
double zoomFactor() const;
@@ -45,7 +45,7 @@ class PageViewItem
private:
const KPDFPage * m_page;
double m_zoomFactor;
- QRect m_geometry;
+ TQRect m_geometry;
};
@@ -55,18 +55,18 @@ class PageViewItem
class PageViewMessage : public QWidget
{
public:
- PageViewMessage( QWidget * parent );
+ PageViewMessage( TQWidget * parent );
enum Icon { None, Info, Warning, Error, Find };
- void display( const QString & message, Icon icon = Info, int durationMs = 4000 );
+ void display( const TQString & message, Icon icon = Info, int durationMs = 4000 );
protected:
- void paintEvent( QPaintEvent * e );
- void mousePressEvent( QMouseEvent * e );
+ void paintEvent( TQPaintEvent * e );
+ void mousePressEvent( TQMouseEvent * e );
private:
- QPixmap m_pixmap;
- QTimer * m_timer;
+ TQPixmap m_pixmap;
+ TQTimer * m_timer;
};
#endif
diff --git a/kpdf/ui/presentationwidget.cpp b/kpdf/ui/presentationwidget.cpp
index c57e2f95..450f25df 100644
--- a/kpdf/ui/presentationwidget.cpp
+++ b/kpdf/ui/presentationwidget.cpp
@@ -8,12 +8,12 @@
***************************************************************************/
// qt/kde includes
-#include <qtimer.h>
-#include <qimage.h>
-#include <qpainter.h>
-#include <qapplication.h>
-#include <qdesktopwidget.h>
-#include <qtooltip.h>
+#include <tqtimer.h>
+#include <tqimage.h>
+#include <tqpainter.h>
+#include <tqapplication.h>
+#include <tqdesktopwidget.h>
+#include <tqtooltip.h>
#include <kaccel.h>
#include <kactioncollection.h>
#include <kapplication.h>
@@ -48,12 +48,12 @@
struct PresentationFrame
{
const KPDFPage * page;
- QRect geometry;
+ TQRect geometry;
};
-PresentationWidget::PresentationWidget( QWidget * parent, KPDFDocument * doc )
- : QDialog( parent, "presentationWidget", true, WDestructiveClose | WStyle_NoBorder),
+PresentationWidget::PresentationWidget( TQWidget * parent, KPDFDocument * doc )
+ : TQDialog( parent, "presentationWidget", true, WDestructiveClose | WStyle_NoBorder),
m_pressedLink( 0 ), m_handCursor( false ), m_document( doc ), m_frameIndex( -1 )
{
// set look and geometry
@@ -68,12 +68,12 @@ PresentationWidget::PresentationWidget( QWidget * parent, KPDFDocument * doc )
// misc stuff
setMouseTracking( true );
- m_transitionTimer = new QTimer( this );
- connect( m_transitionTimer, SIGNAL( timeout() ), this, SLOT( slotTransitionStep() ) );
- m_overlayHideTimer = new QTimer( this );
- connect( m_overlayHideTimer, SIGNAL( timeout() ), this, SLOT( slotHideOverlay() ) );
- m_nextPageTimer = new QTimer( this );
- connect( m_nextPageTimer, SIGNAL( timeout() ), this, SLOT( slotNextPage() ) );
+ m_transitionTimer = new TQTimer( this );
+ connect( m_transitionTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotTransitionStep() ) );
+ m_overlayHideTimer = new TQTimer( this );
+ connect( m_overlayHideTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotHideOverlay() ) );
+ m_nextPageTimer = new TQTimer( this );
+ connect( m_nextPageTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotNextPage() ) );
// handle cursor appearance as specified in configuration
if ( KpdfSettings::slidesCursor() == KpdfSettings::EnumSlidesCursor::HiddenDelay )
@@ -93,24 +93,24 @@ PresentationWidget::~PresentationWidget()
m_document->removeObserver( this );
// delete frames
- QValueVector< PresentationFrame * >::iterator fIt = m_frames.begin(), fEnd = m_frames.end();
+ TQValueVector< PresentationFrame * >::iterator fIt = m_frames.begin(), fEnd = m_frames.end();
for ( ; fIt != fEnd; ++fIt )
delete *fIt;
}
void PresentationWidget::setupActions( KActionCollection * ac )
{
- m_accel->insert( "previous_page", ac->action( "previous_page" )->shortcut(), this, SLOT( slotPrevPage() ), false, true );
- m_accel->insert( "next_page", ac->action( "next_page" )->shortcut(), this, SLOT( slotNextPage() ), false, true );
- m_accel->insert( "first_page", ac->action( "first_page" )->shortcut(), this, SLOT( slotFirstPage() ), false, true );
- m_accel->insert( "last_page", ac->action( "last_page" )->shortcut(), this, SLOT( slotLastPage() ), false, true );
- m_accel->insert( "presentation", ac->action( "presentation" )->shortcut(), this, SLOT( close() ), false, true );
+ m_accel->insert( "previous_page", ac->action( "previous_page" )->shortcut(), this, TQT_SLOT( slotPrevPage() ), false, true );
+ m_accel->insert( "next_page", ac->action( "next_page" )->shortcut(), this, TQT_SLOT( slotNextPage() ), false, true );
+ m_accel->insert( "first_page", ac->action( "first_page" )->shortcut(), this, TQT_SLOT( slotFirstPage() ), false, true );
+ m_accel->insert( "last_page", ac->action( "last_page" )->shortcut(), this, TQT_SLOT( slotLastPage() ), false, true );
+ m_accel->insert( "presentation", ac->action( "presentation" )->shortcut(), this, TQT_SLOT( close() ), false, true );
}
-void PresentationWidget::notifySetup( const QValueVector< KPDFPage * > & pageSet, bool /*documentChanged*/ )
+void PresentationWidget::notifySetup( const TQValueVector< KPDFPage * > & pageSet, bool /*documentChanged*/ )
{
// delete previous frames (if any (shouldn't be))
- QValueVector< PresentationFrame * >::iterator fIt = m_frames.begin(), fEnd = m_frames.end();
+ TQValueVector< PresentationFrame * >::iterator fIt = m_frames.begin(), fEnd = m_frames.end();
for ( ; fIt != fEnd; ++fIt )
delete *fIt;
if ( !m_frames.isEmpty() )
@@ -118,7 +118,7 @@ void PresentationWidget::notifySetup( const QValueVector< KPDFPage * > & pageSet
m_frames.clear();
// create the new frames
- QValueVector< KPDFPage * >::const_iterator setIt = pageSet.begin(), setEnd = pageSet.end();
+ TQValueVector< KPDFPage * >::const_iterator setIt = pageSet.begin(), setEnd = pageSet.end();
float screenRatio = (float)m_height / (float)m_width;
for ( ; setIt != setEnd; ++setIt )
{
@@ -183,15 +183,15 @@ bool PresentationWidget::canUnloadPixmap( int pageNumber )
// <widget events>
/* This hack was here to fix 103718 but it's no longer necessary on KDE 3.5 and Lubos asked me to remove it
-bool PresentationWidget::event ( QEvent * e )
+bool PresentationWidget::event ( TQEvent * e )
{
- if (e -> type() == QEvent::WindowDeactivate) KWin::clearState(winId(), NET::StaysOnTop);
- else if (e -> type() == QEvent::WindowActivate) KWin::setState(winId(), NET::StaysOnTop);
- return QDialog::event(e);
+ if (e -> type() == TQEvent::WindowDeactivate) KWin::clearState(winId(), NET::StaysOnTop);
+ else if (e -> type() == TQEvent::WindowActivate) KWin::setState(winId(), NET::StaysOnTop);
+ return TQDialog::event(e);
}
*/
-void PresentationWidget::keyPressEvent( QKeyEvent * e )
+void PresentationWidget::keyPressEvent( TQKeyEvent * e )
{
if (m_width == -1) return;
@@ -212,7 +212,7 @@ void PresentationWidget::keyPressEvent( QKeyEvent * e )
}
}
-void PresentationWidget::wheelEvent( QWheelEvent * e )
+void PresentationWidget::wheelEvent( TQWheelEvent * e )
{
// performance note: don't remove the clipping
int div = e->delta() / 120;
@@ -232,7 +232,7 @@ void PresentationWidget::wheelEvent( QWheelEvent * e )
}
}
-void PresentationWidget::mousePressEvent( QMouseEvent * e )
+void PresentationWidget::mousePressEvent( TQMouseEvent * e )
{
// pressing left button
if ( e->button() == Qt::LeftButton )
@@ -256,7 +256,7 @@ void PresentationWidget::mousePressEvent( QMouseEvent * e )
slotPrevPage();
}
-void PresentationWidget::mouseReleaseEvent( QMouseEvent * e )
+void PresentationWidget::mouseReleaseEvent( TQMouseEvent * e )
{
// if releasing on the same link we pressed over, execute it
if ( m_pressedLink && e->button() == Qt::LeftButton )
@@ -268,7 +268,7 @@ void PresentationWidget::mouseReleaseEvent( QMouseEvent * e )
}
}
-void PresentationWidget::mouseMoveEvent( QMouseEvent * e )
+void PresentationWidget::mouseMoveEvent( TQMouseEvent * e )
{
// safety check
if ( m_width == -1 )
@@ -295,11 +295,11 @@ void PresentationWidget::mouseMoveEvent( QMouseEvent * e )
}
}
-void PresentationWidget::paintEvent( QPaintEvent * pe )
+void PresentationWidget::paintEvent( TQPaintEvent * pe )
{
if (m_width == -1)
{
- QRect d = KGlobalSettings::desktopGeometry(this);
+ TQRect d = KGlobalSettings::desktopGeometry(this);
m_width = d.width();
m_height = d.height();
@@ -307,16 +307,16 @@ void PresentationWidget::paintEvent( QPaintEvent * pe )
m_topBar = new KToolBar( this, "presentationBar" );
m_topBar->setIconSize( 32 );
m_topBar->setMovingEnabled( false );
- m_topBar->insertButton( QApplication::reverseLayout() ? "1rightarrow" : "1leftarrow", 2, SIGNAL( clicked() ), this, SLOT( slotPrevPage() ) );
- m_topBar->insertButton( QApplication::reverseLayout() ? "1leftarrow" : "1rightarrow", 3, SIGNAL( clicked() ), this, SLOT( slotNextPage() ) );
- m_topBar->insertButton( "exit", 1, SIGNAL( clicked() ), this, SLOT( close() ) );
+ m_topBar->insertButton( TQApplication::reverseLayout() ? "1rightarrow" : "1leftarrow", 2, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotPrevPage() ) );
+ m_topBar->insertButton( TQApplication::reverseLayout() ? "1leftarrow" : "1rightarrow", 3, TQT_SIGNAL( clicked() ), this, TQT_SLOT( slotNextPage() ) );
+ m_topBar->insertButton( "exit", 1, TQT_SIGNAL( clicked() ), this, TQT_SLOT( close() ) );
m_topBar->setGeometry( 0, 0, m_width, 32 + 10 );
m_topBar->alignItemRight( 1 );
m_topBar->hide();
// change topbar background color
- QPalette p = m_topBar->palette();
- p.setColor( QPalette::Active, QColorGroup::Button, Qt::gray );
- p.setColor( QPalette::Active, QColorGroup::Background, Qt::darkGray );
+ TQPalette p = m_topBar->palette();
+ p.setColor( TQPalette::Active, TQColorGroup::Button, Qt::gray );
+ p.setColor( TQPalette::Active, TQColorGroup::Background, Qt::darkGray );
m_topBar->setPalette( p );
// register this observer in document. events will come immediately
@@ -326,34 +326,34 @@ void PresentationWidget::paintEvent( QPaintEvent * pe )
if ( KpdfSettings::slidesShowSummary() )
generatePage();
- KMessageBox::information(this, i18n("There are two ways of exiting presentation mode, you can press either ESC key or click with the quit button that appears when placing the mouse in the top-right corner. Of course you can cycle windows (Alt+TAB by default)"), QString::null, "presentationInfo");
+ KMessageBox::information(this, i18n("There are two ways of exiting presentation mode, you can press either ESC key or click with the quit button that appears when placing the mouse in the top-right corner. Of course you can cycle windows (Alt+TAB by default)"), TQString::null, "presentationInfo");
}
// check painting rect consistancy
- QRect r = pe->rect().intersect( geometry() );
+ TQRect r = pe->rect().intersect( geometry() );
if ( r.isNull() || m_lastRenderedPixmap.isNull() )
return;
// blit the pixmap to the screen
- QMemArray<QRect> allRects = pe->region().rects();
+ TQMemArray<TQRect> allRects = pe->region().rects();
uint numRects = allRects.count();
for ( uint i = 0; i < numRects; i++ )
{
- const QRect & r = allRects[i];
+ const TQRect & r = allRects[i];
if ( !r.isValid() )
continue;
#ifdef ENABLE_PROGRESS_OVERLAY
if ( KpdfSettings::slidesShowProgress() && r.intersects( m_overlayGeometry ) )
{
// backbuffer the overlay operation
- QPixmap backPixmap( r.size() );
- QPainter pixPainter( &backPixmap );
+ TQPixmap backPixmap( r.size() );
+ TQPainter pixPainter( &backPixmap );
// first draw the background on the backbuffer
- pixPainter.drawPixmap( QPoint(0,0), m_lastRenderedPixmap, r );
+ pixPainter.drawPixmap( TQPoint(0,0), m_lastRenderedPixmap, r );
// then blend the overlay (a piece of) over the background
- QRect ovr = m_overlayGeometry.intersect( r );
+ TQRect ovr = m_overlayGeometry.intersect( r );
pixPainter.drawPixmap( ovr.left() - r.left(), ovr.top() - r.top(),
m_lastRenderedOverlay, ovr.left() - m_overlayGeometry.left(),
ovr.top() - m_overlayGeometry.top(), ovr.width(), ovr.height() );
@@ -370,7 +370,7 @@ void PresentationWidget::paintEvent( QPaintEvent * pe )
// </widget events>
-const KPDFLink * PresentationWidget::getLink( int x, int y, QRect * geometry ) const
+const KPDFLink * PresentationWidget::getLink( int x, int y, TQRect * geometry ) const
{
// no links on invalid pages
if ( geometry && !geometry->isNull() )
@@ -381,7 +381,7 @@ const KPDFLink * PresentationWidget::getLink( int x, int y, QRect * geometry ) c
// get frame, page and geometry
const PresentationFrame * frame = m_frames[ m_frameIndex ];
const KPDFPage * page = frame->page;
- const QRect & frameGeometry = frame->geometry;
+ const TQRect & frameGeometry = frame->geometry;
// compute normalized x and y
double nx = (double)(x - frameGeometry.left()) / (double)frameGeometry.width();
@@ -410,7 +410,7 @@ const KPDFLink * PresentationWidget::getLink( int x, int y, QRect * geometry ) c
void PresentationWidget::testCursorOnLink( int x, int y )
{
// get rect
- QRect linkRect;
+ TQRect linkRect;
const KPDFLink * link = getLink( x, y, &linkRect );
// only react on changes (in/out from a link)
@@ -421,13 +421,13 @@ void PresentationWidget::testCursorOnLink( int x, int y )
setCursor( m_handCursor ? KCursor::handCursor() : KCursor::arrowCursor());
// set tooltip over link's rect
- QString tip = link ? link->linkTip() : QString::null;
+ TQString tip = link ? link->linkTip() : TQString::null;
if ( m_handCursor && !tip.isEmpty() )
- QToolTip::add( this, linkRect, tip );
+ TQToolTip::add( this, linkRect, tip );
}
}
-void PresentationWidget::overlayClick( const QPoint & position )
+void PresentationWidget::overlayClick( const TQPoint & position )
{
// clicking the progress indicator
int xPos = position.x() - m_overlayGeometry.x() - m_overlayGeometry.width() / 2,
@@ -459,12 +459,12 @@ void PresentationWidget::changePage( int newPage )
if ( !frame->page->hasPixmap( PRESENTATION_ID, pixW, pixH ) )
{
// operation will take long: set busy cursor
- QApplication::setOverrideCursor( KCursor::workingCursor() );
+ TQApplication::setOverrideCursor( KCursor::workingCursor() );
// request the pixmap
- QValueList< PixmapRequest * > requests;
+ TQValueList< PixmapRequest * > requests;
requests.push_back( new PixmapRequest( PRESENTATION_ID, m_frameIndex, pixW, pixH, PRESENTATION_PRIO ) );
// restore cursor
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
// ask for next and previous page if not in low memory usage setting
if (KpdfSettings::memoryLevel() != KpdfSettings::EnumMemoryLevel::Low && KpdfSettings::enableThreading()) {
if (newPage + 1 < (int)m_document->pages())
@@ -503,7 +503,7 @@ void PresentationWidget::generatePage()
m_lastRenderedPixmap.resize( m_width, m_height );
// opens the painter over the pixmap
- QPainter pixmapPainter;
+ TQPainter pixmapPainter;
pixmapPainter.begin( &m_lastRenderedPixmap );
// generate welcome page
if ( m_frameIndex == -1 )
@@ -532,12 +532,12 @@ void PresentationWidget::generatePage()
// update cursor + tooltip
if ( KpdfSettings::slidesCursor() != KpdfSettings::EnumSlidesCursor::Hidden )
{
- QPoint p = mapFromGlobal( QCursor::pos() );
+ TQPoint p = mapFromGlobal( TQCursor::pos() );
testCursorOnLink( p.x(), p.y() );
}
}
-void PresentationWidget::generateIntroPage( QPainter & p )
+void PresentationWidget::generateIntroPage( TQPainter & p )
{
// use a vertical gray gradient background
int blend1 = m_height / 10,
@@ -550,11 +550,11 @@ void PresentationWidget::generateIntroPage( QPainter & p )
k -= (int)( baseTint * (i-blend1)*(i-blend1) / (float)(blend1 * blend1) );
if ( i > blend2 )
k += (int)( (255-baseTint) * (i-blend2)*(i-blend2) / (float)(blend1 * blend1) );
- p.fillRect( 0, i, m_width, 1, QColor( k, k, k ) );
+ p.fillRect( 0, i, m_width, 1, TQColor( k, k, k ) );
}
// draw kpdf logo in the four corners
- QPixmap logo = DesktopIcon( "kpdf", 64 );
+ TQPixmap logo = DesktopIcon( "kpdf", 64 );
if ( !logo.isNull() )
{
p.drawPixmap( 5, 5, logo );
@@ -567,14 +567,14 @@ void PresentationWidget::generateIntroPage( QPainter & p )
int strNum = m_metaStrings.count(),
strHeight = m_height / ( strNum + 4 ),
fontHeight = 2 * strHeight / 3;
- QFont font( p.font() );
+ TQFont font( p.font() );
font.setPixelSize( fontHeight );
- QFontMetrics metrics( font );
+ TQFontMetrics metrics( font );
for ( int i = 0; i < strNum; i++ )
{
// set a font to fit text width
float wScale = (float)metrics.boundingRect( m_metaStrings[i] ).width() / (float)m_width;
- QFont f( font );
+ TQFont f( font );
if ( wScale > 1.0 )
f.setPixelSize( (int)( (float)fontHeight / (float)wScale ) );
p.setFont( f );
@@ -590,12 +590,12 @@ void PresentationWidget::generateIntroPage( QPainter & p )
}
}
-void PresentationWidget::generateContentsPage( int pageNum, QPainter & p )
+void PresentationWidget::generateContentsPage( int pageNum, TQPainter & p )
{
PresentationFrame * frame = m_frames[ pageNum ];
// translate painter and contents rect
- QRect geom( frame->geometry );
+ TQRect geom( frame->geometry );
p.translate( geom.left(), geom.top() );
geom.moveBy( -geom.left(), -geom.top() );
@@ -608,11 +608,11 @@ void PresentationWidget::generateContentsPage( int pageNum, QPainter & p )
p.translate( -frame->geometry.left(), -frame->geometry.top() );
// fill unpainted areas with background color
- QRegion unpainted( QRect( 0, 0, m_width, m_height ) );
- QMemArray<QRect> rects = unpainted.subtract( frame->geometry ).rects();
+ TQRegion unpainted( TQRect( 0, 0, m_width, m_height ) );
+ TQMemArray<TQRect> rects = unpainted.subtract( frame->geometry ).rects();
for ( uint i = 0; i < rects.count(); i++ )
{
- const QRect & r = rects[i];
+ const TQRect & r = rects[i];
p.fillRect( r, KpdfSettings::slidesBackgroundColor() );
}
}
@@ -632,9 +632,9 @@ void PresentationWidget::generateOverlay()
// and the resulting image is smoothly scaled down. So here we open a
// painter on the double sized pixmap.
side *= 2;
- QPixmap doublePixmap( side, side );
+ TQPixmap doublePixmap( side, side );
doublePixmap.fill( Qt::black );
- QPainter pixmapPainter( &doublePixmap );
+ TQPainter pixmapPainter( &doublePixmap );
// draw PIE SLICES in blue levels (the levels will then be the alpha component)
int pages = m_document->pages();
@@ -667,16 +667,16 @@ void PresentationWidget::generateOverlay()
pixmapPainter.drawEllipse( circleOut, circleOut, side - 2*circleOut, side - 2*circleOut );
// draw TEXT using maximum opacity
- QFont f( pixmapPainter.font() );
+ TQFont f( pixmapPainter.font() );
f.setPixelSize( side / 4 );
pixmapPainter.setFont( f );
pixmapPainter.setPen( 0xFF );
// use a little offset to prettify output
- pixmapPainter.drawText( 2, 2, side, side, Qt::AlignCenter, QString::number( m_frameIndex + 1 ) );
+ pixmapPainter.drawText( 2, 2, side, side, Qt::AlignCenter, TQString::number( m_frameIndex + 1 ) );
// end drawing pixmap and halve image
pixmapPainter.end();
- QImage image( doublePixmap.convertToImage().smoothScale( side / 2, side / 2 ) );
+ TQImage image( doublePixmap.convertToImage().smoothScale( side / 2, side / 2 ) );
image.setAlphaBuffer( true );
// draw circular shadow using the same technique
@@ -686,11 +686,11 @@ void PresentationWidget::generateOverlay()
pixmapPainter.setBrush( 0x80 );
pixmapPainter.drawEllipse( 0, 0, side, side );
pixmapPainter.end();
- QImage shadow( doublePixmap.convertToImage().smoothScale( side / 2, side / 2 ) );
+ TQImage shadow( doublePixmap.convertToImage().smoothScale( side / 2, side / 2 ) );
// generate a 2 colors pixmap using mixing shadow (made with highlight color)
// and image (made with highlightedText color)
- QColor color = palette().active().highlightedText();
+ TQColor color = palette().active().highlightedText();
int red = color.red(), green = color.green(), blue = color.blue();
color = palette().active().highlight();
int sRed = color.red(), sGreen = color.green(), sBlue = color.blue();
@@ -802,7 +802,7 @@ void PresentationWidget::slotLastPage()
void PresentationWidget::slotHideOverlay()
{
- QRect geom( m_overlayGeometry );
+ TQRect geom( m_overlayGeometry );
m_overlayGeometry.setCoords( 0, 0, -1, -1 );
update( geom );
}
@@ -990,8 +990,8 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
for ( int i = 0; i < steps; i++ )
{
int xNext = ((i + 1) * m_width) / (2 * steps);
- m_transitionRects.push_back( QRect( xPosition, 0, xNext - xPosition, m_height ) );
- m_transitionRects.push_back( QRect( m_width - xNext, 0, xNext - xPosition, m_height ) );
+ m_transitionRects.push_back( TQRect( xPosition, 0, xNext - xPosition, m_height ) );
+ m_transitionRects.push_back( TQRect( m_width - xNext, 0, xNext - xPosition, m_height ) );
xPosition = xNext;
}
}
@@ -1001,8 +1001,8 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
for ( int i = 0; i < steps; i++ )
{
int xNext = ((steps - (i + 1)) * m_width) / (2 * steps);
- m_transitionRects.push_back( QRect( xNext, 0, xPosition - xNext, m_height ) );
- m_transitionRects.push_back( QRect( m_width - xPosition, 0, xPosition - xNext, m_height ) );
+ m_transitionRects.push_back( TQRect( xNext, 0, xPosition - xNext, m_height ) );
+ m_transitionRects.push_back( TQRect( m_width - xPosition, 0, xPosition - xNext, m_height ) );
xPosition = xNext;
}
}
@@ -1015,8 +1015,8 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
for ( int i = 0; i < steps; i++ )
{
int yNext = ((i + 1) * m_height) / (2 * steps);
- m_transitionRects.push_back( QRect( 0, yPosition, m_width, yNext - yPosition ) );
- m_transitionRects.push_back( QRect( 0, m_height - yNext, m_width, yNext - yPosition ) );
+ m_transitionRects.push_back( TQRect( 0, yPosition, m_width, yNext - yPosition ) );
+ m_transitionRects.push_back( TQRect( 0, m_height - yNext, m_width, yNext - yPosition ) );
yPosition = yNext;
}
}
@@ -1026,8 +1026,8 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
for ( int i = 0; i < steps; i++ )
{
int yNext = ((steps - (i + 1)) * m_height) / (2 * steps);
- m_transitionRects.push_back( QRect( 0, yNext, m_width, yPosition - yNext ) );
- m_transitionRects.push_back( QRect( 0, m_height - yPosition, m_width, yPosition - yNext ) );
+ m_transitionRects.push_back( TQRect( 0, yNext, m_width, yPosition - yNext ) );
+ m_transitionRects.push_back( TQRect( 0, m_height - yPosition, m_width, yPosition - yNext ) );
yPosition = yNext;
}
}
@@ -1052,7 +1052,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
int stepOffset = (int)( ((float)i * (float)m_width) / ((float)blinds * (float)steps) );
for ( int b = 0; b < blinds; b++ )
{
- m_transitionRects.push_back( QRect( xPosition[ b ], 0, stepOffset, m_height ) );
+ m_transitionRects.push_back( TQRect( xPosition[ b ], 0, stepOffset, m_height ) );
xPosition[ b ] = stepOffset + (b * m_width) / blinds;
}
}
@@ -1068,7 +1068,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
int stepOffset = (int)( ((float)i * (float)m_height) / ((float)blinds * (float)steps) );
for ( int b = 0; b < blinds; b++ )
{
- m_transitionRects.push_back( QRect( 0, yPosition[ b ], m_width, stepOffset ) );
+ m_transitionRects.push_back( TQRect( 0, yPosition[ b ], m_width, stepOffset ) );
yPosition[ b ] = stepOffset + (b * m_height) / blinds;
}
}
@@ -1092,10 +1092,10 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
int newR = m_width - newL;
int newB = m_height - newT;
// add left, right, topcenter, bottomcenter rects
- m_transitionRects.push_back( QRect( L, T, newL - L, B - T ) );
- m_transitionRects.push_back( QRect( newR, T, R - newR, B - T ) );
- m_transitionRects.push_back( QRect( newL, T, newR - newL, newT - T ) );
- m_transitionRects.push_back( QRect( newL, newB, newR - newL, B - newB ) );
+ m_transitionRects.push_back( TQRect( L, T, newL - L, B - T ) );
+ m_transitionRects.push_back( TQRect( newR, T, R - newR, B - T ) );
+ m_transitionRects.push_back( TQRect( newL, T, newR - newL, newT - T ) );
+ m_transitionRects.push_back( TQRect( newL, newB, newR - newL, B - newB ) );
L = newL; T = newT; R = newR, B = newB;
}
}
@@ -1110,10 +1110,10 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
int newR = m_width - newL;
int newB = m_height - newT;
// add left, right, topcenter, bottomcenter rects
- m_transitionRects.push_back( QRect( newL, newT, L - newL, newB - newT ) );
- m_transitionRects.push_back( QRect( R, newT, newR - R, newB - newT ) );
- m_transitionRects.push_back( QRect( L, newT, R - L, T - newT ) );
- m_transitionRects.push_back( QRect( L, B, R - L, newB - B ) );
+ m_transitionRects.push_back( TQRect( newL, newT, L - newL, newB - newT ) );
+ m_transitionRects.push_back( TQRect( R, newT, newR - R, newB - newT ) );
+ m_transitionRects.push_back( TQRect( L, newT, R - L, T - newT ) );
+ m_transitionRects.push_back( TQRect( L, B, R - L, newB - B ) );
L = newL; T = newT; R = newR, B = newB;
}
}
@@ -1132,7 +1132,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
for ( int i = 0; i < steps; i++ )
{
int xNext = ((i + 1) * m_width) / steps;
- m_transitionRects.push_back( QRect( xPosition, 0, xNext - xPosition, m_height ) );
+ m_transitionRects.push_back( TQRect( xPosition, 0, xNext - xPosition, m_height ) );
xPosition = xNext;
}
}
@@ -1142,7 +1142,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
for ( int i = 0; i < steps; i++ )
{
int yNext = ((steps - (i + 1)) * m_height) / steps;
- m_transitionRects.push_back( QRect( 0, yNext, m_width, yPosition - yNext ) );
+ m_transitionRects.push_back( TQRect( 0, yNext, m_width, yPosition - yNext ) );
yPosition = yNext;
}
}
@@ -1152,7 +1152,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
for ( int i = 0; i < steps; i++ )
{
int xNext = ((steps - (i + 1)) * m_width) / steps;
- m_transitionRects.push_back( QRect( xNext, 0, xPosition - xNext, m_height ) );
+ m_transitionRects.push_back( TQRect( xNext, 0, xPosition - xNext, m_height ) );
xPosition = xNext;
}
}
@@ -1162,7 +1162,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
for ( int i = 0; i < steps; i++ )
{
int yNext = ((i + 1) * m_height) / steps;
- m_transitionRects.push_back( QRect( 0, yPosition, m_width, yNext - yPosition ) );
+ m_transitionRects.push_back( TQRect( 0, yPosition, m_width, yNext - yPosition ) );
yPosition = yNext;
}
}
@@ -1190,7 +1190,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
for ( int x = 0; x < gridXsteps; x++ )
{
int newX = (int)( m_width * ((float)(x+1) / (float)gridXsteps) );
- m_transitionRects.push_back( QRect( oldX, oldY, newX - oldX, newY - oldY ) );
+ m_transitionRects.push_back( TQRect( oldX, oldY, newX - oldX, newY - oldY ) );
oldX = newX;
}
oldX = 0;
@@ -1204,7 +1204,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
// swap items if index differs
if ( n1 != n2 )
{
- QRect r = m_transitionRects[ n2 ];
+ TQRect r = m_transitionRects[ n2 ];
m_transitionRects[ n2 ] = m_transitionRects[ n1 ];
m_transitionRects[ n1 ] = r;
}
@@ -1232,7 +1232,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
for ( int j = 0; j < gridXsteps; j++ )
{
int xNext = ((j + 1) * m_width) / gridXsteps;
- m_transitionRects.push_back( QRect( xPosition, yNext, xNext - xPosition, yPosition - yNext ) );
+ m_transitionRects.push_back( TQRect( xPosition, yNext, xNext - xPosition, yPosition - yNext ) );
xPosition = xNext;
}
yPosition = yNext;
@@ -1248,7 +1248,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
for ( int j = 0; j < gridYsteps; j++ )
{
int yNext = ((j + 1) * m_height) / gridYsteps;
- m_transitionRects.push_back( QRect( xNext, yPosition, xPosition - xNext, yNext - yPosition ) );
+ m_transitionRects.push_back( TQRect( xNext, yPosition, xPosition - xNext, yNext - yPosition ) );
yPosition = yNext;
}
xPosition = xNext;
@@ -1264,7 +1264,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
for ( int j = 0; j < gridXsteps; j++ )
{
int xNext = ((j + 1) * m_width) / gridXsteps;
- m_transitionRects.push_back( QRect( xPosition, yPosition, xNext - xPosition, yNext - yPosition ) );
+ m_transitionRects.push_back( TQRect( xPosition, yPosition, xNext - xPosition, yNext - yPosition ) );
xPosition = xNext;
}
yPosition = yNext;
@@ -1280,7 +1280,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
for ( int j = 0; j < gridYsteps; j++ )
{
int yNext = ((j + 1) * m_height) / gridYsteps;
- m_transitionRects.push_back( QRect( xPosition, yPosition, xNext - xPosition, yNext - yPosition ) );
+ m_transitionRects.push_back( TQRect( xPosition, yPosition, xNext - xPosition, yNext - yPosition ) );
yPosition = yNext;
}
xPosition = xNext;
@@ -1295,7 +1295,7 @@ void PresentationWidget::initTransition( const KPDFPageTransition *transition )
// swap items if index differs
if ( n1 != n2 )
{
- QRect r = m_transitionRects[ n2 ];
+ TQRect r = m_transitionRects[ n2 ];
m_transitionRects[ n2 ] = m_transitionRects[ n1 ];
m_transitionRects[ n1 ] = r;
}
diff --git a/kpdf/ui/presentationwidget.h b/kpdf/ui/presentationwidget.h
index 4b0cdf19..00ff5b35 100644
--- a/kpdf/ui/presentationwidget.h
+++ b/kpdf/ui/presentationwidget.h
@@ -10,17 +10,17 @@
#ifndef _KPDF_PRESENTATIONWIDGET_H_
#define _KPDF_PRESENTATIONWIDGET_H_
-#include <qdialog.h>
-#include <qpixmap.h>
-#include <qstringlist.h>
-#include <qvaluevector.h>
+#include <tqdialog.h>
+#include <tqpixmap.h>
+#include <tqstringlist.h>
+#include <tqvaluevector.h>
#include "core/observer.h"
#include "core/pagetransition.h"
class KAccel;
class KActionCollection;
class KToolBar;
-class QTimer;
+class TQTimer;
class KPDFDocument;
class KPDFPage;
@@ -32,40 +32,40 @@ class PresentationFrame;
*
* This is a fullscreen widget that displays
*/
-class PresentationWidget : public QDialog, public DocumentObserver
+class PresentationWidget : public TQDialog, public DocumentObserver
{
Q_OBJECT
public:
- PresentationWidget( QWidget * parent, KPDFDocument * doc );
+ PresentationWidget( TQWidget * parent, KPDFDocument * doc );
~PresentationWidget();
void setupActions( KActionCollection * ac );
// inherited from DocumentObserver
uint observerId() const { return PRESENTATION_ID; }
- void notifySetup( const QValueVector< KPDFPage * > & pages, bool documentChanged );
+ void notifySetup( const TQValueVector< KPDFPage * > & pages, bool documentChanged );
void notifyViewportChanged( bool smoothMove );
void notifyPageChanged( int pageNumber, int changedFlags );
bool canUnloadPixmap( int pageNumber );
protected:
// widget events
-// bool event( QEvent * e );
- void keyPressEvent( QKeyEvent * e );
- void wheelEvent( QWheelEvent * e );
- void mousePressEvent( QMouseEvent * e );
- void mouseReleaseEvent( QMouseEvent * e );
- void mouseMoveEvent( QMouseEvent * e );
- void paintEvent( QPaintEvent * e );
+// bool event( TQEvent * e );
+ void keyPressEvent( TQKeyEvent * e );
+ void wheelEvent( TQWheelEvent * e );
+ void mousePressEvent( TQMouseEvent * e );
+ void mouseReleaseEvent( TQMouseEvent * e );
+ void mouseMoveEvent( TQMouseEvent * e );
+ void paintEvent( TQPaintEvent * e );
private:
- const KPDFLink * getLink( int x, int y, QRect * geometry = 0 ) const;
+ const KPDFLink * getLink( int x, int y, TQRect * geometry = 0 ) const;
void testCursorOnLink( int x, int y );
- void overlayClick( const QPoint & position );
+ void overlayClick( const TQPoint & position );
void changePage( int newPage );
void generatePage();
- void generateIntroPage( QPainter & p );
- void generateContentsPage( int page, QPainter & p );
+ void generateIntroPage( TQPainter & p );
+ void generateContentsPage( int page, TQPainter & p );
void generateOverlay();
void initTransition( const KPDFPageTransition *transition );
const KPDFPageTransition defaultTransition() const;
@@ -74,25 +74,25 @@ class PresentationWidget : public QDialog, public DocumentObserver
// cache stuff
int m_width;
int m_height;
- QPixmap m_lastRenderedPixmap;
- QPixmap m_lastRenderedOverlay;
- QRect m_overlayGeometry;
+ TQPixmap m_lastRenderedPixmap;
+ TQPixmap m_lastRenderedOverlay;
+ TQRect m_overlayGeometry;
const KPDFLink * m_pressedLink;
bool m_handCursor;
// transition related
- QTimer * m_transitionTimer;
- QTimer * m_overlayHideTimer;
- QTimer * m_nextPageTimer;
+ TQTimer * m_transitionTimer;
+ TQTimer * m_overlayHideTimer;
+ TQTimer * m_nextPageTimer;
int m_transitionDelay;
int m_transitionMul;
- QValueList< QRect > m_transitionRects;
+ TQValueList< TQRect > m_transitionRects;
// misc stuff
KPDFDocument * m_document;
- QValueVector< PresentationFrame * > m_frames;
+ TQValueVector< PresentationFrame * > m_frames;
int m_frameIndex;
- QStringList m_metaStrings;
+ TQStringList m_metaStrings;
KToolBar * m_topBar;
KAccel * m_accel;
diff --git a/kpdf/ui/propertiesdialog.cpp b/kpdf/ui/propertiesdialog.cpp
index d5810a07..df03422e 100644
--- a/kpdf/ui/propertiesdialog.cpp
+++ b/kpdf/ui/propertiesdialog.cpp
@@ -8,8 +8,8 @@
***************************************************************************/
// qt/kde includes
-#include <qlayout.h>
-#include <qlabel.h>
+#include <tqlayout.h>
+#include <tqlabel.h>
#include <klistview.h>
#include <klocale.h>
#include <ksqueezedtextlabel.h>
@@ -19,39 +19,39 @@
#include "propertiesdialog.h"
#include "core/document.h"
-PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc)
+PropertiesDialog::PropertiesDialog(TQWidget *parent, KPDFDocument *doc)
: KDialogBase( Tabbed, i18n( "Unknown File" ), Ok, Ok, parent, 0, true, true )
{
// Properties
- QFrame *page = addPage(i18n("Properties"));
- QGridLayout *layout = new QGridLayout( page, 2, 2, marginHint(), spacingHint() );
+ TQFrame *page = addPage(i18n("Properties"));
+ TQGridLayout *layout = new TQGridLayout( page, 2, 2, marginHint(), spacingHint() );
// get document info, if not present display blank data and a warning
const DocumentInfo * info = doc->documentInfo();
if ( !info ) {
- layout->addWidget( new QLabel( i18n( "No document opened." ), page ), 0, 0 );
+ layout->addWidget( new TQLabel( i18n( "No document opened." ), page ), 0, 0 );
return;
}
// mime name based on mimetype id
- QString mimeName = info->get( "mimeType" ).section( '/', -1 ).upper();
+ TQString mimeName = info->get( "mimeType" ).section( '/', -1 ).upper();
setCaption( i18n("%1 Properties").arg( mimeName ) );
- QDomElement docElement = info->documentElement();
+ TQDomElement docElement = info->documentElement();
int row = 0;
int valMaxWidth = 100;
- for ( QDomNode node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) {
- QDomElement element = node.toElement();
+ for ( TQDomNode node = docElement.firstChild(); !node.isNull(); node = node.nextSibling() ) {
+ TQDomElement element = node.toElement();
- QString titleString = element.attribute( "title" );
- QString valueString = element.attribute( "value" );
+ TQString titleString = element.attribute( "title" );
+ TQString valueString = element.attribute( "value" );
if ( titleString.isEmpty() || valueString.isEmpty() )
continue;
// create labels and layout them
- QLabel *key = new QLabel( i18n( "%1:" ).arg( titleString ), page );
- QLabel *value = new KSqueezedTextLabel( valueString, page );
+ TQLabel *key = new TQLabel( i18n( "%1:" ).arg( titleString ), page );
+ TQLabel *value = new KSqueezedTextLabel( valueString, page );
layout->addWidget( key, row, 0, AlignRight );
layout->addWidget( value, row, 1 );
row++;
@@ -61,21 +61,21 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc)
}
// add the number of pages if the generator hasn't done it already
- QDomNodeList list = docElement.elementsByTagName( "pages" );
+ TQDomNodeList list = docElement.elementsByTagName( "pages" );
if ( list.count() == 0 ) {
- QLabel *key = new QLabel( i18n( "Pages:" ), page );
- QLabel *value = new QLabel( QString::number( doc->pages() ), page );
+ TQLabel *key = new TQLabel( i18n( "Pages:" ), page );
+ TQLabel *value = new TQLabel( TQString::number( doc->pages() ), page );
layout->addWidget( key, row, 0 );
layout->addWidget( value, row, 1 );
}
// Fonts
- QVBoxLayout *page2Layout = 0;
+ TQVBoxLayout *page2Layout = 0;
if (doc->hasFonts())
{
- QFrame *page2 = addPage(i18n("Fonts"));
- page2Layout = new QVBoxLayout(page2, 0, KDialog::spacingHint());
+ TQFrame *page2 = addPage(i18n("Fonts"));
+ page2Layout = new TQVBoxLayout(page2, 0, KDialog::spacingHint());
KListView *lv = new KListView(page2);
page2Layout->add(lv);
doc->putFontInfo(lv);
@@ -88,7 +88,7 @@ PropertiesDialog::PropertiesDialog(QWidget *parent, KPDFDocument *doc)
width = QMAX( width, page2Layout->sizeHint().width() + marginHint() + spacingHint() + 31 );
}
// stay inside the 2/3 of the screen width
- QRect screenContainer = KGlobalSettings::desktopGeometry( this );
+ TQRect screenContainer = KGlobalSettings::desktopGeometry( this );
width = QMIN( width, 2*screenContainer.width()/3 );
resize(width, 1);
}
diff --git a/kpdf/ui/propertiesdialog.h b/kpdf/ui/propertiesdialog.h
index 7bc39e5a..d5e3229a 100644
--- a/kpdf/ui/propertiesdialog.h
+++ b/kpdf/ui/propertiesdialog.h
@@ -17,7 +17,7 @@ class KPDFDocument;
class PropertiesDialog : public KDialogBase
{
public:
- PropertiesDialog( QWidget *parent, KPDFDocument *doc );
+ PropertiesDialog( TQWidget *parent, KPDFDocument *doc );
};
#endif
diff --git a/kpdf/ui/searchwidget.cpp b/kpdf/ui/searchwidget.cpp
index 30a5bcf2..36b8dd19 100644
--- a/kpdf/ui/searchwidget.cpp
+++ b/kpdf/ui/searchwidget.cpp
@@ -8,9 +8,9 @@
***************************************************************************/
// qt/kde includes
-#include <qtooltip.h>
-#include <qapplication.h>
-#include <qtimer.h>
+#include <tqtooltip.h>
+#include <tqapplication.h>
+#include <tqtimer.h>
#include <kaction.h>
#include <kactioncollection.h>
#include <klocale.h>
@@ -28,7 +28,7 @@
#define LEDIT_ID 2
#define FIND_ID 3
-SearchWidget::SearchWidget( QWidget * parent, KPDFDocument * document )
+SearchWidget::SearchWidget( TQWidget * parent, KPDFDocument * document )
: KToolBar( parent, "iSearchBar" ), m_document( document ),
m_searchType( 0 ), m_caseSensitive( false )
{
@@ -39,19 +39,19 @@ SearchWidget::SearchWidget( QWidget * parent, KPDFDocument * document )
setMovingEnabled( false );
// a timer to ensure that we don't flood the document with requests to search
- m_inputDelayTimer = new QTimer(this);
- connect( m_inputDelayTimer, SIGNAL( timeout() ),
- this, SLOT( startSearch() ) );
+ m_inputDelayTimer = new TQTimer(this);
+ connect( m_inputDelayTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( startSearch() ) );
// 1. text line
- insertLined( QString::null, LEDIT_ID, SIGNAL( textChanged(const QString &) ),
- this, SLOT( slotTextChanged(const QString &) ), true,
+ insertLined( TQString::null, LEDIT_ID, TQT_SIGNAL( textChanged(const TQString &) ),
+ this, TQT_SLOT( slotTextChanged(const TQString &) ), true,
i18n( "Enter at least 3 letters to filter pages" ), 0/*size*/, 1 );
// 2. clear button (uses a lineEdit slot, so it must be created after)
- insertButton( QApplication::reverseLayout() ? "clear_left" : "locationbar_erase",
- CLEAR_ID, SIGNAL( clicked() ),
- getLined( LEDIT_ID ), SLOT( clear() ), true,
+ insertButton( TQApplication::reverseLayout() ? "clear_left" : "locationbar_erase",
+ CLEAR_ID, TQT_SIGNAL( clicked() ),
+ getLined( LEDIT_ID ), TQT_SLOT( clear() ), true,
i18n( "Clear filter" ), 0/*index*/ );
// 3.1. create the popup menu for changing filtering features
@@ -62,7 +62,7 @@ SearchWidget::SearchWidget( QWidget * parent, KPDFDocument * document )
m_menu->insertItem( i18n("Match All Words"), 4 );
m_menu->insertItem( i18n("Match Any Word"), 5 );
m_menu->setItemChecked( 3, true );
- connect( m_menu, SIGNAL( activated(int) ), SLOT( slotMenuChaged(int) ) );
+ connect( m_menu, TQT_SIGNAL( activated(int) ), TQT_SLOT( slotMenuChaged(int) ) );
// 3.2. create the toolbar button that spawns the popup menu
insertButton( "kpdf", FIND_ID, m_menu, true, i18n( "Filter Options" ), 2/*index*/ );
@@ -76,10 +76,10 @@ void SearchWidget::clearText()
getLined( LEDIT_ID )->clear();
}
-void SearchWidget::slotTextChanged( const QString & text )
+void SearchWidget::slotTextChanged( const TQString & text )
{
// if 0<length<3 set 'red' text and send a blank string to document
- QColor color = text.length() > 0 && text.length() < 3 ? Qt::darkRed : palette().active().text();
+ TQColor color = text.length() > 0 && text.length() < 3 ? Qt::darkRed : palette().active().text();
KLineEdit * lineEdit = getLined( LEDIT_ID );
lineEdit->setPaletteForegroundColor( color );
lineEdit->setPaletteBackgroundColor( palette().active().base() );
@@ -111,7 +111,7 @@ void SearchWidget::slotMenuChaged( int index )
void SearchWidget::startSearch()
{
// search text if have more than 3 chars or else clear search
- QString text = getLined( LEDIT_ID )->text();
+ TQString text = getLined( LEDIT_ID )->text();
bool ok = true;
if ( text.length() >= 3 )
{
diff --git a/kpdf/ui/searchwidget.h b/kpdf/ui/searchwidget.h
index 9f2a1e44..33fb1459 100644
--- a/kpdf/ui/searchwidget.h
+++ b/kpdf/ui/searchwidget.h
@@ -31,18 +31,18 @@ class SearchWidget : public KToolBar
{
Q_OBJECT
public:
- SearchWidget( QWidget *parent, KPDFDocument *document );
+ SearchWidget( TQWidget *parent, KPDFDocument *document );
void clearText();
private:
KPDFDocument * m_document;
KPopupMenu * m_menu;
- QTimer * m_inputDelayTimer;
+ TQTimer * m_inputDelayTimer;
int m_searchType;
bool m_caseSensitive;
private slots:
- void slotTextChanged( const QString & text );
+ void slotTextChanged( const TQString & text );
void slotMenuChaged( int index );
void startSearch();
};
diff --git a/kpdf/ui/thumbnaillist.cpp b/kpdf/ui/thumbnaillist.cpp
index 60324533..49d22ee3 100644
--- a/kpdf/ui/thumbnaillist.cpp
+++ b/kpdf/ui/thumbnaillist.cpp
@@ -8,8 +8,8 @@
***************************************************************************/
// qt/kde includes
-#include <qtimer.h>
-#include <qpainter.h>
+#include <tqtimer.h>
+#include <tqpainter.h>
#include <klocale.h>
#include <kurl.h>
#include <kurldrag.h>
@@ -30,7 +30,7 @@
class ThumbnailWidget : public QWidget
{
public:
- ThumbnailWidget( QWidget * parent, const KPDFPage * page, ThumbnailList * tl );
+ ThumbnailWidget( TQWidget * parent, const KPDFPage * page, ThumbnailList * tl );
// set internal parameters to fit the page in the given width
void resizeFitWidth( int width );
@@ -45,8 +45,8 @@ class ThumbnailWidget : public QWidget
const KPDFPage * page() const { return m_page; }
protected:
- void mouseReleaseEvent( QMouseEvent * e );
- void paintEvent(QPaintEvent *);
+ void mouseReleaseEvent( TQMouseEvent * e );
+ void paintEvent(TQPaintEvent *);
private:
// the margin around the widget
@@ -63,13 +63,13 @@ class ThumbnailWidget : public QWidget
/** ThumbnailList implementation **/
-ThumbnailList::ThumbnailList( QWidget *parent, KPDFDocument *document )
- : QScrollView( parent, "KPDF::Thumbnails", WNoAutoErase | WStaticContents ),
+ThumbnailList::ThumbnailList( TQWidget *parent, KPDFDocument *document )
+ : TQScrollView( parent, "KPDF::Thumbnails", WNoAutoErase | WStaticContents ),
m_document( document ), m_selected( 0 ), m_delayTimer( 0 ), m_bookmarkOverlay( 0 )
{
// set scrollbars
- setHScrollBarMode( QScrollView::AlwaysOff );
- setVScrollBarMode( QScrollView::AlwaysOn );
+ setHScrollBarMode( TQScrollView::AlwaysOff );
+ setVScrollBarMode( TQScrollView::AlwaysOn );
// dealing with large areas so enable clipper
enableClipper( true );
@@ -85,7 +85,7 @@ ThumbnailList::ThumbnailList( QWidget *parent, KPDFDocument *document )
viewport()->setPaletteBackgroundColor( palette().active().base() );
setFrameStyle( StyledPanel | Raised );
- connect( this, SIGNAL(contentsMoving(int, int)), this, SLOT(slotRequestVisiblePixmaps(int, int)) );
+ connect( this, TQT_SIGNAL(contentsMoving(int, int)), this, TQT_SLOT(slotRequestVisiblePixmaps(int, int)) );
}
ThumbnailList::~ThumbnailList()
@@ -95,7 +95,7 @@ ThumbnailList::~ThumbnailList()
}
//BEGIN DocumentObserver inherited methods
-void ThumbnailList::notifySetup( const QValueVector< KPDFPage * > & pages, bool documentChanged )
+void ThumbnailList::notifySetup( const TQValueVector< KPDFPage * > & pages, bool documentChanged )
{
// if there was a widget selected, save its pagenumber to restore
// its selection (if available in the new set of pages)
@@ -106,7 +106,7 @@ void ThumbnailList::notifySetup( const QValueVector< KPDFPage * > & pages, bool
}
// delete all the Thumbnails
- QValueVector<ThumbnailWidget *>::iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
+ TQValueVector<ThumbnailWidget *>::iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
for ( ; tIt != tEnd; ++tIt )
delete *tIt;
m_thumbnails.clear();
@@ -123,7 +123,7 @@ void ThumbnailList::notifySetup( const QValueVector< KPDFPage * > & pages, bool
//RESTORE THIS int flags = Settings::filterBookmarks() ? KPDFPage::Bookmark : KPDFPage::Highlight;
// if no page matches filter rule, then display all pages
- QValueVector< KPDFPage * >::const_iterator pIt = pages.begin(), pEnd = pages.end();
+ TQValueVector< KPDFPage * >::const_iterator pIt = pages.begin(), pEnd = pages.end();
bool skipCheck = true;
for ( ; pIt != pEnd ; ++pIt )
//if ( (*pIt)->attributes() & flags )
@@ -175,7 +175,7 @@ void ThumbnailList::notifyViewportChanged( bool /*smoothMove*/ )
// select the page with viewport and ensure it's centered in the view
m_vectorIndex = 0;
- QValueVector<ThumbnailWidget *>::iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
+ TQValueVector<ThumbnailWidget *>::iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
for ( ; tIt != tEnd; ++tIt )
{
if ( (*tIt)->pageNumber() == newPage )
@@ -200,7 +200,7 @@ void ThumbnailList::notifyPageChanged( int pageNumber, int /*changedFlags*/ )
// return;
// iterate over visible items: if page(pageNumber) is one of them, repaint it
- QValueList<ThumbnailWidget *>::iterator vIt = m_visibleThumbnails.begin(), vEnd = m_visibleThumbnails.end();
+ TQValueList<ThumbnailWidget *>::iterator vIt = m_visibleThumbnails.begin(), vEnd = m_visibleThumbnails.end();
for ( ; vIt != vEnd; ++vIt )
if ( (*vIt)->pageNumber() == pageNumber )
{
@@ -219,7 +219,7 @@ void ThumbnailList::notifyContentsCleared( int changedFlags )
bool ThumbnailList::canUnloadPixmap( int pageNumber )
{
// if the thubnail 'pageNumber' is one of the visible ones, forbid unloading
- QValueList<ThumbnailWidget *>::iterator vIt = m_visibleThumbnails.begin(), vEnd = m_visibleThumbnails.end();
+ TQValueList<ThumbnailWidget *>::iterator vIt = m_visibleThumbnails.begin(), vEnd = m_visibleThumbnails.end();
for ( ; vIt != vEnd; ++vIt )
if ( (*vIt)->pageNumber() == pageNumber )
return false;
@@ -232,14 +232,14 @@ bool ThumbnailList::canUnloadPixmap( int pageNumber )
void ThumbnailList::updateWidgets()
{
// find all widgets that intersects the viewport and update them
- QRect viewportRect( contentsX(), contentsY(), visibleWidth(), visibleHeight() );
- QValueList<ThumbnailWidget *>::iterator vIt = m_visibleThumbnails.begin(), vEnd = m_visibleThumbnails.end();
+ TQRect viewportRect( contentsX(), contentsY(), visibleWidth(), visibleHeight() );
+ TQValueList<ThumbnailWidget *>::iterator vIt = m_visibleThumbnails.begin(), vEnd = m_visibleThumbnails.end();
for ( ; vIt != vEnd; ++vIt )
{
ThumbnailWidget * t = *vIt;
- QRect widgetRect( childX( t ), childY( t ), t->width(), t->height() );
+ TQRect widgetRect( childX( t ), childY( t ), t->width(), t->height() );
// update only the exposed area of the widget (saves pixels..)
- QRect relativeRect = viewportRect.intersect( widgetRect );
+ TQRect relativeRect = viewportRect.intersect( widgetRect );
if ( !relativeRect.isValid() )
continue;
relativeRect.moveBy( -widgetRect.left(), -widgetRect.top() );
@@ -247,12 +247,12 @@ void ThumbnailList::updateWidgets()
}
}
-void ThumbnailList::forwardRightClick( const KPDFPage * p, const QPoint & t )
+void ThumbnailList::forwardRightClick( const KPDFPage * p, const TQPoint & t )
{
emit rightClick( p, t );
}
-const QPixmap * ThumbnailList::getBookmarkOverlay() const
+const TQPixmap * ThumbnailList::getBookmarkOverlay() const
{
return m_bookmarkOverlay;
}
@@ -270,7 +270,7 @@ void ThumbnailList::slotFilterBookmarks( bool filterOn )
//BEGIN widget events
-void ThumbnailList::keyPressEvent( QKeyEvent * keyEvent )
+void ThumbnailList::keyPressEvent( TQKeyEvent * keyEvent )
{
if ( m_thumbnails.count() < 1 )
return keyEvent->ignore();
@@ -309,12 +309,12 @@ void ThumbnailList::keyPressEvent( QKeyEvent * keyEvent )
m_document->setViewportPage( nextPage );
}
-void ThumbnailList::contentsMousePressEvent( QMouseEvent * e )
+void ThumbnailList::contentsMousePressEvent( TQMouseEvent * e )
{
if ( e->button() != Qt::LeftButton )
return;
int clickY = e->y();
- QValueList<ThumbnailWidget *>::iterator vIt = m_visibleThumbnails.begin(), vEnd = m_visibleThumbnails.end();
+ TQValueList<ThumbnailWidget *>::iterator vIt = m_visibleThumbnails.begin(), vEnd = m_visibleThumbnails.end();
for ( ; vIt != vEnd; ++vIt )
{
ThumbnailWidget * t = *vIt;
@@ -328,7 +328,7 @@ void ThumbnailList::contentsMousePressEvent( QMouseEvent * e )
}
}
-void ThumbnailList::viewportResizeEvent( QResizeEvent * e )
+void ThumbnailList::viewportResizeEvent( TQResizeEvent * e )
{
if ( m_thumbnails.count() < 1 || width() < 1 )
return;
@@ -343,7 +343,7 @@ void ThumbnailList::viewportResizeEvent( QResizeEvent * e )
// resize and reposition items
int totalHeight = 0,
newWidth = e->size().width();
- QValueVector<ThumbnailWidget *>::iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
+ TQValueVector<ThumbnailWidget *>::iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
for ( ; tIt != tEnd; ++tIt )
{
ThumbnailWidget *t = *tIt;
@@ -373,12 +373,12 @@ void ThumbnailList::viewportResizeEvent( QResizeEvent * e )
delayedRequestVisiblePixmaps( 500 );
}
-void ThumbnailList::dragEnterEvent( QDragEnterEvent * ev )
+void ThumbnailList::dragEnterEvent( TQDragEnterEvent * ev )
{
ev->accept();
}
-void ThumbnailList::dropEvent( QDropEvent * ev )
+void ThumbnailList::dropEvent( TQDropEvent * ev )
{
KURL::List lst;
if ( KURLDrag::decode( ev, lst ) )
@@ -398,8 +398,8 @@ void ThumbnailList::slotRequestVisiblePixmaps( int /*newContentsX*/, int newCont
// scroll from the top to the last visible thumbnail
m_visibleThumbnails.clear();
- QValueList< PixmapRequest * > requestedPixmaps;
- QValueVector<ThumbnailWidget *>::iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
+ TQValueList< PixmapRequest * > requestedPixmaps;
+ TQValueVector<ThumbnailWidget *>::iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end();
for ( ; tIt != tEnd; ++tIt )
{
ThumbnailWidget * t = *tIt;
@@ -430,7 +430,7 @@ void ThumbnailList::slotDelayTimeout()
delete m_bookmarkOverlay;
int expectedWidth = contentsWidth() / 4;
if ( expectedWidth > 10 )
- m_bookmarkOverlay = new QPixmap( DesktopIcon( "attach", expectedWidth ) );
+ m_bookmarkOverlay = new TQPixmap( DesktopIcon( "attach", expectedWidth ) );
else
m_bookmarkOverlay = 0;
@@ -443,8 +443,8 @@ void ThumbnailList::delayedRequestVisiblePixmaps( int delayMs )
{
if ( !m_delayTimer )
{
- m_delayTimer = new QTimer( this );
- connect( m_delayTimer, SIGNAL( timeout() ), this, SLOT( slotDelayTimeout() ) );
+ m_delayTimer = new TQTimer( this );
+ connect( m_delayTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( slotDelayTimeout() ) );
}
m_delayTimer->start( delayMs, true );
}
@@ -452,12 +452,12 @@ void ThumbnailList::delayedRequestVisiblePixmaps( int delayMs )
/** ThumbnailWidget implementation **/
-ThumbnailWidget::ThumbnailWidget( QWidget * parent, const KPDFPage * kp, ThumbnailList * tl )
- : QWidget( parent, 0, WNoAutoErase ), m_tl( tl ), m_page( kp ),
+ThumbnailWidget::ThumbnailWidget( TQWidget * parent, const KPDFPage * kp, ThumbnailList * tl )
+ : TQWidget( parent, 0, WNoAutoErase ), m_tl( tl ), m_page( kp ),
m_selected( false ), m_pixmapWidth( 10 ), m_pixmapHeight( 10 )
{
m_labelNumber = m_page->number() + 1;
- m_labelHeight = QFontMetrics( font() ).height();
+ m_labelHeight = TQFontMetrics( font() ).height();
}
void ThumbnailWidget::resizeFitWidth( int width )
@@ -477,7 +477,7 @@ void ThumbnailWidget::setSelected( bool selected )
}
}
-void ThumbnailWidget::mouseReleaseEvent( QMouseEvent * e )
+void ThumbnailWidget::mouseReleaseEvent( TQMouseEvent * e )
{
if ( e->button() != Qt::RightButton )
return;
@@ -485,20 +485,20 @@ void ThumbnailWidget::mouseReleaseEvent( QMouseEvent * e )
m_tl->forwardRightClick( m_page, e->globalPos() );
}
-void ThumbnailWidget::paintEvent( QPaintEvent * e )
+void ThumbnailWidget::paintEvent( TQPaintEvent * e )
{
int width = m_pixmapWidth + m_margin;
int height = m_pixmapHeight + m_margin + m_labelHeight;
- QRect clipRect = e->rect();
+ TQRect clipRect = e->rect();
if ( !clipRect.isValid() )
return;
- QPainter p( this );
+ TQPainter p( this );
// draw the bottom label + highlight mark
- QColor fillColor = m_selected ? palette().active().highlight() : palette().active().base();
+ TQColor fillColor = m_selected ? palette().active().highlight() : palette().active().base();
p.fillRect( 0, 0, width, height, fillColor );
p.setPen( m_selected ? palette().active().highlightedText() : palette().active().text() );
- p.drawText( 0, m_pixmapHeight + m_margin, width, m_labelHeight, Qt::AlignCenter, QString::number( m_labelNumber ) );
+ p.drawText( 0, m_pixmapHeight + m_margin, width, m_labelHeight, Qt::AlignCenter, TQString::number( m_labelNumber ) );
// draw page outline and pixmap
if ( clipRect.top() < m_pixmapHeight + m_margin )
@@ -506,10 +506,10 @@ void ThumbnailWidget::paintEvent( QPaintEvent * e )
// if page is bookmarked draw a colored border
bool isBookmarked = m_page->hasBookmark();
// draw the inner rect
- p.setPen( isBookmarked ? QColor( 0xFF8000 ) : Qt::black );
+ p.setPen( isBookmarked ? TQColor( 0xFF8000 ) : Qt::black );
p.drawRect( m_margin/2 - 1, m_margin/2 - 1, m_pixmapWidth + 2, m_pixmapHeight + 2 );
// draw the clear rect
- p.setPen( isBookmarked ? QColor( 0x804000 ) : palette().active().base() );
+ p.setPen( isBookmarked ? TQColor( 0x804000 ) : palette().active().base() );
// draw the bottom and right shadow edges
if ( !isBookmarked )
{
@@ -526,7 +526,7 @@ void ThumbnailWidget::paintEvent( QPaintEvent * e )
// draw the page using the shared PagePainter class
p.translate( m_margin/2, m_margin/2 );
clipRect.moveBy( -m_margin/2, -m_margin/2 );
- clipRect = clipRect.intersect( QRect( 0, 0, m_pixmapWidth, m_pixmapHeight ) );
+ clipRect = clipRect.intersect( TQRect( 0, 0, m_pixmapWidth, m_pixmapHeight ) );
if ( clipRect.isValid() )
{
int flags = PagePainter::Accessibility | PagePainter::Highlights;
@@ -535,12 +535,12 @@ void ThumbnailWidget::paintEvent( QPaintEvent * e )
}
// draw the bookmark overlay on the top-right corner
- const QPixmap * bookmarkPixmap = m_tl->getBookmarkOverlay();
+ const TQPixmap * bookmarkPixmap = m_tl->getBookmarkOverlay();
if ( isBookmarked && bookmarkPixmap )
{
int pixW = bookmarkPixmap->width(),
pixH = bookmarkPixmap->height();
- clipRect = clipRect.intersect( QRect( m_pixmapWidth - pixW, 0, pixW, pixH ) );
+ clipRect = clipRect.intersect( TQRect( m_pixmapWidth - pixW, 0, pixW, pixH ) );
if ( clipRect.isValid() )
p.drawPixmap( m_pixmapWidth - pixW, -pixH/8, *bookmarkPixmap );
}
@@ -552,7 +552,7 @@ void ThumbnailWidget::paintEvent( QPaintEvent * e )
#define FILTERB_ID 1
-ThumbnailController::ThumbnailController( QWidget * parent, ThumbnailList * list )
+ThumbnailController::ThumbnailController( TQWidget * parent, ThumbnailList * list )
: KToolBar( parent, "ThumbsControlBar" )
{
// change toolbar appearance
@@ -563,8 +563,8 @@ ThumbnailController::ThumbnailController( QWidget * parent, ThumbnailList * list
// insert a togglebutton [show only bookmarked pages]
//insertSeparator();
- insertButton( "bookmark", FILTERB_ID, SIGNAL( toggled( bool ) ),
- list, SLOT( slotFilterBookmarks( bool ) ),
+ insertButton( "bookmark", FILTERB_ID, TQT_SIGNAL( toggled( bool ) ),
+ list, TQT_SLOT( slotFilterBookmarks( bool ) ),
true, i18n( "Show bookmarked pages only" ) );
setToggle( FILTERB_ID );
setButton( FILTERB_ID, KpdfSettings::filterBookmarks() );
diff --git a/kpdf/ui/thumbnaillist.h b/kpdf/ui/thumbnaillist.h
index e0f84610..a3f81b11 100644
--- a/kpdf/ui/thumbnaillist.h
+++ b/kpdf/ui/thumbnaillist.h
@@ -10,13 +10,13 @@
#ifndef _KPDF_THUMBNAILLIST_H_
#define _KPDF_THUMBNAILLIST_H_
-#include <qscrollview.h>
-#include <qvaluevector.h>
-#include <qvbox.h>
+#include <tqscrollview.h>
+#include <tqvaluevector.h>
+#include <tqvbox.h>
#include <ktoolbar.h>
#include "core/observer.h"
-class QTimer;
+class TQTimer;
class KActionCollection;
class KPDFDocument;
@@ -27,17 +27,17 @@ class ThumbnailWidget;
*
* ...
*/
-class ThumbnailList : public QScrollView, public DocumentObserver
+class ThumbnailList : public TQScrollView, public DocumentObserver
{
Q_OBJECT
public:
- ThumbnailList(QWidget *parent, KPDFDocument *document);
+ ThumbnailList(TQWidget *parent, KPDFDocument *document);
~ThumbnailList();
// inherited: return thumbnails observer id
uint observerId() const { return THUMBNAILS_ID; }
// inherited: create thumbnails ( inherited as a DocumentObserver )
- void notifySetup( const QValueVector< KPDFPage * > & pages, bool documentChanged );
+ void notifySetup( const TQValueVector< KPDFPage * > & pages, bool documentChanged );
// inherited: hilihght current thumbnail ( inherited as DocumentObserver )
void notifyViewportChanged( bool smoothMove );
// inherited: redraw thumbnail ( inherited as DocumentObserver )
@@ -51,9 +51,9 @@ Q_OBJECT
void updateWidgets();
// called by ThumbnailWidgets to send (forward) rightClick signals
- void forwardRightClick( const KPDFPage *, const QPoint & );
+ void forwardRightClick( const KPDFPage *, const TQPoint & );
// called by ThumbnailWidgets to get the overlay bookmark pixmap
- const QPixmap * getBookmarkOverlay() const;
+ const TQPixmap * getBookmarkOverlay() const;
public slots:
// these are connected to ThumbnailController buttons
@@ -61,30 +61,30 @@ Q_OBJECT
protected:
// scroll up/down the view
- void keyPressEvent( QKeyEvent * e );
+ void keyPressEvent( TQKeyEvent * e );
// select a thumbnail by clicking on it
- void contentsMousePressEvent( QMouseEvent * );
+ void contentsMousePressEvent( TQMouseEvent * );
// resize thumbnails to fit the width
- void viewportResizeEvent( QResizeEvent * );
+ void viewportResizeEvent( TQResizeEvent * );
// file drop related events (an url may be dropped even here)
- void dragEnterEvent( QDragEnterEvent* );
- void dropEvent( QDropEvent* );
+ void dragEnterEvent( TQDragEnterEvent* );
+ void dropEvent( TQDropEvent* );
signals:
void urlDropped( const KURL& );
- void rightClick( const KPDFPage *, const QPoint & );
+ void rightClick( const KPDFPage *, const TQPoint & );
private:
void delayedRequestVisiblePixmaps( int delayMs = 0 );
KPDFDocument *m_document;
ThumbnailWidget *m_selected;
- QTimer *m_delayTimer;
- QPixmap *m_bookmarkOverlay;
- QValueVector<ThumbnailWidget *> m_thumbnails;
- QValueList<ThumbnailWidget *> m_visibleThumbnails;
+ TQTimer *m_delayTimer;
+ TQPixmap *m_bookmarkOverlay;
+ TQValueVector<ThumbnailWidget *> m_thumbnails;
+ TQValueList<ThumbnailWidget *> m_visibleThumbnails;
int m_vectorIndex;
private slots:
@@ -100,8 +100,8 @@ Q_OBJECT
class ThumbnailsBox : public QVBox
{
public:
- ThumbnailsBox( QWidget * parent ) : QVBox( parent ) {};
- QSize sizeHint() const { return QSize(); }
+ ThumbnailsBox( TQWidget * parent ) : TQVBox( parent ) {};
+ TQSize sizeHint() const { return TQSize(); }
};
/**
@@ -115,7 +115,7 @@ class ThumbnailsBox : public QVBox
class ThumbnailController : public KToolBar
{
public:
- ThumbnailController( QWidget * parent, ThumbnailList * thumbnailList );
+ ThumbnailController( TQWidget * parent, ThumbnailList * thumbnailList );
};
#endif
diff --git a/kpdf/ui/toc.cpp b/kpdf/ui/toc.cpp
index 6db19933..015ba313 100644
--- a/kpdf/ui/toc.cpp
+++ b/kpdf/ui/toc.cpp
@@ -8,8 +8,8 @@
***************************************************************************/
// qt/kde includes
-#include <qheader.h>
-#include <qvariant.h>
+#include <tqheader.h>
+#include <tqvariant.h>
#include <klocale.h>
// local includes
@@ -25,7 +25,7 @@
class TOCItem : public KListViewItem
{
public:
- TOCItem( KListView *parent, TOCItem *after, const QDomElement & e )
+ TOCItem( KListView *parent, TOCItem *after, const TQDomElement & e )
: KListViewItem( parent, after, e.tagName() ), m_element( e )
{
#ifdef TOC_ENABLE_PAGE_COLUMN
@@ -35,7 +35,7 @@ class TOCItem : public KListViewItem
setMultiLinesEnabled(true);
}
- TOCItem( KListViewItem *parent, TOCItem *after, const QDomElement & e )
+ TOCItem( KListViewItem *parent, TOCItem *after, const TQDomElement & e )
: KListViewItem( parent, after, e.tagName() ), m_element( e )
{
#ifdef TOC_ENABLE_PAGE_COLUMN
@@ -45,16 +45,16 @@ class TOCItem : public KListViewItem
setMultiLinesEnabled(true);
}
- const QDomElement & element() const
+ const TQDomElement & element() const
{
return m_element;
}
private:
- QDomElement m_element;
+ TQDomElement m_element;
};
-TOC::TOC(QWidget *parent, KPDFDocument *document) : KListView(parent), m_document(document)
+TOC::TOC(TQWidget *parent, KPDFDocument *document) : KListView(parent), m_document(document)
{
addColumn( i18n("Topic") );
#ifdef TOC_ENABLE_PAGE_COLUMN
@@ -67,8 +67,8 @@ TOC::TOC(QWidget *parent, KPDFDocument *document) : KListView(parent), m_documen
// the next line causes bug:147233
// setResizeMode(AllColumns);
setAllColumnsShowFocus(true);
- connect(this, SIGNAL(clicked(QListViewItem *)), this, SLOT(slotExecuted(QListViewItem *)));
- connect(this, SIGNAL(returnPressed(QListViewItem *)), this, SLOT(slotExecuted(QListViewItem *)));
+ connect(this, TQT_SIGNAL(clicked(TQListViewItem *)), this, TQT_SLOT(slotExecuted(TQListViewItem *)));
+ connect(this, TQT_SIGNAL(returnPressed(TQListViewItem *)), this, TQT_SLOT(slotExecuted(TQListViewItem *)));
}
TOC::~TOC()
@@ -81,7 +81,7 @@ uint TOC::observerId() const
return TOC_ID;
}
-void TOC::notifySetup( const QValueVector< KPDFPage * > & /*pages*/, bool documentChanged )
+void TOC::notifySetup( const TQValueVector< KPDFPage * > & /*pages*/, bool documentChanged )
{
if ( !documentChanged )
return;
@@ -104,15 +104,15 @@ void TOC::notifySetup( const QValueVector< KPDFPage * > & /*pages*/, bool docume
emit hasTOC( true );
}
-void TOC::addChildren( const QDomNode & parentNode, KListViewItem * parentItem )
+void TOC::addChildren( const TQDomNode & parentNode, KListViewItem * parentItem )
{
// keep track of the current listViewItem
TOCItem * currentItem = 0;
- QDomNode n = parentNode.firstChild();
+ TQDomNode n = parentNode.firstChild();
while( !n.isNull() )
{
// convert the node to an element (sure it is)
- QDomElement e = n.toElement();
+ TQDomElement e = n.toElement();
// insert the entry as top level (listview parented) or 2nd+ level
if ( !parentItem )
@@ -127,22 +127,22 @@ void TOC::addChildren( const QDomNode & parentNode, KListViewItem * parentItem )
// open/keep close the item
bool isOpen = false;
if ( e.hasAttribute( "Open" ) )
- isOpen = QVariant( e.attribute( "Open" ) ).toBool();
+ isOpen = TQVariant( e.attribute( "Open" ) ).toBool();
currentItem->setOpen( isOpen );
n = n.nextSibling();
}
}
-void TOC::slotExecuted( QListViewItem *i )
+void TOC::slotExecuted( TQListViewItem *i )
{
TOCItem* tocItem = dynamic_cast<TOCItem*>( i );
// that filters clicks on [+] that for a strange reason don't seem to be TOCItem*
if (tocItem == NULL)
return;
- const QDomElement & e = tocItem->element();
+ const TQDomElement & e = tocItem->element();
- QString externalFileName = e.attribute( "ExternalFileName" );
+ TQString externalFileName = e.attribute( "ExternalFileName" );
if ( !externalFileName.isEmpty() )
{
KPDFLinkGoto link( externalFileName, getViewport( e ) );
@@ -154,7 +154,7 @@ void TOC::slotExecuted( QListViewItem *i )
}
}
-DocumentViewport TOC::getViewport( const QDomElement &e ) const
+DocumentViewport TOC::getViewport( const TQDomElement &e ) const
{
if ( e.hasAttribute( "Viewport" ) )
{
@@ -164,8 +164,8 @@ DocumentViewport TOC::getViewport( const QDomElement &e ) const
else if ( e.hasAttribute( "ViewportName" ) )
{
// if the node references a viewport, get the reference and set it
- const QString & page = e.attribute( "ViewportName" );
- const QString & viewport = m_document->getMetaData( "NamedViewport", page );
+ const TQString & page = e.attribute( "ViewportName" );
+ const TQString & viewport = m_document->getMetaData( "NamedViewport", page );
if ( !viewport.isNull() )
return DocumentViewport( viewport );
}
diff --git a/kpdf/ui/toc.h b/kpdf/ui/toc.h
index eaa398a5..0f2915fd 100644
--- a/kpdf/ui/toc.h
+++ b/kpdf/ui/toc.h
@@ -10,7 +10,7 @@
#ifndef _KPDF_TOC_H_
#define _KPDF_TOC_H_
-#include <qdom.h>
+#include <tqdom.h>
#include <klistview.h>
#include "core/document.h"
#include "core/observer.h"
@@ -21,22 +21,22 @@ class TOC : public KListView, public DocumentObserver
{
Q_OBJECT
public:
- TOC(QWidget *parent, KPDFDocument *document);
+ TOC(TQWidget *parent, KPDFDocument *document);
~TOC();
// inherited from DocumentObserver
uint observerId() const;
- void notifySetup( const QValueVector< KPDFPage * > & pages, bool documentChanged );
+ void notifySetup( const TQValueVector< KPDFPage * > & pages, bool documentChanged );
signals:
void hasTOC(bool has);
private slots:
- void slotExecuted(QListViewItem *i);
+ void slotExecuted(TQListViewItem *i);
private:
- void addChildren( const QDomNode & parentNode, KListViewItem * parentItem = 0 );
- DocumentViewport getViewport( const QDomElement &e ) const;
+ void addChildren( const TQDomNode & parentNode, KListViewItem * parentItem = 0 );
+ DocumentViewport getViewport( const TQDomElement &e ) const;
KPDFDocument *m_document;
};
diff --git a/kpdf/xpdf/xpdf/GlobalParams.cc b/kpdf/xpdf/xpdf/GlobalParams.cc
index b1083777..519e81a4 100644
--- a/kpdf/xpdf/xpdf/GlobalParams.cc
+++ b/kpdf/xpdf/xpdf/GlobalParams.cc
@@ -15,9 +15,9 @@
#include <string.h>
#include <strings.h>
// KPDF: additional includes for Qt and Xft
-#include <qstring.h>
-#include <qregexp.h>
-#include <qwindowdefs.h>
+#include <tqstring.h>
+#include <tqregexp.h>
+#include <tqwindowdefs.h>
// -- gentoo compile fix (XFree 4.3.0, FC 2.2.3, FreeType 2.1.9) --
// on other distros these 2 lines should't harm
#include <ft2build.h>
@@ -57,8 +57,8 @@
#endif
#include "GlobalParams.h"
-#include <qstring.h>
-#include <qregexp.h>
+#include <tqstring.h>
+#include <tqregexp.h>
#include <fontconfig/fontconfig.h>
#ifdef WIN32
@@ -699,7 +699,7 @@ GlobalParams::GlobalParams(char *cfgFileName) {
psPreload = gFalse;
psOPI = gFalse;
psASCIIHex = gFalse;
- // KPDF: use always UTF-8 and QString::fromUtf
+ // KPDF: use always UTF-8 and TQString::fromUtf
textEncoding = new GString("UTF-8");
#if defined(WIN32)
textEOL = eolDOS;
@@ -1057,7 +1057,7 @@ void GlobalParams::parseLine(char *buf, GString *fileName, int line) {
} else if (!cmd->cmp("psASCIIHex")) {
parseYesNo("psASCIIHex", &psASCIIHex, tokens, fileName, line);
} else if (!cmd->cmp("textEncoding")) {
-// Always use UTF-8 and allow QString do the magic
+// Always use UTF-8 and allow TQString do the magic
// parseTextEncoding(tokens, fileName, line);
} else if (!cmd->cmp("textEOL")) {
parseTextEOL(tokens, fileName, line);
@@ -2055,13 +2055,13 @@ FILE *GlobalParams::findToUnicodeFile(GString *name) {
// KPDF: parse xpdf font name into family and style
// Helvetica-BoldOblique => name=Helvetica, weight=Bold, slant=Oblique
-void parseStyle(QString& name, int& weight, int& slant, int& width)
+void parseStyle(TQString& name, int& weight, int& slant, int& width)
{
if (name.find("MS-") == 0) name = "MS " + name.remove(0,3);
if (!name.contains('-') && !name.contains(',')) return;
- QString type = name.section(QRegExp("[-,]"),-1);
- name = name.section(QRegExp("[-,]"),0,-2);
+ TQString type = name.section(TQRegExp("[-,]"),-1);
+ name = name.section(TQRegExp("[-,]"),0,-2);
if (type.contains("Oblique")) slant=FC_SLANT_OBLIQUE;
if (type.contains("Italic")) slant=FC_SLANT_ITALIC;
if (type.contains("Bold")) weight=FC_WEIGHT_BOLD;
@@ -2081,7 +2081,7 @@ DisplayFontParam *GlobalParams::getDisplayFont(GString *fontName) {
// KPDF: try to find font using Xft
if (!dfp) {
int weight=FC_WEIGHT_MEDIUM, slant=FC_SLANT_ROMAN, width=FC_WIDTH_NORMAL;
- QString name(fontName->getCString());
+ TQString name(fontName->getCString());
parseStyle(name,weight,slant,width);
p = FcPatternBuild(0,FC_FAMILY,FcTypeString, name.ascii(),