add cursor alphablending to rfb.h cursor.c, x11vnc -alphablend -snapfb etc..

pull/1/head
runge 20 years ago
parent 336d7dad1d
commit b58e460fac

@ -1,3 +1,10 @@
2005-01-15 Karl Runge <runge@karlrunge.com>
* rfb/rfb.h: add alphaSource and alphaPreMultiplied to rfbCursor.
* libvncserver/cursor.c: do cursor alpha blending in rfbDrawCursor()
for non-cursorshapeupdates clients.
* x11vnc: -alphablend, cursors fixes, -snapfb, more tweaks and bug
fixes.
2004-12-27 Karl Runge <runge@karlrunge.com>
* x11vnc: improve alpha channel handling for XFIXES cursors.
* add more parameters to remote control.

@ -310,6 +310,8 @@ void rfbFreeCursor(rfbCursorPtr cursor)
if(cursor) {
if(cursor->cleanupRichSource && cursor->richSource)
free(cursor->richSource);
if(cursor->cleanupRichSource && cursor->alphaSource)
free(cursor->alphaSource);
if(cursor->cleanupSource && cursor->source)
free(cursor->source);
if(cursor->cleanupMask && cursor->mask)
@ -320,6 +322,7 @@ void rfbFreeCursor(rfbCursorPtr cursor)
cursor->cleanup=cursor->cleanupSource=cursor->cleanupMask
=cursor->cleanupRichSource=FALSE;
cursor->source=cursor->mask=cursor->richSource=0;
cursor->alphaSource=0;
}
}
@ -489,12 +492,84 @@ void rfbDrawCursor(rfbScreenInfoPtr s)
if(!c->richSource)
rfbMakeRichCursorFromXCursor(s,c);
/* now the cursor has to be drawn */
for(j=0;j<y2;j++)
for(i=0;i<x2;i++)
if((c->mask[(j+j1)*w+(i+i1)/8]<<((i+i1)&7))&0x80)
memcpy(s->frameBuffer+(j+y1)*rowstride+(i+x1)*bpp,
c->richSource+(j+j1)*c->width*bpp+(i+i1)*bpp,bpp);
if (c->alphaSource) {
int rmax, rshift;
int gmax, gshift;
int bmax, bshift;
int amax = 255; /* alphaSource is always 8bits of info per pixel */
unsigned long rmask, gmask, bmask;
rmax = s->serverFormat.redMax;
gmax = s->serverFormat.greenMax;
bmax = s->serverFormat.blueMax;
rshift = s->serverFormat.redShift;
gshift = s->serverFormat.greenShift;
bshift = s->serverFormat.blueShift;
rmask = (rmax << rshift);
gmask = (gmax << gshift);
bmask = (bmax << bshift);
for(j=0;j<y2;j++) {
for(i=0;i<x2;i++) {
/*
* we loop over the whole cursor ignoring c->mask[],
* using the extracted alpha value instead.
*/
char *dest, *src, *aptr;
unsigned long val, *dv, *sv;
int rdst, gdst, bdst; /* fb RGB */
int asrc, rsrc, gsrc, bsrc; /* rich source ARGB */
dest = s->frameBuffer + (j+y1)*rowstride + (i+x1)*bpp;
src = c->richSource + (j+j1)*c->width*bpp + (i+i1)*bpp;
aptr = c->alphaSource + (j+j1)*c->width + (i+i1);
dv = (unsigned long *)dest;
sv = (unsigned long *)src;
asrc = *((unsigned char *)aptr);
if (!asrc) {
continue;
}
/* extract dest and src RGB */
rdst = (*dv & rmask) >> rshift; /* fb */
gdst = (*dv & gmask) >> gshift;
bdst = (*dv & bmask) >> bshift;
rsrc = (*sv & rmask) >> rshift; /* richcursor */
gsrc = (*sv & gmask) >> gshift;
bsrc = (*sv & bmask) >> bshift;
/* blend in fb data. */
if (! c->alphaPreMultiplied) {
rsrc = (asrc * rsrc)/amax;
gsrc = (asrc * gsrc)/amax;
bsrc = (asrc * bsrc)/amax;
}
rdst = rsrc + ((amax - asrc) * rdst)/amax;
gdst = gsrc + ((amax - asrc) * gdst)/amax;
bdst = bsrc + ((amax - asrc) * bdst)/amax;
val = 0;
val |= (rdst << rshift);
val |= (gdst << gshift);
val |= (bdst << bshift);
/* insert the cooked pixel into the fb */
memcpy(dest, &val, bpp);
}
}
} else {
/* now the cursor has to be drawn */
for(j=0;j<y2;j++)
for(i=0;i<x2;i++)
if((c->mask[(j+j1)*w+(i+i1)/8]<<((i+i1)&7))&0x80)
memcpy(s->frameBuffer+(j+y1)*rowstride+(i+x1)*bpp,
c->richSource+(j+j1)*c->width*bpp+(i+i1)*bpp,bpp);
}
if(wasChanged)
rfbMarkRectAsModified(s,x1,y1,x1+x2,y1+y2);

@ -664,6 +664,8 @@ typedef struct rfbCursor {
unsigned short foreRed, foreGreen, foreBlue; /* device-independent colour */
unsigned short backRed, backGreen, backBlue; /* device-independent colour */
unsigned char *richSource; /* source bytes for a rich cursor */
unsigned char *alphaSource; /* source for alpha blending info */
rfbBool alphaPreMultiplied; /* if richSource already has alpha applied */
} rfbCursor, *rfbCursorPtr;
extern unsigned char rfbReverseByte[0x100];

@ -1,3 +1,12 @@
2005-01-15 Karl Runge <runge@karlrunge.com>
* adjust alpha blending parameters, -alphablend, handle 24bpp.
* add -snapfb snapshot fb, not clear how useful it is..
* more functions etc for -pointer_mode 4, still not finished.
* scan_for_updates() "count only" mode.
* increase max shm size on Linux.
* -oa -logappend, -pm, -speeds
* fix bugs in -allow, -R connect, screen == NULL
2004-12-27 Karl Runge <runge@karlrunge.com>
* allow -DLIBVNCSERVER_HAVE_FOO=0 override everything
* get_xfixes_cursor() try to more carefully convert alpha channel

File diff suppressed because it is too large Load Diff

@ -139,6 +139,7 @@ Keyboard
Pointer
=-C:none,arrow,X,some,most cursor:
noxfixes
alphablend
--
cursorpos
nocursorshape
@ -160,6 +161,7 @@ Misc
bg
=-C:ignore,exit sigpipe:
=0 inetd
rfbwait:
--
=RA remote-cmd:
=GA all-settings
@ -204,17 +206,19 @@ Permissions
unsafe
Tuning
=-C:1,2,3,4 pointer_mode:
=-C:0,1,2,3,4 pointer_mode:
input_skip:
nodragging
alphacut:
alphafrac:
alpharemove
--
=D noshm
flipbyteorder
onetile
--
alphacut:
alphafrac:
alpharemove
--
speeds:
wait:
defer:
nap
@ -224,9 +228,9 @@ Tuning
gaps:
grow:
fuzz:
snapfb
--
threads
rfbwait:
--
progressive:
"
@ -329,8 +333,7 @@ provides an interface to each of the many x11vnc command line options and
remote control commands. See \"Help -> all\" for much info about x11vnc.
Most menu items have a (?) button one can click on to get more information
about the option or command. In most cases it will be text extracted
from that in \"Help -> all\".
about the option or command.
There are two states tkx11vnc can be in:
@ -463,7 +466,7 @@ proc make_toplevel {w {title ""}} {
proc textwin {name title text} {
global max_text_height max_text_width
global bfont
global bfont ffont
set width [textwidth $text]
incr width
@ -481,9 +484,11 @@ proc textwin {name title text} {
frame $w.f -bd 0;
pack $w.f -fill both -expand 1
text $w.f.t -width $width -height $height -setgrid 1 -bd 2 \
-yscrollcommand "$w.f.y set" -relief ridge -font fixed;
-yscrollcommand "$w.f.y set" -relief ridge \
-font $ffont;
scrollbar $w.f.y -orient v -relief sunken -command "$w.f.t yview";
button $w.f.b -text "Dismiss" -command "destroy $w" -font $bfont
button $w.f.b -text "Dismiss" -command "destroy $w" -font $bfont \
-pady 2
$w.f.t insert 1.0 $text;
@ -909,121 +914,6 @@ proc entry_delete {} {
# Utilities for remote control and updating vars.
proc push_new_value0 {item name new {query 1}} {
# old way w/o -sync
global menu_var always_update remote_output query_output
global delay_sleep extra_sleep extra_sleep_split
set debug [in_debug_mode]
set do_query_all 0
set getout 0
if {$item == "remote-cmd"} {
# kludge for arbitrary remote command:
if {[regexp {^Q:} $new]} {
# extra kludge for Q:var to mean -Q var
regsub {^Q:} $new "" new
set qonly 1
} else {
set qonly 0
}
# need to extract item from new:
set qtmp $new
regsub {:.*$} $qtmp "" qtmp
if {! $qonly} {
set rargs [list "-R" "$new"]
set qargs [list "-Q" "$qtmp"]
set getout 1
} else {
set rargs [list "-Q" "$qtmp"]
set qargs [list "-Q" "$qtmp"]
}
} elseif {[value_is_string $item]} {
set rargs [list "-R" "$name:$new"]
set qargs [list "-Q" "$name"]
} else {
set rargs [list "-R" "$name"]
set qargs [list "-Q" "$name"]
}
if {!$debug} {
append_text "x11vnc $rargs ..."
}
set remote_output [run_remote_cmd $rargs]
if {[lindex $rargs 0] == "-Q"} {
append_text "\t$remote_output"
set getout 1
} elseif {! $query && ! $always_update} {
set getout 1
} elseif {$item == "noremote"} {
set getout 1
} elseif {[is_action $item] && ![opt_match Q $item] && $rargs != ""} {
set getout 1
} elseif {[regexp {^(sid|id)$} $item] && ![regexp {^0x} $new]} {
set getout 1
}
if {$getout} {
append_text "\n"
return
}
stop_watch on
after $delay_sleep
if {[opt_match D $item]} {
set s [expr $extra_sleep/$extra_sleep_split]
append_text " "
for {set i 0} {$i<$extra_sleep_split} {incr i} {
after $s
append_text "."
update
}
}
stop_watch off
if {!$debug} {
append_text ", -Q ..."
}
if {$item == "disconnect"} {
set new "N/A"
set do_query_all 1
}
if {$always_update || $do_query_all} {
set query [query_all 1]
} else {
set query [run_remote_cmd $qargs]
}
set query_output $query
if {![see_if_ok $query $item "$name:$new"]} {
# failed
if {[regexp {^a..=} $query]} {
# but some result came back
if {! $always_update} {
# synchronize everything
set query_output [query_all 1]
}
} else {
# server may be dead
if {$item != "ping" && $item != "attach"} {
try_connect
}
}
} else {
# succeeded
if {! $always_update} {
# synchronize this variable
update_menu_vars $query
} else {
# already done in query_all
}
}
}
proc push_new_value {item name new {query 1}} {
global menu_var always_update remote_output query_output
global delay_sleep extra_sleep extra_sleep_split
@ -1264,6 +1154,25 @@ proc see_if_ok {query item expected} {
} else {
set msg $found
}
if {!$ok && $found != ""} {
# check for floating point match:
set v1 ""
set v2 ""
regexp {:([0-9.][0-9.]*)$} $found m0 v1
regexp {:([0-9.][0-9.]*)$} $expected m0 v2
if {$v1 != "" && $v2 != ""} {
set diff ""
catch {set diff [expr "$v1 - $v2"]}
if {$diff != ""} {
if {$diff < 0} {
set diff [expr "0.0 - $diff"]
}
if {$diff < 0.00001} {
set ok 1
}
}
}
}
if {$ok} {
append_text "\tSet OK ($msg)\n"
return 1
@ -1272,6 +1181,12 @@ proc see_if_ok {query item expected} {
# e.g. blackout:+30x30+20+20
append_text "\t($msg)\n"
return 1
} elseif {[regexp {:[0-9]\.[0-9]} $expected]} {
append_text "\t($msg)\n"
return 1
} elseif {$item == "connect" || $item == "disconnect"} {
append_text "\t($msg)\n"
return 1
} else {
append_text "\t*FAILED* $msg\n"
return 0
@ -1298,13 +1213,14 @@ proc update_menu_vars {{query ""}} {
if {$val == "N/A"} {
continue
}
if {0 && $debug} {
puts "setting menuvar: $item: $old -> $val"
}
set menu_var($item) $val
}
if {$item == "clients"} {
update_clients_menu $val
} elseif {$item == "display"} {
set_x11_display $val
} elseif {$item == "vncdisplay"} {
set_vnc_display $val
}
}
}
@ -1329,6 +1245,7 @@ proc clear_all {} {
}
}
}
append_text "Cleared all settings.\n"
}
proc all_query_vars {} {
@ -1813,10 +1730,10 @@ proc update_clients_and_repost {} {
}
proc update_clients_menu {list} {
global item_cascade
global item_cascade ffont
set subm $item_cascade(current);
catch {destroy $subm}
menu $subm -tearoff 0
menu $subm -tearoff 0 -font $ffont
$subm add command
$subm add command -label "refresh-list" -command "update_clients_and_repost"
$subm add separator
@ -1866,14 +1783,14 @@ proc make_widgets {} {
global text_area
global entry_box entry_str entry_set entry_label entry_ok entry_browse
global entry_help entry_skip
global bfont
global bfont ffont
global helptext helpremote helplabel
set label_width 80
set info_label .info
label $info_label -textvariable info_str -bd 2 -relief groove \
-anchor w -width $label_width
-anchor w -width $label_width -font $ffont
pack $info_label -side top -fill x -expand 0
# Extract the Rows:
@ -1989,11 +1906,13 @@ proc make_widgets {} {
} elseif {$item == "Quit"} {
# Quit item must shut us down:
$m add command -label "$item" -underline 0 \
-font $ffont \
-command {destroy .; exit 0}
} elseif {$case == "Help"} {
# Help is simple help:
$m add command -label "$item" \
-font $ffont \
-command "menu_help $item"
} elseif {$item == "current"} {
@ -2002,11 +1921,13 @@ proc make_widgets {} {
set item_cascade($item) $subm
update_clients_menu ""
$m add cascade -label "$item" \
-font $ffont \
-menu $subm
} elseif {[is_action $item]} {
# Action
$m add command -label "$item" \
-font $ffont \
-command "do_var $item"
set menu_var($item) ""; # for convenience
@ -2015,19 +1936,22 @@ proc make_widgets {} {
if {[regexp -- {-C:(.*)} $item_opts($item) m0 m1]} {
# Radiobutton select
set subm $m.cascade$menu_count($case)
menu $subm -tearoff 0
menu $subm -tearoff 0 -font $ffont
foreach val [split $m1 ","] {
$subm add radiobutton -label "$val" \
-command "do_var $item" \
-value "$val" \
-font $ffont \
-variable menu_var($item)
}
$m add cascade -label "$item" \
-font $ffont \
-menu $subm
set item_cascade($item) $subm
} else {
# Arbitrary_string
$m add command -label "$item" \
-font $ffont \
-command "do_var $item"
}
set mvar 1
@ -2036,6 +1960,7 @@ proc make_widgets {} {
# Boolean
$m add checkbutton -label "$item" \
-command "do_var $item" \
-font $ffont \
-variable menu_var($item)
set menu_var($item) 0
}
@ -2069,6 +1994,7 @@ proc make_widgets {} {
set str "(?)"
}
$m add command -label $str \
-font $ffont \
-command "menu_help $label";
if {$str == ""} {
@ -2094,17 +2020,19 @@ proc make_widgets {} {
no_x11_display
set lw [expr {$label_width / 2}]
label $df_x11 -textvariable x11_display -width $lw -anchor w
label $df_x11 -textvariable x11_display -width $lw -anchor w \
-font $ffont
set df_vnc "$df.vdisplay"
no_vnc_display
label $df_vnc -textvariable vnc_display -width $lw -anchor w
label $df_vnc -textvariable vnc_display -width $lw -anchor w \
-font $ffont
pack $df_x11 $df_vnc -side left
pack $df -side top -fill x
# text area
text .text -height 11 -relief ridge
text .text -height 11 -relief ridge -font $ffont
set text_area .text
pack .text -side top -fill both -expand 1
@ -2122,28 +2050,35 @@ proc make_widgets {} {
set entry_str "Set... : "
set ef_entry "$ef.entry"
entry $ef_entry -relief sunken
entry $ef_entry -relief sunken -font $ffont
bind $ef_entry <KeyPress-Return> {set entry_set 1}
bind $ef_entry <KeyPress-Escape> {set entry_set 0}
# Entry OK button
set bpx "1m"
set bpy "1"
set hlt "0"
set ef_ok "$ef.ok"
button $ef_ok -text OK -pady 1 -command {set entry_set 1} \
button $ef_ok -text OK -pady $bpy -padx $bpx -command {set entry_set 1} \
-highlightthickness $hlt \
-font $bfont
# Entry Skip button
set ef_skip "$ef.skip"
button $ef_skip -text Skip -pady 0 -command {set entry_set 0} \
button $ef_skip -text Skip -pady $bpy -padx $bpx -command {set entry_set 0} \
-highlightthickness $hlt \
-font $bfont
# Entry Help button
set ef_help "$ef.help"
button $ef_help -text Help -pady 0 -command \
{menu_help $entry_dialog_item} -font $bfont
button $ef_help -text Help -pady $bpy -padx $bpx -command \
{menu_help $entry_dialog_item} -font $bfont \
-highlightthickness $hlt
# Entry Browse button
set ef_browse "$ef.browse"
button $ef_browse -text "Browse..." -pady 0 -font $bfont \
button $ef_browse -text "Browse..." -pady $bpy -padx $bpx -font $bfont \
-highlightthickness $hlt \
-command {entry_insert [tk_getOpenFile]}
pack $ef_label -side left
@ -2316,6 +2251,9 @@ proc get_start_x11vnc_cmd {{show_rc 0}} {
if {$item == "id"} {
set saw_id 1
}
if {$item == "httpport" && $menu_var($item) == "0"} {
continue
}
if {$item == "progressive" && $menu_var($item) == "0"} {
continue
}
@ -2519,7 +2457,7 @@ global helpall helptext helpremote helplabel hostname;
global all_settings reply_xdisplay always_update
global max_text_height max_text_width
global menu_var unset_str menus_disabled
global bfont old_labels
global bfont ffont old_labels
global connected_to_x11vnc
global delay_sleep extra_sleep extra_sleep_split
global cache_all_query_vars
@ -2529,7 +2467,8 @@ set connected_to_x11vnc 0
set menus_disabled 0
set max_text_height 40
set max_text_width 90
set bfont -adobe-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*;
set bfont "-adobe-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*"
set ffont "fixed"
set help_indent 24;
set reply_xdisplay ""
set all_settings "None so far."

@ -145,6 +145,7 @@
"Pointer\n"
" =-C:none,arrow,X,some,most cursor:\n"
" noxfixes\n"
" alphablend\n"
" --\n"
" cursorpos\n"
" nocursorshape\n"
@ -166,6 +167,7 @@
" bg\n"
" =-C:ignore,exit sigpipe:\n"
" =0 inetd\n"
" rfbwait:\n"
" --\n"
" =RA remote-cmd:\n"
" =GA all-settings\n"
@ -210,17 +212,19 @@
" unsafe\n"
"\n"
"Tuning\n"
" =-C:1,2,3,4 pointer_mode:\n"
" =-C:0,1,2,3,4 pointer_mode:\n"
" input_skip:\n"
" nodragging\n"
" alphacut:\n"
" alphafrac:\n"
" alpharemove\n"
" --\n"
" =D noshm\n"
" flipbyteorder\n"
" onetile\n"
" --\n"
" alphacut:\n"
" alphafrac:\n"
" alpharemove\n"
" --\n"
" speeds:\n"
" wait:\n"
" defer:\n"
" nap\n"
@ -230,9 +234,9 @@
" gaps:\n"
" grow:\n"
" fuzz:\n"
" snapfb\n"
" --\n"
" threads\n"
" rfbwait:\n"
" --\n"
" progressive:\n"
"\"\n"
@ -335,8 +339,7 @@
"remote control commands. See \\\"Help -> all\\\" for much info about x11vnc.\n"
"\n"
"Most menu items have a (?) button one can click on to get more information\n"
"about the option or command. In most cases it will be text extracted\n"
"from that in \\\"Help -> all\\\".\n"
"about the option or command.\n"
"\n"
"There are two states tkx11vnc can be in:\n"
"\n"
@ -469,7 +472,7 @@
"\n"
"proc textwin {name title text} {\n"
" global max_text_height max_text_width\n"
" global bfont\n"
" global bfont ffont\n"
"\n"
" set width [textwidth $text]\n"
" incr width\n"
@ -487,9 +490,11 @@
" frame $w.f -bd 0;\n"
" pack $w.f -fill both -expand 1\n"
" text $w.f.t -width $width -height $height -setgrid 1 -bd 2 \\\n"
" -yscrollcommand \"$w.f.y set\" -relief ridge -font fixed;\n"
" -yscrollcommand \"$w.f.y set\" -relief ridge \\\n"
" -font $ffont;\n"
" scrollbar $w.f.y -orient v -relief sunken -command \"$w.f.t yview\";\n"
" button $w.f.b -text \"Dismiss\" -command \"destroy $w\" -font $bfont\n"
" button $w.f.b -text \"Dismiss\" -command \"destroy $w\" -font $bfont \\\n"
" -pady 2\n"
"\n"
" $w.f.t insert 1.0 $text;\n"
"\n"
@ -915,121 +920,6 @@
"\n"
"# Utilities for remote control and updating vars.\n"
"\n"
"proc push_new_value0 {item name new {query 1}} {\n"
" # old way w/o -sync\n"
" global menu_var always_update remote_output query_output\n"
" global delay_sleep extra_sleep extra_sleep_split\n"
"\n"
" set debug [in_debug_mode]\n"
" set do_query_all 0\n"
" set getout 0\n"
"\n"
" if {$item == \"remote-cmd\"} {\n"
" # kludge for arbitrary remote command:\n"
" if {[regexp {^Q:} $new]} {\n"
" # extra kludge for Q:var to mean -Q var\n"
" regsub {^Q:} $new \"\" new\n"
" set qonly 1\n"
" } else {\n"
" set qonly 0\n"
" }\n"
" # need to extract item from new:\n"
" set qtmp $new\n"
" regsub {:.*$} $qtmp \"\" qtmp\n"
" if {! $qonly} {\n"
" set rargs [list \"-R\" \"$new\"]\n"
" set qargs [list \"-Q\" \"$qtmp\"]\n"
" set getout 1\n"
" } else {\n"
" set rargs [list \"-Q\" \"$qtmp\"]\n"
" set qargs [list \"-Q\" \"$qtmp\"]\n"
" }\n"
"\n"
" } elseif {[value_is_string $item]} {\n"
" set rargs [list \"-R\" \"$name:$new\"]\n"
" set qargs [list \"-Q\" \"$name\"]\n"
" } else {\n"
" set rargs [list \"-R\" \"$name\"]\n"
" set qargs [list \"-Q\" \"$name\"]\n"
" }\n"
"\n"
" if {!$debug} {\n"
" append_text \"x11vnc $rargs ...\"\n"
" }\n"
" set remote_output [run_remote_cmd $rargs]\n"
"\n"
" if {[lindex $rargs 0] == \"-Q\"} {\n"
" append_text \"\\t$remote_output\"\n"
" set getout 1\n"
" } elseif {! $query && ! $always_update} {\n"
" set getout 1\n"
" } elseif {$item == \"noremote\"} {\n"
" set getout 1\n"
" } elseif {[is_action $item] && ![opt_match Q $item] && $rargs != \"\"} {\n"
" set getout 1\n"
" } elseif {[regexp {^(sid|id)$} $item] && ![regexp {^0x} $new]} {\n"
" set getout 1\n"
" }\n"
"\n"
" if {$getout} {\n"
" append_text \"\\n\"\n"
" return\n"
" }\n"
"\n"
" stop_watch on\n"
" after $delay_sleep\n"
" if {[opt_match D $item]} {\n"
" set s [expr $extra_sleep/$extra_sleep_split] \n"
" append_text \" \"\n"
" for {set i 0} {$i<$extra_sleep_split} {incr i} {\n"
" after $s\n"
" append_text \".\"\n"
" update\n"
" }\n"
" }\n"
" stop_watch off\n"
"\n"
" if {!$debug} {\n"
" append_text \", -Q ...\"\n"
" }\n"
"\n"
" if {$item == \"disconnect\"} {\n"
" set new \"N/A\"\n"
" set do_query_all 1\n"
" }\n"
"\n"
" if {$always_update || $do_query_all} {\n"
" set query [query_all 1]\n"
" } else {\n"
" set query [run_remote_cmd $qargs]\n"
" }\n"
" set query_output $query\n"
"\n"
" if {![see_if_ok $query $item \"$name:$new\"]} {\n"
" # failed\n"
" if {[regexp {^a..=} $query]} {\n"
" # but some result came back\n"
" if {! $always_update} {\n"
" # synchronize everything\n"
" set query_output [query_all 1]\n"
" }\n"
" } else {\n"
" # server may be dead\n"
" if {$item != \"ping\" && $item != \"attach\"} {\n"
" try_connect\n"
" }\n"
" }\n"
" } else {\n"
" # succeeded\n"
" if {! $always_update} {\n"
" # synchronize this variable\n"
" update_menu_vars $query\n"
" } else {\n"
" # already done in query_all\n"
" }\n"
" }\n"
"}\n"
"\n"
"proc push_new_value {item name new {query 1}} {\n"
" global menu_var always_update remote_output query_output\n"
" global delay_sleep extra_sleep extra_sleep_split\n"
@ -1270,6 +1160,25 @@
" } else {\n"
" set msg $found\n"
" }\n"
" if {!$ok && $found != \"\"} {\n"
" # check for floating point match:\n"
" set v1 \"\"\n"
" set v2 \"\"\n"
" regexp {:([0-9.][0-9.]*)$} $found m0 v1\n"
" regexp {:([0-9.][0-9.]*)$} $expected m0 v2\n"
" if {$v1 != \"\" && $v2 != \"\"} {\n"
" set diff \"\"\n"
" catch {set diff [expr \"$v1 - $v2\"]}\n"
" if {$diff != \"\"} {\n"
" if {$diff < 0} {\n"
" set diff [expr \"0.0 - $diff\"]\n"
" }\n"
" if {$diff < 0.00001} {\n"
" set ok 1\n"
" }\n"
" }\n"
" }\n"
" }\n"
" if {$ok} {\n"
" append_text \"\\tSet OK ($msg)\\n\"\n"
" return 1\n"
@ -1278,6 +1187,12 @@
" # e.g. blackout:+30x30+20+20\n"
" append_text \"\\t($msg)\\n\"\n"
" return 1\n"
" } elseif {[regexp {:[0-9]\\.[0-9]} $expected]} {\n"
" append_text \"\\t($msg)\\n\"\n"
" return 1\n"
" } elseif {$item == \"connect\" || $item == \"disconnect\"} {\n"
" append_text \"\\t($msg)\\n\"\n"
" return 1\n"
" } else {\n"
" append_text \"\\t*FAILED* $msg\\n\"\n"
" return 0\n"
@ -1304,13 +1219,14 @@
" if {$val == \"N/A\"} {\n"
" continue\n"
" }\n"
" if {0 && $debug} {\n"
" puts \"setting menuvar: $item: $old -> $val\"\n"
" }\n"
" set menu_var($item) $val\n"
" }\n"
" if {$item == \"clients\"} {\n"
" update_clients_menu $val\n"
" } elseif {$item == \"display\"} {\n"
" set_x11_display $val\n"
" } elseif {$item == \"vncdisplay\"} {\n"
" set_vnc_display $val\n"
" }\n"
" }\n"
" }\n"
@ -1335,6 +1251,7 @@
" }\n"
" }\n"
" }\n"
" append_text \"Cleared all settings.\\n\"\n"
"}\n"
"\n"
"proc all_query_vars {} {\n"
@ -1819,10 +1736,10 @@
"}\n"
"\n"
"proc update_clients_menu {list} {\n"
" global item_cascade\n"
" global item_cascade ffont\n"
" set subm $item_cascade(current);\n"
" catch {destroy $subm}\n"
" menu $subm -tearoff 0\n"
" menu $subm -tearoff 0 -font $ffont\n"
" $subm add command\n"
" $subm add command -label \"refresh-list\" -command \"update_clients_and_repost\"\n"
" $subm add separator\n"
@ -1872,14 +1789,14 @@
" global text_area\n"
" global entry_box entry_str entry_set entry_label entry_ok entry_browse\n"
" global entry_help entry_skip\n"
" global bfont\n"
" global bfont ffont\n"
" global helptext helpremote helplabel\n"
"\n"
" set label_width 80\n"
"\n"
" set info_label .info\n"
" label $info_label -textvariable info_str -bd 2 -relief groove \\\n"
" -anchor w -width $label_width\n"
" -anchor w -width $label_width -font $ffont\n"
" pack $info_label -side top -fill x -expand 0\n"
"\n"
" # Extract the Rows:\n"
@ -1995,11 +1912,13 @@
" } elseif {$item == \"Quit\"} {\n"
" # Quit item must shut us down:\n"
" $m add command -label \"$item\" -underline 0 \\\n"
" -font $ffont \\\n"
" -command {destroy .; exit 0}\n"
"\n"
" } elseif {$case == \"Help\"} {\n"
" # Help is simple help:\n"
" $m add command -label \"$item\" \\\n"
" -font $ffont \\\n"
" -command \"menu_help $item\"\n"
"\n"
" } elseif {$item == \"current\"} {\n"
@ -2008,11 +1927,13 @@
" set item_cascade($item) $subm\n"
" update_clients_menu \"\"\n"
" $m add cascade -label \"$item\" \\\n"
" -font $ffont \\\n"
" -menu $subm\n"
"\n"
" } elseif {[is_action $item]} {\n"
" # Action\n"
" $m add command -label \"$item\" \\\n"
" -font $ffont \\\n"
" -command \"do_var $item\"\n"
" set menu_var($item) \"\"; # for convenience\n"
"\n"
@ -2021,19 +1942,22 @@
" if {[regexp -- {-C:(.*)} $item_opts($item) m0 m1]} {\n"
" # Radiobutton select\n"
" set subm $m.cascade$menu_count($case)\n"
" menu $subm -tearoff 0\n"
" menu $subm -tearoff 0 -font $ffont\n"
" foreach val [split $m1 \",\"] {\n"
" $subm add radiobutton -label \"$val\" \\\n"
" -command \"do_var $item\" \\\n"
" -value \"$val\" \\\n"
" -font $ffont \\\n"
" -variable menu_var($item)\n"
" }\n"
" $m add cascade -label \"$item\" \\\n"
" -font $ffont \\\n"
" -menu $subm\n"
" set item_cascade($item) $subm\n"
" } else {\n"
" # Arbitrary_string\n"
" $m add command -label \"$item\" \\\n"
" -font $ffont \\\n"
" -command \"do_var $item\"\n"
" }\n"
" set mvar 1\n"
@ -2042,6 +1966,7 @@
" # Boolean\n"
" $m add checkbutton -label \"$item\" \\\n"
" -command \"do_var $item\" \\\n"
" -font $ffont \\\n"
" -variable menu_var($item)\n"
" set menu_var($item) 0\n"
" }\n"
@ -2075,6 +2000,7 @@
" set str \"(?)\"\n"
" }\n"
" $m add command -label $str \\\n"
" -font $ffont \\\n"
" -command \"menu_help $label\";\n"
"\n"
" if {$str == \"\"} {\n"
@ -2100,17 +2026,19 @@
" no_x11_display\n"
"\n"
" set lw [expr {$label_width / 2}]\n"
" label $df_x11 -textvariable x11_display -width $lw -anchor w\n"
" label $df_x11 -textvariable x11_display -width $lw -anchor w \\\n"
" -font $ffont\n"
"\n"
" set df_vnc \"$df.vdisplay\"\n"
" no_vnc_display\n"
" label $df_vnc -textvariable vnc_display -width $lw -anchor w\n"
" label $df_vnc -textvariable vnc_display -width $lw -anchor w \\\n"
" -font $ffont\n"
"\n"
" pack $df_x11 $df_vnc -side left \n"
" pack $df -side top -fill x\n"
"\n"
" # text area\n"
" text .text -height 11 -relief ridge\n"
" text .text -height 11 -relief ridge -font $ffont\n"
" set text_area .text\n"
" pack .text -side top -fill both -expand 1\n"
"\n"
@ -2128,28 +2056,35 @@
"\n"
" set entry_str \"Set... : \"\n"
" set ef_entry \"$ef.entry\"\n"
" entry $ef_entry -relief sunken\n"
" entry $ef_entry -relief sunken -font $ffont\n"
" bind $ef_entry <KeyPress-Return> {set entry_set 1}\n"
" bind $ef_entry <KeyPress-Escape> {set entry_set 0}\n"
"\n"
" # Entry OK button\n"
" set bpx \"1m\"\n"
" set bpy \"1\"\n"
" set hlt \"0\"\n"
" set ef_ok \"$ef.ok\"\n"
" button $ef_ok -text OK -pady 1 -command {set entry_set 1} \\\n"
" button $ef_ok -text OK -pady $bpy -padx $bpx -command {set entry_set 1} \\\n"
" -highlightthickness $hlt \\\n"
" -font $bfont\n"
"\n"
" # Entry Skip button\n"
" set ef_skip \"$ef.skip\"\n"
" button $ef_skip -text Skip -pady 0 -command {set entry_set 0} \\\n"
" button $ef_skip -text Skip -pady $bpy -padx $bpx -command {set entry_set 0} \\\n"
" -highlightthickness $hlt \\\n"
" -font $bfont\n"
"\n"
" # Entry Help button\n"
" set ef_help \"$ef.help\"\n"
" button $ef_help -text Help -pady 0 -command \\\n"
" {menu_help $entry_dialog_item} -font $bfont\n"
" button $ef_help -text Help -pady $bpy -padx $bpx -command \\\n"
" {menu_help $entry_dialog_item} -font $bfont \\\n"
" -highlightthickness $hlt\n"
"\n"
" # Entry Browse button\n"
" set ef_browse \"$ef.browse\"\n"
" button $ef_browse -text \"Browse...\" -pady 0 -font $bfont \\\n"
" button $ef_browse -text \"Browse...\" -pady $bpy -padx $bpx -font $bfont \\\n"
" -highlightthickness $hlt \\\n"
" -command {entry_insert [tk_getOpenFile]} \n"
"\n"
" pack $ef_label -side left\n"
@ -2322,6 +2257,9 @@
" if {$item == \"id\"} {\n"
" set saw_id 1\n"
" }\n"
" if {$item == \"httpport\" && $menu_var($item) == \"0\"} {\n"
" continue\n"
" }\n"
" if {$item == \"progressive\" && $menu_var($item) == \"0\"} {\n"
" continue\n"
" }\n"
@ -2525,7 +2463,7 @@
"global all_settings reply_xdisplay always_update\n"
"global max_text_height max_text_width\n"
"global menu_var unset_str menus_disabled\n"
"global bfont old_labels\n"
"global bfont ffont old_labels\n"
"global connected_to_x11vnc\n"
"global delay_sleep extra_sleep extra_sleep_split\n"
"global cache_all_query_vars\n"
@ -2535,7 +2473,8 @@
"set menus_disabled 0\n"
"set max_text_height 40\n"
"set max_text_width 90\n"
"set bfont -adobe-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*;\n"
"set bfont \"-adobe-helvetica-bold-r-*-*-*-120-*-*-*-*-*-*\"\n"
"set ffont \"fixed\"\n"
"set help_indent 24;\n"
"set reply_xdisplay \"\"\n"
"set all_settings \"None so far.\"\n"

@ -1,8 +1,8 @@
.\" This file was automatically generated from x11vnc -help output.
.TH X11VNC "1" "December 2004" "x11vnc " "User Commands"
.TH X11VNC "1" "January 2005" "x11vnc " "User Commands"
.SH NAME
x11vnc - allow VNC connections to real X11 displays
version: 0.7.1pre, lastmod: 2004-12-27
version: 0.7.1pre, lastmod: 2005-01-16
.SH SYNOPSIS
.B x11vnc
[OPTION]...
@ -57,7 +57,7 @@ environment variable to \fIdisp\fR.
\fB-auth\fR \fIfile\fR
.IP
Set the X authority file to be \fIfile\fR, equivalent to
setting the XAUTHORITY environment varirable to \fIfile\fR
setting the XAUTHORITY environment variable to \fIfile\fR
before startup. See
.IR Xsecurity (7)
,
@ -407,7 +407,8 @@ to handle all subsequent resizes (e.g. under \fB-xrandr,\fR
\fB-o\fR \fIlogfile\fR
.IP
Write stderr messages to file \fIlogfile\fR instead of
to the terminal. Same as "\fB-logfile\fR \fIfile\fR".
to the terminal. Same as "\fB-logfile\fR \fIfile\fR". To append
to the file use "\fB-oa\fR \fIfile\fR" or "\fB-logappend\fR \fIfile\fR".
.PP
\fB-rc\fR \fIfilename\fR
.IP
@ -623,7 +624,7 @@ cursors with transparency will not be displayed exactly
for cursors that have transparency ("alpha channel"
with values ranging from 0 to 255) Any cursor pixel with
alpha value less than n becomes completely transparent.
Otherwise the pixel is completely opaque. Default 255
Otherwise the pixel is completely opaque. Default 240
.IP
Note: the options \fB-alphacut,\fR \fB-alphafrac,\fR and \fB-alphafrac\fR
may be removed if a more accurate internal method for
@ -646,6 +647,17 @@ black background). Specify this option to remove the
alpha factor. (useful for light colored semi-transparent
cursors).
.PP
\fB-alphablend\fR
.IP
In XFIXES mode send cursor alpha channel data to
libvncserver. The blending effect will only be
visible in \fB-nocursorshape\fR mode or for clients with
cursorshapeupdates turned off. (However there is a
hack for 32bpp with depth 24, it uses the extra 8 bits
to store cursor transparency for use with a hacked
vncviewer that applies the transparency locally.
See the FAQ for more info).
.PP
\fB-nocursorshape\fR
.IP
Do not use the TightVNC CursorShapeUpdates extension
@ -699,36 +711,59 @@ To include button events use "Button1", ... etc.
.PP
\fB-nodragging\fR
.IP
Do not update the display during mouse dragging
events (mouse motion with a button held down).
Greatly improves response on slow setups, but you lose
all visual feedback for drags, text selection, and some
menu traversals. It overrides any \fB-pointer_mode\fR setting
(think of it as pointer_mode 0)
Do not update the display during mouse dragging events
(mouse button held down). Greatly improves response on
slow setups, but you lose all visual feedback for drags,
text selection, and some menu traversals. It overrides
any \fB-pointer_mode\fR setting
.PP
\fB-pointer_mode\fR \fIn\fR
.IP
Various pointer update schemes. The problem is pointer
motion can cause rapid changes on the screen, e.g. a
window drag. Neither x11vnc's screen polling nor the
Various pointer motion update schemes. "\fB-pm\fR" is
an alias. The problem is pointer motion can cause
rapid changes on the screen: consider the rapid changes
when you drag a large window around. Neither x11vnc's
screen polling and vnc compression routines nor the
bandwidth to the vncviewers can keep up these rapid
screen changes: everything bogs down when dragging
or scrolling. Note that most video h/w is optimized
for writing, not reading (a 50X rate difference is
possible) and x11vnc is reading all the time. So a
scheme has to be used to "eat" much of that pointer
input before re-polling the screen. n can be 1 to 4.
.IP
n=1 was the original scheme used to about Jan 2004: it
basically just skips \fB-input_skip\fR pointer events before
repolling the screen. n=2 is an improved scheme:
by watching the current rate it tries to detect if
it should try to "eat" more pointer events. n=3 is
basically a dynamic \fB-nodragging\fR mode: it detects if the
mouse drag motion has paused and refreshes the display.
n=4 is TBD, it will try measure screen read and client
write rates and try to insert "frames" between the
on/off states of mode 3. The default n is 2.
screen changes: everything will bog down when dragging
or scrolling. So a scheme has to be used to "eat"
much of that pointer input before re-polling the screen
and sending out framebuffer updates. The mode number
\fIn\fR can be 0 to 4 and selects one of the schemes
desribed below.
.IP
n=0: does the same as \fB-nodragging.\fR (all screen polling
is suspended if a mouse button is pressed.)
.IP
n=1: was the original scheme used to about Jan 2004:
it basically just skips \fB-input_skip\fR keyboard or pointer
events before repolling the screen.
.IP
n=2 is an improved scheme: by watching the current rate
of input events it tries to detect if it should try to
"eat" additional pointer events before continuing.
.IP
n=3 is basically a dynamic \fB-nodragging\fR mode: it detects
when the mouse motion has paused and then refreshes
the display.
.IP
n=4: attempts to measures network rates and latency,
the video card read rate, and how many tiles have been
changed on the screen. From this, it aggressively tries
to push screen "frames" when it decides it has enough
resources to do so. NOT FINISHED.
.IP
The default n is 2. Note that modes 2, 3, 4 will skip
\fB-input_skip\fR keyboard events (but it will not count
pointer events). Also note that these modes are not
available in \fB-threads\fR mode which has its own pointer
event handling mechanism.
.IP
To try out the different pointer modes to see
which one gives the best response for your usage,
it is convenient to use the remote control function,
e.g. "x11vnc \fB-R\fR pointer_mode:4" or the tcl/tk gui
(Tuning -> pointer_mode -> n).
.PP
\fB-input_skip\fR \fIn\fR
.IP
@ -737,6 +772,32 @@ read n user input events before scanning display. n < 0
means to act as though there is always user input.
Default: 10
.PP
\fB-speeds\fR \fIrd,bw,lat\fR
.IP
x11vnc tries to estimate some speed parameters that
are used to optimize scheduling (e.g. \fB-pointer_mode\fR
4) and other things. Use the \fB-speeds\fR option to set
these manually. The triple \fIrd,bw,lat\fR corresponds
to video h/w read rate in MB/sec, network bandwidth to
clients in KB/sec, and network latency to clients in
milliseconds, respectively. If a value is left blank,
e.g. "\fB-speeds\fR \fI,100,15\fR", then the internal scheme is
used to estimate the empty value(s).
.IP
Typical PC video cards have read rates of 5-10 MB/sec.
If the framebuffer is in main memory instead of video
h/w (e.g. SunRay, shadowfb, Xvfb), the read rate may
be much faster. "x11perf \fB-getimage500"\fR can be used
to get a lower bound (remember to factor in the bytes
per pixel). It is up to you to estimate the network
bandwith to clients. For the latency the
.IR ping (1)
command can be used.
.IP
For convenience there are some aliases provided,
e.g. "\fB-speeds\fR \fImodem\fR". The aliases are: "modem" for
6,4,200; "dsl" for 6,100,50; and "lan" for 6,5000,1
.PP
\fB-debug_pointer\fR
.IP
Print debugging output for every pointer event.
@ -803,6 +864,22 @@ by checking the tile near the boundary. Default: 3
Tolerance in pixels to mark a tiles edges as changed.
Default: 2
.PP
\fB-snapfb\fR
.IP
Instead of polling the X display framebuffer (fb) for
changes, periodically copy all of X display fb into main
memory and examine that copy for changes. Under some
circumstances this will improve interactive response,
or at least make things look smoother, but in others
(many) it will make the response worse. If the video
h/w fb is such that reading small tiles is very slow
this mode could help. To keep the "framerate" up
the screen size x bpp cannot be too large. Note that
this mode is very wasteful of memory I/O resources
(it makes full screen copies even if nothing changes).
It may be of use in video capture-like applications,
or where window tearing is a problem.
.PP
\fB-gui\fR \fI[gui-opts]\fR
.IP
Start up a simple tcl/tk gui based on the the remote
@ -1073,6 +1150,10 @@ alpharemove enable \fB-alpharemove\fR mode.
.IP
noalpharemove disable \fB-alpharemove\fR mode.
.IP
alphablend enable \fB-alphablend\fR mode.
.IP
noalphablend disable \fB-alphablend\fR mode.
.IP
cursorshape disable \fB-nocursorshape\fR mode.
.IP
nocursorshape enable \fB-nocursorshape\fR mode.
@ -1091,9 +1172,11 @@ dragging disable \fB-nodragging\fR mode.
.IP
nodragging enable \fB-nodragging\fR mode.
.IP
pointer_mode n set \fB-pointer_mode\fR to n.
pointer_mode:n set \fB-pointer_mode\fR to n. same as "pm"
.IP
input_skip:n set \fB-input_skip\fR to n.
.IP
input_skip n set \fB-input_skip\fR to n.
speeds:str set \fB-speeds\fR to str.
.IP
debug_pointer enable \fB-debug_pointer,\fR same as "dp"
.IP
@ -1123,6 +1206,10 @@ grow:n set \fB-grow\fR to n.
.IP
fuzz:n set \fB-fuzz\fR to n.
.IP
snapfb enable \fB-snapfb\fR mode.
.IP
nosnapfb disable \fB-snapfb\fR mode.
.IP
progressive:n set libvncserver \fB-progressive\fR slice
height parameter to n.
.IP
@ -1215,29 +1302,30 @@ the returned value corresponds to (hint: the ext_*
variables correspond to the presence of X extensions):
.IP
ans= stop quit exit shutdown ping blacken zero
refresh reset close disconnect id sid flashcmap
noflashcmap truecolor notruecolor overlay nooverlay
overlay_cursor overlay_yescursor nooverlay_nocursor
nooverlay_cursor nooverlay_yescursor overlay_nocursor
visual scale viewonly noviewonly shared noshared
forever noforever once deny lock nodeny unlock
connect allowonce allow localhost nolocalhost accept
gone shm noshm flipbyteorder noflipbyteorder onetile
noonetile blackout xinerama noxinerama xrandr noxrandr
xrandr_mode padgeom quiet q noquiet modtweak nomodtweak
xkb noxkb skip_keycodes add_keysyms noadd_keysyms
clear_mods noclear_mods clear_keys noclear_keys
remap repeat norepeat fb nofb bell nobell sel
nosel primary noprimary cursorshape nocursorshape
refresh reset close disconnect id sid waitmapped
nowaitmapped flashcmap noflashcmap truecolor notruecolor
overlay nooverlay overlay_cursor overlay_yescursor
nooverlay_nocursor nooverlay_cursor nooverlay_yescursor
overlay_nocursor visual scale viewonly noviewonly
shared noshared forever noforever once deny lock nodeny
unlock connect allowonce allow localhost nolocalhost
accept gone shm noshm flipbyteorder noflipbyteorder
onetile noonetile blackout xinerama noxinerama xrandr
noxrandr xrandr_mode padgeom quiet q noquiet modtweak
nomodtweak xkb noxkb skip_keycodes add_keysyms
noadd_keysyms clear_mods noclear_mods clear_keys
noclear_keys remap repeat norepeat fb nofb bell nobell
sel nosel primary noprimary cursorshape nocursorshape
cursorpos nocursorpos cursor show_cursor noshow_cursor
nocursor xfixes noxfixes alphacut alphafrac alpharemove
noalpharemove xwarp xwarppointer noxwarp noxwarppointer
buttonmap dragging nodragging pointer_mode input_skip
debug_pointer dp nodebug_pointer nodp debug_keyboard
dk nodebug_keyboard nodk deferupdate defer wait
rfbwait nap nonap sb screen_blank fs gaps grow fuzz
progressive rfbport http nohttp httpport httpdir
enablehttpproxy noenablehttpproxy alwaysshared
nocursor xfixes noxfixes alphacut alphafrac
alpharemove noalpharemove alphablend noalphablend
xwarp xwarppointer noxwarp noxwarppointer buttonmap
dragging nodragging pointer_mode pm input_skip speeds
debug_pointer dp nodebug_pointer nodp debug_keyboard dk
nodebug_keyboard nodk deferupdate defer wait rfbwait
nap nonap sb screen_blank fs gaps grow fuzz snapfb
nosnapfb progressive rfbport http nohttp httpport
httpdir enablehttpproxy noenablehttpproxy alwaysshared
noalwaysshared nevershared noalwaysshared dontdisconnect
nodontdisconnect desktop noremote
.IP

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save