annotate src/console-msw.c @ 335:54f7aa390f4f r21-0-65

Import from CVS: tag r21-0-65
author cvs
date Mon, 13 Aug 2007 10:50:39 +0200
parents 7df0dd720c89
children 064ab7fed2e0
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 */
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
87 struct lrecord_header *DHEADER(Lisp_Object obj)
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
88 {
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
89 return (LRECORDP (obj)) ? XRECORD_LHEADER (obj) : NULL;
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
90 }
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 int *DOPAQUE_DATA (Lisp_Object obj)
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
93 {
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
94 return (OPAQUEP (obj)) ? OPAQUE_DATA (XOPAQUE (obj)) : NULL;
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
95 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
96
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
97 struct Lisp_Event *DEVENT(Lisp_Object obj)
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
98 {
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
99 return (EVENTP (obj)) ? XEVENT (obj) : NULL;
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
100 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
101
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
102 struct Lisp_Cons *DCONS(Lisp_Object obj)
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 return (CONSP (obj)) ? XCONS (obj) : NULL;
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
105 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
106
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
107 struct Lisp_Cons *DCONSCDR(Lisp_Object obj)
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
108 {
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
109 return ((CONSP (obj)) && (CONSP (XCDR (obj)))) ? XCONS (XCDR (obj)) : 0;
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
110 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
111
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
112 char *DSTRING(Lisp_Object obj)
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
113 {
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
114 return (STRINGP (obj)) ? XSTRING_DATA (obj) : NULL;
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
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
117 struct Lisp_Vector *DVECTOR(Lisp_Object obj)
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
118 {
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
119 return (VECTORP (obj)) ? XVECTOR (obj) : NULL;
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
120 }
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 struct Lisp_Symbol *DSYMBOL(Lisp_Object obj)
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
123 {
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
124 return (SYMBOLP (obj)) ? XSYMBOL (obj) : NULL;
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
125 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
126
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
127 char *DSYMNAME(Lisp_Object obj)
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
128 {
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
129 return (SYMBOLP (obj)) ? XSYMBOL (obj)->name->_data : NULL;
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
130 }
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
131
83b3d10dcba9 Import from CVS: tag r20-5b23
cvs
parents: 213
diff changeset
132 #endif