aboutsummaryrefslogtreecommitdiffstats
path: root/src/w32console.c
diff options
context:
space:
mode:
authorJason Rumney2004-05-18 19:48:51 +0000
committerJason Rumney2004-05-18 19:48:51 +0000
commit7cb010ed71e28e79bdce5e22ce6f257ca991a008 (patch)
tree952790264470af031ac9b22e9967f9189fd9eaeb /src/w32console.c
parenta7f7f2540f02834ad128d0c9357a4dbd8222dff4 (diff)
downloademacs-7cb010ed71e28e79bdce5e22ce6f257ca991a008.tar.gz
emacs-7cb010ed71e28e79bdce5e22ce6f257ca991a008.zip
Prefix RIF functions with w32con_ to avoid namespace clash with term.c.
Diffstat (limited to 'src/w32console.c')
-rw-r--r--src/w32console.c124
1 files changed, 62 insertions, 62 deletions
diff --git a/src/w32console.c b/src/w32console.c
index b2d340d579c..74a8fd6338e 100644
--- a/src/w32console.c
+++ b/src/w32console.c
@@ -53,20 +53,20 @@ extern int read_input_pending ();
53extern struct frame * updating_frame; 53extern struct frame * updating_frame;
54extern int meta_key; 54extern int meta_key;
55 55
56static void move_cursor (int row, int col); 56static void w32con_move_cursor (int row, int col);
57static void clear_to_end (void); 57static void w32con_clear_to_end (void);
58void clear_frame (void); 58static void w32con_clear_frame (void);
59void clear_end_of_line (int); 59static void w32con_clear_end_of_line (int);
60static void ins_del_lines (int vpos, int n); 60static void w32con_ins_del_lines (int vpos, int n);
61void insert_glyphs (struct glyph *start, int len); 61static void w32con_insert_glyphs (struct glyph *start, int len);
62void write_glyphs (struct glyph *string, int len); 62static void w32con_write_glyphs (struct glyph *string, int len);
63void delete_glyphs (int n); 63static void w32con_delete_glyphs (int n);
64void w32_sys_ring_bell (void); 64void w32_sys_ring_bell (void);
65void reset_terminal_modes (void); 65static void w32con_reset_terminal_modes (void);
66void set_terminal_modes (void); 66static void w32con_set_terminal_modes (void);
67void set_terminal_window (int size); 67static void w32con_set_terminal_window (int size);
68void update_begin (struct frame * f); 68static void w32con_update_begin (struct frame * f);
69void update_end (struct frame * f); 69static void w32con_update_end (struct frame * f);
70static WORD w32_face_attributes (struct frame *f, int face_id); 70static WORD w32_face_attributes (struct frame *f, int face_id);
71 71
72static COORD cursor_coords; 72static COORD cursor_coords;
@@ -104,7 +104,7 @@ ctrl_c_handler (unsigned long type)
104 104
105/* Move the cursor to (row, col). */ 105/* Move the cursor to (row, col). */
106static void 106static void
107move_cursor (int row, int col) 107w32con_move_cursor (int row, int col)
108{ 108{
109 cursor_coords.X = col; 109 cursor_coords.X = col;
110 cursor_coords.Y = row; 110 cursor_coords.Y = row;
@@ -117,17 +117,17 @@ move_cursor (int row, int col)
117 117
118/* Clear from cursor to end of screen. */ 118/* Clear from cursor to end of screen. */
119static void 119static void
120clear_to_end (void) 120w32con_clear_to_end (void)
121{ 121{
122 struct frame * f = PICK_FRAME (); 122 struct frame * f = PICK_FRAME ();
123 123
124 clear_end_of_line (FRAME_COLS (f) - 1); 124 w32con_clear_end_of_line (FRAME_COLS (f) - 1);
125 ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1); 125 w32con_ins_del_lines (cursor_coords.Y, FRAME_LINES (f) - cursor_coords.Y - 1);
126} 126}
127 127
128/* Clear the frame. */ 128/* Clear the frame. */
129void 129static void
130clear_frame (void) 130w32con_clear_frame (void)
131{ 131{
132 struct frame * f = PICK_FRAME (); 132 struct frame * f = PICK_FRAME ();
133 COORD dest; 133 COORD dest;
@@ -144,7 +144,7 @@ clear_frame (void)
144 FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r); 144 FillConsoleOutputAttribute (cur_screen, char_attr_normal, n, dest, &r);
145 FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r); 145 FillConsoleOutputCharacter (cur_screen, ' ', n, dest, &r);
146 146
147 move_cursor (0, 0); 147 w32con_move_cursor (0, 0);
148} 148}
149 149
150 150
@@ -152,8 +152,8 @@ static struct glyph glyph_base[256];
152static BOOL ceol_initialized = FALSE; 152static BOOL ceol_initialized = FALSE;
153 153
154/* Clear from Cursor to end (what's "standout marker"?). */ 154/* Clear from Cursor to end (what's "standout marker"?). */
155void 155static void
156clear_end_of_line (int end) 156w32con_clear_end_of_line (int end)
157{ 157{
158 if (!ceol_initialized) 158 if (!ceol_initialized)
159 { 159 {
@@ -164,12 +164,12 @@ clear_end_of_line (int end)
164 } 164 }
165 ceol_initialized = TRUE; 165 ceol_initialized = TRUE;
166 } 166 }
167 write_glyphs (glyph_base, end - cursor_coords.X); /* fencepost ? */ 167 w32con_write_glyphs (glyph_base, end - cursor_coords.X); /* fencepost ? */
168} 168}
169 169
170/* Insert n lines at vpos. if n is negative delete -n lines. */ 170/* Insert n lines at vpos. if n is negative delete -n lines. */
171void 171static void
172ins_del_lines (int vpos, int n) 172w32con_ins_del_lines (int vpos, int n)
173{ 173{
174 int i, nb; 174 int i, nb;
175 SMALL_RECT scroll; 175 SMALL_RECT scroll;
@@ -212,8 +212,8 @@ ins_del_lines (int vpos, int n)
212 { 212 {
213 for (i = scroll.Bottom; i < dest.Y; i++) 213 for (i = scroll.Bottom; i < dest.Y; i++)
214 { 214 {
215 move_cursor (i, 0); 215 w32con_move_cursor (i, 0);
216 clear_end_of_line (FRAME_COLS (f)); 216 w32con_clear_end_of_line (FRAME_COLS (f));
217 } 217 }
218 } 218 }
219 } 219 }
@@ -225,8 +225,8 @@ ins_del_lines (int vpos, int n)
225 { 225 {
226 for (i = nb; i < scroll.Top; i++) 226 for (i = nb; i < scroll.Top; i++)
227 { 227 {
228 move_cursor (i, 0); 228 w32con_move_cursor (i, 0);
229 clear_end_of_line (FRAME_COLS (f)); 229 w32con_clear_end_of_line (FRAME_COLS (f));
230 } 230 }
231 } 231 }
232 } 232 }
@@ -275,8 +275,8 @@ scroll_line (int dist, int direction)
275 275
276 276
277/* If start is zero insert blanks instead of a string at start ?. */ 277/* If start is zero insert blanks instead of a string at start ?. */
278void 278static void
279insert_glyphs (register struct glyph *start, register int len) 279w32con_insert_glyphs (register struct glyph *start, register int len)
280{ 280{
281 scroll_line (len, RIGHT); 281 scroll_line (len, RIGHT);
282 282
@@ -286,16 +286,16 @@ insert_glyphs (register struct glyph *start, register int len)
286 /* Print the first len characters of start, cursor_coords.X adjusted 286 /* Print the first len characters of start, cursor_coords.X adjusted
287 by write_glyphs. */ 287 by write_glyphs. */
288 288
289 write_glyphs (start, len); 289 w32con_write_glyphs (start, len);
290 } 290 }
291 else 291 else
292 { 292 {
293 clear_end_of_line (cursor_coords.X + len); 293 w32con_clear_end_of_line (cursor_coords.X + len);
294 } 294 }
295} 295}
296 296
297void 297static void
298write_glyphs (register struct glyph *string, register int len) 298w32con_write_glyphs (register struct glyph *string, register int len)
299{ 299{
300 int produced, consumed; 300 int produced, consumed;
301 DWORD r; 301 DWORD r;
@@ -353,7 +353,7 @@ write_glyphs (register struct glyph *string, register int len)
353 } 353 }
354 354
355 cursor_coords.X += produced; 355 cursor_coords.X += produced;
356 move_cursor (cursor_coords.Y, cursor_coords.X); 356 w32con_move_cursor (cursor_coords.Y, cursor_coords.X);
357 } 357 }
358 len -= consumed; 358 len -= consumed;
359 n -= consumed; 359 n -= consumed;
@@ -391,8 +391,8 @@ write_glyphs (register struct glyph *string, register int len)
391} 391}
392 392
393 393
394void 394static void
395delete_glyphs (int n) 395w32con_delete_glyphs (int n)
396{ 396{
397 /* delete chars means scroll chars from cursor_coords.X + n to 397 /* delete chars means scroll chars from cursor_coords.X + n to
398 cursor_coords.X, anything beyond the edge of the screen should 398 cursor_coords.X, anything beyond the edge of the screen should
@@ -450,8 +450,8 @@ SOUND is nil to use the normal beep. */)
450 return sound; 450 return sound;
451} 451}
452 452
453void 453static void
454reset_terminal_modes (void) 454w32con_reset_terminal_modes (void)
455{ 455{
456#ifdef USE_SEPARATE_SCREEN 456#ifdef USE_SEPARATE_SCREEN
457 SetConsoleActiveScreenBuffer (prev_screen); 457 SetConsoleActiveScreenBuffer (prev_screen);
@@ -461,8 +461,8 @@ reset_terminal_modes (void)
461 SetConsoleMode (keyboard_handle, prev_console_mode); 461 SetConsoleMode (keyboard_handle, prev_console_mode);
462} 462}
463 463
464void 464static void
465set_terminal_modes (void) 465w32con_set_terminal_modes (void)
466{ 466{
467 CONSOLE_CURSOR_INFO cci; 467 CONSOLE_CURSOR_INFO cci;
468 468
@@ -484,19 +484,19 @@ set_terminal_modes (void)
484 clumps rather than one-character-at-a-time... 484 clumps rather than one-character-at-a-time...
485 485
486 we'll start with not moving the cursor while an update is in progress. */ 486 we'll start with not moving the cursor while an update is in progress. */
487void 487static void
488update_begin (struct frame * f) 488w32con_update_begin (struct frame * f)
489{ 489{
490} 490}
491 491
492void 492static void
493update_end (struct frame * f) 493w32con_update_end (struct frame * f)
494{ 494{
495 SetConsoleCursorPosition (cur_screen, cursor_coords); 495 SetConsoleCursorPosition (cur_screen, cursor_coords);
496} 496}
497 497
498void 498static void
499set_terminal_window (int size) 499w32con_set_terminal_window (int size)
500{ 500{
501} 501}
502 502
@@ -574,21 +574,21 @@ initialize_w32_display (void)
574{ 574{
575 CONSOLE_SCREEN_BUFFER_INFO info; 575 CONSOLE_SCREEN_BUFFER_INFO info;
576 576
577 cursor_to_hook = move_cursor; 577 cursor_to_hook = w32con_move_cursor;
578 raw_cursor_to_hook = move_cursor; 578 raw_cursor_to_hook = w32con_move_cursor;
579 clear_to_end_hook = clear_to_end; 579 clear_to_end_hook = w32con_clear_to_end;
580 clear_frame_hook = clear_frame; 580 clear_frame_hook = w32con_clear_frame;
581 clear_end_of_line_hook = clear_end_of_line; 581 clear_end_of_line_hook = w32con_clear_end_of_line;
582 ins_del_lines_hook = ins_del_lines; 582 ins_del_lines_hook = w32con_ins_del_lines;
583 insert_glyphs_hook = insert_glyphs; 583 insert_glyphs_hook = w32con_insert_glyphs;
584 write_glyphs_hook = write_glyphs; 584 write_glyphs_hook = w32con_write_glyphs;
585 delete_glyphs_hook = delete_glyphs; 585 delete_glyphs_hook = w32con_delete_glyphs;
586 ring_bell_hook = w32_sys_ring_bell; 586 ring_bell_hook = w32_sys_ring_bell;
587 reset_terminal_modes_hook = reset_terminal_modes; 587 reset_terminal_modes_hook = w32con_reset_terminal_modes;
588 set_terminal_modes_hook = set_terminal_modes; 588 set_terminal_modes_hook = w32con_set_terminal_modes;
589 set_terminal_window_hook = set_terminal_window; 589 set_terminal_window_hook = w32con_set_terminal_window;
590 update_begin_hook = update_begin; 590 update_begin_hook = w32con_update_begin;
591 update_end_hook = update_end; 591 update_end_hook = w32con_update_end;
592 592
593 read_socket_hook = w32_console_read_socket; 593 read_socket_hook = w32_console_read_socket;
594 mouse_position_hook = w32_console_mouse_position; 594 mouse_position_hook = w32_console_mouse_position;