Mercurial > hg > xemacs-beta
comparison lisp/w3/w3-toolbar.el @ 14:9ee227acff29 r19-15b90
Import from CVS: tag r19-15b90
author | cvs |
---|---|
date | Mon, 13 Aug 2007 08:48:42 +0200 |
parents | ac2d302a0011 |
children | 0293115a14e9 |
comparison
equal
deleted
inserted
replaced
13:13c6d0aaafe5 | 14:9ee227acff29 |
---|---|
1 ;;; w3-toolbar.el --- Toolbar functions for emacs-w3 | 1 ;;; w3-toolbar.el --- Toolbar functions for emacs-w3 |
2 ;; Author: wmperry | 2 ;; Author: wmperry |
3 ;; Created: 1996/06/30 18:12:43 | 3 ;; Created: 1996/12/30 16:04:40 |
4 ;; Version: 1.2 | 4 ;; Version: 1.6 |
5 ;; Keywords: mouse, toolbar | 5 ;; Keywords: mouse, toolbar |
6 | 6 |
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
8 ;;; Copyright (c) 1995, 1996 by William M. Perry (wmperry@cs.indiana.edu) | 8 ;;; Copyright (c) 1995, 1996 by William M. Perry (wmperry@cs.indiana.edu) |
9 ;;; Copyright (c) 1996 Free Software Foundation, Inc. | |
9 ;;; | 10 ;;; |
10 ;;; This file is part of GNU Emacs. | 11 ;;; This file is part of GNU Emacs. |
11 ;;; | 12 ;;; |
12 ;;; GNU Emacs is free software; you can redistribute it and/or modify | 13 ;;; 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 ;;; it under the terms of the GNU General Public License as published by |
18 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of | 19 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
19 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | 20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
20 ;;; GNU General Public License for more details. | 21 ;;; GNU General Public License for more details. |
21 ;;; | 22 ;;; |
22 ;;; You should have received a copy of the GNU General Public License | 23 ;;; 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 | 24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the |
24 ;;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | 25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
26 ;;; Boston, MA 02111-1307, USA. | |
25 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
26 | 28 |
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
28 ;;; Toolbar specific function for XEmacs 19.12+ | 30 ;;; Toolbar specific function for XEmacs 19.12+ |
29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | 31 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
30 (require 'xpm-button) | 32 (condition-case () |
31 (require 'xbm-button) | 33 (progn |
34 (require 'xpm-button) | |
35 (require 'xbm-button)) | |
36 (error nil)) | |
32 | 37 |
33 (defvar w3-toolbar-icon-directory nil "Where the toolbar icons for w3 are.") | 38 (defvar w3-toolbar-icon-directory nil "Where the toolbar icons for w3 are.") |
34 (defvar w3-toolbar-back-icon nil "Toolbar icon for back") | 39 (defvar w3-toolbar-back-icon nil "Toolbar icon for back") |
35 (defvar w3-toolbar-forw-icon nil "Toolbar icon for forward") | 40 (defvar w3-toolbar-forw-icon nil "Toolbar icon for forward") |
36 (defvar w3-toolbar-home-icon nil "Toolbar icon for home") | 41 (defvar w3-toolbar-home-icon nil "Toolbar icon for home") |
168 (t | 173 (t |
169 (w3-toolbar-make-picture-buttons)))) | 174 (w3-toolbar-make-picture-buttons)))) |
170 | 175 |
171 (defun w3-link-is-defined (rel &optional rev) | 176 (defun w3-link-is-defined (rel &optional rev) |
172 (or | 177 (or |
173 (cdr-safe (assoc rel (cdr-safe (assoc "Parent of" w3-current-links)))) | 178 (cdr-safe (assoc rel (cdr-safe (assq 'rel w3-current-links)))) |
174 (cdr-safe (assoc (or rev rel) (cdr-safe (assoc "Child of" | 179 (cdr-safe (assoc (or rev rel) (cdr-safe (assq 'rev w3-current-links)))))) |
175 w3-current-links)))))) | |
176 | 180 |
177 ;; Need to create w3-toolbar-glos-icon | 181 ;; Need to create w3-toolbar-glos-icon |
178 ;; w3-toolbar-toc-icon | 182 ;; w3-toolbar-toc-icon |
179 ;; w3-toolbar-copy-icon | 183 ;; w3-toolbar-copy-icon |
180 (defvar w3-link-toolbar | 184 (defvar w3-link-toolbar |
286 (let* ((w3-toolbar-orientation w3-link-toolbar-orientation) | 290 (let* ((w3-toolbar-orientation w3-link-toolbar-orientation) |
287 (toolbar (w3-toolbar-from-orientation w3-toolbar-orientation))) | 291 (toolbar (w3-toolbar-from-orientation w3-toolbar-orientation))) |
288 (if toolbar | 292 (if toolbar |
289 (if (w3-toolbar-active) | 293 (if (w3-toolbar-active) |
290 (set-specifier toolbar (cons (current-buffer) nil)) | 294 (set-specifier toolbar (cons (current-buffer) nil)) |
291 (set-specifier toolbar (cons (current-buffer) w3-link-toolbar)))))) | 295 (set-specifier toolbar w3-link-toolbar (current-buffer)))))) |
292 | 296 |
293 (defun w3-toggle-toolbar () | 297 (defun w3-toggle-toolbar () |
294 (interactive) | 298 (interactive) |
295 (if (eq major-mode 'w3-mode) | 299 (if (eq major-mode 'w3-mode) |
296 (let ((toolbar (w3-toolbar-from-orientation w3-toolbar-orientation))) | 300 (let ((toolbar (w3-toolbar-from-orientation w3-toolbar-orientation))) |