summaryrefslogtreecommitdiffstats
path: root/x11vnc/tkx11vnc.h
diff options
context:
space:
mode:
authorrunge <runge>2005-10-23 03:29:38 +0000
committerrunge <runge>2005-10-23 03:29:38 +0000
commit30c00d0b065ae9b2825b1edfb051c1376c8f9867 (patch)
tree7c5cbdf34a7b7b12ded26e82d44a4960edb0270b /x11vnc/tkx11vnc.h
parent94d7fc841e61f8da1840dc0aa158c885abb5b602 (diff)
downloadlibtdevnc-30c00d0b065ae9b2825b1edfb051c1376c8f9867.tar.gz
libtdevnc-30c00d0b065ae9b2825b1edfb051c1376c8f9867.zip
x11vnc: -filexfer, -slow_fb, -blackout noptr,...
Diffstat (limited to 'x11vnc/tkx11vnc.h')
-rw-r--r--x11vnc/tkx11vnc.h160
1 files changed, 147 insertions, 13 deletions
diff --git a/x11vnc/tkx11vnc.h b/x11vnc/tkx11vnc.h
index 9aaf5fa..ee6fe5d 100644
--- a/x11vnc/tkx11vnc.h
+++ b/x11vnc/tkx11vnc.h
@@ -61,6 +61,7 @@
"# 0 means to skip the item.\n"
"# -- means add a separator\n"
"#\n"
+"\n"
"proc set_template {} {\n"
" global template\n"
" set template \"\n"
@@ -192,6 +193,8 @@
" --\n"
" =F rc:\n"
" norc\n"
+" filexfer\n"
+" --\n"
" nofb\n"
" =D nobell\n"
" nolookup\n"
@@ -578,6 +581,22 @@
" Stop x11vnc - Directs the x11vnc server to disconnect all vncviewers\n"
" and then exit. The tray/icon GUI then exits as well.\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"
+" via \\\"x11vnc -R <command>\\\", or if prefixed with \n"
+" \\\"action:\\\" runs a gui internal action, or if \\\"sep\\\"\n"
+" adds a separator. Set X11VNC_CUSTOM_GUI to use\n"
+" a different filename. Example file contents:\n"
+"\n"
+" scale:3/4\n"
+" scale:1\n"
+" scale_cursor:1\n"
+" sep\n"
+" action:all-settings\n"
+" #debug_keyboard\n"
+" sep\n"
+" action:Quit\n"
"\n"
"Termination:\n"
"\n"
@@ -1321,7 +1340,9 @@
" set ok 0\n"
" set text \"Help on $item:\\n\\n\"\n"
"\n"
-" if {[is_gui_internal $item]} {\n"
+" if {$item == \"NewClient\"} {\n"
+" ;\n"
+" } elseif {[is_gui_internal $item]} {\n"
" if {$item != \"gui\" && $item != \"all\" && $item != \"Misc-Tuning:\" \\\n"
" && $item != \"Properties\" && $item != \"Tray\"} {\n"
" append text \" + Is a gui internal Action (cannot be set).\\n\";\n"
@@ -1333,7 +1354,9 @@
" } else {\n"
" append text \" - Cannot be changed in a running x11vnc.\\n\";\n"
" }\n"
-" if {[is_gui_internal $item]} {\n"
+" if {$item == \"NewClient\"} {\n"
+" ;\n"
+" } elseif {[is_gui_internal $item]} {\n"
" ;\n"
" } elseif {[active_when_starting $item]} {\n"
" append text \" + Can be set at x11vnc startup.\\n\";\n"
@@ -2866,6 +2889,9 @@
" } elseif {$item == \"WindowView\"} {\n"
" change_view_state\n"
" return\n"
+" } elseif {$item == \"quit\" || $item == \"Quit\"} {\n"
+" destroy .\n"
+" exit 0\n"
" } elseif {$item == \"stop+quit\"} {\n"
" do_stop_quit\n"
" }\n"
@@ -3850,6 +3876,7 @@
" } else {\n"
" set first 0\n"
" }\n"
+" update\n"
" wm deiconify $full_win\n"
" update\n"
"\n"
@@ -4125,6 +4152,8 @@
" set x [expr $x-10]\n"
" set y [expr $y-10]\n"
" $m post $x $y\n"
+" # XXX more care needed\n"
+" grab set -global $m\n"
"}\n"
"\n"
"proc set_client_balloon {str} {\n"
@@ -4164,7 +4193,9 @@
" }\n"
" } else {\n"
" set i [expr $count+1]\n"
-" set client_balloon \"${client_balloon}\\nunknown-host$i\"\n"
+" if {$i == 1} {\n"
+" set client_balloon \"${client_balloon}\\nunknown-host$i\"\n"
+" }\n"
" }\n"
" incr count\n"
" }\n"
@@ -4464,18 +4495,27 @@
" return $lab\n"
"}\n"
"\n"
+"# currently unused\n"
"proc lmenu {menu} {\n"
" global popup_cascade_posted\n"
+" global left_iconwin_menu\n"
+" set left_iconwin_menu 1\n"
" after 100\n"
-" if {!$popup_cascade_posted} {\n"
-" after 100\n"
-" if {!$popup_cascade_posted} {\n"
+" update\n"
+" if {!$popup_cascade_posted && $left_iconwin_menu} {\n"
+" for {set i 0} {$i < 3} {incr i} {\n"
+" after 100\n"
+" update\n"
+" }\n"
+" if {!$popup_cascade_posted && $left_iconwin_menu} {\n"
" $menu unpost\n"
" return\n"
" }\n"
" }\n"
" # kludge for WindowView\n"
-" focus $menu\n"
+" if {$popup_cascade_posted} {\n"
+" focus $menu\n"
+" }\n"
"}\n"
"\n"
"proc old_balloon {} {\n"
@@ -4496,6 +4536,78 @@
" }\n"
"}\n"
"\n"
+"proc get_custom_menu_items {} {\n"
+" global env custom_last_read\n"
+"\n"
+" if {![info exists custom_last_read]} {\n"
+" set custom_last_read 0\n"
+" }\n"
+" if {[info exists env(X11VNC_CUSTOM_GUI)]} {\n"
+" set custom \"$env(X11VNC_CUSTOM_GUI)\"\n"
+" } elseif {![info exists env(HOME)]} {\n"
+" return [list \"none\"]\n"
+" } else {\n"
+" set custom \"$env(HOME)/.x11vnc.gui\"\n"
+" }\n"
+" if {![file exists $custom]} {\n"
+" return [list \"none\"]\n"
+" }\n"
+"\n"
+"# if {[file mtime $custom] <= $custom_last_read} {\n"
+"# return [list \"nochange\"]\n"
+"# }\n"
+"\n"
+" set in \"\"\n"
+" catch {set in [open $custom \"r\"]} \n"
+" if {$in == \"\"} {\n"
+" return [list \"none\"]\n"
+" }\n"
+"\n"
+" set custom_last_read [clock seconds]\n"
+"\n"
+" set count 0\n"
+" while {[gets $in line] > -1} {\n"
+" if {[regexp {^[ \\t]*#} $line]} {\n"
+" continue\n"
+" }\n"
+" set line [string trim $line]\n"
+" if {$line != \"\"} {\n"
+" lappend items $line\n"
+" incr count\n"
+" }\n"
+" }\n"
+" close $in\n"
+" \n"
+" if {$count > 0} {\n"
+" return $items\n"
+" } else {\n"
+" return [list \"none\"]\n"
+" }\n"
+"}\n"
+"\n"
+"proc make_custom_menu {menu font} {\n"
+" set items [get_custom_menu_items]\n"
+" set i0 [lindex $items 0]\n"
+" catch {$menu delete 0 end}\n"
+" if {$i0 != \"none\"} {\n"
+" $menu add command -font $font -label \"Custom items:\"\n"
+" $menu add separator\n"
+" foreach item $items {\n"
+" if {$item == \"sep\" || $item == \"separator\"} {\n"
+" $menu add separator\n"
+" continue\n"
+" }\n"
+" if {[regexp {^action:(.*)$} $item m action]} {\n"
+" $menu add command -font $font -label \"$action\" \\\n"
+" -command \"do_var $action\"\n"
+" continue\n"
+" }\n"
+" $menu add command -font $font -label \"$item\" \\\n"
+" -command \"run_remote_cmd \\[list \\\"-R\\\" \\\"$item\\\"\\]\"\n"
+" }\n"
+" }\n"
+"}\n"
+"\n"
"proc make_icon {} {\n"
" global icon_mode icon_embed_id icon_win props_win full_win\n"
" global tray_embed tray_running env\n"
@@ -4578,13 +4690,25 @@
"\n"
" $menu add command -font $mfont -label \"Stop x11vnc\" -command clean_icon_exit\n"
"\n"
-" bind $icon_win <ButtonPress-1> \"pmenu $menu %X %Y\"\n"
-" bind $icon_win <ButtonPress-3> \"pmenu $menu %X %Y\"\n"
+" set items [get_custom_menu_items]\n"
+" set i0 [lindex $items 0]\n"
+" if {$i0 != \"none\" && $i0 != \"nochange\"} {\n"
+" $menu add separator\n"
+" set cm \"$menu.custom\"\n"
+" catch {destroy $cm}\n"
+" menu $cm -tearoff 0 -font $ffont \\\n"
+" -postcommand \"set popup_cascade_posted 1; make_custom_menu $cm $ffont\"\n"
+" $menu add cascade -font $mfont -label \"Custom:\" -menu $cm\n"
+" }\n"
+"\n"
+" bind $icon_win <ButtonRelease-1> \"pmenu $menu %X %Y\"\n"
+" bind $icon_win <ButtonRelease-3> \"pmenu $menu %X %Y\"\n"
" bind $icon_win <Enter> {set client_balloon_id [after 500 show_client_balloon]}\n"
" bind $icon_win <Button> {kill_client_balloon}\n"
" bind $icon_win <Leave> {kill_client_balloon}\n"
" bind $icon_win <ButtonPress-2> {kill_client_balloon; show_client_balloon}\n"
-" bind $menu <Leave> \"lmenu $menu\"\n"
+"# bind $menu <Leave> \"lmenu $menu\"\n"
+"# bind $menu <Enter> \"set left_iconwin_menu 0\"\n"
"## bind $menu <KeyPress-Escape> \"$menu unpost\"\n"
"\n"
" bind . <Control-KeyPress-c> {destroy .; exit 0}\n"
@@ -4605,7 +4729,9 @@
" }\n"
" wm iconname . \"tkx11vnc\"\n"
" wm title . \"tkx11vnc\"\n"
+" update\n"
" wm deiconify .\n"
+" update\n"
"\n"
" old_balloon\n"
"}\n"
@@ -4745,6 +4871,7 @@
" set gui_current_state $mode\n"
"\n"
"\n"
+" update\n"
" wm deiconify .\n"
" update idletasks\n"
" wm minsize $w [winfo width $w] [winfo height $w]\n"
@@ -5201,9 +5328,10 @@
"proc double_check_start_x11vnc {} {\n"
" global hostname\n"
" set msg [get_start_x11vnc_txt]\n"
+" bell\n"
" append msg \"\\n\"\n"
-" append msg \"*** To run the above command on machine \\\"$hostname\\\" to\\n\"\n"
-" append msg \"*** start x11vnc press \\\"OK\\\" otherwise press \\\"Cancel\\\".\\n\"\n"
+" append msg \"*** To run the above command on machine \\\"$hostname\\\" (thereby\\n\"\n"
+" append msg \"*** starting x11vnc) press \\\"OK\\\", otherwise press \\\"Cancel\\\".\\n\"\n"
" return [warning_dialog $msg \"start\"]\n"
"}\n"
"\n"
@@ -5408,8 +5536,12 @@
" global client_sock\n"
"\n"
" set db 0\n"
+" if {[file channels $client_sock] == \"\"} {\n"
+" set client_sock \"\"\n"
+" return \"fail\"\n"
+" }\n"
" if {[eof $client_sock]} {\n"
-" close $client_sock\n"
+" catch {close $client_sock}\n"
" set client_sock \"\"\n"
" return \"fail\"\n"
" }\n"
@@ -5756,6 +5888,8 @@
"############################################################################\n"
"# main:\n"
"\n"
+"wm withdraw .\n"
+"\n"
"global env x11vnc_prog x11vnc_cmdline x11vnc_xdisplay x11vnc_connect;\n"
"global x11vnc_xdisplay0\n"
"global x11vnc_client_file x11vnc_gui_geom x11vnc_started vnc_url\n"