diff options
| author | Kim F. Storm | 2001-12-01 01:34:24 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2001-12-01 01:34:24 +0000 |
| commit | d33c49e8795f8094ec2587e57203b1245af0d6ca (patch) | |
| tree | fc8ffadc4438c8069cda1469aa9927ea2a2c6d00 /mac/src | |
| parent | 41c1bdd9bb12005260deaafb2c0f18a8e342fd4a (diff) | |
| download | emacs-d33c49e8795f8094ec2587e57203b1245af0d6ca.tar.gz emacs-d33c49e8795f8094ec2587e57203b1245af0d6ca.zip | |
Merged fringe width related changes from xterm.c.
Diffstat (limited to 'mac/src')
| -rw-r--r-- | mac/src/macterm.c | 373 |
1 files changed, 217 insertions, 156 deletions
diff --git a/mac/src/macterm.c b/mac/src/macterm.c index d8f2fb7cd85..d8af2e80403 100644 --- a/mac/src/macterm.c +++ b/mac/src/macterm.c | |||
| @@ -129,9 +129,17 @@ enum fringe_bitmap_type | |||
| 129 | `indicate-empty-lines' is non-nil. */ | 129 | `indicate-empty-lines' is non-nil. */ |
| 130 | 130 | ||
| 131 | #define zv_width 8 | 131 | #define zv_width 8 |
| 132 | #define zv_height 8 | 132 | #define zv_height 72 |
| 133 | #define zv_period 3 | ||
| 133 | static unsigned char zv_bits[] = { | 134 | static unsigned char zv_bits[] = { |
| 134 | 0x00, 0x00, 0x78, 0x78, 0x78, 0x78, 0x00, 0x00}; | 135 | 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, |
| 136 | 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, | ||
| 137 | 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, | ||
| 138 | 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, | ||
| 139 | 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, | ||
| 140 | 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, | ||
| 141 | 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, | ||
| 142 | 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x3c, 0x00}; | ||
| 135 | 143 | ||
| 136 | /* An arrow like this: `<-'. */ | 144 | /* An arrow like this: `<-'. */ |
| 137 | 145 | ||
| @@ -429,8 +437,7 @@ static void x_update_window_cursor P_ ((struct window *, int)); | |||
| 429 | static void x_erase_phys_cursor P_ ((struct window *)); | 437 | static void x_erase_phys_cursor P_ ((struct window *)); |
| 430 | void x_display_and_set_cursor P_ ((struct window *, int, int, int, int, int)); | 438 | void x_display_and_set_cursor P_ ((struct window *, int, int, int, int, int)); |
| 431 | static void x_draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, | 439 | static void x_draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, |
| 432 | enum fringe_bitmap_type)); | 440 | enum fringe_bitmap_type, int left_p)); |
| 433 | |||
| 434 | static void x_clip_to_row P_ ((struct window *, struct glyph_row *, | 441 | static void x_clip_to_row P_ ((struct window *, struct glyph_row *, |
| 435 | GC, int)); | 442 | GC, int)); |
| 436 | static int x_phys_cursor_in_rect_p P_ ((struct window *, Rect *)); | 443 | static int x_phys_cursor_in_rect_p P_ ((struct window *, Rect *)); |
| @@ -1303,15 +1310,17 @@ x_after_update_window_line (desired_row) | |||
| 1303 | drawn. */ | 1310 | drawn. */ |
| 1304 | 1311 | ||
| 1305 | static void | 1312 | static void |
| 1306 | x_draw_fringe_bitmap (w, row, which) | 1313 | x_draw_fringe_bitmap (w, row, which, left_p) |
| 1307 | struct window *w; | 1314 | struct window *w; |
| 1308 | struct glyph_row *row; | 1315 | struct glyph_row *row; |
| 1309 | enum fringe_bitmap_type which; | 1316 | enum fringe_bitmap_type which; |
| 1317 | int left_p; | ||
| 1310 | { | 1318 | { |
| 1311 | struct frame *f = XFRAME (WINDOW_FRAME (w)); | 1319 | struct frame *f = XFRAME (WINDOW_FRAME (w)); |
| 1312 | Display *display = FRAME_MAC_DISPLAY (f); | 1320 | Display *display = FRAME_MAC_DISPLAY (f); |
| 1313 | WindowPtr window = FRAME_MAC_WINDOW (f); | 1321 | WindowPtr window = FRAME_MAC_WINDOW (f); |
| 1314 | int x, y, wd, h, dy; | 1322 | int x, y, wd, h, dy; |
| 1323 | int b1, b2; | ||
| 1315 | unsigned char *bits; | 1324 | unsigned char *bits; |
| 1316 | BitMap bitmap; | 1325 | BitMap bitmap; |
| 1317 | XGCValues gcv; | 1326 | XGCValues gcv; |
| @@ -1320,72 +1329,138 @@ x_draw_fringe_bitmap (w, row, which) | |||
| 1320 | /* Must clip because of partially visible lines. */ | 1329 | /* Must clip because of partially visible lines. */ |
| 1321 | x_clip_to_row (w, row, 1); | 1330 | x_clip_to_row (w, row, 1); |
| 1322 | 1331 | ||
| 1332 | /* Convert row to frame coordinates. */ | ||
| 1333 | y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); | ||
| 1334 | |||
| 1323 | switch (which) | 1335 | switch (which) |
| 1324 | { | 1336 | { |
| 1337 | case NO_FRINGE_BITMAP: | ||
| 1338 | wd = 0; | ||
| 1339 | h = 0; | ||
| 1340 | break; | ||
| 1341 | |||
| 1325 | case LEFT_TRUNCATION_BITMAP: | 1342 | case LEFT_TRUNCATION_BITMAP: |
| 1326 | wd = left_width; | 1343 | wd = left_width; |
| 1327 | h = left_height; | 1344 | h = left_height; |
| 1328 | bits = left_bits; | 1345 | bits = left_bits; |
| 1329 | x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) | ||
| 1330 | - wd | ||
| 1331 | - (FRAME_X_LEFT_FRINGE_WIDTH (f) - wd) / 2); | ||
| 1332 | break; | 1346 | break; |
| 1333 | 1347 | ||
| 1334 | case OVERLAY_ARROW_BITMAP: | 1348 | case OVERLAY_ARROW_BITMAP: |
| 1335 | wd = left_width; | 1349 | wd = ov_width; |
| 1336 | h = left_height; | 1350 | h = ov_height; |
| 1337 | bits = ov_bits; | 1351 | bits = ov_bits; |
| 1338 | x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) | ||
| 1339 | - wd | ||
| 1340 | - (FRAME_X_LEFT_FRINGE_WIDTH (f) - wd) / 2); | ||
| 1341 | break; | 1352 | break; |
| 1342 | 1353 | ||
| 1343 | case RIGHT_TRUNCATION_BITMAP: | 1354 | case RIGHT_TRUNCATION_BITMAP: |
| 1344 | wd = right_width; | 1355 | wd = right_width; |
| 1345 | h = right_height; | 1356 | h = right_height; |
| 1346 | bits = right_bits; | 1357 | bits = right_bits; |
| 1347 | x = window_box_right (w, -1); | ||
| 1348 | x += (FRAME_X_RIGHT_FRINGE_WIDTH (f) - wd) / 2; | ||
| 1349 | break; | 1358 | break; |
| 1350 | 1359 | ||
| 1351 | case CONTINUED_LINE_BITMAP: | 1360 | case CONTINUED_LINE_BITMAP: |
| 1352 | wd = right_width; | 1361 | wd = continued_width; |
| 1353 | h = right_height; | 1362 | h = continued_height; |
| 1354 | bits = continued_bits; | 1363 | bits = continued_bits; |
| 1355 | x = window_box_right (w, -1); | ||
| 1356 | x += (FRAME_X_RIGHT_FRINGE_WIDTH (f) - wd) / 2; | ||
| 1357 | break; | 1364 | break; |
| 1358 | 1365 | ||
| 1359 | case CONTINUATION_LINE_BITMAP: | 1366 | case CONTINUATION_LINE_BITMAP: |
| 1360 | wd = continuation_width; | 1367 | wd = continuation_width; |
| 1361 | h = continuation_height; | 1368 | h = continuation_height; |
| 1362 | bits = continuation_bits; | 1369 | bits = continuation_bits; |
| 1363 | x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) | ||
| 1364 | - wd | ||
| 1365 | - (FRAME_X_LEFT_FRINGE_WIDTH (f) - wd) / 2); | ||
| 1366 | break; | 1370 | break; |
| 1367 | 1371 | ||
| 1368 | case ZV_LINE_BITMAP: | 1372 | case ZV_LINE_BITMAP: |
| 1369 | wd = zv_width; | 1373 | wd = zv_width; |
| 1370 | h = zv_height; | 1374 | h = zv_height - (y % zv_period); |
| 1371 | bits = zv_bits; | 1375 | bits = zv_bits + (y % zv_period); |
| 1372 | x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) | ||
| 1373 | - wd | ||
| 1374 | - (FRAME_X_LEFT_FRINGE_WIDTH (f) - wd) / 2); | ||
| 1375 | break; | 1376 | break; |
| 1376 | 1377 | ||
| 1377 | default: | 1378 | default: |
| 1378 | abort (); | 1379 | abort (); |
| 1379 | } | 1380 | } |
| 1380 | 1381 | ||
| 1381 | /* Convert to frame coordinates. Set dy to the offset in the row to | 1382 | /* Clip bitmap if too high. */ |
| 1382 | start drawing the bitmap. */ | 1383 | if (h > row->height) |
| 1383 | y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); | 1384 | h = row->height; |
| 1385 | |||
| 1386 | /* Set dy to the offset in the row to start drawing the bitmap. */ | ||
| 1384 | dy = (row->height - h) / 2; | 1387 | dy = (row->height - h) / 2; |
| 1385 | 1388 | ||
| 1386 | /* Draw the bitmap. I believe these small pixmaps can be cached | 1389 | /* Draw the bitmap. I believe these small pixmaps can be cached |
| 1387 | by the server. */ | 1390 | by the server. */ |
| 1388 | face = FACE_FROM_ID (f, FRINGE_FACE_ID); | 1391 | face = FACE_FROM_ID (f, FRINGE_FACE_ID); |
| 1392 | PREPARE_FACE_FOR_DISPLAY (f, face); | ||
| 1393 | |||
| 1394 | /* Clear left fringe if no bitmap to draw or if bitmap doesn't fill | ||
| 1395 | the fringe. */ | ||
| 1396 | b1 = -1; | ||
| 1397 | if (left_p) | ||
| 1398 | { | ||
| 1399 | if (wd > FRAME_X_LEFT_FRINGE_WIDTH (f)) | ||
| 1400 | wd = FRAME_X_LEFT_FRINGE_WIDTH (f); | ||
| 1401 | x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) | ||
| 1402 | - wd | ||
| 1403 | - (FRAME_X_LEFT_FRINGE_WIDTH (f) - wd) / 2); | ||
| 1404 | if (wd < FRAME_X_LEFT_FRINGE_WIDTH (f) || row->height > h) | ||
| 1405 | { | ||
| 1406 | /* If W has a vertical border to its left, don't draw over it. */ | ||
| 1407 | int border = ((XFASTINT (w->left) > 0 | ||
| 1408 | && !FRAME_HAS_VERTICAL_SCROLL_BARS (f)) | ||
| 1409 | ? 1 : 0); | ||
| 1410 | b1 = (window_box_left (w, -1) | ||
| 1411 | - FRAME_X_LEFT_FRINGE_WIDTH (f) | ||
| 1412 | + border); | ||
| 1413 | b2 = (FRAME_X_LEFT_FRINGE_WIDTH (f) - border); | ||
| 1414 | } | ||
| 1415 | } | ||
| 1416 | else | ||
| 1417 | { | ||
| 1418 | if (wd > FRAME_X_RIGHT_FRINGE_WIDTH (f)) | ||
| 1419 | wd = FRAME_X_RIGHT_FRINGE_WIDTH (f); | ||
| 1420 | x = (window_box_right (w, -1) | ||
| 1421 | + (FRAME_X_RIGHT_FRINGE_WIDTH (f) - wd) / 2); | ||
| 1422 | /* Clear right fringe if no bitmap to draw of if bitmap doesn't fill | ||
| 1423 | the fringe. */ | ||
| 1424 | if (wd < FRAME_X_RIGHT_FRINGE_WIDTH (f) || row->height > h) | ||
| 1425 | { | ||
| 1426 | b1 = window_box_right (w, -1); | ||
| 1427 | b2 = FRAME_X_RIGHT_FRINGE_WIDTH (f); | ||
| 1428 | } | ||
| 1429 | } | ||
| 1430 | |||
| 1431 | if (b1 >= 0) | ||
| 1432 | { | ||
| 1433 | int header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); | ||
| 1434 | XGCValues gcv; | ||
| 1435 | gcv.foreground = face->background; | ||
| 1436 | |||
| 1437 | #if 0 /* MAC_TODO: stipple */ | ||
| 1438 | /* In case the same realized face is used for fringes and | ||
| 1439 | for something displayed in the text (e.g. face `region' on | ||
| 1440 | mono-displays, the fill style may have been changed to | ||
| 1441 | FillSolid in x_draw_glyph_string_background. */ | ||
| 1442 | if (face->stipple) | ||
| 1443 | XSetFillStyle (FRAME_X_DISPLAY (f), face->gc, FillOpaqueStippled); | ||
| 1444 | else | ||
| 1445 | XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); | ||
| 1446 | #endif | ||
| 1447 | |||
| 1448 | XFillRectangle (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), | ||
| 1449 | &gcv, | ||
| 1450 | b1, | ||
| 1451 | WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, | ||
| 1452 | row->y)), | ||
| 1453 | b2, | ||
| 1454 | row->visible_height); | ||
| 1455 | |||
| 1456 | #if 0 /* MAC_TODO: stipple */ | ||
| 1457 | if (!face->stipple) | ||
| 1458 | XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground); | ||
| 1459 | #endif | ||
| 1460 | } | ||
| 1461 | |||
| 1462 | if (which == NO_FRINGE_BITMAP) | ||
| 1463 | return; | ||
| 1389 | 1464 | ||
| 1390 | mac_create_bitmap_from_bitmap_data (&bitmap, bits, wd, h); | 1465 | mac_create_bitmap_from_bitmap_data (&bitmap, bits, wd, h); |
| 1391 | gcv.foreground = face->foreground; | 1466 | gcv.foreground = face->foreground; |
| @@ -1408,8 +1483,6 @@ x_draw_row_fringe_bitmaps (w, row) | |||
| 1408 | { | 1483 | { |
| 1409 | struct frame *f = XFRAME (w->frame); | 1484 | struct frame *f = XFRAME (w->frame); |
| 1410 | enum fringe_bitmap_type bitmap; | 1485 | enum fringe_bitmap_type bitmap; |
| 1411 | struct face *face; | ||
| 1412 | int header_line_height = -1; | ||
| 1413 | 1486 | ||
| 1414 | xassert (interrupt_input_blocked); | 1487 | xassert (interrupt_input_blocked); |
| 1415 | 1488 | ||
| @@ -1418,133 +1491,37 @@ x_draw_row_fringe_bitmaps (w, row) | |||
| 1418 | if (row->visible_height <= 0) | 1491 | if (row->visible_height <= 0) |
| 1419 | return; | 1492 | return; |
| 1420 | 1493 | ||
| 1421 | face = FACE_FROM_ID (f, FRINGE_FACE_ID); | 1494 | if (FRAME_X_LEFT_FRINGE_WIDTH (f) != 0) |
| 1422 | PREPARE_FACE_FOR_DISPLAY (f, face); | 1495 | { |
| 1423 | 1496 | /* Decide which bitmap to draw in the left fringe. */ | |
| 1424 | /* Decide which bitmap to draw in the left fringe. */ | 1497 | if (row->overlay_arrow_p) |
| 1425 | if (row->overlay_arrow_p) | 1498 | bitmap = OVERLAY_ARROW_BITMAP; |
| 1426 | bitmap = OVERLAY_ARROW_BITMAP; | 1499 | else if (row->truncated_on_left_p) |
| 1427 | else if (row->truncated_on_left_p) | 1500 | bitmap = LEFT_TRUNCATION_BITMAP; |
| 1428 | bitmap = LEFT_TRUNCATION_BITMAP; | 1501 | else if (MATRIX_ROW_CONTINUATION_LINE_P (row)) |
| 1429 | else if (MATRIX_ROW_CONTINUATION_LINE_P (row)) | 1502 | bitmap = CONTINUATION_LINE_BITMAP; |
| 1430 | bitmap = CONTINUATION_LINE_BITMAP; | 1503 | else if (row->indicate_empty_line_p) |
| 1431 | else if (row->indicate_empty_line_p) | 1504 | bitmap = ZV_LINE_BITMAP; |
| 1432 | bitmap = ZV_LINE_BITMAP; | ||
| 1433 | else | ||
| 1434 | bitmap = NO_FRINGE_BITMAP; | ||
| 1435 | |||
| 1436 | /* Clear left fringe if no bitmap to draw or if bitmap doesn't fill | ||
| 1437 | the fringe. */ | ||
| 1438 | if (bitmap == NO_FRINGE_BITMAP | ||
| 1439 | || FRAME_FRINGE_BITMAP_WIDTH (f) < FRAME_X_LEFT_FRINGE_WIDTH (f) | ||
| 1440 | || row->height > FRAME_FRINGE_BITMAP_HEIGHT (f)) | ||
| 1441 | { | ||
| 1442 | /* If W has a vertical border to its left, don't draw over it. */ | ||
| 1443 | int border = ((XFASTINT (w->left) > 0 | ||
| 1444 | && !FRAME_HAS_VERTICAL_SCROLL_BARS (f)) | ||
| 1445 | ? 1 : 0); | ||
| 1446 | int left = window_box_left (w, -1); | ||
| 1447 | |||
| 1448 | if (header_line_height < 0) | ||
| 1449 | header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); | ||
| 1450 | |||
| 1451 | #if 0 /* MAC_TODO: stipple */ | ||
| 1452 | /* In case the same realized face is used for fringes and | ||
| 1453 | for something displayed in the text (e.g. face `region' on | ||
| 1454 | mono-displays, the fill style may have been changed to | ||
| 1455 | FillSolid in x_draw_glyph_string_background. */ | ||
| 1456 | if (face->stipple) | ||
| 1457 | XSetFillStyle (FRAME_X_DISPLAY (f), face->gc, FillOpaqueStippled); | ||
| 1458 | else | 1505 | else |
| 1459 | XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); | 1506 | bitmap = NO_FRINGE_BITMAP; |
| 1460 | |||
| 1461 | XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | ||
| 1462 | face->gc, | ||
| 1463 | (left | ||
| 1464 | - FRAME_X_LEFT_FRINGE_WIDTH (f) | ||
| 1465 | + border), | ||
| 1466 | WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, | ||
| 1467 | row->y)), | ||
| 1468 | FRAME_X_LEFT_FRINGE_WIDTH (f) - border, | ||
| 1469 | row->visible_height); | ||
| 1470 | if (!face->stipple) | ||
| 1471 | XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground); | ||
| 1472 | #endif | ||
| 1473 | { | ||
| 1474 | XGCValues gcv; | ||
| 1475 | gcv.foreground = face->background; | ||
| 1476 | XFillRectangle (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), | ||
| 1477 | &gcv, | ||
| 1478 | (left | ||
| 1479 | - FRAME_X_LEFT_FRINGE_WIDTH (f) | ||
| 1480 | + border), | ||
| 1481 | WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, | ||
| 1482 | row->y)), | ||
| 1483 | FRAME_X_LEFT_FRINGE_WIDTH (f) - border, | ||
| 1484 | row->visible_height); | ||
| 1485 | } | ||
| 1486 | |||
| 1487 | } | ||
| 1488 | |||
| 1489 | /* Draw the left bitmap. */ | ||
| 1490 | if (bitmap != NO_FRINGE_BITMAP) | ||
| 1491 | x_draw_fringe_bitmap (w, row, bitmap); | ||
| 1492 | 1507 | ||
| 1493 | /* Decide which bitmap to draw in the right fringe. */ | 1508 | x_draw_fringe_bitmap (w, row, bitmap, 1); |
| 1494 | if (row->truncated_on_right_p) | 1509 | } |
| 1495 | bitmap = RIGHT_TRUNCATION_BITMAP; | ||
| 1496 | else if (row->continued_p) | ||
| 1497 | bitmap = CONTINUED_LINE_BITMAP; | ||
| 1498 | else | ||
| 1499 | bitmap = NO_FRINGE_BITMAP; | ||
| 1500 | 1510 | ||
| 1501 | /* Clear right fringe if no bitmap to draw of if bitmap doesn't fill | 1511 | if (FRAME_X_RIGHT_FRINGE_WIDTH (f) != 0) |
| 1502 | the fringe. */ | ||
| 1503 | if (bitmap == NO_FRINGE_BITMAP | ||
| 1504 | || FRAME_FRINGE_BITMAP_WIDTH (f) < FRAME_X_RIGHT_FRINGE_WIDTH (f) | ||
| 1505 | || row->height > FRAME_FRINGE_BITMAP_HEIGHT (f)) | ||
| 1506 | { | 1512 | { |
| 1507 | int right = window_box_right (w, -1); | 1513 | /* Decide which bitmap to draw in the right fringe. */ |
| 1508 | 1514 | if (row->truncated_on_right_p) | |
| 1509 | if (header_line_height < 0) | 1515 | bitmap = RIGHT_TRUNCATION_BITMAP; |
| 1510 | header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); | 1516 | else if (row->continued_p) |
| 1511 | 1517 | bitmap = CONTINUED_LINE_BITMAP; | |
| 1512 | #if 0 /* MAC_TODO: stipple */ | 1518 | else if (row->indicate_empty_line_p && FRAME_X_LEFT_FRINGE_WIDTH (f) == 0) |
| 1513 | /* In case the same realized face is used for fringes and | 1519 | bitmap = ZV_LINE_BITMAP; |
| 1514 | for something displayed in the text (e.g. face `region' on | ||
| 1515 | mono-displays, the fill style may have been changed to | ||
| 1516 | FillSolid in x_draw_glyph_string_background. */ | ||
| 1517 | if (face->stipple) | ||
| 1518 | XSetFillStyle (FRAME_X_DISPLAY (f), face->gc, FillOpaqueStippled); | ||
| 1519 | else | 1520 | else |
| 1520 | XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); | 1521 | bitmap = NO_FRINGE_BITMAP; |
| 1521 | XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | ||
| 1522 | face->gc, | ||
| 1523 | right, | ||
| 1524 | WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, | ||
| 1525 | row->y)), | ||
| 1526 | FRAME_X_RIGHT_FRINGE_WIDTH (f), | ||
| 1527 | row->visible_height); | ||
| 1528 | if (!face->stipple) | ||
| 1529 | XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground); | ||
| 1530 | #endif | ||
| 1531 | { | ||
| 1532 | XGCValues gcv; | ||
| 1533 | gcv.foreground = face->background; | ||
| 1534 | XFillRectangle (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), | ||
| 1535 | &gcv, | ||
| 1536 | right, | ||
| 1537 | WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, | ||
| 1538 | row->y)), | ||
| 1539 | FRAME_X_RIGHT_FRINGE_WIDTH (f), | ||
| 1540 | row->visible_height); | ||
| 1541 | } | ||
| 1542 | 1522 | ||
| 1523 | x_draw_fringe_bitmap (w, row, bitmap, 0); | ||
| 1543 | } | 1524 | } |
| 1544 | |||
| 1545 | /* Draw the right bitmap. */ | ||
| 1546 | if (bitmap != NO_FRINGE_BITMAP) | ||
| 1547 | x_draw_fringe_bitmap (w, row, bitmap); | ||
| 1548 | } | 1525 | } |
| 1549 | 1526 | ||
| 1550 | 1527 | ||
| @@ -5193,7 +5170,6 @@ x_draw_glyphs (w, x, row, area, start, end, hl, real_start, real_end, | |||
| 5193 | /* X is relative to the left edge of W, without scroll bars | 5170 | /* X is relative to the left edge of W, without scroll bars |
| 5194 | or fringes. */ | 5171 | or fringes. */ |
| 5195 | struct frame *f = XFRAME (w->frame); | 5172 | struct frame *f = XFRAME (w->frame); |
| 5196 | /* int width = FRAME_FRINGE_WIDTH (f); */ | ||
| 5197 | int window_left_x = WINDOW_LEFT_MARGIN (w) * CANON_X_UNIT (f); | 5173 | int window_left_x = WINDOW_LEFT_MARGIN (w) * CANON_X_UNIT (f); |
| 5198 | 5174 | ||
| 5199 | x += window_left_x; | 5175 | x += window_left_x; |
| @@ -9210,8 +9186,92 @@ x_new_fontset (f, fontsetname) | |||
| 9210 | return build_string (fontsetname); | 9186 | return build_string (fontsetname); |
| 9211 | } | 9187 | } |
| 9212 | 9188 | ||
| 9213 | #if 0 /* MAC_TODO: inline input methods for Mac */ | 9189 | /* Compute actual fringe widths */ |
| 9190 | |||
| 9191 | void | ||
| 9192 | x_compute_fringe_widths (f, redraw) | ||
| 9193 | struct frame *f; | ||
| 9194 | int redraw; | ||
| 9195 | { | ||
| 9196 | int o_left = f->output_data.mac->left_fringe_width; | ||
| 9197 | int o_right = f->output_data.mac->right_fringe_width; | ||
| 9198 | int o_cols = f->output_data.mac->fringe_cols; | ||
| 9199 | |||
| 9200 | Lisp_Object left_fringe = Fassq (Qleft_fringe, f->param_alist); | ||
| 9201 | Lisp_Object right_fringe = Fassq (Qright_fringe, f->param_alist); | ||
| 9202 | int left_fringe_width, right_fringe_width; | ||
| 9203 | |||
| 9204 | if (!NILP (left_fringe)) | ||
| 9205 | left_fringe = Fcdr (left_fringe); | ||
| 9206 | if (!NILP (right_fringe)) | ||
| 9207 | right_fringe = Fcdr (right_fringe); | ||
| 9208 | |||
| 9209 | left_fringe_width = ((NILP (left_fringe) || !INTEGERP (left_fringe)) ? 8 : | ||
| 9210 | XINT (left_fringe)); | ||
| 9211 | right_fringe_width = ((NILP (right_fringe) || !INTEGERP (right_fringe)) ? 8 : | ||
| 9212 | XINT (right_fringe)); | ||
| 9213 | |||
| 9214 | if (left_fringe_width || right_fringe_width) | ||
| 9215 | { | ||
| 9216 | int left_wid = left_fringe_width >= 0 ? left_fringe_width : -left_fringe_width; | ||
| 9217 | int right_wid = right_fringe_width >= 0 ? right_fringe_width : -right_fringe_width; | ||
| 9218 | int conf_wid = left_wid + right_wid; | ||
| 9219 | int font_wid = FONT_WIDTH (f->output_data.mac->font); | ||
| 9220 | int cols = (left_wid + right_wid + font_wid-1) / font_wid; | ||
| 9221 | int real_wid = cols * font_wid; | ||
| 9222 | if (left_wid && right_wid) | ||
| 9223 | { | ||
| 9224 | if (left_fringe_width < 0) | ||
| 9225 | { | ||
| 9226 | /* Left fringe width is fixed, adjust right fringe if necessary */ | ||
| 9227 | f->output_data.mac->left_fringe_width = left_wid; | ||
| 9228 | f->output_data.mac->right_fringe_width = real_wid - left_wid; | ||
| 9229 | } | ||
| 9230 | else if (right_fringe_width < 0) | ||
| 9231 | { | ||
| 9232 | /* Right fringe width is fixed, adjust left fringe if necessary */ | ||
| 9233 | f->output_data.mac->left_fringe_width = real_wid - right_wid; | ||
| 9234 | f->output_data.mac->right_fringe_width = right_wid; | ||
| 9235 | } | ||
| 9236 | else | ||
| 9237 | { | ||
| 9238 | /* Adjust both fringes with an equal amount. | ||
| 9239 | Note that we are doing integer arithmetic here, so don't | ||
| 9240 | lose a pixel if the total width is an odd number. */ | ||
| 9241 | int fill = real_wid - conf_wid; | ||
| 9242 | f->output_data.mac->left_fringe_width = left_wid + fill/2; | ||
| 9243 | f->output_data.mac->right_fringe_width = right_wid + fill - fill/2; | ||
| 9244 | } | ||
| 9245 | } | ||
| 9246 | else if (left_fringe_width) | ||
| 9247 | { | ||
| 9248 | f->output_data.mac->left_fringe_width = real_wid; | ||
| 9249 | f->output_data.mac->right_fringe_width = 0; | ||
| 9250 | } | ||
| 9251 | else | ||
| 9252 | { | ||
| 9253 | f->output_data.mac->left_fringe_width = 0; | ||
| 9254 | f->output_data.mac->right_fringe_width = real_wid; | ||
| 9255 | } | ||
| 9256 | f->output_data.mac->fringe_cols = cols; | ||
| 9257 | f->output_data.mac->fringes_extra = real_wid; | ||
| 9258 | } | ||
| 9259 | else | ||
| 9260 | { | ||
| 9261 | f->output_data.mac->left_fringe_width = 0; | ||
| 9262 | f->output_data.mac->right_fringe_width = 0; | ||
| 9263 | f->output_data.mac->fringe_cols = 0; | ||
| 9264 | f->output_data.mac->fringes_extra = 0; | ||
| 9265 | } | ||
| 9266 | |||
| 9267 | if (redraw && FRAME_VISIBLE_P (f)) | ||
| 9268 | if (o_left != f->output_data.mac->left_fringe_width || | ||
| 9269 | o_right != f->output_data.mac->right_fringe_width || | ||
| 9270 | o_cols != f->output_data.mac->fringe_cols) | ||
| 9271 | redraw_frame (f); | ||
| 9272 | } | ||
| 9214 | 9273 | ||
| 9274 | #if 0 /* MAC_TODO: inline input methods for Mac */ | ||
| 9215 | /*********************************************************************** | 9275 | /*********************************************************************** |
| 9216 | X Input Methods | 9276 | X Input Methods |
| 9217 | ***********************************************************************/ | 9277 | ***********************************************************************/ |
| @@ -9512,8 +9572,9 @@ x_set_window_size (f, change_gravity, cols, rows) | |||
| 9512 | : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 | 9572 | : FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 |
| 9513 | ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) | 9573 | ? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) |
| 9514 | : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.mac->font))); | 9574 | : (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.mac->font))); |
| 9515 | f->output_data.mac->fringes_extra | 9575 | |
| 9516 | = FRAME_FRINGE_WIDTH (f); | 9576 | x_compute_fringe_widths (f, 0); |
| 9577 | |||
| 9517 | pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); | 9578 | pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); |
| 9518 | pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); | 9579 | pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); |
| 9519 | 9580 | ||