Next: , Previous: , Up: Glyphs   [Contents][Index]


50.1 Glyph Introduction

In SXEmacs, “glyph” does not refer to a single unit of textual display (the SXEmacs term for that is rune, and runes are confined to the internal implementation of redisplay), but rather is an object encapsulating a graphical element, such as an image or widget (an active GUI element such as a button or text entry field; X11 calls this a widget). This graphical element could appear in a buffer, a margin, a gutter, or a toolbar, or even externally to SXEmacs as a mouse pointer or an icon, for example.

On the other hand, by contrast with GNU Emacs 21, a SXEmacs glyph is not “just” an image. The actual image that is displayed (as opposed to its position or clipping) is defined by an “image specifier” object contained within the glyph. The separation between an image specifier object and a glyph object is made because the glyph includes other properties than just the actual image: e.g. the face it is displayed in, the alignment of the image, etc. Also, an image specifier is used in at least one place in SXEmacs in lieu of a glyph, namely the backing pixmap of a face.

An image specifier is used because glyphs often have locale-specific semantics. The most important example is semantics determined by the display device: you cannot usefully display a JPEG on stdout, or a color image on a monochrome display. But because the image property is a specifier in SXEmacs, you can specify that a given glyph appear as a monochrome image on monochrome displays, a color image on color displays, and as a string on TTYs. Specifying a string for the tty device locale would give behavior like the ALT attribute of an IMG element in HTML. Another is semantics determined by the buffer or mode. (Unfortunately, currently there are no compelling examples of this for glyphs.)

All this means that only one global glyph needs to exist for a particular purpose (e.g. the icon used to represent an iconified frame, the mouse pointer used over particular areas of a frame, etc.). Often you need not (and should not!) create your own glyph, but rather modify an existing one.

In working with glyphs it is important to keep in mind the distinction between a locale and a domain. A locale is specified by the programmer, and is an abstract link between a specification (for a glyph, its visual appearance) and a displayable object. The displayable object may be a buffer or a window, or an object containing buffers or windows such as frame, device, or console. A domain is an actual display context, which must be concrete enough to enable SXEmacs to identify the device type. (Buffers may be displayed in windows on different devices, even simultaneously, so a buffer cannot be a domain. Similarly, the global locale cannot be a domain.) Specifiers, for more information about specifier locales and domains.


Next: , Previous: , Up: Glyphs   [Contents][Index]