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