diff options
author | runge <runge> | 2006-07-28 20:28:16 +0000 |
---|---|---|
committer | runge <runge> | 2006-07-28 20:28:16 +0000 |
commit | 521f0338af52506e079a5075fbe9350904a67269 (patch) | |
tree | 42e67d78a1826f9c24520d52bcde91a9aaec2a2e /x11vnc/cursor.c | |
parent | 901729e3e04d13d0d7e701c6a6c014f4adc42ce6 (diff) | |
download | libtdevnc-521f0338af52506e079a5075fbe9350904a67269.tar.gz libtdevnc-521f0338af52506e079a5075fbe9350904a67269.zip |
x11vnc: -rotate option
Diffstat (limited to 'x11vnc/cursor.c')
-rw-r--r-- | x11vnc/cursor.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/x11vnc/cursor.c b/x11vnc/cursor.c index c0fe222..f014a98 100644 --- a/x11vnc/cursor.c +++ b/x11vnc/cursor.c @@ -82,6 +82,19 @@ static void curs_copy(cursor_info_t *dest, cursor_info_t *src) { dest->sy = src->sy; dest->reverse = src->reverse; dest->rfb = src->rfb; + + if (rotating && rotating_cursors && dest->data != NULL) { + int tx, ty; + rotate_curs(dest->data, src->data, src->wx, src->wy, 1); + rotate_curs(dest->mask, src->mask, src->wx, src->wy, 1); + rotate_coords(dest->sx, dest->sy, &tx, &ty, src->wx, src->wy); + dest->sx = tx; + dest->sy = ty; + if (! rotating_same) { + dest->wx = src->wy; + dest->wy = src->wx; + } + } } /* empty cursor */ @@ -1317,6 +1330,27 @@ static int get_xfixes_cursor(int init) { cursors[use]->rfb = NULL; } + if (rotating && rotating_cursors) { + char *dst; + int tx, ty; + int w = xfc->width; + int h = xfc->height; + + dst = (char *) malloc(w * h * 4); + rotate_curs(dst, (char *) xfc->pixels, w, h, 4); + + memcpy(xfc->pixels, dst, w * h * 4); + free(dst); + + rotate_coords(xfc->xhot, xfc->yhot, &tx, &ty, w, h); + xfc->xhot = tx; + xfc->yhot = ty; + if (! rotating_same) { + xfc->width = h; + xfc->height = w; + } + } + /* place cursor into our collection */ cursors[use]->rfb = pixels2curs(xfc->pixels, xfc->width, xfc->height, xfc->xhot, xfc->yhot, bpp/8); |