|
|
@ -43,6 +43,7 @@ SMsgWriter::SMsgWriter(ConnParams* cp_, rdr::OutStream* os_)
|
|
|
|
needSetDesktopSize(false), needExtendedDesktopSize(false),
|
|
|
|
needSetDesktopSize(false), needExtendedDesktopSize(false),
|
|
|
|
needSetDesktopName(false), needSetCursor(false),
|
|
|
|
needSetDesktopName(false), needSetCursor(false),
|
|
|
|
needSetXCursor(false), needSetCursorWithAlpha(false),
|
|
|
|
needSetXCursor(false), needSetCursorWithAlpha(false),
|
|
|
|
|
|
|
|
needSetVMWareCursor(false),
|
|
|
|
needCursorPos(false),
|
|
|
|
needCursorPos(false),
|
|
|
|
needLEDState(false), needQEMUKeyEvent(false)
|
|
|
|
needLEDState(false), needQEMUKeyEvent(false)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -321,6 +322,16 @@ bool SMsgWriter::writeSetCursorWithAlpha()
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool SMsgWriter::writeSetVMwareCursor()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!cp->supportsVMWareCursor)
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
needSetVMWareCursor = true;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return true;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SMsgWriter::writeCursorPos()
|
|
|
|
void SMsgWriter::writeCursorPos()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!cp->supportsEncoding(pseudoEncodingVMwareCursorPosition))
|
|
|
|
if (!cp->supportsEncoding(pseudoEncodingVMwareCursorPosition))
|
|
|
@ -355,7 +366,7 @@ bool SMsgWriter::needFakeUpdate()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (needSetDesktopName)
|
|
|
|
if (needSetDesktopName)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
if (needSetCursor || needSetXCursor || needSetCursorWithAlpha)
|
|
|
|
if (needSetCursor || needSetXCursor || needSetCursorWithAlpha || needSetVMWareCursor)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
if (needCursorPos)
|
|
|
|
if (needCursorPos)
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
@ -411,6 +422,8 @@ void SMsgWriter::writeFramebufferUpdateStart(int nRects)
|
|
|
|
nRects++;
|
|
|
|
nRects++;
|
|
|
|
if (needSetCursorWithAlpha)
|
|
|
|
if (needSetCursorWithAlpha)
|
|
|
|
nRects++;
|
|
|
|
nRects++;
|
|
|
|
|
|
|
|
if (needSetVMWareCursor)
|
|
|
|
|
|
|
|
nRects++;
|
|
|
|
if (needCursorPos)
|
|
|
|
if (needCursorPos)
|
|
|
|
nRects++;
|
|
|
|
nRects++;
|
|
|
|
if (needLEDState)
|
|
|
|
if (needLEDState)
|
|
|
@ -528,6 +541,15 @@ void SMsgWriter::writePseudoRects()
|
|
|
|
needSetCursorWithAlpha = false;
|
|
|
|
needSetCursorWithAlpha = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (needSetVMWareCursor) {
|
|
|
|
|
|
|
|
const Cursor& cursor = cp->cursor();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
writeSetVMwareCursorRect(cursor.width(), cursor.height(),
|
|
|
|
|
|
|
|
cursor.hotspot().x, cursor.hotspot().y,
|
|
|
|
|
|
|
|
cursor.getBuffer());
|
|
|
|
|
|
|
|
needSetVMWareCursor = false;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (needCursorPos) {
|
|
|
|
if (needCursorPos) {
|
|
|
|
const Point& cursorPos = cp->cursorPos();
|
|
|
|
const Point& cursorPos = cp->cursorPos();
|
|
|
|
|
|
|
|
|
|
|
@ -718,6 +740,28 @@ void SMsgWriter::writeSetCursorWithAlphaRect(int width, int height,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void SMsgWriter::writeSetVMwareCursorRect(int width, int height,
|
|
|
|
|
|
|
|
int hotspotX, int hotspotY,
|
|
|
|
|
|
|
|
const rdr::U8* data)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (!cp->supportsVMWareCursor)
|
|
|
|
|
|
|
|
throw Exception("Client does not support local cursors");
|
|
|
|
|
|
|
|
if (++nRectsInUpdate > nRectsInHeader && nRectsInHeader)
|
|
|
|
|
|
|
|
throw Exception("SMsgWriter::writeSetVMwareCursorRect: nRects out of sync");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
os->writeS16(hotspotX);
|
|
|
|
|
|
|
|
os->writeS16(hotspotY);
|
|
|
|
|
|
|
|
os->writeU16(width);
|
|
|
|
|
|
|
|
os->writeU16(height);
|
|
|
|
|
|
|
|
os->writeU32(pseudoEncodingVMwareCursor);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
os->writeU8(1); // Alpha cursor
|
|
|
|
|
|
|
|
os->pad(1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// FIXME: Should alpha be premultiplied?
|
|
|
|
|
|
|
|
os->writeBytes(data, width*height*4);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void SMsgWriter::writeSetVMwareCursorPositionRect(int hotspotX, int hotspotY)
|
|
|
|
void SMsgWriter::writeSetVMwareCursorPositionRect(int hotspotX, int hotspotY)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (!cp->supportsEncoding(pseudoEncodingVMwareCursorPosition))
|
|
|
|
if (!cp->supportsEncoding(pseudoEncodingVMwareCursorPosition))
|
|
|
|