428
|
1 /* Redisplay data structures.
|
|
2 Copyright (C) 1994, 1995 Board of Trustees, University of Illinois.
|
|
3 Copyright (C) 1996 Chuck Thompson.
|
826
|
4 Copyright (C) 1995, 1996, 2002 Ben Wing.
|
428
|
5
|
|
6 This file is part of XEmacs.
|
|
7
|
|
8 XEmacs is free software; you can redistribute it and/or modify it
|
|
9 under the terms of the GNU General Public License as published by the
|
|
10 Free Software Foundation; either version 2, or (at your option) any
|
|
11 later version.
|
|
12
|
|
13 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
16 for more details.
|
|
17
|
|
18 You should have received a copy of the GNU General Public License
|
|
19 along with XEmacs; see the file COPYING. If not, write to
|
|
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
21 Boston, MA 02111-1307, USA. */
|
|
22
|
|
23 /* Synched up with: Not in FSF. */
|
|
24
|
440
|
25 #ifndef INCLUDED_redisplay_h_
|
|
26 #define INCLUDED_redisplay_h_
|
428
|
27
|
|
28 /* Redisplay DASSERT types */
|
|
29 #define DB_DISP_POS 1
|
|
30 #define DB_DISP_TEXT_LAYOUT 2
|
|
31 #define DB_DISP_REDISPLAY 4
|
|
32
|
|
33 /* These are the possible return values from pixel_to_glyph_translation. */
|
|
34 #define OVER_MODELINE 0
|
|
35 #define OVER_TEXT 1
|
|
36 #define OVER_OUTSIDE 2
|
|
37 #define OVER_NOTHING 3
|
|
38 #define OVER_BORDER 4
|
|
39 #define OVER_TOOLBAR 5
|
|
40 #define OVER_V_DIVIDER 6
|
|
41
|
|
42 #define NO_BLOCK -1
|
|
43
|
|
44 /* Imagine that the text in the buffer is displayed on a piece of paper
|
|
45 the width of the frame and very very tall. The line start cache is
|
|
46 an array of struct line_start_cache's, describing the start and
|
|
47 end buffer positions for a contiguous set of lines on that piece
|
|
48 of paper. */
|
|
49
|
|
50 typedef struct line_start_cache line_start_cache;
|
|
51 struct line_start_cache
|
|
52 {
|
665
|
53 Charbpos start, end;
|
428
|
54 int height;
|
|
55 };
|
|
56
|
|
57 typedef struct
|
|
58 {
|
|
59 Dynarr_declare (line_start_cache);
|
|
60 } line_start_cache_dynarr;
|
|
61
|
|
62 /* The possible types of runes.
|
|
63
|
|
64 #### The Lisp_Glyph type is broken. There should instead be a pixmap
|
|
65 type. Currently the device-specific output routines have to worry
|
|
66 about whether the glyph is textual or not, etc. For Mule this is
|
|
67 a big problem because you might need multiple fonts to display the
|
|
68 text. It also eliminates optimizations that could come from glumping
|
|
69 the text of multiple text glyphs together -- this makes displaying
|
|
70 binary files (with lots of control chars, etc.) very very slow. */
|
|
71
|
|
72 #define RUNE_BLANK 0
|
|
73 #define RUNE_CHAR 1
|
|
74 #define RUNE_DGLYPH 2
|
|
75 #define RUNE_HLINE 3
|
|
76 #define RUNE_VLINE 4
|
|
77
|
|
78 #define CURSOR_ON 0
|
|
79 #define CURSOR_OFF 1
|
|
80 #define NO_CURSOR 2
|
|
81 #define NEXT_CURSOR 3
|
|
82 #define IGNORE_CURSOR 4
|
|
83
|
|
84 #define DEFAULT_INDEX (face_index) 0
|
|
85 #define MODELINE_INDEX (face_index) 1
|
|
86
|
|
87 /* A rune is a single display element, such as a printable character
|
|
88 or pixmap. Any single character in a buffer has one or more runes
|
|
89 (or zero, if the character is invisible) corresponding to it.
|
|
90 (Printable characters typically have one rune associated with them,
|
|
91 but control characters have two -- a ^ and a letter -- and other
|
|
92 non-printing characters (those displayed in octal) have four. */
|
|
93
|
|
94 /* WARNING! In compare_runes (one of the most heavily used functions)
|
|
95 two runes are compared. So please be careful with changes to this
|
|
96 structure. See comments in compare_runes.
|
|
97
|
|
98 #### This should really be made smaller.
|
|
99 */
|
432
|
100
|
428
|
101 typedef struct rune rune;
|
|
102 struct rune
|
|
103 {
|
|
104 face_index findex; /* face rune is displayed with. The
|
|
105 face_index is an index into a
|
|
106 window-specific array of face cache
|
|
107 elements. Each face cache element
|
|
108 corresponds to one "merged face"
|
|
109 (the result of merging all the
|
|
110 faces that overlap the rune) and
|
|
111 contains the instance values for
|
|
112 each of the face properties in this
|
|
113 particular window. */
|
|
114
|
826
|
115 Charxpos charpos; /* buffer position this rune is displaying;
|
428
|
116 for the modeline, the value here is a
|
|
117 Charcount, but who's looking? */
|
826
|
118 Charxpos endpos; /* if set this rune covers a range of pos;
|
|
119 used in redisplay_move_cursor(). */
|
428
|
120 /* #### Chuck, what does it mean for a rune
|
|
121 to cover a range of pos? I don't get
|
|
122 this. */
|
432
|
123
|
|
124
|
428
|
125 short xpos; /* horizontal starting position in pixels */
|
|
126 short width; /* pixel width of rune */
|
432
|
127
|
|
128
|
428
|
129 unsigned char cursor_type; /* is this rune covered by the cursor? */
|
|
130 unsigned char type; /* type of rune object */
|
|
131 /* We used to do bitfields here, but if I
|
|
132 (JV) count correctly that doesn't matter
|
|
133 for the size of the structure. All the bit
|
|
134 fiddling _does_ slow down redisplay by
|
|
135 about 10%. So don't do that */
|
|
136
|
|
137 union /* Information specific to the type of rune */
|
|
138 {
|
450
|
139 /* #### Glyphs are rare. Is it really necessary to waste 8 bytes on every
|
428
|
140 rune for that?! */
|
|
141 /* DGLYPH */
|
|
142 struct
|
|
143 {
|
|
144 Lisp_Object glyph;
|
|
145 Lisp_Object extent; /* extent rune is attached to, if any.
|
|
146 If this is a rune in the modeline
|
|
147 then this might be nil. */
|
|
148
|
819
|
149 int ascent; /* Ascent of this glyph, in pixels. */
|
|
150 int descent; /* Descent of this glyph, in pixels. */
|
|
151 int yoffset; /* Offset from line top to reach glyph top */
|
428
|
152 int xoffset; /* Number of pixels that need to be
|
|
153 chopped off the left of the glyph.
|
|
154 This has the effect of shifting the
|
|
155 glyph to the left while still clipping
|
|
156 at XPOS. */
|
|
157 } dglyph;
|
|
158
|
|
159 /* CHAR */
|
|
160 struct
|
|
161 {
|
867
|
162 Ichar ch; /* Character of this rune. */
|
428
|
163 } chr;
|
|
164
|
|
165 /* HLINE */
|
|
166 struct
|
|
167 {
|
|
168 short thickness; /* how thick to make hline */
|
|
169 short yoffset; /* how far down from top of line to put top */
|
|
170 } hline;
|
|
171 } object; /* actual rune object */
|
|
172 };
|
|
173
|
|
174 typedef struct
|
|
175 {
|
|
176 Dynarr_declare (rune);
|
|
177 } rune_dynarr;
|
|
178
|
|
179 /* These must have distinct values. Note that the ordering actually
|
|
180 represents priority levels. TEXT has the lowest priority level. */
|
|
181 enum display_type
|
|
182 {
|
|
183 TEXT,
|
|
184 LEFT_OUTSIDE_MARGIN,
|
|
185 LEFT_INSIDE_MARGIN,
|
|
186 RIGHT_INSIDE_MARGIN,
|
|
187 RIGHT_OUTSIDE_MARGIN,
|
|
188 OVERWRITE
|
|
189 };
|
|
190
|
|
191 /* A display block represents a run of text on a single line.
|
|
192 Apparently there is only one display block per line for each
|
|
193 of the types listed in `enum display_type'.
|
|
194
|
|
195 A display block consists mostly of an array of runes, one per
|
|
196 atomic display element (printable character, pixmap, etc.). */
|
|
197
|
|
198 /* #### Yuckity yuckity yuck yuck yuck yuck yuck!!
|
|
199
|
|
200 Chuck, I think you should redo this. It should not be the
|
|
201 responsibility of the device-specific code to worry about
|
|
202 the different faces. The generic stuff in redisplay-output.c
|
|
203 should glump things up into sub-blocks, each of which
|
|
204 corresponds to a single pixmap or a single run of text in
|
|
205 the same font.
|
|
206
|
|
207 It might still make sense for the device-specific output routine
|
|
208 to get passed an entire display line. That way, it can make
|
|
209 calls to XDrawText() (which draws multiple runs of single-font
|
|
210 data) instead of XDrawString(). The reason for this is to
|
|
211 reduce the amount of X traffic, which will help things significantly
|
|
212 on a slow line. */
|
|
213
|
|
214 typedef struct display_block display_block;
|
|
215 struct display_block
|
|
216 {
|
|
217 enum display_type type; /* type of display block */
|
|
218
|
|
219 int start_pos; /* starting pixel position of block */
|
|
220 int end_pos; /* ending pixel position of block */
|
|
221
|
|
222 rune_dynarr *runes; /* Dynamic array of runes */
|
|
223 };
|
|
224
|
|
225 typedef struct
|
|
226 {
|
|
227 Dynarr_declare (display_block);
|
|
228 } display_block_dynarr;
|
|
229
|
|
230 typedef struct layout_bounds_type
|
|
231 {
|
|
232 int left_out;
|
|
233 int left_in;
|
|
234 int left_white;
|
|
235 int right_white;
|
|
236 int right_in;
|
|
237 int right_out;
|
|
238 } layout_bounds;
|
|
239
|
|
240 typedef struct glyph_block glyph_block;
|
|
241 struct glyph_block
|
|
242 {
|
|
243 Lisp_Object glyph;
|
|
244 Lisp_Object extent;
|
|
245 /* The rest are only used by margin routines. */
|
|
246 face_index findex;
|
|
247 int active;
|
|
248 int width;
|
|
249 };
|
|
250
|
|
251 typedef struct
|
|
252 {
|
|
253 Dynarr_declare (glyph_block);
|
|
254 } glyph_block_dynarr;
|
|
255
|
|
256 /*************************************************************************/
|
617
|
257 /* display lines */
|
428
|
258 /*************************************************************************/
|
|
259
|
826
|
260 /* Modeline commentary: IMO the modeline is handled very badly, we
|
428
|
261 special case virtually *everything* in the redisplay routines for
|
826
|
262 the modeline. The fact that dl->charpos can be either a buffer
|
428
|
263 position or a char count highlights this. There is no abstraction at
|
|
264 all that I can find and it means that the code is made very ugly as
|
|
265 a result. Either we should treat the modeline *entirely* separately,
|
|
266 or we should abstract to something that applies equally well to the
|
|
267 modeline and to buffer text, the things are not enormously different
|
|
268 after all and handling them identically at some level would
|
|
269 eliminate some bugs that still exist (mainly to do with modeline
|
|
270 handling). This problem doesn't help trying to implement gutters
|
|
271 which are somewhere in between buffer text and modeline text.
|
|
272
|
|
273 Redisplay commentary: Everything in redisplay is tied very tightly
|
|
274 to the things that are being displayed, and the context,
|
|
275 e.g. buffers and windows. According to Chuck this is so that we can
|
|
276 get speed, which seems fine to me, however this usage is extended
|
442
|
277 too far down the redisplay routines IMO. At some level there should
|
428
|
278 be functions that know how to display strings with extents and
|
|
279 faces, regardless of buffer etc. After all the window system does
|
|
280 not care. <andy@xemacs.org> */
|
|
281
|
|
282 typedef struct display_line display_line;
|
|
283 struct display_line
|
|
284 {
|
|
285 short ypos; /* vertical position in pixels
|
|
286 of the baseline for this line. */
|
|
287 unsigned short ascent, descent; /* maximum values for this line.
|
|
288 The ascent is the number of
|
|
289 pixels above the baseline, and
|
|
290 the descent is the number of
|
|
291 pixels below the baseline.
|
|
292 The descent includes the baseline
|
|
293 pixel-row itself, I think. */
|
|
294 unsigned short clip; /* amount of bottom of line to clip
|
|
295 in pixels.*/
|
|
296 unsigned short top_clip; /* amount of top of line to clip
|
|
297 in pixels.*/
|
826
|
298 Charxpos charpos; /* first buffer position on line */
|
|
299 Charxpos end_charpos; /* last buffer position on line */
|
|
300 Charcount offset; /* adjustment to charpos vals */
|
428
|
301 Charcount num_chars; /* # of chars on line
|
|
302 including expansion of tabs
|
|
303 and control chars */
|
|
304 int cursor_elt; /* rune block of TEXT display
|
|
305 block cursor is at or -1 */
|
|
306 char used_prop_data; /* can't incrementally update if line
|
|
307 used propagation data */
|
|
308
|
|
309 layout_bounds bounds; /* line boundary positions */
|
|
310
|
|
311 char modeline; /* t if this line is a modeline */
|
|
312
|
442
|
313 char line_continuation; /* t if this line continues to
|
|
314 next display line. */
|
|
315
|
428
|
316 /* Dynamic array of display blocks */
|
|
317 display_block_dynarr *display_blocks;
|
|
318
|
|
319 /* Dynamic arrays of left and right glyph blocks */
|
|
320 glyph_block_dynarr *left_glyphs;
|
|
321 glyph_block_dynarr *right_glyphs;
|
|
322
|
|
323 face_index left_margin_findex;
|
|
324 face_index right_margin_findex;
|
|
325 face_index default_findex;
|
|
326 };
|
|
327
|
|
328 #define DISPLAY_LINE_HEIGHT(dl) \
|
|
329 (dl->ascent + dl->descent - (dl->clip + dl->top_clip))
|
|
330 #define DISPLAY_LINE_YPOS(dl) \
|
|
331 (dl->ypos - (dl->ascent - dl->top_clip))
|
|
332 #define DISPLAY_LINE_YEND(dl) \
|
|
333 ((dl->ypos + dl->descent) - dl->clip)
|
|
334
|
|
335 typedef struct
|
|
336 {
|
|
337 Dynarr_declare (display_line);
|
|
338 } display_line_dynarr;
|
|
339
|
|
340 /* The following two structures are used to represent an area to
|
|
341 displayed and where to display it. Using these two structures all
|
|
342 combinations of clipping and position can be accommodated. */
|
|
343
|
|
344 /* This represents an area to be displayed into. */
|
|
345 typedef struct display_box display_box;
|
|
346 struct display_box
|
|
347 {
|
|
348 int xpos; /* absolute horizontal position of area */
|
|
349 int ypos; /* absolute vertical position of area */
|
|
350 int width, height;
|
|
351 };
|
|
352
|
|
353 /* This represents the area from a glyph to be displayed. */
|
|
354 typedef struct display_glyph_area display_glyph_area;
|
|
355 struct display_glyph_area
|
|
356 {
|
|
357 int xoffset; /* horizontal offset of the glyph, +ve means
|
|
358 display the glyph with x offset by xoffset,
|
|
359 -ve means display starting xoffset into the
|
|
360 glyph. */
|
|
361 int yoffset; /* vertical offset of the glyph, +ve means
|
|
362 display the glyph with y offset by yoffset,
|
|
363 -ve means display starting xoffset into the
|
|
364 glyph. */
|
|
365 int width, height; /* width and height of glyph to display. */
|
|
366 };
|
|
367
|
|
368 /* It could be argued that the following two structs belong in
|
|
369 extents.h, but they're only used by redisplay and it simplifies
|
|
370 the header files to put them here. */
|
|
371
|
|
372 typedef struct
|
|
373 {
|
|
374 Dynarr_declare (EXTENT);
|
|
375 } EXTENT_dynarr;
|
|
376
|
|
377 struct font_metric_info
|
|
378 {
|
|
379 int width;
|
|
380 int height; /* always ascent + descent; for convenience */
|
|
381 int ascent;
|
|
382 int descent;
|
|
383
|
|
384 int proportional_p;
|
|
385 };
|
|
386
|
|
387 /* NOTE NOTE NOTE: Currently the positions in an extent fragment
|
826
|
388 structure are Bytexpos's, not Charxpos's. This could change. */
|
428
|
389
|
|
390 struct extent_fragment
|
|
391 {
|
|
392 Lisp_Object object; /* buffer or string */
|
|
393 struct frame *frm;
|
826
|
394 Bytexpos pos, end;
|
428
|
395 EXTENT_dynarr *extents;
|
|
396 glyph_block_dynarr *begin_glyphs, *end_glyphs;
|
|
397 unsigned int invisible:1;
|
|
398 unsigned int invisible_ellipses:1;
|
|
399 unsigned int previously_invisible:1;
|
|
400 unsigned int invisible_ellipses_already_displayed:1;
|
|
401 };
|
|
402
|
|
403 #define EDGE_TOP 1
|
|
404 #define EDGE_LEFT 2
|
|
405 #define EDGE_BOTTOM 4
|
|
406 #define EDGE_RIGHT 8
|
|
407 #define EDGE_ALL (EDGE_TOP | EDGE_LEFT | EDGE_BOTTOM | EDGE_RIGHT)
|
|
408
|
|
409
|
|
410 /*************************************************************************/
|
|
411 /* change flags */
|
|
412 /*************************************************************************/
|
|
413
|
|
414 /* Quick flags to signal redisplay. redisplay() sets them all to 0
|
|
415 when it finishes. If none of them are set when it starts, it
|
|
416 assumes that nothing needs to be done. Functions that make a change
|
|
417 that is (potentially) visible on the screen should set the
|
|
418 appropriate flag.
|
|
419
|
|
420 If any of these flags are set, redisplay will look more carefully
|
|
421 to see if anything has really changed. */
|
|
422
|
442
|
423 /* Nonzero if the contents of a buffer have changed since the last time
|
|
424 redisplay completed. */
|
428
|
425 extern int buffers_changed;
|
|
426 extern int buffers_changed_set;
|
|
427
|
|
428 /* Nonzero if head_clip or tail_clip of a buffer has changed
|
442
|
429 since last redisplay that finished. */
|
428
|
430 extern int clip_changed;
|
|
431 extern int clip_changed_set;
|
|
432
|
442
|
433 /* Nonzero if any extent has changed since the last time redisplay completed. */
|
428
|
434 extern int extents_changed;
|
|
435 extern int extents_changed_set;
|
|
436
|
442
|
437 /* Nonzero if any face has changed since the last time redisplay completed. */
|
428
|
438 extern int faces_changed;
|
|
439
|
442
|
440 /* Nonzero means one or more frames have been marked as garbaged. */
|
428
|
441 extern int frame_changed;
|
|
442
|
|
443 /* True if any of the builtin display glyphs (continuation,
|
|
444 hscroll, control-arrow, etc) is in need of updating
|
|
445 somewhere. */
|
|
446 extern int glyphs_changed;
|
|
447 extern int glyphs_changed_set;
|
|
448
|
|
449 /* True if any displayed subwindow is in need of updating
|
|
450 somewhere. */
|
|
451 extern int subwindows_changed;
|
|
452 extern int subwindows_changed_set;
|
|
453
|
|
454 /* True if any displayed subwindow is in need of updating
|
|
455 somewhere. */
|
|
456 extern int subwindows_state_changed;
|
|
457 extern int subwindows_state_changed_set;
|
|
458
|
|
459 /* True if an icon is in need of updating somewhere. */
|
|
460 extern int icon_changed;
|
|
461 extern int icon_changed_set;
|
|
462
|
|
463 /* True if a menubar is in need of updating somewhere. */
|
|
464 extern int menubar_changed;
|
|
465 extern int menubar_changed_set;
|
|
466
|
442
|
467 /* True iff we should redraw the modelines on the next redisplay. */
|
428
|
468 extern int modeline_changed;
|
|
469 extern int modeline_changed_set;
|
|
470
|
442
|
471 /* Nonzero if point has changed in some buffer since the last time
|
|
472 redisplay completed. */
|
428
|
473 extern int point_changed;
|
|
474 extern int point_changed_set;
|
|
475
|
442
|
476 /* Nonzero if some frame has changed its size. */
|
428
|
477 extern int size_changed;
|
|
478
|
442
|
479 /* Nonzero if some device has signaled that it wants to change size. */
|
428
|
480 extern int asynch_device_change_pending;
|
|
481
|
442
|
482 /* Nonzero if any toolbar has changed. */
|
428
|
483 extern int toolbar_changed;
|
|
484 extern int toolbar_changed_set;
|
|
485
|
442
|
486 /* Nonzero if any gutter has changed. */
|
428
|
487 extern int gutter_changed;
|
|
488 extern int gutter_changed_set;
|
|
489
|
442
|
490 /* Nonzero if any window has changed since the last time redisplay completed */
|
428
|
491 extern int windows_changed;
|
|
492
|
442
|
493 /* Nonzero if any frame's window structure has changed since the last
|
|
494 time redisplay completed. */
|
428
|
495 extern int windows_structure_changed;
|
|
496
|
|
497 /* These macros can be relatively expensive. Since they are often
|
|
498 called numerous times between each call to redisplay, we keep track
|
|
499 if each has already been called and don't bother doing most of the
|
|
500 work if it is currently set. */
|
|
501
|
|
502 #define MARK_TYPE_CHANGED(object) do { \
|
|
503 if (!object##_changed_set) { \
|
|
504 Lisp_Object MTC_devcons, MTC_concons; \
|
|
505 DEVICE_LOOP_NO_BREAK (MTC_devcons, MTC_concons) \
|
|
506 { \
|
|
507 Lisp_Object MTC_frmcons; \
|
|
508 struct device *MTC_d = XDEVICE (XCAR (MTC_devcons)); \
|
|
509 DEVICE_FRAME_LOOP (MTC_frmcons, MTC_d) \
|
|
510 { \
|
|
511 struct frame *MTC_f = XFRAME (XCAR (MTC_frmcons)); \
|
|
512 MTC_f->object##_changed = 1; \
|
|
513 MTC_f->modiff++; \
|
|
514 } \
|
|
515 MTC_d->object##_changed = 1; \
|
|
516 } \
|
|
517 object##_changed = 1; \
|
|
518 object##_changed_set = 1; } \
|
|
519 } while (0)
|
|
520
|
872
|
521 void mark_buffers_changed (void);
|
|
522 #define MARK_BUFFERS_CHANGED mark_buffers_changed ()
|
|
523 void mark_clip_changed (void);
|
|
524 #define MARK_CLIP_CHANGED mark_clip_changed ()
|
|
525 void mark_extents_changed (void);
|
|
526 #define MARK_EXTENTS_CHANGED mark_extents_changed ()
|
|
527 void mark_icon_changed (void);
|
|
528 #define MARK_ICON_CHANGED mark_icon_changed ()
|
|
529 void mark_menubar_changed (void);
|
|
530 #define MARK_MENUBAR_CHANGED mark_menubar_changed ()
|
|
531 void mark_modeline_changed (void);
|
|
532 #define MARK_MODELINE_CHANGED mark_modeline_changed ()
|
|
533 void mark_point_changed (void);
|
|
534 #define MARK_POINT_CHANGED mark_point_changed ()
|
|
535 void mark_toolbar_changed (void);
|
|
536 #define MARK_TOOLBAR_CHANGED mark_toolbar_changed ()
|
|
537 void mark_gutter_changed (void);
|
|
538 #define MARK_GUTTER_CHANGED mark_gutter_changed ()
|
|
539 void mark_glyphs_changed (void);
|
|
540 #define MARK_GLYPHS_CHANGED mark_glyphs_changed ()
|
|
541 void mark_subwindows_changed (void);
|
|
542 #define MARK_SUBWINDOWS_CHANGED mark_subwindows_changed ()
|
|
543 void mark_subwindows_state_changed (void);
|
|
544 #define MARK_SUBWINDOWS_STATE_CHANGED mark_subwindows_state_changed ()
|
428
|
545
|
|
546 #define CLASS_RESET_CHANGED_FLAGS(p) do { \
|
|
547 (p)->buffers_changed = 0; \
|
|
548 (p)->clip_changed = 0; \
|
|
549 (p)->extents_changed = 0; \
|
|
550 (p)->faces_changed = 0; \
|
|
551 (p)->frame_changed = 0; \
|
|
552 (p)->icon_changed = 0; \
|
|
553 (p)->menubar_changed = 0; \
|
|
554 (p)->modeline_changed = 0; \
|
|
555 (p)->point_changed = 0; \
|
|
556 (p)->toolbar_changed = 0; \
|
|
557 (p)->gutter_changed = 0; \
|
|
558 (p)->glyphs_changed = 0; \
|
|
559 (p)->subwindows_changed = 0; \
|
|
560 (p)->subwindows_state_changed = 0; \
|
|
561 (p)->windows_changed = 0; \
|
|
562 (p)->windows_structure_changed = 0; \
|
|
563 } while (0)
|
|
564
|
|
565 #define GLOBAL_RESET_CHANGED_FLAGS do { \
|
|
566 buffers_changed = 0; \
|
|
567 clip_changed = 0; \
|
|
568 extents_changed = 0; \
|
|
569 frame_changed = 0; \
|
|
570 icon_changed = 0; \
|
|
571 menubar_changed = 0; \
|
|
572 modeline_changed = 0; \
|
|
573 point_changed = 0; \
|
|
574 toolbar_changed = 0; \
|
|
575 gutter_changed = 0; \
|
|
576 glyphs_changed = 0; \
|
|
577 subwindows_changed = 0; \
|
442
|
578 subwindows_state_changed = 0; \
|
428
|
579 windows_changed = 0; \
|
|
580 windows_structure_changed = 0; \
|
|
581 } while (0)
|
|
582
|
|
583 #define CLASS_REDISPLAY_FLAGS_CHANGEDP(p) \
|
|
584 ( (p)->buffers_changed || \
|
|
585 (p)->clip_changed || \
|
|
586 (p)->extents_changed || \
|
|
587 (p)->faces_changed || \
|
|
588 (p)->frame_changed || \
|
|
589 (p)->icon_changed || \
|
|
590 (p)->menubar_changed || \
|
|
591 (p)->modeline_changed || \
|
|
592 (p)->point_changed || \
|
|
593 (p)->toolbar_changed || \
|
|
594 (p)->gutter_changed || \
|
|
595 (p)->glyphs_changed || \
|
442
|
596 (p)->size_changed || \
|
428
|
597 (p)->subwindows_changed || \
|
|
598 (p)->subwindows_state_changed || \
|
|
599 (p)->windows_changed || \
|
|
600 (p)->windows_structure_changed )
|
|
601
|
|
602 #define GLOBAL_REDISPLAY_FLAGS_CHANGEDP \
|
|
603 ( buffers_changed || \
|
|
604 clip_changed || \
|
|
605 extents_changed || \
|
|
606 faces_changed || \
|
|
607 frame_changed || \
|
|
608 icon_changed || \
|
|
609 menubar_changed || \
|
|
610 modeline_changed || \
|
|
611 point_changed || \
|
|
612 toolbar_changed || \
|
|
613 gutter_changed || \
|
|
614 glyphs_changed || \
|
430
|
615 size_changed || \
|
428
|
616 subwindows_changed || \
|
|
617 subwindows_state_changed || \
|
|
618 windows_changed || \
|
|
619 windows_structure_changed )
|
|
620
|
|
621
|
|
622 /* Anytime a console, device or frame is added or deleted we need to reset
|
|
623 these flags. */
|
|
624 #define RESET_CHANGED_SET_FLAGS do { \
|
|
625 buffers_changed_set = 0; \
|
|
626 clip_changed_set = 0; \
|
|
627 extents_changed_set = 0; \
|
|
628 icon_changed_set = 0; \
|
|
629 menubar_changed_set = 0; \
|
|
630 modeline_changed_set = 0; \
|
|
631 point_changed_set = 0; \
|
|
632 toolbar_changed_set = 0; \
|
|
633 gutter_changed_set = 0; \
|
|
634 glyphs_changed_set = 0; \
|
|
635 subwindows_changed_set = 0; \
|
|
636 subwindows_state_changed_set = 0; \
|
|
637 } while (0)
|
|
638
|
|
639
|
|
640 /*************************************************************************/
|
|
641 /* redisplay global variables */
|
|
642 /*************************************************************************/
|
|
643
|
|
644 /* redisplay structure used by various utility routines. */
|
|
645 extern display_line_dynarr *cmotion_display_lines;
|
|
646
|
|
647 /* Nonzero means truncate lines in all windows less wide than the frame. */
|
|
648 extern int truncate_partial_width_windows;
|
|
649
|
|
650 /* Nonzero if we're in a display critical section. */
|
|
651 extern int in_display;
|
|
652
|
|
653 /* Nonzero means no need to redraw the entire frame on resuming
|
|
654 a suspended Emacs. This is useful on terminals with multiple pages,
|
|
655 where one page is used for Emacs and another for all else. */
|
|
656 extern int no_redraw_on_reenter;
|
|
657
|
442
|
658 /* Non-nil means flash the frame instead of ringing the bell. */
|
|
659 extern Lisp_Object Vvisible_bell;
|
428
|
660
|
|
661 /* Thickness of shadow border around 3D modelines. */
|
|
662 extern Lisp_Object Vmodeline_shadow_thickness;
|
|
663
|
|
664 /* Scroll if point lands on the bottom line and that line is partially
|
|
665 clipped. */
|
|
666 extern int scroll_on_clipped_lines;
|
|
667
|
|
668 extern Lisp_Object Vglobal_mode_string;
|
|
669
|
|
670 /* The following two variables are defined in emacs.c and are used
|
|
671 to convey information discovered on the command line way early
|
|
672 (before *anything* is initialized). */
|
|
673
|
|
674 /* If non-zero, a window-system was specified on the command line.
|
|
675 Defined in emacs.c. */
|
|
676 extern int display_arg;
|
|
677
|
|
678 /* Type of display specified. Defined in emacs.c. */
|
771
|
679 extern const Char_ASCII *display_use;
|
428
|
680
|
|
681 /* Nonzero means reading single-character input with prompt
|
|
682 so put cursor on minibuffer after the prompt. */
|
|
683
|
|
684 extern int cursor_in_echo_area;
|
|
685
|
|
686 extern Lisp_Object Qbar_cursor, Qcursor_in_echo_area, Vwindow_system;
|
|
687
|
442
|
688 extern Lisp_Object Qtop_bottom;
|
|
689
|
428
|
690
|
|
691 /*************************************************************************/
|
|
692 /* redisplay exported functions */
|
|
693 /*************************************************************************/
|
|
694 EXFUN (Fredraw_frame, 2);
|
|
695
|
|
696 int redisplay_text_width_string (struct window *w, int findex,
|
867
|
697 Ibyte *nonreloc, Lisp_Object reloc,
|
428
|
698 Bytecount offset, Bytecount len);
|
|
699 int redisplay_frame_text_width_string (struct frame *f,
|
|
700 Lisp_Object face,
|
867
|
701 Ibyte *nonreloc,
|
428
|
702 Lisp_Object reloc,
|
|
703 Bytecount offset, Bytecount len);
|
442
|
704 int redisplay_frame (struct frame *f, int preemption_check);
|
853
|
705 void redisplay_no_pre_idle_hook (void);
|
428
|
706 void redisplay (void);
|
853
|
707 Lisp_Object eval_within_redisplay (Lisp_Object dont_trust_this_damn_sucker);
|
428
|
708 struct display_block *get_display_block_from_line (struct display_line *dl,
|
|
709 enum display_type type);
|
|
710 layout_bounds calculate_display_line_boundaries (struct window *w,
|
|
711 int modeline);
|
665
|
712 Charbpos point_at_center (struct window *w, int type, Charbpos start,
|
826
|
713 Charbpos point);
|
|
714 int line_at_center (struct window *w, int type, Charbpos start,
|
|
715 Charbpos point);
|
428
|
716 int window_half_pixpos (struct window *w);
|
|
717 void redisplay_echo_area (void);
|
|
718 void free_display_structs (struct window_mirror *mir);
|
|
719 void free_display_lines (display_line_dynarr *dla);
|
442
|
720 void mark_redisplay_structs (display_line_dynarr *dla);
|
428
|
721 void generate_displayable_area (struct window *w, Lisp_Object disp_string,
|
|
722 int xpos, int ypos, int width, int height,
|
|
723 display_line_dynarr* dl,
|
665
|
724 Charbpos start_pos, face_index default_face);
|
438
|
725 /* `generate_title_string' in frame.c needs this */
|
|
726 void generate_formatted_string_db (Lisp_Object format_str,
|
|
727 Lisp_Object result_str,
|
|
728 struct window *w,
|
|
729 struct display_line *dl,
|
|
730 struct display_block *db,
|
|
731 face_index findex,
|
|
732 int min_pixpos, int max_pixpos, int type);
|
428
|
733 int real_current_modeline_height (struct window *w);
|
|
734 int pixel_to_glyph_translation (struct frame *f, int x_coord,
|
|
735 int y_coord, int *col, int *row,
|
|
736 int *obj_x, int *obj_y,
|
665
|
737 struct window **w, Charbpos *charbpos,
|
|
738 Charbpos *closest, Charcount *modeline_closest,
|
428
|
739 Lisp_Object *obj1, Lisp_Object *obj2);
|
|
740 void glyph_to_pixel_translation (struct window *w, int char_x,
|
|
741 int char_y, int *pix_x, int *pix_y);
|
665
|
742 int point_in_line_start_cache (struct window *w, Charbpos point,
|
428
|
743 int min_past);
|
665
|
744 int point_would_be_visible (struct window *w, Charbpos startp,
|
826
|
745 Charbpos point);
|
665
|
746 Charbpos start_of_last_line (struct window *w, Charbpos startp);
|
|
747 Charbpos end_of_last_line (struct window *w, Charbpos startp);
|
|
748 Charbpos start_with_line_at_pixpos (struct window *w, Charbpos point,
|
826
|
749 int pixpos);
|
665
|
750 Charbpos start_with_point_on_display_line (struct window *w, Charbpos point,
|
826
|
751 int line);
|
428
|
752 int redisplay_variable_changed (Lisp_Object sym, Lisp_Object *val,
|
|
753 Lisp_Object in_object, int flags);
|
|
754 void redisplay_glyph_changed (Lisp_Object glyph, Lisp_Object property,
|
|
755 Lisp_Object locale);
|
|
756
|
|
757 #ifdef MEMORY_USAGE_STATS
|
|
758 int compute_display_line_dynarr_usage (display_line_dynarr *dyn,
|
|
759 struct overhead_stats *ovstats);
|
|
760 int compute_line_start_cache_dynarr_usage (line_start_cache_dynarr *dyn,
|
|
761 struct overhead_stats *ovstats);
|
|
762 #endif
|
|
763
|
|
764
|
|
765 /* defined in redisplay-output.c */
|
|
766 int get_next_display_block (layout_bounds bounds,
|
|
767 display_block_dynarr *dba, int start_pos,
|
|
768 int *next_start);
|
442
|
769 void redisplay_output_layout (Lisp_Object domain,
|
428
|
770 Lisp_Object image_instance,
|
617
|
771 struct display_box* db,
|
|
772 struct display_glyph_area* dga,
|
|
773 face_index findex, int cursor_start,
|
|
774 int cursor_width,
|
428
|
775 int cursor_height);
|
|
776 void redisplay_output_subwindow (struct window *w,
|
|
777 Lisp_Object image_instance,
|
617
|
778 struct display_box* db,
|
|
779 struct display_glyph_area* dga,
|
|
780 face_index findex, int cursor_start,
|
|
781 int cursor_width,
|
428
|
782 int cursor_height);
|
617
|
783 void redisplay_unmap_subwindows_maybe (struct frame* f, int x, int y,
|
|
784 int width, int height);
|
428
|
785 void redisplay_output_pixmap (struct window *w,
|
|
786 Lisp_Object image_instance,
|
617
|
787 struct display_box* db,
|
|
788 struct display_glyph_area* dga,
|
|
789 face_index findex, int cursor_start,
|
|
790 int cursor_width,
|
428
|
791 int cursor_height, int offset_bitmap);
|
|
792 int redisplay_calculate_display_boxes (struct display_line *dl, int xpos,
|
819
|
793 int xoffset, int yoffset, int start_pixpos,
|
|
794 int width, struct display_box* dest,
|
428
|
795 struct display_glyph_area* src);
|
|
796 int redisplay_normalize_glyph_area (struct display_box* dest,
|
|
797 struct display_glyph_area* glyphsrc);
|
|
798 void redisplay_clear_to_window_end (struct window *w, int ypos1, int ypos2);
|
|
799 void redisplay_clear_region (Lisp_Object window, face_index findex, int x,
|
|
800 int y, int width, int height);
|
448
|
801 void redisplay_clear_top_of_window (struct window *w);
|
428
|
802 void redisplay_clear_bottom_of_window (struct window *w,
|
|
803 display_line_dynarr *ddla,
|
|
804 int min_start, int max_end);
|
|
805 void redisplay_update_line (struct window *w, int first_line,
|
|
806 int last_line, int update_values);
|
|
807 void redisplay_output_window (struct window *w);
|
|
808 void bevel_modeline (struct window *w, struct display_line *dl);
|
665
|
809 int redisplay_move_cursor (struct window *w, Charbpos new_point,
|
428
|
810 int no_output_end);
|
|
811 void redisplay_redraw_cursor (struct frame *f, int run_begin_end_meths);
|
|
812 void output_display_line (struct window *w, display_line_dynarr *cdla,
|
|
813 display_line_dynarr *ddla, int line,
|
|
814 int force_start, int force_end);
|
442
|
815 void sync_display_line_structs (struct window *w, int line, int do_blocks,
|
|
816 display_line_dynarr *cdla,
|
|
817 display_line_dynarr *ddla);
|
428
|
818
|
440
|
819 #endif /* INCLUDED_redisplay_h_ */
|