X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/6ccb9cab43613632ece4f62d9ee28d694bc1d666..51caf50203be08ba6f15e0d72b777f036d6bee72:/src/msdos.c diff --git a/src/msdos.c b/src/msdos.c index a2bcc06ac1..b778245a7b 100644 --- a/src/msdos.c +++ b/src/msdos.c @@ -298,7 +298,7 @@ mouse_button_depressed (int b, int *xp, int *yp) } void -mouse_get_pos (FRAME_PTR *f, int insist, Lisp_Object *bar_window, +mouse_get_pos (struct frame **f, int insist, Lisp_Object *bar_window, enum scroll_bar_part *part, Lisp_Object *x, Lisp_Object *y, Time *time) { @@ -408,7 +408,7 @@ static int term_setup_done; static unsigned short outside_cursor; -/* Similar to the_only_frame. */ +/* The only display since MS-DOS does not support multiple ones. */ struct tty_display_info the_only_display_info; /* Support for DOS/V (allows Japanese characters to be displayed on @@ -602,11 +602,7 @@ dos_set_window_size (int *rows, int *cols) Lisp_Object window = hlinfo->mouse_face_window; if (! NILP (window) && XFRAME (XWINDOW (window)->frame) == f) - { - hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; - hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; - hlinfo->mouse_face_window = Qnil; - } + reset_mouse_highlight (hlinfo); } /* Enable bright background colors. */ @@ -950,9 +946,6 @@ IT_write_glyphs (struct frame *f, struct glyph *str, int str_len) Mouse Highlight (and friends..) ************************************************************************/ -/* Last window where we saw the mouse. Used by mouse-autoselect-window. */ -static Lisp_Object last_mouse_window; - static int mouse_preempted = 0; /* non-zero when XMenu gobbles mouse events */ int @@ -1158,7 +1151,7 @@ IT_display_cursor (int on) to put the cursor at the end of the text displayed there. */ static void -IT_cmgoto (FRAME_PTR f) +IT_cmgoto (struct frame *f) { /* Only set the cursor to where it should be if the display is already in sync with the window contents. */ @@ -1229,7 +1222,7 @@ IT_cmgoto (FRAME_PTR f) static void IT_update_begin (struct frame *f) { - struct tty_display_info *display_info = FRAME_X_DISPLAY_INFO (f); + struct tty_display_info *display_info = FRAME_DISPLAY_INFO (f); Mouse_HLInfo *hlinfo = &display_info->mouse_highlight; struct frame *mouse_face_frame = hlinfo->mouse_face_mouse_frame; @@ -1276,14 +1269,9 @@ IT_update_begin (struct frame *f) } } else if (mouse_face_frame && !FRAME_LIVE_P (mouse_face_frame)) - { - /* If the frame with mouse highlight was deleted, invalidate the - highlight info. */ - hlinfo->mouse_face_beg_row = hlinfo->mouse_face_beg_col = -1; - hlinfo->mouse_face_end_row = hlinfo->mouse_face_end_col = -1; - hlinfo->mouse_face_window = Qnil; - hlinfo->mouse_face_mouse_frame = NULL; - } + /* If the frame with mouse highlight was deleted, invalidate the + highlight info. */ + reset_mouse_highlight (hlinfo); unblock_input (); } @@ -1291,7 +1279,7 @@ IT_update_begin (struct frame *f) static void IT_update_end (struct frame *f) { - struct tty_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); + struct tty_display_info *dpyinfo = FRAME_DISPLAY_INFO (f); if (dpyinfo->termscript) fprintf (dpyinfo->termscript, "\n= 0 && colors[1] < 16) FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()) = colors[1]; } - the_only_display_info.mouse_highlight.mouse_face_mouse_frame = NULL; - the_only_display_info.mouse_highlight.mouse_face_beg_row = - the_only_display_info.mouse_highlight.mouse_face_beg_col = -1; - the_only_display_info.mouse_highlight.mouse_face_end_row = - the_only_display_info.mouse_highlight.mouse_face_end_col = -1; - the_only_display_info.mouse_highlight.mouse_face_face_id = DEFAULT_FACE_ID; - the_only_display_info.mouse_highlight.mouse_face_window = Qnil; - the_only_display_info.mouse_highlight.mouse_face_mouse_x = - the_only_display_info.mouse_highlight.mouse_face_mouse_y = 0; - the_only_display_info.mouse_highlight.mouse_face_defer = 0; - the_only_display_info.mouse_highlight.mouse_face_hidden = 0; + + reset_mouse_highlight (&the_only_display_info.mouse_highlight); if (have_mouse) /* detected in dos_ttraw, which see */ { @@ -1889,7 +1856,7 @@ initialize_msdos_display (struct terminal *term) term->ring_bell_hook = IT_ring_bell; term->reset_terminal_modes_hook = IT_reset_terminal_modes; term->set_terminal_modes_hook = IT_set_terminal_modes; - term->set_terminal_window_hook = IT_set_terminal_window; + term->set_terminal_window_hook = NULL; term->update_begin_hook = IT_update_begin; term->update_end_hook = IT_update_end; term->frame_up_to_date_hook = IT_frame_up_to_date; @@ -2691,10 +2658,10 @@ dos_rawgetc (void) /* Generate SELECT_WINDOW_EVENTs when needed. */ if (!NILP (Vmouse_autoselect_window)) { - mouse_window = window_from_coordinates (SELECTED_FRAME (), - mouse_last_x, - mouse_last_y, - 0, 0); + static Lisp_Object last_mouse_window; + + mouse_window = window_from_coordinates + (SELECTED_FRAME (), mouse_last_x, mouse_last_y, 0, 0); /* A window will be selected only when it is not selected now, and the last mouse movement event was not in it. A minibuffer window will be selected iff @@ -2709,10 +2676,9 @@ dos_rawgetc (void) event.timestamp = event_timestamp (); kbd_buffer_store_event (&event); } + /* Remember the last window where we saw the mouse. */ last_mouse_window = mouse_window; } - else - last_mouse_window = Qnil; previous_help_echo_string = help_echo_string; help_echo_string = help_echo_object = help_echo_window = Qnil; @@ -3320,18 +3286,6 @@ XMenuDestroy (Display *foo, XMenu *menu) xfree (menu); menu_help_message = prev_menu_help_message = NULL; } - -int -x_pixel_width (struct frame *f) -{ - return FRAME_COLS (f); -} - -int -x_pixel_height (struct frame *f) -{ - return FRAME_LINES (f); -} #endif /* !HAVE_X_WINDOWS */ /* ----------------------- DOS / UNIX conversion --------------------- */ @@ -3341,7 +3295,7 @@ void msdos_downcase_filename (unsigned char *); /* Destructively turn backslashes into slashes. */ void -dostounix_filename (char *p, int ignore) +dostounix_filename (char *p) { msdos_downcase_filename (p); @@ -3605,7 +3559,7 @@ init_environment (int argc, char **argv, int skip_args) if (!s) s = "c:/command.com"; t = alloca (strlen (s) + 1); strcpy (t, s); - dostounix_filename (t, 0); + dostounix_filename (t); setenv ("SHELL", t, 0); /* PATH is also downcased and backslashes mirrored. */ @@ -3615,7 +3569,7 @@ init_environment (int argc, char **argv, int skip_args) /* Current directory is always considered part of MsDos's path but it is not normally mentioned. Now it is. */ strcat (strcpy (t, ".;"), s); - dostounix_filename (t, 0); /* Not a single file name, but this should work. */ + dostounix_filename (t); /* Not a single file name, but this should work. */ setenv ("PATH", t, 1); /* In some sense all dos users have root privileges, so... */ @@ -4085,7 +4039,7 @@ dos_yield_time_slice (void) because wait_reading_process_output takes care of that. */ int sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, - EMACS_TIME *timeout, void *ignored) + struct timespec *timeout, void *ignored) { int check_input; struct timespec t; @@ -4115,20 +4069,20 @@ sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, } else { - EMACS_TIME clnow, cllast, cldiff; + struct timespec clnow, cllast, cldiff; gettime (&t); - cllast = make_emacs_time (t.tv_sec, t.tv_nsec); + cllast = make_timespec (t.tv_sec, t.tv_nsec); while (!check_input || !detect_input_pending ()) { gettime (&t); - clnow = make_emacs_time (t.tv_sec, t.tv_nsec); - cldiff = sub_emacs_time (clnow, cllast); - *timeout = sub_emacs_time (*timeout, cldiff); + clnow = make_timespec (t.tv_sec, t.tv_nsec); + cldiff = timespec_sub (clnow, cllast); + *timeout = timespec_sub (*timeout, cldiff); /* Stop when timeout value crosses zero. */ - if (EMACS_TIME_SIGN (*timeout) <= 0) + if (timespec_sign (*timeout) <= 0) return 0; cllast = clnow; dos_yield_time_slice ();