summaryrefslogtreecommitdiffstats
path: root/x11vnc/tkx11vnc.h
diff options
context:
space:
mode:
Diffstat (limited to 'x11vnc/tkx11vnc.h')
-rw-r--r--x11vnc/tkx11vnc.h93
1 files changed, 85 insertions, 8 deletions
diff --git a/x11vnc/tkx11vnc.h b/x11vnc/tkx11vnc.h
index 0f442a2..ddd5f23 100644
--- a/x11vnc/tkx11vnc.h
+++ b/x11vnc/tkx11vnc.h
@@ -79,6 +79,7 @@
" =RA update-all\n"
" =GA clear-all\n"
" --\n"
+" =RA stop+quit \n"
" =GA Quit \n"
"\n"
"Help\n"
@@ -292,6 +293,10 @@
"a -Q query. Examples: \\\"zero:20,20,100,100\\\", \\\"Q:ext_xfixes\\\" \n"
"\"\n"
"\n"
+" set helptext(stop+quit) \"\n"
+"Send the stop command to the x11vnc server, then terminate the tkx11vnc gui.\n"
+"\"\n"
+"\n"
" set helptext(Quit) \"\n"
"Terminate the tkx11vnc gui. Any x11vnc servers will be left running.\n"
"\"\n"
@@ -784,10 +789,16 @@
"}\n"
"\n"
"proc menus_enable {} {\n"
+" global menus_disabled\n"
+"\n"
" menus_state \"normal\"\n"
+" set menus_disabled 0\n"
"}\n"
"\n"
"proc menus_disable {} {\n"
+" global menus_disabled\n"
+"\n"
+" set menus_disabled 1\n"
" menus_state \"disabled\"\n"
"}\n"
"\n"
@@ -1189,6 +1200,8 @@
" set query_result_list [split_query $query]\n"
"\n"
" foreach q $query_result_list {\n"
+" # XXX following will crash if $item is not a good regexp\n"
+" # need to protect it \\Q$item\\E style...\n"
"# if {[regexp \"^$item:\" $q]} {\n"
"# set found $q\n"
"# }\n"
@@ -1415,6 +1428,12 @@
" } elseif {$item == \"all-settings\"} {\n"
" show_all_settings\n"
" return\n"
+" } elseif {$item == \"stop+quit\"} {\n"
+" push_new_value \"stop\" \"stop\" 1 0\n"
+" set_connected no\n"
+" update\n"
+" after 500\n"
+" destroy .\n"
" }\n"
"\n"
" if {[value_is_string $item]} {\n"
@@ -1662,12 +1681,45 @@
" }\n"
"}\n"
"\n"
+"proc update_clients_and_repost {} {\n"
+" global item_cascade menu_m menu_b\n"
+"\n"
+" append_text \"Refreshing connected clients list... \"\n"
+" query_all 1\n"
+" update\n"
+"\n"
+" set saw 0\n"
+" set casc $item_cascade(current)\n"
+" set last [$casc index end]\n"
+" for {set i 0} {$i <= $last} {incr i} {\n"
+" if {[$casc type $i] == \"separator\"} {\n"
+" continue\n"
+" }\n"
+" set name [$casc entrycget $i -label]\n"
+" if {[regexp {^#} $name]} {\n"
+" continue\n"
+" }\n"
+" if {[regexp {^refresh-list} $name]} {\n"
+" continue\n"
+" }\n"
+" if {! $saw} {\n"
+" append_text \"\\n\"\n"
+" }\n"
+" set saw 1\n"
+" append_text \"client: $name\\n\"\n"
+" }\n"
+" if {! $saw} {\n"
+" append_text \"done.\\n\"\n"
+" }\n"
+"}\n"
+"\n"
"proc update_clients_menu {list} {\n"
" global item_cascade\n"
" set subm $item_cascade(current);\n"
" catch {destroy $subm}\n"
" menu $subm -tearoff 0\n"
" $subm add command\n"
+" $subm add command -label \"refresh-list\" -command \"update_clients_and_repost\"\n"
" $subm add separator\n"
" set count 0\n"
" foreach client [split $list \",\"] {\n"
@@ -1768,7 +1820,16 @@
" set menu \"$colf.menu$case.menu\";\n"
" set menu_b($case) $menub\n"
" set menu_m($case) $menu\n"
-" menubutton $menub -text \"$case\" -underline 0 \\\n"
+" set ul 0\n"
+" foreach char [split $case \"\"] {\n"
+" set char [string tolower $char]\n"
+" if {![info exists underlined($char)]} {\n"
+" set underlined($char) 1\n"
+" break\n"
+" }\n"
+" incr ul\n"
+" }\n"
+" menubutton $menub -text \"$case\" -underline $ul \\\n"
" -anchor w -menu $menu -background $fbg \\\n"
" -font $bfont\n"
" pack $menub -side top -fill x\n"
@@ -2042,16 +2103,31 @@
"}\n"
"\n"
"proc key_bindings {} {\n"
-" global env\n"
+" global env menus_disabled\n"
" if {[info exists env(USER)] && $env(USER) == \"runge\"} {\n"
" # quick restart\n"
" bind . <Control-KeyPress-c> {exec $argv0 $argv &; destroy .}\n"
" }\n"
-" bind . <Control-KeyPress-p> {try_connect_and_query_all}\n"
-" bind . <Control-KeyPress-u> {query_all 0}\n"
-" bind . <Control-KeyPress-r> {query_all 0}\n"
-" bind . <Control-KeyPress-d> {detach_from_display}\n"
-" bind . <Control-KeyPress-a> {try_connect_and_query_all}\n"
+" bind . <Control-KeyPress-p> { \\\n"
+" global menus_disabled; \\\n"
+" if {!$menus_disabled} {try_connect_and_query_all} \\\n"
+" }\n"
+" bind . <Control-KeyPress-u> { \\\n"
+" global menus_disabled; \\\n"
+" if {!$menus_disabled} {query_all 0} \\\n"
+" }\n"
+" bind . <Control-KeyPress-r> { \\\n"
+" global menus_disabled; \\\n"
+" if {!$menus_disabled} {query_all 0} \\\n"
+" }\n"
+" bind . <Control-KeyPress-d> { \\\n"
+" global menus_disabled; \\\n"
+" if {!$menus_disabled} {detach_from_display} \\\n"
+" }\n"
+" bind . <Control-KeyPress-a> { \\\n"
+" global menus_disabled; \\\n"
+" if {!$menus_disabled} {try_connect_and_query_all} \\\n"
+" }\n"
"}\n"
"\n"
"proc stop_watch {onoff} {\n"
@@ -2343,7 +2419,7 @@
"global helpall helptext helpremote helplabel hostname;\n"
"global all_settings reply_xdisplay always_update\n"
"global max_text_height max_text_width\n"
-"global menu_var unset_str\n"
+"global menu_var unset_str menus_disabled\n"
"global bfont\n"
"global connected_to_x11vnc\n"
"global delay_sleep extra_sleep extra_sleep_split\n"
@@ -2351,6 +2427,7 @@
"\n"
"set unset_str \"(unset)\"\n"
"set connected_to_x11vnc 0\n"
+"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"