Mercurial > hg > xemacs-beta
comparison src/console-msw.c @ 440:8de8e3f6228a r21-2-28
Import from CVS: tag r21-2-28
author | cvs |
---|---|
date | Mon, 13 Aug 2007 11:33:38 +0200 |
parents | 3ecd8885ac67 |
children | abe6d1db359e |
comparison
equal
deleted
inserted
replaced
439:357dd071b03c | 440:8de8e3f6228a |
---|---|
29 #include <config.h> | 29 #include <config.h> |
30 #include "lisp.h" | 30 #include "lisp.h" |
31 | 31 |
32 #include "console-msw.h" | 32 #include "console-msw.h" |
33 | 33 |
34 DEFINE_CONSOLE_TYPE (mswindows); | |
35 DEFINE_CONSOLE_TYPE (msprinter); | |
34 | 36 |
35 DEFINE_CONSOLE_TYPE (mswindows); | 37 /************************************************************************/ |
36 | 38 /* mswindows console methods */ |
39 /************************************************************************/ | |
37 | 40 |
38 static int | 41 static int |
39 mswindows_initially_selected_for_input (struct console *con) | 42 mswindows_initially_selected_for_input (struct console *con) |
40 { | 43 { |
41 return 1; | 44 return 1; |
42 } | 45 } |
43 | 46 |
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 } | |
44 | 63 |
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 } | |
45 | 73 |
46 | 74 |
47 /************************************************************************/ | 75 /************************************************************************/ |
48 /* initialization */ | 76 /* initialization */ |
49 /************************************************************************/ | 77 /************************************************************************/ |
61 /* console methods */ | 89 /* console methods */ |
62 /* CONSOLE_HAS_METHOD (mswindows, init_console); */ | 90 /* CONSOLE_HAS_METHOD (mswindows, init_console); */ |
63 /* CONSOLE_HAS_METHOD (mswindows, mark_console); */ | 91 /* CONSOLE_HAS_METHOD (mswindows, mark_console); */ |
64 CONSOLE_HAS_METHOD (mswindows, initially_selected_for_input); | 92 CONSOLE_HAS_METHOD (mswindows, initially_selected_for_input); |
65 /* CONSOLE_HAS_METHOD (mswindows, delete_console); */ | 93 /* CONSOLE_HAS_METHOD (mswindows, delete_console); */ |
66 /* CONSOLE_HAS_METHOD (mswindows, canonicalize_console_connection); */ | 94 CONSOLE_HAS_METHOD (mswindows, canonicalize_console_connection); |
67 /* CONSOLE_HAS_METHOD (mswindows, canonicalize_device_connection); */ | 95 CONSOLE_HAS_METHOD (mswindows, canonicalize_device_connection); |
68 /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_console_connection); */ | 96 /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_console_connection); */ |
69 /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_device_connection); */ | 97 /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_device_connection); */ |
98 | |
99 INITIALIZE_CONSOLE_TYPE (msprinter, "msprinter", "console-msprinter-p"); | |
70 } | 100 } |
71 | 101 |
72 void | 102 void |
73 reinit_console_type_create_mswindows (void) | 103 reinit_console_type_create_mswindows (void) |
74 { | 104 { |
75 REINITIALIZE_CONSOLE_TYPE (mswindows); | 105 REINITIALIZE_CONSOLE_TYPE (mswindows); |
106 REINITIALIZE_CONSOLE_TYPE (msprinter); | |
76 } | 107 } |
77 | 108 |
78 void | 109 void |
79 vars_of_console_mswindows (void) | 110 vars_of_console_mswindows (void) |
80 { | 111 { |
100 DOPAQUE_DATA (Lisp_Object obj) | 131 DOPAQUE_DATA (Lisp_Object obj) |
101 { | 132 { |
102 return OPAQUEP (obj) ? OPAQUE_DATA (XOPAQUE (obj)) : NULL; | 133 return OPAQUEP (obj) ? OPAQUE_DATA (XOPAQUE (obj)) : NULL; |
103 } | 134 } |
104 | 135 |
105 struct Lisp_Event * | 136 Lisp_Event * |
106 DEVENT (Lisp_Object obj) | 137 DEVENT (Lisp_Object obj) |
107 { | 138 { |
108 return EVENTP (obj) ? XEVENT (obj) : NULL; | 139 return EVENTP (obj) ? XEVENT (obj) : NULL; |
109 } | 140 } |
110 | 141 |
111 struct Lisp_Cons * | 142 Lisp_Cons * |
112 DCONS (Lisp_Object obj) | 143 DCONS (Lisp_Object obj) |
113 { | 144 { |
114 return CONSP (obj) ? XCONS (obj) : NULL; | 145 return CONSP (obj) ? XCONS (obj) : NULL; |
115 } | 146 } |
116 | 147 |
117 struct Lisp_Cons * | 148 Lisp_Cons * |
118 DCONSCDR (Lisp_Object obj) | 149 DCONSCDR (Lisp_Object obj) |
119 { | 150 { |
120 return (CONSP (obj) && CONSP (XCDR (obj))) ? XCONS (XCDR (obj)) : 0; | 151 return (CONSP (obj) && CONSP (XCDR (obj))) ? XCONS (XCDR (obj)) : 0; |
121 } | 152 } |
122 | 153 |
124 DSTRING (Lisp_Object obj) | 155 DSTRING (Lisp_Object obj) |
125 { | 156 { |
126 return STRINGP (obj) ? XSTRING_DATA (obj) : NULL; | 157 return STRINGP (obj) ? XSTRING_DATA (obj) : NULL; |
127 } | 158 } |
128 | 159 |
129 struct Lisp_Vector * | 160 Lisp_Vector * |
130 DVECTOR (Lisp_Object obj) | 161 DVECTOR (Lisp_Object obj) |
131 { | 162 { |
132 return VECTORP (obj) ? XVECTOR (obj) : NULL; | 163 return VECTORP (obj) ? XVECTOR (obj) : NULL; |
133 } | 164 } |
134 | 165 |
135 struct Lisp_Symbol * | 166 Lisp_Symbol * |
136 DSYMBOL (Lisp_Object obj) | 167 DSYMBOL (Lisp_Object obj) |
137 { | 168 { |
138 return SYMBOLP (obj) ? XSYMBOL (obj) : NULL; | 169 return SYMBOLP (obj) ? XSYMBOL (obj) : NULL; |
139 } | 170 } |
140 | 171 |
142 DSYMNAME (Lisp_Object obj) | 173 DSYMNAME (Lisp_Object obj) |
143 { | 174 { |
144 return SYMBOLP (obj) ? string_data (XSYMBOL (obj)->name) : NULL; | 175 return SYMBOLP (obj) ? string_data (XSYMBOL (obj)->name) : NULL; |
145 } | 176 } |
146 | 177 |
147 #endif | 178 #endif /* DEBUG_XEMACS */ |