comparison src/dispnew.c @ 112021:6ce864f1550e

Protoize * dispnew.c (add_window_display_history) (add_frame_display_history, glyph_row_slice_p) (find_glyph_row_slice, flush_stdout) (check_matrix_pointer_lossage, matrix_row) (check_matrix_invariants, check_window_matrix_pointers) (check_matrix_pointers, window_to_frame_vpos) (window_to_frame_hpos): Prototize. * textprop.c (erase_properties): Likewise.
author Andreas Schwab <schwab@linux-m68k.org>
date Mon, 27 Dec 2010 18:23:29 +0100
parents a5a188ddc758
children ac49e05bfcf2
comparison
equal deleted inserted replaced
112020:9780afa403a4 112021:6ce864f1550e
356 MSG is a trace containing the information how W's glyph matrix 356 MSG is a trace containing the information how W's glyph matrix
357 has been constructed. PAUSED_P non-zero means that the update 357 has been constructed. PAUSED_P non-zero means that the update
358 has been interrupted for pending input. */ 358 has been interrupted for pending input. */
359 359
360 static void 360 static void
361 add_window_display_history (w, msg, paused_p) 361 add_window_display_history (struct window *w, char *msg, int paused_p)
362 struct window *w;
363 char *msg;
364 int paused_p;
365 { 362 {
366 char *buf; 363 char *buf;
367 364
368 if (history_idx >= REDISPLAY_HISTORY_SIZE) 365 if (history_idx >= REDISPLAY_HISTORY_SIZE)
369 history_idx = 0; 366 history_idx = 0;
385 /* Add to the redisplay history that frame F has been displayed. 382 /* Add to the redisplay history that frame F has been displayed.
386 PAUSED_P non-zero means that the update has been interrupted for 383 PAUSED_P non-zero means that the update has been interrupted for
387 pending input. */ 384 pending input. */
388 385
389 static void 386 static void
390 add_frame_display_history (f, paused_p) 387 add_frame_display_history (struct frame *f, int paused_p)
391 struct frame *f;
392 int paused_p;
393 { 388 {
394 char *buf; 389 char *buf;
395 390
396 if (history_idx >= REDISPLAY_HISTORY_SIZE) 391 if (history_idx >= REDISPLAY_HISTORY_SIZE)
397 history_idx = 0; 392 history_idx = 0;
1242 memory of FRAME_ROW. */ 1237 memory of FRAME_ROW. */
1243 1238
1244 #if GLYPH_DEBUG 1239 #if GLYPH_DEBUG
1245 1240
1246 static int 1241 static int
1247 glyph_row_slice_p (window_row, frame_row) 1242 glyph_row_slice_p (struct glyph_row *window_row, struct glyph_row *frame_row)
1248 struct glyph_row *window_row, *frame_row;
1249 { 1243 {
1250 struct glyph *window_glyph_start = window_row->glyphs[0]; 1244 struct glyph *window_glyph_start = window_row->glyphs[0];
1251 struct glyph *frame_glyph_start = frame_row->glyphs[0]; 1245 struct glyph *frame_glyph_start = frame_row->glyphs[0];
1252 struct glyph *frame_glyph_end = frame_row->glyphs[LAST_AREA]; 1246 struct glyph *frame_glyph_end = frame_row->glyphs[LAST_AREA];
1253 1247
1262 /* Find the row in the window glyph matrix WINDOW_MATRIX being a slice 1256 /* Find the row in the window glyph matrix WINDOW_MATRIX being a slice
1263 of ROW in the frame matrix FRAME_MATRIX. Value is null if no row 1257 of ROW in the frame matrix FRAME_MATRIX. Value is null if no row
1264 in WINDOW_MATRIX is found satisfying the condition. */ 1258 in WINDOW_MATRIX is found satisfying the condition. */
1265 1259
1266 static struct glyph_row * 1260 static struct glyph_row *
1267 find_glyph_row_slice (window_matrix, frame_matrix, row) 1261 find_glyph_row_slice (struct glyph_matrix *window_matrix,
1268 struct glyph_matrix *window_matrix, *frame_matrix; 1262 struct glyph_matrix *frame_matrix, int row)
1269 int row;
1270 { 1263 {
1271 int i; 1264 int i;
1272 1265
1273 xassert (row >= 0 && row < frame_matrix->nrows); 1266 xassert (row >= 0 && row < frame_matrix->nrows);
1274 1267
1568 XXX Maybe this should be changed to flush the current terminal instead of 1561 XXX Maybe this should be changed to flush the current terminal instead of
1569 stdout. 1562 stdout.
1570 */ 1563 */
1571 1564
1572 void 1565 void
1573 flush_stdout () 1566 flush_stdout (void)
1574 { 1567 {
1575 fflush (stdout); 1568 fflush (stdout);
1576 } 1569 }
1577 1570
1578 1571
1580 pointer has been lost, e.g. by using a structure assignment between 1573 pointer has been lost, e.g. by using a structure assignment between
1581 rows, at least one pointer must occur more than once in the rows of 1574 rows, at least one pointer must occur more than once in the rows of
1582 MATRIX. */ 1575 MATRIX. */
1583 1576
1584 void 1577 void
1585 check_matrix_pointer_lossage (matrix) 1578 check_matrix_pointer_lossage (struct glyph_matrix *matrix)
1586 struct glyph_matrix *matrix;
1587 { 1579 {
1588 int i, j; 1580 int i, j;
1589 1581
1590 for (i = 0; i < matrix->nrows; ++i) 1582 for (i = 0; i < matrix->nrows; ++i)
1591 for (j = 0; j < matrix->nrows; ++j) 1583 for (j = 0; j < matrix->nrows; ++j)
1596 1588
1597 1589
1598 /* Get a pointer to glyph row ROW in MATRIX, with bounds checks. */ 1590 /* Get a pointer to glyph row ROW in MATRIX, with bounds checks. */
1599 1591
1600 struct glyph_row * 1592 struct glyph_row *
1601 matrix_row (matrix, row) 1593 matrix_row (struct glyph_matrix *matrix, int row)
1602 struct glyph_matrix *matrix;
1603 int row;
1604 { 1594 {
1605 xassert (matrix && matrix->rows); 1595 xassert (matrix && matrix->rows);
1606 xassert (row >= 0 && row < matrix->nrows); 1596 xassert (row >= 0 && row < matrix->nrows);
1607 1597
1608 /* That's really too slow for normal testing because this function 1598 /* That's really too slow for normal testing because this function
1622 1612
1623 /* Check invariants that must hold for an up to date current matrix of 1613 /* Check invariants that must hold for an up to date current matrix of
1624 window W. */ 1614 window W. */
1625 1615
1626 static void 1616 static void
1627 check_matrix_invariants (w) 1617 check_matrix_invariants (struct window *w)
1628 struct window *w;
1629 { 1618 {
1630 struct glyph_matrix *matrix = w->current_matrix; 1619 struct glyph_matrix *matrix = w->current_matrix;
1631 int yb = window_text_bottom_y (w); 1620 int yb = window_text_bottom_y (w);
1632 struct glyph_row *row = matrix->rows; 1621 struct glyph_row *row = matrix->rows;
1633 struct glyph_row *last_text_row = NULL; 1622 struct glyph_row *last_text_row = NULL;
3144 window in the window tree rooted at W, check that rows in the 3133 window in the window tree rooted at W, check that rows in the
3145 matrices of leaf window agree with their frame matrices about 3134 matrices of leaf window agree with their frame matrices about
3146 glyph pointers. */ 3135 glyph pointers. */
3147 3136
3148 void 3137 void
3149 check_window_matrix_pointers (w) 3138 check_window_matrix_pointers (struct window *w)
3150 struct window *w;
3151 { 3139 {
3152 while (w) 3140 while (w)
3153 { 3141 {
3154 if (!NILP (w->hchild)) 3142 if (!NILP (w->hchild))
3155 check_window_matrix_pointers (XWINDOW (w->hchild)); 3143 check_window_matrix_pointers (XWINDOW (w->hchild));
3171 a window and FRAME_MATRIX is the corresponding frame matrix. For 3159 a window and FRAME_MATRIX is the corresponding frame matrix. For
3172 each row in WINDOW_MATRIX check that it's a slice of the 3160 each row in WINDOW_MATRIX check that it's a slice of the
3173 corresponding frame row. If it isn't, abort. */ 3161 corresponding frame row. If it isn't, abort. */
3174 3162
3175 static void 3163 static void
3176 check_matrix_pointers (window_matrix, frame_matrix) 3164 check_matrix_pointers (struct glyph_matrix *window_matrix,
3177 struct glyph_matrix *window_matrix, *frame_matrix; 3165 struct glyph_matrix *frame_matrix)
3178 { 3166 {
3179 /* Row number in WINDOW_MATRIX. */ 3167 /* Row number in WINDOW_MATRIX. */
3180 int i = 0; 3168 int i = 0;
3181 3169
3182 /* Row number corresponding to I in FRAME_MATRIX. */ 3170 /* Row number corresponding to I in FRAME_MATRIX. */
3206 3194
3207 /* Translate vertical position VPOS which is relative to window W to a 3195 /* Translate vertical position VPOS which is relative to window W to a
3208 vertical position relative to W's frame. */ 3196 vertical position relative to W's frame. */
3209 3197
3210 static int 3198 static int
3211 window_to_frame_vpos (w, vpos) 3199 window_to_frame_vpos (struct window *w, int vpos)
3212 struct window *w;
3213 int vpos;
3214 { 3200 {
3215 struct frame *f = XFRAME (w->frame); 3201 struct frame *f = XFRAME (w->frame);
3216 3202
3217 xassert (!FRAME_WINDOW_P (f)); 3203 xassert (!FRAME_WINDOW_P (f));
3218 xassert (vpos >= 0 && vpos <= w->desired_matrix->nrows); 3204 xassert (vpos >= 0 && vpos <= w->desired_matrix->nrows);
3224 3210
3225 /* Translate horizontal position HPOS which is relative to window W to 3211 /* Translate horizontal position HPOS which is relative to window W to
3226 a horizontal position relative to W's frame. */ 3212 a horizontal position relative to W's frame. */
3227 3213
3228 static int 3214 static int
3229 window_to_frame_hpos (w, hpos) 3215 window_to_frame_hpos (struct window *w, int hpos)
3230 struct window *w;
3231 int hpos;
3232 { 3216 {
3233 xassert (!FRAME_WINDOW_P (XFRAME (w->frame))); 3217 xassert (!FRAME_WINDOW_P (XFRAME (w->frame)));
3234 hpos += WINDOW_LEFT_EDGE_COL (w); 3218 hpos += WINDOW_LEFT_EDGE_COL (w);
3235 return hpos; 3219 return hpos;
3236 } 3220 }