Mercurial > hg > xemacs-beta
comparison src/event-stream.c @ 5125:b5df3737028a ben-lisp-object
merge
author | Ben Wing <ben@xemacs.org> |
---|---|
date | Wed, 24 Feb 2010 01:58:04 -0600 |
parents | 623d57b7fbe8 16112448d484 |
children | 2a462149bd6a |
comparison
equal
deleted
inserted
replaced
5124:623d57b7fbe8 | 5125:b5df3737028a |
---|---|
1 /* The portable interface to event streams. | 1 /* The portable interface to event streams. |
2 Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. | 2 Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc. |
3 Copyright (C) 1995 Board of Trustees, University of Illinois. | 3 Copyright (C) 1995 Board of Trustees, University of Illinois. |
4 Copyright (C) 1995 Sun Microsystems, Inc. | 4 Copyright (C) 1995 Sun Microsystems, Inc. |
5 Copyright (C) 1995, 1996, 2001, 2002, 2003, 2005 Ben Wing. | 5 Copyright (C) 1995, 1996, 2001, 2002, 2003, 2005, 2010 Ben Wing. |
6 | 6 |
7 This file is part of XEmacs. | 7 This file is part of XEmacs. |
8 | 8 |
9 XEmacs is free software; you can redistribute it and/or modify it | 9 XEmacs is free software; you can redistribute it and/or modify it |
10 under the terms of the GNU General Public License as published by the | 10 under the terms of the GNU General Public License as published by the |
253 | 253 |
254 #ifdef DEBUG_XEMACS | 254 #ifdef DEBUG_XEMACS |
255 Fixnum debug_emacs_events; | 255 Fixnum debug_emacs_events; |
256 | 256 |
257 static void | 257 static void |
258 external_debugging_print_event (const char *event_description, Lisp_Object event) | 258 external_debugging_print_event (const Ascbyte *event_description, |
259 { | 259 Lisp_Object event) |
260 write_c_string (Qexternal_debugging_output, "("); | 260 { |
261 write_c_string (Qexternal_debugging_output, event_description); | 261 write_ascstring (Qexternal_debugging_output, "("); |
262 write_c_string (Qexternal_debugging_output, ") "); | 262 write_ascstring (Qexternal_debugging_output, event_description); |
263 write_ascstring (Qexternal_debugging_output, ") "); | |
263 print_internal (event, Qexternal_debugging_output, 1); | 264 print_internal (event, Qexternal_debugging_output, 1); |
264 write_c_string (Qexternal_debugging_output, "\n"); | 265 write_ascstring (Qexternal_debugging_output, "\n"); |
265 } | 266 } |
266 #define DEBUG_PRINT_EMACS_EVENT(event_description, event) do { \ | 267 #define DEBUG_PRINT_EMACS_EVENT(event_description, event) do { \ |
267 if (debug_emacs_events) \ | 268 if (debug_emacs_events) \ |
268 external_debugging_print_event (event_description, event); \ | 269 external_debugging_print_event (event_description, event); \ |
269 } while (0) | 270 } while (0) |
354 finalize_command_builder (void *header) | 355 finalize_command_builder (void *header) |
355 { | 356 { |
356 struct command_builder *b = (struct command_builder *) header; | 357 struct command_builder *b = (struct command_builder *) header; |
357 if (b->echo_buf) | 358 if (b->echo_buf) |
358 { | 359 { |
359 xfree (b->echo_buf, Ibyte *); | 360 xfree (b->echo_buf); |
360 b->echo_buf = 0; | 361 b->echo_buf = 0; |
361 } | 362 } |
362 } | 363 } |
363 | 364 |
364 DEFINE_NODUMP_LISP_OBJECT ("command-builder", command_builder, | 365 DEFINE_NODUMP_LISP_OBJECT ("command-builder", command_builder, |
447 static void | 448 static void |
448 free_command_builder (struct command_builder *builder) | 449 free_command_builder (struct command_builder *builder) |
449 { | 450 { |
450 if (builder->echo_buf) | 451 if (builder->echo_buf) |
451 { | 452 { |
452 xfree (builder->echo_buf, Ibyte *); | 453 xfree (builder->echo_buf); |
453 builder->echo_buf = NULL; | 454 builder->echo_buf = NULL; |
454 } | 455 } |
455 FREE_LISP_OBJECT (wrap_command_builder (builder)); | 456 FREE_LISP_OBJECT (wrap_command_builder (builder)); |
456 } | 457 } |
457 | 458 |
826 call0 (Qcurrent_window_configuration))); | 827 call0 (Qcurrent_window_configuration))); |
827 reset_key_echo (command_builder, 1); | 828 reset_key_echo (command_builder, 1); |
828 | 829 |
829 help = IGNORE_MULTIPLE_VALUES (Feval (Vhelp_form)); | 830 help = IGNORE_MULTIPLE_VALUES (Feval (Vhelp_form)); |
830 if (STRINGP (help)) | 831 if (STRINGP (help)) |
831 internal_with_output_to_temp_buffer (build_string ("*Help*"), | 832 internal_with_output_to_temp_buffer (build_ascstring ("*Help*"), |
832 print_help, help, Qnil); | 833 print_help, help, Qnil); |
833 Fnext_command_event (event, Qnil); | 834 Fnext_command_event (event, Qnil); |
834 /* Remove the help from the frame */ | 835 /* Remove the help from the frame */ |
835 unbind_to (speccount); | 836 unbind_to (speccount); |
836 /* Hmmmm. Tricky. The unbind restores an old window configuration, | 837 /* Hmmmm. Tricky. The unbind restores an old window configuration, |
4099 RETURN_UNGCPRO (leaf); | 4100 RETURN_UNGCPRO (leaf); |
4100 } | 4101 } |
4101 } | 4102 } |
4102 | 4103 |
4103 static int | 4104 static int |
4104 is_scrollbar_event (Lisp_Object event) | 4105 is_scrollbar_event (Lisp_Object USED_IF_SCROLLBARS (event)) |
4105 { | 4106 { |
4106 #ifdef HAVE_SCROLLBARS | 4107 #ifdef HAVE_SCROLLBARS |
4107 Lisp_Object fun; | 4108 Lisp_Object fun; |
4108 | 4109 |
4109 if (XEVENT_TYPE (event) != misc_user_event) | 4110 if (XEVENT_TYPE (event) != misc_user_event) |
4932 staticpro (&pending_async_timeout_list); | 4933 staticpro (&pending_async_timeout_list); |
4933 | 4934 |
4934 last_point_position_buffer = Qnil; | 4935 last_point_position_buffer = Qnil; |
4935 staticpro (&last_point_position_buffer); | 4936 staticpro (&last_point_position_buffer); |
4936 | 4937 |
4937 QSnext_event_internal = build_string ("next_event_internal()"); | 4938 QSnext_event_internal = build_ascstring ("next_event_internal()"); |
4938 staticpro (&QSnext_event_internal); | 4939 staticpro (&QSnext_event_internal); |
4939 QSexecute_internal_event = build_string ("execute_internal_event()"); | 4940 QSexecute_internal_event = build_ascstring ("execute_internal_event()"); |
4940 staticpro (&QSexecute_internal_event); | 4941 staticpro (&QSexecute_internal_event); |
4941 | 4942 |
4942 DEFVAR_LISP ("echo-keystrokes", &Vecho_keystrokes /* | 4943 DEFVAR_LISP ("echo-keystrokes", &Vecho_keystrokes /* |
4943 *Nonzero means echo unfinished commands after this many seconds of pause. | 4944 *Nonzero means echo unfinished commands after this many seconds of pause. |
4944 */ ); | 4945 */ ); |