Mercurial > hg > xemacs-beta
comparison src/redisplay-x.c @ 422:95016f13131a r21-2-19
Import from CVS: tag r21-2-19
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:25:01 +0200 |
parents | 41dbb7a9d5f2 |
children | 11054d720c21 |
comparison
equal
deleted
inserted
replaced
421:fff06e11db74 | 422:95016f13131a |
---|---|
38 | 38 |
39 #include "buffer.h" | 39 #include "buffer.h" |
40 #include "debug.h" | 40 #include "debug.h" |
41 #include "faces.h" | 41 #include "faces.h" |
42 #include "frame.h" | 42 #include "frame.h" |
43 #include "gutter.h" | |
43 #include "redisplay.h" | 44 #include "redisplay.h" |
44 #include "sysdep.h" | 45 #include "sysdep.h" |
45 #include "window.h" | 46 #include "window.h" |
46 #include <X11/bitmaps/gray> | 47 #include <X11/bitmaps/gray> |
47 | 48 |
76 int width, int height); | 77 int width, int height); |
77 static void x_output_eol_cursor (struct window *w, struct display_line *dl, | 78 static void x_output_eol_cursor (struct window *w, struct display_line *dl, |
78 int xpos, face_index findex); | 79 int xpos, face_index findex); |
79 static void x_clear_frame (struct frame *f); | 80 static void x_clear_frame (struct frame *f); |
80 static void x_clear_frame_windows (Lisp_Object window); | 81 static void x_clear_frame_windows (Lisp_Object window); |
81 static void x_bevel_modeline (struct window *w, struct display_line *dl); | 82 void bevel_modeline (struct window *w, struct display_line *dl); |
82 | 83 |
83 | 84 |
84 /* Note: We do not use the Xmb*() functions and XFontSets. | 85 /* Note: We do not use the Xmb*() functions and XFontSets. |
85 Those functions are generally losing for a number of reasons: | 86 Those functions are generally losing for a number of reasons: |
86 | 87 |
332 rune_dynarr *rba = db->runes; | 333 rune_dynarr *rba = db->runes; |
333 struct rune *rb; | 334 struct rune *rb; |
334 | 335 |
335 int elt = start; | 336 int elt = start; |
336 face_index findex; | 337 face_index findex; |
337 int xpos, width; | 338 int xpos, width = 0; |
338 Lisp_Object charset = Qunbound; /* Qnil is a valid charset when | 339 Lisp_Object charset = Qunbound; /* Qnil is a valid charset when |
339 MULE is not defined */ | 340 MULE is not defined */ |
340 | 341 |
341 XSETWINDOW (window, w); | 342 XSETWINDOW (window, w); |
342 rb = Dynarr_atp (rba, start); | 343 rb = Dynarr_atp (rba, start); |
343 | 344 |
344 if (!rb) | 345 if (!rb) |
345 { | 346 /* Nothing to do so don't do anything. */ |
346 /* Nothing to do so don't do anything. */ | 347 return; |
347 return; | 348 |
348 } | 349 findex = rb->findex; |
349 else | 350 xpos = rb->xpos; |
350 { | 351 if (rb->type == RUNE_CHAR) |
351 findex = rb->findex; | 352 charset = CHAR_CHARSET (rb->object.chr.ch); |
352 xpos = rb->xpos; | |
353 width = 0; | |
354 if (rb->type == RUNE_CHAR) | |
355 charset = CHAR_CHARSET (rb->object.chr.ch); | |
356 } | |
357 | 353 |
358 if (end < 0) | 354 if (end < 0) |
359 end = Dynarr_length (rba); | 355 end = Dynarr_length (rba); |
360 Dynarr_reset (buf); | 356 Dynarr_reset (buf); |
361 | 357 |
520 if (dl->modeline | 516 if (dl->modeline |
521 && !EQ (Qzero, w->modeline_shadow_thickness) | 517 && !EQ (Qzero, w->modeline_shadow_thickness) |
522 && (f->clear | 518 && (f->clear |
523 || f->windows_structure_changed | 519 || f->windows_structure_changed |
524 || w->shadow_thickness_changed)) | 520 || w->shadow_thickness_changed)) |
525 x_bevel_modeline (w, dl); | 521 bevel_modeline (w, dl); |
526 | 522 |
527 Dynarr_free (buf); | 523 Dynarr_free (buf); |
528 } | 524 } |
529 | 525 |
530 /***************************************************************************** | 526 /***************************************************************************** |
531 x_bevel_modeline | 527 x_bevel_area |
532 | 528 |
533 Draw a 3d border around the modeline on window W. | 529 Draw a shadows for the given area in the given face. |
534 ****************************************************************************/ | 530 ****************************************************************************/ |
535 static void | 531 static void |
536 x_bevel_modeline (struct window *w, struct display_line *dl) | 532 x_bevel_area (struct window *w, face_index findex, |
533 int x, int y, int width, int height, | |
534 int shadow_thickness) | |
537 { | 535 { |
538 struct frame *f = XFRAME (w->frame); | 536 struct frame *f = XFRAME (w->frame); |
539 struct device *d = XDEVICE (f->device); | 537 struct device *d = XDEVICE (f->device); |
538 | |
539 EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f); | |
540 Display *dpy = DEVICE_X_DISPLAY (d); | 540 Display *dpy = DEVICE_X_DISPLAY (d); |
541 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); | 541 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); |
542 EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f); | 542 Pixel top_shadow_pixel, bottom_shadow_pixel, background_pixel; |
543 Lisp_Object tmp_pixel; | |
544 XColor tmp_color; | |
545 XGCValues gcv; | |
543 GC top_shadow_gc, bottom_shadow_gc, background_gc; | 546 GC top_shadow_gc, bottom_shadow_gc, background_gc; |
544 Pixel top_shadow_pixel, bottom_shadow_pixel, background_pixel; | 547 |
545 XColor tmp_color; | |
546 Lisp_Object tmp_pixel; | |
547 int x, y, width, height; | |
548 XGCValues gcv; | |
549 unsigned long mask; | |
550 int use_pixmap = 0; | 548 int use_pixmap = 0; |
551 int flip_gcs = 0; | 549 int flip_gcs = 0; |
552 int shadow_thickness; | 550 unsigned long mask; |
553 | 551 |
554 memset (&gcv, ~0, sizeof (XGCValues)); | 552 memset (&gcv, ~0, sizeof (XGCValues)); |
555 | 553 |
556 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, MODELINE_INDEX); | 554 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, findex); |
557 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); | 555 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); |
558 | 556 |
559 /* First, get the GC's. */ | 557 /* First, get the GC's. */ |
560 top_shadow_pixel = tmp_color.pixel; | 558 top_shadow_pixel = tmp_color.pixel; |
561 bottom_shadow_pixel = tmp_color.pixel; | 559 bottom_shadow_pixel = tmp_color.pixel; |
562 background_pixel = tmp_color.pixel; | 560 background_pixel = tmp_color.pixel; |
563 | 561 |
564 x_generate_shadow_pixels (f, &top_shadow_pixel, &bottom_shadow_pixel, | 562 x_generate_shadow_pixels (f, &top_shadow_pixel, &bottom_shadow_pixel, |
565 background_pixel, ef->core.background_pixel); | 563 background_pixel, ef->core.background_pixel); |
566 | 564 |
567 tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, MODELINE_INDEX); | 565 tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, findex); |
568 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); | 566 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); |
569 gcv.background = tmp_color.pixel; | 567 gcv.background = tmp_color.pixel; |
570 gcv.graphics_exposures = False; | 568 gcv.graphics_exposures = False; |
571 mask = GCForeground | GCBackground | GCGraphicsExposures; | 569 mask = GCForeground | GCBackground | GCGraphicsExposures; |
572 | 570 |
571 /* If we can't distinguish one of the shadows (the color is the same as the | |
572 background), it's better to use a pixmap to generate a dithered gray. */ | |
573 if (top_shadow_pixel == background_pixel || | 573 if (top_shadow_pixel == background_pixel || |
574 bottom_shadow_pixel == background_pixel) | 574 bottom_shadow_pixel == background_pixel) |
575 use_pixmap = 1; | 575 use_pixmap = 1; |
576 | 576 |
577 if (use_pixmap) | 577 if (use_pixmap) |
581 DEVICE_X_GRAY_PIXMAP (d) = | 581 DEVICE_X_GRAY_PIXMAP (d) = |
582 XCreatePixmapFromBitmapData (dpy, x_win, (char *) gray_bits, | 582 XCreatePixmapFromBitmapData (dpy, x_win, (char *) gray_bits, |
583 gray_width, gray_height, 1, 0, 1); | 583 gray_width, gray_height, 1, 0, 1); |
584 } | 584 } |
585 | 585 |
586 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, MODELINE_INDEX); | 586 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, findex); |
587 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); | 587 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); |
588 gcv.foreground = tmp_color.pixel; | 588 gcv.foreground = tmp_color.pixel; |
589 /* this is needed because the GC draws with a pixmap here */ | |
589 gcv.fill_style = FillOpaqueStippled; | 590 gcv.fill_style = FillOpaqueStippled; |
590 gcv.stipple = DEVICE_X_GRAY_PIXMAP (d); | 591 gcv.stipple = DEVICE_X_GRAY_PIXMAP (d); |
591 top_shadow_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, | 592 top_shadow_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, |
592 (mask | GCStipple | GCFillStyle)); | 593 (mask | GCStipple | GCFillStyle)); |
593 | 594 |
594 tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, MODELINE_INDEX); | 595 tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, findex); |
595 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); | 596 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); |
596 bottom_shadow_pixel = tmp_color.pixel; | 597 bottom_shadow_pixel = tmp_color.pixel; |
597 | 598 |
598 flip_gcs = (bottom_shadow_pixel == | 599 flip_gcs = (bottom_shadow_pixel == |
599 WhitePixelOfScreen (DefaultScreenOfDisplay (dpy))); | 600 WhitePixelOfScreen (DefaultScreenOfDisplay (dpy))); |
615 } | 616 } |
616 | 617 |
617 gcv.foreground = background_pixel; | 618 gcv.foreground = background_pixel; |
618 background_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask); | 619 background_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask); |
619 | 620 |
620 if (XINT (w->modeline_shadow_thickness) < 0) | 621 /* possibly revert the GC's in case the shadow thickness is < 0. |
622 This will give a depressed look to the divider */ | |
623 if (shadow_thickness < 0) | |
621 { | 624 { |
622 GC temp; | 625 GC temp; |
623 | 626 |
624 temp = top_shadow_gc; | 627 temp = top_shadow_gc; |
625 top_shadow_gc = bottom_shadow_gc; | 628 top_shadow_gc = bottom_shadow_gc; |
626 bottom_shadow_gc = temp; | 629 bottom_shadow_gc = temp; |
627 } | 630 |
628 | 631 /* better avoid a Bad Address XLib error ;-) */ |
629 shadow_thickness = MODELINE_SHADOW_THICKNESS (w); | 632 shadow_thickness = - shadow_thickness; |
630 | 633 } |
631 x = WINDOW_MODELINE_LEFT (w); | 634 |
632 width = WINDOW_MODELINE_RIGHT (w) - x; | 635 /* Draw the shadows around the divider line */ |
633 y = dl->ypos - dl->ascent - shadow_thickness; | 636 x_output_shadows (f, x, y, width, height, |
634 height = dl->ascent + dl->descent + 2 * shadow_thickness; | 637 top_shadow_gc, bottom_shadow_gc, |
635 | |
636 x_output_shadows (f, x, y, width, height, top_shadow_gc, bottom_shadow_gc, | |
637 background_gc, shadow_thickness); | 638 background_gc, shadow_thickness); |
638 } | 639 } |
639 | 640 |
640 /***************************************************************************** | 641 /***************************************************************************** |
641 x_get_gc | 642 x_get_gc |
838 may cause the cache to resize and any pointers to it to | 839 may cause the cache to resize and any pointers to it to |
839 become invalid. */ | 840 become invalid. */ |
840 cachel = WINDOW_FACE_CACHEL (w, findex); | 841 cachel = WINDOW_FACE_CACHEL (w, findex); |
841 } | 842 } |
842 | 843 |
843 #if defined(HAVE_XIM) && defined(XIM_XLIB) | 844 #ifdef HAVE_XIM |
844 if (cursor && focus && (cursor_start == clip_start) && cursor_height) | 845 if (cursor && focus && (cursor_start == clip_start) && cursor_height) |
845 if (FRAME_X_XIC(f)) | 846 XIM_SetSpotLocation (f, xpos - 2, dl->ypos + dl->descent - 2); |
846 XIM_SetSpotLocation (f, xpos - 2, dl->ypos + dl->descent - 2); | 847 #endif /* HAVE_XIM */ |
847 #endif /* HAVE_XIM && XIM_XLIB */ | |
848 | 848 |
849 bg_pmap = cachel->background_pixmap; | 849 bg_pmap = cachel->background_pixmap; |
850 if (!IMAGE_INSTANCEP (bg_pmap) | 850 if (!IMAGE_INSTANCEP (bg_pmap) |
851 || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap))) | 851 || !IMAGE_INSTANCE_PIXMAP_TYPE_P (XIMAGE_INSTANCE (bg_pmap))) |
852 bg_pmap = Qnil; | 852 bg_pmap = Qnil; |
1396 x_output_vertical_divider (struct window *w, int clear) | 1396 x_output_vertical_divider (struct window *w, int clear) |
1397 { | 1397 { |
1398 struct frame *f = XFRAME (w->frame); | 1398 struct frame *f = XFRAME (w->frame); |
1399 struct device *d = XDEVICE (f->device); | 1399 struct device *d = XDEVICE (f->device); |
1400 | 1400 |
1401 EmacsFrame ef = (EmacsFrame) FRAME_X_TEXT_WIDGET (f); | |
1402 Display *dpy = DEVICE_X_DISPLAY (d); | 1401 Display *dpy = DEVICE_X_DISPLAY (d); |
1403 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); | 1402 Window x_win = XtWindow (FRAME_X_TEXT_WIDGET (f)); |
1404 Pixel top_shadow_pixel, bottom_shadow_pixel, background_pixel; | |
1405 Lisp_Object tmp_pixel; | 1403 Lisp_Object tmp_pixel; |
1406 XColor tmp_color; | 1404 XColor tmp_color; |
1407 XGCValues gcv; | 1405 XGCValues gcv; |
1408 GC top_shadow_gc, bottom_shadow_gc, background_gc; | 1406 GC background_gc; |
1409 | 1407 |
1410 int use_pixmap = 0; | |
1411 int flip_gcs = 0; | |
1412 unsigned long mask; | 1408 unsigned long mask; |
1413 int x, y1, y2, width, shadow_thickness, spacing, line_width; | 1409 int x, y1, y2, width, shadow_thickness, spacing, line_width; |
1414 face_index div_face = get_builtin_face_cache_index (w, Vvertical_divider_face); | 1410 face_index div_face = get_builtin_face_cache_index (w, Vvertical_divider_face); |
1415 | 1411 |
1416 width = window_divider_width (w); | 1412 width = window_divider_width (w); |
1417 shadow_thickness = XINT (w->vertical_divider_shadow_thickness); | 1413 shadow_thickness = XINT (w->vertical_divider_shadow_thickness); |
1418 spacing = XINT (w->vertical_divider_spacing); | 1414 spacing = XINT (w->vertical_divider_spacing); |
1419 line_width = XINT (w->vertical_divider_line_width); | 1415 line_width = XINT (w->vertical_divider_line_width); |
1420 x = WINDOW_RIGHT (w) - width; | 1416 x = WINDOW_RIGHT (w) - width; |
1421 y1 = WINDOW_TOP (w); | 1417 y1 = WINDOW_TOP (w) + FRAME_TOP_GUTTER_BOUNDS (f); |
1422 y2 = WINDOW_BOTTOM (w); | 1418 y2 = WINDOW_BOTTOM (w) + FRAME_BOTTOM_GUTTER_BOUNDS (f); |
1423 | 1419 |
1424 memset (&gcv, ~0, sizeof (XGCValues)); | 1420 memset (&gcv, ~0, sizeof (XGCValues)); |
1425 | 1421 |
1426 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face); | 1422 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face); |
1427 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); | 1423 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); |
1428 | 1424 |
1429 /* First, get the GC's. */ | 1425 /* First, get the GC's. */ |
1430 top_shadow_pixel = tmp_color.pixel; | |
1431 bottom_shadow_pixel = tmp_color.pixel; | |
1432 background_pixel = tmp_color.pixel; | |
1433 | |
1434 x_generate_shadow_pixels (f, &top_shadow_pixel, &bottom_shadow_pixel, | |
1435 background_pixel, ef->core.background_pixel); | |
1436 | |
1437 tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, div_face); | |
1438 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); | |
1439 gcv.background = tmp_color.pixel; | 1426 gcv.background = tmp_color.pixel; |
1427 gcv.foreground = tmp_color.pixel; | |
1440 gcv.graphics_exposures = False; | 1428 gcv.graphics_exposures = False; |
1441 mask = GCForeground | GCBackground | GCGraphicsExposures; | 1429 mask = GCForeground | GCBackground | GCGraphicsExposures; |
1442 | |
1443 /* If we can't distinguish one of the shadows (the color is the same as the | |
1444 background), it's better to use a pixmap to generate a dithered gray. */ | |
1445 if (top_shadow_pixel == background_pixel || | |
1446 bottom_shadow_pixel == background_pixel) | |
1447 use_pixmap = 1; | |
1448 | |
1449 if (use_pixmap) | |
1450 { | |
1451 if (DEVICE_X_GRAY_PIXMAP (d) == None) | |
1452 { | |
1453 DEVICE_X_GRAY_PIXMAP (d) = | |
1454 XCreatePixmapFromBitmapData (dpy, x_win, (char *) gray_bits, | |
1455 gray_width, gray_height, 1, 0, 1); | |
1456 } | |
1457 | |
1458 tmp_pixel = WINDOW_FACE_CACHEL_BACKGROUND (w, div_face); | |
1459 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); | |
1460 gcv.foreground = tmp_color.pixel; | |
1461 /* this is needed because the GC draws with a pixmap here */ | |
1462 gcv.fill_style = FillOpaqueStippled; | |
1463 gcv.stipple = DEVICE_X_GRAY_PIXMAP (d); | |
1464 top_shadow_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, | |
1465 (mask | GCStipple | GCFillStyle)); | |
1466 | |
1467 tmp_pixel = WINDOW_FACE_CACHEL_FOREGROUND (w, div_face); | |
1468 tmp_color = COLOR_INSTANCE_X_COLOR (XCOLOR_INSTANCE (tmp_pixel)); | |
1469 bottom_shadow_pixel = tmp_color.pixel; | |
1470 | |
1471 flip_gcs = (bottom_shadow_pixel == | |
1472 WhitePixelOfScreen (DefaultScreenOfDisplay (dpy))); | |
1473 } | |
1474 else | |
1475 { | |
1476 gcv.foreground = top_shadow_pixel; | |
1477 top_shadow_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask); | |
1478 } | |
1479 | |
1480 gcv.foreground = bottom_shadow_pixel; | |
1481 bottom_shadow_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask); | |
1482 | |
1483 if (use_pixmap && flip_gcs) | |
1484 { | |
1485 GC tmp_gc = bottom_shadow_gc; | |
1486 bottom_shadow_gc = top_shadow_gc; | |
1487 top_shadow_gc = tmp_gc; | |
1488 } | |
1489 | |
1490 gcv.foreground = background_pixel; | |
1491 background_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask); | 1430 background_gc = gc_cache_lookup (DEVICE_X_GC_CACHE (d), &gcv, mask); |
1492 | |
1493 /* possibly revert the GC's in case the shadow thickness is < 0. | |
1494 This will give a depressed look to the divider */ | |
1495 if (shadow_thickness < 0) | |
1496 { | |
1497 GC temp; | |
1498 | |
1499 temp = top_shadow_gc; | |
1500 top_shadow_gc = bottom_shadow_gc; | |
1501 bottom_shadow_gc = temp; | |
1502 | |
1503 /* better avoid a Bad Address XLib error ;-) */ | |
1504 shadow_thickness = - shadow_thickness; | |
1505 } | |
1506 | 1431 |
1507 /* Clear the divider area first. This needs to be done when a | 1432 /* Clear the divider area first. This needs to be done when a |
1508 window split occurs. */ | 1433 window split occurs. */ |
1509 if (clear) | 1434 if (clear) |
1510 XClearArea (dpy, x_win, x, y1, width, y2 - y1, False); | 1435 XClearArea (dpy, x_win, x, y1, width, y2 - y1, False); |
1513 XFillRectangle (dpy, x_win, background_gc, | 1438 XFillRectangle (dpy, x_win, background_gc, |
1514 x + spacing + shadow_thickness, y1, | 1439 x + spacing + shadow_thickness, y1, |
1515 line_width, y2 - y1); | 1440 line_width, y2 - y1); |
1516 | 1441 |
1517 /* Draw the shadows around the divider line */ | 1442 /* Draw the shadows around the divider line */ |
1518 x_output_shadows (f, x + spacing, y1, | 1443 x_bevel_area (w, div_face, x + spacing, y1, |
1519 width - 2 * spacing, y2 - y1, | 1444 width - 2 * spacing, y2 - y1, |
1520 top_shadow_gc, bottom_shadow_gc, | 1445 shadow_thickness); |
1521 background_gc, shadow_thickness); | |
1522 } | 1446 } |
1523 | 1447 |
1524 /***************************************************************************** | 1448 /***************************************************************************** |
1525 x_output_blank | 1449 x_output_blank |
1526 | 1450 |
1814 } | 1738 } |
1815 } | 1739 } |
1816 } | 1740 } |
1817 | 1741 |
1818 /***************************************************************************** | 1742 /***************************************************************************** |
1819 x_clear_to_window_end | |
1820 | |
1821 Clear the area between ypos1 and ypos2. Each margin area and the | |
1822 text area is handled separately since they may each have their own | |
1823 background color. | |
1824 ****************************************************************************/ | |
1825 static void | |
1826 x_clear_to_window_end (struct window *w, int ypos1, int ypos2) | |
1827 { | |
1828 int height = ypos2 - ypos1; | |
1829 | |
1830 if (height) | |
1831 { | |
1832 struct frame *f = XFRAME (w->frame); | |
1833 Lisp_Object window; | |
1834 int bflag = (window_needs_vertical_divider (w) ? 0 : 1); | |
1835 layout_bounds bounds; | |
1836 | |
1837 bounds = calculate_display_line_boundaries (w, bflag); | |
1838 XSETWINDOW (window, w); | |
1839 | |
1840 if (window_is_leftmost (w)) | |
1841 redisplay_clear_region (window, DEFAULT_INDEX, FRAME_LEFT_BORDER_START (f), | |
1842 ypos1, FRAME_BORDER_WIDTH (f), height); | |
1843 | |
1844 if (bounds.left_in - bounds.left_out > 0) | |
1845 redisplay_clear_region (window, | |
1846 get_builtin_face_cache_index (w, Vleft_margin_face), | |
1847 bounds.left_out, ypos1, | |
1848 bounds.left_in - bounds.left_out, height); | |
1849 | |
1850 if (bounds.right_in - bounds.left_in > 0) | |
1851 redisplay_clear_region (window, DEFAULT_INDEX, bounds.left_in, ypos1, | |
1852 bounds.right_in - bounds.left_in, height); | |
1853 | |
1854 if (bounds.right_out - bounds.right_in > 0) | |
1855 redisplay_clear_region (window, | |
1856 get_builtin_face_cache_index (w, Vright_margin_face), | |
1857 bounds.right_in, ypos1, | |
1858 bounds.right_out - bounds.right_in, height); | |
1859 | |
1860 if (window_is_rightmost (w)) | |
1861 redisplay_clear_region (window, DEFAULT_INDEX, FRAME_RIGHT_BORDER_START (f), | |
1862 ypos1, FRAME_BORDER_WIDTH (f), height); | |
1863 } | |
1864 } | |
1865 | |
1866 /***************************************************************************** | |
1867 x_redraw_exposed_window | 1743 x_redraw_exposed_window |
1868 | 1744 |
1869 Given a bounding box for an area that needs to be redrawn, determine | 1745 Given a bounding box for an area that needs to be redrawn, determine |
1870 what parts of what lines are contained within and re-output their | 1746 what parts of what lines are contained within and re-output their |
1871 contents. | 1747 contents. |
1978 /* #### We would rather put these off as well but there is currently | 1854 /* #### We would rather put these off as well but there is currently |
1979 no combination of flags which will force an unchanged toolbar to | 1855 no combination of flags which will force an unchanged toolbar to |
1980 redraw anyhow. */ | 1856 redraw anyhow. */ |
1981 MAYBE_FRAMEMETH (f, redraw_exposed_toolbars, (f, x, y, width, height)); | 1857 MAYBE_FRAMEMETH (f, redraw_exposed_toolbars, (f, x, y, width, height)); |
1982 #endif | 1858 #endif |
1859 redraw_exposed_gutters (f, x, y, width, height); | |
1983 | 1860 |
1984 if (!f->window_face_cache_reset) | 1861 if (!f->window_face_cache_reset) |
1985 { | 1862 { |
1986 x_redraw_exposed_windows (f->root_window, x, y, width, height); | 1863 x_redraw_exposed_windows (f->root_window, x, y, width, height); |
1987 | 1864 |
2067 cursor_y = max (y, min (y + height - cursor_height, | 1944 cursor_y = max (y, min (y + height - cursor_height, |
2068 dl->ypos - defascent)); | 1945 dl->ypos - defascent)); |
2069 | 1946 |
2070 if (focus) | 1947 if (focus) |
2071 { | 1948 { |
2072 #if defined(HAVE_XIM) && defined(XIM_XLIB) | 1949 #ifdef HAVE_XIM |
2073 if (FRAME_X_XIC(f)) | 1950 XIM_SetSpotLocation (f, x - 2 , cursor_y + cursor_height - 2); |
2074 XIM_SetSpotLocation (f, x - 2 , cursor_y + cursor_height - 2); | |
2075 #endif /* HAVE_XIM */ | 1951 #endif /* HAVE_XIM */ |
2076 | 1952 |
2077 if (NILP (bar_cursor_value)) | 1953 if (NILP (bar_cursor_value)) |
2078 { | 1954 { |
2079 XFillRectangle (dpy, x_win, gc, x, cursor_y, width, cursor_height); | 1955 XFillRectangle (dpy, x_win, gc, x, cursor_y, width, cursor_height); |
2110 { | 1986 { |
2111 x_clear_frame_windows (w->hchild); | 1987 x_clear_frame_windows (w->hchild); |
2112 return; | 1988 return; |
2113 } | 1989 } |
2114 | 1990 |
2115 x_clear_to_window_end (w, WINDOW_TEXT_TOP (w), WINDOW_TEXT_BOTTOM (w)); | 1991 redisplay_clear_to_window_end (w, WINDOW_TEXT_TOP (w), |
1992 WINDOW_TEXT_BOTTOM (w)); | |
2116 } | 1993 } |
2117 | 1994 |
2118 static void | 1995 static void |
2119 x_clear_frame_windows (Lisp_Object window) | 1996 x_clear_frame_windows (Lisp_Object window) |
2120 { | 1997 { |
2267 CONSOLE_HAS_METHOD (x, text_width); | 2144 CONSOLE_HAS_METHOD (x, text_width); |
2268 CONSOLE_HAS_METHOD (x, output_display_block); | 2145 CONSOLE_HAS_METHOD (x, output_display_block); |
2269 CONSOLE_HAS_METHOD (x, divider_height); | 2146 CONSOLE_HAS_METHOD (x, divider_height); |
2270 CONSOLE_HAS_METHOD (x, eol_cursor_width); | 2147 CONSOLE_HAS_METHOD (x, eol_cursor_width); |
2271 CONSOLE_HAS_METHOD (x, output_vertical_divider); | 2148 CONSOLE_HAS_METHOD (x, output_vertical_divider); |
2272 CONSOLE_HAS_METHOD (x, clear_to_window_end); | |
2273 CONSOLE_HAS_METHOD (x, clear_region); | 2149 CONSOLE_HAS_METHOD (x, clear_region); |
2274 CONSOLE_HAS_METHOD (x, clear_frame); | 2150 CONSOLE_HAS_METHOD (x, clear_frame); |
2275 CONSOLE_HAS_METHOD (x, output_begin); | 2151 CONSOLE_HAS_METHOD (x, output_begin); |
2276 CONSOLE_HAS_METHOD (x, output_end); | 2152 CONSOLE_HAS_METHOD (x, output_end); |
2277 CONSOLE_HAS_METHOD (x, flash); | 2153 CONSOLE_HAS_METHOD (x, flash); |
2278 CONSOLE_HAS_METHOD (x, ring_bell); | 2154 CONSOLE_HAS_METHOD (x, ring_bell); |
2279 } | 2155 CONSOLE_HAS_METHOD (x, bevel_area); |
2156 } |