annotate man/lispref/glyphs.texi @ 1058:d7285d54aa5f

[xemacs-hg @ 2002-10-18 05:43:26 by stephent] cygXpm-noX FAQ <87ptu8b972.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Fri, 18 Oct 2002 05:43:35 +0000
parents a307f9a2021d
children c6facab13185
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 @c -*-texinfo-*-
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2 @c This is part of the XEmacs Lisp Reference Manual.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 @c Copyright (C) 1995, 1996 Ben Wing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 @c See the file lispref.texi for copying conditions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 @setfilename ../../info/glyphs.info
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6 @node Glyphs, Annotations, Faces and Window-System Objects, top
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 @chapter Glyphs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 @cindex glyphs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
10 A @dfn{glyph} is an object that is used for pixmaps, widgets and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
11 images of all sorts, as well as for things that ``act'' like pixmaps,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
12 such as non-textual strings (@dfn{annotations}) displayed in a buffer or
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
13 in the margins. It is used in begin-glyphs and end-glyphs attached to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
14 extents, marginal and textual annotations, overlay arrows
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
15 (@code{overlay-arrow-*} variables), toolbar buttons, mouse pointers,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
16 frame icons, truncation and continuation markers, and the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
17 like. (Basically, any place there is an image or something that acts
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
18 like an image, there will be a glyph object representing it.)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 The actual image that is displayed (as opposed to its position or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 clipping) is defined by an @dfn{image specifier} object contained
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 within the glyph. The separation between an image specifier object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 and a glyph object is made because the glyph includes other properties
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 than just the actual image: e.g. the face it is displayed in (for text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 images), the alignment of the image (when it is in a buffer), etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 @defun glyphp object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28 This function returns @code{t} if @var{object} is a glyph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32 * Glyph Functions:: Functions for working with glyphs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 * Images:: Graphical images displayed in a frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34 * Glyph Types:: Each glyph has a particular type.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 * Mouse Pointer:: Controlling the mouse pointer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36 * Redisplay Glyphs:: Glyphs controlling various redisplay functions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 * Subwindows:: Inserting an externally-controlled subwindow
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 into a buffer.
707
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
39 * Glyph Examples:: Examples of how to work with glyphs.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 @node Glyph Functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 @section Glyph Functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 * Creating Glyphs:: Creating new glyphs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47 * Glyph Properties:: Accessing and modifying a glyph's properties.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
48 * Glyph Convenience Functions::
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
49 Convenience functions for accessing particular
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
50 properties of a glyph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
51 * Glyph Dimensions:: Determining the height, width, etc. of a glyph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
52 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
53
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
54 @node Creating Glyphs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
55 @subsection Creating Glyphs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 @defun make-glyph &optional spec-list type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 This function creates a new glyph object of type @var{type}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60 @var{spec-list} is used to initialize the glyph's image. It is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
61 typically an image instantiator (a string or a vector; @ref{Image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 Specifiers}), but can also be a list of such instantiators (each one in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 turn is tried until an image is successfully produced), a cons of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 locale (frame, buffer, etc.) and an instantiator, a list of such conses,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 or any other form accepted by @code{canonicalize-spec-list}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 @xref{Specifiers}, for more information about specifiers.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 @var{type} specifies the type of the glyph, which specifies in which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 contexts the glyph can be used, and controls the allowable image types
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 into which the glyph's image can be instantiated. @var{type} should be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 one of @code{buffer} (used for glyphs in an extent, the modeline, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 toolbar, or elsewhere in a buffer), @code{pointer} (used for the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 mouse-pointer), or @code{icon} (used for a frame's icon), and defaults
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74 to @code{buffer}. @xref{Glyph Types}.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
75
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
76 A glyph in XEmacs does @strong{NOT} refer to a single unit of textual
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
77 display (the XEmacs term for this is @dfn{rune}), but rather is an
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
78 object encapsulating a graphical element, such as an image or widget (an
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
79 element such as a button or text field; @dfn{widget} is the term for
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
80 this under X Windows, and it's called a @dfn{control} under MS Windows).
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
81 This graphical element could appear in a buffer, a margin, a gutter, or
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
82 a toolbar, or as a mouse pointer or an icon, for example.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
83
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
84 Creating a glyph using @code{make-glyph} does not specify @emph{where}
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
85 the glyph will be used, but it does specify @emph{what} the glyph will
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
86 look like. In particular, @var{spec-list} is used to specify this, and it's
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
87 used to initialize the glyph's @code{image} property, which is an image
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
88 specifier. (Note that @dfn{image} as used in the context of a glyph's
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
89 @code{image} property or in the terms @dfn{image specifier}, @dfn{image
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
90 instantiator}, or @dfn{image instance} does not refer to what people
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
91 normally think of as an image (which in XEmacs is called a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
92 @dfn{pixmap}), but to any graphical element---a pixmap, a widget, or
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
93 even a block of text, when used in the places that call for a glyph.)
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
94 The format of the @var{spec-list} is typically an image instantiator (a string
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
95 or a vector; @ref{Image Specifiers}), but can also be a list of such
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
96 instantiators (each one in turn is tried until an image is successfully
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
97 produced), a cons of a locale (frame, buffer, etc.) and an
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
98 instantiator, a list of such conses, or any other form accepted by
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
99 @code{canonicalize-spec-list}. @xref{Specifiers}, for more information
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
100 about specifiers.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
101
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
102 If you're not familiar with specifiers, you should be in order to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
103 understand how glyphs work. The clearest introduction to specifiers
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
104 is in the Lispref manual, available under Info. (Choose
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
105 Help->Info->Info Contents on the menubar or type C-h i.) You can
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
106 also see @code{make-specifier} for a capsule summary. What's important to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
107 keep in mind is that a specifier lets you set a different value for
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
108 any particular buffer, window, frame, device, or console. This allows
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
109 for a great deal of flexibility; in particular, only one global glyph
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
110 needs to exist for a particular purpose (e.g. the icon used to represent
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
111 an iconified frame, the mouse pointer used over particular areas of a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
112 frame, etc.), and in these cases you do not create your own glyph, but
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
113 rather modify the existing one.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
114
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
115 As well as using @var{spec-list} to initialize the glyph, you can set
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
116 specifications using @code{set-glyph-image}. Note that, due to a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
117 possibly questionable historical design decision, a glyph itself is not
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
118 actually a specifier, but rather is an object containing an image
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
119 specifier (as well as other, seldom-used properties). Therefore, you
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
120 cannot set or access specifications for the glyph's image by directly
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
121 using @code{set-specifier}, @code{specifier-instance} or the like on the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
122 glyph; instead use them on @code{(glyph-image @var{glyph})} or use the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
123 convenience functions @code{set-glyph-image},
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
124 @code{glyph-image-instance}, and @code{glyph-image}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
125
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
126 Once you have created a glyph, you specify where it will be used as
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
127 follows:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
128
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
129 @itemize @bullet
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
130 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
131 To insert a glyph into a buffer, create an extent in the buffer and then
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
132 use @code{set-extent-begin-glyph} or @code{set-extent-end-glyph} to set
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
133 a glyph to be displayed at the corresponding edge of the extent. (It is
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
134 common to create zero-width extents for this purpose.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
135
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
136 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
137 To insert a glyph into the left or right margin of a buffer, first
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
138 make sure the margin is visible by setting a value for the specifiers
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
139 @code{left-margin-width} or @code{right-margin-width}. (Not strictly necessary
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
140 when using margin glyphs with layout policy @code{whitespace}.) Then follow
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
141 the same procedure above for inserting a glyph in a buffer, and then
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
142 set a non-default layout policy for the glyph using
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
143 @code{set-extent-begin-glyph-layout} or @code{set-extent-end-glyph-layout}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
144 Alternatively, use the high-level annotations API (see
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
145 @code{make-annotation}). (In point of fact, you can also use the annotations
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
146 API for glyphs in a buffer, by setting a layout policy of @code{text}.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
147
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
148 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
149 To insert a glyph into the modeline, just put the glyph directly as one
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
150 of the modeline elements. (Unfortunately you can't currently put a begin
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
151 glyph or end glyph on one of the modeline extents---they're ignored.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
152
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
153 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
154 To insert a glyph into a toolbar, specify it as part of a toolbar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
155 instantiator (typically set on the specifier @code{default-toolbar}).
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
156 See @code{default-toolbar} for more information. (Note that it is
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
157 standard practice to use a symbol in place of the glyph list in the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
158 toolbar instantiator; the symbol is evalled to get the glyph list. This
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
159 facilitates both creating the toolbar instantiator and modifying
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
160 individual glyphs in a toolbar later on. For example, you can change
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
161 the way that the Mail toolbar button looks by modifying the value of the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
162 variable @code{toolbar-mail-icon} (in general, @code{toolbar-*-icon})
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
163 and then calling @code{(set-specifier-dirty-flag default-toolbar)}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
164 (#### Unfortunately this doesn't quite work the way it should; the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
165 change will appear in new frames, but not existing ones.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
166
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
167 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
168 To insert a glyph into a gutter, create or modify a gutter instantiator
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
169 (typically set on the specifier @code{default-gutter}). Gutter
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
170 instantiators consist of strings or lists of strings, so to insert a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
171 glyph, create an extent over the string, and use
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
172 @code{set-extent-begin-glyph} or @code{set-extent-end-glyph} to set a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
173 glyph to be displayed at the corresponding edge of the extent, just like
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
174 for glyphs in a buffer.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
175
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
176 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
177 To use a glyph as the icon for a frame, you do not actually create a new
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
178 glyph; rather, you change the specifications for the existing glyph
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
179 @code{frame-icon-glyph}. (Remember that, because of the specifier nature
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
180 of glyphs, you can set different values for any particular buffer or
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
181 frame.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
182
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
183 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
184 To use a glyph as the mouse pointer, in general you do not create a new
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
185 glyph, but rather you change the specifications of various existing
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
186 glyphs, such as @code{text-pointer-glyph} for the pointer used over
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
187 text, @code{modeline-pointer-glyph} for the pointer used over the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
188 modeline, etc. Do an apropos over @code{*-pointer-glyph} to find all of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
189 them. (Note also that you can temporarily set the mouse pointer to some
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
190 specific shape by using @code{set-frame-pointer}, which takes an image
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
191 instance, as obtained from calling @code{glyph-image-instance} on a glyph
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
192 of type @code{pointer} -- either one of the above-mentioned variables or
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
193 one you created yourself. (See below for what it means to create a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
194 glyph of type @code{pointer}.) This pointer will last only until the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
195 next mouse motion event is processed or certain other things happen,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
196 such as creating or deleting a window. (In fact, the above-mentioned
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
197 pointer glyph variables are implemented as part of the default handler
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
198 for mouse motion events. If you want to customize this behavior, take a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
199 look at @code{mode-motion-hook}, or @code{mouse-motion-handler} if you
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
200 really want to get low-level.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
201
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
202 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
203 To use a glyph to control the shape of miscellaneous redisplay effects
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
204 such as the truncation and continuation markers, set the appropriate
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
205 existing glyph variables, as for icons and pointers above. See
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
206 @code{continuation-glyph}, @code{control-arrow-glyph},
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
207 @code{hscroll-glyph}, @code{invisible-text-glyph},
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
208 @code{octal-escape-glyph}, and @code{truncation-glyph}. See also
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
209 @code{overlay-arrow-string}, an odd redisplay leftover which can be set
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
210 to a glyph you created, and will cause the glyph to be displayed on top
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
211 of the text position specified in the marker stored in
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
212 @code{overlay-arrow-position}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
213
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
214 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
215 To use a glyph in a display table (i.e. to control the appearance of any
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
216 individual character), create the appropriate character glyphs and then
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
217 set a specification for the specifier @code{current-display-table},
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
218 which controls the appearance of characters. You can also set an
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
219 overriding display table for use with text displayed in a particular
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
220 face; see @code{set-face-display-table} and @code{make-display-table}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
221 #### Note: Display tables do not currently support general Mule
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
222 characters. They will be overhauled at some point to support this
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
223 and to provide other features required under Mule.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
224
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
225 @item
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
226 To use a glyph as the background pixmap of a face: Note that the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
227 background pixmap of a face is actually an image specifier -- probably
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
228 the only place in XEmacs where an image specifier occurs outside of a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
229 glyph. Similarly to how the glyph's image specifier works, you don't
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
230 create your own image specifier, but rather add specifications to the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
231 existing one (using @code{set-face-background-pixmap}). Note that the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
232 image instance that is generated in order to actually display the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
233 background pixmap is of type @code{mono-pixmap}, meaning that it's a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
234 two-color image and the foreground and background of the image get
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
235 filled in with the corresponding colors from the face.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
236 @end itemize
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
237
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
238 It is extremely rare that you will ever have to specify a value for
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
239 @var{type}, which should be one of @code{buffer} (used for glyphs in an
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
240 extent, the modeline, the toolbar, or elsewhere in a buffer),
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
241 @code{pointer} (used for the mouse-pointer), or @code{icon} (used for a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
242 frame's icon), and defaults to @code{buffer}. The only cases where it
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
243 needs to be specified is when creating icon or pointer glyphs, and in
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
244 both cases the necessary glyphs have already been created at startup and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
245 are accessed through the appropriate variables,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
246 e.g. @code{text-pointer-glyph} (or in general, @code{*-pointer-glyph})
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
247 and @code{frame-icon-glyph}. @xref{Glyph Types}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
248 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
249
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
250 @defun make-glyph-internal &optional type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
251 This function creates a new, uninitialized glyph of type @var{type}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
252 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
253
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
254 @defun make-pointer-glyph &optional spec-list
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
255
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
256 Return a new @code{pointer-glyph} object with the specification list
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
257 @var{spec-list}. This function is equivalent to calling
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
258 @code{make-glyph} with a @var{type} of @code{pointer}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
259
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
260 It is extremely unlikely that you will ever need to create a pointer
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
261 glyph. Instead, you probably want to be calling @code{set-glyph-image}
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
262 on an existing glyph, e.g. @code{text-pointer-glyph}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
263 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
264
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
265 @defun make-icon-glyph &optional spec-list
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
266
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
267 Return a new @code{pointer-glyph} object with the specification list
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
268 @var{spec-list}. This function is equivalent to calling
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
269 @code{make-glyph} with a @var{type} of @code{icon}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
270
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
271 It is extremely unlikely that you will ever need to create a pointer
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
272 glyph. Instead, you probably want to be calling @code{set-glyph-image}
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
273 on an existing glyph, e.g. @code{text-pointer-glyph}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 @node Glyph Properties
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 @subsection Glyph Properties
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
278
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
279 Each glyph has a list of properties, which control all of the aspects of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
280 the glyph's appearance. The following symbols have predefined meanings:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
281
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
282 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
283 @item image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
284 The image used to display the glyph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
285
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 @item baseline
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287 Percent above baseline that glyph is to be displayed. Only for glyphs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 displayed inside of a buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290 @item contrib-p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 Whether the glyph contributes to the height of the line it's on.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 Only for glyphs displayed inside of a buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 @item face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 Face of this glyph (@emph{not} a specifier).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 @defun set-glyph-property glyph property value &optional locale tag-set how-to-add
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 This function changes a property of a @var{glyph}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 For built-in properties, the actual value of the property is a specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 and you cannot change this; but you can change the specifications within
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 the specifier, and that is what this function will do. For user-defined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 properties, you can use this function to either change the actual value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 of the property or, if this value is a specifier, change the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306 specifications within it.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 If @var{property} is a built-in property, the specifications to be added
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 to this property can be supplied in many different ways:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 If @var{value} is a simple instantiator (e.g. a string naming a pixmap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 filename) or a list of instantiators, then the instantiator(s) will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315 added as a specification of the property for the given @var{locale}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 (which defaults to @code{global} if omitted).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
317
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
318 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
319 If @var{value} is a list of specifications (each of which is a cons of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
320 locale and a list of instantiators), then @var{locale} must be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
321 @code{nil} (it does not make sense to explicitly specify a locale in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
322 this case), and specifications will be added as given.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
323
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
324 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
325 If @var{value} is a specifier (as would be returned by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
326 @code{glyph-property} if no @var{locale} argument is given), then some
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
327 or all of the specifications in the specifier will be added to the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
328 property. In this case, the function is really equivalent to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
329 @code{copy-specifier} and @var{locale} has the same semantics (if it is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
330 a particular locale, the specification for the locale will be copied; if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
331 a locale type, specifications for all locales of that type will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
332 copied; if @code{nil} or @code{all}, then all specifications will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
333 copied).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
334 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
335
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
336 @var{how-to-add} should be either @code{nil} or one of the symbols
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
337 @code{prepend}, @code{append}, @code{remove-tag-set-prepend},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
338 @code{remove-tag-set-append}, @code{remove-locale},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
339 @code{remove-locale-type}, or @code{remove-all}. See
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
340 @code{copy-specifier} and @code{add-spec-to-specifier} for a description
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
341 of what each of these means. Most of the time, you do not need to worry
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
342 about this argument; the default behavior usually is fine.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
343
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
344 In general, it is OK to pass an instance object (e.g. as returned by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
345 @code{glyph-property-instance}) as an instantiator in place of an actual
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
346 instantiator. In such a case, the instantiator used to create that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
347 instance object will be used (for example, if you set a font-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
348 object as the value of the @code{font} property, then the font name used
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
349 to create that object will be used instead). If some cases, however,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
350 doing this conversion does not make sense, and this will be noted in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
351 documentation for particular types of instance objects.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
352
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
353 If @var{property} is not a built-in property, then this function will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
354 simply set its value if @var{locale} is @code{nil}. However, if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
355 @var{locale} is given, then this function will attempt to add
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
356 @var{value} as the instantiator for the given @var{locale}, using
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
357 @code{add-spec-to-specifier}. If the value of the property is not a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
358 specifier, it will automatically be converted into a @code{generic}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
359 specifier.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
360 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
361
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
362 @defun glyph-property glyph property &optional locale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
363 This function returns @var{glyph}'s value of the given @var{property}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
364
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
365 If @var{locale} is omitted, the @var{glyph}'s actual value for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
366 @var{property} will be returned. For built-in properties, this will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
367 a specifier object of a type appropriate to the property (e.g. a font or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
368 color specifier). For other properties, this could be anything.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
369
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
370 If @var{locale} is supplied, then instead of returning the actual value,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
371 the specification(s) for the given locale or locale type will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
372 returned. This will only work if the actual value of @var{property} is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
373 a specifier (this will always be the case for built-in properties, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
374 may or may not apply to user-defined properties). If the actual value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
375 of @var{property} is not a specifier, this value will simply be returned
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
376 regardless of @var{locale}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
377
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
378 The return value will be a list of instantiators (e.g. vectors
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
379 specifying pixmap data), or a list of specifications, each of which is a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
380 cons of a locale and a list of instantiators. Specifically, if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
381 @var{locale} is a particular locale (a buffer, window, frame, device, or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
382 @code{global}), a list of instantiators for that locale will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
383 returned. Otherwise, if @var{locale} is a locale type (one of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
384 symbols @code{buffer}, @code{window}, @code{frame}, or @code{device}),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
385 the specifications for all locales of that type will be returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
386 Finally, if @var{locale} is @code{all}, the specifications for all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
387 locales of all types will be returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
388
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
389 The specifications in a specifier determine what the value of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
390 @var{property} will be in a particular @dfn{domain} or set of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
391 circumstances, which is typically a particular Emacs window along with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
392 the buffer it contains and the frame and device it lies within. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
393 value is derived from the instantiator associated with the most specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
394 locale (in the order buffer, window, frame, device, and @code{global})
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
395 that matches the domain in question. In other words, given a domain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
396 (i.e. an Emacs window, usually), the specifier for @var{property} will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
397 first be searched for a specification whose locale is the buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
398 contained within that window; then for a specification whose locale is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
399 the window itself; then for a specification whose locale is the frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
400 that the window is contained within; etc. The first instantiator that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
401 is valid for the domain (usually this means that the instantiator is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
402 recognized by the device [i.e. the X server or TTY device] that the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
403 domain is on). The function @code{glyph-property-instance} actually does
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
404 all this, and is used to determine how to display the glyph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
405 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
406
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
407 @defun glyph-property-instance glyph property &optional domain default no-fallback
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
408 This function returns the instance of @var{glyph}'s @var{property} in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
409 specified @var{domain}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
410
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
411 Under most circumstances, @var{domain} will be a particular window, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
412 the returned instance describes how the specified property actually is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
413 displayed for that window and the particular buffer in it. Note that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
414 this may not be the same as how the property appears when the buffer is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
415 displayed in a different window or frame, or how the property appears in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
416 the same window if you switch to another buffer in that window; and in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
417 those cases, the returned instance would be different.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
418
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
419 The returned instance is an image-instance object, and you can query it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
420 using the appropriate image instance functions. For example, you could use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
421 @code{image-instance-depth} to find out the depth (number of color
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
422 planes) of a pixmap displayed in a particular window. The results might
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
423 be different from the results you would get for another window (perhaps
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
424 the user specified a different image for the frame that window is on; or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
425 perhaps the same image was specified but the window is on a different X
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
426 server, and that X server has different color capabilities from this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
427 one).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
429 @var{domain} defaults to the selected window if omitted.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
430
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
431 @var{domain} can be a frame or device, instead of a window. The value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
432 returned for such a domain is used in special circumstances when a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
433 more specific domain does not apply; for example, a frame value might be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
434 used for coloring a toolbar, which is conceptually attached to a frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
435 rather than a particular window. The value is also useful in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
436 determining what the value would be for a particular window within the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
437 frame or device, if it is not overridden by a more specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
438 specification.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
439
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
440 If @var{property} does not name a built-in property, its value will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
441 simply be returned unless it is a specifier object, in which case it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
442 will be instanced using @code{specifier-instance}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
443
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
444 Optional arguments @var{default} and @var{no-fallback} are the same as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
445 in @code{specifier-instance}. @xref{Specifiers}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
446 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
447
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
448 @defun remove-glyph-property glyph property &optional locale tag-set exact-p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
449 This function removes a property from a glyph. For built-in properties,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
450 this is analogous to @code{remove-specifier}. @xref{Specifiers,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
451 remove-specifier-p}, for the meaning of the @var{locale}, @var{tag-set},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
452 and @var{exact-p} arguments.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
453 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
454
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
455 @node Glyph Convenience Functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
456 @subsection Glyph Convenience Functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
457
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
458 The following functions are provided for working with specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
459 properties of a glyph. Note that these are exactly like calling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
460 the general functions described above and passing in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
461 appropriate value for @var{property}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
462
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
463 Remember that if you want to determine the ``value'' of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
464 specific glyph property, you probably want to use the @code{*-instance}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
465 functions. For example, to determine whether a glyph contributes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
466 to its line height, use @code{glyph-contrib-p-instance}, not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
467 @code{glyph-contrib-p}. (The latter will return a boolean specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
468 or a list of specifications, and you probably aren't concerned with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
469 these.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
470
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
471 @defun glyph-image glyph &optional locale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
472 This function is equivalent to calling @code{glyph-property} with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
473 a property of @code{image}. The return value will be an image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
474 specifier if @var{locale} is @code{nil} or omitted; otherwise,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
475 it will be a specification or list of specifications.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
476 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
477
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
478 @defun set-glyph-image glyph spec &optional locale tag-set how-to-add
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
479 This function is equivalent to calling @code{set-glyph-property} with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
480 a property of @code{image}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
481 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
482
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
483 @defun glyph-image-instance glyph &optional domain default no-fallback
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
484 This function returns the instance of @var{glyph}'s image in the given
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
485 @var{domain}, and is equivalent to calling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
486 @code{glyph-property-instance} with a property of @code{image}. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
487 return value will be an image instance.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
488
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
489 Normally @var{domain} will be a window or @code{nil} (meaning the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
490 selected window), and an instance object describing how the image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
491 appears in that particular window and buffer will be returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
492 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
493
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
494 @defun glyph-contrib-p glyph &optional locale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
495 This function is equivalent to calling @code{glyph-property} with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
496 a property of @code{contrib-p}. The return value will be a boolean
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
497 specifier if @var{locale} is @code{nil} or omitted; otherwise,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
498 it will be a specification or list of specifications.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
499 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
500
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
501 @defun set-glyph-contrib-p glyph spec &optional locale tag-set how-to-add
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
502 This function is equivalent to calling @code{set-glyph-property} with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
503 a property of @code{contrib-p}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
504 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
505
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
506 @defun glyph-contrib-p-instance glyph &optional domain default no-fallback
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
507 This function returns whether the glyph contributes to its line height
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
508 in the given @var{domain}, and is equivalent to calling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
509 @code{glyph-property-instance} with a property of @code{contrib-p}. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
510 return value will be either @code{nil} or @code{t}. (Normally @var{domain}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
511 will be a window or @code{nil}, meaning the selected window.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
512 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
513
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
514 @defun glyph-baseline glyph &optional locale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
515 This function is equivalent to calling @code{glyph-property} with a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
516 property of @code{baseline}. The return value will be a specifier if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
517 @var{locale} is @code{nil} or omitted; otherwise, it will be a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
518 specification or list of specifications.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
519 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
520
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
521 @defun set-glyph-baseline glyph spec &optional locale tag-set how-to-add
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
522 This function is equivalent to calling @code{set-glyph-property} with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
523 a property of @code{baseline}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
524 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
525
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
526 @defun glyph-baseline-instance glyph &optional domain default no-fallback
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
527 This function returns the instance of @var{glyph}'s baseline value in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
528 the given @var{domain}, and is equivalent to calling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
529 @code{glyph-property-instance} with a property of @code{baseline}. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
530 return value will be an integer or @code{nil}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
531
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
532 Normally @var{domain} will be a window or @code{nil} (meaning the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
533 selected window), and an instance object describing the baseline value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
534 appears in that particular window and buffer will be returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
535 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
536
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
537 @defun glyph-face glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
538 This function returns the face of @var{glyph}. (Remember, this is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
539 not a specifier, but a simple property.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
540 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
541
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
542 @defun set-glyph-face glyph face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
543 This function changes the face of @var{glyph} to @var{face}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
544 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
545
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
546 @node Glyph Dimensions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
547 @subsection Glyph Dimensions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
548
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
549 @defun glyph-width glyph &optional window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
550 This function returns the width of @var{glyph} on @var{window}. This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
551 may not be exact as it does not take into account all of the context
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
552 that redisplay will.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
553 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
554
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
555 @defun glyph-ascent glyph &optional window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
556 This function returns the ascent value of @var{glyph} on @var{window}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
557 This may not be exact as it does not take into account all of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
558 context that redisplay will.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
559 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
560
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
561 @defun glyph-descent glyph &optional window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
562 This function returns the descent value of @var{glyph} on @var{window}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
563 This may not be exact as it does not take into account all of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
564 context that redisplay will.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
565 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
566
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
567 @defun glyph-height glyph &optional window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
568 This function returns the height of @var{glyph} on @var{window}. (This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
569 is equivalent to the sum of the ascent and descent values.) This may
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
570 not be exact as it does not take into account all of the context that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
571 redisplay will.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
572 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
573
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
574 @node Images
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
575 @section Images
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
576
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
577 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
578 * Image Specifiers:: Specifying how an image will appear.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
579 * Image Instantiator Conversion::
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
580 Conversion is applied to image instantiators
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
581 at the time they are added to an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
582 image specifier or at the time they
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
583 are passed to @code{make-image-instance}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
584 * Image Instances:: What an image specifier gets instanced as.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
585 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
586
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
587 @node Image Specifiers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
588 @subsection Image Specifiers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
589 @cindex image specifiers
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
590
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
591 An image specifier is used to describe the actual image of a glyph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
592 It works like other specifiers (@pxref{Specifiers}), in that it contains
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
593 a number of specifications describing how the image should appear in a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
594 variety of circumstances. These specifications are called @dfn{image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
595 instantiators}. When XEmacs wants to display the image, it instantiates
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
596 the image into an @dfn{image instance}. Image instances are their own
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
597 primitive object type (similar to font instances and color instances),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
598 describing how the image appears in a particular domain. (On the other
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
599 hand, image instantiators, which are just descriptions of how the image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
600 should appear, are represented using strings or vectors.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
601
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
602 @defun image-specifier-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
603 This function returns non-@code{nil} if @var{object} is an image specifier.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
604 Usually, an image specifier results from calling @code{glyph-image} on
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
605 a glyph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
606 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
607
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
608 @defun make-image-specifier spec-list
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
609 This function creates a new image specifier object and initializes it
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
610 according to @var{spec-list}. @xref{Specifiers}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
611
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
612 Note that, in practice, you rarely, if ever, need to actually create an
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
613 image specifier! (This function exists mainly for completeness.) Pretty
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
614 much the only use for image specifiers is to control how glyphs are
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
615 displayed, and the image specifier associated with a glyph (the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
616 @code{image} property of a glyph) is created automatically when a glyph
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
617 is created and need not (and cannot, for that matter) ever be changed
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
618 (@pxref{Glyphs}). In fact, the design decision to create a separate
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
619 image specifier type, rather than make glyphs themselves be specifiers,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
620 is debatable---the other properties of glyphs are rarely used and could
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
621 conceivably have been incorporated into the glyph's instantiator. The
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
622 rarely used glyph types (buffer, pointer, icon) could also have been
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
623 incorporated into the instantiator.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
624 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
625
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
626 Image instantiators come in many formats: @code{xbm}, @code{xpm},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
627 @code{gif}, @code{jpeg}, etc. This describes the format of the data
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
628 describing the image. The resulting image instances also come in many
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
629 types---@code{mono-pixmap}, @code{color-pixmap}, @code{text},
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
630 @code{pointer}, etc. This refers to the behavior of the image and the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
631 sorts of places it can appear. (For example, a color-pixmap image has
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
632 fixed colors specified for it, while a mono-pixmap image comes in two
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
633 unspecified shades ``foreground'' and ``background'' that are determined
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
634 from the face of the glyph or surrounding text; a text image appears as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
635 a string of text and has an unspecified foreground, background, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
636 font; a pointer image behaves like a mono-pixmap image but can only be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
637 used as a mouse pointer [mono-pixmap images cannot be used as mouse
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
638 pointers]; etc.) It is important to keep the distinction between image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
639 instantiator format and image instance type in mind. Typically, a given
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
640 image instantiator format can result in many different image instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
641 types (for example, @code{xpm} can be instanced as @code{color-pixmap},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
642 @code{mono-pixmap}, or @code{pointer}; whereas @code{cursor-font} can be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
643 instanced only as @code{pointer}), and a particular image instance type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
644 can be generated by many different image instantiator formats (e.g.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
645 @code{color-pixmap} can be generated by @code{xpm}, @code{gif},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
646 @code{jpeg}, etc.).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
647
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
648 @xref{Image Instances}, for a more detailed discussion of image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
649 instance types.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
650
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
651 An image instantiator should be a string or a vector of the form
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
652
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
653 @example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
654 @code{[@var{format} @var{:keyword} @var{value} ...]}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
655 @end example
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
656
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
657 i.e. a format symbol followed by zero or more alternating keyword-value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
658 pairs. The @dfn{format} field should be a symbol, one of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
659
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
660 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
661 @item nothing
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
662 Don't display anything; no keywords are valid for this. Can only be
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
663 instanced as @code{nothing}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
664 @item string
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
665 Display this image as a text string. Can only be instanced
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
666 as @code{text}, although support for instancing as @code{mono-pixmap}
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
667 should be added.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
668 @item formatted-string
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
669 Display this image as a text string with replaceable fields,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
670 similar to a modeline format string; not currently implemented.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
671 @item xbm
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
672 An X bitmap; only if X support was compiled into this XEmacs. Can be
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
673 instanced as @code{mono-pixmap}, @code{color-pixmap}, or
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
674 @code{pointer}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
675 @item xpm
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
676 An XPM pixmap; only if XPM support was compiled into this XEmacs. Can
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
677 be instanced as @code{color-pixmap}, @code{mono-pixmap}, or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
678 @code{pointer}. XPM is an add-on library for X that was designed to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
679 rectify the shortcomings of the XBM format. Most implementations of X
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
680 include the XPM library as a standard part. If your vendor does not, it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
681 is highly recommended that you download it and install it. You can get
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
682 it from the standard XEmacs FTP site, among other places.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
683 @item xface
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
684 An X-Face bitmap, used to encode people's faces in e-mail messages;
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
685 only if X-Face support was compiled into this XEmacs. Can be instanced
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
686 as @code{mono-pixmap}, @code{color-pixmap}, or @code{pointer}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
687 @item gif
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
688 A GIF87 or GIF89 image; only if GIF support was compiled into this
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
689 XEmacs. Can be instanced as @code{color-pixmap}. Note that XEmacs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
690 includes GIF decoding functions as a standard part of it, so if you have
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
691 X support, you will normally have GIF support, unless you explicitly
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
692 disable it at configure time.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
693 @item jpeg
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
694 A JPEG-format image; only if JPEG support was compiled into this
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
695 XEmacs. Can be instanced as @code{color-pixmap}. If you have the JPEG
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
696 libraries present on your system when XEmacs is built, XEmacs will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
697 automatically detect this and use them, unless you explicitly disable it
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
698 at configure time.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
699 @item png
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
700 A PNG/GIF24 image; only if PNG support was compiled into this XEmacs.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
701 Can be instanced as @code{color-pixmap}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
702 @item tiff
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
703 A TIFF-format image; only if TIFF support was compiled into this XEmacs.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
704 @item cursor-font
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
705 One of the standard cursor-font names, such as @samp{watch} or
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
706 @samp{right_ptr} under X. Under X, this is, more specifically, any of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
707 the standard cursor names from appendix B of the Xlib manual [also known
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
708 as the file @file{<X11/cursorfont.h>}] minus the @samp{XC_} prefix. On
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
709 other window systems, the valid names will be specific to the type of
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
710 window system. Can only be instanced as @code{pointer}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
711 @item font
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
712 A glyph from a font; i.e. the name of a font, and glyph index into it
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
713 of the form @samp{@var{font} fontname index [[mask-font] mask-index]}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
714 Only if X support was compiled into this XEmacs. Currently can only be
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
715 instanced as @code{pointer}, although this should probably be fixed.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
716 @item mswindows-resource
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
717 An MS Windows pointer resource. Specifies a resource to retrieve
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
718 directly from the system (an OEM resource) or from a file, particularly
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
719 an executable file. If the resource is to be retrieved from a file, use
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
720 :file and optionally :resource-id. Otherwise use :resource-id. Always
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
721 specify :resource-type to specify the type (cursor, bitmap or icon) of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
722 the resource. Possible values for :resource-id are listed below. Can
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
723 be instanced as @code{pointer} or @code{color-pixmap}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
724 @item subwindow
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
725 An embedded windowing system window. Can only be instanced as
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
726 @code{subwindow}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
727 @item button
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
728 A button widget; either a push button, radio button or toggle button.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
729 Can only be instanced as @code{widget}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
730 @item combo-box
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
731 A drop list of selectable items in a widget, for editing text.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
732 Can only be instanced as @code{widget}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
733 @item edit-field
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
734 A text editing widget. Can only be instanced as @code{widget}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
735 @item label
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
736 A static, text-only, widget; for displaying text. Can only be instanced
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
737 as @code{widget}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
738 @item layout
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
739 A widget for controlling the positioning of children underneath it.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
740 Through the use of nested layouts, a widget hierarchy can be created
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
741 which can have the appearance of any standard dialog box or similar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
742 arrangement; all of this is counted as one @dfn{glyph} and could appear
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
743 in many of the places that expect a single glyph. Can only be instanced
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
744 as @code{widget}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
745 @item native-layout
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
746 @c #### Document me better!
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
747 The native version of a layout widget.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
748 Can only be instanced as @code{widget}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
749 @item progress-gauge
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
750 A sliding widget, for showing progress. Can only be instanced as
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
751 @code{widget}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
752 @item tab-control
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
753 A tab widget; a series of user selectable tabs. Can only be instanced
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
754 as @code{widget}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
755 @item tree-view
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
756 A folding widget. Can only be instanced as @code{widget}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
757 @item scrollbar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
758 A scrollbar widget. Can only be instanced as @code{widget}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
759 @item autodetect
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
760 XEmacs tries to guess what format the data is in. If X support exists,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
761 the data string will be checked to see if it names a filename. If so,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
762 and this filename contains XBM or XPM data, the appropriate sort of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
763 pixmap or pointer will be created. [This includes picking up any
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
764 specified hotspot or associated mask file.] Otherwise, if @code{pointer}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
765 is one of the allowable image-instance types and the string names a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
766 valid cursor-font name, the image will be created as a pointer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
767 Otherwise, the image will be displayed as text. If no X support exists,
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
768 the image will always be displayed as text.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
769 @item inherit
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
770 Inherit from the background-pixmap property of a face. Can only be
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
771 instanced as @code{mono-pixmap}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
772 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
773
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
774 The valid keywords are:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
775
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
776 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
777 @item :data
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
778 Inline data. For most formats above, this should be a string. For
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
779 XBM images, this should be a list of three elements: width, height, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
780 a string of bit data. This keyword is not valid for instantiator
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
781 format @code{nothing}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
782
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
783 @item :file
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
784 Data is contained in a file. The value is the name of this file. If
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
785 both @code{:data} and @code{:file} are specified, the image is created
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
786 from what is specified in @code{:data} and the string in @code{:file}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
787 becomes the value of the @code{image-instance-file-name} function when
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
788 applied to the resulting image-instance. This keyword is not valid for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
789 instantiator formats @code{nothing}, @code{string},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
790 @code{formatted-string}, @code{cursor-font}, @code{font}, and
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
791 @code{autodetect}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
792
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
793 @item :foreground
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
794 @itemx :background
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
795 For @code{xbm}, @code{xface}, @code{cursor-font}, and @code{font}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
796 These keywords allow you to explicitly specify foreground and background
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
797 colors. The argument should be anything acceptable to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
798 @code{make-color-instance}. This will cause what would be a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
799 @code{mono-pixmap} to instead be colorized as a two-color color-pixmap,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
800 and specifies the foreground and/or background colors for a pointer
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
801 instead of black and white.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
802
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
803 @item :mask-data
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
804 For @code{xbm} and @code{xface}. This specifies a mask to be used with the
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
805 bitmap. The format is a list of width, height, and bits, like for
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
806 @code{:data}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
807
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
808 @item :mask-file
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
809 For @code{xbm} and @code{xface}. This specifies a file containing the
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
810 mask data. If neither a mask file nor inline mask data is given for an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
811 XBM image, and the XBM image comes from a file, XEmacs will look for a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
812 mask file with the same name as the image file but with @samp{Mask} or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
813 @samp{msk} appended. For example, if you specify the XBM file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
814 @file{left_ptr} [usually located in @file{/usr/include/X11/bitmaps}],
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
815 the associated mask file @file{left_ptrmsk} will automatically be picked
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
816 up.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
817
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
818 @item :hotspot-x
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
819 @itemx :hotspot-y
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
820 For @code{xbm} and @code{xface}. These keywords specify a hotspot if
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
821 the image is instantiated as a @code{pointer}. Note that if the XBM
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
822 image file specifies a hotspot, it will automatically be picked up if no
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
823 explicit hotspot is given.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
824
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
825 @item :color-symbols
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
826 Only for @code{xpm}. This specifies an alist that maps strings that
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
827 specify symbolic color names to the actual color to be used for that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
828 symbolic color (in the form of a string or a color-specifier object).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
829 If this is not specified, the contents of @code{xpm-color-symbols} are
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
830 used to generate the alist.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
831 @item :resource-id
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
832 Only for @code{mswindows-resource}. This must be either an integer
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
833 (which directly specifies a resource number) or a string. Valid strings
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
834 are
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
835
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
836 For bitmaps:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
837
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
838 "close", "uparrow", "dnarrow", "rgarrow", "lfarrow",
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
839 "reduce", "zoom", "restore", "reduced", "zoomd",
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
840 "restored", "uparrowd", "dnarrowd", "rgarrowd", "lfarrowd",
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
841 "mnarrow", "combo", "uparrowi", "dnarrowi", "rgarrowi",
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
842 "lfarrowi", "size", "btsize", "check", "checkboxes", and
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
843 "btncorners".
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
844
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
845 For cursors:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
846
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
847 "normal", "ibeam", "wait", "cross", "up", "sizenwse",
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
848 "sizenesw", "sizewe", "sizens", "sizeall", and "no".
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
849
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
850 For icons:
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
851
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
852 "sample", "hand", "ques", "bang", "note", and "winlogo".
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
853 @item :resource-type
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
854 Only for @code{mswindows-resource}. This must be a symbol, either
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
855 @code{cursor}, @code{icon}, or @code{bitmap}, specifying the type of
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
856 resource to be retrieved.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
857 @item :face
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
858 Only for @code{inherit}. This specifies the face to inherit from. For
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
859 widgets this also specifies the face to use for display. It defaults to
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
860 gui-element-face.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
861 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
862
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
863 Keywords accepted as menu item specs are also accepted by widgets.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
864 These are @code{:selected}, @code{:active}, @code{:suffix},
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
865 @code{:keys}, @code{:style}, @code{:filter}, @code{:config},
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
866 @code{:included}, @code{:key-sequence}, @code{:accelerator},
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
867 @code{:label} and @code{:callback}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
868
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
869 If instead of a vector, the instantiator is a string, it will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
870 converted into a vector by looking it up according to the specs in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
871 @code{console-type-image-conversion-list} for the console type of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
872 the domain (usually a window; sometimes a frame or device) over which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
873 the image is being instantiated.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
874
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
875 If the instantiator specifies data from a file, the data will be read in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
876 at the time that the instantiator is added to the image specifier (which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
877 may be well before the image is actually displayed), and the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
878 instantiator will be converted into one of the inline-data forms, with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
879 the filename retained using a @code{:file} keyword. This implies that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
880 the file must exist when the instantiator is added to the image, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
881 does not need to exist at any other time (e.g. it may safely be a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
882 temporary file).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
883
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
884 @defun valid-image-instantiator-format-p format &optional locale
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
885 This function returns non-@code{nil} if @var{format} is a valid image
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
886 instantiator format.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
887
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
888 If @var{locale} is non-@code{nil} then the format is checked in that locale.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
889 If @var{locale} is @code{nil} the current console is used.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
890
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
891 Note that the return value for many formats listed above depends on
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
892 whether XEmacs was compiled with support for that format.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
893 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
894
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
895 @defun image-instantiator-format-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
896 This function return a list of valid image-instantiator formats.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
897 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
898
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
899 @defvar xpm-color-symbols
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
900 This variable holds definitions of logical color-names used when reading
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
901 XPM files. Elements of this list should be of the form
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
902 @code{(@var{color-name} @var{form-to-evaluate})}. The @var{color-name}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
903 should be a string, which is the name of the color to define; the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
904 @var{form-to-evaluate} should evaluate to a color specifier object, or a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
905 string to be passed to @code{make-color-instance} (@pxref{Colors}). If
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
906 a loaded XPM file references a symbolic color called @var{color-name},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
907 it will display as the computed color instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
908
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
909 The default value of this variable defines the logical color names
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
910 @samp{"foreground"} and @samp{"background"} to be the colors of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
911 @code{default} face.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
912 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
913
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
914 @defvar x-bitmap-file-path
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
915 A list of the directories in which X bitmap files may be found. If @code{nil},
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
916 this is initialized from the @samp{"*bitmapFilePath"} resource. This is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
917 used by the @code{make-image-instance} function (however, note that if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
918 the environment variable @samp{XBMLANGPATH} is set, it is consulted
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
919 first).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
920 @end defvar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
921
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
922 @node Image Instantiator Conversion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
923 @subsection Image Instantiator Conversion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
924 @cindex image instantiator conversion
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
925 @cindex conversion of image instantiators
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
926
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
927 @defun set-console-type-image-conversion-list console-type list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
928 This function sets the image-conversion-list for consoles of the given
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
929 @var{console-type}. The image-conversion-list specifies how image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
930 instantiators that are strings should be interpreted. Each element of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
931 the list should be a list of two elements (a regular expression string
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
932 and a vector) or a list of three elements (the preceding two plus an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
933 integer index into the vector). The string is converted to the vector
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
934 associated with the first matching regular expression. If a vector
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
935 index is specified, the string itself is substituted into that position
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
936 in the vector.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
937
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
938 Note: The conversion above is applied when the image instantiator is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
939 added to an image specifier, not when the specifier is actually
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
940 instantiated. Therefore, changing the image-conversion-list only affects
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
941 newly-added instantiators. Existing instantiators in glyphs and image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
942 specifiers will not be affected.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
943 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
944
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
945 @defun console-type-image-conversion-list console-type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
946 This function returns the image-conversion-list for consoles of the given
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
947 @var{console-type}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
948 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
949
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
950 @node Image Instances
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
951 @subsection Image Instances
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
952 @cindex image instances
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
953
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
954 Image-instance objects encapsulate the way a particular image (pixmap,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
955 etc.) is displayed on a particular device.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
956
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
957 In most circumstances, you do not need to directly create image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
958 instances; use a glyph instead. However, it may occasionally be useful
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
959 to explicitly create image instances, if you want more control over the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
960 instantiation process.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
961
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
962 @defun image-instance-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
963 This function returns non-@code{nil} if @var{object} is an image instance.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
964 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
965
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
966 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
967 * Image Instance Types:: Each image instances has a particular type.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
968 * Image Instance Functions:: Functions for working with image instances.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
969 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
970
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
971 @node Image Instance Types
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
972 @subsubsection Image Instance Types
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
973 @cindex image instance types
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
974
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
975 Image instances come in a number of different types. The type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
976 of an image instance specifies the nature of the image: Whether
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
977 it is a text string, a mono pixmap, a color pixmap, etc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
978
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
979 The valid image instance types are
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
980
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
981 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
982 @item nothing
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
983 Nothing is displayed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
984
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
985 @item text
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
986 Displayed as text. The foreground and background colors and the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
987 font of the text are specified independent of the pixmap. Typically
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
988 these attributes will come from the face of the surrounding text,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
989 unless a face is specified for the glyph in which the image appears.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
990
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
991 @item mono-pixmap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
992 Displayed as a mono pixmap (a pixmap with only two colors where the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
993 foreground and background can be specified independent of the pixmap;
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
994 typically the pixmap assumes the foreground and background colors of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
995 the text around it, unless a face is specified for the glyph in which
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
996 the image appears).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
997 @item color-pixmap
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
998
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
999 Displayed as a color pixmap.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1000
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1001 @item pointer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1002 Used as the mouse pointer for a window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1003
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1004 @item subwindow
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1005 A child window that is treated as an image. This allows (e.g.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1006 another program to be responsible for drawing into the window.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1007 Not currently implemented.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1008 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1009
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1010 @defun valid-image-instance-type-p type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1011 This function returns non-@code{nil} if @var{type} is a valid image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1012 instance type.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1013 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1014
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1015 @defun image-instance-type-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1016 This function returns a list of the valid image instance types.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1017 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1018
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1019 @defun image-instance-type image-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1020 This function returns the type of the given image instance. The return
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1021 value will be one of @code{nothing}, @code{text}, @code{mono-pixmap},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1022 @code{color-pixmap}, @code{pointer}, or @code{subwindow}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1023 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1024
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1025 @defun text-image-instance-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1026 This function returns non-@code{nil} if @var{object} is an image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1027 instance of type @code{text}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1028 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1029
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1030 @defun mono-pixmap-image-instance-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1031 This function returns non-@code{nil} if @var{object} is an image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1032 instance of type @code{mono-pixmap}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1033 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1034
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1035 @defun color-pixmap-image-instance-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1036 This function returns non-@code{nil} if @var{object} is an image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1037 instance of type @code{color-pixmap}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1038 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1039
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1040 @defun pointer-image-instance-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1041 This function returns non-@code{nil} if @var{object} is an image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1042 instance of type @code{pointer}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1043 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1044
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1045 @defun subwindow-image-instance-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1046 This function returns non-@code{nil} if @var{object} is an image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1047 instance of type @code{subwindow}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1048 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1049
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1050 @defun nothing-image-instance-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1051 This function returns non-@code{nil} if @var{object} is an image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1052 instance of type @code{nothing}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1053 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1054
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1055 @defun widget-image-instance-p object
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1056 Return @code{t} if @var{object} is an image instance of type @code{widget}.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1057 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1058
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1059 @node Image Instance Functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1060 @subsubsection Image Instance Functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1061
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1062 @defun make-image-instance data &optional domain dest-types noerror
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1063 This function creates a new image-instance object.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1064
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1065 @var{data} is an image instantiator, which describes the image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1066 (@pxref{Image Specifiers}).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1067
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1068 @var{dest-types} should be a list of allowed image instance types that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1069 can be generated. The @var{dest-types} list is unordered. If multiple
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1070 destination types are possible for a given instantiator, the ``most
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1071 natural'' type for the instantiator's format is chosen. (For XBM, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1072 most natural types are @code{mono-pixmap}, followed by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1073 @code{color-pixmap}, followed by @code{pointer}. For the other normal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1074 image formats, the most natural types are @code{color-pixmap}, followed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1075 by @code{mono-pixmap}, followed by @code{pointer}. For the string and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1076 formatted-string formats, the most natural types are @code{text},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1077 followed by @code{mono-pixmap} (not currently implemented), followed by
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1078 @code{color-pixmap} (not currently implemented). For MS Windows
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1079 resources, the most natural type for pointer resources is
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1080 @code{pointer}, and for the others it's @code{color-pixmap}. The other
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1081 formats can only be instantiated as one type. (If you want to control
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1082 more specifically the order of the types into which an image is
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1083 instantiated, just call @code{make-image-instance} repeatedly until it
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1084 succeeds, passing less and less preferred destination types each time.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1085
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1086 If @var{dest-types} is omitted, all possible types are allowed.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1087
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1088 @var{domain} specifies the domain to which the image instance will be
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1089 attached. This domain is termed the @dfn{governing domain}. The type
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1090 of the governing domain depends on the image instantiator
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1091 format. (Although, more correctly, it should probably depend on the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1092 image instance type.) For example, pixmap image instances are specific
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1093 to a device, but widget image instances are specific to a particular
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1094 XEmacs window because in order to display such a widget when two windows
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1095 onto the same buffer want to display the widget, two separate underlying
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1096 widgets must be created. (That's because a widget is actually a child
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1097 window-system window, and all window-system windows have a unique
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1098 existence on the screen.) This means that the governing domain for a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1099 pixmap image instance will be some device (most likely, the only
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1100 existing device), whereas the governing domain for a widget image
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1101 instance will be some XEmacs window.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1102
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1103 If you specify an overly general @var{domain} (e.g. a frame when a
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1104 window was wanted), an error is signaled. If you specify an overly
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1105 specific @var{domain} (e.g. a window when a device was wanted), the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1106 corresponding general domain is fetched and used instead. For
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1107 @code{make-image-instance}, it makes no difference whether you specify
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1108 an overly specific domain or the properly general domain derived from
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1109 it. However, it does matter when creating an image instance by
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1110 instantiating a specifier or glyph (e.g. with
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1111 @code{glyph-image-instance}), because the more specific domain causes
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1112 spec lookup to start there and proceed to more general domains. (It
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1113 would also matter when creating an image instance with an instantiator
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1114 format of @code{inherit}, but we currently disallow this. #### We should
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1115 fix this.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1116 n
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1117 If omitted, @var{domain} defaults to the selected window.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1118
444
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1119 @var{noerror} controls what happens when the image cannot be generated.
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1120 If @code{nil}, an error message is generated. If @code{t}, no messages
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1121 are generated and this function returns @code{nil}. If anything else, a
576fb035e263 Import from CVS: tag r21-2-37
cvs
parents: 442
diff changeset
1122 warning message is generated and this function returns @code{nil}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1123 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1124
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1125 @defun colorize-image-instance image-instance foreground background
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1126 This function makes the image instance be displayed in the given
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1127 colors. Image instances come in two varieties: bitmaps, which are 1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1128 bit deep which are rendered in the prevailing foreground and background
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1129 colors; and pixmaps, which are of arbitrary depth (including 1) and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1130 which have the colors explicitly specified. This function converts a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1131 bitmap to a pixmap. If the image instance was a pixmap already,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1132 nothing is done (and @code{nil} is returned). Otherwise @code{t} is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1133 returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1134 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1135
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1136 @defun image-instance-name image-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1137 This function returns the name of the given image instance.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1138 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1139
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1140 @defun image-instance-domain image-instance
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1141
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1142 Return the governing domain of the given @var{image-instance}. The
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1143 governing domain of an image instance is the domain that the image
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1144 instance is specific to. It is @emph{NOT} necessarily the domain that
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1145 was given to the call to @code{specifier-instance} that resulted in the
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1146 creation of this image instance. See @code{make-image-instance} for
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1147 more information on governing domains.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1148 @end defun
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1149
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1150
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1151 @defun image-instance-string image-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1152 This function returns the string of the given image instance. This will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1153 only be non-@code{nil} for text image instances.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1154 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1155
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1156 @defun image-instance-file-name image-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1157 This function returns the file name from which @var{image-instance} was
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1158 read, if known.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1159 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1160
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1161 @defun image-instance-mask-file-name image-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1162 This function returns the file name from which @var{image-instance}'s
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1163 mask was read, if known.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1164 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1165
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1166 @defun image-instance-depth image-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1167 This function returns the depth of the image instance. This is 0 for a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1168 mono pixmap, or a positive integer for a color pixmap.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1169 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1170
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1171 @defun image-instance-height image-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1172 This function returns the height of the image instance, in pixels.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1173 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1174
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1175 @defun image-instance-width image-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1176 This function returns the width of the image instance, in pixels.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1177 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1178
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1179 @defun image-instance-hotspot-x image-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1180 This function returns the X coordinate of the image instance's hotspot,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1181 if known. This is a point relative to the origin of the pixmap. When
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1182 an image is used as a mouse pointer, the hotspot is the point on the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1183 image that sits over the location that the pointer points to. This is,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1184 for example, the tip of the arrow or the center of the crosshairs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1185
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1186 This will always be @code{nil} for a non-pointer image instance.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1187 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1188
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1189 @defun image-instance-hotspot-y image-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1190 This function returns the Y coordinate of the image instance's hotspot,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1191 if known.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1192 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1193
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1194 @defun image-instance-foreground image-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1195 This function returns the foreground color of @var{image-instance}, if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1196 applicable. This will be a color instance or @code{nil}. (It will only
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1197 be non-@code{nil} for colorized mono pixmaps and for pointers.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1198 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1199
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1200 @defun image-instance-background image-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1201 This function returns the background color of @var{image-instance}, if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1202 applicable. This will be a color instance or @code{nil}. (It will only
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1203 be non-@code{nil} for colorized mono pixmaps and for pointers.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1204 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1205
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1206
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1207 @node Glyph Types
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1208 @section Glyph Types
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1209
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1210 Each glyph has a particular type, which controls how the glyph's image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1211 is generated. Each glyph type has a corresponding list of allowable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1212 image instance types that can be generated. When you call
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1213 @code{glyph-image-instance} to retrieve the image instance of a glyph,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1214 XEmacs does the equivalent of calling @code{make-image-instance} and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1215 passing in @var{dest-types} the list of allowable image instance types
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1216 for the glyph's type.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1217
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1218 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1219 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1220 @code{buffer} glyphs can be used as the begin-glyph or end-glyph of an
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1221 extent, in the modeline, and in the toolbar. Their image can be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1222 instantiated as @code{nothing}, @code{mono-pixmap}, @code{color-pixmap},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1223 @code{text}, and @code{subwindow}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1224
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1225 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1226 @code{pointer} glyphs can be used to specify the mouse pointer. Their
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1227 image can be instantiated as @code{pointer}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1228
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1229 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1230 @code{icon} glyphs can be used to specify the icon used when a frame is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1231 iconified. Their image can be instantiated as @code{mono-pixmap} and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1232 @code{color-pixmap}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1233 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1234
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1235 @defun glyph-type glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1236 This function returns the type of the given glyph. The return value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1237 will be a symbol, one of @code{buffer}, @code{pointer}, or @code{icon}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1238 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1239
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1240 @defun valid-glyph-type-p glyph-type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1241 Given a @var{glyph-type}, this function returns non-@code{nil} if it is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1242 valid.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1243 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1244
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1245 @defun glyph-type-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1246 This function returns a list of valid glyph types.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1247 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1248
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1249 @defun buffer-glyph-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1250 This function returns non-@code{nil} if @var{object} is a glyph of type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1251 @code{buffer}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1252 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1253
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1254 @defun icon-glyph-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1255 This function returns non-@code{nil} if @var{object} is a glyph of type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1256 @code{icon}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1257 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1258
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1259 @defun pointer-glyph-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1260 This function returns non-@code{nil} if @var{object} is a glyph of type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1261 @code{pointer}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1262 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1263
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1264 @node Mouse Pointer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1265 @section Mouse Pointer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1266 @cindex mouse cursor
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1267 @cindex cursor (mouse)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1268 @cindex pointer (mouse)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1269 @cindex mouse pointer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1270
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1271 The shape of the mouse pointer when over a particular section of a frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1272 is controlled using various glyph variables. Since the image of a glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1273 is a specifier, it can be controlled on a per-buffer, per-frame, per-window,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1274 or per-device basis.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1275
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1276 You should use @code{set-glyph-image} to set the following variables,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1277 @emph{not} @code{setq}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1278
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1279 @defvr Glyph text-pointer-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1280 This variable specifies the shape of the mouse pointer when over text.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1281 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1282
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1283 @defvr Glyph nontext-pointer-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1284 This variable specifies the shape of the mouse pointer when over a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1285 buffer, but not over text. If unspecified in a particular domain,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1286 @code{text-pointer-glyph} is used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1287 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1288
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1289 @defvr Glyph modeline-pointer-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1290 This variable specifies the shape of the mouse pointer when over the modeline.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1291 If unspecified in a particular domain, @code{nontext-pointer-glyph} is used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1292 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1293
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1294 @defvr Glyph selection-pointer-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1295 This variable specifies the shape of the mouse pointer when over a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1296 selectable text region. If unspecified in a particular domain,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1297 @code{text-pointer-glyph} is used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1298 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1299
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1300 @defvr Glyph gc-pointer-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1301 This variable specifies the shape of the mouse pointer when a garbage
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1302 collection is in progress. If the selected window is on a window system
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1303 and this glyph specifies a value (i.e. a pointer image instance) in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1304 domain of the selected window, the pointer will be changed as specified
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1305 during garbage collection. Otherwise, a message will be printed in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1306 echo area, as controlled by @code{gc-message}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1307 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1308
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1309 @defvr Glyph busy-pointer-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1310 This variable specifies the shape of the mouse pointer when XEmacs is busy.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1311 If unspecified in a particular domain, the pointer is not changed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1312 when XEmacs is busy.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1313 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1314
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1315 @defvr Glyph menubar-pointer-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1316 This variable specifies the shape of the mouse pointer when over the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1317 menubar. If unspecified in a particular domain, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1318 window-system-provided default pointer is used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1319 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1320
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1321 @defvr Glyph scrollbar-pointer-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1322 This variable specifies the shape of the mouse pointer when over a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1323 scrollbar. If unspecified in a particular domain, the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1324 window-system-provided default pointer is used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1325 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1326
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1327 @defvr Glyph toolbar-pointer-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1328 This variable specifies the shape of the mouse pointer when over a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1329 toolbar. If unspecified in a particular domain,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1330 @code{nontext-pointer-glyph} is used.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1331 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1332
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1333 Internally, these variables are implemented in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1334 @code{default-mouse-motion-handler}, and thus only take effect when the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1335 mouse moves. That function calls @code{set-frame-pointer}, which sets
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1336 the current mouse pointer for a frame.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1337
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1338 @defun set-frame-pointer frame image-instance
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1339 This function sets the mouse pointer of @var{frame} to the given pointer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1340 image instance. You should not call this function directly.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1341 (If you do, the pointer will change again the next time the mouse moves.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1342 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1343
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1344 @node Redisplay Glyphs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1345 @section Redisplay Glyphs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1346
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1347 @defvr Glyph truncation-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1348 This variable specifies what is displayed at the end of truncated lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1349 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1350
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1351 @defvr Glyph continuation-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1352 This variable specifies what is displayed at the end of wrapped lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1353 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1354
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1355 @defvr Glyph octal-escape-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1356 This variable specifies what to prefix character codes displayed in octal
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1357 with.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1358 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1359
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1360 @defvr Glyph hscroll-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1361 This variable specifies what to display at the beginning of horizontally
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1362 scrolled lines.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1363 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1364
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1365 @defvr Glyph invisible-text-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1366 This variable specifies what to use to indicate the presence of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1367 invisible text. This is the glyph that is displayed when an ellipsis is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1368 called for, according to @code{selective-display-ellipses} or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1369 @code{buffer-invisibility-spec}). Normally this is three dots (``...'').
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1370 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1371
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1372 @defvr Glyph control-arrow-glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1373 This variable specifies what to use as an arrow for control characters.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1374 @end defvr
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1375
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1376 @node Subwindows
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1377 @section Subwindows
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1378
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1379 Subwindows are not currently implemented.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1380
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1381 @defun subwindowp object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1382 This function returns non-@code{nil} if @var{object} is a subwindow.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1383 @end defun
707
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1384
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1385 @node Glyph Examples
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1386 @section Glyph Examples
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1387
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1388 For many applications, displaying graphics is a simple process: you
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1389 create a glyph, and then you insert it into a buffer.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1390
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1391 The easiest way to create a glyph is to use a file that contains a
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1392 graphical image, such as a JPEG, TIFF, or PNG file:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1393
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1394 @lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1395 ;; Create a glyph from a JPEG file:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1396 (setq foo (make-glyph [jpeg :file "/tmp/file1.jpg"]))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1397 @end lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1398
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1399 @lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1400 ;; Create a glyph from a XPM file:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1401 (setq foo (make-glyph [xpm :file "/tmp/file2.xpm"]))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1402 @end lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1403
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1404 @lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1405 ;; Create a glyph from a PNG file:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1406 (setq foo (make-glyph [png :file "/tmp/file3.png"]))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1407 @end lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1408
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1409 @lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1410 ;; Create a glyph from a TIFF file:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1411 (setq foo (make-glyph [tiff :file "/tmp/file4.tiff"]))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1412 @end lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1413
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1414 The parameters passed to @code{make-glyph} are called "Image
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1415 Specifiers", and can handle more image types than those shown above.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1416 You can also put the raw image data into a string (e.g., if you put the
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1417 contents of a JPEG file into a string), and use that to create a glyph.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1418 @xref{Image Specifiers}, for more information.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1419
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1420 @quotation
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1421 @strong{Caution}: In order for XEmacs to read a particular graphics file
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1422 format, support for that format must have been compiled into XEmacs.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1423 It's possible, although somewhat unlikely, for XEmacs to have been
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1424 compiled without support for any of the various graphics file formats.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1425 To see what graphics formats your particular version of XEmacs supports,
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1426 use @kbd{M-x describe-installation}.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1427
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1428 To programmatically query whether or not a particular file format is
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1429 supported, you can use the @code{featurep} function, with one of:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1430 @code{gif}, @code{tiff}, @code{jpeg}, @code{xpm}, @code{xbm},
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1431 @code{png}, or @code{xface}. For an up-to-date list, @ref{Image
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1432 Specifiers}. Example:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1433
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1434 @example
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1435 ;; Returns `t' if TIFF is supported:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1436 (featurep 'tiff)
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1437 @end example
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1438
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1439 Another example is:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1440
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1441 @example
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1442 ;; Returns a list of `t' or `nil', depending on whether or not the
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1443 ;; corresponding feature is supported:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1444 (mapcar #'(lambda (format-symbol) (featurep format-symbol))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1445 '(gif tiff jpeg xpm png))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1446 @end example
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1447
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1448 @end quotation
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1449
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1450 Once you have a glyph, you can then insert it into a buffer. Example:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1451
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1452 @lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1453 ;; Use this function to insert a glyph at the left edge of point in the
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1454 ;; current buffer. Any existing glyph at this location is replaced.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1455 (defun insert-glyph (gl)
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1456 "Insert a glyph at the left edge of point."
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1457 (let ( (prop 'myimage) ;; myimage is an arbitrary name, chosen
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1458 ;; to (hopefully) not conflict with any
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1459 ;; other properties. Change it if
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1460 ;; necessary.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1461 extent )
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1462 ;; First, check to see if one of our extents already exists at
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1463 ;; point. For ease-of-programming, we are creating and using our
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1464 ;; own extents (multiple extents are allowed to exist/overlap at the
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1465 ;; same point, and it's quite possible for other applications to
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1466 ;; embed extents in the current buffer without your knowledge).
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1467 ;; Basically, if an extent, with the property stored in "prop",
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1468 ;; exists at point, we assume that it is one of ours, and we re-use
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1469 ;; it (this is why it is important for the property stored in "prop"
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1470 ;; to be unique, and only used by us).
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1471 (if (not (setq extent (extent-at (point) (current-buffer) prop)))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1472 (progn
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1473 ;; If an extent does not already exist, create a zero-length
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1474 ;; extent, and give it our special property.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1475 (setq extent (make-extent (point) (point) (current-buffer)))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1476 (set-extent-property extent prop t)
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1477 ))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1478 ;; Display the glyph by storing it as the extent's "begin-glyph".
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1479 (set-extent-property extent 'begin-glyph gl)
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1480 ))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1481
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1482 ;; You can then use this function like:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1483 (insert-glyph (make-glyph [jpeg :file "/tmp/file1.jpg"]))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1484 ;; This will insert the glyph at point.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1485
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1486 ;; Here's an example of how to insert two glyphs side-by-side, at point
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1487 ;; (using the above code):
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1488 (progn
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1489 (insert-glyph (make-glyph [jpeg :file "/tmp/file1.jpg"]))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1490 ;; Create a new extent at point. We can't simply call "insert-glyph",
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1491 ;; as "insert-glyph" will simply replace the first glyph with the
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1492 ;; second.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1493 (setq extent (make-extent (point) (point) (current-buffer)))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1494 ;; Here, we're only setting the 'myimage property in case we need
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1495 ;; to later identify/locate/reuse this particular extent.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1496 (set-extent-property extent 'myimage t)
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1497 (set-extent-property extent 'begin-glyph
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1498 (make-glyph [jpeg :file "/tmp/file2.jpg"]))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1499 )
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1500
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1501 @end lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1502
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1503 Here are the gory details:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1504
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1505 @itemize @bullet
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1506
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1507 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1508 Glyphs are displayed by attaching them to extents (see @ref{Extents}),
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1509 either to the beginning or the end of extents.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1510
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1511 Note that extents can be used for many things, and not just for
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1512 displaying images (although, in the above example, we are creating our
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1513 own extent for the sole purpose of displaying an image). Also, note
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1514 that multiple extents are allowed to exist at the same position, and
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1515 they can overlap.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1516
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1517 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1518 Glyphs are often displayed inside the text area (alongside text). This
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1519 is the default.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1520
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1521 Although glyphs can also be displayed in the margins, how to do this
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1522 will not be described here. For more information on this, see
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1523 @ref{Annotation Basics} (look for information on "layout types") and
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1524 @ref{Extent Properties} (look for @code{begin-glyph-layout} and
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1525 @code{end-glyph-layout}).
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1526
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1527 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1528 The easiest way to insert a glyph into text is to create a zero-length
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1529 extent at the point where you want the glyph to appear.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1530
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1531 Note that zero-length extents are attached to the character to the
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1532 right of the extent; deleting this character will also delete the extent.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1533
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1534 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1535 It's often a good idea to assign a unique property to the newly-created
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1536 extent, in case you later want to locate it, and replace any existing
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1537 glyph with a different one (or just delete the existing one). In the
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1538 above example, we are using "myimage" as our (hopefully) unique property
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1539 name.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1540
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1541 If you need to locate all of the extents, you'll have to use functions
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1542 like @code{extent-list} or @code{next-extent}, or provide additional
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1543 parameters to the @code{extent-at} function. Assigning a unique
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1544 property to the extent makes it easy to locate your extents; for
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1545 example, @code{extent-list} can return only those extents with a
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1546 particular property. @xref{Finding Extents}, and @ref{Mapping Over
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1547 Extents}, for more information.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1548
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1549 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1550 Glyphs are displayed by assigning then to the @code{begin-glyph} or
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1551 @code{end-glyph} property of the extent. For zero-length extents, it
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1552 doesn't really matter if you assign the glyph to the @code{begin-glyph}
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1553 or @code{end-glyph} property, as they are both at the same location;
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1554 however, for non-zero-length extents (extents that cover one or more
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1555 characters of text), it does matter which one you use.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1556
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1557 Assigning @code{nil} to the @code{begin-glyph} or @code{end-glyph}
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1558 property will delete any existing glyph. In this case, you may also
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1559 want to delete the extent, assuming that the extent is used for no other
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1560 purpose.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1561
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1562 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1563 If you happen to insert two glyphs, side-by-side, note that the example
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1564 @code{insert-glyph} function will have trouble, if it's again used at
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1565 the same point (it can only locate one of the two extents).
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1566 @xref{Finding Extents}, and @ref{Mapping Over Extents}, for more
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1567 information on locating extents in a buffer.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1568
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1569 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1570 Among other things, glyphs provide a way of displaying graphics
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1571 alongside text. Note, however, that glyphs only provide a way of
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1572 displaying graphics; glyphs are not actually part of the text, and are
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1573 only displayed alongside the text. If you save the text in the buffer,
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1574 the graphics are not saved. The low-level glyph code does not provide a
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1575 way of saving graphics with the text. If you need to save graphics and
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1576 text, you have to write your own code to do this, and this topic is
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1577 outside the scope of this discussion.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1578
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
1579 @end itemize