(struct x_display_info): Struct renamed from x_screen.
[bpt/emacs.git] / src / keyboard.h
CommitLineData
284f4730 1/* Declarations useful when processing input.
c6c5df7f 2 Copyright (C) 1985, 1986, 1987, 1993 Free Software Foundation, Inc.
284f4730
JB
3
4This file is part of GNU Emacs.
5
6GNU Emacs is free software; you can redistribute it and/or modify
7it under the terms of the GNU General Public License as published by
e5d77022 8the Free Software Foundation; either version 2, or (at your option)
284f4730
JB
9any later version.
10
11GNU Emacs is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16You should have received a copy of the GNU General Public License
17along with GNU Emacs; see the file COPYING. If not, write to
18the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20/* Total number of times read_char has returned. */
21extern int num_input_chars;
22
0ca96cef
JB
23/* Total number of times read_char has returned, outside of macros. */
24extern int num_nonmacro_input_chars;
25
eb8c3be9 26/* Nonzero means polling for input is temporarily suppressed. */
284f4730
JB
27extern int poll_suppress_count;
28
3b0deae5
RS
29/* Nonzero if polling_for_input is actually being used. */
30extern int polling_for_input;
31
284f4730
JB
32/* Keymap mapping ASCII function key sequences onto their preferred forms.
33 Initialized by the terminal-specific lisp files. */
34extern Lisp_Object Vfunction_key_map;
35
49fcd3de
JB
36/* Vector holding the key sequence that invoked the current command.
37 It is reused for each command, and it may be longer than the current
38 sequence; this_command_key_count indicates how many elements
39 actually mean something. */
40extern Lisp_Object this_command_keys;
41extern int this_command_key_count;
6084b314 42
fd2777e0
JB
43#ifdef MULTI_FRAME
44/* The frame in which the last input event occurred, or Qmacro if the
45 last event came from a macro. We use this to determine when to
46 generate switch-frame events. This may be cleared by functions
47 like Fselect_frame, to make sure that a switch-frame event is
48 generated by the next character. */
9e6314a4 49extern Lisp_Object internal_last_event_frame;
fd2777e0
JB
50#endif
51
284f4730
JB
52\f
53/* Macros for dealing with lispy events. */
54
55/* True iff EVENT has data fields describing it (i.e. a mouse click). */
4a2fb8bd 56#define EVENT_HAS_PARAMETERS(event) (CONSP (event))
284f4730 57
53ce28d6
JB
58/* Extract the head from an event.
59 This works on composite and simple events. */
ac501cd9
JB
60#define EVENT_HEAD(event) \
61 (EVENT_HAS_PARAMETERS (event) ? XCONS (event)->car : (event))
62
53ce28d6 63/* Extract the starting and ending positions from a composite event. */
ac501cd9
JB
64#define EVENT_START(event) (XCONS (XCONS (event)->cdr)->car)
65#define EVENT_END(event) (XCONS (XCONS (XCONS (event)->cdr)->cdr)->car)
66
6765e5b0
JB
67/* Extract the click count from a multi-click event. */
68#define EVENT_CLICK_COUNT(event) (Fnth ((event), make_number (2)))
69
53ce28d6 70/* Extract the fields of a position. */
ac501cd9
JB
71#define POSN_WINDOW(posn) (XCONS (posn)->car)
72#define POSN_BUFFER_POSN(posn) (XCONS (XCONS (posn)->cdr)->car)
ac501cd9
JB
73#define POSN_WINDOW_POSN(posn) (XCONS (XCONS (XCONS (posn)->cdr)->cdr)->car)
74#define POSN_TIMESTAMP(posn) \
75 (XCONS (XCONS (XCONS (XCONS (posn)->cdr)->cdr)->cdr)->car)
6765e5b0 76#define POSN_SCROLLBAR_PART(posn) (Fnth ((posn), make_number (4)))
284f4730
JB
77
78/* Some of the event heads. */
6084b314 79extern Lisp_Object Qswitch_frame;
284f4730
JB
80
81/* Properties on event heads. */
ac501cd9 82extern Lisp_Object Qevent_kind, Qevent_symbol_elements;
284f4730
JB
83
84/* Getting an unmodified version of an event head. */
85#define EVENT_HEAD_UNMODIFIED(event_head) \
ac501cd9 86 (Fcar (Fget ((event_head), Qevent_symbol_elements)))
284f4730
JB
87
88/* The values of Qevent_kind properties. */
89extern Lisp_Object Qfunction_key, Qmouse_click, Qmouse_movement;
fd2777e0 90extern Lisp_Object Qscroll_bar_movement;
284f4730
JB
91
92/* Getting the kind of an event head. */
93#define EVENT_HEAD_KIND(event_head) \
94 (Fget ((event_head), Qevent_kind))
95
96/* Symbols to use for non-text mouse positions. */
e5d77022 97extern Lisp_Object Qmode_line, Qvertical_line;
284f4730 98
5bb46ecf
JB
99extern Lisp_Object get_keymap_1 ();
100extern Lisp_Object Fkeymapp ();
101extern Lisp_Object reorder_modifiers ();
5bb46ecf 102extern Lisp_Object read_char ();
ec558adc
JB
103/* User-supplied string to translate input characters through. */
104extern Lisp_Object Vkeyboard_translate_table;
105
71e61810 106extern Lisp_Object map_prompt ();