]> code.delx.au - gnu-emacs/blobdiff - src/termchar.h
* src/macfont.m (mac_font_shape): Make sure that total_advance is increasing.
[gnu-emacs] / src / termchar.h
index 5c57593c04f38e0c7ea5baa90e9f441ebc3d61b7..35b30fb90ccee1b9b31193f79da5630a6250fbd1 100644 (file)
@@ -1,12 +1,12 @@
 /* Flags and parameters describing terminal's characteristics.
-   Copyright (C) 1985-1986, 2001-201 Free Software Foundation, Inc.
+   Copyright (C) 1985-1986, 2001-2016 Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
 
 GNU Emacs is free software: you can redistribute it and/or modify
 it under the terms of the GNU General Public License as published by
-the Free Software Foundation, either version 3 of the License, or
-(at your option) any later version.
+the Free Software Foundation, either version 3 of the License, or (at
+your option) any later version.
 
 GNU Emacs is distributed in the hope that it will be useful,
 but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -16,6 +16,12 @@ GNU General Public License for more details.
 You should have received a copy of the GNU General Public License
 along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
+#ifndef EMACS_TERMCHAR_H
+#define EMACS_TERMCHAR_H
+
+#include <stdio.h>
+#include "dispextern.h"
+
 /* Each termcap frame points to its own struct tty_output object in
    the output_data.tty field.  The tty_output structure contains the
    information that is specific to termcap frames. */
@@ -28,6 +34,8 @@ struct tty_output
   /* There is nothing else here at the moment... */
 };
 
+enum { TERMCAP_BUFFER_SIZE = 4096 };
+
 /* Parameters that are shared between frames on the same tty device. */
 
 struct tty_display_info
@@ -50,8 +58,8 @@ struct tty_display_info
 
   struct emacs_tty *old_tty;    /* The initial tty mode bits */
 
-  int term_initted;             /* 1 if we have been through init_sys_modes. */
-
+  bool_bf term_initted : 1;    /* True if we have been through
+                                  init_sys_modes. */
 
   int reference_count;          /* Number of frames that are on this display. */
 
@@ -74,13 +82,12 @@ struct tty_display_info
   Mouse_HLInfo mouse_highlight;
 
   /* Buffer used internally by termcap (see tgetent in the Termcap
-     manual).  Only init_tty and delete_tty should change this.  */
-  char *termcap_term_buffer;
+     manual).  Only init_tty should use this.  */
+  char termcap_term_buffer[TERMCAP_BUFFER_SIZE];
 
   /* Buffer storing terminal description strings (see tgetstr in the
-     Termcap manual).  Only init_tty and delete_tty should change
-     this.  */
-  char *termcap_strings_buffer;
+     Termcap manual).  Only init_tty should use this.  */
+  char termcap_strings_buffer[TERMCAP_BUFFER_SIZE];
 
   /* Strings, numbers and flags taken from the termcap entry.  */
 
@@ -164,17 +171,12 @@ struct tty_display_info
 
   int RPov;                     /* # chars to start a TS_repeat */
 
-  int delete_in_insert_mode;    /* delete mode == insert mode */
-
-  int se_is_so;                 /* 1 if same string both enters and leaves
-                                   standout mode */
-
-  int costs_set;                /* Nonzero if costs have been calculated. */
-
-  int insert_mode;              /* Nonzero when in insert mode.  */
-  int standout_mode;            /* Nonzero when in standout mode.  */
+  bool_bf delete_in_insert_mode : 1;    /* delete mode == insert mode */
 
+  bool_bf costs_set : 1;       /* True if costs have been calculated. */
 
+  bool_bf insert_mode : 1;     /* True when in insert mode.  */
+  bool_bf standout_mode : 1;   /* True when in standout mode.  */
 
   /* 1 if should obey 0200 bit in input chars as "Meta", 2 if should
      keep 0200 bit in input chars.  0 to ignore the 0200 bit.  */
@@ -192,11 +194,33 @@ struct tty_display_info
 
   /* Flag used in tty_show/hide_cursor.  */
 
-  int cursor_hidden;
+  bool_bf cursor_hidden : 1;
+
+  /* True means use ^S/^Q for flow control.  */
 
-  /* Nonzero means use ^S/^Q for flow control.  */
-  int flow_control;
+  bool_bf flow_control : 1;
 
+  /* True means we are displaying a TTY menu on this tty.  */
+  bool_bf showing_menu : 1;
+
+  /* True means spaces in the text must actually be output;
+     can't just skip over some columns to leave them blank.  */
+  bool_bf must_write_spaces : 1;
+
+  /* True if TTY can insert and delete lines.  */
+  bool_bf line_ins_del_ok : 1;
+
+  /* True if TTY can insert and delete chars.  */
+  bool_bf char_ins_del_ok : 1;
+
+  /* True if TTY supports setting the scroll window.  */
+  bool_bf scroll_region_ok : 1;
+
+  /* True if TTY remembers lines scrolled off bottom.  */
+  bool_bf memory_below_frame : 1;
+
+  /* Cost of setting the scroll window, measured in characters.  */
+  int scroll_region_cost;
 };
 
 /* A chain of structures for all tty devices currently in use. */
@@ -210,3 +234,5 @@ extern struct tty_display_info *tty_list;
    : (emacs_abort (), (struct tty_display_info *) 0))
 
 #define CURTTY() FRAME_TTY (SELECTED_FRAME())
+
+#endif /* EMACS_TERMCHAR_H */