44 #if !defined(QT_NO_QWS_MOUSE_TSLIB) || defined(QT_PLUGIN) 46 #include <QtCore/qregexp.h> 47 #include <QtCore/qstringlist.h> 56 #ifdef TSLIBMOUSEHANDLER_DEBUG 57 # include <QtCore/QDebug> 132 inline bool get_sample(
struct ts_sample *sample);
153 const char *str = getenv(
"TSLIB_TSDEVICE");
181 qCritical(
"QWSTslibMouseHandlerPrivate: ts_open() failed" 182 " with error: '%s'", strerror(
errno));
183 qCritical(
"Please check your tslib installation!");
187 if (ts_config(
dev)) {
188 qCritical(
"QWSTslibMouseHandlerPrivate: ts_config() failed" 189 " with error: '%s'", strerror(
errno));
190 qCritical(
"Please check your tslib installation!");
223 return (ts_read_raw(
dev, sample, 1) == 1);
225 return (ts_read(
dev, sample, 1) == 1);
240 pressed = (sample.pressure > 0);
246 pressed = (sample.pressure > 0);
250 if (!
calibrated && !pressed && sample.x == 0 && sample.y == 0) {
268 if (
wasPressed == pressed && dx == 0 && dy == 0)
271 #ifdef TSLIBMOUSEHANDLER_DEBUG 273 <<
"curr" <<
QPoint(sample.x, sample.y)
274 <<
"dx,dy" <<
QPoint(dx, dy)
286 const QPoint p(sample.x, sample.y);
290 handler->QWSMouseHandler::mouseChanged(p, pressed);
301 handler->QWSCalibratedMouseHandler::clearCalibration();
313 handler->QWSCalibratedMouseHandler::calibrate(data);
371 #include "qmousetslib_qws.moc" 373 #endif //QT_NO_QWS_MOUSE_TSLIB Q_GUI_EXPORT QScreen * qt_screen
void clearCalibration()
Reimplemented Function
static QString fromLocal8Bit(const char *, int size=-1)
Returns a QString initialized with the first size characters of the 8-bit string str.
QString cap(int nth=0) const
Returns the text captured by the nth subexpression.
#define QT_END_NAMESPACE
This macro expands to.
The QRegExp class provides pattern matching using regular expressions.
int toInt(bool *ok=0, int base=10) const
Returns the string converted to an int using base base, which is 10 by default and must be between 2 ...
The QWSCalibratedMouseHandler class provides mouse calibration and noise reduction in Qt for Embedded...
QLatin1String(DBUS_INTERFACE_DBUS))) Q_GLOBAL_STATIC_WITH_ARGS(QString
The QString class provides a Unicode character string.
Q_DECL_CONSTEXPR T qAbs(const T &t)
The QObject class is the base class of all Qt objects.
The QSocketNotifier class provides support for monitoring activity on a file descriptor.
Q_CORE_EXPORT void qDebug(const char *,...)
QSocketNotifier * mouseNotifier
void calibrate(const QWSPointerCalibrationData *data)
Reimplemented Function
bool sendFiltered(const QPoint &, int button)
Notifies the system of a new mouse event after applying a noise reduction filter. ...
int indexOf(const QRegExp &rx, int from=0) const
Returns the index position of the first exact match of rx in the list, searching forward from index p...
#define QT_BEGIN_NAMESPACE
This macro expands to.
static bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
Creates a connection of the given type from the signal in the sender object to the method in the rece...
struct ts_sample lastSample
The QStringList class provides a list of strings.
void suspend()
Reimplemented Function
static const char * data(const QByteArray &arr)
The QWSPointerCalibrationData class is a container for mouse calibration data in Qt for Embedded Linu...
void resume()
Reimplemented Function
QByteArray toLocal8Bit() const Q_REQUIRED_RESULT
Returns the local 8-bit representation of the string as a QByteArray.
The QWSTslibMouseHandler class implements a mouse driver for the Universal Touch Screen Library...
const char * constData() const
Returns a pointer to the data stored in the byte array.
bool isNull() const
Returns true if this string is null; otherwise returns false.
QString join(const QString &sep) const
Joins all the string list's strings into a single string with each element separated by the given sep...
QWSTslibMouseHandler(const QString &driver=QString(), const QString &device=QString())
QWSTslibMouseHandlerPrivate(QWSTslibMouseHandler *h, const QString &device)
The QPoint class defines a point in the plane using integer precision.
void setEnabled(bool)
If enable is true, the notifier is enabled; otherwise the notifier is disabled.
QWSTslibMouseHandlerPrivate * d
QWSTslibMouseHandler * handler
void calibrate(const QWSPointerCalibrationData *data)
QStringList split(const QString &sep, SplitBehavior behavior=KeepEmptyParts, Qt::CaseSensitivity cs=Qt::CaseSensitive) const Q_REQUIRED_RESULT
Splits the string into substrings wherever sep occurs, and returns the list of those strings...
bool get_sample(struct ts_sample *sample)
friend class QWSTslibMouseHandlerPrivate
The QLatin1Char class provides an 8-bit ASCII/Latin-1 character.
~QWSTslibMouseHandlerPrivate()
Q_CORE_EXPORT void qCritical(const char *,...)
void removeAt(int i)
Removes the item at index position i.