x11vnc: -rotate option

pull/1/head
runge 18 years ago
parent 901729e3e0
commit 521f0338af

@ -30,9 +30,19 @@
# to reach the VNC server (e.g. your firewall requires a proxy). # to reach the VNC server (e.g. your firewall requires a proxy).
# For the "double proxy" case use -proxy host1:port1,host2:port2 # For the "double proxy" case use -proxy host1:port1,host2:port2
# #
# A couple other args (not related to certs):
#
# -alpha turn on cursor alphablending hack if you are using the
# enhanced tightvnc vncviewer.
#
# -grab turn on XGrabServer hack if you are using the enhanced tightvnc
# vncviewer (e.g. for fullscreen mode in some windowmanagers like
# fvwm that do not otherwise work in fullscreen mode)
#
# #
# set VNCVIEWERCMD to whatever vncviewer command you want to use: # set VNCVIEWERCMD to whatever vncviewer command you want to use:
# #
VNCIPCMD=${VNCVIEWERCMD:-vncip}
VNCVIEWERCMD=${VNCVIEWERCMD:-vncviewer} VNCVIEWERCMD=${VNCVIEWERCMD:-vncviewer}
# #
# Same for STUNNEL, e.g. /path/to/stunnel or stunnel4, etc. # Same for STUNNEL, e.g. /path/to/stunnel or stunnel4, etc.
@ -53,6 +63,8 @@ help() {
head -39 $0 | tail +2 head -39 $0 | tail +2
} }
gotalpha=""
# grab our cmdline options: # grab our cmdline options:
while [ "X$1" != "X" ] while [ "X$1" != "X" ]
do do
@ -63,6 +75,10 @@ do
;; ;;
"-proxy") shift; proxy="$1" "-proxy") shift; proxy="$1"
;; ;;
"-alpha") gotalpha=1
;;
"-grab") VNCVIEWER_GRAB_SERVER=1; export VNCVIEWER_GRAB_SERVER
;;
"-h"*) help; exit 0 "-h"*) help; exit 0
;; ;;
*) break *) break
@ -71,16 +87,26 @@ do
shift shift
done done
if [ "X$gotalpha" != "X1" ]; then
NO_ALPHABLEND=1
export NO_ALPHABLEND
fi
orig="$1" orig="$1"
shift shift
# play around with host:display port: # play around with host:display port:
if ! echo "$orig" | grep ':' > /dev/null; then if echo "$orig" | grep ':' > /dev/null; then
:
else
orig="$orig:0" orig="$orig:0"
fi fi
host=`echo "$orig" | awk -F: '{print $1}'` host=`echo "$orig" | awk -F: '{print $1}'`
disp=`echo "$orig" | awk -F: '{print $2}'` disp=`echo "$orig" | awk -F: '{print $2}'`
if [ "X$host" = "X" ]; then
host=localhost
fi
if [ $disp -lt 200 ]; then if [ $disp -lt 200 ]; then
port=`expr $disp + 5900` port=`expr $disp + 5900`
else else
@ -99,7 +125,9 @@ if [ "x$inuse" != "x" ]; then
try=5920 try=5920
while [ $try -lt 6000 ] while [ $try -lt 6000 ]
do do
if ! echo "$inuse" | grep -w $try > /dev/null; then if echo "$inuse" | grep -w $try > /dev/null; then
:
else
use=$try use=$try
break break
fi fi
@ -305,7 +333,7 @@ fi
if echo "$0" | grep vncip > /dev/null; then if echo "$0" | grep vncip > /dev/null; then
# hack for runge's special wrapper script vncip. # hack for runge's special wrapper script vncip.
vncip "$@" localhost:$n $VNCIPCMD "$@" localhost:$n
else else
$VNCVIEWERCMD "$@" localhost:$n $VNCVIEWERCMD "$@" localhost:$n
fi fi

@ -1,3 +1,7 @@
2006-07-28 Karl Runge <runge@karlrunge.com>
* ssl_vncviewer: remove some bashisms.
* x11vnc: -rotate option (e.g. handheld), fix FPE on tru64.
2006-07-17 Karl Runge <runge@karlrunge.com> 2006-07-17 Karl Runge <runge@karlrunge.com>
* x11vnc: enable --without-x builds for -rawfb only (NO_X11) * x11vnc: enable --without-x builds for -rawfb only (NO_X11)

File diff suppressed because it is too large Load Diff

@ -82,6 +82,19 @@ static void curs_copy(cursor_info_t *dest, cursor_info_t *src) {
dest->sy = src->sy; dest->sy = src->sy;
dest->reverse = src->reverse; dest->reverse = src->reverse;
dest->rfb = src->rfb; 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 */ /* empty cursor */
@ -1317,6 +1330,27 @@ static int get_xfixes_cursor(int init) {
cursors[use]->rfb = NULL; 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 */ /* place cursor into our collection */
cursors[use]->rfb = pixels2curs(xfc->pixels, xfc->width, cursors[use]->rfb = pixels2curs(xfc->pixels, xfc->width,
xfc->height, xfc->xhot, xfc->yhot, bpp/8); xfc->height, xfc->xhot, xfc->yhot, bpp/8);

@ -326,7 +326,7 @@ void print_help(int mode) {
" to the program location and in standard locations\n" " to the program location and in standard locations\n"
" (/usr/local/share/x11vnc/classes, etc). Under -ssl or\n" " (/usr/local/share/x11vnc/classes, etc). Under -ssl or\n"
" -stunnel the ssl classes subdirectory is sought.\n" " -stunnel the ssl classes subdirectory is sought.\n"
#ifndef REL8x #ifndef NO_SSL_OR_UNIXPW
"-http_ssl As -http, but force lookup for ssl classes subdir.\n" "-http_ssl As -http, but force lookup for ssl classes subdir.\n"
#endif #endif
"\n" "\n"
@ -458,7 +458,7 @@ void print_help(int mode) {
" and last line be \"__BEGIN_VIEWONLY__\" to have 2\n" " and last line be \"__BEGIN_VIEWONLY__\" to have 2\n"
" full-access passwords)\n" " full-access passwords)\n"
"\n" "\n"
#ifndef REL8x #ifndef NO_SSL_OR_UNIXPW
"-unixpw [list] Use Unix username and password authentication. x11vnc\n" "-unixpw [list] Use Unix username and password authentication. x11vnc\n"
" uses the su(1) program to verify the user's password.\n" " uses the su(1) program to verify the user's password.\n"
" [list] is an optional comma separated list of allowed\n" " [list] is an optional comma separated list of allowed\n"
@ -615,7 +615,7 @@ void print_help(int mode) {
" of the form XAUTHORITY=<file> or raw xauthority data for\n" " of the form XAUTHORITY=<file> or raw xauthority data for\n"
" the display (e.g. \"xauth extract - $DISPLAY\" output).\n" " the display (e.g. \"xauth extract - $DISPLAY\" output).\n"
"\n" "\n"
#ifndef REL8x #ifndef NO_SSL_OR_UNIXPW
" In the case of -unixpw (but not -unixpw_nis), then the\n" " In the case of -unixpw (but not -unixpw_nis), then the\n"
" above command is run as the user who just authenticated\n" " above command is run as the user who just authenticated\n"
" via the login and password prompt.\n" " via the login and password prompt.\n"
@ -624,8 +624,8 @@ void print_help(int mode) {
" can place a colon at the end of his username and\n" " can place a colon at the end of his username and\n"
" supply a few options: scale=, scale_cursor= (or sc=),\n" " supply a few options: scale=, scale_cursor= (or sc=),\n"
" solid (or so), id=, clear_mods (or cm), clear_keys\n" " solid (or so), id=, clear_mods (or cm), clear_keys\n"
" (or ck), repeat, speeds= (or sp=), or readtimeout=\n" " (or ck), repeat, speeds= (or sp=), readtimeout=\n"
" (or rd=) separated by commas if there is more than one.\n" " (or rd=), or rotate= (or ro=) separated by commas if there is more than one.\n"
" After the user logs in successfully, these options will\n" " After the user logs in successfully, these options will\n"
" be applied to the VNC screen. For example,\n" " be applied to the VNC screen. For example,\n"
"\n" "\n"
@ -682,7 +682,7 @@ void print_help(int mode) {
" the VNC client first attaches to since some VNC viewers\n" " the VNC client first attaches to since some VNC viewers\n"
" will not automatically adjust to a new framebuffer size.\n" " will not automatically adjust to a new framebuffer size.\n"
"\n" "\n"
#ifndef REL8x #ifndef NO_SSL_OR_UNIXPW
"-ssl [pem] Use the openssl library (www.openssl.org) to provide a\n" "-ssl [pem] Use the openssl library (www.openssl.org) to provide a\n"
" built-in encrypted SSL tunnel between VNC viewers and\n" " built-in encrypted SSL tunnel between VNC viewers and\n"
" x11vnc. This requires libssl support to be compiled\n" " x11vnc. This requires libssl support to be compiled\n"
@ -1450,6 +1450,38 @@ void print_help(int mode) {
" encoding, and then resize the framebuffer. \"exit\"\n" " encoding, and then resize the framebuffer. \"exit\"\n"
" means disconnect all viewer clients, and then terminate\n" " means disconnect all viewer clients, and then terminate\n"
" x11vnc.\n" " x11vnc.\n"
"\n"
"-rotate string Rotate and/or flip the framebuffer view exported by VNC.\n"
" This transformation is independent of XRANDR and is\n"
" done in software in main memory and so may be slower.\n"
" This mode could be useful on a handheld with portrait or\n"
" landscape modes that do not correspond to the scanline\n"
" order of the actual framebuffer. \"string\" can be:\n"
"\n"
" x flip along x-axis\n"
" y flip along y-axis\n"
" xy flip along x- and y-axes\n"
" +90 rotate 90 degrees clockwise\n"
" -90 rotate 90 degrees counter-clockwise\n"
" +90x rotate 90 degrees CW, then flip along x\n"
" +90y rotate 90 degrees CW, then flip along y\n"
"\n"
" these give all possible rotations and reflections.\n"
"\n"
" Aliases: same as xy: yx, +180, -180, 180\n"
" same as -90: +270, 270\n"
" same as +90: 90, (ditto for 90x, 90y)\n"
"\n"
" Like -scale, this transformation is applied at the very\n"
" end of any chain of framebuffer transformations and so\n"
" any options with geometries, e.g. -blackout, -clip, etc.\n"
" are relative to the original X (or -rawfb) framebuffer,\n"
" not the final one sent to VNC viewers.\n"
"\n"
" If you do not want the cursor shape to be rotated\n"
" prefix \"string\" with \"nc:\", e.g. \"nc:+90\",\n"
" \"nc:xy\", etc.\n"
"\n"
"-padgeom WxH Whenever a new vncviewer connects, the framebuffer is\n" "-padgeom WxH Whenever a new vncviewer connects, the framebuffer is\n"
" replaced with a fake, solid black one of geometry WxH.\n" " replaced with a fake, solid black one of geometry WxH.\n"
" Shortly afterwards the framebuffer is replaced with the\n" " Shortly afterwards the framebuffer is replaced with the\n"
@ -2565,7 +2597,7 @@ void print_help(int mode) {
"\n" "\n"
" If you do not want x11vnc to guess the framebuffer's\n" " If you do not want x11vnc to guess the framebuffer's\n"
" WxHxB and masks automatically (sometimes the kernel\n" " WxHxB and masks automatically (sometimes the kernel\n"
" given inaccurate information), specify them with a\n" " gives inaccurate information), specify them with a\n"
" @WxHxB at the end of the string.\n" " @WxHxB at the end of the string.\n"
"\n" "\n"
" Examples:\n" " Examples:\n"
@ -2923,6 +2955,7 @@ void print_help(int mode) {
" xrandr enable -xrandr mode. (if applicable)\n" " xrandr enable -xrandr mode. (if applicable)\n"
" noxrandr disable -xrandr mode.\n" " noxrandr disable -xrandr mode.\n"
" xrandr_mode:mode set the -xrandr mode to \"mode\".\n" " xrandr_mode:mode set the -xrandr mode to \"mode\".\n"
" rotate:mode set the -rotate mode to \"mode\".\n"
" padgeom:WxH set -padgeom to WxH (empty to disable)\n" " padgeom:WxH set -padgeom to WxH (empty to disable)\n"
" If WxH is \"force\" or \"do\" the padded\n" " If WxH is \"force\" or \"do\" the padded\n"
" geometry fb is immediately applied.\n" " geometry fb is immediately applied.\n"
@ -3126,7 +3159,7 @@ void print_help(int mode) {
" listen lookup nolookup accept afteraccept gone shm\n" " listen lookup nolookup accept afteraccept gone shm\n"
" noshm flipbyteorder noflipbyteorder onetile noonetile\n" " noshm flipbyteorder noflipbyteorder onetile noonetile\n"
" solid_color solid nosolid blackout xinerama noxinerama\n" " solid_color solid nosolid blackout xinerama noxinerama\n"
" xtrap noxtrap xrandr noxrandr xrandr_mode padgeom\n" " xtrap noxtrap xrandr noxrandr xrandr_mode rotate padgeom\n"
" quiet q noquiet modtweak nomodtweak xkb noxkb capslock\n" " quiet q noquiet modtweak nomodtweak xkb noxkb capslock\n"
" nocapslock skip_lockkeys noskip_lockkeys skip_keycodes\n" " nocapslock skip_lockkeys noskip_lockkeys skip_keycodes\n"
" sloppy_keys nosloppy_keys skip_dups noskip_dups\n" " sloppy_keys nosloppy_keys skip_dups noskip_dups\n"
@ -3149,9 +3182,9 @@ void print_help(int mode) {
" nograbkbd grabptr nograbptr client_input speeds wmdt\n" " nograbkbd grabptr nograbptr client_input speeds wmdt\n"
" debug_pointer dp nodebug_pointer nodp debug_keyboard\n" " debug_pointer dp nodebug_pointer nodp debug_keyboard\n"
" dk nodebug_keyboard nodk deferupdate defer wait_ui\n" " dk nodebug_keyboard nodk deferupdate defer wait_ui\n"
" wait_bog nowait_bog slow_fb wait readtimeout nap\n" " wait_bog nowait_bog slow_fb wait readtimeout nap nonap\n"
" nonap sb screen_blank fbpm nofbpm fs gaps grow\n" " sb screen_blank fbpm nofbpm fs gaps grow fuzz snapfb\n"
" fuzz snapfb nosnapfb rawfb uinput_accel uinput_reset\n" " nosnapfb rawfb uinput_accel uinput_thresh uinput_reset\n"
" uinput_always progressive rfbport http nohttp httpport\n" " uinput_always progressive rfbport http nohttp httpport\n"
" httpdir enablehttpproxy noenablehttpproxy alwaysshared\n" " httpdir enablehttpproxy noenablehttpproxy alwaysshared\n"
" noalwaysshared nevershared noalwaysshared dontdisconnect\n" " noalwaysshared nevershared noalwaysshared dontdisconnect\n"

@ -42,4 +42,13 @@
#define MAX_BUTTONS 5 #define MAX_BUTTONS 5
#define ROTATE_NONE 0
#define ROTATE_X 1
#define ROTATE_Y 2
#define ROTATE_XY 3
#define ROTATE_90 4
#define ROTATE_90X 5
#define ROTATE_90Y 6
#define ROTATE_270 7
#endif /* _X11VNC_PARAMS_H */ #endif /* _X11VNC_PARAMS_H */

@ -646,6 +646,10 @@ void pointer(int mask, int x, int y, rfbClientPtr client) {
return; return;
} }
if (rotating) {
rotate_coords_inverse(x, y, &x, &y, -1, -1);
}
if (scaling) { if (scaling) {
/* map from rfb size to X11 size: */ /* map from rfb size to X11 size: */
x = ((double) x / scaled_x) * dpy_x; x = ((double) x / scaled_x) * dpy_x;

@ -536,7 +536,7 @@ if (db) fprintf(stderr, "dt3 calc: num rects req: %d/%d mod: %d/%d "
} else if (got_t3 == 2) { } else if (got_t3 == 2) {
dt3 = dts[1]; dt3 = dts[1];
} else { } else {
if (dts[2] >= 0.0) { if (dts[2] > 0.0) {
double rat = dts[1]/dts[2]; double rat = dts[1]/dts[2];
if (rat > 0.5 && rat < 2.0) { if (rat > 0.5 && rat < 2.0) {
dt3 = dts[1]+dts[2]; dt3 = dts[1]+dts[2];

@ -1897,6 +1897,20 @@ char *process_remote_cmd(char *cmd, int stringonly) {
rfbLog("remote_cmd: XRANDR ext. not present.\n"); rfbLog("remote_cmd: XRANDR ext. not present.\n");
} }
} else if (strstr(p, "rotate") == p) {
COLON_CHECK("rotate:")
if (query) {
snprintf(buf, bufn, "ans=%s%s%s", p, co,
NONUL(rotating_str));
goto qry;
}
p += strlen("rotate:");
if (rotating_str) free(rotating_str);
rotating_str = strdup(p);
rfbLog("remote_cmd: set rotate to \"%s\"\n", rotating_str);
do_new_fb(0);
} else if (strstr(p, "padgeom") == p) { } else if (strstr(p, "padgeom") == p) {
COLON_CHECK("padgeom:") COLON_CHECK("padgeom:")
if (query) { if (query) {
@ -4035,7 +4049,7 @@ char *process_remote_cmd(char *cmd, int stringonly) {
snprintf(buf, bufn, "aro=%s:%d", p, no_external_cmds); snprintf(buf, bufn, "aro=%s:%d", p, no_external_cmds);
} else if (!strcmp(p, "passwdfile")) { } else if (!strcmp(p, "passwdfile")) {
snprintf(buf, bufn, "aro=%s:%s", p, NONUL(passwdfile)); snprintf(buf, bufn, "aro=%s:%s", p, NONUL(passwdfile));
#ifndef REL8x #ifndef NO_SSL_OR_UNIXPW
} else if (!strcmp(p, "unixpw")) { } else if (!strcmp(p, "unixpw")) {
snprintf(buf, bufn, "aro=%s:%d", p, unixpw); snprintf(buf, bufn, "aro=%s:%d", p, unixpw);
} else if (!strcmp(p, "unixpw_nis")) { } else if (!strcmp(p, "unixpw_nis")) {

@ -1181,9 +1181,78 @@ void scale_rect(double factor, int blend, int interpolate, int Bpp,
} }
} }
/*
Framebuffers data flow:
General case:
-------- -------- -------- --------
----- |8to24_fb| |main_fb | |snap_fb | | X |
|rfbfb| <== | | <== | | <== | | <== | Server |
----- -------- -------- -------- --------
(to vnc) (optional) (usu = rfbfb) (optional) (read only)
8to24_fb mode will create side fbs: poll24_fb and poll8_fb for
bookkeepping the different regions (merged into 8to24_fb).
Normal case:
-------- --------
|main_fb | | X |
|= rfb_fb| <== | Server |
-------- --------
Scaling case:
-------- --------
----- |main_fb | | X |
|rfbfb| <== | | <== | Server |
----- -------- --------
Webcam/video case:
-------- -------- --------
|main_fb | |snap_fb | | Video |
| | <== | | <== | device |
-------- -------- --------
If we ever do a -rr rotation/reflection tran, it probably should
be done after any scaling (need a rr_fb for intermediate results)
-rr option: transformation:
none x -> x;
y -> y;
x x -> w - x - 1;
y -> y;
y x -> x;
x -> h - y - 1;
xy x -> w - x - 1;
y -> h - y - 1;
+90 x -> h - y - 1;
y -> x;
+90x x -> y;
y -> x;
+90y x -> h - y - 1;
y -> w - x - 1;
-90 x -> y;
y -> w - x - 1;
some aliases:
xy: yx, +180, -180, 180
+90: 90
+90x: 90x
+90y: 90y
-90: +270, 270
*/
void scale_and_mark_rect(int X1, int Y1, int X2, int Y2) { void scale_and_mark_rect(int X1, int Y1, int X2, int Y2) {
char *src_fb = main_fb; char *dst_fb, *src_fb = main_fb;
int Bpp = bpp/8, fac = 1; int dst_bpl, Bpp = bpp/8, fac = 1;
if (!screen || !rfb_fb || !main_fb) { if (!screen || !rfb_fb || !main_fb) {
return; return;
@ -1213,10 +1282,309 @@ void scale_and_mark_rect(int X1, int Y1, int X2, int Y2) {
fac = 4; fac = 4;
} }
} }
dst_fb = rfb_fb;
dst_bpl = rfb_bytes_per_line;
scale_rect(scale_fac, scaling_blend, scaling_interpolate, fac * Bpp, scale_rect(scale_fac, scaling_blend, scaling_interpolate, fac * Bpp,
src_fb, fac * main_bytes_per_line, rfb_fb, rfb_bytes_per_line, src_fb, fac * main_bytes_per_line, dst_fb, dst_bpl, dpy_x, dpy_y,
dpy_x, dpy_y, scaled_x, scaled_y, X1, Y1, X2, Y2, 1); scaled_x, scaled_y, X1, Y1, X2, Y2, 1);
}
void rotate_coords(int x, int y, int *xo, int *yo, int dxi, int dyi) {
int xi = x, yi = y;
int Dx, Dy;
if (dxi >= 0) {
Dx = dxi;
Dy = dyi;
} else if (scaling) {
Dx = scaled_x;
Dy = scaled_y;
} else {
Dx = dpy_x;
Dy = dpy_y;
}
if (rotating == ROTATE_NONE) {
*xo = xi;
*yo = yi;
} else if (rotating == ROTATE_X) {
*xo = Dx - xi - 1;
*yo = yi;
} else if (rotating == ROTATE_Y) {
*xo = xi;
*yo = Dy - yi - 1;
} else if (rotating == ROTATE_XY) {
*xo = Dx - xi - 1;
*yo = Dy - yi - 1;
} else if (rotating == ROTATE_90) {
*xo = Dy - yi - 1;
*yo = xi;
} else if (rotating == ROTATE_90X) {
*xo = yi;
*yo = xi;
} else if (rotating == ROTATE_90Y) {
*xo = Dy - yi - 1;
*yo = Dx - xi - 1;
} else if (rotating == ROTATE_270) {
*xo = yi;
*yo = Dx - xi - 1;
}
}
void rotate_coords_inverse(int x, int y, int *xo, int *yo, int dxi, int dyi) {
int xi = x, yi = y;
int Dx, Dy;
if (dxi >= 0) {
Dx = dxi;
Dy = dyi;
} else if (scaling) {
Dx = scaled_x;
Dy = scaled_y;
} else {
Dx = dpy_x;
Dy = dpy_y;
}
if (! rotating_same) {
int t = Dx;
Dx = Dy;
Dy = t;
}
if (rotating == ROTATE_NONE) {
*xo = xi;
*yo = yi;
} else if (rotating == ROTATE_X) {
*xo = Dx - xi - 1;
*yo = yi;
} else if (rotating == ROTATE_Y) {
*xo = xi;
*yo = Dy - yi - 1;
} else if (rotating == ROTATE_XY) {
*xo = Dx - xi - 1;
*yo = Dy - yi - 1;
} else if (rotating == ROTATE_90) {
*xo = yi;
*yo = Dx - xi - 1;
} else if (rotating == ROTATE_90X) {
*xo = yi;
*yo = xi;
} else if (rotating == ROTATE_90Y) {
*xo = Dy - yi - 1;
*yo = Dx - xi - 1;
} else if (rotating == ROTATE_270) {
*xo = Dy - yi - 1;
*yo = xi;
}
}
/* unroll the Bpp loop to be used in each case: */
#define ROT_COPY \
src = src_0 + fbl*y + Bpp*x; \
dst = dst_0 + rbl*yn + Bpp*xn; \
if (Bpp == 1) { \
*(dst) = *(src); \
} else if (Bpp == 2) { \
*(dst+0) = *(src+0); \
*(dst+1) = *(src+1); \
} else if (Bpp == 3) { \
*(dst+0) = *(src+0); \
*(dst+1) = *(src+1); \
*(dst+2) = *(src+2); \
} else if (Bpp == 4) { \
*(dst+0) = *(src+0); \
*(dst+1) = *(src+1); \
*(dst+2) = *(src+2); \
*(dst+3) = *(src+3); \
}
void rotate_fb(int x1, int y1, int x2, int y2) {
int x, y, xn, yn, r_x1, r_y1, r_x2, r_y2, Bpp = bpp/8;
int fbl = rfb_bytes_per_line;
int rbl = rot_bytes_per_line;
int Dx, Dy;
char *src, *dst;
char *src_0 = rfb_fb;
char *dst_0 = rot_fb;
if (! rotating || ! rot_fb) {
return;
}
if (scaling) {
Dx = scaled_x;
Dy = scaled_y;
} else {
Dx = dpy_x;
Dy = dpy_y;
}
rotate_coords(x1, y1, &r_x1, &r_y1, -1, -1);
rotate_coords(x2, y2, &r_x2, &r_y2, -1, -1);
dst = rot_fb;
if (rotating == ROTATE_X) {
for (y = y1; y < y2; y++) {
for (x = x1; x < x2; x++) {
xn = Dx - x - 1;
yn = y;
ROT_COPY
}
}
} else if (rotating == ROTATE_Y) {
for (y = y1; y < y2; y++) {
for (x = x1; x < x2; x++) {
xn = x;
yn = Dy - y - 1;
ROT_COPY
}
}
} else if (rotating == ROTATE_XY) {
for (y = y1; y < y2; y++) {
for (x = x1; x < x2; x++) {
xn = Dx - x - 1;
yn = Dy - y - 1;
ROT_COPY
}
}
} else if (rotating == ROTATE_90) {
for (y = y1; y < y2; y++) {
for (x = x1; x < x2; x++) {
xn = Dy - y - 1;
yn = x;
ROT_COPY
}
}
} else if (rotating == ROTATE_90X) {
for (y = y1; y < y2; y++) {
for (x = x1; x < x2; x++) {
xn = y;
yn = x;
ROT_COPY
}
}
} else if (rotating == ROTATE_90Y) {
for (y = y1; y < y2; y++) {
for (x = x1; x < x2; x++) {
xn = Dy - y - 1;
yn = Dx - x - 1;
ROT_COPY
}
}
} else if (rotating == ROTATE_270) {
for (y = y1; y < y2; y++) {
for (x = x1; x < x2; x++) {
xn = y;
yn = Dx - x - 1;
ROT_COPY
}
}
}
}
void rotate_curs(char *dst_0, char *src_0, int Dx, int Dy, int Bpp) {
int x, y, xn, yn;
char *src, *dst;
int fbl, rbl;
if (! rotating) {
return;
}
fbl = Dx * Bpp;
if (rotating_same) {
rbl = Dx * Bpp;
} else {
rbl = Dy * Bpp;
}
if (rotating == ROTATE_X) {
for (y = 0; y < Dy; y++) {
for (x = 0; x < Dx; x++) {
xn = Dx - x - 1;
yn = y;
ROT_COPY
if (0) fprintf(stderr, "rcurs: %d %d %d %d\n", x, y, xn, yn);
}
}
} else if (rotating == ROTATE_Y) {
for (y = 0; y < Dy; y++) {
for (x = 0; x < Dx; x++) {
xn = x;
yn = Dy - y - 1;
ROT_COPY
}
}
} else if (rotating == ROTATE_XY) {
for (y = 0; y < Dy; y++) {
for (x = 0; x < Dx; x++) {
xn = Dx - x - 1;
yn = Dy - y - 1;
ROT_COPY
}
}
} else if (rotating == ROTATE_90) {
for (y = 0; y < Dy; y++) {
for (x = 0; x < Dx; x++) {
xn = Dy - y - 1;
yn = x;
ROT_COPY
}
}
} else if (rotating == ROTATE_90X) {
for (y = 0; y < Dy; y++) {
for (x = 0; x < Dx; x++) {
xn = y;
yn = x;
ROT_COPY
}
}
} else if (rotating == ROTATE_90Y) {
for (y = 0; y < Dy; y++) {
for (x = 0; x < Dx; x++) {
xn = Dy - y - 1;
yn = Dx - x - 1;
ROT_COPY
}
}
} else if (rotating == ROTATE_270) {
for (y = 0; y < Dy; y++) {
for (x = 0; x < Dx; x++) {
xn = y;
yn = Dx - x - 1;
ROT_COPY
}
}
}
}
void mark_wrapper(int x1, int y1, int x2, int y2) {
int t, r_x1 = x1, r_y1 = y1, r_x2 = x2, r_y2 = y2;
if (rotating) {
/* well we hope rot_fb will always be the last one... */
rotate_coords(x1, y1, &r_x1, &r_y1, -1, -1);
rotate_coords(x2, y2, &r_x2, &r_y2, -1, -1);
rotate_fb(x1, y1, x2, y2);
if (r_x1 > r_x2) {
t = r_x1;
r_x1 = r_x2;
r_x2 = t;
}
if (r_y1 > r_y2) {
t = r_y1;
r_y1 = r_y2;
r_y2 = t;
}
/* painting errors */
r_x1--;
r_x2++;
r_y1--;
r_y2++;
}
rfbMarkRectAsModified(screen, r_x1, r_y1, r_x2, r_y2);
} }
void mark_rect_as_modified(int x1, int y1, int x2, int y2, int force) { void mark_rect_as_modified(int x1, int y1, int x2, int y2, int force) {
@ -1243,8 +1611,9 @@ void mark_rect_as_modified(int x1, int y1, int x2, int y2, int force) {
} }
} }
if (rfb_fb == main_fb || force) { if (rfb_fb == main_fb || force) {
rfbMarkRectAsModified(screen, x1, y1, x2, y2); mark_wrapper(x1, y1, x2, y2);
return; return;
} }
@ -1255,7 +1624,7 @@ void mark_rect_as_modified(int x1, int y1, int x2, int y2, int force) {
if (scaling) { if (scaling) {
scale_and_mark_rect(x1, y1, x2, y2); scale_and_mark_rect(x1, y1, x2, y2);
} else { } else {
rfbMarkRectAsModified(screen, x1, y1, x2, y2); mark_wrapper(x1, y1, x2, y2);
} }
} }

@ -29,12 +29,13 @@ void set_colormap(int reset);
void set_nofb_params(int restore); void set_nofb_params(int restore);
void set_raw_fb_params(int restore); void set_raw_fb_params(int restore);
void do_new_fb(int reset_mem); void do_new_fb(int reset_mem);
void free_old_fb(char *old_main, char *old_rfb, char *old_8to24, char *old_snap_fb); void free_old_fb(void);
void check_padded_fb(void); void check_padded_fb(void);
void install_padded_fb(char *geom); void install_padded_fb(char *geom);
XImage *initialize_xdisplay_fb(void); XImage *initialize_xdisplay_fb(void);
void parse_scale_string(char *str, double *factor, int *scaling, int *blend, void parse_scale_string(char *str, double *factor, int *scaling, int *blend,
int *nomult4, int *pad, int *interpolate, int *numer, int *denom); int *nomult4, int *pad, int *interpolate, int *numer, int *denom);
int parse_rotate_string(char *str, int *mode);
int scale_round(int len, double fac); int scale_round(int len, double fac);
void initialize_screen(int *argc, char **argv, XImage *fb); void initialize_screen(int *argc, char **argv, XImage *fb);
void set_vnc_desktop_name(void); void set_vnc_desktop_name(void);
@ -657,24 +658,34 @@ static void nofb_hook(rfbClientPtr cl) {
screen->displayHook = NULL; screen->displayHook = NULL;
} }
void free_old_fb(char *old_main, char *old_rfb, char *old_8to24, char *old_snap_fb) { void free_old_fb(void) {
if (old_main) { char *fbs[16];
free(old_main); int i, j, nfb = 0, db = 0;
}
if (old_rfb) { fbs[nfb++] = main_fb; main_fb = NULL;
if (old_rfb != old_main) { fbs[nfb++] = rfb_fb; rfb_fb = NULL;
free(old_rfb); fbs[nfb++] = cmap8to24_fb; cmap8to24_fb = NULL;
fbs[nfb++] = snap_fb; snap_fb = NULL;
fbs[nfb++] = rot_fb; rot_fb = NULL;
fbs[nfb++] = raw_fb; raw_fb = NULL;
for (i=0; i < nfb; i++) {
char *fb = fbs[i];
int freeit = 1;
if (! fb || fb < (char *) 0x10) {
continue;
} }
} for (j=0; j < i; j++) {
if (old_8to24) { if (fb == fbs[j]) {
if (old_8to24 != old_main && old_8to24 != old_rfb) { freeit = 0;
free(old_8to24); break;
}
} }
} if (freeit) {
if (old_snap_fb) { if (db) fprintf(stderr, "free: %i %p\n", i, fb);
if (old_snap_fb != old_main && old_snap_fb != old_rfb && free(fb);
old_snap_fb != old_8to24) { } else {
free(old_snap_fb); if (db) fprintf(stderr, "skip: %i %p\n", i, fb);
} }
} }
} }
@ -694,15 +705,7 @@ void do_new_fb(int reset_mem) {
free_tiles(); free_tiles();
} }
free_old_fb(main_fb, rfb_fb, cmap8to24_fb, snap_fb); free_old_fb();
if (raw_fb == main_fb || raw_fb == rfb_fb) {
raw_fb = NULL;
}
main_fb = NULL;
rfb_fb = NULL;
cmap8to24_fb = NULL;
snap_fb = NULL;
fb = initialize_xdisplay_fb(); fb = initialize_xdisplay_fb();
@ -1766,6 +1769,35 @@ void parse_scale_string(char *str, double *factor, int *scaling, int *blend,
free(tstr); free(tstr);
} }
int parse_rotate_string(char *str, int *mode) {
int m = ROTATE_NONE;
if (str == NULL || !strcmp(str, "") || !strcmp(str, "0")) {
m = ROTATE_NONE;
} else if (!strcmp(str, "x")) {
m = ROTATE_X;
} else if (!strcmp(str, "y")) {
m = ROTATE_Y;
} else if (!strcmp(str, "xy") || !strcmp(str, "yx") ||
!strcmp(str,"+180") || !strcmp(str,"-180") || !strcmp(str,"180")) {
m = ROTATE_XY;
} else if (!strcmp(str, "+90") || !strcmp(str, "90")) {
m = ROTATE_90;
} else if (!strcmp(str, "+90x") || !strcmp(str, "90x")) {
m = ROTATE_90X;
} else if (!strcmp(str, "+90y") || !strcmp(str, "90y")) {
m = ROTATE_90Y;
} else if (!strcmp(str, "-90") || !strcmp(str, "270") ||
!strcmp(str, "+270")) {
m = ROTATE_270;
} else {
rfbLog("invalid -rotate mode: %s\n", str);
}
if (mode) {
*mode = m;
}
return m;
}
int scale_round(int len, double fac) { int scale_round(int len, double fac) {
double eps = 0.000001; double eps = 0.000001;
@ -1837,6 +1869,28 @@ static void setup_scaling(int *width_in, int *height_in) {
} }
} }
static void setup_rotating(void) {
char *rs = rotating_str;
rotating_cursors = 1;
if (rs && strstr(rs, "nc:") == rs) {
rs += strlen("nc:");
rotating_cursors = 0;
}
rotating = parse_rotate_string(rs, NULL);
if (! rotating) {
rotating_cursors = 0;
}
if (rotating == ROTATE_90 || rotating == ROTATE_90X ||
rotating == ROTATE_90Y || rotating == ROTATE_270) {
rotating_same = 0;
} else {
rotating_same = 1;
}
}
/* /*
* initialize the rfb framebuffer/screen * initialize the rfb framebuffer/screen
*/ */
@ -1892,8 +1946,27 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
rfb_bytes_per_line = main_bytes_per_line; rfb_bytes_per_line = main_bytes_per_line;
} }
setup_rotating();
if (rotating) {
if (! rotating_same) {
int t, b = main_bytes_per_line / fb->width;
if (scaling) {
rot_bytes_per_line = b * height;
} else {
rot_bytes_per_line = b * fb->height;
}
t = width;
width = height; /* The big swap... */
height = t;
} else {
rot_bytes_per_line = rfb_bytes_per_line;
}
}
if (cmap8to24 && depth == 8) { if (cmap8to24 && depth == 8) {
rfb_bytes_per_line *= 4; rfb_bytes_per_line *= 4;
rot_bytes_per_line *= 4;
} }
/* /*
@ -1965,7 +2038,11 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
} }
/* set up format from scratch: */ /* set up format from scratch: */
screen->paddedWidthInBytes = rfb_bytes_per_line; if (rotating && ! rotating_same) {
screen->paddedWidthInBytes = rot_bytes_per_line;
} else {
screen->paddedWidthInBytes = rfb_bytes_per_line;
}
screen->serverFormat.bitsPerPixel = fb_bpp; screen->serverFormat.bitsPerPixel = fb_bpp;
screen->serverFormat.depth = fb_depth; screen->serverFormat.depth = fb_depth;
screen->serverFormat.trueColour = TRUE; screen->serverFormat.trueColour = TRUE;
@ -2155,6 +2232,8 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
main_bytes_per_line); main_bytes_per_line);
fprintf(stderr, " rfb_fb_bytes_per_line: %d\n", fprintf(stderr, " rfb_fb_bytes_per_line: %d\n",
rfb_bytes_per_line); rfb_bytes_per_line);
fprintf(stderr, " rot_fb_bytes_per_line: %d\n",
rot_bytes_per_line);
switch(fb->format) { switch(fb->format) {
case XYBitmap: case XYBitmap:
fprintf(stderr, " format: XYBitmap\n"); break; fprintf(stderr, " format: XYBitmap\n"); break;
@ -2201,11 +2280,13 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
main_fb = NULL; main_fb = NULL;
rfb_fb = main_fb; rfb_fb = main_fb;
cmap8to24_fb = NULL; cmap8to24_fb = NULL;
rot_fb = NULL;
screen->displayHook = nofb_hook; screen->displayHook = nofb_hook;
} else { } else {
main_fb = fb->data; main_fb = fb->data;
rfb_fb = NULL; rfb_fb = NULL;
cmap8to24_fb = NULL; cmap8to24_fb = NULL;
rot_fb = NULL;
if (cmap8to24) { if (cmap8to24) {
int n = main_bytes_per_line * fb->height; int n = main_bytes_per_line * fb->height;
@ -2215,20 +2296,39 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
cmap8to24_fb = (char *) malloc(n); cmap8to24_fb = (char *) malloc(n);
memset(cmap8to24_fb, 0, n); memset(cmap8to24_fb, 0, n);
} }
if (rotating) {
int n = rot_bytes_per_line * height;
rot_fb = (char *) malloc(n);
memset(rot_fb, 0, n);
}
if (scaling) { if (scaling) {
rfb_fb = (char *) malloc(rfb_bytes_per_line * height); int n = rfb_bytes_per_line * height;
memset(rfb_fb, 0, rfb_bytes_per_line * height);
if (rotating && ! rotating_same) {
n = rot_bytes_per_line * height;
}
rfb_fb = (char *) malloc(n);
memset(rfb_fb, 0, n);
} else if (cmap8to24) { } else if (cmap8to24) {
rfb_fb = cmap8to24_fb; rfb_fb = cmap8to24_fb;
} else { } else {
rfb_fb = main_fb; rfb_fb = main_fb;
} }
} }
screen->frameBuffer = rfb_fb; if (rot_fb) {
screen->frameBuffer = rot_fb;
} else {
screen->frameBuffer = rfb_fb;
}
if (!quiet) { if (!quiet) {
fprintf(stderr, " rfb_fb: %p\n", rfb_fb); fprintf(stderr, " rfb_fb: %p\n", rfb_fb);
fprintf(stderr, " main_fb: %p\n", main_fb); fprintf(stderr, " main_fb: %p\n", main_fb);
fprintf(stderr, " 8to24_fb: %p\n", cmap8to24_fb); fprintf(stderr, " 8to24_fb: %p\n", cmap8to24_fb);
fprintf(stderr, " rot_fb: %p\n", rot_fb);
fprintf(stderr, " snap_fb: %p\n", snap_fb); fprintf(stderr, " snap_fb: %p\n", snap_fb);
fprintf(stderr, " raw_fb: %p\n", raw_fb); fprintf(stderr, " raw_fb: %p\n", raw_fb);
fprintf(stderr, " fake_fb: %p\n", fake_fb); fprintf(stderr, " fake_fb: %p\n", fake_fb);
@ -2241,7 +2341,7 @@ void initialize_screen(int *argc, char **argv, XImage *fb) {
setup_cursors_and_push(); setup_cursors_and_push();
if (scaling || cmap8to24) { if (scaling || rotating || cmap8to24) {
mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0); mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0);
} }

@ -10,13 +10,14 @@ extern void set_colormap(int reset);
extern void set_nofb_params(int restore); extern void set_nofb_params(int restore);
extern void set_raw_fb_params(int restore); extern void set_raw_fb_params(int restore);
extern void do_new_fb(int reset_mem); extern void do_new_fb(int reset_mem);
extern void free_old_fb(char *old_main, char *old_rfb, char *old_8to24, char *old_snap_fb); extern void free_old_fb(void);
extern void check_padded_fb(void); extern void check_padded_fb(void);
extern void install_padded_fb(char *geom); extern void install_padded_fb(char *geom);
extern XImage *initialize_xdisplay_fb(void); extern XImage *initialize_xdisplay_fb(void);
extern XImage *initialize_raw_fb(int); extern XImage *initialize_raw_fb(int);
extern void parse_scale_string(char *str, double *factor, int *scaling, int *blend, extern void parse_scale_string(char *str, double *factor, int *scaling, int *blend,
int *nomult4, int *pad, int *interpolate, int *numer, int *denom); int *nomult4, int *pad, int *interpolate, int *numer, int *denom);
extern int parse_rotate_string(char *str, int *mode);
extern int scale_round(int len, double fac); extern int scale_round(int len, double fac);
extern void initialize_screen(int *argc, char **argv, XImage *fb); extern void initialize_screen(int *argc, char **argv, XImage *fb);
extern void set_vnc_desktop_name(void); extern void set_vnc_desktop_name(void);

@ -673,7 +673,13 @@ char *guess_desktop(void) {
if (prop != None) return "gnome"; if (prop != None) return "gnome";
prop = XInternAtom(dpy, "KWIN_RUNNING", True); prop = XInternAtom(dpy, "KWIN_RUNNING", True);
if (prop != None) return "kde"; if (prop != None) {
prop = XInternAtom(dpy, "_KDE_RUNNING", True);
if (prop != None) {
prop = XInternAtom(dpy, "KDE_DESKTOP_WINDOW", True);
if (prop != None) return "kde";
}
}
prop = XInternAtom(dpy, "_MOTIF_WM_INFO", True); prop = XInternAtom(dpy, "_MOTIF_WM_INFO", True);
if (prop != None) { if (prop != None) {

@ -15,7 +15,7 @@
#endif #endif
#endif #endif
#ifdef REL8x #ifdef NO_SSL_OR_UNIXPW
#undef SSLCMDS #undef SSLCMDS
#endif #endif

@ -20,7 +20,7 @@
#endif #endif
#endif #endif
#ifdef REL8x #ifdef NO_SSL_OR_UNIXPW
#undef FORK_OK #undef FORK_OK
#undef LIBVNCSERVER_HAVE_LIBSSL #undef LIBVNCSERVER_HAVE_LIBSSL
#define LIBVNCSERVER_HAVE_LIBSSL 0 #define LIBVNCSERVER_HAVE_LIBSSL 0
@ -923,14 +923,7 @@ static void lose_ram(void) {
* without doing exec(). we really should re-exec, but a pain * without doing exec(). we really should re-exec, but a pain
* to redo all SSL ctx. * to redo all SSL ctx.
*/ */
free_old_fb(main_fb, rfb_fb, cmap8to24_fb, snap_fb); free_old_fb();
if (raw_fb == main_fb || raw_fb == rfb_fb) {
raw_fb = NULL;
}
main_fb = NULL;
rfb_fb = NULL;
cmap8to24_fb = NULL;
snap_fb = NULL;
free_tiles(); free_tiles();
} }
@ -1406,6 +1399,8 @@ void accept_openssl(int mode) {
int f_in = fileno(stdin); int f_in = fileno(stdin);
int f_out = fileno(stdout); int f_out = fileno(stdout);
if (db) fprintf(stderr, "helper pid in: %d %d %d %d\n", f_in, f_out, sock, listen);
/* reset all handlers to default (no interrupted() calls) */ /* reset all handlers to default (no interrupted() calls) */
unset_signals(); unset_signals();
@ -1442,6 +1437,7 @@ void accept_openssl(int mode) {
" back to: %d\n", getpid(), cport); " back to: %d\n", getpid(), cport);
exit(1); exit(1);
} }
if (db) fprintf(stderr, "vncsock %d\n", vncsock);
/* try to initialize SSL with the remote client */ /* try to initialize SSL with the remote client */
@ -2370,10 +2366,9 @@ static void init_prng(void) {
void raw_xfer(int csock, int s_in, int s_out) { void raw_xfer(int csock, int s_in, int s_out) {
char buf[8192]; char buf[8192];
int sz = 8192, n, m, status; int sz = 8192, n, m, status, db = 1;
#ifdef FORK_OK #ifdef FORK_OK
pid_t pid = fork(); pid_t pid = fork();
int db = 1;
/* this is for testing, no SSL just socket redir */ /* this is for testing, no SSL just socket redir */
if (pid < 0) { if (pid < 0) {
@ -2389,7 +2384,7 @@ void raw_xfer(int csock, int s_in, int s_out) {
} else if (n > 0) { } else if (n > 0) {
int len = n; int len = n;
char *src = buf; char *src = buf;
if (db > 1) write(2, buf, n); if (db > 1) write(2, buf, n);
while (len > 0) { while (len > 0) {
m = write(s_out, src, len); m = write(s_out, src, len);
if (m > 0) { if (m > 0) {
@ -2400,7 +2395,7 @@ if (db > 1) write(2, buf, n);
if (m < 0 && (errno == EINTR || errno == EAGAIN)) { if (m < 0 && (errno == EINTR || errno == EAGAIN)) {
continue; continue;
} }
if (db) fprintf(stderr, "raw_xfer bad write: %d -> %d | %d/%d errno=%d\n", csock, s_out, m, n, errno); if (db) fprintf(stderr, "raw_xfer bad write: %d -> %d | %d/%d errno=%d\n", csock, s_out, m, n, errno);
break; break;
} }
} }
@ -2419,7 +2414,7 @@ if (db > 1) write(2, buf, n);
} else if (n > 0) { } else if (n > 0) {
int len = n; int len = n;
char *src = buf; char *src = buf;
if (db > 1) write(2, buf, n); if (db > 1) write(2, buf, n);
while (len > 0) { while (len > 0) {
m = write(csock, src, len); m = write(csock, src, len);
if (m > 0) { if (m > 0) {
@ -2441,6 +2436,6 @@ if (db > 1) write(2, buf, n);
close(csock); close(csock);
close(s_in); close(s_in);
close(s_out); close(s_out);
#endif #endif /* FORK_OK */
} }

@ -166,6 +166,7 @@ Screen
=GAL ResizeRotate:: =GAL ResizeRotate::
= xrandr = xrandr
=-C:resize,newfbsize,exit xrandr_mode: =-C:resize,newfbsize,exit xrandr_mode:
rotate:
padgeom: padgeom:
=GAL LOFF =GAL LOFF
=GAL Clipping:: =GAL Clipping::

@ -177,6 +177,7 @@ char gui_code[] = "";
" =GAL ResizeRotate::\n" " =GAL ResizeRotate::\n"
" = xrandr\n" " = xrandr\n"
" =-C:resize,newfbsize,exit xrandr_mode:\n" " =-C:resize,newfbsize,exit xrandr_mode:\n"
" rotate:\n"
" padgeom:\n" " padgeom:\n"
" =GAL LOFF\n" " =GAL LOFF\n"
" =GAL Clipping::\n" " =GAL Clipping::\n"

@ -51,7 +51,7 @@ extern char *crypt(const char*, const char *);
#define IS_BSD #define IS_BSD
#endif #endif
#ifdef REL8x #ifdef NO_SSL_OR_UNIXPW
#undef UNIXPW_SU #undef UNIXPW_SU
#undef UNIXPW_CRYPT #undef UNIXPW_CRYPT
#endif #endif
@ -117,6 +117,9 @@ static int text_y(void) {
return char_y + char_row * char_h; return char_y + char_row * char_h;
} }
static rfbScreenInfo fscreen;
static rfbScreenInfoPtr pscreen;
void unixpw_screen(int init) { void unixpw_screen(int init) {
if (unixpw_nis) { if (unixpw_nis) {
#ifndef UNIXPW_CRYPT #ifndef UNIXPW_CRYPT
@ -143,9 +146,20 @@ void unixpw_screen(int init) {
if (scaling) { if (scaling) {
x = (int) (x * scale_fac); x = (int) (x * scale_fac);
y = (int) (y * scale_fac); y = (int) (y * scale_fac);
x = nfix(x, scaled_x);
y = nfix(y, scaled_y);
}
if (rotating) {
fscreen.serverFormat.bitsPerPixel = bpp;
fscreen.paddedWidthInBytes = rfb_bytes_per_line;
fscreen.frameBuffer = rfb_fb;
pscreen = &fscreen;
} else {
pscreen = screen;
} }
rfbDrawString(screen, &default8x16Font, x, y, log, white()); rfbDrawString(pscreen, &default8x16Font, x, y, log, white());
char_x = x; char_x = x;
char_y = y; char_y = y;
@ -156,7 +170,7 @@ void unixpw_screen(int init) {
} }
if (scaling) { if (scaling) {
mark_rect_as_modified(0, 0, dpy_x, dpy_y, 1); mark_rect_as_modified(0, 0, scaled_x, scaled_y, 1);
} else { } else {
mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0); mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0);
} }
@ -895,18 +909,18 @@ if (db) fprintf(stderr, "unixpw_verify: '%s' '%s'\n", user, db > 1 ? pass : "***
x = text_x(); x = text_x();
y = text_y(); y = text_y();
rfbDrawString(screen, &default8x16Font, x, y, li, white()); rfbDrawString(pscreen, &default8x16Font, x, y, li, white());
char_row += 2; char_row += 2;
x = text_x(); x = text_x();
y = text_y(); y = text_y();
rfbDrawString(screen, &default8x16Font, x, y, log, white()); rfbDrawString(pscreen, &default8x16Font, x, y, log, white());
char_col = strlen(log); char_col = strlen(log);
if (scaling) { if (scaling) {
mark_rect_as_modified(0, 0, dpy_x, dpy_y, 1); mark_rect_as_modified(0, 0, scaled_x, scaled_y, 1);
} else { } else {
mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0); mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0);
} }
@ -927,7 +941,7 @@ static void set_db(void) {
void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) { void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
int x, y, i, nmax = 100; int x, y, i, nmax = 100;
static char user[100], pass[100]; static char user_r[100], user[100], pass[100];
static int u_cnt = 0, p_cnt = 0, first = 1; static int u_cnt = 0, p_cnt = 0, first = 1;
char keystr[100]; char keystr[100];
char *str; char *str;
@ -935,6 +949,9 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
if (first) { if (first) {
set_db(); set_db();
first = 0; first = 0;
for (i=0; i < nmax; i++) {
user_r[i] = '\0';
}
} }
if (init) { if (init) {
@ -1006,6 +1023,9 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
int w2 = char_w / scale_fac; int w2 = char_w / scale_fac;
int h2 = char_h / scale_fac; int h2 = char_h / scale_fac;
x2 = nfix(x2, dpy_x);
y2 = nfix(y2, dpy_y);
zero_fb(x2 - w2, y2 - h2, x2, y2); zero_fb(x2 - w2, y2 - h2, x2, y2);
mark_rect_as_modified(x2 - w2, mark_rect_as_modified(x2 - w2,
y2 - h2, x2, y2, 0); y2 - h2, x2, y2, 0);
@ -1038,17 +1058,42 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
x = text_x(); x = text_x();
y = text_y(); y = text_y();
rfbDrawString(screen, &default8x16Font, x, y, pw, rfbDrawString(pscreen, &default8x16Font, x, y, pw,
white()); white());
char_col = strlen(pw); char_col = strlen(pw);
if (scaling) { if (scaling) {
mark_rect_as_modified(0, 0, dpy_x, dpy_y, 1); mark_rect_as_modified(0, 0, scaled_x,
scaled_y, 1);
} else { } else {
mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0); mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0);
} }
return; return;
} }
if (u_cnt == 0 && keysym == XK_Up) {
/*
* Allow user to hit Up arrow at beginning to
* regain their username plus any options.
*/
int i;
for (i=0; i < nmax; i++) {
user[u_cnt++] = user_r[i];
if (user_r[i] == '\0') {
break;
}
keystr[0] = (char) user_r[i];
keystr[1] = '\0';
x = text_x();
y = text_y();
rfbDrawString(pscreen, &default8x16Font, x, y,
keystr, white());
mark_rect_as_modified(x, y-char_h, x+char_w,
y, scaling);
char_col++;
usleep(10*1000);
}
return;
}
if (keysym <= ' ' || keysym >= 0x7f) { if (keysym <= ' ' || keysym >= 0x7f) {
return; return;
} }
@ -1066,6 +1111,9 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
user[u_cnt++] = keystr[0]; user[u_cnt++] = keystr[0];
#else #else
user[u_cnt++] = (char) keysym; user[u_cnt++] = (char) keysym;
for (i=0; i < nmax; i++) {
user_r[i] = user[i];
}
keystr[0] = (char) keysym; keystr[0] = (char) keysym;
#endif #endif
@ -1075,13 +1123,9 @@ void unixpw_keystroke(rfbBool down, rfbKeySym keysym, int init) {
if (db && db <= 2) fprintf(stderr, "u_cnt: %d %d/%d ks: 0x%x %s\n", u_cnt, x, y, keysym, keystr); if (db && db <= 2) fprintf(stderr, "u_cnt: %d %d/%d ks: 0x%x %s\n", u_cnt, x, y, keysym, keystr);
keystr[1] = '\0'; keystr[1] = '\0';
rfbDrawString(screen, &default8x16Font, x, y, keystr, white()); rfbDrawString(pscreen, &default8x16Font, x, y, keystr, white());
if (scaling) { mark_rect_as_modified(x, y-char_h, x+char_w, y, scaling);
mark_rect_as_modified(x, y-char_h, x+char_w, y, 1);
} else {
mark_rect_as_modified(x, y-char_h, x+char_w, y, 0);
}
char_col++; char_col++;
} else if (in_passwd) { } else if (in_passwd) {
@ -1272,9 +1316,9 @@ void unixpw_deny(void) {
x = char_x + char_col * char_w; x = char_x + char_col * char_w;
y = char_y + char_row * char_h; y = char_y + char_row * char_h;
rfbDrawString(screen, &default8x16Font, x, y, pd, white()); rfbDrawString(pscreen, &default8x16Font, x, y, pd, white());
if (scaling) { if (scaling) {
mark_rect_as_modified(0, 0, dpy_x, dpy_y, 1); mark_rect_as_modified(0, 0, scaled_x, scaled_y, 1);
} else { } else {
mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0); mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0);
} }
@ -1304,9 +1348,9 @@ void unixpw_msg(char *msg, int delay) {
x = char_x + char_col * char_w; x = char_x + char_col * char_w;
y = char_y + char_row * char_h; y = char_y + char_row * char_h;
rfbDrawString(screen, &default8x16Font, x, y, msg, white()); rfbDrawString(pscreen, &default8x16Font, x, y, msg, white());
if (scaling) { if (scaling) {
mark_rect_as_modified(0, 0, dpy_x, dpy_y, 1); mark_rect_as_modified(0, 0, scaled_x, scaled_y, 1);
} else { } else {
mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0); mark_rect_as_modified(0, 0, dpy_x, dpy_y, 0);
} }

@ -1041,6 +1041,7 @@ void user_supplied_opts(char *opts) {
"scale", "scale_cursor", "sc", "solid", "so", "id", "scale", "scale_cursor", "sc", "solid", "so", "id",
"clear_mods", "cm", "clear_keys", "ck", "repeat", "clear_mods", "cm", "clear_keys", "ck", "repeat",
"speeds", "sp", "readtimeout", "rd", "speeds", "sp", "readtimeout", "rd",
"rotate", "ro",
NULL NULL
}; };
@ -1089,6 +1090,11 @@ void user_supplied_opts(char *opts) {
if (scale_cursor_str) free(scale_cursor_str); if (scale_cursor_str) free(scale_cursor_str);
q = strchr(p, '=') + 1; q = strchr(p, '=') + 1;
scale_cursor_str = strdup(q); scale_cursor_str = strdup(q);
} else if (strstr(p, "rotate=") == p ||
strstr(p, "ro=") == p) {
if (rotating_str) free(rotating_str);
q = strchr(p, '=') + 1;
rotating_str = strdup(q);
} else if (!strcmp(p, "solid") || !strcmp(p, "so")) { } else if (!strcmp(p, "solid") || !strcmp(p, "so")) {
use_solid_bg = 1; use_solid_bg = 1;
if (!solid_str) { if (!solid_str) {

@ -1760,7 +1760,7 @@ static void do_copyregion(sraRegionPtr region, int dx, int dy) {
last_copyrect = dnow(); last_copyrect = dnow();
if (rfb_fb == main_fb) { if (rfb_fb == main_fb && ! rotating) {
/* normal case, no -scale or -8to24 */ /* normal case, no -scale or -8to24 */
get_client_regions(&req, &mod, &cpy, &ncli); get_client_regions(&req, &mod, &cpy, &ncli);
if (debug_scroll > 1) fprintf(stderr, "<<<-rfbDoCopyRect req: %d mod: %d cpy: %d\n", req, mod, cpy); if (debug_scroll > 1) fprintf(stderr, "<<<-rfbDoCopyRect req: %d mod: %d cpy: %d\n", req, mod, cpy);
@ -1777,7 +1777,7 @@ if (debug_scroll > 1) fprintf(stderr, ">>>-rfbDoCopyRect req: %d mod: %d cpy: %d
iter = sraRgnGetReverseIterator(region, dx < 0, dy < 0); iter = sraRgnGetReverseIterator(region, dx < 0, dy < 0);
while(sraRgnIteratorNext(iter, &rect)) { while(sraRgnIteratorNext(iter, &rect)) {
int j, c; int j, c, t;
x1 = rect.x1; x1 = rect.x1;
y1 = rect.y1; y1 = rect.y1;
@ -1825,6 +1825,7 @@ if (debug_scroll > 1) fprintf(stderr, ">>>-rfbDoCopyRect req: %d mod: %d cpy: %d
} }
} }
if (scaling) { if (scaling) {
sx1 = ((double) x1 / dpy_x) * scaled_x; sx1 = ((double) x1 / dpy_x) * scaled_x;
sy1 = ((double) y1 / dpy_y) * scaled_y; sy1 = ((double) y1 / dpy_y) * scaled_y;
@ -1840,6 +1841,46 @@ if (debug_scroll > 1) fprintf(stderr, ">>>-rfbDoCopyRect req: %d mod: %d cpy: %d
sdx = dx; sdx = dx;
sdy = dy; sdy = dy;
} }
if (0) fprintf(stderr, "s... %d %d %d %d %d %d\n", sx1, sy1, sx2, sy2, sdx, sdy);
if (rotating) {
rotate_coords(sx1, sy1, &sx1, &sy1, -1, -1);
rotate_coords(sx2, sy2, &sx2, &sy2, -1, -1);
if (rotating == ROTATE_X) {
sdx = -sdx;
} else if (rotating == ROTATE_Y) {
sdy = -sdy;
} else if (rotating == ROTATE_XY) {
sdx = -sdx;
sdy = -sdy;
} else if (rotating == ROTATE_90) {
t = sdx;
sdx = -sdy;
sdy = t;
} else if (rotating == ROTATE_90X) {
t = sdx;
sdx = sdy;
sdy = t;
} else if (rotating == ROTATE_90Y) {
t = sdx;
sdx = -sdy;
sdy = -t;
} else if (rotating == ROTATE_270) {
t = sdx;
sdx = sdy;
sdy = -t;
}
}
if (sx2 < sx1) {
t = sx1;
sx1 = sx2;
sx2 = t;
}
if (sy2 < sy1) {
t = sy1;
sy1 = sy2;
sy2 = t;
}
if (0) fprintf(stderr, "s... %d %d %d %d %d %d\n", sx1, sy1, sx2, sy2, sdx, sdy);
rfbDoCopyRect(screen, sx1, sy1, sx2, sy2, sdx, sdy); rfbDoCopyRect(screen, sx1, sy1, sx2, sy2, sdx, sdy);
} }

@ -2,7 +2,7 @@
.TH X11VNC "1" "July 2006" "x11vnc " "User Commands" .TH X11VNC "1" "July 2006" "x11vnc " "User Commands"
.SH NAME .SH NAME
x11vnc - allow VNC connections to real X11 displays x11vnc - allow VNC connections to real X11 displays
version: 0.8.3, lastmod: 2006-07-17 version: 0.8.3, lastmod: 2006-07-28
.SH SYNOPSIS .SH SYNOPSIS
.B x11vnc .B x11vnc
[OPTION]... [OPTION]...
@ -744,8 +744,8 @@ Also in the case of \fB-unixpw,\fR the user logging in
can place a colon at the end of his username and can place a colon at the end of his username and
supply a few options: scale=, scale_cursor= (or sc=), supply a few options: scale=, scale_cursor= (or sc=),
solid (or so), id=, clear_mods (or cm), clear_keys solid (or so), id=, clear_mods (or cm), clear_keys
(or ck), repeat, speeds= (or sp=), or readtimeout= (or ck), repeat, speeds= (or sp=), readtimeout=
(or rd=) separated by commas if there is more than one. (or rd=), or rotate= (or ro=) separated by commas if there is more than one.
After the user logs in successfully, these options will After the user logs in successfully, these options will
be applied to the VNC screen. For example, be applied to the VNC screen. For example,
.IP .IP
@ -1666,6 +1666,39 @@ encoding, and then resize the framebuffer. "exit"
means disconnect all viewer clients, and then terminate means disconnect all viewer clients, and then terminate
x11vnc. x11vnc.
.PP .PP
\fB-rotate\fR \fIstring\fR
.IP
Rotate and/or flip the framebuffer view exported by VNC.
This transformation is independent of XRANDR and is
done in software in main memory and so may be slower.
This mode could be useful on a handheld with portrait or
landscape modes that do not correspond to the scanline
order of the actual framebuffer. \fIstring\fR can be:
.IP
x flip along x-axis
y flip along y-axis
xy flip along x- and y-axes
+90 rotate 90 degrees clockwise
\fB-90\fR rotate 90 degrees counter-clockwise
+90x rotate 90 degrees CW, then flip along x
+90y rotate 90 degrees CW, then flip along y
.IP
these give all possible rotations and reflections.
.IP
Aliases: same as xy: yx, +180, \fB-180,\fR 180
same as \fB-90:\fR +270, 270
same as +90: 90, (ditto for 90x, 90y)
.IP
Like \fB-scale,\fR this transformation is applied at the very
end of any chain of framebuffer transformations and so
any options with geometries, e.g. \fB-blackout,\fR \fB-clip,\fR etc.
are relative to the original X (or \fB-rawfb)\fR framebuffer,
not the final one sent to VNC viewers.
.IP
If you do not want the cursor shape to be rotated
prefix \fIstring\fR with "nc:", e.g. "nc:+90",
"nc:xy", etc.
.PP
\fB-padgeom\fR \fIWxH\fR \fB-padgeom\fR \fIWxH\fR
.IP .IP
Whenever a new vncviewer connects, the framebuffer is Whenever a new vncviewer connects, the framebuffer is
@ -3024,7 +3057,7 @@ nonstandard, use "console:/dev/foofb"
.IP .IP
If you do not want x11vnc to guess the framebuffer's If you do not want x11vnc to guess the framebuffer's
WxHxB and masks automatically (sometimes the kernel WxHxB and masks automatically (sometimes the kernel
given inaccurate information), specify them with a gives inaccurate information), specify them with a
@WxHxB at the end of the string. @WxHxB at the end of the string.
.IP .IP
Examples: Examples:
@ -3460,6 +3493,8 @@ noxrandr disable \fB-xrandr\fR mode.
.IP .IP
xrandr_mode:mode set the \fB-xrandr\fR mode to "mode". xrandr_mode:mode set the \fB-xrandr\fR mode to "mode".
.IP .IP
rotate:mode set the \fB-rotate\fR mode to "mode".
.IP
padgeom:WxH set \fB-padgeom\fR to WxH (empty to disable) padgeom:WxH set \fB-padgeom\fR to WxH (empty to disable)
If WxH is "force" or "do" the padded If WxH is "force" or "do" the padded
geometry fb is immediately applied. geometry fb is immediately applied.
@ -3823,7 +3858,7 @@ unlock connect allowonce allow localhost nolocalhost
listen lookup nolookup accept afteraccept gone shm listen lookup nolookup accept afteraccept gone shm
noshm flipbyteorder noflipbyteorder onetile noonetile noshm flipbyteorder noflipbyteorder onetile noonetile
solid_color solid nosolid blackout xinerama noxinerama solid_color solid nosolid blackout xinerama noxinerama
xtrap noxtrap xrandr noxrandr xrandr_mode padgeom xtrap noxtrap xrandr noxrandr xrandr_mode rotate padgeom
quiet q noquiet modtweak nomodtweak xkb noxkb capslock quiet q noquiet modtweak nomodtweak xkb noxkb capslock
nocapslock skip_lockkeys noskip_lockkeys skip_keycodes nocapslock skip_lockkeys noskip_lockkeys skip_keycodes
sloppy_keys nosloppy_keys skip_dups noskip_dups sloppy_keys nosloppy_keys skip_dups noskip_dups
@ -3846,9 +3881,9 @@ pm input_skip allinput noallinput input grabkbd
nograbkbd grabptr nograbptr client_input speeds wmdt nograbkbd grabptr nograbptr client_input speeds wmdt
debug_pointer dp nodebug_pointer nodp debug_keyboard debug_pointer dp nodebug_pointer nodp debug_keyboard
dk nodebug_keyboard nodk deferupdate defer wait_ui dk nodebug_keyboard nodk deferupdate defer wait_ui
wait_bog nowait_bog slow_fb wait readtimeout nap wait_bog nowait_bog slow_fb wait readtimeout nap nonap
nonap sb screen_blank fbpm nofbpm fs gaps grow sb screen_blank fbpm nofbpm fs gaps grow fuzz snapfb
fuzz snapfb nosnapfb rawfb uinput_accel uinput_reset nosnapfb rawfb uinput_accel uinput_thresh uinput_reset
uinput_always progressive rfbport http nohttp httpport uinput_always progressive rfbport http nohttp httpport
httpdir enablehttpproxy noenablehttpproxy alwaysshared httpdir enablehttpproxy noenablehttpproxy alwaysshared
noalwaysshared nevershared noalwaysshared dontdisconnect noalwaysshared nevershared noalwaysshared dontdisconnect

@ -1642,7 +1642,7 @@ int main(int argc, char* argv[]) {
CHECK_ARGC CHECK_ARGC
passwdfile = strdup(argv[++i]); passwdfile = strdup(argv[++i]);
got_passwdfile = 1; got_passwdfile = 1;
#ifndef REL8x #ifndef NO_SSL_OR_UNIXPW
} else if (strstr(arg, "-unixpw") == arg) { } else if (strstr(arg, "-unixpw") == arg) {
unixpw = 1; unixpw = 1;
if (strstr(arg, "-unixpw_nis")) { if (strstr(arg, "-unixpw_nis")) {
@ -1826,6 +1826,9 @@ int main(int argc, char* argv[]) {
i++; i++;
} }
} }
} else if (!strcmp(arg, "-rotate")) {
CHECK_ARGC
rotating_str = strdup(argv[++i]);
} else if (!strcmp(arg, "-padgeom") } else if (!strcmp(arg, "-padgeom")
|| !strcmp(arg, "-padgeometry")) { || !strcmp(arg, "-padgeometry")) {
CHECK_ARGC CHECK_ARGC

@ -131,7 +131,7 @@
#define PASSWD_UNLESS_NOPW 0 #define PASSWD_UNLESS_NOPW 0
#endif #endif
#define noREL8x #define xxNO_SSL_OR_UNIXPW
/* /*
* Beginning of support for small binary footprint build for embedded * Beginning of support for small binary footprint build for embedded
@ -386,6 +386,7 @@ extern char *rfb_fb; /* same as main_fb unless transformation */
extern char *fake_fb; /* used under -padgeom */ extern char *fake_fb; /* used under -padgeom */
extern char *snap_fb; /* used under -snapfb */ extern char *snap_fb; /* used under -snapfb */
extern char *cmap8to24_fb; /* used under -8to24 */ extern char *cmap8to24_fb; /* used under -8to24 */
extern char *rot_fb; /* used under -rotate */
extern char *raw_fb; extern char *raw_fb;
extern char *raw_fb_addr; extern char *raw_fb_addr;
extern int raw_fb_offset; extern int raw_fb_offset;
@ -397,6 +398,7 @@ extern int raw_fb_back_to_X;
extern int rfb_bytes_per_line; extern int rfb_bytes_per_line;
extern int main_bytes_per_line; extern int main_bytes_per_line;
extern int rot_bytes_per_line;
extern unsigned long main_red_mask, main_green_mask, main_blue_mask; extern unsigned long main_red_mask, main_green_mask, main_blue_mask;
extern unsigned short main_red_max, main_green_max, main_blue_max; extern unsigned short main_red_max, main_green_max, main_blue_max;
extern unsigned short main_red_shift, main_green_shift, main_blue_shift; extern unsigned short main_red_shift, main_green_shift, main_blue_shift;
@ -411,6 +413,10 @@ extern int scaling_pad; /* pad out scaled sizes to fit denominator */
extern int scaling_interpolate; /* use interpolation scheme when shrinking */ extern int scaling_interpolate; /* use interpolation scheme when shrinking */
extern int scaled_x, scaled_y; /* dimensions of scaled display */ extern int scaled_x, scaled_y; /* dimensions of scaled display */
extern int scale_numer, scale_denom; /* n/m */ extern int scale_numer, scale_denom; /* n/m */
extern char *rotating_str;
extern int rotating;
extern int rotating_same;
extern int rotating_cursors;
/* scale cursor */ /* scale cursor */
extern char *scale_cursor_str; extern char *scale_cursor_str;

@ -15,7 +15,7 @@ int xtrap_base_event_type = 0;
int xdamage_base_event_type = 0; int xdamage_base_event_type = 0;
/* date +'lastmod: %Y-%m-%d' */ /* date +'lastmod: %Y-%m-%d' */
char lastmod[] = "0.8.3 lastmod: 2006-07-17"; char lastmod[] = "0.8.3 lastmod: 2006-07-28";
/* X display info */ /* X display info */
@ -59,6 +59,7 @@ char *rfb_fb = NULL; /* same as main_fb unless transformation */
char *fake_fb = NULL; /* used under -padgeom */ char *fake_fb = NULL; /* used under -padgeom */
char *snap_fb = NULL; /* used under -snapfb */ char *snap_fb = NULL; /* used under -snapfb */
char *cmap8to24_fb = NULL; /* used under -8to24 */ char *cmap8to24_fb = NULL; /* used under -8to24 */
char *rot_fb = NULL;
char *raw_fb = NULL; /* when used should be main_fb */ char *raw_fb = NULL; /* when used should be main_fb */
char *raw_fb_addr = NULL; char *raw_fb_addr = NULL;
int raw_fb_offset = 0; int raw_fb_offset = 0;
@ -70,6 +71,7 @@ int raw_fb_back_to_X = 0; /* kludge for testing rawfb -> X */
int rfb_bytes_per_line = 0; int rfb_bytes_per_line = 0;
int main_bytes_per_line = 0; int main_bytes_per_line = 0;
int rot_bytes_per_line = 0;
unsigned long main_red_mask = 0, main_green_mask = 0, main_blue_mask = 0; unsigned long main_red_mask = 0, main_green_mask = 0, main_blue_mask = 0;
unsigned short main_red_max = 0, main_green_max = 0, main_blue_max = 0; unsigned short main_red_max = 0, main_green_max = 0, main_blue_max = 0;
unsigned short main_red_shift = 0, main_green_shift = 0, main_blue_shift = 0; unsigned short main_red_shift = 0, main_green_shift = 0, main_blue_shift = 0;
@ -84,6 +86,10 @@ int scaling_pad = 0; /* pad out scaled sizes to fit denominator */
int scaling_interpolate = 0; /* use interpolation scheme when shrinking */ int scaling_interpolate = 0; /* use interpolation scheme when shrinking */
int scaled_x = 0, scaled_y = 0; /* dimensions of scaled display */ int scaled_x = 0, scaled_y = 0; /* dimensions of scaled display */
int scale_numer = 0, scale_denom = 0; /* n/m */ int scale_numer = 0, scale_denom = 0; /* n/m */
char *rotating_str = NULL;
int rotating = 0;
int rotating_same = 0;
int rotating_cursors = 0;
/* scale cursor */ /* scale cursor */
char *scale_cursor_str = NULL; char *scale_cursor_str = NULL;

Loading…
Cancel
Save