annotate lisp/glyphs.el @ 408:501cfd01ee6d r21-2-34

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