296
|
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.
|
|
4
|
|
5 This file is part of GNU Emacs.
|
|
6
|
|
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)
|
|
10 any later version.
|
|
11
|
|
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.
|
|
16
|
|
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. */
|
|
20
|
|
21
|
|
22 extern int (*cursor_to_hook) ();
|
|
23 extern int (*raw_cursor_to_hook) ();
|
|
24
|
|
25 extern int (*clear_to_end_hook) ();
|
|
26 extern int (*clear_screen_hook) ();
|
|
27 extern int (*clear_end_of_line_hook) ();
|
|
28
|
|
29 extern int (*ins_del_lines_hook) ();
|
|
30
|
|
31 extern int (*change_line_highlight_hook) ();
|
|
32 extern int (*reassert_line_highlight_hook) ();
|
|
33
|
|
34 extern int (*insert_glyphs_hook) ();
|
|
35 extern int (*write_glyphs_hook) ();
|
|
36 extern int (*delete_glyphs_hook) ();
|
|
37
|
|
38 extern int (*ring_bell_hook) ();
|
|
39
|
|
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) ();
|
|
45
|
|
46 extern int (*read_socket_hook) ();
|
|
47
|
|
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.
|
|
52
|
|
53 If this is 0, Emacs should assume that there is no mouse (or at
|
|
54 least no mouse tracking) available.
|
|
55
|
|
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.
|
|
60
|
|
61 If called with ENABLE zero, the window system event handler should
|
|
62 ignore mouse movement events, and not enqueue events for mouse
|
|
63 button releases. */
|
|
64 extern int (*mouse_tracking_enable_hook) ( /* int ENABLE */ );
|
|
65
|
357
|
66 /* When a screen's focus redirection is changed, this hook tells the
|
|
67 window system code to re-decide where to put the highlight. Under
|
|
68 X, this means that the system lies about where the focus is. */
|
|
69 extern void (*screen_rehighlight_hook) ( /* void */ );
|
338
|
70
|
296
|
71 /* If nonzero, send all terminal output characters to this stream also. */
|
|
72
|
|
73 extern FILE *termscript;
|
|
74
|
|
75 #ifdef XINT
|
|
76 /* Expedient hack: only provide the below definitions to files that
|
|
77 are prepared to handle lispy things. XINT is defined iff lisp.h
|
|
78 has been included in the file before this file. */
|
|
79
|
|
80 /* The keyboard input buffer is an array of these structures. Each one
|
|
81 represents some sort of input event - a keystroke, a mouse click, or
|
|
82 a window system event. These get turned into their lispy forms when
|
|
83 they are removed from the event queue. */
|
|
84
|
|
85 struct input_event {
|
|
86
|
|
87 /* What kind of event was this? */
|
|
88 enum {
|
|
89 no_event, /* nothing happened. This should never
|
|
90 actually appear in the event queue. */
|
338
|
91 ascii_keystroke, /* The ASCII code is in .code.
|
|
92 .screen is the screen in which the key
|
|
93 was typed.
|
|
94 Note that this includes meta-keys, and
|
|
95 the modifiers field of the event
|
|
96 is unused. */
|
|
97
|
296
|
98 non_ascii_keystroke, /* .code is a number identifying the
|
|
99 function key. A code N represents
|
|
100 a key whose name is
|
|
101 function_key_names[N]; function_key_names
|
|
102 is a table in keyboard.c to which you
|
|
103 should feel free to add missing keys.
|
|
104 .modifiers holds the state of the
|
338
|
105 modifier keys.
|
|
106 .screen is the screen in which the key
|
|
107 was typed. */
|
296
|
108 mouse_click, /* The button number is in .code.
|
|
109 .modifiers holds the state of the
|
|
110 modifier keys.
|
|
111 .x and .y give the mouse position,
|
|
112 in pixels, within the window.
|
|
113 .screen gives the screen the mouse
|
|
114 click occurred in.
|
|
115 .timestamp gives a timestamp (in
|
|
116 milliseconds) for the click. */
|
|
117 scrollbar_click, /* .code gives the number of the mouse
|
|
118 button that was clicked.
|
|
119 .part is a lisp symbol indicating which
|
|
120 part of the scrollbar got clicked. This
|
|
121 indicates whether the scroll bar was
|
|
122 horizontal or vertical.
|
|
123 .modifiers gives the state of the
|
|
124 modifier keys.
|
|
125 .x gives the distance from the start
|
|
126 of the scroll bar of the click; .y gives
|
|
127 the total length of the scroll bar.
|
|
128 .screen gives the screen the click
|
|
129 should apply to.
|
|
130 .timestamp gives a timestamp (in
|
|
131 milliseconds) for the click. */
|
338
|
132 #if 0
|
296
|
133 screen_selected, /* The user has moved the focus to another
|
|
134 screen.
|
|
135 .screen is the screen that should become
|
|
136 selected at the next convenient time. */
|
338
|
137 #endif
|
296
|
138 } kind;
|
|
139
|
|
140 Lisp_Object code;
|
|
141 Lisp_Object part;
|
|
142 struct screen *screen;
|
|
143 int modifiers; /* See enum below for interpretation. */
|
|
144 Lisp_Object x, y;
|
|
145 Lisp_Object timestamp;
|
|
146 };
|
|
147
|
|
148 /* Bits in the modifiers member of the input_event structure. */
|
|
149 enum {
|
|
150 shift_modifier = 1,
|
|
151 ctrl_modifier = 2,
|
|
152 meta_modifier = 4,
|
|
153 up_modifier = 8, /* This only applies to mouse buttons. */
|
|
154 last_modifier /* This should always be one more than the
|
|
155 highest modifier bit defined. */
|
|
156 };
|
|
157
|
|
158 #define NUM_MODIFIER_COMBOS ((last_modifier-1) << 1)
|
|
159
|
|
160 #endif
|