129 |
`indicate-empty-lines' is non-nil. */ |
`indicate-empty-lines' is non-nil. */ |
130 |
|
|
131 |
#define zv_width 8 |
#define zv_width 8 |
132 |
#define zv_height 8 |
#define zv_height 72 |
133 |
|
#define zv_period 3 |
134 |
static unsigned char zv_bits[] = { |
static unsigned char zv_bits[] = { |
135 |
0x00, 0x00, 0x78, 0x78, 0x78, 0x78, 0x00, 0x00}; |
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}; |
143 |
|
|
144 |
/* An arrow like this: `<-'. */ |
/* An arrow like this: `<-'. */ |
145 |
|
|
437 |
static void x_erase_phys_cursor P_ ((struct window *)); |
static void x_erase_phys_cursor P_ ((struct window *)); |
438 |
void x_display_and_set_cursor P_ ((struct window *, int, int, int, int, int)); |
void x_display_and_set_cursor P_ ((struct window *, int, int, int, int, int)); |
439 |
static void x_draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, |
static void x_draw_fringe_bitmap P_ ((struct window *, struct glyph_row *, |
440 |
enum fringe_bitmap_type)); |
enum fringe_bitmap_type, int left_p)); |
|
|
|
441 |
static void x_clip_to_row P_ ((struct window *, struct glyph_row *, |
static void x_clip_to_row P_ ((struct window *, struct glyph_row *, |
442 |
GC, int)); |
GC, int)); |
443 |
static int x_phys_cursor_in_rect_p P_ ((struct window *, Rect *)); |
static int x_phys_cursor_in_rect_p P_ ((struct window *, Rect *)); |
1310 |
drawn. */ |
drawn. */ |
1311 |
|
|
1312 |
static void |
static void |
1313 |
x_draw_fringe_bitmap (w, row, which) |
x_draw_fringe_bitmap (w, row, which, left_p) |
1314 |
struct window *w; |
struct window *w; |
1315 |
struct glyph_row *row; |
struct glyph_row *row; |
1316 |
enum fringe_bitmap_type which; |
enum fringe_bitmap_type which; |
1317 |
|
int left_p; |
1318 |
{ |
{ |
1319 |
struct frame *f = XFRAME (WINDOW_FRAME (w)); |
struct frame *f = XFRAME (WINDOW_FRAME (w)); |
1320 |
Display *display = FRAME_MAC_DISPLAY (f); |
Display *display = FRAME_MAC_DISPLAY (f); |
1321 |
WindowPtr window = FRAME_MAC_WINDOW (f); |
WindowPtr window = FRAME_MAC_WINDOW (f); |
1322 |
int x, y, wd, h, dy; |
int x, y, wd, h, dy; |
1323 |
|
int b1, b2; |
1324 |
unsigned char *bits; |
unsigned char *bits; |
1325 |
BitMap bitmap; |
BitMap bitmap; |
1326 |
XGCValues gcv; |
XGCValues gcv; |
1329 |
/* Must clip because of partially visible lines. */ |
/* Must clip because of partially visible lines. */ |
1330 |
x_clip_to_row (w, row, 1); |
x_clip_to_row (w, row, 1); |
1331 |
|
|
1332 |
|
/* Convert row to frame coordinates. */ |
1333 |
|
y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); |
1334 |
|
|
1335 |
switch (which) |
switch (which) |
1336 |
{ |
{ |
1337 |
|
case NO_FRINGE_BITMAP: |
1338 |
|
wd = 0; |
1339 |
|
h = 0; |
1340 |
|
break; |
1341 |
|
|
1342 |
case LEFT_TRUNCATION_BITMAP: |
case LEFT_TRUNCATION_BITMAP: |
1343 |
wd = left_width; |
wd = left_width; |
1344 |
h = left_height; |
h = left_height; |
1345 |
bits = left_bits; |
bits = left_bits; |
|
x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) |
|
|
- wd |
|
|
- (FRAME_X_LEFT_FRINGE_WIDTH (f) - wd) / 2); |
|
1346 |
break; |
break; |
1347 |
|
|
1348 |
case OVERLAY_ARROW_BITMAP: |
case OVERLAY_ARROW_BITMAP: |
1349 |
wd = left_width; |
wd = ov_width; |
1350 |
h = left_height; |
h = ov_height; |
1351 |
bits = ov_bits; |
bits = ov_bits; |
|
x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) |
|
|
- wd |
|
|
- (FRAME_X_LEFT_FRINGE_WIDTH (f) - wd) / 2); |
|
1352 |
break; |
break; |
1353 |
|
|
1354 |
case RIGHT_TRUNCATION_BITMAP: |
case RIGHT_TRUNCATION_BITMAP: |
1355 |
wd = right_width; |
wd = right_width; |
1356 |
h = right_height; |
h = right_height; |
1357 |
bits = right_bits; |
bits = right_bits; |
|
x = window_box_right (w, -1); |
|
|
x += (FRAME_X_RIGHT_FRINGE_WIDTH (f) - wd) / 2; |
|
1358 |
break; |
break; |
1359 |
|
|
1360 |
case CONTINUED_LINE_BITMAP: |
case CONTINUED_LINE_BITMAP: |
1361 |
wd = right_width; |
wd = continued_width; |
1362 |
h = right_height; |
h = continued_height; |
1363 |
bits = continued_bits; |
bits = continued_bits; |
|
x = window_box_right (w, -1); |
|
|
x += (FRAME_X_RIGHT_FRINGE_WIDTH (f) - wd) / 2; |
|
1364 |
break; |
break; |
1365 |
|
|
1366 |
case CONTINUATION_LINE_BITMAP: |
case CONTINUATION_LINE_BITMAP: |
1367 |
wd = continuation_width; |
wd = continuation_width; |
1368 |
h = continuation_height; |
h = continuation_height; |
1369 |
bits = continuation_bits; |
bits = continuation_bits; |
|
x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) |
|
|
- wd |
|
|
- (FRAME_X_LEFT_FRINGE_WIDTH (f) - wd) / 2); |
|
1370 |
break; |
break; |
1371 |
|
|
1372 |
case ZV_LINE_BITMAP: |
case ZV_LINE_BITMAP: |
1373 |
wd = zv_width; |
wd = zv_width; |
1374 |
h = zv_height; |
h = zv_height - (y % zv_period); |
1375 |
bits = zv_bits; |
bits = zv_bits + (y % zv_period); |
|
x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) |
|
|
- wd |
|
|
- (FRAME_X_LEFT_FRINGE_WIDTH (f) - wd) / 2); |
|
1376 |
break; |
break; |
1377 |
|
|
1378 |
default: |
default: |
1379 |
abort (); |
abort (); |
1380 |
} |
} |
1381 |
|
|
1382 |
/* Convert to frame coordinates. Set dy to the offset in the row to |
/* Clip bitmap if too high. */ |
1383 |
start drawing the bitmap. */ |
if (h > row->height) |
1384 |
y = WINDOW_TO_FRAME_PIXEL_Y (w, row->y); |
h = row->height; |
1385 |
|
|
1386 |
|
/* Set dy to the offset in the row to start drawing the bitmap. */ |
1387 |
dy = (row->height - h) / 2; |
dy = (row->height - h) / 2; |
1388 |
|
|
1389 |
/* Draw the bitmap. I believe these small pixmaps can be cached |
/* Draw the bitmap. I believe these small pixmaps can be cached |
1390 |
by the server. */ |
by the server. */ |
1391 |
face = FACE_FROM_ID (f, FRINGE_FACE_ID); |
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; |
1464 |
|
|
1465 |
mac_create_bitmap_from_bitmap_data (&bitmap, bits, wd, h); |
mac_create_bitmap_from_bitmap_data (&bitmap, bits, wd, h); |
1466 |
gcv.foreground = face->foreground; |
gcv.foreground = face->foreground; |
1483 |
{ |
{ |
1484 |
struct frame *f = XFRAME (w->frame); |
struct frame *f = XFRAME (w->frame); |
1485 |
enum fringe_bitmap_type bitmap; |
enum fringe_bitmap_type bitmap; |
|
struct face *face; |
|
|
int header_line_height = -1; |
|
1486 |
|
|
1487 |
xassert (interrupt_input_blocked); |
xassert (interrupt_input_blocked); |
1488 |
|
|
1491 |
if (row->visible_height <= 0) |
if (row->visible_height <= 0) |
1492 |
return; |
return; |
1493 |
|
|
1494 |
face = FACE_FROM_ID (f, FRINGE_FACE_ID); |
if (FRAME_X_LEFT_FRINGE_WIDTH (f) != 0) |
1495 |
PREPARE_FACE_FOR_DISPLAY (f, face); |
{ |
1496 |
|
/* Decide which bitmap to draw in the left fringe. */ |
1497 |
/* Decide which bitmap to draw in the left fringe. */ |
if (row->overlay_arrow_p) |
1498 |
if (row->overlay_arrow_p) |
bitmap = OVERLAY_ARROW_BITMAP; |
1499 |
bitmap = OVERLAY_ARROW_BITMAP; |
else if (row->truncated_on_left_p) |
1500 |
else if (row->truncated_on_left_p) |
bitmap = LEFT_TRUNCATION_BITMAP; |
1501 |
bitmap = LEFT_TRUNCATION_BITMAP; |
else if (MATRIX_ROW_CONTINUATION_LINE_P (row)) |
1502 |
else if (MATRIX_ROW_CONTINUATION_LINE_P (row)) |
bitmap = CONTINUATION_LINE_BITMAP; |
1503 |
bitmap = CONTINUATION_LINE_BITMAP; |
else if (row->indicate_empty_line_p) |
1504 |
else if (row->indicate_empty_line_p) |
bitmap = ZV_LINE_BITMAP; |
|
bitmap = ZV_LINE_BITMAP; |
|
|
else |
|
|
bitmap = NO_FRINGE_BITMAP; |
|
|
|
|
|
/* Clear left fringe if no bitmap to draw or if bitmap doesn't fill |
|
|
the fringe. */ |
|
|
if (bitmap == NO_FRINGE_BITMAP |
|
|
|| FRAME_FRINGE_BITMAP_WIDTH (f) < FRAME_X_LEFT_FRINGE_WIDTH (f) |
|
|
|| row->height > FRAME_FRINGE_BITMAP_HEIGHT (f)) |
|
|
{ |
|
|
/* If W has a vertical border to its left, don't draw over it. */ |
|
|
int border = ((XFASTINT (w->left) > 0 |
|
|
&& !FRAME_HAS_VERTICAL_SCROLL_BARS (f)) |
|
|
? 1 : 0); |
|
|
int left = window_box_left (w, -1); |
|
|
|
|
|
if (header_line_height < 0) |
|
|
header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); |
|
|
|
|
|
#if 0 /* MAC_TODO: stipple */ |
|
|
/* In case the same realized face is used for fringes and |
|
|
for something displayed in the text (e.g. face `region' on |
|
|
mono-displays, the fill style may have been changed to |
|
|
FillSolid in x_draw_glyph_string_background. */ |
|
|
if (face->stipple) |
|
|
XSetFillStyle (FRAME_X_DISPLAY (f), face->gc, FillOpaqueStippled); |
|
1505 |
else |
else |
1506 |
XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); |
bitmap = NO_FRINGE_BITMAP; |
|
|
|
|
XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
|
|
face->gc, |
|
|
(left |
|
|
- FRAME_X_LEFT_FRINGE_WIDTH (f) |
|
|
+ border), |
|
|
WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, |
|
|
row->y)), |
|
|
FRAME_X_LEFT_FRINGE_WIDTH (f) - border, |
|
|
row->visible_height); |
|
|
if (!face->stipple) |
|
|
XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground); |
|
|
#endif |
|
|
{ |
|
|
XGCValues gcv; |
|
|
gcv.foreground = face->background; |
|
|
XFillRectangle (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), |
|
|
&gcv, |
|
|
(left |
|
|
- FRAME_X_LEFT_FRINGE_WIDTH (f) |
|
|
+ border), |
|
|
WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, |
|
|
row->y)), |
|
|
FRAME_X_LEFT_FRINGE_WIDTH (f) - border, |
|
|
row->visible_height); |
|
|
} |
|
|
|
|
|
} |
|
1507 |
|
|
1508 |
/* Draw the left bitmap. */ |
x_draw_fringe_bitmap (w, row, bitmap, 1); |
1509 |
if (bitmap != NO_FRINGE_BITMAP) |
} |
|
x_draw_fringe_bitmap (w, row, bitmap); |
|
|
|
|
|
/* Decide which bitmap to draw in the right fringe. */ |
|
|
if (row->truncated_on_right_p) |
|
|
bitmap = RIGHT_TRUNCATION_BITMAP; |
|
|
else if (row->continued_p) |
|
|
bitmap = CONTINUED_LINE_BITMAP; |
|
|
else |
|
|
bitmap = NO_FRINGE_BITMAP; |
|
1510 |
|
|
1511 |
/* Clear right fringe if no bitmap to draw of if bitmap doesn't fill |
if (FRAME_X_RIGHT_FRINGE_WIDTH (f) != 0) |
|
the fringe. */ |
|
|
if (bitmap == NO_FRINGE_BITMAP |
|
|
|| FRAME_FRINGE_BITMAP_WIDTH (f) < FRAME_X_RIGHT_FRINGE_WIDTH (f) |
|
|
|| row->height > FRAME_FRINGE_BITMAP_HEIGHT (f)) |
|
1512 |
{ |
{ |
1513 |
int right = window_box_right (w, -1); |
/* Decide which bitmap to draw in the right fringe. */ |
1514 |
|
if (row->truncated_on_right_p) |
1515 |
if (header_line_height < 0) |
bitmap = RIGHT_TRUNCATION_BITMAP; |
1516 |
header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); |
else if (row->continued_p) |
1517 |
|
bitmap = CONTINUED_LINE_BITMAP; |
1518 |
#if 0 /* MAC_TODO: stipple */ |
else if (row->indicate_empty_line_p && FRAME_X_LEFT_FRINGE_WIDTH (f) == 0) |
1519 |
/* In case the same realized face is used for fringes and |
bitmap = ZV_LINE_BITMAP; |
|
for something displayed in the text (e.g. face `region' on |
|
|
mono-displays, the fill style may have been changed to |
|
|
FillSolid in x_draw_glyph_string_background. */ |
|
|
if (face->stipple) |
|
|
XSetFillStyle (FRAME_X_DISPLAY (f), face->gc, FillOpaqueStippled); |
|
1520 |
else |
else |
1521 |
XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); |
bitmap = NO_FRINGE_BITMAP; |
|
XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
|
|
face->gc, |
|
|
right, |
|
|
WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, |
|
|
row->y)), |
|
|
FRAME_X_RIGHT_FRINGE_WIDTH (f), |
|
|
row->visible_height); |
|
|
if (!face->stipple) |
|
|
XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground); |
|
|
#endif |
|
|
{ |
|
|
XGCValues gcv; |
|
|
gcv.foreground = face->background; |
|
|
XFillRectangle (FRAME_MAC_DISPLAY (f), FRAME_MAC_WINDOW (f), |
|
|
&gcv, |
|
|
right, |
|
|
WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, |
|
|
row->y)), |
|
|
FRAME_X_RIGHT_FRINGE_WIDTH (f), |
|
|
row->visible_height); |
|
|
} |
|
1522 |
|
|
1523 |
|
x_draw_fringe_bitmap (w, row, bitmap, 0); |
1524 |
} |
} |
|
|
|
|
/* Draw the right bitmap. */ |
|
|
if (bitmap != NO_FRINGE_BITMAP) |
|
|
x_draw_fringe_bitmap (w, row, bitmap); |
|
1525 |
} |
} |
1526 |
|
|
1527 |
|
|
5170 |
/* X is relative to the left edge of W, without scroll bars |
/* X is relative to the left edge of W, without scroll bars |
5171 |
or fringes. */ |
or fringes. */ |
5172 |
struct frame *f = XFRAME (w->frame); |
struct frame *f = XFRAME (w->frame); |
|
/* int width = FRAME_FRINGE_WIDTH (f); */ |
|
5173 |
int window_left_x = WINDOW_LEFT_MARGIN (w) * CANON_X_UNIT (f); |
int window_left_x = WINDOW_LEFT_MARGIN (w) * CANON_X_UNIT (f); |
5174 |
|
|
5175 |
x += window_left_x; |
x += window_left_x; |
9186 |
return build_string (fontsetname); |
return build_string (fontsetname); |
9187 |
} |
} |
9188 |
|
|
9189 |
#if 0 /* MAC_TODO: inline input methods for Mac */ |
/* 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 |
|
} |
9273 |
|
|
9274 |
|
#if 0 /* MAC_TODO: inline input methods for Mac */ |
9275 |
/*********************************************************************** |
/*********************************************************************** |
9276 |
X Input Methods |
X Input Methods |
9277 |
***********************************************************************/ |
***********************************************************************/ |
9572 |
: FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 |
: FRAME_SCROLL_BAR_PIXEL_WIDTH (f) > 0 |
9573 |
? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) |
? FRAME_SCROLL_BAR_PIXEL_WIDTH (f) |
9574 |
: (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.mac->font))); |
: (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.mac->font))); |
9575 |
f->output_data.mac->fringes_extra |
|
9576 |
= FRAME_FRINGE_WIDTH (f); |
x_compute_fringe_widths (f, 0); |
9577 |
|
|
9578 |
pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); |
pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); |
9579 |
pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); |
pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); |
9580 |
|
|