Mercurial > emacs
comparison src/msdos.c @ 51201:df6e2df16eb0
Make (several) trivial substitutions for renamed and
new macros in dispextern.h, frame.h and window.h.
(IT_note_mouse_highlight): Use updated window coordinates returned
by window_from_coordinates, rather than adjusting them locally.
(internal_terminal_init): No need to initialize line_height here;
it now defaults to 1.
author | Kim F. Storm <storm@cua.dk> |
---|---|
date | Sat, 24 May 2003 22:02:52 +0000 |
parents | f9447a2e045c |
children | 904f120f283f |
comparison
equal
deleted
inserted
replaced
51200:be76b5735f96 | 51201:df6e2df16eb0 |
---|---|
1258 /* Record that some glyphs of this row are displayed in | 1258 /* Record that some glyphs of this row are displayed in |
1259 mouse-face. */ | 1259 mouse-face. */ |
1260 row->mouse_face_p = hl > 0; | 1260 row->mouse_face_p = hl > 0; |
1261 if (hl > 0) | 1261 if (hl > 0) |
1262 { | 1262 { |
1263 int vpos = row->y + WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y (w); | 1263 int vpos = row->y + WINDOW_TOP_EDGE_Y (w); |
1264 int kstart = start_hpos + WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X (w); | 1264 int kstart = start_hpos + WINDOW_LEFT_EDGE_X (w); |
1265 int nglyphs = end_hpos - start_hpos; | 1265 int nglyphs = end_hpos - start_hpos; |
1266 int offset = ScreenPrimary + 2*(vpos*screen_size_X + kstart) + 1; | 1266 int offset = ScreenPrimary + 2*(vpos*screen_size_X + kstart) + 1; |
1267 int start_offset = offset; | 1267 int start_offset = offset; |
1268 | 1268 |
1269 if (termscript) | 1269 if (termscript) |
1301 nglyphs = row->used[TEXT_AREA] - start_hpos; | 1301 nglyphs = row->used[TEXT_AREA] - start_hpos; |
1302 | 1302 |
1303 /* IT_write_glyphs writes at cursor position, so we need to | 1303 /* IT_write_glyphs writes at cursor position, so we need to |
1304 temporarily move cursor coordinates to the beginning of | 1304 temporarily move cursor coordinates to the beginning of |
1305 the highlight region. */ | 1305 the highlight region. */ |
1306 new_pos_X = start_hpos + WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X (w); | 1306 new_pos_X = start_hpos + WINDOW_LEFT_EDGE_X (w); |
1307 new_pos_Y = row->y + WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y (w); | 1307 new_pos_Y = row->y + WINDOW_TOP_EDGE_Y (w); |
1308 | 1308 |
1309 if (termscript) | 1309 if (termscript) |
1310 fprintf (termscript, "<MH- %d-%d:%d>", | 1310 fprintf (termscript, "<MH- %d-%d:%d>", |
1311 new_pos_X, new_pos_X + nglyphs - 1, new_pos_Y); | 1311 new_pos_X, new_pos_X + nglyphs - 1, new_pos_Y); |
1312 IT_write_glyphs (row->glyphs[TEXT_AREA] + start_hpos, nglyphs); | 1312 IT_write_glyphs (row->glyphs[TEXT_AREA] + start_hpos, nglyphs); |
1431 extern Lisp_Object Qhelp_echo; | 1431 extern Lisp_Object Qhelp_echo; |
1432 struct glyph *glyph, *end; | 1432 struct glyph *glyph, *end; |
1433 Lisp_Object help, map; | 1433 Lisp_Object help, map; |
1434 | 1434 |
1435 /* Find the glyph under X. */ | 1435 /* Find the glyph under X. */ |
1436 glyph = row->glyphs[TEXT_AREA] | 1436 glyph = (row->glyphs[TEXT_AREA] |
1437 + x - FRAME_LEFT_SCROLL_BAR_WIDTH (f) * CANON_X_UNIT (f); | 1437 + x |
1438 /* Does MS-DOG really support scroll-bars?? ++KFS */ | |
1439 - WINDOW_LEFT_SCROLL_BAR_AREA_WIDTH (w)); | |
1438 end = glyph + row->used[TEXT_AREA]; | 1440 end = glyph + row->used[TEXT_AREA]; |
1439 if (glyph < end | 1441 if (glyph < end |
1440 && STRINGP (glyph->object) | 1442 && STRINGP (glyph->object) |
1441 && STRING_INTERVALS (glyph->object) | 1443 && STRING_INTERVALS (glyph->object) |
1442 && glyph->charpos >= 0 | 1444 && glyph->charpos >= 0 |
1490 dpyinfo->mouse_face_deferred_gc = 1; | 1492 dpyinfo->mouse_face_deferred_gc = 1; |
1491 return; | 1493 return; |
1492 } | 1494 } |
1493 | 1495 |
1494 /* Which window is that in? */ | 1496 /* Which window is that in? */ |
1495 window = window_from_coordinates (f, x, y, &part, 0); | 1497 window = window_from_coordinates (f, x, y, &part, &x, &y, 0); |
1496 | 1498 |
1497 /* If we were displaying active text in another window, clear that. */ | 1499 /* If we were displaying active text in another window, clear that. */ |
1498 if (! EQ (window, dpyinfo->mouse_face_window)) | 1500 if (! EQ (window, dpyinfo->mouse_face_window)) |
1499 clear_mouse_face (dpyinfo); | 1501 clear_mouse_face (dpyinfo); |
1500 | 1502 |
1502 if (!WINDOWP (window)) | 1504 if (!WINDOWP (window)) |
1503 return; | 1505 return; |
1504 | 1506 |
1505 /* Convert to window-relative coordinates. */ | 1507 /* Convert to window-relative coordinates. */ |
1506 w = XWINDOW (window); | 1508 w = XWINDOW (window); |
1507 x -= WINDOW_DISPLAY_LEFT_EDGE_PIXEL_X (w); | |
1508 y -= WINDOW_DISPLAY_TOP_EDGE_PIXEL_Y (w); | |
1509 | 1509 |
1510 if (part == ON_MODE_LINE || part == ON_HEADER_LINE) | 1510 if (part == ON_MODE_LINE || part == ON_HEADER_LINE) |
1511 { | 1511 { |
1512 /* Mouse is on the mode or top line. */ | 1512 /* Mouse is on the mode or top line. */ |
1513 IT_note_mode_line_highlight (w, x, part == ON_MODE_LINE); | 1513 IT_note_mode_line_highlight (w, x, part == ON_MODE_LINE); |
1514 return; | 1514 return; |
1515 } | 1515 } |
1516 else | 1516 |
1517 IT_set_mouse_pointer (0); | 1517 IT_set_mouse_pointer (0); |
1518 | 1518 |
1519 /* Are we in a window whose display is up to date? | 1519 /* Are we in a window whose display is up to date? |
1520 And verify the buffer's text has not changed. */ | 1520 And verify the buffer's text has not changed. */ |
1521 if (part == ON_TEXT | 1521 if (part == ON_TEXT |
1522 && EQ (w->window_end_valid, w->buffer) | 1522 && EQ (w->window_end_valid, w->buffer) |
1879 if (update_cursor_pos && previous_pos_X >= 0) | 1879 if (update_cursor_pos && previous_pos_X >= 0) |
1880 previous_pos_X = -1; | 1880 previous_pos_X = -1; |
1881 /* If we are in the echo area, put the cursor at the | 1881 /* If we are in the echo area, put the cursor at the |
1882 end of the echo area message. */ | 1882 end of the echo area message. */ |
1883 if (!update_cursor_pos | 1883 if (!update_cursor_pos |
1884 && XFASTINT (XWINDOW (FRAME_MINIBUF_WINDOW (f))->top) <= new_pos_Y) | 1884 && WINDOW_TOP_EDGE_LINE (XWINDOW (FRAME_MINIBUF_WINDOW (f))) <= new_pos_Y) |
1885 { | 1885 { |
1886 int tem_X = current_pos_X, dummy; | 1886 int tem_X = current_pos_X, dummy; |
1887 | 1887 |
1888 if (echo_area_glyphs) | 1888 if (echo_area_glyphs) |
1889 { | 1889 { |
2546 else if (isxdigit (colors[1])) | 2546 else if (isxdigit (colors[1])) |
2547 colors[1] -= (isupper (colors[1]) ? 'A' : 'a') - 10; | 2547 colors[1] -= (isupper (colors[1]) ? 'A' : 'a') - 10; |
2548 if (colors[1] >= 0 && colors[1] < 16) | 2548 if (colors[1] >= 0 && colors[1] < 16) |
2549 the_only_x_display.background_pixel = colors[1]; | 2549 the_only_x_display.background_pixel = colors[1]; |
2550 } | 2550 } |
2551 the_only_x_display.line_height = 1; | |
2552 the_only_x_display.font = (XFontStruct *)1; /* must *not* be zero */ | 2551 the_only_x_display.font = (XFontStruct *)1; /* must *not* be zero */ |
2553 the_only_x_display.display_info.mouse_face_mouse_frame = NULL; | 2552 the_only_x_display.display_info.mouse_face_mouse_frame = NULL; |
2554 the_only_x_display.display_info.mouse_face_deferred_gc = 0; | 2553 the_only_x_display.display_info.mouse_face_deferred_gc = 0; |
2555 the_only_x_display.display_info.mouse_face_beg_row = | 2554 the_only_x_display.display_info.mouse_face_beg_row = |
2556 the_only_x_display.display_info.mouse_face_beg_col = -1; | 2555 the_only_x_display.display_info.mouse_face_beg_col = -1; |
3381 if (mouse_autoselect_window) | 3380 if (mouse_autoselect_window) |
3382 { | 3381 { |
3383 mouse_window = window_from_coordinates (SELECTED_FRAME(), | 3382 mouse_window = window_from_coordinates (SELECTED_FRAME(), |
3384 mouse_last_x, | 3383 mouse_last_x, |
3385 mouse_last_y, | 3384 mouse_last_y, |
3386 0, 0); | 3385 0, 0, 0, 0); |
3387 /* A window will be selected only when it is not | 3386 /* A window will be selected only when it is not |
3388 selected now, and the last mouse movement event was | 3387 selected now, and the last mouse movement event was |
3389 not in it. A minibuffer window will be selected iff | 3388 not in it. A minibuffer window will be selected iff |
3390 it is active. */ | 3389 it is active. */ |
3391 if (WINDOWP (mouse_window) | 3390 if (WINDOWP (mouse_window) |
4009 } | 4008 } |
4010 | 4009 |
4011 int | 4010 int |
4012 x_pixel_width (struct frame *f) | 4011 x_pixel_width (struct frame *f) |
4013 { | 4012 { |
4014 return FRAME_WIDTH (f); | 4013 return FRAME_COLS (f); |
4015 } | 4014 } |
4016 | 4015 |
4017 int | 4016 int |
4018 x_pixel_height (struct frame *f) | 4017 x_pixel_height (struct frame *f) |
4019 { | 4018 { |
4020 return FRAME_HEIGHT (f); | 4019 return FRAME_LINES (f); |
4021 } | 4020 } |
4022 #endif /* !HAVE_X_WINDOWS */ | 4021 #endif /* !HAVE_X_WINDOWS */ |
4023 | 4022 |
4024 /* ----------------------- DOS / UNIX conversion --------------------- */ | 4023 /* ----------------------- DOS / UNIX conversion --------------------- */ |
4025 | 4024 |