annotate lisp/x11/x-toolbar.el @ 88:821dec489c24 r20-0

Import from CVS: tag r20-0
author cvs
date Mon, 13 Aug 2007 09:09:59 +0200
parents 1ce6082ce73f
children 0d2f883870bc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;; Toolbar support for X.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;; Copyright (C) 1994 Andy Piper <andyp@parallax.demon.co.uk>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1995 Board of Trustees, University of Illinois
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 ;; Copyright (C) 1996 Ben Wing <wing@666.com>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;; XEmacs is distributed in the hope that it will be useful, but
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;; You should have received a copy of the GNU General Public License
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
19 ;; along with XEmacs; see the file COPYING. If not, write to the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
20 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
21 ;; Boston, MA 02111-1307, USA.
16
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
22
0293115a14e9 Import from CVS: tag r19-15b91
cvs
parents: 14
diff changeset
23 ;;
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
24 ;; Miscellaneous toolbar functions, useful for users to redefine, in
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
25 ;; order to get different behaviour.
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
26 ;;
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
27
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
28 (defun toolbar-open ()
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
29 (interactive)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
30 (call-interactively 'find-file))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
31
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
32 (defun toolbar-dired ()
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
33 (interactive)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
34 (call-interactively 'dired))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
35
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
36 (defun toolbar-save ()
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
37 (interactive)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
38 (call-interactively 'save-buffer))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
39
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
40 (defun toolbar-print ()
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
41 (interactive)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
42 (call-interactively 'lpr-buffer))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
43
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
44 (defun toolbar-cut ()
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
45 (interactive)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
46 (call-interactively 'x-kill-primary-selection))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
47
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
48 (defun toolbar-copy ()
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
49 (interactive)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
50 (call-interactively 'x-copy-primary-selection))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
51
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
52 (defun toolbar-paste ()
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
53 (interactive)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
54 (call-interactively 'x-yank-clipboard-selection))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
55
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
56 (defun toolbar-undo ()
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
57 (interactive)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
58 (call-interactively 'undo))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
59
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
60 (defun toolbar-replace ()
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
61 (interactive)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
62 (call-interactively 'query-replace))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
63
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
64 ;;
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 ;; toolbar ispell variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 (defun toolbar-ispell ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 "Intelligently spell the region or buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (interactive)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
71 (if (region-active-p)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
72 (ispell-region (region-beginning) (region-end))
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
73 (ispell-buffer)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 ;; toolbar mail variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
79 (defmacro toolbar-external (process &rest args)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
80 `(lambda () (interactive) (call-process ,process nil 0 nil ,@args)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
82 (defvar toolbar-mail-commands-alist
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
83 `((vm . vm)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
84 (gnus . gnus-no-server)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
85 (rmail . rmail)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
86 (mh . mh-rmail)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
87 (pine . ,(toolbar-external "xterm" "-e" "pine")) ; *gag*
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
88 (elm . ,(toolbar-external "xterm" "-e" "elm"))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
89 (mutt . ,(toolbar-external "xterm" "-e" "mutt"))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
90 (exmh . ,(toolbar-external "exmh"))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
91 ;; How to turn on netscape mail, command-line??
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
92 (netscape . ,(toolbar-external "netscape")))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
93 "Alist of mail readers and their commands.
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
94 The car of the alist is the mail reader, and the cdr is the form
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
95 used to start it.")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
97 (defvar toolbar-mail-reader 'vm
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
98 "Mail reader toolbar will invoke.
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
99 The legal values are `vm' and `gnus', but you can add your own values
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
100 by customizing `toolbar-mail-commands-alist'.")
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
101
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (defun toolbar-mail ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 "Run mail in a separate frame."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 (interactive)
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
106 (let ((command (assq toolbar-mail-reader toolbar-mail-commands-alist)))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
107 (if (not command)
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
108 (error "Uknown mail reader %s" toolbar-mail-reader))
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
109 (funcall (cdr command))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 ;; toolbar info variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (defvar toolbar-info-frame nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 "The frame in which info is displayed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 (defun toolbar-info ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 "Run info in a separate frame."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (if (or (not toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (not (frame-live-p toolbar-info-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (setq toolbar-info-frame (make-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 (select-frame toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 (raise-frame toolbar-info-frame)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 (if (frame-iconified-p toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 (deiconify-frame toolbar-info-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (select-frame toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 (raise-frame toolbar-info-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 (info))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 ;; toolbar debug variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 (defun toolbar-debug ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 (if (featurep 'eos-debugger)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 (call-interactively 'eos::start-debugger)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 (require 'gdbsrc)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (call-interactively 'gdbsrc))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (defvar compile-command)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (defun toolbar-compile ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 "Run compile without having to touch the keyboard."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 (require 'compile)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
151 (popup-dialog-box
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
152 `(,(concat "Compile:\n " compile-command)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
153 ["Compile" (compile compile-command) t]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
154 ["Edit command" compile t]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
155 nil
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
156 ["Cancel" (message "Quit") t])))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 ;; toolbar news variables and defuns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 (defvar toolbar-news-frame nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 "The frame in which news is displayed.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 76
diff changeset
165 (defvar toolbar-news-frame-properties nil
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 76
diff changeset
166 "The properties of the frame in which news is displayed.")
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 76
diff changeset
167
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (defun toolbar-news ()
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
169 "Run Gnus in a separate frame."
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (interactive)
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
171 (when (or (not toolbar-news-frame)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
172 (not (frame-live-p toolbar-news-frame)))
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 76
diff changeset
173 (setq toolbar-news-frame (make-frame toolbar-news-frame-properties))
76
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
174 (add-hook 'gnus-exit-gnus-hook
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
175 (lambda ()
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
176 (when (frame-live-p toolbar-news-frame)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
177 (if (cdr (frame-list))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
178 (delete-frame toolbar-news-frame))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
179 (setq toolbar-news-frame nil))))
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
180 (select-frame toolbar-news-frame)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
181 (raise-frame toolbar-news-frame)
c0c698873ce1 Import from CVS: tag r20-0b33
cvs
parents: 70
diff changeset
182 (gnus))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (if (frame-iconified-p toolbar-news-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (deiconify-frame toolbar-news-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 (select-frame toolbar-news-frame)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (raise-frame toolbar-news-frame))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (defvar toolbar-last-win-icon nil "A `last-win' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (defvar toolbar-next-win-icon nil "A `next-win' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (defvar toolbar-file-icon nil "A `file' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 (defvar toolbar-folder-icon nil "A `folder' icon set")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 (defvar toolbar-disk-icon nil "A `disk' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 (defvar toolbar-printer-icon nil "A `printer' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 (defvar toolbar-cut-icon nil "A `cut' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (defvar toolbar-copy-icon nil "A `copy' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 (defvar toolbar-paste-icon nil "A `paste' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (defvar toolbar-undo-icon nil "An `undo' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (defvar toolbar-spell-icon nil "A `spell' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (defvar toolbar-replace-icon nil "A `replace' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (defvar toolbar-mail-icon nil "A `mail' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (defvar toolbar-info-icon nil "An `info' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (defvar toolbar-compile-icon nil "A `compile' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 (defvar toolbar-debug-icon nil "A `debugger' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (defvar toolbar-news-icon nil "A `news' icon set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 ;;; each entry maps a variable to the prefix used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (defvar init-x-toolbar-list
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 '((toolbar-last-win-icon . "last-win")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 (toolbar-next-win-icon . "next-win")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 (toolbar-file-icon . "file")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (toolbar-folder-icon . "folder")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 (toolbar-disk-icon . "disk")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (toolbar-printer-icon . "printer")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (toolbar-cut-icon . "cut")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (toolbar-copy-icon . "copy")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (toolbar-paste-icon . "paste")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (toolbar-undo-icon . "undo")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (toolbar-spell-icon . "spell")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220 (toolbar-replace-icon . "replace")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 (toolbar-mail-icon . "mail")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (toolbar-info-icon . "info-def")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (toolbar-compile-icon . "compile")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (toolbar-debug-icon . "debug")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225 (toolbar-news-icon . "news")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 (defun init-x-toolbar ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 (mapcar
10
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
229 (lambda (cons)
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
230 (let ((prefix (expand-file-name (cdr cons) toolbar-icon-directory)))
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
231 (set (car cons)
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
232 (if (featurep 'xpm)
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
233 (toolbar-make-button-list
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
234 (concat prefix "-up.xpm")
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
235 nil
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
236 (concat prefix "-xx.xpm")
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
237 (concat prefix "-cap-up.xpm")
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
238 nil
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
239 (concat prefix "-cap-xx.xpm"))
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
240 (toolbar-make-button-list
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
241 (concat prefix "-up.xbm")
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
242 (concat prefix "-dn.xbm")
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
243 (concat prefix "-xx.xbm")
49a24b4fd526 Import from CVS: tag r19-15b6
cvs
parents: 4
diff changeset
244 )))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 init-x-toolbar-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 ;; do this now because errors will occur if the icon symbols
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 ;; are not initted
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (set-specifier default-toolbar initial-toolbar-spec))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 (defvar initial-toolbar-spec
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
251 '(;;[toolbar-last-win-icon pop-window-configuration
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
252 ;;(frame-property (selected-frame)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
253 ;; 'window-config-stack) t "Most recent window config"]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
254 ;; #### Illicit knowledge?
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
255 ;; #### These don't work right - not consistent!
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
256 ;; I don't know what's wrong; perhaps `selected-frame' is wrong
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
257 ;; sometimes when this is evaluated. Note that I even tried to
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
258 ;; kludge-fix this by calls to `set-specifier-dirty-flag' in
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
259 ;; pop-window-configuration and such.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
260
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
261 ;;[toolbar-next-win-icon unpop-window-configuration
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
262 ;;(frame-property (selected-frame)
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
263 ;; 'window-config-unpop-stack) t "Undo \"Most recent window config\""]
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
264 ;; #### Illicit knowledge?
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 22
diff changeset
265
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
266 [toolbar-file-icon toolbar-open t "Open a file" ]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
267 [toolbar-folder-icon toolbar-dired t "View directory"]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
268 [toolbar-disk-icon toolbar-save t "Save buffer" ]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
269 [toolbar-printer-icon toolbar-print t "Print buffer" ]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
270 [toolbar-cut-icon toolbar-cut t "Kill region"]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
271 [toolbar-copy-icon toolbar-copy t "Copy region"]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
272 [toolbar-paste-icon toolbar-paste t "Paste from clipboard"]
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
273 [toolbar-undo-icon toolbar-undo t "Undo edit" ]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 [toolbar-spell-icon toolbar-ispell t "Spellcheck" ]
88
821dec489c24 Import from CVS: tag r20-0
cvs
parents: 80
diff changeset
275 [toolbar-replace-icon toolbar-replace t "Replace text" ]
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 [toolbar-mail-icon toolbar-mail t "Mail" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 [toolbar-info-icon toolbar-info t "Information" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 [toolbar-compile-icon toolbar-compile t "Compile" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 [toolbar-debug-icon toolbar-debug t "Debug" ]
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 [toolbar-news-icon toolbar-news t "News" ])
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 "The initial toolbar for a buffer.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (defun x-init-toolbar-from-resources (locale)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (x-init-specifier-from-resources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 top-toolbar-height 'natnum locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 '("topToolBarHeight" . "TopToolBarHeight"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (x-init-specifier-from-resources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 bottom-toolbar-height 'natnum locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289 '("bottomToolBarHeight" . "BottomToolBarHeight"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 (x-init-specifier-from-resources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291 left-toolbar-width 'natnum locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 '("leftToolBarWidth" . "LeftToolBarWidth"))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 (x-init-specifier-from-resources
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294 right-toolbar-width 'natnum locale
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 '("rightToolBarWidth" . "RightToolBarWidth")))