diff options
author | runge <runge> | 2007-01-31 15:29:12 +0000 |
---|---|---|
committer | runge <runge> | 2007-01-31 15:29:12 +0000 |
commit | 1f8da9bde3b7de272228872410143f076662ae13 (patch) | |
tree | b17994299e96318ecd147f052a42eddffa1e9ca9 /libvncclient/rfbproto.c | |
parent | b66c944fe30d9bd120c29f28f23336623777eee8 (diff) | |
download | libvncserver-1f8da9bde3b7de272228872410143f076662ae13.zip libvncserver-1f8da9bde3b7de272228872410143f076662ae13.tar.gz |
libvncclient: add GotCursorShape() and GotCopyRect(); x11vnc dep on libvncclient
Diffstat (limited to 'libvncclient/rfbproto.c')
-rw-r--r-- | libvncclient/rfbproto.c | 31 |
1 files changed, 28 insertions, 3 deletions
diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c index 105e4e3..2704dee 100644 --- a/libvncclient/rfbproto.c +++ b/libvncclient/rfbproto.c @@ -167,9 +167,30 @@ static void CopyRectangleFromRectangle(rfbClient* client, int src_x, int src_y, #define COPY_RECT_FROM_RECT(BPP) \ { \ uint##BPP##_t* _buffer=((uint##BPP##_t*)client->frameBuffer)+(src_y-dest_y)*client->width+src_x-dest_x; \ - for(j=dest_y*client->width;j<(dest_y+h)*client->width;j+=client->width) { \ - for(i=dest_x;i<dest_x+w;i++) \ - ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \ + if (dest_y < src_y) { \ + for(j = dest_y*client->width; j < (dest_y+h)*client->width; j += client->width) { \ + if (dest_x < src_x) { \ + for(i = dest_x; i < dest_x+w; i++) { \ + ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \ + } \ + } else { \ + for(i = dest_x+w-1; i >= dest_x; i--) { \ + ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \ + } \ + } \ + } \ + } else { \ + for(j = (dest_y+h-1)*client->width; j >= dest_y*client->width; j-=client->width) { \ + if (dest_x < src_x) { \ + for(i = dest_x; i < dest_x+w; i++) { \ + ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \ + } \ + } else { \ + for(i = dest_x+w-1; i >= dest_x; i--) { \ + ((uint##BPP##_t*)client->frameBuffer)[j+i]=_buffer[j+i]; \ + } \ + } \ + } \ } \ } @@ -1262,6 +1283,10 @@ HandleRFBServerMessage(rfbClient* client) client->SoftCursorLockArea(client, cr.srcX, cr.srcY, rect.r.w, rect.r.h); + if (client->GotCopyRect != NULL) { + client->GotCopyRect(client, cr.srcX, cr.srcY, rect.r.w, rect.r.h, + rect.r.x, rect.r.y); + } CopyRectangleFromRectangle(client, cr.srcX, cr.srcY, rect.r.w, rect.r.h, rect.r.x, rect.r.y); |