aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1994-03-19 02:53:33 +0000
committerKarl Heuer1994-03-19 02:53:33 +0000
commit4cdc65eb4ae4052201205f1197704fa9190e5da5 (patch)
tree540a600a17e4cabfd6a45c9daf9e6fff13ee8408
parenta1c3de84f5f59a5e15cf6f691a42a4f3fe6dd4ed (diff)
downloademacs-4cdc65eb4ae4052201205f1197704fa9190e5da5.tar.gz
emacs-4cdc65eb4ae4052201205f1197704fa9190e5da5.zip
(fix_glyph, display_text_line, copy_part_of_rope, display_mode_line): Handle
termcap frames as well as X.
-rw-r--r--src/xdisp.c88
1 files changed, 52 insertions, 36 deletions
diff --git a/src/xdisp.c b/src/xdisp.c
index bad74b0ee77..8108387ea51 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -1837,28 +1837,39 @@ copy_part_of_rope (f, to, s, from, len, face)
1837 int last_code = -1; 1837 int last_code = -1;
1838 int last_merged = 0; 1838 int last_merged = 0;
1839 1839
1840 while (n--) 1840#ifdef HAVE_X_WINDOWS
1841 { 1841 if (! FRAME_TERMCAP_P (f))
1842 int glyph = XFASTINT (*fp); 1842 while (n--)
1843 int facecode; 1843 {
1844 1844 int glyph = XFASTINT (*fp);
1845 if (GLYPH_FACE (glyph) == 0) 1845 int facecode;
1846 /* If GLYPH has no face code, use FACE. */ 1846
1847 facecode = face; 1847 if (FAST_GLYPH_FACE (glyph) == 0)
1848 else if (GLYPH_FACE (glyph) == last_code) 1848 /* If GLYPH has no face code, use FACE. */
1849 /* If it's same as previous glyph, use same result. */ 1849 facecode = face;
1850 facecode = last_merged; 1850 else if (FAST_GLYPH_FACE (glyph) == last_code)
1851 else 1851 /* If it's same as previous glyph, use same result. */
1852 { 1852 facecode = last_merged;
1853 /* Merge this glyph's face and remember the result. */ 1853 else
1854 last_code = GLYPH_FACE (glyph); 1854 {
1855 last_merged = facecode = compute_glyph_face (f, last_code, face); 1855 /* Merge this glyph's face and remember the result. */
1856 } 1856 last_code = FAST_GLYPH_FACE (glyph);
1857 last_merged = facecode = compute_glyph_face (f, last_code, face);
1858 }
1857 1859
1858 if (to >= s) *to = MAKE_GLYPH (GLYPH_CHAR (glyph), facecode); 1860 if (to >= s)
1859 ++to; 1861 *to = FAST_MAKE_GLYPH (FAST_GLYPH_CHAR (glyph), facecode);
1860 ++fp; 1862 ++to;
1861 } 1863 ++fp;
1864 }
1865 else
1866#endif
1867 while (n--)
1868 {
1869 if (to >= s) *to = XFASTINT (*fp);
1870 ++to;
1871 ++fp;
1872 }
1862 return to; 1873 return to;
1863} 1874}
1864 1875
@@ -1871,10 +1882,13 @@ fix_glyph (f, glyph, current_face)
1871 GLYPH glyph; 1882 GLYPH glyph;
1872 int current_face; 1883 int current_face;
1873{ 1884{
1874 if (GLYPH_FACE (glyph) == 0) 1885#ifdef HAVE_X_WINDOWS
1875 return glyph; 1886 if (! FRAME_TERMCAP_P (f) && FAST_GLYPH_FACE (glyph) != 0)
1876 return MAKE_GLYPH (GLYPH_CHAR (glyph), 1887 return FAST_MAKE_GLYPH (FAST_GLYPH_CHAR (glyph),
1877 compute_glyph_face (f, GLYPH_FACE (glyph), current_face)); 1888 compute_glyph_face (f, FAST_GLYPH_FACE (glyph),
1889 current_face));
1890#endif
1891 return glyph;
1878} 1892}
1879 1893
1880/* Display one line of window w, starting at position START in W's buffer. 1894/* Display one line of window w, starting at position START in W's buffer.
@@ -2109,7 +2123,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2109 && (dp == 0 || XTYPE (DISP_CHAR_VECTOR (dp, c)) != Lisp_Vector)) 2123 && (dp == 0 || XTYPE (DISP_CHAR_VECTOR (dp, c)) != Lisp_Vector))
2110 { 2124 {
2111 if (p1 >= startp) 2125 if (p1 >= startp)
2112 *p1 = MAKE_GLYPH (c, current_face); 2126 *p1 = MAKE_GLYPH (f, c, current_face);
2113 p1++; 2127 p1++;
2114 } 2128 }
2115 else if (c == '\n') 2129 else if (c == '\n')
@@ -2132,12 +2146,12 @@ display_text_line (w, start, vpos, hpos, taboffset)
2132 copy_part_of_rope (f, p1prev, p1prev, invis_vector_contents, 2146 copy_part_of_rope (f, p1prev, p1prev, invis_vector_contents,
2133 (p1 - p1prev), current_face); 2147 (p1 - p1prev), current_face);
2134 } 2148 }
2135#if 1 2149#ifdef HAVE_X_WINDOWS
2136 /* Draw the face of the newline character as extending all the 2150 /* Draw the face of the newline character as extending all the
2137 way to the end of the frame line. */ 2151 way to the end of the frame line. */
2138 if (current_face) 2152 if (current_face)
2139 while (p1 < endp) 2153 while (p1 < endp)
2140 *p1++ = MAKE_GLYPH (' ', current_face); 2154 *p1++ = FAST_MAKE_GLYPH (' ', current_face);
2141#endif 2155#endif
2142 break; 2156 break;
2143 } 2157 }
@@ -2146,7 +2160,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2146 do 2160 do
2147 { 2161 {
2148 if (p1 >= startp && p1 < endp) 2162 if (p1 >= startp && p1 < endp)
2149 *p1 = MAKE_GLYPH (' ', current_face); 2163 *p1 = MAKE_GLYPH (f, ' ', current_face);
2150 p1++; 2164 p1++;
2151 } 2165 }
2152 while ((p1 - startp + taboffset + hscroll - (hscroll > 0)) 2166 while ((p1 - startp + taboffset + hscroll - (hscroll > 0))
@@ -2165,12 +2179,12 @@ display_text_line (w, start, vpos, hpos, taboffset)
2165 copy_part_of_rope (f, p1prev, p1prev, invis_vector_contents, 2179 copy_part_of_rope (f, p1prev, p1prev, invis_vector_contents,
2166 (p1 - p1prev), current_face); 2180 (p1 - p1prev), current_face);
2167 } 2181 }
2168#if 1 2182#ifdef HAVE_X_WINDOWS
2169 /* Draw the face of the newline character as extending all the 2183 /* Draw the face of the newline character as extending all the
2170 way to the end of the frame line. */ 2184 way to the end of the frame line. */
2171 if (current_face) 2185 if (current_face)
2172 while (p1 < endp) 2186 while (p1 < endp)
2173 *p1++ = MAKE_GLYPH (' ', current_face); 2187 *p1++ = FAST_MAKE_GLYPH (' ', current_face);
2174#endif 2188#endif
2175 break; 2189 break;
2176 } 2190 }
@@ -2189,7 +2203,7 @@ display_text_line (w, start, vpos, hpos, taboffset)
2189 current_face); 2203 current_face);
2190 p1++; 2204 p1++;
2191 if (p1 >= startp && p1 < endp) 2205 if (p1 >= startp && p1 < endp)
2192 *p1 = MAKE_GLYPH (c ^ 0100, current_face); 2206 *p1 = MAKE_GLYPH (f, c ^ 0100, current_face);
2193 p1++; 2207 p1++;
2194 } 2208 }
2195 else 2209 else
@@ -2200,13 +2214,13 @@ display_text_line (w, start, vpos, hpos, taboffset)
2200 current_face); 2214 current_face);
2201 p1++; 2215 p1++;
2202 if (p1 >= startp && p1 < endp) 2216 if (p1 >= startp && p1 < endp)
2203 *p1 = MAKE_GLYPH ((c >> 6) + '0', current_face); 2217 *p1 = MAKE_GLYPH (f, (c >> 6) + '0', current_face);
2204 p1++; 2218 p1++;
2205 if (p1 >= startp && p1 < endp) 2219 if (p1 >= startp && p1 < endp)
2206 *p1 = MAKE_GLYPH ((7 & (c >> 3)) + '0', current_face); 2220 *p1 = MAKE_GLYPH (f, (7 & (c >> 3)) + '0', current_face);
2207 p1++; 2221 p1++;
2208 if (p1 >= startp && p1 < endp) 2222 if (p1 >= startp && p1 < endp)
2209 *p1 = MAKE_GLYPH ((7 & c) + '0', current_face); 2223 *p1 = MAKE_GLYPH (f, (7 & c) + '0', current_face);
2210 p1++; 2224 p1++;
2211 } 2225 }
2212 2226
@@ -2452,14 +2466,16 @@ display_mode_line (w)
2452 if (XFASTINT (w->width) == FRAME_WIDTH (f) 2466 if (XFASTINT (w->width) == FRAME_WIDTH (f)
2453 || XFASTINT (XWINDOW (w->parent)->width) == FRAME_WIDTH (f)) 2467 || XFASTINT (XWINDOW (w->parent)->width) == FRAME_WIDTH (f))
2454 FRAME_DESIRED_GLYPHS (f)->highlight[vpos] = mode_line_inverse_video; 2468 FRAME_DESIRED_GLYPHS (f)->highlight[vpos] = mode_line_inverse_video;
2469#ifdef HAVE_X_WINDOWS
2455 else if (! FRAME_TERMCAP_P (f)) 2470 else if (! FRAME_TERMCAP_P (f))
2456 { 2471 {
2457 /* For a partial width window, explicitly set face of each glyph. */ 2472 /* For a partial width window, explicitly set face of each glyph. */
2458 int i; 2473 int i;
2459 GLYPH *ptr = FRAME_DESIRED_GLYPHS (f)->glyphs[vpos]; 2474 GLYPH *ptr = FRAME_DESIRED_GLYPHS (f)->glyphs[vpos];
2460 for (i = left; i < right; ++i) 2475 for (i = left; i < right; ++i)
2461 ptr[i] = MAKE_GLYPH (GLYPH_CHAR (ptr[i]), 1); 2476 ptr[i] = FAST_MAKE_GLYPH (FAST_GLYPH_CHAR (ptr[i]), 1);
2462 } 2477 }
2478#endif
2463 2479
2464#ifdef HAVE_X_WINDOWS 2480#ifdef HAVE_X_WINDOWS
2465 if (w == XWINDOW (f->selected_window)) 2481 if (w == XWINDOW (f->selected_window))