annotate man/lispref/glyphs.texi @ 5366:f00192e1cd49

Examining the result of #'length: `eql', not `=', it's better style & cheaper 2011-03-08 Aidan Kehoe <kehoea@parhasard.net> * buff-menu.el (list-buffers-noselect): * byte-optimize.el (byte-optimize-identity): * byte-optimize.el (byte-optimize-if): * byte-optimize.el (byte-optimize-nth): * byte-optimize.el (byte-optimize-nthcdr): * bytecomp.el (byte-compile-warn-wrong-args): * bytecomp.el (byte-compile-two-args-19->20): * bytecomp.el (byte-compile-list): * bytecomp.el (byte-compile-beginning-of-line): * bytecomp.el (byte-compile-set): * bytecomp.el (byte-compile-set-default): * bytecomp.el (byte-compile-values): * bytecomp.el (byte-compile-values-list): * bytecomp.el (byte-compile-integerp): * bytecomp.el (byte-compile-multiple-value-list-internal): * bytecomp.el (byte-compile-throw): * cl-macs.el (cl-do-arglist): * cl-macs.el (cl-parse-loop-clause): * cl-macs.el (multiple-value-bind): * cl-macs.el (multiple-value-setq): * cl-macs.el (get-setf-method): * cmdloop.el (command-error): * cmdloop.el (y-or-n-p-minibuf): * cmdloop.el (yes-or-no-p-minibuf): * coding.el (unencodable-char-position): * cus-edit.el (custom-face-prompt): * cus-edit.el (custom-buffer-create-internal): * cus-edit.el (widget-face-action): * cus-edit.el (custom-group-value-create): * descr-text.el (describe-char-unicode-data): * dialog-gtk.el (popup-builtin-question-dialog): * dragdrop.el (experimental-dragdrop-drop-log-function): * dragdrop.el (experimental-dragdrop-drop-mime-default): * easymenu.el (easy-menu-add): * easymenu.el (easy-menu-remove): * faces.el (read-face-name): * faces.el (set-face-stipple): * files.el (file-name-non-special): * font.el (font-combine-fonts): * font.el (font-set-face-font): * font.el (font-parse-rgb-components): * font.el (font-rgb-color-p): * font.el (font-color-rgb-components): * gnuserv.el (gnuserv-edit-files): * help.el (key-or-menu-binding): * help.el (function-documentation-1): * help.el (function-documentation): * info.el (info): * isearch-mode.el (isearch-exit): * isearch-mode.el (isearch-edit-string): * isearch-mode.el (isearch-*-char): * isearch-mode.el (isearch-complete1): * ldap.el (ldap-encode-country-string): * ldap.el (ldap-decode-string): * minibuf.el (read-file-name-internal-1): * minibuf.el (read-non-nil-coding-system): * minibuf.el (get-user-response): * mouse.el (drag-window-divider): * mule/ccl.el: * mule/ccl.el (ccl-compile-if): * mule/ccl.el (ccl-compile-break): * mule/ccl.el (ccl-compile-repeat): * mule/ccl.el (ccl-compile-write-repeat): * mule/ccl.el (ccl-compile-call): * mule/ccl.el (ccl-compile-end): * mule/ccl.el (ccl-compile-read-multibyte-character): * mule/ccl.el (ccl-compile-write-multibyte-character): * mule/ccl.el (ccl-compile-translate-character): * mule/ccl.el (ccl-compile-mule-to-unicode): * mule/ccl.el (ccl-compile-unicode-to-mule): * mule/ccl.el (ccl-compile-lookup-integer): * mule/ccl.el (ccl-compile-lookup-character): * mule/ccl.el (ccl-compile-map-multiple): * mule/ccl.el (ccl-compile-map-single): * mule/devan-util.el (devanagari-compose-to-one-glyph): * mule/devan-util.el (devanagari-composition-component): * mule/mule-cmds.el (finish-set-language-environment): * mule/viet-util.el: * mule/viet-util.el (viet-encode-viscii-char): * multicast.el (open-multicast-group): * newcomment.el (comment-quote-nested): * newcomment.el (comment-region): * newcomment.el (comment-dwim): * regexp-opt.el (regexp-opt-group): * replace.el (map-query-replace-regexp): * specifier.el (derive-device-type-from-tag-set): * subr.el (skip-chars-quote): * test-harness.el (test-harness-from-buffer): * test-harness.el (batch-test-emacs): * wid-edit.el (widget-choice-action): * wid-edit.el (widget-symbol-prompt-internal): * wid-edit.el (widget-color-action): * window-xemacs.el (push-window-configuration): * window-xemacs.el (pop-window-configuration): * window.el (quit-window): * x-compose.el (electric-diacritic): It's better style, and cheaper (often one assembler instruction vs. a C funcall in the byte code), to use `eql' instead of `=' when it's clear what numerical type a given result will be. Change much of our code to do this, with the help of a byte-compiler change (not comitted) that looked for calls to #'length (which always returns an integer) in its args.
author Aidan Kehoe <kehoea@parhasard.net>
date Tue, 08 Mar 2011 23:41:52 +0000
parents 1cecc3e9f0a0
children 68f8d295be49
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
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
10 A @dfn{glyph} is an object that is used for pixmaps, widgets, and
442
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
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
17 like. Basically, any place there is an image or something that acts
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
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 @defun glyphp object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21 This function returns @code{t} if @var{object} is a glyph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 @menu
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
25 * Glyph Intro:: Glyphs are abstract image specifications.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
26 * Images:: Specifying the appearance of glyphs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
27 * Using Glyphs:: Creating and displaying glyphs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
28 * Manipulating Glyphs:: Getting and setting glyph properties.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
29 * Glyph Examples:: Examples of how to work with glyphs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
30 @end menu
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
31
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
32
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
33 @node Glyph Intro
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
34 @section Glyph Introduction
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
35
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
36 In XEmacs, ``glyph'' does @strong{not} refer to a single unit of textual
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
37 display (the XEmacs term for that is @dfn{rune}, and runes are confined
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
38 to the internal implementation of redisplay), but rather is an
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
39 object encapsulating a graphical element, such as an image or widget (an
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
40 active GUI element such as a button or text entry field; X11 calls this a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
41 @dfn{widget}, while MS Windows uses the term @dfn{control}).
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
42 This graphical element could appear in a buffer, a margin, a gutter, or
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
43 a toolbar, or even externally to XEmacs as a mouse pointer or an icon,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
44 for example.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
45
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
46 On the other hand, by contrast with GNU Emacs 21, an XEmacs glyph is
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
47 not ``just'' an image. The actual image that is displayed (as opposed
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
48 to its position or clipping) is defined by an ``image specifier'' object
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
49 contained within the glyph. The separation between an image specifier
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
50 object and a glyph object is made because the glyph includes other
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
51 properties than just the actual image: e.g. the face it is displayed in,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
52 the alignment of the image, @emph{etc}. Also, an image specifier is
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
53 used in at least one place in XEmacs in lieu of a glyphs, namely the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
54 backing pixmap of a face.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
55
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
56 An image specifier is used because glyphs often have locale-specific
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
57 semantics. The most important example is semantics determined by the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
58 display device: you can't usefully display a JPEG on stdout, or a color
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
59 image on a monochrome display. But because the image property is a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
60 specifier in XEmacs, you can specify that a given glyph appear as a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
61 monochrome image on monochrome displays, a color image on color
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
62 displays, and as a string on TTYs. (Specifying a string for the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
63 @code{tty} device locale would give behavior like the @code{ALT}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
64 attribute of an @code{IMG} element in HTML.) Another is semantics
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
65 determined by the buffer or mode. (Unfortunately, currently there are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
66 no compelling examples of this for glyphs.)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
67
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
68 All this means that only one global glyph needs to exist for a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
69 particular purpose (e.g. the icon used to represent an iconified frame,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
70 the mouse pointer used over particular areas of a frame, etc.). Often
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
71 you need not (and should not!) create your own glyph, but rather modify
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
72 an existing one.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
73
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
74 In working with glyphs it is important to keep in mind the distinction
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
75 between a locale and a domain. A @dfn{locale} is specified by the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
76 programmer, and is an abstract link between a specification (for a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
77 glyph, its visual appearance) and a displayable object. The displayable
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
78 object may be a buffer or a window, or an object containing buffers or
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
79 windows such as frame, device, or console. A @dfn{domain} is an actual
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
80 display context, which must be concrete enough to enable XEmacs to
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
81 identify the device type. (Buffers may be displayed in windows on
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
82 different devices, even simultaneously, so a buffer cannot be a domain.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
83 Similarly, the global locale cannot be a domain.) @ref{Specifiers}, for
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
84 more information about specifier locales and domains.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
85
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
86
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
87 @node Images
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
88 @section Images
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
89
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
90 @menu
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
91 * Image Instantiators:: Specifying an image's appearance.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
92 * Image Instantiator Conversion:: Lazy realization of graphics.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
93 * Image Instantiator Formats:: A catalog of image descriptors.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
94 * Image Instances:: Classes of graphical objects.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
97
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
98 @node Image Instantiators
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
99 @subsection Image Instantiators
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
100 @cindex image instantiators
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
101
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
102 An @dfn{image instantiator} is a description of the actual graphical
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
103 realization of a glyph. For example, a typical image description is
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
104 @emph{the file system path to a PNG file}. Since redisplay doesn't know
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
105 about files, and in any case the image may need to be manipulated
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
106 (@emph{e.g.}, a face's background pixmap must be clipped and tiled), the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
107 PNG file must be converted internally to a window system bitmap or
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
108 pixmap object. We describe this process by writing that when XEmacs
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
109 displays the image, it @dfn{instantiates} the image instantiator
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
110 into an @dfn{image instance}. Image instances are an internal object
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
111 type (similar to font instances and color instances), describing how the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
112 image appears in a particular domain. On the other hand, image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
113 instantiators, which are just descriptions of how the image should
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
114 appear, are represented using Lisp strings or vectors.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
115
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
116 Furthermore the graphical realization will vary, and for some devices
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
117 may not even be a bitmapped graphic. These variations may be
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
118 controlled by the program by specifying different instantiators in
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
119 different locales. This is implemented with an @dfn{image specifier},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
120 a specifier whose specifications are image instantiators.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
121
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
122 Image specifiers are rarely if ever found by themselves. However, an
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
123 image specifier results from calling @code{glyph-image} on a glyph, or
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
124 retrieving the @code{background-pixmap} property of a face, and you can
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
125 check if some random object is an image specifier.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
126
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
127 @defun image-specifier-p object
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
128 This function returns non-@code{nil} if @var{object} is an image specifier.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
129 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
130
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
131 @defun make-image-specifier spec-list
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
132 This function creates a new image specifier object and initializes it
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
133 according to @var{spec-list}. @xref{Specifiers}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
134 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
135
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
136 This function exists mainly for completeness. In practice, you rarely,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
137 if ever, need to actually create an image specifier. Instead, they are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
138 implicitly created by the initialization of glyphs and faces, and the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
139 specifier member of these objects cannot be changed after
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
140 initialization; you may only set the specifications it contains.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
141
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
142 Image instantiators come in many formats: @code{xbm}, @code{xpm},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
143 @code{gif}, @code{jpeg}, etc. These denote the format of the data
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
144 describing the image. The resulting image instances also come in many
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
145 types---@code{mono-pixmap}, @code{color-pixmap}, @code{text},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
146 @code{pointer}, etc. This refers to the behavior of the image and the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
147 sorts of places it can appear. (For example, a color-pixmap image has
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
148 fixed colors specified for it, while a mono-pixmap image comes in two
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
149 unspecified shades ``foreground'' and ``background'' that are determined
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
150 from the face of the glyph or surrounding text; a text image appears as
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
151 a string of text and has an unspecified foreground, background, and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
152 font; a pointer image behaves like a mono-pixmap image but can only be
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
153 used as a mouse pointer [mono-pixmap images cannot be used as mouse
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
154 pointers]; etc.)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
155
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
156 It is important to keep the distinction between image instantiator
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
157 format and image instance type in mind. Typically, a given image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
158 instantiator format can result in many different image instance types.
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
159 For example, @code{xpm} can be instantiated as @code{color-pixmap},
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
160 @code{mono-pixmap}, or @code{pointer}; whereas @code{cursor-font} can be
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
161 instantiated only as @code{pointer}. On the other hand, a particular image
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
162 instance type can be generated by many different image instantiator
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
163 formats (e.g. @code{color-pixmap} can be generated by @code{xpm},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
164 @code{gif}, @code{jpeg}, etc.).
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
165
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
166 @xref{Image Instances}, for a more detailed discussion of image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
167 instance types.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
168
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
169 An image instantiator should be a string or a vector of the form
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
170
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
171 @example
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
172 @code{[@var{format} @var{:keyword} @var{value} ...]}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
173 @end example
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
174
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
175 i.e. a format symbol followed by zero or more alternating keyword-value
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
176 pairs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
177
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
178 The form of an instantiator can be checked with
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
179 @code{valid-instantiator-p} with a @var{TYPE} of @code{image},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
180 @ref{Specifier Validation Functions}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
181
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
182 For a complete list of the format symbols and their usage,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
183 @ref{Image Instantiator Formats}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
184
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
185 If the instantiator is a string, it will be converted into a vector by
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
186 looking it up according to the specs in the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
187 @code{console-type-image-conversion-list} for the console type of the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
188 domain (usually a window; sometimes a frame or device) over which the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
189 image is being instantiated.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
190
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
191 If the instantiator specifies data from a file, the data will be read in
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
192 at the time that the instantiator is added to the image specifier (which
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
193 may be well before the image is actually displayed), and the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
194 instantiator will be converted into one of the inline-data forms, with
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
195 the filename retained using a @code{:file} keyword. This implies that
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
196 the file must exist when the instantiator is added to the image, but
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
197 does not need to exist at any other time (e.g. it may safely be a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
198 temporary file).
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
199
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
200 The available keywords are given below. Note that some keywords are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
201 generally available (for example, the @code{:data} keyword may be used
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
202 with any format except @code{nothing}), while others are only available
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
203 for one format (@code{resource-id} is unique to the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
204 @code{mswindows-resource} format).
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
205
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
206 @table @code
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
207 @item :data
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
208 Inline image data. If available for a given format, it may be specified
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
209 directly by the program, or it may be a cache of file data previously
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
210 read. When present, it is used to instantiate the image in preference
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
211 to the file named by the @code{:file} property.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
212
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
213 The format of inline data is image-format-specific. For example, in
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
214 pixmap formats, the value should be a string, which is interpreted as an
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
215 octet-stream representing a bitmap or pixmap. But for text formats,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
216 it's string containing the text to be displayed, and for resource
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
217 formats, it's a string containing the name of the resource.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
218
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
219 @item :file
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
220 Data contained in a file. The value is the name of this file. If both
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
221 @code{:data} and @code{:file} are specified, the image is created from
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
222 what is specified in @code{:data} and the string in @code{:file} becomes
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
223 the value of the @code{image-instance-file-name} function when applied
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
224 to the resulting image-instance. Note that there is nothing to stop a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
225 program from changing either the @code{:file} or the @code{:data}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
226 property, and there is no way to detect such mischief. This means that
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
227 the data will @emph{not} be automatically reread if you change the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
228 @code{file} property; you must force it by removing the @code{:data}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
229 property.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
230 @c #### If there are ways to do this in-place, describe them.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
231 (One way to do this is replacing the whole specification with a new
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
232 vector.) This keyword is not valid for instantiator formats
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
233 @code{nothing}, @code{string}, @code{formatted-string},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
234 @code{cursor-font}, @code{font}, and @code{autodetect}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
235
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
236 @item :mask-data
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
237 Inline data for @code{xbm} and @code{xface}. This specifies a mask to
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
238 be used with the bitmap. Pixels which are not set in the mask will not
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
239 be written to the imaging device. The format is a list of width,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
240 height, and bits, as for @code{:data}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
241
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
242 @item :mask-file
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
243 For @code{xbm} and @code{xface}. This specifies a file containing the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
244 mask data. If neither a mask file nor inline mask data is given for an
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
245 XBM image, and the XBM image comes from a file, XEmacs will look for a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
246 mask file with the same name as the image file but with @samp{Mask} or
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
247 @samp{msk} appended. For example, if you specify the XBM file
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
248 @file{left_ptr} [usually located in @file{/usr/include/X11/bitmaps}],
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
249 the associated mask file @file{left_ptrmsk} will automatically be picked
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
250 up.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
251
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
252 @item :resource-id
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
253 Only for @code{mswindows-resource}. This must be either an integer
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
254 (which directly specifies a resource number) or a string. See the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
255 description of @code{mswindows-resource} for valid strings. @xref{Image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
256 Instantiator Formats}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
257
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
258 @item :foreground
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
259 @itemx :background
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
260 For @code{xbm}, @code{xface}, @code{cursor-font}, and @code{font}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
261 These keywords allow you to explicitly specify foreground and background
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
262 colors. The value should be anything acceptable to
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
263 @code{make-color-instance}. This will cause an external format that
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
264 would by default be instantiated as a @code{mono-pixmap} to instead be
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
265 instantiated as a two-color color-pixmap. This can be used to override
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
266 the colors specified by a glyph's face, for example. If the image is
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
267 instantiated as a pointer, they specify its foreground and/or
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
268 background, instead of the defaults of black and white.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
269
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
270 @item :hotspot-x
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
271 @itemx :hotspot-y
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
272 For @code{xbm} and @code{xface}. These keywords specify a hotspot if
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
273 the image is instantiated as a @code{pointer}. Note that if the XBM
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
274 image file specifies a hotspot, it will automatically be picked up if no
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
275 explicit hotspot is given.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
276
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
277 @item :color-symbols
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
278 Only for @code{xpm}. This specifies an alist that maps strings that
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
279 specify symbolic color names to the actual color to be used for that
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
280 symbolic color (in the form of a string or a color-specifier object).
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
281 If this is not specified, the contents of @code{xpm-color-symbols} are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
282 used to generate the alist.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
283
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
284 @item :resource-type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
285 Only for @code{mswindows-resource}. This must be a symbol, either
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
286 @code{cursor}, @code{icon}, or @code{bitmap}, specifying the type of
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
287 resource to be retrieved.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
288
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
289 @item :face
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
290 For @code{inherit} and the widget formats. This specifies the face to
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
291 inherit from. For widgets this specifies the face to use for display.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
292 It defaults to gui-element-face.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
293
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
294 @item :selected
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
295 @itemx :active
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
296 @itemx :suffix
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
297 @itemx :keys
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
298 @itemx :style
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
299 @itemx :filter
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
300 @itemx :config
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
301 @itemx :included
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
302 @itemx :key-sequence
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
303 @itemx :accelerator
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
304 @itemx :label
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
305 @itemx :callback
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
306 These keywords, accepted as menu item specs, are also accepted by images
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
307 instantiated as @code{widget}. For their semantics, @ref{Menu Format}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
308 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
309
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
310
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
311 @node Image Instantiator Conversion
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
312 @subsection Image Instantiator Conversion
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
313 @cindex image instantiator conversion
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
314 @cindex conversion of image instantiators
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
315
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
316 Conversion is applied to image instantiators at the time they are added
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
317 to an image specifier or at the time they are passed to
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
318 @code{make-image-instance}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
319
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
320 @defun set-console-type-image-conversion-list console-type list
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
321 This function sets the image-conversion-list for consoles of the given
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
322 @var{console-type}. The image-conversion-list specifies how image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
323 instantiators that are strings should be interpreted. Each element of
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
324 the list should be a list of two elements (a regular expression string
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
325 and a vector) or a list of three elements (the preceding two plus an
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
326 integer index into the vector). The string is converted to the vector
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
327 associated with the first matching regular expression. If a vector
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
328 index is specified, the string itself is substituted into that position
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
329 in the vector.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
330
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
331 Note: The conversion above is applied when the image instantiator is
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
332 added to an image specifier, not when the specifier is actually
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
333 instantiated. Therefore, changing the image-conversion-list only affects
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
334 newly-added instantiators. Existing instantiators in glyphs and image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
335 specifiers will not be affected.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
336 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
337
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
338 @defun console-type-image-conversion-list console-type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
339 This function returns the image-conversion-list for consoles of the given
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
340 @var{console-type}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
341 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
342
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
343
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
344 @node Image Instantiator Formats
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
345 @subsection Image Instantiator Formats
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
346 @cindex image instantiator formats
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
347
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
348 The @dfn{format} field of an image instantiator should be a symbol
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
349 denoting a valid format. Which formats are valid will depend on the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
350 features (such as image decoding libraries) available, on platform
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
351 support (MS Windows resource IDs make no sense on other platforms), and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
352 on the locale.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
353
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
354 @defun valid-image-instantiator-format-p format &optional locale
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
355 This function returns non-@code{nil} if @var{format} is a valid image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
356 instantiator format.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
357
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
358 If @var{locale} is non-@code{nil} then the format is checked in that locale.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
359 If @var{locale} is @code{nil} the current console is used.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
360
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
361 Note that the return value for many formats listed above depends on
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
362 whether XEmacs was compiled with support for that format.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
363 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
364
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
365 @defun image-instantiator-format-list
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
366 This function returns a list of valid image-instantiator formats.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
367 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
368
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
369 Here is a table of image-instantiator formats, giving the keywords that
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
370 are usable with each, and the kinds of instances that may result.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
371
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
372 @table @code
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
373 @item nothing
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
374 Don't display anything; no keywords are valid for this format. Can only be
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
375 instantiated as @code{nothing}.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
376
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
377 @item string
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
378 Display this image as a text string. Can only be instantiated
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
379 as @code{text}, although support for instantiation as @code{mono-pixmap}
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
380 should be added. The valid keyword is @code{:data}. The value should
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
381 be a string, and it is interpreted as a string of characters.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
382
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
383 @item formatted-string
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
384 Display this image as a text string with replaceable fields,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
385 similar to a modeline format string. The valid keyword is @code{:data}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
386 The value should be a string, and it is interpreted as a string of
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
387 characters containing format sequences.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
388
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
389 Not currently implemented.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
390
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
391 @item xbm
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
392 An X bitmap; available only if X support was compiled into this XEmacs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
393
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
394 If used in a buffer glyph, icon glyph, or face background pixmap, it
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
395 will be instantiated as @code{mono-pixmap} unless the @code{:foreground}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
396 or @code{:background} keywords are present. In the latter case it will
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
397 be instantiated as @code{color-pixmap} with the two specified colors.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
398 @c #### Check this.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
399 (Probably if @code{:foreground} or @code{:background} is omitted, it
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
400 defaults to black or white respectively.) If used in a pointer glyph,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
401 it will be instantiated as an @code{pointer}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
402
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
403 The valid keywords and their values are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
404 @table @code
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
405 @item :data
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
406 A list containing the height and width of the bitmap as integers, and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
407 a string interpreted as a bit vector according to the X11 standard XBM
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
408 bitmap format, in that order.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
409 @item :file
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
410 The name of a file containing standard XBM-format data. If it contains
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
411 a hotspot specification, it will be parsed and used if the hotspot is
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
412 not explicitly specified.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
413 @item :mask-data
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
414 A list containing the height and width of the bitmap as integers, and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
415 a string interpreted as a bit vector according to the X11 standard XBM
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
416 bitmap format, in that order. This bitmap is interpreted as the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
417 clipping region for the bitmap contained in the @code{:data} property.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
418 @item :mask-file
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
419 The name of a file containing standard XBM-format data. Interpreted as
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
420 the clipping region for the bitmap contained in the @code{:data} property.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
421 @item :foreground
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
422 @itemx :background
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
423 These keywords allow you to explicitly specify foreground and background
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
424 colors. The values should be acceptable to @code{make-color-instance}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
425 @item :hotspot-x
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
426 @itemx :hotspot-y
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
427 Integers denoting the hotspot (mouse pointer position), with (0,0) at
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
428 the top left corner. If given, these override any specification in the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
429 XBM file.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
430 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
431
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
432 @item xpm
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
433 An XPM pixmap; only available if XPM support was compiled into this XEmacs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
434
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
435 Can be instantiated as @code{color-pixmap}, @code{mono-pixmap}, or
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
436 @code{pointer}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
437
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
438 XPM is an add-on library for X that was designed to rectify the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
439 shortcomings of the XBM format. Many icons and labels used in the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
440 XEmacs GUI are still distributed in XPM format (although we are moving
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
441 to standardize on the PNG format). It is therefore highly desirable
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
442 that XPM be available in your XEmacs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
443
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
444 Most implementations of X include the XPM library as a standard part.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
445 If your vendor does not, it is highly recommended that you download it
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
446 and install it. You can get it from the XEmacs FTP site and mirrors, as
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
447 well as from most sites that distribute X11.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
448
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
449 The valid keywords and their values are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
450 @table @code
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
451 @item :data
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
452 A string interpreted as the contents of a standard XPM file.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
453 @item :file
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
454 The name of a file containing standard XPM-format data. If it contains
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
455 a hotspot specification, it will be parsed and used if the hotspot is
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
456 not explicitly specified.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
457 @c #### Does XPM provide for a hotspot?
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
458 @item :hotspot-x
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
459 @itemx :hotspot-y
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
460 Integers denoting the hotspot (mouse pointer position), with (0,0) at
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
461 the top left corner. If given, these override any specification in the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
462 XBM file.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
463 @c #### Check this.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
464 (This may not be true. The original documentation doesn't mention them
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
465 in connection with XPM, but a pointer needs a hotspot.)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
466 @item :color-symbols
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
467 An alist that maps the one- or two-character strings that specify
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
468 symbolic color names in the XPM file to the actual color to be used for
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
469 that symbolic color (in the form of a string acceptable as a color
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
470 instantiator, @ref{Color Specifiers}, or a color-specifier object).
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
471 If this is not specified, the contents of @code{xpm-color-symbols} are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
472 used to generate the alist.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
473 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
474
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
475 @item xface
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
476 An X-Face bitmap, used to encode people's faces in e-mail messages;
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
477 only available if X-Face support was compiled into this XEmacs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
478
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
479 Will be instantiated as @code{mono-pixmap}, @code{color-pixmap}, or
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
480 @code{pointer}, depending on the target instance type and the presence
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
481 of color keywords.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
482
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
483 The valid keywords and their values are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
484 @table @code
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
485 @item :data
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
486 A list containing the height and width of the bitmap as integers, and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
487 a string interpreted as a bit vector according to the X11 standard XBM
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
488 bitmap format, in that order.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
489 @item :file
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
490 The name of a file containing standard XBM-format data. If it contains
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
491 a hotspot specification, it will be parsed and used if the hotspot is
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
492 not explicitly specified.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
493 @item :mask-data
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
494 A list containing the height and width of the bitmap as integers, and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
495 a string interpreted as a bit vector according to the X11 standard XBM
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
496 bitmap format, in that order. This bitmap is interpreted as the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
497 clipping region for the bitmap contained in the @code{:data} property.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
498 @item :mask-file
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
499 The name of a file containing standard XBM-format data. Interpreted as
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
500 the clipping region for the bitmap contained in the @code{:data} property.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
501 @item :foreground
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
502 @itemx :background
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
503 These keywords allow you to explicitly specify foreground and background
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
504 colors. The values should be acceptable to @code{make-color-instance}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
505 @item :hotspot-x
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
506 @itemx :hotspot-y
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
507 Integers denoting the hotspot (mouse pointer position), with (0,0) at
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
508 the top left corner. If given, these override any specification in the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
509 XBM file.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
510 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
511
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
512 @item gif
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
513 @itemx jpeg
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
514 @itemx png
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
515 @itemx tiff
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
516 These are GIF87- or GIF89-format, JPEG-format, PNG/GIF24-format, and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
517 TIFF-format images, respectively. They are available only if
4708
1cecc3e9f0a0 Use giflib or libungif to provide GIF support, instead of using internal
Jerry James <james@xemacs.org>
parents: 2953
diff changeset
518 appropriate decoding support was built into XEmacs. If you have
1cecc3e9f0a0 Use giflib or libungif to provide GIF support, instead of using internal
Jerry James <james@xemacs.org>
parents: 2953
diff changeset
519 development support (both the libraries and the relevant C header files)
1cecc3e9f0a0 Use giflib or libungif to provide GIF support, instead of using internal
Jerry James <james@xemacs.org>
parents: 2953
diff changeset
520 available when XEmacs is built, the JPEG, PNG, GIF, and TIFF libraries
1cecc3e9f0a0 Use giflib or libungif to provide GIF support, instead of using internal
Jerry James <james@xemacs.org>
parents: 2953
diff changeset
521 will automatically be detected (in the ``usual places'') and linked into
1cecc3e9f0a0 Use giflib or libungif to provide GIF support, instead of using internal
Jerry James <james@xemacs.org>
parents: 2953
diff changeset
522 the build.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
523
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
524 Note that PNG is the standard format for images distributed with XEmacs,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
525 so it is highly recommended that PNG support be built in.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
526
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
527 All of these instantiators will be instantiated as @code{color-pixmap}.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
528
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
529 The valid keywords and their values are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
530 @table @code
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
531 @item :data
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
532 A string interpreted as the contents of a file containing data in the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
533 appropriate standard format.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
534 @item :file
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
535 The name of a file containing standard-format data.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
536 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
537
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
538 @item cursor-font
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
539 Most window systems provide a set of standard cursors, which in X11 is
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
540 called a cursor font. Can only be instantiated as @code{pointer}. This
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
541 should probably be fixed.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
542
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
543 The valid keyword is @code{:data}. Its value should be a string
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
544 containing one of the standard cursor-font names, such as @samp{watch}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
545 or @samp{right_ptr} under X. More specifically, in the X Window System
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
546 it may be any of the standard cursor names from appendix B of the Xlib
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
547 manual, provided in the file @file{<X11/cursorfont.h>} by most
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
548 distributions, minus the @samp{XC_} prefix. For MS Windows, use
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
549 @code{mswindows-resource} instantiator format, not @code{cursor-font}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
550 Other window systems may have different lists.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
551
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
552 @item font
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
553 A glyph from a font; i.e. the name of a font, and glyph index into it
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
554 of the form @samp{@var{font} fontname index [[mask-font] mask-index]}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
555 Only if X support was compiled into this XEmacs. Currently can only be
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
556 instantiated as @code{pointer}. This should probably be fixed.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
557 @c #### The above description is not very helpful, so it's not obvious
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
558 @c how to instantiate a font image.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
559
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
560 @item mswindows-resource
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
561 An MS Windows pointer resource. Specifies a resource to retrieve
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
562 directly from the system (an OEM resource) or from a file, particularly
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
563 an executable file. Can be instantiated as @code{pointer} or
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
564 @code{color-pixmap}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
565
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
566 The valid keywords and their values are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
567
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
568 @table @code
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
569 @item :resource-type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
570 A string naming the type (@code{cursor}, @code{bitmap}, or @code{icon})
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
571 of the resource. Required.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
572 @item :file
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
573 A string containing the name of the file containing the resource (often
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
574 an executable). If a system resource, @code{:file} should be omitted.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
575 @item :resource-id
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
576 A string containing the name of a resource. Required if @code{:file}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
577 is not specified.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
578
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
579 This must be either an integer (which directly specifies a resource
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
580 number) or a string. Valid strings are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
581
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
582 For bitmaps:
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
583
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
584 "close", "uparrow", "dnarrow", "rgarrow", "lfarrow",
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
585 "reduce", "zoom", "restore", "reduced", "zoomd",
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
586 "restored", "uparrowd", "dnarrowd", "rgarrowd", "lfarrowd",
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
587 "mnarrow", "combo", "uparrowi", "dnarrowi", "rgarrowi",
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
588 "lfarrowi", "size", "btsize", "check", "checkboxes", and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
589 "btncorners".
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
590
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
591 For cursors:
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
592
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
593 "normal", "ibeam", "wait", "cross", "up", "sizenwse",
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
594 "sizenesw", "sizewe", "sizens", "sizeall", and "no".
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
595
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
596 For icons:
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
597
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
598 "sample", "hand", "ques", "bang", "note", and "winlogo".
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
599 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
600
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
601 @item subwindow
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
602 An embedded windowing system window. Can only be instantiated as
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
603 @code{subwindow}. Not implemented.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
604 @c #### Check status of subwindows ... I thought Andy implemented them.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
605
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
606 @item button
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
607 A button widget; either a push button, radio button or toggle button.
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
608 Can only be instantiated as @code{widget}.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
609
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
610 @item combo-box
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
611 A drop list of selectable items in a widget, for editing text.
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
612 Can only be instantiated as @code{widget}.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
613
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
614 @item edit-field
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
615 A text editing widget. Can only be instantiated as @code{widget}.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
616
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
617 @item label
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
618 A static, text-only, widget; for displaying text. Can only be instantiated
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
619 as @code{widget}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
620
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
621 @item layout
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
622 A widget for controlling the positioning of children underneath it.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
623 Through the use of nested layouts, a widget hierarchy can be created
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
624 which can have the appearance of any standard dialog box or similar
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
625 arrangement; all of this is counted as one @dfn{glyph} and could appear
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
626 in many of the places that expect a single glyph. Can only be instantiated
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
627 as @code{widget}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
628
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
629 @item native-layout
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
630 The native version of a layout widget.
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
631 Can only be instantiated as @code{widget}.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
632
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
633 @item progress-gauge
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
634 A sliding widget, for showing progress. Can only be instantiated as
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
635 @code{widget}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
636
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
637 @item tab-control
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
638 A tab widget; a series of user selectable tabs. Can only be instantiated
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
639 as @code{widget}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
640
2297
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2182
diff changeset
641 The required keyword is @code{:items}. Its value should be a list of
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2182
diff changeset
642 vectors, whose first element is a string, the second element is a
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2182
diff changeset
643 callback (a Lisp expression to be eval'ed), and the remaining elements
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2182
diff changeset
644 are key-value pairs. The most important keyword is @code{:selected} (a
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2182
diff changeset
645 Boolean); exactly one of the elements should have a value of @code{t}
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2182
diff changeset
646 for the @code{:selected} property. Other keywords accepted include
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2182
diff changeset
647 @code{:descriptor} (a string), @code{:face} (a symbol naming a face),
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2182
diff changeset
648 @code{:orientation} (a symbol, one of @code{top}, @code{center},
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2182
diff changeset
649 @code{bottom}, @code{left}, or @code{right}), and @code{:pixel-width}
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2182
diff changeset
650 and @code{:pixel-height} (positive integers).
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2182
diff changeset
651
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2182
diff changeset
652 (The above is incomplete and may be inaccurate.)
13a418960a88 [xemacs-hg @ 2004-09-22 02:05:42 by stephent]
stephent
parents: 2182
diff changeset
653
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
654 @item tree-view
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
655 A folding widget. Can only be instantiated as @code{widget}.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
656
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
657 @item scrollbar
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
658 A scrollbar widget. Can only be instantiated as @code{widget}.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
659
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
660 @item autodetect
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
661 XEmacs tries to guess what format the data is in. If X support exists,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
662 the data string will be checked to see if it names a filename. If so,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
663 and this filename contains XBM or XPM data, the appropriate sort of
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
664 pixmap or pointer will be created. [This includes picking up any
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
665 specified hotspot or associated mask file.] Otherwise, if @code{pointer}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
666 is one of the allowable image-instance types and the string names a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
667 valid cursor-font name, the image will be created as a pointer.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
668 Otherwise, the image will be displayed as text. If no X support exists,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
669 the image will always be displayed as text.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
670
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
671 @item inherit
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
672 Inherit from the background-pixmap property of a face. Can only be
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
673 instantiated as @code{mono-pixmap}.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
674 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
675
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
676 There are two convenience variables for use with the XBM and XPM image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
677 formats.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
678
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
679 @defvar xpm-color-symbols
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
680 This variable holds definitions of logical color-names used when reading
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
681 XPM files. Elements of this list should be of the form
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
682 @code{(@var{color-name} @var{form-to-evaluate})}. The @var{color-name}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
683 should be a string, which is the name of the color to define; the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
684 @var{form-to-evaluate} should evaluate to a color specifier object, or a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
685 string to be passed to @code{make-color-instance} (@pxref{Colors}). If
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
686 a loaded XPM file references a symbolic color called @var{color-name},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
687 it will display as the computed color instead.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
688
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
689 The default value of this variable defines the logical color names
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
690 @samp{"foreground"} and @samp{"background"} to be the colors of the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
691 @code{default} face.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
692 @end defvar
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
693
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
694 @defvar x-bitmap-file-path
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
695 A list of the directories in which X bitmap files may be found. If @code{nil},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
696 this is initialized from the @samp{"*bitmapFilePath"} resource. This is
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
697 used by the @code{make-image-instance} function (however, note that if
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
698 the environment variable @samp{XBMLANGPATH} is set, it is consulted
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
699 first).
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
700 @end defvar
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
701
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
702
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
703 @node Image Instances
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
704 @subsection Image Instances
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
705 @cindex image instances
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
706
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
707 Image-instance objects encapsulate the way a particular image (pixmap,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
708 etc.) is displayed on a particular device.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
709
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
710 In most circumstances, you do not need to directly create image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
711 instances; use a glyph instead. However, it may occasionally be useful
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
712 to explicitly create image instances, if you want more control over the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
713 instantiation process.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
714
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
715 @defun image-instance-p object
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
716 This function returns non-@code{nil} if @var{object} is an image instance.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
717 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
718
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
719 @menu
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
720 * Image Instance Types:: Each image instance has a particular type.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
721 * Image Instance Functions:: Functions for working with image instances.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
722 @end menu
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
723
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
724
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
725 @node Image Instance Types
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
726 @subsubsection Image Instance Types
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
727 @cindex image instance types
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
728
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
729 Image instances come in a number of different types. The type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
730 of an image instance specifies the nature of the image: Whether
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
731 it is a text string, a mono pixmap, a color pixmap, etc.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
732
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
733 The valid image instance types are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
734
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
735 @table @code
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
736 @item nothing
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
737 Nothing is displayed.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
738
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
739 @item text
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
740 Displayed as text. The foreground and background colors and the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
741 font of the text are specified independent of the pixmap. Typically
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
742 these attributes will come from the face of the surrounding text,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
743 unless a face is specified for the glyph in which the image appears.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
744
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
745 @item mono-pixmap
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
746 Displayed as a mono pixmap (a pixmap with only two colors where the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
747 foreground and background can be specified independent of the pixmap;
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
748 typically the pixmap assumes the foreground and background colors of
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
749 the text around it, unless a face is specified for the glyph in which
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
750 the image appears).
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
751 @item color-pixmap
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
752
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
753 Displayed as a color pixmap.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
754
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
755 @item pointer
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
756 Used as the mouse pointer for a window.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
757
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
758 @item subwindow
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
759 A child window that is treated as an image. This allows (e.g.)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
760 another program to be responsible for drawing into the window.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
761 Not currently implemented.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
762 @c #### Check status of subwindows ... I thought Andy implemented them.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
763
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
764 @item widget
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
765 An active GUI element implemented as a ``widget'' or ``control'' of the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
766 underlying window system.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
767 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
768
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
769 The following functions are used to check whether an image instance type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
770 is valid in the running XEmacs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
771
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
772 @defun valid-image-instance-type-p type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
773 This function returns non-@code{nil} if @var{type} is a valid image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
774 instance type.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
775 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
776
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
777 @defun image-instance-type-list
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
778 This function returns a list of the valid image instance types.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
779 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
780
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
781 The following functions are used to determine the type of an image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
782 instance.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
783
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
784 @defun image-instance-type image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
785 Return the type of the given image instance. The return
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
786 value will be one of @code{nothing}, @code{text}, @code{mono-pixmap},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
787 @code{color-pixmap}, @code{pointer}, @code{subwindow}, or @code{widget}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
788 @c #### Check status of subwindows ... I thought Andy implemented them.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
789 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
790
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
791 @defun text-image-instance-p object
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
792 Return non-@code{nil} if @var{object} is an image instance of type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
793 @code{text}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
794 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
795
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
796 @defun mono-pixmap-image-instance-p object
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
797 Return non-@code{nil} if @var{object} is an image instance of type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
798 @code{mono-pixmap}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
799 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
800
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
801 @defun color-pixmap-image-instance-p object
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
802 Return non-@code{nil} if @var{object} is an image instance of type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
803 @code{color-pixmap}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
804 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
805
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
806 @defun pointer-image-instance-p object
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
807 Return non-@code{nil} if @var{object} is an image instance of type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
808 @code{pointer}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
809 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
810
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
811 @defun subwindow-image-instance-p object
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
812 Return non-@code{nil} if @var{object} is an image instance of type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
813 @code{subwindow}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
814 @c #### Check status of subwindows ... I thought Andy implemented them.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
815 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
816
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
817 @defun nothing-image-instance-p object
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
818 Return non-@code{nil} if @var{object} is an image instance of type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
819 @code{nothing}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
820 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
821
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
822 @defun widget-image-instance-p object
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
823 Return non-@code{nil} if @var{object} is an image instance of type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
824 @code{widget}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
825 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
826
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
827
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
828 @node Image Instance Functions
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
829 @subsubsection Image Instance Functions
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
830
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
831 @defun make-image-instance data &optional domain dest-types noerror
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
832 This function creates a new image-instance object.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
833
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
834 @var{data} is an image instantiator, which describes the image
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
835 (@pxref{Image Instantiators}).
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
836
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
837 @var{dest-types} should be a list of allowed image instance types that
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
838 can be generated. The @var{dest-types} list is unordered. If multiple
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
839 destination types are possible for a given instantiator, the ``most
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
840 natural'' type for the instantiator's format is chosen. These are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
841
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
842 @table @code
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
843 @item XBM
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
844 @c #### check xface
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
845 @itemx xface
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
846 @code{mono-pixmap}, then @code{color-pixmap}, then @code{pointer}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
847
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
848 @item XPM
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
849 @itemx GIF
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
850 @itemx JPEG
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
851 @itemx PNG
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
852 @itemx TIFF
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
853 @code{color-pixmap}, then @code{mono-pixmap}, then @code{pointer}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
854
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
855 @item string
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
856 @itemx formatted-string formats
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
857 @code{text}, then @code{mono-pixmap} (not currently implemented), then
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
858 @code{color-pixmap} (not currently implemented).
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
859
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
860 @item mswindows-resource
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
861 For pointer resources, @code{pointer}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
862
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
863 For the others, @code{color-pixmap}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
864 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
865
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
866 @c #### So what? This is a reference manual, list them, you lazy bastard!
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
867 The other formats can only be instantiated as one type.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
868
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
869 If you want to control more specifically the order of the types into
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
870 which an image is instantiated, call @code{make-image-instance}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
871 repeatedly until it succeeds, passing less and less preferred
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
872 destination types each time.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
873
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
874 If @var{dest-types} is omitted, all possible types are allowed.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
875
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
876 @var{domain} specifies the domain to which the image instance will be
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
877 attached. This domain is termed the @dfn{governing domain}. The type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
878 of the governing domain depends on the image instantiator format.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
879 (Although, more correctly, it should probably depend on the image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
880 instance type.) For example, pixmap image instances are specific to a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
881 device, but widget image instances are specific to a particular XEmacs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
882 window because in order to display such a widget when two windows onto
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
883 the same buffer want to display the widget, two separate underlying
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
884 widgets must be created. (That's because a widget is actually a child
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
885 window-system window, and all window-system windows have a unique
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
886 existence on the screen.) This means that the governing domain for a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
887 pixmap image instance will be some device (most likely, the only
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
888 existing device), whereas the governing domain for a widget image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
889 instance will be some XEmacs window.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
890
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
891 If you specify an overly general @var{domain} (e.g. a frame when a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
892 window was wanted), an error is signaled. If you specify an overly
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
893 specific @var{domain} (e.g. a window when a device was wanted), the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
894 corresponding general domain is fetched and used instead. For
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
895 @code{make-image-instance}, it makes no difference whether you specify
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
896 an overly specific domain or the properly general domain derived from
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
897 it. However, it does matter when creating an image instance by
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
898 instantiating a specifier or glyph (e.g. with
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
899 @code{glyph-image-instance}), because the more specific domain causes
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
900 spec lookup to start there and proceed to more general domains. (It
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
901 would also matter when creating an image instance with an instantiator
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
902 format of @code{inherit}, but we currently disallow this.)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
903 @c #### We should fix that.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
904
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
905 If omitted, @var{domain} defaults to the selected window.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
906
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
907 @var{noerror} controls what happens when the image cannot be generated.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
908 If @code{nil}, an error message is generated. If @code{t}, no messages
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
909 are generated and this function returns @code{nil}. If anything else, a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
910 warning message is generated and this function returns @code{nil}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
911 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
912
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
913 @defun colorize-image-instance image-instance foreground background
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
914 This function makes the image instance be displayed in the given
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
915 colors. Image instances come in two varieties: bitmaps, which are 1
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
916 bit deep which are rendered in the prevailing foreground and background
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
917 colors; and pixmaps, which are of arbitrary depth (including 1) and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
918 which have the colors explicitly specified. This function converts a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
919 bitmap to a pixmap. If the image instance was a pixmap already,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
920 nothing is done (and @code{nil} is returned). Otherwise @code{t} is
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
921 returned.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
922 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
923
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
924 The following functions are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
925
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
926 @defun image-instance-name image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
927 This function returns the name of the given image instance. The name is
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
928 typically taken from the @code{:file} property of the instantiator if
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
929 present, otherwise from the @code{:data} property.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
930 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
931
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
932 @defun image-instance-domain image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
933 Return the governing domain of the given @var{image-instance}. The
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
934 governing domain of an image instance is the domain that the image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
935 instance is specific to. It is @emph{NOT} necessarily the domain that
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
936 was given to the call to @code{specifier-instance} that resulted in the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
937 creation of this image instance. See @code{make-image-instance} for
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
938 more information on governing domains.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
939 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
940
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
941 @defun image-instance-string image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
942 This function returns the string of the given image instance. This will
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
943 only be non-@code{nil} for text image instances.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
944 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
945
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
946 @defun image-instance-file-name image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
947 This function returns the file name from which @var{image-instance} was
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
948 read, if known.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
949 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
950
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
951 @defun image-instance-mask-file-name image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
952 This function returns the file name from which @var{image-instance}'s
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
953 mask was read, if known.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
954 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
955
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
956 Pixmaps are considered to be three-dimensional. The height and width of
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
957 the pixel array that is displayed, and the color depth of its pixels,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
958 are accessed with these functions.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
959
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
960 @defun image-instance-depth image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
961 This function returns the depth of the image instance. This is 0 for a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
962 mono pixmap, or a positive integer for a color pixmap.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
963 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
964
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
965 @defun image-instance-height image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
966 This function returns the height of the image instance, in pixels.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
967 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
968
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
969 @defun image-instance-width image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
970 This function returns the width of the image instance, in pixels.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
971 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
972
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
973 The hotspot is a point relative to the origin of the pixmap. When
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
974 an image is used as a mouse pointer, the hotspot is the point on the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
975 image that sits over the location that the pointer points to. This is,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
976 for example, the tip of the arrow or the center of the crosshairs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
977
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
978 These functions access the coordinates of the hotspot. They simply
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
979 return @code{nil} for a non-pointer image instance.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
980
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
981 @defun image-instance-hotspot-x image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
982 This function returns the X coordinate of the image instance's hotspot,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
983 if known.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
984 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
985
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
986 @defun image-instance-hotspot-y image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
987 This function returns the Y coordinate of the image instance's hotspot,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
988 if known.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
989 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
990
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
991 Mono pixmaps and pointers may have their foreground and background
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
992 colors set when instantiated. Use these functions to access color
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
993 information.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
994
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
995 @defun image-instance-foreground image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
996 This function returns the foreground color of @var{image-instance}, if
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
997 applicable. This will be a color instance or @code{nil}. (It will only
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
998 be non-@code{nil} for colorized mono pixmaps and for pointers.)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
999 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1000
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1001 @defun image-instance-background image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1002 This function returns the background color of @var{image-instance}, if
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1003 applicable. This will be a color instance or @code{nil}. (It will only
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1004 be non-@code{nil} for colorized mono pixmaps and for pointers.)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1005 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1006
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1007
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1008 @node Using Glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1009 @section Using Glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1010
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1011 Glyph usage is unfortunately somewhat arcane. (For discussion of
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1012 rationale, @ref{Glyphs,,,Internals}.) Because they are not ``text,''
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1013 they cannot be inserted directly into a buffer. Instead, they are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1014 values of properties of extents attached to buffers or strings, values
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1015 of global variables such as mouse pointers, or as a component of a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1016 complex data structure such as a toolbar initializer. Although these
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1017 uses could probably streamlined, each structure has its own
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1018 requirements. Since glyphs are very flexible, it is possible to create
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1019 applications like the @file{edit-toolbar} and @file{xpm-mode} libraries
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1020 which display glyphs in a buffer (for reference while editing) that are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1021 normally used in a different context.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1022
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1023 Usage of glyphs can roughly be categorized as follows:
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1024
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1025 @table @strong
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1026 @item Buffer glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1027 Glyphs that are inserted in a buffer may be used for their own sake (for
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1028 example, image display in @file{w3}), as an accurate representation of
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1029 text that can't be displayed in usual fonts (equation display in
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1030 @file{preview-latex}), or as annotations (such as a marginal indication
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1031 of a bookmark). Glyphs are attached to buffers via extents.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1032
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1033 @item Redisplay glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1034 Glyphs can be used to create XEmacs-specific ``fonts''. For example,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1035 the character that indicates truncation of lines is implemented as the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1036 @code{truncation-glyph}. It is also possible to have XEmacs display a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1037 certain character using a custom glyph, via display tables.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1038
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1039 @item Frame glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1040 Glyphs are used to control the appearance of various other components of
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1041 the frame. They can be inserted in the modeline, the favicons are used
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1042 in Web browsers. They are used to specify the labels on toolbar
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1043 buttons. Finally, they can be inserted in the gutters. (The difference
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1044 between a glyph inserted in a gutter and a marginal annotation is that
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1045 the marginal annotation is tied to the text in the buffer. If the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1046 buffer line scrolls out of view, the marginal annotation will, as well.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1047 A gutter glyph does not move with the text.)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1048
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1049 Unfortunately, all these uses are special cases, and have their own
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1050 APIs, in contrast to glyphs in a buffer.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1051
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1052 @item External glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1053 External glyphs simply allow a consistent API for images. The images
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1054 are then passed to external software such as the window system itself
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1055 (mouse cursor shapes) and the window manager (icons to represent
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1056 minimized windows). XEmacs has no role in managing their use.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1057
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1058 @item Subwindow and widget glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1059 These do not constitute a context of use, but rather an important class of
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1060 glyph types. The difference between these and other glyphs is that
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1061 while their geometry is determined by XEmacs, their behavior is managed
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1062 separately, by internal mechanisms in the case of widgets, and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1063 (possibly) by another process in the case of subwindows.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1064 @c #### Check status of subwindows ... I thought Andy implemented them.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1065 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1066
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1067 Some simple concrete examples showing how to insert a glyph in a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1068 buffer are presented later. @ref{Glyph Examples}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1069
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1070 ``Creating Glyphs'' explains how to create glyphs. Creating a glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1071 using @code{make-glyph} does not specify @emph{where} the glyph will be
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1072 used, it only specifies @emph{what} the glyph will look like. The next
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1073 four sections explain how to embed glyphs in different display
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1074 contexts. Finally, the last two sections explain the special
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1075 considerations of using glyphs whose behavior is not determined by the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1076 code creating them, but by the glyph itself (a ``widget'' in X11 or
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1077 ``control'' in MS Windows or Aqua), or even by a separate process.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1078
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1079 @menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1080 * Creating Glyphs:: Creating new glyphs.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1081 * Buffer Glyphs:: Annotations are glyphs that appear in a buffer.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1082 * Redisplay Glyphs:: Glyphs controlling various redisplay functions.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1083 * Frame Glyphs:: Displaying glyphs in GUI components of the frame.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1084 * External Glyphs:: Icons and mouse pointers for the window system.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1085 * Native GUI Widgets:: Complex active elements treated as a single glyph.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1086 * Subwindows:: Externally-controlled subwindows in buffers.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1087 @c #### Check status of subwindows ... I thought Andy implemented them.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1088 @end menu
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1089
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1090 @node Creating Glyphs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1091 @subsection Creating Glyphs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1092
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1093 @defun make-glyph &optional spec-list type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1094 This function creates a new glyph object of type @var{type}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1095
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1096 The optional @var{spec-list} is used to initialize the glyph's image.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1097 It can be any spec-list of @dfn{image instantiator} accepted by
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1098 @code{canonicalize-spec-list}, @ref{Adding Specifications}. An
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1099 individual image instantiator may be a string, which is converted to a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1100 vector according to @code{console-type-image-conversion-list}, or a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1101 vector. The vector's first element specifies the @emph{external} format
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1102 of the data, such as a string, a PNG file, or an MS Windows resource.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1103 This is followed by properties (keyword-value pairs) specifying such
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1104 information as the name of a file containing an image, or pixmap data
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
1105 directly. @xref{Image Instantiators}.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1106
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1107 The optional @var{type} specifies the type of the glyph. @var{type}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1108 should be one of @code{buffer} (used for glyphs in an extent, the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1109 modeline, the toolbar, or elsewhere in a frame), @code{pointer} (used
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1110 for the mouse-pointer), or @code{icon} (used for a frame's icon), and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1111 defaults to @code{buffer}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1112 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1113
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1114 @var{spec-list} is the initializer for the glyph's @code{image}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1115 property, which is an image specifier. (Note that @dfn{image} as used
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1116 in the context of a glyph's @code{image} property or in the terms
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1117 @dfn{image specifier}, @dfn{image instantiator}, or @dfn{image instance}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1118 does not refer to what people normally think of as an image (which in
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1119 XEmacs is called a @dfn{pixmap}), but to any graphical element---a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1120 pixmap, a widget, or even a block of text, when used in the places that
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1121 call for a glyph.)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1122
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1123 The most common form of @var{spec-list} is a single image instantiator.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1124 (@strong{Compatibility note:} in GNU Emacs 21, a string used to
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1125 instantiate an image is interpreted as the name of an image file, which
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1126 is searched for and instantiated.) The conversion controlled by
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1127 @code{console-type-image-conversion-list} typically attempts to look up
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1128 the string as a file name in XEmacs's data directory path, and if this
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1129 fails, defaults to displaying the string as a text image instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1130 (@emph{i.e.}. the string itself.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1131
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1132 Fine control of a particular specification is provided by using a vector
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1133 as the image instantiator. More complicated instantiators allow lists
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1134 of instantiators to be specified (which are tried in order), or mappings
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1135 from locales to lists of instantiators, @emph{etc}. @xref{Specifiers},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1136 for more information about specification formats.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1137
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1138 As well as using @var{spec-list} to initialize the glyph, you can set
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1139 specifications using @code{set-glyph-image}. The glyph itself is not
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1140 actually a specifier, but rather is an object containing an image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1141 specifier (as well as other properties seldom set by user code).
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1142 Therefore, you cannot set or access specifications for the glyph's image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1143 by directly using @code{set-specifier}, @code{specifier-instance} or the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1144 like on the glyph; instead use them on @code{(glyph-image @var{glyph})}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1145 or use the convenience functions @code{set-glyph-image},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1146 @code{glyph-image-instance}, and @code{glyph-image}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1147
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1148 Glyph types reflect the fact that glyphs are used in contexts like
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1149 pointers and window manager icons, which are defined by external
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1150 programs such as the window system or window manager. These require
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1151 somewhat different @emph{internal} format, which is opaque to the user.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1152
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1153 It is extremely rare that you will ever have to specify a value for
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1154 @var{type}, which should be one of @code{buffer} (used for glyphs in an
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1155 extent, the modeline, the toolbar, or elsewhere in a buffer),
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1156 @code{pointer} (used for the mouse-pointer), or @code{icon} (used for a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1157 frame's icon), and defaults to @code{buffer}. The only cases where it
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1158 needs to be specified is when creating icon or pointer glyphs, and in
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1159 both cases the necessary glyphs have already been created at startup and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1160 are accessed through the appropriate variables,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1161 e.g. @code{text-pointer-glyph} (or in general, any
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1162 @samp{*-pointer-glyph}) and @code{frame-icon-glyph}. User code should
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1163 never need to create @code{pointer} or @code{icon} glyphs. @xref{Glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1164 Types}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1165
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1166 There are a few other glyph creation functions, normally used only
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1167 internally or at XEmacs initialization.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1168
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1169 @defun make-glyph-internal &optional type
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1170 This function creates a new, uninitialized glyph of type @var{type}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1171 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1172
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1173 @defun make-pointer-glyph &optional spec-list
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1174
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1175 Return a new @code{pointer-glyph} object with the specification list
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1176 @var{spec-list}. This function is equivalent to calling
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1177 @code{make-glyph} with a @var{type} of @code{pointer}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1178 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1179
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1180 @code{make-pointer-glyph} is normally used only by XEmacs initialization
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1181 code. It is extremely unlikely that you will ever need to create a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1182 pointer glyph. Instead, you probably want to be calling
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1183 @code{set-glyph-image} on an existing glyph,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1184 e.g. @code{text-pointer-glyph}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1185
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1186 @defun make-icon-glyph &optional spec-list
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1187
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1188 Return a new @code{icon-glyph} object with the specification list
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1189 @var{spec-list}. This function is equivalent to calling
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1190 @code{make-glyph} with a @var{type} of @code{icon}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1191 @end defun
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1192
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1193 @code{make-icon-glyph} is normally used only by XEmacs initialization
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1194 code. It is extremely unlikely that you will ever need to create a icon
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1195 glyph. Instead, you probably want to be calling @code{set-glyph-image}
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1196 on the existing glyph, @code{frame-icon-glyph}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1197
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1198
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1199 @node Buffer Glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1200 @subsection Buffer Glyphs
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1201
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1202 Creating a glyph using @code{make-glyph} does not specify @emph{where}
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1203 the glyph will be used, it only specifies @emph{what} the glyph will
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1204 look like. Once you have created a glyph, you specify where it will be
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1205 used by attaching it to an extent as a @emph{begin-glyph} or
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1206 @emph{end-glyph}.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1207
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1208 @table @code
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1209 @item buffer text
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1210 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
1211 use @code{set-extent-begin-glyph} or @code{set-extent-end-glyph} to set
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1212 a glyph to be displayed at the corresponding edge of the extent. (It is
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1213 common to create zero-width extents for this purpose.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1214
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1215 @item margins
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1216 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
1217 make sure the margin is visible by setting a value for the specifiers
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1218 @code{left-margin-width} or @code{right-margin-width}. (Not strictly necessary
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1219 when using margin glyphs with layout policy @code{whitespace}.) Follow
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1220 the same procedure above for inserting a glyph in a buffer, then
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1221 set a non-default layout policy for the glyph using
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1222 @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
1223 Alternatively, use the high-level annotations API (see
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1224 @code{make-annotation}). (In fact, you can also use the annotations
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1225 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
1226
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1227 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1228
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1229
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1230 @node Redisplay Glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1231 @subsection Redisplay Glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1232
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1233 To use a glyph to control the shape of miscellaneous redisplay effects
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1234 such as the truncation and continuation markers, set the appropriate
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1235 existing glyph variables with @code{set-glyph-image}. See
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1236 @code{continuation-glyph}, @code{control-arrow-glyph},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1237 @code{hscroll-glyph}, @code{invisible-text-glyph},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1238 @code{octal-escape-glyph}, and @code{truncation-glyph}. See also
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1239 @code{overlay-arrow-string}, an odd redisplay leftover which can be set
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1240 to a glyph you created, and will cause the glyph to be displayed on top
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1241 of the text position specified in the marker stored in
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1242 @code{overlay-arrow-position}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1243
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1244 To use a glyph in a display table (i.e. to control the appearance of any
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1245 individual character), create the appropriate character glyphs and then
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1246 set a specification for the specifier @code{current-display-table},
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1247 which controls the appearance of characters. You can also set an
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1248 overriding display table for use with text displayed in a particular
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1249 face; see @code{set-face-display-table} and @code{make-display-table}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1250 #### Note: Display tables do not currently support general Mule
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1251 characters. They will be overhauled at some point to support this
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1252 and to provide other features required under Mule. @ref{Display Tables}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1253
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1254 Glyphs are not actually used as the background pixmaps of faces, but the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1255 API is similar. The
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1256 background pixmap of a face is actually an image specifier -- probably
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1257 the only place in XEmacs where an image specifier occurs outside of a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1258 glyph. If you would like to use a glyph's image as a background pixmap,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1259 you can extract it with @code{glyph-image}, and then add it to a face.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1260 @xref{Face Convenience Functions}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1261
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1262 @defvr Glyph truncation-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1263 This variable specifies what is displayed at the end of truncated lines.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1264 @end defvr
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1265
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1266 @defvr Glyph continuation-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1267 This variable specifies what is displayed at the end of wrapped lines.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1268 @end defvr
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1269
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1270 @defvr Glyph octal-escape-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1271 This variable specifies what to prefix character codes displayed in octal
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1272 with.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1273 @end defvr
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1274
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1275 @defvr Glyph hscroll-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1276 This variable specifies what to display at the beginning of horizontally
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1277 scrolled lines.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1278 @end defvr
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1279
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1280 @defvr Glyph invisible-text-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1281 This variable specifies what to use to indicate the presence of
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1282 invisible text. This is the glyph that is displayed when an ellipsis is
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1283 called for, according to @code{selective-display-ellipses} or
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1284 @code{buffer-invisibility-spec}). Normally this is three dots (``...'').
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1285 @end defvr
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1286
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1287 @defvr Glyph control-arrow-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1288 This variable specifies what to use as an arrow for control characters.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1289 @end defvr
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1290
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1291
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1292 @node Frame Glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1293 @subsection Frame Glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1294
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1295 There are also a number of special objects whose appearance is specified
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1296 by a glyph. Most of these a global objects that you update with
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1297 @code{set-glyph-image}, such as mouse pointers. Frame icons, toolbar
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1298 button icons, and the modeline are the main non-text objects which
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1299 accept glyphs as elements.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1300
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1301 @table @code
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1302 @item modeline
2127
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1303 A glyph may be displayed in the modeline by inserting the glyph as one
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1304 of the elements of the modeline format. (Unfortunately you can't
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1305 currently put a begin glyph or end glyph on one of the modeline
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1306 extents---they're ignored.)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1307
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1308 @item toolbar
2127
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1309 To insert a glyph into a toolbar, specify it as the icon part of a toolbar
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1310 button, which in turn must be part of a toolbar instantiator (typically
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1311 set on the specifier @code{default-toolbar}).
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1312 See @code{default-toolbar} for more information. (As a convenience, you
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1313 may use a symbol in place of the glyph list in the toolbar button
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1314 instantiator; the symbol is evalled to get the glyph list. This
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1315 facilitates both creating the toolbar instantiator and modifying
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1316 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
1317 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
1318 variable @code{toolbar-mail-icon} (in general, @code{toolbar-*-icon})
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1319 and then calling @code{(set-specifier-dirty-flag default-toolbar)}.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1320 (#### Unfortunately this doesn't quite work the way it should; the
2127
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1321 change will appear in new frames, but not existing ones, because once an
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1322 image has been displayed the pixmap replaces the symbol for those domains.)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1323
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1324 @item gutter
2127
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1325 To insert a glyph into a gutter, use
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1326 @code{set-extent-begin-glyph} or @code{set-extent-end-glyph} to set a
2127
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1327 glyph to be displayed at the corresponding edge of extent in a string,
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1328 similar to the way you insert glyphs in a buffer. Then insert the
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1329 string into the gutter @ref{Specifying a Gutter}. Glyphs that are
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1330 frequently used in this way are @code{tab control} and @code{progress
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1331 bar} glyphs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1332
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1333 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1334
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1335
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1336 @node External Glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1337 @subsection External Glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1338 @cindex frame icon
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1339 @cindex icon, frame
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1340 @cindex mouse cursor
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1341 @cindex cursor (mouse)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1342 @cindex pointer (mouse)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1343 @cindex mouse pointer
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1344
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1345 There are two special kinds of glyph that are not displayed by XEmacs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1346 Instead, they are used to set the appearance of iconified frames and the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1347 mouse pointer. Because these uses are constrained by the window system,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1348 icons and pointers have their own special types @xref{Glyph Types}.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1349
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1350 You may use a glyph as the icon for a frame. Do not create a new glyph;
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1351 instead, change the specifications for the existing glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1352 @code{frame-icon-glyph} with @code{set-glyph-image}. This is a unique,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1353 predefined object. Although the natural usage is to set specifications
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1354 for the global locale or a frame locale, you can also arrange for a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1355 special icon when a frame's selected window displays a particular buffer
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1356 by using a buffer locale.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1357
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1358 The shape of the mouse pointer when over a particular section of a frame
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1359 is controlled using various glyph variables. Since the image of a glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1360 is a specifier, it can be controlled on a per-buffer, per-frame, per-window,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1361 or per-device basis.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1362
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1363 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
1364 glyph, but rather you change the specifications of various existing
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1365 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
1366 text, @code{modeline-pointer-glyph} for the pointer used over the
2127
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1367 modeline, etc. Do an apropos over @samp{pointer-glyph} to find all of
4657b5a54253 [xemacs-hg @ 2004-06-14 10:24:44 by stephent]
stephent
parents: 2028
diff changeset
1368 them. (Note also that you can temporarily set the mouse pointer to some
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1369 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
1370 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
1371 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
1372 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
1373 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
1374 next mouse motion event is processed or certain other things happen,
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1375 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
1376 pointer glyph variables are implemented as part of the default handler
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1377 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
1378 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
1379 really want to get low-level.)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1380
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1381 You should use @code{set-glyph-image} to set the following variables,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1382 @emph{not} @code{setq}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1383
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1384 @defvr Glyph text-pointer-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1385 This variable specifies the shape of the mouse pointer when over text.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1386 @end defvr
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1387
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1388 @defvr Glyph nontext-pointer-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1389 This variable specifies the shape of the mouse pointer when over a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1390 buffer, but not over text. If unspecified in a particular domain,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1391 @code{text-pointer-glyph} is used.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1392 @end defvr
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1393
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1394 @defvr Glyph modeline-pointer-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1395 This variable specifies the shape of the mouse pointer when over the modeline.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1396 If unspecified in a particular domain, @code{nontext-pointer-glyph} is used.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1397 @end defvr
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1398
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1399 @defvr Glyph selection-pointer-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1400 This variable specifies the shape of the mouse pointer when over a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1401 selectable text region. If unspecified in a particular domain,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1402 @code{text-pointer-glyph} is used.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1403 @end defvr
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1404
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1405 @defvr Glyph gc-pointer-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1406 This variable specifies the shape of the mouse pointer when a garbage
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1407 collection is in progress. If the selected window is on a window system
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1408 and this glyph specifies a value (i.e. a pointer image instance) in the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1409 domain of the selected window, the pointer will be changed as specified
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1410 during garbage collection. Otherwise, a message will be printed in the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1411 echo area, as controlled by @code{gc-message}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1412 @end defvr
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1413
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1414 @defvr Glyph busy-pointer-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1415 This variable specifies the shape of the mouse pointer when XEmacs is busy.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1416 If unspecified in a particular domain, the pointer is not changed
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1417 when XEmacs is busy.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1418 @end defvr
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1419
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1420 @defvr Glyph menubar-pointer-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1421 This variable specifies the shape of the mouse pointer when over the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1422 menubar. If unspecified in a particular domain, the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1423 window-system-provided default pointer is used.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1424 @end defvr
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1425
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1426 @defvr Glyph scrollbar-pointer-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1427 This variable specifies the shape of the mouse pointer when over a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1428 scrollbar. If unspecified in a particular domain, the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1429 window-system-provided default pointer is used.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1430 @end defvr
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1431
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1432 @defvr Glyph toolbar-pointer-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1433 This variable specifies the shape of the mouse pointer when over a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1434 toolbar. If unspecified in a particular domain,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1435 @code{nontext-pointer-glyph} is used.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1436 @end defvr
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1437
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1438 Internally, these variables are implemented in
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1439 @code{default-mouse-motion-handler}, and thus only take effect when the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1440 mouse moves. That function calls @code{set-frame-pointer}, which sets
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1441 the current mouse pointer for a frame.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1442
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1443 @defun set-frame-pointer frame image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1444 This function sets the mouse pointer of @var{frame} to the given pointer
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1445 image instance. You should not call this function directly.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1446 (If you do, the pointer will change again the next time the mouse moves.)
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1447 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1448
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1449
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1450 @node Native GUI Widgets
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1451 @subsection Native GUI Widgets
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1452 @cindex native widget
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1453
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1454 A ``native widget'' is a primitive GUI object defined either by the host
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1455 GUI platform or an external toolkit, and accessed from Lisp as a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1456 ``glyph.''
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1457
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1458 @menu
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1459 * Introduction to Widgets:: Native widgets provide tight integration of
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1460 GUI features with the platform GUI.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1461 * Lisp API to Native Widgets:: Native widgets are glyphs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1462 * Layouts:: Specifying composite widgets from Lisp.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1463 * Primitive Widgets:: Catalogue of available native widgets.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1464 @end menu
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1465
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1466 @node Introduction to Widgets
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1467 @subsubsection Introduction to Native Widgets and Subwindow Glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1468
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1469 Traditionally Emacsen have hidden the GUI apparatus from the Lisp
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1470 programmer, but in XEmacs 21.4 the ability to embed autonomous GUI
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1471 objects, called @dfn{native widgets}, in text was added to Lisp. They
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1472 are handled as @emph{glyphs}. Unlike traditional XEmacs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1473 glyphs such images and strings, native widgets are opaque to XEmacs, and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1474 must be able to redraw themselves because they are implemented as
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1475 subwindows, not as graphics drawn by XEmacs into the text window.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1476
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1477 Primitive widgets are coded in C using the underlying GUI toolkit, and
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1478 thus are beyond the scope of the @emph{XEmacs Lisp Reference Manual}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1479 However, composite widgets can be created in Lisp using ``layouts,''
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1480 which are horizontal or vertical arrays of subwidgets. For example, the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1481 search dialog is formatted using layouts.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1482
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1483 @node Lisp API to Native Widgets
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1484 @subsubsection Lisp API to Native Widgets
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1485
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1486 Native widgets are manipulated as @emph{glyphs} (@pxref{Glyphs}). Thus
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1487 they are created using @code{make-glyph}, with a format of one of the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1488 widget types and a @code{:data} property specific to the widget being
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
1489 instantiated.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1490
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1491 However, there is a technical difference between widgets and other kinds
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1492 of glyphs that is theoretically important. Because widgets
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1493 are active (that is, they can respond to user input events themselves),
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1494 it is possible for the user to become aware that two appearances of the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1495 ``same'' glyph are actually separate instances. For example, if a user
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1496 changes an image glyph from red to blue, and the buffer containing the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1497 glyph appears in more than one window, the user will perceive all the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1498 appearances to change from red to blue simultaneously. However, suppose
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1499 the glyph is a button glyph (@emph{e.g.}, as used in the Customize
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1500 buffer for the Set, Save, and Done buttons). Then if the Customize
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1501 buffer appears in several windows at the same time, and the user clicks
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1502 on the button, she will only perceive the button to be depressed in the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1503 window where she clicked the button.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1504
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1505 It seems from this example that it is unlikely to be a problem in
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1506 practice. When the user is faced with an active widget, it seems likely
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1507 that attention will focus on the widget being manipulated, and having
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1508 other instances of the widget respond simultaneously might be more
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1509 disconcerting than the actual case.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1510
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1511 @node Layouts
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1512 @subsubsection Layouts
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1513
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1514 An XEmacs @dfn{layout} is a one-dimensional array of glyphs. It is a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1515 widget for controlling the positioning of children underneath it.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1516 Through the use of nested layouts, a widget hierarchy can be created
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1517 which can have the appearance of any standard dialog box or similar
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1518 arrangement; all of this is counted as one "glyph" and could appear in
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1519 many of the places that expect a single glyph.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1520
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1521 (There are also @dfn{native layouts}, but I don't know what these are or
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1522 how they are used.)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1523
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1524 A layout descriptor is an image instantiator, @emph{i.e.}, a vector of
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1525 the form @samp{[FORMAT KEY-1 VALUE-1 KEY-2 VALUE-2 ...]} with format
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1526 @code{layout}, and properties
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1527
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1528 @c #### need defaults for these
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1529 @table @code
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1530 @item :orientation
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1531 Specifies the orientation of the contained array of glyphs. The value
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1532 must be one of the symbols @code{horizontal} or @code{vertical}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1533
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1534 @item :horizontally-justify
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1535 Specifies the horizontal justification of the items in the array. The
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1536 value must be one of the symbols @code{:right}, @code{:center}, or
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1537 @code{:left}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1538
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1539 @item :vertically-justify
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1540 Specifies the vertical justification of the items in the array. The
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1541 value must be one of the symbols @code{:top}, @code{:center}, or
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1542 @code{:bottom}.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1543
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1544 @item :justify
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1545 Specifies justification. #### not understood.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1546
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1547 @item :border
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1548 A glyph to place in the border. The value must be an image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1549 instantiator.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1550
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1551 @item :items
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1552 The glyphs controlled by the layout. The value must be a list of image
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1553 instantiators.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1554 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1555
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1556 Here is the specification of the search dialog widget created by
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1557 @code{make-search-dialog} in the @file{dialog-items} library, which
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1558 makes use of recursive layouts.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1559
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1560 @example
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1561 (make-glyph
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1562 `[layout
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1563 :orientation horizontal
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1564 :vertically-justify top
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1565 :horizontally-justify center
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1566 :border [string :data "Search"]
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1567 :items
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1568 ([layout :orientation vertical
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1569 :justify top ; implies left also
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1570 :items
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1571 ([string :data "Search for:"]
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1572 [button :descriptor "Match Case"
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1573 :style toggle
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1574 :selected (not case-fold-search)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1575 :callback (setq case-fold-search
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1576 (not case-fold-search))]
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1577 [button :descriptor "Regular Expression"
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1578 :style toggle
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1579 :selected search-dialog-regexp
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1580 :callback (setq search-dialog-regexp
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1581 (not search-dialog-regexp))]
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1582 [button :descriptor "Forwards"
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1583 :style radio
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1584 :selected search-dialog-direction
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1585 :callback (setq search-dialog-direction t)]
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1586 [button :descriptor "Backwards"
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1587 :style radio
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1588 :selected (not search-dialog-direction)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1589 :callback (setq search-dialog-direction nil)]
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1590 )]
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1591 [layout :orientation vertical
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1592 :vertically-justify top
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1593 :horizontally-justify right
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1594 :items
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1595 ([edit-field :width 15 :descriptor "" :active t
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1596 :initial-focus t]
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1597 [button :width 10 :descriptor "Find Next"
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1598 :callback-ex
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1599 (lambda (image-instance event)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1600 (search-dialog-callback ,parent
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1601 image-instance
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1602 event))]
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1603 [button :width 10 :descriptor "Cancel"
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1604 :callback-ex
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1605 (lambda (image-instance event)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1606 (isearch-dehighlight)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1607 (delete-frame
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1608 (event-channel event)))])])])
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1609 @end example
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1610
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1611 @node Primitive Widgets
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1612 @subsubsection Primitive Widgets
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1613
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1614 @c #### the following table should be replaced with a menu of nodes
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1615 @table @code
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1616 @item button
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1617 A button widget; either a push button, radio button or toggle
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1618 button.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1619
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1620 @item combo-box
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1621 A drop list of selectable items in a widget, for editing text.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1622
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1623 @item edit-field
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1624 A text editing widget.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1625
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1626 @item label
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1627 A static, text-only, widget; for displaying text.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1628
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1629 @item progress-gauge
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1630 A sliding widget, for showing progress.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1631
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1632 @item tab-control
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1633 A tab widget; a series of user selectable tabs.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1634
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1635 @item tree-view
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1636 A folding widget.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1637
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1638 @item scrollbar
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1639 A scrollbar widget. (#### Probably not the same as the scrollbar
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1640 controlling an Emacs window.)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1641 @end table
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1642
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1643
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1644 @node Subwindows
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1645 @subsection Subwindows
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1646
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1647 Subwindows are not currently implemented.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1648 @c #### Check status of subwindows ... I thought Andy implemented them.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1649
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1650 @defun subwindowp object
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1651 This function returns non-@code{nil} if @var{object} is a subwindow.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1652 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1653
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1654
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1655 @node Manipulating Glyphs
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1656 @section Manipulating Glyphs
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1657
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1658 Each glyphs has properties that may be accessed. Most of these can
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1659 also be set after the glyph is initialized, with the exception of the
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1660 glyph's type. This is not a real restriction, as it is almost never
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1661 useful to create glyphs of types other than @code{buffer}.
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1662
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1663 @menu
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1664 * Glyph Properties:: Accessing and modifying a glyph's properties.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1665 * Glyph Convenience Functions:: Accessing particular properties of a glyph.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1666 * Glyph Dimensions:: Determining the height, width, etc. of a glyph.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1667 * Glyph Types:: Each glyph has a particular type.
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1668 @end menu
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
1669
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1670
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1671 @node Glyph Properties
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1672 @subsection Glyph Properties
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1673
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1674 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
1675 the glyph's appearance. The following symbols have predefined meanings:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1676
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1677 @table @code
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1678 @item image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1679 The image used to display the glyph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1680
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1681 @item baseline
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1682 Percent above baseline that glyph is to be displayed. Only for glyphs
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1683 displayed inside of a buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1684
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1685 @item contrib-p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1686 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
1687 Only for glyphs displayed inside of a buffer.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1688
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1689 @item face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1690 Face of this glyph (@emph{not} a specifier).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1691 @end table
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1692
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1693 @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
1694 This function changes a property of a @var{glyph}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1695
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1696 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
1697 and you cannot change this; but you can change the specifications within
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1698 the specifier, and that is what this function will do. The glyph face
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1699 is an exception; it is a face name (a symbol) or a face object, not a
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1700 specifier. (The face properties themselves are typically specifiers.)
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1701 For user-defined properties, you can use this function to either change
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1702 the actual value of the property or, if this value is a specifier,
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1703 change the specifications within it.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1704
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1705 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
1706 to this property can be supplied in many different ways:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1707
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1708 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1709 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1710 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
1711 filename) or a list of instantiators, then the instantiator(s) will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1712 added as a specification of the property for the given @var{locale}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1713 (which defaults to @code{global} if omitted).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1714
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1715 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1716 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
1717 locale and a list of instantiators), then @var{locale} must be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1718 @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
1719 this case), and specifications will be added as given.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1720
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1721 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1722 If @var{value} is a specifier (as would be returned by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1723 @code{glyph-property} if no @var{locale} argument is given), then some
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1724 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
1725 property. In this case, the function is really equivalent to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1726 @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
1727 a particular locale, the specification for the locale will be copied; if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1728 a locale type, specifications for all locales of that type will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1729 copied; if @code{nil} or @code{all}, then all specifications will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1730 copied).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1731 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1732
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1733 @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
1734 @code{prepend}, @code{append}, @code{remove-tag-set-prepend},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1735 @code{remove-tag-set-append}, @code{remove-locale},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1736 @code{remove-locale-type}, or @code{remove-all}. See
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1737 @code{copy-specifier} and @code{add-spec-to-specifier} for a description
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1738 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
1739 about this argument; the default behavior usually is fine.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1740
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1741 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
1742 @code{glyph-property-instance}) as an instantiator in place of an actual
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1743 instantiator. In such a case, the instantiator used to create that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1744 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
1745 object as the value of the @code{font} property, then the font name used
2028
2ba4f06a264d [xemacs-hg @ 2004-04-19 08:02:27 by stephent]
stephent
parents: 1137
diff changeset
1746 to create that object will be used instead). In some cases, however,
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1747 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
1748 documentation for particular types of instance objects.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1749
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1750 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
1751 simply set its value if @var{locale} is @code{nil}. However, if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1752 @var{locale} is given, then this function will attempt to add
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1753 @var{value} as the instantiator for the given @var{locale}, using
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1754 @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
1755 specifier, it will automatically be converted into a @code{generic}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1756 specifier.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1757 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1758
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1759 @defun glyph-property glyph property &optional locale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1760 This function returns @var{glyph}'s value of the given @var{property}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1761
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1762 If @var{locale} is omitted, the @var{glyph}'s actual value for
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1763 @var{property} will be returned. For built-in properties, this will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1764 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
1765 color specifier). For other properties, this could be anything.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1766
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1767 If @var{locale} is supplied, then instead of returning the actual value,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1768 the specification(s) for the given locale or locale type will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1769 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
1770 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
1771 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
1772 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
1773 regardless of @var{locale}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1774
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1775 The return value will be a list of instantiators (e.g. vectors
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1776 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
1777 cons of a locale and a list of instantiators. Specifically, if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1778 @var{locale} is a particular locale (a buffer, window, frame, device, or
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1779 @code{global}), a list of instantiators for that locale will be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1780 returned. Otherwise, if @var{locale} is a locale type (one of the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1781 symbols @code{buffer}, @code{window}, @code{frame}, or @code{device}),
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1782 the specifications for all locales of that type will be returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1783 Finally, if @var{locale} is @code{all}, the specifications for all
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1784 locales of all types will be returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1785
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1786 The specifications in a specifier determine what the value of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1787 @var{property} will be in a particular @dfn{domain} or set of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1788 circumstances, which is typically a particular Emacs window along with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1789 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
1790 value is derived from the instantiator associated with the most specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1791 locale (in the order buffer, window, frame, device, and @code{global})
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1792 that matches the domain in question. In other words, given a domain
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1793 (i.e. an Emacs window, usually), the specifier for @var{property} will
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1794 first be searched for a specification whose locale is the buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1795 contained within that window; then for a specification whose locale is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1796 the window itself; then for a specification whose locale is the frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1797 that the window is contained within; etc. The first instantiator that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1798 is valid for the domain (usually this means that the instantiator is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1799 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
1800 domain is on). The function @code{glyph-property-instance} actually does
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1801 all this, and is used to determine how to display the glyph.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1802 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1803
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1804 @defun glyph-property-instance glyph property &optional domain default no-fallback
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1805 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
1806 specified @var{domain}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1807
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1808 Under most circumstances, @var{domain} will be a particular window, and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1809 the returned instance describes how the specified property actually is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1810 displayed for that window and the particular buffer in it. Note that
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1811 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
1812 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
1813 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
1814 those cases, the returned instance would be different.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1815
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1816 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
1817 using the appropriate image instance functions. For example, you could use
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1818 @code{image-instance-depth} to find out the depth (number of color
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1819 planes) of a pixmap displayed in a particular window. The results might
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1820 be different from the results you would get for another window (perhaps
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1821 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
1822 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
1823 server, and that X server has different color capabilities from this
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1824 one).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1825
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1826 @var{domain} defaults to the selected window if omitted.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1827
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1828 @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
1829 returned for such a domain is used in special circumstances when a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1830 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
1831 used for coloring a toolbar, which is conceptually attached to a frame
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1832 rather than a particular window. The value is also useful in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1833 determining what the value would be for a particular window within the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1834 frame or device, if it is not overridden by a more specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1835 specification.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1836
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1837 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
1838 simply be returned unless it is a specifier object, in which case it
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
1839 will be instantiated using @code{specifier-instance}.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1840
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1841 Optional arguments @var{default} and @var{no-fallback} are the same as
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1842 in @code{specifier-instance}. @xref{Specifiers}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1843 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1844
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1845 @defun remove-glyph-property glyph property &optional locale tag-set exact-p
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1846 This function removes a property from a glyph. For built-in properties,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1847 this is analogous to @code{remove-specifier}. @xref{Specifiers,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1848 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
1849 and @var{exact-p} arguments.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1850 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1851
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1852
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1853 @node Glyph Convenience Functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1854 @subsection Glyph Convenience Functions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1855
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1856 The following functions are provided for working with specific
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1857 properties of a glyph. Note that these are exactly like calling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1858 the general functions described above and passing in the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1859 appropriate value for @var{property}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1860
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1861 Remember that if you want to determine the ``value'' of a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1862 specific glyph property, you probably want to use the @code{*-instance}
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1863 functions. For example, to determine whether a glyph contributes
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1864 to its line height, use @code{glyph-contrib-p-instance}, not
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1865 @code{glyph-contrib-p}. (The latter will return a boolean specifier
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1866 or a list of specifications, and you probably aren't concerned with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1867 these.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1868
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1869 @defun glyph-image glyph &optional locale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1870 This function is equivalent to calling @code{glyph-property} with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1871 a property of @code{image}. The return value will be an image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1872 specifier if @var{locale} is @code{nil} or omitted; otherwise,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1873 it will be a specification or list of specifications.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1874 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1875
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1876 @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
1877 This function is equivalent to calling @code{set-glyph-property} with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1878 a property of @code{image}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1879 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1880
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1881 @defun glyph-image-instance glyph &optional domain default no-fallback
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1882 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
1883 @var{domain}, and is equivalent to calling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1884 @code{glyph-property-instance} with a property of @code{image}. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1885 return value will be an image instance.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1886
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1887 Normally @var{domain} will be a window or @code{nil} (meaning the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1888 selected window), and an instance object describing how the image
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1889 appears in that particular window and buffer will be returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1890 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1891
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1892 @defun glyph-contrib-p glyph &optional locale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1893 This function is equivalent to calling @code{glyph-property} with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1894 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
1895 specifier if @var{locale} is @code{nil} or omitted; otherwise,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1896 it will be a specification or list of specifications.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1897 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1898
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1899 @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
1900 This function is equivalent to calling @code{set-glyph-property} with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1901 a property of @code{contrib-p}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1902 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1903
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1904 @defun glyph-contrib-p-instance glyph &optional domain default no-fallback
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1905 This function returns whether the glyph contributes to its line height
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1906 in the given @var{domain}, and is equivalent to calling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1907 @code{glyph-property-instance} with a property of @code{contrib-p}. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1908 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
1909 will be a window or @code{nil}, meaning the selected window.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1910 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1911
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1912 @defun glyph-baseline glyph &optional locale
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1913 This function is equivalent to calling @code{glyph-property} with a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1914 property of @code{baseline}. The return value will be a specifier if
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1915 @var{locale} is @code{nil} or omitted; otherwise, it will be a
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1916 specification or list of specifications.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1917 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1918
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1919 @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
1920 This function is equivalent to calling @code{set-glyph-property} with
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1921 a property of @code{baseline}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1922 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1923
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1924 @defun glyph-baseline-instance glyph &optional domain default no-fallback
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1925 This function returns the instance of @var{glyph}'s baseline value in
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1926 the given @var{domain}, and is equivalent to calling
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1927 @code{glyph-property-instance} with a property of @code{baseline}. The
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1928 return value will be an integer or @code{nil}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1929
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1930 Normally @var{domain} will be a window or @code{nil} (meaning the
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1931 selected window), and an instance object describing the baseline value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1932 appears in that particular window and buffer will be returned.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1933 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1934
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1935 @defun glyph-face glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1936 This function returns the face of @var{glyph}. (Remember, this is
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1937 not a specifier, but a simple property.)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1938 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1939
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1940 @defun set-glyph-face glyph face
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1941 This function changes the face of @var{glyph} to @var{face}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1942 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1943
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1944
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1945 @node Glyph Dimensions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1946 @subsection Glyph Dimensions
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1947
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1948 @defun glyph-width glyph &optional window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1949 This function returns the width of @var{glyph} on @var{window}. This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1950 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
1951 that redisplay will.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1952 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1953
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1954 @defun glyph-ascent glyph &optional window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1955 This function returns the ascent value of @var{glyph} on @var{window}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1956 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
1957 context that redisplay will.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1958 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1959
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1960 @defun glyph-descent glyph &optional window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1961 This function returns the descent value of @var{glyph} on @var{window}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1962 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
1963 context that redisplay will.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1964 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1965
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1966 @defun glyph-height glyph &optional window
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1967 This function returns the height of @var{glyph} on @var{window}. (This
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1968 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
1969 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
1970 redisplay will.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1971 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1972
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1973
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1974 @node Glyph Types
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1975 @subsection Glyph Types
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1976
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1977 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
1978 is generated. Each glyph type has a corresponding list of allowable
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1979 image instance types that can be generated. When you call
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1980 @code{glyph-image-instance} to retrieve the image instance of a glyph,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1981 XEmacs does the equivalent of calling @code{make-image-instance} and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1982 passing in @var{dest-types} the list of allowable image instance types
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1983 for the glyph's type.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1984
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1985 @itemize @bullet
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1986 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1987 @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
1988 extent, in the modeline, and in the toolbar. Their image can be
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1989 instantiated as @code{nothing}, @code{mono-pixmap}, @code{color-pixmap},
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1990 @code{text}, and @code{subwindow}.
2182
c91543697b09 [xemacs-hg @ 2004-07-19 08:24:24 by stephent]
stephent
parents: 2127
diff changeset
1991 @c #### Check status of subwindows ... I thought Andy implemented them.
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1992
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1993 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1994 @code{pointer} glyphs can be used to specify the mouse pointer. Their
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1995 image can be instantiated as @code{pointer}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1996
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1997 @item
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1998 @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
1999 iconified. Their image can be instantiated as @code{mono-pixmap} and
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2000 @code{color-pixmap}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2001 @end itemize
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2002
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2003 @defun glyph-type glyph
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2004 This function returns the type of the given glyph. The return value
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2005 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
2006 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2007
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2008 @defun valid-glyph-type-p glyph-type
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2009 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
2010 valid.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2011 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2012
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2013 @defun glyph-type-list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2014 This function returns a list of valid glyph types.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2015 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2016
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2017 @defun buffer-glyph-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2018 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
2019 @code{buffer}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2020 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2021
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2022 @defun icon-glyph-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2023 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
2024 @code{icon}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2025 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2026
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2027 @defun pointer-glyph-p object
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2028 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
2029 @code{pointer}.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2030 @end defun
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2031
707
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2032
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2033 @node Glyph Examples
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2034 @section Glyph Examples
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2035
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2036 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
2037 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
2038
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2039 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
2040 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
2041
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2042 @lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2043 ;; Create a glyph from a JPEG file:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2044 (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
2045 @end lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2046
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2047 @lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2048 ;; Create a glyph from a XPM file:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2049 (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
2050 @end lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2051
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2052 @lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2053 ;; Create a glyph from a PNG file:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2054 (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
2055 @end lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2056
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2057 @lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2058 ;; Create a glyph from a TIFF file:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2059 (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
2060 @end lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2061
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2062 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
2063 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
2064 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
2065 contents of a JPEG file into a string), and use that to create a glyph.
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
2066 @xref{Image Instantiators}, for more information.
707
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2067
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2068 @quotation
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2069 @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
2070 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
2071 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
2072 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
2073 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
2074 use @kbd{M-x describe-installation}.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2075
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2076 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
2077 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
2078 @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
2079 @code{png}, or @code{xface}. For an up-to-date list, @ref{Image
2953
c7d4a681eb2c [xemacs-hg @ 2005-09-26 08:41:45 by ben]
ben
parents: 2297
diff changeset
2080 Instantiators}. Example:
707
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2081
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2082 @example
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2083 ;; Returns `t' if TIFF is supported:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2084 (featurep 'tiff)
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2085 @end example
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2086
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2087 Another example is:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2088
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2089 @example
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2090 ;; 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
2091 ;; corresponding feature is supported:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2092 (mapcar #'(lambda (format-symbol) (featurep format-symbol))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2093 '(gif tiff jpeg xpm png))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2094 @end example
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2095
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2096 @end quotation
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2097
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2098 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
2099
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2100 @lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2101 ;; 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
2102 ;; 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
2103 (defun insert-glyph (gl)
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2104 "Insert a glyph at the left edge of point."
1137
c6facab13185 [xemacs-hg @ 2002-12-03 10:35:06 by didierv]
didierv
parents: 707
diff changeset
2105 (let ( (prop 'myimage) ;; myimage is an arbitrary name, chosen
707
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2106 ;; to (hopefully) not conflict with any
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2107 ;; other properties. Change it if
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2108 ;; necessary.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2109 extent )
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2110 ;; 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
2111 ;; 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
2112 ;; 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
2113 ;; 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
2114 ;; 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
2115 ;; 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
2116 ;; 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
2117 ;; 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
2118 ;; to be unique, and only used by us).
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2119 (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
2120 (progn
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2121 ;; 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
2122 ;; extent, and give it our special property.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2123 (setq extent (make-extent (point) (point) (current-buffer)))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2124 (set-extent-property extent prop t)
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2125 ))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2126 ;; 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
2127 (set-extent-property extent 'begin-glyph gl)
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2128 ))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2129
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2130 ;; You can then use this function like:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2131 (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
2132 ;; This will insert the glyph at point.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2133
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2134 ;; 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
2135 ;; (using the above code):
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2136 (progn
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2137 (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
2138 ;; 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
2139 ;; 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
2140 ;; second.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2141 (setq extent (make-extent (point) (point) (current-buffer)))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2142 ;; 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
2143 ;; to later identify/locate/reuse this particular extent.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2144 (set-extent-property extent 'myimage t)
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2145 (set-extent-property extent 'begin-glyph
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2146 (make-glyph [jpeg :file "/tmp/file2.jpg"]))
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2147 )
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2148
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2149 @end lisp
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2150
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2151 Here are the gory details:
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2152
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2153 @itemize @bullet
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2154
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2155 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2156 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
2157 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
2158
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2159 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
2160 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
2161 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
2162 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
2163 they can overlap.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2164
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2165 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2166 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
2167 is the default.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2168
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2169 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
2170 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
2171 @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
2172 @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
2173 @code{end-glyph-layout}).
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2174
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2175 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2176 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
2177 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
2178
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2179 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
2180 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
2181
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2182 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2183 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
2184 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
2185 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
2186 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
2187 name.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2188
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2189 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
2190 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
2191 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
2192 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
2193 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
2194 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
2195 Extents}, for more information.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2196
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2197 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2198 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
2199 @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
2200 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
2201 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
2202 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
2203 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
2204
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2205 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
2206 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
2207 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
2208 purpose.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2209
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2210 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2211 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
2212 @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
2213 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
2214 @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
2215 information on locating extents in a buffer.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2216
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2217 @item
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2218 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
2219 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
2220 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
2221 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
2222 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
2223 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
2224 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
2225 outside the scope of this discussion.
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2226
a307f9a2021d [xemacs-hg @ 2001-12-20 05:49:28 by andyp]
andyp
parents: 444
diff changeset
2227 @end itemize