62 |
#define BETWEEN(X, LOWER, UPPER) ((X) >= (LOWER) && (X) < (UPPER)) |
#define BETWEEN(X, LOWER, UPPER) ((X) >= (LOWER) && (X) < (UPPER)) |
63 |
|
|
64 |
|
|
65 |
/* Bitmaps for truncated lines. */ |
/* Fringe bitmaps. */ |
66 |
|
|
67 |
enum bitmap_type |
enum fringe_bitmap_type |
68 |
{ |
{ |
69 |
NO_BITMAP, |
NO_FRINGE_BITMAP, |
70 |
LEFT_TRUNCATION_BITMAP, |
LEFT_TRUNCATION_BITMAP, |
71 |
RIGHT_TRUNCATION_BITMAP, |
RIGHT_TRUNCATION_BITMAP, |
72 |
OVERLAY_ARROW_BITMAP, |
OVERLAY_ARROW_BITMAP, |
401 |
static void x_erase_phys_cursor P_ ((struct window *)); |
static void x_erase_phys_cursor P_ ((struct window *)); |
402 |
void x_display_cursor P_ ((struct window *w, int, int, int, int, int)); |
void x_display_cursor P_ ((struct window *w, int, int, int, int, int)); |
403 |
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)); |
404 |
static void w32_draw_bitmap P_ ((struct window *, HDC hdc, struct glyph_row *, |
static void w32_draw_fringe_bitmap P_ ((struct window *, HDC hdc, struct glyph_row *, |
405 |
enum bitmap_type)); |
enum fringe_bitmap_type)); |
406 |
static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, |
static void w32_clip_to_row P_ ((struct window *, struct glyph_row *, |
407 |
HDC, int)); |
HDC, int)); |
408 |
static int x_phys_cursor_in_rect_p P_ ((struct window *, RECT *)); |
static int x_phys_cursor_in_rect_p P_ ((struct window *, RECT *)); |
409 |
static void x_draw_row_bitmaps P_ ((struct window *, struct glyph_row *)); |
static void x_draw_row_fringe_bitmaps P_ ((struct window *, struct glyph_row *)); |
410 |
static void note_overwritten_text_cursor P_ ((struct window *, int, int)); |
static void note_overwritten_text_cursor P_ ((struct window *, int, int)); |
411 |
|
|
412 |
static Lisp_Object Qvendor_specific_keysyms; |
static Lisp_Object Qvendor_specific_keysyms; |
650 |
|
|
651 |
window_box_edges (w, -1, (int *) &r.left, (int *) &r.top, |
window_box_edges (w, -1, (int *) &r.left, (int *) &r.top, |
652 |
(int *) &r.right, (int *) &r.bottom); |
(int *) &r.right, (int *) &r.bottom); |
653 |
r.left = r.right + FRAME_X_RIGHT_FLAGS_AREA_WIDTH (f); |
r.left = r.right + FRAME_X_RIGHT_FRINGE_WIDTH (f); |
654 |
r.right = r.left + 1; |
r.right = r.left + 1; |
655 |
r.bottom -= 1; |
r.bottom -= 1; |
656 |
|
|
750 |
|
|
751 |
|
|
752 |
/* Draw truncation mark bitmaps, continuation mark bitmaps, overlay |
/* Draw truncation mark bitmaps, continuation mark bitmaps, overlay |
753 |
arrow bitmaps, or clear the areas where they would be displayed |
arrow bitmaps, or clear the fringes if no bitmaps are required |
754 |
before DESIRED_ROW is made current. The window being updated is |
before DESIRED_ROW is made current. The window being updated is |
755 |
found in updated_window. This function It is called from |
found in updated_window. This function It is called from |
756 |
update_window_line only if it is known that there are differences |
update_window_line only if it is known that there are differences |
770 |
int width; |
int width; |
771 |
|
|
772 |
BLOCK_INPUT; |
BLOCK_INPUT; |
773 |
x_draw_row_bitmaps (w, desired_row); |
x_draw_row_fringe_bitmaps (w, desired_row); |
774 |
|
|
775 |
/* When a window has disappeared, make sure that no rest of |
/* When a window has disappeared, make sure that no rest of |
776 |
full-width rows stays visible in the internal border. */ |
full-width rows stays visible in the internal border. */ |
781 |
{ |
{ |
782 |
int height = desired_row->visible_height; |
int height = desired_row->visible_height; |
783 |
int x = (window_box_right (w, -1) |
int x = (window_box_right (w, -1) |
784 |
+ FRAME_X_RIGHT_FLAGS_AREA_WIDTH (f)); |
+ FRAME_X_RIGHT_FRINGE_WIDTH (f)); |
785 |
int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); |
int y = WINDOW_TO_FRAME_PIXEL_Y (w, max (0, desired_row->y)); |
786 |
HDC hdc = get_frame_dc (f); |
HDC hdc = get_frame_dc (f); |
787 |
|
|
794 |
} |
} |
795 |
|
|
796 |
|
|
797 |
/* Draw the bitmap WHICH in one of the areas to the left or right of |
/* Draw the bitmap WHICH in one of the left or right fringes of |
798 |
window W. ROW is the glyph row for which to display the bitmap; it |
window W. ROW is the glyph row for which to display the bitmap; it |
799 |
determines the vertical position at which the bitmap has to be |
determines the vertical position at which the bitmap has to be |
800 |
drawn. */ |
drawn. */ |
801 |
|
|
802 |
static void |
static void |
803 |
w32_draw_bitmap (w, hdc, row, which) |
w32_draw_fringe_bitmap (w, hdc, row, which) |
804 |
struct window *w; |
struct window *w; |
805 |
HDC hdc; |
HDC hdc; |
806 |
struct glyph_row *row; |
struct glyph_row *row; |
807 |
enum bitmap_type which; |
enum fringe_bitmap_type which; |
808 |
{ |
{ |
809 |
struct frame *f = XFRAME (WINDOW_FRAME (w)); |
struct frame *f = XFRAME (WINDOW_FRAME (w)); |
810 |
Window window = FRAME_W32_WINDOW (f); |
Window window = FRAME_W32_WINDOW (f); |
825 |
pixmap = left_bmp; |
pixmap = left_bmp; |
826 |
x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) |
x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) |
827 |
- wd |
- wd |
828 |
- (FRAME_X_LEFT_FLAGS_AREA_WIDTH (f) - wd) / 2); |
- (FRAME_X_LEFT_FRINGE_WIDTH (f) - wd) / 2); |
829 |
break; |
break; |
830 |
|
|
831 |
case OVERLAY_ARROW_BITMAP: |
case OVERLAY_ARROW_BITMAP: |
834 |
pixmap = ov_bmp; |
pixmap = ov_bmp; |
835 |
x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) |
x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) |
836 |
- wd |
- wd |
837 |
- (FRAME_X_LEFT_FLAGS_AREA_WIDTH (f) - wd) / 2); |
- (FRAME_X_LEFT_FRINGE_WIDTH (f) - wd) / 2); |
838 |
break; |
break; |
839 |
|
|
840 |
case RIGHT_TRUNCATION_BITMAP: |
case RIGHT_TRUNCATION_BITMAP: |
842 |
h = right_height; |
h = right_height; |
843 |
pixmap = right_bmp; |
pixmap = right_bmp; |
844 |
x = window_box_right (w, -1); |
x = window_box_right (w, -1); |
845 |
x += (FRAME_X_RIGHT_FLAGS_AREA_WIDTH (f) - wd) / 2; |
x += (FRAME_X_RIGHT_FRINGE_WIDTH (f) - wd) / 2; |
846 |
break; |
break; |
847 |
|
|
848 |
case CONTINUED_LINE_BITMAP: |
case CONTINUED_LINE_BITMAP: |
850 |
h = continued_height; |
h = continued_height; |
851 |
pixmap = continued_bmp; |
pixmap = continued_bmp; |
852 |
x = window_box_right (w, -1); |
x = window_box_right (w, -1); |
853 |
x += (FRAME_X_RIGHT_FLAGS_AREA_WIDTH (f) - wd) / 2; |
x += (FRAME_X_RIGHT_FRINGE_WIDTH (f) - wd) / 2; |
854 |
break; |
break; |
855 |
|
|
856 |
case CONTINUATION_LINE_BITMAP: |
case CONTINUATION_LINE_BITMAP: |
859 |
pixmap = continuation_bmp; |
pixmap = continuation_bmp; |
860 |
x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) |
x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) |
861 |
- wd |
- wd |
862 |
- (FRAME_X_LEFT_FLAGS_AREA_WIDTH (f) - wd) / 2); |
- (FRAME_X_LEFT_FRINGE_WIDTH (f) - wd) / 2); |
863 |
break; |
break; |
864 |
|
|
865 |
case ZV_LINE_BITMAP: |
case ZV_LINE_BITMAP: |
868 |
pixmap = zv_bmp; |
pixmap = zv_bmp; |
869 |
x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) |
x = (WINDOW_TO_FRAME_PIXEL_X (w, 0) |
870 |
- wd |
- wd |
871 |
- (FRAME_X_LEFT_FLAGS_AREA_WIDTH (f) - wd) / 2); |
- (FRAME_X_LEFT_FRINGE_WIDTH (f) - wd) / 2); |
872 |
break; |
break; |
873 |
|
|
874 |
default: |
default: |
881 |
dy = (row->height - h) / 2; |
dy = (row->height - h) / 2; |
882 |
|
|
883 |
/* Draw the bitmap. */ |
/* Draw the bitmap. */ |
884 |
face = FACE_FROM_ID (f, BITMAP_AREA_FACE_ID); |
face = FACE_FROM_ID (f, FRINGE_FACE_ID); |
885 |
|
|
886 |
compat_hdc = CreateCompatibleDC (hdc); |
compat_hdc = CreateCompatibleDC (hdc); |
887 |
SaveDC (hdc); |
SaveDC (hdc); |
898 |
} |
} |
899 |
|
|
900 |
|
|
901 |
/* Draw flags bitmaps for glyph row ROW on window W. Call this |
/* Draw fringe bitmaps for glyph row ROW on window W. Call this |
902 |
function with input blocked. */ |
function with input blocked. */ |
903 |
|
|
904 |
static void |
static void |
905 |
x_draw_row_bitmaps (w, row) |
x_draw_row_fringe_bitmaps (w, row) |
906 |
struct window *w; |
struct window *w; |
907 |
struct glyph_row *row; |
struct glyph_row *row; |
908 |
{ |
{ |
909 |
struct frame *f = XFRAME (w->frame); |
struct frame *f = XFRAME (w->frame); |
910 |
enum bitmap_type bitmap; |
enum fringe_bitmap_type bitmap; |
911 |
struct face *face; |
struct face *face; |
912 |
int header_line_height = -1; |
int header_line_height = -1; |
913 |
HDC hdc; |
HDC hdc; |
919 |
if (row->visible_height <= 0) |
if (row->visible_height <= 0) |
920 |
return; |
return; |
921 |
|
|
922 |
face = FACE_FROM_ID (f, BITMAP_AREA_FACE_ID); |
face = FACE_FROM_ID (f, FRINGE_FACE_ID); |
923 |
PREPARE_FACE_FOR_DISPLAY (f, face); |
PREPARE_FACE_FOR_DISPLAY (f, face); |
924 |
|
|
925 |
/* Decide which bitmap to draw at the left side. */ |
/* Decide which bitmap to draw in the left fringe. */ |
926 |
if (row->overlay_arrow_p) |
if (row->overlay_arrow_p) |
927 |
bitmap = OVERLAY_ARROW_BITMAP; |
bitmap = OVERLAY_ARROW_BITMAP; |
928 |
else if (row->truncated_on_left_p) |
else if (row->truncated_on_left_p) |
932 |
else if (row->indicate_empty_line_p) |
else if (row->indicate_empty_line_p) |
933 |
bitmap = ZV_LINE_BITMAP; |
bitmap = ZV_LINE_BITMAP; |
934 |
else |
else |
935 |
bitmap = NO_BITMAP; |
bitmap = NO_FRINGE_BITMAP; |
936 |
|
|
937 |
hdc = get_frame_dc (f); |
hdc = get_frame_dc (f); |
938 |
|
|
939 |
/* Clear flags area if no bitmap to draw or if bitmap doesn't fill |
/* Clear left fringe if no bitmap to draw or if bitmap doesn't fill |
940 |
the flags area. */ |
the fringe. */ |
941 |
if (bitmap == NO_BITMAP |
if (bitmap == NO_FRINGE_BITMAP |
942 |
|| FRAME_FLAGS_BITMAP_WIDTH (f) < FRAME_X_LEFT_FLAGS_AREA_WIDTH (f) |
|| FRAME_FRINGE_BITMAP_WIDTH (f) < FRAME_X_LEFT_FRINGE_WIDTH (f) |
943 |
|| row->height > FRAME_FLAGS_BITMAP_HEIGHT (f)) |
|| row->height > FRAME_FRINGE_BITMAP_HEIGHT (f)) |
944 |
{ |
{ |
945 |
/* If W has a vertical border to its left, don't draw over it. */ |
/* If W has a vertical border to its left, don't draw over it. */ |
946 |
int border = ((XFASTINT (w->left) > 0 |
int border = ((XFASTINT (w->left) > 0 |
952 |
header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); |
header_line_height = WINDOW_DISPLAY_HEADER_LINE_HEIGHT (w); |
953 |
|
|
954 |
w32_fill_area (f, hdc, face->background, |
w32_fill_area (f, hdc, face->background, |
955 |
left - FRAME_X_LEFT_FLAGS_AREA_WIDTH (f) + border, |
left - FRAME_X_LEFT_FRINGE_WIDTH (f) + border, |
956 |
WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, |
WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, |
957 |
row->y)), |
row->y)), |
958 |
FRAME_X_LEFT_FLAGS_AREA_WIDTH (f) - border, |
FRAME_X_LEFT_FRINGE_WIDTH (f) - border, |
959 |
row->visible_height); |
row->visible_height); |
960 |
} |
} |
961 |
|
|
962 |
/* Draw the left bitmap. */ |
/* Draw the left bitmap. */ |
963 |
if (bitmap != NO_BITMAP) |
if (bitmap != NO_FRINGE_BITMAP) |
964 |
w32_draw_bitmap (w, hdc, row, bitmap); |
w32_draw_fringe_bitmap (w, hdc, row, bitmap); |
965 |
|
|
966 |
/* Decide which bitmap to draw at the right side. */ |
/* Decide which bitmap to draw in the right fringe. */ |
967 |
if (row->truncated_on_right_p) |
if (row->truncated_on_right_p) |
968 |
bitmap = RIGHT_TRUNCATION_BITMAP; |
bitmap = RIGHT_TRUNCATION_BITMAP; |
969 |
else if (row->continued_p) |
else if (row->continued_p) |
970 |
bitmap = CONTINUED_LINE_BITMAP; |
bitmap = CONTINUED_LINE_BITMAP; |
971 |
else |
else |
972 |
bitmap = NO_BITMAP; |
bitmap = NO_FRINGE_BITMAP; |
973 |
|
|
974 |
/* Clear flags area if no bitmap to draw of if bitmap doesn't fill |
/* Clear right fringe if no bitmap to draw of if bitmap doesn't fill |
975 |
the flags area. */ |
the fringe. */ |
976 |
if (bitmap == NO_BITMAP |
if (bitmap == NO_FRINGE_BITMAP |
977 |
|| FRAME_FLAGS_BITMAP_WIDTH (f) < FRAME_X_RIGHT_FLAGS_AREA_WIDTH (f) |
|| FRAME_FRINGE_BITMAP_WIDTH (f) < FRAME_X_RIGHT_FRINGE_WIDTH (f) |
978 |
|| row->height > FRAME_FLAGS_BITMAP_HEIGHT (f)) |
|| row->height > FRAME_FRINGE_BITMAP_HEIGHT (f)) |
979 |
{ |
{ |
980 |
int right = window_box_right (w, -1); |
int right = window_box_right (w, -1); |
981 |
|
|
986 |
right, |
right, |
987 |
WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, |
WINDOW_TO_FRAME_PIXEL_Y (w, max (header_line_height, |
988 |
row->y)), |
row->y)), |
989 |
FRAME_X_RIGHT_FLAGS_AREA_WIDTH (f), |
FRAME_X_RIGHT_FRINGE_WIDTH (f), |
990 |
row->visible_height); |
row->visible_height); |
991 |
} |
} |
992 |
|
|
993 |
/* Draw the right bitmap. */ |
/* Draw the right bitmap. */ |
994 |
if (bitmap != NO_BITMAP) |
if (bitmap != NO_FRINGE_BITMAP) |
995 |
w32_draw_bitmap (w, hdc, row, bitmap); |
w32_draw_fringe_bitmap (w, hdc, row, bitmap); |
996 |
|
|
997 |
release_frame_dc (f, hdc); |
release_frame_dc (f, hdc); |
998 |
} |
} |
3754 |
if (s->row->full_width_p |
if (s->row->full_width_p |
3755 |
&& !s->w->pseudo_window_p) |
&& !s->w->pseudo_window_p) |
3756 |
{ |
{ |
3757 |
last_x += FRAME_X_RIGHT_FLAGS_AREA_WIDTH (s->f); |
last_x += FRAME_X_RIGHT_FRINGE_WIDTH (s->f); |
3758 |
if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (s->f)) |
if (FRAME_HAS_VERTICAL_SCROLL_BARS_ON_RIGHT (s->f)) |
3759 |
last_x += FRAME_SCROLL_BAR_WIDTH (s->f) * CANON_X_UNIT (s->f); |
last_x += FRAME_SCROLL_BAR_WIDTH (s->f) * CANON_X_UNIT (s->f); |
3760 |
} |
} |
4893 |
if (row->full_width_p) |
if (row->full_width_p) |
4894 |
{ |
{ |
4895 |
/* X is relative to the left edge of W, without scroll bars |
/* X is relative to the left edge of W, without scroll bars |
4896 |
or flag areas. */ |
or fringes. */ |
4897 |
struct frame *f = XFRAME (WINDOW_FRAME (w)); |
struct frame *f = XFRAME (WINDOW_FRAME (w)); |
4898 |
/* int width = FRAME_FLAGS_AREA_WIDTH (f); */ |
/* int width = FRAME_FRINGE_WIDTH (f); */ |
4899 |
int window_left_x = WINDOW_LEFT_MARGIN (w) * CANON_X_UNIT (f); |
int window_left_x = WINDOW_LEFT_MARGIN (w) * CANON_X_UNIT (f); |
4900 |
|
|
4901 |
x += window_left_x; |
x += window_left_x; |
5400 |
HDC hdc = get_frame_dc (f); |
HDC hdc = get_frame_dc (f); |
5401 |
|
|
5402 |
/* Get frame-relative bounding box of the text display area of W, |
/* Get frame-relative bounding box of the text display area of W, |
5403 |
without mode lines. Include in this box the flags areas to the |
without mode lines. Include in this box the left and right |
5404 |
left and right of W. */ |
fringes of W. */ |
5405 |
window_box (w, -1, &x, &y, &width, &height); |
window_box (w, -1, &x, &y, &width, &height); |
5406 |
width += FRAME_X_FLAGS_AREA_WIDTH (f); |
width += FRAME_X_FRINGE_WIDTH (f); |
5407 |
x -= FRAME_X_LEFT_FLAGS_AREA_WIDTH (f); |
x -= FRAME_X_LEFT_FRINGE_WIDTH (f); |
5408 |
|
|
5409 |
from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y); |
from_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->current_y); |
5410 |
to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y); |
to_y = WINDOW_TO_FRAME_PIXEL_Y (w, run->desired_y); |
5643 |
expose_area (w, row, r, TEXT_AREA); |
expose_area (w, row, r, TEXT_AREA); |
5644 |
if (row->used[RIGHT_MARGIN_AREA]) |
if (row->used[RIGHT_MARGIN_AREA]) |
5645 |
expose_area (w, row, r, RIGHT_MARGIN_AREA); |
expose_area (w, row, r, RIGHT_MARGIN_AREA); |
5646 |
x_draw_row_bitmaps (w, row); |
x_draw_row_fringe_bitmaps (w, row); |
5647 |
} |
} |
5648 |
|
|
5649 |
return row->mouse_face_p; |
return row->mouse_face_p; |
6342 |
/* Take proper action when mouse has moved to the mode or header line of |
/* Take proper action when mouse has moved to the mode or header line of |
6343 |
window W, x-position X. MODE_LINE_P non-zero means mouse is on the |
window W, x-position X. MODE_LINE_P non-zero means mouse is on the |
6344 |
mode line. X is relative to the start of the text display area of |
mode line. X is relative to the start of the text display area of |
6345 |
W, so the width of bitmap areas and scroll bars must be subtracted |
W, so the width of fringes and scroll bars must be subtracted |
6346 |
to get a position relative to the start of the mode line. */ |
to get a position relative to the start of the mode line. */ |
6347 |
|
|
6348 |
static void |
static void |
6370 |
glyph = row->glyphs[TEXT_AREA]; |
glyph = row->glyphs[TEXT_AREA]; |
6371 |
end = glyph + row->used[TEXT_AREA]; |
end = glyph + row->used[TEXT_AREA]; |
6372 |
x0 = - (FRAME_LEFT_SCROLL_BAR_WIDTH (f) * CANON_X_UNIT (f) |
x0 = - (FRAME_LEFT_SCROLL_BAR_WIDTH (f) * CANON_X_UNIT (f) |
6373 |
+ FRAME_X_LEFT_FLAGS_AREA_WIDTH (f)); |
+ FRAME_X_LEFT_FRINGE_WIDTH (f)); |
6374 |
|
|
6375 |
while (glyph < end |
while (glyph < end |
6376 |
&& x >= x0 + glyph->pixel_width) |
&& x >= x0 + glyph->pixel_width) |
9203 |
the rectangle to the left and increase its width. */ |
the rectangle to the left and increase its width. */ |
9204 |
if (whole_line_p) |
if (whole_line_p) |
9205 |
{ |
{ |
9206 |
clip_rect.left -= FRAME_X_LEFT_FLAGS_AREA_WIDTH (f); |
clip_rect.left -= FRAME_X_LEFT_FRINGE_WIDTH (f); |
9207 |
clip_rect.right += FRAME_X_FLAGS_AREA_WIDTH (f); |
clip_rect.right += FRAME_X_FRINGE_WIDTH (f); |
9208 |
} |
} |
9209 |
|
|
9210 |
w32_set_clip_rectangle (hdc, &clip_rect); |
w32_set_clip_rectangle (hdc, &clip_rect); |
10021 |
= (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) |
= (!FRAME_HAS_VERTICAL_SCROLL_BARS (f) |
10022 |
? 0 |
? 0 |
10023 |
: (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font))); |
: (FRAME_SCROLL_BAR_COLS (f) * FONT_WIDTH (f->output_data.w32->font))); |
10024 |
f->output_data.w32->flags_areas_extra |
f->output_data.w32->fringes_extra |
10025 |
= FRAME_FLAGS_AREA_WIDTH (f); |
= FRAME_FRINGE_WIDTH (f); |
10026 |
pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); |
pixelwidth = CHAR_TO_PIXEL_WIDTH (f, cols); |
10027 |
pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); |
pixelheight = CHAR_TO_PIXEL_HEIGHT (f, rows); |
10028 |
|
|