213
|
1 /* Console functions for mswindows.
|
|
2 Copyright (C) 1996 Ben Wing.
|
|
3
|
|
4 This file is part of XEmacs.
|
|
5
|
|
6 XEmacs 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
|
|
9 later version.
|
|
10
|
|
11 XEmacs 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
|
|
14 for more details.
|
|
15
|
|
16 You should have received a copy of the GNU General Public License
|
|
17 along with XEmacs; see the file COPYING. If not, write to
|
|
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
19 Boston, MA 02111-1307, USA. */
|
|
20
|
|
21 /* Synched up with: Not in FSF. */
|
|
22
|
|
23 /* Authorship:
|
|
24
|
|
25 Ben Wing: January 1996, for 19.14.
|
272
|
26 Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0
|
213
|
27 */
|
|
28
|
|
29 #include <config.h>
|
|
30 #include "lisp.h"
|
|
31
|
|
32 #include "console-msw.h"
|
|
33
|
398
|
34 DEFINE_CONSOLE_TYPE (mswindows);
|
|
35 DEFINE_CONSOLE_TYPE (msprinter);
|
249
|
36
|
398
|
37 /************************************************************************/
|
|
38 /* mswindows console methods */
|
|
39 /************************************************************************/
|
213
|
40
|
|
41 static int
|
|
42 mswindows_initially_selected_for_input (struct console *con)
|
|
43 {
|
|
44 return 1;
|
|
45 }
|
|
46
|
398
|
47 static Lisp_Object
|
|
48 mswindows_canonicalize_console_connection (Lisp_Object connection,
|
|
49 Error_behavior errb)
|
|
50 {
|
|
51 /* Do not allow more than one mswindows device, by explicitly
|
|
52 requiring that CONNECTION is nil, the only allowed connection in
|
|
53 Windows. */
|
|
54 if (!NILP (connection))
|
|
55 {
|
|
56 if (ERRB_EQ (errb, ERROR_ME))
|
|
57 signal_simple_error
|
|
58 ("Invalid (non-nil) connection for mswindows device/console",
|
|
59 connection);
|
|
60 else
|
|
61 return Qunbound;
|
|
62 }
|
213
|
63
|
398
|
64 return Qnil;
|
|
65 }
|
|
66
|
|
67 static Lisp_Object
|
|
68 mswindows_canonicalize_device_connection (Lisp_Object connection,
|
|
69 Error_behavior errb)
|
|
70 {
|
|
71 return mswindows_canonicalize_console_connection (connection, errb);
|
|
72 }
|
213
|
73
|
|
74
|
|
75 /************************************************************************/
|
|
76 /* initialization */
|
|
77 /************************************************************************/
|
|
78
|
|
79 void
|
|
80 syms_of_console_mswindows (void)
|
|
81 {
|
|
82 }
|
|
83
|
|
84 void
|
|
85 console_type_create_mswindows (void)
|
|
86 {
|
|
87 INITIALIZE_CONSOLE_TYPE (mswindows, "mswindows", "console-mswindows-p");
|
|
88
|
|
89 /* console methods */
|
|
90 /* CONSOLE_HAS_METHOD (mswindows, init_console); */
|
|
91 /* CONSOLE_HAS_METHOD (mswindows, mark_console); */
|
|
92 CONSOLE_HAS_METHOD (mswindows, initially_selected_for_input);
|
|
93 /* CONSOLE_HAS_METHOD (mswindows, delete_console); */
|
398
|
94 CONSOLE_HAS_METHOD (mswindows, canonicalize_console_connection);
|
|
95 CONSOLE_HAS_METHOD (mswindows, canonicalize_device_connection);
|
213
|
96 /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_console_connection); */
|
|
97 /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_device_connection); */
|
398
|
98
|
|
99 INITIALIZE_CONSOLE_TYPE (msprinter, "msprinter", "console-msprinter-p");
|
|
100 }
|
|
101
|
|
102 void
|
|
103 reinit_console_type_create_mswindows (void)
|
|
104 {
|
|
105 REINITIALIZE_CONSOLE_TYPE (mswindows);
|
|
106 REINITIALIZE_CONSOLE_TYPE (msprinter);
|
213
|
107 }
|
|
108
|
|
109 void
|
|
110 vars_of_console_mswindows (void)
|
|
111 {
|
|
112 Fprovide (Qmswindows);
|
|
113 }
|
249
|
114
|
|
115
|
|
116 #ifdef DEBUG_XEMACS
|
|
117 #include "events.h"
|
|
118 #include "opaque.h"
|
|
119 /*
|
|
120 * Random helper functions for debugging.
|
|
121 * Intended for use in the MSVC "Watch" window which doesn't like
|
|
122 * the aborts that the error_check_foo() functions can make.
|
|
123 */
|
382
|
124 struct lrecord_header *
|
|
125 DHEADER (Lisp_Object obj)
|
249
|
126 {
|
382
|
127 return LRECORDP (obj) ? XRECORD_LHEADER (obj) : NULL;
|
249
|
128 }
|
|
129
|
382
|
130 void *
|
|
131 DOPAQUE_DATA (Lisp_Object obj)
|
249
|
132 {
|
382
|
133 return OPAQUEP (obj) ? OPAQUE_DATA (XOPAQUE (obj)) : NULL;
|
249
|
134 }
|
|
135
|
398
|
136 Lisp_Event *
|
382
|
137 DEVENT (Lisp_Object obj)
|
249
|
138 {
|
382
|
139 return EVENTP (obj) ? XEVENT (obj) : NULL;
|
249
|
140 }
|
|
141
|
398
|
142 Lisp_Cons *
|
382
|
143 DCONS (Lisp_Object obj)
|
249
|
144 {
|
382
|
145 return CONSP (obj) ? XCONS (obj) : NULL;
|
249
|
146 }
|
|
147
|
398
|
148 Lisp_Cons *
|
382
|
149 DCONSCDR (Lisp_Object obj)
|
249
|
150 {
|
382
|
151 return (CONSP (obj) && CONSP (XCDR (obj))) ? XCONS (XCDR (obj)) : 0;
|
249
|
152 }
|
|
153
|
382
|
154 Bufbyte *
|
|
155 DSTRING (Lisp_Object obj)
|
249
|
156 {
|
382
|
157 return STRINGP (obj) ? XSTRING_DATA (obj) : NULL;
|
249
|
158 }
|
|
159
|
398
|
160 Lisp_Vector *
|
382
|
161 DVECTOR (Lisp_Object obj)
|
249
|
162 {
|
382
|
163 return VECTORP (obj) ? XVECTOR (obj) : NULL;
|
249
|
164 }
|
|
165
|
398
|
166 Lisp_Symbol *
|
382
|
167 DSYMBOL (Lisp_Object obj)
|
249
|
168 {
|
382
|
169 return SYMBOLP (obj) ? XSYMBOL (obj) : NULL;
|
249
|
170 }
|
|
171
|
382
|
172 Bufbyte *
|
|
173 DSYMNAME (Lisp_Object obj)
|
249
|
174 {
|
382
|
175 return SYMBOLP (obj) ? string_data (XSYMBOL (obj)->name) : NULL;
|
249
|
176 }
|
|
177
|
398
|
178 #endif /* DEBUG_XEMACS */
|