Commit 14b29038 authored by dscho's avatar dscho

LibVNCClient: some users do not want to get whole-screen updates; introduce...

LibVNCClient: some users do not want to get whole-screen updates; introduce client->updateRect for that
parent 35d481a7
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> 2007-01-31 Karl Runge <runge@karlrunge.com>
* libvncclient: add GotCursorShape() and GotCopyRect() hooks. * libvncclient: add GotCursorShape() and GotCopyRect() hooks.
fix copyrect code in rfbproto.c, add copyrect to default list. fix copyrect code in rfbproto.c, add copyrect to default list.
......
...@@ -854,8 +854,9 @@ SetFormatAndEncodings(rfbClient* client) ...@@ -854,8 +854,9 @@ SetFormatAndEncodings(rfbClient* client)
rfbBool rfbBool
SendIncrementalFramebufferUpdateRequest(rfbClient* client) SendIncrementalFramebufferUpdateRequest(rfbClient* client)
{ {
return SendFramebufferUpdateRequest(client, 0, 0, client->width, return SendFramebufferUpdateRequest(client,
client->height, TRUE); client->updateRect.x, client->updateRect.y,
client->updateRect.w, client->updateRect.h, TRUE);
} }
......
...@@ -119,7 +119,10 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel, ...@@ -119,7 +119,10 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel,
client->CurrentKeyboardLedState = 0; client->CurrentKeyboardLedState = 0;
client->HandleKeyboardLedState = (HandleKeyboardLedStateProc)DummyPoint; client->HandleKeyboardLedState = (HandleKeyboardLedStateProc)DummyPoint;
/* default: use complete frame buffer */
client->updateRect.x = -1;
client->format.bitsPerPixel = bytesPerPixel*8; client->format.bitsPerPixel = bytesPerPixel*8;
client->format.depth = bitsPerSample*samplesPerPixel; client->format.depth = bitsPerSample*samplesPerPixel;
client->appData.requestedDepth=client->format.depth; client->appData.requestedDepth=client->format.depth;
...@@ -202,20 +205,30 @@ static rfbBool rfbInitConnection(rfbClient* client) ...@@ -202,20 +205,30 @@ static rfbBool rfbInitConnection(rfbClient* client)
client->height=client->si.framebufferHeight; client->height=client->si.framebufferHeight;
client->MallocFrameBuffer(client); 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 (client->appData.scaleSetting>1)
{ {
if (!SendScaleSetting(client, client->appData.scaleSetting)) if (!SendScaleSetting(client, client->appData.scaleSetting))
return FALSE; return FALSE;
if (!SendFramebufferUpdateRequest(client, if (!SendFramebufferUpdateRequest(client,
0,0, client->updateRect.x / client->appData.scaleSetting,
client->width/client->appData.scaleSetting, client->updateRect.y / client->appData.scaleSetting,
client->height/client->appData.scaleSetting,FALSE)) client->updateRect.w / client->appData.scaleSetting,
return FALSE; client->updateRect.h / client->appData.scaleSetting,
FALSE))
return FALSE;
} }
else else
{ {
if (!SendFramebufferUpdateRequest(client, 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; return FALSE;
} }
......
...@@ -124,6 +124,10 @@ typedef struct _rfbClient { ...@@ -124,6 +124,10 @@ typedef struct _rfbClient {
rfbBool listenSpecified; rfbBool listenSpecified;
int listenPort, flashPort; int listenPort, flashPort;
struct {
int x, y, w, h;
} updateRect;
/* Note that the CoRRE encoding uses this buffer and assumes it is big enough /* 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. 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. Hextile also assumes it is big enough to hold 16 * 16 * 32 bits.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment