summaryrefslogtreecommitdiffstats
path: root/kword/KWCanvas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kword/KWCanvas.cpp')
-rw-r--r--kword/KWCanvas.cpp592
1 files changed, 296 insertions, 296 deletions
diff --git a/kword/KWCanvas.cpp b/kword/KWCanvas.cpp
index 37fd0ff5..2e147e6c 100644
--- a/kword/KWCanvas.cpp
+++ b/kword/KWCanvas.cpp
@@ -38,13 +38,13 @@
#include "KWFrameView.h"
#include "KWFrameViewManager.h"
-#include <qbuffer.h>
-#include <qtimer.h>
-#include <qclipboard.h>
-#include <qprogressdialog.h>
-#include <qobjectlist.h>
-#include <qapplication.h>
-#include <qwhatsthis.h>
+#include <tqbuffer.h>
+#include <tqtimer.h>
+#include <tqclipboard.h>
+#include <tqprogressdialog.h>
+#include <tqobjectlist.h>
+#include <tqapplication.h>
+#include <tqwhatsthis.h>
#include <KoStore.h>
#include <KoStoreDrag.h>
@@ -63,8 +63,8 @@
#include <assert.h>
-KWCanvas::KWCanvas(const QString& viewMode, QWidget *parent, KWDocument *d, KWGUI *lGui)
- : QScrollView( parent, "canvas", /*WNorthWestGravity*/ WStaticContents| WResizeNoErase | WRepaintNoErase ), m_doc( d )
+KWCanvas::KWCanvas(const TQString& viewMode, TQWidget *tqparent, KWDocument *d, KWGUI *lGui)
+ : TQScrollView( tqparent, "canvas", /*WNorthWestGravity*/ WStaticContents| WResizeNoErase | WRepaintNoErase ), m_doc( d )
{
m_frameViewManager = new KWFrameViewManager(d);
m_gui = lGui;
@@ -91,7 +91,7 @@ KWCanvas::KWCanvas(const QString& viewMode, QWidget *parent, KWDocument *d, KWGU
m_table.width = KWTableFrameSet::TblAuto;
m_table.height = KWTableFrameSet::TblAuto;
m_table.floating = true;
- m_table.tableTemplateName=QString::null;
+ m_table.tableTemplateName=TQString();
m_table.format=31;
m_footEndNote.noteType = FootNote;
@@ -110,29 +110,29 @@ KWCanvas::KWCanvas(const QString& viewMode, QWidget *parent, KWDocument *d, KWGU
setKeyCompression( TRUE );
viewport()->setMouseTracking( TRUE );
- m_scrollTimer = new QTimer( this );
- connect( m_scrollTimer, SIGNAL( timeout() ),
- this, SLOT( doAutoScroll() ) );
+ m_scrollTimer = new TQTimer( this );
+ connect( m_scrollTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( doAutoScroll() ) );
viewport()->setFocusProxy( this );
- viewport()->setFocusPolicy( WheelFocus );
+ viewport()->setFocusPolicy( TQ_WheelFocus );
setInputMethodEnabled( true );
setFocus();
viewport()->installEventFilter( this );
installEventFilter( this );
KCursor::setAutoHideCursor( this, true, true );
- connect( this, SIGNAL(contentsMoving( int, int )),
- this, SLOT(slotContentsMoving( int, int )) );
+ connect( this, TQT_SIGNAL(contentsMoving( int, int )),
+ this, TQT_SLOT(slotContentsMoving( int, int )) );
- connect( m_doc, SIGNAL( newContentsSize() ),
- this, SLOT( slotNewContentsSize() ) );
+ connect( m_doc, TQT_SIGNAL( newContentsSize() ),
+ this, TQT_SLOT( slotNewContentsSize() ) );
- connect( m_doc, SIGNAL( mainTextHeightChanged() ),
- this, SLOT( slotMainTextHeightChanged() ) );
+ connect( m_doc, TQT_SIGNAL( mainTextHeightChanged() ),
+ this, TQT_SLOT( slotMainTextHeightChanged() ) );
- connect( m_doc, SIGNAL( sig_terminateEditing( KWFrameSet * ) ),
- this, SLOT( terminateEditing( KWFrameSet * ) ) );
+ connect( m_doc, TQT_SIGNAL( sig_terminateEditing( KWFrameSet * ) ),
+ this, TQT_SLOT( terminateEditing( KWFrameSet * ) ) );
slotNewContentsSize();
@@ -141,7 +141,7 @@ KWCanvas::KWCanvas(const QString& viewMode, QWidget *parent, KWDocument *d, KWGU
// Create the current frameset-edit last, to have everything ready for it
KWFrameSet * fs = 0L;
- QString fsName = m_doc->initialFrameSet();
+ TQString fsName = m_doc->initialFrameSet();
if ( !fsName.isEmpty() )
fs = m_doc->frameSetByName( fsName );
if ( !fs )
@@ -162,10 +162,10 @@ KWCanvas::KWCanvas(const QString& viewMode, QWidget *parent, KWDocument *d, KWGU
}
m_doc->deleteInitialEditingInfo();
- connect(frameViewManager(), SIGNAL(sigFrameResized(const QValueList<KWFrame*>&)),
- m_doc, SLOT(framesChanged(const QValueList<KWFrame*>&)));
- connect(frameViewManager(), SIGNAL(sigFrameMoved(const QValueList<KWFrame*>&)),
- m_doc, SLOT(framesChanged(const QValueList<KWFrame*>&)));
+ connect(frameViewManager(), TQT_SIGNAL(sigFrameResized(const TQValueList<KWFrame*>&)),
+ m_doc, TQT_SLOT(framesChanged(const TQValueList<KWFrame*>&)));
+ connect(frameViewManager(), TQT_SIGNAL(sigFrameMoved(const TQValueList<KWFrame*>&)),
+ m_doc, TQT_SLOT(framesChanged(const TQValueList<KWFrame*>&)));
}
KWCanvas::~KWCanvas()
@@ -175,41 +175,41 @@ KWCanvas::~KWCanvas()
m_currentFrameSetEdit = 0;
delete m_viewMode;
m_viewMode = 0;
- disconnect(frameViewManager(), SIGNAL(sigFrameResized(const QValueList<KWFrame*>&)),
- m_doc, SLOT(framesChanged(const QValueList<KWFrame*>&)));
- disconnect(frameViewManager(), SIGNAL(sigFrameMoved(const QValueList<KWFrame*>&)),
- m_doc, SLOT(framesChanged(const QValueList<KWFrame*>&)));
+ disconnect(frameViewManager(), TQT_SIGNAL(sigFrameResized(const TQValueList<KWFrame*>&)),
+ m_doc, TQT_SLOT(framesChanged(const TQValueList<KWFrame*>&)));
+ disconnect(frameViewManager(), TQT_SIGNAL(sigFrameMoved(const TQValueList<KWFrame*>&)),
+ m_doc, TQT_SLOT(framesChanged(const TQValueList<KWFrame*>&)));
delete m_frameViewManager;
m_frameViewManager = 0;
}
-void KWCanvas::repaintChanged( KWFrameSet * fs, bool resetChanged )
+void KWCanvas::tqrepaintChanged( KWFrameSet * fs, bool resetChanged )
{
assert(fs); // the new code can't support fs being 0L here. Mail me if it happens (DF)
- //kdDebug(32002) << "KWCanvas::repaintChanged this=" << this << " fs=" << fs << endl;
- QPainter p( viewport() );
+ //kdDebug(32002) << "KWCanvas::tqrepaintChanged this=" << this << " fs=" << fs << endl;
+ TQPainter p( viewport() );
p.translate( -contentsX(), -contentsY() );
p.setBrushOrigin( -contentsX(), -contentsY() );
- QRect crect( contentsX(), contentsY(), visibleWidth(), visibleHeight() );
+ TQRect crect( contentsX(), contentsY(), visibleWidth(), visibleHeight() );
drawFrameSet( fs, &p, crect, true, resetChanged, m_viewMode );
- // ###### This repaints the whole grid every time. Ouch.
- // We should return a QRegion from drawFrameSet.... Tricky.
+ // ###### This tqrepaints the whole grid every time. Ouch.
+ // We should return a TQRegion from drawFrameSet.... Tricky.
if ( m_doc->showGrid() )
drawGrid( p, crect );
}
-void KWCanvas::repaintAll( bool erase /* = false */ )
+void KWCanvas::tqrepaintAll( bool erase /* = false */ )
{
- //kdDebug(32002) << "KWCanvas::repaintAll erase=" << erase << endl;
- viewport()->repaint( erase );
+ //kdDebug(32002) << "KWCanvas::tqrepaintAll erase=" << erase << endl;
+ viewport()->tqrepaint( erase );
}
-void KWCanvas::viewportResizeEvent( QResizeEvent * )
+void KWCanvas::viewportResizeEvent( TQResizeEvent * )
{
viewport()->update();
}
-void KWCanvas::print( QPainter *painter, KPrinter *printer )
+void KWCanvas::print( TQPainter *painter, KPrinter *printer )
{
// Prevent cursor drawing and editing
if ( m_currentFrameSetEdit )
@@ -217,16 +217,16 @@ void KWCanvas::print( QPainter *painter, KPrinter *printer )
m_printing = true;
KWViewMode *viewMode = new KWViewModePrint( m_doc, this );
// Use page list specified in kdeprint dialogbox
- QValueList<int> pageList = printer->pageList();
- QProgressDialog progress( i18n( "Printing..." ), i18n( "Cancel" ),
+ TQValueList<int> pageList = printer->pageList();
+ TQProgressDialog progress( i18n( "Printing..." ), i18n( "Cancel" ),
pageList.count() + 1, this );
int j = 0;
progress.setProgress( 0 );
- QValueList<int>::Iterator it = pageList.begin();
+ TQValueList<int>::Iterator it = pageList.begin();
for ( ; it != pageList.end(); ++it )
{
progress.setProgress( ++j );
- qApp->processEvents();
+ tqApp->processEvents();
if ( progress.wasCancelled() )
break;
@@ -238,13 +238,13 @@ void KWCanvas::print( QPainter *painter, KPrinter *printer )
int pgNum = (*it);
int yOffset = m_doc->zoomItY( m_doc->pageManager()->topOfPage( pgNum ) );
kdDebug(32001) << "printing page " << pgNum << " yOffset=" << yOffset << endl;
- QRect pageRect = m_doc->pageManager()->page(pgNum)->zoomedRect(m_doc);
+ TQRect pageRect = m_doc->pageManager()->page(pgNum)->zoomedRect(m_doc);
painter->fillRect( pageRect, white );
painter->translate( 0, -yOffset );
painter->setBrushOrigin( 0, -yOffset );
drawDocument( painter, pageRect, viewMode );
- qApp->processEvents();
+ tqApp->processEvents();
painter->restore();
}
if ( m_currentFrameSetEdit )
@@ -253,36 +253,36 @@ void KWCanvas::print( QPainter *painter, KPrinter *printer )
delete viewMode;
}
-void KWCanvas::drawContents( QPainter *painter, int cx, int cy, int cw, int ch )
+void KWCanvas::drawContents( TQPainter *painter, int cx, int cy, int cw, int ch )
{
if ( isUpdatesEnabled() )
{
// Note: in drawContents, the painter is already translated to the contents coordinates
painter->setBrushOrigin( -contentsX(), -contentsY() );
- drawDocument( painter, QRect( cx, cy, cw, ch ), m_viewMode );
+ drawDocument( painter, TQRect( cx, cy, cw, ch ), m_viewMode );
if ( m_doc->showGrid() )
- drawGrid( *painter, QRect( cx, cy, cw, ch ) );
+ drawGrid( *painter, TQRect( cx, cy, cw, ch ) );
else if ( m_doc->snapToGrid() && ( m_interactionPolicy && m_interactionPolicy->gotDragEvents()
|| m_mouseMode != MM_EDIT ) )
- drawGrid( *painter, QRect(contentsX(), contentsY(), visibleWidth(), visibleHeight()) );
+ drawGrid( *painter, TQRect(contentsX(), contentsY(), visibleWidth(), visibleHeight()) );
}
}
-void KWCanvas::drawDocument( QPainter *painter, const QRect &crect, KWViewMode* viewMode )
+void KWCanvas::drawDocument( TQPainter *painter, const TQRect &crect, KWViewMode* viewMode )
{
//kdDebug(32002) << "KWCanvas::drawDocument crect: " << crect << endl;
// Draw the outside of the pages (shadow, gray area)
// and the empty area first (in case of transparent frames)
- if ( painter->device()->devType() != QInternal::Printer ) // except when printing
+ if ( painter->device()->devType() != TQInternal::Printer ) // except when printing
{
- QRegion emptySpaceRegion( crect );
+ TQRegion emptySpaceRegion( crect );
m_doc->createEmptyRegion( crect, emptySpaceRegion, viewMode );
viewMode->drawPageBorders( painter, crect, emptySpaceRegion );
}
// Draw all framesets contents
- QPtrListIterator<KWFrameSet> fit = m_doc->framesetsIterator();
+ TQPtrListIterator<KWFrameSet> fit = m_doc->framesetsIterator();
for ( ; fit.current() ; ++fit )
{
KWFrameSet * frameset = fit.current();
@@ -293,8 +293,8 @@ void KWCanvas::drawDocument( QPainter *painter, const QRect &crect, KWViewMode*
m_doc->maybeDeleteDoubleBufferPixmap();
}
-void KWCanvas::drawFrameSet( KWFrameSet * frameset, QPainter * painter,
- const QRect & crect, bool onlyChanged, bool resetChanged, KWViewMode* viewMode )
+void KWCanvas::drawFrameSet( KWFrameSet * frameset, TQPainter * painter,
+ const TQRect & crect, bool onlyChanged, bool resetChanged, KWViewMode* viewMode )
{
if ( !frameset->isVisible( viewMode ) )
return;
@@ -302,10 +302,10 @@ void KWCanvas::drawFrameSet( KWFrameSet * frameset, QPainter * painter,
return;
bool focus = hasFocus() || viewport()->hasFocus();
- if ( painter->device()->devType() == QInternal::Printer )
+ if ( painter->device()->devType() == TQInternal::Printer )
focus = false;
- QColorGroup gb = QApplication::palette().active();
+ TQColorGroup gb = TQApplication::tqpalette().active();
if ( focus && m_currentFrameSetEdit && frameset == m_currentFrameSetEdit->frameSet() )
// Currently edited frameset
m_currentFrameSetEdit->drawContents( painter, crect, gb, onlyChanged, resetChanged, viewMode, m_frameViewManager );
@@ -313,32 +313,32 @@ void KWCanvas::drawFrameSet( KWFrameSet * frameset, QPainter * painter,
frameset->drawContents( painter, crect, gb, onlyChanged, resetChanged, 0L, viewMode, m_frameViewManager );
}
-void KWCanvas::keyPressEvent( QKeyEvent *e )
+void KWCanvas::keyPressEvent( TQKeyEvent *e )
{
if( !m_doc->isReadWrite()) {
switch( e->key() ) {
- case Qt::Key_Down:
+ case TQt::Key_Down:
setContentsPos( contentsX(), contentsY() + 10 );
break;
- case Qt::Key_Up:
+ case TQt::Key_Up:
setContentsPos( contentsX(), contentsY() - 10 );
break;
- case Qt::Key_Left:
+ case TQt::Key_Left:
setContentsPos( contentsX() - 10, contentsY() );
break;
- case Qt::Key_Right:
+ case TQt::Key_Right:
setContentsPos( contentsX() + 10, contentsY() );
break;
- case Qt::Key_PageUp:
+ case TQt::Key_PageUp:
setContentsPos( contentsX(), contentsY() - visibleHeight() );
break;
- case Qt::Key_PageDown:
+ case TQt::Key_PageDown:
setContentsPos( contentsX(), contentsY() + visibleHeight() );
break;
- case Qt::Key_Home:
+ case TQt::Key_Home:
setContentsPos( contentsX(), 0 );
break;
- case Qt::Key_End:
+ case TQt::Key_End:
setContentsPos( contentsX(), contentsHeight() - visibleHeight() );
break;
default:
@@ -349,13 +349,13 @@ void KWCanvas::keyPressEvent( QKeyEvent *e )
// we don't get <Tab> key presses.
}
-void KWCanvas::switchViewMode( const QString& newViewMode )
+void KWCanvas::switchViewMode( const TQString& newViewMode )
{
delete m_viewMode;
m_viewMode = KWViewMode::create( newViewMode, m_doc, this );
}
-void KWCanvas::mpCreate( const QPoint& normalPoint, bool noGrid )
+void KWCanvas::mpCreate( const TQPoint& normalPoint, bool noGrid )
{
KoPoint docPoint = m_doc->unzoomPoint( normalPoint );
if ( m_doc->snapToGrid() && !noGrid )
@@ -364,7 +364,7 @@ void KWCanvas::mpCreate( const QPoint& normalPoint, bool noGrid )
m_deleteMovingRect = false;
}
-void KWCanvas::mpCreatePixmap( const QPoint& normalPoint, bool noGrid )
+void KWCanvas::mpCreatePixmap( const TQPoint& normalPoint, bool noGrid )
{
if ( !m_kopicture.isNull() )
{
@@ -379,8 +379,8 @@ void KWCanvas::mpCreatePixmap( const QPoint& normalPoint, bool noGrid )
if ( !m_pixmapSize.isEmpty() )
{
// This ensures 1-1 at 100% on screen, but allows zooming and printing with correct DPI values
- uint width = qRound( (double)m_pixmapSize.width() * m_doc->zoomedResolutionX() / POINT_TO_INCH( KoGlobal::dpiX() ) );
- uint height = qRound( (double)m_pixmapSize.height() * m_doc->zoomedResolutionY() / POINT_TO_INCH( KoGlobal::dpiY() ) );
+ uint width = tqRound( (double)m_pixmapSize.width() * m_doc->zoomedResolutionX() / POINT_TO_INCH( KoGlobal::dpiX() ) );
+ uint height = tqRound( (double)m_pixmapSize.height() * m_doc->zoomedResolutionY() / POINT_TO_INCH( KoGlobal::dpiY() ) );
m_insRect.setWidth( m_doc->unzoomItX( width ) );
m_insRect.setHeight( m_doc->unzoomItY( height ) );
// Apply reasonable limits
@@ -393,33 +393,33 @@ void KWCanvas::mpCreatePixmap( const QPoint& normalPoint, bool noGrid )
applyAspectRatio( ratio, m_insRect );
}
- QPoint nPoint( normalPoint.x() + m_doc->zoomItX( m_insRect.width() ),
+ TQPoint nPoint( normalPoint.x() + m_doc->zoomItX( m_insRect.width() ),
normalPoint.y() + m_doc->zoomItY( m_insRect.height() ) );
- QPoint vPoint = m_viewMode->normalToView( nPoint );
+ TQPoint vPoint = m_viewMode->normalToView( nPoint );
vPoint = contentsToViewport( vPoint );
- QRect viewportRect( contentsX(), contentsY(), visibleWidth(), visibleHeight() );
- if ( viewportRect.contains( vPoint ) ) // Don't move the mouse out of the viewport
- QCursor::setPos( viewport()->mapToGlobal( vPoint ) );
+ TQRect viewportRect( contentsX(), contentsY(), visibleWidth(), visibleHeight() );
+ if ( viewportRect.tqcontains( vPoint ) ) // Don't move the mouse out of the viewport
+ TQCursor::setPos( viewport()->mapToGlobal( vPoint ) );
}
emit docStructChanged(Pictures);
if ( !m_doc->showGrid() && m_doc->snapToGrid() )
- repaintContents( FALSE ); //draw the grid over the whole canvas
+ tqrepaintContents( FALSE ); //draw the grid over the whole canvas
}
}
-void KWCanvas::contentsMousePressEvent( QMouseEvent *e )
+void KWCanvas::contentsMousePressEvent( TQMouseEvent *e )
{
- QPoint normalPoint = m_viewMode->viewToNormal( e->pos() );
+ TQPoint normalPoint = m_viewMode->viewToNormal( e->pos() );
KoPoint docPoint = m_doc->unzoomPoint( normalPoint );
- if ( e->button() == LeftButton )
+ if ( e->button() == Qt::LeftButton )
{
m_mousePressed = true;
}
// Only edit-mode (and only LMB) allowed on read-only documents (to select text)
- if ( !m_doc->isReadWrite() && ( m_mouseMode != MM_EDIT || e->button() != LeftButton ) )
+ if ( !m_doc->isReadWrite() && ( m_mouseMode != MM_EDIT || e->button() != Qt::LeftButton ) )
return;
if ( m_printing )
return;
@@ -430,7 +430,7 @@ void KWCanvas::contentsMousePressEvent( QMouseEvent *e )
{
if(! viewMode()->hasFrames() ) { // for the text mode we just forward the click to the text
// first, make clicks left of text be on the border;
- docPoint = KoPoint(QMAX(0, docPoint.x()), QMAX(0, docPoint.y()));
+ docPoint = KoPoint(TQMAX(0, docPoint.x()), TQMAX(0, docPoint.y()));
if ( m_currentFrameSetEdit )
m_currentFrameSetEdit->mousePressEvent( e, normalPoint, docPoint );
break;
@@ -450,7 +450,7 @@ void KWCanvas::contentsMousePressEvent( QMouseEvent *e )
// RMB inside a frame unselects too, except when
// right-clicking on a selected frame
KWFrameView *view = m_frameViewManager->view( docPoint, KWFrameViewManager::frameOnTop );
- if ( ! ( e->button() == RightButton && view && view->selected() ) )
+ if ( ! ( e->button() == Qt::RightButton && view && view->selected() ) )
selectAllFrames( false );
KWFrame * frame = view ? view->frame() : 0L;
@@ -529,26 +529,26 @@ void KWCanvas::contentsMousePressEvent( QMouseEvent *e )
break;
case MM_CREATE_TEXT: case MM_CREATE_PART: case MM_CREATE_TABLE:
case MM_CREATE_FORMULA:
- if ( e->button() == LeftButton )
- mpCreate( normalPoint, e->state() & Qt::ShiftButton);
+ if ( e->button() == Qt::LeftButton )
+ mpCreate( normalPoint, e->state() & TQt::ShiftButton);
break;
case MM_CREATE_PIX:
- if ( e->button() == LeftButton )
- mpCreatePixmap( normalPoint, e->state() & Qt::ShiftButton );
+ if ( e->button() == Qt::LeftButton )
+ mpCreatePixmap( normalPoint, e->state() & TQt::ShiftButton );
break;
default: break;
}
m_scrollTimer->start( 50 );
- if ( e->button() == MidButton ) {
+ if ( e->button() == Qt::MidButton ) {
if ( m_doc->isReadWrite() && m_currentFrameSetEdit && m_mouseMode == MM_EDIT )
{
- QApplication::clipboard()->setSelectionMode( true );
+ TQApplication::tqclipboard()->setSelectionMode( true );
m_currentFrameSetEdit->paste();
- QApplication::clipboard()->setSelectionMode( false );
+ TQApplication::tqclipboard()->setSelectionMode( false );
}
}
- else if ( e->button() == RightButton ) {
+ else if ( e->button() == Qt::RightButton ) {
if(!m_doc->isReadWrite()) // The popups are not available in readonly mode, since the GUI isn't built...
return;
if ( m_deleteMovingRect )
@@ -559,10 +559,10 @@ void KWCanvas::contentsMousePressEvent( QMouseEvent *e )
case MM_EDIT:
if ( !viewMode()->hasFrames() ) { // text view mode
KWFrameView *view = m_frameViewManager->view(m_doc->frameSet( 0 )->frame(0));
- view->showPopup(docPoint, m_gui->getView(), QCursor::pos());
+ view->showPopup(docPoint, m_gui->getView(), TQCursor::pos());
}
else
- m_frameViewManager->showPopup(docPoint, m_gui->getView(), e->state(), QCursor::pos());
+ m_frameViewManager->showPopup(docPoint, m_gui->getView(), e->state(), TQCursor::pos());
break;
case MM_CREATE_TEXT:
case MM_CREATE_PART:
@@ -590,7 +590,7 @@ void KWCanvas::createTable( unsigned int rows, unsigned int cols,
m_table.floating = isFloating;
m_table.format = format;
- m_table.tableTemplateName = tt ? tt->displayName():QString::null;
+ m_table.tableTemplateName = tt ? tt->displayName():TQString();
m_table.tt = tt;
if ( isFloating )
@@ -657,13 +657,13 @@ void KWCanvas::applyGrid( KoPoint &p )
//FIXME It doesn't work in preview mode - apply viewmode
}
-void KWCanvas::drawGrid( QPainter &p, const QRect& rect )
+void KWCanvas::drawGrid( TQPainter &p, const TQRect& rect )
{
// Grid-positioning makes no sense in text view mode
if ( !m_viewMode->hasFrames() )
return;
- QPen pen = QPen( Qt::black, 6, Qt::DotLine );
- QPen oldPen = p.pen();
+ TQPen pen = TQPen( TQt::black, 6, TQt::DotLine );
+ TQPen oldPen = p.pen();
p.setPen( pen );
const double offsetX = m_doc->gridX();
@@ -672,15 +672,15 @@ void KWCanvas::drawGrid( QPainter &p, const QRect& rect )
// per page, this is needed to paint correctly on preview mode as well as making sure
// we start the grid from the topleft of each page.
for ( int pgNum = m_doc->startPage() ; pgNum <= m_doc->lastPage() ; ++pgNum) {
- const QRect pageRect = m_viewMode->viewPageRect( pgNum );
- const QRect crect = pageRect & rect;
+ const TQRect pageRect = m_viewMode->viewPageRect( pgNum );
+ const TQRect crect = pageRect & rect;
if ( crect.isEmpty() )
continue;
// To convert back to view coordinates later we can calculate the offset for each
// point again, or we can do it one time for the page and re-use the answer.
KoPoint pageTopLeft (0, m_doc->pageManager()->topOfPage(pgNum) + 2); // +2 to get around rounding problems..
- QPoint pageTopLeftView = m_viewMode->normalToView( m_doc->zoomPoint(pageTopLeft) );
+ TQPoint pageTopLeftView = m_viewMode->normalToView( m_doc->zoomPoint(pageTopLeft) );
// docRect is the part of the document that needs to be painted.. Coordinates in pt
const KoRect docRect = m_doc->unzoomRect( m_viewMode->viewToNormal( crect ) );
@@ -715,9 +715,9 @@ void KWCanvas::applyAspectRatio( double ratio, KoRect& insRect )
//kdDebug() << "KWCanvas::applyAspectRatio: width=" << width << " height=" << height << " insRect=" << DEBUGRECT(insRect) << endl;
}
-void KWCanvas::mmCreate( const QPoint& normalPoint, bool noGrid ) // Mouse move when creating a frame
+void KWCanvas::mmCreate( const TQPoint& normalPoint, bool noGrid ) // Mouse move when creating a frame
{
- QPainter p;
+ TQPainter p;
p.begin( viewport() );
p.translate( -contentsX(), -contentsY() );
p.setRasterOp( NotROP );
@@ -743,12 +743,12 @@ void KWCanvas::mmCreate( const QPoint& normalPoint, bool noGrid ) // Mouse move
// But not out of the page
KoRect r = m_insRect.normalize();
- if ( !m_doc->pageManager()->page(page)->rect().contains(r) )
+ if ( !m_doc->pageManager()->page(page)->rect().tqcontains(r) )
{
// Even better would be to go to the limit of the page boundary, so that the result,
// when moving the mouse of the page, doesn't depend on how fast we're moving it...
m_insRect = oldRect;
- // #### QCursor::setPos( viewport()->mapToGlobal( zoomPoint( m_insRect.bottomRight() ) ) );
+ // #### TQCursor::setPos( viewport()->mapToGlobal( zoomPoint( m_insRect.bottomRight() ) ) );
}
// Apply keep-aspect-ratio feature
@@ -763,7 +763,7 @@ void KWCanvas::mmCreate( const QPoint& normalPoint, bool noGrid ) // Mouse move
m_deleteMovingRect = true;
}
-void KWCanvas::drawMovingRect( QPainter & p )
+void KWCanvas::drawMovingRect( TQPainter & p )
{
p.setPen( black );
p.drawRect( m_viewMode->normalToView( m_doc->zoomRect( m_insRect ) ) );
@@ -772,7 +772,7 @@ void KWCanvas::drawMovingRect( QPainter & p )
void KWCanvas::deleteMovingRect()
{
Q_ASSERT( m_deleteMovingRect );
- QPainter p;
+ TQPainter p;
p.begin( viewport() );
p.translate( -contentsX(), -contentsY() );
p.setRasterOp( NotROP );
@@ -783,11 +783,11 @@ void KWCanvas::deleteMovingRect()
p.end();
}
-void KWCanvas::contentsMouseMoveEvent( QMouseEvent *e )
+void KWCanvas::contentsMouseMoveEvent( TQMouseEvent *e )
{
if ( m_printing )
return;
- QPoint normalPoint = m_viewMode->viewToNormal( e->pos() );
+ TQPoint normalPoint = m_viewMode->viewToNormal( e->pos() );
if(normalPoint.x() == -1) // e->pos() is an exceptional state...
return;
KoPoint docPoint = m_doc->unzoomPoint( normalPoint );
@@ -805,14 +805,14 @@ void KWCanvas::contentsMouseMoveEvent( QMouseEvent *e )
if ( m_mouseMeaning == MEANING_RESIZE_COLUMN || m_mouseMeaning == MEANING_RESIZE_ROW )
{
// TODO undo/redo support (esp. in mouse-release)
- QRect oldRect( m_viewMode->normalToView( m_doc->zoomRect( m_currentTable->boundingRect() ) ) );
+ TQRect oldRect( m_viewMode->normalToView( m_doc->zoomRect( m_currentTable->boundingRect() ) ) );
if ( m_mouseMeaning == MEANING_RESIZE_ROW )
m_currentTable->resizeRow( m_rowColResized, docPoint.y() );
else
m_currentTable->resizeColumn( m_rowColResized, docPoint.x() );
// Repaint only the changed rects (oldRect U newRect)
- QRect newRect( m_viewMode->normalToView( m_doc->zoomRect( m_currentTable->boundingRect() ) ) );
- repaintContents( QRegion(oldRect).unite(newRect).boundingRect(), FALSE );
+ TQRect newRect( m_viewMode->normalToView( m_doc->zoomRect( m_currentTable->boundingRect() ) ) );
+ tqrepaintContents( TQRegion(oldRect).unite(newRect).boundingRect(), FALSE );
}
else if (m_interactionPolicy) {
m_interactionPolicy->handleMouseMove(e->state(),
@@ -863,9 +863,9 @@ void KWCanvas::contentsMouseMoveEvent( QMouseEvent *e )
{
KWTextFrameSet *frameset = static_cast<KWTextFrameSet *>(fs);
//show the link target in the status bar
- QString link = frameset->linkVariableUnderMouse(docPoint)->url();
+ TQString link = frameset->linkVariableUnderMouse(docPoint)->url();
if ( link.startsWith("bkm://") )
- link.replace( 0, 6, i18n("Bookmark target: ") );
+ link.tqreplace( 0, 6, i18n("Bookmark target: ") );
gui()->getView()->setTemporaryStatusBarText( link );
m_temporaryStatusBarTextShown = true;
}
@@ -878,7 +878,7 @@ void KWCanvas::contentsMouseMoveEvent( QMouseEvent *e )
if(viewMode()->hasFrames())
viewport()->setCursor( m_frameViewManager->mouseCursor( docPoint, e->state() ) );
else
- viewport()->setCursor( Qt::ibeamCursor );
+ viewport()->setCursor( TQt::ibeamCursor );
}
}
}
@@ -893,7 +893,7 @@ void KWCanvas::mrEditFrame() {
delete(m_interactionPolicy);
m_interactionPolicy = 0;
if ( !m_doc->showGrid() && m_doc->snapToGrid() )
- repaintContents();
+ tqrepaintContents();
}
m_mousePressed = false;
}
@@ -905,7 +905,7 @@ KCommand *KWCanvas::createTextBox( const KoRect & rect )
frame->setNewFrameBehavior(KWFrame::Reconnect);
frame->setZOrder( m_doc->maxZOrder( frame->pageNumber(m_doc) ) + 1 ); // make sure it's on top
- QString name = m_doc->generateFramesetName( i18n( "Text Frameset %1" ) );
+ TQString name = m_doc->generateFramesetName( i18n( "Text Frameset %1" ) );
KWTextFrameSet *_frameSet = new KWTextFrameSet(m_doc, name );
_frameSet->addFrame( frame );
m_doc->addFrameSet( _frameSet );
@@ -932,7 +932,7 @@ void KWCanvas::mrCreateText()
emit currentFrameSetEditChanged();
}
setMouseMode( MM_EDIT );
- m_doc->repaintAllViews();
+ m_doc->tqrepaintAllViews();
emit docStructChanged(TextFrames);
emit currentFrameSetEditChanged();
}
@@ -961,7 +961,7 @@ void KWCanvas::mrCreatePixmap()
setMouseMode( MM_EDIT );
if ( !m_kopicture.isNull() ) {
- KWPictureFrameSet *fs = new KWPictureFrameSet( m_doc, QString::null /*automatic name*/ );
+ KWPictureFrameSet *fs = new KWPictureFrameSet( m_doc, TQString() /*automatic name*/ );
fs->insertPicture( m_kopicture );
fs->setKeepAspectRatio( m_keepRatio );
KWFrame *frame = new KWFrame(fs, picRect.x(), picRect.y(), picRect.width(),
@@ -994,7 +994,7 @@ void KWCanvas::mrCreateFormula()
{
m_insRect = m_insRect.normalize();
if ( !m_doc->snapToGrid() || ( m_insRect.width() > m_doc->gridX() && m_insRect.height() > m_doc->gridY() ) ) {
- KWFormulaFrameSet *frameset = new KWFormulaFrameSet( m_doc, QString::null );
+ KWFormulaFrameSet *frameset = new KWFormulaFrameSet( m_doc, TQString() );
KWFrame *frame = new KWFrame(frameset, m_insRect.x(), m_insRect.y(), m_insRect.width(), m_insRect.height() );
frame->setZOrder( m_doc->maxZOrder( frame->pageNumber(m_doc) ) + 1 ); // make sure it's on top
frameset->addFrame( frame, false );
@@ -1032,8 +1032,8 @@ void KWCanvas::mrCreateTable()
emit docStructChanged(Tables);
}
m_doc->updateAllFrames();
- m_doc->layout();
- repaintAll();
+ m_doc->tqlayout();
+ tqrepaintAll();
}
setMouseMode( MM_EDIT );
@@ -1041,13 +1041,13 @@ void KWCanvas::mrCreateTable()
KWTableFrameSet * KWCanvas::createTable() // uses m_insRect and m_table to create the table
{
- KWTableFrameSet *table = new KWTableFrameSet( m_doc, QString::null /*automatic name*/ );
+ KWTableFrameSet *table = new KWTableFrameSet( m_doc, TQString() /*automatic name*/ );
int pageNum = m_doc->pageManager()->pageNumber(m_insRect.topLeft());
// Create a set of cells with random-size frames.
for ( unsigned int i = 0; i < m_table.rows; i++ ) {
for ( unsigned int j = 0; j < m_table.cols; j++ ) {
- KWTableFrameSet::Cell *cell = new KWTableFrameSet::Cell( table, i, j, QString::null /*automatic name*/ );
+ KWTableFrameSet::Cell *cell = new KWTableFrameSet::Cell( table, i, j, TQString() /*automatic name*/ );
KWFrame *frame = new KWFrame(cell, 0, 0, 0, 0, KWFrame::RA_BOUNDINGRECT ); // pos and size will be set in setBoundingRect
frame->setZOrder( m_doc->maxZOrder( pageNum ) + 1 ); // make sure it's on top
cell->addFrame( frame, false );
@@ -1062,7 +1062,7 @@ KWTableFrameSet * KWCanvas::createTable() // uses m_insRect and m_table to creat
return table;
}
-void KWCanvas::contentsMouseReleaseEvent( QMouseEvent * e )
+void KWCanvas::contentsMouseReleaseEvent( TQMouseEvent * e )
{
if ( m_printing )
return;
@@ -1072,7 +1072,7 @@ void KWCanvas::contentsMouseReleaseEvent( QMouseEvent * e )
if ( m_deleteMovingRect )
deleteMovingRect();
- QPoint normalPoint = m_viewMode->viewToNormal( e->pos() );
+ TQPoint normalPoint = m_viewMode->viewToNormal( e->pos() );
KoPoint docPoint = m_doc->unzoomPoint( normalPoint );
if(m_insRect.bottom()==0 && m_insRect.right()==0) {
@@ -1081,8 +1081,8 @@ void KWCanvas::contentsMouseReleaseEvent( QMouseEvent * e )
if(page == -1)
return;
KoPageLayout pageLayout = m_doc->pageManager()->pageLayout(page);
- m_insRect.setLeft(QMIN(m_insRect.left(), pageLayout.ptWidth - 200));
- m_insRect.setTop(QMIN(m_insRect.top(), pageLayout.ptHeight - 150));
+ m_insRect.setLeft(TQMIN(m_insRect.left(), pageLayout.ptWidth - 200));
+ m_insRect.setTop(TQMIN(m_insRect.top(), pageLayout.ptHeight - 150));
m_insRect.setBottom(m_insRect.top()+150);
m_insRect.setRight(m_insRect.left()+200);
}
@@ -1127,16 +1127,16 @@ void KWCanvas::contentsMouseReleaseEvent( QMouseEvent * e )
}
if ( old_mouseMove != MM_EDIT && !m_doc->showGrid() && m_doc->snapToGrid() )
- repaintContents( FALSE ); //draw the grid over the whole canvas
+ tqrepaintContents( FALSE ); //draw the grid over the whole canvas
m_mousePressed = false;
}
}
-void KWCanvas::contentsMouseDoubleClickEvent( QMouseEvent * e )
+void KWCanvas::contentsMouseDoubleClickEvent( TQMouseEvent * e )
{
if ( m_printing )
return;
- QPoint normalPoint = m_viewMode->viewToNormal( e->pos() );
+ TQPoint normalPoint = m_viewMode->viewToNormal( e->pos() );
KoPoint docPoint = m_doc->unzoomPoint( normalPoint );
switch ( m_mouseMode ) {
case MM_EDIT:
@@ -1163,22 +1163,22 @@ void KWCanvas::contentsMouseDoubleClickEvent( QMouseEvent * e )
}
}
-void KWCanvas::setFrameBackgroundColor( const QBrush &_backColor )
+void KWCanvas::setFrameBackgroundColor( const TQBrush &_backColor )
{
- QValueList<KWFrameView*> selectedFrames = m_frameViewManager->selectedFrames();
+ TQValueList<KWFrameView*> selectedFrames = m_frameViewManager->selectedFrames();
if (selectedFrames.isEmpty())
return;
bool colorChanged=false;
- QPtrList<FrameIndex> frameindexList;
- QPtrList<QBrush> oldColor;
+ TQPtrList<FrameIndex> frameindexList;
+ TQPtrList<TQBrush> oldColor;
- QValueListIterator<KWFrameView*> framesIterator = selectedFrames.begin();
+ TQValueListIterator<KWFrameView*> framesIterator = selectedFrames.begin();
while(framesIterator != selectedFrames.end()) {
KWFrame *frame = KWFrameSet::settingsFrame( (*framesIterator)->frame() );
FrameIndex *index=new FrameIndex( frame );
frameindexList.append(index);
- QBrush *_color=new QBrush(frame->backgroundColor());
+ TQBrush *_color=new TQBrush(frame->backgroundColor());
oldColor.append(_color);
if (frame->frameSet() && frame->frameSet()->type()!=FT_PICTURE && frame->frameSet()->type()!=FT_PART && _backColor!=frame->backgroundColor())
@@ -1192,7 +1192,7 @@ void KWCanvas::setFrameBackgroundColor( const QBrush &_backColor )
{
KWFrameBackGroundColorCommand *cmd=new KWFrameBackGroundColorCommand(i18n("Change Frame Background Color"),frameindexList,oldColor,_backColor);
m_doc->addCommand(cmd);
- m_doc->repaintAllViews();
+ m_doc->tqrepaintAllViews();
}
else
{
@@ -1212,15 +1212,15 @@ void KWCanvas::editFrameProperties( KWFrameSet * frameset )
void KWCanvas::editFrameProperties()
{
- QValueList<KWFrameView*> selectedFrames = m_frameViewManager->selectedFrames();
+ TQValueList<KWFrameView*> selectedFrames = m_frameViewManager->selectedFrames();
if(selectedFrames.count()==0) return;
KWFrameDia *frameDia;
if(selectedFrames.count()==1)
frameDia = new KWFrameDia( this, selectedFrames[0]->frame());
else { // multi frame dia.
- QPtrList<KWFrame> frames;
- QValueListIterator<KWFrameView*> framesIterator = selectedFrames.begin();
+ TQPtrList<KWFrame> frames;
+ TQValueListIterator<KWFrameView*> framesIterator = selectedFrames.begin();
for(;framesIterator != selectedFrames.end(); ++framesIterator)
frames.append( (*framesIterator)->frame() );
frameDia = new KWFrameDia( this, frames );
@@ -1230,8 +1230,8 @@ void KWCanvas::editFrameProperties()
}
void KWCanvas::selectAllFrames( bool select ) {
- QValueList<KWFrameView*> frameViews = m_frameViewManager->frameViewsIterator();
- QValueList<KWFrameView*>::iterator frames = frameViews.begin();
+ TQValueList<KWFrameView*> frameViews = m_frameViewManager->frameViewsIterator();
+ TQValueList<KWFrameView*>::iterator frames = frameViews.begin();
for(; frames != frameViews.end(); ++frames ) {
KWFrameSet *fs = (*frames)->frame()->frameSet();
if ( !fs->isVisible() ) continue;
@@ -1370,7 +1370,7 @@ void KWCanvas::terminateCurrentEdit()
delete m_currentFrameSetEdit;
m_currentFrameSetEdit = 0L;
emit currentFrameSetEditChanged();
- repaintAll();
+ tqrepaintAll();
}
void KWCanvas::terminateEditing( KWFrameSet *fs )
@@ -1378,7 +1378,7 @@ void KWCanvas::terminateEditing( KWFrameSet *fs )
if ( m_currentFrameSetEdit && m_currentFrameSetEdit->frameSet() == fs )
terminateCurrentEdit();
// Also deselect the frames from this frameset
- QPtrListIterator<KWFrame> frameIt = fs->frameIterator();
+ TQPtrListIterator<KWFrame> frameIt = fs->frameIterator();
for ( ; frameIt.current(); ++frameIt ) {
KWFrameView* view = m_frameViewManager->view(frameIt.current());
Q_ASSERT(view);
@@ -1404,7 +1404,7 @@ void KWCanvas::setMouseMode( MouseMode newMouseMode )
m_mouseMode = newMouseMode;
if ( !m_doc->showGrid() && m_doc->snapToGrid() )
- repaintContents( FALSE ); //draw the grid over the whole canvas
+ tqrepaintContents( FALSE ); //draw the grid over the whole canvas
}
else
m_mouseMode = newMouseMode;
@@ -1412,8 +1412,8 @@ void KWCanvas::setMouseMode( MouseMode newMouseMode )
switch ( m_mouseMode ) {
case MM_EDIT: {
- QPoint mousep = mapFromGlobal(QCursor::pos()) + QPoint( contentsX(), contentsY() );
- QPoint normalPoint = m_viewMode->viewToNormal( mousep );
+ TQPoint mousep = mapFromGlobal(TQCursor::pos()) + TQPoint( contentsX(), contentsY() );
+ TQPoint normalPoint = m_viewMode->viewToNormal( mousep );
KoPoint docPoint = m_doc->unzoomPoint( normalPoint );
viewport()->setCursor( m_frameViewManager->mouseCursor( docPoint, 0 ) );
m_frameInline = false;
@@ -1428,7 +1428,7 @@ void KWCanvas::setMouseMode( MouseMode newMouseMode )
}
}
-void KWCanvas::insertPicture( const KoPicture& newPicture, QSize pixmapSize, bool _keepRatio )
+void KWCanvas::insertPicture( const KoPicture& newPicture, TQSize pixmapSize, bool _keepRatio )
{
setMouseMode( MM_CREATE_PIX );
m_kopicture = newPicture;
@@ -1438,7 +1438,7 @@ void KWCanvas::insertPicture( const KoPicture& newPicture, QSize pixmapSize, boo
m_keepRatio = _keepRatio;
}
-void KWCanvas::insertPictureDirect( const KoPicture& picture, const KoPoint& pos, const QSize& sz )
+void KWCanvas::insertPictureDirect( const KoPicture& picture, const KoPoint& pos, const TQSize& sz )
{
// Prepare things for mrCreatePixmap
m_pixmapSize = sz.isEmpty() ? picture.getOriginalSize() : sz;
@@ -1459,7 +1459,7 @@ void KWCanvas::insertPart( const KoDocumentEntry &entry )
setMouseMode( MM_CREATE_PART );
}
-void KWCanvas::contentsDragEnterEvent( QDragEnterEvent *e )
+void KWCanvas::contentsDragEnterEvent( TQDragEnterEvent *e )
{
int provides = KWView::checkClipboard( e );
if ( ( provides & KWView::ProvidesImage ) || KURLDrag::canDecode( e ) )
@@ -1475,11 +1475,11 @@ void KWCanvas::contentsDragEnterEvent( QDragEnterEvent *e )
}
}
-void KWCanvas::contentsDragMoveEvent( QDragMoveEvent *e )
+void KWCanvas::contentsDragMoveEvent( TQDragMoveEvent *e )
{
if ( !m_imageDrag /*&& m_currentFrameSetEdit*/ )
{
- QPoint normalPoint = m_viewMode->viewToNormal( e->pos() );
+ TQPoint normalPoint = m_viewMode->viewToNormal( e->pos() );
KoPoint docPoint = m_doc->unzoomPoint( normalPoint );
KWFrameView *view = m_frameViewManager->view(docPoint, KWFrameViewManager::frameOnTop);
KWFrame *frame = view ? view->frame() : 0;
@@ -1500,18 +1500,18 @@ void KWCanvas::contentsDragMoveEvent( QDragMoveEvent *e )
}
}
-void KWCanvas::contentsDragLeaveEvent( QDragLeaveEvent *e )
+void KWCanvas::contentsDragLeaveEvent( TQDragLeaveEvent *e )
{
if ( !m_imageDrag && m_currentFrameSetEdit )
m_currentFrameSetEdit->dragLeaveEvent( e );
}
-void KWCanvas::contentsDropEvent( QDropEvent *e )
+void KWCanvas::contentsDropEvent( TQDropEvent *e )
{
- QPoint normalPoint = m_viewMode->viewToNormal( e->pos() );
+ TQPoint normalPoint = m_viewMode->viewToNormal( e->pos() );
KoPoint docPoint = m_doc->unzoomPoint( normalPoint );
- if ( QImageDrag::canDecode( e ) ) {
+ if ( TQImageDrag::canDecode( e ) ) {
pasteImage( e, docPoint );
} else if ( KURLDrag::canDecode( e ) ) {
@@ -1525,15 +1525,15 @@ void KWCanvas::contentsDropEvent( QDropEvent *e )
for ( ; it != lst.end(); ++it ) {
const KURL &url( *it );
- QString filename;
+ TQString filename;
if ( !KIO::NetAccess::download( url, filename, this ) )
continue;
KMimeType::Ptr res = KMimeType::findByFileContent( filename );
if ( res && res->isValid() ) {
- QString mimetype = res->name();
- if ( mimetype.contains( "image" ) ) {
+ TQString mimetype = res->name();
+ if ( mimetype.tqcontains( "image" ) ) {
KoPictureKey key;
key.setKeyFromFile( filename );
KoPicture newKoPicture;
@@ -1556,14 +1556,14 @@ void KWCanvas::contentsDropEvent( QDropEvent *e )
m_imageDrag = false;
}
-void KWCanvas::pasteImage( QMimeSource *e, const KoPoint &docPoint )
+void KWCanvas::pasteImage( TQMimeSource *e, const KoPoint &docPoint )
{
- QImage i;
- if ( !QImageDrag::decode(e, i) ) {
+ TQImage i;
+ if ( !TQImageDrag::decode(e, i) ) {
kdWarning() << "Couldn't decode image" << endl;
return;
}
- KTempFile tmpFile( QString::null, ".png");
+ KTempFile tmpFile( TQString(), ".png");
tmpFile.setAutoDelete( true );
if ( !i.save(tmpFile.name(), "PNG") ) {
kdWarning() << "Couldn't save image to " << tmpFile.name() << endl;
@@ -1591,9 +1591,9 @@ void KWCanvas::doAutoScroll()
}
// This code comes from khtml
- QPoint pos( mapFromGlobal( QCursor::pos() ) );
+ TQPoint pos( mapFromGlobal( TQCursor::pos() ) );
- pos = QPoint(pos.x() - viewport()->x(), pos.y() - viewport()->y());
+ pos = TQPoint(pos.x() - viewport()->x(), pos.y() - viewport()->y());
if ( (pos.y() < 0) || (pos.y() > visibleHeight()) ||
(pos.x() < 0) || (pos.x() > visibleWidth()) )
{
@@ -1611,13 +1611,13 @@ void KWCanvas::doAutoScroll()
void KWCanvas::slotContentsMoving( int cx, int cy )
{
- //QPoint nPointTop = m_viewMode->viewToNormal( QPoint( cx, cy ) );
- QPoint nPointBottom = m_viewMode->viewToNormal( QPoint( cx + visibleWidth(), cy + visibleHeight() ) );
+ //TQPoint nPointTop = m_viewMode->viewToNormal( TQPoint( cx, cy ) );
+ TQPoint nPointBottom = m_viewMode->viewToNormal( TQPoint( cx + visibleWidth(), cy + visibleHeight() ) );
//kdDebug() << "KWCanvas::slotContentsMoving cx=" << cx << " cy=" << cy << endl;
//kdDebug() << " visibleWidth()=" << visibleWidth() << " visibleHeight()=" << visibleHeight() << endl;
// Update our "formatted paragraphs needs" in all the text framesets
- QPtrList<KWTextFrameSet> textFrameSets = m_doc->allTextFramesets( false );
- QPtrListIterator<KWTextFrameSet> fit( textFrameSets );
+ TQPtrList<KWTextFrameSet> textFrameSets = m_doc->allTextFramesets( false );
+ TQPtrListIterator<KWTextFrameSet> fit( textFrameSets );
for ( ; fit.current() ; ++fit )
{
if(! fit.current()->isVisible()) continue;
@@ -1631,7 +1631,7 @@ void KWCanvas::slotContentsMoving( int cx, int cy )
// so that it will reposition any active embedded object.
// This needs to be delayed since contents moving is emitted -before- moving,
// and from resizeEvent it's too early too.
- QTimer::singleShot( 0, this, SIGNAL( viewTransformationsChanged() ) );
+ TQTimer::singleShot( 0, this, TQT_SIGNAL( viewTransformationsChanged() ) );
}
void KWCanvas::slotMainTextHeightChanged()
@@ -1647,18 +1647,18 @@ void KWCanvas::slotMainTextHeightChanged()
void KWCanvas::slotNewContentsSize()
{
- QSize size = m_viewMode->contentsSize();
- if ( size != QSize( contentsWidth(), contentsHeight() ) )
+ TQSize size = m_viewMode->contentsSize();
+ if ( size != TQSize( contentsWidth(), contentsHeight() ) )
{
//kdDebug() << "KWCanvas::slotNewContentsSize " << size.width() << "x" << size.height() << endl;
resizeContents( size.width(), size.height() );
}
}
-void KWCanvas::resizeEvent( QResizeEvent *e )
+void KWCanvas::resizeEvent( TQResizeEvent *e )
{
slotContentsMoving( contentsX(), contentsY() );
- QScrollView::resizeEvent( e );
+ TQScrollView::resizeEvent( e );
}
void KWCanvas::scrollToOffset( const KoPoint & d )
@@ -1669,8 +1669,8 @@ void KWCanvas::scrollToOffset( const KoPoint & d )
if ( blinking )
stopBlinkCursor();
#endif
- QPoint nPoint = m_doc->zoomPoint( d );
- QPoint cPoint = m_viewMode->normalToView( nPoint );
+ TQPoint nPoint = m_doc->zoomPoint( d );
+ TQPoint cPoint = m_viewMode->normalToView( nPoint );
setContentsPos( cPoint.x(), cPoint.y() );
#if 0
@@ -1688,7 +1688,7 @@ void KWCanvas::updateRulerOffsets( int cx, int cy )
}
// The offset is usually just the scrollview offset
// But we also need to offset to the current page, for the graduations
- QPoint pc = m_viewMode->pageCorner();
+ TQPoint pc = m_viewMode->pageCorner();
//kdDebug() << "KWCanvas::updateRulerOffsets contentsX=" << cx << ", contentsY=" << cy << endl;
if (m_gui->getHorzRuler())
m_gui->getHorzRuler()->setOffset( cx - pc.x(), 0 );
@@ -1697,61 +1697,61 @@ void KWCanvas::updateRulerOffsets( int cx, int cy )
}
-bool KWCanvas::eventFilter( QObject *o, QEvent *e )
+bool KWCanvas::eventFilter( TQObject *o, TQEvent *e )
{
- if ( o == this || o == viewport() ) {
+ if ( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) || TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(viewport()) ) {
- if(m_currentFrameSetEdit && o == this )
+ if(m_currentFrameSetEdit && TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(this) )
{
// Pass event to auto-hide-cursor code (see kcursor.h for details)
KCursor::autoHideEventFilter( o, e );
}
switch ( e->type() ) {
- case QEvent::FocusIn:
- // kdDebug() << "KWCanvas::eventFilter QEvent::FocusIn" << endl;
+ case TQEvent::FocusIn:
+ // kdDebug() << "KWCanvas::eventFilter TQEvent::FocusIn" << endl;
if ( m_currentFrameSetEdit && !m_printing )
m_currentFrameSetEdit->focusInEvent();
break;
- case QEvent::FocusOut:
- // kdDebug() << "KWCanvas::eventFilter QEvent::FocusOut" << endl;
+ case TQEvent::FocusOut:
+ // kdDebug() << "KWCanvas::eventFilter TQEvent::FocusOut" << endl;
if ( m_currentFrameSetEdit && !m_printing )
m_currentFrameSetEdit->focusOutEvent();
if ( m_scrollTimer->isActive() )
m_scrollTimer->stop();
m_mousePressed = false;
break;
- case QEvent::AccelOverride: // was part of KeyPress - changed due to kdelibs BUG!
+ case TQEvent::AccelOverride: // was part of KeyPress - changed due to kdelibs BUG!
{
// kdDebug() << " KeyPress m_currentFrameSetEdit=" << m_currentFrameSetEdit << " isRW="<<m_doc->isReadWrite() << endl;
// kdDebug() << " m_printing=" << m_printing << " mousemode=" << m_mouseMode << " (MM_EDIT=" << MM_EDIT<<")"<<endl;
- QKeyEvent * keyev = static_cast<QKeyEvent *>(e);
+ TQKeyEvent * keyev = TQT_TQKEYEVENT(e);
#ifndef NDEBUG
// Debug keys
if ( ( keyev->state() & ControlButton ) && ( keyev->state() & ShiftButton ) )
{
switch ( keyev->key() ) {
- case Qt::Key_P: // 'P' -> paragraph debug
+ case TQt::Key_P: // 'P' -> paragraph debug
printRTDebug( 0 );
keyev->accept();
break;
- case Qt::Key_V: // 'V' -> verbose parag debug
+ case TQt::Key_V: // 'V' -> verbose parag debug
printRTDebug( 1 );
keyev->accept();
break;
- case Qt::Key_F: // 'F' -> frames debug
+ case TQt::Key_F: // 'F' -> frames debug
m_doc->printDebug();
kdDebug(32002) << "Current framesetedit: " << m_currentFrameSetEdit << " " <<
( m_currentFrameSetEdit ? m_currentFrameSetEdit->frameSet()->className() : "" ) << endl;
keyev->accept();
break;
- case Qt::Key_S: // 'S' -> styles debug
+ case TQt::Key_S: // 'S' -> styles debug
m_doc->printStyleDebug();
keyev->accept();
break;
- case Qt::Key_M: // 'M' -> mark debug output
+ case TQt::Key_M: // 'M' -> mark debug output
{
- const QDateTime dtMark ( QDateTime::currentDateTime() );
+ const TQDateTime dtMark ( TQDateTime::tqcurrentDateTime() );
kdDebug(32002) << "Developer mark: " << dtMark.toString("yyyy-MM-dd hh:mm:ss,zzz") << endl;
keyev->accept();
break;
@@ -1764,37 +1764,37 @@ bool KWCanvas::eventFilter( QObject *o, QEvent *e )
#endif
}
break;
- case QEvent::KeyPress:
+ case TQEvent::KeyPress:
{
// kdDebug() << " KeyPress m_currentFrameSetEdit=" << m_currentFrameSetEdit << " isRW="<<m_doc->isReadWrite() << endl;
// kdDebug() << " m_printing=" << m_printing << " mousemode=" << m_mouseMode << " (MM_EDIT=" << MM_EDIT<<")"<<endl;
- QKeyEvent * keyev = static_cast<QKeyEvent *>(e);
+ TQKeyEvent * keyev = TQT_TQKEYEVENT(e);
// By default PgUp and PgDown move the scrollbars and not the caret anymore - this is done here
if ( !m_doc->pgUpDownMovesCaret() && ( (keyev->state() & ShiftButton) == 0 )
- && ( keyev->key() == Qt::Key_PageUp || keyev->key() == Key_PageDown ) )
+ && ( keyev->key() == TQt::Key_PageUp || keyev->key() == Key_PageDown ) )
{
- viewportScroll( keyev->key() == Qt::Key_PageUp );
+ viewportScroll( keyev->key() == TQt::Key_PageUp );
}
// Activate this code (and in focusNextPreviousChild() to allow Shift+Tab
// out of document window. Disabled because it conflicts with Shift+Tab inside a table.
- // else if ( keyev->key() == Qt::Key_BackTab )
+ // else if ( keyev->key() == TQt::Key_BackTab )
// return FALSE;
else if ( keyev->key() == KGlobalSettings::contextMenuKey() ) {
// The popups are not available in readonly mode, since the GUI isn't built...
if(!m_doc->isReadWrite()) return TRUE;
if (m_mouseMode != MM_EDIT) return TRUE;
- KoPoint docPoint = m_doc->unzoomPoint( QCursor::pos() );
+ KoPoint docPoint = m_doc->unzoomPoint( TQCursor::pos() );
if ( viewMode()->type()=="ModeText") {
KWFrameView *view = m_frameViewManager->view(m_doc->frameSet( 0 )->frame(0));
- view->showPopup(docPoint, m_gui->getView(), QCursor::pos());
+ view->showPopup(docPoint, m_gui->getView(), TQCursor::pos());
}
else {
m_frameViewManager->showPopup( docPoint, m_gui->getView(), keyev->state(), pos());
}
return true;
}
- else if ( keyev->key() == Qt::Key_Return && keyev->state() == 0
+ else if ( keyev->key() == TQt::Key_Return && keyev->state() == 0
&& (m_mouseMode != MM_EDIT || m_frameInline )) {
// When inserting an inline or non-line frame,
// simulate mouse press and release at caret position.
@@ -1807,22 +1807,22 @@ bool KWCanvas::eventFilter( QObject *o, QEvent *e )
if (m_lastCaretPos.isNull()) return TRUE;
int page = m_doc->pageManager()->pageNumber(m_lastCaretPos);
if(page == -1) return TRUE;
- QPoint normalPoint = m_doc->zoomPoint(m_lastCaretPos);
+ TQPoint normalPoint = m_doc->zoomPoint(m_lastCaretPos);
// Coordinate is at the very top of the caret. In the case of an
// inline frame, adjust slightly down and to the right in order
// to avoid "clicking" the frame border.
if (m_frameInline)
- normalPoint += QPoint(2,2);
- QPoint vP = m_viewMode->normalToView(normalPoint);
- QPoint gP = mapToGlobal(vP);
- QMouseEvent mevPress(QEvent::MouseButtonPress, vP,
+ normalPoint += TQPoint(2,2);
+ TQPoint vP = m_viewMode->normalToView(normalPoint);
+ TQPoint gP = mapToGlobal(vP);
+ TQMouseEvent mevPress(TQEvent::MouseButtonPress, vP,
gP, Qt::LeftButton, 0);
contentsMousePressEvent(&mevPress);
- QMouseEvent mevRelease(QEvent::MouseButtonRelease, vP,
+ TQMouseEvent mevRelease(TQEvent::MouseButtonRelease, vP,
gP, Qt::LeftButton, 0);
contentsMouseReleaseEvent(&mevRelease);
}
- else if ( keyev->key() == Qt::Key_Escape ) {
+ else if ( keyev->key() == TQt::Key_Escape ) {
if ( m_mouseMode != MM_EDIT ) // Abort frame creation
setMouseMode( MM_EDIT );
else if(m_interactionPolicy) {
@@ -1832,12 +1832,12 @@ bool KWCanvas::eventFilter( QObject *o, QEvent *e )
m_mousePressed = false;
// reset cursor
- QPoint mousep = mapFromGlobal(QCursor::pos()) + QPoint( contentsX(), contentsY() );
- QPoint normalPoint = m_viewMode->viewToNormal( mousep );
+ TQPoint mousep = mapFromGlobal(TQCursor::pos()) + TQPoint( contentsX(), contentsY() );
+ TQPoint normalPoint = m_viewMode->viewToNormal( mousep );
KoPoint docPoint = m_doc->unzoomPoint( normalPoint );
viewport()->setCursor( m_frameViewManager->mouseCursor( docPoint, keyev->stateAfter() ) );
if ( !m_doc->showGrid() && m_doc->snapToGrid() )
- repaintContents();
+ tqrepaintContents();
}
}
else if ( keyev->key() == Key_Insert && keyev->state() == 0 ) {
@@ -1866,24 +1866,24 @@ bool KWCanvas::eventFilter( QObject *o, QEvent *e )
}
// Because of the dependency on the control key, we need to update the mouse cursor here
- if ( keyev->key() == Qt::Key_Control )
+ if ( keyev->key() == TQt::Key_Control )
{
- QPoint mousep = mapFromGlobal(QCursor::pos()) + QPoint( contentsX(), contentsY() );
- QPoint normalPoint = m_viewMode->viewToNormal( mousep );
+ TQPoint mousep = mapFromGlobal(TQCursor::pos()) + TQPoint( contentsX(), contentsY() );
+ TQPoint normalPoint = m_viewMode->viewToNormal( mousep );
KoPoint docPoint = m_doc->unzoomPoint( normalPoint );
viewport()->setCursor( m_frameViewManager->mouseCursor( docPoint, keyev->stateAfter() ) );
}
- else if ( (keyev->key() == Qt::Key_Delete || keyev->key() ==Key_Backspace )
+ else if ( (keyev->key() == TQt::Key_Delete || keyev->key() ==Key_Backspace )
&& m_frameViewManager->selectedFrame() && !m_printing )
m_gui->getView()->editDeleteFrame();
} break;
- case QEvent::KeyRelease:
+ case TQEvent::KeyRelease:
{
- QKeyEvent * keyev = static_cast<QKeyEvent *>(e);
- if ( keyev->key() == Qt::Key_Control )
+ TQKeyEvent * keyev = TQT_TQKEYEVENT(e);
+ if ( keyev->key() == TQt::Key_Control )
{
- QPoint mousep = mapFromGlobal(QCursor::pos()) + QPoint( contentsX(), contentsY() );
- QPoint normalPoint = m_viewMode->viewToNormal( mousep );
+ TQPoint mousep = mapFromGlobal(TQCursor::pos()) + TQPoint( contentsX(), contentsY() );
+ TQPoint normalPoint = m_viewMode->viewToNormal( mousep );
KoPoint docPoint = m_doc->unzoomPoint( normalPoint );
viewport()->setCursor( m_frameViewManager->mouseCursor( docPoint, keyev->stateAfter() ) );
}
@@ -1895,21 +1895,21 @@ bool KWCanvas::eventFilter( QObject *o, QEvent *e )
}
}
break;
- case QEvent::IMStart:
+ case TQEvent::IMStart:
{
- QIMEvent * imev = static_cast<QIMEvent *>(e);
+ TQIMEvent * imev = static_cast<TQIMEvent *>(e);
m_currentFrameSetEdit->imStartEvent( imev );
}
break;
- case QEvent::IMCompose:
+ case TQEvent::IMCompose:
{
- QIMEvent * imev = static_cast<QIMEvent *>(e);
+ TQIMEvent * imev = static_cast<TQIMEvent *>(e);
m_currentFrameSetEdit->imComposeEvent( imev );
}
break;
- case QEvent::IMEnd:
+ case TQEvent::IMEnd:
{
- QIMEvent * imev = static_cast<QIMEvent *>(e);
+ TQIMEvent * imev = static_cast<TQIMEvent *>(e);
m_currentFrameSetEdit->imEndEvent( imev );
}
break;
@@ -1917,7 +1917,7 @@ bool KWCanvas::eventFilter( QObject *o, QEvent *e )
break;
}
}
- return QScrollView::eventFilter( o, e );
+ return TQScrollView::eventFilter( o, e );
}
bool KWCanvas::focusNextPrevChild( bool next)
@@ -1926,7 +1926,7 @@ bool KWCanvas::focusNextPrevChild( bool next)
return TRUE; // Don't allow to go out of the canvas widget by pressing "Tab"
// Don't allow to go out of the canvas widget by pressing Tab, but do allow Shift+Tab.
// if (next) return TRUE;
- // return QWidget::focusNextPrevChild( next );
+ // return TQWidget::focusNextPrevChild( next );
}
void KWCanvas::updateCurrentFormat()
@@ -1956,12 +1956,12 @@ void KWCanvas::printRTDebug( int info )
void KWCanvas::setXimPosition( int x, int y, int w, int h )
{
- /* Check for hasFocus() to avoid crashes in QXIMInputContext as in bug #123941.
- This is only a workaround, the real problem might be in Qt. See also
+ /* Check for hasFocus() to avoid crashes in TQXIMInputContext as in bug #123941.
+ This is only a workaround, the real problem might be in TQt. See also
http://lists.kde.org/?l=kde-core-devel&m=115770546313922&w=2 .
*/
if (hasFocus())
- QWidget::setMicroFocusHint( x - contentsX(), y - contentsY(), w, h );
+ TQWidget::setMicroFocusHint( x - contentsX(), y - contentsY(), w, h );
}
void KWCanvas::inlinePictureStarted()
@@ -2029,22 +2029,22 @@ KoPoint KWCanvas::caretPos()
KWFrame* currentFrame = m_currentFrameSetEdit->currentFrame();
if (!currentFrame) return KoPoint();
- QPoint viewP = textFrameset->cursorPos(cursor, this, currentFrame);
+ TQPoint viewP = textFrameset->cursorPos(cursor, this, currentFrame);
viewP.rx() += contentsX();
viewP.ry() += contentsY();
- QPoint normalP = m_viewMode->viewToNormal(viewP);
+ TQPoint normalP = m_viewMode->viewToNormal(viewP);
KoPoint docP = m_doc->unzoomPoint(normalP);
return docP;
}
// ************** InteractionPolicy ***********************
-InteractionPolicy::InteractionPolicy(KWCanvas *parent, bool doInit, bool includeInlineFrames) {
+InteractionPolicy::InteractionPolicy(KWCanvas *tqparent, bool doInit, bool includeInlineFrames) {
m_gotDragEvents = false;
- m_parent = parent;
+ m_parent = tqparent;
if(doInit) {
- QValueList<KWFrameView*> selectedFrames = m_parent->frameViewManager()->selectedFrames();
- QValueListIterator<KWFrameView*> framesIterator = selectedFrames.begin();
+ TQValueList<KWFrameView*> selectedFrames = m_parent->frameViewManager()->selectedFrames();
+ TQValueListIterator<KWFrameView*> framesIterator = selectedFrames.begin();
for(;framesIterator != selectedFrames.end(); ++framesIterator) {
KWFrame *frame = (*framesIterator)->frame();
KWFrameSet *fs = frame->frameSet();
@@ -2061,12 +2061,12 @@ InteractionPolicy::InteractionPolicy(KWCanvas *parent, bool doInit, bool include
}
}
-InteractionPolicy* InteractionPolicy::createPolicy(KWCanvas *parent, MouseMeaning meaning, KoPoint &point, Qt::ButtonState buttonState, Qt::ButtonState keyState) {
+InteractionPolicy* InteractionPolicy::createPolicy(KWCanvas *tqparent, MouseMeaning meaning, KoPoint &point, TQt::ButtonState buttonState, TQt::ButtonState keyState) {
if(buttonState & Qt::LeftButton || buttonState & Qt::RightButton) {
// little inner class to make sure we don't duplicate code
class Selector {
public:
- Selector(KWCanvas *canvas, KoPoint &point, Qt::ButtonState buttonState, Qt::ButtonState keyState) :
+ Selector(KWCanvas *canvas, KoPoint &point, TQt::ButtonState buttonState, TQt::ButtonState keyState) :
m_canvas(canvas), m_point(point), m_state(keyState) {
m_leftClick = buttonState & Qt::LeftButton;
KWFrameView *view = canvas->frameViewManager()->view(point,
@@ -2081,15 +2081,15 @@ InteractionPolicy* InteractionPolicy::createPolicy(KWCanvas *parent, MouseMeanin
private:
KWCanvas *m_canvas;
KoPoint m_point;
- Qt::ButtonState m_state;
+ TQt::ButtonState m_state;
bool m_leftClick, m_doSomething;
};
- Selector selector(parent, point, buttonState, keyState);
+ Selector selector(tqparent, point, buttonState, keyState);
switch(meaning) {
case MEANING_MOUSE_MOVE:
selector.doSelect();
- return new FrameMovePolicy(parent, point);
+ return new FrameMovePolicy(tqparent, point);
case MEANING_TOPLEFT:
case MEANING_TOP:
case MEANING_TOPRIGHT:
@@ -2099,9 +2099,9 @@ InteractionPolicy* InteractionPolicy::createPolicy(KWCanvas *parent, MouseMeanin
case MEANING_BOTTOMLEFT:
case MEANING_LEFT:
selector.doSelect();
- return new FrameResizePolicy(parent, meaning, point);
+ return new FrameResizePolicy(tqparent, meaning, point);
default:
- FrameSelectPolicy *fsp = new FrameSelectPolicy(parent, meaning, point, buttonState, keyState);
+ FrameSelectPolicy *fsp = new FrameSelectPolicy(tqparent, meaning, point, buttonState, keyState);
if(fsp->isValid())
return fsp;
delete fsp;
@@ -2120,8 +2120,8 @@ void InteractionPolicy::cancelInteraction() {
// ************** FrameResizePolicy ***********************
-FrameResizePolicy::FrameResizePolicy(KWCanvas *parent, MouseMeaning meaning, KoPoint &point) :
- InteractionPolicy (parent, true, true), m_boundingRect() {
+FrameResizePolicy::FrameResizePolicy(KWCanvas *tqparent, MouseMeaning meaning, KoPoint &point) :
+ InteractionPolicy (tqparent, true, true), m_boundingRect() {
if( meaning == MEANING_TOPLEFT) {
m_top = true; m_bottom = false; m_left = true; m_right = false;
@@ -2148,7 +2148,7 @@ FrameResizePolicy::FrameResizePolicy(KWCanvas *parent, MouseMeaning meaning, KoP
m_top = false; m_bottom = false; m_left = true; m_right = false;
}
- QValueListConstIterator<KWFrame*> framesIterator = m_frames.begin();
+ TQValueListConstIterator<KWFrame*> framesIterator = m_frames.begin();
for(;framesIterator != m_frames.end(); ++framesIterator) {
KWFrame *frame = *framesIterator;
FrameResizeStruct frs(*frame, frame->minimumFrameHeight(), *frame);
@@ -2158,20 +2158,20 @@ FrameResizePolicy::FrameResizePolicy(KWCanvas *parent, MouseMeaning meaning, KoP
m_hotSpot = point - m_boundingRect.topLeft();
}
-void FrameResizePolicy::handleMouseMove(Qt::ButtonState keyState, const KoPoint &point) {
+void FrameResizePolicy::handleMouseMove(TQt::ButtonState keyState, const KoPoint &point) {
//kdDebug() << "handleMouseMove " << (m_top?"top ":"") << (m_bottom?"bottom ":"") << (m_left?"left ":"") << (m_right?"right":"") << endl;
//kdDebug() << " + point: " << point
// << " boundingrect: " << m_boundingRect << endl;
- bool keepAspect = keyState & Qt::AltButton;
+ bool keepAspect = keyState & TQt::AltButton;
for(unsigned int i=0; !keepAspect && i < m_frames.count(); i++) {
KWPictureFrameSet *picFs = dynamic_cast<KWPictureFrameSet*>(m_frames[i]->frameSet());
if(picFs)
keepAspect = picFs->keepAspectRatio();
}
- bool noGrid = keyState & Qt::ShiftButton;
- bool scaleFromCenter = keyState & Qt::ControlButton;
+ bool noGrid = keyState & TQt::ShiftButton;
+ bool scaleFromCenter = keyState & TQt::ControlButton;
KoPoint p( point.x() - (m_hotSpot.x() + m_boundingRect.x()),
point.y() - (m_hotSpot.y() + m_boundingRect.y()) );
@@ -2228,10 +2228,10 @@ void FrameResizePolicy::handleMouseMove(Qt::ButtonState keyState, const KoPoint
KWPageManager *pageManager = m_parent->kWordDocument()->pageManager();
sizeRect.moveTopLeft(pageManager->clipToDocument(sizeRect.topLeft()));
sizeRect.moveBottomRight(pageManager->clipToDocument(sizeRect.bottomRight()));
- sizeRect.setX( QMAX(0, sizeRect.x()) ); // otherwise it would get wider than the page
+ sizeRect.setX( TQMAX(0, sizeRect.x()) ); // otherwise it would get wider than the page
}
- // each frame in m_frames should be reshaped from the original size stored in the
+ // each frame in m_frames should be retqshaped from the original size stored in the
// m_frameResize data to a size that equals the reshaping of m_boundingrect to sizeRect
class Converter {
public:
@@ -2244,21 +2244,21 @@ void FrameResizePolicy::handleMouseMove(Qt::ButtonState keyState, const KoPoint
//kdDebug() << "Converter " << from << ", " << to << " x: " << m_diffX << ", y: " << m_diffY << endl;
}
void update(KWFrame *frame, KoRect &orig) {
- QRect oldRect( m_viewMode->normalToView( frame->outerRect(m_viewMode) ) );
+ TQRect oldRect( m_viewMode->normalToView( frame->outerRect(m_viewMode) ) );
if(! frame->frameSet()->isFloating())
frame->moveTopLeft( convert( orig.topLeft() ) );
KoPoint bottomRight( convert( orig.bottomRight() ) );
frame->setBottom( bottomRight.y() );
frame->setRight( bottomRight.x() );
- QRect newRect( frame->outerRect(m_viewMode) );
- QRect frameRect( m_viewMode->normalToView( newRect ) );
+ TQRect newRect( frame->outerRect(m_viewMode) );
+ TQRect frameRect( m_viewMode->normalToView( newRect ) );
// Repaint only the changed rects (oldRect U newRect)
- m_repaintRegion += QRegion(oldRect).unite(frameRect).boundingRect();
+ m_tqrepaintRegion += TQRegion(oldRect).unite(frameRect).boundingRect();
}
- QRegion repaintRegion() {
- return m_repaintRegion;
+ TQRegion tqrepaintRegion() {
+ return m_tqrepaintRegion;
}
private:
@@ -2271,7 +2271,7 @@ void FrameResizePolicy::handleMouseMove(Qt::ButtonState keyState, const KoPoint
private: // vars
KoPoint m_from, m_to;
KWViewMode *m_viewMode;
- QRegion m_repaintRegion;
+ TQRegion m_tqrepaintRegion;
double m_diffX, m_diffY;
};
@@ -2280,9 +2280,9 @@ void FrameResizePolicy::handleMouseMove(Qt::ButtonState keyState, const KoPoint
converter.update(m_frames[i], m_frameResize[i].oldRect);
if ( !m_parent->kWordDocument()->showGrid() && m_parent->kWordDocument()->snapToGrid() )
- m_parent->repaintContents( false ); //draw the grid over the whole canvas
+ m_parent->tqrepaintContents( false ); //draw the grid over the whole canvas
else
- m_parent->repaintContents( converter.repaintRegion().boundingRect(), false );
+ m_parent->tqrepaintContents( converter.tqrepaintRegion().boundingRect(), false );
m_parent->gui()->getView()->updateFrameStatusBarItem();
}
@@ -2308,10 +2308,10 @@ void FrameResizePolicy::finishInteraction() {
// *************** FrameMovePolicy ************************
-FrameMovePolicy::FrameMovePolicy(KWCanvas *parent, KoPoint &point) :
- InteractionPolicy (parent), m_boundingRect() {
+FrameMovePolicy::FrameMovePolicy(KWCanvas *tqparent, KoPoint &point) :
+ InteractionPolicy (tqparent), m_boundingRect() {
- QValueListConstIterator<KWFrame*> framesIterator = m_frames.begin();
+ TQValueListConstIterator<KWFrame*> framesIterator = m_frames.begin();
for(;framesIterator != m_frames.end(); ++framesIterator) {
KWFrame *frame = *framesIterator;
m_boundingRect |= frame->outerKoRect();
@@ -2323,9 +2323,9 @@ FrameMovePolicy::FrameMovePolicy(KWCanvas *parent, KoPoint &point) :
m_startPoint = m_boundingRect.topLeft();
}
-void FrameMovePolicy::handleMouseMove(Qt::ButtonState keyState, const KoPoint &point) {
- bool noGrid = keyState & Qt::ShiftButton;
- bool linearMove = (keyState & Qt::AltButton) || (keyState & Qt::ControlButton);
+void FrameMovePolicy::handleMouseMove(TQt::ButtonState keyState, const KoPoint &point) {
+ bool noGrid = keyState & TQt::ShiftButton;
+ bool linearMove = (keyState & TQt::AltButton) || (keyState & TQt::ControlButton);
KWPageManager *pageManager = m_parent->kWordDocument()->pageManager();
@@ -2335,7 +2335,7 @@ void FrameMovePolicy::handleMouseMove(Qt::ButtonState keyState, const KoPoint &p
KoPoint p( point.x() - m_hotSpot.x(), point.y() - m_hotSpot.y() );
if(linearMove) {
- if(QABS(p.x() - m_startPoint.x()) < QABS(p.y() - m_startPoint.y()))
+ if(TQABS(p.x() - m_startPoint.x()) < TQABS(p.y() - m_startPoint.y()))
p.setX(m_startPoint.x());
else
p.setY(m_startPoint.y());
@@ -2371,30 +2371,30 @@ void FrameMovePolicy::handleMouseMove(Qt::ButtonState keyState, const KoPoint &p
kdDebug() << " boundingX+hotspotX=" << m_boundingRect.left() + m_hotSpot.x() << endl;
kdDebug() << " point.x()=" << point.x() << endl; */
- QPtrList<KWTableFrameSet> tablesMoved;
+ TQPtrList<KWTableFrameSet> tablesMoved;
tablesMoved.setAutoDelete( FALSE );
- QRegion repaintRegion;
+ TQRegion tqrepaintRegion;
KoPoint _move=m_boundingRect.topLeft() - oldBoundingRect.topLeft();
- QValueListIterator<KWFrame*> framesIterator = m_frames.begin();
+ TQValueListIterator<KWFrame*> framesIterator = m_frames.begin();
for(; framesIterator != m_frames.end(); ++framesIterator) {
KWFrame *frame = *framesIterator;
KWFrameSet *fs = frame->frameSet();
if ( fs->type() == FT_TABLE ) {
- if ( tablesMoved.findRef( static_cast<KWTableFrameSet *> (fs) ) == -1 )
+ if ( tablesMoved.tqfindRef( static_cast<KWTableFrameSet *> (fs) ) == -1 )
tablesMoved.append( static_cast<KWTableFrameSet *> (fs));
}
else {
- QRect oldRect( m_parent->viewMode()->normalToView( frame->outerRect(m_parent->viewMode()) ) );
+ TQRect oldRect( m_parent->viewMode()->normalToView( frame->outerRect(m_parent->viewMode()) ) );
// Move the frame
frame->moveTopLeft( frame->topLeft() + _move );
// Calculate new rectangle for this frame
- QRect newRect( frame->outerRect(m_parent->viewMode()) );
+ TQRect newRect( frame->outerRect(m_parent->viewMode()) );
- QRect frameRect( m_parent->viewMode()->normalToView( newRect ) );
+ TQRect frameRect( m_parent->viewMode()->normalToView( newRect ) );
// Repaint only the changed rects (oldRect U newRect)
- repaintRegion += QRegion(oldRect).unite(frameRect).boundingRect();
+ tqrepaintRegion += TQRegion(oldRect).unite(frameRect).boundingRect();
}
}
@@ -2404,21 +2404,21 @@ void FrameMovePolicy::handleMouseMove(Qt::ButtonState keyState, const KoPoint &p
KWTableFrameSet *table = tablesMoved.at( i );
for ( KWTableFrameSet::TableIter k(table) ; k ; ++k ) {
KWFrame * frame = k->frame( 0 );
- QRect oldRect( m_parent->viewMode()->normalToView( frame->outerRect(m_parent->viewMode()) ) );
+ TQRect oldRect( m_parent->viewMode()->normalToView( frame->outerRect(m_parent->viewMode()) ) );
frame->moveTopLeft( frame->topLeft() + _move );
// Calculate new rectangle for this frame
- QRect newRect( frame->outerRect(m_parent->viewMode()) );
- QRect frameRect( m_parent->viewMode()->normalToView( newRect ) );
+ TQRect newRect( frame->outerRect(m_parent->viewMode()) );
+ TQRect frameRect( m_parent->viewMode()->normalToView( newRect ) );
// Repaing only the changed rects (oldRect U newRect)
- repaintRegion += QRegion(oldRect).unite(frameRect).boundingRect();
+ tqrepaintRegion += TQRegion(oldRect).unite(frameRect).boundingRect();
}
}
}
if ( !m_parent->kWordDocument()->showGrid() && m_parent->kWordDocument()->snapToGrid() )
- m_parent->repaintContents( false ); //draw the grid over the whole canvas
+ m_parent->tqrepaintContents( false ); //draw the grid over the whole canvas
else
- m_parent->repaintContents( repaintRegion.boundingRect(), false );
+ m_parent->tqrepaintContents( tqrepaintRegion.boundingRect(), false );
m_parent->gui()->getView()->updateFrameStatusBarItem();
}
@@ -2442,29 +2442,29 @@ void FrameMovePolicy::finishInteraction() {
// ************** FrameSelectPolicy ***********************
-FrameSelectPolicy::FrameSelectPolicy(KWCanvas *parent, MouseMeaning meaning, KoPoint &point, Qt::ButtonState buttonState, Qt::ButtonState keyState)
- : InteractionPolicy(parent, false) {
+FrameSelectPolicy::FrameSelectPolicy(KWCanvas *tqparent, MouseMeaning meaning, KoPoint &point, TQt::ButtonState buttonState, TQt::ButtonState keyState)
+ : InteractionPolicy(tqparent, false) {
bool leftButton = buttonState & Qt::LeftButton;
// this is a special case; if a frame that is curently being edited is 'selected' on the border
// we redirect that click to the text part of the frame.
// this means we give the user a lot more space to click on the left side of the frame to
// select the first characters.
- KWFrameSetEdit *fse = parent->currentFrameSetEdit();
+ KWFrameSetEdit *fse = tqparent->currentFrameSetEdit();
if(leftButton && fse) {
KWFrameView *view = m_parent->frameViewManager()->view(point,
KWFrameViewManager::unselected, true);
if(view && view->frame()->frameSet() == fse->frameSet()) {
// make sure 'point' is inside the frame
- point.setX(QMAX(point.x(), view->frame()->left()));
- point.setY(QMAX(point.y(), view->frame()->top()));
- point.setX(QMIN(point.x(), view->frame()->right()));
- point.setY(QMIN(point.y(), view->frame()->bottom()));
+ point.setX(TQMAX(point.x(), view->frame()->left()));
+ point.setY(TQMAX(point.y(), view->frame()->top()));
+ point.setX(TQMIN(point.x(), view->frame()->right()));
+ point.setY(TQMIN(point.y(), view->frame()->bottom()));
// convert point to the view coordinate system.
- QPoint normalPoint = parent->kWordDocument()->zoomPoint(point);
- QPoint mousePos = parent->viewMode()->normalToView(normalPoint);
- QMouseEvent *me = new QMouseEvent(QEvent::MouseButtonPress, mousePos,
+ TQPoint normalPoint = tqparent->kWordDocument()->zoomPoint(point);
+ TQPoint mousePos = tqparent->viewMode()->normalToView(normalPoint);
+ TQMouseEvent *me = new TQMouseEvent(TQEvent::MouseButtonPress, mousePos,
buttonState, keyState);
fse->mousePressEvent(me, normalPoint, point );
delete me;
@@ -2478,7 +2478,7 @@ FrameSelectPolicy::FrameSelectPolicy(KWCanvas *parent, MouseMeaning meaning, KoP
m_parent->frameViewManager()->selectFrames(point, keyState, leftButton );
}
-void FrameSelectPolicy::handleMouseMove(Qt::ButtonState keyState, const KoPoint &point) {
+void FrameSelectPolicy::handleMouseMove(TQt::ButtonState keyState, const KoPoint &point) {
Q_UNUSED(keyState);
Q_UNUSED(point);
}