[!HAVE_X_WINDOWS] (store_frame_title): Dummy macro.
[bpt/emacs.git] / src / keyboard.h
1 /* Declarations useful when processing input.
2 Copyright (C) 1985, 1986, 1987, 1993 Free Software Foundation, Inc.
3
4 This file is part of GNU Emacs.
5
6 GNU Emacs is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
10
11 GNU Emacs is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GNU Emacs; see the file COPYING. If not, write to
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
19
20 /* Total number of times read_char has returned. */
21 extern int num_input_chars;
22
23 /* Total number of times read_char has returned, outside of macros. */
24 extern int num_nonmacro_input_chars;
25
26 /* Nonzero means polling for input is temporarily suppressed. */
27 extern int poll_suppress_count;
28
29 /* Nonzero if polling_for_input is actually being used. */
30 extern int polling_for_input;
31
32 /* Keymap mapping ASCII function key sequences onto their preferred forms.
33 Initialized by the terminal-specific lisp files. */
34 extern Lisp_Object Vfunction_key_map;
35
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. */
40 extern Lisp_Object this_command_keys;
41 extern int this_command_key_count;
42
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. */
49 extern Lisp_Object internal_last_event_frame;
50 #endif
51
52 \f
53 /* Macros for dealing with lispy events. */
54
55 /* True iff EVENT has data fields describing it (i.e. a mouse click). */
56 #define EVENT_HAS_PARAMETERS(event) \
57 (XTYPE (event) == Lisp_Cons)
58
59 /* Extract the head from an event.
60 This works on composite and simple events. */
61 #define EVENT_HEAD(event) \
62 (EVENT_HAS_PARAMETERS (event) ? XCONS (event)->car : (event))
63
64 /* Extract the starting and ending positions from a composite event. */
65 #define EVENT_START(event) (XCONS (XCONS (event)->cdr)->car)
66 #define EVENT_END(event) (XCONS (XCONS (XCONS (event)->cdr)->cdr)->car)
67
68 /* Extract the click count from a multi-click event. */
69 #define EVENT_CLICK_COUNT(event) (Fnth ((event), make_number (2)))
70
71 /* Extract the fields of a position. */
72 #define POSN_WINDOW(posn) (XCONS (posn)->car)
73 #define POSN_BUFFER_POSN(posn) (XCONS (XCONS (posn)->cdr)->car)
74 #define POSN_WINDOW_POSN(posn) (XCONS (XCONS (XCONS (posn)->cdr)->cdr)->car)
75 #define POSN_TIMESTAMP(posn) \
76 (XCONS (XCONS (XCONS (XCONS (posn)->cdr)->cdr)->cdr)->car)
77 #define POSN_SCROLLBAR_PART(posn) (Fnth ((posn), make_number (4)))
78
79 /* Some of the event heads. */
80 extern Lisp_Object Qswitch_frame;
81
82 /* Properties on event heads. */
83 extern Lisp_Object Qevent_kind, Qevent_symbol_elements;
84
85 /* Getting an unmodified version of an event head. */
86 #define EVENT_HEAD_UNMODIFIED(event_head) \
87 (Fcar (Fget ((event_head), Qevent_symbol_elements)))
88
89 /* The values of Qevent_kind properties. */
90 extern Lisp_Object Qfunction_key, Qmouse_click, Qmouse_movement;
91 extern Lisp_Object Qscroll_bar_movement;
92
93 /* Getting the kind of an event head. */
94 #define EVENT_HEAD_KIND(event_head) \
95 (Fget ((event_head), Qevent_kind))
96
97 /* Symbols to use for non-text mouse positions. */
98 extern Lisp_Object Qmode_line, Qvertical_line;
99
100 extern Lisp_Object get_keymap_1 ();
101 extern Lisp_Object Fkeymapp ();
102 extern Lisp_Object reorder_modifiers ();
103 extern Lisp_Object read_char ();
104 /* User-supplied string to translate input characters through. */
105 extern Lisp_Object Vkeyboard_translate_table;
106
107 extern Lisp_Object map_prompt ();