Mercurial > hg > xemacs-beta
comparison man/internals/internals.texi @ 4668:8b2a8ecf91cd
Improve redisplay docs in Internals a bit.
author | Stephen J. Turnbull <stephen@xemacs.org> |
---|---|
date | Tue, 28 Jul 2009 23:24:15 +0900 |
parents | b93587f33338 |
children | 1cecc3e9f0a0 |
comparison
equal
deleted
inserted
replaced
4667:cbe5d2169270 | 4668:8b2a8ecf91cd |
---|---|
18219 | 18219 |
18220 @node Redisplay Piece by Piece, Modules for the Redisplay Mechanism, Line Start Cache, The Redisplay Mechanism | 18220 @node Redisplay Piece by Piece, Modules for the Redisplay Mechanism, Line Start Cache, The Redisplay Mechanism |
18221 @section Redisplay Piece by Piece | 18221 @section Redisplay Piece by Piece |
18222 @cindex redisplay piece by piece | 18222 @cindex redisplay piece by piece |
18223 | 18223 |
18224 As you can begin to see redisplay is complex and also not well | 18224 Redisplay is complex and not very well documented. Chuck Thompson no |
18225 documented. Chuck no longer works on XEmacs so this section is my take | 18225 longer works on XEmacs so this section is my [presumably Ben's] take on |
18226 on the workings of redisplay. | 18226 the workings of redisplay. |
18227 | 18227 |
18228 Redisplay happens in three phases: | 18228 Redisplay happens in three phases: |
18229 | 18229 |
18230 @enumerate | 18230 @enumerate |
18231 @item | 18231 @item |
18232 Determine desired display in area that needs redisplay. | 18232 Determine desired display in area that needs redisplay. |
18233 Implemented by @code{redisplay.c} | 18233 |
18234 Implemented in @code{redisplay.c} | |
18234 @item | 18235 @item |
18235 Compare desired display with current display | 18236 Compare desired display with current display |
18236 Implemented by @code{redisplay-output.c} | 18237 |
18237 @item | 18238 Implemented in @code{redisplay-output.c} |
18238 Output changes Implemented by @code{redisplay-output.c}, | 18239 @item |
18240 Output changes | |
18241 | |
18242 Implemented in @code{redisplay-output.c}, | |
18239 @code{redisplay-x.c}, @code{redisplay-msw.c} and @code{redisplay-tty.c} | 18243 @code{redisplay-x.c}, @code{redisplay-msw.c} and @code{redisplay-tty.c} |
18240 @end enumerate | 18244 @end enumerate |
18241 | 18245 |
18242 Steps 1 and 2 are device-independent and relatively complex. Step 3 is | 18246 Steps 1 and 2 are device-independent and relatively complex. Step 3 is |
18243 mostly device-dependent. | 18247 mostly device-dependent. |
18253 The @code{display_line} structures are tightly tied to buffers which | 18257 The @code{display_line} structures are tightly tied to buffers which |
18254 presents a problem for redisplay as this connection is bogus for the | 18258 presents a problem for redisplay as this connection is bogus for the |
18255 modeline. Hence the @code{display_line} generation routines are | 18259 modeline. Hence the @code{display_line} generation routines are |
18256 duplicated for generating the modeline. This means that the modeline | 18260 duplicated for generating the modeline. This means that the modeline |
18257 display code has many bugs that the standard redisplay code does not. | 18261 display code has many bugs that the standard redisplay code does not. |
18262 Perhaps the modeline redisplay could be unified with gutter redisplay | |
18263 (see below). | |
18258 | 18264 |
18259 The guts of @code{display_line} generation are in | 18265 The guts of @code{display_line} generation are in |
18260 @code{create_text_block}, which creates a single display line for the | 18266 @code{create_text_block}, which creates a single display line for the |
18261 desired locale. This incrementally parses the characters on the current | 18267 desired locale. This incrementally parses the characters on the current |
18262 line and generates redisplay structures for each. | 18268 line and generates redisplay structures for each. |
18265 a string we cannot use @code{create_text_block}. Instead we use | 18271 a string we cannot use @code{create_text_block}. Instead we use |
18266 @code{create_text_string_block} which performs the same function as | 18272 @code{create_text_string_block} which performs the same function as |
18267 @code{create_text_block} but for strings. Many of the complexities of | 18273 @code{create_text_block} but for strings. Many of the complexities of |
18268 @code{create_text_block} to do with cursor handling and selective | 18274 @code{create_text_block} to do with cursor handling and selective |
18269 display have been removed. | 18275 display have been removed. |
18276 | |
18277 In the following, @code{create_text_block} only will be described, so | |
18278 keep in mind in the fact that modeline and gutter redisplay are somewhat | |
18279 different. | |
18280 | |
18281 @code{create_text_block} takes a @code{struct window *}, the index of a | |
18282 line in the text (a @code{Bytebpos}) and a @code{struct display_line *}, | |
18283 as well as two arguments @code{prop} and @code{type} (as yet | |
18284 undocumented). Given the window, it can derive the relevant buffer, and | |
18285 use the @code{Bytebpos} to find the line of text. It then walks over | |
18286 the characters in the text and regenerates the display line information | |
18287 for each. | |
18288 | |
18289 @code{create_text_block} calls out to @code{extent_fragment_update} to | |
18290 get information about faces (fonts and colors), which are represented as | |
18291 a @code{face_index}, an index into a table of merged faces. Faces must | |
18292 be merged because (1) a face may inherit properties from their parents | |
18293 and (2) faces may be only partially specified, in which case redisplay | |
18294 must fall back to faces associated with extents earlier in the extent | |
18295 order (@pxref{Extent Ordering}). Since getting complete information | |
18296 about a face involves instantantiating many specifiers, we keep a cache | |
18297 of this information, and a @code{face_index} is an index into the cache. | |
18298 | |
18299 @code{extent_fragment_update} calls out to | |
18300 @code{get_extent_fragment_face_cache_index}, which in turn calls | |
18301 @code{merge_face_cachel_data} on each relevant face. | |
18302 @code{merge_face_cachel_data} is straightforward, except for font | |
18303 handling. In the case of fonts, the legacy XLFD model has a different | |
18304 font for each Mule charset (in fact, both the XLFD model of I18N and | |
18305 that of Mule are derived from the same root, ISO 2022, and so mesh | |
18306 well---or as well as anything based on ISO 2022 can). This means that | |
18307 @code{merge_face_cachel_data} has to iterate over the list of Mule | |
18308 charsets, and update the font for each one. | |
18309 | |
18310 @code{create_text_block} is not responsible for creating face cachels. | |
18311 That is done by @code{redisplay_output_layout}, | |
18312 @code{redisplay_text_width_string} or | |
18313 @code{redisplay_text_width_ichar_string}, via | |
18314 @code{ensure_face_cachel_complete}, with the actual work being done by | |
18315 @code{ensure_face_cachel_contains_charset}. | |
18270 | 18316 |
18271 @node Modules for the Redisplay Mechanism, Modules for other Display-Related Lisp Objects, Redisplay Piece by Piece, The Redisplay Mechanism | 18317 @node Modules for the Redisplay Mechanism, Modules for other Display-Related Lisp Objects, Redisplay Piece by Piece, The Redisplay Mechanism |
18272 @section Modules for the Redisplay Mechanism | 18318 @section Modules for the Redisplay Mechanism |
18273 @cindex modules for the redisplay mechanism | 18319 @cindex modules for the redisplay mechanism |
18274 @cindex redisplay mechanism, modules for the | 18320 @cindex redisplay mechanism, modules for the |