annotate lisp/glyphs.el @ 4226:9b4442ac18c7

[xemacs-hg @ 2007-10-15 09:55:43 by didierv] Fix image specifiers related bugs
author didierv
date Mon, 15 Oct 2007 09:55:50 +0000
parents fd1acd2f457a
children 6a17ac5da3c4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 ;;; glyphs.el --- Lisp interface to C glyphs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 ;; Copyright (C) 1994, 1997 Free Software Foundation, Inc.
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
4 ;; Copyright (C) 1995, 1996, 2000, 2005 Ben Wing.
4226
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
5 ;; Copyright (C) 2007 Didier Verna
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 ;; Author: Chuck Thompson <cthomp@cs.uiuc.edu>, Ben Wing <ben@xemacs.org>
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 ;; Maintainer: XEmacs Development Team
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9 ;; Keywords: extensions, internal, dumped
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11 ;; This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ;; XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 ;; under the terms of the GNU General Public License as published by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 ;; the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16 ;; any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 ;; XEmacs is distributed in the hope that it will be useful, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 ;; General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 ;; You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 ;; along with XEmacs; see the file COPYING. If not, write to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 ;; Free Software Foundation, 59 Temple Place - Suite 330,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26 ;; Boston, MA 02111-1307, USA.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 ;;; Synched up with: Not in FSF.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
30 ;;; Authorship:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
31
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
32 ;; Prototype created 1995 by Chuck Thompson.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
33 ;; Completely rewritten by Ben Wing, 1995.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
34 ;; Various cleanups (esp. doc strings) by Ben Wing, May 2000.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
35
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 ;;; Commentary:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 ;; This file is dumped with XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 ;;; Code:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
42 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; image specifiers
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44 (defun make-image-specifier (spec-list)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 "Return a new `image' specifier object with the specification list SPEC-LIST.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 SPEC-LIST can be a list of specifications (each of which is a cons of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 locale and a list of instantiators), a single instantiator, or a list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 of instantiators. See `make-specifier' for more information about
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
49 specifiers.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
50
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
51 The main purpose of this doc string is to describe the possible formats for
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
52 image instantiators, as given as an argument to `make-glyph' or
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
53 `set-glyph-image'.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
54
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
55 An image instantiator should be a string or a vector of the form
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
56
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
57 [FORMAT :KEYWORD VALUE ...]
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
58
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
59 i.e. a format symbol followed by zero or more alternating keyword-value
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
60 pairs. The vector form of an image instantiator explicitly specifies the
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
61 format of the image and other relevant properties. The string form
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
62 specifies only a filename or gives inline data of an unspecified format,
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
63 and XEmacs must guess the actual format. Once it has done this, it
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
64 internally converts the instantiator into the vector format. This is
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
65 described in more detail below.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
66
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
67 Following is a list of the possible values for FORMAT. After each
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
68 description, the allowable keywords for the format are listed in brackets,
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
69 followed by the possible image instance types that can be generated from
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
70 this format. (Image instance types will be discussed below.)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
71
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
72 `nothing'
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
73 Don't display anything; no keywords are valid for this.
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
74 [] (nothing)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
75 `string'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
76 Display this image as a text string. Support for instantiating as
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
77 `mono-pixmap' and `color-pixmap' should probably be added.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
78 [:data] (text)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
79 `formatted-string'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
80 Display this image as a text string, with replaceable fields.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
81 Not currently implemented -- it's treated like `string'.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
82 [:data] (text)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
83 `gif'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
84 A GIF87 or GIF89 image; only if GIF support was compiled into this
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
85 XEmacs. NOTE: Only the first frame of animated gifs will be displayed.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
86 [:data, :file] (color-pixmap, pointer)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
87 `jpeg'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
88 A JPEG image; only if JPEG support was compiled into this XEmacs.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
89 [:data, :file] (color-pixmap, pointer)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
90 `png'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
91 A PNG image; only if PNG support was compiled into this XEmacs.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
92 [:data, :file] (color-pixmap, pointer)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
93 `tiff'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
94 A TIFF image; only if TIFF support was compiled into this XEmacs.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
95 [:data, :file] (color-pixmap, pointer)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
96 `bmp'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
97 A MS Windows BMP image; only if MS Windows support was compiled into
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
98 this XEmacs.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
99 [:data, :file] (color-pixmap, pointer)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
100 `xbm'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
101 An X bitmap; exists if any window-system support was compiled into this
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
102 XEmacs.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
103 [:data, :file, :foreground, :background, :mask-data, :mask-file,
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
104 :hotspot-x, :hotspot-y] (mono-pixmap, color-pixmap, pointer)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
105 `xpm'
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
106 An XPM pixmap; only if XPM support was compiled into this XEmacs.
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
107 [:data, :file, :color-symbols] (mono-pixmap, color-pixmap, pointer)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
108 `xface'
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
109 An X-Face bitmap, used to encode people's faces in e-mail messages;
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
110 only if X-Face support was compiled into this XEmacs.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
111 [:data, :file, :foreground, :background, :mask-data, :mask-file,
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
112 :hotspot-x, :hotspot-y] (mono-pixmap, color-pixmap, pointer)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
113 `cursor-font'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
114 X and GTK only. One of the standard cursor-font names, such as \"watch\"
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
115 or \"right_ptr\" under X. Under X, this is, more specifically, any
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
116 of the standard cursor names from appendix B of the Xlib manual
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
117 [also known as the file <X11/cursorfont.h>] minus the XC_ prefix.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
118 On other window systems, the valid names will be specific to the
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
119 type of window system.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
120 [:data, :foreground, :background] (pointer)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
121 `mswindows-resource'
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
122 An MS Windows pointer resource. Specifies a resource to retrieve
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
123 directly from the system (an OEM resource) or from a file, particularly
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
124 an executable file. If the resource is to be retrieved from a file, use
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
125 :file and optionally :resource-id. Otherwise use :resource-id. Always
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
126 specify :resource-type to specify the type (cursor, bitmap or icon) of
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
127 the resource. Possible values for :resource-id are listed below.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
128 [:file, :resource-type, :resource-id] (pointer, color-pixmap)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
129 `font'
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
130 A glyph from a font; i.e. the name of a font, and glyph index into it
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
131 of the form \"FONT fontname index [[mask-font] mask-index]\".
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
132 Currently can only be instantiated as `pointer', although this should
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
133 probably be fixed.
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
134 [:data, :foreground, :background] (pointer)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
135 `subwindow'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
136 An embedded windowing system window.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
137 [:pixel-width, :pixel-height] (subwindow)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
138 `button'
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
139 A button widget; either a push button, radio button or toggle button.
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
140 [WIDGET-KEYWORDS, GUI-KEYWORDS, :image] (widget)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
141 `combo-box'
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
142 A drop list of selectable items in a widget, for editing text.
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
143 [GUI-KEYWORDS, :width, :height, :pixel-width, :face, :items] (widget)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
144 `edit-field'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
145 A text editing widget.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
146 [WIDGET-KEYWORDS, GUI-KEYWORDS] (widget)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
147 `label'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
148 A static, text-only, widget; for displaying text.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
149 [WIDGET-KEYWORDS, :descriptor] (widget)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
150 `layout'
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
151 A widget for controlling the positioning of children underneath it.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
152 Through the use of nested layouts, a widget hierarchy can be created
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
153 which can have the appearance of any standard dialog box or similar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
154 arrangement; all of this is counted as one \"glyph\" and could appear
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
155 in many of the places that expect a single glyph.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
156 [WIDGET-KEYWORDS, GUI-KEYWORDS, :orientation, :justify, :vertically-justify,
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
157 :horizontally-justify, :border, :margin-width, :items] (widget)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
158 `native-layout'
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
159 The native version of a layout widget. #### Document me better!
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
160 [WIDGET-KEYWORDS, GUI-KEYWORDS] (widget)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
161 `progress-gauge'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
162 A sliding widget, for showing progress.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
163 [WIDGET-KEYWORDS, GUI-KEYWORDS, :value] (widget)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
164 `tab-control'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
165 A tab widget; a series of user selectable tabs.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
166 [WIDGET-KEYWORDS, GUI-KEYWORDS, :orientation, :items] (widget)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
167 `tree-view'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
168 A folding widget.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
169 [WIDGET-KEYWORDS, GUI-KEYWORDS, :items] (widget)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
170 `scrollbar'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
171 A scrollbar widget.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
172 [GUI-KEYWORDS, :pixel-width, :face, :items] (widget)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
173 `autodetect'
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
174 XEmacs tries to guess what format the data is in. If X support
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
175 exists, the data string will be checked to see if it names a filename.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
176 If so, and this filename contains XBM or XPM data, the appropriate
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
177 sort of pixmap or pointer will be created. [This includes picking up
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
178 any specified hotspot or associated mask file.] Otherwise, if `pointer'
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
179 is one of the allowable image-instance types and the string names a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
180 valid cursor-font name, the image will be created as a pointer.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
181 Otherwise, the image will be displayed as text. If no X support
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
182 exists, the image will always be displayed as text.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
183 [:data] (mono-pixmap, color-pixmap, pointer, text)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
184 `inherit'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
185 Inherit from the background-pixmap property of a face.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
186 [:face] (mono-pixmap)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
187
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
188 The valid keywords are:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
189
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
190 :data
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
191 Inline data. For most formats above, this should be a string. For
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
192 XBM images, this should be a list of three elements: width, height, and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
193 a string of bit data. This keyword is valid for all of the bitmap/pixmap
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
194 formats, as well as `string', `formatted-string', `font', `cursor-font',
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
195 and `autodetect'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
196 :file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
197 Data is contained in a file. The value is the name of this file.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
198 If both :data and :file are specified, the image is created from
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
199 what is specified in :data and the string in :file becomes the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
200 value of the `image-instance-file-name' function when applied to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
201 the resulting image-instance. This keyword is valid for all of the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
202 bitmap/pixmap formats as well as `mswindows-resource'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
203 :foreground
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
204 :background
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
205 For `xbm', `xface', `cursor-font', `widget' and `font'. These keywords
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
206 allow you to explicitly specify foreground and background colors.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
207 The argument should be anything acceptable to `make-color-instance'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
208 This will cause what would be a `mono-pixmap' to instead be colorized
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
209 as a two-color color-pixmap, and specifies the foreground and/or
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
210 background colors for a pointer instead of black and white.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
211 :mask-data
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
212 For `xbm' and `xface'. This specifies a mask to be used with the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
213 bitmap. The format is a list of width, height, and bits, like for
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
214 :data.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
215 :mask-file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
216 For `xbm' and `xface'. This specifies a file containing the mask data.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
217 If neither a mask file nor inline mask data is given for an XBM image,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
218 and the XBM image comes from a file, XEmacs will look for a mask file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
219 with the same name as the image file but with \"Mask\" or \"msk\"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
220 appended. For example, if you specify the XBM file \"left_ptr\"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
221 [usually located in \"/usr/include/X11/bitmaps\"], the associated
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
222 mask file \"left_ptrmsk\" will automatically be picked up.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
223 :hotspot-x
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
224 :hotspot-y
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
225 For `xbm' and `xface'. These keywords specify a hotspot if the image
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
226 is instantiated as a `pointer'. Note that if the XBM image file
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
227 specifies a hotspot, it will automatically be picked up if no
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
228 explicit hotspot is given.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
229 :color-symbols
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
230 Only for `xpm'. This specifies an alist that maps strings
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
231 that specify symbolic color names to the actual color to be used
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
232 for that symbolic color (in the form of a string or a color-specifier
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
233 object). If this is not specified, the contents of `xpm-color-symbols'
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
234 are used to generate the alist.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
235 :resource-id
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
236 Only for `mswindows-resource'. This must be either an integer (which
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
237 directly specifies a resource number) or a string. Valid strings are
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
238
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
239 -- For bitmaps:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
240
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
241 \"close\", \"uparrow\", \"dnarrow\", \"rgarrow\", \"lfarrow\",
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
242 \"reduce\", \"zoom\", \"restore\", \"reduced\", \"zoomd\",
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
243 \"restored\", \"uparrowd\", \"dnarrowd\", \"rgarrowd\", \"lfarrowd\",
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
244 \"mnarrow\", \"combo\", \"uparrowi\", \"dnarrowi\", \"rgarrowi\",
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
245 \"lfarrowi\", \"size\", \"btsize\", \"check\", \"checkboxes\", and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
246 \"btncorners\".
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
247
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
248 -- For pointers:
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
249
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
250 \"normal\", \"ibeam\", \"wait\", \"cross\", \"up\", \"sizenwse\",
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
251 \"sizenesw\", \"sizewe\", \"sizens\", \"sizeall\", and \"no\".
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
252
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
253 -- For icons:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
254
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
255 \"sample\", \"hand\", \"ques\", \"bang\", \"note\", and \"winlogo\".
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
256 :resource-type
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
257 Only for `mswindows-resource'. This must be a symbol, either `cursor'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
258 (i.e. pointer), `icon', or `bitmap', specifying the type of resource to
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
259 be retrieved.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
260 :face
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
261 Only for `inherit'. This specifies the face to inherit from.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
262 For widgets this also specifies the face to use for display. It defaults
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
263 to gui-element-face.
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
264 :pixel-width, :pixel-height
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
265 Width and height of element, in pixels. For `subwindow', the values
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
266 must be integers. For widgets, the values can be integers or
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
267 expressions that evaluate to integers.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
268
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
269 \[WIDGET-KEYWORDS] stands for the standard keywords accepted by widgets:
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
270 These are `:selected', `:active', `:suffix', `:keys', `:style',
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
271 `:filter', `:config', `:included', `:key-sequence', `:accelerator',
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
272 `:label', `:callback', `:initial-focus', and `:descriptor'.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
273 #### Document me.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
274
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
275 \[GUI-KEYWORDS] stands for keywords accepted by many widgets.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
276 These are `:width', `:height', `:pixel-width', `:pixel-height', and `:face'.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
277 #### Document me.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
278
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
279 If instead of a vector, the instantiator is a string, it will be
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
280 converted into a vector by looking it up according to the specs in the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
281 `console-type-image-conversion-list' (q.v.) for the console type of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
282 the domain (usually a window; sometimes a frame or device) over which
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
283 the image is being instantiated.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
284
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
285 If the instantiator specifies data from a file, the data will be read
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
286 in at the time that the instantiator is added to the image (which may
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
287 be well before when the image is actually displayed), and the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
288 instantiator will be converted into one of the inline-data forms, with
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
289 the filename retained using a :file keyword. This implies that the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
290 file must exist when the instantiator is added to the image, but does
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
291 not need to exist at any other time (e.g. it may safely be a temporary
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
292 file).
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
293
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
294 NOTE: In practice, you rarely, if ever, need to actually
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
295 create an image specifier! (The function `make-image-specifier' exists
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
296 mainly for completeness.) Pretty much the only use for image specifiers is
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
297 to control how glyphs are displayed, and the image specifier associated
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
298 with a glyph (the `image' property of a glyph) is created automatically
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
299 when a glyph is created (see `make-glyph') and need not \(and cannot, for
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
300 that matter) ever be changed. In fact, the design decision to create a
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
301 separate image specifier type, rather than make glyphs themselves be
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
302 specifiers, is debatable -- the other properties of glyphs are rarely used
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
303 and could conceivably have been incorporated into the glyph's instantiator.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
304 The rarely used glyph types (buffer, pointer, icon) could also have been
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
305 incorporated into the instantiator.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
306
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
307 An image specifier is used for images (pixmaps, widgets and the like). It
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
308 is used to describe the actual image in a glyph. It is instantiated \(see
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
309 `specifier-instance') as an image-instance. Note that \"image\" as used in
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
310 XEmacs does not actually refer to what the term \"image\" normally means (a
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
311 picture, e.g. in .GIF or .JPG format, and called a \"pixmap\" in XEmacs),
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
312 but includes all types of graphical elements, including pixmaps, widgets
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
313 \(buttons, sliders, text fields, etc.) and even strings of text.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
314
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
315 There is an important distinction to be made between image instantiators
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
316 and image instances, and \"image instantiator formats\" and \"image
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
317 instance types\", analogous to the distinction between source and
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
318 destination. An image instantiator describes the source data for an image.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
319 An image instance encapsulates the resulting window-system object used to
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
320 display the image. Image instantiator formats are the formats of the
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
321 source: This includes familiar and less-familiar graphics formats such as
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
322 `gif', `jpeg', `png' and `xpm'; widget types such as `button', `edit-field'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
323 and `combo-box'; and other beasts such as `string' (plain text, which could
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
324 potentially behave like text when placed in a buffer, such as wrapping),
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
325 `font' (a single character from a particular font, specified by the index
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
326 into the font), etc. Image instance types are the (destination) types of
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
327 the resulting image instance. Different image instance types correspond to
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
328 fundamentally different appearance and behaviors for the resulting image,
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
329 specifically:
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
330
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
331 -- `color-pixmap' (a color image);
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
332 -- `mono-pixmap' (a \"monochrome\" image, technically a two-color image
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
333 that comes in two unspecified shades \"foreground\" and \"background\",
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
334 determined from the face [see `make-face'] of the glyph or surrounding
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
335 text);
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
336 -- `text' (a string of text appearing somewhere in a buffer's text or
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
337 margins, which has an unspecified foreground, background, and font
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
338 derived from the surrounding text or other external property and which
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
339 behaves in many respects like an image but can wrap across the end of a
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
340 line to the beginning of the next);
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
341 -- `pointer' (the mouse pointer for a window; this is a combination of a
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
342 rectangular pixmap image, a monochrome mask that specifies the
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
343 transparency of the image [i.e. in which places the underlying screen
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
344 image can show through, and how much of it], and a \"hotspot\" that
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
345 indicates which pixel in the pointer's image is considered the actual
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
346 pointer location -- for example, this will be located near the tip of
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
347 an arrow, in the middle of a crosshairs, somewhere along an i-beam, etc.);
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
348 -- `widget' (a window-system object or \"widget\" that interacts with the
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
349 user, such as a button, edit-field or combo-box);
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
350 -- `subwindow' (a rectangular area that another program can draw into);
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
351 -- `nothing' (no display).
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
352
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
353 There is not a one-to-one mapping between source (image instantiator)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
354 formats and destination (image instance) types. For example, the source
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
355 format `xpm' can generate the image instance types `color-pixmap',
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
356 `mono-pixmap', or `pointer', and the image instance type `color-pixmap' can
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
357 be generated by any of `gif', `jpeg', `png', `tiff', `xpm', `xbm' and
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
358 `xface'.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
359
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
360 In general, the user or programmer specifies the image instantiator format,
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
361 while the appropriate image instance type is determined automatically by
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
362 XEmacs from the image instantiator format, from the data in the
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
363 instantiator and from the particular situation the image (and the glyph
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
364 that holds it) is being used in. (However, it's possible to explicitly
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
365 create image instances and control their types; see `make-image-instance'.)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
366 For example, a glyph used to specify the shape of a mouse pointer can only
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
367 result in `pointer'-type image instances, and a glyph used for an icon can
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
368 only result in `color-pixmap' image instances. A glyph used in a buffer
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
369 can potentially result in any image instance type except for `pointer', but
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
370 particular instantiator formats have only a limited set of image instance
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
371 types they will support. Here is an example of how the image instance type
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
372 for an `xpm' instantiator (which can potentially support `color-pixmap',
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
373 `mono-pixmap', or `pointer') is determined:
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
374
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
375 1. If the glyph is being used for a mouse pointer (hence its `glyph-type'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
376 is `pointer'), it can be instantiated only a `pointer'-type image instance.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
377 2. If the glyph is being used for an icon (hence its `glyph-type' is `icon'),
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
378 it can be instantiated only a `color-pixmap'-type image instance.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
379 3. Otherwise, the glyph is being used somewhere inside a frame (`glyph-type'
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
380 of `buffer') and any image instance type except `pointer' can be
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
381 supported. In this case, this means `color-pixmap' or `mono-pixmap'.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
382 Which one will result depends on the particular data being processed,
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
383 since XPM images can specify whether they are color or mono.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
384
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
385 Note again that \"mono\" does *NOT* simply mean \"an image with two
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
386 colors\". The latter image has two prespecified colors, e.g. red and blue
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
387 or black and white, and will always appear with those colors, no matter
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
388 what the context. A mono image has two *unspecified* colors, symbolically
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
389 named \"foreground\" and \"background\", and the actual values for those
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
390 colors depends on context. A mono pixmap displayed among text will take
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
391 its foreground and background from that of the text and hence blend in
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
392 nicely; a two-color color pixmap won't do that.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
393
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
394 Note also that `color-pixmap' image instances can be generated from the
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
395 supported pixmap formats that are inherently mono (i.e. `xbm' and `xface')
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
396 by specifying :foreground and :background values.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
397
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
398 A table of the various image instantiator formats and the possible
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
399 destination (image instance) types that can be generated from them is as
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
400 follows:
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
401
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
402
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
403 color-pixmap mono-pixmap text pointer widget subwindow noth.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
404 -------------------------------------------------------------------------------
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
405 nothing +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
406 string +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
407 formatted-string +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
408 xbm + + +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
409 xpm + + +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
410 xface + + +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
411 gif + +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
412 jpeg + +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
413 png + +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
414 tiff + +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
415 bmp + +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
416 cursor-font +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
417 mswindows-resource + +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
418 font +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
419 subwindow +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
420 button +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
421 combo-box +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
422 edit-field +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
423 label +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
424 layout +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
425 native-layout +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
426 progress-gauge +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
427 tab-control +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
428 tree-view +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
429 scrollbar +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
430 autodetect + + + +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
431 inherit +
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
432
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
433 See `make-image-instance' for a more detailed discussion of image
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
434 instance types."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 (make-specifier-and-init 'image spec-list))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; glyphs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439 (defconst built-in-glyph-specifiers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 '(image contrib-p baseline)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
441 "A list of the built-in glyph properties that are specifiers.")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443 (defun glyph-property (glyph property &optional locale)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 "Return GLYPH's value of PROPERTY in LOCALE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 If LOCALE is omitted, the GLYPH's actual value for PROPERTY will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447 returned. For built-in properties, this will be a specifier object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448 of a type appropriate to the property (e.g. a font or color
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 specifier). For other properties, this could be anything.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 If LOCALE is supplied, then instead of returning the actual value,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 the specification(s) for the given locale or locale type will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453 be returned. This will only work if the actual value of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454 PROPERTY is a specifier (this will always be the case for built-in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 properties, but not or not may apply to user-defined properties).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 If the actual value of PROPERTY is not a specifier, this value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457 will simply be returned regardless of LOCALE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459 The return value will be a list of instantiators (e.g. strings
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 specifying a font or color name), or a list of specifications, each
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461 of which is a cons of a locale and a list of instantiators.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462 Specifically, if LOCALE is a particular locale (a buffer, window,
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
463 frame, device, or `global'), a list of instantiators for that locale
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 will be returned. Otherwise, if LOCALE is a locale type (one of
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
465 the symbols `buffer', `window', `frame', `device', `device-class', or
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
466 `device-type'), the specifications for all locales of that type will
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
467 be returned. Finally, if LOCALE is `all', the specifications for all
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 locales of all types will be returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470 The specifications in a specifier determine what the value of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471 PROPERTY will be in a particular \"domain\" or set of circumstances,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 which is typically a particular Emacs window along with the buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 it contains and the frame and device it lies within. The value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474 is derived from the instantiator associated with the most specific
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
475 locale (in the order buffer, window, frame, device, and `global')
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476 that matches the domain in question. In other words, given a domain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477 (i.e. an Emacs window, usually), the specifier for PROPERTY will first
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 be searched for a specification whose locale is the buffer contained
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 within that window; then for a specification whose locale is the window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 itself; then for a specification whose locale is the frame that the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481 window is contained within; etc. The first instantiator that is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482 valid for the domain (usually this means that the instantiator is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483 recognized by the device [i.e. the X server or TTY device] that the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484 domain is on. The function `glyph-property-instance' actually does
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 all this, and is used to determine how to display the glyph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 See `set-glyph-property' for the built-in property-names."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488 (check-argument-type 'glyphp glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489 (let ((value (get glyph property)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490 (if (and locale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 (or (memq property built-in-glyph-specifiers)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 (specifierp value)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493 (setq value (specifier-specs value locale)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 value))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
495
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
496 (defun convert-glyph-property-into-specifier (glyph property)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 "Convert PROPERTY on GLYPH into a specifier, if it's not already."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 (check-argument-type 'glyphp glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499 (let ((specifier (get glyph property)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500 ;; if a user-property does not have a specifier but a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 ;; locale was specified, put a specifier there.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502 ;; If there was already a value there, convert it to a
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
503 ;; specifier with the value as its `global' instantiator.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 (if (not (specifierp specifier))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505 (let ((new-specifier (make-specifier 'generic)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 (if (or (not (null specifier))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507 ;; make sure the nil returned from `get' wasn't
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 ;; actually the value of the property
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
509 (null (get glyph property t)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 (add-spec-to-specifier new-specifier specifier))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 (setq specifier new-specifier)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 (put glyph property specifier)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 (defun glyph-property-instance (glyph property
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 &optional domain default no-fallback)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 "Return the instance of GLYPH's PROPERTY in the specified DOMAIN.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518 Under most circumstances, DOMAIN will be a particular window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519 and the returned instance describes how the specified property
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
520 actually is displayed for that window and the particular buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521 in it. Note that this may not be the same as how the property
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522 appears when the buffer is displayed in a different window or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523 frame, or how the property appears in the same window if you
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524 switch to another buffer in that window; and in those cases,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525 the returned instance would be different.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 DOMAIN defaults to the selected window if omitted.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529 DOMAIN can be a frame or device, instead of a window. The value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 returned for a such a domain is used in special circumstances
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531 when a more specific domain does not apply; for example, a frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 value might be used for coloring a toolbar, which is conceptually
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 attached to a frame rather than a particular window. The value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534 is also useful in determining what the value would be for a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 particular window within the frame or device, if it is not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536 overridden by a more specific specification.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538 If PROPERTY does not name a built-in property, its value will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
539 simply be returned unless it is a specifier object, in which case
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
540 it will be instanced using `specifier-instance'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
542 Optional arguments DEFAULT and NO-FALLBACK are the same as in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 `specifier-instance'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
544 (check-argument-type 'glyphp glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545 (let ((value (get glyph property)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546 (if (specifierp value)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547 (setq value (specifier-instance value domain default no-fallback)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548 value))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550 (defun set-glyph-property (glyph property value &optional locale tag-set
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551 how-to-add)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552 "Change a property of a GLYPH.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
553
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554 NOTE: If you want to remove a property from a glyph, use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555 `remove-glyph-property' rather than attempting to set a value of nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
556 for the property.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
557
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
558 For built-in properties, the actual value of the property is a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
559 specifier and you cannot change this; but you can change the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560 specifications within the specifier, and that is what this function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561 will do. For user-defined properties, you can use this function
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
562 to either change the actual value of the property or, if this value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
563 is a specifier, change the specifications within it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
564
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
565 If PROPERTY is a built-in property, the specifications to be added to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566 this property can be supplied in many different ways:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568 -- If VALUE is a simple instantiator (e.g. a string naming a font or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
569 color) or a list of instantiators, then the instantiator(s) will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
570 be added as a specification of the property for the given LOCALE
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
571 (which defaults to `global' if omitted).
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
572 -- If VALUE is a list of specifications (each of which is a cons of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573 a locale and a list of instantiators), then LOCALE must be nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574 (it does not make sense to explicitly specify a locale in this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
575 case), and specifications will be added as given.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576 -- If VALUE is a specifier (as would be returned by `glyph-property'
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577 if no LOCALE argument is given), then some or all of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
578 specifications in the specifier will be added to the property.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579 In this case, the function is really equivalent to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
580 `copy-specifier' and LOCALE has the same semantics (if it is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
581 a particular locale, the specification for the locale will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
582 copied; if a locale type, specifications for all locales of
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
583 that type will be copied; if nil or `all', then all
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
584 specifications will be copied).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
585
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
586 HOW-TO-ADD should be either nil or one of the symbols `prepend',
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
587 `append', `remove-tag-set-prepend', `remove-tag-set-append', `remove-locale',
3061
fd1acd2f457a [xemacs-hg @ 2005-11-13 07:39:26 by ben]
ben
parents: 2607
diff changeset
588 `remove-locale-type', or `remove-all'. See `copy-specifier' and
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
589 `add-spec-to-specifier' for a description of what each of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590 these means. Most of the time, you do not need to worry about
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
591 this argument; the default behavior usually is fine.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
592
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
593 In general, it is OK to pass an instance object (e.g. as returned
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
594 by `glyph-property-instance') as an instantiator in place of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
595 an actual instantiator. In such a case, the instantiator used
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
596 to create that instance object will be used (for example, if
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
597 you set a font-instance object as the value of the `font'
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
598 property, then the font name used to create that object will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
599 be used instead). If some cases, however, doing this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
600 conversion does not make sense, and this will be noted in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
601 the documentation for particular types of instance objects.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
602
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
603 If PROPERTY is not a built-in property, then this function will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
604 simply set its value if LOCALE is nil. However, if LOCALE is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
605 given, then this function will attempt to add VALUE as the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
606 instantiator for the given LOCALE, using `add-spec-to-specifier'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
607 If the value of the property is not a specifier, it will
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
608 automatically be converted into a `generic' specifier.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
609
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
610
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
611 The following symbols have predefined meanings:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
612
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
613 image The image used to display the glyph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
614
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
615 baseline Percent above baseline that glyph is to be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
616 displayed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
617
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
618 contrib-p Whether the glyph contributes to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
619 height of the line it's on.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
620
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
621 face Face of this glyph (*not* a specifier)."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
622 (check-argument-type 'glyphp glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
623 (if (memq property built-in-glyph-specifiers)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
624 (set-specifier (get glyph property) value locale tag-set how-to-add)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
625
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
626 ;; This section adds user defined properties.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
627 (if (not locale)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
628 (put glyph property value)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
629 (convert-glyph-property-into-specifier glyph property)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630 (add-spec-to-specifier (get glyph property) value locale tag-set
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
631 how-to-add)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
632 value)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
633
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
634 (defun remove-glyph-property (glyph property &optional locale tag-set exact-p)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
635 "Remove a property from a glyph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
636 For built-in properties, this is analogous to `remove-specifier'.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
637 See `remove-specifier' for the meaning of the LOCALE, TAG-SET, and EXACT-P
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
638 arguments."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
639 (or locale (setq locale 'all))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
640 (if (memq property built-in-glyph-specifiers)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
641 (remove-specifier (glyph-property glyph property) locale tag-set exact-p)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
642 (if (eq locale 'all)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
643 (remprop glyph property)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
644 (convert-glyph-property-into-specifier glyph property)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
645 (remove-specifier (glyph-property glyph property) locale tag-set
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646 exact-p))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
647
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
648 (defun glyph-face (glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 "Return the face of GLYPH."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650 (glyph-property glyph 'face))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
651
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
652 (defun set-glyph-face (glyph face)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
653 "Change the face of GLYPH to FACE."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
654 ; (interactive (glyph-interactive "face"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
655 (set-glyph-property glyph 'face face))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
656
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
657 (defun glyph-image (glyph &optional locale)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658 "Return the image of GLYPH in LOCALE, or nil if it is unspecified.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
660 LOCALE may be a locale (the instantiators for that particular locale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 will be returned), a locale type (the specifications for all locales
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
662 of that type will be returned), `all' (all specifications will be
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
663 returned), or nil (the actual specifier object will be returned).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
664
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
665 See `glyph-property' for more information."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
666 (glyph-property glyph 'image locale))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
667
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
668 (defun glyph-image-instance (glyph &optional domain default no-fallback)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
669 "Return the instance of GLYPH's image in DOMAIN.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
670
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 Normally DOMAIN will be a window or nil (meaning the selected window),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
672 and an instance object describing how the image appears in that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
673 particular window and buffer will be returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
674
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
675 See `glyph-property-instance' for more information."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
676 (glyph-property-instance glyph 'image domain default no-fallback))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
677
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
678 (defun glyph-image-property (glyph prop &optional domain default no-fallback)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
679 "Return property PROP of the instance of GLYPH's image in DOMAIN.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
680
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
681 Normally DOMAIN will be a window or nil (meaning the selected window).
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
682 The value returned is dependent on the image instance type."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
683 (image-instance-property
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
684 (glyph-image-instance glyph domain default no-fallback) prop))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
685
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
686 (defun set-glyph-image (glyph spec &optional locale tag-set how-to-add)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
687 "Change the image of GLYPH in LOCALE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
688
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
689 SPEC should be an instantiator (a string or vector; see
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
690 `make-image-specifier' for a description of possible values here),
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
691 a list of (possibly tagged) instantiators, an alist of specifications
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
692 (each mapping a locale to an instantiator list), or an image specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
693 object.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
694
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
695 If SPEC is an alist, LOCALE must be omitted. If SPEC is a
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
696 specifier object, LOCALE can be a locale, a locale type, `all',
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
697 or nil; see `copy-specifier' for its semantics. Otherwise LOCALE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
698 specifies the locale under which the specified instantiator(s)
3061
fd1acd2f457a [xemacs-hg @ 2005-11-13 07:39:26 by ben]
ben
parents: 2607
diff changeset
699 will be added, and defaults to `global'.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
700
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
701 See `set-glyph-property' for more information."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
702 ; (interactive (glyph-interactive "image"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
703 (set-glyph-property glyph 'image spec locale tag-set how-to-add))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
704
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
705 (defun glyph-contrib-p (glyph &optional locale)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
706 "Return whether GLYPH contributes to its line height.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
707
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
708 LOCALE may be a locale (the instantiators for that particular locale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
709 will be returned), a locale type (the specifications for all locales
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
710 of that type will be returned), `all' (all specifications will be
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
711 returned), or nil (the actual specifier object will be returned).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
712
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
713 See `glyph-property' for more information."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
714 (glyph-property glyph 'contrib-p locale))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
715
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
716 (defun glyph-contrib-p-instance (glyph &optional domain default no-fallback)
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
717 "Return the instance of GLYPH's `contrib-p' property in DOMAIN.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
718
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
719 Normally DOMAIN will be a window or nil (meaning the selected window),
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
720 and an instance object describing what the `contrib-p' property is in
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
721 that particular window and buffer will be returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
722
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
723 See `glyph-property-instance' for more information."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
724 (glyph-property-instance glyph 'contrib-p domain default no-fallback))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
725
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
726 (defun set-glyph-contrib-p (glyph spec &optional locale tag-set how-to-add)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
727 "Change the contrib-p property of GLYPH in LOCALE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
728
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
729 SPEC should be an instantiator (t or nil), a list of (possibly
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
730 tagged) instantiators, an alist of specifications (each mapping a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
731 locale to an instantiator list), or a boolean specifier object.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
732
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
733 If SPEC is an alist, LOCALE must be omitted. If SPEC is a
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
734 specifier object, LOCALE can be a locale, a locale type, `all',
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
735 or nil; see `copy-specifier' for its semantics. Otherwise LOCALE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
736 specifies the locale under which the specified instantiator(s)
3061
fd1acd2f457a [xemacs-hg @ 2005-11-13 07:39:26 by ben]
ben
parents: 2607
diff changeset
737 will be added, and defaults to `global'.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
738
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
739 See `set-glyph-property' for more information."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
740 ; (interactive (glyph-interactive "contrib-p"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
741 (set-glyph-property glyph 'contrib-p spec locale tag-set how-to-add))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
742
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
743 (defun glyph-baseline (glyph &optional locale)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
744 "Return the baseline of GLYPH in LOCALE, or nil if it is unspecified.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
745
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
746 LOCALE may be a locale (the instantiators for that particular locale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
747 will be returned), a locale type (the specifications for all locales
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
748 of that type will be returned), `all' (all specifications will be
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
749 returned), or nil (the actual specifier object will be returned).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
750
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
751 See `glyph-property' for more information."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
752 (glyph-property glyph 'baseline locale))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
753
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
754 (defun glyph-baseline-instance (glyph &optional domain default no-fallback)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
755 "Return the instance of GLYPH's baseline in DOMAIN.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
756
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
757 Normally DOMAIN will be a window or nil (meaning the selected window),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
758 and an integer or nil (specifying the baseline in that particular
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
759 window and buffer) will be returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
760
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
761 See `glyph-property-instance' for more information."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
762 (glyph-property-instance glyph 'baseline domain default no-fallback))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
763
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
764 (defun set-glyph-baseline (glyph spec &optional locale tag-set how-to-add)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
765 "Change the baseline of GLYPH to SPEC in LOCALE.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
766
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
767 SPEC should be an instantiator (an integer [a percentage above the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
768 baseline of the line the glyph is on] or nil), a list of (possibly
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
769 tagged) instantiators, an alist of specifications (each mapping a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
770 locale to an instantiator list), or a generic specifier object.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
771
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
772 If SPEC is an alist, LOCALE must be omitted. If SPEC is a
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
773 specifier object, LOCALE can be a locale, a locale type, `all',
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
774 or nil; see `copy-specifier' for its semantics. Otherwise LOCALE
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
775 specifies the locale under which the specified instantiator(s)
3061
fd1acd2f457a [xemacs-hg @ 2005-11-13 07:39:26 by ben]
ben
parents: 2607
diff changeset
776 will be added, and defaults to `global'.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
777
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
778 See `set-glyph-property' for more information."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
779 ; (interactive (glyph-interactive "baseline"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
780 (set-glyph-property glyph 'baseline spec locale tag-set how-to-add))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
781
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
782 (defun make-glyph (&optional spec-list type)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
783 "Create a new glyph of type TYPE.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
784
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
785 A glyph in XEmacs does NOT refer to a single unit of textual display (the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
786 XEmacs term for this is \"rune\"), but rather is an object encapsulating
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
787 a graphical element, such as an image or widget (an element such as a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
788 button or text field; \"widget\" is the term for this under X Windows,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
789 and it's called a \"control\" under MS Windows). This graphical element
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
790 could appear in a buffer, a margin, a gutter, or a toolbar, or as a mouse
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
791 pointer or an icon, for example.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
792
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
793 Creating a glyph using `make-glyph' does not specify *where* the glyph
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
794 will be used, but it does specify *what* the glyph will look like. In
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
795 particular, SPEC-LIST is used to specify this, and it's used to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
796 initialize the glyph's `image' property, which is an image
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
797 specifier. (Note that \"image\" as used in the context of a glyph's
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
798 `image' property or in the terms \"image specifier\", \"image
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
799 instantiator\", or \"image instance\" does not refer to what people
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
800 normally think of as an image (which in XEmacs is called a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
801 \"pixmap\"), but to any graphical element -- a pixmap, a widget, or
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
802 even a block of text, when used in the places that call for a glyph.)
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
803
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
804 SPEC-LIST is typically an image instantiator, describing the source for the
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
805 image data. This is either a vector of the form [FORMAT :KEYWORD DATA ...],
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
806 for example
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
807
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
808 [jpeg :file \"/user/john/images/myimage.jpg\"]
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
809
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
810 or
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
811
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
812 [xbm :data \"/* XPM */\nstatic char * copy[] = {\n...\"]
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
813
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
814 or it is a string, either giving a file name or directly specifying inline
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
815 data. See `make-image-specifier' for a detailed description of valid image
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
816 instantiators. If the instantiator is a string, XEmacs will convert it
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
817 into vector form by trying to guess whether a file name or inline data is
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
818 intended, and what kind of data is inline or in the file. Usually it does
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
819 a pretty good job. See `console-type-image-conversion-list' for details of
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
820 how this works.
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
821
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
822 If the instantiator specifies data from a file, the data will be read in
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
823 when `make-glyph' is called and substituted inline into the instantiator,
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
824 using the :data keyword. This means that the file must exist when the
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
825 glyph is created, but does not need to exist afterwards (e.g. it may safely
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
826 be a temporary file).
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
827
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
828 When errors occur in the process of reading image data from a file
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
829 \(e.g. the file does not exist or the data is of the wrong format or
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
830 corrupted), no Lisp error will currently be signalled. Instead, the
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
831 instantiator is skipped and warnings will be issued at level `debug'. \(A
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
832 glyph with no instantiators in it cannot be displayed.) Normally, such
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
833 warnings are ignored entirely, but you can change this by setting
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
834 `log-warning-minimum-level'. This is useful if you're trying to debug why
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
835 particular instantiators are not being processed. (#### We should probably
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
836 provide a way of getting errors in such circumstances, or even make this
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
837 the default behavior.)
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
838
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
839 Technically, SPEC-LIST can also be a list of image instantiators (each one
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
840 in turn is tried until an image is successfully produced), a cons of a
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
841 locale (frame, buffer, etc.) and an instantiator, a list of such conses,
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
842 or any other form accepted by `canonicalize-spec-list'.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
843
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
844 If you're not familiar with specifiers, you should be in order to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
845 understand how glyphs work. The clearest introduction to specifiers
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
846 is in the Lispref manual, available under Info. (Choose
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
847 Help->Info->Info Contents on the menubar or type \\[info].) You can
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
848 also see `make-specifier' for a capsule summary. What's important to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
849 keep in mind is that a specifier lets you set a different value for
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
850 any particular buffer, window, frame, device, or console. This allows
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
851 for a great deal of flexibility; in particular, only one global glyph
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
852 needs to exist for a particular purpose (e.g. the icon used to represent
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
853 an iconified frame, the mouse pointer used over particular areas of a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
854 frame, etc.), and in these cases you do not create your own glyph, but
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
855 rather modify the existing one.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
856
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
857 As well as using SPEC-LIST to initialize the glyph, you can set
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
858 specifications using `set-glyph-image'. Note that, due to a possibly
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
859 questionable historical design decision, a glyph itself is not
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
860 actually a specifier, but rather is an object containing an image
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
861 specifier (as well as other, seldom-used properties). Therefore, you
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
862 cannot set or access specifications for the glyph's image by directly
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
863 using `set-specifier', `specifier-instance' or the like on the glyph;
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
864 instead use them on `(glyph-image GLYPH)' or use the convenience
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
865 functions `set-glyph-image', `glyph-image-instance', and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
866 `glyph-image'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
867
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
868 Once you have created a glyph, you specify where it will be used as follows:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
869
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
870 -- To insert a glyph into a buffer, create an extent in the buffer and then
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
871 use `set-extent-begin-glyph' or `set-extent-end-glyph' to set a glyph
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
872 to be displayed at the corresponding edge of the extent. (It is common
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
873 to create zero-width extents for this purpose.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
874
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
875 -- To insert a glyph into the left or right margin of a buffer, first
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
876 make sure the margin is visible by setting a value for the specifiers
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
877 `left-margin-width' or `right-margin-width'. (Not strictly necessary
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
878 when using margin glyphs with layout policy `whitespace'.) Then follow
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
879 the same procedure above for inserting a glyph in a buffer, and then
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
880 set a non-default layout policy for the glyph using
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
881 `set-extent-begin-glyph-layout' or `set-extent-end-glyph-layout'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
882 Alternatively, use the high-level annotations API (see
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
883 `make-annotation'). (In point of fact, you can also use the annotations
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
884 API for glyphs in a buffer, by setting a layout policy of `text'.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
885
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
886 -- To insert a glyph into the modeline, just put the glyph directly as
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
887 one of the modeline elements. (Unfortunately you can't currently
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
888 put a begin glyph or end glyph on one of the modeline extents --
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
889 they're ignored.)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
890
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
891 -- To insert a glyph into a toolbar, specify it as part of a toolbar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
892 instantiator (typically set on the specifier `default-toolbar').
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
893 See `default-toolbar' for more information. (Note that it is standard
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
894 practice to use a symbol in place of the glyph list in the toolbar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
895 instantiator; the symbol is evalled to get the glyph list. This
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
896 facilitates both creating the toolbar instantiator and modifying
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
897 individual glyphs in a toolbar later on. For example, you can
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
898 change the way that the Mail toolbar button looks by modifying the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
899 value of the variable `toolbar-mail-icon' (in general, `toolbar-*-icon')
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
900 and then calling `(set-specifier-dirty-flag default-toolbar)'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
901 (#### Unfortunately this doesn't quite work the way it should; the
2607
f8db302d6298 [xemacs-hg @ 2005-02-22 23:38:49 by ben]
ben
parents: 446
diff changeset
902 change will appear in new frames, but not existing ones.)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
903
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
904 -- To insert a glyph into a gutter, create or modify a gutter instantiator
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
905 (typically set on the specifier `default-gutter'). Gutter instantiators
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
906 consist of strings or lists of strings, so to insert a glyph, create an
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
907 extent over the string, and use `set-extent-begin-glyph' or
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
908 `set-extent-end-glyph' to set a glyph to be displayed at the corresponding
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
909 edge of the extent, just like for glyphs in a buffer.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
910
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
911 -- To use a glyph as the icon for a frame, you do not actually create a new
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
912 glyph; rather, you change the specifications for the existing glyph
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
913 `frame-icon-glyph'. (Remember that, because of the specifier nature of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
914 glyphs, you can set different values for any particular buffer or frame.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
915
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
916 -- To use a glyph as the mouse pointer, in general you do not create a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
917 new glyph, but rather you change the specifications of various existing
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
918 glyphs, such as `text-pointer-glyph' for the pointer used over text,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
919 `modeline-pointer-glyph' for the pointer used over the modeline, etc.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
920 Do an apropos over `*-pointer-glyph' to find all of them. (Note also
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
921 that you can temporarily set the mouse pointer to some specific shape
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
922 by using `set-frame-pointer', which takes an image instance, as obtained
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
923 from calling `glyph-image-instance' on a glyph of type `pointer' --
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
924 either one of the above-mentioned variables or one you created yourself.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
925 (See below for what it means to create a glyph of type `pointer'.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
926 This pointer will last only until the next mouse motion event is
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
927 processed or certain other things happen, such as creating or deleting
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
928 a window. (In fact, the above-mentioned pointer glyph variables are
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
929 implemented as part of the default handler for mouse motion events.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
930 If you want to customize this behavior, take a look at `mode-motion-hook',
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
931 or `mouse-motion-handler' if you really want to get low-level.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
932
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
933 -- To use a glyph to control the shape of miscellaneous redisplay effects
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
934 such as the truncation and continuation markers, set the appropriate
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
935 existing glyph variables, as for icons and pointers above. See
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
936 `continuation-glyph', `control-arrow-glyph', `hscroll-glyph',
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
937 `invisible-text-glyph', `octal-escape-glyph', and `truncation-glyph'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
938 See also `overlay-arrow-string', an odd redisplay leftover which can
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
939 be set to a glyph you created, and will cause the glyph to be displayed
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
940 on top of the text position specified in the marker stored in
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
941 `overlay-arrow-position'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
942
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
943 -- To use a glyph in a display table (i.e. to control the appearance of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
944 any individual character), create the appropriate character glyphs
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
945 and then set a specification for the specifier `current-display-table',
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
946 which controls the appearance of characters. You can also set an
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
947 overriding display table for use with text displayed in a particular
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
948 face; see `set-face-display-table' and `make-display-table'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
949
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
950 -- To use a glyph as the background pixmap of a face: Note that the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
951 background pixmap of a face is actually an image specifier -- probably
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
952 the only place in XEmacs where an image specifier occurs outside of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
953 a glyph. Similarly to how the glyph's image specifier works, you
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
954 don't create your own image specifier, but rather add specifications
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
955 to the existing one (using `set-face-background-pixmap'). Note that
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
956 the image instance that is generated in order to actually display the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
957 background pixmap is of type `mono-pixmap', meaning that it's a two-color
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
958 image and the foreground and background of the image get filled in with
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
959 the corresponding colors from the face.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
960
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
961 It is extremely rare that you will ever have to specify a value for TYPE,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
962 which should be one of `buffer' (used for glyphs in an extent, the modeline,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
963 the toolbar, or elsewhere in a buffer), `pointer' (used for the mouse-pointer),
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
964 or `icon' (used for a frame's icon), and defaults to `buffer'. The only cases
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
965 where it needs to be specified is when creating icon or pointer glyphs, and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
966 in both cases the necessary glyphs have already been created at startup and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
967 are accessed through the appropriate variables, e.g. `text-pointer-glyph'
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
968 (or in general, `*-pointer-glyph') and `frame-icon-glyph'."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
969 (let ((glyph (make-glyph-internal type)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
970 (and spec-list (set-glyph-image glyph spec-list))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
971 glyph))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
972
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
973 (defun buffer-glyph-p (object)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
974 "Return t if OBJECT is a glyph of type `buffer'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
975 (and (glyphp object) (eq 'buffer (glyph-type object))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
976
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
977 (defun pointer-glyph-p (object)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
978 "Return t if OBJECT is a glyph of type `pointer'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
979 (and (glyphp object) (eq 'pointer (glyph-type object))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
980
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
981 (defun icon-glyph-p (object)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
982 "Return t if OBJECT is a glyph of type `icon'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
983 (and (glyphp object) (eq 'icon (glyph-type object))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
984
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
985 (defun make-pointer-glyph (&optional spec-list)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
986 "Return a new `pointer-glyph' object with the specification list SPEC-LIST.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
987 This is equivalent to calling `make-glyph', specifying a type of `pointer'.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
988 See `make-glyph' for more information.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
989
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
990 It is extremely unlikely that you will ever need to create a pointer glyph.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
991 Instead, you probably want to be calling `set-glyph-image' on an existing
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
992 glyph, e.g. `text-pointer-glyph'."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
993 (make-glyph spec-list 'pointer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
994
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
995 (defun make-icon-glyph (&optional spec-list)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
996 "Return a new `icon-glyph' object with the specification list SPEC-LIST.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
997 This is equivalent to calling `make-glyph', specifying a type of `icon'.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
998 See `make-glyph' for more information.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
999
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1000 It is extremely unlikely that you will ever need to create a icon glyph.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1001 Instead, you probably want to be calling `set-glyph-image' on
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1002 `frame-icon-glyph'."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1003 (make-glyph spec-list 'icon))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1004
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1005 (defun nothing-image-instance-p (object)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1006 "Return t if OBJECT is an image instance of type `nothing'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1007 (and (image-instance-p object) (eq 'nothing (image-instance-type object))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1008
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1009 (defun text-image-instance-p (object)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1010 "Return t if OBJECT is an image instance of type `text'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1011 (and (image-instance-p object) (eq 'text (image-instance-type object))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1012
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1013 (defun mono-pixmap-image-instance-p (object)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1014 "Return t if OBJECT is an image instance of type `mono-pixmap'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1015 (and (image-instance-p object) (eq 'mono-pixmap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1016 (image-instance-type object))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1017
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1018 (defun color-pixmap-image-instance-p (object)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1019 "Return t if OBJECT is an image instance of type `color-pixmap'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1020 (and (image-instance-p object) (eq 'color-pixmap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1021 (image-instance-type object))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1022
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1023 (defun pointer-image-instance-p (object)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1024 "Return t if OBJECT is an image instance of type `pointer'."
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1025 (and (image-instance-p object) (eq 'pointer (image-instance-type object))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1026
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1027 (defun widget-image-instance-p (object)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1028 "Return t if OBJECT is an image instance of type `widget'."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1029 (and (image-instance-p object) (eq 'widget (image-instance-type object))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1030
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1031 (defun subwindow-image-instance-p (object)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 428
diff changeset
1032 "Return t if OBJECT is an image instance of type `subwindow'."
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1033 (and (image-instance-p object) (eq 'subwindow (image-instance-type object))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1034
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1035 ;;;;;;;;;; the built-in glyphs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1036
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1037 (defvar text-pointer-glyph (make-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1038 "*The shape of the mouse-pointer when over text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1039 This is a glyph; use `set-glyph-image' to change it.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1040 (set-glyph-face text-pointer-glyph 'pointer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1041
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1042 (defvar nontext-pointer-glyph (make-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1043 "*The shape of the mouse-pointer when over a buffer, but not over text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1044 This is a glyph; use `set-glyph-image' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1045 If unspecified in a particular domain, `text-pointer-glyph' is used.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1046 (set-glyph-face nontext-pointer-glyph 'pointer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1047
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1048 (defvar modeline-pointer-glyph (make-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1049 "*The shape of the mouse-pointer when over the modeline.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1050 This is a glyph; use `set-glyph-image' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1051 If unspecified in a particular domain, `nontext-pointer-glyph' is used.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1052 (set-glyph-face modeline-pointer-glyph 'pointer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1053
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1054 (defvar selection-pointer-glyph (make-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1055 "*The shape of the mouse-pointer when over a selectable text region.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1056 This is a glyph; use `set-glyph-image' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1057 If unspecified in a particular domain, `text-pointer-glyph' is used.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1058 (set-glyph-face selection-pointer-glyph 'pointer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1059
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1060 (defvar busy-pointer-glyph (make-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1061 "*The shape of the mouse-pointer when XEmacs is busy.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1062 This is a glyph; use `set-glyph-image' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1063 If unspecified in a particular domain, the pointer is not changed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1064 when XEmacs is busy.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1065 (set-glyph-face busy-pointer-glyph 'pointer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1066
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1067 (defvar toolbar-pointer-glyph (make-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1068 "*The shape of the mouse-pointer when over a toolbar.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1069 This is a glyph; use `set-glyph-image' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1070 If unspecified in a particular domain, `nontext-pointer-glyph' is used.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1071 (set-glyph-face toolbar-pointer-glyph 'pointer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1072
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1073 (defvar divider-pointer-glyph (make-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1074 "*The shape of the mouse-pointer when over a window divider.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1075 This is a glyph; use `set-glyph-image' to change it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1076 If unspecified in a particular domain, `nontext-pointer-glyph' is used.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1077 (set-glyph-face divider-pointer-glyph 'pointer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1078
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1079 ;; The following three are in C.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1080 (if (featurep 'menubar)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1081 (set-glyph-face menubar-pointer-glyph 'pointer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1082 (if (featurep 'scrollbar)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1083 (set-glyph-face scrollbar-pointer-glyph 'pointer))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1084 (set-glyph-face gc-pointer-glyph 'pointer)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1085
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1086 ;; Now add the magic access/set behavior.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1087
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1088 (defun dontusethis-set-value-glyph-handler (sym args fun harg handler)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1089 (error "Use `set-glyph-image' to set `%s'" sym))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1090 (defun dontusethis-make-unbound-glyph-handler (sym args fun harg handler)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1091 (error "Can't `makunbound' `%s'" sym))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1092 (defun dontusethis-make-local-glyph-handler (sym args fun harg handler)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1093 (error "Use `set-glyph-image' to make local values for `%s'" sym))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1094
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1095 (defun define-constant-glyph (sym)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1096 (dontusethis-set-symbol-value-handler
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1097 sym 'set-value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1098 'dontusethis-set-value-glyph-handler)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1099 (dontusethis-set-symbol-value-handler
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1100 sym 'make-unbound
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1101 'dontusethis-make-unbound-glyph-handler)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1102 (dontusethis-set-symbol-value-handler
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1103 sym 'make-local
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1104 'dontusethis-make-local-glyph-handler)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1105 ;; Make frame properties magically work with glyph variables.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1106 (put sym 'const-glyph-variable t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1107
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1108 (define-constant-glyph 'text-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1109 (define-constant-glyph 'nontext-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1110 (define-constant-glyph 'modeline-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1111 (define-constant-glyph 'selection-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1112 (define-constant-glyph 'busy-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1113 (define-constant-glyph 'gc-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1114 (define-constant-glyph 'divider-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1115 (define-constant-glyph 'toolbar-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1116 (define-constant-glyph 'menubar-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1117 (define-constant-glyph 'scrollbar-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1118
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1119 (define-constant-glyph 'octal-escape-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1120 (define-constant-glyph 'control-arrow-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1121 (define-constant-glyph 'invisible-text-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1122 (define-constant-glyph 'hscroll-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1123 (define-constant-glyph 'truncation-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1124 (define-constant-glyph 'continuation-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1125
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1126 (define-constant-glyph 'frame-icon-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1127
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1128 ;; backwards compatibility garbage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1129
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1130 (defun dontusethis-old-pointer-shape-handler (sym args fun harg handler)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1131 (let ((value (car args)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1132 (if (null value)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1133 (remove-specifier harg 'global)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1134 (set-glyph-image (symbol-value harg) value))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1135
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1136 ;; It might or might not be garbage, but it's rude. Make these
3061
fd1acd2f457a [xemacs-hg @ 2005-11-13 07:39:26 by ben]
ben
parents: 2607
diff changeset
1137 ;; `compatible' instead of `obsolete'. -slb
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1138 (defun define-obsolete-pointer-glyph (old new)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1139 (define-compatible-variable-alias old new)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1140 (dontusethis-set-symbol-value-handler
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1141 old 'set-value 'dontusethis-old-pointer-shape-handler new))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1142
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1143 ;;; (defvar x-pointer-shape nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1144 (define-obsolete-pointer-glyph 'x-pointer-shape 'text-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1145
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1146 ;;; (defvar x-nontext-pointer-shape nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1147 (define-obsolete-pointer-glyph 'x-nontext-pointer-shape 'nontext-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1148
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1149 ;;; (defvar x-mode-pointer-shape nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1150 (define-obsolete-pointer-glyph 'x-mode-pointer-shape 'modeline-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1151
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1152 ;;; (defvar x-selection-pointer-shape nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1153 (define-obsolete-pointer-glyph 'x-selection-pointer-shape
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1154 'selection-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1155
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1156 ;;; (defvar x-busy-pointer-shape nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1157 (define-obsolete-pointer-glyph 'x-busy-pointer-shape 'busy-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1158
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1159 ;;; (defvar x-gc-pointer-shape nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1160 (define-obsolete-pointer-glyph 'x-gc-pointer-shape 'gc-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1161
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1162 ;;; (defvar x-toolbar-pointer-shape nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1163 (define-obsolete-pointer-glyph 'x-toolbar-pointer-shape 'toolbar-pointer-glyph)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1164
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1165 ;; for subwindows
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1166 (defalias 'subwindow-xid 'image-instance-subwindow-id)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1167 (defalias 'subwindow-width 'image-instance-width)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1168 (defalias 'subwindow-height 'image-instance-height)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1169 ;;;;;;;;;; initialization
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1170
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1171 (defun init-glyphs ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1172 ;; initialize default image types
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1173 (if (featurep 'x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1174 (set-console-type-image-conversion-list 'x
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1175 `(,@(if (featurep 'xpm) '(("\\.xpm\\'" [xpm :file nil] 2)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1176 ("\\.xbm\\'" [xbm :file nil] 2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1177 ,@(if (featurep 'xpm) '(("\\`/\\* XPM \\*/" [xpm :data nil] 2)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1178 ,@(if (featurep 'xface) '(("\\`X-Face:" [xface :data nil] 2)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1179 ,@(if (featurep 'gif) '(("\\.gif\\'" [gif :file nil] 2)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1180 ("\\`GIF8[79]" [gif :data nil] 2)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1181 ,@(if (featurep 'jpeg) '(("\\.jpe?g\\'" [jpeg :file nil] 2)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1182 ;; all of the JFIF-format JPEG's that I've seen begin with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1183 ;; the following. I have no idea if this is standard.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1184 ,@(if (featurep 'jpeg) '(("\\`\377\330\377\340\000\020JFIF"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1185 [jpeg :data nil] 2)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1186 ,@(if (featurep 'png) '(("\\.png\\'" [png :file nil] 2)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1187 ,@(if (featurep 'png) '(("\\`\211PNG" [png :data nil] 2)))
4226
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1188 ;; No, I don't think we want to inline images... -- dvl
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1189 ;; ("" [string :data nil] 2)
446
1ccc32a20af4 Import from CVS: tag r21-2-38
cvs
parents: 442
diff changeset
1190 ("" [nothing]))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1191 ;; #### this should really be formatted-string, not string but we
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1192 ;; don't have it implemented yet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1193 (if (featurep 'tty)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1194 (progn
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1195 (set-console-type-image-conversion-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1196 'tty
4226
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1197 '(("\\.xpm\\'" [string :data nil] 2)
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1198 ("\\.xbm\\'" [string :data nil] 2)
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1199 ;; #define could also mean a bitmap as well as a version 1 XPM. Who
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1200 ;; cares.
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1201 ("^#define" [string :data "[xpm]"])
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1202 ("\\`/\\* XPM \\*/" [string :data "[xpm]"])
4226
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1203 ("\\`X-Face:" [string :data "[xface]"])
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1204 ("\\.gif\\'" [string :data nil] 2)
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1205 ("\\`GIF8[79]" [string :data "[gif]"])
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1206 ("\\.jpe?g\\'" [string :data nil] 2)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1207 ("\\`\377\330\340\000\020JFIF" [string :data "[jpeg]"])
4226
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1208 ;; all of the JFIF-format JPEG's that I've seen begin with
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1209 ;; the following. I have no idea if this is standard.
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1210 ("\\`\377\330\377\340\000\020JFIF" [string :data "[jpeg]"])
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1211 ("\\.png\\'" [string :data nil] 2)
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1212 ("\\`\211PNG" [string :data "[png]"])
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1213 ;; No, I don't think we want to inline images... -- dvl
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1214 ;;("" [string :data nil] 2)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1215 ;; this last one is here for pointers and icons and such --
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1216 ;; strings are not allowed so they will be ignored.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1217 ("" [nothing])))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1218
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1219 ;; finish initializing truncation glyph -- created internally
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1220 ;; because it has a built-in bitmap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1221 (set-glyph-image truncation-glyph "$" 'global 'tty)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1222
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1223 ;; finish initializing continuation glyph -- created internally
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1224 ;; because it has a built-in bitmap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1225 (set-glyph-image continuation-glyph "\\" 'global 'tty)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1226
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1227 ;; finish initializing hscroll glyph -- created internally
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1228 ;; because it has a built-in bitmap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1229 (set-glyph-image hscroll-glyph "$" 'global 'tty)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1230
4226
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1231 ;; For streams, we don't want images at all -- dvl
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1232 (set-console-type-image-conversion-list 'stream '(("" [nothing])))
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1233
9b4442ac18c7 [xemacs-hg @ 2007-10-15 09:55:43 by didierv]
didierv
parents: 3061
diff changeset
1234
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1235 (set-glyph-image octal-escape-glyph "\\")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1236 (set-glyph-image control-arrow-glyph "^")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1237 (set-glyph-image invisible-text-glyph " ...")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1238 ;; (set-glyph-image hscroll-glyph "$")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1239
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1240 (let ((face (make-face 'border-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1241 "Truncation and continuation glyphs face")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1242 (set-glyph-face continuation-glyph face)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1243 (set-glyph-face truncation-glyph face)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1244 (set-glyph-face hscroll-glyph face))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1245
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1246 ;; finish initializing xemacs logo -- created internally because it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1247 ;; has a built-in bitmap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1248 (if (featurep 'xpm)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1249 (set-glyph-image xemacs-logo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1250 (concat "../etc/"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1251 (if emacs-beta-version
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1252 "xemacs-beta.xpm"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1253 "xemacs.xpm"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1254 'global 'x))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1255 (cond ((featurep 'xpm)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1256 (set-glyph-image frame-icon-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1257 (concat "../etc/" "xemacs-icon.xpm")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1258 'global 'x))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1259 ((featurep 'x)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1260 (set-glyph-image frame-icon-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1261 (concat "../etc/" "xemacs-icon2.xbm")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1262 'global 'x)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1263
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1264 (if (featurep 'tty)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1265 (set-glyph-image xemacs-logo
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1266 "XEmacs <insert spiffy graphic logo here>"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1267 'global 'tty))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1268 )
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1269
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1270 (init-glyphs)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1271
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1272 ;;; glyphs.el ends here.