/* Declarations useful when processing input.
- Copyright (C) 1985-1987, 1993, 2001-2015 Free Software Foundation,
+ Copyright (C) 1985-1987, 1993, 2001-2016 Free Software Foundation,
Inc.
This file is part of GNU Emacs.
GNU Emacs is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
GNU Emacs is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-#include "systime.h" /* for struct timespec, Time */
+#ifndef EMACS_KEYBOARD_H
+#define EMACS_KEYBOARD_H
+
#include "coding.h" /* for ENCODE_UTF_8 and ENCODE_SYSTEM */
#include "termhooks.h"
+#ifdef HAVE_X11
+# include "xterm.h" /* for struct selection_input_event */
+#endif
+
INLINE_HEADER_BEGIN
/* Most code should use this macro to access Lisp fields in struct kboard. */
kbd_queue_has_data is 0. When we push back an incomplete
command, then this flag is 0, meaning we don't want to try
reading from this KBOARD again until more input arrives. */
- char kbd_queue_has_data;
+ bool_bf kbd_queue_has_data;
/* True means echo each character as typed. */
bool_bf immediate_echo : 1;
- /* If we have echoed a prompt string specified by the user,
- this is its length in characters. Otherwise this is -1. */
- ptrdiff_t echo_after_prompt;
+ /* If we have a prompt string specified by the user, this is it. */
+ Lisp_Object echo_prompt_;
};
INLINE void
kb->Vwindow_system_ = val;
}
+union buffered_input_event
+{
+ ENUM_BF (event_kind) kind : EVENT_KIND_WIDTH;
+ struct input_event ie;
+#ifdef HAVE_X11
+ struct selection_input_event sie;
+#endif
+};
+
/* Temporarily used before a frame has been opened. */
extern KBOARD *initial_kboard;
/* Total number of times read_char has returned, modulo UINTMAX_MAX + 1. */
extern uintmax_t num_input_events;
+/* The location of point immediately before the last command was
+ executed, or the last time the undo-boundary command added a
+ boundary.*/
+extern ptrdiff_t point_before_last_command_or_undo;
+
+/* The value of current_buffer immediately before the last command was
+ executed, or the last time the undo-boundary command added a
+ boundary.*/
+extern struct buffer *buffer_before_last_command_or_undo;
+
+extern struct buffer *prev_buffer;
+
/* Nonzero means polling for input is temporarily suppressed. */
extern int poll_suppress_count;
extern void swallow_events (bool);
extern bool lucid_event_type_list_p (Lisp_Object);
extern void kbd_buffer_store_event (struct input_event *);
-extern void kbd_buffer_store_event_hold (struct input_event *,
- struct input_event *);
-extern void kbd_buffer_unget_event (struct input_event *);
+extern void kbd_buffer_store_buffered_event (union buffered_input_event *,
+ struct input_event *);
+INLINE void
+kbd_buffer_store_event_hold (struct input_event *event,
+ struct input_event *hold_quit)
+{
+ verify (alignof (struct input_event) == alignof (union buffered_input_event)
+ && sizeof (struct input_event) == sizeof (union buffered_input_event));
+ kbd_buffer_store_buffered_event ((union buffered_input_event *) event,
+ hold_quit);
+}
+#ifdef HAVE_X11
+extern void kbd_buffer_unget_event (struct selection_input_event *);
+#endif
extern void poll_for_input_1 (void);
extern void show_help_echo (Lisp_Object, Lisp_Object, Lisp_Object,
Lisp_Object);
#endif
INLINE_HEADER_END
+
+#endif /* EMACS_KEYBOARD_H */