summaryrefslogtreecommitdiff
path: root/core/apps/calibrate/calibrate.cpp
Unidiff
Diffstat (limited to 'core/apps/calibrate/calibrate.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/apps/calibrate/calibrate.cpp27
1 files changed, 25 insertions, 2 deletions
diff --git a/core/apps/calibrate/calibrate.cpp b/core/apps/calibrate/calibrate.cpp
index a5f8792..e079195 100644
--- a/core/apps/calibrate/calibrate.cpp
+++ b/core/apps/calibrate/calibrate.cpp
@@ -28,3 +28,3 @@
28 28
29#if defined(Q_WS_QWS) || defined(_WS_QWS_) 29//#if defined(Q_WS_QWS) || defined(_WS_QWS_)
30 30
@@ -39,2 +39,3 @@ Calibrate::Calibrate( QWidget* parent, const char * name, WFlags wf ) :
39{ 39{
40#ifdef QWS
40 showCross = TRUE; 41 showCross = TRUE;
@@ -60,2 +61,3 @@ Calibrate::Calibrate( QWidget* parent, const char * name, WFlags wf ) :
60 connect( timer, SIGNAL( timeout() ), this, SLOT( timeout() ) ); 61 connect( timer, SIGNAL( timeout() ), this, SLOT( timeout() ) );
62#endif
61} 63}
@@ -69,2 +71,3 @@ void Calibrate::show()
69{ 71{
72#ifdef QWS
70 grabMouse(); 73 grabMouse();
@@ -73,2 +76,3 @@ void Calibrate::show()
73 QDialog::show(); 76 QDialog::show();
77#endif
74} 78}
@@ -77,3 +81,5 @@ void Calibrate::store()
77{ 81{
82#ifdef QWS
78 QWSServer::mouseHandler() ->calibrate( &goodcd ); 83 QWSServer::mouseHandler() ->calibrate( &goodcd );
84#endif
79} 85}
@@ -96,2 +102,3 @@ void Calibrate::reset()
96{ 102{
103#ifdef QWS
97 penPos = QPoint(); 104 penPos = QPoint();
@@ -99,2 +106,3 @@ void Calibrate::reset()
99 crossPos = fromDevice( cd.screenPoints[ location ] ); 106 crossPos = fromDevice( cd.screenPoints[ location ] );
107#endif
100} 108}
@@ -103,3 +111,8 @@ QPoint Calibrate::fromDevice( const QPoint &p )
103{ 111{
112#ifdef QWS
104 return qt_screen->mapFromDevice ( p, QSize( qt_screen->deviceWidth ( ), qt_screen->deviceHeight() ) ); 113 return qt_screen->mapFromDevice ( p, QSize( qt_screen->deviceWidth ( ), qt_screen->deviceHeight() ) );
114#else
115 return QPoint();
116#endif
117
105} 118}
@@ -108,2 +121,3 @@ bool Calibrate::sanityCheck()
108{ 121{
122#ifdef QWS
109 QPoint tl = cd.devPoints[QWSPointerCalibrationData::TopLeft]; 123 QPoint tl = cd.devPoints[QWSPointerCalibrationData::TopLeft];
@@ -148,2 +162,5 @@ bool Calibrate::sanityCheck()
148 return true; 162 return true;
163#else
164return true;
165#endif
149 } 166 }
@@ -192,2 +209,3 @@ void Calibrate::mousePressEvent( QMouseEvent *e )
192{ 209{
210#ifdef QWS
193 // map to device coordinates 211 // map to device coordinates
@@ -199,2 +217,3 @@ void Calibrate::mousePressEvent( QMouseEvent *e )
199 ( penPos.y() + devPos.y() ) / 2 ); 217 ( penPos.y() + devPos.y() ) / 2 );
218#endif
200} 219}
@@ -203,2 +222,3 @@ void Calibrate::mouseReleaseEvent( QMouseEvent * )
203{ 222{
223#ifdef QWS
204 if ( timer->isActive() ) 224 if ( timer->isActive() )
@@ -231,2 +251,3 @@ void Calibrate::mouseReleaseEvent( QMouseEvent * )
231 } 251 }
252#endif
232} 253}
@@ -235,2 +256,3 @@ void Calibrate::timeout()
235{ 256{
257#ifdef QWS
236 QPoint target = fromDevice( cd.screenPoints[ location ] ); 258 QPoint target = fromDevice( cd.screenPoints[ location ] );
@@ -257,4 +279,5 @@ void Calibrate::timeout()
257 moveCrosshair( newPos ); 279 moveCrosshair( newPos );
280#endif
258} 281}
259 282
260#endif // _WS_QWS_ 283//#endif // _WS_QWS_