aboutsummaryrefslogtreecommitdiffstats
path: root/src/termhooks.h
diff options
context:
space:
mode:
authorEli Zaretskii2013-09-05 11:01:04 +0300
committerEli Zaretskii2013-09-05 11:01:04 +0300
commit41306318777a942420bc4feadbfacf662ea179dc (patch)
tree669e5cca02f95d6064ce73c0d3fbbf91b8c8b563 /src/termhooks.h
parent141f1ff7a40cda10f0558e891dd196a943a5082e (diff)
parent257b3b03cb1cff917e0b3b7832ad3eab5b59f257 (diff)
downloademacs-41306318777a942420bc4feadbfacf662ea179dc.tar.gz
emacs-41306318777a942420bc4feadbfacf662ea179dc.zip
Merge from trunk after a lot of time.
Diffstat (limited to 'src/termhooks.h')
-rw-r--r--src/termhooks.h136
1 files changed, 68 insertions, 68 deletions
diff --git a/src/termhooks.h b/src/termhooks.h
index a15f829288a..437089ebf7a 100644
--- a/src/termhooks.h
+++ b/src/termhooks.h
@@ -1,6 +1,7 @@
1/* Parameters and display hooks for terminal devices. 1/* Parameters and display hooks for terminal devices.
2 2
3Copyright (C) 1985-1986, 1993-1994, 2001-2012 Free Software Foundation, Inc. 3Copyright (C) 1985-1986, 1993-1994, 2001-2013 Free Software Foundation,
4Inc.
4 5
5This file is part of GNU Emacs. 6This file is part of GNU Emacs.
6 7
@@ -17,14 +18,17 @@ GNU General Public License for more details.
17You should have received a copy of the GNU General Public License 18You should have received a copy of the GNU General Public License
18along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ 19along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19 20
20 21#ifndef EMACS_TERMHOOKS_H
22#define EMACS_TERMHOOKS_H
23
21/* Miscellanea. */ 24/* Miscellanea. */
22 25
23#include "systime.h" /* for Time */ 26#include "systime.h" /* for Time */
24 27
25struct glyph; 28INLINE_HEADER_BEGIN
26struct frame; 29#ifndef TERMHOOKS_INLINE
27 30# define TERMHOOKS_INLINE INLINE
31#endif
28 32
29enum scroll_bar_part { 33enum scroll_bar_part {
30 scroll_bar_above_handle, 34 scroll_bar_above_handle,
@@ -43,7 +47,18 @@ enum scroll_bar_part {
43 may do something OS dependent, like extended window manager hints on X11. */ 47 may do something OS dependent, like extended window manager hints on X11. */
44extern void (*fullscreen_hook) (struct frame *f); 48extern void (*fullscreen_hook) (struct frame *f);
45 49
46 50/* Output method of a terminal (and frames on this terminal, respectively). */
51
52enum output_method
53{
54 output_initial,
55 output_termcap,
56 output_x_window,
57 output_msdos_raw,
58 output_w32,
59 output_ns
60};
61
47/* Input queue declarations and hooks. */ 62/* Input queue declarations and hooks. */
48 63
49enum event_kind 64enum event_kind
@@ -102,9 +117,9 @@ enum event_kind
102 HORIZ_WHEEL_EVENT, /* A wheel event generated by a second 117 HORIZ_WHEEL_EVENT, /* A wheel event generated by a second
103 horizontal wheel that is present on some 118 horizontal wheel that is present on some
104 mice. See WHEEL_EVENT. */ 119 mice. See WHEEL_EVENT. */
105#if defined (WINDOWSNT) 120#ifdef HAVE_NTGUI
106 LANGUAGE_CHANGE_EVENT, /* A LANGUAGE_CHANGE_EVENT is 121 LANGUAGE_CHANGE_EVENT, /* A LANGUAGE_CHANGE_EVENT is
107 generated on WINDOWSNT or Mac OS 122 generated when HAVE_NTGUI or on Mac OS
108 when the keyboard layout or input 123 when the keyboard layout or input
109 language is changed by the 124 language is changed by the
110 user. */ 125 user. */
@@ -166,6 +181,8 @@ enum event_kind
166 `switch-frame' events in kbd_buffer_get_event, if necessary. */ 181 `switch-frame' events in kbd_buffer_get_event, if necessary. */
167 FOCUS_IN_EVENT, 182 FOCUS_IN_EVENT,
168 183
184 FOCUS_OUT_EVENT,
185
169 /* Generated when mouse moves over window not currently selected. */ 186 /* Generated when mouse moves over window not currently selected. */
170 SELECT_WINDOW_EVENT, 187 SELECT_WINDOW_EVENT,
171 188
@@ -183,7 +200,7 @@ enum event_kind
183 200
184 , CONFIG_CHANGED_EVENT 201 , CONFIG_CHANGED_EVENT
185 202
186#ifdef WINDOWSNT 203#ifdef HAVE_NTGUI
187 /* Generated when an APPCOMMAND event is received, in response to 204 /* Generated when an APPCOMMAND event is received, in response to
188 Multimedia or Internet buttons on some keyboards. 205 Multimedia or Internet buttons on some keyboards.
189 Such keys are available as normal function keys on X through the 206 Such keys are available as normal function keys on X through the
@@ -206,6 +223,11 @@ enum event_kind
206 , NS_NONKEY_EVENT 223 , NS_NONKEY_EVENT
207#endif 224#endif
208 225
226#ifdef USE_FILE_NOTIFY
227 /* File or directory was changed. */
228 , FILE_NOTIFY_EVENT
229#endif
230
209}; 231};
210 232
211/* If a struct input_event has a kind which is SELECTION_REQUEST_EVENT 233/* If a struct input_event has a kind which is SELECTION_REQUEST_EVENT
@@ -237,16 +259,8 @@ struct input_event
237 Lisp_Object x, y; 259 Lisp_Object x, y;
238 Time timestamp; 260 Time timestamp;
239 261
240 /* This is padding just to put the frame_or_window field 262 /* This field is copied into a vector while the event is in
241 past the size of struct selection_input_event. */ 263 the queue, so that garbage collections won't kill it. */
242 int *padding[2];
243
244 /* This field is copied into a vector while the event is in the queue,
245 so that garbage collections won't kill it. */
246 /* In a menu_bar_event, this is a cons cell whose car is the frame
247 and whose cdr is the Lisp object that is the event's value. */
248 /* This field is last so that struct selection_input_event
249 does not overlap with it. */
250 Lisp_Object frame_or_window; 264 Lisp_Object frame_or_window;
251 265
252 /* Additional event argument. This is used for TOOL_BAR_EVENTs and 266 /* Additional event argument. This is used for TOOL_BAR_EVENTs and
@@ -316,11 +330,6 @@ extern void term_mouse_moveto (int, int);
316extern struct tty_display_info *gpm_tty; 330extern struct tty_display_info *gpm_tty;
317#endif 331#endif
318 332
319
320struct ns_display_info;
321struct x_display_info;
322struct w32_display_info;
323
324/* Terminal-local parameters. */ 333/* Terminal-local parameters. */
325struct terminal 334struct terminal
326{ 335{
@@ -379,7 +388,7 @@ struct terminal
379 struct image_cache *image_cache; 388 struct image_cache *image_cache;
380#endif /* HAVE_WINDOW_SYSTEM */ 389#endif /* HAVE_WINDOW_SYSTEM */
381 390
382 /* Device-type dependent data shared amongst all frames on this terminal. */ 391 /* Device-type dependent data shared amongst all frames on this terminal. */
383 union display_info 392 union display_info
384 { 393 {
385 struct tty_display_info *tty; /* termchar.h */ 394 struct tty_display_info *tty; /* termchar.h */
@@ -400,31 +409,23 @@ struct terminal
400 the function `set-keyboard-coding-system'. */ 409 the function `set-keyboard-coding-system'. */
401 struct coding_system *keyboard_coding; 410 struct coding_system *keyboard_coding;
402 411
403 /* Terminal characteristics. */ 412 /* Terminal characteristics. */
404 /* XXX Are these really used on non-termcap displays? */ 413 /* XXX Are these really used on non-termcap displays? */
405 414
406 int must_write_spaces; /* Nonzero means spaces in the text must 415 int must_write_spaces; /* Nonzero means spaces in the text must
407 actually be output; can't just skip over 416 actually be output; can't just skip over
408 some columns to leave them blank. */ 417 some columns to leave them blank. */
409 int fast_clear_end_of_line; /* Nonzero means terminal has a `ce' string */ 418 int fast_clear_end_of_line; /* Nonzero means terminal has a `ce' string. */
410 419
411 int line_ins_del_ok; /* Terminal can insert and delete lines */ 420 int line_ins_del_ok; /* Terminal can insert and delete lines. */
412 int char_ins_del_ok; /* Terminal can insert and delete chars */ 421 int char_ins_del_ok; /* Terminal can insert and delete chars. */
413 int scroll_region_ok; /* Terminal supports setting the scroll 422 int scroll_region_ok; /* Terminal supports setting the scroll
414 window */ 423 window. */
415 int scroll_region_cost; /* Cost of setting the scroll window, 424 int scroll_region_cost; /* Cost of setting the scroll window,
416 measured in characters. */ 425 measured in characters. */
417 int memory_below_frame; /* Terminal remembers lines scrolled 426 int memory_below_frame; /* Terminal remembers lines scrolled
418 off bottom */ 427 off bottom. */
419 428
420#if 0 /* These are not used anywhere. */
421 /* EMACS_INT baud_rate; */ /* Output speed in baud */
422 int min_padding_speed; /* Speed below which no padding necessary. */
423 int dont_calculate_costs; /* Nonzero means don't bother computing
424 various cost tables; we won't use them. */
425#endif
426
427
428 /* Window-based redisplay interface for this device (0 for tty 429 /* Window-based redisplay interface for this device (0 for tty
429 devices). */ 430 devices). */
430 struct redisplay_interface *rif; 431 struct redisplay_interface *rif;
@@ -472,10 +473,7 @@ struct terminal
472 Otherwise, set *bar_window to Qnil, and *x and *y to the column and 473 Otherwise, set *bar_window to Qnil, and *x and *y to the column and
473 row of the character cell the mouse is over. 474 row of the character cell the mouse is over.
474 475
475 Set *time to the time the mouse was at the returned position. 476 Set *time to the time the mouse was at the returned position. */
476
477 This should clear mouse_moved until the next motion
478 event arrives. */
479 void (*mouse_position_hook) (struct frame **f, int, 477 void (*mouse_position_hook) (struct frame **f, int,
480 Lisp_Object *bar_window, 478 Lisp_Object *bar_window,
481 enum scroll_bar_part *part, 479 enum scroll_bar_part *part,
@@ -483,11 +481,6 @@ struct terminal
483 Lisp_Object *y, 481 Lisp_Object *y,
484 Time *); 482 Time *);
485 483
486 /* The window system handling code should set this if the mouse has
487 moved since the last call to the mouse_position_hook. Calling that
488 hook should clear this. */
489 int mouse_moved;
490
491 /* When a frame's focus redirection is changed, this hook tells the 484 /* When a frame's focus redirection is changed, this hook tells the
492 window system code to re-decide where to put the highlight. Under 485 window system code to re-decide where to put the highlight. Under
493 X, this means that Emacs lies about where the focus is. */ 486 X, this means that Emacs lies about where the focus is. */
@@ -586,24 +579,14 @@ struct terminal
586 /* Called to read input events. 579 /* Called to read input events.
587 580
588 TERMINAL indicates which terminal device to read from. Input 581 TERMINAL indicates which terminal device to read from. Input
589 events should be read into BUF, the size of which is given in 582 events should be read into HOLD_QUIT.
590 SIZE. EXPECTED is non-zero if the caller suspects that new input
591 is available.
592 583
593 A positive return value indicates that that many input events 584 A positive return value indicates that that many input events
594 where read into BUF. 585 were read into BUF.
595 Zero means no events were immediately available. 586 Zero means no events were immediately available.
596 A value of -1 means a transient read error, while -2 indicates 587 A value of -1 means a transient read error, while -2 indicates
597 that the device was closed (hangup), and it should be deleted. 588 that the device was closed (hangup), and it should be deleted. */
598
599 XXX Please note that a non-zero value of EXPECTED only means that
600 there is available input on at least one of the currently opened
601 terminal devices -- but not necessarily on this device.
602 Therefore, in most cases EXPECTED should be simply ignored.
603
604 XXX This documentation needs to be updated. */
605 int (*read_socket_hook) (struct terminal *terminal, 589 int (*read_socket_hook) (struct terminal *terminal,
606 int expected,
607 struct input_event *hold_quit); 590 struct input_event *hold_quit);
608 591
609 /* Called when a frame's display becomes entirely up to date. */ 592 /* Called when a frame's display becomes entirely up to date. */
@@ -627,8 +610,20 @@ struct terminal
627 void (*delete_terminal_hook) (struct terminal *); 610 void (*delete_terminal_hook) (struct terminal *);
628}; 611};
629 612
613/* Most code should use these functions to set Lisp fields in struct
614 terminal. */
615TERMHOOKS_INLINE void
616tset_charset_list (struct terminal *t, Lisp_Object val)
617{
618 t->charset_list = val;
619}
620TERMHOOKS_INLINE void
621tset_selection_alist (struct terminal *t, Lisp_Object val)
622{
623 t->Vselection_alist = val;
624}
630 625
631/* Chain of all terminal devices currently in use. */ 626/* Chain of all terminal devices currently in use. */
632extern struct terminal *terminal_list; 627extern struct terminal *terminal_list;
633 628
634#define FRAME_MUST_WRITE_SPACES(f) ((f)->terminal->must_write_spaces) 629#define FRAME_MUST_WRITE_SPACES(f) ((f)->terminal->must_write_spaces)
@@ -649,14 +644,16 @@ extern struct terminal *terminal_list;
649 644
650#define FRAME_TERMINAL(f) ((f)->terminal) 645#define FRAME_TERMINAL(f) ((f)->terminal)
651 646
652/* Return true if the terminal device is not suspended. */ 647/* Return true if the terminal device is not suspended. */
653#define TERMINAL_ACTIVE_P(d) (((d)->type != output_termcap && (d)->type !=output_msdos_raw) || (d)->display_info.tty->input) 648#define TERMINAL_ACTIVE_P(d) \
649 (((d)->type != output_termcap && (d)->type != output_msdos_raw) \
650 || (d)->display_info.tty->input)
654 651
655extern struct terminal *get_terminal (Lisp_Object terminal, int); 652extern struct terminal *get_terminal (Lisp_Object terminal, bool);
656extern struct terminal *create_terminal (void); 653extern struct terminal *create_terminal (void);
657extern void delete_terminal (struct terminal *); 654extern void delete_terminal (struct terminal *);
658 655
659/* The initial terminal device, created by initial_term_init. */ 656/* The initial terminal device, created by initial_term_init. */
660extern struct terminal *initial_terminal; 657extern struct terminal *initial_terminal;
661 658
662extern unsigned char *encode_terminal_code (struct glyph *, int, 659extern unsigned char *encode_terminal_code (struct glyph *, int,
@@ -671,3 +668,6 @@ extern int curX (struct tty_display_info *);
671extern int curY (struct tty_display_info *); 668extern int curY (struct tty_display_info *);
672#endif 669#endif
673 670
671INLINE_HEADER_END
672
673#endif /* EMACS_TERMHOOKS_H */