Mercurial > emacs
annotate src/w32console.c @ 109154:6f7fb6d5f0f9
Make the function member of Lisp_Subr use standard C prototypes.
* src/lisp.h (struct Lisp_Subr): Use a union for the function member.
(DECL_ALIGN): Add a cast for the function.
* src/eval.c (Feval, Ffuncall): Use the proper type for each type
function call.
author | Dan Nicolaescu <dann@ics.uci.edu> |
---|---|
date | Tue, 06 Jul 2010 19:49:37 -0700 |
parents | e27859da5624 |
children | f8660b83cdbf |
rev | line source |
---|---|
16883
d1d4d81f9ece
Change all uses of win95, winnt, and win32
Geoff Voelker <voelker@cs.washington.edu>
parents:
16593
diff
changeset
|
1 /* Terminal hooks for GNU Emacs on the Microsoft W32 API. |
94963
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91327
diff
changeset
|
2 Copyright (C) 1992, 1999, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
106815 | 3 2008, 2009, 2010 Free Software Foundation, Inc. |
9907 | 4 |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
13424
diff
changeset
|
5 This file is part of GNU Emacs. |
9907 | 6 |
94963
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91327
diff
changeset
|
7 GNU Emacs is free software: you can redistribute it and/or modify |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
13424
diff
changeset
|
8 it under the terms of the GNU General Public License as published by |
94963
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91327
diff
changeset
|
9 the Free Software Foundation, either version 3 of the License, or |
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91327
diff
changeset
|
10 (at your option) any later version. |
9907 | 11 |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
13424
diff
changeset
|
12 GNU Emacs is distributed in the hope that it will be useful, |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
13424
diff
changeset
|
13 but WITHOUT ANY WARRANTY; without even the implied warranty of |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
13424
diff
changeset
|
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
13424
diff
changeset
|
15 GNU General Public License for more details. |
9907 | 16 |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
13424
diff
changeset
|
17 You should have received a copy of the GNU General Public License |
94963
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91327
diff
changeset
|
18 along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ |
9907 | 19 |
94963
8971ddf55736
Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents:
91327
diff
changeset
|
20 /* |
9907 | 21 Tim Fleehart (apollo@online.com) 1-17-92 |
22 Geoff Voelker (voelker@cs.washington.edu) 9-12-93 | |
23 */ | |
24 | |
25 | |
12183
47685fb0fbd1
Include config.h before stdio.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
11942
diff
changeset
|
26 #include <config.h> |
47685fb0fbd1
Include config.h before stdio.h.
Geoff Voelker <voelker@cs.washington.edu>
parents:
11942
diff
changeset
|
27 |
9907 | 28 #include <stdlib.h> |
29 #include <stdio.h> | |
30 #include <windows.h> | |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
31 #include <string.h> |
105669
68dd71358159
* alloc.c: Do not define struct catchtag.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
100951
diff
changeset
|
32 #include <setjmp.h> |
9907 | 33 |
34 #include "lisp.h" | |
88351
aac41b50c875
Include "character.h" instead of "charset.h".
Kenichi Handa <handa@m17n.org>
parents:
40962
diff
changeset
|
35 #include "character.h" |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
36 #include "coding.h" |
9907 | 37 #include "disptab.h" |
27892
1857b9695885
Only disable window system features for dispextern.h
Jason Rumney <jasonr@gnu.org>
parents:
27518
diff
changeset
|
38 #include "frame.h" |
9907 | 39 #include "termhooks.h" |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
40 #include "termchar.h" |
32668
3bdd8b545352
Do not undef HAVE_WINDOW_SYSTEM before
Jason Rumney <jasonr@gnu.org>
parents:
31109
diff
changeset
|
41 #include "dispextern.h" |
16593
4ed80eda6fac
Use new names for w32 files
Geoff Voelker <voelker@cs.washington.edu>
parents:
16588
diff
changeset
|
42 #include "w32inevt.h" |
9907 | 43 |
11389 | 44 /* from window.c */ |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
45 extern Lisp_Object Frecenter (Lisp_Object); |
9907 | 46 |
47 /* from keyboard.c */ | |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
48 extern int detect_input_pending (void); |
9907 | 49 |
50 /* from sysdep.c */ | |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
51 extern int read_input_pending (void); |
9907 | 52 |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
53 static void w32con_move_cursor (struct frame *f, int row, int col); |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
54 static void w32con_clear_to_end (struct frame *f); |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
55 static void w32con_clear_frame (struct frame *f); |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
56 static void w32con_clear_end_of_line (struct frame *f, int); |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
57 static void w32con_ins_del_lines (struct frame *f, int vpos, int n); |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
58 static void w32con_insert_glyphs (struct frame *f, struct glyph *start, int len); |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
59 static void w32con_write_glyphs (struct frame *f, struct glyph *string, int len); |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
60 static void w32con_delete_glyphs (struct frame *f, int n); |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
61 static void w32con_reset_terminal_modes (struct terminal *t); |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
62 static void w32con_set_terminal_modes (struct terminal *t); |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
63 static void w32con_set_terminal_window (struct frame *f, int size); |
55670
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
64 static void w32con_update_begin (struct frame * f); |
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
65 static void w32con_update_end (struct frame * f); |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
66 static WORD w32_face_attributes (struct frame *f, int face_id); |
9907 | 67 |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
68 static COORD cursor_coords; |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
69 static HANDLE prev_screen, cur_screen; |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
70 static WORD char_attr_normal; |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
71 static DWORD prev_console_mode; |
9907 | 72 |
19706
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
73 #ifndef USE_SEPARATE_SCREEN |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
74 static CONSOLE_CURSOR_INFO prev_console_cursor; |
19706
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
75 #endif |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
76 |
86834
ca4d8fae0af9
Leave HAVE_WINDOW_SYSTEM defined.
Jason Rumney <jasonr@gnu.org>
parents:
86271
diff
changeset
|
77 extern Lisp_Object Vtty_defined_color_alist; |
ca4d8fae0af9
Leave HAVE_WINDOW_SYSTEM defined.
Jason Rumney <jasonr@gnu.org>
parents:
86271
diff
changeset
|
78 |
24938
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
79 /* Determine whether to make frame dimensions match the screen buffer, |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
80 or the current window size. The former is desirable when running |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
81 over telnet, while the latter is more useful when working directly at |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
82 the console with a large scroll-back buffer. */ |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
83 int w32_use_full_screen_buffer; |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
84 HANDLE keyboard_handle; |
24938
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
85 |
9907 | 86 |
87 /* Setting this as the ctrl handler prevents emacs from being killed when | |
12336
617f39b43557
(ctrl_c_handler): Ignore CTRL_BREAK_EVENT signals.
Richard M. Stallman <rms@gnu.org>
parents:
12183
diff
changeset
|
88 someone hits ^C in a 'suspended' session (child shell). |
617f39b43557
(ctrl_c_handler): Ignore CTRL_BREAK_EVENT signals.
Richard M. Stallman <rms@gnu.org>
parents:
12183
diff
changeset
|
89 Also ignore Ctrl-Break signals. */ |
617f39b43557
(ctrl_c_handler): Ignore CTRL_BREAK_EVENT signals.
Richard M. Stallman <rms@gnu.org>
parents:
12183
diff
changeset
|
90 |
9907 | 91 BOOL |
92 ctrl_c_handler (unsigned long type) | |
93 { | |
19706
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
94 /* Only ignore "interrupt" events when running interactively. */ |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
95 return (!noninteractive |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
96 && (type == CTRL_C_EVENT || type == CTRL_BREAK_EVENT)); |
9907 | 97 } |
98 | |
99 | |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
100 /* Move the cursor to (ROW, COL) on FRAME. */ |
55644 | 101 static void |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
102 w32con_move_cursor (struct frame *f, int row, int col) |
9907 | 103 { |
104 cursor_coords.X = col; | |
105 cursor_coords.Y = row; | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
106 |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
107 /* TODO: for multi-tty support, cur_screen should be replaced with a |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
108 reference to the terminal for this frame. */ |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
109 SetConsoleCursorPosition (cur_screen, cursor_coords); |
9907 | 110 } |
111 | |
112 /* Clear from cursor to end of screen. */ | |
55644 | 113 static void |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
114 w32con_clear_to_end (struct frame *f) |
9907 | 115 { |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
116 w32con_clear_end_of_line (f, FRAME_COLS (f) - 1); |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
117 w32con_ins_del_lines (f, cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1); |
9907 | 118 } |
119 | |
120 /* Clear the frame. */ | |
55670
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
121 static void |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
122 w32con_clear_frame (struct frame *f) |
9907 | 123 { |
124 COORD dest; | |
31109 | 125 int n; |
126 DWORD r; | |
24755
3bb855a40bf6
(clear_frame): Remember that the window width might
Andrew Innes <andrewi@gnu.org>
parents:
23572
diff
changeset
|
127 CONSOLE_SCREEN_BUFFER_INFO info; |
3bb855a40bf6
(clear_frame): Remember that the window width might
Andrew Innes <andrewi@gnu.org>
parents:
23572
diff
changeset
|
128 |
3bb855a40bf6
(clear_frame): Remember that the window width might
Andrew Innes <andrewi@gnu.org>
parents:
23572
diff
changeset
|
129 GetConsoleScreenBufferInfo (GetStdHandle (STD_OUTPUT_HANDLE), &info); |
14244
493cff4d5960
(clear_frame): Use FillConsoleOutput* calls instead of
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
130 |
24755
3bb855a40bf6
(clear_frame): Remember that the window width might
Andrew Innes <andrewi@gnu.org>
parents:
23572
diff
changeset
|
131 /* Remember that the screen buffer might be wider than the window. */ |
51206
22a5614b558f
Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
50247
diff
changeset
|
132 n = FRAME_LINES (f) * info.dwSize.X; |
14244
493cff4d5960
(clear_frame): Use FillConsoleOutput* calls instead of
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
133 dest.X = dest.Y = 0; |
493cff4d5960
(clear_frame): Use FillConsoleOutput* calls instead of
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
134 |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
135 FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r); |
14244
493cff4d5960
(clear_frame): Use FillConsoleOutput* calls instead of
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
136 FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r); |
493cff4d5960
(clear_frame): Use FillConsoleOutput* calls instead of
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
137 |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
138 w32con_move_cursor (f, 0, 0); |
9907 | 139 } |
140 | |
141 | |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
142 static struct glyph glyph_base[256]; |
9907 | 143 static BOOL ceol_initialized = FALSE; |
144 | |
145 /* Clear from Cursor to end (what's "standout marker"?). */ | |
55670
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
146 static void |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
147 w32con_clear_end_of_line (struct frame *f, int end) |
9907 | 148 { |
149 if (!ceol_initialized) | |
150 { | |
151 int i; | |
152 for (i = 0; i < 256; i++) | |
153 { | |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
154 memcpy (&glyph_base[i], &space_glyph, sizeof (struct glyph)); |
9907 | 155 } |
156 ceol_initialized = TRUE; | |
157 } | |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
158 w32con_write_glyphs (f, glyph_base, end - cursor_coords.X); /* fencepost ? */ |
9907 | 159 } |
160 | |
161 /* Insert n lines at vpos. if n is negative delete -n lines. */ | |
55670
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
162 static void |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
163 w32con_ins_del_lines (struct frame *f, int vpos, int n) |
9907 | 164 { |
40079
e62d3694acdc
(reassert_line_highlight, change_line_highlight): Functions removed.
Miles Bader <miles@gnu.org>
parents:
39682
diff
changeset
|
165 int i, nb; |
9907 | 166 SMALL_RECT scroll; |
86876
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
167 SMALL_RECT clip; |
9907 | 168 COORD dest; |
169 CHAR_INFO fill; | |
170 | |
171 if (n < 0) | |
172 { | |
173 scroll.Top = vpos - n; | |
51206
22a5614b558f
Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
50247
diff
changeset
|
174 scroll.Bottom = FRAME_LINES (f); |
9907 | 175 dest.Y = vpos; |
176 } | |
177 else | |
178 { | |
179 scroll.Top = vpos; | |
51206
22a5614b558f
Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
50247
diff
changeset
|
180 scroll.Bottom = FRAME_LINES (f) - n; |
9907 | 181 dest.Y = vpos + n; |
182 } | |
86876
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
183 clip.Top = clip.Left = scroll.Left = 0; |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
184 clip.Right = scroll.Right = FRAME_COLS (f); |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
185 clip.Bottom = FRAME_LINES (f); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
186 |
9907 | 187 dest.X = 0; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
188 |
9907 | 189 fill.Char.AsciiChar = 0x20; |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
190 fill.Attributes = char_attr_normal; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
191 |
86876
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
192 ScrollConsoleScreenBuffer (cur_screen, &scroll, &clip, dest, &fill); |
9907 | 193 |
16588
481b7874a1e9
Change identifiers of the form win32* to w32*.
Geoff Voelker <voelker@cs.washington.edu>
parents:
16262
diff
changeset
|
194 /* Here we have to deal with a w32 console flake: If the scroll |
9907 | 195 region looks like abc and we scroll c to a and fill with d we get |
196 cbd... if we scroll block c one line at a time to a, we get cdd... | |
197 Emacs expects cdd consistently... So we have to deal with that | |
198 here... (this also occurs scrolling the same way in the other | |
199 direction. */ | |
200 | |
201 if (n > 0) | |
202 { | |
203 if (scroll.Bottom < dest.Y) | |
204 { | |
205 for (i = scroll.Bottom; i < dest.Y; i++) | |
206 { | |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
207 w32con_move_cursor (f, i, 0); |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
208 w32con_clear_end_of_line (f, FRAME_COLS (f)); |
9907 | 209 } |
210 } | |
211 } | |
212 else | |
213 { | |
214 nb = dest.Y + (scroll.Bottom - scroll.Top) + 1; | |
215 | |
216 if (nb < scroll.Top) | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
217 { |
9907 | 218 for (i = nb; i < scroll.Top; i++) |
219 { | |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
220 w32con_move_cursor (f, i, 0); |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
221 w32con_clear_end_of_line (f, FRAME_COLS (f)); |
9907 | 222 } |
223 } | |
224 } | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
225 |
9907 | 226 cursor_coords.X = 0; |
227 cursor_coords.Y = vpos; | |
228 } | |
229 | |
230 #undef LEFT | |
231 #undef RIGHT | |
232 #define LEFT 1 | |
233 #define RIGHT 0 | |
234 | |
55644 | 235 static void |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
236 scroll_line (struct frame *f, int dist, int direction) |
9907 | 237 { |
238 /* The idea here is to implement a horizontal scroll in one line to | |
239 implement delete and half of insert. */ | |
86876
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
240 SMALL_RECT scroll, clip; |
9907 | 241 COORD dest; |
242 CHAR_INFO fill; | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
243 |
86876
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
244 clip.Top = scroll.Top = clip.Bottom = scroll.Bottom = cursor_coords.Y; |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
245 clip.Left = 0; |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
246 clip.Right = FRAME_COLS (f); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
247 |
9907 | 248 if (direction == LEFT) |
249 { | |
250 scroll.Left = cursor_coords.X + dist; | |
51206
22a5614b558f
Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
50247
diff
changeset
|
251 scroll.Right = FRAME_COLS (f) - 1; |
9907 | 252 } |
253 else | |
254 { | |
255 scroll.Left = cursor_coords.X; | |
51206
22a5614b558f
Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
50247
diff
changeset
|
256 scroll.Right = FRAME_COLS (f) - dist - 1; |
9907 | 257 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
258 |
9907 | 259 dest.X = cursor_coords.X; |
260 dest.Y = cursor_coords.Y; | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
261 |
9907 | 262 fill.Char.AsciiChar = 0x20; |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
263 fill.Attributes = char_attr_normal; |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
264 |
86876
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
265 ScrollConsoleScreenBuffer (cur_screen, &scroll, &clip, dest, &fill); |
9907 | 266 } |
267 | |
268 | |
269 /* If start is zero insert blanks instead of a string at start ?. */ | |
55670
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
270 static void |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
271 w32con_insert_glyphs (struct frame *f, register struct glyph *start, |
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
272 register int len) |
9907 | 273 { |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
274 scroll_line (f, len, RIGHT); |
9907 | 275 |
276 /* Move len chars to the right starting at cursor_coords, fill with blanks */ | |
277 if (start) | |
278 { | |
279 /* Print the first len characters of start, cursor_coords.X adjusted | |
280 by write_glyphs. */ | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
281 |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
282 w32con_write_glyphs (f, start, len); |
9907 | 283 } |
284 else | |
285 { | |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
286 w32con_clear_end_of_line (f, cursor_coords.X + len); |
9907 | 287 } |
288 } | |
289 | |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
290 extern unsigned char *encode_terminal_code (struct glyph *, int, |
109100
2bc9a0c04c87
Remove __P and P_ from .c and .m files and definition of P_
Jan D <jan.h.d@swipnet.se>
parents:
108007
diff
changeset
|
291 struct coding_system *); |
58700
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
292 |
55670
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
293 static void |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
294 w32con_write_glyphs (struct frame *f, register struct glyph *string, |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
295 register int len) |
9907 | 296 { |
31109 | 297 DWORD r; |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
298 WORD char_attr; |
58700
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
299 unsigned char *conversion_buffer; |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
300 struct coding_system *coding; |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
301 |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
302 if (len <= 0) |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
303 return; |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
304 |
58700
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
305 /* If terminal_coding does any conversion, use it, otherwise use |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
306 safe_terminal_coding. We can't use CODING_REQUIRE_ENCODING here |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
307 because it always return 1 if the member src_multibyte is 1. */ |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
308 coding = (FRAME_TERMINAL_CODING (f)->common_flags & CODING_REQUIRE_ENCODING_MASK |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
309 ? FRAME_TERMINAL_CODING (f) : &safe_terminal_coding); |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
310 /* The mode bit CODING_MODE_LAST_BLOCK should be set to 1 only at |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
311 the tail. */ |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
312 coding->mode &= ~CODING_MODE_LAST_BLOCK; |
14244
493cff4d5960
(clear_frame): Use FillConsoleOutput* calls instead of
Geoff Voelker <voelker@cs.washington.edu>
parents:
14186
diff
changeset
|
313 |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
314 while (len > 0) |
9907 | 315 { |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
316 /* Identify a run of glyphs with the same face. */ |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
317 int face_id = string->face_id; |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
318 int n; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
319 |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
320 for (n = 1; n < len; ++n) |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
321 if (string[n].face_id != face_id) |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
322 break; |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
323 |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
324 /* Turn appearance modes of the face of the run on. */ |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
325 char_attr = w32_face_attributes (f, face_id); |
9907 | 326 |
58700
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
327 if (n == len) |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
328 /* This is the last run. */ |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
329 coding->mode |= CODING_MODE_LAST_BLOCK; |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
330 conversion_buffer = encode_terminal_code (string, n, coding); |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
331 if (coding->produced > 0) |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
332 { |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
333 /* Set the attribute for these characters. */ |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
334 if (!FillConsoleOutputAttribute (cur_screen, char_attr, |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
335 coding->produced, cursor_coords, |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
336 &r)) |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
337 { |
58700
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
338 printf ("Failed writing console attributes: %d\n", |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
339 GetLastError ()); |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
340 fflush (stdout); |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
341 } |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
342 |
58700
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
343 /* Write the characters. */ |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
344 if (!WriteConsoleOutputCharacter (cur_screen, conversion_buffer, |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
345 coding->produced, cursor_coords, |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
346 &r)) |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
347 { |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
348 printf ("Failed writing console characters: %d\n", |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
349 GetLastError ()); |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
350 fflush (stdout); |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
351 } |
9907 | 352 |
58700
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
353 cursor_coords.X += coding->produced; |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
354 w32con_move_cursor (f, cursor_coords.Y, cursor_coords.X); |
58700
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
355 } |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
356 len -= n; |
222a7e1090c3
(w32con_write_glyphs): Decide coding here.
Kenichi Handa <handa@m17n.org>
parents:
55670
diff
changeset
|
357 string += n; |
9907 | 358 } |
359 } | |
360 | |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
361 |
55670
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
362 static void |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
363 w32con_delete_glyphs (struct frame *f, int n) |
9907 | 364 { |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
365 /* delete chars means scroll chars from cursor_coords.X + n to |
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
366 cursor_coords.X, anything beyond the edge of the screen should |
9907 | 367 come out empty... */ |
368 | |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
369 scroll_line (f, n, LEFT); |
9907 | 370 } |
371 | |
11389 | 372 static unsigned int sound_type = 0xFFFFFFFF; |
23563
18c5f58b70b5
(Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents:
22540
diff
changeset
|
373 #define MB_EMACS_SILENT (0xFFFFFFFF - 1) |
11389 | 374 |
9907 | 375 void |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
376 w32_sys_ring_bell (struct frame *f) |
9907 | 377 { |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
378 if (sound_type == 0xFFFFFFFF) |
23563
18c5f58b70b5
(Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents:
22540
diff
changeset
|
379 { |
11389 | 380 Beep (666, 100); |
23563
18c5f58b70b5
(Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents:
22540
diff
changeset
|
381 } |
18c5f58b70b5
(Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents:
22540
diff
changeset
|
382 else if (sound_type == MB_EMACS_SILENT) |
18c5f58b70b5
(Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents:
22540
diff
changeset
|
383 { |
18c5f58b70b5
(Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents:
22540
diff
changeset
|
384 /* Do nothing. */ |
18c5f58b70b5
(Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents:
22540
diff
changeset
|
385 } |
11389 | 386 else |
23563
18c5f58b70b5
(Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents:
22540
diff
changeset
|
387 MessageBeep (sound_type); |
9907 | 388 } |
389 | |
11389 | 390 DEFUN ("set-message-beep", Fset_message_beep, Sset_message_beep, 1, 1, 0, |
40962
f66d09d1bb2f
Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents:
40656
diff
changeset
|
391 doc: /* Set the sound generated when the bell is rung. |
f66d09d1bb2f
Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents:
40656
diff
changeset
|
392 SOUND is 'asterisk, 'exclamation, 'hand, 'question, 'ok, or 'silent |
f66d09d1bb2f
Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents:
40656
diff
changeset
|
393 to use the corresponding system sound for the bell. The 'silent sound |
f66d09d1bb2f
Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents:
40656
diff
changeset
|
394 prevents Emacs from making any sound at all. |
f66d09d1bb2f
Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents:
40656
diff
changeset
|
395 SOUND is nil to use the normal beep. */) |
11389 | 396 (sound) |
397 Lisp_Object sound; | |
9907 | 398 { |
40656
cdfd4d09b79a
Update usage of CHECK_ macros (remove unused second argument).
Pavel Janík <Pavel@Janik.cz>
parents:
40079
diff
changeset
|
399 CHECK_SYMBOL (sound); |
11389 | 400 |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
401 if (NILP (sound)) |
11389 | 402 sound_type = 0xFFFFFFFF; |
403 else if (EQ (sound, intern ("asterisk"))) | |
404 sound_type = MB_ICONASTERISK; | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
405 else if (EQ (sound, intern ("exclamation"))) |
11389 | 406 sound_type = MB_ICONEXCLAMATION; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
407 else if (EQ (sound, intern ("hand"))) |
11389 | 408 sound_type = MB_ICONHAND; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
409 else if (EQ (sound, intern ("question"))) |
11389 | 410 sound_type = MB_ICONQUESTION; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
411 else if (EQ (sound, intern ("ok"))) |
11389 | 412 sound_type = MB_OK; |
23563
18c5f58b70b5
(Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents:
22540
diff
changeset
|
413 else if (EQ (sound, intern ("silent"))) |
18c5f58b70b5
(Fset_message_beep): Recognize 'silent.
Geoff Voelker <voelker@cs.washington.edu>
parents:
22540
diff
changeset
|
414 sound_type = MB_EMACS_SILENT; |
11389 | 415 else |
416 sound_type = 0xFFFFFFFF; | |
417 | |
418 return sound; | |
9907 | 419 } |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
420 |
55670
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
421 static void |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
422 w32con_reset_terminal_modes (struct terminal *t) |
9907 | 423 { |
86876
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
424 COORD dest; |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
425 CONSOLE_SCREEN_BUFFER_INFO info; |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
426 int n; |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
427 DWORD r; |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
428 |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
429 /* Clear the complete screen buffer. This is required because Emacs |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
430 sets the cursor position to the top of the buffer, but there might |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
431 be other output below the bottom of the Emacs frame if the screen buffer |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
432 is larger than the window size. */ |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
433 GetConsoleScreenBufferInfo (cur_screen, &info); |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
434 dest.X = 0; |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
435 dest.Y = 0; |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
436 n = info.dwSize.X * info.dwSize.Y; |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
437 |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
438 FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r); |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
439 FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r); |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
440 /* Now that the screen is clear, put the cursor at the top. */ |
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
441 SetConsoleCursorPosition (cur_screen, dest); |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
442 |
19706
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
443 #ifdef USE_SEPARATE_SCREEN |
9907 | 444 SetConsoleActiveScreenBuffer (prev_screen); |
19706
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
445 #else |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
446 SetConsoleCursorInfo (prev_screen, &prev_console_cursor); |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
447 #endif |
86876
24d5cc50cf7d
(w32con_ins_del_lines, scroll_line): Clip to window.
Jason Rumney <jasonr@gnu.org>
parents:
86834
diff
changeset
|
448 |
19706
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
449 SetConsoleMode (keyboard_handle, prev_console_mode); |
9907 | 450 } |
451 | |
55670
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
452 static void |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
453 w32con_set_terminal_modes (struct terminal *t) |
9907 | 454 { |
455 CONSOLE_CURSOR_INFO cci; | |
456 | |
19706
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
457 /* make cursor big and visible (100 on Win95 makes it disappear) */ |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
458 cci.dwSize = 99; |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
459 cci.bVisible = TRUE; |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
460 (void) SetConsoleCursorInfo (cur_screen, &cci); |
9907 | 461 |
19706
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
462 SetConsoleActiveScreenBuffer (cur_screen); |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
463 |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
464 SetConsoleMode (keyboard_handle, ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT); |
9907 | 465 |
19706
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
466 /* Initialize input mode: interrupt_input off, no flow control, allow |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
467 8 bit character input, standard quit char. */ |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
468 Fset_input_mode (Qnil, Qnil, make_number (2), Qnil); |
9907 | 469 } |
470 | |
471 /* hmmm... perhaps these let us bracket screen changes so that we can flush | |
472 clumps rather than one-character-at-a-time... | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
473 |
9907 | 474 we'll start with not moving the cursor while an update is in progress. */ |
55670
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
475 static void |
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
476 w32con_update_begin (struct frame * f) |
9907 | 477 { |
478 } | |
479 | |
55670
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
480 static void |
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
481 w32con_update_end (struct frame * f) |
9907 | 482 { |
483 SetConsoleCursorPosition (cur_screen, cursor_coords); | |
484 } | |
485 | |
55670
d3274c878082
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Jason Rumney <jasonr@gnu.org>
parents:
55644
diff
changeset
|
486 static void |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
487 w32con_set_terminal_window (struct frame *f, int size) |
9907 | 488 { |
489 } | |
490 | |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
491 /*********************************************************************** |
108007
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
492 stubs from termcap.c |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
493 ***********************************************************************/ |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
494 |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
495 void |
109116
e723dd7c9121
w32console.c (sys_tputs): Adjust argument list to prototype in term.c.
Eli Zaretskii <eliz@gnu.org>
parents:
109100
diff
changeset
|
496 sys_tputs (char *str, int nlines, int (*outfun)(int)) |
108007
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
497 { |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
498 } |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
499 |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
500 char * |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
501 sys_tgetstr (char *cap, char **area) |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
502 { |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
503 return NULL; |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
504 } |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
505 |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
506 |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
507 /*********************************************************************** |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
508 stubs from cm.c |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
509 ***********************************************************************/ |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
510 |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
511 struct tty_display_info *current_tty = NULL; |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
512 int cost = 0; |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
513 |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
514 int |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
515 evalcost (int c) |
108007
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
516 { |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
517 return c; |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
518 } |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
519 |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
520 int |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
521 cmputc (int c) |
108007
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
522 { |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
523 return c; |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
524 } |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
525 |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
526 void |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
527 cmcheckmagic (struct tty_display_info *tty) |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
528 { |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
529 } |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
530 |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
531 void |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
532 cmcostinit (struct tty_display_info *tty) |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
533 { |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
534 } |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
535 |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
536 void |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
537 cmgoto (struct tty_display_info *tty, int row, int col) |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
538 { |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
539 } |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
540 |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
541 void |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
542 Wcm_clear (struct tty_display_info *tty) |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
543 { |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
544 } |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
545 |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
546 |
ea2f4615a622
Don't depend on cm.c or termcap.c on Windows, use stubs.
Juanma Barranquero <lekktu@gmail.com>
parents:
106815
diff
changeset
|
547 /*********************************************************************** |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
548 Faces |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
549 ***********************************************************************/ |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
550 |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
551 |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
552 /* Turn appearances of face FACE_ID on tty frame F on. */ |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
553 |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
554 static WORD |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
555 w32_face_attributes (struct frame *f, int face_id) |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
556 { |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
557 WORD char_attr; |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
558 struct face *face = FACE_FROM_ID (f, face_id); |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
559 |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
560 xassert (face != NULL); |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
561 |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
562 char_attr = char_attr_normal; |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
563 |
86880
a7773099c258
(w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents:
86876
diff
changeset
|
564 /* Reverse the default color if requested. If background and |
a7773099c258
(w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents:
86876
diff
changeset
|
565 foreground are specified, then they have been reversed already. */ |
40079
e62d3694acdc
(reassert_line_highlight, change_line_highlight): Functions removed.
Miles Bader <miles@gnu.org>
parents:
39682
diff
changeset
|
566 if (face->tty_reverse_p) |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
567 char_attr = (char_attr & 0xff00) + ((char_attr & 0x000f) << 4) |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
568 + ((char_attr & 0x00f0) >> 4); |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
569 |
86880
a7773099c258
(w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents:
86876
diff
changeset
|
570 /* Before the terminal is properly initialized, all colors map to 0. |
a7773099c258
(w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents:
86876
diff
changeset
|
571 Don't try to resolve them. */ |
a7773099c258
(w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents:
86876
diff
changeset
|
572 if (NILP (Vtty_defined_color_alist)) |
a7773099c258
(w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents:
86876
diff
changeset
|
573 return char_attr; |
a7773099c258
(w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents:
86876
diff
changeset
|
574 |
86907
0f135bf21932
(w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents:
86880
diff
changeset
|
575 /* Colors should be in the range 0...15 unless they are one of |
0f135bf21932
(w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents:
86880
diff
changeset
|
576 FACE_TTY_DEFAULT_COLOR, FACE_TTY_DEFAULT_FG_COLOR or |
0f135bf21932
(w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents:
86880
diff
changeset
|
577 FACE_TTY_DEFAULT_BG_COLOR. Other out of range colors are |
0f135bf21932
(w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents:
86880
diff
changeset
|
578 invalid, so it is better to use the default color if they ever |
0f135bf21932
(w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents:
86880
diff
changeset
|
579 get through to here. */ |
0f135bf21932
(w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents:
86880
diff
changeset
|
580 if (face->foreground >= 0 && face->foreground < 16) |
86880
a7773099c258
(w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents:
86876
diff
changeset
|
581 char_attr = (char_attr & 0xfff0) + face->foreground; |
a7773099c258
(w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents:
86876
diff
changeset
|
582 |
86907
0f135bf21932
(w32_face_attributes): Comment previous change.
Jason Rumney <jasonr@gnu.org>
parents:
86880
diff
changeset
|
583 if (face->background >= 0 && face->background < 16) |
86880
a7773099c258
(w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents:
86876
diff
changeset
|
584 char_attr = (char_attr & 0xff0f) + (face->background << 4); |
a7773099c258
(w32_face_attributes): Don't use color indexes that are out of range.
Jason Rumney <jasonr@gnu.org>
parents:
86876
diff
changeset
|
585 |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
586 return char_attr; |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
587 } |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
588 |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
589 |
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
590 |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
591 /* Given a color index, return its standard name. */ |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
592 Lisp_Object |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
593 vga_stdcolor_name (int idx) |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
594 { |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
595 /* Standard VGA colors, in the order of their standard numbering |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
596 in the default VGA palette. */ |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
597 static char *vga_colors[16] = { |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
598 "black", "blue", "green", "cyan", "red", "magenta", "brown", |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
599 "lightgray", "darkgray", "lightblue", "lightgreen", "lightcyan", |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
600 "lightred", "lightmagenta", "yellow", "white" |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
601 }; |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
602 |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
603 extern Lisp_Object Qunspecified; |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
604 |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
605 if (idx >= 0 && idx < sizeof (vga_colors) / sizeof (vga_colors[0])) |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
606 return build_string (vga_colors[idx]); |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
607 else |
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
608 return Qunspecified; /* meaning the default */ |
27395
fe54558f20d8
(turn_on_face, turn_off_face): New functions.
Jason Rumney <jasonr@gnu.org>
parents:
24938
diff
changeset
|
609 } |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
610 |
9907 | 611 void |
83882
c81c5bd99c21
(one_and_only_w32cons): Remove.
Jason Rumney <jasonr@gnu.org>
parents:
83648
diff
changeset
|
612 initialize_w32_display (struct terminal *term) |
9907 | 613 { |
614 CONSOLE_SCREEN_BUFFER_INFO info; | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
615 |
83892
fc43b930f905
(initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents:
83882
diff
changeset
|
616 term->rif = 0; /* No window based redisplay on the console. */ |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
617 term->cursor_to_hook = w32con_move_cursor; |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
618 term->raw_cursor_to_hook = w32con_move_cursor; |
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
619 term->clear_to_end_hook = w32con_clear_to_end; |
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
620 term->clear_frame_hook = w32con_clear_frame; |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
621 term->clear_end_of_line_hook = w32con_clear_end_of_line; |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
622 term->ins_del_lines_hook = w32con_ins_del_lines; |
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
623 term->insert_glyphs_hook = w32con_insert_glyphs; |
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
624 term->write_glyphs_hook = w32con_write_glyphs; |
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
625 term->delete_glyphs_hook = w32con_delete_glyphs; |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
626 term->ring_bell_hook = w32_sys_ring_bell; |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
627 term->reset_terminal_modes_hook = w32con_reset_terminal_modes; |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
628 term->set_terminal_modes_hook = w32con_set_terminal_modes; |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
629 term->set_terminal_window_hook = w32con_set_terminal_window; |
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
630 term->update_begin_hook = w32con_update_begin; |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
631 term->update_end_hook = w32con_update_end; |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
632 |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
633 term->read_socket_hook = w32_console_read_socket; |
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
634 term->mouse_position_hook = w32_console_mouse_position; |
19706
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
635 |
83892
fc43b930f905
(initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents:
83882
diff
changeset
|
636 /* The following are not used on the console. */ |
fc43b930f905
(initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents:
83882
diff
changeset
|
637 term->frame_rehighlight_hook = 0; |
fc43b930f905
(initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents:
83882
diff
changeset
|
638 term->frame_raise_lower_hook = 0; |
fc43b930f905
(initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents:
83882
diff
changeset
|
639 term->set_vertical_scroll_bar_hook = 0; |
fc43b930f905
(initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents:
83882
diff
changeset
|
640 term->condemn_scroll_bars_hook = 0; |
fc43b930f905
(initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents:
83882
diff
changeset
|
641 term->redeem_scroll_bar_hook = 0; |
fc43b930f905
(initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents:
83882
diff
changeset
|
642 term->judge_scroll_bars_hook = 0; |
fc43b930f905
(initialize_w32_display): Zero unused hooks.
Jason Rumney <jasonr@gnu.org>
parents:
83882
diff
changeset
|
643 term->frame_up_to_date_hook = 0; |
19706
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
644 |
22540
0e7c65caf1cb
(initialize_w32_display): Call init_crit to initialize
Andrew Innes <andrewi@gnu.org>
parents:
21828
diff
changeset
|
645 /* Initialize interrupt_handle. */ |
0e7c65caf1cb
(initialize_w32_display): Call init_crit to initialize
Andrew Innes <andrewi@gnu.org>
parents:
21828
diff
changeset
|
646 init_crit (); |
0e7c65caf1cb
(initialize_w32_display): Call init_crit to initialize
Andrew Innes <andrewi@gnu.org>
parents:
21828
diff
changeset
|
647 |
19706
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
648 /* Remember original console settings. */ |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
649 keyboard_handle = GetStdHandle (STD_INPUT_HANDLE); |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
650 GetConsoleMode (keyboard_handle, &prev_console_mode); |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
651 |
9907 | 652 prev_screen = GetStdHandle (STD_OUTPUT_HANDLE); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
653 |
19706
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
654 #ifdef USE_SEPARATE_SCREEN |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
655 cur_screen = CreateConsoleScreenBuffer (GENERIC_READ | GENERIC_WRITE, |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
656 0, NULL, |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
657 CONSOLE_TEXTMODE_BUFFER, |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
658 NULL); |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
659 |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
660 if (cur_screen == INVALID_HANDLE_VALUE) |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
661 { |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
662 printf ("CreateConsoleScreenBuffer failed in ResetTerm\n"); |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
663 printf ("LastError = 0x%lx\n", GetLastError ()); |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
664 fflush (stdout); |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
665 exit (0); |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
666 } |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
667 #else |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
668 cur_screen = prev_screen; |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
669 GetConsoleCursorInfo (prev_screen, &prev_console_cursor); |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
670 #endif |
e21b63afe61f
(DebPrint, reset_kbd, unset_kbd, take_console): Delete functions.
Geoff Voelker <voelker@cs.washington.edu>
parents:
18507
diff
changeset
|
671 |
24938
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
672 /* Respect setting of LINES and COLUMNS environment variables. */ |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
673 { |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
674 char * lines = getenv("LINES"); |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
675 char * columns = getenv("COLUMNS"); |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
676 |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
677 if (lines != NULL && columns != NULL) |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
678 { |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
679 SMALL_RECT new_win_dims; |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
680 COORD new_size; |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
681 |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
682 new_size.X = atoi (columns); |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
683 new_size.Y = atoi (lines); |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
684 |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
685 GetConsoleScreenBufferInfo (cur_screen, &info); |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
686 |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
687 /* Shrink the window first, so the buffer dimensions can be |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
688 reduced if necessary. */ |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
689 new_win_dims.Top = 0; |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
690 new_win_dims.Left = 0; |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
691 new_win_dims.Bottom = min (new_size.Y, info.dwSize.Y) - 1; |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
692 new_win_dims.Right = min (new_size.X, info.dwSize.X) - 1; |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
693 SetConsoleWindowInfo (cur_screen, TRUE, &new_win_dims); |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
694 |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
695 SetConsoleScreenBufferSize (cur_screen, new_size); |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
696 |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
697 /* Set the window size to match the buffer dimension. */ |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
698 new_win_dims.Top = 0; |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
699 new_win_dims.Left = 0; |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
700 new_win_dims.Bottom = new_size.Y - 1; |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
701 new_win_dims.Right = new_size.X - 1; |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
702 SetConsoleWindowInfo (cur_screen, TRUE, &new_win_dims); |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
703 } |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
704 } |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
705 |
9907 | 706 GetConsoleScreenBufferInfo (cur_screen, &info); |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
707 |
27518
ff2e0205b5a0
(turn_on_face, turn_off_face): Removed.
Jason Rumney <jasonr@gnu.org>
parents:
27395
diff
changeset
|
708 char_attr_normal = info.wAttributes; |
23572
1fa5f9f5c92e
(initialize_w32_display): Use buffer coords
Geoff Voelker <voelker@cs.washington.edu>
parents:
23563
diff
changeset
|
709 |
64111
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
710 /* Determine if the info returned by GetConsoleScreenBufferInfo |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
711 is realistic. Old MS Telnet servers used to only fill out |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
712 the dwSize portion, even modern one fill the whole struct with |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
713 garbage when using non-MS telnet clients. */ |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
714 if ((w32_use_full_screen_buffer |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
715 && (info.dwSize.Y < 20 || info.dwSize.Y > 100 |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
716 || info.dwSize.X < 40 || info.dwSize.X > 200)) |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
717 || (!w32_use_full_screen_buffer |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
718 && (info.srWindow.Bottom - info.srWindow.Top < 20 |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
719 || info.srWindow.Bottom - info.srWindow.Top > 100 |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
720 || info.srWindow.Right - info.srWindow.Left < 40 |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
721 || info.srWindow.Right - info.srWindow.Left > 100))) |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
722 { |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
723 FRAME_LINES (SELECTED_FRAME ()) = 25; |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
724 SET_FRAME_COLS (SELECTED_FRAME (), 80); |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
725 } |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
726 |
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
727 else if (w32_use_full_screen_buffer) |
24938
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
728 { |
51206
22a5614b558f
Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
50247
diff
changeset
|
729 FRAME_LINES (SELECTED_FRAME ()) = info.dwSize.Y; /* lines per page */ |
22a5614b558f
Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
50247
diff
changeset
|
730 SET_FRAME_COLS (SELECTED_FRAME (), info.dwSize.X); /* characters per line */ |
24938
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
731 } |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
732 else |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
733 { |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
734 /* Lines per page. Use buffer coords instead of buffer size. */ |
51206
22a5614b558f
Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
50247
diff
changeset
|
735 FRAME_LINES (SELECTED_FRAME ()) = 1 + info.srWindow.Bottom - |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
736 info.srWindow.Top; |
24938
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
737 /* Characters per line. Use buffer coords instead of buffer size. */ |
51206
22a5614b558f
Make (few) trivial substitutions for renamed and
Kim F. Storm <storm@cua.dk>
parents:
50247
diff
changeset
|
738 SET_FRAME_COLS (SELECTED_FRAME (), 1 + info.srWindow.Right - |
24938
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
739 info.srWindow.Left); |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
740 } |
27892
1857b9695885
Only disable window system features for dispextern.h
Jason Rumney <jasonr@gnu.org>
parents:
27518
diff
changeset
|
741 |
1857b9695885
Only disable window system features for dispextern.h
Jason Rumney <jasonr@gnu.org>
parents:
27518
diff
changeset
|
742 /* Setup w32_display_info structure for this frame. */ |
1857b9695885
Only disable window system features for dispextern.h
Jason Rumney <jasonr@gnu.org>
parents:
27518
diff
changeset
|
743 |
1857b9695885
Only disable window system features for dispextern.h
Jason Rumney <jasonr@gnu.org>
parents:
27518
diff
changeset
|
744 w32_initialize_display_info (build_string ("Console")); |
1857b9695885
Only disable window system features for dispextern.h
Jason Rumney <jasonr@gnu.org>
parents:
27518
diff
changeset
|
745 |
9907 | 746 } |
747 | |
83573
b77b83741308
(w32con_move_cursor, w32con_clear_to_end):
Jason Rumney <jasonr@gnu.org>
parents:
75227
diff
changeset
|
748 |
9907 | 749 DEFUN ("set-screen-color", Fset_screen_color, Sset_screen_color, 2, 2, 0, |
40962
f66d09d1bb2f
Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents:
40656
diff
changeset
|
750 doc: /* Set screen colors. */) |
9907 | 751 (foreground, background) |
752 Lisp_Object foreground; | |
753 Lisp_Object background; | |
754 { | |
755 char_attr_normal = XFASTINT (foreground) + (XFASTINT (background) << 4); | |
756 | |
757 Frecenter (Qnil); | |
758 return Qt; | |
759 } | |
760 | |
761 DEFUN ("set-cursor-size", Fset_cursor_size, Sset_cursor_size, 1, 1, 0, | |
40962
f66d09d1bb2f
Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents:
40656
diff
changeset
|
762 doc: /* Set cursor size. */) |
9907 | 763 (size) |
764 Lisp_Object size; | |
765 { | |
766 CONSOLE_CURSOR_INFO cci; | |
767 cci.dwSize = XFASTINT (size); | |
768 cci.bVisible = TRUE; | |
769 (void) SetConsoleCursorInfo (cur_screen, &cci); | |
49600
23a1cea22d13
Trailing whitespace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
40962
diff
changeset
|
770 |
9907 | 771 return Qt; |
772 } | |
773 | |
11389 | 774 void |
109152
e27859da5624
src/w32*.c: Convert function definitions to standard C.
Juanma Barranquero <lekktu@gmail.com>
parents:
109116
diff
changeset
|
775 syms_of_ntterm (void) |
9907 | 776 { |
24938
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
777 DEFVAR_BOOL ("w32-use-full-screen-buffer", |
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
778 &w32_use_full_screen_buffer, |
40962
f66d09d1bb2f
Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents:
40656
diff
changeset
|
779 doc: /* Non-nil means make terminal frames use the full screen buffer dimensions. |
71534
cb66cca12fa5
(syms_of_ntterm) <w32-use-full-screen-buffer>: Doc fix - default value changed.
John Paul Wallington <jpw@pobox.com>
parents:
68651
diff
changeset
|
780 This is desirable when running Emacs over telnet. |
40962
f66d09d1bb2f
Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents:
40656
diff
changeset
|
781 A value of nil means use the current console window dimensions; this |
f66d09d1bb2f
Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents:
40656
diff
changeset
|
782 may be preferrable when working directly at the console with a large |
f66d09d1bb2f
Change doc-string comments to `new style'. [w/`doc:' keyword]. Doc fixes.
Jason Rumney <jasonr@gnu.org>
parents:
40656
diff
changeset
|
783 scroll-back buffer. */); |
64111
a948ecc89102
(initialize_w32_display): Detect when the console
Jason Rumney <jasonr@gnu.org>
parents:
64084
diff
changeset
|
784 w32_use_full_screen_buffer = 0; |
24938
a4c871b96d4b
(w32_use_full_screen_buffer): New variable.
Andrew Innes <andrewi@gnu.org>
parents:
24755
diff
changeset
|
785 |
9907 | 786 defsubr (&Sset_screen_color); |
787 defsubr (&Sset_cursor_size); | |
11389 | 788 defsubr (&Sset_message_beep); |
9907 | 789 } |
52401 | 790 |
791 /* arch-tag: a390a07f-f661-42bc-aeb4-e6d8bf860337 | |
792 (do not change this comment) */ |