ERfPM?AppleApple_partition_map?PM@ disk imageApple_HFS @3noogPM`Apple_FreeH+10.0Jrț:K1D^klO9 `@_e xXxSR Info.plistTRInfoPlist.stringsUR MainMenu.nibU classes.nibVu2u2ț{ț{Uinfo.nibWu2u2ț{ț{6 U info.nib.origXu2u2ț{ț{3U objects.nibYu2u2ț{țI &Uobjects.nib.origZu2u2ț{ț{VU classes.nibWUinfo.nibXU info.nib.origYU objects.nibZUobjects.nib.orig[R Msgbox.nib[ classes.nib\u2u2ț{ț{[info.nib]u2u2ț{ț{&[keyedobjects.nib^u2u2ț{țI \[ classes.nib][info.nib^[keyedobjects.nib_Jscript`J%x11vnc-0.9.8_i386-apple-darwin_8.11.1a80000000000006172c800000000000062a0d800000000000063bef80000000000006896h server.txtj80000000000006a69 r Z (  l : l D $~R0h4J appIcon.icnsKț{ț{ț{țI  (JAppSettings.plistLțzțzț{țI2J CocoaDialogMu2u2ț{țI,, J English.lprojNțzțzț{ț,AJ ResourcesRțcțcț{țOAJscript_țzțzț{țPJ%x11vnc-0.9.8_i386-apple-darwin_8.11.1`}^}^ț{țOu"8KJ appIcon.icnsLJAppSettings.plistMJ CocoaDialogNJ English.lproj(NInfoPlist.stringsOțzțzț{ț,N MainMenu.nibPțcțcț{ț{AONInfoPlist.stringsPN MainMenu.nib&Pkeyedobjects.nibQ7.7.ț{țIbQPkeyedobjects.nibRJ ResourcesR Info.plistSu2u2ț{țIJ(RInfoPlist.stringsTu2u2ț{țI$R MainMenu.nibUțcțcț{ț{AR Msgbox.nib[țcțcț{ț{A n j J tR&VJ^H&"InstantSupport"8fseventsd-uuidJ appIcon.icnsS^6"InstantSupportK1țțInstantSupport .DS_StoreK1țțțc@b .fseventsd8țț8ț8ț(A@.HFS+ Private Directory Data 7K1K1K1K1CmP@@$.TemporaryItems<ț_ț_ț_ț_C@.TrashesK1ț:ț:K1cB@*InstantSupport.appEțzțzț{ț,A server.txthIițțț\0HFS+ Private DataK1K1K1K1@PWWHFS+ Private Data.Trashes .DS_Store7.HFS+ Private Directory Data 8 .fseventsd&80000000000006172ațțțțMZ&800000000000062a0cțțțț&800000000000063bedțțțț [&80000000000006896fțțțț.]&80000000000006a69jț8ț:ț:ț8^ | \ < jF$^JV>"8fseventsd-uuid9țț:ț:ț:$d98fseventsd-uuid<.TemporaryItems< folders.501=ț_ț_ț:ț_A=< folders.501"=TemporaryItems>ț_țțț_A>=TemporaryItemsEInstantSupport.appEContentsFțzț{ț{ț,AFEContentsF Info.plistGț{ț{ț{ț,/iFMacOSHțzțzț{ț{AF ResourcesJțzț{ț{ț,AGF Info.plistHFMacOS"HInstantSupportI7.7.ț{țHBjIHInstantSupportJF Resources. z b n Z r 8v&X* return $file } proc insert_cmdline_vars {} { global env cmd_var menu_var default_var x11vnc_cmdline if {![info exists x11vnc_cmdline]} { return } if {$x11vnc_cmdline == ""} { return } set cmd_var(novar) 1 set str [string trim $x11vnc_cmdline] while {[regexp -- {^-} $str]} { if {[regexp -- {^--*([^ \t][^ \t]*)(.*)$} $str m var rest]} { set rest [string trim $rest] set var [string trim $var] if {[regexp {^\{\{([^\}]*)\}\}(.*)} $rest m val rest]} { set str [string trim $rest] set cmd_var($var) $val } else { set str $rest set cmd_var($var) "boolean" } } else { break } } if {[info exists cmd_var(rc)]} { load_settings $cmd_var(rc) } elseif {[info exists cmd_var(norc)]} { ; } else { set filex [tilde_expand "~/.x11vncrc"] if {[file exists $filex]} { load_settings $filex } } foreach var [array names cmd_var] { if {$var == "novar"} { continue } if {[regexp {^[ \t]*$} $var]} { continue } if {[info exists menu_var($var)]} { if {$cmd_var($var) == "boolean"} { set menu_var($var) 1 } else { set menu_var($var) $cmd_var($var) } } } } proc copy_default_vars {} { global menu_var default_var foreach item [array names default_var] { if {[info exists menu_var($item)]} { if {[info exists default_var($item)]} { set menu_var($item) $default_var($item) } } } foreach item [array names menu_var] { if {[info exists default_var($item)]} { set menu_var($item) $default_var($item) } } } proc update_menu_vars {{query ""}} { global all_settings menu_var query_result_list set debug [in_debug_mode] if {$query == "USE_LIST"} { ; } elseif {$query == ""} { set query_result_list [split_query $all_settings] } else { set query_result_list [split_query $query] } foreach piece $query_result_list { #puts stderr "UMV: $piece" if {[regexp {^([^:][^:]*):(.*)$} $piece m0 item val]} { if {[info exists menu_var($item)]} { set old $menu_var($item) #puts stderr " $old" if {$val == "N/A"} { continue } set menu_var($item) $val } if {$item == "clients"} { update_clients_menu $val } elseif {$item == "display"} { set_x11_display $val } elseif {$item == "vncdisplay"} { set_vnc_display $val } elseif {$item == "http_url"} { set_vnc_url $val } } } } proc load_settings {{file ""}} { global menu_var default_var env if {$file == ""} { if {![info exists menu_var(load-settings)]} { return } set file $menu_var(load-settings) } if {$file == ""} { return } set fh "" set filex [tilde_expand $file] catch {set fh [open $filex "r"]} if {$fh == ""} { append_text "load_settings: *** failed to open $filex ***\n" return } copy_default_vars set str "" while {[gets $fh line] > -1} { regsub -all {\\#} $line {__QUOTED_HASH__} line if {[regexp {^[ \t]*#} $line]} { continue } for {set i 0} {$i < 5} {incr i} { regsub {#.*$} $line "" line } if {[regexp {^[ \t]*$} $line]} { continue } regsub -all {__QUOTED_HASH__} $line {#} line if {[regexp {\\$} $line]} { regsub {\\$} $line " " line append str "$line" } else { append str "$line\n" } } close $fh set count 0 set parms "" foreach line [split $str "\n"] { set line [string trim $line] regsub {^--*} $line "" line regsub -all {[ \t][ \t]*} $line " " line set list [split $line] set item [lindex $list 0] set value [lindex $list 1] if {[regexp {^[ \t]*$} $item]} { continue } if {$item == "gui"} { continue } if {[info exists menu_var($item)]} { if {[value_is_bool $item]} { set menu_var($item) 1 incr count append parms " -$item\n" } elseif {[value_is_string $item]} { if {$value != ""} { set menu_var($item) $value set nitem [get_nitem $item] append parms " -$nitem $value\n" incr count } } } } append_text "loaded $count parameter settings from $filex" if {$count > 0} { append_text ":\n" append_text $parms } else { append_text ".\n" } } proc save_settings {} { set rc_text [get_settings_rcfile] set top "# # This file is based on the current x11vnc settings and can be used as # as a ~/.x11vncrc defaults file. If saved to another filename, these # settings can be passed to x11vnc at startup via \"-rc \". # # The rc file comment character is \"#\". Use \"\\#\" for the literal char. # You can continue lines using \"\\\" as the last character of a line. # # Lines beginning with \"#d\" indicate the parameter value is at its default # setting and you probably want to leave it commented out. # # Lines beginning with \"#?\" indicate parameters you probably do not # want to hardwire to the current setting (uncomment if you want that). # # Some parameters are boolean, e.g. -forever, and take no value; while # the others, e.g. -wait 50, take a string or numerical value. # # For booleans, the line will end with comment \"default: on\" or # \"default: off\" indicating the default setting. (Note: often # \"-nofoobar\" corresponds to option \"-foobar\" and the former is # \"the default\", e.g. -norepeat). # # For string or numerical options, the value \"\" in a line below # means the default is unset and you will need to supply some non-empty # value to use the parameter. For reference, if the default differs # from your value it placed at the end of the line as a comment. # # Feel free to uncomment or comment any of the lines or to change any # of the values of the parameters. Don't be surprised that most if not # all of the lines below are commented out (x11vnc has so many parameters, # most of them will be at their default values). #------------------------------------------------------------------------- " set rc_text "$top$rc_text" global env save_settings_var save_settings_var_ok if {[info exists env(HOME)]} { set save_settings_var "$env(HOME)/.x11vncrc" } else { set save_settings_var ".x11vncrc" } set save_settings_var_ok 0 set w [textwin "save_settings" "Save Settings..." $rc_text \ "save_settings_var+Save as:"] tkwait window $w if {$save_settings_var_ok == 1} { set file $save_settings_var if {$file == ""} { return } set file [tilde_expand $file] append_text "\nSaving current settings to $file ...\n" if {[file exists $file]} { set backup "${file}~" append_text "Backing up $file -> $backup ...\n" catch {file delete -force $backup} set emsg "*** Backup to $backup failed. ***\n" if {![file exists $backup]} { catch {file copy -force $file $backup} if {![file exists $backup]} { append_text $emsg bell } } else { append_text $emsg bell } } set fh "" catch {set fh [open $file "w"]} if {$fh != ""} { puts $fh $rc_text close $fh if {![file exists $file]} { append_text "*** Saving to $file failed. ***\n" bell } else { append_text "Done.\n" } } else { append_text "*** Open of $file failed. ***\n" bell } } } proc clear_all {} { global menu_var unset_str set debug [in_debug_mode] foreach item [array names menu_var] { if {$item == "debug_gui"} { continue } if {[info exists menu_var($item)]} { if {[is_action $item]} { set menu_var($item) "" } elseif {[value_is_bool $item]} { set menu_var($item) 0 } elseif {[value_is_string $item]} { set menu_var($item) $unset_str } } } append_text "Cleared all settings.\n" } proc defaults_all {} { copy_default_vars append_text "Reset all variables to default values.\n" } proc all_query_vars {} { global query_ans_list query_aro_list all_settings global cache_all_query_vars if {$cache_all_query_vars != ""} { return $cache_all_query_vars } set qry "" foreach item $query_ans_list { if {$qry == ""} { set qry $item } else { append qry ",$item" } } foreach item $query_aro_list { if {$qry == ""} { set qry $item } else { append qry ",$item" } } set cache_all_query_vars $qry #puts $qry return $qry } proc query_all {{quiet 0}} { global query_ans_list query_aro_list all_settings global last_query_all_time dtime 1 set qry [all_query_vars] set qargs [list "-Q" $qry] set all [run_remote_cmd $qargs] if {[regexp {ans=} $all]} { if {! $quiet} { append_text "Retrieved all current settings.\n" } set all_settings $all update_menu_vars $all } else { if {! $quiet} { append_text "Failed to retrieve current settings.\n" } } set last_query_all_time [clock seconds] dtime 2 return $all } proc set_info {str} { global info_str info_label #set w1 [$info_label cget -width] #set w2 [winfo width $info_label] #puts "set_info: w=$w1 winfo=$w2" #append_text "$str\n" set info_str "$str" update } proc append_text {str} { global text_area text_area_str if {![info exists text_area_str]} { set text_area_str "" } append text_area_str $str if {![info exists text_area]} { puts stderr $str return } if {$text_area == ""} { puts stderr $str return } if {![winfo exists $text_area]} { puts stderr $str return } $text_area insert end $str $text_area see end } proc show_all_settings {} { global all_settings global client_sock client_tail global x11vnc_client_file set txt "\nRead-Write settings:\n\n" foreach item [split_query $all_settings] { regsub {:} $item {: } item append txt " $item\n" if {[regexp {noremote} $item]} { append txt "\nRead-Only settings:\n\n" } } append txt "\nInternal settings:\n\n" append txt "x11vnc_client_file: $x11vnc_client_file\n" if {[info exists client_tail]} { append txt "client_tail: $client_tail\n" } else { append txt "client_tail: unset\n" } if {[info exists client_sock]} { append txt "client_sock: $client_sock\n" } else { append txt "client_sock: unset\n" } set estr "" catch {set estr [exec env | grep -i X11VNC]} append txt "$estr\n" textwin "Settings" "All Current Settings" $txt } proc show_logfile {} { global menu_var unset_str set logfile [tilde_expand $menu_var(logfile)] if {$logfile == "" || $logfile == $unset_str} { set txt "\nNo logfile was specified at x11vnc startup.\n\n" } elseif {![file exists $logfile]} { set txt "\nLogfile \"$logfile\" does not exist.\n\n" } else { set fh "-3" set err "" catch {set fh [open $logfile "r"]} err if {$fh == "-3"} { set txt "\nError opening \"$logfile\" $err.\n\n" } else { set txt "\nLogfile \"$logfile\" current contents:\n" while {[gets $fh line] > -1} { append txt "$line\n" } close $fh } } textwin "Logfile" "Logfile" $txt } proc tail_logfile {} { global menu_var unset_str ffont set logfile $menu_var(logfile) set txt "" if {$logfile == "" || $logfile == $unset_str} { set txt "\nNo logfile was specified at x11vnc startup.\n\n" } elseif {![file exists $logfile]} { set txt "\nLogfile \"$logfile\" does not exist.\n\n" } else { set cmd "" set xterm_cmd "xterm -sb -fn $ffont -geometry 80x45 -title x11vnc-logfile -e" set cmd [split $xterm_cmd] lappend cmd "tail" lappend cmd "-3000f" lappend cmd $logfile lappend cmd "&" catch {[eval exec $cmd]} } if {$txt != ""} { textwin "Logfile" "Logfile" $txt } } proc set_connected {yesno} { global connected_to_x11vnc set orig $connected_to_x11vnc if {$yesno == "yes"} { set connected_to_x11vnc 1 } else { set connected_to_x11vnc 0 no_x11_display no_vnc_display } if {$orig != $connected_to_x11vnc} { set_widgets } } proc detach_from_display {} { global connected_to_x11vnc reply_xdisplay x11vnc_xdisplay set str "Detaching from X display." if {$reply_xdisplay != ""} { set str "Detaching from $reply_xdisplay." } elseif {$x11vnc_xdisplay != ""} { set str "Detaching from $x11vnc_xdisplay." } if {$connected_to_x11vnc} { append_text "$str\n" } set_connected no } proc do_stop_quit {} { push_new_value "stop" "stop" 1 0 set_connected no update after 250 destroy . } # Menu item is an action: proc do_action {item} { global menu_var connected_to_x11vnc beginner_mode if {[in_debug_mode]} { append_text "action: \"$item\"\n" } #puts "action: \"$item\"\n" if {$item == "ping"} { if {$beginner_mode} { try_connect_and_query_all } else { try_connect } return } elseif {$item == "start"} { start_x11vnc return } elseif {$item == "detach"} { detach_from_display return } elseif {$item == "attach"} { try_connect_and_query_all return } elseif {$item == "update-all"} { query_all return } elseif {$item == "clear-all"} { clear_all return } elseif {$item == "defaults-all"} { defaults_all return } elseif {$item == "save-settings"} { save_settings return } elseif {$item == "show-start-cmd"} { show_start_cmd return } elseif {$item == "all-settings"} { show_all_settings return } elseif {$item == "show-logfile"} { show_logfile return } elseif {$item == "tail-logfile"} { tail_logfile return } elseif {$item == "Misc-Tuning:"} { menu_help "$item" return } elseif {$item == "WindowView"} { change_view_state return } elseif {$item == "quit" || $item == "Quit"} { destroy . exit 0 } elseif {$item == "stop+quit"} { do_stop_quit } if {[value_is_string $item]} { if {! [entry_dialog $item]} { return } set new $menu_var($item) set name $item } else { set new 1 set name $item } if {$item == "load-settings"} { load_settings return } if {! $connected_to_x11vnc} { ; } elseif {[regexp {^(stop|quit|exit|shutdown)$} $item]} { # just do -R append_text "stopping remote x11vnc server...\n" push_new_value $item $name $new 0 set_connected no } elseif {[opt_match Q $item]} { push_new_value $item $name $new 1 } else { push_new_value $item $name $new 0 } } proc ptime {time} { set usec [lindex [split $time] 0] set sec [format "%.3f" [expr "$usec / 1000000.0"]] puts "time: $sec secs." } proc do_var {item} { global connected_to_x11vnc item_cascade menu_var set debug [in_debug_mode] set string 0 if {[is_action $item] || $item == "WindowView"} { # Menu item is action: if {$debug} { ptime [time {do_action $item}] } else { do_action $item } return } if {[value_is_string $item]} { # Menu item is a string: if {$item_cascade($item) != ""} { # Cascade sets variable automatically } else { # Otherwise Entry box if {![entry_dialog $item]} { return } } set new $menu_var($item) set name $item } else { # Menu item is a boolean: set name [check_var $item] if {$name == ""} { return } set new 1 } if {$connected_to_x11vnc} { if {$debug} { ptime [time {push_new_value $item $name $new 1}] } else { push_new_value $item $name $new 1 } if {$item == "http"} { global vnc_url append_text " URL: $vnc_url\n" } } } proc menu_help {item} { if ![help_win $item] { textwin "nohelp" "No help available" \ "Sorry, no help avaiable for \"$item\"" } } proc opt_match {c item} { global item_opts if {[info exists item_opts($item)]} { if {[regexp "^\[A-z\]*$c" $item_opts($item)]} { return 1 } } return 0 } proc is_action {item} { return [opt_match A $item] } proc is_gui_internal {item} { if {$item == "Properties"} { return 1 } if {$item == "Tray"} { return 1 } return [opt_match G $item] } proc is_browse {item} { return [opt_match F $item] } proc value_is_string {item} { global item_bool if {![info exists item_bool($item)]} { return 0 } if {! $item_bool($item)} { return 1 } else { return 0 } } proc value_is_bool {item} { global item_bool if {![info exists item_bool($item)]} { return 0 } if {$item_bool($item)} { return 1 } else { return 0 } } proc split_query0 {query} { # original slower way with regexp/regsub regsub -all {aro=} $query {ans=} query set items {} while {1} { if {! [regexp {^ans=(.*)$} $query m0 m1]} { break } set item $m1 set m2 "" regexp {,ans=.*$} $item m2 regsub {,ans=.*$} $item "" item if {$item != ""} { lappend items $item } set query $m2 regsub {^,} $query "" query } return $items } proc split_query {query} { regsub -all {aro=} $query {ans=} query set items {} while {1} { set n [string first "ans=" $query] if {$n < 0} { break } set from [expr $n+4] set m [string first ",ans=" $query] if {$m < 0} { set more 0 set item [string range $query $from end] } else { set more 1 set to [expr $m-1] set item [string range $query $from $to] } if {$item != ""} { lappend items $item } if {$more} { incr m set query [string range $query $m end] } else { set query "" } } return $items } proc set_x11_display {name} { global x11_display set x11_display "x11vnc X display: $name" set_name "tkx11vnc - $name" } proc set_vnc_display {name} { global vnc_display icon_mode set vnc_display "VNC display: $name" if {$icon_mode} { set_icon_label } } proc set_vnc_url {name} { global vnc_url set vnc_url $name } proc no_x11_display {} { set_x11_display "(*none*)" set_name "tkx11vnc" } proc no_vnc_display {} { set_vnc_display "(*none*)" } proc no_vnc_url {} { set_vnc_url "(*none*)" } proc get_vnc_display_number {} { global vnc_display if ![info exists vnc_display] { return "none" } if {$vnc_display == ""} { return "none" } set str $vnc_display regsub {VNC display: *} $str "" str if [regexp {:([0-9][0-9]*)} $str m0 n] { return $n } return "none" } proc fetch_displays {} { set qargs [list "-Q" "display,vncdisplay"] set result [run_remote_cmd $qargs] set got_x11 0 set got_vnc 0 set got_url 0 foreach item [split_query $result] { if {[regexp {^display:(.*)$} $item m0 m1]} { set_x11_display $m1 set got_x11 1 } elseif {[regexp {^vncdisplay:(.*)$} $item m0 m1]} { set_vnc_display $m1 set got_vnc 1 } elseif {[regexp {^http_url:(.*)$} $item m0 m1]} { set_vnc_url $m1 set got_url 1 } } if {! $got_x11} { no_x11_display } if {! $got_vnc} { no_vnc_display } if {! $got_url} { no_vnc_url } } proc client_dialog {client} { set cid "" set host "" set ip "" global menu_var text_area cleanup_window item_bool #::::::::