summaryrefslogtreecommitdiff
path: root/comms/pilot-link
diff options
context:
space:
mode:
authortron <tron@pkgsrc.org>2003-09-28 15:09:50 +0000
committertron <tron@pkgsrc.org>2003-09-28 15:09:50 +0000
commitd6c03f3a6a6946543312b7ce13fbbf746e46e909 (patch)
treeae558bfec24c58910e8b73224205a0e91f2f49b0 /comms/pilot-link
parentb35037fad5dcfc57ec8dd874406f779e50dd761e (diff)
downloadpkgsrc-d6c03f3a6a6946543312b7ce13fbbf746e46e909.tar.gz
Fix GCC 3.3.1 related build problem.
Diffstat (limited to 'comms/pilot-link')
-rw-r--r--comms/pilot-link/distinfo3
-rw-r--r--comms/pilot-link/patches/patch-ae1312
2 files changed, 1314 insertions, 1 deletions
diff --git a/comms/pilot-link/distinfo b/comms/pilot-link/distinfo
index 53e41b5b94e..a070b294bee 100644
--- a/comms/pilot-link/distinfo
+++ b/comms/pilot-link/distinfo
@@ -1,4 +1,4 @@
-$NetBSD: distinfo,v 1.12 2003/01/10 04:30:18 rh Exp $
+$NetBSD: distinfo,v 1.13 2003/09/28 15:09:50 tron Exp $
SHA1 (pilot-link-0.11.7.tar.bz2) = f1ae56d3aad5d793f58fac4d3a51ca0c0f517262
Size (pilot-link-0.11.7.tar.bz2) = 669470 bytes
@@ -6,3 +6,4 @@ SHA1 (patch-aa) = 87ea9401603bd55d62ac2fa17ad45ff16baeda4d
SHA1 (patch-ab) = add1156600a681cc0ae30c5d9095b4f1bb6739c3
SHA1 (patch-ac) = 1a5c5946a23850910849d3f58011b2e9086d7641
SHA1 (patch-ad) = 91e0a72a0f2d313173024c9edacfa0b92fb33b3d
+SHA1 (patch-ae) = a7e84e6fc2b7414c63e4306da5df3cd840b2a6ca
diff --git a/comms/pilot-link/patches/patch-ae b/comms/pilot-link/patches/patch-ae
new file mode 100644
index 00000000000..daf152cfc42
--- /dev/null
+++ b/comms/pilot-link/patches/patch-ae
@@ -0,0 +1,1312 @@
+$NetBSD: patch-ae,v 1.4 2003/09/28 15:09:50 tron Exp $
+
+--- src/pilot-debug.c.orig 2002-12-02 15:32:47.000000000 +0100
++++ src/pilot-debug.c 2003-09-28 17:08:23.000000000 +0200
+@@ -1549,526 +1549,524 @@
+ return TCL_OK;
+ }
+
+- Tcl_VarEval(interp,"\
+-
+-### /*** Generate remote UI window ***/
+-
+-set tkdbg 1
+-
+-toplevel .remote
+-wm title .remote {Palm Remote UI}
+-
+-catch {
+- if {[file exists {tools/pix/case.gif}]} {
+- set dir {tools}
+- } elseif {[file exists {",LIBDIR,"/pix/case.gif}]} {
+- set dir {",LIBDIR,"/pix}
+- } else {
+- error {No pix}
+- }
+- image create photo Case -format gif -file \"$dir/pix/case.gif\"
+- image create photo B1 -format gif -file \"$dir/pix/b1.gif\"
+- image create photo B2 -format gif -file \"$dir/pix/b2.gif\"
+- image create photo B3 -format gif -file \"$dir/pix/b3.gif\"
+- image create photo B4 -format gif -file \"$dir/pix/b4.gif\"
+- image create photo B5 -format gif -file \"$dir/pix/b5.gif\"
+- image create photo B6 -format gif -file \"$dir/pix/b6.gif\"
+- image create photo B7 -format gif -file \"$dir/pix/b7.gif\"
+-}
+-
+-canvas .remote.c -width 221 -height 337
+-
+-.remote.c create rectangle 27 29 196 260 -outline {red} -tag screen -fill {blue}
+-.remote.c create rectangle 0 280 18 306 -outline {red} -tag button1 -fill {blue}
+-.remote.c create oval 23 276 52 307 -outline {red} -tag button2 -fill {blue}
+-.remote.c create oval 63 276 92 307 -outline {red} -tag button3 -fill {blue}
+-.remote.c create rectangle 97 277 127 294 -outline {red} -tag button4 -fill {blue}
+-.remote.c create rectangle 97 300 127 317 -outline {red} -tag button5 -fill {blue}
+-.remote.c create oval 133 276 162 307 -outline {red} -tag button6 -fill {blue}
+-.remote.c create oval 171 276 200 307 -outline {red} -tag button7 -fill {blue}
+-
+-.remote.c create rectangle 33 32 187 253 -outline black -tag screen
+-.remote.c create rectangle 33 200 61 225 -outline black -tag screen
+-.remote.c create rectangle 33 225 61 253 -outline black -tag screen
+-.remote.c create rectangle 160 200 187 225 -outline black -tag screen
+-.remote.c create rectangle 160 225 187 253 -outline black -tag screen
+-.remote.c create rectangle 62 200 159 253 -outline black -tag screen
+-
+-set buttons(1) 0
+-
+-proc holdbutton {button} {
+- global buttons
+- if {$button==1} {
+- set buttons($button) [after 1000 \"continuebutton $button\"]
+- } else {
+- pushbutton $button
+- set buttons($button) [after 250 \"holdbutton $button\"]
+- }
+-}
+-
+-proc continuebutton {button} {
+- global buttons
+- if {$button==1} {
+- pushbutton 0
+- }
+- set buttons($button) \"\"
+-}
+-
+-proc releasebutton {button} {
+- global buttons
+- if {$buttons($button)!=\"\"} {
+- if {$button==1} {
+- pushbutton 1
+- }
+- after cancel $buttons($button)
+- set buttons($button) \"\"
+- }
+-}
+-
+-.remote.c bind button1 <ButtonPress-1> {.remote.c itemconfigure button1 -fill green; update; holdbutton 1}
+-.remote.c bind button1 <ButtonRelease-1> {.remote.c itemconfigure button1 -fill blue; releasebutton 1}
+-
+-.remote.c bind button2 <ButtonPress-1> {.remote.c itemconfigure button2 -fill green; update; holdbutton 2}
+-.remote.c bind button2 <ButtonRelease-1> {.remote.c itemconfigure button2 -fill blue; releasebutton 2}
+-
+-.remote.c bind button3 <ButtonPress-1> {.remote.c itemconfigure button3 -fill green; update; holdbutton 3}
+-.remote.c bind button3 <ButtonRelease-1> {.remote.c itemconfigure button3 -fill blue; releasebutton 3}
+-
+-.remote.c bind button4 <ButtonPress-1> {.remote.c itemconfigure button4 -fill green; update; holdbutton 4}
+-.remote.c bind button4 <ButtonRelease-1> {.remote.c itemconfigure button4 -fill blue; releasebutton 4}
+-
+-.remote.c bind button5 <ButtonPress-1> {.remote.c itemconfigure button5 -fill green; update; holdbutton 5}
+-.remote.c bind button5 <ButtonRelease-1> {.remote.c itemconfigure button5 -fill blue; releasebutton 5}
+-
+-.remote.c bind button6 <ButtonPress-1> {.remote.c itemconfigure button6 -fill green; update; holdbutton 6}
+-.remote.c bind button6 <ButtonRelease-1> {.remote.c itemconfigure button6 -fill blue; releasebutton 6}
+-
+-.remote.c bind button7 <ButtonPress-1> {.remote.c itemconfigure button7 -fill green; update; holdbutton 7}
+-.remote.c bind button7 <ButtonRelease-1> {.remote.c itemconfigure button7 -fill blue; releasebutton 7}
+-
+-catch {
+- .remote.c create image 0 282 -image B1 -anchor nw -tag downbutton1
+- .remote.c create image 22 274 -image B2 -anchor nw -tag downbutton2
+- .remote.c create image 60 275 -image B3 -anchor nw -tag downbutton3
+- .remote.c create image 93 278 -image B4 -anchor nw -tag downbutton4
+- .remote.c create image 95 298 -image B5 -anchor nw -tag downbutton5
+- .remote.c create image 131 275 -image B6 -anchor nw -tag downbutton6
+- .remote.c create image 169 274 -image B7 -anchor nw -tag downbutton7
+-
+- .remote.c create image 0 0 -image Case -anchor nw
+-
+- .remote.c bind button1 <ButtonPress-1> {.remote.c raise downbutton1; update; holdbutton 1}
+- .remote.c bind button1 <ButtonRelease-1> {.remote.c lower downbutton1; releasebutton 1}
+-
+- .remote.c bind button2 <ButtonPress-1> {.remote.c raise downbutton2; update; holdbutton 2}
+- .remote.c bind button2 <ButtonRelease-1> {.remote.c lower downbutton2; releasebutton 2}
+-
+- .remote.c bind button3 <ButtonPress-1> {.remote.c raise downbutton3; update; holdbutton 3}
+- .remote.c bind button3 <ButtonRelease-1> {.remote.c lower downbutton3; releasebutton 3}
+-
+- .remote.c bind button4 <ButtonPress-1> {.remote.c raise downbutton4; update; holdbutton 4}
+- .remote.c bind button4 <ButtonRelease-1> {.remote.c lower downbutton4; releasebutton 4}
+-
+- .remote.c bind button5 <ButtonPress-1> {.remote.c raise downbutton5; update; holdbutton 5}
+- .remote.c bind button5 <ButtonRelease-1> {.remote.c lower downbutton5; releasebutton 5}
+-
+- .remote.c bind button6 <ButtonPress-1> {.remote.c raise downbutton6; update; holdbutton 6}
+- .remote.c bind button6 <ButtonRelease-1> {.remote.c lower downbutton6; releasebutton 6}
+-
+- .remote.c bind button7 <ButtonPress-1> {.remote.c raise downbutton7; update; holdbutton 7}
+- .remote.c bind button7 <ButtonRelease-1> {.remote.c lower downbutton7; releasebutton 7}
+-
+-
+- .remote.c itemconfigure button1 -outline {} -fill {}
+- .remote.c raise button1
+- .remote.c itemconfigure button2 -outline {} -fill {}
+- .remote.c raise button2
+- .remote.c itemconfigure button3 -outline {} -fill {}
+- .remote.c raise button3
+- .remote.c itemconfigure button4 -outline {} -fill {}
+- .remote.c raise button4
+- .remote.c itemconfigure button5 -outline {} -fill {}
+- .remote.c raise button5
+- .remote.c itemconfigure button6 -outline {} -fill {}
+- .remote.c raise button6
+- .remote.c itemconfigure button7 -outline {} -fill {}
+- .remote.c raise button7
+- .remote.c itemconfigure screen -outline {} -fill {}
+- .remote.c raise screen
+-}
+-
+-pack .remote.c -side top
+-
+-.remote.c bind screen <ButtonPress-1> {pen %x %y 1}
+-.remote.c bind screen <B1-Motion> {pen %x %y 1}
+-.remote.c bind screen <ButtonRelease-1> {pen %x %y 0}
+-
+-global KeyQueue
+-global KeyQueueId
+-global KeyQueueDelay
+-set KeyQueue {}
+-set KeyQueueId {}
+-set KeyQueueDelay 50
+-
+-proc readyqueue {} {
+- global KeyQueueId
+- global KeyQueueDelay
+- if {$KeyQueueId == {}} {
+- after $KeyQueueDelay { set KeyQueueId [ after idle {sendqueue} ] }
+- }
+-}
+-
+-proc queuekey {c} {
+- global KeyQueue
+- append KeyQueue $c
+- readyqueue
+-}
+-
+-proc sendqueue {} {
+- global KeyQueue
+- global KeyQueueId
+- if {[string length $KeyQueue] > 0} {
+- key [string index $KeyQueue 0]
+- set KeyQueue [string range $KeyQueue 1 end]
+- }
+- set KeyQueueId {}
+- if {[string length $KeyQueue] > 0} { readyqueue }
+-}
+-
+-bind .remote <KeyPress> {queuekey %A}
+-
+-## Handle pasting
+-proc do_paste { } {
+- if [catch {selection get} sel] {
+- if [catch {selection get -selection CLIPBOARD} sel] {
+- return
+- }
+- }
+- queuekey $sel
+-}
+-bind .remote <ButtonPress-2> {do_paste}
+-
+-##### /*** Generate remote console window ***/
+-
+-toplevel .console
+-wm title .console \"Palm Remote Console\"
+-scrollbar .console.y -orient vertical -command {.console.t yview}
+-text .console.t -yscrollcommand {.console.y set}
+-pack .console.t -fill both -expand yes -side left
+-pack .console.y -fill y -side right
+-focus .console.t
+-
+-#### /*** Generate pilot state window ***/
+-
+-toplevel .state
+-wm title .state {Palm State}
+-label .state.l1 -text {Active mode:}
+-label .state.l1x -text {Battery:}
+-label .state.l2 -text {Exception:}
+-label .state.l25 -text {Reset:}
+-label .state.l3 -text {Function:}
+-label .state.l4 -text {F-start:}
+-label .state.l5 -text {F-end:}
+-label .state.l6 -text {D0:}
+-label .state.l7 -text {A0:}
+-label .state.l8 -text {D1:}
+-label .state.l9 -text {A1:}
+-label .state.l10 -text {D2:}
+-label .state.l11 -text {A2:}
+-label .state.l12 -text {D3:}
+-label .state.l13 -text {A3:}
+-label .state.l14 -text {D4:}
+-label .state.l15 -text {A4:}
+-label .state.l16 -text {D5:}
+-label .state.l17 -text {A5:}
+-label .state.l18 -text {D6:}
+-label .state.l19 -text {A6:}
+-label .state.l20 -text {D7:}
+-
+-label .state.l21 -text {PC:}
+-label .state.l22 -text {SR:}
+-label .state.l23 -text {USP:}
+-label .state.l24 -text {SSP:}
+-
+-label .state.halted -text {None}
+-label .state.battery -text {Unknown}
+-label .state.exception -text {0}
+-label .state.reset -text {No}
+-label .state.funcname -text {}
+-label .state.funcstart -text {00000000}
+-label .state.funcend -text {00000000}
+-label .state.d0 -text {00000000}
+-label .state.a0 -text {00000000}
+-label .state.d1 -text {00000000}
+-label .state.a1 -text {00000000}
+-label .state.d2 -text {00000000}
+-label .state.a2 -text {00000000}
+-label .state.d3 -text {00000000}
+-label .state.a3 -text {00000000}
+-label .state.d4 -text {00000000}
+-label .state.a4 -text {00000000}
+-label .state.d5 -text {00000000}
+-label .state.a5 -text {00000000}
+-label .state.d6 -text {00000000}
+-label .state.a6 -text {00000000}
+-label .state.d7 -text {00000000}
+-label .state.pc -text {00000000}
+-label .state.sr -text {0000}
+-label .state.usp -text {00000000}
+-label .state.ssp -text {00000000}
+-
+-grid .state.l1 -column 0 -row 0 -sticky e -columnspan 2
+-grid .state.halted -column 2 -row 0 -sticky w -columnspan 2
+-
+-grid .state.l1x -column 0 -row 1 -sticky e -columnspan 2
+-grid .state.battery -column 2 -row 1 -sticky w -columnspan 2
+-
+-grid .state.l2 -column 0 -row 2 -sticky e -columnspan 2
+-grid .state.exception -column 2 -row 2 -sticky w -columnspan 2
+-
+-grid .state.l25 -column 0 -row 3 -sticky e -columnspan 2
+-grid .state.reset -column 2 -row 3 -sticky w -columnspan 2
+-
+-grid .state.l3 -column 0 -row 4 -sticky e -columnspan 2
+-grid .state.funcname -column 2 -row 4 -sticky w -columnspan 2
+-
+-grid .state.l4 -column 0 -row 5 -sticky e -columnspan 2
+-grid .state.funcstart -column 2 -row 5 -sticky w -columnspan 2
+-
+-grid .state.l5 -column 0 -row 6 -sticky e -columnspan 2
+-grid .state.funcend -column 2 -row 6 -sticky w -columnspan 2
+-
+-frame .state.rule1 -relief raised -bd 2 -height 4
+-grid .state.rule1 -column 0 -row 7 -columnspan 4 -sticky ew
+-
+-grid .state.l6 -column 0 -row 8 -sticky e
+-grid .state.d0 -column 1 -row 8 -sticky w
+-grid .state.l7 -column 2 -row 8 -sticky e
+-grid .state.a0 -column 3 -row 8 -sticky w
+-
+-grid .state.l8 -column 0 -row 9 -sticky e
+-grid .state.d1 -column 1 -row 9 -sticky w
+-grid .state.l9 -column 2 -row 9 -sticky e
+-grid .state.a1 -column 3 -row 9 -sticky w
+-
+-grid .state.l10 -column 0 -row 10 -sticky e
+-grid .state.d2 -column 1 -row 10 -sticky w
+-grid .state.l11 -column 2 -row 10 -sticky e
+-grid .state.a2 -column 3 -row 10 -sticky w
+-
+-grid .state.l12 -column 0 -row 11 -sticky e
+-grid .state.d3 -column 1 -row 11 -sticky w
+-grid .state.l13 -column 2 -row 11 -sticky e
+-grid .state.a3 -column 3 -row 11 -sticky w
+-
+-grid .state.l14 -column 0 -row 12 -sticky e
+-grid .state.d4 -column 1 -row 12 -sticky w
+-grid .state.l15 -column 2 -row 12 -sticky e
+-grid .state.a4 -column 3 -row 12 -sticky w
+-
+-grid .state.l16 -column 0 -row 13 -sticky e
+-grid .state.d5 -column 1 -row 13 -sticky w
+-grid .state.l17 -column 2 -row 13 -sticky e
+-grid .state.a5 -column 3 -row 13 -sticky w
+-
+-grid .state.l18 -column 0 -row 14 -sticky e
+-grid .state.d6 -column 1 -row 14 -sticky w
+-grid .state.l19 -column 2 -row 14 -sticky e
+-grid .state.a6 -column 3 -row 14 -sticky w
+-
+-grid .state.l20 -column 0 -row 15 -sticky e
+-grid .state.d7 -column 1 -row 15 -sticky w
+-
+-grid .state.l21 -column 0 -row 16 -sticky e
+-grid .state.pc -column 1 -row 16 -sticky w
+-grid .state.l22 -column 2 -row 16 -sticky e
+-grid .state.sr -column 3 -row 16 -sticky w
+-
+-grid .state.l23 -column 0 -row 17 -sticky e
+-grid .state.usp -column 1 -row 17 -sticky w
+-grid .state.l24 -column 2 -row 17 -sticky e
+-grid .state.ssp -column 3 -row 17 -sticky w
+-
+-label .state.bl2 -text {B1:}
+-label .state.bl4 -text {B2:}
+-label .state.bl6 -text {B3:}
+-label .state.bl8 -text {B4:}
+-label .state.bl10 -text {B5:}
+-label .state.bl12 -text {B6:}
+-
+-label .state.b1 -text {00000000}
+-label .state.b1a -text {Off}
+-label .state.b2 -text {00000000}
+-label .state.b2a -text {Off}
+-label .state.b3 -text {00000000}
+-label .state.b3a -text {Off}
+-label .state.b4 -text {00000000}
+-label .state.b4a -text {Off}
+-label .state.b5 -text {00000000}
+-label .state.b5a -text {Off}
+-label .state.b6 -text {00000000}
+-label .state.b6a -text {Off}
+-
+-frame .state.rule2 -relief raised -bd 2 -height 4
+-grid .state.rule2 -column 0 -row 18 -columnspan 4 -sticky ew
+-
+-grid .state.bl2 -column 0 -row 19 -sticky e
+-grid .state.b1 -column 1 -row 19 -sticky w
+-grid .state.b1a -column 2 -row 19 -sticky w
+-
+-grid .state.bl4 -column 0 -row 20 -sticky e
+-grid .state.b2 -column 1 -row 20 -sticky w
+-grid .state.b2a -column 2 -row 20 -sticky w
+-
+-grid .state.bl6 -column 0 -row 21 -sticky e
+-grid .state.b3 -column 1 -row 21 -sticky w
+-grid .state.b3a -column 2 -row 21 -sticky w
+-
+-grid .state.bl8 -column 0 -row 22 -sticky e
+-grid .state.b4 -column 1 -row 22 -sticky w
+-grid .state.b4a -column 2 -row 22 -sticky w
+-
+-grid .state.bl10 -column 0 -row 23 -sticky e
+-grid .state.b5 -column 1 -row 23 -sticky w
+-grid .state.b5a -column 2 -row 23 -sticky w
+-
+-grid .state.bl12 -column 0 -row 24 -sticky e
+-grid .state.b6 -column 1 -row 24 -sticky w
+-grid .state.b6a -column 2 -row 24 -sticky w
+-
+-### /*** Generate debugger console window ***/
+-
+-wm title . \"Palm Debugger Console\"
+-catch {
+- wm iconbitmap . {@pix/case.xbm}
+- wm iconbitmap .remote {@pix/case.xbm}
+- wm iconbitmap .console {@pix/case.xbm}
+- wm iconbitmap .state {@pix/case.xbm}
+- #wm iconmask . {@pix/casemask.xbm}
+-}
+-
+-frame .m -relief raised
+-frame .f
+-scrollbar .f.y -orient vertical -command {.f.t yview}
+-text .f.t -yscrollcommand {.f.y set} -wrap word
+-pack .f.t -fill both -expand yes -side left
+-pack .f.y -fill y -side right
+-pack [menubutton .m.file -text {File} -menu .m.file.m] -side left
+-#pack [menubutton .m.edit -text {Edit} -menu .m.edit.m] -side left
+-pack [menubutton .m.windows -text {Windows} -menu .m.windows.m] -side left
+-#pack [menubutton .m.help -text {display_help} -menu .m.help.m] -side right
+-
+-menu .m.file.m
+-menu .m.windows.m
+-#menu .m.edit.m
+-#menu .m.help.m
+-
+-#wm iconify .remote
+-#wm iconify .console
+-#wm iconify .state
+-
+-
+-proc ShowWindow {name1 name2 op} {
+- global show
+- if {$show($name2)} {
+- if {[wm state $name2] != \"normal\"} {
+- wm deiconify $name2
+- }
+- } else {
+- if {[wm state $name2] == \"normal\"} {
+- wm withdraw $name2
+- }
+- }
+-}
+-
+-
+-trace variable show w {ShowWindow}
+-
+-bind .remote <Unmap> { set show(.remote) 0 }
+-bind .console <Unmap> { set show(.console) 0 }
+-bind .state <Unmap> { set show(.state) 0 }
+-
+-bind .remote <Map> { set show(.remote) 1 }
+-bind .console <Map> { set show(.console) 1 }
+-bind .state <Map> { set show(.state) 1 }
+-
+-wm protocol .remote WM_DELETE_WINDOW { set show(.remote) 0 }
+-wm protocol .console WM_DELETE_WINDOW { set show(.console) 0 }
+-wm protocol .state WM_DELETE_WINDOW { set show(.state) 0 }
+-
+-set show(.remote) 0
+-set show(.console) 0
+-set show(.state) 0
+-
+-
+-.m.file.m add command -label {Exit} -command {exit}
+-
+-.m.windows.m add checkbutton -label {Remote UI} -var show(.remote)
+-.m.windows.m add checkbutton -label {Remote Console} -var show(.console)
+-.m.windows.m add checkbutton -label {Remote State} -var show(.state)
+-
+-pack .m -side top -fill x
+-pack .f -side top -fill both -expand yes
+-focus .f.t
+-
+-### /*** Configure console bindings ***/
+-
+-bind .console.t <Shift-KeyPress-Return> {tkTextInsert .console.t \"\\n\" ; break}
+-bind .f.t <Shift-KeyPress-Return> {tkTextInsert .f.t \"\\n\" ; break}
+-
+-bind .console.t <Control-KeyPress-Return> {tkTextInsert .console.t \"\\n\" ; break}
+-bind .f.t <Control-KeyPress-Return> {tkTextInsert .f.t \"\\n\" ; break}
+-
+-bind .console.t <KeyPress-Return> {Console [.console.t get {insert linestart} {insert lineend}] ; break}
+-bind .f.t <KeyPress-Return> {
+- set line [.f.t get {insert linestart} {insert lineend}]
+- set f [string first \">\" $line]
+- incr f
+- set line [string range $line $f end]
+- .f.t mark set insert {insert lineend}
+- .f.t insert insert \\n
+- Debugger $line
+- if {[.f.t compare insert != {insert linestart}]} {
+- .f.t insert insert \"\\n\"
+- }
+- .f.t insert insert \"pilot-debug> \"
+- .f.t see insert
+- break
+-}
+-
+-proc Console {cmd} {
+- .console.t mark set insert {insert lineend}
+- tkTextInsert .console.t \\n
+- transmit $cmd
+-}
+-
+-proc Debugger {cmd} {
+- #.f.t mark set insert {insert lineend}
+- #tkTextInsert .f.t \\n
+- if {[string length [string trim $cmd]]!=0} {
+- set code [catch {eval $cmd} message]
+- if {[string length $message]} {
+- set message [string trimright $message]
+- Say \"$message\\n\"
+- #if {[.f.t compare insert != {insert linestart}]} {
+- # Say \"\\\n\"
+- #}
+- }
+- }
+-}
+-
+-proc Say {text} {
+- global Interactive
+- if {$Interactive} {
+- .f.t insert insert \"$text\"
+- .f.t see insert
+- } else {
+- upvar result result
+- set result \"$result$text\"
+- }
+-}
+-
+-", NULL);
++ Tcl_VarEval(interp,
++"\n"
++"### /*** Generate remote UI window ***/\n"
++"\n"
++"set tkdbg 1\n"
++"\n"
++"toplevel .remote\n"
++"wm title .remote {Palm Remote UI}\n"
++"\n"
++"catch {\n"
++" if {[file exists {tools/pix/case.gif}]} {\n"
++" set dir {tools}\n"
++" } elseif {[file exists {",LIBDIR,"/pix/case.gif}]} {\n"
++" set dir {",LIBDIR,"/pix}\n"
++" } else {\n"
++" error {No pix}\n"
++" }\n"
++" image create photo Case -format gif -file \"$dir/pix/case.gif\"\n"
++" image create photo B1 -format gif -file \"$dir/pix/b1.gif\"\n"
++" image create photo B2 -format gif -file \"$dir/pix/b2.gif\"\n"
++" image create photo B3 -format gif -file \"$dir/pix/b3.gif\"\n"
++" image create photo B4 -format gif -file \"$dir/pix/b4.gif\"\n"
++" image create photo B5 -format gif -file \"$dir/pix/b5.gif\"\n"
++" image create photo B6 -format gif -file \"$dir/pix/b6.gif\"\n"
++" image create photo B7 -format gif -file \"$dir/pix/b7.gif\"\n"
++"}\n"
++"\n"
++"canvas .remote.c -width 221 -height 337\n"
++"\n"
++".remote.c create rectangle 27 29 196 260 -outline {red} -tag screen -fill {blue}\n"
++".remote.c create rectangle 0 280 18 306 -outline {red} -tag button1 -fill {blue}\n"
++".remote.c create oval 23 276 52 307 -outline {red} -tag button2 -fill {blue}\n"
++".remote.c create oval 63 276 92 307 -outline {red} -tag button3 -fill {blue}\n"
++".remote.c create rectangle 97 277 127 294 -outline {red} -tag button4 -fill {blue}\n"
++".remote.c create rectangle 97 300 127 317 -outline {red} -tag button5 -fill {blue}\n"
++".remote.c create oval 133 276 162 307 -outline {red} -tag button6 -fill {blue}\n"
++".remote.c create oval 171 276 200 307 -outline {red} -tag button7 -fill {blue}\n"
++"\n"
++".remote.c create rectangle 33 32 187 253 -outline black -tag screen\n"
++".remote.c create rectangle 33 200 61 225 -outline black -tag screen\n"
++".remote.c create rectangle 33 225 61 253 -outline black -tag screen\n"
++".remote.c create rectangle 160 200 187 225 -outline black -tag screen\n"
++".remote.c create rectangle 160 225 187 253 -outline black -tag screen\n"
++".remote.c create rectangle 62 200 159 253 -outline black -tag screen\n"
++"\n"
++"set buttons(1) 0\n"
++"\n"
++"proc holdbutton {button} {\n"
++" global buttons\n"
++" if {$button==1} {\n"
++" set buttons($button) [after 1000 \"continuebutton $button\"]\n"
++" } else {\n"
++" pushbutton $button\n"
++" set buttons($button) [after 250 \"holdbutton $button\"]\n"
++" }\n"
++"}\n"
++"\n"
++"proc continuebutton {button} {\n"
++" global buttons\n"
++" if {$button==1} {\n"
++" pushbutton 0\n"
++" }\n"
++" set buttons($button) \"\"\n"
++"}\n"
++"\n"
++"proc releasebutton {button} {\n"
++" global buttons\n"
++" if {$buttons($button)!=\"\"} {\n"
++" if {$button==1} {\n"
++" pushbutton 1\n"
++" }\n"
++" after cancel $buttons($button)\n"
++" set buttons($button) \"\"\n"
++" }\n"
++"}\n"
++"\n"
++".remote.c bind button1 <ButtonPress-1> {.remote.c itemconfigure button1 -fill green; update; holdbutton 1}\n"
++".remote.c bind button1 <ButtonRelease-1> {.remote.c itemconfigure button1 -fill blue; releasebutton 1}\n"
++"\n"
++".remote.c bind button2 <ButtonPress-1> {.remote.c itemconfigure button2 -fill green; update; holdbutton 2}\n"
++".remote.c bind button2 <ButtonRelease-1> {.remote.c itemconfigure button2 -fill blue; releasebutton 2}\n"
++"\n"
++".remote.c bind button3 <ButtonPress-1> {.remote.c itemconfigure button3 -fill green; update; holdbutton 3}\n"
++".remote.c bind button3 <ButtonRelease-1> {.remote.c itemconfigure button3 -fill blue; releasebutton 3}\n"
++"\n"
++".remote.c bind button4 <ButtonPress-1> {.remote.c itemconfigure button4 -fill green; update; holdbutton 4}\n"
++".remote.c bind button4 <ButtonRelease-1> {.remote.c itemconfigure button4 -fill blue; releasebutton 4}\n"
++"\n"
++".remote.c bind button5 <ButtonPress-1> {.remote.c itemconfigure button5 -fill green; update; holdbutton 5}\n"
++".remote.c bind button5 <ButtonRelease-1> {.remote.c itemconfigure button5 -fill blue; releasebutton 5}\n"
++"\n"
++".remote.c bind button6 <ButtonPress-1> {.remote.c itemconfigure button6 -fill green; update; holdbutton 6}\n"
++".remote.c bind button6 <ButtonRelease-1> {.remote.c itemconfigure button6 -fill blue; releasebutton 6}\n"
++"\n"
++".remote.c bind button7 <ButtonPress-1> {.remote.c itemconfigure button7 -fill green; update; holdbutton 7}\n"
++".remote.c bind button7 <ButtonRelease-1> {.remote.c itemconfigure button7 -fill blue; releasebutton 7}\n"
++"\n"
++"catch {\n"
++" .remote.c create image 0 282 -image B1 -anchor nw -tag downbutton1\n"
++" .remote.c create image 22 274 -image B2 -anchor nw -tag downbutton2\n"
++" .remote.c create image 60 275 -image B3 -anchor nw -tag downbutton3\n"
++" .remote.c create image 93 278 -image B4 -anchor nw -tag downbutton4\n"
++" .remote.c create image 95 298 -image B5 -anchor nw -tag downbutton5\n"
++" .remote.c create image 131 275 -image B6 -anchor nw -tag downbutton6\n"
++" .remote.c create image 169 274 -image B7 -anchor nw -tag downbutton7\n"
++"\n"
++" .remote.c create image 0 0 -image Case -anchor nw\n"
++"\n"
++" .remote.c bind button1 <ButtonPress-1> {.remote.c raise downbutton1; update; holdbutton 1}\n"
++" .remote.c bind button1 <ButtonRelease-1> {.remote.c lower downbutton1; releasebutton 1}\n"
++"\n"
++" .remote.c bind button2 <ButtonPress-1> {.remote.c raise downbutton2; update; holdbutton 2}\n"
++" .remote.c bind button2 <ButtonRelease-1> {.remote.c lower downbutton2; releasebutton 2}\n"
++"\n"
++" .remote.c bind button3 <ButtonPress-1> {.remote.c raise downbutton3; update; holdbutton 3}\n"
++" .remote.c bind button3 <ButtonRelease-1> {.remote.c lower downbutton3; releasebutton 3}\n"
++"\n"
++" .remote.c bind button4 <ButtonPress-1> {.remote.c raise downbutton4; update; holdbutton 4}\n"
++" .remote.c bind button4 <ButtonRelease-1> {.remote.c lower downbutton4; releasebutton 4}\n"
++"\n"
++" .remote.c bind button5 <ButtonPress-1> {.remote.c raise downbutton5; update; holdbutton 5}\n"
++" .remote.c bind button5 <ButtonRelease-1> {.remote.c lower downbutton5; releasebutton 5}\n"
++"\n"
++" .remote.c bind button6 <ButtonPress-1> {.remote.c raise downbutton6; update; holdbutton 6}\n"
++" .remote.c bind button6 <ButtonRelease-1> {.remote.c lower downbutton6; releasebutton 6}\n"
++"\n"
++" .remote.c bind button7 <ButtonPress-1> {.remote.c raise downbutton7; update; holdbutton 7}\n"
++" .remote.c bind button7 <ButtonRelease-1> {.remote.c lower downbutton7; releasebutton 7}\n"
++" \n"
++" \n"
++" .remote.c itemconfigure button1 -outline {} -fill {}\n"
++" .remote.c raise button1\n"
++" .remote.c itemconfigure button2 -outline {} -fill {}\n"
++" .remote.c raise button2\n"
++" .remote.c itemconfigure button3 -outline {} -fill {}\n"
++" .remote.c raise button3\n"
++" .remote.c itemconfigure button4 -outline {} -fill {}\n"
++" .remote.c raise button4\n"
++" .remote.c itemconfigure button5 -outline {} -fill {}\n"
++" .remote.c raise button5\n"
++" .remote.c itemconfigure button6 -outline {} -fill {}\n"
++" .remote.c raise button6\n"
++" .remote.c itemconfigure button7 -outline {} -fill {}\n"
++" .remote.c raise button7\n"
++" .remote.c itemconfigure screen -outline {} -fill {}\n"
++" .remote.c raise screen\n"
++"}\n"
++"\n"
++"pack .remote.c -side top\n"
++"\n"
++".remote.c bind screen <ButtonPress-1> {pen %x %y 1}\n"
++".remote.c bind screen <B1-Motion> {pen %x %y 1}\n"
++".remote.c bind screen <ButtonRelease-1> {pen %x %y 0}\n"
++"\n"
++"global KeyQueue\n"
++"global KeyQueueId\n"
++"global KeyQueueDelay\n"
++"set KeyQueue {}\n"
++"set KeyQueueId {}\n"
++"set KeyQueueDelay 50\n"
++"\n"
++"proc readyqueue {} {\n"
++" global KeyQueueId\n"
++" global KeyQueueDelay\n"
++" if {$KeyQueueId == {}} {\n"
++" after $KeyQueueDelay { set KeyQueueId [ after idle {sendqueue} ] }\n"
++" }\n"
++"}\n"
++"\n"
++"proc queuekey {c} {\n"
++" global KeyQueue\n"
++" append KeyQueue $c\n"
++" readyqueue\n"
++"}\n"
++"\n"
++"proc sendqueue {} {\n"
++" global KeyQueue\n"
++" global KeyQueueId\n"
++" if {[string length $KeyQueue] > 0} {\n"
++" key [string index $KeyQueue 0]\n"
++" set KeyQueue [string range $KeyQueue 1 end]\n"
++" }\n"
++" set KeyQueueId {}\n"
++" if {[string length $KeyQueue] > 0} { readyqueue }\n"
++"}\n"
++"\n"
++"bind .remote <KeyPress> {queuekey %A}\n"
++"\n"
++"## Handle pasting\n"
++"proc do_paste { } {\n"
++" if [catch {selection get} sel] {\n"
++" if [catch {selection get -selection CLIPBOARD} sel] {\n"
++" return\n"
++" }\n"
++" }\n"
++" queuekey $sel\n"
++"}\n"
++"bind .remote <ButtonPress-2> {do_paste}\n"
++"\n"
++"##### /*** Generate remote console window ***/\n"
++"\n"
++"toplevel .console\n"
++"wm title .console \"Palm Remote Console\"\n"
++"scrollbar .console.y -orient vertical -command {.console.t yview}\n"
++"text .console.t -yscrollcommand {.console.y set}\n"
++"pack .console.t -fill both -expand yes -side left\n"
++"pack .console.y -fill y -side right\n"
++"focus .console.t\n"
++"\n"
++"#### /*** Generate pilot state window ***/\n"
++"\n"
++"toplevel .state\n"
++"wm title .state {Palm State}\n"
++"label .state.l1 -text {Active mode:}\n"
++"label .state.l1x -text {Battery:}\n"
++"label .state.l2 -text {Exception:}\n"
++"label .state.l25 -text {Reset:}\n"
++"label .state.l3 -text {Function:}\n"
++"label .state.l4 -text {F-start:}\n"
++"label .state.l5 -text {F-end:}\n"
++"label .state.l6 -text {D0:}\n"
++"label .state.l7 -text {A0:}\n"
++"label .state.l8 -text {D1:}\n"
++"label .state.l9 -text {A1:}\n"
++"label .state.l10 -text {D2:}\n"
++"label .state.l11 -text {A2:}\n"
++"label .state.l12 -text {D3:}\n"
++"label .state.l13 -text {A3:}\n"
++"label .state.l14 -text {D4:}\n"
++"label .state.l15 -text {A4:}\n"
++"label .state.l16 -text {D5:}\n"
++"label .state.l17 -text {A5:}\n"
++"label .state.l18 -text {D6:}\n"
++"label .state.l19 -text {A6:}\n"
++"label .state.l20 -text {D7:}\n"
++"\n"
++"label .state.l21 -text {PC:}\n"
++"label .state.l22 -text {SR:}\n"
++"label .state.l23 -text {USP:}\n"
++"label .state.l24 -text {SSP:}\n"
++"\n"
++"label .state.halted -text {None}\n"
++"label .state.battery -text {Unknown}\n"
++"label .state.exception -text {0}\n"
++"label .state.reset -text {No}\n"
++"label .state.funcname -text {}\n"
++"label .state.funcstart -text {00000000}\n"
++"label .state.funcend -text {00000000}\n"
++"label .state.d0 -text {00000000}\n"
++"label .state.a0 -text {00000000}\n"
++"label .state.d1 -text {00000000}\n"
++"label .state.a1 -text {00000000}\n"
++"label .state.d2 -text {00000000}\n"
++"label .state.a2 -text {00000000}\n"
++"label .state.d3 -text {00000000}\n"
++"label .state.a3 -text {00000000}\n"
++"label .state.d4 -text {00000000}\n"
++"label .state.a4 -text {00000000}\n"
++"label .state.d5 -text {00000000}\n"
++"label .state.a5 -text {00000000}\n"
++"label .state.d6 -text {00000000}\n"
++"label .state.a6 -text {00000000}\n"
++"label .state.d7 -text {00000000}\n"
++"label .state.pc -text {00000000}\n"
++"label .state.sr -text {0000}\n"
++"label .state.usp -text {00000000}\n"
++"label .state.ssp -text {00000000}\n"
++"\n"
++"grid .state.l1 -column 0 -row 0 -sticky e -columnspan 2\n"
++"grid .state.halted -column 2 -row 0 -sticky w -columnspan 2\n"
++"\n"
++"grid .state.l1x -column 0 -row 1 -sticky e -columnspan 2\n"
++"grid .state.battery -column 2 -row 1 -sticky w -columnspan 2\n"
++"\n"
++"grid .state.l2 -column 0 -row 2 -sticky e -columnspan 2\n"
++"grid .state.exception -column 2 -row 2 -sticky w -columnspan 2\n"
++"\n"
++"grid .state.l25 -column 0 -row 3 -sticky e -columnspan 2\n"
++"grid .state.reset -column 2 -row 3 -sticky w -columnspan 2\n"
++"\n"
++"grid .state.l3 -column 0 -row 4 -sticky e -columnspan 2 \n"
++"grid .state.funcname -column 2 -row 4 -sticky w -columnspan 2\n"
++"\n"
++"grid .state.l4 -column 0 -row 5 -sticky e -columnspan 2 \n"
++"grid .state.funcstart -column 2 -row 5 -sticky w -columnspan 2\n"
++"\n"
++"grid .state.l5 -column 0 -row 6 -sticky e -columnspan 2 \n"
++"grid .state.funcend -column 2 -row 6 -sticky w -columnspan 2\n"
++"\n"
++"frame .state.rule1 -relief raised -bd 2 -height 4\n"
++"grid .state.rule1 -column 0 -row 7 -columnspan 4 -sticky ew\n"
++"\n"
++"grid .state.l6 -column 0 -row 8 -sticky e \n"
++"grid .state.d0 -column 1 -row 8 -sticky w\n"
++"grid .state.l7 -column 2 -row 8 -sticky e \n"
++"grid .state.a0 -column 3 -row 8 -sticky w\n"
++"\n"
++"grid .state.l8 -column 0 -row 9 -sticky e \n"
++"grid .state.d1 -column 1 -row 9 -sticky w\n"
++"grid .state.l9 -column 2 -row 9 -sticky e \n"
++"grid .state.a1 -column 3 -row 9 -sticky w\n"
++"\n"
++"grid .state.l10 -column 0 -row 10 -sticky e \n"
++"grid .state.d2 -column 1 -row 10 -sticky w\n"
++"grid .state.l11 -column 2 -row 10 -sticky e \n"
++"grid .state.a2 -column 3 -row 10 -sticky w\n"
++"\n"
++"grid .state.l12 -column 0 -row 11 -sticky e \n"
++"grid .state.d3 -column 1 -row 11 -sticky w\n"
++"grid .state.l13 -column 2 -row 11 -sticky e \n"
++"grid .state.a3 -column 3 -row 11 -sticky w\n"
++"\n"
++"grid .state.l14 -column 0 -row 12 -sticky e \n"
++"grid .state.d4 -column 1 -row 12 -sticky w\n"
++"grid .state.l15 -column 2 -row 12 -sticky e \n"
++"grid .state.a4 -column 3 -row 12 -sticky w\n"
++"\n"
++"grid .state.l16 -column 0 -row 13 -sticky e \n"
++"grid .state.d5 -column 1 -row 13 -sticky w\n"
++"grid .state.l17 -column 2 -row 13 -sticky e \n"
++"grid .state.a5 -column 3 -row 13 -sticky w\n"
++"\n"
++"grid .state.l18 -column 0 -row 14 -sticky e \n"
++"grid .state.d6 -column 1 -row 14 -sticky w\n"
++"grid .state.l19 -column 2 -row 14 -sticky e \n"
++"grid .state.a6 -column 3 -row 14 -sticky w\n"
++"\n"
++"grid .state.l20 -column 0 -row 15 -sticky e \n"
++"grid .state.d7 -column 1 -row 15 -sticky w\n"
++"\n"
++"grid .state.l21 -column 0 -row 16 -sticky e \n"
++"grid .state.pc -column 1 -row 16 -sticky w\n"
++"grid .state.l22 -column 2 -row 16 -sticky e \n"
++"grid .state.sr -column 3 -row 16 -sticky w\n"
++"\n"
++"grid .state.l23 -column 0 -row 17 -sticky e \n"
++"grid .state.usp -column 1 -row 17 -sticky w\n"
++"grid .state.l24 -column 2 -row 17 -sticky e \n"
++"grid .state.ssp -column 3 -row 17 -sticky w\n"
++"\n"
++"label .state.bl2 -text {B1:}\n"
++"label .state.bl4 -text {B2:}\n"
++"label .state.bl6 -text {B3:}\n"
++"label .state.bl8 -text {B4:}\n"
++"label .state.bl10 -text {B5:}\n"
++"label .state.bl12 -text {B6:}\n"
++"\n"
++"label .state.b1 -text {00000000}\n"
++"label .state.b1a -text {Off}\n"
++"label .state.b2 -text {00000000}\n"
++"label .state.b2a -text {Off}\n"
++"label .state.b3 -text {00000000}\n"
++"label .state.b3a -text {Off}\n"
++"label .state.b4 -text {00000000}\n"
++"label .state.b4a -text {Off}\n"
++"label .state.b5 -text {00000000}\n"
++"label .state.b5a -text {Off}\n"
++"label .state.b6 -text {00000000}\n"
++"label .state.b6a -text {Off}\n"
++"\n"
++"frame .state.rule2 -relief raised -bd 2 -height 4\n"
++"grid .state.rule2 -column 0 -row 18 -columnspan 4 -sticky ew\n"
++"\n"
++"grid .state.bl2 -column 0 -row 19 -sticky e\n"
++"grid .state.b1 -column 1 -row 19 -sticky w\n"
++"grid .state.b1a -column 2 -row 19 -sticky w \n"
++"\n"
++"grid .state.bl4 -column 0 -row 20 -sticky e\n"
++"grid .state.b2 -column 1 -row 20 -sticky w\n"
++"grid .state.b2a -column 2 -row 20 -sticky w \n"
++"\n"
++"grid .state.bl6 -column 0 -row 21 -sticky e\n"
++"grid .state.b3 -column 1 -row 21 -sticky w\n"
++"grid .state.b3a -column 2 -row 21 -sticky w \n"
++"\n"
++"grid .state.bl8 -column 0 -row 22 -sticky e\n"
++"grid .state.b4 -column 1 -row 22 -sticky w\n"
++"grid .state.b4a -column 2 -row 22 -sticky w \n"
++"\n"
++"grid .state.bl10 -column 0 -row 23 -sticky e\n"
++"grid .state.b5 -column 1 -row 23 -sticky w\n"
++"grid .state.b5a -column 2 -row 23 -sticky w \n"
++"\n"
++"grid .state.bl12 -column 0 -row 24 -sticky e\n"
++"grid .state.b6 -column 1 -row 24 -sticky w\n"
++"grid .state.b6a -column 2 -row 24 -sticky w \n"
++"\n"
++"### /*** Generate debugger console window ***/\n"
++"\n"
++"wm title . \"Palm Debugger Console\"\n"
++"catch {\n"
++" wm iconbitmap . {@pix/case.xbm}\n"
++" wm iconbitmap .remote {@pix/case.xbm}\n"
++" wm iconbitmap .console {@pix/case.xbm}\n"
++" wm iconbitmap .state {@pix/case.xbm}\n"
++" #wm iconmask . {@pix/casemask.xbm}\n"
++"}\n"
++"\n"
++"frame .m -relief raised\n"
++"frame .f\n"
++"scrollbar .f.y -orient vertical -command {.f.t yview}\n"
++"text .f.t -yscrollcommand {.f.y set} -wrap word\n"
++"pack .f.t -fill both -expand yes -side left\n"
++"pack .f.y -fill y -side right\n"
++"pack [menubutton .m.file -text {File} -menu .m.file.m] -side left\n"
++"#pack [menubutton .m.edit -text {Edit} -menu .m.edit.m] -side left\n"
++"pack [menubutton .m.windows -text {Windows} -menu .m.windows.m] -side left\n"
++"#pack [menubutton .m.help -text {display_help} -menu .m.help.m] -side right\n"
++"\n"
++"menu .m.file.m\n"
++"menu .m.windows.m\n"
++"#menu .m.edit.m\n"
++"#menu .m.help.m\n"
++"\n"
++"#wm iconify .remote\n"
++"#wm iconify .console\n"
++"#wm iconify .state\n"
++"\n"
++"\n"
++"proc ShowWindow {name1 name2 op} {\n"
++" global show\n"
++" if {$show($name2)} {\n"
++" if {[wm state $name2] != \"normal\"} {\n"
++" wm deiconify $name2\n"
++" }\n"
++" } else {\n"
++" if {[wm state $name2] == \"normal\"} {\n"
++" wm withdraw $name2\n"
++" }\n"
++" }\n"
++"}\n"
++"\n"
++"\n"
++"trace variable show w {ShowWindow}\n"
++"\n"
++"bind .remote <Unmap> { set show(.remote) 0 }\n"
++"bind .console <Unmap> { set show(.console) 0 }\n"
++"bind .state <Unmap> { set show(.state) 0 }\n"
++"\n"
++"bind .remote <Map> { set show(.remote) 1 }\n"
++"bind .console <Map> { set show(.console) 1 }\n"
++"bind .state <Map> { set show(.state) 1 }\n"
++"\n"
++"wm protocol .remote WM_DELETE_WINDOW { set show(.remote) 0 }\n"
++"wm protocol .console WM_DELETE_WINDOW { set show(.console) 0 }\n"
++"wm protocol .state WM_DELETE_WINDOW { set show(.state) 0 }\n"
++"\n"
++"set show(.remote) 0\n"
++"set show(.console) 0\n"
++"set show(.state) 0\n"
++"\n"
++"\n"
++".m.file.m add command -label {Exit} -command {exit}\n"
++"\n"
++".m.windows.m add checkbutton -label {Remote UI} -var show(.remote)\n"
++".m.windows.m add checkbutton -label {Remote Console} -var show(.console)\n"
++".m.windows.m add checkbutton -label {Remote State} -var show(.state)\n"
++"\n"
++"pack .m -side top -fill x\n"
++"pack .f -side top -fill both -expand yes\n"
++"focus .f.t\n"
++"\n"
++"### /*** Configure console bindings ***/\n"
++"\n"
++"bind .console.t <Shift-KeyPress-Return> {tkTextInsert .console.t \"\\n\" ; break}\n"
++"bind .f.t <Shift-KeyPress-Return> {tkTextInsert .f.t \"\\n\" ; break}\n"
++"\n"
++"bind .console.t <Control-KeyPress-Return> {tkTextInsert .console.t \"\\n\" ; break}\n"
++"bind .f.t <Control-KeyPress-Return> {tkTextInsert .f.t \"\\n\" ; break}\n"
++"\n"
++"bind .console.t <KeyPress-Return> {Console [.console.t get {insert linestart} {insert lineend}] ; break}\n"
++"bind .f.t <KeyPress-Return> {\n"
++" set line [.f.t get {insert linestart} {insert lineend}]\n"
++" set f [string first \">\" $line]\n"
++" incr f\n"
++" set line [string range $line $f end]\n"
++" .f.t mark set insert {insert lineend}\n"
++" .f.t insert insert \\n\n"
++" Debugger $line\n"
++" if {[.f.t compare insert != {insert linestart}]} {\n"
++" .f.t insert insert \"\\n\"\n"
++" }\n"
++" .f.t insert insert \"pilot-debug> \"\n"
++" .f.t see insert\n"
++" break\n"
++"}\n"
++"\n"
++"proc Console {cmd} {\n"
++" .console.t mark set insert {insert lineend}\n"
++" tkTextInsert .console.t \\n\n"
++" transmit $cmd\n"
++"}\n"
++"\n"
++"proc Debugger {cmd} {\n"
++" #.f.t mark set insert {insert lineend}\n"
++" #tkTextInsert .f.t \\n\n"
++" if {[string length [string trim $cmd]]!=0} {\n"
++" set code [catch {eval $cmd} message]\n"
++" if {[string length $message]} {\n"
++" set message [string trimright $message]\n"
++" Say \"$message\\n\"\n"
++" #if {[.f.t compare insert != {insert linestart}]} {\n"
++" # Say \"\\\n\"\n"
++" #}\n"
++" }\n"
++" }\n"
++"}\n"
++"\n"
++"proc Say {text} {\n"
++" global Interactive\n"
++" if {$Interactive} {\n"
++" .f.t insert insert \"$text\"\n"
++" .f.t see insert\n"
++" } else {\n"
++" upvar result result\n"
++" set result \"$result$text\"\n"
++" }\n"
++"}\n\n", NULL);
+ puts(interp->result);
+
+ created = 1;
+@@ -2080,25 +2078,24 @@
+
+ static int proc_help(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
+ {
+- Say("\
+---- display_help ---\n\
+-g [<addr>] Go: Resume execution (if address is supplied,
+- will start at that point)\n\
+-t <addr1> [<addr2>] Till: Resume execution until addr1 (if addr2 is
+- supplied, will start at that point)\n\
+-coldboot Simulate the hard-reset (reset pin + power
+- button press, i.e. lose all data)\n\
+-warmboot Simulate a soft-reset (reset pin press)\n\
+-pushbutton <button number> Simulate button push\n\
+-mirror [bool] Continually view the Palm's screen in the
+- Remote UI window (if bool supplied, can
+- turn on or off mirroring, otherwise
+- toggles)\n\
+-getdisplay Show the Palm's display in the Remote UI
+- window\n\
+-updatedisplay Force a mirror refresh\n\
+-feature Get/Set/Read Palm features\n\
+-");
++ Say(
++"--- display_help ---\n"
++"g [<addr>] Go: Resume execution (if address is supplied,\n"
++" will start at that point)\n"
++"t <addr1> [<addr2>] Till: Resume execution until addr1 (if addr2 is\n"
++" supplied, will start at that point)\n"
++"coldboot Simulate the hard-reset (reset pin + power\n"
++" button press, i.e. lose all data)\n"
++"warmboot Simulate a soft-reset (reset pin press)\n"
++"pushbutton <button number> Simulate button push\n"
++"mirror [bool] Continually view the Palm's screen in the\n"
++" Remote UI window (if bool supplied, can\n"
++" turn on or off mirroring, otherwise\n"
++" toggles)\n"
++"getdisplay Show the Palm's display in the Remote UI\n"
++" window\n"
++"updatedisplay Force a mirror refresh\n"
++"feature Get/Set/Read Palm features\n");
+ return TCL_OK;
+ }
+
+@@ -2151,55 +2148,53 @@
+ Tcl_CreateCommand(interp, cmds[i].name, cmds[i].proc, 0, NULL);
+ }
+
+- Tcl_VarEval(interp,"\
+-proc Say {text} {
+- global Interactive
+- if {$Interactive} {
+- puts \"$text\"
+- } else {
+- upvar result result
+- set result \"$result$text\"
+- }
+-}
+-
+-proc interactive {args} {
+- global Interactive
+- global errorInfo
+- set hold $Interactive
+- set Interactive 1
+- set code [catch $args message]
+- set Interactive $hold
+- error $message $errorInfo $code
+-}
+-
+-proc noninteractive {args} {
+- global Interactive
+- global errorInfo
+- set hold $Interactive
+- set Interactive 0
+- set code [catch $args message]
+- set Interactive $hold
+- error $message $errorInfo $code
+-}
+-
+-set Interactive 1
+-
+-proc bgerror {msg} {
+- Say $msg
+-}
+-
+-proc checkup {} {
+- catch {noninteractive battery}
+- after 10000 checkup
+-}
+-
+-after 1000 checkup
+-
+-proc checkupin {time} {
+- after $time {catch {noninteractive battery}}
+-}
+-
+-",NULL);
++ Tcl_VarEval(interp,
++"proc Say {text} {\n"
++" global Interactive\n"
++" if {$Interactive} {\n"
++" puts \"$text\"\n"
++" } else {\n"
++" upvar result result\n"
++" set result \"$result$text\"\n"
++" }\n"
++"}\n"
++"\n"
++"proc interactive {args} {\n"
++" global Interactive\n"
++" global errorInfo\n"
++" set hold $Interactive\n"
++" set Interactive 1\n"
++" set code [catch $args message]\n"
++" set Interactive $hold\n"
++" error $message $errorInfo $code\n"
++"}\n"
++"\n"
++"proc noninteractive {args} {\n"
++" global Interactive\n"
++" global errorInfo\n"
++" set hold $Interactive\n"
++" set Interactive 0\n"
++" set code [catch $args message]\n"
++" set Interactive $hold\n"
++" error $message $errorInfo $code\n"
++"}\n"
++"\n"
++"set Interactive 1\n"
++"\n"
++"proc bgerror {msg} {\n"
++" Say $msg\n"
++"}\n"
++"\n"
++"proc checkup {} {\n"
++" catch {noninteractive battery}\n"
++" after 10000 checkup\n"
++"}\n"
++"\n"
++"after 1000 checkup\n"
++"\n"
++"proc checkupin {time} {\n"
++" after $time {catch {noninteractive battery}}\n"
++"}\n\n", NULL);
+
+ Tcl_LinkVar(interp, "Interactive", (char*)&Interactive, TCL_LINK_INT);
+
+@@ -2216,44 +2211,36 @@
+ Type 'exit' to quit the application\n\n");
+
+ #if 0
+- Say("\tWelcome to pilot-debug!\n\n\
+-
+-Please connect your Palm and start console or debugging mode.\n\n\
+-
+-(Console mode is a background task that can respond to a few commands,\n
+-most importantly RPC which lets any function on the Palm be invoked. The\n
+-Palm operates as usual while console mode is active, except that since\n
+-the serial port is held open, HotSync and other applications that use\n
+-the serial port will not work. Debug mode is activated on demand or when\n
+-the Palm crashes. In debug mode, the CPU is halted, and no commands may\n
+-be executed, except via a debugging console like this one.)\n\n\
+-
+-In the absence of special utilities, the console can be started by the\n
+-\".2\" shortcut, and debugging via \".1\". To clear either mode,\n
+-reboot via the reset button. If console mode is active, you may also\n
+-reboot via the \"coldboot\" or \"warmboot\" commands.\n\n\
+-
+-The Remote UI window lets you manipulate the Palm if console mode is\n
+-active. By clicking the mouse button on the screen or buttons, you can\n
+-simulate pen taps, and if you type anything while the window has the\n
+-focus, the Palm will receive the keystrokes.\n\n\
+-
+-The Remote Console window is specifically for the transmission and\n
+-reception of console packets. Pressing Return on a line will transmit\n
+-it, and any incoming packets will be displayed here in addition to the\n
+-Debug Console.\n\n\
+-
+-The Remote State window shows the current Palm CPU state. It is only\n
+-updated on request or when the Palm halts.\n\n\
+-
+-
+-The Debugging Console window is the primary interface for pilot-debug.\n
+-Pressing Return on a line that contains text will execute that line as\n
+-a Tcl command. (Try 'expr 3+4'.) All of the usual Tcl and Tk commands\n
+-are available, as well as some special-purpose ones, including 'help',\n
+-'coldboot', 'warmboot', 'attach', 't', and 'g', (the last one continues\n
+-after the Palm halts.)\n\n\ Execute 'help' for the list of commands\n
+-currently implemented.\n\n\ ");
++ Say("\tWelcome to pilot-debug!\n\n\n"
++"Please connect your Palm and start console or debugging mode.\n\n"
++"(Console mode is a background task that can respond to a few commands,\n"
++"most importantly RPC which lets any function on the Palm be invoked. The\n"
++"Palm operates as usual while console mode is active, except that since\n"
++"the serial port is held open, HotSync and other applications that use\n"
++"the serial port will not work. Debug mode is activated on demand or when\n"
++"the Palm crashes. In debug mode, the CPU is halted, and no commands may\n"
++"be executed, except via a debugging console like this one.)\n\n"
++"In the absence of special utilities, the console can be started by the\n"
++"\".2\" shortcut, and debugging via \".1\". To clear either mode,\n"
++"reboot via the reset button. If console mode is active, you may also\n"
++"reboot via the \"coldboot\" or \"warmboot\" commands.\n\n"
++"The Remote UI window lets you manipulate the Palm if console mode is\n"
++"active. By clicking the mouse button on the screen or buttons, you can\n"
++"simulate pen taps, and if you type anything while the window has the\n"
++"focus, the Palm will receive the keystrokes.\n\n"
++"The Remote Console window is specifically for the transmission and\n"
++"reception of console packets. Pressing Return on a line will transmit\n"
++"it, and any incoming packets will be displayed here in addition to the\n"
++"Debug Console.\n\n"
++"The Remote State window shows the current Palm CPU state. It is only\n"
++"updated on request or when the Palm halts.\n\n"
++"The Debugging Console window is the primary interface for pilot-debug.\n"
++"Pressing Return on a line that contains text will execute that line as\n"
++"a Tcl command. (Try 'expr 3+4'.) All of the usual Tcl and Tk commands\n"
++"are available, as well as some special-purpose ones, including 'help',\n"
++"'coldboot', 'warmboot', 'attach', 't', and 'g', (the last one continues\n"
++"after the Palm halts.)\n\n\ Execute 'help' for the list of commands\n"
++"currently implemented.\n\n");
+ #endif
+
+ /* Specify a user-specific startup file to invoke if the application is
+@@ -2263,26 +2250,23 @@
+
+ Tcl_SetVar(interp, "tcl_rcFileName", "~/.pdebugrc", TCL_GLOBAL_ONLY);
+
+- Tcl_VarEval(interp,"\
+- set tcl_prompt1 myprompt
+- proc myprompt {} {
+- puts -nonewline \"pilot-debug> \"
+- }
+-
+- ",NULL);
++ Tcl_VarEval(interp,
++" set tcl_prompt1 myprompt\n"
++" proc myprompt {} {\n"
++" puts -nonewline \"pilot-debug> \"\n"
++" }\n\n",NULL);
+
+ /* Deal with command-line arguments */
+
+- Tcl_VarEval(interp,"\
+- if {$argc > 0} {
+- set p [lindex $argv 0]
+- set argv [lrange $argv 1 end]
+- port $p
+- } else {
+- Say \"As you have not entered a serial port on the command like, you might like to \
+-set one with 'port /dev/something'\\n\\n\"
+- }
+- ",NULL);
++ Tcl_VarEval(interp,
++" if {$argc > 0} {\n"
++" set p [lindex $argv 0]\n"
++" set argv [lrange $argv 1 end]\n"
++" port $p\n"
++" } else {\n"
++" Say \"As you have not entered a serial port on the command like, you might like to "
++"set one with 'port /dev/something'\\n\\n\"\n"
++" }\n",NULL);
+
+ return TCL_OK;
+ }