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