summaryrefslogtreecommitdiff
path: root/src/keyboard.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/keyboard.h')
-rw-r--r--src/keyboard.h42
1 files changed, 25 insertions, 17 deletions
diff --git a/src/keyboard.h b/src/keyboard.h
index a2a5f8f21d9..507d80c2975 100644
--- a/src/keyboard.h
+++ b/src/keyboard.h
@@ -1,5 +1,5 @@
/* Declarations useful when processing input.
- Copyright (C) 1985-1987, 1993, 2001-2017 Free Software Foundation,
+ Copyright (C) 1985-1987, 1993, 2001-2022 Free Software Foundation,
Inc.
This file is part of GNU Emacs.
@@ -27,6 +27,10 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
# include "xterm.h" /* for struct selection_input_event */
#endif
+#ifdef HAVE_PGTK
+#include "pgtkterm.h" /* for struct selection_input_event */
+#endif
+
INLINE_HEADER_BEGIN
/* Most code should use this macro to access Lisp fields in struct kboard. */
@@ -65,7 +69,7 @@ INLINE_HEADER_BEGIN
as soon as a complete key arrives from some KBOARD or other,
Emacs starts executing that key's binding. It switches to the
single-kboard state for the execution of that command,
- so that that command can get input only from its own KBOARD.
+ so that the command can get input only from its own KBOARD.
While in the single-kboard state, read_char can consider input only
from the current KBOARD. If events come from other KBOARDs, they
@@ -226,7 +230,7 @@ union buffered_input_event
{
ENUM_BF (event_kind) kind : EVENT_KIND_WIDTH;
struct input_event ie;
-#ifdef HAVE_X11
+#if defined HAVE_X11 || defined HAVE_PGTK
struct selection_input_event sie;
#endif
};
@@ -327,9 +331,9 @@ extern Lisp_Object item_properties;
takes care of protecting all the data from GC. */
extern Lisp_Object menu_items;
-/* If non-nil, means that the global vars defined here are already in use.
+/* Whether the global vars defined here are already in use.
Used to detect cases where we try to re-enter this non-reentrant code. */
-extern Lisp_Object menu_items_inuse;
+extern bool menu_items_inuse;
/* Number of slots currently allocated in menu_items. */
extern int menu_items_allocated;
@@ -358,6 +362,11 @@ enum menu_item_idx
MENU_ITEMS_ITEM_LENGTH
};
+enum
+ {
+ KBD_BUFFER_SIZE = 4096
+ };
+
extern void unuse_menu_items (void);
/* This is how to deal with multibyte text if HAVE_MULTILINGUAL_MENU
@@ -391,7 +400,7 @@ extern void unuse_menu_items (void);
#define EVENT_END(event) (CAR_SAFE (CDR_SAFE (CDR_SAFE (event))))
/* Extract the click count from a multi-click event. */
-#define EVENT_CLICK_COUNT(event) (Fnth (make_number (2), (event)))
+#define EVENT_CLICK_COUNT(event) (Fnth (make_fixnum (2), (event)))
/* Extract the fields of a position. */
#define POSN_WINDOW(posn) (CAR_SAFE (posn))
@@ -399,17 +408,17 @@ extern void unuse_menu_items (void);
#define POSN_SET_POSN(posn,x) (XSETCAR (XCDR (posn), (x)))
#define POSN_WINDOW_POSN(posn) (CAR_SAFE (CDR_SAFE (CDR_SAFE (posn))))
#define POSN_TIMESTAMP(posn) (CAR_SAFE (CDR_SAFE (CDR_SAFE (CDR_SAFE (posn)))))
-#define POSN_SCROLLBAR_PART(posn) (Fnth (make_number (4), (posn)))
+#define POSN_SCROLLBAR_PART(posn) (Fnth (make_fixnum (4), (posn)))
/* A cons (STRING . STRING-CHARPOS), or nil in mouse-click events.
It's a cons if the click is over a string in the mode line. */
-#define POSN_STRING(posn) (Fnth (make_number (4), (posn)))
+#define POSN_STRING(posn) (Fnth (make_fixnum (4), (posn)))
/* If POSN_STRING is nil, event refers to buffer location. */
#define POSN_INBUFFER_P(posn) (NILP (POSN_STRING (posn)))
-#define POSN_BUFFER_POSN(posn) (Fnth (make_number (5), (posn)))
+#define POSN_BUFFER_POSN(posn) (Fnth (make_fixnum (5), (posn)))
/* Getting the kind of an event head. */
#define EVENT_HEAD_KIND(event_head) \
@@ -419,6 +428,10 @@ extern void unuse_menu_items (void);
happens. */
extern struct timespec *input_available_clear_time;
+extern union buffered_input_event kbd_buffer[KBD_BUFFER_SIZE];
+extern union buffered_input_event *kbd_fetch_ptr;
+extern union buffered_input_event *kbd_store_ptr;
+
extern bool ignore_mouse_drag_p;
extern Lisp_Object parse_modifiers (Lisp_Object);
@@ -432,12 +445,13 @@ extern int parse_solitary_modifier (Lisp_Object symbol);
extern Lisp_Object real_this_command;
extern int quit_char;
-
+extern bool input_was_pending;
extern unsigned int timers_run;
extern bool menu_separator_name_p (const char *);
extern bool parse_menu_item (Lisp_Object, int);
+extern void init_raw_keybuf_count (void);
extern KBOARD *allocate_kboard (Lisp_Object);
extern void delete_kboard (KBOARD *);
extern void not_single_kboard_state (KBOARD *);
@@ -445,7 +459,6 @@ extern void push_kboard (struct kboard *);
extern void push_frame_kboard (struct frame *);
extern void pop_kboard (void);
extern void temporarily_switch_to_single_kboard (struct frame *);
-extern void record_asynch_buffer_change (void);
extern void input_poll_signal (int);
extern void start_polling (void);
extern void stop_polling (void);
@@ -472,9 +485,6 @@ kbd_buffer_store_event_hold (struct input_event *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);
@@ -486,12 +496,10 @@ extern bool kbd_buffer_events_waiting (void);
extern void add_user_signal (int, const char *);
extern int tty_read_avail_input (struct terminal *, struct input_event *);
-extern bool volatile pending_signals;
-extern void process_pending_signals (void);
extern struct timespec timer_check (void);
extern void mark_kboards (void);
-#ifdef HAVE_NTGUI
+#if defined HAVE_NTGUI || defined HAVE_X_WINDOWS || defined HAVE_PGTK
extern const char *const lispy_function_keys[];
#endif