summaryrefslogtreecommitdiffstats
path: root/kpdf/ui
diff options
context:
space:
mode:
Diffstat (limited to 'kpdf/ui')
-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
18 files changed, 612 insertions, 612 deletions
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;
};