LibVNCClient: some users do not want to get whole-screen updates; introduce client->updateRect for that

pull/1/head
dscho 17 years ago
parent 35d481a783
commit 14b290384a

@ -1,3 +1,7 @@
2007-02-01 Johannes E. Schindelin <Johannes.Schindelin@gmx.de>
* libvncclient: add updateRect member to rfbClient, to allow
requesting smaller updates than whole-screen.
2007-01-31 Karl Runge <runge@karlrunge.com>
* libvncclient: add GotCursorShape() and GotCopyRect() hooks.
fix copyrect code in rfbproto.c, add copyrect to default list.

@ -854,8 +854,9 @@ SetFormatAndEncodings(rfbClient* client)
rfbBool
SendIncrementalFramebufferUpdateRequest(rfbClient* client)
{
return SendFramebufferUpdateRequest(client, 0, 0, client->width,
client->height, TRUE);
return SendFramebufferUpdateRequest(client,
client->updateRect.x, client->updateRect.y,
client->updateRect.w, client->updateRect.h, TRUE);
}

@ -119,7 +119,10 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,
client->CurrentKeyboardLedState = 0;
client->HandleKeyboardLedState = (HandleKeyboardLedStateProc)DummyPoint;
/* default: use complete frame buffer */
client->updateRect.x = -1;
client->format.bitsPerPixel = bytesPerPixel*8;
client->format.depth = bitsPerSample*samplesPerPixel;
client->appData.requestedDepth=client->format.depth;
@ -202,20 +205,30 @@ static rfbBool rfbInitConnection(rfbClient* client)
client->height=client->si.framebufferHeight;
client->MallocFrameBuffer(client);
if (client->updateRect.x < 0) {
client->updateRect.x = client->updateRect.y = 0;
client->updateRect.w = client->width;
client->updateRect.h = client->height;
}
if (client->appData.scaleSetting>1)
{
if (!SendScaleSetting(client, client->appData.scaleSetting))
return FALSE;
if (!SendFramebufferUpdateRequest(client,
0,0,
client->width/client->appData.scaleSetting,
client->height/client->appData.scaleSetting,FALSE))
return FALSE;
client->updateRect.x / client->appData.scaleSetting,
client->updateRect.y / client->appData.scaleSetting,
client->updateRect.w / client->appData.scaleSetting,
client->updateRect.h / client->appData.scaleSetting,
FALSE))
return FALSE;
}
else
{
if (!SendFramebufferUpdateRequest(client,
0,0,client->width,client->height,FALSE))
client->updateRect.x, client->updateRect.y,
client->updateRect.w, client->updateRect.h,
FALSE))
return FALSE;
}

@ -124,6 +124,10 @@ typedef struct _rfbClient {
rfbBool listenSpecified;
int listenPort, flashPort;
struct {
int x, y, w, h;
} updateRect;
/* Note that the CoRRE encoding uses this buffer and assumes it is big enough
to hold 255 * 255 * 32 bits -> 260100 bytes. 640*480 = 307200 bytes.
Hextile also assumes it is big enough to hold 16 * 16 * 32 bits.

Loading…
Cancel
Save