summaryrefslogtreecommitdiffstats
path: root/kmag
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-17 22:17:08 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-17 22:17:08 +0000
commitf138d74fe16092003b06f5bde9663841929cde7f (patch)
treee9c497a0e59bc7d34264ac9404740d2ea76f3de4 /kmag
parent3a3c4b256baee79bdcfe72c5e01b9ded9b525900 (diff)
downloadtdeaccessibility-f138d74fe16092003b06f5bde9663841929cde7f.tar.gz
tdeaccessibility-f138d74fe16092003b06f5bde9663841929cde7f.zip
TQt4 port kdeaccessibility
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdeaccessibility@1237325 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kmag')
-rw-r--r--kmag/kmag.cpp74
-rw-r--r--kmag/kmag.h7
-rw-r--r--kmag/kmagselrect.cpp60
-rw-r--r--kmag/kmagselrect.h21
-rw-r--r--kmag/kmagzoomview.cpp150
-rw-r--r--kmag/kmagzoomview.h13
6 files changed, 160 insertions, 165 deletions
diff --git a/kmag/kmag.cpp b/kmag/kmag.cpp
index 12d660c..80549be 100644
--- a/kmag/kmag.cpp
+++ b/kmag/kmag.cpp
@@ -126,92 +126,92 @@ KmagApp::~KmagApp()
void KmagApp::initActions()
{
- fileNewWindow = new KAction(i18n("New &Window"), "window_new", KStdAccel::openNew(), this,
+ fileNewWindow = new KAction(i18n("New &Window"), "window_new", KStdAccel::openNew(), TQT_TQOBJECT(this),
TQT_SLOT(slotFileNewWindow()), actionCollection(),"new_window");
fileNewWindow->setToolTip(i18n("Open a new KMagnifier window"));
- refreshSwitch = new KAction(i18n("&Stop"), "stop", KStdAccel::reload(), this,
+ refreshSwitch = new KAction(i18n("&Stop"), "stop", KStdAccel::reload(), TQT_TQOBJECT(this),
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,
+ m_pSnapshot = new KAction(i18n("&Save Snapshot As..."), "ksnapshot", KStdAccel::save(), TQT_TQOBJECT(this),
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, TQT_SLOT(slotFilePrint()), actionCollection(), "print");
+ m_pPrint = KStdAction::print(TQT_TQOBJECT(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, TQT_SLOT(slotFileQuit()), actionCollection(), "quit");
+ m_pQuit = KStdAction::quit(TQT_TQOBJECT(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, TQT_SLOT(copyToClipBoard()), actionCollection(), "copy");
+ m_pCopy = KStdAction::copy(TQT_TQOBJECT(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,
+ m_pShowMenu = new KToggleAction(i18n("Show &Menu"), "showmenu", CTRL+Key_M, TQT_TQOBJECT(this),
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,
+ m_pShowMainToolBar = new KToggleAction(i18n("Show Main &Toolbar"), 0, 0, TQT_TQOBJECT(this),
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,
+ m_pShowViewToolBar = new KToggleAction(i18n("Show &View Toolbar"), 0, 0, TQT_TQOBJECT(this),
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,
+ m_pShowSettingsToolBar = new KToggleAction(i18n("Show &Settings Toolbar"), 0, 0, TQT_TQOBJECT(this),
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,
+ m_modeFollowMouse = new KRadioAction(i18n("&Follow Mouse Mode"), "followmouse", Key_F1, TQT_TQOBJECT(this),
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,
+ m_modeSelWin = new KRadioAction(i18n("S&election Window Mode"), "window", Key_F2, TQT_TQOBJECT(this),
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,
+ m_modeEdgeTop = new KRadioAction(i18n("&Top Screen Edge Mode"), 0, 0, TQT_TQOBJECT(this),
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,
+ m_modeEdgeLeft = new KRadioAction(i18n("&Left Screen Edge Mode"), 0, 0, TQT_TQOBJECT(this),
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,
+ m_modeEdgeRight = new KRadioAction(i18n("&Right Screen Edge Mode"), 0, 0, TQT_TQOBJECT(this),
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,
+ m_modeEdgeBottom = new KRadioAction(i18n("&Bottom Screen Edge Mode"), 0, 0, TQT_TQOBJECT(this),
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,
+ m_hideCursor = new KToggleAction(i18n("Hide Mouse &Cursor"), "hidemouse", Key_F4, TQT_TQOBJECT(this),
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, TQT_SLOT(zoomIn()), actionCollection(), "zoom_in");
+ m_pZoomIn = KStdAction::zoomIn(TQT_TQOBJECT(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,10 +219,10 @@ void KmagApp::initActions()
m_pZoomBox->setWhatsThis(i18n("Select the zoom factor."));
m_pZoomBox->setToolTip(i18n("Zoom factor"));
- m_pZoomOut = KStdAction::zoomOut(this, TQT_SLOT(zoomOut()), actionCollection(), "zoom_out");
+ m_pZoomOut = KStdAction::zoomOut(TQT_TQOBJECT(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,
+ m_pInvert = new KToggleAction(i18n("&Invert Colors"), 0, Key_F6, TQT_TQOBJECT(this),
TQT_SLOT(slotToggleInvert()), actionCollection(), "invert");
m_pRotationBox = new KSelectAction(i18n("&Rotation"),0,actionCollection(),"rotation");
@@ -232,8 +232,8 @@ void KmagApp::initActions()
// KHelpMenu *newHelpMenu = new KHelpMenu(this, KGlobal::instance()->aboutData());
- m_keyConf = KStdAction::keyBindings( this, TQT_SLOT( slotConfKeys() ), actionCollection(), "key_conf");
- m_toolConf = KStdAction::configureToolbars( this, TQT_SLOT( slotEditToolbars() ),
+ m_keyConf = KStdAction::keyBindings( TQT_TQOBJECT(this), TQT_SLOT( slotConfKeys() ), actionCollection(), "key_conf");
+ m_toolConf = KStdAction::configureToolbars( TQT_TQOBJECT(this), TQT_SLOT( slotEditToolbars() ),
actionCollection(), "toolbar_conf");
m_pFPSBox = new KSelectAction(i18n("Re&fresh"),0,actionCollection(),"fps_selector");
@@ -247,7 +247,7 @@ void KmagApp::initActions()
void KmagApp::initView()
{
m_zoomView = new KMagZoomView( this, "ZoomView" );
- m_zoomView->setSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, m_zoomView->sizePolicy().hasHeightForWidth() ) );
+ m_zoomView->tqsetSizePolicy( TQSizePolicy( (TQSizePolicy::SizeType)7, (TQSizePolicy::SizeType)7, m_zoomView->sizePolicy().hasHeightForWidth() ) );
m_zoomView->setFrameShape( TQFrame::StyledPanel );
m_zoomView->setFrameShadow( TQFrame::Raised );
@@ -270,11 +270,11 @@ void KmagApp::initConnections()
connect(this, TQT_SIGNAL(updateFPSIndex(int)), m_pFPSBox, TQT_SLOT(setCurrentItem(int)));
// selector selects a zoom index -> set the zoom index
- 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_pZoomBox, TQT_SIGNAL(activated(int)), TQT_TQOBJECT(this), TQT_SLOT(setZoomIndex(int)));
+ connect(m_pRotationBox, TQT_SIGNAL(activated(int)), TQT_TQOBJECT(this), TQT_SLOT(setRotationIndex(int)));
+ connect(m_pFPSBox, TQT_SIGNAL(activated(int)), TQT_TQOBJECT(this), TQT_SLOT(setFPSIndex(int)));
- connect(m_zoomView, TQT_SIGNAL(contextMenu(TQPoint)), this, TQT_SLOT(contextMenu(TQPoint)));
+ connect(m_zoomView, TQT_SIGNAL(contextMenu(TQPoint)), TQT_TQOBJECT(this), TQT_SLOT(contextMenu(TQPoint)));
}
/**
@@ -550,12 +550,12 @@ void KmagApp::saveZoomPixmap()
bool toggled(false);
// stop refresh temporarily
- if (m_zoomView->getRefreshStatus()) {
+ if (m_zoomView->getRefreshtqStatus()) {
slotToggleRefresh();
toggled = true;
}
- KURL url = KFileDialog::getSaveURL(TQString::null,
+ KURL url = KFileDialog::getSaveURL(TQString(),
KImageIO::pattern(KImageIO::Writing),
0,i18n("Save Snapshot As"));
@@ -571,7 +571,7 @@ void KmagApp::saveZoomPixmap()
KMessageBox::error(0, i18n("Unable to upload file over the network."),
i18n("Error Writing File"));
} else {
- KMessageBox::information(0, i18n("Current zoomed image saved to\n%1").arg(url.prettyURL()),
+ KMessageBox::information(0, i18n("Current zoomed image saved to\n%1").tqarg(url.prettyURL()),
i18n("Information"), "save_confirm");
}
}
@@ -583,7 +583,7 @@ void KmagApp::saveZoomPixmap()
KMessageBox::error(0, i18n("Unable to save file. Please check if you have permission to write to the directory."),
i18n("Error Writing File"));
} else {
- KMessageBox::information(0, i18n("Current zoomed image saved to\n%1").arg(url.prettyURL()),
+ KMessageBox::information(0, i18n("Current zoomed image saved to\n%1").tqarg(url.prettyURL()),
i18n("Information"), "save_confirm");
}
}
@@ -597,7 +597,7 @@ void KmagApp::saveZoomPixmap()
void KmagApp::slotToggleRefresh()
{
m_zoomView->toggleRefresh();
- if(m_zoomView->getRefreshStatus()) {
+ if(m_zoomView->getRefreshtqStatus()) {
refreshSwitch->setIcon("stop.png");
refreshSwitch->setText(i18n("Stop"));
refreshSwitch->setToolTip(i18n("Click to stop window update"));
@@ -799,7 +799,7 @@ void KmagApp::slotFileNewWindow()
void KmagApp::slotFilePrint()
{
-#ifndef QT_NO_PRINTER
+#ifndef TQT_NO_PRINTER
bool toggled(false);
@@ -810,7 +810,7 @@ void KmagApp::slotFilePrint()
#endif
// stop refresh temporarily
- if (m_zoomView->getRefreshStatus()) {
+ if (m_zoomView->getRefreshtqStatus()) {
slotToggleRefresh();
toggled = true;
}
@@ -840,7 +840,7 @@ void KmagApp::slotFilePrint()
if(toggled) {
slotToggleRefresh();
}
-#endif // QT_NO_PRINTER
+#endif // TQT_NO_PRINTER
}
void KmagApp::slotFileQuit()
@@ -864,7 +864,7 @@ void KmagApp::slotFileQuit()
void KmagApp::copyToClipBoard()
{
- QClipboard *cb=KApplication::clipboard();
+ TQClipboard *cb=KApplication::tqclipboard();
cb->setPixmap(m_zoomView->getPixmap());
}
@@ -935,7 +935,7 @@ void KmagApp::slotEditToolbars()
{
saveMainWindowSettings( KGlobal::config(), "MainWindow" );
KEditToolbar dlg( actionCollection() );
- connect( &dlg, TQT_SIGNAL( newToolbarConfig() ), this, TQT_SLOT( slotNewToolbarConfig() ) );
+ connect( &dlg, TQT_SIGNAL( newToolbarConfig() ), TQT_TQOBJECT(this), TQT_SLOT( slotNewToolbarConfig() ) );
if ( dlg.exec() )
createGUI();
}
diff --git a/kmag/kmag.h b/kmag/kmag.h
index 6a27f03..e84a176 100644
--- a/kmag/kmag.h
+++ b/kmag/kmag.h
@@ -29,7 +29,7 @@
#include "kmagzoomview.h"
#include <vector>
-// include files for Qt
+// include files for TQt
#include <tqstringlist.h>
// include files for KDE
@@ -57,12 +57,13 @@
class KmagApp : public KMainWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
/**
* Construtor of KmagApp, calls all init functions to create the application.
*/
- KmagApp(TQWidget* parent=0, const char* name=0);
+ KmagApp(TQWidget* tqparent=0, const char* name=0);
/// Default destructor
~KmagApp();
@@ -70,7 +71,7 @@ class KmagApp : public KMainWindow
protected:
- /** save general Options like all bar positions and status as well as the geometry and the recent file list to the configuration
+ /** save general Options like all bar positions and status as well as the tqgeometry and the recent file list to the configuration
* file
*/
void saveOptions();
diff --git a/kmag/kmagselrect.cpp b/kmag/kmagselrect.cpp
index 68e09b0..4a56d07 100644
--- a/kmag/kmagselrect.cpp
+++ b/kmag/kmagselrect.cpp
@@ -87,42 +87,42 @@ int getTitleSize ()
// Construction
//--------------------------------------------------------------------------
-KMagSelRect::KMagSelRect(TQWidget *parent) :
+KMagSelRect::KMagSelRect(TQWidget *tqparent) :
TQRect()
{
- init(parent);
+ init(tqparent);
}
KMagSelRect::KMagSelRect(const TQPoint &topLeft, const TQPoint &bottomRight,
- TQWidget *parent) :
+ TQWidget *tqparent) :
TQRect(topLeft, bottomRight)
{
- init(parent);
+ init(tqparent);
}
KMagSelRect::KMagSelRect(const TQPoint &topLeft, const TQSize &size,
- TQWidget *parent) :
+ TQWidget *tqparent) :
TQRect(topLeft, size)
{
- init(parent);
+ init(tqparent);
}
KMagSelRect::KMagSelRect(int left, int top, int width, int height,
- TQWidget *parent) :
+ TQWidget *tqparent) :
TQRect(left, top, width, height)
{
- init(parent);
+ init(tqparent);
}
-void KMagSelRect::init(TQWidget *parent)
+void KMagSelRect::init(TQWidget *tqparent)
{
- // Make sure parent is the window itself, not a widget within the window
- if (parent != 0)
- while (parent->parentWidget (true) != 0)
- parent=parent->parentWidget (true);
+ // Make sure tqparent is the window itself, not a widget within the window
+ if (tqparent != 0)
+ while (tqparent->tqparentWidget (true) != 0)
+ tqparent=tqparent->tqparentWidget (true);
selectionwindow = 0;
- selWindowParent = parent;
+ selWindowParent = tqparent;
m_alwaysVisible = false;
}
@@ -184,19 +184,19 @@ void KMagSelRect::hide()
void KMagSelRect::update()
{
// make sure the selection window does not go outside of the display
- if (height() > TQApplication::desktop()->geometry().height())
- setHeight (TQApplication::desktop()->geometry().height());
- if (width() > TQApplication::desktop()->geometry().width())
- setWidth (TQApplication::desktop()->geometry().width());
+ if (height() > TQApplication::desktop()->tqgeometry().height())
+ setHeight (TQApplication::desktop()->tqgeometry().height());
+ if (width() > TQApplication::desktop()->tqgeometry().width())
+ setWidth (TQApplication::desktop()->tqgeometry().width());
if (top() < 0)
moveTop (0);
if (left() < 0)
moveLeft (0);
- if (bottom() > TQApplication::desktop()->geometry().bottom())
- moveBottom (TQApplication::desktop()->geometry().bottom());
- if (right() > TQApplication::desktop()->geometry().right())
- moveRight (TQApplication::desktop()->geometry().right());
+ if (bottom() > TQApplication::desktop()->tqgeometry().bottom())
+ moveBottom (TQApplication::desktop()->tqgeometry().bottom());
+ if (right() > TQApplication::desktop()->tqgeometry().right())
+ moveRight (TQApplication::desktop()->tqgeometry().right());
if (selectionwindow != 0)
selectionwindow->setSelRect (TQRect (topLeft(), bottomRight()));
@@ -215,8 +215,8 @@ void KMagSelRect::selWinResized()
// KMagSelWin
//--------------------------------------------------------------------------
-KMagSelWin::KMagSelWin ( TQWidget * parent, const char * name, WFlags ) :
- TQWidget (parent, name, WStyle_Customize | WStyle_NoBorder | WStyle_StaysOnTop | WType_TopLevel | WX11BypassWM)
+KMagSelWin::KMagSelWin ( TQWidget * tqparent, const char * name, WFlags ) :
+ TQWidget (tqparent, name, WStyle_Customize | WStyle_NoBorder | WStyle_StaysOnTop | WType_TopLevel | WX11BypassWM)
{
TQBitmap line (8, 8, line_bits, true);
setPaletteBackgroundPixmap (line);
@@ -230,25 +230,25 @@ KMagSelWin::KMagSelWin ( TQWidget * parent, const char * name, WFlags ) :
connect (titleBar, TQT_SIGNAL (resized (TQPoint)), this, TQT_SLOT (titleMoved (TQPoint)));
topLeftCorner = new KMagSelWinCorner (this, "topleft");
- topLeftCorner->setCursor (Qt::SizeFDiagCursor);
+ topLeftCorner->setCursor (TQt::SizeFDiagCursor);
topLeftCorner->setPaletteBackgroundColor (getTitleBtnColor ());
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->setCursor (TQt::SizeBDiagCursor);
topRightCorner->setPaletteBackgroundColor (getTitleBtnColor ());
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->setCursor (TQt::SizeBDiagCursor);
bottomLeftCorner->setPaletteBackgroundColor (getTitleBtnColor ());
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->setCursor (TQt::SizeFDiagCursor);
bottomRightCorner->setPaletteBackgroundColor (getTitleBtnColor ());
connect (bottomRightCorner, TQT_SIGNAL (startResizing ()), this, TQT_SLOT (startResizing ()));
connect (bottomRightCorner, TQT_SIGNAL (resized (TQPoint)), this, TQT_SLOT (bottomRightResized (TQPoint)));
@@ -356,8 +356,8 @@ void KMagSelWin::bottomRightResized ( TQPoint offset )
// KMagSelWinCorner
//--------------------------------------------------------------------------
-KMagSelWinCorner::KMagSelWinCorner ( TQWidget * parent, const char * name, WFlags f ) :
- TQLabel (parent, name, f)
+KMagSelWinCorner::KMagSelWinCorner ( TQWidget * tqparent, const char * name, WFlags f ) :
+ TQLabel (tqparent, name, f)
{
setFrameStyle (TQFrame::WinPanel | TQFrame::Raised);
setLineWidth (1);
diff --git a/kmag/kmagselrect.h b/kmag/kmagselrect.h
index e0e8348..9180b36 100644
--- a/kmag/kmagselrect.h
+++ b/kmag/kmagselrect.h
@@ -22,18 +22,19 @@
#include <stdlib.h>
-// Qt includes
+// TQt includes
#include <tqrect.h>
#include <tqwidget.h>
#include <tqlabel.h>
-class KMagSelWinCorner : public QLabel
+class KMagSelWinCorner : public TQLabel
{
Q_OBJECT
+ TQ_OBJECT
public:
- KMagSelWinCorner ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 );
+ KMagSelWinCorner ( TQWidget * tqparent = 0, const char * name = 0, WFlags f = 0 );
virtual ~KMagSelWinCorner();
@@ -51,13 +52,14 @@ protected:
virtual void mouseMoveEvent ( TQMouseEvent * e );
};
-class KMagSelWin : public QWidget
+class KMagSelWin : public TQWidget
{
Q_OBJECT
+ TQ_OBJECT
public:
- KMagSelWin ( TQWidget * parent = 0, const char * name = 0, WFlags f = 0 );
+ KMagSelWin ( TQWidget * tqparent = 0, const char * name = 0, WFlags f = 0 );
virtual ~KMagSelWin();
@@ -95,16 +97,17 @@ protected:
* @author Original : Michael Forster
* @author Current : Sarang Lakare
*/
-class KMagSelRect : public TQObject, public QRect
+class KMagSelRect : public TQObject, public TQRect
{
Q_OBJECT
+ TQ_OBJECT
public:
- KMagSelRect(TQWidget *parent=0);
+ KMagSelRect(TQWidget *tqparent=0);
KMagSelRect(const TQPoint &topLeft, const TQPoint &bottomRight,
- TQWidget *parent=0);
+ TQWidget *tqparent=0);
KMagSelRect(const TQPoint &topLeft, const TQSize &size,
- TQWidget *parent=0);
+ TQWidget *tqparent=0);
KMagSelRect(int left, int top, int width, int height,
TQWidget *selWindowParent=0);
diff --git a/kmag/kmagzoomview.cpp b/kmag/kmagzoomview.cpp
index 4010fce..7608887 100644
--- a/kmag/kmagzoomview.cpp
+++ b/kmag/kmagzoomview.cpp
@@ -22,7 +22,7 @@
#include "kmagzoomview.h"
#include "kmagzoomview.moc"
-// include files for Qt
+// include files for TQt
#include <tqbitmap.h>
#include <tqpixmap.h>
#include <tqimage.h>
@@ -80,22 +80,22 @@ static uchar phand_bits[] = {
static bool obscuredRegion (TQRegion &region, Window winId, Window ignoreId, Window start = 0, int level = -1) {
- Window root, parent, *children; uint nchildren;
+ Window root, tqparent, *tqchildren; uint ntqchildren;
if (0 == start)
start = qt_xrootwin();
bool winIdFound = false;
- if (0 != XQueryTree (qt_xdisplay(), start, &root, &parent, &children, &nchildren)) {
- for (uint i=0; i < nchildren; ++i) {
+ if (0 != XQueryTree (qt_xdisplay(), start, &root, &tqparent, &tqchildren, &ntqchildren)) {
+ for (uint i=0; i < ntqchildren; ++i) {
if (winIdFound) {
- if (ignoreId != children [i]) {
+ if (ignoreId != tqchildren [i]) {
XWindowAttributes atts;
- XGetWindowAttributes (qt_xdisplay(), children [i], &atts);
+ XGetWindowAttributes (qt_xdisplay(), tqchildren [i], &atts);
if (atts.map_state == IsViewable)
region -= TQRegion (atts.x, atts.y, atts.width, atts.height, TQRegion::Rectangle);
}
}
- else if (winId == children [i])
+ else if (winId == tqchildren [i])
winIdFound = true;
// According to tests, my own window ID is either on toplevel or two levels below.
@@ -103,15 +103,15 @@ static bool obscuredRegion (TQRegion &region, Window winId, Window ignoreId, Win
// then to five recursion levels, and make a full recursive search only if that
// was unsuccessful.
else if (level > 1)
- winIdFound = obscuredRegion (region, winId, ignoreId, children [i], level-1);
+ winIdFound = obscuredRegion (region, winId, ignoreId, tqchildren [i], level-1);
else if (level == -1)
- if (! (winIdFound = obscuredRegion (region, winId, ignoreId, children [i], 0)))
- if (! (winIdFound = obscuredRegion (region, winId, ignoreId, children [i], 1)))
- winIdFound = obscuredRegion (region, winId, ignoreId, children [i], -1);
+ if (! (winIdFound = obscuredRegion (region, winId, ignoreId, tqchildren [i], 0)))
+ if (! (winIdFound = obscuredRegion (region, winId, ignoreId, tqchildren [i], 1)))
+ winIdFound = obscuredRegion (region, winId, ignoreId, tqchildren [i], -1);
}
- if (children != NULL)
- XFree (children);
+ if (tqchildren != NULL)
+ XFree (tqchildren);
}
return winIdFound;
@@ -120,8 +120,8 @@ static bool obscuredRegion (TQRegion &region, Window winId, Window ignoreId, Win
-KMagZoomView::KMagZoomView(TQWidget *parent, const char *name)
- : TQScrollView(parent, name),
+KMagZoomView::KMagZoomView(TQWidget *tqparent, const char *name)
+ : TQScrollView(tqparent, name),
m_selRect(0, 0, 128, 128, this),
m_grabTimer(0),
m_mouseViewTimer(0),
@@ -136,7 +136,7 @@ KMagZoomView::KMagZoomView(TQWidget *parent, const char *name)
KApplication::setGlobalMouseTracking(TRUE);
viewport()->setMouseTracking(TRUE);
viewport()->setBackgroundMode (NoBackground);
- viewport()->setFocusPolicy(TQWidget::StrongFocus);
+ viewport()->setFocusPolicy(TQ_StrongFocus);
m_ctrlKeyPressed = false;
m_shiftKeyPressed = false;
@@ -227,7 +227,7 @@ void KMagZoomView::resizeEvent( TQResizeEvent * e )
}
/**
- * Called when the widget is to be repainted
+ * Called when the widget is to be tqrepainted
*
* @param p
*/
@@ -246,7 +246,7 @@ void KMagZoomView::drawContents ( TQPainter * p, int clipx, int clipy, int clipw
// show the pixel under mouse cursor
if(m_showMouse) {
// paint the mouse cursor
- paintMouseCursor(&clippedPixmap, calcMousePos (m_refreshSwitch)-TQPoint (areaToPaint.x(), areaToPaint.y()));
+ paintMouseCursor(TQT_TQPAINTDEVICE(&clippedPixmap), calcMousePos (m_refreshSwitch)-TQPoint (areaToPaint.x(), areaToPaint.y()));
}
TQPixmap zoomedPixmap;
@@ -255,9 +255,9 @@ void KMagZoomView::drawContents ( TQPainter * p, int clipx, int clipy, int clipw
if (m_invert) {
TQImage zoomedImage;
zoomedImage = zoomedPixmap.convertToImage();
- zoomedImage.invertPixels (false);
+ zoomedImage.tqinvertPixels (false);
p->drawImage (TQPoint (clipx-contentsX(), clipy-contentsY()), zoomedImage, zoomedImage.rect(),
- Qt::ThresholdDither | Qt::ThresholdAlphaDither | Qt::AvoidDither);
+ TQt::ThresholdDither | TQt::ThresholdAlphaDither | TQt::AvoidDither);
} else {
p->drawPixmap (TQPoint (clipx, clipy), zoomedPixmap, zoomedPixmap.rect());
}
@@ -283,20 +283,20 @@ void KMagZoomView::paintMouseCursor(TQPaintDevice *dev, TQPoint mousePos)
switch(m_showMouse) {
case 1:
// 1. Square around the pixel
- pz.setPen(Qt::white);
- pz.setRasterOp(Qt::XorROP);
+ pz.setPen(TQt::white);
+ pz.setRasterOp(TQt::XorROP);
pz.drawRect(mousePos.x()-1, mousePos.y()-1, 3, 3);
break;
case 2:
{
// 2. Arrow cursor
- pz.setPen(Qt::black);
- pz.setBackgroundColor(Qt::white);
+ pz.setPen(TQt::black);
+ pz.setBackgroundColor(TQt::white);
TQBitmap sCursor( 16, 16, left_ptr_bits, TRUE );
- TQBitmap mask( 16, 16, left_ptrmsk_bits, TRUE );
- sCursor.setMask(mask);
+ TQBitmap tqmask( 16, 16, left_ptrmsk_bits, TRUE );
+ sCursor.setMask(tqmask);
// since hot spot is at 3,1
pz.drawPixmap(mousePos.x()-3, mousePos.y()-1, sCursor);
@@ -315,12 +315,12 @@ void KMagZoomView::paintMouseCursor(TQPaintDevice *dev, TQPoint mousePos)
case ArrowCursor :
{
// 2. Arrow cursor
- pz.setPen(Qt::black);
- pz.setBackgroundColor(Qt::white);
+ pz.setPen(TQt::black);
+ pz.setBackgroundColor(TQt::white);
TQBitmap sCursor( 16, 16, left_ptr_bits, TRUE );
- TQBitmap mask( 16, 16, left_ptrmsk_bits, TRUE );
- sCursor.setMask(mask);
+ TQBitmap tqmask( 16, 16, left_ptrmsk_bits, TRUE );
+ sCursor.setMask(tqmask);
// since hot spot is at 3,1
pz.drawPixmap(mousePos.x()-3, mousePos.y()-1, sCursor);
@@ -328,8 +328,8 @@ void KMagZoomView::paintMouseCursor(TQPaintDevice *dev, TQPoint mousePos)
break;
default:
TQBitmap sCursor( 32, 32, phand_bits, TRUE );
- TQBitmap mask( 32, 32, phandm_bits, TRUE );
- sCursor.setMask(mask);
+ TQBitmap tqmask( 32, 32, phandm_bits, TRUE );
+ sCursor.setMask(tqmask);
pz.drawPixmap(mousePos.x(), mousePos.y(), sCursor);
break;
@@ -370,7 +370,7 @@ TQPoint KMagZoomView::calcMousePos(bool updateMousePos)
void KMagZoomView::mousePressEvent(TQMouseEvent *e)
{
switch(e->button()) {
- case TQMouseEvent::LeftButton :
+ case Qt::LeftButton :
if(m_ctrlKeyPressed) {
// check if currently in resize mode
// don't do anything if fitToWindow is enabled
@@ -392,10 +392,8 @@ void KMagZoomView::mousePressEvent(TQMouseEvent *e)
m_selRect.show();
}
else {
- #if QT_VERSION >= 300
- // ignore this button press.. so it goes to the parent
+ // ignore this button press.. so it goes to the tqparent
e->ignore();
- #endif
}
} else if(m_shiftKeyPressed) {
// check if currently in move mode
@@ -417,10 +415,8 @@ void KMagZoomView::mousePressEvent(TQMouseEvent *e)
m_selRect.show();
}
else {
- #if QT_VERSION >= 300
- // ignore this button press.. so it goes to the parent
+ // ignore this button press.. so it goes to the tqparent
e->ignore();
- #endif
}
} else {
// check if currently in move mode
@@ -441,15 +437,13 @@ void KMagZoomView::mousePressEvent(TQMouseEvent *e)
m_selRect.show();
}
else {
- #if QT_VERSION >= 300
- // ignore this button press.. so it goes to the parent
+ // ignore this button press.. so it goes to the tqparent
e->ignore();
- #endif
}
}
break;
- case TQMouseEvent::MidButton :
+ case Qt::MidButton :
// check if currently in move mode
// don't do anything if follow mouse is enabled
if ((m_mouseMode != MoveSelection) && !m_followMouse) {
@@ -469,18 +463,14 @@ void KMagZoomView::mousePressEvent(TQMouseEvent *e)
m_selRect.show();
}
else {
- #if QT_VERSION >= 300
- // ignore this button press.. so it goes to the parent
+ // ignore this button press.. so it goes to the tqparent
e->ignore();
- #endif
}
break;
// do nothing
default:
-#if QT_VERSION >= 300
- // ignore this button press.. so it goes to the parent
+ // ignore this button press.. so it goes to the tqparent
e->ignore();
-#endif
break;
}
}
@@ -494,8 +484,8 @@ void KMagZoomView::mousePressEvent(TQMouseEvent *e)
void KMagZoomView::mouseReleaseEvent(TQMouseEvent *e)
{
switch(e->button()) {
- case TQMouseEvent::LeftButton :
- case TQMouseEvent::MidButton :
+ case Qt::LeftButton :
+ case Qt::MidButton :
// check if currently in move mode
if(m_mouseMode == MoveSelection) {
// hide the selection window
@@ -503,7 +493,7 @@ void KMagZoomView::mouseReleaseEvent(TQMouseEvent *e)
// set the mouse mode to normal
m_mouseMode = Normal;
- // restore the cursor shape
+ // restore the cursor tqshape
setCursor(arrowCursor);
// restore the cursor position
@@ -514,7 +504,7 @@ void KMagZoomView::mouseReleaseEvent(TQMouseEvent *e)
// set the mouse mode to normal
m_mouseMode = Normal;
- // restore the cursor shape
+ // restore the cursor tqshape
setCursor(arrowCursor);
// restore the cursor position
@@ -526,14 +516,14 @@ void KMagZoomView::mouseReleaseEvent(TQMouseEvent *e)
// set the mouse mode to normal
m_mouseMode = Normal;
- // restore the cursor shape
+ // restore the cursor tqshape
setCursor(arrowCursor);
}
break;
- case TQMouseEvent::RightButton :
+ case Qt::RightButton :
break;
- case TQMouseEvent::NoButton :
+ case Qt::NoButton :
break;
// do nothing
@@ -582,16 +572,16 @@ void KMagZoomView::mouseMoveEvent(TQMouseEvent *e)
void KMagZoomView::keyPressEvent(TQKeyEvent *e)
{
int offset = 16;
- if (e->state() & TQKeyEvent::ShiftButton)
+ if (e->state() & TQt::ShiftButton)
offset = 1;
- if (e->key() == TQKeyEvent::Key_Control)
+ if (e->key() == TQt::Key_Control)
m_ctrlKeyPressed = true;
- else if (e->key() == TQKeyEvent::Key_Shift)
- m_shiftKeyPressed = true;
- else if (e->key() == TQKeyEvent::Key_Left)
+ else if (e->key() == TQt::Key_Shift)
+ m_shiftKeyPressed = true;
+ else if (e->key() == TQt::Key_Left)
{
- if (e->state() & TQKeyEvent::ControlButton)
+ if (e->state() & TQt::ControlButton)
{
if (offset >= m_selRect.width())
m_selRect.setWidth (1);
@@ -615,9 +605,9 @@ void KMagZoomView::keyPressEvent(TQKeyEvent *e)
}
m_selRect.update();
}
- else if (e->key() == TQKeyEvent::Key_Right)
+ else if (e->key() == TQt::Key_Right)
{
- if (e->state() & TQKeyEvent::ControlButton)
+ if (e->state() & TQt::ControlButton)
m_selRect.setRight (m_selRect.right()+offset);
else if (contentsX() < contentsWidth()-visibleWidth())
{
@@ -632,9 +622,9 @@ void KMagZoomView::keyPressEvent(TQKeyEvent *e)
m_selRect.update();
}
- else if (e->key() == TQKeyEvent::Key_Up)
+ else if (e->key() == TQt::Key_Up)
{
- if (e->state() & TQKeyEvent::ControlButton)
+ if (e->state() & TQt::ControlButton)
{
if (offset >= m_selRect.height())
m_selRect.setHeight (1);
@@ -658,9 +648,9 @@ void KMagZoomView::keyPressEvent(TQKeyEvent *e)
}
m_selRect.update();
}
- else if (e->key() == TQKeyEvent::Key_Down)
+ else if (e->key() == TQt::Key_Down)
{
- if (e->state() & TQKeyEvent::ControlButton)
+ if (e->state() & TQt::ControlButton)
m_selRect.setBottom (m_selRect.bottom()+offset);
else if (contentsY() < contentsHeight()-visibleHeight())
{
@@ -680,9 +670,9 @@ void KMagZoomView::keyPressEvent(TQKeyEvent *e)
void KMagZoomView::keyReleaseEvent(TQKeyEvent *e)
{
- if (e->key() == TQKeyEvent::Key_Control)
+ if (e->key() == TQt::Key_Control)
m_ctrlKeyPressed = false;
- else if (e->key() == TQKeyEvent::Key_Shift)
+ else if (e->key() == TQt::Key_Shift)
m_shiftKeyPressed = false;
else
e->ignore();
@@ -716,7 +706,7 @@ void KMagZoomView::fitToWindow()
m_selRect.moveCenter(currCenter);
m_selRect.update();
- viewport()->repaint(false);
+ viewport()->tqrepaint(false);
}
void KMagZoomView::setFitToWindow(bool fit)
@@ -761,18 +751,18 @@ void KMagZoomView::grabFrame()
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());
+ obscuredRegion (intersection, tqtopLevelWidget()->winId(), m_selRect.winId());
intersection.translate (-selRect.x(), -selRect.y());
TQPainter painter (&m_grabbedPixmap, true);
- TQMemArray<TQRect> rects (intersection.rects());
+ TQMemArray<TQRect> rects (intersection.tqrects());
for (uint i = 0; i < rects.size(); i++)
painter.fillRect (rects[i], TQBrush (TQColor (128, 128, 128)));
- // call repaint to display the newly grabbed image
+ // call tqrepaint to display the newly grabbed image
TQRect newSize = m_zoomMatrix.mapRect (m_grabbedPixmap.rect());
resizeContents (newSize.width(), newSize.height());
- viewport()->repaint(false);
+ viewport()->tqrepaint(false);
}
@@ -785,7 +775,7 @@ void KMagZoomView::updateMouseView()
if(m_selRect.left() <= pos.x() && pos.x() <= m_selRect.right() &&
m_selRect.top() <= pos.y() && pos.y() <= m_selRect.bottom() &&
m_refreshSwitch)
- viewport()->repaint(false);
+ viewport()->tqrepaint(false);
}
/**
@@ -811,7 +801,7 @@ void KMagZoomView::setZoom(float zoom)
{
m_zoom = zoom;
updateMatrix();
- viewport()->repaint();
+ viewport()->tqrepaint();
}
/**
@@ -821,7 +811,7 @@ void KMagZoomView::setRotation(int rotation)
{
m_rotation = rotation;
updateMatrix();
- viewport()->repaint();
+ viewport()->tqrepaint();
}
/**
@@ -830,7 +820,7 @@ void KMagZoomView::setRotation(int rotation)
void KMagZoomView::setInvertation(bool invert)
{
m_invert = invert;
- viewport()->repaint();
+ viewport()->tqrepaint();
}
/**
@@ -899,7 +889,7 @@ TQPixmap KMagZoomView::getPixmap()
TQPixmap mousePixmap(m_grabbedPixmap);
// paint the mouse cursor w/o updating to a newer position
- paintMouseCursor(&mousePixmap, calcMousePos(false));
+ paintMouseCursor(TQT_TQPAINTDEVICE(&mousePixmap), calcMousePos(false));
return(mousePixmap);
} else { // no mouse cursor
diff --git a/kmag/kmagzoomview.h b/kmag/kmagzoomview.h
index 7b631ae..0c492cb 100644
--- a/kmag/kmagzoomview.h
+++ b/kmag/kmagzoomview.h
@@ -24,7 +24,7 @@
#include <config.h>
#endif
-// include files for Qt
+// include files for TQt
#include <tqwidget.h>
#include <tqpainter.h>
#include <tqpixmap.h>
@@ -43,12 +43,13 @@
* @author Olaf Schmikt <ojschmidt@kde.org>
* @author Sarang Lakare <sarang#users.sourceforge.net>
*/
-class KMagZoomView : public QScrollView
+class KMagZoomView : public TQScrollView
{
Q_OBJECT
+ TQ_OBJECT
public:
/// Constructor for the main view
- KMagZoomView(TQWidget *parent = 0, const char *name=0);
+ KMagZoomView(TQWidget *tqparent = 0, const char *name=0);
/// Destructor for the main view
~KMagZoomView();
@@ -60,7 +61,7 @@ class KMagZoomView : public QScrollView
TQPixmap getPixmap();
/// Returns the state of the refresh switch
- bool getRefreshStatus() const { return m_refreshSwitch; };
+ bool getRefreshtqStatus() const { return m_refreshSwitch; };
/// Returns teh status of followMouse
bool getFollowMouse() const { return m_followMouse; };
@@ -69,7 +70,7 @@ class KMagZoomView : public QScrollView
bool getShowSelRect() const { return (m_selRect.getAlwaysVisible()); };
/// Get the coordinates of the selection rectangle
- TQRect getSelRectPos() const { return static_cast<TQRect>(m_selRect); };
+ TQRect getSelRectPos() const { return (TQRect&)(m_selRect); };
/// Returns the current state of show mouse
unsigned int getShowMouseType() const;
@@ -131,7 +132,7 @@ class KMagZoomView : public QScrollView
/// Called when the widget has been resized
void resizeEvent(TQResizeEvent *e);
- /// Called when the widget is to be repainted
+ /// Called when the widget is to be tqrepainted
void drawContents ( TQPainter * p, int clipx, int clipy, int clipw, int cliph );
/// This function calculates the mouse position relative to the image