Mercurial > emacs
annotate lisp/ezimage.el @ 94902:bf4ea3254629
*** empty log message ***
author | Jay Belanger <jay.p.belanger@gmail.com> |
---|---|
date | Tue, 13 May 2008 19:12:56 +0000 |
parents | ee5932bf781d |
children | a2ec715aefb4 |
rev | line source |
---|---|
65752
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
1 ;;; ezimage --- Generalized Image management |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
2 |
68651
3bd95f4f2941
Update years in copyright notice; nfc.
Thien-Thi Nguyen <ttn@gnuvola.org>
parents:
68562
diff
changeset
|
3 ;; Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, |
79721 | 4 ;; 2005, 2006, 2007, 2008 Free Software Foundation, Inc. |
65752
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
5 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
6 ;; Author: Eric M. Ludlam <zappo@gnu.org> |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
7 ;; Keywords: file, tags, tools |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
8 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
9 ;; This file is part of GNU Emacs. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
10 |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
79721
diff
changeset
|
11 ;; GNU Emacs is free software: you can redistribute it and/or modify |
65752
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
12 ;; it under the terms of the GNU General Public License as published by |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
79721
diff
changeset
|
13 ;; the Free Software Foundation, either version 3 of the License, or |
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
79721
diff
changeset
|
14 ;; (at your option) any later version. |
65752
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
15 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
16 ;; GNU Emacs is distributed in the hope that it will be useful, |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
19 ;; GNU General Public License for more details. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
20 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
21 ;; You should have received a copy of the GNU General Public License |
94678
ee5932bf781d
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
79721
diff
changeset
|
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. |
65752
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
23 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
24 ;;; Commentary: |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
25 ;; |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
26 ;; A few routines for placing an image over text that will work for any |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
27 ;; Emacs implementation without error. When images are not supported, then |
72966 | 28 ;; they are just not displayed. |
65752
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
29 ;; |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
30 ;; The idea is that gui buffers (trees, buttons, etc) will have text |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
31 ;; representations of the GUI elements. These routines will replace the text |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
32 ;; with an image when images are available. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
33 ;; |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
34 ;; This file requires the `image' package if it is available. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
35 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
36 (condition-case nil |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
37 (require 'image) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
38 (error nil)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
39 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
40 ;;; Code: |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
41 (defcustom ezimage-use-images |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
42 (and (or (fboundp 'defimage) ; emacs 21 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
43 (fboundp 'make-image-specifier)) ; xemacs |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
44 (if (fboundp 'display-graphic-p) ; emacs 21 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
45 (display-graphic-p) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
46 window-system) ; old emacs & xemacs |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
47 (or (not (fboundp 'image-type-available-p)) ; xemacs? |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
48 (image-type-available-p 'xpm))) ; emacs 21 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
49 "*Non-nil if ezimage should display icons." |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
50 :group 'ezimage |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
51 :version "21.1" |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
52 :type 'boolean) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
53 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
54 ;;; Create our own version of defimage |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
55 (eval-and-compile |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
56 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
57 (if (fboundp 'defimage) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
58 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
59 (progn |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
60 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
61 (defmacro defezimage (variable imagespec docstring) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
62 "Define VARIABLE as an image if `defimage' is not available. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
63 IMAGESPEC is the image data, and DOCSTRING is documentation for the image." |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
64 `(progn |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
65 (defimage ,variable ,imagespec ,docstring) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
66 (put (quote ,variable) 'ezimage t))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
67 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
68 ; (defalias 'defezimage 'defimage) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
69 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
70 ;; This hack is for the ezimage install which has an icons direcory for |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
71 ;; the default icons to be used. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
72 ;; (add-to-list 'load-path |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
73 ;; (concat (file-name-directory |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
74 ;; (locate-library "ezimage.el")) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
75 ;; "icons")) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
76 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
77 ) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
78 (if (not (fboundp 'make-glyph)) |
68562
26cf94e56f83
(ezimage-mail, ezimage-object-out-of-date, ezimage-insert-image-button-maybe,
Juanma Barranquero <lekktu@gmail.com>
parents:
66608
diff
changeset
|
79 |
65752
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
80 (defmacro defezimage (variable imagespec docstring) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
81 "Don't bother loading up an image... |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
82 Argument VARIABLE is the variable to define. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
83 Argument IMAGESPEC is the list defining the image to create. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
84 Argument DOCSTRING is the documentation for VARIABLE." |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
85 `(defvar ,variable nil ,docstring)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
86 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
87 ;; ELSE |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
88 (with-no-warnings |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
89 (defun ezimage-find-image-on-load-path (image) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
90 "Find the image file IMAGE on the load path." |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
91 (let ((l (cons |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
92 ;; In XEmacs, try the data directory first (for an |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
93 ;; install in XEmacs proper.) Search the load |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
94 ;; path next (for user installs) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
95 (locate-data-directory "ezimage") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
96 load-path)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
97 (r nil)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
98 (while (and l (not r)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
99 (if (file-exists-p (concat (car l) "/" image)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
100 (setq r (concat (car l) "/" image)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
101 (if (file-exists-p (concat (car l) "/icons/" image)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
102 (setq r (concat (car l) "/icons/" image)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
103 )) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
104 (setq l (cdr l))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
105 r)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
106 );with-no-warnings |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
107 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
108 (with-no-warnings |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
109 (defun ezimage-convert-emacs21-imagespec-to-xemacs (spec) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
110 "Convert the Emacs21 image SPEC into an XEmacs image spec. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
111 The Emacs 21 spec is what I first learned, and is easy to convert." |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
112 (let* ((sl (car spec)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
113 (itype (nth 1 sl)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
114 (ifile (nth 3 sl))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
115 (vector itype ':file (ezimage-find-image-on-load-path ifile)))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
116 );with-no-warnings |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
117 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
118 (defmacro defezimage (variable imagespec docstring) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
119 "Define VARIABLE as an image if `defimage' is not available. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
120 IMAGESPEC is the image data, and DOCSTRING is documentation for the image." |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
121 `(progn |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
122 (defvar ,variable |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
123 ;; The Emacs21 version of defimage looks just like the XEmacs image |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
124 ;; specifier, except that it needs a :type keyword. If we line |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
125 ;; stuff up right, we can use this cheat to support XEmacs specifiers. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
126 (condition-case nil |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
127 (make-glyph |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
128 (make-image-specifier |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
129 (ezimage-convert-emacs21-imagespec-to-xemacs (quote ,imagespec))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
130 'buffer) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
131 (error nil)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
132 ,docstring) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
133 (put ',variable 'ezimage t))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
134 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
135 ))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
136 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
137 (defezimage ezimage-directory |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
138 ((:type xpm :file "ezimage/dir.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
139 "Image used for empty directories.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
140 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
141 (defezimage ezimage-directory-plus |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
142 ((:type xpm :file "ezimage/dir-plus.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
143 "Image used for closed directories with stuff in them.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
144 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
145 (defezimage ezimage-directory-minus |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
146 ((:type xpm :file "ezimage/dir-minus.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
147 "Image used for open directories with stuff in them.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
148 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
149 (defezimage ezimage-page-plus |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
150 ((:type xpm :file "ezimage/page-plus.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
151 "Image used for closed files with stuff in them.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
152 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
153 (defezimage ezimage-page-minus |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
154 ((:type xpm :file "ezimage/page-minus.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
155 "Image used for open files with stuff in them.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
156 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
157 (defezimage ezimage-page |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
158 ((:type xpm :file "ezimage/page.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
159 "Image used for files with nothing interesting in it.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
160 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
161 (defezimage ezimage-tag |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
162 ((:type xpm :file "ezimage/tag.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
163 "Image used for tags.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
164 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
165 (defezimage ezimage-tag-plus |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
166 ((:type xpm :file "ezimage/tag-plus.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
167 "Image used for closed tag groups.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
168 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
169 (defezimage ezimage-tag-minus |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
170 ((:type xpm :file "ezimage/tag-minus.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
171 "Image used for open tags.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
172 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
173 (defezimage ezimage-tag-gt |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
174 ((:type xpm :file "ezimage/tag-gt.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
175 "Image used for closed tags (with twist arrow).") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
176 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
177 (defezimage ezimage-tag-v |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
178 ((:type xpm :file "ezimage/tag-v.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
179 "Image used for open tags (with twist arrow).") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
180 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
181 (defezimage ezimage-tag-type |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
182 ((:type xpm :file "ezimage/tag-type.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
183 "Image used for tags that represent a data type.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
184 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
185 (defezimage ezimage-box-plus |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
186 ((:type xpm :file "ezimage/box-plus.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
187 "Image of a closed box.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
188 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
189 (defezimage ezimage-box-minus |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
190 ((:type xpm :file "ezimage/box-minus.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
191 "Image of an open box.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
192 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
193 (defezimage ezimage-mail |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
194 ((:type xpm :file "ezimage/mail.xpm" :ascent center)) |
68562
26cf94e56f83
(ezimage-mail, ezimage-object-out-of-date, ezimage-insert-image-button-maybe,
Juanma Barranquero <lekktu@gmail.com>
parents:
66608
diff
changeset
|
195 "Image of an envelope.") |
65752
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
196 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
197 (defezimage ezimage-checkout |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
198 ((:type xpm :file "ezimage/checkmark.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
199 "Image representing a checkmark. For files checked out of a VC.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
200 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
201 (defezimage ezimage-object |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
202 ((:type xpm :file "ezimage/bits.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
203 "Image representing bits (an object file.)") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
204 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
205 (defezimage ezimage-object-out-of-date |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
206 ((:type xpm :file "ezimage/bitsbang.xpm" :ascent center)) |
68562
26cf94e56f83
(ezimage-mail, ezimage-object-out-of-date, ezimage-insert-image-button-maybe,
Juanma Barranquero <lekktu@gmail.com>
parents:
66608
diff
changeset
|
207 "Image representing bits with a ! in it. (An out of data object file.)") |
65752
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
208 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
209 (defezimage ezimage-label |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
210 ((:type xpm :file "ezimage/label.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
211 "Image used for label prefix.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
212 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
213 (defezimage ezimage-lock |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
214 ((:type xpm :file "ezimage/lock.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
215 "Image of a lock. Used for Read Only, or private.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
216 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
217 (defezimage ezimage-unlock |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
218 ((:type xpm :file "ezimage/unlock.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
219 "Image of an unlocked lock.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
220 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
221 (defezimage ezimage-key |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
222 ((:type xpm :file "ezimage/key.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
223 "Image of a key.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
224 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
225 (defezimage ezimage-document-tag |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
226 ((:type xpm :file "ezimage/doc.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
227 "Image used to indicate documentation available.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
228 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
229 (defezimage ezimage-document-plus |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
230 ((:type xpm :file "ezimage/doc-plus.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
231 "Image used to indicate closed documentation.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
232 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
233 (defezimage ezimage-document-minus |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
234 ((:type xpm :file "ezimage/doc-minus.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
235 "Image used to indicate open documentation.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
236 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
237 (defezimage ezimage-info-tag |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
238 ((:type xpm :file "ezimage/info.xpm" :ascent center)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
239 "Image used to indicate more information available.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
240 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
241 (defvar ezimage-expand-image-button-alist |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
242 '( |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
243 ;; here are some standard representations |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
244 ("<+>" . ezimage-directory-plus) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
245 ("<->" . ezimage-directory-minus) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
246 ("< >" . ezimage-directory) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
247 ("[+]" . ezimage-page-plus) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
248 ("[-]" . ezimage-page-minus) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
249 ("[?]" . ezimage-page) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
250 ("[ ]" . ezimage-page) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
251 ("{+}" . ezimage-box-plus) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
252 ("{-}" . ezimage-box-minus) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
253 ;; Some vaguely representitive entries |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
254 ("*" . ezimage-checkout) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
255 ("#" . ezimage-object) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
256 ("!" . ezimage-object-out-of-date) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
257 ("%" . ezimage-lock) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
258 ) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
259 "List of text and image associations.") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
260 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
261 (defun ezimage-insert-image-button-maybe (start length &optional string) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
262 "Insert an image button based on text starting at START for LENGTH chars. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
263 If buttontext is unknown, just insert that text. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
264 If we have an image associated with it, use that image. |
68562
26cf94e56f83
(ezimage-mail, ezimage-object-out-of-date, ezimage-insert-image-button-maybe,
Juanma Barranquero <lekktu@gmail.com>
parents:
66608
diff
changeset
|
265 Optional argument STRING is a string upon which to add text properties." |
65752
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
266 (when ezimage-use-images |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
267 (let* ((bt (buffer-substring start (+ length start))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
268 (a (assoc bt ezimage-expand-image-button-alist))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
269 ;; Regular images (created with `insert-image' are intangible |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
270 ;; which (I suppose) make them more compatible with XEmacs 21. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
271 ;; Unfortunatly, there is a giant pile o code dependent on the |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
272 ;; underlying text. This means if we leave it tangible, then I |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
273 ;; don't have to change said giant piles o code. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
274 (if (and a (symbol-value (cdr a))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
275 (ezimage-insert-over-text (symbol-value (cdr a)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
276 start |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
277 (+ start (length bt)))))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
278 string) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
279 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
280 (defun ezimage-image-over-string (string &optional alist) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
281 "Insert over the text in STRING an image found in ALIST. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
282 Return STRING with properties applied." |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
283 (if ezimage-use-images |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
284 (let ((a (assoc string alist))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
285 (if (and a (symbol-value (cdr a))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
286 (ezimage-insert-over-text (symbol-value (cdr a)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
287 0 (length string) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
288 string) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
289 string)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
290 string)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
291 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
292 (defun ezimage-insert-over-text (image start end &optional string) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
293 "Place IMAGE over the text between START and END. |
68562
26cf94e56f83
(ezimage-mail, ezimage-object-out-of-date, ezimage-insert-image-button-maybe,
Juanma Barranquero <lekktu@gmail.com>
parents:
66608
diff
changeset
|
294 Assumes the image is part of a GUI and can be clicked on. |
65752
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
295 Optional argument STRING is a string upon which to add text properties." |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
296 (when ezimage-use-images |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
297 (if (featurep 'xemacs) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
298 (add-text-properties start end |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
299 (list 'end-glyph image |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
300 'rear-nonsticky (list 'display) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
301 'invisible t |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
302 'detachable t) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
303 string) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
304 (add-text-properties start end |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
305 (list 'display image |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
306 'rear-nonsticky (list 'display)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
307 string))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
308 string) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
309 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
310 (defun ezimage-image-association-dump () |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
311 "Dump out the current state of the Ezimage image alist. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
312 See `ezimage-expand-image-button-alist' for details." |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
313 (interactive) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
314 (with-output-to-temp-buffer "*Ezimage Images*" |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
315 (save-excursion |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
316 (set-buffer "*Ezimage Images*") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
317 (goto-char (point-max)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
318 (insert "Ezimage image cache.\n\n") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
319 (let ((start (point)) (end nil)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
320 (insert "Image\tText\tImage Name") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
321 (setq end (point)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
322 (insert "\n") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
323 (put-text-property start end 'face 'underline)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
324 (let ((ia ezimage-expand-image-button-alist)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
325 (while ia |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
326 (let ((start (point))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
327 (insert (car (car ia))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
328 (insert "\t") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
329 (ezimage-insert-image-button-maybe start |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
330 (length (car (car ia)))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
331 (insert (car (car ia)) "\t" (format "%s" (cdr (car ia))) "\n")) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
332 (setq ia (cdr ia))))))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
333 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
334 (defun ezimage-image-dump () |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
335 "Dump out the current state of the Ezimage image alist. |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
336 See `ezimage-expand-image-button-alist' for details." |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
337 (interactive) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
338 (with-output-to-temp-buffer "*Ezimage Images*" |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
339 (save-excursion |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
340 (set-buffer "*Ezimage Images*") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
341 (goto-char (point-max)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
342 (insert "Ezimage image cache.\n\n") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
343 (let ((start (point)) (end nil)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
344 (insert "Image\tImage Name") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
345 (setq end (point)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
346 (insert "\n") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
347 (put-text-property start end 'face 'underline)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
348 (let ((ia (ezimage-all-images))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
349 (while ia |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
350 (let ((start (point))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
351 (insert "cm") |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
352 (ezimage-insert-over-text (symbol-value (car ia)) start (point)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
353 (insert "\t" (format "%s" (car ia)) "\n")) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
354 (setq ia (cdr ia))))))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
355 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
356 (defun ezimage-all-images () |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
357 "Return a list of all variables containing ez images." |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
358 (let ((ans nil)) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
359 (mapatoms (lambda (sym) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
360 (if (get sym 'ezimage) (setq ans (cons sym ans)))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
361 ) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
362 (setq ans (sort ans (lambda (a b) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
363 (string< (symbol-name a) (symbol-name b))))) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
364 ans) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
365 ) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
366 |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
367 (provide 'ezimage) |
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
368 |
65779 | 369 ;; arch-tag: d4ea2d93-3c7a-4cb3-b5a6-c1b9178183aa |
65752
12e5c2513853
* speedbar.el: New version 1.0pre3.
Chong Yidong <cyd@stupidchicken.com>
parents:
diff
changeset
|
370 ;;; sb-image.el ends here |