mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1350 lines
48 KiB

  1. # --- ROCK-COPYRIGHT-NOTE-BEGIN ---
  2. #
  3. # This copyright note is auto-generated by ./scripts/Create-CopyPatch.
  4. # Please add additional copyright information _after_ the line containing
  5. # the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by
  6. # the ./scripts/Create-CopyPatch script. Do not edit this copyright text!
  7. #
  8. # ROCK Linux: rock-src/package/tibit/pilot-link/multi-line-strings.patch
  9. # ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf
  10. #
  11. # This patch file is dual-licensed. It is available under the license the
  12. # patched project is licensed under, as long as it is an OpenSource license
  13. # as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms
  14. # of the GNU General Public License as published by the Free Software
  15. # Foundation; either version 2 of the License, or (at your option) any later
  16. # version.
  17. #
  18. # --- ROCK-COPYRIGHT-NOTE-END ---
  19. --- pilot-link-0.11.7/src/pilot-debug.c 2002-12-02 15:32:47.000000000 +0100
  20. +++ pilot-link-0.11.7-rock/src/pilot-debug.c 2004-02-25 00:11:06.000000000 +0100
  21. @@ -1549,526 +1549,526 @@
  22. return TCL_OK;
  23. }
  24. - Tcl_VarEval(interp,"\
  25. -
  26. -### /*** Generate remote UI window ***/
  27. -
  28. -set tkdbg 1
  29. -
  30. -toplevel .remote
  31. -wm title .remote {Palm Remote UI}
  32. -
  33. -catch {
  34. - if {[file exists {tools/pix/case.gif}]} {
  35. - set dir {tools}
  36. - } elseif {[file exists {",LIBDIR,"/pix/case.gif}]} {
  37. - set dir {",LIBDIR,"/pix}
  38. - } else {
  39. - error {No pix}
  40. - }
  41. - image create photo Case -format gif -file \"$dir/pix/case.gif\"
  42. - image create photo B1 -format gif -file \"$dir/pix/b1.gif\"
  43. - image create photo B2 -format gif -file \"$dir/pix/b2.gif\"
  44. - image create photo B3 -format gif -file \"$dir/pix/b3.gif\"
  45. - image create photo B4 -format gif -file \"$dir/pix/b4.gif\"
  46. - image create photo B5 -format gif -file \"$dir/pix/b5.gif\"
  47. - image create photo B6 -format gif -file \"$dir/pix/b6.gif\"
  48. - image create photo B7 -format gif -file \"$dir/pix/b7.gif\"
  49. -}
  50. -
  51. -canvas .remote.c -width 221 -height 337
  52. -
  53. -.remote.c create rectangle 27 29 196 260 -outline {red} -tag screen -fill {blue}
  54. -.remote.c create rectangle 0 280 18 306 -outline {red} -tag button1 -fill {blue}
  55. -.remote.c create oval 23 276 52 307 -outline {red} -tag button2 -fill {blue}
  56. -.remote.c create oval 63 276 92 307 -outline {red} -tag button3 -fill {blue}
  57. -.remote.c create rectangle 97 277 127 294 -outline {red} -tag button4 -fill {blue}
  58. -.remote.c create rectangle 97 300 127 317 -outline {red} -tag button5 -fill {blue}
  59. -.remote.c create oval 133 276 162 307 -outline {red} -tag button6 -fill {blue}
  60. -.remote.c create oval 171 276 200 307 -outline {red} -tag button7 -fill {blue}
  61. -
  62. -.remote.c create rectangle 33 32 187 253 -outline black -tag screen
  63. -.remote.c create rectangle 33 200 61 225 -outline black -tag screen
  64. -.remote.c create rectangle 33 225 61 253 -outline black -tag screen
  65. -.remote.c create rectangle 160 200 187 225 -outline black -tag screen
  66. -.remote.c create rectangle 160 225 187 253 -outline black -tag screen
  67. -.remote.c create rectangle 62 200 159 253 -outline black -tag screen
  68. -
  69. -set buttons(1) 0
  70. -
  71. -proc holdbutton {button} {
  72. - global buttons
  73. - if {$button==1} {
  74. - set buttons($button) [after 1000 \"continuebutton $button\"]
  75. - } else {
  76. - pushbutton $button
  77. - set buttons($button) [after 250 \"holdbutton $button\"]
  78. - }
  79. -}
  80. -
  81. -proc continuebutton {button} {
  82. - global buttons
  83. - if {$button==1} {
  84. - pushbutton 0
  85. - }
  86. - set buttons($button) \"\"
  87. -}
  88. -
  89. -proc releasebutton {button} {
  90. - global buttons
  91. - if {$buttons($button)!=\"\"} {
  92. - if {$button==1} {
  93. - pushbutton 1
  94. - }
  95. - after cancel $buttons($button)
  96. - set buttons($button) \"\"
  97. - }
  98. -}
  99. -
  100. -.remote.c bind button1 <ButtonPress-1> {.remote.c itemconfigure button1 -fill green; update; holdbutton 1}
  101. -.remote.c bind button1 <ButtonRelease-1> {.remote.c itemconfigure button1 -fill blue; releasebutton 1}
  102. -
  103. -.remote.c bind button2 <ButtonPress-1> {.remote.c itemconfigure button2 -fill green; update; holdbutton 2}
  104. -.remote.c bind button2 <ButtonRelease-1> {.remote.c itemconfigure button2 -fill blue; releasebutton 2}
  105. -
  106. -.remote.c bind button3 <ButtonPress-1> {.remote.c itemconfigure button3 -fill green; update; holdbutton 3}
  107. -.remote.c bind button3 <ButtonRelease-1> {.remote.c itemconfigure button3 -fill blue; releasebutton 3}
  108. -
  109. -.remote.c bind button4 <ButtonPress-1> {.remote.c itemconfigure button4 -fill green; update; holdbutton 4}
  110. -.remote.c bind button4 <ButtonRelease-1> {.remote.c itemconfigure button4 -fill blue; releasebutton 4}
  111. -
  112. -.remote.c bind button5 <ButtonPress-1> {.remote.c itemconfigure button5 -fill green; update; holdbutton 5}
  113. -.remote.c bind button5 <ButtonRelease-1> {.remote.c itemconfigure button5 -fill blue; releasebutton 5}
  114. -
  115. -.remote.c bind button6 <ButtonPress-1> {.remote.c itemconfigure button6 -fill green; update; holdbutton 6}
  116. -.remote.c bind button6 <ButtonRelease-1> {.remote.c itemconfigure button6 -fill blue; releasebutton 6}
  117. -
  118. -.remote.c bind button7 <ButtonPress-1> {.remote.c itemconfigure button7 -fill green; update; holdbutton 7}
  119. -.remote.c bind button7 <ButtonRelease-1> {.remote.c itemconfigure button7 -fill blue; releasebutton 7}
  120. -
  121. -catch {
  122. - .remote.c create image 0 282 -image B1 -anchor nw -tag downbutton1
  123. - .remote.c create image 22 274 -image B2 -anchor nw -tag downbutton2
  124. - .remote.c create image 60 275 -image B3 -anchor nw -tag downbutton3
  125. - .remote.c create image 93 278 -image B4 -anchor nw -tag downbutton4
  126. - .remote.c create image 95 298 -image B5 -anchor nw -tag downbutton5
  127. - .remote.c create image 131 275 -image B6 -anchor nw -tag downbutton6
  128. - .remote.c create image 169 274 -image B7 -anchor nw -tag downbutton7
  129. -
  130. - .remote.c create image 0 0 -image Case -anchor nw
  131. -
  132. - .remote.c bind button1 <ButtonPress-1> {.remote.c raise downbutton1; update; holdbutton 1}
  133. - .remote.c bind button1 <ButtonRelease-1> {.remote.c lower downbutton1; releasebutton 1}
  134. -
  135. - .remote.c bind button2 <ButtonPress-1> {.remote.c raise downbutton2; update; holdbutton 2}
  136. - .remote.c bind button2 <ButtonRelease-1> {.remote.c lower downbutton2; releasebutton 2}
  137. -
  138. - .remote.c bind button3 <ButtonPress-1> {.remote.c raise downbutton3; update; holdbutton 3}
  139. - .remote.c bind button3 <ButtonRelease-1> {.remote.c lower downbutton3; releasebutton 3}
  140. -
  141. - .remote.c bind button4 <ButtonPress-1> {.remote.c raise downbutton4; update; holdbutton 4}
  142. - .remote.c bind button4 <ButtonRelease-1> {.remote.c lower downbutton4; releasebutton 4}
  143. -
  144. - .remote.c bind button5 <ButtonPress-1> {.remote.c raise downbutton5; update; holdbutton 5}
  145. - .remote.c bind button5 <ButtonRelease-1> {.remote.c lower downbutton5; releasebutton 5}
  146. -
  147. - .remote.c bind button6 <ButtonPress-1> {.remote.c raise downbutton6; update; holdbutton 6}
  148. - .remote.c bind button6 <ButtonRelease-1> {.remote.c lower downbutton6; releasebutton 6}
  149. -
  150. - .remote.c bind button7 <ButtonPress-1> {.remote.c raise downbutton7; update; holdbutton 7}
  151. - .remote.c bind button7 <ButtonRelease-1> {.remote.c lower downbutton7; releasebutton 7}
  152. -
  153. -
  154. - .remote.c itemconfigure button1 -outline {} -fill {}
  155. - .remote.c raise button1
  156. - .remote.c itemconfigure button2 -outline {} -fill {}
  157. - .remote.c raise button2
  158. - .remote.c itemconfigure button3 -outline {} -fill {}
  159. - .remote.c raise button3
  160. - .remote.c itemconfigure button4 -outline {} -fill {}
  161. - .remote.c raise button4
  162. - .remote.c itemconfigure button5 -outline {} -fill {}
  163. - .remote.c raise button5
  164. - .remote.c itemconfigure button6 -outline {} -fill {}
  165. - .remote.c raise button6
  166. - .remote.c itemconfigure button7 -outline {} -fill {}
  167. - .remote.c raise button7
  168. - .remote.c itemconfigure screen -outline {} -fill {}
  169. - .remote.c raise screen
  170. -}
  171. -
  172. -pack .remote.c -side top
  173. -
  174. -.remote.c bind screen <ButtonPress-1> {pen %x %y 1}
  175. -.remote.c bind screen <B1-Motion> {pen %x %y 1}
  176. -.remote.c bind screen <ButtonRelease-1> {pen %x %y 0}
  177. -
  178. -global KeyQueue
  179. -global KeyQueueId
  180. -global KeyQueueDelay
  181. -set KeyQueue {}
  182. -set KeyQueueId {}
  183. -set KeyQueueDelay 50
  184. -
  185. -proc readyqueue {} {
  186. - global KeyQueueId
  187. - global KeyQueueDelay
  188. - if {$KeyQueueId == {}} {
  189. - after $KeyQueueDelay { set KeyQueueId [ after idle {sendqueue} ] }
  190. - }
  191. -}
  192. -
  193. -proc queuekey {c} {
  194. - global KeyQueue
  195. - append KeyQueue $c
  196. - readyqueue
  197. -}
  198. -
  199. -proc sendqueue {} {
  200. - global KeyQueue
  201. - global KeyQueueId
  202. - if {[string length $KeyQueue] > 0} {
  203. - key [string index $KeyQueue 0]
  204. - set KeyQueue [string range $KeyQueue 1 end]
  205. - }
  206. - set KeyQueueId {}
  207. - if {[string length $KeyQueue] > 0} { readyqueue }
  208. -}
  209. -
  210. -bind .remote <KeyPress> {queuekey %A}
  211. -
  212. -## Handle pasting
  213. -proc do_paste { } {
  214. - if [catch {selection get} sel] {
  215. - if [catch {selection get -selection CLIPBOARD} sel] {
  216. - return
  217. - }
  218. - }
  219. - queuekey $sel
  220. -}
  221. -bind .remote <ButtonPress-2> {do_paste}
  222. -
  223. -##### /*** Generate remote console window ***/
  224. -
  225. -toplevel .console
  226. -wm title .console \"Palm Remote Console\"
  227. -scrollbar .console.y -orient vertical -command {.console.t yview}
  228. -text .console.t -yscrollcommand {.console.y set}
  229. -pack .console.t -fill both -expand yes -side left
  230. -pack .console.y -fill y -side right
  231. -focus .console.t
  232. -
  233. -#### /*** Generate pilot state window ***/
  234. -
  235. -toplevel .state
  236. -wm title .state {Palm State}
  237. -label .state.l1 -text {Active mode:}
  238. -label .state.l1x -text {Battery:}
  239. -label .state.l2 -text {Exception:}
  240. -label .state.l25 -text {Reset:}
  241. -label .state.l3 -text {Function:}
  242. -label .state.l4 -text {F-start:}
  243. -label .state.l5 -text {F-end:}
  244. -label .state.l6 -text {D0:}
  245. -label .state.l7 -text {A0:}
  246. -label .state.l8 -text {D1:}
  247. -label .state.l9 -text {A1:}
  248. -label .state.l10 -text {D2:}
  249. -label .state.l11 -text {A2:}
  250. -label .state.l12 -text {D3:}
  251. -label .state.l13 -text {A3:}
  252. -label .state.l14 -text {D4:}
  253. -label .state.l15 -text {A4:}
  254. -label .state.l16 -text {D5:}
  255. -label .state.l17 -text {A5:}
  256. -label .state.l18 -text {D6:}
  257. -label .state.l19 -text {A6:}
  258. -label .state.l20 -text {D7:}
  259. -
  260. -label .state.l21 -text {PC:}
  261. -label .state.l22 -text {SR:}
  262. -label .state.l23 -text {USP:}
  263. -label .state.l24 -text {SSP:}
  264. -
  265. -label .state.halted -text {None}
  266. -label .state.battery -text {Unknown}
  267. -label .state.exception -text {0}
  268. -label .state.reset -text {No}
  269. -label .state.funcname -text {}
  270. -label .state.funcstart -text {00000000}
  271. -label .state.funcend -text {00000000}
  272. -label .state.d0 -text {00000000}
  273. -label .state.a0 -text {00000000}
  274. -label .state.d1 -text {00000000}
  275. -label .state.a1 -text {00000000}
  276. -label .state.d2 -text {00000000}
  277. -label .state.a2 -text {00000000}
  278. -label .state.d3 -text {00000000}
  279. -label .state.a3 -text {00000000}
  280. -label .state.d4 -text {00000000}
  281. -label .state.a4 -text {00000000}
  282. -label .state.d5 -text {00000000}
  283. -label .state.a5 -text {00000000}
  284. -label .state.d6 -text {00000000}
  285. -label .state.a6 -text {00000000}
  286. -label .state.d7 -text {00000000}
  287. -label .state.pc -text {00000000}
  288. -label .state.sr -text {0000}
  289. -label .state.usp -text {00000000}
  290. -label .state.ssp -text {00000000}
  291. -
  292. -grid .state.l1 -column 0 -row 0 -sticky e -columnspan 2
  293. -grid .state.halted -column 2 -row 0 -sticky w -columnspan 2
  294. -
  295. -grid .state.l1x -column 0 -row 1 -sticky e -columnspan 2
  296. -grid .state.battery -column 2 -row 1 -sticky w -columnspan 2
  297. -
  298. -grid .state.l2 -column 0 -row 2 -sticky e -columnspan 2
  299. -grid .state.exception -column 2 -row 2 -sticky w -columnspan 2
  300. -
  301. -grid .state.l25 -column 0 -row 3 -sticky e -columnspan 2
  302. -grid .state.reset -column 2 -row 3 -sticky w -columnspan 2
  303. -
  304. -grid .state.l3 -column 0 -row 4 -sticky e -columnspan 2
  305. -grid .state.funcname -column 2 -row 4 -sticky w -columnspan 2
  306. -
  307. -grid .state.l4 -column 0 -row 5 -sticky e -columnspan 2
  308. -grid .state.funcstart -column 2 -row 5 -sticky w -columnspan 2
  309. -
  310. -grid .state.l5 -column 0 -row 6 -sticky e -columnspan 2
  311. -grid .state.funcend -column 2 -row 6 -sticky w -columnspan 2
  312. -
  313. -frame .state.rule1 -relief raised -bd 2 -height 4
  314. -grid .state.rule1 -column 0 -row 7 -columnspan 4 -sticky ew
  315. -
  316. -grid .state.l6 -column 0 -row 8 -sticky e
  317. -grid .state.d0 -column 1 -row 8 -sticky w
  318. -grid .state.l7 -column 2 -row 8 -sticky e
  319. -grid .state.a0 -column 3 -row 8 -sticky w
  320. -
  321. -grid .state.l8 -column 0 -row 9 -sticky e
  322. -grid .state.d1 -column 1 -row 9 -sticky w
  323. -grid .state.l9 -column 2 -row 9 -sticky e
  324. -grid .state.a1 -column 3 -row 9 -sticky w
  325. -
  326. -grid .state.l10 -column 0 -row 10 -sticky e
  327. -grid .state.d2 -column 1 -row 10 -sticky w
  328. -grid .state.l11 -column 2 -row 10 -sticky e
  329. -grid .state.a2 -column 3 -row 10 -sticky w
  330. -
  331. -grid .state.l12 -column 0 -row 11 -sticky e
  332. -grid .state.d3 -column 1 -row 11 -sticky w
  333. -grid .state.l13 -column 2 -row 11 -sticky e
  334. -grid .state.a3 -column 3 -row 11 -sticky w
  335. -
  336. -grid .state.l14 -column 0 -row 12 -sticky e
  337. -grid .state.d4 -column 1 -row 12 -sticky w
  338. -grid .state.l15 -column 2 -row 12 -sticky e
  339. -grid .state.a4 -column 3 -row 12 -sticky w
  340. -
  341. -grid .state.l16 -column 0 -row 13 -sticky e
  342. -grid .state.d5 -column 1 -row 13 -sticky w
  343. -grid .state.l17 -column 2 -row 13 -sticky e
  344. -grid .state.a5 -column 3 -row 13 -sticky w
  345. -
  346. -grid .state.l18 -column 0 -row 14 -sticky e
  347. -grid .state.d6 -column 1 -row 14 -sticky w
  348. -grid .state.l19 -column 2 -row 14 -sticky e
  349. -grid .state.a6 -column 3 -row 14 -sticky w
  350. -
  351. -grid .state.l20 -column 0 -row 15 -sticky e
  352. -grid .state.d7 -column 1 -row 15 -sticky w
  353. -
  354. -grid .state.l21 -column 0 -row 16 -sticky e
  355. -grid .state.pc -column 1 -row 16 -sticky w
  356. -grid .state.l22 -column 2 -row 16 -sticky e
  357. -grid .state.sr -column 3 -row 16 -sticky w
  358. -
  359. -grid .state.l23 -column 0 -row 17 -sticky e
  360. -grid .state.usp -column 1 -row 17 -sticky w
  361. -grid .state.l24 -column 2 -row 17 -sticky e
  362. -grid .state.ssp -column 3 -row 17 -sticky w
  363. -
  364. -label .state.bl2 -text {B1:}
  365. -label .state.bl4 -text {B2:}
  366. -label .state.bl6 -text {B3:}
  367. -label .state.bl8 -text {B4:}
  368. -label .state.bl10 -text {B5:}
  369. -label .state.bl12 -text {B6:}
  370. -
  371. -label .state.b1 -text {00000000}
  372. -label .state.b1a -text {Off}
  373. -label .state.b2 -text {00000000}
  374. -label .state.b2a -text {Off}
  375. -label .state.b3 -text {00000000}
  376. -label .state.b3a -text {Off}
  377. -label .state.b4 -text {00000000}
  378. -label .state.b4a -text {Off}
  379. -label .state.b5 -text {00000000}
  380. -label .state.b5a -text {Off}
  381. -label .state.b6 -text {00000000}
  382. -label .state.b6a -text {Off}
  383. -
  384. -frame .state.rule2 -relief raised -bd 2 -height 4
  385. -grid .state.rule2 -column 0 -row 18 -columnspan 4 -sticky ew
  386. -
  387. -grid .state.bl2 -column 0 -row 19 -sticky e
  388. -grid .state.b1 -column 1 -row 19 -sticky w
  389. -grid .state.b1a -column 2 -row 19 -sticky w
  390. -
  391. -grid .state.bl4 -column 0 -row 20 -sticky e
  392. -grid .state.b2 -column 1 -row 20 -sticky w
  393. -grid .state.b2a -column 2 -row 20 -sticky w
  394. -
  395. -grid .state.bl6 -column 0 -row 21 -sticky e
  396. -grid .state.b3 -column 1 -row 21 -sticky w
  397. -grid .state.b3a -column 2 -row 21 -sticky w
  398. -
  399. -grid .state.bl8 -column 0 -row 22 -sticky e
  400. -grid .state.b4 -column 1 -row 22 -sticky w
  401. -grid .state.b4a -column 2 -row 22 -sticky w
  402. -
  403. -grid .state.bl10 -column 0 -row 23 -sticky e
  404. -grid .state.b5 -column 1 -row 23 -sticky w
  405. -grid .state.b5a -column 2 -row 23 -sticky w
  406. -
  407. -grid .state.bl12 -column 0 -row 24 -sticky e
  408. -grid .state.b6 -column 1 -row 24 -sticky w
  409. -grid .state.b6a -column 2 -row 24 -sticky w
  410. -
  411. -### /*** Generate debugger console window ***/
  412. -
  413. -wm title . \"Palm Debugger Console\"
  414. -catch {
  415. - wm iconbitmap . {@pix/case.xbm}
  416. - wm iconbitmap .remote {@pix/case.xbm}
  417. - wm iconbitmap .console {@pix/case.xbm}
  418. - wm iconbitmap .state {@pix/case.xbm}
  419. - #wm iconmask . {@pix/casemask.xbm}
  420. -}
  421. -
  422. -frame .m -relief raised
  423. -frame .f
  424. -scrollbar .f.y -orient vertical -command {.f.t yview}
  425. -text .f.t -yscrollcommand {.f.y set} -wrap word
  426. -pack .f.t -fill both -expand yes -side left
  427. -pack .f.y -fill y -side right
  428. -pack [menubutton .m.file -text {File} -menu .m.file.m] -side left
  429. -#pack [menubutton .m.edit -text {Edit} -menu .m.edit.m] -side left
  430. -pack [menubutton .m.windows -text {Windows} -menu .m.windows.m] -side left
  431. -#pack [menubutton .m.help -text {display_help} -menu .m.help.m] -side right
  432. -
  433. -menu .m.file.m
  434. -menu .m.windows.m
  435. -#menu .m.edit.m
  436. -#menu .m.help.m
  437. -
  438. -#wm iconify .remote
  439. -#wm iconify .console
  440. -#wm iconify .state
  441. -
  442. -
  443. -proc ShowWindow {name1 name2 op} {
  444. - global show
  445. - if {$show($name2)} {
  446. - if {[wm state $name2] != \"normal\"} {
  447. - wm deiconify $name2
  448. - }
  449. - } else {
  450. - if {[wm state $name2] == \"normal\"} {
  451. - wm withdraw $name2
  452. - }
  453. - }
  454. -}
  455. -
  456. -
  457. -trace variable show w {ShowWindow}
  458. -
  459. -bind .remote <Unmap> { set show(.remote) 0 }
  460. -bind .console <Unmap> { set show(.console) 0 }
  461. -bind .state <Unmap> { set show(.state) 0 }
  462. -
  463. -bind .remote <Map> { set show(.remote) 1 }
  464. -bind .console <Map> { set show(.console) 1 }
  465. -bind .state <Map> { set show(.state) 1 }
  466. -
  467. -wm protocol .remote WM_DELETE_WINDOW { set show(.remote) 0 }
  468. -wm protocol .console WM_DELETE_WINDOW { set show(.console) 0 }
  469. -wm protocol .state WM_DELETE_WINDOW { set show(.state) 0 }
  470. -
  471. -set show(.remote) 0
  472. -set show(.console) 0
  473. -set show(.state) 0
  474. -
  475. -
  476. -.m.file.m add command -label {Exit} -command {exit}
  477. -
  478. -.m.windows.m add checkbutton -label {Remote UI} -var show(.remote)
  479. -.m.windows.m add checkbutton -label {Remote Console} -var show(.console)
  480. -.m.windows.m add checkbutton -label {Remote State} -var show(.state)
  481. -
  482. -pack .m -side top -fill x
  483. -pack .f -side top -fill both -expand yes
  484. -focus .f.t
  485. -
  486. -### /*** Configure console bindings ***/
  487. -
  488. -bind .console.t <Shift-KeyPress-Return> {tkTextInsert .console.t \"\\n\" ; break}
  489. -bind .f.t <Shift-KeyPress-Return> {tkTextInsert .f.t \"\\n\" ; break}
  490. -
  491. -bind .console.t <Control-KeyPress-Return> {tkTextInsert .console.t \"\\n\" ; break}
  492. -bind .f.t <Control-KeyPress-Return> {tkTextInsert .f.t \"\\n\" ; break}
  493. -
  494. -bind .console.t <KeyPress-Return> {Console [.console.t get {insert linestart} {insert lineend}] ; break}
  495. -bind .f.t <KeyPress-Return> {
  496. - set line [.f.t get {insert linestart} {insert lineend}]
  497. - set f [string first \">\" $line]
  498. - incr f
  499. - set line [string range $line $f end]
  500. - .f.t mark set insert {insert lineend}
  501. - .f.t insert insert \\n
  502. - Debugger $line
  503. - if {[.f.t compare insert != {insert linestart}]} {
  504. - .f.t insert insert \"\\n\"
  505. - }
  506. - .f.t insert insert \"pilot-debug> \"
  507. - .f.t see insert
  508. - break
  509. -}
  510. -
  511. -proc Console {cmd} {
  512. - .console.t mark set insert {insert lineend}
  513. - tkTextInsert .console.t \\n
  514. - transmit $cmd
  515. -}
  516. -
  517. -proc Debugger {cmd} {
  518. - #.f.t mark set insert {insert lineend}
  519. - #tkTextInsert .f.t \\n
  520. - if {[string length [string trim $cmd]]!=0} {
  521. - set code [catch {eval $cmd} message]
  522. - if {[string length $message]} {
  523. - set message [string trimright $message]
  524. - Say \"$message\\n\"
  525. - #if {[.f.t compare insert != {insert linestart}]} {
  526. - # Say \"\\\n\"
  527. - #}
  528. - }
  529. - }
  530. -}
  531. -
  532. -proc Say {text} {
  533. - global Interactive
  534. - if {$Interactive} {
  535. - .f.t insert insert \"$text\"
  536. - .f.t see insert
  537. - } else {
  538. - upvar result result
  539. - set result \"$result$text\"
  540. - }
  541. -}
  542. -
  543. -", NULL);
  544. + Tcl_VarEval(interp,
  545. +""
  546. +"\n"
  547. +"### /*** Generate remote UI window ***/\n"
  548. +"\n"
  549. +"set tkdbg 1\n"
  550. +"\n"
  551. +"toplevel .remote\n"
  552. +"wm title .remote {Palm Remote UI}\n"
  553. +"\n"
  554. +"catch {\n"
  555. +" if {[file exists {tools/pix/case.gif}]} {\n"
  556. +" set dir {tools}\n"
  557. +" } elseif {[file exists {",LIBDIR,"/pix/case.gif}]} {\n"
  558. +" set dir {",LIBDIR,"/pix}\n"
  559. +" } else {\n"
  560. +" error {No pix}\n"
  561. +" }\n"
  562. +" image create photo Case -format gif -file \"$dir/pix/case.gif\"\n"
  563. +" image create photo B1 -format gif -file \"$dir/pix/b1.gif\"\n"
  564. +" image create photo B2 -format gif -file \"$dir/pix/b2.gif\"\n"
  565. +" image create photo B3 -format gif -file \"$dir/pix/b3.gif\"\n"
  566. +" image create photo B4 -format gif -file \"$dir/pix/b4.gif\"\n"
  567. +" image create photo B5 -format gif -file \"$dir/pix/b5.gif\"\n"
  568. +" image create photo B6 -format gif -file \"$dir/pix/b6.gif\"\n"
  569. +" image create photo B7 -format gif -file \"$dir/pix/b7.gif\"\n"
  570. +"}\n"
  571. +"\n"
  572. +"canvas .remote.c -width 221 -height 337\n"
  573. +"\n"
  574. +".remote.c create rectangle 27 29 196 260 -outline {red} -tag screen -fill {blue}\n"
  575. +".remote.c create rectangle 0 280 18 306 -outline {red} -tag button1 -fill {blue}\n"
  576. +".remote.c create oval 23 276 52 307 -outline {red} -tag button2 -fill {blue}\n"
  577. +".remote.c create oval 63 276 92 307 -outline {red} -tag button3 -fill {blue}\n"
  578. +".remote.c create rectangle 97 277 127 294 -outline {red} -tag button4 -fill {blue}\n"
  579. +".remote.c create rectangle 97 300 127 317 -outline {red} -tag button5 -fill {blue}\n"
  580. +".remote.c create oval 133 276 162 307 -outline {red} -tag button6 -fill {blue}\n"
  581. +".remote.c create oval 171 276 200 307 -outline {red} -tag button7 -fill {blue}\n"
  582. +"\n"
  583. +".remote.c create rectangle 33 32 187 253 -outline black -tag screen\n"
  584. +".remote.c create rectangle 33 200 61 225 -outline black -tag screen\n"
  585. +".remote.c create rectangle 33 225 61 253 -outline black -tag screen\n"
  586. +".remote.c create rectangle 160 200 187 225 -outline black -tag screen\n"
  587. +".remote.c create rectangle 160 225 187 253 -outline black -tag screen\n"
  588. +".remote.c create rectangle 62 200 159 253 -outline black -tag screen\n"
  589. +"\n"
  590. +"set buttons(1) 0\n"
  591. +"\n"
  592. +"proc holdbutton {button} {\n"
  593. +" global buttons\n"
  594. +" if {$button==1} {\n"
  595. +" set buttons($button) [after 1000 \"continuebutton $button\"]\n"
  596. +" } else {\n"
  597. +" pushbutton $button\n"
  598. +" set buttons($button) [after 250 \"holdbutton $button\"]\n"
  599. +" }\n"
  600. +"}\n"
  601. +"\n"
  602. +"proc continuebutton {button} {\n"
  603. +" global buttons\n"
  604. +" if {$button==1} {\n"
  605. +" pushbutton 0\n"
  606. +" }\n"
  607. +" set buttons($button) \"\"\n"
  608. +"}\n"
  609. +"\n"
  610. +"proc releasebutton {button} {\n"
  611. +" global buttons\n"
  612. +" if {$buttons($button)!=\"\"} {\n"
  613. +" if {$button==1} {\n"
  614. +" pushbutton 1\n"
  615. +" }\n"
  616. +" after cancel $buttons($button)\n"
  617. +" set buttons($button) \"\"\n"
  618. +" }\n"
  619. +"}\n"
  620. +"\n"
  621. +".remote.c bind button1 <ButtonPress-1> {.remote.c itemconfigure button1 -fill green; update; holdbutton 1}\n"
  622. +".remote.c bind button1 <ButtonRelease-1> {.remote.c itemconfigure button1 -fill blue; releasebutton 1}\n"
  623. +"\n"
  624. +".remote.c bind button2 <ButtonPress-1> {.remote.c itemconfigure button2 -fill green; update; holdbutton 2}\n"
  625. +".remote.c bind button2 <ButtonRelease-1> {.remote.c itemconfigure button2 -fill blue; releasebutton 2}\n"
  626. +"\n"
  627. +".remote.c bind button3 <ButtonPress-1> {.remote.c itemconfigure button3 -fill green; update; holdbutton 3}\n"
  628. +".remote.c bind button3 <ButtonRelease-1> {.remote.c itemconfigure button3 -fill blue; releasebutton 3}\n"
  629. +"\n"
  630. +".remote.c bind button4 <ButtonPress-1> {.remote.c itemconfigure button4 -fill green; update; holdbutton 4}\n"
  631. +".remote.c bind button4 <ButtonRelease-1> {.remote.c itemconfigure button4 -fill blue; releasebutton 4}\n"
  632. +"\n"
  633. +".remote.c bind button5 <ButtonPress-1> {.remote.c itemconfigure button5 -fill green; update; holdbutton 5}\n"
  634. +".remote.c bind button5 <ButtonRelease-1> {.remote.c itemconfigure button5 -fill blue; releasebutton 5}\n"
  635. +"\n"
  636. +".remote.c bind button6 <ButtonPress-1> {.remote.c itemconfigure button6 -fill green; update; holdbutton 6}\n"
  637. +".remote.c bind button6 <ButtonRelease-1> {.remote.c itemconfigure button6 -fill blue; releasebutton 6}\n"
  638. +"\n"
  639. +".remote.c bind button7 <ButtonPress-1> {.remote.c itemconfigure button7 -fill green; update; holdbutton 7}\n"
  640. +".remote.c bind button7 <ButtonRelease-1> {.remote.c itemconfigure button7 -fill blue; releasebutton 7}\n"
  641. +"\n"
  642. +"catch {\n"
  643. +" .remote.c create image 0 282 -image B1 -anchor nw -tag downbutton1\n"
  644. +" .remote.c create image 22 274 -image B2 -anchor nw -tag downbutton2\n"
  645. +" .remote.c create image 60 275 -image B3 -anchor nw -tag downbutton3\n"
  646. +" .remote.c create image 93 278 -image B4 -anchor nw -tag downbutton4\n"
  647. +" .remote.c create image 95 298 -image B5 -anchor nw -tag downbutton5\n"
  648. +" .remote.c create image 131 275 -image B6 -anchor nw -tag downbutton6\n"
  649. +" .remote.c create image 169 274 -image B7 -anchor nw -tag downbutton7\n"
  650. +"\n"
  651. +" .remote.c create image 0 0 -image Case -anchor nw\n"
  652. +"\n"
  653. +" .remote.c bind button1 <ButtonPress-1> {.remote.c raise downbutton1; update; holdbutton 1}\n"
  654. +" .remote.c bind button1 <ButtonRelease-1> {.remote.c lower downbutton1; releasebutton 1}\n"
  655. +"\n"
  656. +" .remote.c bind button2 <ButtonPress-1> {.remote.c raise downbutton2; update; holdbutton 2}\n"
  657. +" .remote.c bind button2 <ButtonRelease-1> {.remote.c lower downbutton2; releasebutton 2}\n"
  658. +"\n"
  659. +" .remote.c bind button3 <ButtonPress-1> {.remote.c raise downbutton3; update; holdbutton 3}\n"
  660. +" .remote.c bind button3 <ButtonRelease-1> {.remote.c lower downbutton3; releasebutton 3}\n"
  661. +"\n"
  662. +" .remote.c bind button4 <ButtonPress-1> {.remote.c raise downbutton4; update; holdbutton 4}\n"
  663. +" .remote.c bind button4 <ButtonRelease-1> {.remote.c lower downbutton4; releasebutton 4}\n"
  664. +"\n"
  665. +" .remote.c bind button5 <ButtonPress-1> {.remote.c raise downbutton5; update; holdbutton 5}\n"
  666. +" .remote.c bind button5 <ButtonRelease-1> {.remote.c lower downbutton5; releasebutton 5}\n"
  667. +"\n"
  668. +" .remote.c bind button6 <ButtonPress-1> {.remote.c raise downbutton6; update; holdbutton 6}\n"
  669. +" .remote.c bind button6 <ButtonRelease-1> {.remote.c lower downbutton6; releasebutton 6}\n"
  670. +"\n"
  671. +" .remote.c bind button7 <ButtonPress-1> {.remote.c raise downbutton7; update; holdbutton 7}\n"
  672. +" .remote.c bind button7 <ButtonRelease-1> {.remote.c lower downbutton7; releasebutton 7}\n"
  673. +" \n"
  674. +" \n"
  675. +" .remote.c itemconfigure button1 -outline {} -fill {}\n"
  676. +" .remote.c raise button1\n"
  677. +" .remote.c itemconfigure button2 -outline {} -fill {}\n"
  678. +" .remote.c raise button2\n"
  679. +" .remote.c itemconfigure button3 -outline {} -fill {}\n"
  680. +" .remote.c raise button3\n"
  681. +" .remote.c itemconfigure button4 -outline {} -fill {}\n"
  682. +" .remote.c raise button4\n"
  683. +" .remote.c itemconfigure button5 -outline {} -fill {}\n"
  684. +" .remote.c raise button5\n"
  685. +" .remote.c itemconfigure button6 -outline {} -fill {}\n"
  686. +" .remote.c raise button6\n"
  687. +" .remote.c itemconfigure button7 -outline {} -fill {}\n"
  688. +" .remote.c raise button7\n"
  689. +" .remote.c itemconfigure screen -outline {} -fill {}\n"
  690. +" .remote.c raise screen\n"
  691. +"}\n"
  692. +"\n"
  693. +"pack .remote.c -side top\n"
  694. +"\n"
  695. +".remote.c bind screen <ButtonPress-1> {pen %x %y 1}\n"
  696. +".remote.c bind screen <B1-Motion> {pen %x %y 1}\n"
  697. +".remote.c bind screen <ButtonRelease-1> {pen %x %y 0}\n"
  698. +"\n"
  699. +"global KeyQueue\n"
  700. +"global KeyQueueId\n"
  701. +"global KeyQueueDelay\n"
  702. +"set KeyQueue {}\n"
  703. +"set KeyQueueId {}\n"
  704. +"set KeyQueueDelay 50\n"
  705. +"\n"
  706. +"proc readyqueue {} {\n"
  707. +" global KeyQueueId\n"
  708. +" global KeyQueueDelay\n"
  709. +" if {$KeyQueueId == {}} {\n"
  710. +" after $KeyQueueDelay { set KeyQueueId [ after idle {sendqueue} ] }\n"
  711. +" }\n"
  712. +"}\n"
  713. +"\n"
  714. +"proc queuekey {c} {\n"
  715. +" global KeyQueue\n"
  716. +" append KeyQueue $c\n"
  717. +" readyqueue\n"
  718. +"}\n"
  719. +"\n"
  720. +"proc sendqueue {} {\n"
  721. +" global KeyQueue\n"
  722. +" global KeyQueueId\n"
  723. +" if {[string length $KeyQueue] > 0} {\n"
  724. +" key [string index $KeyQueue 0]\n"
  725. +" set KeyQueue [string range $KeyQueue 1 end]\n"
  726. +" }\n"
  727. +" set KeyQueueId {}\n"
  728. +" if {[string length $KeyQueue] > 0} { readyqueue }\n"
  729. +"}\n"
  730. +"\n"
  731. +"bind .remote <KeyPress> {queuekey %A}\n"
  732. +"\n"
  733. +"## Handle pasting\n"
  734. +"proc do_paste { } {\n"
  735. +" if [catch {selection get} sel] {\n"
  736. +" if [catch {selection get -selection CLIPBOARD} sel] {\n"
  737. +" return\n"
  738. +" }\n"
  739. +" }\n"
  740. +" queuekey $sel\n"
  741. +"}\n"
  742. +"bind .remote <ButtonPress-2> {do_paste}\n"
  743. +"\n"
  744. +"##### /*** Generate remote console window ***/\n"
  745. +"\n"
  746. +"toplevel .console\n"
  747. +"wm title .console \"Palm Remote Console\"\n"
  748. +"scrollbar .console.y -orient vertical -command {.console.t yview}\n"
  749. +"text .console.t -yscrollcommand {.console.y set}\n"
  750. +"pack .console.t -fill both -expand yes -side left\n"
  751. +"pack .console.y -fill y -side right\n"
  752. +"focus .console.t\n"
  753. +"\n"
  754. +"#### /*** Generate pilot state window ***/\n"
  755. +"\n"
  756. +"toplevel .state\n"
  757. +"wm title .state {Palm State}\n"
  758. +"label .state.l1 -text {Active mode:}\n"
  759. +"label .state.l1x -text {Battery:}\n"
  760. +"label .state.l2 -text {Exception:}\n"
  761. +"label .state.l25 -text {Reset:}\n"
  762. +"label .state.l3 -text {Function:}\n"
  763. +"label .state.l4 -text {F-start:}\n"
  764. +"label .state.l5 -text {F-end:}\n"
  765. +"label .state.l6 -text {D0:}\n"
  766. +"label .state.l7 -text {A0:}\n"
  767. +"label .state.l8 -text {D1:}\n"
  768. +"label .state.l9 -text {A1:}\n"
  769. +"label .state.l10 -text {D2:}\n"
  770. +"label .state.l11 -text {A2:}\n"
  771. +"label .state.l12 -text {D3:}\n"
  772. +"label .state.l13 -text {A3:}\n"
  773. +"label .state.l14 -text {D4:}\n"
  774. +"label .state.l15 -text {A4:}\n"
  775. +"label .state.l16 -text {D5:}\n"
  776. +"label .state.l17 -text {A5:}\n"
  777. +"label .state.l18 -text {D6:}\n"
  778. +"label .state.l19 -text {A6:}\n"
  779. +"label .state.l20 -text {D7:}\n"
  780. +"\n"
  781. +"label .state.l21 -text {PC:}\n"
  782. +"label .state.l22 -text {SR:}\n"
  783. +"label .state.l23 -text {USP:}\n"
  784. +"label .state.l24 -text {SSP:}\n"
  785. +"\n"
  786. +"label .state.halted -text {None}\n"
  787. +"label .state.battery -text {Unknown}\n"
  788. +"label .state.exception -text {0}\n"
  789. +"label .state.reset -text {No}\n"
  790. +"label .state.funcname -text {}\n"
  791. +"label .state.funcstart -text {00000000}\n"
  792. +"label .state.funcend -text {00000000}\n"
  793. +"label .state.d0 -text {00000000}\n"
  794. +"label .state.a0 -text {00000000}\n"
  795. +"label .state.d1 -text {00000000}\n"
  796. +"label .state.a1 -text {00000000}\n"
  797. +"label .state.d2 -text {00000000}\n"
  798. +"label .state.a2 -text {00000000}\n"
  799. +"label .state.d3 -text {00000000}\n"
  800. +"label .state.a3 -text {00000000}\n"
  801. +"label .state.d4 -text {00000000}\n"
  802. +"label .state.a4 -text {00000000}\n"
  803. +"label .state.d5 -text {00000000}\n"
  804. +"label .state.a5 -text {00000000}\n"
  805. +"label .state.d6 -text {00000000}\n"
  806. +"label .state.a6 -text {00000000}\n"
  807. +"label .state.d7 -text {00000000}\n"
  808. +"label .state.pc -text {00000000}\n"
  809. +"label .state.sr -text {0000}\n"
  810. +"label .state.usp -text {00000000}\n"
  811. +"label .state.ssp -text {00000000}\n"
  812. +"\n"
  813. +"grid .state.l1 -column 0 -row 0 -sticky e -columnspan 2\n"
  814. +"grid .state.halted -column 2 -row 0 -sticky w -columnspan 2\n"
  815. +"\n"
  816. +"grid .state.l1x -column 0 -row 1 -sticky e -columnspan 2\n"
  817. +"grid .state.battery -column 2 -row 1 -sticky w -columnspan 2\n"
  818. +"\n"
  819. +"grid .state.l2 -column 0 -row 2 -sticky e -columnspan 2\n"
  820. +"grid .state.exception -column 2 -row 2 -sticky w -columnspan 2\n"
  821. +"\n"
  822. +"grid .state.l25 -column 0 -row 3 -sticky e -columnspan 2\n"
  823. +"grid .state.reset -column 2 -row 3 -sticky w -columnspan 2\n"
  824. +"\n"
  825. +"grid .state.l3 -column 0 -row 4 -sticky e -columnspan 2 \n"
  826. +"grid .state.funcname -column 2 -row 4 -sticky w -columnspan 2\n"
  827. +"\n"
  828. +"grid .state.l4 -column 0 -row 5 -sticky e -columnspan 2 \n"
  829. +"grid .state.funcstart -column 2 -row 5 -sticky w -columnspan 2\n"
  830. +"\n"
  831. +"grid .state.l5 -column 0 -row 6 -sticky e -columnspan 2 \n"
  832. +"grid .state.funcend -column 2 -row 6 -sticky w -columnspan 2\n"
  833. +"\n"
  834. +"frame .state.rule1 -relief raised -bd 2 -height 4\n"
  835. +"grid .state.rule1 -column 0 -row 7 -columnspan 4 -sticky ew\n"
  836. +"\n"
  837. +"grid .state.l6 -column 0 -row 8 -sticky e \n"
  838. +"grid .state.d0 -column 1 -row 8 -sticky w\n"
  839. +"grid .state.l7 -column 2 -row 8 -sticky e \n"
  840. +"grid .state.a0 -column 3 -row 8 -sticky w\n"
  841. +"\n"
  842. +"grid .state.l8 -column 0 -row 9 -sticky e \n"
  843. +"grid .state.d1 -column 1 -row 9 -sticky w\n"
  844. +"grid .state.l9 -column 2 -row 9 -sticky e \n"
  845. +"grid .state.a1 -column 3 -row 9 -sticky w\n"
  846. +"\n"
  847. +"grid .state.l10 -column 0 -row 10 -sticky e \n"
  848. +"grid .state.d2 -column 1 -row 10 -sticky w\n"
  849. +"grid .state.l11 -column 2 -row 10 -sticky e \n"
  850. +"grid .state.a2 -column 3 -row 10 -sticky w\n"
  851. +"\n"
  852. +"grid .state.l12 -column 0 -row 11 -sticky e \n"
  853. +"grid .state.d3 -column 1 -row 11 -sticky w\n"
  854. +"grid .state.l13 -column 2 -row 11 -sticky e \n"
  855. +"grid .state.a3 -column 3 -row 11 -sticky w\n"
  856. +"\n"
  857. +"grid .state.l14 -column 0 -row 12 -sticky e \n"
  858. +"grid .state.d4 -column 1 -row 12 -sticky w\n"
  859. +"grid .state.l15 -column 2 -row 12 -sticky e \n"
  860. +"grid .state.a4 -column 3 -row 12 -sticky w\n"
  861. +"\n"
  862. +"grid .state.l16 -column 0 -row 13 -sticky e \n"
  863. +"grid .state.d5 -column 1 -row 13 -sticky w\n"
  864. +"grid .state.l17 -column 2 -row 13 -sticky e \n"
  865. +"grid .state.a5 -column 3 -row 13 -sticky w\n"
  866. +"\n"
  867. +"grid .state.l18 -column 0 -row 14 -sticky e \n"
  868. +"grid .state.d6 -column 1 -row 14 -sticky w\n"
  869. +"grid .state.l19 -column 2 -row 14 -sticky e \n"
  870. +"grid .state.a6 -column 3 -row 14 -sticky w\n"
  871. +"\n"
  872. +"grid .state.l20 -column 0 -row 15 -sticky e \n"
  873. +"grid .state.d7 -column 1 -row 15 -sticky w\n"
  874. +"\n"
  875. +"grid .state.l21 -column 0 -row 16 -sticky e \n"
  876. +"grid .state.pc -column 1 -row 16 -sticky w\n"
  877. +"grid .state.l22 -column 2 -row 16 -sticky e \n"
  878. +"grid .state.sr -column 3 -row 16 -sticky w\n"
  879. +"\n"
  880. +"grid .state.l23 -column 0 -row 17 -sticky e \n"
  881. +"grid .state.usp -column 1 -row 17 -sticky w\n"
  882. +"grid .state.l24 -column 2 -row 17 -sticky e \n"
  883. +"grid .state.ssp -column 3 -row 17 -sticky w\n"
  884. +"\n"
  885. +"label .state.bl2 -text {B1:}\n"
  886. +"label .state.bl4 -text {B2:}\n"
  887. +"label .state.bl6 -text {B3:}\n"
  888. +"label .state.bl8 -text {B4:}\n"
  889. +"label .state.bl10 -text {B5:}\n"
  890. +"label .state.bl12 -text {B6:}\n"
  891. +"\n"
  892. +"label .state.b1 -text {00000000}\n"
  893. +"label .state.b1a -text {Off}\n"
  894. +"label .state.b2 -text {00000000}\n"
  895. +"label .state.b2a -text {Off}\n"
  896. +"label .state.b3 -text {00000000}\n"
  897. +"label .state.b3a -text {Off}\n"
  898. +"label .state.b4 -text {00000000}\n"
  899. +"label .state.b4a -text {Off}\n"
  900. +"label .state.b5 -text {00000000}\n"
  901. +"label .state.b5a -text {Off}\n"
  902. +"label .state.b6 -text {00000000}\n"
  903. +"label .state.b6a -text {Off}\n"
  904. +"\n"
  905. +"frame .state.rule2 -relief raised -bd 2 -height 4\n"
  906. +"grid .state.rule2 -column 0 -row 18 -columnspan 4 -sticky ew\n"
  907. +"\n"
  908. +"grid .state.bl2 -column 0 -row 19 -sticky e\n"
  909. +"grid .state.b1 -column 1 -row 19 -sticky w\n"
  910. +"grid .state.b1a -column 2 -row 19 -sticky w \n"
  911. +"\n"
  912. +"grid .state.bl4 -column 0 -row 20 -sticky e\n"
  913. +"grid .state.b2 -column 1 -row 20 -sticky w\n"
  914. +"grid .state.b2a -column 2 -row 20 -sticky w \n"
  915. +"\n"
  916. +"grid .state.bl6 -column 0 -row 21 -sticky e\n"
  917. +"grid .state.b3 -column 1 -row 21 -sticky w\n"
  918. +"grid .state.b3a -column 2 -row 21 -sticky w \n"
  919. +"\n"
  920. +"grid .state.bl8 -column 0 -row 22 -sticky e\n"
  921. +"grid .state.b4 -column 1 -row 22 -sticky w\n"
  922. +"grid .state.b4a -column 2 -row 22 -sticky w \n"
  923. +"\n"
  924. +"grid .state.bl10 -column 0 -row 23 -sticky e\n"
  925. +"grid .state.b5 -column 1 -row 23 -sticky w\n"
  926. +"grid .state.b5a -column 2 -row 23 -sticky w \n"
  927. +"\n"
  928. +"grid .state.bl12 -column 0 -row 24 -sticky e\n"
  929. +"grid .state.b6 -column 1 -row 24 -sticky w\n"
  930. +"grid .state.b6a -column 2 -row 24 -sticky w \n"
  931. +"\n"
  932. +"### /*** Generate debugger console window ***/\n"
  933. +"\n"
  934. +"wm title . \"Palm Debugger Console\"\n"
  935. +"catch {\n"
  936. +" wm iconbitmap . {@pix/case.xbm}\n"
  937. +" wm iconbitmap .remote {@pix/case.xbm}\n"
  938. +" wm iconbitmap .console {@pix/case.xbm}\n"
  939. +" wm iconbitmap .state {@pix/case.xbm}\n"
  940. +" #wm iconmask . {@pix/casemask.xbm}\n"
  941. +"}\n"
  942. +"\n"
  943. +"frame .m -relief raised\n"
  944. +"frame .f\n"
  945. +"scrollbar .f.y -orient vertical -command {.f.t yview}\n"
  946. +"text .f.t -yscrollcommand {.f.y set} -wrap word\n"
  947. +"pack .f.t -fill both -expand yes -side left\n"
  948. +"pack .f.y -fill y -side right\n"
  949. +"pack [menubutton .m.file -text {File} -menu .m.file.m] -side left\n"
  950. +"#pack [menubutton .m.edit -text {Edit} -menu .m.edit.m] -side left\n"
  951. +"pack [menubutton .m.windows -text {Windows} -menu .m.windows.m] -side left\n"
  952. +"#pack [menubutton .m.help -text {display_help} -menu .m.help.m] -side right\n"
  953. +"\n"
  954. +"menu .m.file.m\n"
  955. +"menu .m.windows.m\n"
  956. +"#menu .m.edit.m\n"
  957. +"#menu .m.help.m\n"
  958. +"\n"
  959. +"#wm iconify .remote\n"
  960. +"#wm iconify .console\n"
  961. +"#wm iconify .state\n"
  962. +"\n"
  963. +"\n"
  964. +"proc ShowWindow {name1 name2 op} {\n"
  965. +" global show\n"
  966. +" if {$show($name2)} {\n"
  967. +" if {[wm state $name2] != \"normal\"} {\n"
  968. +" wm deiconify $name2\n"
  969. +" }\n"
  970. +" } else {\n"
  971. +" if {[wm state $name2] == \"normal\"} {\n"
  972. +" wm withdraw $name2\n"
  973. +" }\n"
  974. +" }\n"
  975. +"}\n"
  976. +"\n"
  977. +"\n"
  978. +"trace variable show w {ShowWindow}\n"
  979. +"\n"
  980. +"bind .remote <Unmap> { set show(.remote) 0 }\n"
  981. +"bind .console <Unmap> { set show(.console) 0 }\n"
  982. +"bind .state <Unmap> { set show(.state) 0 }\n"
  983. +"\n"
  984. +"bind .remote <Map> { set show(.remote) 1 }\n"
  985. +"bind .console <Map> { set show(.console) 1 }\n"
  986. +"bind .state <Map> { set show(.state) 1 }\n"
  987. +"\n"
  988. +"wm protocol .remote WM_DELETE_WINDOW { set show(.remote) 0 }\n"
  989. +"wm protocol .console WM_DELETE_WINDOW { set show(.console) 0 }\n"
  990. +"wm protocol .state WM_DELETE_WINDOW { set show(.state) 0 }\n"
  991. +"\n"
  992. +"set show(.remote) 0\n"
  993. +"set show(.console) 0\n"
  994. +"set show(.state) 0\n"
  995. +"\n"
  996. +"\n"
  997. +".m.file.m add command -label {Exit} -command {exit}\n"
  998. +"\n"
  999. +".m.windows.m add checkbutton -label {Remote UI} -var show(.remote)\n"
  1000. +".m.windows.m add checkbutton -label {Remote Console} -var show(.console)\n"
  1001. +".m.windows.m add checkbutton -label {Remote State} -var show(.state)\n"
  1002. +"\n"
  1003. +"pack .m -side top -fill x\n"
  1004. +"pack .f -side top -fill both -expand yes\n"
  1005. +"focus .f.t\n"
  1006. +"\n"
  1007. +"### /*** Configure console bindings ***/\n"
  1008. +"\n"
  1009. +"bind .console.t <Shift-KeyPress-Return> {tkTextInsert .console.t \"\\n\" ; break}\n"
  1010. +"bind .f.t <Shift-KeyPress-Return> {tkTextInsert .f.t \"\\n\" ; break}\n"
  1011. +"\n"
  1012. +"bind .console.t <Control-KeyPress-Return> {tkTextInsert .console.t \"\\n\" ; break}\n"
  1013. +"bind .f.t <Control-KeyPress-Return> {tkTextInsert .f.t \"\\n\" ; break}\n"
  1014. +"\n"
  1015. +"bind .console.t <KeyPress-Return> {Console [.console.t get {insert linestart} {insert lineend}] ; break}\n"
  1016. +"bind .f.t <KeyPress-Return> {\n"
  1017. +" set line [.f.t get {insert linestart} {insert lineend}]\n"
  1018. +" set f [string first \">\" $line]\n"
  1019. +" incr f\n"
  1020. +" set line [string range $line $f end]\n"
  1021. +" .f.t mark set insert {insert lineend}\n"
  1022. +" .f.t insert insert \\n\n"
  1023. +" Debugger $line\n"
  1024. +" if {[.f.t compare insert != {insert linestart}]} {\n"
  1025. +" .f.t insert insert \"\\n\"\n"
  1026. +" }\n"
  1027. +" .f.t insert insert \"pilot-debug> \"\n"
  1028. +" .f.t see insert\n"
  1029. +" break\n"
  1030. +"}\n"
  1031. +"\n"
  1032. +"proc Console {cmd} {\n"
  1033. +" .console.t mark set insert {insert lineend}\n"
  1034. +" tkTextInsert .console.t \\n\n"
  1035. +" transmit $cmd\n"
  1036. +"}\n"
  1037. +"\n"
  1038. +"proc Debugger {cmd} {\n"
  1039. +" #.f.t mark set insert {insert lineend}\n"
  1040. +" #tkTextInsert .f.t \\n\n"
  1041. +" if {[string length [string trim $cmd]]!=0} {\n"
  1042. +" set code [catch {eval $cmd} message]\n"
  1043. +" if {[string length $message]} {\n"
  1044. +" set message [string trimright $message]\n"
  1045. +" Say \"$message\\n\"\n"
  1046. +" #if {[.f.t compare insert != {insert linestart}]} {\n"
  1047. +" # Say \"\\\n\"\n"
  1048. +" #}\n"
  1049. +" }\n"
  1050. +" }\n"
  1051. +"}\n"
  1052. +"\n"
  1053. +"proc Say {text} {\n"
  1054. +" global Interactive\n"
  1055. +" if {$Interactive} {\n"
  1056. +" .f.t insert insert \"$text\"\n"
  1057. +" .f.t see insert\n"
  1058. +" } else {\n"
  1059. +" upvar result result\n"
  1060. +" set result \"$result$text\"\n"
  1061. +" }\n"
  1062. +"}\n"
  1063. +"\n", NULL);
  1064. puts(interp->result);
  1065. created = 1;
  1066. @@ -2080,25 +2080,24 @@
  1067. static int proc_help(ClientData clientData, Tcl_Interp *interp, int argc, char *argv[])
  1068. {
  1069. - Say("\
  1070. ---- display_help ---\n\
  1071. -g [<addr>] Go: Resume execution (if address is supplied,
  1072. - will start at that point)\n\
  1073. -t <addr1> [<addr2>] Till: Resume execution until addr1 (if addr2 is
  1074. - supplied, will start at that point)\n\
  1075. -coldboot Simulate the hard-reset (reset pin + power
  1076. - button press, i.e. lose all data)\n\
  1077. -warmboot Simulate a soft-reset (reset pin press)\n\
  1078. -pushbutton <button number> Simulate button push\n\
  1079. -mirror [bool] Continually view the Palm's screen in the
  1080. - Remote UI window (if bool supplied, can
  1081. - turn on or off mirroring, otherwise
  1082. - toggles)\n\
  1083. -getdisplay Show the Palm's display in the Remote UI
  1084. - window\n\
  1085. -updatedisplay Force a mirror refresh\n\
  1086. -feature Get/Set/Read Palm features\n\
  1087. -");
  1088. + Say("\n"
  1089. +"--- display_help ---\n\\n"
  1090. +"g [<addr>] Go: Resume execution (if address is supplied,\n"
  1091. +" will start at that point)\n\\n"
  1092. +"t <addr1> [<addr2>] Till: Resume execution until addr1 (if addr2 is\n"
  1093. +" supplied, will start at that point)\n\\n"
  1094. +"coldboot Simulate the hard-reset (reset pin + power\n"
  1095. +" button press, i.e. lose all data)\n\\n"
  1096. +"warmboot Simulate a soft-reset (reset pin press)\n\\n"
  1097. +"pushbutton <button number> Simulate button push\n\\n"
  1098. +"mirror [bool] Continually view the Palm's screen in the\n"
  1099. +" Remote UI window (if bool supplied, can\n"
  1100. +" turn on or off mirroring, otherwise\n"
  1101. +" toggles)\n\\n"
  1102. +"getdisplay Show the Palm's display in the Remote UI\n"
  1103. +" window\n\\n"
  1104. +"updatedisplay Force a mirror refresh\n\\n"
  1105. +"feature Get/Set/Read Palm features\n\\n");
  1106. return TCL_OK;
  1107. }
  1108. @@ -2151,55 +2150,54 @@
  1109. Tcl_CreateCommand(interp, cmds[i].name, cmds[i].proc, 0, NULL);
  1110. }
  1111. - Tcl_VarEval(interp,"\
  1112. -proc Say {text} {
  1113. - global Interactive
  1114. - if {$Interactive} {
  1115. - puts \"$text\"
  1116. - } else {
  1117. - upvar result result
  1118. - set result \"$result$text\"
  1119. - }
  1120. -}
  1121. -
  1122. -proc interactive {args} {
  1123. - global Interactive
  1124. - global errorInfo
  1125. - set hold $Interactive
  1126. - set Interactive 1
  1127. - set code [catch $args message]
  1128. - set Interactive $hold
  1129. - error $message $errorInfo $code
  1130. -}
  1131. -
  1132. -proc noninteractive {args} {
  1133. - global Interactive
  1134. - global errorInfo
  1135. - set hold $Interactive
  1136. - set Interactive 0
  1137. - set code [catch $args message]
  1138. - set Interactive $hold
  1139. - error $message $errorInfo $code
  1140. -}
  1141. -
  1142. -set Interactive 1
  1143. -
  1144. -proc bgerror {msg} {
  1145. - Say $msg
  1146. -}
  1147. -
  1148. -proc checkup {} {
  1149. - catch {noninteractive battery}
  1150. - after 10000 checkup
  1151. -}
  1152. -
  1153. -after 1000 checkup
  1154. -
  1155. -proc checkupin {time} {
  1156. - after $time {catch {noninteractive battery}}
  1157. -}
  1158. -
  1159. -",NULL);
  1160. + Tcl_VarEval(interp,
  1161. +"proc Say {text} {\n"
  1162. +" global Interactive\n"
  1163. +" if {$Interactive} {\n"
  1164. +" puts \"$text\"\n"
  1165. +" } else {\n"
  1166. +" upvar result result\n"
  1167. +" set result \"$result$text\"\n"
  1168. +" }\n"
  1169. +"}\n"
  1170. +"\n"
  1171. +"proc interactive {args} {\n"
  1172. +" global Interactive\n"
  1173. +" global errorInfo\n"
  1174. +" set hold $Interactive\n"
  1175. +" set Interactive 1\n"
  1176. +" set code [catch $args message]\n"
  1177. +" set Interactive $hold\n"
  1178. +" error $message $errorInfo $code\n"
  1179. +"}\n"
  1180. +"\n"
  1181. +"proc noninteractive {args} {\n"
  1182. +" global Interactive\n"
  1183. +" global errorInfo\n"
  1184. +" set hold $Interactive\n"
  1185. +" set Interactive 0\n"
  1186. +" set code [catch $args message]\n"
  1187. +" set Interactive $hold\n"
  1188. +" error $message $errorInfo $code\n"
  1189. +"}\n"
  1190. +"\n"
  1191. +"set Interactive 1\n"
  1192. +"\n"
  1193. +"proc bgerror {msg} {\n"
  1194. +" Say $msg\n"
  1195. +"}\n"
  1196. +"\n"
  1197. +"proc checkup {} {\n"
  1198. +" catch {noninteractive battery}\n"
  1199. +" after 10000 checkup\n"
  1200. +"}\n"
  1201. +"\n"
  1202. +"after 1000 checkup\n"
  1203. +"\n"
  1204. +"proc checkupin {time} {\n"
  1205. +" after $time {catch {noninteractive battery}}\n"
  1206. +"}\n"
  1207. +"\n", NULL);
  1208. Tcl_LinkVar(interp, "Interactive", (char*)&Interactive, TCL_LINK_INT);
  1209. @@ -2211,49 +2209,50 @@
  1210. Tcl_VarEval(interp,"set tkdbg 0", NULL);
  1211. #endif
  1212. - Say("Welcome to pilot-debug!\n\n\
  1213. - Type 'help' for further information.\n\
  1214. - Type 'exit' to quit the application\n\n");
  1215. + Say("Welcome to pilot-debug!\n\n"
  1216. +" Type 'help' for further information.\n"
  1217. +" Type 'exit' to quit the application\n");
  1218. #if 0
  1219. - Say("\tWelcome to pilot-debug!\n\n\
  1220. -
  1221. -Please connect your Palm and start console or debugging mode.\n\n\
  1222. -
  1223. -(Console mode is a background task that can respond to a few commands,\n
  1224. -most importantly RPC which lets any function on the Palm be invoked. The\n
  1225. -Palm operates as usual while console mode is active, except that since\n
  1226. -the serial port is held open, HotSync and other applications that use\n
  1227. -the serial port will not work. Debug mode is activated on demand or when\n
  1228. -the Palm crashes. In debug mode, the CPU is halted, and no commands may\n
  1229. -be executed, except via a debugging console like this one.)\n\n\
  1230. -
  1231. -In the absence of special utilities, the console can be started by the\n
  1232. -\".2\" shortcut, and debugging via \".1\". To clear either mode,\n
  1233. -reboot via the reset button. If console mode is active, you may also\n
  1234. -reboot via the \"coldboot\" or \"warmboot\" commands.\n\n\
  1235. -
  1236. -The Remote UI window lets you manipulate the Palm if console mode is\n
  1237. -active. By clicking the mouse button on the screen or buttons, you can\n
  1238. -simulate pen taps, and if you type anything while the window has the\n
  1239. -focus, the Palm will receive the keystrokes.\n\n\
  1240. -
  1241. -The Remote Console window is specifically for the transmission and\n
  1242. -reception of console packets. Pressing Return on a line will transmit\n
  1243. -it, and any incoming packets will be displayed here in addition to the\n
  1244. -Debug Console.\n\n\
  1245. -
  1246. -The Remote State window shows the current Palm CPU state. It is only\n
  1247. -updated on request or when the Palm halts.\n\n\
  1248. -
  1249. -
  1250. -The Debugging Console window is the primary interface for pilot-debug.\n
  1251. -Pressing Return on a line that contains text will execute that line as\n
  1252. -a Tcl command. (Try 'expr 3+4'.) All of the usual Tcl and Tk commands\n
  1253. -are available, as well as some special-purpose ones, including 'help',\n
  1254. -'coldboot', 'warmboot', 'attach', 't', and 'g', (the last one continues\n
  1255. -after the Palm halts.)\n\n\ Execute 'help' for the list of commands\n
  1256. -currently implemented.\n\n\ ");
  1257. + Say(
  1258. +"\tWelcome to pilot-debug!\n\n"
  1259. +"\n"
  1260. +"Please connect your Palm and start console or debugging mode.\n\n\\n"
  1261. +"\n"
  1262. +"(Console mode is a background task that can respond to a few commands,\n\n"
  1263. +"most importantly RPC which lets any function on the Palm be invoked. The\n\n"
  1264. +"Palm operates as usual while console mode is active, except that since\n\n"
  1265. +"the serial port is held open, HotSync and other applications that use\n\n"
  1266. +"the serial port will not work. Debug mode is activated on demand or when\n\n"
  1267. +"the Palm crashes. In debug mode, the CPU is halted, and no commands may\n\n"
  1268. +"be executed, except via a debugging console like this one.)\n\n\\n"
  1269. +"\n"
  1270. +"In the absence of special utilities, the console can be started by the\n\n"
  1271. +"\".2\" shortcut, and debugging via \".1\". To clear either mode,\n\n"
  1272. +"reboot via the reset button. If console mode is active, you may also\n\n"
  1273. +"reboot via the \"coldboot\" or \"warmboot\" commands.\n\n\\n"
  1274. +"\n"
  1275. +"The Remote UI window lets you manipulate the Palm if console mode is\n\n"
  1276. +"active. By clicking the mouse button on the screen or buttons, you can\n\n"
  1277. +"simulate pen taps, and if you type anything while the window has the\n\n"
  1278. +"focus, the Palm will receive the keystrokes.\n\n\\n"
  1279. +"\n"
  1280. +"The Remote Console window is specifically for the transmission and\n\n"
  1281. +"reception of console packets. Pressing Return on a line will transmit\n\n"
  1282. +"it, and any incoming packets will be displayed here in addition to the\n\n"
  1283. +"Debug Console.\n\n\ \n"
  1284. +"\n"
  1285. +"The Remote State window shows the current Palm CPU state. It is only\n\n"
  1286. +"updated on request or when the Palm halts.\n\n\\n"
  1287. +"\n"
  1288. +"\n"
  1289. +"The Debugging Console window is the primary interface for pilot-debug.\n\n"
  1290. +"Pressing Return on a line that contains text will execute that line as\n\n"
  1291. +"a Tcl command. (Try 'expr 3+4'.) All of the usual Tcl and Tk commands\n\n"
  1292. +"are available, as well as some special-purpose ones, including 'help',\n\n"
  1293. +"'coldboot', 'warmboot', 'attach', 't', and 'g', (the last one continues\n\n"
  1294. +"after the Palm halts.)\n\n\ Execute 'help' for the list of commands\n\n"
  1295. +"currently implemented.\n\n\ ");
  1296. #endif
  1297. /* Specify a user-specific startup file to invoke if the application is
  1298. @@ -2263,26 +2262,24 @@
  1299. Tcl_SetVar(interp, "tcl_rcFileName", "~/.pdebugrc", TCL_GLOBAL_ONLY);
  1300. - Tcl_VarEval(interp,"\
  1301. - set tcl_prompt1 myprompt
  1302. - proc myprompt {} {
  1303. - puts -nonewline \"pilot-debug> \"
  1304. - }
  1305. -
  1306. - ",NULL);
  1307. + Tcl_VarEval(interp,
  1308. +" set tcl_prompt1 myprompt\n"
  1309. +" proc myprompt {} {\n"
  1310. +" puts -nonewline \"pilot-debug> \"\n"
  1311. +" }\n"
  1312. +" \n", NULL);
  1313. /* Deal with command-line arguments */
  1314. - Tcl_VarEval(interp,"\
  1315. - if {$argc > 0} {
  1316. - set p [lindex $argv 0]
  1317. - set argv [lrange $argv 1 end]
  1318. - port $p
  1319. - } else {
  1320. - Say \"As you have not entered a serial port on the command like, you might like to \
  1321. -set one with 'port /dev/something'\\n\\n\"
  1322. - }
  1323. - ",NULL);
  1324. + Tcl_VarEval(interp,
  1325. +" if {$argc > 0} {\n"
  1326. +" set p [lindex $argv 0]\n"
  1327. +" set argv [lrange $argv 1 end]\n"
  1328. +" port $p\n"
  1329. +" } else {\n"
  1330. +" Say \"As you have not entered a serial port on the command like, you might like to \\n"
  1331. +"set one with 'port /dev/something'\\n\\n\"\n"
  1332. +" }\n", NULL);
  1333. return TCL_OK;
  1334. }