-/* Terminal hooks for Windows NT port of GNU Emacs.
+/* Terminal hooks for GNU Emacs on the Microsoft W32 API.
Copyright (C) 1992 Free Software Foundation, Inc.
This file is part of GNU Emacs.
#include "disptab.h"
#include "termhooks.h"
-#include "ntinevt.h"
+#include "w32inevt.h"
/* from window.c */
extern Lisp_Object Frecenter ();
static void insert_glyphs (GLYPH *start, int len);
static void write_glyphs (GLYPH *string, int len);
static void delete_glyphs (int n);
-void nt_ring_bell (void);
+void w32_sys_ring_bell (void);
static void reset_terminal_modes (void);
static void set_terminal_modes (void);
static void set_terminal_window (int size);
HANDLE prev_screen, cur_screen;
UCHAR char_attr, char_attr_normal, char_attr_reverse;
HANDLE keyboard_handle;
+DWORD prev_console_mode;
/* Setting this as the ctrl handler prevents emacs from being killed when
ScrollConsoleScreenBuffer (cur_screen, &scroll, NULL, dest, &fill);
- /* Here we have to deal with a win32 console flake: If the scroll
+ /* Here we have to deal with a w32 console flake: If the scroll
region looks like abc and we scroll c to a and fill with d we get
cbd... if we scroll block c one line at a time to a, we get cdd...
Emacs expects cdd consistently... So we have to deal with that
static unsigned int sound_type = 0xFFFFFFFF;
void
-nt_ring_bell (void)
+w32_sys_ring_bell (void)
{
if (sound_type == 0xFFFFFFFF)
Beep (666, 100);
SetConsoleActiveScreenBuffer (cur_screen);
- /* make cursor big and visible (100 on Win95 makes it disappear) */
+ /* make cursor big and visible (100 on Windows 95 makes it disappear) */
cci.dwSize = 99;
cci.bVisible = TRUE;
(void) SetConsoleCursorInfo (cur_screen, &cci);
void
unset_kbd (void)
{
- SetConsoleMode (keyboard_handle, ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT |
- ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT);
+ SetConsoleMode (keyboard_handle, prev_console_mode);
}
void
reset_kbd (void)
{
keyboard_handle = GetStdHandle (STD_INPUT_HANDLE);
+ GetConsoleMode (keyboard_handle, &prev_console_mode);
SetConsoleMode (keyboard_handle, ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT);
+
+ /* Try to use interrupt input; if we can't, then start polling. */
+ Fset_input_mode (Qt, Qnil, Qt, Qnil);
}
typedef int (*term_hook) ();
void
-initialize_win_nt_display (void)
+initialize_w32_display (void)
{
CONSOLE_SCREEN_BUFFER_INFO info;
insert_glyphs_hook = (term_hook) insert_glyphs;
write_glyphs_hook = (term_hook) write_glyphs;
delete_glyphs_hook = (term_hook) delete_glyphs;
- ring_bell_hook = (term_hook) nt_ring_bell;
+ ring_bell_hook = (term_hook) w32_sys_ring_bell;
reset_terminal_modes_hook = (term_hook) reset_terminal_modes;
set_terminal_modes_hook = (term_hook) set_terminal_modes;
set_terminal_window_hook = (term_hook) set_terminal_window;
update_begin_hook = (term_hook) update_begin;
update_end_hook = (term_hook) update_end;
- read_socket_hook = win32_read_socket;
- mouse_position_hook = win32_mouse_position;
+ read_socket_hook = w32_console_read_socket;
+ mouse_position_hook = w32_mouse_position;
prev_screen = GetStdHandle (STD_OUTPUT_HANDLE);
char_attr_reverse = ((char_attr & 0xf) << 4) + ((char_attr & 0xf0) >> 4);
FRAME_HEIGHT (selected_frame) = info.dwSize.Y; /* lines per page */
- FRAME_WIDTH (selected_frame) = info.dwSize.X; /* characters per line */
+ SET_FRAME_WIDTH (selected_frame, info.dwSize.X); /* characters per line */
move_cursor (0, 0);