annotate lisp/w3/w3-widget.el @ 123:c77884c6318d

Added tag r20-1b14 for changeset d2f30a177268
author cvs
date Mon, 13 Aug 2007 09:26:04 +0200
parents cca96a509cfe
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
1 ;;; w3-widget.el --- An image widget
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 ;; Author: wmperry
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 116
diff changeset
3 ;; Created: 1997/04/07 16:00:02
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 116
diff changeset
4 ;; Version: 1.28
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
5 ;; Keywords: faces, images
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
8 ;;; Copyright (c) 1993 - 1996 by William M. Perry (wmperry@cs.indiana.edu)
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
9 ;;; Copyright (c) 1996, 1997 Free Software Foundation, Inc.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;;;
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
11 ;;; This file is part of GNU Emacs.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 ;;; GNU Emacs is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 ;;; GNU Emacs is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;;; You should have received a copy of the GNU General Public License
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
24 ;;; along with GNU Emacs; see the file COPYING. If not, write to the
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
25 ;;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
26 ;;; Boston, MA 02111-1307, USA.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;; This is a widget that will do the best it can with an image.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;;; It can handle all the common occurences of images on the world wide web
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;;; 1. A plain image - displays either a glyph of the image, or the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;;; alternative text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 ;;; 2. A hyperlinked image - an image that is also a hypertext link to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;;; another page. Displays either a glyph of the image, or the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;;; alternative text. When activated with the mouse or the keyboard,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;;; the 'href' property of the widget is retrieved.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;;; 3. Server side imagemaps - an image that has hotzones that lead to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 ;;; different areas. Unfortunately, we cannot tell where the links go
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 ;;; from the client - all processing is done by the server. Displays
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 ;;; either a glyph of the image, or the alternative text. When activated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;;; with the mouse or the keyboard, the coordinates clicked on are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;;; sent to the remote server as HREF?x,y. If the link is activated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;;; by the keyboard, then 0,0 are sent as the coordinates.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;;; 4. Client side imagemaps - an image that has hotzones that lead to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;;; different areas. All processing is done on the client side, so
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;;; we can actually show a decent representation on a TTY. Displays
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 ;;; either a glyph of the image, or a drop-down-list of the destinations
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;;; These are either URLs (http://foo/...) or alternative text.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 (require 'cl)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 (require 'widget)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
56 (defvar widget-image-keymap (make-sparse-keymap)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 "Keymap used over glyphs in an image widget")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
59 (define-widget-keywords :tab-order)
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
60
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
61 (defconst widget-mouse-button1 nil)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
62 (defconst widget-mouse-button2 nil)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
63 (defconst widget-mouse-button3 nil)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
64
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
65 (if (string-match "XEmacs" (emacs-version))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
66 (if (featurep 'mouse)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
67 (setq widget-mouse-button1 'button1
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
68 widget-mouse-button2 'button2
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
69 widget-mouse-button3 'button3)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
70 (setq widget-mouse-button1 'return
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
71 widget-mouse-button2 'return
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
72 widget-mouse-button3 'return))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
73 (setq widget-mouse-button1 'mouse-1
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
74 widget-mouse-button2 'mouse-2
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
75 widget-mouse-button3 'mouse-3))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
76
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
77 (defvar widget-image-inaudible-p nil
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
78 "*Whether to make images inaudible or not.")
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
79
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
80 (define-key widget-image-keymap (vector widget-mouse-button1)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
81 'widget-image-button-press)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
82 (define-key widget-image-keymap (vector widget-mouse-button2)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
83 'widget-image-button-press)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 (define-widget 'image 'default
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 "A fairly complex image widget."
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
87 :convert-widget 'widget-image-convert
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 :value-to-internal (lambda (widget value) value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 :value-to-external (lambda (widget value) value)
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
90 :value-set 'widget-image-value-set
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
91 :create 'widget-image-create
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
92 :delete 'widget-image-delete
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
93 :value-create 'widget-image-value-create
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
94 :value-delete 'widget-image-value-delete
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
95 :value-get 'widget-image-value-get
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
96 :notify 'widget-image-notify
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
99 (defun widget-image-convert (widget)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 (let ((args (widget-get widget :args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 (widget-put widget :args nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 (while args
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 (widget-put widget (car args) (cadr args))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 (setq args (cddr args)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 widget))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
107 (defun widget-image-value-get (widget)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 (let ((children (widget-get widget :children)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (and (car children)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 (widget-apply (car children) :value-get))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
112 (defun widget-image-create (widget)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 ;; Create an image widget at point in the current buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 (let ((where (widget-get widget 'where)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 ((null where)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 (setq where (set-marker (make-marker) (point))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 ((markerp where)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 ((integerp where)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 (setq where (set-marker (make-marker) where)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122 (t
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
123 (error "IMPOSSIBLE position in widget-image-create: %s" where)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 (widget-put widget 'where where))
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
125 (widget-image-value-create widget))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
127 (defun widget-image-value-set (widget value)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 ;; Recreate widget with new value.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 (save-excursion
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
130 (widget-image-delete widget)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
131 (if (widget-glyphp value)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 (widget-put widget 'glyph value)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 (widget-put widget :value value))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
134 (put-text-property (point)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
135 (progn
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
136 (widget-apply widget :create)
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
137 (point))
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
138 'inaudible
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
139 widget-image-inaudible-p)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
141 (defsubst widget-image-usemap (widget)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 (let ((usemap (widget-get widget 'usemap)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 (if (listp usemap)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 usemap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 (if (and usemap (string-match "^#" usemap))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146 (setq usemap (substring usemap 1 nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 (cdr-safe (assoc usemap w3-imagemaps)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
149 (defun widget-image-callback (widget widget-ignore &optional event)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
150 (if (widget-get widget 'href)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
151 (w3-fetch (widget-get widget 'href) (widget-get widget 'target))))
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
152
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
153 (defmacro widget-image-create-subwidget (&rest args)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
154 (` (widget-create (,@ args)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
155 :parent widget
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
156 :help-echo 'widget-image-summarize
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
157 'usemap (widget-get widget 'usemap)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
158 'href href
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
159 'src (widget-get widget 'src)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
160 'ismap server-map)))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
161
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
162 (defun widget-image-value-create (widget)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163 ;; Insert the printed representation of the value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 (let (
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 (href (widget-get widget 'href))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 (server-map (widget-get widget 'ismap))
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
167 (client-map (widget-image-usemap widget))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 (where (or (widget-get widget 'where) (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 (glyph (widget-get widget 'glyph))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 (alt (widget-get widget 'alt))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 (real-widget nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 (invalid-glyph nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ;; Specifier-instance will signal an error if we have an invalid
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 ;; image specifier, which would be the case if we get screwed up
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 ;; data back from a URL somewhere.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 (setq invalid-glyph (and glyph (condition-case ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 (if (specifier-instance
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 (glyph-image glyph))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 nil)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 (error t))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 (if (or (not glyph) invalid-glyph)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 ;; Do a TTY or delayed image version of the image.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 (if (= 0 (length alt)) (setq alt nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 (goto-char where)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 (client-map
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
191 (let* ((default nil)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
192 (options (mapcar
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
193 (function
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
194 (lambda (x)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
195 (if (eq (aref x 0) 'default)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
196 (setq default (aref x 2)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
197 (if (and (not default) (stringp (aref x 2)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
198 (setq default (aref x 2)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
199 (list 'choice-item
120
cca96a509cfe Import from CVS: tag r20-1b12
cvs
parents: 116
diff changeset
200 :tab-order -1
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
201 :format "%[%t%]"
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
202 :tag (or (aref x 3) (aref x 2))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
203 :value (aref x 2)))) client-map)))
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
204 (setq real-widget
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
205 (apply 'widget-create 'menu-choice
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
206 :tag (or (widget-get widget :tag) "Imagemap")
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
207 :ignore-case t
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
208 :notify (widget-get widget :notify)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
209 :action (widget-get widget :action)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
210 :value default
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
211 :parent widget
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
212 :help-echo 'widget-image-summarize
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
213 options))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 ((and server-map (stringp href))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (setq real-widget
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
216 (widget-image-create-subwidget
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
217 'item :format "%[%t%]"
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
218 :tag alt
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
219 :delete 'widget-default-delete
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
220 :value href
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
221 :action (widget-get widget :action)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
222 :notify (widget-get widget :notify))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (href
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (setq real-widget
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
225 (widget-image-create-subwidget
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
226 'item :format "%[%t%]"
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
227 :tag (or alt "Image")
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
228 :value href
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
229 :delete 'widget-default-delete
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
230 :action (widget-get widget :action)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
231 :notify 'widget-image-callback)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 (alt
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
233 (setq real-widget
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
234 (widget-image-create-subwidget
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
235 'item :format "%[%t%]"
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
236 :tag alt
110
fe104dbd9147 Import from CVS: tag r20-1b7
cvs
parents: 108
diff changeset
237 :tab-order -1
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
238 :delete 'widget-default-delete
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
239 :action (widget-get widget :action)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
240 :notify 'widget-image-callback))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 (if (not real-widget)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 (widget-put widget :children (list real-widget))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ;;; Actually use the image
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 (let ((extent (or (widget-get widget 'extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 (make-extent where where))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 (set-extent-endpoints extent where where)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 (widget-put widget 'extent extent)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 (widget-put widget :children nil)
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
250 (set-extent-property extent 'keymap widget-image-keymap)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 (set-extent-property extent 'begin-glyph glyph)
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
252 (set-extent-property extent 'detachable t)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 (set-extent-property extent 'help-echo (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 ((and href (or client-map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 server-map))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 (format "%s [map]" href))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 (href href)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 (t nil)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 (set-glyph-property glyph 'widget widget)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
261 (defun widget-image-delete (widget)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 ;; Remove the widget from the buffer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 (let ((extent (widget-get widget 'extent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 (child (car (widget-get widget :children))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266 (extent ; Remove a glyph
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 (delete-extent extent))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 (child ; Remove a child widget
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 (widget-apply child :delete))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 (t ; Doh! Do nothing.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (if (fboundp 'mouse-event-p)
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
274 (fset 'widget-mouse-event-p 'mouse-event-p)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
275 (fset 'widget-mouse-event-p 'ignore))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (if (fboundp 'glyphp)
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
278 (fset 'widget-glyphp 'glyphp)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
279 (fset 'widget-glyphp 'ignore))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
281 (defun widget-image-button-press (event)
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 46
diff changeset
282 (interactive "@e")
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
283 (let* ((glyph (and event (widget-mouse-event-p event) (event-glyph event)))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 46
diff changeset
284 (widget (and glyph (glyph-property glyph 'widget))))
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
285 (widget-image-notify widget widget event)))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
286
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
287 (defun widget-image-usemap-default (usemap)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
288 (let ((rval (and usemap (car usemap))))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
289 (while usemap
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
290 (if (equal (aref (car usemap) 0) "default")
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
291 (setq rval (car usemap)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
292 usemap nil))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
293 (setq usemap (cdr usemap)))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
294 rval))
14
9ee227acff29 Import from CVS: tag r19-15b90
cvs
parents: 2
diff changeset
295
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
296 (defun widget-image-summarize (widget)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
297 (if (widget-get widget :parent)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
298 (setq widget (widget-get widget :parent)))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
299 (let* ((ismap (widget-get widget 'ismap))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
300 (usemap (widget-image-usemap widget))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
301 (href (widget-get widget 'href))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
302 (alt (widget-get widget 'alt))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
303 (value (widget-value widget)))
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
304 (cond
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
305 (usemap
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
306 (setq usemap (widget-image-usemap-default usemap))
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
307 ;; Perhaps we should do something here with showing the # of entries
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
308 ;; in the imagemap as well as the default href? Could get too long.
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
309 (format "Client side imagemap: %s" value))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
310 (ismap
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
311 (format "Server side imagemap: %s" href))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
312 ((stringp href) ; Normal hyperlink
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
313 (format "Image hyperlink: %s" href))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
314 ((stringp alt) ; Alternate message was specified
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
315 (format "Image: %s" alt))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
316 ((stringp value)
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
317 (format "Image: %s" value))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
318 (t ; Huh?
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
319 "A very confused image widget."))))
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
320
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
321 (defvar widget-image-auto-retrieve 'ask
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
322 "*Whether to automatically retrieve the source of an image widget
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
323 if it is not an active hyperlink or imagemap.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
324 If `nil', don't do anything.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
325 If `t', automatically retrieve the source.
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
326 Any other value means ask the user each time.")
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
327
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
328 (defun widget-image-notify (widget widget-changed &optional event)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 ;; Happens when anything changes
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
330 (let* ((glyph (and event (widget-mouse-event-p event) (event-glyph event)))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331 (x (and glyph (event-glyph-x-pixel event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332 (y (and glyph (event-glyph-y-pixel event)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333 (ismap (widget-get widget 'ismap))
80
1ce6082ce73f Import from CVS: tag r20-0b90
cvs
parents: 70
diff changeset
334 (usemap (widget-image-usemap widget))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335 (href (widget-get widget 'href))
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
336 (img-src (or (widget-get widget 'src)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
337 (and widget-changed (widget-get widget-changed 'src))))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
338 (target (widget-get widget 'target))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 (cond
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 ((and glyph usemap) ; Do the client-side imagemap stuff
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 (setq href (w3-point-in-map (vector x y) usemap nil))
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
343 (if (stringp href)
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
344 (w3-fetch href target)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 (message "No destination found for %d,%d" x y)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 ((and glyph x y ismap) ; Do the server-side imagemap stuff
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
347 (w3-fetch (format "%s?%d,%d" href x y) target))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 (usemap ; Dummed-down tty client side imap
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
349 (let ((choices (mapcar (function
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
350 (lambda (entry)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
351 (cons
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
352 (or (aref entry 3) (aref entry 2))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 82
diff changeset
353 (aref entry 2)))) usemap))
116
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
354 (choice nil)
9f59509498e1 Import from CVS: tag r20-1b10
cvs
parents: 110
diff changeset
355 (case-fold-search t))
98
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 82
diff changeset
356 (setq choice (completing-read "Imagemap: " choices nil t)
0d2f883870bc Import from CVS: tag r20-1b1
cvs
parents: 82
diff changeset
357 choice (cdr-safe (assoc choice choices)))
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
358 (and (stringp choice) (w3-fetch choice target))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (ismap ; Do server-side dummy imagemap for tty
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
360 (w3-fetch (concat href "?0,0") target))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 ((stringp href) ; Normal hyperlink
108
360340f9fd5f Import from CVS: tag r20-1b6
cvs
parents: 98
diff changeset
362 (w3-fetch href target))
82
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
363 ((stringp img-src)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
364 (cond
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
365 ((null widget-image-auto-retrieve) nil)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
366 ((eq t widget-image-auto-retrieve)
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
367 (w3-fetch img-src))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
368 ((funcall url-confirmation-func
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
369 (format "Retrieve image (%s)?"
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
370 (url-truncate-url-for-viewing img-src)))
6a378aca36af Import from CVS: tag r20-0b91
cvs
parents: 80
diff changeset
371 (w3-fetch img-src))))
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 (t ; Huh?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373 nil))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 (provide 'w3-widget)