Commit | Line | Data |
---|---|---|
6cdfb6e6 RS |
1 | /* Terminal hooks for Windows NT port of GNU Emacs. |
2 | Copyright (C) 1992 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of GNU Emacs. | |
5 | ||
6 | GNU Emacs is free software; you can redistribute it and/or modify it | |
7 | under the terms of the GNU General Public License as published by the | |
8 | Free Software Foundation; either version 2, or (at your option) any later | |
9 | version. | |
10 | ||
11 | GNU Emacs is distributed in the hope that it will be useful, but WITHOUT | |
12 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
13 | FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | |
14 | more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License along | |
17 | with GNU Emacs; see the file COPYING. If not, write to the Free Software | |
18 | Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. | |
19 | ||
20 | Tim Fleehart (apollo@online.com) 1-17-92 | |
21 | Geoff Voelker (voelker@cs.washington.edu) 9-12-93 | |
22 | */ | |
23 | ||
24 | ||
25 | #include <stdlib.h> | |
26 | #include <stdio.h> | |
27 | ||
28 | #include "config.h" | |
29 | ||
30 | #include <windows.h> | |
31 | ||
32 | #include "lisp.h" | |
33 | #include "frame.h" | |
34 | #include "disptab.h" | |
35 | #include "termhooks.h" | |
36 | ||
37 | #include "ntinevt.h" | |
38 | ||
0534d577 | 39 | /* from window.c */ |
6cdfb6e6 RS |
40 | extern Lisp_Object Frecenter (); |
41 | ||
42 | /* from keyboard.c */ | |
43 | extern int detect_input_pending (); | |
44 | ||
45 | /* from sysdep.c */ | |
46 | extern int read_input_pending (); | |
47 | ||
48 | extern FRAME_PTR updating_frame; | |
49 | extern int meta_key; | |
50 | ||
51 | static void move_cursor (int row, int col); | |
52 | static void clear_to_end (void); | |
53 | static void clear_frame (void); | |
54 | static void clear_end_of_line (int); | |
55 | static void ins_del_lines (int vpos, int n); | |
56 | static void change_line_highlight (int, int, int); | |
57 | static void reassert_line_highlight (int, int); | |
58 | static void insert_glyphs (GLYPH *start, int len); | |
59 | static void write_glyphs (GLYPH *string, int len); | |
60 | static void delete_glyphs (int n); | |
61 | static void ring_bell (void); | |
62 | static void reset_terminal_modes (void); | |
63 | static void set_terminal_modes (void); | |
64 | static void set_terminal_window (int size); | |
65 | static void update_begin (FRAME_PTR f); | |
66 | static void update_end (FRAME_PTR f); | |
67 | static void reset_kbd (void); | |
68 | static void unset_kbd (void); | |
69 | static int hl_mode (int new_highlight); | |
70 | ||
71 | void | |
72 | DebPrint () | |
73 | { | |
74 | } | |
75 | ||
76 | /* Init hook called in init_keyboard. */ | |
77 | void (*keyboard_init_hook)(void) = reset_kbd; | |
78 | ||
79 | COORD cursor_coords; | |
80 | HANDLE prev_screen, cur_screen; | |
81 | UCHAR char_attr, char_attr_normal, char_attr_reverse; | |
82 | HANDLE keyboard_handle; | |
83 | ||
84 | ||
85 | /* Setting this as the ctrl handler prevents emacs from being killed when | |
86 | * someone hits ^C in a 'suspended' session (child shell). */ | |
87 | BOOL | |
88 | ctrl_c_handler (unsigned long type) | |
89 | { | |
90 | return (type == CTRL_C_EVENT) ? TRUE : FALSE; | |
91 | } | |
92 | ||
93 | /* If we're updating a frame, use it as the current frame | |
94 | Otherwise, use the selected frame. */ | |
95 | #define PICK_FRAME() (updating_frame ? updating_frame : selected_frame) | |
96 | ||
97 | /* Move the cursor to (row, col). */ | |
98 | void | |
99 | move_cursor (int row, int col) | |
100 | { | |
101 | cursor_coords.X = col; | |
102 | cursor_coords.Y = row; | |
103 | ||
0534d577 | 104 | if (updating_frame == (FRAME_PTR) NULL) |
6cdfb6e6 RS |
105 | { |
106 | SetConsoleCursorPosition (cur_screen, cursor_coords); | |
107 | } | |
108 | } | |
109 | ||
110 | /* Clear from cursor to end of screen. */ | |
111 | void | |
112 | clear_to_end (void) | |
113 | { | |
114 | FRAME_PTR f = PICK_FRAME (); | |
115 | ||
116 | clear_end_of_line (FRAME_WIDTH (f) - 1); | |
117 | ins_del_lines (cursor_coords.Y, FRAME_HEIGHT (f) - cursor_coords.Y - 1); | |
118 | } | |
119 | ||
120 | /* Clear the frame. */ | |
121 | void | |
122 | clear_frame (void) | |
123 | { | |
124 | SMALL_RECT scroll; | |
125 | COORD dest; | |
126 | CHAR_INFO fill; | |
127 | FRAME_PTR f = PICK_FRAME (); | |
128 | ||
129 | hl_mode (0); | |
130 | ||
131 | scroll.Top = 0; | |
132 | scroll.Bottom = FRAME_HEIGHT (f) - 1; | |
133 | scroll.Left = 0; | |
134 | scroll.Right = FRAME_WIDTH (f) - 1; | |
135 | ||
136 | dest.Y = FRAME_HEIGHT (f); | |
137 | dest.X = 0; | |
138 | ||
139 | fill.Char.AsciiChar = 0x20; | |
140 | fill.Attributes = char_attr; | |
141 | ||
142 | ScrollConsoleScreenBuffer (cur_screen, &scroll, NULL, dest, &fill); | |
143 | move_cursor (0, 0); | |
144 | } | |
145 | ||
146 | ||
147 | static GLYPH glyph_base[256]; | |
148 | static BOOL ceol_initialized = FALSE; | |
149 | ||
150 | /* Clear from Cursor to end (what's "standout marker"?). */ | |
151 | void | |
152 | clear_end_of_line (int end) | |
153 | { | |
154 | if (!ceol_initialized) | |
155 | { | |
156 | int i; | |
157 | for (i = 0; i < 256; i++) | |
158 | { | |
159 | glyph_base[i] = SPACEGLYPH; /* empty space */ | |
160 | } | |
161 | ceol_initialized = TRUE; | |
162 | } | |
163 | write_glyphs (glyph_base, end - cursor_coords.X); /* fencepost ? */ | |
164 | } | |
165 | ||
166 | /* Insert n lines at vpos. if n is negative delete -n lines. */ | |
167 | void | |
168 | ins_del_lines (int vpos, int n) | |
169 | { | |
170 | int i, nb, save_highlight; | |
171 | SMALL_RECT scroll; | |
172 | COORD dest; | |
173 | CHAR_INFO fill; | |
174 | FRAME_PTR f = PICK_FRAME (); | |
175 | ||
176 | if (n < 0) | |
177 | { | |
178 | scroll.Top = vpos - n; | |
179 | scroll.Bottom = FRAME_HEIGHT (f); | |
180 | dest.Y = vpos; | |
181 | } | |
182 | else | |
183 | { | |
184 | scroll.Top = vpos; | |
185 | scroll.Bottom = FRAME_HEIGHT (f) - n; | |
186 | dest.Y = vpos + n; | |
187 | } | |
188 | scroll.Left = 0; | |
189 | scroll.Right = FRAME_WIDTH (f); | |
190 | ||
191 | dest.X = 0; | |
192 | ||
193 | save_highlight = hl_mode (0); | |
194 | ||
195 | fill.Char.AsciiChar = 0x20; | |
196 | fill.Attributes = char_attr; | |
197 | ||
198 | ScrollConsoleScreenBuffer (cur_screen, &scroll, NULL, dest, &fill); | |
199 | ||
200 | /* Here we have to deal with a win32 console flake: If the scroll | |
201 | region looks like abc and we scroll c to a and fill with d we get | |
202 | cbd... if we scroll block c one line at a time to a, we get cdd... | |
203 | Emacs expects cdd consistently... So we have to deal with that | |
204 | here... (this also occurs scrolling the same way in the other | |
205 | direction. */ | |
206 | ||
207 | if (n > 0) | |
208 | { | |
209 | if (scroll.Bottom < dest.Y) | |
210 | { | |
211 | for (i = scroll.Bottom; i < dest.Y; i++) | |
212 | { | |
213 | move_cursor (i, 0); | |
214 | clear_end_of_line (FRAME_WIDTH (f)); | |
215 | } | |
216 | } | |
217 | } | |
218 | else | |
219 | { | |
220 | nb = dest.Y + (scroll.Bottom - scroll.Top) + 1; | |
221 | ||
222 | if (nb < scroll.Top) | |
223 | { | |
224 | for (i = nb; i < scroll.Top; i++) | |
225 | { | |
226 | move_cursor (i, 0); | |
227 | clear_end_of_line (FRAME_WIDTH (f)); | |
228 | } | |
229 | } | |
230 | } | |
231 | ||
232 | cursor_coords.X = 0; | |
233 | cursor_coords.Y = vpos; | |
234 | ||
235 | hl_mode (save_highlight); | |
236 | } | |
237 | ||
238 | /* Changes attribute to use when drawing characters to control. */ | |
239 | static int | |
240 | hl_mode (int new_highlight) | |
241 | { | |
242 | static int highlight = 0; | |
243 | int old_highlight; | |
244 | ||
245 | old_highlight = highlight; | |
246 | highlight = (new_highlight != 0); | |
247 | if (highlight) | |
248 | { | |
249 | char_attr = char_attr_reverse; | |
250 | } | |
251 | else | |
252 | { | |
253 | char_attr = char_attr_normal; | |
254 | } | |
255 | return old_highlight; | |
256 | } | |
257 | ||
258 | /* Call this when about to modify line at position VPOS and change whether it | |
259 | is highlighted. */ | |
260 | void | |
261 | change_line_highlight (int new_highlight, int vpos, int first_unused_hpos) | |
262 | { | |
263 | hl_mode (new_highlight); | |
264 | move_cursor (vpos, 0); | |
265 | clear_end_of_line (first_unused_hpos); | |
266 | } | |
267 | ||
268 | /* External interface to control of standout mode. Call this when about to | |
269 | * modify line at position VPOS and not change whether it is highlighted. */ | |
270 | void | |
271 | reassert_line_highlight (int highlight, int vpos) | |
272 | { | |
273 | hl_mode (highlight); | |
274 | vpos; /* pedantic compiler silencer */ | |
275 | } | |
276 | ||
277 | #undef LEFT | |
278 | #undef RIGHT | |
279 | #define LEFT 1 | |
280 | #define RIGHT 0 | |
281 | ||
282 | void | |
283 | scroll_line (int dist, int direction) | |
284 | { | |
285 | /* The idea here is to implement a horizontal scroll in one line to | |
286 | implement delete and half of insert. */ | |
287 | SMALL_RECT scroll; | |
288 | COORD dest; | |
289 | CHAR_INFO fill; | |
290 | FRAME_PTR f = PICK_FRAME (); | |
291 | ||
292 | scroll.Top = cursor_coords.Y; | |
293 | scroll.Bottom = cursor_coords.Y; | |
294 | ||
295 | if (direction == LEFT) | |
296 | { | |
297 | scroll.Left = cursor_coords.X + dist; | |
298 | scroll.Right = FRAME_WIDTH (f) - 1; | |
299 | } | |
300 | else | |
301 | { | |
302 | scroll.Left = cursor_coords.X; | |
303 | scroll.Right = FRAME_WIDTH (f) - dist - 1; | |
304 | } | |
305 | ||
306 | dest.X = cursor_coords.X; | |
307 | dest.Y = cursor_coords.Y; | |
308 | ||
309 | fill.Char.AsciiChar = 0x20; | |
310 | fill.Attributes = char_attr; | |
311 | ||
312 | ScrollConsoleScreenBuffer (cur_screen, &scroll, NULL, dest, &fill); | |
313 | } | |
314 | ||
315 | ||
316 | /* If start is zero insert blanks instead of a string at start ?. */ | |
317 | void | |
318 | insert_glyphs (register GLYPH *start, register int len) | |
319 | { | |
320 | scroll_line (len, RIGHT); | |
321 | ||
322 | /* Move len chars to the right starting at cursor_coords, fill with blanks */ | |
323 | if (start) | |
324 | { | |
325 | /* Print the first len characters of start, cursor_coords.X adjusted | |
326 | by write_glyphs. */ | |
327 | ||
328 | write_glyphs (start, len); | |
329 | } | |
330 | else | |
331 | { | |
332 | clear_end_of_line (cursor_coords.X + len); | |
333 | } | |
334 | } | |
335 | ||
336 | void | |
337 | write_glyphs (register GLYPH *string, register int len) | |
338 | { | |
339 | register unsigned int glyph_len = GLYPH_TABLE_LENGTH; | |
340 | Lisp_Object *glyph_table = GLYPH_TABLE_BASE; | |
341 | FRAME_PTR f = PICK_FRAME (); | |
342 | register char *ptr; | |
343 | GLYPH glyph; | |
344 | WORD *attrs; | |
345 | char *chars; | |
346 | int i; | |
347 | ||
348 | attrs = alloca (len * sizeof (*attrs)); | |
349 | chars = alloca (len * sizeof (*chars)); | |
350 | if (attrs == NULL || chars == NULL) | |
351 | { | |
352 | printf ("alloca failed in write_glyphs\n"); | |
353 | return; | |
354 | } | |
355 | ||
356 | /* We have to deal with the glyph indirection...go over the glyph | |
357 | buffer and extract the characters. */ | |
358 | ptr = chars; | |
359 | while (--len >= 0) | |
360 | { | |
361 | glyph = *string++; | |
362 | ||
363 | if (glyph > glyph_len) | |
364 | { | |
365 | *ptr++ = glyph & 0xFF; | |
366 | continue; | |
367 | } | |
368 | GLYPH_FOLLOW_ALIASES (glyph_table, glyph_len, glyph); | |
369 | if (GLYPH_FACE (fixfix, glyph) != 0) | |
370 | printf ("Glyph face is %d\n", GLYPH_FACE (fixfix, glyph)); | |
371 | if (GLYPH_SIMPLE_P (glyph_table, glyph_len, glyph)) | |
372 | { | |
373 | *ptr++ = glyph & 0xFF; | |
374 | continue; | |
375 | } | |
376 | for (i = 0; i < GLYPH_LENGTH (glyph_table, glyph); i++) | |
377 | { | |
378 | *ptr++ = (GLYPH_STRING (glyph_table, glyph))[i]; | |
379 | } | |
380 | } | |
381 | ||
382 | /* Number of characters we have in the buffer. */ | |
383 | len = ptr-chars; | |
384 | ||
385 | /* Fill in the attributes for these characters. */ | |
386 | memset (attrs, char_attr, len*sizeof (*attrs)); | |
387 | ||
388 | /* Write the attributes. */ | |
389 | if (!WriteConsoleOutputAttribute (cur_screen, attrs, len, cursor_coords, &i)) | |
390 | { | |
0534d577 | 391 | printf ("Failed writing console attributes: %d\n", GetLastError ()); |
6cdfb6e6 RS |
392 | fflush (stdout); |
393 | } | |
394 | ||
395 | /* Write the characters. */ | |
396 | if (!WriteConsoleOutputCharacter (cur_screen, chars, len, cursor_coords, &i)) | |
397 | { | |
0534d577 | 398 | printf ("Failed writing console characters: %d\n", GetLastError ()); |
6cdfb6e6 RS |
399 | fflush (stdout); |
400 | } | |
401 | ||
402 | cursor_coords.X += len; | |
403 | move_cursor (cursor_coords.Y, cursor_coords.X); | |
404 | } | |
405 | ||
406 | void | |
407 | delete_glyphs (int n) | |
408 | { | |
409 | /* delete chars means scroll chars from cursor_coords.X + n to | |
410 | cursor_coords.X, anything beyond the edge of the screen should | |
411 | come out empty... */ | |
412 | ||
413 | scroll_line (n, LEFT); | |
414 | } | |
415 | ||
0534d577 KH |
416 | static unsigned int sound_type = 0xFFFFFFFF; |
417 | ||
6cdfb6e6 RS |
418 | void |
419 | ring_bell (void) | |
420 | { | |
0534d577 KH |
421 | if (sound_type == 0xFFFFFFFF) |
422 | Beep (666, 100); | |
423 | else | |
424 | MessageBeep (sound_type); | |
6cdfb6e6 RS |
425 | } |
426 | ||
0534d577 KH |
427 | DEFUN ("set-message-beep", Fset_message_beep, Sset_message_beep, 1, 1, 0, |
428 | "Set the sound generated when the bell is rung.\n\ | |
429 | SOUND is 'asterisk, 'exclamation, 'hand, 'question, or 'ok\n\ | |
430 | to use the corresponding system sound for the bell.\n\ | |
431 | SOUND is nil to use the normal beep.") | |
432 | (sound) | |
433 | Lisp_Object sound; | |
6cdfb6e6 | 434 | { |
0534d577 KH |
435 | CHECK_SYMBOL (sound, 0); |
436 | ||
437 | if (NILP (sound)) | |
438 | sound_type = 0xFFFFFFFF; | |
439 | else if (EQ (sound, intern ("asterisk"))) | |
440 | sound_type = MB_ICONASTERISK; | |
441 | else if (EQ (sound, intern ("exclamation"))) | |
442 | sound_type = MB_ICONEXCLAMATION; | |
443 | else if (EQ (sound, intern ("hand"))) | |
444 | sound_type = MB_ICONHAND; | |
445 | else if (EQ (sound, intern ("question"))) | |
446 | sound_type = MB_ICONQUESTION; | |
447 | else if (EQ (sound, intern ("ok"))) | |
448 | sound_type = MB_OK; | |
449 | else | |
450 | sound_type = 0xFFFFFFFF; | |
451 | ||
452 | return sound; | |
6cdfb6e6 RS |
453 | } |
454 | ||
455 | /* Put our console back up, for ending a suspended session. */ | |
456 | void | |
457 | take_console (void) | |
458 | { | |
459 | reset_kbd (); | |
460 | SetConsoleActiveScreenBuffer (cur_screen); | |
461 | } | |
462 | ||
463 | void | |
464 | reset_terminal_modes (void) | |
465 | { | |
466 | unset_kbd (); | |
467 | SetConsoleActiveScreenBuffer (prev_screen); | |
6cdfb6e6 RS |
468 | } |
469 | ||
470 | void | |
471 | set_terminal_modes (void) | |
472 | { | |
473 | CONSOLE_CURSOR_INFO cci; | |
474 | ||
475 | if (cur_screen == NULL) | |
476 | { | |
477 | reset_kbd (); | |
478 | cur_screen = CreateConsoleScreenBuffer (GENERIC_READ | GENERIC_WRITE, | |
479 | 0, NULL, | |
480 | CONSOLE_TEXTMODE_BUFFER, | |
481 | NULL); | |
482 | ||
483 | if (cur_screen == INVALID_HANDLE_VALUE) | |
484 | { | |
485 | printf ("CreateConsoleScreenBuffer failed in ResetTerm\n"); | |
486 | printf ("LastError = 0x%lx\n", GetLastError ()); | |
487 | fflush (stdout); | |
488 | exit (0); | |
489 | } | |
490 | ||
491 | SetConsoleActiveScreenBuffer (cur_screen); | |
492 | ||
493 | /* make cursor big and visible */ | |
494 | cci.dwSize = 100; | |
495 | cci.bVisible = TRUE; | |
496 | (void) SetConsoleCursorInfo (cur_screen, &cci); | |
497 | } | |
498 | } | |
499 | ||
500 | /* hmmm... perhaps these let us bracket screen changes so that we can flush | |
501 | clumps rather than one-character-at-a-time... | |
502 | ||
503 | we'll start with not moving the cursor while an update is in progress. */ | |
504 | void | |
505 | update_begin (FRAME_PTR f) | |
506 | { | |
507 | } | |
508 | ||
509 | void | |
510 | update_end (FRAME_PTR f) | |
511 | { | |
512 | SetConsoleCursorPosition (cur_screen, cursor_coords); | |
513 | } | |
514 | ||
515 | void | |
516 | set_terminal_window (int size) | |
517 | { | |
518 | } | |
519 | ||
520 | void | |
521 | unset_kbd (void) | |
522 | { | |
523 | SetConsoleMode (keyboard_handle, ENABLE_PROCESSED_INPUT | ENABLE_LINE_INPUT | | |
524 | ENABLE_ECHO_INPUT | ENABLE_MOUSE_INPUT); | |
525 | } | |
526 | ||
527 | void | |
528 | reset_kbd (void) | |
529 | { | |
530 | keyboard_handle = GetStdHandle (STD_INPUT_HANDLE); | |
531 | SetConsoleMode (keyboard_handle, ENABLE_MOUSE_INPUT | ENABLE_WINDOW_INPUT); | |
532 | } | |
533 | ||
534 | typedef int (*term_hook) (); | |
535 | ||
536 | void | |
537 | initialize_win_nt_display (void) | |
538 | { | |
539 | CONSOLE_SCREEN_BUFFER_INFO info; | |
540 | ||
541 | cursor_to_hook = (term_hook) move_cursor; | |
542 | raw_cursor_to_hook = (term_hook) move_cursor; | |
543 | clear_to_end_hook = (term_hook) clear_to_end; | |
544 | clear_frame_hook = (term_hook) clear_frame; | |
545 | clear_end_of_line_hook = (term_hook) clear_end_of_line; | |
546 | ins_del_lines_hook = (term_hook) ins_del_lines; | |
547 | change_line_highlight_hook = (term_hook) change_line_highlight; | |
548 | reassert_line_highlight_hook = (term_hook) reassert_line_highlight; | |
549 | insert_glyphs_hook = (term_hook) insert_glyphs; | |
550 | write_glyphs_hook = (term_hook) write_glyphs; | |
551 | delete_glyphs_hook = (term_hook) delete_glyphs; | |
552 | ring_bell_hook = (term_hook) ring_bell; | |
553 | reset_terminal_modes_hook = (term_hook) reset_terminal_modes; | |
554 | set_terminal_modes_hook = (term_hook) set_terminal_modes; | |
555 | set_terminal_window_hook = (term_hook) set_terminal_window; | |
556 | update_begin_hook = (term_hook) update_begin; | |
557 | update_end_hook = (term_hook) update_end; | |
558 | ||
559 | read_socket_hook = win32_read_socket; | |
560 | mouse_position_hook = win32_mouse_position; | |
561 | ||
562 | prev_screen = GetStdHandle (STD_OUTPUT_HANDLE); | |
563 | ||
564 | set_terminal_modes (); | |
565 | ||
566 | GetConsoleScreenBufferInfo (cur_screen, &info); | |
567 | ||
568 | meta_key = 1; | |
569 | char_attr = info.wAttributes & 0xFF; | |
570 | char_attr_normal = char_attr; | |
571 | char_attr_reverse = ((char_attr & 0xf) << 4) + ((char_attr & 0xf0) >> 4); | |
572 | ||
573 | FRAME_HEIGHT (selected_frame) = info.dwSize.Y; /* lines per page */ | |
574 | FRAME_WIDTH (selected_frame) = info.dwSize.X; /* characters per line */ | |
575 | ||
576 | move_cursor (0, 0); | |
577 | ||
578 | clear_frame (); | |
579 | } | |
580 | ||
581 | DEFUN ("set-screen-color", Fset_screen_color, Sset_screen_color, 2, 2, 0, | |
582 | "Set screen colors.") | |
583 | (foreground, background) | |
584 | Lisp_Object foreground; | |
585 | Lisp_Object background; | |
586 | { | |
587 | char_attr_normal = XFASTINT (foreground) + (XFASTINT (background) << 4); | |
588 | char_attr_reverse = XFASTINT (background) + (XFASTINT (foreground) << 4); | |
589 | ||
590 | Frecenter (Qnil); | |
591 | return Qt; | |
592 | } | |
593 | ||
594 | DEFUN ("set-cursor-size", Fset_cursor_size, Sset_cursor_size, 1, 1, 0, | |
595 | "Set cursor size.") | |
596 | (size) | |
597 | Lisp_Object size; | |
598 | { | |
599 | CONSOLE_CURSOR_INFO cci; | |
600 | cci.dwSize = XFASTINT (size); | |
601 | cci.bVisible = TRUE; | |
602 | (void) SetConsoleCursorInfo (cur_screen, &cci); | |
603 | ||
604 | return Qt; | |
605 | } | |
606 | ||
607 | void | |
608 | pixel_to_glyph_coords (FRAME_PTR f, int pix_x, int pix_y, int *x, int *y, | |
609 | void *bounds, int noclip) | |
610 | { | |
611 | *x = pix_x; | |
612 | *y = pix_y; | |
613 | } | |
614 | ||
615 | void | |
616 | glyph_to_pixel_coords (FRAME_PTR f, int x, int y, int *pix_x, int *pix_y) | |
617 | { | |
618 | *pix_x = x; | |
619 | *pix_y = y; | |
620 | } | |
621 | ||
0534d577 | 622 | void |
6cdfb6e6 RS |
623 | syms_of_ntterm () |
624 | { | |
625 | defsubr (&Sset_screen_color); | |
626 | defsubr (&Sset_cursor_size); | |
0534d577 | 627 | defsubr (&Sset_message_beep); |
6cdfb6e6 | 628 | } |