summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/apps/calibrate/calibrate.cpp37
-rw-r--r--core/apps/calibrate/calibrate.h6
2 files changed, 34 insertions, 9 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 @@
-#if defined(Q_WS_QWS) || defined(_WS_QWS_)
+//#if defined(Q_WS_QWS) || defined(_WS_QWS_)
@@ -39,2 +39,3 @@ Calibrate::Calibrate( QWidget* parent, const char * name, WFlags wf ) :
{
+#ifdef QWS
showCross = TRUE;
@@ -60,2 +61,3 @@ Calibrate::Calibrate( QWidget* parent, const char * name, WFlags wf ) :
connect( timer, SIGNAL( timeout() ), this, SLOT( timeout() ) );
+#endif
}
@@ -69,2 +71,3 @@ void Calibrate::show()
{
+#ifdef QWS
grabMouse();
@@ -73,2 +76,3 @@ void Calibrate::show()
QDialog::show();
+#endif
}
@@ -77,3 +81,5 @@ void Calibrate::store()
{
+#ifdef QWS
QWSServer::mouseHandler() ->calibrate( &goodcd );
+#endif
}
@@ -89,3 +95,3 @@ void Calibrate::hide()
e << QString ( "calibrate" );
- }
+ }
}
@@ -96,2 +102,3 @@ void Calibrate::reset()
{
+#ifdef QWS
penPos = QPoint();
@@ -99,2 +106,3 @@ void Calibrate::reset()
crossPos = fromDevice( cd.screenPoints[ location ] );
+#endif
}
@@ -103,3 +111,8 @@ QPoint Calibrate::fromDevice( const QPoint &p )
{
+#ifdef QWS
return qt_screen->mapFromDevice ( p, QSize( qt_screen->deviceWidth ( ), qt_screen->deviceHeight() ) );
+#else
+ return QPoint();
+#endif
+
}
@@ -108,2 +121,3 @@ bool Calibrate::sanityCheck()
{
+#ifdef QWS
QPoint tl = cd.devPoints[QWSPointerCalibrationData::TopLeft];
@@ -129,4 +143,4 @@ bool Calibrate::sanityCheck()
int db = (int) ::sqrt (( dbx * dbx ) + ( dby * dby ));
-
- // Calculate leeway for x/y (we do not care if diff1/diff2 is for x or y here !)
+
+ // Calculate leeway for x/y (we do not care if diff1/diff2 is for x or y here !)
int diff1 = QABS( dl - dr );
@@ -139,3 +153,3 @@ bool Calibrate::sanityCheck()
// It needs to be performed only for the triange (bl, tl, tr)
- int diff3 = QABS(( dlx + dly + dtx + dty ) - ( dl + dt ));
+ int diff3 = QABS(( dlx + dly + dtx + dty ) - ( dl + dt ));
int avg3 = (( dlx + dly + dtx + dty ) + ( dl + dt )) / 2;
@@ -148,3 +162,6 @@ bool Calibrate::sanityCheck()
return true;
-}
+#else
+return true;
+#endif
+}
@@ -192,2 +209,3 @@ void Calibrate::mousePressEvent( QMouseEvent *e )
{
+#ifdef QWS
// map to device coordinates
@@ -199,2 +217,3 @@ void Calibrate::mousePressEvent( QMouseEvent *e )
( penPos.y() + devPos.y() ) / 2 );
+#endif
}
@@ -203,2 +222,3 @@ void Calibrate::mouseReleaseEvent( QMouseEvent * )
{
+#ifdef QWS
if ( timer->isActive() )
@@ -231,2 +251,3 @@ void Calibrate::mouseReleaseEvent( QMouseEvent * )
}
+#endif
}
@@ -235,2 +256,3 @@ void Calibrate::timeout()
{
+#ifdef QWS
QPoint target = fromDevice( cd.screenPoints[ location ] );
@@ -257,4 +279,5 @@ void Calibrate::timeout()
moveCrosshair( newPos );
+#endif
}
-#endif // _WS_QWS_
+//#endif // _WS_QWS_
diff --git a/core/apps/calibrate/calibrate.h b/core/apps/calibrate/calibrate.h
index 97108c9..06aa0c9 100644
--- a/core/apps/calibrate/calibrate.h
+++ b/core/apps/calibrate/calibrate.h
@@ -22,3 +22,3 @@
-#if defined(Q_WS_QWS) || defined(_WS_QWS_)
+//#if defined(Q_WS_QWS) || defined(_WS_QWS_)
@@ -54,4 +54,6 @@ private:
QPixmap logo;
+#ifdef QWS
QWSPointerCalibrationData goodcd,cd;
QWSPointerCalibrationData::Location location;
+#endif
QPoint crossPos;
@@ -65,3 +67,3 @@ private:
-#endif // _WS_QWS_
+//#endif // _WS_QWS_