diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:20:30 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-07-31 19:20:30 +0000 |
commit | 28bf3cbba4139c8a0f81dc9d1a2f6c4ed724f22c (patch) | |
tree | a2f011f22aa31d0839c6e2118501b7a6d2f2ae96 /kmag | |
parent | 0285229d858c8f03cde7354c679a752598cf4515 (diff) | |
download | tdeaccessibility-28bf3cbba4139c8a0f81dc9d1a2f6c4ed724f22c.tar.gz tdeaccessibility-28bf3cbba4139c8a0f81dc9d1a2f6c4ed724f22c.zip |
Trinity Qt initial conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1157633 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmag')
-rw-r--r-- | kmag/kmag.cpp | 150 | ||||
-rw-r--r-- | kmag/kmag.h | 12 | ||||
-rw-r--r-- | kmag/kmagselrect.cpp | 158 | ||||
-rw-r--r-- | kmag/kmagselrect.h | 56 | ||||
-rw-r--r-- | kmag/kmagzoomview.cpp | 202 | ||||
-rw-r--r-- | kmag/kmagzoomview.h | 74 |
6 files changed, 326 insertions, 326 deletions
diff --git a/kmag/kmag.cpp b/kmag/kmag.cpp index f385c13..12d660c 100644 --- a/kmag/kmag.cpp +++ b/kmag/kmag.cpp @@ -18,15 +18,15 @@ ***************************************************************************/ // include files for QT -#include <qdir.h> -#include <qprinter.h> -#include <qpainter.h> -#include <qlayout.h> -#include <qclipboard.h> -#include <qdragobject.h> -#include <qwhatsthis.h> -#include <qtooltip.h> -#include <qpopupmenu.h> +#include <tqdir.h> +#include <tqprinter.h> +#include <tqpainter.h> +#include <tqlayout.h> +#include <tqclipboard.h> +#include <tqdragobject.h> +#include <tqwhatsthis.h> +#include <tqtooltip.h> +#include <tqpopupmenu.h> #include <kdeversion.h> @@ -57,7 +57,7 @@ #include <kwin.h> #if KDE_VERSION < 220 -#include <qprinter.h> +#include <tqprinter.h> #else #include <kprinter.h> #endif @@ -74,7 +74,7 @@ #endif #endif -KmagApp::KmagApp(QWidget* , const char* name) +KmagApp::KmagApp(TQWidget* , const char* name) : KMainWindow(0, name, WStyle_MinMax | WType_TopLevel | WStyle_StaysOnTop | WDestructiveClose | WStyle_ContextHelp), m_defaultMouseCursorType(2) { @@ -127,91 +127,91 @@ KmagApp::~KmagApp() void KmagApp::initActions() { fileNewWindow = new KAction(i18n("New &Window"), "window_new", KStdAccel::openNew(), this, - SLOT(slotFileNewWindow()), actionCollection(),"new_window"); + TQT_SLOT(slotFileNewWindow()), actionCollection(),"new_window"); fileNewWindow->setToolTip(i18n("Open a new KMagnifier window")); refreshSwitch = new KAction(i18n("&Stop"), "stop", KStdAccel::reload(), this, - SLOT(slotToggleRefresh()), actionCollection(), "start_stop_refresh"); + TQT_SLOT(slotToggleRefresh()), actionCollection(), "start_stop_refresh"); refreshSwitch->setToolTip(i18n("Click to stop window refresh")); refreshSwitch->setWhatsThis(i18n("Clicking on this icon will <b>start</b> / <b>stop</b>\ updating of the display. Stopping the update will zero the processing power\ required (CPU usage)")); m_pSnapshot = new KAction(i18n("&Save Snapshot As..."), "ksnapshot", KStdAccel::save(), this, - SLOT(saveZoomPixmap()), actionCollection(),"snapshot"); + TQT_SLOT(saveZoomPixmap()), actionCollection(),"snapshot"); m_pSnapshot->setWhatsThis(i18n("Saves the zoomed view to an image file.")); m_pSnapshot->setToolTip(i18n("Save image to a file")); - m_pPrint = KStdAction::print(this, SLOT(slotFilePrint()), actionCollection(), "print"); + m_pPrint = KStdAction::print(this, TQT_SLOT(slotFilePrint()), actionCollection(), "print"); m_pPrint->setWhatsThis(i18n("Click on this button to print the current zoomed view.")); - m_pQuit = KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection(), "quit"); + m_pQuit = KStdAction::quit(this, TQT_SLOT(slotFileQuit()), actionCollection(), "quit"); m_pQuit->setStatusText(i18n("Quits the application")); m_pQuit->setWhatsThis (i18n("Quits the application")); - m_pCopy = KStdAction::copy(this, SLOT(copyToClipBoard()), actionCollection(), "copy"); + m_pCopy = KStdAction::copy(this, TQT_SLOT(copyToClipBoard()), actionCollection(), "copy"); m_pCopy->setWhatsThis(i18n("Click on this button to copy the current zoomed view to the clipboard which you can paste in other applications.")); m_pCopy->setToolTip(i18n("Copy zoomed image to clipboard")); m_pShowMenu = new KToggleAction(i18n("Show &Menu"), "showmenu", CTRL+Key_M, this, - SLOT(slotShowMenu()), actionCollection(),"show_menu"); + TQT_SLOT(slotShowMenu()), actionCollection(),"show_menu"); #ifdef havesetCheckedState m_pShowMenu->setCheckedState(i18n("Hide &Menu")); #endif m_pShowMainToolBar = new KToggleAction(i18n("Show Main &Toolbar"), 0, 0, this, - SLOT(slotShowMainToolBar()), actionCollection(),"show_mainToolBar"); + TQT_SLOT(slotShowMainToolBar()), actionCollection(),"show_mainToolBar"); #ifdef havesetCheckedState m_pShowMainToolBar->setCheckedState(i18n("Hide Main &Toolbar")); #endif m_pShowViewToolBar = new KToggleAction(i18n("Show &View Toolbar"), 0, 0, this, - SLOT(slotShowViewToolBar()), actionCollection(),"show_viewToolBar"); + TQT_SLOT(slotShowViewToolBar()), actionCollection(),"show_viewToolBar"); #ifdef havesetCheckedState m_pShowViewToolBar->setCheckedState(i18n("Hide &View Toolbar")); #endif m_pShowSettingsToolBar = new KToggleAction(i18n("Show &Settings Toolbar"), 0, 0, this, - SLOT(slotShowSettingsToolBar()), actionCollection(),"show_settingsToolBar"); + TQT_SLOT(slotShowSettingsToolBar()), actionCollection(),"show_settingsToolBar"); #ifdef havesetCheckedState m_pShowSettingsToolBar->setCheckedState(i18n("Hide &Settings Toolbar")); #endif m_modeFollowMouse = new KRadioAction(i18n("&Follow Mouse Mode"), "followmouse", Key_F1, this, - SLOT(slotModeFollowMouse()), actionCollection(), "mode_followmouse"); + TQT_SLOT(slotModeFollowMouse()), actionCollection(), "mode_followmouse"); m_modeFollowMouse->setToolTip(i18n("Magnify mouse area into window")); m_modeFollowMouse->setWhatsThis(i18n("In this mode the area around the mouse cursor is shown in a normal window.")); m_modeSelWin = new KRadioAction(i18n("S&election Window Mode"), "window", Key_F2, this, - SLOT(slotModeSelWin()), actionCollection(), "mode_selectionwindow"); + TQT_SLOT(slotModeSelWin()), actionCollection(), "mode_selectionwindow"); m_modeSelWin->setToolTip(i18n("Magnify selected area into window")); m_modeSelWin->setWhatsThis(i18n("In this mode a selection window is opened. The selected area is shown in a normal window.")); m_modeEdgeTop = new KRadioAction(i18n("&Top Screen Edge Mode"), 0, 0, this, - SLOT(slotModeEdgeTop()), actionCollection(),"mode_edgetop"); + TQT_SLOT(slotModeEdgeTop()), actionCollection(),"mode_edgetop"); m_modeEdgeTop->setToolTip(i18n("Magnify mouse area to top screen edge")); m_modeEdgeTop->setWhatsThis(i18n("In this mode the area around the mouse is magnified to the top screen edge.")); m_modeEdgeLeft = new KRadioAction(i18n("&Left Screen Edge Mode"), 0, 0, this, - SLOT(slotModeEdgeLeft()), actionCollection(),"mode_edgeleft"); + TQT_SLOT(slotModeEdgeLeft()), actionCollection(),"mode_edgeleft"); m_modeEdgeLeft->setToolTip(i18n("Magnify mouse area to left screen edge")); m_modeEdgeLeft->setWhatsThis(i18n("In this mode the area around the mouse is magnified to the left screen edge.")); m_modeEdgeRight = new KRadioAction(i18n("&Right Screen Edge Mode"), 0, 0, this, - SLOT(slotModeEdgeRight()), actionCollection(),"mode_edgeright"); + TQT_SLOT(slotModeEdgeRight()), actionCollection(),"mode_edgeright"); m_modeEdgeRight->setToolTip(i18n("Magnify mouse area to right screen edge")); m_modeEdgeRight->setWhatsThis(i18n("In this mode the area around the mouse is magnified to the right screen edge.")); m_modeEdgeBottom = new KRadioAction(i18n("&Bottom Screen Edge Mode"), 0, 0, this, - SLOT(slotModeEdgeBottom()), actionCollection(),"mode_edgebottom"); + TQT_SLOT(slotModeEdgeBottom()), actionCollection(),"mode_edgebottom"); m_modeEdgeBottom->setToolTip(i18n("Magnify mouse area to bottom screen edge")); m_modeEdgeBottom->setWhatsThis(i18n("In this mode the area around the mouse is magnified to the bottom screen edge.")); m_hideCursor = new KToggleAction(i18n("Hide Mouse &Cursor"), "hidemouse", Key_F4, this, - SLOT(slotToggleHideCursor()), actionCollection(), "hidecursor"); + TQT_SLOT(slotToggleHideCursor()), actionCollection(), "hidecursor"); #ifdef havesetCheckedState m_hideCursor->setCheckedState(i18n("Show Mouse &Cursor")); #endif m_hideCursor->setToolTip(i18n("Hide the mouse cursor")); - m_pZoomIn = KStdAction::zoomIn(this, SLOT(zoomIn()), actionCollection(), "zoom_in"); + m_pZoomIn = KStdAction::zoomIn(this, TQT_SLOT(zoomIn()), actionCollection(), "zoom_in"); m_pZoomIn->setWhatsThis(i18n("Click on this button to <b>zoom-in</b> on the selected region.")); m_pZoomBox = new KSelectAction(i18n("&Zoom"),0,actionCollection(),"zoom"); @@ -219,11 +219,11 @@ void KmagApp::initActions() m_pZoomBox->setWhatsThis(i18n("Select the zoom factor.")); m_pZoomBox->setToolTip(i18n("Zoom factor")); - m_pZoomOut = KStdAction::zoomOut(this, SLOT(zoomOut()), actionCollection(), "zoom_out"); + m_pZoomOut = KStdAction::zoomOut(this, TQT_SLOT(zoomOut()), actionCollection(), "zoom_out"); m_pZoomOut->setWhatsThis(i18n("Click on this button to <b>zoom-out</b> on the selected region.")); m_pInvert = new KToggleAction(i18n("&Invert Colors"), 0, Key_F6, this, - SLOT(slotToggleInvert()), actionCollection(), "invert"); + TQT_SLOT(slotToggleInvert()), actionCollection(), "invert"); m_pRotationBox = new KSelectAction(i18n("&Rotation"),0,actionCollection(),"rotation"); m_pRotationBox->setItems(rotationArrayString); @@ -232,8 +232,8 @@ void KmagApp::initActions() // KHelpMenu *newHelpMenu = new KHelpMenu(this, KGlobal::instance()->aboutData()); - m_keyConf = KStdAction::keyBindings( this, SLOT( slotConfKeys() ), actionCollection(), "key_conf"); - m_toolConf = KStdAction::configureToolbars( this, SLOT( slotEditToolbars() ), + m_keyConf = KStdAction::keyBindings( this, TQT_SLOT( slotConfKeys() ), actionCollection(), "key_conf"); + m_toolConf = KStdAction::configureToolbars( this, TQT_SLOT( slotEditToolbars() ), actionCollection(), "toolbar_conf"); m_pFPSBox = new KSelectAction(i18n("Re&fresh"),0,actionCollection(),"fps_selector"); @@ -247,9 +247,9 @@ void KmagApp::initActions() void KmagApp::initView() { m_zoomView = new KMagZoomView( this, "ZoomView" ); - m_zoomView->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, m_zoomView->sizePolicy().hasHeightForWidth() ) ); - m_zoomView->setFrameShape( QFrame::StyledPanel ); - m_zoomView->setFrameShadow( QFrame::Raised ); + m_zoomView->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, m_zoomView->sizePolicy().hasHeightForWidth() ) ); + m_zoomView->setFrameShape( TQFrame::StyledPanel ); + m_zoomView->setFrameShadow( TQFrame::Raised ); setCentralWidget(m_zoomView); } @@ -260,21 +260,21 @@ void KmagApp::initView() void KmagApp::initConnections() { // change in zoom value -> update the view - connect(this, SIGNAL(updateZoomValue(float)), m_zoomView, SLOT(setZoom(float))); - connect(this, SIGNAL(updateRotationValue(int)), m_zoomView, SLOT(setRotation(int))); - connect(this, SIGNAL(updateFPSValue(float)), m_zoomView, SLOT(setRefreshRate(float))); + connect(this, TQT_SIGNAL(updateZoomValue(float)), m_zoomView, TQT_SLOT(setZoom(float))); + connect(this, TQT_SIGNAL(updateRotationValue(int)), m_zoomView, TQT_SLOT(setRotation(int))); + connect(this, TQT_SIGNAL(updateFPSValue(float)), m_zoomView, TQT_SLOT(setRefreshRate(float))); // change in zoom index -> update the selector - connect(this, SIGNAL(updateZoomIndex(int)), m_pZoomBox, SLOT(setCurrentItem(int))); - connect(this, SIGNAL(updateRotationIndex(int)), m_pRotationBox, SLOT(setCurrentItem(int))); - connect(this, SIGNAL(updateFPSIndex(int)), m_pFPSBox, SLOT(setCurrentItem(int))); + connect(this, TQT_SIGNAL(updateZoomIndex(int)), m_pZoomBox, TQT_SLOT(setCurrentItem(int))); + connect(this, TQT_SIGNAL(updateRotationIndex(int)), m_pRotationBox, TQT_SLOT(setCurrentItem(int))); + connect(this, TQT_SIGNAL(updateFPSIndex(int)), m_pFPSBox, TQT_SLOT(setCurrentItem(int))); // selector selects a zoom index -> set the zoom index - connect(m_pZoomBox, SIGNAL(activated(int)), this, SLOT(setZoomIndex(int))); - connect(m_pRotationBox, SIGNAL(activated(int)), this, SLOT(setRotationIndex(int))); - connect(m_pFPSBox, SIGNAL(activated(int)), this, SLOT(setFPSIndex(int))); + connect(m_pZoomBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setZoomIndex(int))); + connect(m_pRotationBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setRotationIndex(int))); + connect(m_pFPSBox, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setFPSIndex(int))); - connect(m_zoomView, SIGNAL(contextMenu(QPoint)), this, SLOT(contextMenu(QPoint))); + connect(m_zoomView, TQT_SIGNAL(contextMenu(TQPoint)), this, TQT_SLOT(contextMenu(TQPoint))); } /** @@ -322,9 +322,9 @@ void KmagApp::saveOptions() */ void KmagApp::readOptions() { - QColor blue (0,0,128); - QColor yellow (255,255,0); - QColor white (255,255,255); + TQColor blue (0,0,128); + TQColor yellow (255,255,0); + TQColor white (255,255,255); config->setGroup ("WM"); setTitleColors ( @@ -334,8 +334,8 @@ void KmagApp::readOptions() config->setGroup("General Options"); - QSize defSize(460,390); - QSize size=config->readSizeEntry("Geometry", &defSize); + TQSize defSize(460,390); + TQSize size=config->readSizeEntry("Geometry", &defSize); if(!size.isEmpty()) { resize(size); @@ -357,7 +357,7 @@ void KmagApp::readOptions() setFPSIndex(fpsIndex); emit updateFPSIndex(m_fpsIndex); - QRect defaultRect(0,0,211,164); + TQRect defaultRect(0,0,211,164); m_zoomView->setSelRectPos(config->readRectEntry("SelRect", &defaultRect)); m_mouseCursorType = config->readUnsignedNumEntry("ShowMouse", m_defaultMouseCursorType); @@ -391,7 +391,7 @@ void KmagApp::readOptions() config->setGroup("General Options"); edgesize = config->readNumEntry("EdgeSize", 0); - QString mode = config->readEntry("Mode", "followmouse"); + TQString mode = config->readEntry("Mode", "followmouse"); if (mode == "selectionwindow") slotModeSelWin(); else if (mode == "edgetop") @@ -419,7 +419,7 @@ bool KmagApp::queryExit() ///////////////////////////////////////////////////////////////////// -// SLOT IMPLEMENTATION +// TQT_SLOT IMPLEMENTATION ///////////////////////////////////////////////////////////////////// /** @@ -555,7 +555,7 @@ void KmagApp::saveZoomPixmap() toggled = true; } - KURL url = KFileDialog::getSaveURL(QString::null, + KURL url = KFileDialog::getSaveURL(TQString::null, KImageIO::pattern(KImageIO::Writing), 0,i18n("Save Snapshot As")); @@ -636,7 +636,7 @@ void KmagApp::slotModeEdgeTop() int newedgesize; bool ok; newedgesize = KInputDialog::getInteger (i18n ("Magnify to Screen Edge - Select Size"), i18n ("Size:"), edgesize > 0 ? edgesize : 300, 200, - QApplication::desktop()->screenGeometry( this ).height()/2, + TQApplication::desktop()->screenGeometry( this ).height()/2, 25, 10, &ok, 0, "getedgesize"); if (ok) { @@ -652,7 +652,7 @@ void KmagApp::slotModeEdgeLeft() int newedgesize; bool ok; newedgesize = KInputDialog::getInteger (i18n ("Magnify to Left Screen Edge - Select Size"), i18n ("Size:"), edgesize > 0 ? edgesize : 300, 200, - QApplication::desktop()->screenGeometry( this ).width()/2, + TQApplication::desktop()->screenGeometry( this ).width()/2, 25, 10, &ok, 0, "getedgesize"); if (ok) { @@ -668,7 +668,7 @@ void KmagApp::slotModeEdgeRight() int newedgesize; bool ok; newedgesize = KInputDialog::getInteger (i18n ("Magnify to Right Screen Edge - Select Size"), i18n ("Size:"), edgesize > 0 ? edgesize : 300, 200, - QApplication::desktop()->screenGeometry( this ).width()/2, + TQApplication::desktop()->screenGeometry( this ).width()/2, 25, 10, &ok, 0, "getedgesize"); if (ok) { @@ -684,7 +684,7 @@ void KmagApp::slotModeEdgeBottom() int newedgesize; bool ok; newedgesize = KInputDialog::getInteger (i18n ("Magnify to Bottom Screen Edge - Select Size"), i18n ("Size:"), edgesize > 0 ? edgesize : 300, 200, - QApplication::desktop()->screenGeometry( this ).height()/2, + TQApplication::desktop()->screenGeometry( this ).height()/2, 25, 10, &ok, 0, "getedgesize"); if (ok) { @@ -697,11 +697,11 @@ void KmagApp::slotModeEdgeBottom() void KmagApp::setEdgeMode (KToggleAction *mode) { if (m_modeEdgeLeft || mode == m_modeEdgeRight) { - if (edgesize < 200 || edgesize > QApplication::desktop()->screenGeometry( this ).width()/2) - edgesize = QApplication::desktop()->screenGeometry( this ).width()/4; + if (edgesize < 200 || edgesize > TQApplication::desktop()->screenGeometry( this ).width()/2) + edgesize = TQApplication::desktop()->screenGeometry( this ).width()/4; } else { - if (edgesize < 200 || edgesize > QApplication::desktop()->screenGeometry( this ).height()/2) - edgesize = QApplication::desktop()->screenGeometry( this ).height()/4; + if (edgesize < 200 || edgesize > TQApplication::desktop()->screenGeometry( this ).height()/2) + edgesize = TQApplication::desktop()->screenGeometry( this ).height()/4; } m_modeFollowMouse->setChecked(false); @@ -716,7 +716,7 @@ void KmagApp::setEdgeMode (KToggleAction *mode) m_zoomView->followMouse(true); m_zoomView->showSelRect(false); - m_zoomView->reparent (0, QPoint(), false); + m_zoomView->reparent (0, TQPoint(), false); KWin::setType(m_zoomView->winId(), NET::Dock); KWin::setState(m_zoomView->winId(), NET::Sticky | NET::KeepBelow | NET::SkipTaskbar | NET::SkipPager); KWin::setOnAllDesktops(m_zoomView->winId(), true); @@ -729,27 +729,27 @@ void KmagApp::setEdgeMode (KToggleAction *mode) hide(); if (mode == m_modeEdgeTop) { - QRect r = QApplication::desktop()->screenGeometry( this ); + TQRect r = TQApplication::desktop()->screenGeometry( this ); r.setBottom( r.top() + edgesize ); m_zoomView->setGeometry ( r ); KWin::setExtendedStrut (m_zoomView->winId(), 0, 0, 0, 0, 0, 0, edgesize, r.left(), r.right(), 0, 0, 0); } else if (mode == m_modeEdgeLeft) { - QRect r = QApplication::desktop()->screenGeometry( this ); + TQRect r = TQApplication::desktop()->screenGeometry( this ); r.setRight( r.left() + edgesize ); m_zoomView->setGeometry ( r ); KWin::setExtendedStrut (m_zoomView->winId(), edgesize, r.top(), r.bottom(), 0, 0, 0, 0, 0, 0, 0, 0, 0); } else if (mode == m_modeEdgeRight) { - QRect r = QApplication::desktop()->screenGeometry( this ); + TQRect r = TQApplication::desktop()->screenGeometry( this ); r.setLeft( r.right() - edgesize ); m_zoomView->setGeometry ( r ); KWin::setExtendedStrut (m_zoomView->winId(), 0, 0, 0, edgesize, r.top(), r.bottom(), 0, 0, 0, 0, 0, 0); } else { - QRect r = QApplication::desktop()->screenGeometry( this ); + TQRect r = TQApplication::desktop()->screenGeometry( this ); r.setTop( r.bottom() - edgesize ); m_zoomView->setGeometry ( r ); KWin::setExtendedStrut (m_zoomView->winId(), 0, 0, 0, 0, 0, 0, 0, 0, 0, @@ -771,7 +771,7 @@ void KmagApp::unsetEdgeMode (KToggleAction *mode) m_modeEdgeBottom->setChecked(false); mode->setChecked (true); - m_zoomView->reparent (this, QPoint(), true); + m_zoomView->reparent (this, TQPoint(), true); setCentralWidget(m_zoomView); KWin::setExtendedStrut (winId(), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0); @@ -804,7 +804,7 @@ void KmagApp::slotFilePrint() bool toggled(false); #if KDE_VERSION < 220 - QPrinter printer; + TQPrinter printer; #else KPrinter printer; #endif @@ -815,7 +815,7 @@ void KmagApp::slotFilePrint() toggled = true; } - const QPixmap pixmap(m_zoomView->getPixmap()); + const TQPixmap pixmap(m_zoomView->getPixmap()); #if KDE_VERSION >= 220 // use some AI to get the best orientation @@ -827,7 +827,7 @@ void KmagApp::slotFilePrint() #endif if (printer.setup(this)) { - QPainter paint; + TQPainter paint; if(!paint.begin(&printer)) return; @@ -935,17 +935,17 @@ void KmagApp::slotEditToolbars() { saveMainWindowSettings( KGlobal::config(), "MainWindow" ); KEditToolbar dlg( actionCollection() ); - connect( &dlg, SIGNAL( newToolbarConfig() ), this, SLOT( slotNewToolbarConfig() ) ); + connect( &dlg, TQT_SIGNAL( newToolbarConfig() ), this, TQT_SLOT( slotNewToolbarConfig() ) ); if ( dlg.exec() ) createGUI(); } -void KmagApp::contextMenu (QPoint pos) +void KmagApp::contextMenu (TQPoint pos) { // show popup KXMLGUIFactory *factory = this->factory(); - QPopupMenu *popup = (QPopupMenu *)factory->container("mainPopUp",this); + TQPopupMenu *popup = (TQPopupMenu *)factory->container("mainPopUp",this); if (popup != 0) popup->popup(pos, 0); } diff --git a/kmag/kmag.h b/kmag/kmag.h index bfd2e31..6a27f03 100644 --- a/kmag/kmag.h +++ b/kmag/kmag.h @@ -30,7 +30,7 @@ #include <vector> // include files for Qt -#include <qstringlist.h> +#include <tqstringlist.h> // include files for KDE #include <kapplication.h> @@ -62,7 +62,7 @@ class KmagApp : public KMainWindow /** * Construtor of KmagApp, calls all init functions to create the application. */ - KmagApp(QWidget* parent=0, const char* name=0); + KmagApp(TQWidget* parent=0, const char* name=0); /// Default destructor ~KmagApp(); @@ -160,7 +160,7 @@ class KmagApp : public KMainWindow /// Called when "configure toolbar" is clicked void slotEditToolbars(); - void contextMenu(QPoint pos); + void contextMenu(TQPoint pos); signals: /// This signal is raised whenever the index into the zoom array is changed @@ -213,13 +213,13 @@ class KmagApp : public KMainWindow /// Current index into the fpsArray unsigned int m_fpsIndex; - QStringList zoomArrayString; + TQStringList zoomArrayString; std::vector<float> zoomArray; - QStringList rotationArrayString; + TQStringList rotationArrayString; std::vector<int> rotationArray; - QStringList fpsArrayString; + TQStringList fpsArrayString; std::vector<float> fpsArray; KMagZoomView* m_zoomView; diff --git a/kmag/kmagselrect.cpp b/kmag/kmagselrect.cpp index 4347d96..68e09b0 100644 --- a/kmag/kmagselrect.cpp +++ b/kmag/kmagselrect.cpp @@ -20,25 +20,25 @@ #include "kmagselrect.h" #include "kmagselrect.moc" -#include <qapplication.h> -#include <qcursor.h> -#include <qdesktopwidget.h> -#include <qpixmap.h> -#include <qbitmap.h> +#include <tqapplication.h> +#include <tqcursor.h> +#include <tqdesktopwidget.h> +#include <tqpixmap.h> +#include <tqbitmap.h> #include <kapplication.h> #include <klocale.h> static uchar line_bits[] = {0x2d, 0x96, 0x4b, 0xa5, 0xd2, 0x69, 0xb4, 0x5a}; -static QColor titleColor = QColor (0,0,128); -static QColor titleBtnColor = QColor (255,255,0); -static QColor textColor = QColor (255,255,255); +static TQColor titleColor = TQColor (0,0,128); +static TQColor titleBtnColor = TQColor (255,255,0); +static TQColor textColor = TQColor (255,255,255); static int frameSize = 10; static int titleSize = 24; -void setTitleColors (QColor title, QColor text, QColor titleBtn) +void setTitleColors (TQColor title, TQColor text, TQColor titleBtn) { titleColor = title; titleBtnColor = titleBtn; @@ -55,17 +55,17 @@ void setTitleSize (int size) titleSize = size; } -QColor getTitleColor () +TQColor getTitleColor () { return titleColor; } -QColor getTitleBtnColor () +TQColor getTitleBtnColor () { return titleBtnColor; } -QColor getTextColor () +TQColor getTextColor () { return textColor; } @@ -87,34 +87,34 @@ int getTitleSize () // Construction //-------------------------------------------------------------------------- -KMagSelRect::KMagSelRect(QWidget *parent) : - QRect() +KMagSelRect::KMagSelRect(TQWidget *parent) : + TQRect() { init(parent); } -KMagSelRect::KMagSelRect(const QPoint &topLeft, const QPoint &bottomRight, - QWidget *parent) : -QRect(topLeft, bottomRight) +KMagSelRect::KMagSelRect(const TQPoint &topLeft, const TQPoint &bottomRight, + TQWidget *parent) : +TQRect(topLeft, bottomRight) { init(parent); } -KMagSelRect::KMagSelRect(const QPoint &topLeft, const QSize &size, - QWidget *parent) : -QRect(topLeft, size) +KMagSelRect::KMagSelRect(const TQPoint &topLeft, const TQSize &size, + TQWidget *parent) : +TQRect(topLeft, size) { init(parent); } KMagSelRect::KMagSelRect(int left, int top, int width, int height, - QWidget *parent) : -QRect(left, top, width, height) + TQWidget *parent) : +TQRect(left, top, width, height) { init(parent); } -void KMagSelRect::init(QWidget *parent) +void KMagSelRect::init(TQWidget *parent) { // Make sure parent is the window itself, not a widget within the window if (parent != 0) @@ -162,7 +162,7 @@ void KMagSelRect::show() { if (selectionwindow == 0) { selectionwindow = new KMagSelWin (selWindowParent, "selectionwindow"); - connect (selectionwindow, SIGNAL (resized ()), this, SLOT (selWinResized ())); + connect (selectionwindow, TQT_SIGNAL (resized ()), this, TQT_SLOT (selWinResized ())); update(); selectionwindow->show(); @@ -184,29 +184,29 @@ void KMagSelRect::hide() void KMagSelRect::update() { // make sure the selection window does not go outside of the display - if (height() > QApplication::desktop()->geometry().height()) - setHeight (QApplication::desktop()->geometry().height()); - if (width() > QApplication::desktop()->geometry().width()) - setWidth (QApplication::desktop()->geometry().width()); + if (height() > TQApplication::desktop()->geometry().height()) + setHeight (TQApplication::desktop()->geometry().height()); + if (width() > TQApplication::desktop()->geometry().width()) + setWidth (TQApplication::desktop()->geometry().width()); if (top() < 0) moveTop (0); if (left() < 0) moveLeft (0); - if (bottom() > QApplication::desktop()->geometry().bottom()) - moveBottom (QApplication::desktop()->geometry().bottom()); - if (right() > QApplication::desktop()->geometry().right()) - moveRight (QApplication::desktop()->geometry().right()); + if (bottom() > TQApplication::desktop()->geometry().bottom()) + moveBottom (TQApplication::desktop()->geometry().bottom()); + if (right() > TQApplication::desktop()->geometry().right()) + moveRight (TQApplication::desktop()->geometry().right()); if (selectionwindow != 0) - selectionwindow->setSelRect (QRect (topLeft(), bottomRight())); + selectionwindow->setSelRect (TQRect (topLeft(), bottomRight())); } void KMagSelRect::selWinResized() { if (selectionwindow != 0) { - QRect newRect = selectionwindow->getSelRect(); + TQRect newRect = selectionwindow->getSelRect(); setRect (newRect.x(), newRect.y(), newRect.width(), newRect.height()); } } @@ -215,43 +215,43 @@ void KMagSelRect::selWinResized() // KMagSelWin //-------------------------------------------------------------------------- -KMagSelWin::KMagSelWin ( QWidget * parent, const char * name, WFlags ) : - QWidget (parent, name, WStyle_Customize | WStyle_NoBorder | WStyle_StaysOnTop | WType_TopLevel | WX11BypassWM) +KMagSelWin::KMagSelWin ( TQWidget * parent, const char * name, WFlags ) : + TQWidget (parent, name, WStyle_Customize | WStyle_NoBorder | WStyle_StaysOnTop | WType_TopLevel | WX11BypassWM) { - QBitmap line (8, 8, line_bits, true); + TQBitmap line (8, 8, line_bits, true); setPaletteBackgroundPixmap (line); - setBackgroundOrigin (QWidget::WindowOrigin); + setBackgroundOrigin (TQWidget::WindowOrigin); titleBar = new KMagSelWinCorner (this, "titlebar"); titleBar->setPaletteBackgroundColor (getTitleColor ()); titleBar->setPaletteForegroundColor (getTextColor ()); titleBar->setText(i18n("Selection Window")+" - "+i18n("KMagnifier")); - connect (titleBar, SIGNAL (startResizing ()), this, SLOT (startResizing ())); - connect (titleBar, SIGNAL (resized (QPoint)), this, SLOT (titleMoved (QPoint))); + connect (titleBar, TQT_SIGNAL (startResizing ()), this, TQT_SLOT (startResizing ())); + connect (titleBar, TQT_SIGNAL (resized (TQPoint)), this, TQT_SLOT (titleMoved (TQPoint))); topLeftCorner = new KMagSelWinCorner (this, "topleft"); topLeftCorner->setCursor (Qt::SizeFDiagCursor); topLeftCorner->setPaletteBackgroundColor (getTitleBtnColor ()); - connect (topLeftCorner, SIGNAL (startResizing ()), this, SLOT (startResizing ())); - connect (topLeftCorner, SIGNAL (resized (QPoint)), this, SLOT (topLeftResized (QPoint))); + connect (topLeftCorner, TQT_SIGNAL (startResizing ()), this, TQT_SLOT (startResizing ())); + connect (topLeftCorner, TQT_SIGNAL (resized (TQPoint)), this, TQT_SLOT (topLeftResized (TQPoint))); topRightCorner = new KMagSelWinCorner (this, "topright"); topRightCorner->setCursor (Qt::SizeBDiagCursor); topRightCorner->setPaletteBackgroundColor (getTitleBtnColor ()); - connect (topRightCorner, SIGNAL (startResizing ()), this, SLOT (startResizing ())); - connect (topRightCorner, SIGNAL (resized (QPoint)), this, SLOT (topRightResized (QPoint))); + connect (topRightCorner, TQT_SIGNAL (startResizing ()), this, TQT_SLOT (startResizing ())); + connect (topRightCorner, TQT_SIGNAL (resized (TQPoint)), this, TQT_SLOT (topRightResized (TQPoint))); bottomLeftCorner = new KMagSelWinCorner (this, "bottomleft"); bottomLeftCorner->setCursor (Qt::SizeBDiagCursor); bottomLeftCorner->setPaletteBackgroundColor (getTitleBtnColor ()); - connect (bottomLeftCorner, SIGNAL (startResizing ()), this, SLOT (startResizing ())); - connect (bottomLeftCorner, SIGNAL (resized (QPoint)), this, SLOT (bottomLeftResized (QPoint))); + connect (bottomLeftCorner, TQT_SIGNAL (startResizing ()), this, TQT_SLOT (startResizing ())); + connect (bottomLeftCorner, TQT_SIGNAL (resized (TQPoint)), this, TQT_SLOT (bottomLeftResized (TQPoint))); bottomRightCorner = new KMagSelWinCorner (this, "bottomright"); bottomRightCorner->setCursor (Qt::SizeFDiagCursor); bottomRightCorner->setPaletteBackgroundColor (getTitleBtnColor ()); - connect (bottomRightCorner, SIGNAL (startResizing ()), this, SLOT (startResizing ())); - connect (bottomRightCorner, SIGNAL (resized (QPoint)), this, SLOT (bottomRightResized (QPoint))); + connect (bottomRightCorner, TQT_SIGNAL (startResizing ()), this, TQT_SLOT (startResizing ())); + connect (bottomRightCorner, TQT_SIGNAL (resized (TQPoint)), this, TQT_SLOT (bottomRightResized (TQPoint))); } KMagSelWin::~KMagSelWin() @@ -263,7 +263,7 @@ KMagSelWin::~KMagSelWin() delete bottomRightCorner; } -void KMagSelWin::setSelRect (QRect selRect) +void KMagSelWin::setSelRect (TQRect selRect) { selRect = selRect.normalize(); @@ -271,10 +271,10 @@ void KMagSelWin::setSelRect (QRect selRect) selRect.setLeft (0); if (selRect.top() < 0) selRect.setTop (0); - if (selRect.right() > QApplication::desktop()->width()) - selRect.setRight (QApplication::desktop()->width()); - if (selRect.bottom() > QApplication::desktop()->height()) - selRect.setBottom (QApplication::desktop()->height()); + if (selRect.right() > TQApplication::desktop()->width()) + selRect.setRight (TQApplication::desktop()->width()); + if (selRect.bottom() > TQApplication::desktop()->height()) + selRect.setBottom (TQApplication::desktop()->height()); setGeometry ( selRect.left() - getFrameSize(), @@ -290,13 +290,13 @@ void KMagSelWin::setSelRect (QRect selRect) if (selRect.height() < h+h) h = static_cast<int>(selRect.height()/2); - setMask (QRegion (QRect (0, 0, width(), height ())) - - QRegion (QRect (getFrameSize(), getTitleSize()+2, selRect.width(), selRect.height())) - - QRegion (QRect (0, 0, getFrameSize()+w, getTitleSize()+2-getFrameSize())) - - QRegion (QRect (width()-getFrameSize()-w, 0, getFrameSize()+w, getTitleSize()+2-getFrameSize())) - - QRegion (QRect (0, getTitleSize()+2+h, getFrameSize()-2, selRect.height()-h-h)) - - QRegion (QRect (width()-getFrameSize()+2, getTitleSize()+2+h, getFrameSize()-2, selRect.height()-h-h)) - - QRegion (QRect (getFrameSize()+w, height()-getFrameSize()+2, selRect.width()-w-w, getFrameSize()-2))); + setMask (TQRegion (TQRect (0, 0, width(), height ())) + - TQRegion (TQRect (getFrameSize(), getTitleSize()+2, selRect.width(), selRect.height())) + - TQRegion (TQRect (0, 0, getFrameSize()+w, getTitleSize()+2-getFrameSize())) + - TQRegion (TQRect (width()-getFrameSize()-w, 0, getFrameSize()+w, getTitleSize()+2-getFrameSize())) + - TQRegion (TQRect (0, getTitleSize()+2+h, getFrameSize()-2, selRect.height()-h-h)) + - TQRegion (TQRect (width()-getFrameSize()+2, getTitleSize()+2+h, getFrameSize()-2, selRect.height()-h-h)) + - TQRegion (TQRect (getFrameSize()+w, height()-getFrameSize()+2, selRect.width()-w-w, getFrameSize()-2))); titleBar->setGeometry (getFrameSize()+w, 0, selRect.width()-h-h, getTitleSize()); topLeftCorner->setGeometry (0, getTitleSize()+2-getFrameSize(), getFrameSize()+w, getFrameSize()+h); @@ -305,9 +305,9 @@ void KMagSelWin::setSelRect (QRect selRect) bottomRightCorner->setGeometry (width()-getFrameSize()-w, height()-getFrameSize()-h, getFrameSize()+w, getFrameSize()+h); } -QRect KMagSelWin::getSelRect () +TQRect KMagSelWin::getSelRect () { - return QRect ( + return TQRect ( x() + getFrameSize(), y() + getTitleSize()+2, width() - getFrameSize() - getFrameSize(), @@ -319,35 +319,35 @@ void KMagSelWin::startResizing () oldSelRect = getSelRect(); } -void KMagSelWin::titleMoved ( QPoint offset ) +void KMagSelWin::titleMoved ( TQPoint offset ) { - QRect selRect = oldSelRect; + TQRect selRect = oldSelRect; selRect.moveBy (offset.x(), offset.y()); setSelRect (selRect); emit resized (); } -void KMagSelWin::topLeftResized ( QPoint offset ) +void KMagSelWin::topLeftResized ( TQPoint offset ) { - setSelRect (QRect(oldSelRect.topLeft() + offset, oldSelRect.bottomRight ())); + setSelRect (TQRect(oldSelRect.topLeft() + offset, oldSelRect.bottomRight ())); emit resized(); } -void KMagSelWin::topRightResized ( QPoint offset ) +void KMagSelWin::topRightResized ( TQPoint offset ) { - setSelRect (QRect(oldSelRect.topRight() + offset, oldSelRect.bottomLeft ())); + setSelRect (TQRect(oldSelRect.topRight() + offset, oldSelRect.bottomLeft ())); emit resized(); } -void KMagSelWin::bottomLeftResized ( QPoint offset ) +void KMagSelWin::bottomLeftResized ( TQPoint offset ) { - setSelRect (QRect(oldSelRect.bottomLeft() + offset, oldSelRect.topRight ())); + setSelRect (TQRect(oldSelRect.bottomLeft() + offset, oldSelRect.topRight ())); emit resized(); } -void KMagSelWin::bottomRightResized ( QPoint offset ) +void KMagSelWin::bottomRightResized ( TQPoint offset ) { - setSelRect (QRect(oldSelRect.bottomRight() + offset, oldSelRect.topLeft())); + setSelRect (TQRect(oldSelRect.bottomRight() + offset, oldSelRect.topLeft())); emit resized(); } @@ -356,10 +356,10 @@ void KMagSelWin::bottomRightResized ( QPoint offset ) // KMagSelWinCorner //-------------------------------------------------------------------------- -KMagSelWinCorner::KMagSelWinCorner ( QWidget * parent, const char * name, WFlags f ) : - QLabel (parent, name, f) +KMagSelWinCorner::KMagSelWinCorner ( TQWidget * parent, const char * name, WFlags f ) : + TQLabel (parent, name, f) { - setFrameStyle (QFrame::WinPanel | QFrame::Raised); + setFrameStyle (TQFrame::WinPanel | TQFrame::Raised); setLineWidth (1); } @@ -367,19 +367,19 @@ KMagSelWinCorner::~KMagSelWinCorner() { } -void KMagSelWinCorner::mousePressEvent ( QMouseEvent * e ) +void KMagSelWinCorner::mousePressEvent ( TQMouseEvent * e ) { oldPos = e->globalPos (); emit startResizing (); } -void KMagSelWinCorner::mouseReleaseEvent ( QMouseEvent * e ) +void KMagSelWinCorner::mouseReleaseEvent ( TQMouseEvent * e ) { - setFrameShadow (QFrame::Raised); + setFrameShadow (TQFrame::Raised); emit resized (e->globalPos () - oldPos); } -void KMagSelWinCorner::mouseMoveEvent ( QMouseEvent * e ) +void KMagSelWinCorner::mouseMoveEvent ( TQMouseEvent * e ) { emit resized (e->globalPos () - oldPos); } diff --git a/kmag/kmagselrect.h b/kmag/kmagselrect.h index 675954c..e0e8348 100644 --- a/kmag/kmagselrect.h +++ b/kmag/kmagselrect.h @@ -23,9 +23,9 @@ #include <stdlib.h> // Qt includes -#include <qrect.h> -#include <qwidget.h> -#include <qlabel.h> +#include <tqrect.h> +#include <tqwidget.h> +#include <tqlabel.h> class KMagSelWinCorner : public QLabel { @@ -33,22 +33,22 @@ class KMagSelWinCorner : public QLabel public: - KMagSelWinCorner ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ); + KMagSelWinCorner ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 ); virtual ~KMagSelWinCorner(); signals: void startResizing (); - void resized ( QPoint offset ); + void resized ( TQPoint offset ); protected: - QPoint oldPos; + TQPoint oldPos; - virtual void mousePressEvent ( QMouseEvent * e ); - virtual void mouseReleaseEvent ( QMouseEvent * e ); - virtual void mouseMoveEvent ( QMouseEvent * e ); + virtual void mousePressEvent ( TQMouseEvent * e ); + virtual void mouseReleaseEvent ( TQMouseEvent * e ); + virtual void mouseMoveEvent ( TQMouseEvent * e ); }; class KMagSelWin : public QWidget @@ -57,21 +57,21 @@ class KMagSelWin : public QWidget public: - KMagSelWin ( QWidget * parent = 0, const char * name = 0, WFlags f = 0 ); + KMagSelWin ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 ); virtual ~KMagSelWin(); - void setSelRect ( QRect selRect ); - QRect getSelRect (); + void setSelRect ( TQRect selRect ); + TQRect getSelRect (); public slots: void startResizing (); - void titleMoved ( QPoint offset ); - void topLeftResized ( QPoint offset ); - void topRightResized ( QPoint offset ); - void bottomLeftResized ( QPoint offset ); - void bottomRightResized ( QPoint offset ); + void titleMoved ( TQPoint offset ); + void topLeftResized ( TQPoint offset ); + void topRightResized ( TQPoint offset ); + void bottomLeftResized ( TQPoint offset ); + void bottomRightResized ( TQPoint offset ); signals: @@ -79,7 +79,7 @@ signals: protected: - QRect oldSelRect; + TQRect oldSelRect; KMagSelWinCorner *titleBar; KMagSelWinCorner *topLeftCorner; @@ -95,18 +95,18 @@ protected: * @author Original : Michael Forster * @author Current : Sarang Lakare */ -class KMagSelRect : public QObject, public QRect +class KMagSelRect : public TQObject, public QRect { Q_OBJECT public: - KMagSelRect(QWidget *parent=0); - KMagSelRect(const QPoint &topLeft, const QPoint &bottomRight, - QWidget *parent=0); - KMagSelRect(const QPoint &topLeft, const QSize &size, - QWidget *parent=0); + KMagSelRect(TQWidget *parent=0); + KMagSelRect(const TQPoint &topLeft, const TQPoint &bottomRight, + TQWidget *parent=0); + KMagSelRect(const TQPoint &topLeft, const TQSize &size, + TQWidget *parent=0); KMagSelRect(int left, int top, int width, int height, - QWidget *selWindowParent=0); + TQWidget *selWindowParent=0); virtual ~KMagSelRect(); @@ -132,15 +132,15 @@ public slots: protected: - void init(QWidget *); + void init(TQWidget *); - QWidget *selWindowParent; + TQWidget *selWindowParent; KMagSelWin *selectionwindow; bool m_alwaysVisible; }; -void setTitleColors (QColor title, QColor text, QColor titleBtn); +void setTitleColors (TQColor title, TQColor text, TQColor titleBtn); void setFrameSize (int size); #endif // KMAGSELRECT_H diff --git a/kmag/kmagzoomview.cpp b/kmag/kmagzoomview.cpp index a38c21c..4010fce 100644 --- a/kmag/kmagzoomview.cpp +++ b/kmag/kmagzoomview.cpp @@ -23,14 +23,14 @@ #include "kmagzoomview.moc" // include files for Qt -#include <qbitmap.h> -#include <qpixmap.h> -#include <qimage.h> -#include <qcursor.h> -#include <qglobal.h> -#include <qpainter.h> -#include <qwhatsthis.h> -#include <qwidget.h> +#include <tqbitmap.h> +#include <tqpixmap.h> +#include <tqimage.h> +#include <tqcursor.h> +#include <tqglobal.h> +#include <tqpainter.h> +#include <tqwhatsthis.h> +#include <tqwidget.h> // include files for KDE #include <kapplication.h> @@ -79,7 +79,7 @@ static uchar phand_bits[] = { -static bool obscuredRegion (QRegion ®ion, Window winId, Window ignoreId, Window start = 0, int level = -1) { +static bool obscuredRegion (TQRegion ®ion, Window winId, Window ignoreId, Window start = 0, int level = -1) { Window root, parent, *children; uint nchildren; if (0 == start) start = qt_xrootwin(); @@ -92,7 +92,7 @@ static bool obscuredRegion (QRegion ®ion, Window winId, Window ignoreId, Wind XWindowAttributes atts; XGetWindowAttributes (qt_xdisplay(), children [i], &atts); if (atts.map_state == IsViewable) - region -= QRegion (atts.x, atts.y, atts.width, atts.height, QRegion::Rectangle); + region -= TQRegion (atts.x, atts.y, atts.width, atts.height, TQRegion::Rectangle); } } else if (winId == children [i]) @@ -120,8 +120,8 @@ static bool obscuredRegion (QRegion ®ion, Window winId, Window ignoreId, Wind -KMagZoomView::KMagZoomView(QWidget *parent, const char *name) - : QScrollView(parent, name), +KMagZoomView::KMagZoomView(TQWidget *parent, const char *name) + : TQScrollView(parent, name), m_selRect(0, 0, 128, 128, this), m_grabTimer(0), m_mouseViewTimer(0), @@ -136,7 +136,7 @@ KMagZoomView::KMagZoomView(QWidget *parent, const char *name) KApplication::setGlobalMouseTracking(TRUE); viewport()->setMouseTracking(TRUE); viewport()->setBackgroundMode (NoBackground); - viewport()->setFocusPolicy(QWidget::StrongFocus); + viewport()->setFocusPolicy(TQWidget::StrongFocus); m_ctrlKeyPressed = false; m_shiftKeyPressed = false; @@ -147,16 +147,16 @@ KMagZoomView::KMagZoomView(QWidget *parent, const char *name) setRefreshRate(10); // connect it to grabFrame() - connect(&m_grabTimer, SIGNAL(timeout()), SLOT(grabFrame())); + connect(&m_grabTimer, TQT_SIGNAL(timeout()), TQT_SLOT(grabFrame())); // start the grabTimer m_grabTimer.start(static_cast<int>(1000.0/m_fps)); // connect it to updateMouseView() - connect(&m_mouseViewTimer, SIGNAL(timeout()), SLOT(updateMouseView())); + connect(&m_mouseViewTimer, TQT_SIGNAL(timeout()), TQT_SLOT(updateMouseView())); // start the grabTimer @ 25 frames per second! m_mouseViewTimer.start(25); - QWhatsThis::add(this, i18n("This is the main window which shows the contents of the\ + TQWhatsThis::add(this, i18n("This is the main window which shows the contents of the\ selected region. The contents will be magnified according to the zoom level that is set.")); // different ways to show the cursor. @@ -178,20 +178,20 @@ void KMagZoomView::followMouse(bool follow) if(follow) { m_followMouse = true; m_mouseMode = Normal; - setVScrollBarMode (QScrollView::AlwaysOff); - setHScrollBarMode (QScrollView::AlwaysOff); + setVScrollBarMode (TQScrollView::AlwaysOff); + setHScrollBarMode (TQScrollView::AlwaysOff); } else { m_followMouse = false; m_mouseMode = Normal; - setVScrollBarMode (QScrollView::AlwaysOn); - setHScrollBarMode (QScrollView::AlwaysOn); + setVScrollBarMode (TQScrollView::AlwaysOn); + setHScrollBarMode (TQScrollView::AlwaysOn); } } /** * Called when the widget is hidden. Stop refresh when this happens. */ -void KMagZoomView::hideEvent( QHideEvent* ) +void KMagZoomView::hideEvent( TQHideEvent* ) { // Save the state of the refresh switch.. the state will be restored // when showEvent is called @@ -207,7 +207,7 @@ void KMagZoomView::hideEvent( QHideEvent* ) /** * Called when the widget is shown. Start refresh when this happens. */ -void KMagZoomView::showEvent( QShowEvent* ) +void KMagZoomView::showEvent( TQShowEvent* ) { // Check if refresh switch was ON when hide was called and if currently it is OFF if(m_refreshSwitchStateOnHide && !m_refreshSwitch) { @@ -219,9 +219,9 @@ void KMagZoomView::showEvent( QShowEvent* ) /** * Called when the widget is resized. Check if fitToWindow is active when this happens. */ -void KMagZoomView::resizeEvent( QResizeEvent * e ) +void KMagZoomView::resizeEvent( TQResizeEvent * e ) { - QScrollView::resizeEvent (e); + TQScrollView::resizeEvent (e); if(m_fitToWindow) fitToWindow(); } @@ -231,35 +231,35 @@ void KMagZoomView::resizeEvent( QResizeEvent * e ) * * @param p */ -void KMagZoomView::drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph ) +void KMagZoomView::drawContents ( TQPainter * p, int clipx, int clipy, int clipw, int cliph ) { if(m_grabbedPixmap.isNull()) return; // A pixmap which will be eventually displayed - QRect areaToPaint = m_invertedMatrix.mapRect (QRect(clipx, clipy, clipw, cliph)); - QPixmap clippedPixmap (areaToPaint.size()); - clippedPixmap.fill (QColor (128, 128, 128)); - areaToPaint &= QRect (QPoint (0,0), m_selRect.size()); - bitBlt(&clippedPixmap, QPoint (0,0), &m_grabbedPixmap, areaToPaint); + TQRect areaToPaint = m_invertedMatrix.mapRect (TQRect(clipx, clipy, clipw, cliph)); + TQPixmap clippedPixmap (areaToPaint.size()); + clippedPixmap.fill (TQColor (128, 128, 128)); + areaToPaint &= TQRect (TQPoint (0,0), m_selRect.size()); + bitBlt(&clippedPixmap, TQPoint (0,0), &m_grabbedPixmap, areaToPaint); // show the pixel under mouse cursor if(m_showMouse) { // paint the mouse cursor - paintMouseCursor(&clippedPixmap, calcMousePos (m_refreshSwitch)-QPoint (areaToPaint.x(), areaToPaint.y())); + paintMouseCursor(&clippedPixmap, calcMousePos (m_refreshSwitch)-TQPoint (areaToPaint.x(), areaToPaint.y())); } - QPixmap zoomedPixmap; + TQPixmap zoomedPixmap; zoomedPixmap = clippedPixmap.xForm (m_zoomMatrix); if (m_invert) { - QImage zoomedImage; + TQImage zoomedImage; zoomedImage = zoomedPixmap.convertToImage(); zoomedImage.invertPixels (false); - p->drawImage (QPoint (clipx-contentsX(), clipy-contentsY()), zoomedImage, zoomedImage.rect(), + p->drawImage (TQPoint (clipx-contentsX(), clipy-contentsY()), zoomedImage, zoomedImage.rect(), Qt::ThresholdDither | Qt::ThresholdAlphaDither | Qt::AvoidDither); } else { - p->drawPixmap (QPoint (clipx, clipy), zoomedPixmap, zoomedPixmap.rect()); + p->drawPixmap (TQPoint (clipx, clipy), zoomedPixmap, zoomedPixmap.rect()); } } @@ -267,12 +267,12 @@ void KMagZoomView::drawContents ( QPainter * p, int clipx, int clipy, int clipw, * Draws the mouse cursor according to the current selection of the type of * mouse cursor to draw. */ -void KMagZoomView::paintMouseCursor(QPaintDevice *dev, QPoint mousePos) +void KMagZoomView::paintMouseCursor(TQPaintDevice *dev, TQPoint mousePos) { if(!dev) return; - QPainter pz(dev); + TQPainter pz(dev); if(m_latestCursorPos.x() >= 0 && m_latestCursorPos.x() < m_selRect.width() && m_latestCursorPos.y() >= 0 && m_latestCursorPos.y() < m_selRect.height() ) { @@ -294,8 +294,8 @@ void KMagZoomView::paintMouseCursor(QPaintDevice *dev, QPoint mousePos) pz.setPen(Qt::black); pz.setBackgroundColor(Qt::white); - QBitmap sCursor( 16, 16, left_ptr_bits, TRUE ); - QBitmap mask( 16, 16, left_ptrmsk_bits, TRUE ); + TQBitmap sCursor( 16, 16, left_ptr_bits, TRUE ); + TQBitmap mask( 16, 16, left_ptrmsk_bits, TRUE ); sCursor.setMask(mask); // since hot spot is at 3,1 @@ -307,7 +307,7 @@ void KMagZoomView::paintMouseCursor(QPaintDevice *dev, QPoint mousePos) { // 3. Actual cursor // Get the current cursor type - QWidget *dummy = KApplication::widgetAt(QCursor::pos(), FALSE); + TQWidget *dummy = KApplication::widgetAt(TQCursor::pos(), FALSE); if(!dummy) break; kdDebug() << ">" << dummy->name() << ":" << dummy->cursor().shape() << "-" << endl; @@ -318,8 +318,8 @@ void KMagZoomView::paintMouseCursor(QPaintDevice *dev, QPoint mousePos) pz.setPen(Qt::black); pz.setBackgroundColor(Qt::white); - QBitmap sCursor( 16, 16, left_ptr_bits, TRUE ); - QBitmap mask( 16, 16, left_ptrmsk_bits, TRUE ); + TQBitmap sCursor( 16, 16, left_ptr_bits, TRUE ); + TQBitmap mask( 16, 16, left_ptrmsk_bits, TRUE ); sCursor.setMask(mask); // since hot spot is at 3,1 @@ -327,8 +327,8 @@ void KMagZoomView::paintMouseCursor(QPaintDevice *dev, QPoint mousePos) } break; default: - QBitmap sCursor( 32, 32, phand_bits, TRUE ); - QBitmap mask( 32, 32, phandm_bits, TRUE ); + TQBitmap sCursor( 32, 32, phand_bits, TRUE ); + TQBitmap mask( 32, 32, phandm_bits, TRUE ); sCursor.setMask(mask); pz.drawPixmap(mousePos.x(), mousePos.y(), sCursor); @@ -347,16 +347,16 @@ void KMagZoomView::paintMouseCursor(QPaintDevice *dev, QPoint mousePos) } -QPoint KMagZoomView::calcMousePos(bool updateMousePos) +TQPoint KMagZoomView::calcMousePos(bool updateMousePos) { // get position of mouse wrt selRect if(updateMousePos) { // get a new position only if asked - m_latestCursorPos = QCursor::pos(); - m_latestCursorPos -= QPoint(m_selRect.x(), m_selRect.y()); + m_latestCursorPos = TQCursor::pos(); + m_latestCursorPos -= TQPoint(m_selRect.x(), m_selRect.y()); } // get coordinates of the pixel w.r.t. the pixmap - return QPoint (m_latestCursorPos.x(), m_latestCursorPos.y()); + return TQPoint (m_latestCursorPos.x(), m_latestCursorPos.y()); } @@ -367,10 +367,10 @@ QPoint KMagZoomView::calcMousePos(bool updateMousePos) * * @param e */ -void KMagZoomView::mousePressEvent(QMouseEvent *e) +void KMagZoomView::mousePressEvent(TQMouseEvent *e) { switch(e->button()) { - case QMouseEvent::LeftButton : + case TQMouseEvent::LeftButton : if(m_ctrlKeyPressed) { // check if currently in resize mode // don't do anything if fitToWindow is enabled @@ -386,7 +386,7 @@ void KMagZoomView::mousePressEvent(QMouseEvent *e) m_oldMousePos.setY(e->globalY()); // set the cursor position to the bottom-right of the selected region - QCursor::setPos(m_selRect.bottomRight()); + TQCursor::setPos(m_selRect.bottomRight()); // show the selection rectangle m_selRect.show(); @@ -411,7 +411,7 @@ void KMagZoomView::mousePressEvent(QMouseEvent *e) m_oldMousePos.setY(e->globalY()); // set the cursor position to the center of the selected region - QCursor::setPos(m_selRect.center()); + TQCursor::setPos(m_selRect.center()); // show the selected rectangle m_selRect.show(); @@ -449,7 +449,7 @@ void KMagZoomView::mousePressEvent(QMouseEvent *e) } break; - case QMouseEvent::MidButton : + case TQMouseEvent::MidButton : // check if currently in move mode // don't do anything if follow mouse is enabled if ((m_mouseMode != MoveSelection) && !m_followMouse) { @@ -463,7 +463,7 @@ void KMagZoomView::mousePressEvent(QMouseEvent *e) m_oldMousePos.setY(e->globalY()); // set the cursor position to the center of the selected region - QCursor::setPos(m_selRect.center()); + TQCursor::setPos(m_selRect.center()); // show the selected rectangle m_selRect.show(); @@ -491,11 +491,11 @@ void KMagZoomView::mousePressEvent(QMouseEvent *e) * * @param e */ -void KMagZoomView::mouseReleaseEvent(QMouseEvent *e) +void KMagZoomView::mouseReleaseEvent(TQMouseEvent *e) { switch(e->button()) { - case QMouseEvent::LeftButton : - case QMouseEvent::MidButton : + case TQMouseEvent::LeftButton : + case TQMouseEvent::MidButton : // check if currently in move mode if(m_mouseMode == MoveSelection) { // hide the selection window @@ -507,7 +507,7 @@ void KMagZoomView::mouseReleaseEvent(QMouseEvent *e) setCursor(arrowCursor); // restore the cursor position - QCursor::setPos(m_oldMousePos); + TQCursor::setPos(m_oldMousePos); } else if(m_mouseMode == ResizeSelection) { // hide the selection window m_selRect.hide(); @@ -518,7 +518,7 @@ void KMagZoomView::mouseReleaseEvent(QMouseEvent *e) setCursor(arrowCursor); // restore the cursor position - QCursor::setPos(m_oldMousePos); + TQCursor::setPos(m_oldMousePos); } else if(m_mouseMode == GrabSelection) { // hide the selection window m_selRect.hide(); @@ -531,9 +531,9 @@ void KMagZoomView::mouseReleaseEvent(QMouseEvent *e) } break; - case QMouseEvent::RightButton : + case TQMouseEvent::RightButton : break; - case QMouseEvent::NoButton : + case TQMouseEvent::NoButton : break; // do nothing @@ -548,7 +548,7 @@ void KMagZoomView::mouseReleaseEvent(QMouseEvent *e) * * @param e */ -void KMagZoomView::mouseMoveEvent(QMouseEvent *e) +void KMagZoomView::mouseMoveEvent(TQMouseEvent *e) { if(m_mouseMode == ResizeSelection) { // In resize selection mode @@ -559,7 +559,7 @@ void KMagZoomView::mouseMoveEvent(QMouseEvent *e) grabFrame(); } else if(m_mouseMode == MoveSelection) { - QPoint newCenter; + TQPoint newCenter; // set new center to be the current mouse position m_selRect.moveCenter(e->globalPos()); @@ -567,11 +567,11 @@ void KMagZoomView::mouseMoveEvent(QMouseEvent *e) grabFrame(); } else if(m_mouseMode == GrabSelection) { - QPoint newPos; + TQPoint newPos; // get new position newPos = e->globalPos(); - QPoint delta = (newPos - m_oldMousePos)/m_zoom; + TQPoint delta = (newPos - m_oldMousePos)/m_zoom; m_selRect.moveCenter(m_oldCenter-delta); m_selRect.update(); @@ -579,19 +579,19 @@ void KMagZoomView::mouseMoveEvent(QMouseEvent *e) } } -void KMagZoomView::keyPressEvent(QKeyEvent *e) +void KMagZoomView::keyPressEvent(TQKeyEvent *e) { int offset = 16; - if (e->state() & QKeyEvent::ShiftButton) + if (e->state() & TQKeyEvent::ShiftButton) offset = 1; - if (e->key() == QKeyEvent::Key_Control) + if (e->key() == TQKeyEvent::Key_Control) m_ctrlKeyPressed = true; - else if (e->key() == QKeyEvent::Key_Shift) + else if (e->key() == TQKeyEvent::Key_Shift) m_shiftKeyPressed = true; - else if (e->key() == QKeyEvent::Key_Left) + else if (e->key() == TQKeyEvent::Key_Left) { - if (e->state() & QKeyEvent::ControlButton) + if (e->state() & TQKeyEvent::ControlButton) { if (offset >= m_selRect.width()) m_selRect.setWidth (1); @@ -615,9 +615,9 @@ void KMagZoomView::keyPressEvent(QKeyEvent *e) } m_selRect.update(); } - else if (e->key() == QKeyEvent::Key_Right) + else if (e->key() == TQKeyEvent::Key_Right) { - if (e->state() & QKeyEvent::ControlButton) + if (e->state() & TQKeyEvent::ControlButton) m_selRect.setRight (m_selRect.right()+offset); else if (contentsX() < contentsWidth()-visibleWidth()) { @@ -632,9 +632,9 @@ void KMagZoomView::keyPressEvent(QKeyEvent *e) m_selRect.update(); } - else if (e->key() == QKeyEvent::Key_Up) + else if (e->key() == TQKeyEvent::Key_Up) { - if (e->state() & QKeyEvent::ControlButton) + if (e->state() & TQKeyEvent::ControlButton) { if (offset >= m_selRect.height()) m_selRect.setHeight (1); @@ -658,9 +658,9 @@ void KMagZoomView::keyPressEvent(QKeyEvent *e) } m_selRect.update(); } - else if (e->key() == QKeyEvent::Key_Down) + else if (e->key() == TQKeyEvent::Key_Down) { - if (e->state() & QKeyEvent::ControlButton) + if (e->state() & TQKeyEvent::ControlButton) m_selRect.setBottom (m_selRect.bottom()+offset); else if (contentsY() < contentsHeight()-visibleHeight()) { @@ -678,23 +678,23 @@ void KMagZoomView::keyPressEvent(QKeyEvent *e) e->ignore(); } -void KMagZoomView::keyReleaseEvent(QKeyEvent *e) +void KMagZoomView::keyReleaseEvent(TQKeyEvent *e) { - if (e->key() == QKeyEvent::Key_Control) + if (e->key() == TQKeyEvent::Key_Control) m_ctrlKeyPressed = false; - else if (e->key() == QKeyEvent::Key_Shift) + else if (e->key() == TQKeyEvent::Key_Shift) m_shiftKeyPressed = false; else e->ignore(); } -void KMagZoomView::contextMenuEvent (QContextMenuEvent *e) +void KMagZoomView::contextMenuEvent (TQContextMenuEvent *e) { emit contextMenu(e->globalPos()); e->accept(); } -void KMagZoomView::focusOutEvent(QFocusEvent *e) +void KMagZoomView::focusOutEvent(TQFocusEvent *e) { if(e->lostFocus() == TRUE) { m_ctrlKeyPressed = false; @@ -710,8 +710,8 @@ void KMagZoomView::focusOutEvent(QFocusEvent *e) */ void KMagZoomView::fitToWindow() { - QPoint currCenter = m_selRect.center(); - QRect newRect = m_invertedMatrix.mapRect (QRect(0, 0, visibleWidth(), visibleHeight())); + TQPoint currCenter = m_selRect.center(); + TQRect newRect = m_invertedMatrix.mapRect (TQRect(0, 0, visibleWidth(), visibleHeight())); m_selRect.setSize (newRect.size()); m_selRect.moveCenter(currCenter); m_selRect.update(); @@ -739,38 +739,38 @@ void KMagZoomView::grabFrame() // check if follow-mouse is enabled if(m_followMouse && (m_mouseMode != ResizeSelection)) { // in this case grab w.r.t the current mouse position - QPoint newCenter; + TQPoint newCenter; // set new center to be the current mouse position - m_selRect.moveCenter(QCursor::pos()); + m_selRect.moveCenter(TQCursor::pos()); m_selRect.update(); } - //QRect r = pixmapRect(); + //TQRect r = pixmapRect(); // define a normalized rectangle - QRect selRect = m_selRect.normalize(); + TQRect selRect = m_selRect.normalize(); // grab screenshot from the screen and put it in the pixmap - m_grabbedPixmap = QPixmap::grabWindow(QApplication::desktop()->winId(), selRect.x(), selRect.y(), + m_grabbedPixmap = TQPixmap::grabWindow(TQApplication::desktop()->winId(), selRect.x(), selRect.y(), selRect.width(), selRect.height()); // If the KMag window itself is in the screenshot, then it need to be filled with gray to avoid recursion - QPoint globalPos = viewport()->mapToGlobal (viewport()->rect().topLeft()); - QRegion intersection (globalPos.x(), globalPos.y(), viewport()->width(), viewport()->height(), QRegion::Rectangle); - intersection &= QRegion (selRect, QRegion::Rectangle); + TQPoint globalPos = viewport()->mapToGlobal (viewport()->rect().topLeft()); + TQRegion intersection (globalPos.x(), globalPos.y(), viewport()->width(), viewport()->height(), TQRegion::Rectangle); + intersection &= TQRegion (selRect, TQRegion::Rectangle); // We don't want to overpaint other windows that happen to be on top obscuredRegion (intersection, topLevelWidget()->winId(), m_selRect.winId()); intersection.translate (-selRect.x(), -selRect.y()); - QPainter painter (&m_grabbedPixmap, true); - QMemArray<QRect> rects (intersection.rects()); + TQPainter painter (&m_grabbedPixmap, true); + TQMemArray<TQRect> rects (intersection.rects()); for (uint i = 0; i < rects.size(); i++) - painter.fillRect (rects[i], QBrush (QColor (128, 128, 128))); + painter.fillRect (rects[i], TQBrush (TQColor (128, 128, 128))); // call repaint to display the newly grabbed image - QRect newSize = m_zoomMatrix.mapRect (m_grabbedPixmap.rect()); + TQRect newSize = m_zoomMatrix.mapRect (m_grabbedPixmap.rect()); resizeContents (newSize.width(), newSize.height()); viewport()->repaint(false); } @@ -781,7 +781,7 @@ void KMagZoomView::grabFrame() */ void KMagZoomView::updateMouseView() { - QPoint pos(QCursor::pos()); + TQPoint pos(TQCursor::pos()); if(m_selRect.left() <= pos.x() && pos.x() <= m_selRect.right() && m_selRect.top() <= pos.y() && pos.y() <= m_selRect.bottom() && m_refreshSwitch) @@ -859,7 +859,7 @@ void KMagZoomView::showSelRect(bool show) /** * Sets the selection rectangle to the given position. */ -void KMagZoomView::setSelRectPos(const QRect & rect) +void KMagZoomView::setSelRectPos(const TQRect & rect) { m_selRect.setRect(rect.x(), rect.y(), rect.width(), rect.height()); m_selRect.update(); @@ -881,7 +881,7 @@ unsigned int KMagZoomView::getShowMouseType() const return (m_showMouse); } -QStringList KMagZoomView::getShowMouseStringList() const +TQStringList KMagZoomView::getShowMouseStringList() const { return (m_showMouseTypes); } @@ -891,12 +891,12 @@ QStringList KMagZoomView::getShowMouseStringList() const * Returns the image which is being displayed. Its again drawn by adding * the mouse cursor if needed. */ -QPixmap KMagZoomView::getPixmap() +TQPixmap KMagZoomView::getPixmap() { // show the pixel under mouse cursor if(m_showMouse && !m_grabbedPixmap.isNull()) { // Pixmap which will have the pixmap + mouse - QPixmap mousePixmap(m_grabbedPixmap); + TQPixmap mousePixmap(m_grabbedPixmap); // paint the mouse cursor w/o updating to a newer position paintMouseCursor(&mousePixmap, calcMousePos(false)); diff --git a/kmag/kmagzoomview.h b/kmag/kmagzoomview.h index a863ad6..7b631ae 100644 --- a/kmag/kmagzoomview.h +++ b/kmag/kmagzoomview.h @@ -25,14 +25,14 @@ #endif // include files for Qt -#include <qwidget.h> -#include <qpainter.h> -#include <qpixmap.h> -#include <qtimer.h> -#include <qscrollview.h> -#include <qstringlist.h> -#include <qrect.h> -#include <qcursor.h> +#include <tqwidget.h> +#include <tqpainter.h> +#include <tqpixmap.h> +#include <tqtimer.h> +#include <tqscrollview.h> +#include <tqstringlist.h> +#include <tqrect.h> +#include <tqcursor.h> //class KMagSelRect; #include "kmagselrect.h" @@ -48,7 +48,7 @@ class KMagZoomView : public QScrollView Q_OBJECT public: /// Constructor for the main view - KMagZoomView(QWidget *parent = 0, const char *name=0); + KMagZoomView(TQWidget *parent = 0, const char *name=0); /// Destructor for the main view ~KMagZoomView(); @@ -57,7 +57,7 @@ class KMagZoomView : public QScrollView void toggleRefresh(); /// Returns the currently displayed zoomed view - QPixmap getPixmap(); + TQPixmap getPixmap(); /// Returns the state of the refresh switch bool getRefreshStatus() const { return m_refreshSwitch; }; @@ -69,13 +69,13 @@ class KMagZoomView : public QScrollView bool getShowSelRect() const { return (m_selRect.getAlwaysVisible()); }; /// Get the coordinates of the selection rectangle - QRect getSelRectPos() const { return static_cast<QRect>(m_selRect); }; + TQRect getSelRectPos() const { return static_cast<TQRect>(m_selRect); }; /// Returns the current state of show mouse unsigned int getShowMouseType() const; /// Returns the different ways of showing mouse cursor - QStringList getShowMouseStringList() const; + TQStringList getShowMouseStringList() const; /// Returns the status of "fit to window" option bool getFitToWindow() const { return (m_fitToWindow); }; @@ -104,7 +104,7 @@ class KMagZoomView : public QScrollView void showSelRect(bool show=true); /// Set the position of the selection region to the given pos - void setSelRectPos(const QRect & rect); + void setSelRectPos(const TQRect & rect); /// Set the refresh rate in fps (frames per second) void setRefreshRate(float fps); @@ -119,75 +119,75 @@ class KMagZoomView : public QScrollView void fitToWindow(); signals: - void contextMenu(QPoint pos); + void contextMenu(TQPoint pos); protected: /// Called when the widget is hidden - void hideEvent( QHideEvent * e); + void hideEvent( TQHideEvent * e); /// Called when the widget is shown - void showEvent( QShowEvent * e); + void showEvent( TQShowEvent * e); /// Called when the widget has been resized - void resizeEvent(QResizeEvent *e); + void resizeEvent(TQResizeEvent *e); /// Called when the widget is to be repainted - void drawContents ( QPainter * p, int clipx, int clipy, int clipw, int cliph ); + void drawContents ( TQPainter * p, int clipx, int clipy, int clipw, int cliph ); /// This function calculates the mouse position relative to the image - QPoint calcMousePos(bool updateMousePos=true); + TQPoint calcMousePos(bool updateMousePos=true); /// This function draws the mouse cursor - void paintMouseCursor(QPaintDevice *dev, QPoint mousePos); + void paintMouseCursor(TQPaintDevice *dev, TQPoint mousePos); /// Called when mouse click is detected - void mousePressEvent (QMouseEvent *e); + void mousePressEvent (TQMouseEvent *e); /// Called when mouse is moved - void mouseMoveEvent(QMouseEvent *e); + void mouseMoveEvent(TQMouseEvent *e); /// Mouse button release event handler - void mouseReleaseEvent(QMouseEvent *e); + void mouseReleaseEvent(TQMouseEvent *e); /// Mouse button release event handler - void keyPressEvent(QKeyEvent *e); + void keyPressEvent(TQKeyEvent *e); /// Mouse button release event handler - void keyReleaseEvent(QKeyEvent *e); + void keyReleaseEvent(TQKeyEvent *e); /// Catch context menu events - void contextMenuEvent (QContextMenuEvent *e); + void contextMenuEvent (TQContextMenuEvent *e); /// Mouse button release event handler - void focusOutEvent(QFocusEvent *e); + void focusOutEvent(TQFocusEvent *e); /// Returns the rectangle where the pixmap will be drawn - QRect pixmapRect(); + TQRect pixmapRect(); private: /// Stores the pixmap grabbed from the screen - to be zoomed - QPixmap m_grabbedPixmap; + TQPixmap m_grabbedPixmap; /// The selected rectangle which is to be grabbed KMagSelRect m_selRect; /// Grabs a window when the timer goes off - QTimer m_grabTimer; + TQTimer m_grabTimer; /// Updates the mouse view - QTimer m_mouseViewTimer; + TQTimer m_mouseViewTimer; /// Zoom matrix - QWMatrix m_zoomMatrix; + TQWMatrix m_zoomMatrix; /// Inverted zoom matrix - QWMatrix m_invertedMatrix; + TQWMatrix m_invertedMatrix; /// Saves the mouse position when a button is clicked and b4 the cursor is moved to new position - QPoint m_oldMousePos; + TQPoint m_oldMousePos; /// Saves the center of the grab window - QPoint m_oldCenter; + TQPoint m_oldCenter; /// Possible modes for the mouse to be in enum KMagMouseMode { @@ -208,10 +208,10 @@ class KMagZoomView : public QScrollView bool m_shiftKeyPressed; /// Store the more recent updated cursor position - QPoint m_latestCursorPos; + TQPoint m_latestCursorPos; /// Various ways of showing mouse cursor - QStringList m_showMouseTypes; + TQStringList m_showMouseTypes; // configuration options: |