Commit b58e460f authored by runge's avatar runge

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

parent 336d7dad
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> 2004-12-27 Karl Runge <runge@karlrunge.com>
* x11vnc: improve alpha channel handling for XFIXES cursors. * x11vnc: improve alpha channel handling for XFIXES cursors.
* add more parameters to remote control. * add more parameters to remote control.
......
...@@ -310,6 +310,8 @@ void rfbFreeCursor(rfbCursorPtr cursor) ...@@ -310,6 +310,8 @@ void rfbFreeCursor(rfbCursorPtr cursor)
if(cursor) { if(cursor) {
if(cursor->cleanupRichSource && cursor->richSource) if(cursor->cleanupRichSource && cursor->richSource)
free(cursor->richSource); free(cursor->richSource);
if(cursor->cleanupRichSource && cursor->alphaSource)
free(cursor->alphaSource);
if(cursor->cleanupSource && cursor->source) if(cursor->cleanupSource && cursor->source)
free(cursor->source); free(cursor->source);
if(cursor->cleanupMask && cursor->mask) if(cursor->cleanupMask && cursor->mask)
...@@ -320,6 +322,7 @@ void rfbFreeCursor(rfbCursorPtr cursor) ...@@ -320,6 +322,7 @@ void rfbFreeCursor(rfbCursorPtr cursor)
cursor->cleanup=cursor->cleanupSource=cursor->cleanupMask cursor->cleanup=cursor->cleanupSource=cursor->cleanupMask
=cursor->cleanupRichSource=FALSE; =cursor->cleanupRichSource=FALSE;
cursor->source=cursor->mask=cursor->richSource=0; cursor->source=cursor->mask=cursor->richSource=0;
cursor->alphaSource=0;
} }
} }
...@@ -489,12 +492,84 @@ void rfbDrawCursor(rfbScreenInfoPtr s) ...@@ -489,12 +492,84 @@ void rfbDrawCursor(rfbScreenInfoPtr s)
if(!c->richSource) if(!c->richSource)
rfbMakeRichCursorFromXCursor(s,c); rfbMakeRichCursorFromXCursor(s,c);
/* now the cursor has to be drawn */ if (c->alphaSource) {
for(j=0;j<y2;j++) int rmax, rshift;
for(i=0;i<x2;i++) int gmax, gshift;
if((c->mask[(j+j1)*w+(i+i1)/8]<<((i+i1)&7))&0x80) int bmax, bshift;
memcpy(s->frameBuffer+(j+y1)*rowstride+(i+x1)*bpp, int amax = 255; /* alphaSource is always 8bits of info per pixel */
c->richSource+(j+j1)*c->width*bpp+(i+i1)*bpp,bpp); 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) if(wasChanged)
rfbMarkRectAsModified(s,x1,y1,x1+x2,y1+y2); rfbMarkRectAsModified(s,x1,y1,x1+x2,y1+y2);
......
...@@ -664,6 +664,8 @@ typedef struct rfbCursor { ...@@ -664,6 +664,8 @@ typedef struct rfbCursor {
unsigned short foreRed, foreGreen, foreBlue; /* device-independent colour */ unsigned short foreRed, foreGreen, foreBlue; /* device-independent colour */
unsigned short backRed, backGreen, backBlue; /* device-independent colour */ unsigned short backRed, backGreen, backBlue; /* device-independent colour */
unsigned char *richSource; /* source bytes for a rich cursor */ 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; } rfbCursor, *rfbCursorPtr;
extern unsigned char rfbReverseByte[0x100]; extern unsigned char rfbReverseByte[0x100];
......
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> 2004-12-27 Karl Runge <runge@karlrunge.com>
* allow -DLIBVNCSERVER_HAVE_FOO=0 override everything * allow -DLIBVNCSERVER_HAVE_FOO=0 override everything
* get_xfixes_cursor() try to more carefully convert alpha channel * get_xfixes_cursor() try to more carefully convert alpha channel
......
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -139,6 +139,7 @@ Keyboard ...@@ -139,6 +139,7 @@ Keyboard
Pointer Pointer
=-C:none,arrow,X,some,most cursor: =-C:none,arrow,X,some,most cursor:
noxfixes noxfixes
alphablend
-- --
cursorpos cursorpos
nocursorshape nocursorshape
...@@ -160,6 +161,7 @@ Misc ...@@ -160,6 +161,7 @@ Misc
bg bg
=-C:ignore,exit sigpipe: =-C:ignore,exit sigpipe:
=0 inetd =0 inetd
rfbwait:
-- --
=RA remote-cmd: =RA remote-cmd:
=GA all-settings =GA all-settings
...@@ -204,17 +206,19 @@ Permissions ...@@ -204,17 +206,19 @@ Permissions
unsafe unsafe
Tuning Tuning
=-C:1,2,3,4 pointer_mode: =-C:0,1,2,3,4 pointer_mode:
input_skip: input_skip:
nodragging nodragging
alphacut:
alphafrac:
alpharemove
-- --
=D noshm =D noshm
flipbyteorder flipbyteorder
onetile onetile
-- --
alphacut:
alphafrac:
alpharemove
--
speeds:
wait: wait:
defer: defer:
nap nap
...@@ -224,9 +228,9 @@ Tuning ...@@ -224,9 +228,9 @@ Tuning
gaps: gaps:
grow: grow:
fuzz: fuzz:
snapfb
-- --
threads threads
rfbwait:
-- --
progressive: progressive:
" "
...@@ -329,8 +333,7 @@ provides an interface to each of the many x11vnc command line options and ...@@ -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. 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 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 about the option or command.
from that in \"Help -> all\".
There are two states tkx11vnc can be in: There are two states tkx11vnc can be in:
...@@ -463,7 +466,7 @@ proc make_toplevel {w {title ""}} { ...@@ -463,7 +466,7 @@ proc make_toplevel {w {title ""}} {
proc textwin {name title text} { proc textwin {name title text} {
global max_text_height max_text_width global max_text_height max_text_width
global bfont global bfont ffont
set width [textwidth $text] set width [textwidth $text]
incr width incr width
...@@ -481,9 +484,11 @@ proc textwin {name title text} { ...@@ -481,9 +484,11 @@ proc textwin {name title text} {
frame $w.f -bd 0; frame $w.f -bd 0;
pack $w.f -fill both -expand 1 pack $w.f -fill both -expand 1
text $w.f.t -width $width -height $height -setgrid 1 -bd 2 \ 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"; 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; $w.f.t insert 1.0 $text;
...@@ -909,121 +914,6 @@ proc entry_delete {} { ...@@ -909,121 +914,6 @@ proc entry_delete {} {
# Utilities for remote control and updating vars. # 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}} { proc push_new_value {item name new {query 1}} {
global menu_var always_update remote_output query_output global menu_var always_update remote_output query_output
global delay_sleep extra_sleep extra_sleep_split global delay_sleep extra_sleep extra_sleep_split
...@@ -1264,6 +1154,25 @@ proc see_if_ok {query item expected} { ...@@ -1264,6 +1154,25 @@ proc see_if_ok {query item expected} {
} else { } else {
set msg $found 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} { if {$ok} {
append_text "\tSet OK ($msg)\n" append_text "\tSet OK ($msg)\n"
return 1 return 1
...@@ -1272,6 +1181,12 @@ proc see_if_ok {query item expected} { ...@@ -1272,6 +1181,12 @@ proc see_if_ok {query item expected} {
# e.g. blackout:+30x30+20+20 # e.g. blackout:+30x30+20+20
append_text "\t($msg)\n" append_text "\t($msg)\n"
return 1 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 { } else {
append_text "\t*FAILED* $msg\n" append_text "\t*FAILED* $msg\n"
return 0 return 0
...@@ -1298,13 +1213,14 @@ proc update_menu_vars {{query ""}} { ...@@ -1298,13 +1213,14 @@ proc update_menu_vars {{query ""}} {
if {$val == "N/A"} { if {$val == "N/A"} {
continue continue
} }
if {0 && $debug} {
puts "setting menuvar: $item: $old -> $val"
}
set menu_var($item) $val set menu_var($item) $val
} }
if {$item == "clients"} { if {$item == "clients"} {
update_clients_menu $val 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 {} { ...@@ -1329,6 +1245,7 @@ proc clear_all {} {
} }
} }
} }
append_text "Cleared all settings.\n"
} }
proc all_query_vars {} { proc all_query_vars {} {
...@@ -1813,10 +1730,10 @@ proc update_clients_and_repost {} { ...@@ -1813,10 +1730,10 @@ proc update_clients_and_repost {} {
} }
proc update_clients_menu {list} { proc update_clients_menu {list} {
global item_cascade global item_cascade ffont
set subm $item_cascade(current); set subm $item_cascade(current);
catch {destroy $subm} catch {destroy $subm}
menu $subm -tearoff 0 menu $subm -tearoff 0 -font $ffont
$subm add command $subm add command
$subm add command -label "refresh-list" -command "update_clients_and_repost" $subm add command -label "refresh-list" -command "update_clients_and_repost"
$subm add separator $subm add separator
...@@ -1866,14 +1783,14 @@ proc make_widgets {} { ...@@ -1866,14 +1783,14 @@ proc make_widgets {} {
global text_area global text_area
global entry_box entry_str entry_set entry_label entry_ok entry_browse global entry_box entry_str entry_set entry_label entry_ok entry_browse
global entry_help entry_skip global entry_help entry_skip
global bfont global bfont ffont
global helptext helpremote helplabel global helptext helpremote helplabel
set label_width 80 set label_width 80
set info_label .info set info_label .info
label $info_label -textvariable info_str -bd 2 -relief groove \ 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 pack $info_label -side top -fill x -expand 0
# Extract the Rows: # Extract the Rows:
...@@ -1989,11 +1906,13 @@ proc make_widgets {} { ...@@ -1989,11 +1906,13 @@ proc make_widgets {} {
} elseif {$item == "Quit"} { } elseif {$item == "Quit"} {
# Quit item must shut us down: # Quit item must shut us down:
$m add command -label "$item" -underline 0 \ $m add command -label "$item" -underline 0 \
-font $ffont \
-command {destroy .; exit 0} -command {destroy .; exit 0}
} elseif {$case == "Help"} { } elseif {$case == "Help"} {
# Help is simple help: # Help is simple help:
$m add command -label "$item" \ $m add command -label "$item" \
-font $ffont \
-command "menu_help $item" -command "menu_help $item"
} elseif {$item == "current"} { } elseif {$item == "current"} {
...@@ -2002,11 +1921,13 @@ proc make_widgets {} { ...@@ -2002,11 +1921,13 @@ proc make_widgets {} {
set item_cascade($item) $subm set item_cascade($item) $subm
update_clients_menu "" update_clients_menu ""
$m add cascade -label "$item" \ $m add cascade -label "$item" \
-font $ffont \
-menu $subm -menu $subm
} elseif {[is_action $item]} { } elseif {[is_action $item]} {
# Action # Action
$m add command -label "$item" \ $m add command -label "$item" \
-font $ffont \
-command "do_var $item" -command "do_var $item"
set menu_var($item) ""; # for convenience set menu_var($item) ""; # for convenience
...@@ -2015,19 +1936,22 @@ proc make_widgets {} { ...@@ -2015,19 +1936,22 @@ proc make_widgets {} {
if {[regexp -- {-C:(.*)} $item_opts($item) m0 m1]} { if {[regexp -- {-C:(.*)} $item_opts($item) m0 m1]} {
# Radiobutton select # Radiobutton select
set subm $m.cascade$menu_count($case) set subm $m.cascade$menu_count($case)
menu $subm -tearoff 0 menu $subm -tearoff 0 -font $ffont
foreach val [split $m1 ","] { foreach val [split $m1 ","] {
$subm add radiobutton -label "$val" \ $subm add radiobutton -label "$val" \
-command "do_var $item" \ -command "do_var $item" \
-value "$val" \ -value "$val" \
-font $ffont \
-variable menu_var($item) -variable menu_var($item)
} }
$m add cascade -label "$item" \ $m add cascade -label "$item" \
-font $ffont \
-menu $subm -menu $subm
set item_cascade($item) $subm set item_cascade($item) $subm
} else { } else {
# Arbitrary_string # Arbitrary_string
$m add command -label "$item" \ $m add command -label "$item" \
-font $ffont \
-command "do_var $item" -command "do_var $item"
} }
set mvar 1 set mvar 1
...@@ -2036,6 +1960,7 @@ proc make_widgets {} { ...@@ -2036,6 +1960,7 @@ proc make_widgets {} {
# Boolean # Boolean
$m add checkbutton -label "$item" \ $m add checkbutton -label "$item" \
-command "do_var $item" \ -command "do_var $item" \
-font $ffont \
-variable menu_var($item) -variable menu_var($item)
set menu_var($item) 0 set menu_var($item) 0
} }
...@@ -2069,6 +1994,7 @@ proc make_widgets {} { ...@@ -2069,6 +1994,7 @@ proc make_widgets {} {
set str "(?)" set str "(?)"
} }
$m add command -label $str \ $m add command -label $str \
-font $ffont \
-command "menu_help $label"; -command "menu_help $label";
if {$str == ""} { if {$str == ""} {
...@@ -2094,17 +2020,19 @@ proc make_widgets {} { ...@@ -2094,17 +2020,19 @@ proc make_widgets {} {
no_x11_display no_x11_display
set lw [expr {$label_width / 2}] 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" set df_vnc "$df.vdisplay"
no_vnc_display 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_x11 $df_vnc -side left
pack $df -side top -fill x pack $df -side top -fill x
# text area # text area
text .text -height 11 -relief ridge text .text -height 11 -relief ridge -font $ffont
set text_area .text set text_area .text
pack .text -side top -fill both -expand 1 pack .text -side top -fill both -expand 1
...@@ -2122,28 +2050,35 @@ proc make_widgets {} { ...@@ -2122,28 +2050,35 @@ proc make_widgets {} {
set entry_str "Set... : " set entry_str "Set... : "
set ef_entry "$ef.entry" 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-Return> {set entry_set 1}
bind $ef_entry <KeyPress-Escape> {set entry_set 0} bind $ef_entry <KeyPress-Escape> {set entry_set 0}
# Entry OK button # Entry OK button
set bpx "1m"
set bpy "1"
set hlt "0"
set ef_ok "$ef.ok" 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 -font $bfont
# Entry Skip button # Entry Skip button
set ef_skip "$ef.skip" 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 -font $bfont
# Entry Help button # Entry Help button
set ef_help "$ef.help" set ef_help "$ef.help"
button $ef_help -text Help -pady 0 -command \ button $ef_help -text Help -pady $bpy -padx $bpx -command \
{menu_help $entry_dialog_item} -font $bfont {menu_help $entry_dialog_item} -font $bfont \
-highlightthickness $hlt
# Entry Browse button # Entry Browse button
set ef_browse "$ef.browse" 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]} -command {entry_insert [tk_getOpenFile]}
pack $ef_label -side left pack $ef_label -side left
...@@ -2316,6 +2251,9 @@ proc get_start_x11vnc_cmd {{show_rc 0}} { ...@@ -2316,6 +2251,9 @@ proc get_start_x11vnc_cmd {{show_rc 0}} {
if {$item == "id"} { if {$item == "id"} {
set saw_id 1 set saw_id 1
} }
if {$item == "httpport" && $menu_var($item) == "0"} {
continue
}
if {$item == "progressive" && $menu_var($item) == "0"} { if {$item == "progressive" && $menu_var($item) == "0"} {
continue continue
} }
...@@ -2519,7 +2457,7 @@ global helpall helptext helpremote helplabel hostname; ...@@ -2519,7 +2457,7 @@ global helpall helptext helpremote helplabel hostname;
global all_settings reply_xdisplay always_update global all_settings reply_xdisplay always_update
global max_text_height max_text_width global max_text_height max_text_width
global menu_var unset_str menus_disabled global menu_var unset_str menus_disabled
global bfont old_labels global bfont ffont old_labels
global connected_to_x11vnc global connected_to_x11vnc
global delay_sleep extra_sleep extra_sleep_split global delay_sleep extra_sleep extra_sleep_split
global cache_all_query_vars global cache_all_query_vars
...@@ -2529,7 +2467,8 @@ set connected_to_x11vnc 0 ...@@ -2529,7 +2467,8 @@ set connected_to_x11vnc 0
set menus_disabled 0 set menus_disabled 0
set max_text_height 40 set max_text_height 40
set max_text_width 90 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 help_indent 24;
set reply_xdisplay "" set reply_xdisplay ""
set all_settings "None so far." set all_settings "None so far."
......
...@@ -145,6 +145,7 @@ ...@@ -145,6 +145,7 @@
"Pointer\n" "Pointer\n"
" =-C:none,arrow,X,some,most cursor:\n" " =-C:none,arrow,X,some,most cursor:\n"
" noxfixes\n" " noxfixes\n"
" alphablend\n"
" --\n" " --\n"
" cursorpos\n" " cursorpos\n"
" nocursorshape\n" " nocursorshape\n"
...@@ -166,6 +167,7 @@ ...@@ -166,6 +167,7 @@
" bg\n" " bg\n"
" =-C:ignore,exit sigpipe:\n" " =-C:ignore,exit sigpipe:\n"
" =0 inetd\n" " =0 inetd\n"
" rfbwait:\n"
" --\n" " --\n"
" =RA remote-cmd:\n" " =RA remote-cmd:\n"
" =GA all-settings\n" " =GA all-settings\n"
...@@ -210,17 +212,19 @@ ...@@ -210,17 +212,19 @@
" unsafe\n" " unsafe\n"
"\n" "\n"
"Tuning\n" "Tuning\n"
" =-C:1,2,3,4 pointer_mode:\n" " =-C:0,1,2,3,4 pointer_mode:\n"
" input_skip:\n" " input_skip:\n"
" nodragging\n" " nodragging\n"
" alphacut:\n"
" alphafrac:\n"
" alpharemove\n"
" --\n" " --\n"
" =D noshm\n" " =D noshm\n"
" flipbyteorder\n" " flipbyteorder\n"
" onetile\n" " onetile\n"
" --\n" " --\n"
" alphacut:\n"
" alphafrac:\n"
" alpharemove\n"
" --\n"
" speeds:\n"
" wait:\n" " wait:\n"
" defer:\n" " defer:\n"
" nap\n" " nap\n"
...@@ -230,9 +234,9 @@ ...@@ -230,9 +234,9 @@
" gaps:\n" " gaps:\n"
" grow:\n" " grow:\n"
" fuzz:\n" " fuzz:\n"
" snapfb\n"
" --\n" " --\n"
" threads\n" " threads\n"
" rfbwait:\n"
" --\n" " --\n"
" progressive:\n" " progressive:\n"
"\"\n" "\"\n"
...@@ -335,8 +339,7 @@ ...@@ -335,8 +339,7 @@
"remote control commands. See \\\"Help -> all\\\" for much info about x11vnc.\n" "remote control commands. See \\\"Help -> all\\\" for much info about x11vnc.\n"
"\n" "\n"
"Most menu items have a (?) button one can click on to get more information\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" "about the option or command.\n"
"from that in \\\"Help -> all\\\".\n"
"\n" "\n"
"There are two states tkx11vnc can be in:\n" "There are two states tkx11vnc can be in:\n"
"\n" "\n"
...@@ -469,7 +472,7 @@ ...@@ -469,7 +472,7 @@
"\n" "\n"
"proc textwin {name title text} {\n" "proc textwin {name title text} {\n"
" global max_text_height max_text_width\n" " global max_text_height max_text_width\n"
" global bfont\n" " global bfont ffont\n"
"\n" "\n"
" set width [textwidth $text]\n" " set width [textwidth $text]\n"
" incr width\n" " incr width\n"
...@@ -487,9 +490,11 @@ ...@@ -487,9 +490,11 @@
" frame $w.f -bd 0;\n" " frame $w.f -bd 0;\n"
" pack $w.f -fill both -expand 1\n" " pack $w.f -fill both -expand 1\n"
" text $w.f.t -width $width -height $height -setgrid 1 -bd 2 \\\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" " 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" "\n"
" $w.f.t insert 1.0 $text;\n" " $w.f.t insert 1.0 $text;\n"
"\n" "\n"
...@@ -915,121 +920,6 @@ ...@@ -915,121 +920,6 @@
"\n" "\n"
"# Utilities for remote control and updating vars.\n" "# Utilities for remote control and updating vars.\n"
"\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" "proc push_new_value {item name new {query 1}} {\n"
" global menu_var always_update remote_output query_output\n" " global menu_var always_update remote_output query_output\n"
" global delay_sleep extra_sleep extra_sleep_split\n" " global delay_sleep extra_sleep extra_sleep_split\n"
...@@ -1270,6 +1160,25 @@ ...@@ -1270,6 +1160,25 @@
" } else {\n" " } else {\n"
" set msg $found\n" " set msg $found\n"
" }\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" " if {$ok} {\n"
" append_text \"\\tSet OK ($msg)\\n\"\n" " append_text \"\\tSet OK ($msg)\\n\"\n"
" return 1\n" " return 1\n"
...@@ -1278,6 +1187,12 @@ ...@@ -1278,6 +1187,12 @@
" # e.g. blackout:+30x30+20+20\n" " # e.g. blackout:+30x30+20+20\n"
" append_text \"\\t($msg)\\n\"\n" " append_text \"\\t($msg)\\n\"\n"
" return 1\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" " } else {\n"
" append_text \"\\t*FAILED* $msg\\n\"\n" " append_text \"\\t*FAILED* $msg\\n\"\n"
" return 0\n" " return 0\n"
...@@ -1304,13 +1219,14 @@ ...@@ -1304,13 +1219,14 @@
" if {$val == \"N/A\"} {\n" " if {$val == \"N/A\"} {\n"
" continue\n" " continue\n"
" }\n" " }\n"
" if {0 && $debug} {\n"
" puts \"setting menuvar: $item: $old -> $val\"\n"
" }\n"
" set menu_var($item) $val\n" " set menu_var($item) $val\n"
" }\n" " }\n"
" if {$item == \"clients\"} {\n" " if {$item == \"clients\"} {\n"
" update_clients_menu $val\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" " }\n"
" }\n" " }\n"
...@@ -1335,6 +1251,7 @@ ...@@ -1335,6 +1251,7 @@
" }\n" " }\n"
" }\n" " }\n"
" }\n" " }\n"
" append_text \"Cleared all settings.\\n\"\n"
"}\n" "}\n"
"\n" "\n"
"proc all_query_vars {} {\n" "proc all_query_vars {} {\n"
...@@ -1819,10 +1736,10 @@ ...@@ -1819,10 +1736,10 @@
"}\n" "}\n"
"\n" "\n"
"proc update_clients_menu {list} {\n" "proc update_clients_menu {list} {\n"
" global item_cascade\n" " global item_cascade ffont\n"
" set subm $item_cascade(current);\n" " set subm $item_cascade(current);\n"
" catch {destroy $subm}\n" " catch {destroy $subm}\n"
" menu $subm -tearoff 0\n" " menu $subm -tearoff 0 -font $ffont\n"
" $subm add command\n" " $subm add command\n"
" $subm add command -label \"refresh-list\" -command \"update_clients_and_repost\"\n" " $subm add command -label \"refresh-list\" -command \"update_clients_and_repost\"\n"
" $subm add separator\n" " $subm add separator\n"
...@@ -1872,14 +1789,14 @@ ...@@ -1872,14 +1789,14 @@
" global text_area\n" " global text_area\n"
" global entry_box entry_str entry_set entry_label entry_ok entry_browse\n" " global entry_box entry_str entry_set entry_label entry_ok entry_browse\n"
" global entry_help entry_skip\n" " global entry_help entry_skip\n"
" global bfont\n" " global bfont ffont\n"
" global helptext helpremote helplabel\n" " global helptext helpremote helplabel\n"
"\n" "\n"
" set label_width 80\n" " set label_width 80\n"
"\n" "\n"
" set info_label .info\n" " set info_label .info\n"
" label $info_label -textvariable info_str -bd 2 -relief groove \\\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" " pack $info_label -side top -fill x -expand 0\n"
"\n" "\n"
" # Extract the Rows:\n" " # Extract the Rows:\n"
...@@ -1995,11 +1912,13 @@ ...@@ -1995,11 +1912,13 @@
" } elseif {$item == \"Quit\"} {\n" " } elseif {$item == \"Quit\"} {\n"
" # Quit item must shut us down:\n" " # Quit item must shut us down:\n"
" $m add command -label \"$item\" -underline 0 \\\n" " $m add command -label \"$item\" -underline 0 \\\n"
" -font $ffont \\\n"
" -command {destroy .; exit 0}\n" " -command {destroy .; exit 0}\n"
"\n" "\n"
" } elseif {$case == \"Help\"} {\n" " } elseif {$case == \"Help\"} {\n"
" # Help is simple help:\n" " # Help is simple help:\n"
" $m add command -label \"$item\" \\\n" " $m add command -label \"$item\" \\\n"
" -font $ffont \\\n"
" -command \"menu_help $item\"\n" " -command \"menu_help $item\"\n"
"\n" "\n"
" } elseif {$item == \"current\"} {\n" " } elseif {$item == \"current\"} {\n"
...@@ -2008,11 +1927,13 @@ ...@@ -2008,11 +1927,13 @@
" set item_cascade($item) $subm\n" " set item_cascade($item) $subm\n"
" update_clients_menu \"\"\n" " update_clients_menu \"\"\n"
" $m add cascade -label \"$item\" \\\n" " $m add cascade -label \"$item\" \\\n"
" -font $ffont \\\n"
" -menu $subm\n" " -menu $subm\n"
"\n" "\n"
" } elseif {[is_action $item]} {\n" " } elseif {[is_action $item]} {\n"
" # Action\n" " # Action\n"
" $m add command -label \"$item\" \\\n" " $m add command -label \"$item\" \\\n"
" -font $ffont \\\n"
" -command \"do_var $item\"\n" " -command \"do_var $item\"\n"
" set menu_var($item) \"\"; # for convenience\n" " set menu_var($item) \"\"; # for convenience\n"
"\n" "\n"
...@@ -2021,19 +1942,22 @@ ...@@ -2021,19 +1942,22 @@
" if {[regexp -- {-C:(.*)} $item_opts($item) m0 m1]} {\n" " if {[regexp -- {-C:(.*)} $item_opts($item) m0 m1]} {\n"
" # Radiobutton select\n" " # Radiobutton select\n"
" set subm $m.cascade$menu_count($case)\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" " foreach val [split $m1 \",\"] {\n"
" $subm add radiobutton -label \"$val\" \\\n" " $subm add radiobutton -label \"$val\" \\\n"
" -command \"do_var $item\" \\\n" " -command \"do_var $item\" \\\n"
" -value \"$val\" \\\n" " -value \"$val\" \\\n"
" -font $ffont \\\n"
" -variable menu_var($item)\n" " -variable menu_var($item)\n"
" }\n" " }\n"
" $m add cascade -label \"$item\" \\\n" " $m add cascade -label \"$item\" \\\n"
" -font $ffont \\\n"
" -menu $subm\n" " -menu $subm\n"
" set item_cascade($item) $subm\n" " set item_cascade($item) $subm\n"
" } else {\n" " } else {\n"
" # Arbitrary_string\n" " # Arbitrary_string\n"
" $m add command -label \"$item\" \\\n" " $m add command -label \"$item\" \\\n"
" -font $ffont \\\n"
" -command \"do_var $item\"\n" " -command \"do_var $item\"\n"
" }\n" " }\n"
" set mvar 1\n" " set mvar 1\n"
...@@ -2042,6 +1966,7 @@ ...@@ -2042,6 +1966,7 @@
" # Boolean\n" " # Boolean\n"
" $m add checkbutton -label \"$item\" \\\n" " $m add checkbutton -label \"$item\" \\\n"
" -command \"do_var $item\" \\\n" " -command \"do_var $item\" \\\n"
" -font $ffont \\\n"
" -variable menu_var($item)\n" " -variable menu_var($item)\n"
" set menu_var($item) 0\n" " set menu_var($item) 0\n"
" }\n" " }\n"
...@@ -2075,6 +2000,7 @@ ...@@ -2075,6 +2000,7 @@
" set str \"(?)\"\n" " set str \"(?)\"\n"
" }\n" " }\n"
" $m add command -label $str \\\n" " $m add command -label $str \\\n"
" -font $ffont \\\n"
" -command \"menu_help $label\";\n" " -command \"menu_help $label\";\n"
"\n" "\n"
" if {$str == \"\"} {\n" " if {$str == \"\"} {\n"
...@@ -2100,17 +2026,19 @@ ...@@ -2100,17 +2026,19 @@
" no_x11_display\n" " no_x11_display\n"
"\n" "\n"
" set lw [expr {$label_width / 2}]\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" "\n"
" set df_vnc \"$df.vdisplay\"\n" " set df_vnc \"$df.vdisplay\"\n"
" no_vnc_display\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" "\n"
" pack $df_x11 $df_vnc -side left \n" " pack $df_x11 $df_vnc -side left \n"
" pack $df -side top -fill x\n" " pack $df -side top -fill x\n"
"\n" "\n"
" # text area\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" " set text_area .text\n"
" pack .text -side top -fill both -expand 1\n" " pack .text -side top -fill both -expand 1\n"
"\n" "\n"
...@@ -2128,28 +2056,35 @@ ...@@ -2128,28 +2056,35 @@
"\n" "\n"
" set entry_str \"Set... : \"\n" " set entry_str \"Set... : \"\n"
" set ef_entry \"$ef.entry\"\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-Return> {set entry_set 1}\n"
" bind $ef_entry <KeyPress-Escape> {set entry_set 0}\n" " bind $ef_entry <KeyPress-Escape> {set entry_set 0}\n"
"\n" "\n"
" # Entry OK button\n" " # Entry OK button\n"
" set bpx \"1m\"\n"
" set bpy \"1\"\n"
" set hlt \"0\"\n"
" set ef_ok \"$ef.ok\"\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" " -font $bfont\n"
"\n" "\n"
" # Entry Skip button\n" " # Entry Skip button\n"
" set ef_skip \"$ef.skip\"\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" " -font $bfont\n"
"\n" "\n"
" # Entry Help button\n" " # Entry Help button\n"
" set ef_help \"$ef.help\"\n" " set ef_help \"$ef.help\"\n"
" button $ef_help -text Help -pady 0 -command \\\n" " button $ef_help -text Help -pady $bpy -padx $bpx -command \\\n"
" {menu_help $entry_dialog_item} -font $bfont\n" " {menu_help $entry_dialog_item} -font $bfont \\\n"
" -highlightthickness $hlt\n"
"\n" "\n"
" # Entry Browse button\n" " # Entry Browse button\n"
" set ef_browse \"$ef.browse\"\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" " -command {entry_insert [tk_getOpenFile]} \n"
"\n" "\n"
" pack $ef_label -side left\n" " pack $ef_label -side left\n"
...@@ -2322,6 +2257,9 @@ ...@@ -2322,6 +2257,9 @@
" if {$item == \"id\"} {\n" " if {$item == \"id\"} {\n"
" set saw_id 1\n" " set saw_id 1\n"
" }\n" " }\n"
" if {$item == \"httpport\" && $menu_var($item) == \"0\"} {\n"
" continue\n"
" }\n"
" if {$item == \"progressive\" && $menu_var($item) == \"0\"} {\n" " if {$item == \"progressive\" && $menu_var($item) == \"0\"} {\n"
" continue\n" " continue\n"
" }\n" " }\n"
...@@ -2525,7 +2463,7 @@ ...@@ -2525,7 +2463,7 @@
"global all_settings reply_xdisplay always_update\n" "global all_settings reply_xdisplay always_update\n"
"global max_text_height max_text_width\n" "global max_text_height max_text_width\n"
"global menu_var unset_str menus_disabled\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 connected_to_x11vnc\n"
"global delay_sleep extra_sleep extra_sleep_split\n" "global delay_sleep extra_sleep extra_sleep_split\n"
"global cache_all_query_vars\n" "global cache_all_query_vars\n"
...@@ -2535,7 +2473,8 @@ ...@@ -2535,7 +2473,8 @@
"set menus_disabled 0\n" "set menus_disabled 0\n"
"set max_text_height 40\n" "set max_text_height 40\n"
"set max_text_width 90\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 help_indent 24;\n"
"set reply_xdisplay \"\"\n" "set reply_xdisplay \"\"\n"
"set all_settings \"None so far.\"\n" "set all_settings \"None so far.\"\n"
......
.\" This file was automatically generated from x11vnc -help output. .\" 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 .SH NAME
x11vnc - allow VNC connections to real X11 displays 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 .SH SYNOPSIS
.B x11vnc .B x11vnc
[OPTION]... [OPTION]...
...@@ -57,7 +57,7 @@ environment variable to \fIdisp\fR. ...@@ -57,7 +57,7 @@ environment variable to \fIdisp\fR.
\fB-auth\fR \fIfile\fR \fB-auth\fR \fIfile\fR
.IP .IP
Set the X authority file to be \fIfile\fR, equivalent to 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 before startup. See
.IR Xsecurity (7) .IR Xsecurity (7)
, ,
...@@ -407,7 +407,8 @@ to handle all subsequent resizes (e.g. under \fB-xrandr,\fR ...@@ -407,7 +407,8 @@ to handle all subsequent resizes (e.g. under \fB-xrandr,\fR
\fB-o\fR \fIlogfile\fR \fB-o\fR \fIlogfile\fR
.IP .IP
Write stderr messages to file \fIlogfile\fR instead of 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 .PP
\fB-rc\fR \fIfilename\fR \fB-rc\fR \fIfilename\fR
.IP .IP
...@@ -623,7 +624,7 @@ cursors with transparency will not be displayed exactly ...@@ -623,7 +624,7 @@ cursors with transparency will not be displayed exactly
for cursors that have transparency ("alpha channel" for cursors that have transparency ("alpha channel"
with values ranging from 0 to 255) Any cursor pixel with with values ranging from 0 to 255) Any cursor pixel with
alpha value less than n becomes completely transparent. 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 .IP
Note: the options \fB-alphacut,\fR \fB-alphafrac,\fR and \fB-alphafrac\fR Note: the options \fB-alphacut,\fR \fB-alphafrac,\fR and \fB-alphafrac\fR
may be removed if a more accurate internal method for may be removed if a more accurate internal method for
...@@ -646,6 +647,17 @@ black background). Specify this option to remove the ...@@ -646,6 +647,17 @@ black background). Specify this option to remove the
alpha factor. (useful for light colored semi-transparent alpha factor. (useful for light colored semi-transparent
cursors). cursors).
.PP .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 \fB-nocursorshape\fR
.IP .IP
Do not use the TightVNC CursorShapeUpdates extension Do not use the TightVNC CursorShapeUpdates extension
...@@ -699,36 +711,59 @@ To include button events use "Button1", ... etc. ...@@ -699,36 +711,59 @@ To include button events use "Button1", ... etc.
.PP .PP
\fB-nodragging\fR \fB-nodragging\fR
.IP .IP
Do not update the display during mouse dragging Do not update the display during mouse dragging events
events (mouse motion with a button held down). (mouse button held down). Greatly improves response on
Greatly improves response on slow setups, but you lose slow setups, but you lose all visual feedback for drags,
all visual feedback for drags, text selection, and some text selection, and some menu traversals. It overrides
menu traversals. It overrides any \fB-pointer_mode\fR setting any \fB-pointer_mode\fR setting
(think of it as pointer_mode 0)
.PP .PP
\fB-pointer_mode\fR \fIn\fR \fB-pointer_mode\fR \fIn\fR
.IP .IP
Various pointer update schemes. The problem is pointer Various pointer motion update schemes. "\fB-pm\fR" is
motion can cause rapid changes on the screen, e.g. a an alias. The problem is pointer motion can cause
window drag. Neither x11vnc's screen polling nor the 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 bandwidth to the vncviewers can keep up these rapid
screen changes: everything bogs down when dragging screen changes: everything will bog down when dragging
or scrolling. Note that most video h/w is optimized or scrolling. So a scheme has to be used to "eat"
for writing, not reading (a 50X rate difference is much of that pointer input before re-polling the screen
possible) and x11vnc is reading all the time. So a and sending out framebuffer updates. The mode number
scheme has to be used to "eat" much of that pointer \fIn\fR can be 0 to 4 and selects one of the schemes
input before re-polling the screen. n can be 1 to 4. desribed below.
.IP .IP
n=1 was the original scheme used to about Jan 2004: it n=0: does the same as \fB-nodragging.\fR (all screen polling
basically just skips \fB-input_skip\fR pointer events before is suspended if a mouse button is pressed.)
repolling the screen. n=2 is an improved scheme: .IP
by watching the current rate it tries to detect if n=1: was the original scheme used to about Jan 2004:
it should try to "eat" more pointer events. n=3 is it basically just skips \fB-input_skip\fR keyboard or pointer
basically a dynamic \fB-nodragging\fR mode: it detects if the events before repolling the screen.
mouse drag motion has paused and refreshes the display. .IP
n=4 is TBD, it will try measure screen read and client n=2 is an improved scheme: by watching the current rate
write rates and try to insert "frames" between the of input events it tries to detect if it should try to
on/off states of mode 3. The default n is 2. "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 .PP
\fB-input_skip\fR \fIn\fR \fB-input_skip\fR \fIn\fR
.IP .IP
...@@ -737,6 +772,32 @@ read n user input events before scanning display. n < 0 ...@@ -737,6 +772,32 @@ read n user input events before scanning display. n < 0
means to act as though there is always user input. means to act as though there is always user input.
Default: 10 Default: 10
.PP .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 \fB-debug_pointer\fR
.IP .IP
Print debugging output for every pointer event. Print debugging output for every pointer event.
...@@ -803,6 +864,22 @@ by checking the tile near the boundary. Default: 3 ...@@ -803,6 +864,22 @@ by checking the tile near the boundary. Default: 3
Tolerance in pixels to mark a tiles edges as changed. Tolerance in pixels to mark a tiles edges as changed.
Default: 2 Default: 2
.PP .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 \fB-gui\fR \fI[gui-opts]\fR
.IP .IP
Start up a simple tcl/tk gui based on the the remote Start up a simple tcl/tk gui based on the the remote
...@@ -1073,6 +1150,10 @@ alpharemove enable \fB-alpharemove\fR mode. ...@@ -1073,6 +1150,10 @@ alpharemove enable \fB-alpharemove\fR mode.
.IP .IP
noalpharemove disable \fB-alpharemove\fR mode. noalpharemove disable \fB-alpharemove\fR mode.
.IP .IP
alphablend enable \fB-alphablend\fR mode.
.IP
noalphablend disable \fB-alphablend\fR mode.
.IP
cursorshape disable \fB-nocursorshape\fR mode. cursorshape disable \fB-nocursorshape\fR mode.
.IP .IP
nocursorshape enable \fB-nocursorshape\fR mode. nocursorshape enable \fB-nocursorshape\fR mode.
...@@ -1091,9 +1172,11 @@ dragging disable \fB-nodragging\fR mode. ...@@ -1091,9 +1172,11 @@ dragging disable \fB-nodragging\fR mode.
.IP .IP
nodragging enable \fB-nodragging\fR mode. nodragging enable \fB-nodragging\fR mode.
.IP .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 .IP
input_skip n set \fB-input_skip\fR to n. speeds:str set \fB-speeds\fR to str.
.IP .IP
debug_pointer enable \fB-debug_pointer,\fR same as "dp" debug_pointer enable \fB-debug_pointer,\fR same as "dp"
.IP .IP
...@@ -1123,6 +1206,10 @@ grow:n set \fB-grow\fR to n. ...@@ -1123,6 +1206,10 @@ grow:n set \fB-grow\fR to n.
.IP .IP
fuzz:n set \fB-fuzz\fR to n. fuzz:n set \fB-fuzz\fR to n.
.IP .IP
snapfb enable \fB-snapfb\fR mode.
.IP
nosnapfb disable \fB-snapfb\fR mode.
.IP
progressive:n set libvncserver \fB-progressive\fR slice progressive:n set libvncserver \fB-progressive\fR slice
height parameter to n. height parameter to n.
.IP .IP
...@@ -1215,29 +1302,30 @@ the returned value corresponds to (hint: the ext_* ...@@ -1215,29 +1302,30 @@ the returned value corresponds to (hint: the ext_*
variables correspond to the presence of X extensions): variables correspond to the presence of X extensions):
.IP .IP
ans= stop quit exit shutdown ping blacken zero ans= stop quit exit shutdown ping blacken zero
refresh reset close disconnect id sid flashcmap refresh reset close disconnect id sid waitmapped
noflashcmap truecolor notruecolor overlay nooverlay nowaitmapped flashcmap noflashcmap truecolor notruecolor
overlay_cursor overlay_yescursor nooverlay_nocursor overlay nooverlay overlay_cursor overlay_yescursor
nooverlay_cursor nooverlay_yescursor overlay_nocursor nooverlay_nocursor nooverlay_cursor nooverlay_yescursor
visual scale viewonly noviewonly shared noshared overlay_nocursor visual scale viewonly noviewonly
forever noforever once deny lock nodeny unlock shared noshared forever noforever once deny lock nodeny
connect allowonce allow localhost nolocalhost accept unlock connect allowonce allow localhost nolocalhost
gone shm noshm flipbyteorder noflipbyteorder onetile accept gone shm noshm flipbyteorder noflipbyteorder
noonetile blackout xinerama noxinerama xrandr noxrandr onetile noonetile blackout xinerama noxinerama xrandr
xrandr_mode padgeom quiet q noquiet modtweak nomodtweak noxrandr xrandr_mode padgeom quiet q noquiet modtweak
xkb noxkb skip_keycodes add_keysyms noadd_keysyms nomodtweak xkb noxkb skip_keycodes add_keysyms
clear_mods noclear_mods clear_keys noclear_keys noadd_keysyms clear_mods noclear_mods clear_keys
remap repeat norepeat fb nofb bell nobell sel noclear_keys remap repeat norepeat fb nofb bell nobell
nosel primary noprimary cursorshape nocursorshape sel nosel primary noprimary cursorshape nocursorshape
cursorpos nocursorpos cursor show_cursor noshow_cursor cursorpos nocursorpos cursor show_cursor noshow_cursor
nocursor xfixes noxfixes alphacut alphafrac alpharemove nocursor xfixes noxfixes alphacut alphafrac
noalpharemove xwarp xwarppointer noxwarp noxwarppointer alpharemove noalpharemove alphablend noalphablend
buttonmap dragging nodragging pointer_mode input_skip xwarp xwarppointer noxwarp noxwarppointer buttonmap
debug_pointer dp nodebug_pointer nodp debug_keyboard dragging nodragging pointer_mode pm input_skip speeds
dk nodebug_keyboard nodk deferupdate defer wait debug_pointer dp nodebug_pointer nodp debug_keyboard dk
rfbwait nap nonap sb screen_blank fs gaps grow fuzz nodebug_keyboard nodk deferupdate defer wait rfbwait
progressive rfbport http nohttp httpport httpdir nap nonap sb screen_blank fs gaps grow fuzz snapfb
enablehttpproxy noenablehttpproxy alwaysshared nosnapfb progressive rfbport http nohttp httpport
httpdir enablehttpproxy noenablehttpproxy alwaysshared
noalwaysshared nevershared noalwaysshared dontdisconnect noalwaysshared nevershared noalwaysshared dontdisconnect
nodontdisconnect desktop noremote nodontdisconnect desktop noremote
.IP .IP
......
This source diff could not be displayed because it is too large. You can view the blob instead.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment