Whitespace cleanup.

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43017 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
François Revol 2011-10-30 21:18:20 +00:00
parent 86b7df9ad6
commit ba43890fe5

View File

@ -310,7 +310,7 @@ TabletDevice::ReadData(const uchar* data, int dataBytes, bool& hasContact,
xPos = data[3] << 8 | data[2];
yPos = data[5] << 8 | data[4];
hasContact = (data[1] & 0x80);
hasContact = (data[1] & 0x80);
uint16 pressureData = data[7] << 8 | data[6];
pressure = (float)pressureData / 511.0;
@ -338,17 +338,17 @@ TabletDevice::ReadData(const uchar* data, int dataBytes, bool& hasContact,
if (dataBytes < 20) { // ignore touch-packets
xPos = data[3] << 8 | data[2];
yPos = data[5] << 8 | data[4];
hasContact = (data[1] & 0x10) && (data[1] & 0x20);
hasContact = (data[1] & 0x10) && (data[1] & 0x20);
uint16 pressureData = data[7] << 8 | data[6];
pressure = (float)pressureData / 1023.0;
eraser = (data[1] & 0x08);
firstButton = (data[1] & 0x01);
secondButton = (data[1] & 0x02);
thirdButton = (data[1] & 0x04);
break;
}
}
@ -408,7 +408,7 @@ TabletDevice::ReadData(const uchar* data, int dataBytes, bool& hasContact,
hasContact = ( data[1] & 0x20);
xPos = data[2] << 8 | data[3];
yPos = data[5] << 8 | data[6];
firstButton = (data[4] & 0x08);
firstButton = (data[4] & 0x08);
secondButton = (data[4] & 0x10);
thirdButton = (data[4] & 0x20);
uint16 pressureData = (data[4] & 0x04) >> 2 | (data[7] & 0x7f) << 1;
@ -418,15 +418,15 @@ TabletDevice::ReadData(const uchar* data, int dataBytes, bool& hasContact,
case DEVICE_VOLITO: {
eraser = 0;
thirdButton = 0;
xPos = data[3] << 8 | data[2];
yPos = data[5] << 8 | data[4];
hasContact = (data[1] & 0x80);
hasContact = (data[1] & 0x80);
firstButton = (data[1] & 0x01) == 1;
secondButton = data[1] & 0x04;
uint16 pressureData = data[7] << 8 | data[6];
pressure = (float)pressureData / 511.0;
@ -437,13 +437,13 @@ TabletDevice::ReadData(const uchar* data, int dataBytes, bool& hasContact,
pressure = 0.0;
secondButton = data[1] & 0x02;
}
break;
}
case DEVICE_PENSTATION: {
xPos = data[3] << 8 | data[2];
yPos = data[5] << 8 | data[4];
hasContact = (data[1] & 0x10);
hasContact = (data[1] & 0x10);
uint16 pressureData = data[7] << 8 | data[6];
pressure = (float)pressureData / 511.0;
firstButton = (data[1] & 0x01);
@ -475,7 +475,7 @@ TabletDevice::SetStatus(uint32 mode, uint32 buttons, float x, float y,
what = B_MOUSE_DOWN;
else if (buttons < fButtons)
what = B_MOUSE_UP;
#if DEBUG
float tabletX = x;
@ -483,10 +483,10 @@ TabletDevice::SetStatus(uint32 mode, uint32 buttons, float x, float y,
#endif
x /= fMaxX;
y /= fMaxY;
float deltaX = 0.0;
float deltaY = 0.0;
float absDeltaX = 0.0;
float absDeltaY = 0.0;
@ -510,13 +510,13 @@ fParent->LogString() << "tilt x: " << tiltX << ", tilt y: " << tiltY << "\n\n";
if (absDeltaY < fJitterY)
y = fPosY;
}
// only do send message if something changed
if (x != fPosX || y != fPosY || fButtons != buttons || pressure != fPressure
|| fEraser != eraser || fTiltX != tiltX || fTiltY != tiltY) {
bigtime_t now = system_time();
// common fields for any mouse message
BMessage* event = new BMessage(what);
event->AddInt64("when", now);
@ -579,7 +579,7 @@ event->AddFloat("tablet y", tabletY);
status_t ret = fParent->EnqueueMessage(event);
if (ret < B_OK)
PRINT(("EnqueueMessage(): %s\n", strerror(ret)));
// apply values to members
fPosX = x;
fPosY = y;
@ -590,7 +590,7 @@ event->AddFloat("tablet y", tabletY);
fTiltX = tiltX;
fTiltY = tiltY;
}
// separate wheel changed message
if (fWheelX != wheelX || fWheelY != wheelY) {
BMessage* event = new BMessage(B_MOUSE_WHEEL_CHANGED);