annotate src/console-msw.c @ 388:aabb7f5b1c81 r21-2-9

Import from CVS: tag r21-2-9
author cvs
date Mon, 13 Aug 2007 11:09:42 +0200
parents 064ab7fed2e0
children 74fd4e045ea6
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
1 /* Console functions for mswindows.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
2 Copyright (C) 1996 Ben Wing.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
3
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
4 This file is part of XEmacs.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
5
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
9 later version.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
10
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
14 for more details.
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
15
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
20
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
21 /* Synched up with: Not in FSF. */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
22
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
23 /* Authorship:
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
24
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
25 Ben Wing: January 1996, for 19.14.
272
c5d627a313b1 Import from CVS: tag r21-0b34
cvs
parents: 249
diff changeset
26 Rewritten for mswindows by Jonathan Harris, November 1997 for 21.0
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
27 */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
28
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
29 #include <config.h>
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
30 #include "lisp.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
31
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
32 #include "console-msw.h"
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
33
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
34
213
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
35 DEFINE_CONSOLE_TYPE (mswindows);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
36
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
37
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
38 static int
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
39 mswindows_initially_selected_for_input (struct console *con)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
40 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
41 return 1;
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
42 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
43
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
44
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
45
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
46
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
47 /************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
48 /* initialization */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
49 /************************************************************************/
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
50
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
51 void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
52 syms_of_console_mswindows (void)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
53 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
54 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
55
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
56 void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
57 console_type_create_mswindows (void)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
58 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
59 INITIALIZE_CONSOLE_TYPE (mswindows, "mswindows", "console-mswindows-p");
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
60
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
61 /* console methods */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
62 /* CONSOLE_HAS_METHOD (mswindows, init_console); */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
63 /* CONSOLE_HAS_METHOD (mswindows, mark_console); */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
64 CONSOLE_HAS_METHOD (mswindows, initially_selected_for_input);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
65 /* CONSOLE_HAS_METHOD (mswindows, delete_console); */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
66 /* CONSOLE_HAS_METHOD (mswindows, canonicalize_console_connection); */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
67 /* CONSOLE_HAS_METHOD (mswindows, canonicalize_device_connection); */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
68 /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_console_connection); */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
69 /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_device_connection); */
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
70 }
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
71
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
72 void
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
73 vars_of_console_mswindows (void)
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
74 {
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
75 Fprovide (Qmswindows);
78f53ef88e17 Import from CVS: tag r20-4b5
cvs
parents:
diff changeset
76 }
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
77
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
78
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
79 #ifdef DEBUG_XEMACS
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
80 #include "events.h"
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
81 #include "opaque.h"
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
82 /*
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
83 * Random helper functions for debugging.
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
84 * Intended for use in the MSVC "Watch" window which doesn't like
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
85 * the aborts that the error_check_foo() functions can make.
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
86 */
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
87 struct lrecord_header *
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
88 DHEADER (Lisp_Object obj)
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
89 {
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
90 return LRECORDP (obj) ? XRECORD_LHEADER (obj) : NULL;
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
91 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
92
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
93 void *
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
94 DOPAQUE_DATA (Lisp_Object obj)
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
95 {
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
96 return OPAQUEP (obj) ? OPAQUE_DATA (XOPAQUE (obj)) : NULL;
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
97 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
98
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
99 struct Lisp_Event *
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
100 DEVENT (Lisp_Object obj)
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
101 {
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
102 return EVENTP (obj) ? XEVENT (obj) : NULL;
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
103 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
104
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
105 struct Lisp_Cons *
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
106 DCONS (Lisp_Object obj)
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
107 {
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
108 return CONSP (obj) ? XCONS (obj) : NULL;
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
109 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
110
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
111 struct Lisp_Cons *
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
112 DCONSCDR (Lisp_Object obj)
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
113 {
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
114 return (CONSP (obj) && CONSP (XCDR (obj))) ? XCONS (XCDR (obj)) : 0;
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
115 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
116
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
117 Bufbyte *
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
118 DSTRING (Lisp_Object obj)
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
119 {
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
120 return STRINGP (obj) ? XSTRING_DATA (obj) : NULL;
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
121 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
122
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
123 struct Lisp_Vector *
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
124 DVECTOR (Lisp_Object obj)
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
125 {
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
126 return VECTORP (obj) ? XVECTOR (obj) : NULL;
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
127 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
128
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
129 struct Lisp_Symbol *
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
130 DSYMBOL (Lisp_Object obj)
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
131 {
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
132 return SYMBOLP (obj) ? XSYMBOL (obj) : NULL;
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
133 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
134
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
135 Bufbyte *
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
136 DSYMNAME (Lisp_Object obj)
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
137 {
382
064ab7fed2e0 Import from CVS: tag r21-2-6
cvs
parents: 280
diff changeset
138 return SYMBOLP (obj) ? string_data (XSYMBOL (obj)->name) : NULL;
249
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
139 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
140
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
141 #endif