diff options
| author | Jason Rumney | 2004-05-18 19:48:51 +0000 |
|---|---|---|
| committer | Jason Rumney | 2004-05-18 19:48:51 +0000 |
| commit | 7cb010ed71e28e79bdce5e22ce6f257ca991a008 (patch) | |
| tree | 952790264470af031ac9b22e9967f9189fd9eaeb /src/w32console.c | |
| parent | a7f7f2540f02834ad128d0c9357a4dbd8222dff4 (diff) | |
| download | emacs-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.c | 124 |
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 (); | |||
| 53 | extern struct frame * updating_frame; | 53 | extern struct frame * updating_frame; |
| 54 | extern int meta_key; | 54 | extern int meta_key; |
| 55 | 55 | ||
| 56 | static void move_cursor (int row, int col); | 56 | static void w32con_move_cursor (int row, int col); |
| 57 | static void clear_to_end (void); | 57 | static void w32con_clear_to_end (void); |
| 58 | void clear_frame (void); | 58 | static void w32con_clear_frame (void); |
| 59 | void clear_end_of_line (int); | 59 | static void w32con_clear_end_of_line (int); |
| 60 | static void ins_del_lines (int vpos, int n); | 60 | static void w32con_ins_del_lines (int vpos, int n); |
| 61 | void insert_glyphs (struct glyph *start, int len); | 61 | static void w32con_insert_glyphs (struct glyph *start, int len); |
| 62 | void write_glyphs (struct glyph *string, int len); | 62 | static void w32con_write_glyphs (struct glyph *string, int len); |
| 63 | void delete_glyphs (int n); | 63 | static void w32con_delete_glyphs (int n); |
| 64 | void w32_sys_ring_bell (void); | 64 | void w32_sys_ring_bell (void); |
| 65 | void reset_terminal_modes (void); | 65 | static void w32con_reset_terminal_modes (void); |
| 66 | void set_terminal_modes (void); | 66 | static void w32con_set_terminal_modes (void); |
| 67 | void set_terminal_window (int size); | 67 | static void w32con_set_terminal_window (int size); |
| 68 | void update_begin (struct frame * f); | 68 | static void w32con_update_begin (struct frame * f); |
| 69 | void update_end (struct frame * f); | 69 | static void w32con_update_end (struct frame * f); |
| 70 | static WORD w32_face_attributes (struct frame *f, int face_id); | 70 | static WORD w32_face_attributes (struct frame *f, int face_id); |
| 71 | 71 | ||
| 72 | static COORD cursor_coords; | 72 | static 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). */ |
| 106 | static void | 106 | static void |
| 107 | move_cursor (int row, int col) | 107 | w32con_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. */ |
| 119 | static void | 119 | static void |
| 120 | clear_to_end (void) | 120 | w32con_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. */ |
| 129 | void | 129 | static void |
| 130 | clear_frame (void) | 130 | w32con_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]; | |||
| 152 | static BOOL ceol_initialized = FALSE; | 152 | static 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"?). */ |
| 155 | void | 155 | static void |
| 156 | clear_end_of_line (int end) | 156 | w32con_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. */ |
| 171 | void | 171 | static void |
| 172 | ins_del_lines (int vpos, int n) | 172 | w32con_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 ?. */ |
| 278 | void | 278 | static void |
| 279 | insert_glyphs (register struct glyph *start, register int len) | 279 | w32con_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 | ||
| 297 | void | 297 | static void |
| 298 | write_glyphs (register struct glyph *string, register int len) | 298 | w32con_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 | ||
| 394 | void | 394 | static void |
| 395 | delete_glyphs (int n) | 395 | w32con_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 | ||
| 453 | void | 453 | static void |
| 454 | reset_terminal_modes (void) | 454 | w32con_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 | ||
| 464 | void | 464 | static void |
| 465 | set_terminal_modes (void) | 465 | w32con_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. */ |
| 487 | void | 487 | static void |
| 488 | update_begin (struct frame * f) | 488 | w32con_update_begin (struct frame * f) |
| 489 | { | 489 | { |
| 490 | } | 490 | } |
| 491 | 491 | ||
| 492 | void | 492 | static void |
| 493 | update_end (struct frame * f) | 493 | w32con_update_end (struct frame * f) |
| 494 | { | 494 | { |
| 495 | SetConsoleCursorPosition (cur_screen, cursor_coords); | 495 | SetConsoleCursorPosition (cur_screen, cursor_coords); |
| 496 | } | 496 | } |
| 497 | 497 | ||
| 498 | void | 498 | static void |
| 499 | set_terminal_window (int size) | 499 | w32con_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; |