aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1994-04-09 06:33:24 +0000
committerRichard M. Stallman1994-04-09 06:33:24 +0000
commita27f9f86efd203e0dede68dcb33c3681d5f503aa (patch)
tree2eff84a159961000b66c83f16924b24efc61c94e /src
parent34216706230adf5b5d979f15b3716b53132a4775 (diff)
downloademacs-a27f9f86efd203e0dede68dcb33c3681d5f503aa.tar.gz
emacs-a27f9f86efd203e0dede68dcb33c3681d5f503aa.zip
(stufflines, scraplines, dumprectangle, x_do_pending_expose)
(pixel_to_glyph_coords, x_draw_box, clear_cursor, x_display_bar_cursor) (x_set_resize_hint, x_set_mouse_position, x_wm_set_size_hint) (XTclear_end_of_line, redraw_previous_char): Use line_height field. (x_new_font): If frame is new, set line_height field. Otherwise call frame_update_line_height.
Diffstat (limited to 'src')
-rw-r--r--src/xterm.c56
1 files changed, 30 insertions, 26 deletions
diff --git a/src/xterm.c b/src/xterm.c
index 45b52d8dea8..70a527a27fe 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -839,7 +839,7 @@ XTclear_end_of_line (first_unused)
839 CHAR_TO_PIXEL_COL (f, curs_x), 839 CHAR_TO_PIXEL_COL (f, curs_x),
840 CHAR_TO_PIXEL_ROW (f, curs_y), 840 CHAR_TO_PIXEL_ROW (f, curs_y),
841 FONT_WIDTH (f->display.x->font) * (first_unused - curs_x), 841 FONT_WIDTH (f->display.x->font) * (first_unused - curs_x),
842 FONT_HEIGHT (f->display.x->font), False); 842 f->display.x->line_height, False);
843#if 0 843#if 0
844 redraw_previous_char (f, curs_x, curs_y); 844 redraw_previous_char (f, curs_x, curs_y);
845#endif 845#endif
@@ -848,7 +848,7 @@ XTclear_end_of_line (first_unused)
848 CHAR_TO_PIXEL_COL (f, curs_x), 848 CHAR_TO_PIXEL_COL (f, curs_x),
849 CHAR_TO_PIXEL_ROW (f, curs_y), 849 CHAR_TO_PIXEL_ROW (f, curs_y),
850 FONT_WIDTH (f->display.x->font) * (first_unused - curs_x), 850 FONT_WIDTH (f->display.x->font) * (first_unused - curs_x),
851 FONT_HEIGHT (f->display.x->font), 851 f->display.x->line_height,
852 f->display.x->background_pixel); 852 f->display.x->background_pixel);
853#endif /* ! defined (HAVE_X11) */ 853#endif /* ! defined (HAVE_X11) */
854 854
@@ -879,7 +879,7 @@ redraw_previous_char (f, x, y)
879 CHAR_TO_PIXEL_COL (f, x - 1), 879 CHAR_TO_PIXEL_COL (f, x - 1),
880 CHAR_TO_PIXEL_ROW (f, y), 880 CHAR_TO_PIXEL_ROW (f, y),
881 FONT_WIDTH (f->display.x->font), 881 FONT_WIDTH (f->display.x->font),
882 FONT_HEIGHT (f->display.x->font), False); 882 f->display.x->line_height, False);
883 883
884 dumpglyphs (f, CHAR_TO_PIXEL_COL (f, start_x), 884 dumpglyphs (f, CHAR_TO_PIXEL_COL (f, start_x),
885 CHAR_TO_PIXEL_ROW (f, y), 885 CHAR_TO_PIXEL_ROW (f, y),
@@ -1118,14 +1118,14 @@ stufflines (n)
1118 FRAME_X_WINDOW (f), f->display.x->normal_gc, 1118 FRAME_X_WINDOW (f), f->display.x->normal_gc,
1119 intborder, CHAR_TO_PIXEL_ROW (f, topregion), 1119 intborder, CHAR_TO_PIXEL_ROW (f, topregion),
1120 f->width * FONT_WIDTH (f->display.x->font), 1120 f->width * FONT_WIDTH (f->display.x->font),
1121 length * FONT_HEIGHT (f->display.x->font), intborder, 1121 length * f->display.x->line_height, intborder,
1122 CHAR_TO_PIXEL_ROW (f, newtop)); 1122 CHAR_TO_PIXEL_ROW (f, newtop));
1123#else /* ! defined (HAVE_X11) */ 1123#else /* ! defined (HAVE_X11) */
1124 XMoveArea (FRAME_X_WINDOW (f), 1124 XMoveArea (FRAME_X_WINDOW (f),
1125 intborder, CHAR_TO_PIXEL_ROW (f, topregion), 1125 intborder, CHAR_TO_PIXEL_ROW (f, topregion),
1126 intborder, CHAR_TO_PIXEL_ROW (f, newtop), 1126 intborder, CHAR_TO_PIXEL_ROW (f, newtop),
1127 f->width * FONT_WIDTH (f->display.x->font), 1127 f->width * FONT_WIDTH (f->display.x->font),
1128 length * FONT_HEIGHT (f->display.x->font)); 1128 length * f->display.x->line_height);
1129 /* Now we must process any ExposeRegion events that occur 1129 /* Now we must process any ExposeRegion events that occur
1130 if the area being copied from is obscured. 1130 if the area being copied from is obscured.
1131 We can't let it wait because further i/d operations 1131 We can't let it wait because further i/d operations
@@ -1142,13 +1142,13 @@ stufflines (n)
1142 XClearArea (x_current_display, FRAME_X_WINDOW (f), intborder, 1142 XClearArea (x_current_display, FRAME_X_WINDOW (f), intborder,
1143 CHAR_TO_PIXEL_ROW (f, topregion), 1143 CHAR_TO_PIXEL_ROW (f, topregion),
1144 f->width * FONT_WIDTH (f->display.x->font), 1144 f->width * FONT_WIDTH (f->display.x->font),
1145 n * FONT_HEIGHT (f->display.x->font), False); 1145 n * f->display.x->line_height, False);
1146#else /* ! defined (HAVE_X11) */ 1146#else /* ! defined (HAVE_X11) */
1147 XPixSet (FRAME_X_WINDOW (f), 1147 XPixSet (FRAME_X_WINDOW (f),
1148 intborder, 1148 intborder,
1149 CHAR_TO_PIXEL_ROW (f, topregion), 1149 CHAR_TO_PIXEL_ROW (f, topregion),
1150 f->width * FONT_WIDTH (f->display.x->font), 1150 f->width * FONT_WIDTH (f->display.x->font),
1151 n * FONT_HEIGHT (f->display.x->font), 1151 n * f->display.x->line_height,
1152 f->display.x->background_pixel); 1152 f->display.x->background_pixel);
1153#endif /* ! defined (HAVE_X11) */ 1153#endif /* ! defined (HAVE_X11) */
1154 } 1154 }
@@ -1180,12 +1180,12 @@ scraplines (n)
1180 XClearArea (x_current_display, FRAME_X_WINDOW (f), intborder, 1180 XClearArea (x_current_display, FRAME_X_WINDOW (f), intborder,
1181 CHAR_TO_PIXEL_ROW (f, curs_y), 1181 CHAR_TO_PIXEL_ROW (f, curs_y),
1182 f->width * FONT_WIDTH (f->display.x->font), 1182 f->width * FONT_WIDTH (f->display.x->font),
1183 (flexlines - curs_y) * FONT_HEIGHT (f->display.x->font), False); 1183 (flexlines - curs_y) * f->display.x->line_height, False);
1184#else /* ! defined (HAVE_X11) */ 1184#else /* ! defined (HAVE_X11) */
1185 XPixSet (FRAME_X_WINDOW (f), 1185 XPixSet (FRAME_X_WINDOW (f),
1186 intborder, CHAR_TO_PIXEL_ROW (f, curs_y), 1186 intborder, CHAR_TO_PIXEL_ROW (f, curs_y),
1187 f->width * FONT_WIDTH (f->display.x->font), 1187 f->width * FONT_WIDTH (f->display.x->font),
1188 (flexlines - curs_y) * FONT_HEIGHT (f->display.x->font), 1188 (flexlines - curs_y) * f->display.x->line_height,
1189 f->display.x->background_pixel); 1189 f->display.x->background_pixel);
1190#endif /* ! defined (HAVE_X11) */ 1190#endif /* ! defined (HAVE_X11) */
1191 } 1191 }
@@ -1198,20 +1198,20 @@ scraplines (n)
1198 intborder, 1198 intborder,
1199 CHAR_TO_PIXEL_ROW (f, curs_y + n), 1199 CHAR_TO_PIXEL_ROW (f, curs_y + n),
1200 f->width * FONT_WIDTH (f->display.x->font), 1200 f->width * FONT_WIDTH (f->display.x->font),
1201 (flexlines - (curs_y + n)) * FONT_HEIGHT (f->display.x->font), 1201 (flexlines - (curs_y + n)) * f->display.x->line_height,
1202 intborder, CHAR_TO_PIXEL_ROW (f, curs_y)); 1202 intborder, CHAR_TO_PIXEL_ROW (f, curs_y));
1203 XClearArea (x_current_display, FRAME_X_WINDOW (f), 1203 XClearArea (x_current_display, FRAME_X_WINDOW (f),
1204 intborder, 1204 intborder,
1205 CHAR_TO_PIXEL_ROW (f, flexlines - n), 1205 CHAR_TO_PIXEL_ROW (f, flexlines - n),
1206 f->width * FONT_WIDTH (f->display.x->font), 1206 f->width * FONT_WIDTH (f->display.x->font),
1207 n * FONT_HEIGHT (f->display.x->font), False); 1207 n * f->display.x->line_height, False);
1208#else /* ! defined (HAVE_X11) */ 1208#else /* ! defined (HAVE_X11) */
1209 XMoveArea (FRAME_X_WINDOW (f), 1209 XMoveArea (FRAME_X_WINDOW (f),
1210 intborder, 1210 intborder,
1211 CHAR_TO_PIXEL_ROW (f, curs_y + n), 1211 CHAR_TO_PIXEL_ROW (f, curs_y + n),
1212 intborder, CHAR_TO_PIXEL_ROW (f, curs_y), 1212 intborder, CHAR_TO_PIXEL_ROW (f, curs_y),
1213 f->width * FONT_WIDTH (f->display.x->font), 1213 f->width * FONT_WIDTH (f->display.x->font),
1214 (flexlines - (curs_y + n)) * FONT_HEIGHT (f->display.x->font)); 1214 (flexlines - (curs_y + n)) * f->display.x->line_height);
1215 /* Now we must process any ExposeRegion events that occur 1215 /* Now we must process any ExposeRegion events that occur
1216 if the area being copied from is obscured. 1216 if the area being copied from is obscured.
1217 We can't let it wait because further i/d operations 1217 We can't let it wait because further i/d operations
@@ -1220,7 +1220,7 @@ scraplines (n)
1220 XPixSet (FRAME_X_WINDOW (f), intborder, 1220 XPixSet (FRAME_X_WINDOW (f), intborder,
1221 CHAR_TO_PIXEL_ROW (f, flexlines - n), 1221 CHAR_TO_PIXEL_ROW (f, flexlines - n),
1222 f->width * FONT_WIDTH (f->display.x->font), 1222 f->width * FONT_WIDTH (f->display.x->font),
1223 n * FONT_HEIGHT (f->display.x->font), f->display.x->background_pixel); 1223 n * f->display.x->line_height, f->display.x->background_pixel);
1224#endif /* ! defined (HAVE_X11) */ 1224#endif /* ! defined (HAVE_X11) */
1225 } 1225 }
1226} 1226}
@@ -1281,8 +1281,8 @@ dumprectangle (f, left, top, cols, rows)
1281 /* If the rectangle includes any of the internal border area, 1281 /* If the rectangle includes any of the internal border area,
1282 redisplay the border emphasis. */ 1282 redisplay the border emphasis. */
1283 if (top < intborder || left < intborder 1283 if (top < intborder || left < intborder
1284 || bottom > intborder + f->height * FONT_HEIGHT (f->display.x->font) 1284 || bottom > intborder + f->height * f->display.x->line_height
1285 || right > intborder + f->width * FONT_WIDTH (f->display.x->font)) 1285 || right > intborder + f->width * f->display.x->line_height)
1286 dumpborder (f, 0); 1286 dumpborder (f, 0);
1287 } 1287 }
1288#endif /* not HAVE_X11 Window manger does this for X11. */ 1288#endif /* not HAVE_X11 Window manger does this for X11. */
@@ -1291,7 +1291,7 @@ dumprectangle (f, left, top, cols, rows)
1291 Round down for left and top, up for right and bottom. */ 1291 Round down for left and top, up for right and bottom. */
1292 top = PIXEL_TO_CHAR_ROW (f, top); 1292 top = PIXEL_TO_CHAR_ROW (f, top);
1293 left = PIXEL_TO_CHAR_COL (f, left); 1293 left = PIXEL_TO_CHAR_COL (f, left);
1294 bottom += (FONT_HEIGHT (f->display.x->font) - 1); 1294 bottom += (f->display.x->line_height - 1);
1295 right += (FONT_WIDTH (f->display.x->font) - 1); 1295 right += (FONT_WIDTH (f->display.x->font) - 1);
1296 bottom = PIXEL_TO_CHAR_ROW (f, bottom); 1296 bottom = PIXEL_TO_CHAR_ROW (f, bottom);
1297 right = PIXEL_TO_CHAR_COL (f, right); 1297 right = PIXEL_TO_CHAR_COL (f, right);
@@ -1406,7 +1406,7 @@ x_do_pending_expose ()
1406 / FONT_WIDTH (f->display.x->font)); 1406 / FONT_WIDTH (f->display.x->font));
1407 temp_height = ((windowinfo.height- 2 * intborder 1407 temp_height = ((windowinfo.height- 2 * intborder
1408 - f->display.x->h_scroll_bar_height) 1408 - f->display.x->h_scroll_bar_height)
1409 / FONT_HEIGHT (f->display.x->font)); 1409 / f->display.x->line_height);
1410 if (temp_width != f->width || temp_height != f->height) 1410 if (temp_width != f->width || temp_height != f->height)
1411 { 1411 {
1412 change_frame_size (f, max (1, temp_height), 1412 change_frame_size (f, max (1, temp_height),
@@ -1773,7 +1773,7 @@ pixel_to_glyph_coords (f, pix_x, pix_y, x, y, bounds, noclip)
1773 if (pix_x < 0) 1773 if (pix_x < 0)
1774 pix_x -= FONT_WIDTH ((f)->display.x->font) - 1; 1774 pix_x -= FONT_WIDTH ((f)->display.x->font) - 1;
1775 if (pix_y < 0) 1775 if (pix_y < 0)
1776 pix_y -= FONT_HEIGHT ((f)->display.x->font) - 1; 1776 pix_y -= (f)->display.x->line_height - 1;
1777 1777
1778 pix_x = PIXEL_TO_CHAR_COL (f, pix_x); 1778 pix_x = PIXEL_TO_CHAR_COL (f, pix_x);
1779 pix_y = PIXEL_TO_CHAR_ROW (f, pix_y); 1779 pix_y = PIXEL_TO_CHAR_ROW (f, pix_y);
@@ -1781,7 +1781,7 @@ pixel_to_glyph_coords (f, pix_x, pix_y, x, y, bounds, noclip)
1781 if (bounds) 1781 if (bounds)
1782 { 1782 {
1783 bounds->width = FONT_WIDTH (f->display.x->font); 1783 bounds->width = FONT_WIDTH (f->display.x->font);
1784 bounds->height = FONT_HEIGHT (f->display.x->font); 1784 bounds->height = f->display.x->line_height;
1785 bounds->x = CHAR_TO_PIXEL_COL (f, pix_x); 1785 bounds->x = CHAR_TO_PIXEL_COL (f, pix_x);
1786 bounds->y = CHAR_TO_PIXEL_ROW (f, pix_y); 1786 bounds->y = CHAR_TO_PIXEL_ROW (f, pix_y);
1787 } 1787 }
@@ -4209,7 +4209,7 @@ x_draw_box (f)
4209 int left = CHAR_TO_PIXEL_COL (f, f->cursor_x); 4209 int left = CHAR_TO_PIXEL_COL (f, f->cursor_x);
4210 int top = CHAR_TO_PIXEL_ROW (f, f->cursor_y); 4210 int top = CHAR_TO_PIXEL_ROW (f, f->cursor_y);
4211 int width = FONT_WIDTH (f->display.x->font); 4211 int width = FONT_WIDTH (f->display.x->font);
4212 int height = FONT_HEIGHT (f->display.x->font); 4212 int height = f->display.x->line_height;
4213 4213
4214#ifdef HAVE_X11 4214#ifdef HAVE_X11
4215 XDrawRectangle (x_current_display, FRAME_X_WINDOW (f), 4215 XDrawRectangle (x_current_display, FRAME_X_WINDOW (f),
@@ -4255,7 +4255,7 @@ clear_cursor (f)
4255 XPixSet (FRAME_X_WINDOW (f), 4255 XPixSet (FRAME_X_WINDOW (f),
4256 CHAR_TO_PIXEL_COL (f, f->phys_cursor_x), 4256 CHAR_TO_PIXEL_COL (f, f->phys_cursor_x),
4257 CHAR_TO_PIXEL_ROW (f, f->phys_cursor_y), 4257 CHAR_TO_PIXEL_ROW (f, f->phys_cursor_y),
4258 FONT_WIDTH (f->display.x->font), FONT_HEIGHT (f->display.x->font), 4258 FONT_WIDTH (f->display.x->font), f->display.x->line_height,
4259 f->display.x->background_pixel); 4259 f->display.x->background_pixel);
4260#endif /* ! defined (HAVE_X11) */ 4260#endif /* ! defined (HAVE_X11) */
4261 f->phys_cursor_x = -1; 4261 f->phys_cursor_x = -1;
@@ -4330,7 +4330,7 @@ x_display_bar_cursor (f, on)
4330 f->display.x->cursor_gc, 4330 f->display.x->cursor_gc,
4331 CHAR_TO_PIXEL_COL (f, curs_x), 4331 CHAR_TO_PIXEL_COL (f, curs_x),
4332 CHAR_TO_PIXEL_ROW (f, curs_y), 4332 CHAR_TO_PIXEL_ROW (f, curs_y),
4333 1, FONT_HEIGHT (f->display.x->font)); 4333 1, f->display.x->line_height);
4334 4334
4335 f->phys_cursor_x = curs_x; 4335 f->phys_cursor_x = curs_x;
4336 f->phys_cursor_y = curs_y; 4336 f->phys_cursor_y = curs_y;
@@ -4898,8 +4898,12 @@ x_new_font (f, fontname)
4898 XSetFont (x_current_display, f->display.x->cursor_gc, 4898 XSetFont (x_current_display, f->display.x->cursor_gc,
4899 f->display.x->font->fid); 4899 f->display.x->font->fid);
4900 4900
4901 x_set_window_size (f, 0, f->width, f->height); 4901 frame_update_line_height (f);
4902 } 4902 }
4903 else
4904 /* If we are setting a new frame's font for the first time,
4905 there are no faces yet, so this font's height is the line height. */
4906 f->display.x->line_height = FONT_HEIGHT (f);
4903 4907
4904 { 4908 {
4905 Lisp_Object lispy_name; 4909 Lisp_Object lispy_name;
@@ -5082,7 +5086,7 @@ x_set_resize_hint (f)
5082 2 * f->display.x->internal_border_width, 5086 2 * f->display.x->internal_border_width,
5083 2 * f->display.x->internal_border_width, 5087 2 * f->display.x->internal_border_width,
5084 FONT_WIDTH (f->display.x->font), 5088 FONT_WIDTH (f->display.x->font),
5085 FONT_HEIGHT (f->display.x->font)); 5089 f->display.x->line_height);
5086} 5090}
5087#endif /* HAVE_X11 */ 5091#endif /* HAVE_X11 */
5088 5092
@@ -5099,7 +5103,7 @@ x_set_mouse_position (f, x, y)
5099#endif 5103#endif
5100 5104
5101 pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->display.x->font) / 2; 5105 pix_x = CHAR_TO_PIXEL_COL (f, x) + FONT_WIDTH (f->display.x->font) / 2;
5102 pix_y = CHAR_TO_PIXEL_ROW (f, y) + FONT_HEIGHT (f->display.x->font) / 2; 5106 pix_y = CHAR_TO_PIXEL_ROW (f, y) + f->display.x->line_height / 2;
5103 5107
5104 if (pix_x < 0) pix_x = 0; 5108 if (pix_x < 0) pix_x = 0;
5105 if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f); 5109 if (pix_x > PIXEL_WIDTH (f)) pix_x = PIXEL_WIDTH (f);
@@ -5544,7 +5548,7 @@ x_wm_set_size_hint (f, prompting, change_gravity, spec_x, spec_y)
5544 size_hints.width = PIXEL_WIDTH (f); 5548 size_hints.width = PIXEL_WIDTH (f);
5545#endif /* not USE_X_TOOLKIT */ 5549#endif /* not USE_X_TOOLKIT */
5546 size_hints.width_inc = FONT_WIDTH (f->display.x->font); 5550 size_hints.width_inc = FONT_WIDTH (f->display.x->font);
5547 size_hints.height_inc = FONT_HEIGHT (f->display.x->font); 5551 size_hints.height_inc = f->display.x->line_height;
5548#if 0 5552#if 0
5549 size_hints.max_width = x_screen_width - CHAR_TO_PIXEL_WIDTH (f, 0); 5553 size_hints.max_width = x_screen_width - CHAR_TO_PIXEL_WIDTH (f, 0);
5550 size_hints.max_height = x_screen_height - CHAR_TO_PIXEL_HEIGHT (f, 0); 5554 size_hints.max_height = x_screen_height - CHAR_TO_PIXEL_HEIGHT (f, 0);