diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispextern.h | 177 |
1 files changed, 14 insertions, 163 deletions
diff --git a/src/dispextern.h b/src/dispextern.h index 958404d3dc6..3fc33f55a67 100644 --- a/src/dispextern.h +++ b/src/dispextern.h | |||
| @@ -550,12 +550,14 @@ struct glyph_matrix | |||
| 550 | int matrix_w, matrix_h; | 550 | int matrix_w, matrix_h; |
| 551 | 551 | ||
| 552 | /* If this structure describes a window matrix of window W, | 552 | /* If this structure describes a window matrix of window W, |
| 553 | window_left_x is the value of W->left, window_top_y the value of | 553 | window_left_col is the value of W->left_col, window_top_line the |
| 554 | W->top, window_height and window_width are width and height of W, | 554 | value of W->top_line, window_height and window_width are width and |
| 555 | as returned by window_box, and window_vscroll is the value of | 555 | height of W, as returned by window_box, and window_vscroll is the |
| 556 | W->vscroll at the time the matrix was last adjusted. Only set | 556 | value of W->vscroll at the time the matrix was last adjusted. |
| 557 | for window-based redisplay. */ | 557 | Only set for window-based redisplay. */ |
| 558 | int window_left_x, window_top_y, window_height, window_width, window_vscroll; | 558 | int window_left_col, window_top_line; |
| 559 | int window_height, window_width; | ||
| 560 | int window_vscroll; | ||
| 559 | 561 | ||
| 560 | /* Number of glyphs reserved for left and right marginal areas when | 562 | /* Number of glyphs reserved for left and right marginal areas when |
| 561 | the matrix was last adjusted. */ | 563 | the matrix was last adjusted. */ |
| @@ -866,13 +868,13 @@ struct glyph_row *matrix_row P_ ((struct glyph_matrix *, int)); | |||
| 866 | 868 | ||
| 867 | #define MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P(W, ROW) \ | 869 | #define MATRIX_ROW_PARTIALLY_VISIBLE_AT_TOP_P(W, ROW) \ |
| 868 | (MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW)) \ | 870 | (MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW)) \ |
| 869 | && (ROW)->y < WINDOW_DISPLAY_HEADER_LINE_HEIGHT ((W))) | 871 | && (ROW)->y < WINDOW_HEADER_LINE_HEIGHT ((W))) |
| 870 | 872 | ||
| 871 | /* Non-zero if ROW is partially visible at the bottom of window W. */ | 873 | /* Non-zero if ROW is partially visible at the bottom of window W. */ |
| 872 | 874 | ||
| 873 | #define MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P(W, ROW) \ | 875 | #define MATRIX_ROW_PARTIALLY_VISIBLE_AT_BOTTOM_P(W, ROW) \ |
| 874 | (MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW)) \ | 876 | (MATRIX_ROW_PARTIALLY_VISIBLE_P ((ROW)) \ |
| 875 | && (ROW)->y + (ROW)->height > WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE ((W))) | 877 | && (ROW)->y + (ROW)->height > WINDOW_BOX_HEIGHT_NO_MODE_LINE ((W))) |
| 876 | 878 | ||
| 877 | /* Return the bottom Y + 1 of ROW. */ | 879 | /* Return the bottom Y + 1 of ROW. */ |
| 878 | 880 | ||
| @@ -1197,156 +1199,6 @@ struct glyph_string | |||
| 1197 | #define DESIRED_HEADER_LINE_HEIGHT(W) \ | 1199 | #define DESIRED_HEADER_LINE_HEIGHT(W) \ |
| 1198 | MATRIX_HEADER_LINE_HEIGHT ((W)->desired_matrix) | 1200 | MATRIX_HEADER_LINE_HEIGHT ((W)->desired_matrix) |
| 1199 | 1201 | ||
| 1200 | /* Like FRAME_INTERNAL_BORDER_WIDTH but checks whether frame F is a | ||
| 1201 | window-system frame. */ | ||
| 1202 | |||
| 1203 | #define FRAME_INTERNAL_BORDER_WIDTH_SAFE(F) \ | ||
| 1204 | (FRAME_WINDOW_P (F) ? FRAME_INTERNAL_BORDER_WIDTH (F) : 0) | ||
| 1205 | |||
| 1206 | /* Width of display region of window W. For terminal frames, this | ||
| 1207 | equals the width of W since there are no vertical scroll bars. For | ||
| 1208 | window system frames, the value has to be corrected by the pixel | ||
| 1209 | width of vertical scroll bars, and fringes. */ | ||
| 1210 | |||
| 1211 | #define WINDOW_DISPLAY_PIXEL_WIDTH(W) \ | ||
| 1212 | (((XFASTINT ((W)->width) \ | ||
| 1213 | - FRAME_SCROLL_BAR_WIDTH (XFRAME (WINDOW_FRAME ((W)))) \ | ||
| 1214 | - FRAME_FRINGE_COLS (XFRAME (WINDOW_FRAME ((W))))) \ | ||
| 1215 | * CANON_X_UNIT (XFRAME (WINDOW_FRAME ((W)))))) | ||
| 1216 | |||
| 1217 | /* Height of the display region of W, including a mode line, if any. */ | ||
| 1218 | |||
| 1219 | #define WINDOW_DISPLAY_PIXEL_HEIGHT(W) \ | ||
| 1220 | (XFASTINT ((W)->height) \ | ||
| 1221 | * CANON_Y_UNIT (XFRAME (WINDOW_FRAME ((W))))) | ||
| 1222 | |||
| 1223 | /* Height in pixels of the mode line. May be zero if W doesn't have a | ||
| 1224 | mode line. */ | ||
| 1225 | |||
| 1226 | #define WINDOW_DISPLAY_MODE_LINE_HEIGHT(W) \ | ||
| 1227 | (WINDOW_WANTS_MODELINE_P ((W)) \ | ||
| 1228 | ? CURRENT_MODE_LINE_HEIGHT (W) \ | ||
| 1229 | : 0) | ||
| 1230 | |||
| 1231 | /* Height in pixels of the header line. Zero if W doesn't have a header | ||
| 1232 | line. */ | ||
| 1233 | |||
| 1234 | #define WINDOW_DISPLAY_HEADER_LINE_HEIGHT(W) \ | ||
| 1235 | (WINDOW_WANTS_HEADER_LINE_P ((W)) \ | ||
| 1236 | ? CURRENT_HEADER_LINE_HEIGHT (W) \ | ||
| 1237 | : 0) | ||
| 1238 | |||
| 1239 | /* Pixel height of window W without mode line. */ | ||
| 1240 | |||
| 1241 | #define WINDOW_DISPLAY_HEIGHT_NO_MODE_LINE(W) \ | ||
| 1242 | (WINDOW_DISPLAY_PIXEL_HEIGHT ((W)) \ | ||
| 1243 | - WINDOW_DISPLAY_MODE_LINE_HEIGHT ((W))) | ||
| 1244 | |||
| 1245 | /* Pixel height of window W without mode and header line. */ | ||
| 1246 | |||
| 1247 | #define WINDOW_DISPLAY_TEXT_HEIGHT(W) \ | ||
| 1248 | (WINDOW_DISPLAY_PIXEL_HEIGHT ((W)) \ | ||
| 1249 | - WINDOW_DISPLAY_MODE_LINE_HEIGHT ((W)) \ | ||
| 1250 | - WINDOW_DISPLAY_HEADER_LINE_HEIGHT ((W))) | ||
| 1251 | |||
| 1252 | /* Left edge of W in pixels relative to its frame. */ | ||
| 1253 | |||
| 1254 | #define WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X(W) \ | ||
| 1255 | (FRAME_INTERNAL_BORDER_WIDTH_SAFE (XFRAME (WINDOW_FRAME ((W)))) \ | ||
| 1256 | + (WINDOW_LEFT_MARGIN ((W)) \ | ||
| 1257 | * CANON_X_UNIT (XFRAME (WINDOW_FRAME ((W))))) \ | ||
| 1258 | + FRAME_LEFT_FRINGE_WIDTH (XFRAME (WINDOW_FRAME ((W))))) | ||
| 1259 | |||
| 1260 | /* Right edge of window W in pixels, relative to its frame. */ | ||
| 1261 | |||
| 1262 | #define WINDOW_DISPLAY_RIGHT_EDGE_PIXEL_X(W) \ | ||
| 1263 | (WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X ((W)) \ | ||
| 1264 | + WINDOW_DISPLAY_PIXEL_WIDTH ((W))) | ||
| 1265 | |||
| 1266 | /* Top edge of W in pixels relative to its frame. */ | ||
| 1267 | |||
| 1268 | #define WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y(W) \ | ||
| 1269 | (FRAME_INTERNAL_BORDER_WIDTH_SAFE (XFRAME (WINDOW_FRAME ((W)))) \ | ||
| 1270 | + (XFASTINT ((W)->top) \ | ||
| 1271 | * CANON_Y_UNIT (XFRAME (WINDOW_FRAME ((W)))))) | ||
| 1272 | |||
| 1273 | /* Bottom edge of window W relative to its frame. */ | ||
| 1274 | |||
| 1275 | #define WINDOW_DISPLAY_BOTTOM_EDGE_PIXEL_Y(W) \ | ||
| 1276 | (WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y ((W)) \ | ||
| 1277 | + WINDOW_DISPLAY_PIXEL_HEIGHT ((W))) | ||
| 1278 | |||
| 1279 | /* Convert window W relative pixel X to frame pixel coordinates. */ | ||
| 1280 | |||
| 1281 | #define WINDOW_TO_FRAME_PIXEL_X(W, X) \ | ||
| 1282 | ((X) + WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X ((W))) | ||
| 1283 | |||
| 1284 | /* Convert window W relative pixel Y to frame pixel coordinates. */ | ||
| 1285 | |||
| 1286 | #define WINDOW_TO_FRAME_PIXEL_Y(W, Y) \ | ||
| 1287 | ((Y) + WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y ((W))) | ||
| 1288 | |||
| 1289 | /* Convert frame relative pixel X to window relative pixel X. */ | ||
| 1290 | |||
| 1291 | #define FRAME_TO_WINDOW_PIXEL_X(W, X) \ | ||
| 1292 | ((X) - WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X ((W))) | ||
| 1293 | |||
| 1294 | /* Convert frame relative pixel Y to window relative pixel Y. */ | ||
| 1295 | |||
| 1296 | #define FRAME_TO_WINDOW_PIXEL_Y(W, Y) \ | ||
| 1297 | ((Y) - WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y ((W))) | ||
| 1298 | |||
| 1299 | /* Width of left margin area in pixels. */ | ||
| 1300 | |||
| 1301 | #define WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH(W) \ | ||
| 1302 | (NILP ((W)->left_margin_width) \ | ||
| 1303 | ? 0 \ | ||
| 1304 | : (XINT ((W)->left_margin_width) \ | ||
| 1305 | * CANON_X_UNIT (XFRAME (WINDOW_FRAME ((W)))))) | ||
| 1306 | |||
| 1307 | /* Width of right marginal area in pixels. */ | ||
| 1308 | |||
| 1309 | #define WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH(W) \ | ||
| 1310 | (NILP ((W)->right_margin_width) \ | ||
| 1311 | ? 0 \ | ||
| 1312 | : (XINT ((W)->right_margin_width) \ | ||
| 1313 | * CANON_X_UNIT (XFRAME (WINDOW_FRAME ((W)))))) | ||
| 1314 | |||
| 1315 | /* Width of text area in pixels. */ | ||
| 1316 | |||
| 1317 | #define WINDOW_DISPLAY_TEXT_AREA_PIXEL_WIDTH(W) \ | ||
| 1318 | (WINDOW_DISPLAY_PIXEL_WIDTH ((W)) \ | ||
| 1319 | - WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH ((W)) \ | ||
| 1320 | - WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH ((W))) | ||
| 1321 | |||
| 1322 | /* Convert a text area relative x-position in window W to frame X | ||
| 1323 | pixel coordinates. */ | ||
| 1324 | |||
| 1325 | #define WINDOW_TEXT_TO_FRAME_PIXEL_X(W, X) \ | ||
| 1326 | (WINDOW_TO_FRAME_PIXEL_X ((W), (X)) \ | ||
| 1327 | + WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH ((W))) | ||
| 1328 | |||
| 1329 | /* Translate an x-position relative to AREA in window W to frame pixel | ||
| 1330 | coordinates. */ | ||
| 1331 | |||
| 1332 | #define WINDOW_AREA_TO_FRAME_PIXEL_X(W, AREA, X) \ | ||
| 1333 | (WINDOW_TO_FRAME_PIXEL_X ((W), (X)) \ | ||
| 1334 | + (((AREA) > LEFT_MARGIN_AREA) \ | ||
| 1335 | ? WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH ((W)) \ | ||
| 1336 | : 0) \ | ||
| 1337 | + (((AREA) > TEXT_AREA) \ | ||
| 1338 | ? WINDOW_DISPLAY_TEXT_AREA_PIXEL_WIDTH ((W)) \ | ||
| 1339 | : 0)) | ||
| 1340 | |||
| 1341 | /* Return the pixel width of AREA in W. */ | ||
| 1342 | |||
| 1343 | #define WINDOW_AREA_PIXEL_WIDTH(W, AREA) \ | ||
| 1344 | (((AREA) == TEXT_AREA) \ | ||
| 1345 | ? WINDOW_DISPLAY_TEXT_AREA_PIXEL_WIDTH ((W)) \ | ||
| 1346 | : (((AREA) == LEFT_MARGIN_AREA) \ | ||
| 1347 | ? WINDOW_DISPLAY_LEFT_AREA_PIXEL_WIDTH ((W)) \ | ||
| 1348 | : WINDOW_DISPLAY_RIGHT_AREA_PIXEL_WIDTH ((W)))) | ||
| 1349 | |||
| 1350 | /* Value is non-zero if window W wants a mode line. */ | 1202 | /* Value is non-zero if window W wants a mode line. */ |
| 1351 | 1203 | ||
| 1352 | #define WINDOW_WANTS_MODELINE_P(W) \ | 1204 | #define WINDOW_WANTS_MODELINE_P(W) \ |
| @@ -1355,7 +1207,7 @@ struct glyph_string | |||
| 1355 | && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ | 1207 | && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ |
| 1356 | && BUFFERP ((W)->buffer) \ | 1208 | && BUFFERP ((W)->buffer) \ |
| 1357 | && !NILP (XBUFFER ((W)->buffer)->mode_line_format) \ | 1209 | && !NILP (XBUFFER ((W)->buffer)->mode_line_format) \ |
| 1358 | && XFASTINT ((W)->height) > 1) | 1210 | && WINDOW_TOTAL_LINES (W) > 1) |
| 1359 | 1211 | ||
| 1360 | /* Value is non-zero if window W wants a header line. */ | 1212 | /* Value is non-zero if window W wants a header line. */ |
| 1361 | 1213 | ||
| @@ -1365,7 +1217,7 @@ struct glyph_string | |||
| 1365 | && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ | 1217 | && FRAME_WANTS_MODELINE_P (XFRAME (WINDOW_FRAME ((W)))) \ |
| 1366 | && BUFFERP ((W)->buffer) \ | 1218 | && BUFFERP ((W)->buffer) \ |
| 1367 | && !NILP (XBUFFER ((W)->buffer)->header_line_format) \ | 1219 | && !NILP (XBUFFER ((W)->buffer)->header_line_format) \ |
| 1368 | && XFASTINT ((W)->height) > 1 + !NILP (XBUFFER ((W)->buffer)->mode_line_format)) | 1220 | && WINDOW_TOTAL_LINES (W) > 1 + !NILP (XBUFFER ((W)->buffer)->mode_line_format)) |
| 1369 | 1221 | ||
| 1370 | 1222 | ||
| 1371 | /* Return proper value to be used as baseline offset of font that has | 1223 | /* Return proper value to be used as baseline offset of font that has |
| @@ -1391,7 +1243,7 @@ struct glyph_string | |||
| 1391 | BOFF = DESCENT + (F_HEIGHT - HEIGHT) / 2 - F_DESCENT | 1243 | BOFF = DESCENT + (F_HEIGHT - HEIGHT) / 2 - F_DESCENT |
| 1392 | DESCENT = FONT->descent | 1244 | DESCENT = FONT->descent |
| 1393 | HEIGHT = FONT_HEIGHT (FONT) | 1245 | HEIGHT = FONT_HEIGHT (FONT) |
| 1394 | F_DESCENT = (F->output_data.x->font->descent | 1246 | F_DESCENT = (FRAME_FONT (F)->descent |
| 1395 | - F->output_data.x->baseline_offset) | 1247 | - F->output_data.x->baseline_offset) |
| 1396 | F_HEIGHT = FRAME_LINE_HEIGHT (F) | 1248 | F_HEIGHT = FRAME_LINE_HEIGHT (F) |
| 1397 | */ | 1249 | */ |
| @@ -2065,7 +1917,7 @@ struct it | |||
| 2065 | short truncation_pixel_width, continuation_pixel_width; | 1917 | short truncation_pixel_width, continuation_pixel_width; |
| 2066 | 1918 | ||
| 2067 | /* First and last visible x-position in the display area. If window | 1919 | /* First and last visible x-position in the display area. If window |
| 2068 | is hscrolled by n columns, first_visible_x == n * CANON_X_UNIT | 1920 | is hscrolled by n columns, first_visible_x == n * FRAME_COLUMN_WIDTH |
| 2069 | (f), and last_visible_x == pixel width of W + first_visible_x. */ | 1921 | (f), and last_visible_x == pixel width of W + first_visible_x. */ |
| 2070 | int first_visible_x, last_visible_x; | 1922 | int first_visible_x, last_visible_x; |
| 2071 | 1923 | ||
| @@ -2714,7 +2566,6 @@ void clear_face_cache P_ ((int)); | |||
| 2714 | unsigned long load_color P_ ((struct frame *, struct face *, Lisp_Object, | 2566 | unsigned long load_color P_ ((struct frame *, struct face *, Lisp_Object, |
| 2715 | enum lface_attribute_index)); | 2567 | enum lface_attribute_index)); |
| 2716 | void unload_color P_ ((struct frame *, unsigned long)); | 2568 | void unload_color P_ ((struct frame *, unsigned long)); |
| 2717 | int frame_update_line_height P_ ((struct frame *)); | ||
| 2718 | int ascii_face_of_lisp_face P_ ((struct frame *, int)); | 2569 | int ascii_face_of_lisp_face P_ ((struct frame *, int)); |
| 2719 | void prepare_face_for_display P_ ((struct frame *, struct face *)); | 2570 | void prepare_face_for_display P_ ((struct frame *, struct face *)); |
| 2720 | int xstricmp P_ ((const unsigned char *, const unsigned char *)); | 2571 | int xstricmp P_ ((const unsigned char *, const unsigned char *)); |