summaryrefslogtreecommitdiffstats
path: root/kpresenter/KPrCanvas.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kpresenter/KPrCanvas.cpp')
-rw-r--r--kpresenter/KPrCanvas.cpp138
1 files changed, 69 insertions, 69 deletions
diff --git a/kpresenter/KPrCanvas.cpp b/kpresenter/KPrCanvas.cpp
index c43faed3..66bc841a 100644
--- a/kpresenter/KPrCanvas.cpp
+++ b/kpresenter/KPrCanvas.cpp
@@ -24,7 +24,7 @@
#include <tqprogressdialog.h>
#include <tqfile.h>
-#include <tqtextstream.h>
+#include <textstream.h>
#include <tqpainter.h>
#include <tqpaintdevicemetrics.h>
#include <tqwmatrix.h>
@@ -36,7 +36,7 @@
#include <tqrect.h>
#include <tqsize.h>
#include <tqpoint.h>
-#include <tqclipboard.h>
+#include <clipboard.h>
#include <kapplication.h>
#include <kmimemagic.h>
@@ -291,7 +291,7 @@ void KPrCanvas::paintEvent( TQPaintEvent* paintEvent )
{
//kdDebug(33001) << "KPrCanvas::paintEvent" << endl;
TQPainter bufPainter;
- bufPainter.tqbegin( TQT_TQPAINTDEVICE(&buffer), this ); // double-buffering - (the buffer is as big as the widget)
+ bufPainter.begin( TQT_TQPAINTDEVICE(&buffer), this ); // double-buffering - (the buffer is as big as the widget)
bufPainter.translate( -diffx(), -diffy() );
bufPainter.setBrushOrigin( -diffx(), -diffy() );
@@ -481,7 +481,7 @@ void KPrCanvas::drawBackground( TQPainter *painter, const TQRect& rect, KPrPage
// In edit mode we also want to draw the gray area out of the pages
if ( !grayRegion.isEmpty() )
- eraseEmptySpace( painter, grayRegion, TQApplication::tqpalette().active().brush( TQColorGroup::Mid ) );
+ eraseEmptySpace( painter, grayRegion, TQApplication::palette().active().brush( TQColorGroup::Mid ) );
}
else
{
@@ -706,9 +706,9 @@ void KPrCanvas::mousePressEvent( TQMouseEvent *e )
}
else if( e->button() == Qt::MidButton )
{
- TQApplication::tqclipboard()->setSelectionMode( true );
+ TQApplication::clipboard()->setSelectionMode( true );
m_currentTextObjectView->paste();
- TQApplication::tqclipboard()->setSelectionMode( false );
+ TQApplication::clipboard()->setSelectionMode( false );
}
return;
}
@@ -1202,7 +1202,7 @@ void KPrCanvas::mouseReleaseEvent( TQMouseEvent *e )
}
if ( mouseSelectedObject )
- _tqrepaint( false );
+ _repaint( false );
emit objectSelectedChanged();
}
} break;
@@ -1379,7 +1379,7 @@ void KPrCanvas::mouseReleaseEvent( TQMouseEvent *e )
emit objectSelectedChanged();
if ( toolEditMode != TEM_MOUSE && editMode )
- tqrepaint( false );
+ repaint( false );
m_view->disableAutoScroll();
mousePressed = false;
@@ -1542,7 +1542,7 @@ void KPrCanvas::mouseMoveEvent( TQMouseEvent *e )
angle -= 360;
m_rotateObject->rotate( angle );
- _tqrepaint( m_rotateObject );
+ _repaint( m_rotateObject );
}
}break;
case INS_AUTOFORM:
@@ -2072,8 +2072,8 @@ void KPrCanvas::keyPressEvent( TQKeyEvent *e )
m_resizeObject->setOrig( m_rectBeforeResize.topLeft() );
m_resizeObject->setSize( m_rectBeforeResize.size() );
drawContour = false;
- m_view->kPresenterDoc()->tqrepaint( oldBoundingRect );
- m_view->kPresenterDoc()->tqrepaint( m_resizeObject );
+ m_view->kPresenterDoc()->repaint( oldBoundingRect );
+ m_view->kPresenterDoc()->repaint( m_resizeObject );
m_ratio = 0.0;
m_resizeObject = 0;
m_isResizing = false;
@@ -2243,7 +2243,7 @@ KPrObject * KPrCanvas::getObjectAt( const KoPoint &pos, bool withoutProtected )
void KPrCanvas::selectObj( KPrObject *kpobject )
{
kpobject->setSelected( true );
- _tqrepaint( kpobject );
+ _repaint( kpobject );
emit objectSelectedChanged();
mouseSelectedObject = true;
@@ -2252,7 +2252,7 @@ void KPrCanvas::selectObj( KPrObject *kpobject )
void KPrCanvas::deSelectObj( KPrObject *kpobject )
{
kpobject->setSelected( false );
- _tqrepaint( kpobject );
+ _repaint( kpobject );
if ( !m_activePage->isOneObjectSelected() )
{
@@ -2271,7 +2271,7 @@ void KPrCanvas::selectAllObj()
}
mouseSelectedObject = true;
- _tqrepaint( false );
+ _repaint( false );
emit objectSelectedChanged();
}
@@ -2723,9 +2723,9 @@ void KPrCanvas::setTextDepthPlus()
m_view->kPresenterDoc()->addCommand( macroCmd );
if(!lst.isEmpty())
{
- const KoParagLayout *tqlayout=lst.first()->currentParagLayoutFormat();
- m_view->showRulerIndent( tqlayout->margins[TQStyleSheetItem::MarginLeft], tqlayout->margins[TQStyleSheetItem::MarginFirstLine],
- tqlayout->margins[TQStyleSheetItem::MarginRight], lst.first()->rtl());
+ const KoParagLayout *layout=lst.first()->currentParagLayoutFormat();
+ m_view->showRulerIndent( layout->margins[TQStyleSheetItem::MarginLeft], layout->margins[TQStyleSheetItem::MarginFirstLine],
+ layout->margins[TQStyleSheetItem::MarginRight], lst.first()->rtl());
}
}
@@ -2753,9 +2753,9 @@ void KPrCanvas::setTextDepthMinus()
m_view->kPresenterDoc()->addCommand( macroCmd );
if(!lst.isEmpty())
{
- const KoParagLayout *tqlayout=lst.first()->currentParagLayoutFormat();
- m_view->showRulerIndent( tqlayout->margins[TQStyleSheetItem::MarginLeft], tqlayout->margins[TQStyleSheetItem::MarginFirstLine],
- tqlayout->margins[TQStyleSheetItem::MarginRight], lst.first()->rtl());
+ const KoParagLayout *layout=lst.first()->currentParagLayoutFormat();
+ m_view->showRulerIndent( layout->margins[TQStyleSheetItem::MarginLeft], layout->margins[TQStyleSheetItem::MarginFirstLine],
+ layout->margins[TQStyleSheetItem::MarginRight], lst.first()->rtl());
}
}
@@ -2989,7 +2989,7 @@ void KPrCanvas::stopScreenPresentation()
m_step.m_pageNumber = 0;
editMode = true;
m_drawMode = false;
- tqrepaint( false );
+ repaint( false );
setToolEditMode( toolEditMode );
setWFlags( WResizeNoErase );
}
@@ -3173,7 +3173,7 @@ bool KPrCanvas::pPrev( bool gotoPreviousPage )
m_step.m_step = *( --it );
//hopefully there are never more than 1000 sub steps :-)
m_step.m_subStep = 1000;
- tqrepaint( false );
+ repaint( false );
return false;
} else {
// when we go back on the first slide, thats like starting the presentation again
@@ -3201,7 +3201,7 @@ bool KPrCanvas::pPrev( bool gotoPreviousPage )
else
{
m_step.m_step = *( --m_pageEffectSteps.end() );
- tqrepaint( false );
+ repaint( false );
}
return true;
@@ -3544,7 +3544,7 @@ void KPrCanvas::print( TQPainter *painter, KPrinter *printer, float /*left_margi
//deSelectAllObj(); // already done in KPrView::setupPrinter
int i = 0;
- tqrepaint( false );
+ repaint( false );
kapp->processEvents();
editMode = false;
@@ -3633,7 +3633,7 @@ void KPrCanvas::print( TQPainter *painter, KPrinter *printer, float /*left_margi
fillBlack = true;
editMode = true;
- tqrepaint( false );
+ repaint( false );
}
@@ -3872,7 +3872,7 @@ void KPrCanvas::endDrawPolyline()
emit objectSelectedChanged();
if ( toolEditMode != TEM_MOUSE && editMode )
- tqrepaint( false );
+ repaint( false );
m_view->disableAutoScroll();
mousePressed = false;
modType = MT_NONE;
@@ -3885,7 +3885,7 @@ void KPrCanvas::endDrawCubicBezierCurve()
insertCubicBezierCurve( m_pointArray );
emit objectSelectedChanged();
if ( toolEditMode != TEM_MOUSE && editMode )
- tqrepaint( false );
+ repaint( false );
m_view->disableAutoScroll();
mousePressed = false;
modType = MT_NONE;
@@ -3908,7 +3908,7 @@ void KPrCanvas::selectNext()
}
}
m_view->showObjectRect( m_activePage->getSelectedObj() );
- _tqrepaint( false );
+ _repaint( false );
}
void KPrCanvas::selectPrev()
@@ -3927,7 +3927,7 @@ void KPrCanvas::selectPrev()
}
}
m_view->showObjectRect( m_activePage->getSelectedObj() );
- _tqrepaint( false );
+ _repaint( false );
}
void KPrCanvas::dragEnterEvent( TQDragEnterEvent *e )
@@ -4145,7 +4145,7 @@ void KPrCanvas::copyOasisObjs()
delete store;
kd->setEncodedData( arr );
- TQApplication::tqclipboard()->setData( dragObject, TQClipboard::Clipboard );
+ TQApplication::clipboard()->setData( dragObject, TQClipboard::Clipboard );
}
void KPrCanvas::copyObjs()
@@ -4214,7 +4214,7 @@ void KPrCanvas::copyObjs()
delete store;
kd->setEncodedData( arr );
- TQApplication::tqclipboard()->setData( dragObject, TQClipboard::Clipboard );
+ TQApplication::clipboard()->setData( dragObject, TQClipboard::Clipboard );
}
void KPrCanvas::deleteObjs()
@@ -4285,19 +4285,19 @@ unsigned int KPrCanvas::pageNums() const
return m_view->kPresenterDoc()->getPageNums();
}
-void KPrCanvas::_tqrepaint( bool /*erase*/ )
+void KPrCanvas::_repaint( bool /*erase*/ )
{
- m_view->kPresenterDoc()->tqrepaint( false );
+ m_view->kPresenterDoc()->repaint( false );
}
-void KPrCanvas::_tqrepaint( const TQRect &r )
+void KPrCanvas::_repaint( const TQRect &r )
{
- m_view->kPresenterDoc()->tqrepaint( r );
+ m_view->kPresenterDoc()->repaint( r );
}
-void KPrCanvas::_tqrepaint( KPrObject *o )
+void KPrCanvas::_repaint( KPrObject *o )
{
- m_view->kPresenterDoc()->tqrepaint( o );
+ m_view->kPresenterDoc()->repaint( o );
}
void KPrCanvas::slotExitPres()
@@ -4327,7 +4327,7 @@ void KPrCanvas::setSwitchingMode( bool continueTimer )
m_view->continueAutoPresTimer();
}
-void KPrCanvas::exitEditMode( bool tqrepaint )
+void KPrCanvas::exitEditMode( bool repaint )
{
if ( m_editObject )
{
@@ -4337,7 +4337,7 @@ void KPrCanvas::exitEditMode( bool tqrepaint )
{
m_currentTextObjectView->clearSelection();
//hide cursor when we desactivate textObjectView
- if ( tqrepaint )
+ if ( repaint )
{
m_currentTextObjectView->drawCursor( false );
m_currentTextObjectView->terminate();
@@ -4347,8 +4347,8 @@ void KPrCanvas::exitEditMode( bool tqrepaint )
delete m_currentTextObjectView;
m_currentTextObjectView = 0;
- if ( tqrepaint )
- _tqrepaint( static_cast<KPrObject*>( kpTextObj ) );
+ if ( repaint )
+ _repaint( static_cast<KPrObject*>( kpTextObj ) );
}
// Title of slide may have changed
m_view->kPresenterDoc()->updateSideBarItem( m_activePage );
@@ -4358,7 +4358,7 @@ void KPrCanvas::exitEditMode( bool tqrepaint )
else if (m_editObject->getType() == OT_PART )
{
static_cast<KPrPartObject *>(m_editObject)->deactivate();
- _tqrepaint( m_editObject );
+ _repaint( m_editObject );
m_editObject = 0;
return;
}
@@ -4602,8 +4602,8 @@ void KPrCanvas::moveObjectsByKey( int x, int y )
m_moveSnapDiff = KoPoint( 0, 0 );
- KoGuides::SnaptqStatus snaptqStatus = KoGuides::SNAP_NONE;
- m_gl.snapToGuideLines( movedRect, KEY_SNAP_DISTANCE, snaptqStatus, m_moveSnapDiff );
+ KoGuides::SnapStatus snapStatus = KoGuides::SNAP_NONE;
+ m_gl.snapToGuideLines( movedRect, KEY_SNAP_DISTANCE, snapStatus, m_moveSnapDiff );
move += m_moveSnapDiff;
}
@@ -4632,7 +4632,7 @@ void KPrCanvas::moveObjectsByKey( int x, int y )
move.setY( pageRect.bottom() - rect.bottom() );
}
- // we only want a tqrepaint if we have guide lines
+ // we only want a repaint if we have guide lines
if ( snapToGuideLines )
{
// redraw guidelines (intentionally always)
@@ -4672,7 +4672,7 @@ void KPrCanvas::moveObjectsByMouse( KoPoint &pos, bool keepXorYunchanged )
move -= m_moveSnapDiff;
m_moveSnapDiff = KoPoint( 0, 0 ); // needed if all snapping is off
- KoGuides::SnaptqStatus snaptqStatus = KoGuides::SNAP_NONE;
+ KoGuides::SnapStatus snapStatus = KoGuides::SNAP_NONE;
if ( snapToGrid )
{
@@ -4680,12 +4680,12 @@ void KPrCanvas::moveObjectsByMouse( KoPoint &pos, bool keepXorYunchanged )
- movedRect.topLeft().x() );
m_moveSnapDiff.setY( tqRound( movedRect.topLeft().y() / doc->getGridY()) * doc->getGridY()
- movedRect.topLeft().y() );
- snaptqStatus = KoGuides::SNAP_BOTH;
+ snapStatus = KoGuides::SNAP_BOTH;
}
if ( snapToGuideLines )
{
- m_gl.snapToGuideLines( movedRect, MOUSE_SNAP_DISTANCE, snaptqStatus, m_moveSnapDiff );
+ m_gl.snapToGuideLines( movedRect, MOUSE_SNAP_DISTANCE, snapStatus, m_moveSnapDiff );
}
move += m_moveSnapDiff;
@@ -4745,7 +4745,7 @@ void KPrCanvas::resizeObject( ModifyType _modType, const KoPoint & point, bool k
TQRect oldBoundingRect( m_view->zoomHandler()->zoomRect( kpobject->getRepaintRect() ) );
KoRect objRect = kpobject->getRealRect();
- KoGuides::SnaptqStatus snaptqStatus( KoGuides::SNAP_NONE );
+ KoGuides::SnapStatus snapStatus( KoGuides::SNAP_NONE );
bool left = false;
bool right = false;
@@ -4754,22 +4754,22 @@ void KPrCanvas::resizeObject( ModifyType _modType, const KoPoint & point, bool k
if ( _modType == MT_RESIZE_UP || _modType == MT_RESIZE_LU || _modType == MT_RESIZE_RU )
{
top = true;
- snaptqStatus |= KoGuides::SNAP_HORIZ;
+ snapStatus |= KoGuides::SNAP_HORIZ;
}
if ( _modType == MT_RESIZE_DN || _modType == MT_RESIZE_LD || _modType == MT_RESIZE_RD )
{
bottom = true;
- snaptqStatus |= KoGuides::SNAP_HORIZ;
+ snapStatus |= KoGuides::SNAP_HORIZ;
}
if ( _modType == MT_RESIZE_LF || _modType == MT_RESIZE_LU || _modType == MT_RESIZE_LD )
{
left = true;
- snaptqStatus |= KoGuides::SNAP_VERT;
+ snapStatus |= KoGuides::SNAP_VERT;
}
if ( _modType == MT_RESIZE_RT || _modType == MT_RESIZE_RU || _modType == MT_RESIZE_RD )
{
right = true;
- snaptqStatus |= KoGuides::SNAP_VERT;
+ snapStatus |= KoGuides::SNAP_VERT;
}
double newLeft = objRect.left();
@@ -4931,17 +4931,17 @@ void KPrCanvas::resizeObject( ModifyType _modType, const KoPoint & point, bool k
{
sp.setY( rect.bottom() );
}
- m_gl.repaintSnapping( sp, snaptqStatus );
+ m_gl.repaintSnapping( sp, snapStatus );
}
- _tqrepaint( oldBoundingRect );
- _tqrepaint( kpobject );
+ _repaint( oldBoundingRect );
+ _repaint( kpobject );
emit objectSizeChanged();
}
}
-void KPrCanvas::finishResizeObject( const TQString &name, bool tqlayout )
+void KPrCanvas::finishResizeObject( const TQString &name, bool layout )
{
if ( m_resizeObject )
{
@@ -4958,12 +4958,12 @@ void KPrCanvas::finishResizeObject( const TQString &name, bool tqlayout )
m_view->kPresenterDoc()->addCommand( resizeCmd );
}
- if ( tqlayout )
- m_view->kPresenterDoc()->tqlayout( m_resizeObject );
+ if ( layout )
+ m_view->kPresenterDoc()->layout( m_resizeObject );
m_ratio = 0.0;
m_isResizing = false;
- _tqrepaint( m_resizeObject );
+ _repaint( m_resizeObject );
m_resizeObject = NULL;
}
}
@@ -5321,14 +5321,14 @@ void KPrCanvas::textContentsToHeight()
if ( !macro )
macro = new KMacroCommand(i18n("Extend Text Contents to Height"));
macro->addCommand( cmd);
- _tqrepaint( it.current() );
+ _repaint( it.current() );
}
}
if( macro )
{
macro->execute();
m_view->kPresenterDoc()->addCommand( macro );
- m_view->kPresenterDoc()->tqrepaint(this);
+ m_view->kPresenterDoc()->repaint(this);
}
}
@@ -5354,7 +5354,7 @@ void KPrCanvas::textObjectToContents()
{
macro->execute();
m_view->kPresenterDoc()->addCommand( macro );
- m_view->kPresenterDoc()->tqrepaint(this);
+ m_view->kPresenterDoc()->repaint(this);
}
}
@@ -5444,7 +5444,7 @@ bool KPrCanvas::checkCurrentTextEdit( KPrTextObject * textObj )
if ( textObj && m_currentTextObjectView && m_currentTextObjectView->kpTextObject() != textObj )
{
m_currentTextObjectView->kpTextObject()->setEditingTextObj( false );
- _tqrepaint( m_currentTextObjectView->kpTextObject() );
+ _repaint( m_currentTextObjectView->kpTextObject() );
//don't remove selection otherwise break dnd.
m_currentTextObjectView->terminate(false);
delete m_currentTextObjectView;
@@ -5535,12 +5535,12 @@ void KPrCanvas::closeObject(bool /*close*/)
m_view->kPresenterDoc()->addCommand( cmd );
}
-void KPrCanvas::tqlayout()
+void KPrCanvas::layout()
{
TQPtrListIterator<KPrObject> it(getObjectList());
for ( ; it.current(); ++it ) {
if ( it.current()->getType() == OT_TEXT )
- static_cast<KPrTextObject *>( it.current() )->tqlayout();
+ static_cast<KPrTextObject *>( it.current() )->layout();
}
}
@@ -5553,18 +5553,18 @@ KoPoint KPrCanvas::snapPoint( KoPoint &pos, bool repaintSnapping )
bool snapToGuideLines = doc->showGuideLines() && !m_disableSnapping;
KoPoint snapDiff = KoPoint( 0, 0 ); // needed if all snapping is off
- KoGuides::SnaptqStatus snaptqStatus = KoGuides::SNAP_NONE;
+ KoGuides::SnapStatus snapStatus = KoGuides::SNAP_NONE;
if ( snapToGrid )
{
snapDiff.setX( tqRound( sp.x() / doc->getGridX()) * doc->getGridX() - sp.x() );
snapDiff.setY( tqRound( sp.y() / doc->getGridY()) * doc->getGridY() - sp.y() );
- snaptqStatus = KoGuides::SNAP_BOTH;
+ snapStatus = KoGuides::SNAP_BOTH;
}
if ( snapToGuideLines )
{
- m_gl.snapToGuideLines( sp, MOUSE_SNAP_DISTANCE, snaptqStatus, snapDiff );
+ m_gl.snapToGuideLines( sp, MOUSE_SNAP_DISTANCE, snapStatus, snapDiff );
}
sp += snapDiff;