Merge from trunk
[bpt/emacs.git] / src / termhooks.h
index ddcbf53..42f2e16 100644 (file)
@@ -1,6 +1,6 @@
 /* Parameters and display hooks for terminal devices.
 
-Copyright (C) 1985-1986, 1993-1994, 2001-2011  Free Software Foundation, Inc.
+Copyright (C) 1985-1986, 1993-1994, 2001-2012  Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
@@ -22,6 +22,11 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "systime.h" /* for Time */
 
+INLINE_HEADER_BEGIN
+#ifndef TERMHOOKS_INLINE
+# define TERMHOOKS_INLINE INLINE
+#endif
+
 struct glyph;
 struct frame;
 \f
@@ -102,9 +107,9 @@ enum event_kind
   HORIZ_WHEEL_EVENT,            /* A wheel event generated by a second
                                    horizontal wheel that is present on some
                                    mice. See WHEEL_EVENT.  */
-#if defined (WINDOWSNT)
+#if defined (HAVE_NTGUI)
   LANGUAGE_CHANGE_EVENT,       /* A LANGUAGE_CHANGE_EVENT is
-                                  generated on WINDOWSNT or Mac OS
+                                  generated when HAVE_NTGUI or on Mac OS
                                   when the keyboard layout or input
                                   language is changed by the
                                   user.  */
@@ -183,7 +188,7 @@ enum event_kind
 
   , CONFIG_CHANGED_EVENT
 
-#ifdef WINDOWSNT
+#ifdef HAVE_NTGUI
   /* Generated when an APPCOMMAND event is received, in response to
      Multimedia or Internet buttons on some keyboards.
      Such keys are available as normal function keys on X through the
@@ -553,7 +558,7 @@ struct terminal
 
   /* Arrange for all scroll bars on FRAME to be removed at the next call
      to `*judge_scroll_bars_hook'.  A scroll bar may be spared if
-     `*redeem_scroll_bar_hook' is applied to its window before the judgement.
+     `*redeem_scroll_bar_hook' is applied to its window before the judgment.
 
      This should be applied to each frame each time its window tree is
      redisplayed, even if it is not displaying scroll bars at the moment;
@@ -565,7 +570,7 @@ struct terminal
      currently displaying them.  */
   void (*condemn_scroll_bars_hook) (struct frame *frame);
 
-  /* Unmark WINDOW's scroll bar for deletion in this judgement cycle.
+  /* Unmark WINDOW's scroll bar for deletion in this judgment cycle.
      Note that it's okay to redeem a scroll bar that is not condemned.  */
   void (*redeem_scroll_bar_hook) (struct window *window);
 
@@ -586,24 +591,14 @@ struct terminal
   /* Called to read input events.
 
      TERMINAL indicates which terminal device to read from.  Input
-     events should be read into BUF, the size of which is given in
-     SIZE.  EXPECTED is non-zero if the caller suspects that new input
-     is available.
+     events should be read into HOLD_QUIT.
 
      A positive return value indicates that that many input events
-     where read into BUF.
+     were read into BUF.
      Zero means no events were immediately available.
      A value of -1 means a transient read error, while -2 indicates
-     that the device was closed (hangup), and it should be deleted.
-
-     XXX Please note that a non-zero value of EXPECTED only means that
-     there is available input on at least one of the currently opened
-     terminal devices -- but not necessarily on this device.
-     Therefore, in most cases EXPECTED should be simply ignored.
-
-     XXX This documentation needs to be updated.  */
+     that the device was closed (hangup), and it should be deleted.  */
   int (*read_socket_hook) (struct terminal *terminal,
-                           int expected,
                            struct input_event *hold_quit);
 
   /* Called when a frame's display becomes entirely up to date.  */
@@ -627,6 +622,18 @@ struct terminal
   void (*delete_terminal_hook) (struct terminal *);
 };
 
+/* Most code should use these functions to set Lisp fields in struct
+   terminal.  */
+TERMHOOKS_INLINE void
+tset_charset_list (struct terminal *t, Lisp_Object val)
+{
+  t->charset_list = val;
+}
+TERMHOOKS_INLINE void
+tset_selection_alist (struct terminal *t, Lisp_Object val)
+{
+  t->Vselection_alist = val;
+}
 
 /* Chain of all terminal devices currently in use. */
 extern struct terminal *terminal_list;
@@ -665,3 +672,5 @@ extern unsigned char *encode_terminal_code (struct glyph *, int,
 #ifdef HAVE_GPM
 extern void close_gpm (int gpm_fd);
 #endif
+
+INLINE_HEADER_END