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