Qt 4.8
Public Functions | List of all members
QWSPcMouseSubHandler_mousesystems Class Reference
Inheritance diagram for QWSPcMouseSubHandler_mousesystems:
QWSPcMouseSubHandler_serial QWSPcMouseSubHandler

Public Functions

void init ()
 
 QWSPcMouseSubHandler_mousesystems (int f)
 
int tryData ()
 
- Public Functions inherited from QWSPcMouseSubHandler_serial
 QWSPcMouseSubHandler_serial (int f)
 
- Public Functions inherited from QWSPcMouseSubHandler
void appendData (uchar *data, int length)
 
int buttonState () const
 
void closeIfNot (int &f)
 
int file () const
 
void initState ()
 
bool motionPending () const
 
 QWSPcMouseSubHandler (int f)
 
bool reliable () const
 
QPoint takeMotion ()
 
int takeWheel ()
 
UsageResult useData ()
 
void worse (int by=1)
 
virtual ~QWSPcMouseSubHandler ()
 

Additional Inherited Members

- Public Types inherited from QWSPcMouseSubHandler
enum  UsageResult { Insufficient, Motion, Button }
 
- Protected Types inherited from QWSPcMouseSubHandler
enum  { max_buf =32 }
 
- Protected Functions inherited from QWSPcMouseSubHandler_serial
void setflags (int f)
 
- Protected Variables inherited from QWSPcMouseSubHandler
int badness
 
int bstate
 
uchar buffer [max_buf]
 
int fd
 
int goodness
 
QPoint motion
 
int nbuf
 
int wheel
 

Detailed Description

Definition at line 360 of file qmousepc_qws.cpp.

Constructors and Destructors

◆ QWSPcMouseSubHandler_mousesystems()

QWSPcMouseSubHandler_mousesystems::QWSPcMouseSubHandler_mousesystems ( int  f)
inline

Definition at line 364 of file qmousepc_qws.cpp.

Functions

◆ init()

void QWSPcMouseSubHandler_mousesystems::init ( )
inline

Definition at line 369 of file qmousepc_qws.cpp.

370  {
371  setflags(B1200|CS8|CSTOPB);
372  // 60Hz
373  if (QT_WRITE(fd, "R", 1)!=1) {
374  badness = 100;
375  return;
376  }
377  if (tcflush(fd,TCIOFLUSH) == -1) {
378 #ifdef QT_QWS_VNC_DEBUG
379  perror("QWSPcMouseSubHandler_mousesystems: tcflush");
380 #endif
381  }
382  }
#define QT_WRITE
Definition: qcore_unix_p.h:289

◆ tryData()

int QWSPcMouseSubHandler_mousesystems::tryData ( )
inlinevirtual

Implements QWSPcMouseSubHandler.

Definition at line 384 of file qmousepc_qws.cpp.

385  {
386  if (nbuf >= 5) {
387  if ((buffer[0] & 0xf8) != 0x80) {
388  badness++;
389  return 1;
390  }
391  motion +=
392  QPoint((signed char)buffer[1] + (signed char)buffer[3],
393  -(signed char)buffer[2] + (signed char)buffer[4]);
394  int t = ~buffer[0];
395  int nbstate = ((t&3) << 1) | ((t&4) >> 2);
396  if (motion.x() || motion.y() || bstate != nbstate) {
397  bstate = nbstate;
398  goodness++;
399  } else {
400  badness++;
401  return 1;
402  }
403  return 5;
404  }
405  return 0;
406  }
uchar buffer[max_buf]
The QPoint class defines a point in the plane using integer precision.
Definition: qpoint.h:53
int y() const
Returns the y coordinate of this point.
Definition: qpoint.h:131
int x() const
Returns the x coordinate of this point.
Definition: qpoint.h:128

The documentation for this class was generated from the following file: