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