summaryrefslogtreecommitdiffstats
path: root/x11vnc/tkx11vnc.h
diff options
context:
space:
mode:
authorrunge <runge>2008-11-22 18:36:33 +0000
committerrunge <runge>2008-11-22 18:36:33 +0000
commit6fbba525a924961083bf2e43bb841bd15671f526 (patch)
tree3ec0cf4b285fb0140294a151b801c91bc78a612e /x11vnc/tkx11vnc.h
parent63b98dba790fa9835e970b8502d93258862a9373 (diff)
downloadlibtdevnc-6fbba525a924961083bf2e43bb841bd15671f526.tar.gz
libtdevnc-6fbba525a924961083bf2e43bb841bd15671f526.zip
x11vnc: x11vnc.desktop file. -reopen, -dhparams, -sslCRL,
-setdefer options. -rfbport PROMPT VeNCrypt and TLSVNC SSL/TLS encryption support. Tweaks to choose_delay() algorithm. -ssl ANON anonymouse Diffie-Hellman mode. Fix bugs in certs management. Additions to tray=setpass naive user mode.
Diffstat (limited to 'x11vnc/tkx11vnc.h')
-rw-r--r--x11vnc/tkx11vnc.h592
1 files changed, 517 insertions, 75 deletions
diff --git a/x11vnc/tkx11vnc.h b/x11vnc/tkx11vnc.h
index dcc4ce5..b40c21d 100644
--- a/x11vnc/tkx11vnc.h
+++ b/x11vnc/tkx11vnc.h
@@ -134,7 +134,7 @@ char gui_code[] = "";
" afteraccept:\n"
" gone:\n"
" vncconnect\n"
-" avahi\n"
+" zeroconf\n"
" -- D\n"
" tightfilexfer\n"
" ultrafilexfer\n"
@@ -719,6 +719,8 @@ char gui_code[] = "";
" Stop x11vnc - Directs the x11vnc server to disconnect all vncviewers\n"
" and then exit. The tray/icon GUI then exits as well.\n"
"\n"
+" Logfile - Show the logfile if x11vnc is being run with one.\n"
+"\n"
" Custom - If you have a \\$HOME/.x11vnc.gui file each uncommented\n"
" line in it becomes an additional menu item for this\n"
" menu. The remote control command is run directly\n"
@@ -766,42 +768,78 @@ char gui_code[] = "";
"running x11vnc server. After modifying them press \\\"OK\\\" or \\\"Apply\\\"\n"
"to apply the changes, or press \\\"Cancel\\\" to skip applying them.\n"
"\n"
-" - \\\"Accept Connections\\\" toggles whether VNC viewers are allowed\n"
-" to connect or not. It corresponds to the \\\"-R unlock\\\" and \\\"-R lock\\\"\n"
-" remote-control commands.\n"
-" \n"
-" - \\\"Ask for Confirmation\\\" toggles whether a popup menu will be presented\n"
-" at the X display when a new VNC viewer attempts to connect. The person\n"
-" sitting at the X display can choose to accept or reject the connection\n"
-" or accept the connection in View-Only mode. It corresponds to the \n"
-" \\\"-R accept:popup\\\" and \\\"-R accept:\\\" remote-control commands.\n"
+" Accept Connections:\n"
+"\n"
+" Toggles whether VNC viewers are allowed to connect or not. It corresponds\n"
+" to the \\\"-R unlock\\\" and \\\"-R lock\\\" remote-control commands.\n"
+"\n"
+" Ask for Confirmation:\n"
+"\n"
+" Toggles whether a popup menu will be presented at the X display when\n"
+" a new VNC viewer attempts to connect. The person sitting at the X\n"
+" display can choose to accept or reject the connection or accept the\n"
+" connection in ViewOnly mode. It corresponds to the \\\"-R accept:popup\\\"\n"
+" and \\\"-R accept:\\\" remote-control commands.\n"
" \n"
-" - \\\"All Clients ViewOnly\\\" toggles whether the entire VNC desktop is\n"
-" view only. All clients will only be able to watch when this is set\n"
-" (regardless of how they logged in). It corresponds to the\n"
-" \\\"-R viewonly\\\" and \\\"-R noviewonly\\\" remote-control commands.\n"
+" All Clients ViewOnly:\n"
+"\n"
+" Toggles whether the entire VNC desktop is view only. All clients\n"
+" will only be able to watch when this is set (regardless of how they\n"
+" logged in). It corresponds to the \\\"-R viewonly\\\" and \\\"-R noviewonly\\\"\n"
+" remote-control commands.\n"
" \n"
-" - \\\"Shared\\\" toggles whether multiple simultaneous connections are\n"
-" allowed or not. It corresponds to the \\\"-R shared\\\" and \\\"-R noshared\\\"\n"
+" Shared:\n"
+"\n"
+" Toggles whether multiple simultaneous viewer connections are allowed\n"
+" or not. It corresponds to the \\\"-R shared\\\" and \\\"-R noshared\\\"\n"
" remote-control commands.\n"
"\n"
-" - \\\"Password\\\" lets you set the session password viewers may use to gain full\n"
-" access to the display. This will only work if x11vnc was started with \n"
-" the -gui icon or -gui tray mode.\n"
+" Advertise Service (Zeroconf):\n"
+"\n"
+" Toggles whether this VNC server should advertize itself via Zeroconf\n"
+" (also called Bonjour, mDNS, and avahi). Then VNC viewers can then find\n"
+" this service on the local network. It corresponds to the \\\"-R zeroconf\\\"\n"
+" and \\\"-R nozeroconf\\\" remote-control commands.\n"
+"\n"
+" Serve Java Viewer Applet:\n"
+"\n"
+" Toggles whether this VNC server should serve up a Java VNC Viewer\n"
+" applet via HTTP on http://hostname:5800/ (or port 5800+n for VNC\n"
+" port 5900+n). A java enabled Web Browser can then connect to the\n"
+" desktopby VNC. If SSL is active then the HTTPS URL https://hostname:5900/\n"
+" (etc.) will work as well. This requires the x11vnc java viewer jar file\n"
+" (shared/x11vnc/classes) to be installed. It corresponds to the\n"
+" \\\"-R http\\\" and \\\"-R nohttp\\\" remote commands.\n"
+"\n"
+" Solid Background Color:\n"
+"\n"
+" To improve VNC performance, if this option is set, then x11vnc will try\n"
+" to make the desktop background a solid color (which compresses extremely\n"
+" well compared to photo images, etc.) It corresponds to the \\\"-R solid\\\"\n"
+" and \\\"-R nosolid\\\" remote commands.\n"
+"\n"
+" Password:\n"
+"\n"
+" Lets you set the session password viewers may use to gain full access\n"
+" to the display. This will only work if x11vnc was started with the\n"
+" -gui icon or -gui tray mode.\n"
" \n"
-" - \\\"ViewOnly Password\\\" lets you set the session password viewers may\n"
-" use to gain view only access to the display. This will only work if\n"
-" x11vnc was started with the -gui icon or -gui tray mode.\n"
+" ViewOnly Password:\n"
+"\n"
+" Lets you set the session password viewers may use to gain view only\n"
+" access to the display. This will only work if x11vnc was started with\n"
+" the -gui icon or -gui tray mode.\n"
+"\n"
"\n"
-"NOTE: These \\\"session\\\" passwords only last for the current x11vnc\n"
-"session (they are not remembered, see the -storepasswd, -passwdfile,\n"
-"and -rfbauth x11vnc options for using stored passwords).\n"
+" NOTE: These \\\"session\\\" passwords only last for the current x11vnc\n"
+" session (they are not remembered, see the -storepasswd, -passwdfile,\n"
+" and -rfbauth x11vnc options for using stored passwords).\n"
"\n"
-"If you set \\\"Password\\\" to the empty string that makes the \\\"View-Only\n"
-"Password\\\" empty as well and removes the need for any password to log in.\n"
+" If you set \\\"Password\\\" to the empty string that makes the \\\"ViewOnly\n"
+" Password\\\" empty as well and removes the need for any password to log in.\n"
"\n"
-"If you set \\\"ViewOnly Password\\\" to the empty string that just removes\n"
-"the ViewOnly log in aspect: \\\"Password\\\" is still required to log in.\n"
+" If you set \\\"ViewOnly Password\\\" to the empty string that just removes\n"
+" the ViewOnly log in aspect: \\\"Password\\\" is still required to log in.\n"
"\n"
" - The \\\"Help\\\" button shows this help text.\n"
" \n"
@@ -809,7 +847,8 @@ char gui_code[] = "";
" tkx11vnc GUI. All dynamic settings can be modified in the full GUI.\n"
"\n"
"\n"
-"--------------------------------------------------------------------\n"
+"==========================================================================\n"
+"\n"
"Don't Lock Yourself Out:\n"
"\n"
" If you are sitting at the physical X display you cannot get into too\n"
@@ -1659,6 +1698,9 @@ char gui_code[] = "";
" if {[regexp {^These options} $line]} {\n"
" continue;\n"
" }\n"
+" # tweak aliases:\n"
+" regsub {^-zeroconf} $line \"-zero_conf\" line\n"
+" regsub {^-avahi } $line \"-zeroconf\" line\n"
"\n"
" if {! $sawopts} {\n"
" continue;\n"
@@ -2923,6 +2965,8 @@ char gui_code[] = "";
" }\n"
" set cache_all_query_vars $qry\n"
"\n"
+"#puts $qry\n"
+"\n"
" return $qry\n"
"}\n"
"\n"
@@ -2930,6 +2974,7 @@ char gui_code[] = "";
" global query_ans_list query_aro_list all_settings\n"
" global last_query_all_time\n"
"\n"
+" dtime 1\n"
" set qry [all_query_vars]\n"
"\n"
" set qargs [list \"-Q\" $qry]\n"
@@ -2947,6 +2992,7 @@ char gui_code[] = "";
" }\n"
" }\n"
" set last_query_all_time [clock seconds]\n"
+" dtime 2\n"
" return $all\n"
"}\n"
"\n"
@@ -4034,9 +4080,11 @@ char gui_code[] = "";
"}\n"
"\n"
"proc props_apply {} {\n"
-" global props_accept props_confirm props_viewonly props_shared\n"
+" global props_accept props_confirm props_viewonly props_shared \n"
+" global props_zeroconf props_javaview props_solid\n"
" global props_passwd props_viewpasswd\n"
" global prop0_accept prop0_confirm prop0_viewonly prop0_shared\n"
+" global prop0_zeroconf prop0_javaview prop0_solid\n"
" global prop0_passwd prop0_viewpasswd\n"
" global menu_var\n"
" global client_sock\n"
@@ -4051,15 +4099,7 @@ char gui_code[] = "";
" }\n"
" set did 0\n"
"\n"
-" if {$props_accept != $prop0_accept} {\n"
-" if {$did > 0} {after $aft}; incr did\n"
-" if {$props_accept} {\n"
-" push_new_value \"unlock\" \"unlock\" 1 0\n"
-" } else {\n"
-" push_new_value \"lock\" \"lock\" 1 0\n"
-" }\n"
-" set prop0_accept $props_accept\n"
-" }\n"
+" set fail 0\n"
"\n"
" if {$props_confirm != $prop0_confirm} {\n"
" if {$did > 0} {after $aft}; incr did\n"
@@ -4073,6 +4113,7 @@ char gui_code[] = "";
" } elseif {$menu_var(accept) == \"\"} {\n"
" set props_confirm 0\n"
" }\n"
+" if {$props_confirm == $prop0_confirm} {incr fail}\n"
" set prop0_confirm $props_confirm\n"
" }\n"
"\n"
@@ -4088,6 +4129,7 @@ char gui_code[] = "";
" } else {\n"
" set props_viewonly 0\n"
" }\n"
+" if {$props_viewonly == $prop0_viewonly} {incr fail}\n"
" set prop0_viewonly $props_viewonly\n"
" }\n"
"\n"
@@ -4103,9 +4145,58 @@ char gui_code[] = "";
" } else {\n"
" set props_shared 0\n"
" }\n"
+" if {$props_shared == $prop0_shared} {incr fail}\n"
" set prop0_shared $props_shared\n"
" }\n"
"\n"
+" if {$props_zeroconf != $prop0_zeroconf} {\n"
+" if {$did > 0} {after $aft}; incr did\n"
+" if {$props_zeroconf} {\n"
+" push_new_value \"zeroconf\" \"zeroconf\" 1 1\n"
+" } else {\n"
+" push_new_value \"zeroconf\" \"nozeroconf\" 1 1\n"
+" }\n"
+" if {$menu_var(zeroconf)} {\n"
+" set props_zeroconf 1\n"
+" } else {\n"
+" set props_zeroconf 0\n"
+" }\n"
+" if {$props_zeroconf == $prop0_zeroconf} {incr fail}\n"
+" set prop0_zeroconf $props_zeroconf\n"
+" }\n"
+"\n"
+" if {$props_javaview != $prop0_javaview} {\n"
+" if {$did > 0} {after $aft}; incr did\n"
+" if {$props_javaview} {\n"
+" push_new_value \"http\" \"http\" 1 1\n"
+" } else {\n"
+" push_new_value \"http\" \"nohttp\" 1 1\n"
+" }\n"
+" if {$menu_var(http)} {\n"
+" set props_javaview 1\n"
+" } else {\n"
+" set props_javaview 0\n"
+" }\n"
+" if {$props_javaview == $prop0_javaview} {incr fail}\n"
+" set prop0_javaview $props_javaview\n"
+" }\n"
+"\n"
+" if {$props_solid != $prop0_solid} {\n"
+" if {$did > 0} {after $aft}; incr did\n"
+" if {$props_solid} {\n"
+" push_new_value \"solid\" \"solid\" 1 1\n"
+" } else {\n"
+" push_new_value \"solid\" \"nosolid\" 1 1\n"
+" }\n"
+" if {$menu_var(solid)} {\n"
+" set props_solid 1\n"
+" } else {\n"
+" set props_solid 0\n"
+" }\n"
+" if {$props_solid == $prop0_solid} {incr fail}\n"
+" set prop0_solid $props_solid\n"
+" }\n"
+"\n"
" set fpw 0\n"
" if {$props_passwd != $prop0_passwd} {\n"
" set fpw 1\n"
@@ -4170,16 +4261,34 @@ char gui_code[] = "";
" if {$case == \"fpw\"} {\n"
" if {$did > 0} {after $aft}; incr did\n"
" push_new_value \"passwd\" \"passwd\" \"$props_passwd\" 1\n"
+" if {$props_passwd == $prop0_passwd} {incr fail}\n"
" set prop0_passwd $props_passwd\n"
" }\n"
" if {$case == \"vpw\"} {\n"
" if {$did > 0} {after $aft}; incr did\n"
" push_new_value \"viewpasswd\" \"viewpasswd\" \"$props_viewpasswd\" 1\n"
+" if {$props_viewpasswd == $prop0_viewpasswd} {incr fail}\n"
" set prop0_viewpasswd $props_viewpasswd\n"
" }\n"
" }\n"
"\n"
+" if {$props_accept != $prop0_accept} {\n"
+" if {$did > 0} {after $aft}; incr did\n"
+" if {$props_accept} {\n"
+" push_new_value \"unlock\" \"unlock\" 1 0\n"
+" } else {\n"
+" push_new_value \"lock\" \"lock\" 1 0\n"
+" }\n"
+" if {$props_accept == $prop0_accept} {incr fail}\n"
+" set prop0_accept $props_accept\n"
+" }\n"
+"\n"
" props_widgets normal\n"
+" if {$fail > 0} {\n"
+" return 0\n"
+" } else {\n"
+" return 1\n"
+" }\n"
"}\n"
"\n"
"proc props_advanced {} {\n"
@@ -4203,20 +4312,29 @@ char gui_code[] = "";
" }\n"
"}\n"
"\n"
-"proc do_props {{msg \"\"}} {\n"
+"proc do_props {} {\n"
" global props_accept props_confirm props_viewonly props_shared\n"
+" global props_zeroconf props_javaview props_solid\n"
" global props_passwd props_viewpasswd\n"
" global prop0_accept prop0_confirm prop0_viewonly prop0_shared\n"
+" global prop0_zeroconf prop0_javaview prop0_solid\n"
" global prop0_passwd prop0_viewpasswd\n"
" global menu_var unset_str\n"
" global have_labelframes ffont bfont\n"
" global props_buttons icon_noadvanced\n"
" global icon_mode icon_mode_at_startup\n"
" global screen_height screen_width\n"
+" global do_props_msg\n"
+"\n"
+" set msg \"\"\n"
+" if {[info exists do_props_msg]} {\n"
+" set msg $do_props_msg\n"
+" }\n"
"\n"
" check_update_vars\n"
"\n"
-" set pady 1m\n"
+" set pady 0.5m\n"
+" set pady 0.3m\n"
" if {$screen_height <= 360} {\n"
" set pady 0m\n"
" }\n"
@@ -4273,6 +4391,48 @@ char gui_code[] = "";
" }\n"
" set prop0_shared $props_shared\n"
"\n"
+" if [info exists menu_var(zeroconf)] {\n"
+" if {$menu_var(zeroconf) == $unset_str || $menu_var(zeroconf) == \"\"} {\n"
+" set props_zeroconf 0\n"
+" } elseif ($menu_var(zeroconf)) {\n"
+" set props_zeroconf 1\n"
+" } else {\n"
+" set props_zeroconf 0\n"
+" }\n"
+" } else {\n"
+" set menu_var(zeroconf) 0\n"
+" set props_zeroconf 0\n"
+" }\n"
+" set prop0_zeroconf $props_zeroconf\n"
+"\n"
+" if [info exists menu_var(http)] {\n"
+" if {$menu_var(http) == $unset_str || $menu_var(http) == \"\"} {\n"
+" set props_javaview 0\n"
+" } elseif ($menu_var(http)) {\n"
+" set props_javaview 1\n"
+" } else {\n"
+" set props_javaview 0\n"
+" }\n"
+" } else {\n"
+" set menu_var(http) 0\n"
+" set props_javaview 0\n"
+" }\n"
+" set prop0_javaview $props_javaview\n"
+"\n"
+" if [info exists menu_var(solid)] {\n"
+" if {$menu_var(solid) == $unset_str || $menu_var(solid) == \"\"} {\n"
+" set props_solid 0\n"
+" } elseif ($menu_var(solid)) {\n"
+" set props_solid 1\n"
+" } else {\n"
+" set props_solid 0\n"
+" }\n"
+" } else {\n"
+" set menu_var(solid) 0\n"
+" set props_solid 0\n"
+" }\n"
+" set prop0_solid $props_solid\n"
+"\n"
" if ![info exists props_passwd] {\n"
" set props_passwd \"\"\n"
" }\n"
@@ -4294,7 +4454,7 @@ char gui_code[] = "";
" wm title $w \"x11vnc Properties\"\n"
" set b1 \"$w.buttons1\"\n"
" frame $b1\n"
-" button $b1.ok -text OK -command \"props_apply; destroy $w\" -font $bfont\n"
+" button $b1.ok -text OK -command \"if {\\[props_apply\\]} {destroy $w}\" -font $bfont\n"
" button $b1.cancel -text Cancel -command \"destroy $w\" -font $bfont\n"
" button $b1.apply -text Apply -command \"props_apply\" -font $bfont\n"
"\n"
@@ -4306,17 +4466,29 @@ char gui_code[] = "";
" set b2 \"$w.buttons2\"\n"
" frame $b2\n"
"\n"
-" button $b2.advanced -text \"Advanced ...\" \\\n"
+" button $b2.advanced -text \" Advanced ... \" \\\n"
" -command \"destroy $w; props_advanced\" -font $bfont\n"
" if {! $icon_noadvanced} {\n"
" lappend props_buttons $b2.advanced\n"
" pack $b2.advanced -side left -expand 0\n"
" }\n"
"\n"
-" button $b2.help -text \"Help\" -command \"menu_help Properties\" -font $bfont\n"
+" button $b2.help -text \" Help \" -command \"menu_help Properties\" -font $bfont\n"
" lappend props_buttons $b2.help\n"
" pack $b2.help -side left -expand 0\n"
"\n"
+" set pw \"$w.passwd\"\n"
+" if {$have_labelframes} {\n"
+" labelframe $pw -text \"Password\" -font $bfont\n"
+" } else {\n"
+" frame $pw\n"
+" set l $pw.l\n"
+" label $l -text \"Password:\" -justify left -anchor w -font $bfont\n"
+" pack $pw.l -fill x -expand 1 -padx 1m -pady 0m -side top\n"
+" }\n"
+" entry $pw.e -show \"*\" -textvariable props_passwd -font $bfont\n"
+" pack $pw.e -fill x -expand 1 -padx 1m -pady $pady -side top\n"
+"\n"
" set vp \"$w.viewpw\"\n"
" if {$have_labelframes} {\n"
" labelframe $vp -text \"ViewOnly Password\" -font $bfont\n"
@@ -4332,18 +4504,6 @@ char gui_code[] = "";
"\n"
" lappend props_buttons $vp.e\n"
"\n"
-" set pw \"$w.passwd\"\n"
-" if {$have_labelframes} {\n"
-" labelframe $pw -text \"Password\" -font $bfont\n"
-" } else {\n"
-" frame $pw\n"
-" set l $pw.l\n"
-" label $l -text \"Password:\" -justify left -anchor w -font $bfont\n"
-" pack $pw.l -fill x -expand 1 -padx 1m -pady 0m -side top\n"
-" }\n"
-" entry $pw.e -show \"*\" -textvariable props_passwd -font $bfont\n"
-" pack $pw.e -fill x -expand 1 -padx 1m -pady $pady -side top\n"
-"\n"
" if {! $icon_mode_at_startup} {\n"
" $vp.e configure -state disabled\n"
" catch {$vp.l configure -state disabled}\n"
@@ -4357,6 +4517,24 @@ char gui_code[] = "";
"\n"
" lappend props_buttons $pw.e\n"
"\n"
+" set sb \"$w.solid\"\n"
+" frame $sb\n"
+" checkbutton $sb.button -text \"Solid Background Color\" \\\n"
+" -variable props_solid -anchor w -font $bfont\n"
+" pack $sb.button -fill x -expand 1 -padx 1m -pady $pady\n"
+"\n"
+" set jv \"$w.javaview\"\n"
+" frame $jv\n"
+" checkbutton $jv.button -text \"Serve Java Viewer Applet\" \\\n"
+" -variable props_javaview -anchor w -font $bfont\n"
+" pack $jv.button -fill x -expand 1 -padx 1m -pady $pady\n"
+"\n"
+" set zc \"$w.zeroconf\"\n"
+" frame $zc\n"
+" checkbutton $zc.button -text \"Advertise Service (Zeroconf)\" \\\n"
+" -variable props_zeroconf -anchor w -font $bfont\n"
+" pack $zc.button -fill x -expand 1 -padx 1m -pady $pady\n"
+"\n"
" set sh \"$w.shared\"\n"
" frame $sh\n"
" checkbutton $sh.button -text \"Shared\" \\\n"
@@ -4386,11 +4564,21 @@ char gui_code[] = "";
" pack $b2 -side bottom -fill x -pady $pady -padx $px\n"
" pack $vp -side bottom -fill x -pady $pady -padx $px\n"
" pack $pw -side bottom -fill x -pady $pady -padx $px\n"
+" pack $sb -side bottom -fill x -pady 0m -padx $px\n"
+" pack $jv -side bottom -fill x -pady 0m -padx $px\n"
+" pack $zc -side bottom -fill x -pady 0m -padx $px\n"
" pack $sh -side bottom -fill x -pady 0m -padx $px\n"
" pack $vo -side bottom -fill x -pady 0m -padx $px\n"
" pack $cf -side bottom -fill x -pady 0m -padx $px\n"
" pack $ac -side bottom -fill x -pady 0m -padx $px\n"
"\n"
+" global show_props_instructions\n"
+" if {![info exists show_props_instructions]} {\n"
+" set show_props_instructions 1\n"
+" }\n"
+"\n"
+" wm withdraw $w\n"
+"\n"
" if {$msg != \"\"} {\n"
" set tw [textwidth $msg]\n"
" set th [textheight $msg]\n"
@@ -4398,18 +4586,46 @@ char gui_code[] = "";
" set ms \"$w.msg\"\n"
" text $ms -font $ffont -relief ridge -width $tw -height $th\n"
" $ms insert 1.0 $msg\n"
-" pack $ms -side bottom -fill x -pady $pady -padx $px\n"
+"\n"
+" set si \"$w.instructions\"\n"
+" frame $si\n"
+" checkbutton $si.button -text \"Show Instructions\" \\\n"
+" -variable show_props_instructions -anchor w -font $bfont \\\n"
+" -command \"toggle_instructions $ms $pady $px\"\n"
+"\n"
+" pack $si.button -fill x -expand 1 -padx 1m -pady $pady\n"
+" pack $si -side bottom -fill x -pady 0m -padx $px\n"
+"\n"
+" if {$show_props_instructions} {\n"
+" pack $ms -side bottom -fill x -pady $pady -padx $px\n"
+" }\n"
+"\n"
" update\n"
" }\n"
"\n"
-" lappend props_buttons $ac.button $cf.button $vo.button $sh.button\n"
+" lappend props_buttons $ac.button $cf.button $vo.button $sh.button $zc.button $jv.button $sb.button\n"
"\n"
+" \n"
+" update\n"
" wm resizable $w 1 0\n"
" center_win $w\n"
" update\n"
-" wm minsize $w [winfo width $w] [winfo height $w]\n"
+"\n"
+" #wm minsize $w [winfo width $w] [winfo height $w]\n"
"\n"
" tkwait window $w\n"
+" set show_props_instructions 0\n"
+"}\n"
+"\n"
+"proc toggle_instructions {ms pady px} {\n"
+" global show_props_instructions\n"
+" if {$show_props_instructions} {\n"
+" pack $ms -side bottom -fill x -pady $pady -padx $px\n"
+" } else {\n"
+" pack forget $ms\n"
+" }\n"
+" catch {pack .props}\n"
+" update\n"
"}\n"
"\n"
"proc do_new_client {} {\n"
@@ -4558,8 +4774,11 @@ char gui_code[] = "";
"proc read_client_info {channel} {\n"
" global x11vnc_client_file client_str client_info_read\n"
" global read_client_info_lock\n"
+" global read_clients\n"
" set db 0\n"
"\n"
+" set read_clients 0\n"
+"\n"
" if {![info exists read_client_info_lock]} {\n"
" set read_client_info_lock 0\n"
" }\n"
@@ -4591,6 +4810,7 @@ char gui_code[] = "";
" ;\n"
" } elseif [regexp {^clients:} $str] {\n"
" regsub {^clients:} $str \"\" str\n"
+" set read_clients 1\n"
" if {$str == \"none\"} {\n"
" set str \"\"\n"
" }\n"
@@ -4603,11 +4823,30 @@ char gui_code[] = "";
" }\n"
"}\n"
"\n"
+"proc check_set_vnc_display {} {\n"
+" \n"
+" global read_clients check_set_vnc_display_done\n"
+"\n"
+" if {[info exists check_set_vnc_display_done]} {\n"
+" return\n"
+" }\n"
+" if {[info exists read_clients]} {\n"
+" if {$read_clients} {\n"
+" after 250\n"
+" query_all\n"
+" global client_str\n"
+" set_client_balloon $client_str\n"
+" set check_set_vnc_display_done 1\n"
+" }\n"
+" }\n"
+"}\n"
+"\n"
"proc read_client_tail {} {\n"
" global client_tail\n"
"\n"
" if {$client_tail != \"\"} {\n"
" read_client_info $client_tail\n"
+" check_set_vnc_display\n"
" }\n"
"}\n"
"\n"
@@ -4616,6 +4855,7 @@ char gui_code[] = "";
"\n"
" if {$client_sock != \"\"} {\n"
" read_client_info $client_sock\n"
+" check_set_vnc_display\n"
" }\n"
"}\n"
"\n"
@@ -5034,6 +5274,7 @@ char gui_code[] = "";
" menu $menu -tearoff 0 -postcommand \"popup_post $menu\"\n"
" $menu add command -font $mfont -label \"Properties\" -command do_props\n"
" $menu add command -font $mfont -label \"Help\" -command \"menu_help Tray\"\n"
+" $menu add command -font $mfont -label \"Logfile\" -command show_logfile\n"
" $menu add separator\n"
" $menu add command -font $mfont -label \"New Client\" -command do_new_client\n"
"\n"
@@ -5149,6 +5390,7 @@ char gui_code[] = "";
" textwin \"Warning\" \"Warning\" $m\n"
" update\n"
" }\n"
+" dtime C\n"
"}\n"
"\n"
"proc clean_client_tail {} {\n"
@@ -6190,6 +6432,125 @@ char gui_code[] = "";
" return $menu_var(WindowView)\n"
"}\n"
"\n"
+"proc dono {a b c} {\n"
+" exit 1;\n"
+"}\n"
+"\n"
+"proc do_port_prompt {} {\n"
+" global bfont ffont\n"
+" global port_reply port_set\n"
+"\n"
+" set guess 5900\n"
+" for {set i 0} {$i < 50} {incr i} {\n"
+" set fh \"\"\n"
+" set try [expr $guess + $i]\n"
+" catch {set fh [socket -server dono $try]}\n"
+" if {$fh != \"\"} {\n"
+" catch {close $fh}\n"
+" set guess $try\n"
+" break;\n"
+" }\n"
+" }\n"
+" set hn \"\"\n"
+" catch {set hn [exec uname -n]}\n"
+" if {$hn == \"\"} {\n"
+" set hn \"hostname\"\n"
+" }\n"
+"\n"
+" set text \" Set the x11vnc Listening Port:\n"
+"\n"
+" VNC Display :0 corresponds to TCP port 5900\n"
+" VNC Display :1 corresponds to TCP port 5901\n"
+" etc.\n"
+"\n"
+" In the Entry below, indicate a Port for x11vnc to listen on. \n"
+"\n"
+" Note that to connect to x11vnc, a VNC Viewer will need to\n"
+" know your selection, for example:\n"
+"\n"
+" vncviewer $hn:0\n"
+" vncviewer $hn:1\n"
+" etc.\n"
+" \n"
+" You may also set some additional parameters:\n"
+"\n"
+" - Enable SSL encryption.\n"
+" (requires an SSL enabled vncviewer, such as SSVNC) \n"
+" - Listen only on localhost. (e.g. for an SSH tunnel)\n"
+" - Enable UltraVNC or TightVNC File transfer.\n"
+"\"\n"
+" set port_set $guess\n"
+" set port_reply \"\"\n"
+"\n"
+" toplevel .pp\n"
+" wm title .pp \"Select x11vnc port\"\n"
+"\n"
+" wm protocol . WM_DELETE_WINDOW \"destroy .; exit\"\n"
+" wm protocol .pp WM_DELETE_WINDOW \"destroy .pp; exit\"\n"
+"\n"
+" label .pp.m -text \"$text\" -justify left -font $ffont\n"
+"\n"
+" frame .pp.f -bd 1 -relief ridge -pady 2\n"
+" label .pp.f.l -text \"Port: \"\n"
+" entry .pp.f.e -width 8 -textvariable port_set\n"
+" global enable_ssl; set enable_ssl 0\n"
+" if [info exists env(X11VNC_SSL_ENABLED)] {\n"
+" set enable_ssl 1\n"
+" }\n"
+" checkbutton .pp.f.ssl -relief raised -pady 3 -padx 3 -text \"Enable SSL\" -variable enable_ssl\n"
+" global localhost; set localhost 0\n"
+" if [info exists env(X11VNC_LOCALHOST_ENABLED)] {\n"
+" set localhost 1\n"
+" }\n"
+" checkbutton .pp.f.loc -relief raised -pady 3 -padx 3 -text \"Listen on localhost\" -variable localhost\n"
+" pack .pp.f.l .pp.f.e -side left\n"
+" pack .pp.f.loc .pp.f.ssl -side right\n"
+"\n"
+" frame .pp.t -bd 1 -relief ridge -pady 2\n"
+" global file_transfer; set file_transfer \"none\"\n"
+" if [info exists env(X11VNC_FILETRANSFER_ENABLED)] {\n"
+" set file_transfer $env(X11VNC_FILETRANSFER_ENABLED)\n"
+" }\n"
+" label .pp.t.l -text \"File Transfer: \"\n"
+" radiobutton .pp.t.none -text \"None\" -variable file_transfer -value \"none\"\n"
+" radiobutton .pp.t.ultra -text \"UltraVNC\" -variable file_transfer -value \"ultra\"\n"
+" radiobutton .pp.t.tight -text \"TightVNC\" -variable file_transfer -value \"tight\"\n"
+" pack .pp.t.l .pp.t.none .pp.t.ultra .pp.t.tight -side left\n"
+"\n"
+" frame .pp.o -bd 1 -relief ridge\n"
+" button .pp.o.ok -text \"OK\" -command \"set port_reply 1; destroy .pp\"\n"
+" button .pp.o.cancel -text \"Cancel\" -command \"set port_reply 0; destroy .pp\"\n"
+" pack .pp.o.ok .pp.o.cancel -side left -fill x -expand 1\n"
+" pack .pp.m -side top -fill x -expand 1 \n"
+" pack .pp.f .pp.t .pp.o -side top -fill x\n"
+"\n"
+" focus .pp.f.e\n"
+" .pp.f.e icursor end\n"
+"\n"
+" wm withdraw .pp\n"
+" update\n"
+" center_win .pp\n"
+"\n"
+" wm minsize .pp [winfo width .pp] [winfo height .pp]\n"
+"\n"
+" bind .pp.f.e <KeyPress-Return> \"set port_reply 1; destroy .pp\"\n"
+"\n"
+" vwait port_reply\n"
+"\n"
+" if {$port_reply} {\n"
+" regsub -all {^:} $port_set \"\" port_set\n"
+" regsub -all {[ \\t]} $port_set \"\" port_set\n"
+" if {[regexp {^[0-9][0-9]*$} $port_set]} {\n"
+" if {$port_set < 0} {\n"
+" set port_set [expr 0 - $port_set]\n"
+" } elseif {$port_set < 200} {\n"
+" set port_set [expr $port_set + 5900]\n"
+" } \n"
+" puts \"$port_set:ssl${enable_ssl}:localhost$localhost:ft_$file_transfer\"\n"
+" }\n"
+" }\n"
+"}\n"
+"\n"
"proc change_view_state {} {\n"
" global menu_var gui_current_state\n"
"\n"
@@ -6387,20 +6748,47 @@ char gui_code[] = "";
"\n"
"set ls \"\"\n"
"catch {set ls [font metrics $bfont -linespace]}\n"
-"if {$ls != \"\"} {\n"
-" if {$ls > 14} {\n"
+"if {$ls != \"\" && $ls > 14} {\n"
" # some recent setups have BIG rendering for the above fonts.\n"
" # on recent (8/08) debian these are really ragged:\n"
" set bfont \"-adobe-helvetica-bold-r-*-*-*-90-*-*-*-*-*-*\"\n"
" set sfont \"-adobe-helvetica-bold-r-*-*-*-75-*-*-*-*-*-*\"\n"
" set snfont \"-adobe-helvetica-medium-r-*-*-*-75-*-*-*-*-*-*\"\n"
"\n"
-" # these are bigger but look better... but for how long?\n"
-" set bfont \"-adobe-helvetica-bold-r-*-*-*-100-*-*-*-*-*-*\"\n"
-" set sfont \"-adobe-helvetica-bold-r-*-*-*-80-*-*-*-*-*-*\"\n"
-" set snfont \"-adobe-helvetica-medium-r-*-*-*-80-*-*-*-*-*-*\"\n"
-" }\n"
+" set ls \"\"\n"
+" catch {set ls [font metrics $bfont -linespace]}\n"
+" if {$ls != \"\" && $ls < 14} {\n"
+" # these are bigger but look better... but for how long?\n"
+" set bfont \"-adobe-helvetica-bold-r-*-*-*-100-*-*-*-*-*-*\"\n"
+" set sfont \"-adobe-helvetica-bold-r-*-*-*-80-*-*-*-*-*-*\"\n"
+" set snfont \"-adobe-helvetica-medium-r-*-*-*-80-*-*-*-*-*-*\"\n"
+"\n"
+" # maybe consider... {-font font Font {Helvetica -12 bold} {Helvetica -12 bold}}\n"
+" # or stick with system font like ssvnc.\n"
+" }\n"
+"}\n"
+"\n"
+"# need to check if \"fixed\" font under XFT on tk8.5 is actually fixed width!!\n"
+"set ls \"\"\n"
+"catch {set ls [font metrics $ffont -linespace]}\n"
+"set fs \"\"\n"
+"catch {set fs [font metrics $ffont -fixed]}\n"
+"set redo 0\n"
+"if {$fs != \"\" && $fs != \"1\"} {\n"
+" set redo 1\n"
+"}\n"
+"if {$ls != \"\" && $ls > 14} {\n"
+" set redo 1\n"
+"}\n"
+"if {$redo} {\n"
+" foreach fn [font names] {\n"
+" if {$fn == \"TkFixedFont\"} {\n"
+" set ffont $fn\n"
+" break\n"
+" }\n"
+" }\n"
"}\n"
+"\n"
"set help_indent 24;\n"
"set reply_xdisplay \"\"\n"
"set all_settings \"None so far.\"\n"
@@ -6478,6 +6866,10 @@ char gui_code[] = "";
" puts \";\"\n"
" exit 0\n"
"}\n"
+"if {\"$argv\" == \"-portprompt\"} {\n"
+" do_port_prompt\n"
+" exit 0\n"
+"}\n"
"\n"
"\n"
"set_view_variable \"full\"\n"
@@ -6676,15 +7068,65 @@ char gui_code[] = "";
"dtime D\n"
"\n"
"proc check_setpasswd {} {\n"
-" global icon_setpasswd\n"
+" global env icon_setpasswd\n"
+" global do_props_msg\n"
+" set do_props_msg \"\"\n"
" if {$icon_setpasswd} {\n"
-" set m \"You must specify a Session Password\\n\" \n"
-" set m \"${m}before VNC clients can connect.\\n\" \n"
-" set m \"${m}Enter one in the Password field\\n\" \n"
-" set m \"${m}and Press \\\"OK\\\". The password(s) is\\n\" \n"
-" set m \"${m}only for this x11vnc session.\\n\" \n"
-" do_props $m\n"
-" #push_new_value \"unlock\" \"unlock\" 1 0\n"
+" set m \"\\n\"\n"
+" set m \" Note the x11vnc icon in the system tray \\n\" \n"
+" set m \"${m} This panel is its 'Properties' dialog.\\n\" \n"
+" set m \"${m}\\n\" \n"
+" set m \"${m} To specify a Session Password and to\\n\" \n"
+" set m \"${m} allow VNC clients to connect, follow\\n\" \n"
+" set m \"${m} these steps:\\n\" \n"
+" set m \"${m}\\n\" \n"
+" set m \"${m} Enter a passwd in the Password field\\n\" \n"
+" set m \"${m} (it can be left blank.) You can also\\n\" \n"
+" set m \"${m} supply a ViewOnly passwd if desired.\\n\" \n"
+" set m \"${m}\\n\" \n"
+" set m \"${m} Set 'Accept Connections' and then Press \\n\" \n"
+" set m \"${m} 'Apply' to allow incoming connections.\\n\" \n"
+" set m \"${m}\\n\" \n"
+" set m \"${m} The passwords are only for this x11vnc\\n\" \n"
+" set m \"${m} session and are not saved. Run x11vnc\\n\" \n"
+" set m \"${m} manually for more control.\\n\" \n"
+" set m \"${m}\\n\" \n"
+" set m \"${m} See 'Help' for details on each option.\\n\" \n"
+"\n"
+" global x11vnc_cmdline\n"
+"\n"
+" set dossl 0\n"
+" if {[info exists x11vnc_cmdline]} {\n"
+" if [regexp -- {-ssl} $x11vnc_cmdline] {\n"
+" set dossl 1\n"
+" }\n"
+" }\n"
+" if {$dossl || [info exists env(X11VNC_GOT_SSL)]} {\n"
+" set m \"${m}\\n\" \n"
+" set m \"${m} SSL encryption mode active. You can\\n\" \n"
+" set m \"${m} find your Public Cert in the Logfile\\n\" \n"
+" set m \"${m} and also the ~/.vnc/certs directory.\\n\" \n"
+" }\n"
+"\n"
+" if {[info exists env(X11VNC_SETPASS_FAIL)]} {\n"
+" set pp 5900\n"
+" if {[info exists env(X11VNC_GOT_RFBPORT_VAL)]} {\n"
+" if {$env(X11VNC_GOT_RFBPORT_VAL) > 0} {\n"
+" set pp $env(X11VNC_GOT_RFBPORT_VAL)\n"
+" }\n"
+" }\n"
+" \n"
+" set m \" The x11vnc program failed to start! \\n\"\n"
+" set m \"${m}\\n\" \n"
+" set m \"${m} Maybe there is another VNC server\\n\"\n"
+" set m \"${m} already listening on port $pp?\\n\"\n"
+" set m \"${m}\\n\" \n"
+" set m \"${m} You will need to start over after\\n\"\n"
+" set m \"${m} you make sure x11vnc can start.\\n\"\n"
+" }\n"
+" \n"
+" set do_props_msg $m\n"
+" do_props\n"
" }\n"
"}\n"
"\n"