From 521f0338af52506e079a5075fbe9350904a67269 Mon Sep 17 00:00:00 2001 From: runge Date: Fri, 28 Jul 2006 20:28:16 +0000 Subject: x11vnc: -rotate option --- x11vnc/cursor.c | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) (limited to 'x11vnc/cursor.c') 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); -- cgit v1.2.3