1 /* Hooks by which low level terminal operations
2 can be made to call other routines.
3 Copyright (C) 1985, 1986 Free Software Foundation, Inc.
5 This file is part of GNU Emacs.
7 GNU Emacs is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 1, or (at your option)
12 GNU Emacs is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
17 You should have received a copy of the GNU General Public License
18 along with GNU Emacs; see the file COPYING. If not, write to
19 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
22 extern int (*cursor_to_hook
) ();
23 extern int (*raw_cursor_to_hook
) ();
25 extern int (*clear_to_end_hook
) ();
26 extern int (*clear_screen_hook
) ();
27 extern int (*clear_end_of_line_hook
) ();
29 extern int (*ins_del_lines_hook
) ();
31 extern int (*change_line_highlight_hook
) ();
32 extern int (*reassert_line_highlight_hook
) ();
34 extern int (*insert_glyphs_hook
) ();
35 extern int (*write_glyphs_hook
) ();
36 extern int (*delete_glyphs_hook
) ();
38 extern int (*ring_bell_hook
) ();
40 extern int (*reset_terminal_modes_hook
) ();
41 extern int (*set_terminal_modes_hook
) ();
42 extern int (*update_begin_hook
) ();
43 extern int (*update_end_hook
) ();
44 extern int (*set_terminal_window_hook
) ();
46 extern int (*read_socket_hook
) ();
48 /* Hook for Emacs to call to tell the window-system-specific code to
49 enable/disable low-level tracking. The value of ENABLE tells the
50 window system event handler whether it should notice or ignore
51 subsequent mouse movement and mouse button releases.
53 If this is 0, Emacs should assume that there is no mouse (or at
54 least no mouse tracking) available.
56 If called with ENABLE non-zero, the window system event handler
57 should call set_pointer_loc with the new mouse co-ordinates
58 whenever the mouse moves, and enqueue a mouse button event for
59 button releases as well as button presses.
61 If called with ENABLE zero, the window system event handler should
62 ignore mouse movement events, and not enqueue events for mouse
64 extern int (*mouse_tracking_enable_hook
) ( /* int ENABLE */ );
66 /* When reading from a minibuffer in a different screen, Emacs wants
67 to shift the highlight from the selected screen to the minibuffer's
68 screen; under X, this means it lies about where the focus is.
69 This hook tells the window system code to re-decide where to put
71 extern void (*screen_rehighlight_hook
) ( /* SCREEN_PTR s */ );
73 /* If nonzero, send all terminal output characters to this stream also. */
75 extern FILE *termscript
;
78 /* Expedient hack: only provide the below definitions to files that
79 are prepared to handle lispy things. XINT is defined iff lisp.h
80 has been included in the file before this file. */
82 /* The keyboard input buffer is an array of these structures. Each one
83 represents some sort of input event - a keystroke, a mouse click, or
84 a window system event. These get turned into their lispy forms when
85 they are removed from the event queue. */
89 /* What kind of event was this? */
91 no_event
, /* nothing happened. This should never
92 actually appear in the event queue. */
93 ascii_keystroke
, /* The ASCII code is in .code.
94 .screen is the screen in which the key
96 Note that this includes meta-keys, and
97 the modifiers field of the event
100 non_ascii_keystroke
, /* .code is a number identifying the
101 function key. A code N represents
103 function_key_names[N]; function_key_names
104 is a table in keyboard.c to which you
105 should feel free to add missing keys.
106 .modifiers holds the state of the
108 .screen is the screen in which the key
110 mouse_click
, /* The button number is in .code.
111 .modifiers holds the state of the
113 .x and .y give the mouse position,
114 in pixels, within the window.
115 .screen gives the screen the mouse
117 .timestamp gives a timestamp (in
118 milliseconds) for the click. */
119 scrollbar_click
, /* .code gives the number of the mouse
120 button that was clicked.
121 .part is a lisp symbol indicating which
122 part of the scrollbar got clicked. This
123 indicates whether the scroll bar was
124 horizontal or vertical.
125 .modifiers gives the state of the
127 .x gives the distance from the start
128 of the scroll bar of the click; .y gives
129 the total length of the scroll bar.
130 .screen gives the screen the click
132 .timestamp gives a timestamp (in
133 milliseconds) for the click. */
135 screen_selected
, /* The user has moved the focus to another
137 .screen is the screen that should become
138 selected at the next convenient time. */
144 struct screen
*screen
;
145 int modifiers
; /* See enum below for interpretation. */
147 Lisp_Object timestamp
;
150 /* Bits in the modifiers member of the input_event structure. */
155 up_modifier
= 8, /* This only applies to mouse buttons. */
156 last_modifier
/* This should always be one more than the
157 highest modifier bit defined. */
160 #define NUM_MODIFIER_COMBOS ((last_modifier-1) << 1)