idlw-toolbar.el 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972
  1. ;;; idlw-toolbar.el --- a debugging toolbar for IDLWAVE
  2. ;; Copyright (C) 1999-2012 Free Software Foundation, Inc.
  3. ;; Author: Carsten Dominik <dominik@astro.uva.nl>
  4. ;; Maintainer: J.D. Smith <jdsmith@as.arizona.edu>
  5. ;; Version: 6.1.22
  6. ;; Keywords: processes
  7. ;; Package: idlwave
  8. ;; This file is part of GNU Emacs.
  9. ;; GNU Emacs is free software: you can redistribute it and/or modify
  10. ;; it under the terms of the GNU General Public License as published by
  11. ;; the Free Software Foundation, either version 3 of the License, or
  12. ;; (at your option) any later version.
  13. ;; GNU Emacs is distributed in the hope that it will be useful,
  14. ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
  15. ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  16. ;; GNU General Public License for more details.
  17. ;; You should have received a copy of the GNU General Public License
  18. ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
  19. ;;; Commentary:
  20. ;; This file implements a debugging toolbar for IDLWAVE. It requires
  21. ;; Emacs or XEmacs with toolbar and xpm support.
  22. ;; New versions of IDLWAVE, documentation, and more information
  23. ;; available from:
  24. ;; http://idlwave.org
  25. ;;; Code:
  26. (eval-when-compile (require 'cl))
  27. (defun idlwave-toolbar-make-button (image)
  28. (if (featurep 'xemacs)
  29. (toolbar-make-button-list image)
  30. (list 'image :type 'xpm :data image)))
  31. (defvar idlwave-toolbar)
  32. (defvar default-toolbar)
  33. (defvar idlwave-toolbar-is-possible)
  34. (if (not (or (and (featurep 'xemacs) ; This is XEmacs
  35. (featurep 'xpm) ; need xpm
  36. (featurep 'toolbar)) ; ... and the toolbar
  37. (and (not (featurep 'xemacs)) ; This is Emacs
  38. (boundp 'tool-bar-button-margin) ; need toolbar
  39. (fboundp 'image-type-available-p) ; need image stuff
  40. (image-type-available-p 'xpm)) ; need xpm
  41. ))
  42. ;; oops - cannot do the toolbar
  43. (message "Sorry, IDLWAVE xpm toolbar cannot be used on this version of Emacs")
  44. ;; OK, we can define a toolbar
  45. (defconst idlwave-toolbar-is-possible t
  46. "When defined, indicates that a toolbar is possible with this Emacs.")
  47. (defvar idlwave-toolbar-compile-icon
  48. (idlwave-toolbar-make-button
  49. "/* XPM */
  50. static char * file[] = {
  51. \"28 28 2 1\",
  52. \" c None s backgroundToolBarColor\",
  53. \". c #000000000000\",
  54. \" \",
  55. \" \",
  56. \" \",
  57. \" . \",
  58. \" .. ... .. \",
  59. \" .... ... .... \",
  60. \" ............. \",
  61. \" ........... \",
  62. \" ................... \",
  63. \" ........ ........ \",
  64. \" ..... ........ \",
  65. \" .... ......... \",
  66. \" ..... .. ... ..... \",
  67. \" ...... .. .. ...... \",
  68. \" ..... ... .. ..... \",
  69. \" ......... .... \",
  70. \" ........ ..... \",
  71. \" ........ ........ \",
  72. \" ................... \",
  73. \" ........... \",
  74. \" ............. \",
  75. \" .... ... .... \",
  76. \" .. ... .. \",
  77. \" . \",
  78. \" \",
  79. \" \",
  80. \" \",
  81. \" \"};")
  82. "The compile icon.")
  83. (defvar idlwave-toolbar-next-error-icon
  84. (idlwave-toolbar-make-button
  85. "/* XPM */
  86. static char * file[] = {
  87. \"28 28 3 1\",
  88. \" c None s backgroundToolBarColor\",
  89. \". c #000000000000\",
  90. \"R c #FFFF00000000\",
  91. \" \",
  92. \" \",
  93. \" R \",
  94. \" RR RRR RR \",
  95. \" RRRR RRR RRRR \",
  96. \" RRRRRRRRRRRRR \",
  97. \" RRRRRRRRRRR \",
  98. \" RRRRRRRRRRRRRRRRRRR \",
  99. \" RRRRRRRR \",
  100. \" RRRRR \",
  101. \" RRRR \",
  102. \" ........ \",
  103. \" ........ \",
  104. \" ......... \",
  105. \" ..... .. ... ..... \",
  106. \" ...... .. .. ...... \",
  107. \" ..... ... .. ..... \",
  108. \" ......... .... \",
  109. \" ........ ..... \",
  110. \" ........ ........ \",
  111. \" ................... \",
  112. \" ........... \",
  113. \" ............. \",
  114. \" .... ... .... \",
  115. \" .. ... .. \",
  116. \" . \",
  117. \" \",
  118. \" \"};")
  119. "The Next Error icon.")
  120. (defvar idlwave-toolbar-stop-at-icon
  121. (idlwave-toolbar-make-button
  122. "/* XPM */
  123. static char * file[] = {
  124. \"28 28 3 1\",
  125. \" c None s backgroundToolBarColor\",
  126. \". c #000000000000\",
  127. \"R c #FFFF00000000\",
  128. \" \",
  129. \" \",
  130. \" \",
  131. \" \",
  132. \" ........ \",
  133. \" .RRRRRRRR. \",
  134. \" .RRRRRRRRRR. \",
  135. \" .RRRRRRRRRRRR. \",
  136. \" .RRRRRRRRRRRRRR. \",
  137. \" .RRRRRRRRRRRRRRRR. \",
  138. \" .RRRRRRRRRRRRRRRRRR. \",
  139. \" .RRRRRRRRRRRRRRRRRR. \",
  140. \" .RRRRRRRRRRRRRRRRRR. \",
  141. \" .RRRRRRRRRRRRRRRRRR. \",
  142. \" .RRRRRRRRRRRRRRRRRR. \",
  143. \" .RRRRRRRRRRRRRRRRRR. \",
  144. \" .RRRRRRRRRRRRRRRRRR. \",
  145. \" .RRRRRRRRRRRRRRRRRR. \",
  146. \" .RRRRRRRRRRRRRRRR. \",
  147. \" .RRRRRRRRRRRRRR. \",
  148. \" .RRRRRRRRRRRR. \",
  149. \" .RRRRRRRRRR. \",
  150. \" .RRRRRRRR. \",
  151. \" ........ \",
  152. \" \",
  153. \" \",
  154. \" \",
  155. \" \"};")
  156. "The Stop At icon.")
  157. (defvar idlwave-toolbar-clear-at-icon
  158. (idlwave-toolbar-make-button
  159. "/* XPM */
  160. static char * file[] = {
  161. \"28 28 3 1\",
  162. \" c None s backgroundToolBarColor\",
  163. \". c #000000000000\",
  164. \"R c #FFFF00000000\",
  165. \" \",
  166. \" \",
  167. \" \",
  168. \" ... ... \",
  169. \" ... ........ ... \",
  170. \" ... .RRRRRRRR. ... \",
  171. \" ....RRRRRRRRRR.... \",
  172. \" ...RRRRRRRRRR... \",
  173. \" ....RRRRRRRR.... \",
  174. \" .RR...RRRRRR...RR. \",
  175. \" .RRRR...RRRR...RRRR. \",
  176. \" .RRRRR...RR...RRRRR. \",
  177. \" .RRRRRR......RRRRRR. \",
  178. \" .RRRRRRR....RRRRRRR. \",
  179. \" .RRRRRRR....RRRRRRR. \",
  180. \" .RRRRRR......RRRRRR. \",
  181. \" .RRRRR...RR...RRRRR. \",
  182. \" .RRRR...RRRR...RRRR. \",
  183. \" .RR...RRRRRR...RR. \",
  184. \" ....RRRRRRRR.... \",
  185. \" ...RRRRRRRRRR... \",
  186. \" ....RRRRRRRRRR.... \",
  187. \" ... .RRRRRRRR. ... \",
  188. \" ... ........ ... \",
  189. \" ... ... \",
  190. \" \",
  191. \" \",
  192. \" \"};")
  193. "The Clear At icon.")
  194. (defvar idlwave-toolbar-clear-all-icon
  195. (idlwave-toolbar-make-button
  196. "/* XPM */
  197. static char * file[] = {
  198. \"28 28 4 1\",
  199. \" c None s backgroundToolBarColor\",
  200. \". c #000000000000\",
  201. \"X c #FFFFFFFFFFFF\",
  202. \"R c #FFFF00000000\",
  203. \" \",
  204. \" \",
  205. \" \",
  206. \" .. .... .... .. \",
  207. \" ...RRRR. .RRRR... \",
  208. \" ...RRRR. .RRRR... \",
  209. \" .R...RRRR. .RRRR...R. \",
  210. \" .RR...RRR. .RRR...RR. \",
  211. \" .RRR...RR. .RR...RRR. \",
  212. \" .RRRR...R. .R...RRRR. \",
  213. \" .RRRR... ...RRRR. \",
  214. \" .RRRR... ...RRRR. \",
  215. \" .... ... ... .... \",
  216. \" ..... \",
  217. \" ... \",
  218. \" .... ..... .... \",
  219. \" .RRRR.... ....RRRR. \",
  220. \" .RRRRR... ...RRRRR. \",
  221. \" .RRRRR.... ....RRRRR. \",
  222. \" .RRRR...R. .R...RRRR. \",
  223. \" .RRR...RR. .RR...RRR. \",
  224. \" .RR...RRR. .RRR...RR. \",
  225. \" ....RRR. .RRR.... \",
  226. \" ...RRR. .RRR... \",
  227. \" ....... ....... \",
  228. \" \",
  229. \" \",
  230. \" \"};")
  231. "The Clear-All icon.")
  232. (defvar idlwave-toolbar-stop-beginning-icon
  233. (idlwave-toolbar-make-button
  234. "/* XPM */
  235. static char * file[] = {
  236. \"28 28 4 1\",
  237. \" c None s backgroundToolBarColor\",
  238. \". c #000000000000\",
  239. \"X c #FFFF00000000\",
  240. \"_ c #FFFFFFFFFFFF\",
  241. \" \",
  242. \" \",
  243. \" \",
  244. \" \",
  245. \" ........ \",
  246. \" .XXXXXXXX. \",
  247. \" .XXXXXXXXXX. \",
  248. \" .XXXXXXXXXXXX. \",
  249. \" .XX..XXXXXXXXXX. \",
  250. \" .XX.XX.X______XXX. \",
  251. \" .XXX.XX.X______XXXX. \",
  252. \" .XXXX..XXXXXXXXXXXX. \",
  253. \" .XXXXXXXXXX____XXXX. \",
  254. \" .XXXXXXXXXX____XXXX. \",
  255. \" .XXXXXXXXXXXXXXXXXX. \",
  256. \" .XXXXXXXXXX____XXXX. \",
  257. \" .XXXXXXXXXX____XXXX. \",
  258. \" .XXXXXXXXXXXXXXXXXX. \",
  259. \" .XXXXXXXXX____XXX. \",
  260. \" .XXXXXXXX____XX. \",
  261. \" .XXXXXXXXXXXX. \",
  262. \" .XXXXXXXXXX. \",
  263. \" .XXXXXXXX. \",
  264. \" ........ \",
  265. \" \",
  266. \" \",
  267. \" \",
  268. \" \"};")
  269. "The Stop at Beginning icon.")
  270. (defvar idlwave-toolbar-stop-in-icon
  271. (idlwave-toolbar-make-button
  272. "/* XPM */
  273. static char * file[] = {
  274. \"28 28 4 1\",
  275. \" c None s backgroundToolBarColor\",
  276. \"_ c #FFFFFFFFFFFF\",
  277. \". c #000000000000\",
  278. \"R c #FFFF00000000\",
  279. \" \",
  280. \" \",
  281. \" \",
  282. \" \",
  283. \" ........ \",
  284. \" .RRRRRRRR. \",
  285. \" .RRRRRRRRRR. \",
  286. \" .RRRRRRRRRRRR. \",
  287. \" .RRR___RR___RRR. \",
  288. \" .RRRR__RRRR__RRRR. \",
  289. \" .RRRRR__RRRR__RRRRR. \",
  290. \" .RRRRR__RRRR__RRRRR. \",
  291. \" .RRRRR__RRRR__RRRRR. \",
  292. \" .RRRR__RRRRRR__RRRR. \",
  293. \" .RRRRR__RRRR__RRRRR. \",
  294. \" .RRRRR__RRRR__RRRRR. \",
  295. \" .RRRRR__RRRR__RRRRR. \",
  296. \" .RRRRR__RRRR__RRRRR. \",
  297. \" .RRRR___RR___RRRR. \",
  298. \" .RRRRRRRRRRRRRR. \",
  299. \" .RRRRRRRRRRRR. \",
  300. \" .RRRRRRRRRR. \",
  301. \" .RRRRRRRR. \",
  302. \" ........ \",
  303. \" \",
  304. \" \",
  305. \" \",
  306. \" \"};")
  307. "The Stop in icon.")
  308. (defvar idlwave-toolbar-edit-cmd-icon
  309. (idlwave-toolbar-make-button
  310. "/* XPM */
  311. static char * file[] = {
  312. \"28 28 2 1\",
  313. \" c None s backgroundToolBarColor\",
  314. \". c #000000000000\",
  315. \" \",
  316. \" \",
  317. \" \",
  318. \" \",
  319. \" \",
  320. \" \",
  321. \" \",
  322. \" \",
  323. \" \",
  324. \" \",
  325. \" \",
  326. \" .. \",
  327. \" .. \",
  328. \" .. \",
  329. \" .. \",
  330. \" .. \",
  331. \" \",
  332. \" \",
  333. \" ................. \",
  334. \" \",
  335. \" \",
  336. \" \",
  337. \" \",
  338. \" \",
  339. \" \",
  340. \" \",
  341. \" \",
  342. \" \"};")
  343. "The edit-cmd icon")
  344. (defvar idlwave-toolbar-run-icon
  345. (idlwave-toolbar-make-button
  346. "/* XPM */
  347. static char * file[] = {
  348. \"28 28 3 1\",
  349. \" c None s backgroundToolBarColor\",
  350. \". s FgColor c #000000000000\",
  351. \"G c #0000BBBB0000\",
  352. \" \",
  353. \" \",
  354. \" \",
  355. \" \",
  356. \" ..... \",
  357. \" .GGG. \",
  358. \" .GGG. \",
  359. \" .GGG. ....... \",
  360. \" .GGG. \",
  361. \" .GGG. \",
  362. \" .GGG. ....... \",
  363. \" .GGG. \",
  364. \" ....GGG.... \",
  365. \" .GGGGGGG. ....... \",
  366. \" .GGGGG. \",
  367. \" .GGG. \",
  368. \" .G. ....... \",
  369. \" . \",
  370. \" \",
  371. \" ....... \",
  372. \" \",
  373. \" \",
  374. \" ....... \",
  375. \" \",
  376. \" \",
  377. \" \",
  378. \" \",
  379. \" \"};")
  380. "The Run icon.")
  381. (defvar idlwave-toolbar-cont-icon
  382. (idlwave-toolbar-make-button
  383. "/* XPM */
  384. static char * file[] = {
  385. \"28 28 3 1\",
  386. \" c None s backgroundToolBarColor\",
  387. \". s FgColor c #000000000000\",
  388. \"G c #0000BBBB0000\",
  389. \" \",
  390. \" \",
  391. \" \",
  392. \" ....... \",
  393. \" \",
  394. \" ....... \",
  395. \" .GGGGGG. ....... \",
  396. \" .GGGGGGG. \",
  397. \" .GGG..... \",
  398. \" .GGG. ....... \",
  399. \" .GGG. \",
  400. \" .GGG. \",
  401. \" .GGG. ....... \",
  402. \" .GGG. \",
  403. \" ....GGG.... \",
  404. \" .GGGGGGG. ....... \",
  405. \" .GGGGG. \",
  406. \" .GGG. \",
  407. \" .G. ....... \",
  408. \" . \",
  409. \" \",
  410. \" ....... \",
  411. \" \",
  412. \" \",
  413. \" \",
  414. \" \",
  415. \" \",
  416. \" \"};")
  417. "The Cont icon.")
  418. (defvar idlwave-toolbar-to-here-icon
  419. (idlwave-toolbar-make-button
  420. "/* XPM */
  421. static char * file[] = {
  422. \"28 28 4 1\",
  423. \" c None s backgroundToolBarColor\",
  424. \". c #000000000000\",
  425. \"G c #0000BBBB0000\",
  426. \"R c #FFFF00000000\",
  427. \" \",
  428. \" \",
  429. \" \",
  430. \" \",
  431. \" \",
  432. \" \",
  433. \" ..... ........ \",
  434. \" .GGGG. \",
  435. \" .GGGGG. \",
  436. \" .GG.... ........ \",
  437. \" .GG. \",
  438. \" .GG. . \",
  439. \" .GG. .. \",
  440. \" .GG. .G. ...... \",
  441. \" .GG...GG. \",
  442. \" .GGGGGGGG. RRRRRR \",
  443. \" .GGGGGGGGG. RRRRRR \",
  444. \" .GGGGGGG. RRRRRR \",
  445. \" ....GG. \",
  446. \" .G. ...... \",
  447. \" .. \",
  448. \" . \",
  449. \" \",
  450. \" \",
  451. \" \",
  452. \" \",
  453. \" \",
  454. \" \"};")
  455. "The Cont-to-here icon.")
  456. (defvar idlwave-toolbar-step-over-icon
  457. (idlwave-toolbar-make-button
  458. "/* XPM */
  459. static char * file[] = {
  460. \"28 28 3 1\",
  461. \" c None s backgroundToolBarColor\",
  462. \". c #000000000000\",
  463. \"G c #0000BBBB0000\",
  464. \" \",
  465. \" \",
  466. \" \",
  467. \" \",
  468. \" \",
  469. \" \",
  470. \" ..... \",
  471. \" .GGGG. ....... \",
  472. \" .GGGGG. \",
  473. \" .GG.... \",
  474. \" .GG. ....... \",
  475. \" .GG. . \",
  476. \" .GG. .. \",
  477. \" .GG. .G. ....... \",
  478. \" .GG...GG. \",
  479. \" .GGGGGGGG. \",
  480. \" .GGGGGGGGG. ....... \",
  481. \" .GGGGGGG. \",
  482. \" ....GG. \",
  483. \" .G. ....... \",
  484. \" .. \",
  485. \" . \",
  486. \" ....... \",
  487. \" \",
  488. \" \",
  489. \" \",
  490. \" \",
  491. \" \"};")
  492. "The Step Over icon.")
  493. (defvar idlwave-toolbar-step-into-icon
  494. (idlwave-toolbar-make-button
  495. "/* XPM */
  496. static char * file[] = {
  497. \"28 28 3 1\",
  498. \" c None s backgroundToolBarColor\",
  499. \". c #000000000000\",
  500. \"G c #0000BBBB0000\",
  501. \" \",
  502. \" \",
  503. \" \",
  504. \" \",
  505. \" \",
  506. \" \",
  507. \" ..... ....... \",
  508. \" .GGGG. \",
  509. \" .GGGGG. \",
  510. \" .GG.... ........ \",
  511. \" .GG. \",
  512. \" .GG. . \",
  513. \" .GG. .. \",
  514. \" .GG. .G. \",
  515. \" .GG...GG. ....... \",
  516. \" .GGGGGGGG. \",
  517. \" .GGGGGGGGG. \",
  518. \" .GGGGGGG. ....... \",
  519. \" ....GG. \",
  520. \" .G. \",
  521. \" .. ....... \",
  522. \" . \",
  523. \" \",
  524. \" \",
  525. \" \",
  526. \" \",
  527. \" \",
  528. \" \"};")
  529. "The Step Into icon.")
  530. (defvar idlwave-toolbar-step-out-icon
  531. (idlwave-toolbar-make-button
  532. "/* XPM */
  533. static char * file[] = {
  534. \"28 28 3 1\",
  535. \" c None s backgroundToolBarColor\",
  536. \". c #000000000000\",
  537. \"G c #0000BBBB0000\",
  538. \" \",
  539. \" \",
  540. \" \",
  541. \" \",
  542. \" \",
  543. \" \",
  544. \" . \",
  545. \" .. ........ \",
  546. \" .G. \",
  547. \" ....GG. \",
  548. \" .GGGGGGG. ........ \",
  549. \" .GGGGGGGGG. \",
  550. \" .GGGGGGGG. \",
  551. \" .GG...GG. ........ \",
  552. \" .GG. .G. \",
  553. \" .GG. .. \",
  554. \" .GG. . \",
  555. \" .GG. \",
  556. \" .GG....... ....... \",
  557. \" .GGGGGGGG. \",
  558. \" .GGGGGGG. \",
  559. \" ........ ....... \",
  560. \" \",
  561. \" \",
  562. \" \",
  563. \" \",
  564. \" \",
  565. \" \"};")
  566. "The Step up icon.")
  567. (defvar idlwave-toolbar-eval-icon
  568. (idlwave-toolbar-make-button
  569. "/* XPM */
  570. static char * file[] = {
  571. \"28 28 2 1\",
  572. \" c None s backgroundToolBarColor\",
  573. \". c #000000000000\",
  574. \" \",
  575. \" \",
  576. \" \",
  577. \" \",
  578. \" \",
  579. \" \",
  580. \" \",
  581. \" \",
  582. \" \",
  583. \" \",
  584. \" \",
  585. \" .... \",
  586. \" .. .. ...... \",
  587. \" .. .. ...... \",
  588. \" .. .. \",
  589. \" .. .. ...... \",
  590. \" .. .. ...... \",
  591. \" .... \",
  592. \" .. \",
  593. \" .. \",
  594. \" \",
  595. \" \",
  596. \" \",
  597. \" \",
  598. \" \",
  599. \" \",
  600. \" \",
  601. \" \"};")
  602. "The Evaluate icon.")
  603. (defvar idlwave-toolbar-stack-up-icon
  604. (idlwave-toolbar-make-button
  605. "/* XPM */
  606. static char * file[] = {
  607. \"28 28 5 1\",
  608. \" c None s backgroundToolBarColor\",
  609. \". s FgColor c #000000000000\",
  610. \"_ c #FFFFFFFFFFFF\",
  611. \"G c #0000BBBB0000\",
  612. \"R c #FFFF00000000\",
  613. \" \",
  614. \" \",
  615. \" \",
  616. \" \",
  617. \" \",
  618. \" ........ . \",
  619. \" .______. ... \",
  620. \" .______. ..... \",
  621. \" .______. ....... \",
  622. \" .______. ... \",
  623. \" .______. ... \",
  624. \" ........ ... \",
  625. \" .GGGGGG. ... \",
  626. \" .GGGGGG. ... \",
  627. \" .GGGGGG. \",
  628. \" .GGGGGG. \",
  629. \" .GGGGGG. \",
  630. \" ........ \",
  631. \" .RRRRRR. \",
  632. \" .RRRRRR. \",
  633. \" .RRRRRR. \",
  634. \" .RRRRRR. \",
  635. \" .RRRRRR. \",
  636. \" ........ \",
  637. \" \",
  638. \" \",
  639. \" \",
  640. \" \"};")
  641. "The Stack Up icon.")
  642. (defvar idlwave-toolbar-stack-down-icon
  643. (idlwave-toolbar-make-button
  644. "/* XPM */
  645. static char * file[] = {
  646. \"28 28 5 1\",
  647. \" c None s backgroundToolBarColor\",
  648. \". s FgColor c #000000000000\",
  649. \"_ c #FFFFFFFFFFFF\",
  650. \"G c #0000BBBB0000\",
  651. \"R c #FFFF00000000\",
  652. \" \",
  653. \" \",
  654. \" \",
  655. \" \",
  656. \" \",
  657. \" ........ \",
  658. \" .______. \",
  659. \" .______. \",
  660. \" .______. \",
  661. \" .______. \",
  662. \" .______. \",
  663. \" ........ \",
  664. \" .GGGGGG. \",
  665. \" .GGGGGG. \",
  666. \" .GGGGGG. \",
  667. \" .GGGGGG. ... \",
  668. \" .GGGGGG. ... \",
  669. \" ........ ... \",
  670. \" .RRRRRR. ... \",
  671. \" .RRRRRR. ... \",
  672. \" .RRRRRR. ....... \",
  673. \" .RRRRRR. ..... \",
  674. \" .RRRRRR. ... \",
  675. \" ........ . \",
  676. \" \",
  677. \" \",
  678. \" \",
  679. \" \"};")
  680. "The Stack Down icon.")
  681. (defvar idlwave-toolbar-reset-icon
  682. (idlwave-toolbar-make-button
  683. "/* XPM */
  684. static char * file[] = {
  685. \"28 28 3 1\",
  686. \" c None s backgroundToolBarColor\",
  687. \"G c #0000BBBB0000\",
  688. \". c #000000000000\",
  689. \" \",
  690. \" \",
  691. \" \",
  692. \" . \",
  693. \" .G. . \",
  694. \" .GGG.. .G. \",
  695. \" .GGGGG..GG. \",
  696. \" ..GGGGGGGG. \",
  697. \" ..GGGGGG. \",
  698. \" ..GGGGG. \",
  699. \" .GGGGGG. \",
  700. \" .G...... \",
  701. \" \",
  702. \" ..... \",
  703. \" ......... \",
  704. \" ......... \",
  705. \" ......... \",
  706. \" . ..... . \",
  707. \" . . \",
  708. \" . . \",
  709. \" . . \",
  710. \" . . \",
  711. \" . . \",
  712. \" .. .. \",
  713. \" ....... \",
  714. \" ..... \",
  715. \" \",
  716. \" \"};")
  717. "The Reset icon.")
  718. (defvar idlwave-toolbar-electric-debug-icon
  719. (idlwave-toolbar-make-button
  720. "/* XPM */
  721. static char * file[] = {
  722. \"28 28 8 1\",
  723. \" c None s backgroundToolBarColor\",
  724. \". c #CFC854\",
  725. \"+ c #EEDB0E\",
  726. \"@ c #D2C739\",
  727. \"# c #A39C54\",
  728. \"$ c #CDC020\",
  729. \"% c #020202\",
  730. \"& c #D60E36\",
  731. \" \",
  732. \" \",
  733. \" .. \",
  734. \" +++++@ \",
  735. \" ++++++ \",
  736. \" +++++@ \",
  737. \" +++++ \",
  738. \" #++++@ \",
  739. \" $+++@ %% %% \",
  740. \" ++++++$ % % \",
  741. \" #+++++$ % % \",
  742. \" #++$# %%% \",
  743. \" #+++ %%%%%%% \",
  744. \" .++ %%%%%%%%%%% \",
  745. \" ++$$ %%%%%%%%%%% \",
  746. \" .+@# &&%%%%%%%&& \",
  747. \" .++++# &&&&&%%%&&&&& \",
  748. \" +++++$ &&%%&&&&&%%&& \",
  749. \" $+++$ &&%%&&&&&%%&& \",
  750. \" $++@ &&&&&&%&&&&&& \",
  751. \" $+@ &&&&&&%&&&&&& \",
  752. \" @+ &&%%&&&&&%%&& \",
  753. \" ++. &%%&&%&&%%& \",
  754. \" +. &&&&%%%&&&& \",
  755. \" .+ &&%%%%%&& \",
  756. \" ++ %%%%%%% \",
  757. \" . %%% \",
  758. \" \"};")
  759. "The electric debug icon.")
  760. (defvar idlwave-toolbar
  761. '(
  762. [idlwave-toolbar-compile-icon
  763. idlwave-shell-save-and-compile
  764. t
  765. "Save and Compile this file (or recompile last)"]
  766. [idlwave-toolbar-next-error-icon
  767. idlwave-shell-goto-next-error
  768. t
  769. "Goto Next Error"]
  770. [idlwave-toolbar-stop-at-icon
  771. idlwave-shell-break-here
  772. (derived-mode-p 'idlwave-mode)
  773. "Set Breakpoint at selected position"]
  774. [idlwave-toolbar-clear-at-icon
  775. idlwave-shell-clear-current-bp
  776. t
  777. "Clear Breakpoint at selected position"]
  778. [idlwave-toolbar-clear-all-icon
  779. idlwave-shell-clear-all-bp
  780. t
  781. "Clear all Breakpoints"]
  782. [idlwave-toolbar-stop-beginning-icon
  783. idlwave-shell-break-this-module
  784. (derived-mode-p 'idlwave-mode)
  785. "Stop at beginning of enclosing Routine"]
  786. [idlwave-toolbar-stop-in-icon
  787. idlwave-shell-break-in
  788. t
  789. "Stop in Routine with name near point"]
  790. [idlwave-toolbar-edit-cmd-icon
  791. idlwave-shell-edit-default-command-line
  792. t
  793. "Edit Default Command Line"]
  794. [idlwave-toolbar-run-icon
  795. idlwave-shell-execute-default-command-line
  796. t
  797. "Reset, then Execute Default Command Line"]
  798. [idlwave-toolbar-cont-icon
  799. idlwave-shell-cont
  800. t
  801. "Continue Current Program"]
  802. [idlwave-toolbar-to-here-icon
  803. idlwave-shell-to-here
  804. (derived-mode-p 'idlwave-mode)
  805. "Continue to Here (cursor position)"]
  806. [idlwave-toolbar-step-over-icon
  807. idlwave-shell-stepover
  808. t
  809. "Step Over (aka next)"]
  810. [idlwave-toolbar-step-into-icon
  811. idlwave-shell-step
  812. t
  813. "Step Into (aka step)"]
  814. [idlwave-toolbar-step-out-icon
  815. idlwave-shell-out
  816. t
  817. "Step Out (of subroutine)"]
  818. [idlwave-toolbar-eval-icon
  819. idlwave-shell-print
  820. t
  821. "Print Expression at or before Point"]
  822. [idlwave-toolbar-stack-up-icon
  823. idlwave-shell-stack-up
  824. t
  825. "Stack Up (towards \"cooler\" - less recently visited - frames)"]
  826. [idlwave-toolbar-stack-down-icon
  827. idlwave-shell-stack-down
  828. t
  829. "Stack Down (towards \"warmer\" - more recently visited - frames)"]
  830. [idlwave-toolbar-reset-icon
  831. idlwave-shell-reset
  832. t
  833. "Reset IDL (RETALL & CLOSE,/ALL and more)"]
  834. [idlwave-toolbar-electric-debug-icon
  835. idlwave-shell-electric-debug-mode
  836. (derived-mode-p 'idlwave-mode)
  837. "Toggle Electric Debug Mode"]
  838. ))
  839. ;; When the shell exits, arrange to remove the special toolbar everywhere.
  840. (add-hook 'idlwave-shell-cleanup-hook
  841. 'idlwave-toolbar-remove-everywhere)
  842. );; End can define toolbar
  843. (defun idlwave-toolbar-add ()
  844. "Add the IDLWAVE toolbar if appropriate."
  845. (if (and (featurep 'xemacs) ; This is a noop on Emacs
  846. (boundp 'idlwave-toolbar-is-possible)
  847. (derived-mode-p 'idlwave-mode 'idlwave-shell-mode))
  848. (set-specifier default-toolbar (cons (current-buffer)
  849. idlwave-toolbar))))
  850. (defun idlwave-toolbar-remove ()
  851. "Add the IDLWAVE toolbar if appropriate."
  852. (if (and (featurep 'xemacs) ; This is a noop on Emacs
  853. (boundp 'idlwave-toolbar-is-possible)
  854. (derived-mode-p 'idlwave-mode 'idlwave-shell-mode))
  855. (remove-specifier default-toolbar (current-buffer))))
  856. (defvar idlwave-shell-mode-map)
  857. (defvar idlwave-mode-map)
  858. (defvar idlwave-toolbar-visible nil)
  859. (defun idlwave-toolbar-add-everywhere ()
  860. "Add the toolbar in all appropriate buffers."
  861. (when (boundp 'idlwave-toolbar-is-possible)
  862. ;; First make sure new buffers will get the toolbar
  863. (add-hook 'idlwave-mode-hook 'idlwave-toolbar-add)
  864. ;; Then add it to all existing buffers
  865. (if (featurep 'xemacs)
  866. ;; For XEmacs, map over all buffers to add toolbar
  867. (save-excursion
  868. (mapcar (lambda (buf)
  869. (set-buffer buf)
  870. (idlwave-toolbar-add))
  871. (buffer-list)))
  872. ;; For Emacs, add the key definitions to the mode maps
  873. (mapc (lambda (x)
  874. (let* ((icon (aref x 0))
  875. (func (aref x 1))
  876. (show (aref x 2))
  877. (help (aref x 3))
  878. (key (vector 'tool-bar func))
  879. (def (list 'menu-item
  880. "a"
  881. func
  882. :image (symbol-value icon)
  883. :visible show
  884. :help help)))
  885. (define-key idlwave-mode-map key def)
  886. (define-key idlwave-shell-mode-map key def)))
  887. (reverse idlwave-toolbar)))
  888. (setq idlwave-toolbar-visible t)))
  889. (defun idlwave-toolbar-remove-everywhere ()
  890. "Remove the toolbar in all appropriate buffers."
  891. ;; First make sure new buffers won't get the toolbar
  892. (when idlwave-toolbar-is-possible
  893. (remove-hook 'idlwave-mode-hook 'idlwave-toolbar-add)
  894. ;; Then remove it in all existing buffers.
  895. (if (featurep 'xemacs)
  896. ;; For XEmacs, map over all buffers to remove toolbar
  897. (save-excursion
  898. (mapcar (lambda (buf)
  899. (set-buffer buf)
  900. (idlwave-toolbar-remove))
  901. (buffer-list)))
  902. ;; For Emacs, remove the key definitions from the mode maps
  903. (mapc (lambda (x)
  904. (let* (;;(icon (aref x 0))
  905. (func (aref x 1))
  906. ;;(show (aref x 2))
  907. ;;(help (aref x 3))
  908. (key (vector 'tool-bar func)))
  909. (define-key idlwave-mode-map key nil)
  910. (define-key idlwave-shell-mode-map key nil)))
  911. idlwave-toolbar))
  912. (setq idlwave-toolbar-visible nil)))
  913. (defun idlwave-toolbar-toggle (&optional force-on)
  914. (interactive)
  915. (if idlwave-toolbar-visible
  916. (or force-on (idlwave-toolbar-remove-everywhere))
  917. (idlwave-toolbar-add-everywhere))
  918. ;; Now make sure this
  919. (if (featurep 'xemacs)
  920. nil ; no action necessary, toolbar gets updated automatically
  921. ;; On Emacs, redraw the frame to make sure the Toolbar is updated.
  922. (redraw-frame (selected-frame))))
  923. (provide 'idlw-toolbar)
  924. (provide 'idlwave-toolbar)
  925. ;;; idlw-toolbar.el ends here