Mercurial > emacs
annotate src/dosfns.c @ 26164:d39ec0a27081
more XCAR/XCDR/XFLOAT_DATA uses, to help isolete lisp engine
author | Ken Raeburn <raeburn@raeburn.org> |
---|---|
date | Mon, 25 Oct 1999 04:58:18 +0000 |
parents | f0cb2d2e49f2 |
children | f5dded41adcc |
rev | line source |
---|---|
5503 | 1 /* MS-DOS specific Lisp utilities. Coded by Manabu Higashida, 1991. |
2 Major changes May-July 1993 Morten Welinder (only 10% original code left) | |
19294
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
3 Copyright (C) 1991, 1993, 1996, 1997 Free Software Foundation, Inc. |
5503 | 4 |
5 This file is part of GNU Emacs. | |
6 | |
7 GNU Emacs is free software; you can redistribute it and/or modify | |
8 it under the terms of the GNU General Public License as published by | |
10504 | 9 the Free Software Foundation; either version 2, or (at your option) |
5503 | 10 any later version. |
11 | |
12 GNU Emacs is distributed in the hope that it will be useful, | |
13 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
15 GNU General Public License for more details. | |
16 | |
17 You should have received a copy of the GNU General Public License | |
18 along with GNU Emacs; see the file COPYING. If not, write to | |
14186
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
14070
diff
changeset
|
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
ee40177f6c68
Update FSF's address in the preamble.
Erik Naggum <erik@naggum.no>
parents:
14070
diff
changeset
|
20 Boston, MA 02111-1307, USA. */ |
5503 | 21 |
22 | |
5980 | 23 #include <config.h> |
5503 | 24 |
25 #ifdef MSDOS | |
26 /* The entire file is within this conditional */ | |
27 | |
28 #include <stdio.h> | |
25113
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
29 #include <string.h> |
5503 | 30 #include <dos.h> |
31 #include "lisp.h" | |
32 #include "buffer.h" | |
33 #include "termchar.h" | |
34 #include "termhooks.h" | |
35 #include "frame.h" | |
20034 | 36 #include "blockinput.h" |
37 #include "window.h" | |
5503 | 38 #include "dosfns.h" |
39 #include "msdos.h" | |
25113
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
40 #include "dispextern.h" |
20034 | 41 #include <dpmi.h> |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
42 #include <go32.h> |
15226
31a30cc1d61a
(init_dosfns) [DJGPP >= 2]: Make `opendir' preserve
Richard M. Stallman <rms@gnu.org>
parents:
15173
diff
changeset
|
43 #include <dirent.h> |
5503 | 44 |
20034 | 45 #ifndef __DJGPP_MINOR__ |
46 # define __tb _go32_info_block.linear_address_of_transfer_buffer; | |
47 #endif | |
48 | |
5503 | 49 DEFUN ("int86", Fint86, Sint86, 2, 2, 0, |
50 "Call specific MSDOS interrupt number INTERRUPT with REGISTERS.\n\ | |
51 Return the updated REGISTER vector.\n\ | |
52 \n\ | |
53 INTERRUPT should be an integer in the range 0 to 255.\n\ | |
54 REGISTERS should be a vector produced by `make-register' and\n\ | |
55 `set-register-value'.") | |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
56 (interrupt, registers) |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
57 Lisp_Object interrupt, registers; |
5503 | 58 { |
59 register int i; | |
60 int no; | |
61 union REGS inregs, outregs; | |
62 Lisp_Object val; | |
63 | |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
64 CHECK_NUMBER (interrupt, 0); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
65 no = (unsigned long) XINT (interrupt); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
66 CHECK_VECTOR (registers, 1); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
67 if (no < 0 || no > 0xff || XVECTOR (registers)-> size != 8) |
5503 | 68 return Qnil; |
69 for (i = 0; i < 8; i++) | |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
70 CHECK_NUMBER (XVECTOR (registers)->contents[i], 1); |
5503 | 71 |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
72 inregs.x.ax = (unsigned long) XFASTINT (XVECTOR (registers)->contents[0]); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
73 inregs.x.bx = (unsigned long) XFASTINT (XVECTOR (registers)->contents[1]); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
74 inregs.x.cx = (unsigned long) XFASTINT (XVECTOR (registers)->contents[2]); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
75 inregs.x.dx = (unsigned long) XFASTINT (XVECTOR (registers)->contents[3]); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
76 inregs.x.si = (unsigned long) XFASTINT (XVECTOR (registers)->contents[4]); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
77 inregs.x.di = (unsigned long) XFASTINT (XVECTOR (registers)->contents[5]); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
78 inregs.x.cflag = (unsigned long) XFASTINT (XVECTOR (registers)->contents[6]); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
79 inregs.x.flags = (unsigned long) XFASTINT (XVECTOR (registers)->contents[7]); |
5503 | 80 |
81 int86 (no, &inregs, &outregs); | |
82 | |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
83 XVECTOR (registers)->contents[0] = make_number (outregs.x.ax); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
84 XVECTOR (registers)->contents[1] = make_number (outregs.x.bx); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
85 XVECTOR (registers)->contents[2] = make_number (outregs.x.cx); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
86 XVECTOR (registers)->contents[3] = make_number (outregs.x.dx); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
87 XVECTOR (registers)->contents[4] = make_number (outregs.x.si); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
88 XVECTOR (registers)->contents[5] = make_number (outregs.x.di); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
89 XVECTOR (registers)->contents[6] = make_number (outregs.x.cflag); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
90 XVECTOR (registers)->contents[7] = make_number (outregs.x.flags); |
5503 | 91 |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
92 return registers; |
5503 | 93 } |
94 | |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
95 DEFUN ("msdos-memget", Fdos_memget, Sdos_memget, 2, 2, 0, |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
96 "Read DOS memory at offset ADDRESS into VECTOR.\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
97 Return the updated VECTOR.") |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
98 (address, vector) |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
99 Lisp_Object address, vector; |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
100 { |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
101 register int i; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
102 int offs, len; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
103 char *buf; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
104 Lisp_Object val; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
105 |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
106 CHECK_NUMBER (address, 0); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
107 offs = (unsigned long) XINT (address); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
108 CHECK_VECTOR (vector, 1); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
109 len = XVECTOR (vector)-> size; |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
110 if (len < 1 || len > 2048 || address < 0 || address > 0xfffff - len) |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
111 return Qnil; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
112 buf = alloca (len); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
113 dosmemget (offs, len, buf); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
114 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
115 for (i = 0; i < len; i++) |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
116 XVECTOR (vector)->contents[i] = make_number (buf[i]); |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
117 |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
118 return vector; |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
119 } |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
120 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
121 DEFUN ("msdos-memput", Fdos_memput, Sdos_memput, 2, 2, 0, |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
122 "Write DOS memory at offset ADDRESS from VECTOR.") |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
123 (address, vector) |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
124 Lisp_Object address, vector; |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
125 { |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
126 register int i; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
127 int offs, len; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
128 char *buf; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
129 Lisp_Object val; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
130 |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
131 CHECK_NUMBER (address, 0); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
132 offs = (unsigned long) XINT (address); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
133 CHECK_VECTOR (vector, 1); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
134 len = XVECTOR (vector)-> size; |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
135 if (len < 1 || len > 2048 || address < 0 || address > 0xfffff - len) |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
136 return Qnil; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
137 buf = alloca (len); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
138 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
139 for (i = 0; i < len; i++) |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
140 { |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
141 CHECK_NUMBER (XVECTOR (vector)->contents[i], 1); |
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
142 buf[i] = (unsigned char) XFASTINT (XVECTOR (vector)->contents[i]) & 0xFF; |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
143 } |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
144 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
145 dosmemput (buf, len, offs); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
146 return Qt; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
147 } |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
148 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
149 DEFUN ("msdos-set-keyboard", Fmsdos_set_keyboard, Smsdos_set_keyboard, 1, 2, 0, |
14070
c74bb6ea72ab
(Fint86, Fdos_memget, Fdos_memput, Fmsdos_set_keyboard): Harmonize
Erik Naggum <erik@naggum.no>
parents:
13745
diff
changeset
|
150 "Set keyboard layout according to COUNTRY-CODE.\n\ |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
151 If the optional argument ALLKEYS is non-nil, the keyboard is mapped for\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
152 all keys; otherwise it is only used when the ALT key is pressed.\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
153 The current keyboard layout is available in dos-keyboard-code.") |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
154 (country_code, allkeys) |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
155 Lisp_Object country_code; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
156 { |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
157 CHECK_NUMBER (country_code, 0); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
158 if (!dos_set_keyboard (XINT (country_code), !NILP (allkeys))) |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
159 return Qnil; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
160 return Qt; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
161 } |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
162 |
9572 | 163 #ifndef HAVE_X_WINDOWS |
164 /* Later we might want to control the mouse interface with this function, | |
165 e.g., with respect to non-80 column screen modes. */ | |
166 | |
167 DEFUN ("msdos-mouse-p", Fmsdos_mouse_p, Smsdos_mouse_p, 0, 0, 0, "\ | |
168 Report whether a mouse is present.") | |
169 () | |
170 { | |
171 if (have_mouse) | |
172 return Qt; | |
173 else | |
174 return Qnil; | |
175 } | |
176 | |
177 /* Function to translate colour names to integers. See lisp/term/pc-win.el | |
178 for its definition. */ | |
179 | |
180 Lisp_Object Qmsdos_color_translate; | |
181 #endif | |
182 | |
12990
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
183 |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
184 DEFUN ("msdos-mouse-init", Fmsdos_mouse_init, Smsdos_mouse_init, 0, 0, "", |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
185 "Initialize and enable mouse if available.") |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
186 () |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
187 { |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
188 if (have_mouse) |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
189 { |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
190 have_mouse = 1; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
191 mouse_init (); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
192 return Qt; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
193 } |
12990
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
194 return Qnil; |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
195 } |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
196 |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
197 DEFUN ("msdos-mouse-enable", Fmsdos_mouse_enable, Smsdos_mouse_enable, 0, 0, "", |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
198 "Enable mouse if available.") |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
199 () |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
200 { |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
201 if (have_mouse) |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
202 { |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
203 have_mouse = 1; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
204 mouse_on (); |
12990
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
205 } |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
206 return have_mouse ? Qt : Qnil; |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
207 } |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
208 |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
209 DEFUN ("msdos-mouse-disable", Fmsdos_mouse_disable, Smsdos_mouse_disable, 0, 0, "", |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
210 "Disable mouse if available.") |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
211 () |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
212 { |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
213 mouse_off (); |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
214 if (have_mouse) have_mouse = -1; |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
215 return Qnil; |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
216 } |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
217 |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
218 DEFUN ("insert-startup-screen", Finsert_startup_screen, Sinsert_startup_screen, 0, 0, "", "\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
219 Insert copy of screen contents prior to starting emacs.\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
220 Return nil if startup screen is not available.") |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
221 () |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
222 { |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
223 char *s; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
224 int rows, cols; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
225 int i, j; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
226 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
227 if (!dos_get_saved_screen (&s, &rows, &cols)) |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
228 return Qnil; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
229 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
230 for (i = 0; i < rows; i++) |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
231 { |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
232 for (j = 0; j < cols; j++) |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
233 { |
19288
bdc4b7818976
(Finsert_startup_screen): Call `insert_char' with a single argument.
Richard M. Stallman <rms@gnu.org>
parents:
16335
diff
changeset
|
234 insert_char (*s); |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
235 s += 2; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
236 } |
19288
bdc4b7818976
(Finsert_startup_screen): Call `insert_char' with a single argument.
Richard M. Stallman <rms@gnu.org>
parents:
16335
diff
changeset
|
237 insert_char ('\n'); |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
238 } |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
239 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
240 return Qt; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
241 } |
9572 | 242 |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
243 /* country info */ |
5503 | 244 int dos_country_code; |
245 int dos_codepage; | |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
246 int dos_timezone_offset; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
247 int dos_decimal_point; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
248 int dos_keyboard_layout; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
249 unsigned char dos_country_info[DOS_COUNTRY_INFO]; |
19294
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
250 static unsigned char usa_country_info[DOS_COUNTRY_INFO] = { |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
251 0, 0, /* date format */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
252 '$', 0, 0, 0, 0, /* currency string */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
253 ',', 0, /* thousands separator */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
254 '.', 0, /* decimal separator */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
255 '/', 0, /* date separator */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
256 ':', 0, /* time separator */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
257 0, /* currency format */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
258 2, /* digits after decimal in currency */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
259 0, /* time format */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
260 0, 0, 0, 0, /* address of case map routine, GPF if used */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
261 ' ', 0, /* data-list separator (?) */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
262 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 /* reserved */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
263 }; |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
264 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
265 int dos_hyper_key; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
266 int dos_super_key; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
267 int dos_keypad_mode; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
268 |
5503 | 269 Lisp_Object Vdos_version; |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
270 Lisp_Object Vdos_display_scancodes; |
20034 | 271 |
272 #ifndef HAVE_X_WINDOWS | |
273 static unsigned dos_windows_version; | |
274 Lisp_Object Vdos_windows_version; | |
275 | |
276 char parent_vm_title[50]; /* Ralf Brown says 30 is enough */ | |
277 int w95_set_virtual_machine_title (const char *); | |
278 | |
279 void | |
280 restore_parent_vm_title (void) | |
281 { | |
282 if (NILP (Vdos_windows_version)) | |
283 return; | |
284 if ((dos_windows_version & 0xff) >= 4 && parent_vm_title[0]) | |
285 w95_set_virtual_machine_title (parent_vm_title); | |
286 delay (50); | |
287 } | |
288 #endif /* !HAVE_X_WINDOWS */ | |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
289 |
5503 | 290 void |
291 init_dosfns () | |
292 { | |
293 union REGS regs; | |
294 _go32_dpmi_registers dpmiregs; | |
19294
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
295 unsigned long xbuf = _go32_info_block.linear_address_of_transfer_buffer; |
5503 | 296 |
9572 | 297 #ifndef SYSTEM_MALLOC |
5503 | 298 get_lim_data (); /* why the hell isn't this called elsewhere? */ |
9572 | 299 #endif |
5503 | 300 |
301 regs.x.ax = 0x3000; | |
302 intdos (®s, ®s); | |
303 Vdos_version = Fcons (make_number (regs.h.al), make_number (regs.h.ah)); | |
304 | |
19294
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
305 /* Obtain the country code via DPMI, use DJGPP transfer buffer. */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
306 dpmiregs.x.ax = 0x3800; |
21430
b6b154ad6e22
(init_dosfns): Fix bug in passing segment address of the transfer buffer.
Eli Zaretskii <eliz@gnu.org>
parents:
20034
diff
changeset
|
307 dpmiregs.x.ds = xbuf >> 4; |
19294
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
308 dpmiregs.x.dx = 0; |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
309 dpmiregs.x.ss = dpmiregs.x.sp = dpmiregs.x.flags = 0; |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
310 _go32_dpmi_simulate_int (0x21, &dpmiregs); |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
311 if (dpmiregs.x.flags & 1) |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
312 { |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
313 dos_country_code = 1; /* assume USA if 213800 failed */ |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
314 memcpy (dos_country_info, usa_country_info, DOS_COUNTRY_INFO); |
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
315 } |
5503 | 316 else |
317 { | |
318 dos_country_code = dpmiregs.x.bx; | |
19294
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
319 dosmemget (xbuf, DOS_COUNTRY_INFO, dos_country_info); |
5503 | 320 } |
19294
1f8ca0c4836f
(init_dosfns): Avoid calling DOS memory-allocation
Richard M. Stallman <rms@gnu.org>
parents:
19288
diff
changeset
|
321 |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
322 dos_set_keyboard (dos_country_code, 0); |
5503 | 323 |
324 regs.x.ax = 0x6601; | |
325 intdos (®s, ®s); | |
326 if (regs.x.cflag) | |
327 /* Estimate code page from country code */ | |
328 switch (dos_country_code) | |
329 { | |
330 case 45: /* Denmark */ | |
331 case 47: /* Norway */ | |
332 dos_codepage = 865; | |
333 break; | |
334 default: | |
335 /* US */ | |
336 dos_codepage = 437; | |
337 } | |
338 else | |
339 dos_codepage = regs.x.bx & 0xffff; | |
15226
31a30cc1d61a
(init_dosfns) [DJGPP >= 2]: Make `opendir' preserve
Richard M. Stallman <rms@gnu.org>
parents:
15173
diff
changeset
|
340 |
20034 | 341 #ifndef HAVE_X_WINDOWS |
342 parent_vm_title[0] = '\0'; | |
343 | |
344 /* If we are running from DOS box on MS-Windows, get Windows version. */ | |
345 dpmiregs.x.ax = 0x1600; /* enhanced mode installation check */ | |
346 dpmiregs.x.ss = dpmiregs.x.sp = dpmiregs.x.flags = 0; | |
347 _go32_dpmi_simulate_int (0x2f, &dpmiregs); | |
348 /* We only support Windows-specific features when we run on Windows 9X | |
349 or on Windows 3.X/enhanced mode. | |
350 | |
351 Int 2Fh/AX=1600h returns: | |
352 | |
353 AL = 00: no Windows at all; | |
354 AL = 01: Windows/386 2.x; | |
355 AL = 80h: Windows 3.x in mode other than enhanced; | |
356 AL = FFh: Windows/386 2.x | |
357 | |
358 We also check AH > 0 (Windows 3.1 or later), in case AL tricks us. */ | |
359 if (dpmiregs.h.al > 2 && dpmiregs.h.al != 0x80 && dpmiregs.h.al != 0xff | |
360 && (dpmiregs.h.al > 3 || dpmiregs.h.ah > 0)) | |
361 { | |
362 dos_windows_version = dpmiregs.x.ax; | |
363 Vdos_windows_version = | |
364 Fcons (make_number (dpmiregs.h.al), make_number (dpmiregs.h.ah)); | |
365 | |
366 /* Save the current title of this virtual machine, so we can restore | |
367 it before exiting. Otherwise, Windows 95 will continue to use | |
368 the title we set even after we are history, stupido... */ | |
369 if (dpmiregs.h.al >= 4) | |
370 { | |
371 dpmiregs.x.ax = 0x168e; | |
372 dpmiregs.x.dx = 3; /* get VM title */ | |
373 dpmiregs.x.cx = sizeof(parent_vm_title) - 1; | |
374 dpmiregs.x.es = __tb >> 4; | |
375 dpmiregs.x.di = __tb & 15; | |
376 dpmiregs.x.sp = dpmiregs.x.ss = dpmiregs.x.flags = 0; | |
377 _go32_dpmi_simulate_int (0x2f, &dpmiregs); | |
378 if (dpmiregs.x.ax == 1) | |
379 dosmemget (__tb, sizeof(parent_vm_title), parent_vm_title); | |
380 } | |
381 } | |
382 else | |
383 { | |
384 dos_windows_version = 0; | |
385 Vdos_windows_version = Qnil; | |
386 } | |
387 #endif /* !HAVE_X_WINDOWS */ | |
388 | |
15226
31a30cc1d61a
(init_dosfns) [DJGPP >= 2]: Make `opendir' preserve
Richard M. Stallman <rms@gnu.org>
parents:
15173
diff
changeset
|
389 #if __DJGPP__ >= 2 |
31a30cc1d61a
(init_dosfns) [DJGPP >= 2]: Make `opendir' preserve
Richard M. Stallman <rms@gnu.org>
parents:
15173
diff
changeset
|
390 |
16335
6cf0a8b5c895
(init_dosfns): When setting `__opendir_flags' value,
Richard M. Stallman <rms@gnu.org>
parents:
15393
diff
changeset
|
391 /* Without this, we never see hidden files. |
6cf0a8b5c895
(init_dosfns): When setting `__opendir_flags' value,
Richard M. Stallman <rms@gnu.org>
parents:
15393
diff
changeset
|
392 Don't OR it with the previous value, so the value recorded at dump |
6cf0a8b5c895
(init_dosfns): When setting `__opendir_flags' value,
Richard M. Stallman <rms@gnu.org>
parents:
15393
diff
changeset
|
393 time, possibly with `preserve-case' flags set, won't get through. */ |
6cf0a8b5c895
(init_dosfns): When setting `__opendir_flags' value,
Richard M. Stallman <rms@gnu.org>
parents:
15393
diff
changeset
|
394 __opendir_flags = __OPENDIR_FIND_HIDDEN; |
15226
31a30cc1d61a
(init_dosfns) [DJGPP >= 2]: Make `opendir' preserve
Richard M. Stallman <rms@gnu.org>
parents:
15173
diff
changeset
|
395 |
16335
6cf0a8b5c895
(init_dosfns): When setting `__opendir_flags' value,
Richard M. Stallman <rms@gnu.org>
parents:
15393
diff
changeset
|
396 #if __DJGPP_MINOR__ == 0 |
6cf0a8b5c895
(init_dosfns): When setting `__opendir_flags' value,
Richard M. Stallman <rms@gnu.org>
parents:
15393
diff
changeset
|
397 /* Under LFN, preserve the case of files as recorded in the directory |
6cf0a8b5c895
(init_dosfns): When setting `__opendir_flags' value,
Richard M. Stallman <rms@gnu.org>
parents:
15393
diff
changeset
|
398 (in DJGPP 2.01 and later this is automagically done by the library). */ |
15226
31a30cc1d61a
(init_dosfns) [DJGPP >= 2]: Make `opendir' preserve
Richard M. Stallman <rms@gnu.org>
parents:
15173
diff
changeset
|
399 if (!NILP (Fmsdos_long_file_names ())) |
31a30cc1d61a
(init_dosfns) [DJGPP >= 2]: Make `opendir' preserve
Richard M. Stallman <rms@gnu.org>
parents:
15173
diff
changeset
|
400 __opendir_flags |= __OPENDIR_PRESERVE_CASE; |
16335
6cf0a8b5c895
(init_dosfns): When setting `__opendir_flags' value,
Richard M. Stallman <rms@gnu.org>
parents:
15393
diff
changeset
|
401 #endif /* __DJGPP_MINOR__ == 0 */ |
6cf0a8b5c895
(init_dosfns): When setting `__opendir_flags' value,
Richard M. Stallman <rms@gnu.org>
parents:
15393
diff
changeset
|
402 #endif /* __DJGPP__ >= 2 */ |
5503 | 403 } |
404 | |
20034 | 405 #ifndef HAVE_X_WINDOWS |
25113
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
406 |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
407 /* Emulation of some X window features from xfns.c and xfaces.c. */ |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
408 |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
409 /* Standard VGA colors, in the order of their standard numbering |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
410 in the default VGA palette. */ |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
411 static char *vga_colors[16] = { |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
412 "black", "blue", "green", "cyan", "red", "magenta", "brown", |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
413 "lightgray", "darkgray", "lightblue", "lightgreen", "lightcyan", |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
414 "lightred", "lightmagenta", "yellow", "white" |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
415 }; |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
416 |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
417 /* Given a color name, return its index, or -1 if not found. Note |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
418 that this only performs case-insensitive comparison against the |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
419 standard names. For anything more sophisticated, like matching |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
420 "gray" with "grey" or translating X color names into their MSDOS |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
421 equivalents, call the Lisp function Qmsdos_color_translate (defined |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
422 on lisp/term/pc-win.el). */ |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
423 int |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
424 msdos_stdcolor_idx (const char *name) |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
425 { |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
426 int i; |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
427 |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
428 for (i = 0; i < sizeof (vga_colors) / sizeof (vga_colors[0]); i++) |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
429 if (strcasecmp (name, vga_colors[i]) == 0) |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
430 return i; |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
431 |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
432 return FACE_TTY_DEFAULT_COLOR; |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
433 } |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
434 |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
435 /* Given a color index, return its standard name. */ |
25212
f0cb2d2e49f2
(msdos_stdcolor_name): Remove const from return value.
Eli Zaretskii <eliz@gnu.org>
parents:
25113
diff
changeset
|
436 char * |
25113
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
437 msdos_stdcolor_name (int idx) |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
438 { |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
439 if (idx < 0 || idx >= sizeof (vga_colors) / sizeof (vga_colors[0])) |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
440 return ""; /* meaning the default */ |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
441 return vga_colors[idx]; |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
442 } |
73c54061f4bb
(msdos_stdcolor_name, msdos_stdcolor_idx): New
Eli Zaretskii <eliz@gnu.org>
parents:
23814
diff
changeset
|
443 |
20034 | 444 /* Support for features that are available when we run in a DOS box |
445 on MS-Windows. */ | |
446 int | |
447 ms_windows_version (void) | |
448 { | |
449 return dos_windows_version; | |
450 } | |
451 | |
452 /* Set the title of the current virtual machine, to appear on | |
453 the caption bar of that machine's window. */ | |
454 | |
455 int | |
456 w95_set_virtual_machine_title (const char *title_string) | |
457 { | |
458 /* Only Windows 9X (version 4 and higher) support this function. */ | |
459 if (!NILP (Vdos_windows_version) | |
460 && (dos_windows_version & 0xff) >= 4) | |
461 { | |
462 _go32_dpmi_registers regs; | |
463 dosmemput (title_string, strlen (title_string) + 1, __tb); | |
464 regs.x.ax = 0x168e; | |
465 regs.x.dx = 1; | |
466 regs.x.es = __tb >> 4; | |
467 regs.x.di = __tb & 15; | |
468 regs.x.sp = regs.x.ss = regs.x.flags = 0; | |
469 _go32_dpmi_simulate_int (0x2f, ®s); | |
470 return regs.x.ax == 1; | |
471 } | |
472 return 0; | |
473 } | |
474 | |
475 /* Change the title of frame F to NAME. | |
476 If NAME is nil, use the frame name as the title. | |
477 | |
478 If Emacs is not run from a DOS box on Windows 9X, this only | |
479 sets the name in the frame struct, but has no other effects. */ | |
480 | |
481 void | |
482 x_set_title (f, name) | |
483 struct frame *f; | |
484 Lisp_Object name; | |
485 { | |
486 /* Don't change the title if it's already NAME. */ | |
487 if (EQ (name, f->title)) | |
488 return; | |
489 | |
490 update_mode_lines = 1; | |
491 | |
492 f->title = name; | |
493 | |
494 if (NILP (name)) | |
495 name = f->name; | |
496 | |
497 if (FRAME_MSDOS_P (f)) | |
498 { | |
499 BLOCK_INPUT; | |
500 w95_set_virtual_machine_title (XSTRING (name)->data); | |
501 UNBLOCK_INPUT; | |
502 } | |
503 } | |
504 #endif /* !HAVE_X_WINDOWS */ | |
505 | |
506 void | |
507 dos_cleanup (void) | |
508 { | |
509 #ifndef HAVE_X_WINDOWS | |
510 restore_parent_vm_title (); | |
511 #endif | |
23814
3229c65a13c5
(dos_cleanup): Flush and fsync the termscript stream.
Eli Zaretskii <eliz@gnu.org>
parents:
21430
diff
changeset
|
512 /* Make sure the termscript file is committed, in case we are |
3229c65a13c5
(dos_cleanup): Flush and fsync the termscript stream.
Eli Zaretskii <eliz@gnu.org>
parents:
21430
diff
changeset
|
513 crashing and some vital info was written there. */ |
3229c65a13c5
(dos_cleanup): Flush and fsync the termscript stream.
Eli Zaretskii <eliz@gnu.org>
parents:
21430
diff
changeset
|
514 if (termscript) |
3229c65a13c5
(dos_cleanup): Flush and fsync the termscript stream.
Eli Zaretskii <eliz@gnu.org>
parents:
21430
diff
changeset
|
515 { |
3229c65a13c5
(dos_cleanup): Flush and fsync the termscript stream.
Eli Zaretskii <eliz@gnu.org>
parents:
21430
diff
changeset
|
516 fflush (termscript); |
3229c65a13c5
(dos_cleanup): Flush and fsync the termscript stream.
Eli Zaretskii <eliz@gnu.org>
parents:
21430
diff
changeset
|
517 fsync (fileno (termscript)); |
3229c65a13c5
(dos_cleanup): Flush and fsync the termscript stream.
Eli Zaretskii <eliz@gnu.org>
parents:
21430
diff
changeset
|
518 } |
20034 | 519 } |
520 | |
5503 | 521 /* |
522 * Define everything | |
523 */ | |
524 syms_of_dosfns () | |
525 { | |
526 defsubr (&Sint86); | |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
527 defsubr (&Sdos_memget); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
528 defsubr (&Sdos_memput); |
12990
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
529 defsubr (&Smsdos_mouse_init); |
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
530 defsubr (&Smsdos_mouse_enable); |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
531 defsubr (&Smsdos_set_keyboard); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
532 defsubr (&Sinsert_startup_screen); |
12990
93cc41315528
(Fmsdos_mouse_enable, Fmsdos_mouse_disable)
Richard M. Stallman <rms@gnu.org>
parents:
10504
diff
changeset
|
533 defsubr (&Smsdos_mouse_disable); |
9572 | 534 #ifndef HAVE_X_WINDOWS |
535 defsubr (&Smsdos_mouse_p); | |
536 Qmsdos_color_translate = intern ("msdos-color-translate"); | |
537 staticpro (&Qmsdos_color_translate); | |
538 #endif | |
5503 | 539 |
540 DEFVAR_INT ("dos-country-code", &dos_country_code, | |
541 "The country code returned by Dos when Emacs was started.\n\ | |
542 Usually this is the international telephone prefix."); | |
543 | |
544 DEFVAR_INT ("dos-codepage", &dos_codepage, | |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
545 "The codepage active when Emacs was started.\n\ |
7272
b5f74966c9da
Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents:
5980
diff
changeset
|
546 The following are known:\n\ |
b5f74966c9da
Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents:
5980
diff
changeset
|
547 437 United States\n\ |
b5f74966c9da
Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents:
5980
diff
changeset
|
548 850 Multilingual (Latin I)\n\ |
b5f74966c9da
Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents:
5980
diff
changeset
|
549 852 Slavic (Latin II)\n\ |
b5f74966c9da
Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents:
5980
diff
changeset
|
550 857 Turkish\n\ |
b5f74966c9da
Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents:
5980
diff
changeset
|
551 860 Portugal\n\ |
b5f74966c9da
Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents:
5980
diff
changeset
|
552 861 Iceland\n\ |
b5f74966c9da
Finish downcasing mouse_init1, mouse_off,
Richard M. Stallman <rms@gnu.org>
parents:
5980
diff
changeset
|
553 863 Canada (French)\n\ |
5503 | 554 865 Norway/Denmark"); |
555 | |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
556 DEFVAR_INT ("dos-timezone-offset", &dos_timezone_offset, |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
557 "The current timezone offset to UTC in minutes. |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
558 Implicitly modified when the TZ variable is changed."); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
559 |
5503 | 560 DEFVAR_LISP ("dos-version", &Vdos_version, |
561 "The (MAJOR . MINOR) Dos version (subject to modification with setver)."); | |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
562 |
20034 | 563 #ifndef HAVE_X_WINDOWS |
564 DEFVAR_LISP ("dos-windows-version", &Vdos_windows_version, | |
565 "The (MAJOR . MINOR) Windows version for DOS session on MS-Windows."); | |
566 #endif | |
567 | |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
568 DEFVAR_LISP ("dos-display-scancodes", &Vdos_display_scancodes, |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
569 "*When non-nil, the keyboard scan-codes are displayed at the bottom right\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
570 corner of the display (typically at the end of the mode line).\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
571 The output format is: scan code:char code*modifiers."); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
572 Vdos_display_scancodes = Qnil; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
573 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
574 DEFVAR_INT ("dos-hyper-key", &dos_hyper_key, |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
575 "*If set to 1, use right ALT key as hyper key.\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
576 If set to 2, use right CTRL key as hyper key."); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
577 dos_hyper_key = 0; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
578 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
579 DEFVAR_INT ("dos-super-key", &dos_super_key, |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
580 "*If set to 1, use right ALT key as super key.\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
581 If set to 2, use right CTRL key as super key."); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
582 dos_super_key = 0; |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
583 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
584 DEFVAR_INT ("dos-keypad-mode", &dos_keypad_mode, |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
585 "*Controls what key code is returned by a key in the numeric keypad.\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
586 The `numlock ON' action is only taken if no modifier keys are pressed.\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
587 The value is an integer constructed by adding the following bits together:\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
588 \n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
589 0x00 Digit key returns digit (if numlock ON)\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
590 0x01 Digit key returns kp-digit (if numlock ON)\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
591 0x02 Digit key returns M-digit (if numlock ON)\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
592 0x03 Digit key returns edit key (if numlock ON)\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
593 \n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
594 0x00 Grey key returns char (if numlock ON)\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
595 0x04 Grey key returns kp-key (if numlock ON)\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
596 \n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
597 0x00 Digit key returns digit (if numlock OFF)\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
598 0x10 Digit key returns kp-digit (if numlock OFF)\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
599 0x20 Digit key returns M-digit (if numlock OFF)\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
600 0x30 Digit key returns edit key (if numlock OFF)\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
601 \n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
602 0x00 Grey key returns char (if numlock OFF)\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
603 0x40 Grey key returns kp-key (if numlock OFF)\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
604 \n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
605 0x200 ALT-0..ALT-9 in top-row produces shifted codes."); |
13612
342d919f52b2
(syms_of_dosfns): Use 0x75 for dos_keypad_mode.
Richard M. Stallman <rms@gnu.org>
parents:
13180
diff
changeset
|
606 dos_keypad_mode = 0x75; |
13180
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
607 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
608 DEFVAR_INT ("dos-keyboard-layout", &dos_keyboard_layout, |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
609 "Contains the country code for the current keyboard layout.\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
610 Use msdos-set-keyboard to select another keyboard layout."); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
611 dos_keyboard_layout = 1; /* US */ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
612 |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
613 DEFVAR_INT ("dos-decimal-point", &dos_decimal_point, |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
614 "If non-zero, it contains the character to be returned when the\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
615 decimal point key in the numeric keypad is pressed when Num Lock is on.\n\ |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
616 If zero, the decimal point key returns the country code specific value."); |
59663cba4b02
(insert-startup-screen): New function.
Kim F. Storm <storm@cua.dk>
parents:
12990
diff
changeset
|
617 dos_decimal_point = 0; |
5503 | 618 } |
619 #endif /* MSDOS */ |