Mercurial > emacs
comparison src/dispnew.c @ 34736:51a0fe34dfc6
(fake_current_matrices, ensure_frame_matrix): New
functions.
(adjust_frame_glyphs_for_frame_redisplay): If display has been
completed, call fake_current_matrices instead of marking frame
garbaged.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Wed, 20 Dec 2000 12:00:57 +0000 |
parents | fc3693bea815 |
children | 9512f05b60d1 |
comparison
equal
deleted
inserted
replaced
34735:2d590f9a5d31 | 34736:51a0fe34dfc6 |
---|---|
118 }; | 118 }; |
119 | 119 |
120 | 120 |
121 /* Function prototypes. */ | 121 /* Function prototypes. */ |
122 | 122 |
123 static void fake_current_matrices P_ ((Lisp_Object)); | |
123 static void redraw_overlapping_rows P_ ((struct window *, int)); | 124 static void redraw_overlapping_rows P_ ((struct window *, int)); |
124 static void redraw_overlapped_rows P_ ((struct window *, int)); | 125 static void redraw_overlapped_rows P_ ((struct window *, int)); |
125 static int count_blanks P_ ((struct glyph *, int)); | 126 static int count_blanks P_ ((struct glyph *, int)); |
126 static int count_match P_ ((struct glyph *, struct glyph *, | 127 static int count_match P_ ((struct glyph *, struct glyph *, |
127 struct glyph *, struct glyph *)); | 128 struct glyph *, struct glyph *)); |
1999 | 2000 |
2000 f->glyphs_initialized_p = 1; | 2001 f->glyphs_initialized_p = 1; |
2001 } | 2002 } |
2002 | 2003 |
2003 | 2004 |
2005 /* In the window tree with root W, build current matrices of leaf | |
2006 windows from the frame's current matrix. */ | |
2007 | |
2008 static void | |
2009 fake_current_matrices (window) | |
2010 Lisp_Object window; | |
2011 { | |
2012 struct window *w; | |
2013 | |
2014 for (; !NILP (window); window = w->next) | |
2015 { | |
2016 w = XWINDOW (window); | |
2017 | |
2018 if (!NILP (w->hchild)) | |
2019 fake_current_matrices (w->hchild); | |
2020 else if (!NILP (w->vchild)) | |
2021 fake_current_matrices (w->vchild); | |
2022 else | |
2023 { | |
2024 int i; | |
2025 struct frame *f = XFRAME (w->frame); | |
2026 struct glyph_matrix *m = w->current_matrix; | |
2027 struct glyph_matrix *fm = f->current_matrix; | |
2028 | |
2029 xassert (m->matrix_h == XFASTINT (w->height)); | |
2030 xassert (m->matrix_w == XFASTINT (w->width)); | |
2031 | |
2032 for (i = 0; i < m->matrix_h; ++i) | |
2033 { | |
2034 struct glyph_row *r = m->rows + i; | |
2035 struct glyph_row *fr = fm->rows + i + XFASTINT (w->top); | |
2036 | |
2037 xassert (r->glyphs[TEXT_AREA] >= fr->glyphs[TEXT_AREA] | |
2038 && r->glyphs[LAST_AREA] <= fr->glyphs[LAST_AREA]); | |
2039 | |
2040 r->enabled_p = fr->enabled_p; | |
2041 if (r->enabled_p) | |
2042 { | |
2043 r->used[LEFT_MARGIN_AREA] = m->left_margin_glyphs; | |
2044 r->used[RIGHT_MARGIN_AREA] = m->right_margin_glyphs; | |
2045 r->used[TEXT_AREA] = (m->matrix_w | |
2046 - r->used[LEFT_MARGIN_AREA] | |
2047 - r->used[RIGHT_MARGIN_AREA]); | |
2048 r->mode_line_p = 0; | |
2049 r->inverse_p = fr->inverse_p; | |
2050 } | |
2051 } | |
2052 } | |
2053 } | |
2054 } | |
2055 | |
2056 | |
2057 /* Make sure the current frame matrix of frame F has been built. | |
2058 This is a no-op if F doesn't use frame-based redisplay. */ | |
2059 | |
2060 void | |
2061 ensure_frame_matrix (f) | |
2062 struct frame *f; | |
2063 { | |
2064 if (f->current_pool && display_completed) | |
2065 build_frame_matrix (f); | |
2066 } | |
2067 | |
2068 | |
2004 /* Allocate/reallocate glyph matrices of a single frame F for | 2069 /* Allocate/reallocate glyph matrices of a single frame F for |
2005 frame-based redisplay. */ | 2070 frame-based redisplay. */ |
2006 | 2071 |
2007 static void | 2072 static void |
2008 adjust_frame_glyphs_for_frame_redisplay (f) | 2073 adjust_frame_glyphs_for_frame_redisplay (f) |
2034 if (f->desired_matrix == NULL) | 2099 if (f->desired_matrix == NULL) |
2035 { | 2100 { |
2036 f->desired_matrix = new_glyph_matrix (f->desired_pool); | 2101 f->desired_matrix = new_glyph_matrix (f->desired_pool); |
2037 f->current_matrix = new_glyph_matrix (f->current_pool); | 2102 f->current_matrix = new_glyph_matrix (f->current_pool); |
2038 } | 2103 } |
2039 | 2104 |
2040 /* Compute window glyph matrices. (This takes the mini-buffer | 2105 /* Compute window glyph matrices. (This takes the mini-buffer |
2041 window into account). The result is the size of the frame glyph | 2106 window into account). The result is the size of the frame glyph |
2042 matrix needed. The variable window_change_flags is set to a bit | 2107 matrix needed. The variable window_change_flags is set to a bit |
2043 mask indicating whether new matrices will be allocated or | 2108 mask indicating whether new matrices will be allocated or |
2044 existing matrices change their size or location within the frame | 2109 existing matrices change their size or location within the frame |
2074 | 2139 |
2075 /* Resize frame matrices. */ | 2140 /* Resize frame matrices. */ |
2076 adjust_glyph_matrix (NULL, f->desired_matrix, 0, 0, matrix_dim); | 2141 adjust_glyph_matrix (NULL, f->desired_matrix, 0, 0, matrix_dim); |
2077 adjust_glyph_matrix (NULL, f->current_matrix, 0, 0, matrix_dim); | 2142 adjust_glyph_matrix (NULL, f->current_matrix, 0, 0, matrix_dim); |
2078 | 2143 |
2079 /* Since location and size of sub-matrices within the pool may | 2144 /* If the display hasn't been interrupted, set up windows' |
2080 have changed, and current matrices don't have meaningful | 2145 current matrices so that they describe what's on the |
2081 contents anymore, mark the frame garbaged. */ | 2146 screen. */ |
2082 SET_FRAME_GARBAGED (f); | 2147 if (display_completed) |
2148 fake_current_matrices (FRAME_ROOT_WINDOW (f)); | |
2149 else | |
2150 SET_FRAME_GARBAGED (f); | |
2083 } | 2151 } |
2084 } | 2152 } |
2085 | 2153 |
2086 | 2154 |
2087 /* Allocate/reallocate glyph matrices of a single frame F for | 2155 /* Allocate/reallocate glyph matrices of a single frame F for |