Mercurial > hg > xemacs-beta
comparison src/console-msw.c @ 2828:a25c824ed558
[xemacs-hg @ 2005-06-26 18:04:49 by aidan]
Rename the ascii-character property, support more keysyms.
author | aidan |
---|---|
date | Sun, 26 Jun 2005 18:05:05 +0000 |
parents | ecf1ebac70d8 |
children | ad0054aa11f1 |
comparison
equal
deleted
inserted
replaced
2827:936a6576c655 | 2828:a25c824ed558 |
---|---|
35 #include "lisp.h" | 35 #include "lisp.h" |
36 | 36 |
37 #include "console-msw-impl.h" | 37 #include "console-msw-impl.h" |
38 #include "events.h" | 38 #include "events.h" |
39 #include "opaque.h" | 39 #include "opaque.h" |
40 #include "elhash.h" | |
40 | 41 |
41 DEFINE_CONSOLE_TYPE (mswindows); | 42 DEFINE_CONSOLE_TYPE (mswindows); |
42 DEFINE_CONSOLE_TYPE (msprinter); | 43 DEFINE_CONSOLE_TYPE (msprinter); |
43 | 44 |
44 Lisp_Object Qabortretryignore; | 45 Lisp_Object Qabortretryignore; |
65 Lisp_Object Qsystemmodal; | 66 Lisp_Object Qsystemmodal; |
66 Lisp_Object Qtaskmodal; | 67 Lisp_Object Qtaskmodal; |
67 Lisp_Object Qtopmost; | 68 Lisp_Object Qtopmost; |
68 Lisp_Object Qyesno; | 69 Lisp_Object Qyesno; |
69 Lisp_Object Qyesnocancel; | 70 Lisp_Object Qyesnocancel; |
71 static Lisp_Object Qseen_characters = Qnil; | |
70 | 72 |
71 /* Lisp_Object Qabort; */ | 73 /* Lisp_Object Qabort; */ |
72 /* Lisp_Object Qcancel; */ | 74 /* Lisp_Object Qcancel; */ |
73 /* Lisp_Object Qignore; */ | 75 /* Lisp_Object Qignore; */ |
74 /* Lisp_Object Qno; */ | 76 /* Lisp_Object Qno; */ |
180 static Lisp_Object | 182 static Lisp_Object |
181 mswindows_canonicalize_device_connection (Lisp_Object connection, | 183 mswindows_canonicalize_device_connection (Lisp_Object connection, |
182 Error_Behavior errb) | 184 Error_Behavior errb) |
183 { | 185 { |
184 return mswindows_canonicalize_console_connection (connection, errb); | 186 return mswindows_canonicalize_console_connection (connection, errb); |
187 } | |
188 | |
189 /* The actual console doesn't matter, because the global map is global. See | |
190 console-x.c for a corner case, though. */ | |
191 | |
192 static Lisp_Object | |
193 mswindows_perhaps_init_unseen_key_defaults (struct console *UNUSED(con), | |
194 Lisp_Object key) | |
195 { | |
196 Ichar val; | |
197 extern Lisp_Object Vcurrent_global_map; | |
198 | |
199 if (SYMBOLP(key)) | |
200 { | |
201 /* We've no idea what to default a symbol to on MS Windows, and most | |
202 of the keys I'm aware of that have | |
203 symbols--cf. event-msw.c--_shouldn't_ have associated chars. */ | |
204 return Qnil; | |
205 } | |
206 | |
207 CHECK_CHAR(key); | |
208 | |
209 if (!(HASH_TABLEP(Qseen_characters))) | |
210 { | |
211 /* All the keysym we deal with are character objects; therefore, we | |
212 can use eq as the test without worrying. */ | |
213 Qseen_characters = make_lisp_hash_table (128, HASH_TABLE_NON_WEAK, | |
214 HASH_TABLE_EQ); | |
215 } | |
216 /* Might give the user an opaque error if make_lisp_hash_table fails, | |
217 but it shouldn't crash. */ | |
218 CHECK_HASH_TABLE(Qseen_characters); | |
219 | |
220 val = XCHAR(key); | |
221 | |
222 /* Same logic as in x_has_keysym; I'm not convinced it's sane. */ | |
223 if (val < 0x80) | |
224 { | |
225 return Qnil; | |
226 } | |
227 | |
228 if (!NILP(Fgethash(key, Qseen_characters, Qnil))) | |
229 { | |
230 return Qnil; | |
231 } | |
232 | |
233 if (NILP (Flookup_key (Vcurrent_global_map, key, Qnil))) | |
234 { | |
235 Fputhash(key, Qt, Qseen_characters); | |
236 Fdefine_key (Vcurrent_global_map, key, Qself_insert_command); | |
237 return Qt; | |
238 } | |
239 | |
240 return Qnil; | |
185 } | 241 } |
186 | 242 |
187 void | 243 void |
188 mswindows_hide_console (void) | 244 mswindows_hide_console (void) |
189 { | 245 { |
682 /* CONSOLE_HAS_METHOD (mswindows, delete_console); */ | 738 /* CONSOLE_HAS_METHOD (mswindows, delete_console); */ |
683 CONSOLE_HAS_METHOD (mswindows, canonicalize_console_connection); | 739 CONSOLE_HAS_METHOD (mswindows, canonicalize_console_connection); |
684 CONSOLE_HAS_METHOD (mswindows, canonicalize_device_connection); | 740 CONSOLE_HAS_METHOD (mswindows, canonicalize_device_connection); |
685 /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_console_connection); */ | 741 /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_console_connection); */ |
686 /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_device_connection); */ | 742 /* CONSOLE_HAS_METHOD (mswindows, semi_canonicalize_device_connection); */ |
743 CONSOLE_HAS_METHOD (mswindows, perhaps_init_unseen_key_defaults); | |
687 | 744 |
688 INITIALIZE_CONSOLE_TYPE (msprinter, "msprinter", "console-msprinter-p"); | 745 INITIALIZE_CONSOLE_TYPE (msprinter, "msprinter", "console-msprinter-p"); |
689 CONSOLE_HAS_METHOD (msprinter, canonicalize_console_connection); | 746 CONSOLE_HAS_METHOD (msprinter, canonicalize_console_connection); |
690 CONSOLE_HAS_METHOD (msprinter, canonicalize_device_connection); | 747 CONSOLE_HAS_METHOD (msprinter, canonicalize_device_connection); |
691 } | 748 } |
698 } | 755 } |
699 | 756 |
700 void | 757 void |
701 vars_of_console_mswindows (void) | 758 vars_of_console_mswindows (void) |
702 { | 759 { |
760 Qseen_characters = Qnil; | |
703 Fprovide (Qmswindows); | 761 Fprovide (Qmswindows); |
704 } | 762 } |