Mercurial > emacs
diff src/termchar.h @ 82989:f3845715a5f6
Separate frame-local, tty-dependent parameters from tty-local parameters.
src/termchar.h (struct tty_output): Redefined to contain frame-local
tty-dependent parameters. (Currently there are no such parameters, so
it consists of the tty_display_info pointer.)
(struct tty_display_info): New structure, with reference_count.
(FRAME_TTY): Updated to reflect new termcap frame structure.
src/term.c: Update prototypes. Use tty_display_info instead of tty_output.
src/cm.c (current_tty, cmcheckmagic, cmcostinit, calccost, cmgoto, Wcm_clear)
(Wcm_init): Use tty_display_info instead of tty_output.
src/cm.h: Update prototypes.
src/dispextern.h: Ditto.
src/dispnew.c (window_change_signal, init_display, make_terminal_frame):
Use tty_display_info instead of tty_output.
src/frame.c (Fdelete_frame): Use tty_display_info instead of
tty_output. Fix delete_tty check.
(make_terminal_frame): Allocate f->output_data.tty. Increase
reference count of tty device.
(delete_frame): Free f->output_data.tty. Use reference count to
decide if the tty should be closed.
src/frame.h (FRAME_FOREGROUND_PIXEL, FRAME_BACKGROUND_PIXEL): New,
unconditional definitions.
(struct device): New declaration (at the moment, it is defined as
empty in termhooks.h).
(struct frame): Added display, background_pixel, foreground_pixel member.
src/keyboard.c (read_avail_input): Use tty_display_info instead of tty_output.
src/lisp.h: Declare struct display. Update prototypes.
src/sysdep.c: Update prototypes.
(discard_tty_input, init_all_sys_modes, init_sys_modes, reset_all_sys_modes)
(reset_sys_modes, hft_init, hft_reset): Use tty_display_info instead
of tty_output.
git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-29
| author | Karoly Lorentey <lorentey@elte.hu> |
|---|---|
| date | Thu, 01 Jan 2004 17:55:53 +0000 |
| parents | fe9b37bee5f7 |
| children | 2ecd1f669db9 |
line wrap: on
line diff
--- a/src/termchar.h Wed Dec 31 05:09:29 2003 +0000 +++ b/src/termchar.h Thu Jan 01 17:55:53 2004 +0000 @@ -18,11 +18,22 @@ the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -/* 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 terminals. */ +/* 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. */ struct tty_output { + /* The Emacs structure for the tty device this frame is on. */ + struct tty_display_info *display_info; + + /* There is nothing else here at the moment... */ +}; + +/* Parameters that are shared between frames on the same tty device. */ +struct tty_display_info +{ + struct tty_display_info *next; /* Chain of all tty devices. */ + char *name; /* The name of the device file or 0 if stdin/stdout. */ char *type; /* The type of the tty. */ @@ -40,8 +51,9 @@ int term_initted; /* 1 if we have been through init_sys_modes. */ - /* Structure for info on cursor positioning. */ - + int reference_count; /* Number of frames that are on this display. */ + + /* Info on cursor positioning. */ struct cm *Wcm; /* Redisplay. */ @@ -52,12 +64,6 @@ /* The previous terminal frame we displayed on this tty. */ struct frame *previous_terminal_frame; - /* Pixel values. - XXX What are these used for? */ - - unsigned long background_pixel; - unsigned long foreground_pixel; - /* Terminal characteristics. */ int must_write_spaces; /* Nonzero means spaces in the text must @@ -192,23 +198,19 @@ /* Flag used in tty_show/hide_cursor. */ int cursor_hidden; - - - struct tty_output *next; }; -extern struct tty_output *tty_list; +/* A chain of structures for all tty devices currently in use. */ +extern struct tty_display_info *tty_list; -#define FRAME_TTY(f) \ - ((f)->output_method == output_termcap \ - ? (f)->output_data.tty : (abort(), (struct tty_output *) 0)) - +#define FRAME_TTY(f) \ + ((f)->output_method == output_termcap \ + ? (f)->output_data.tty->display_info \ + : (abort(), (struct tty_display_info *) 0)) + #define CURTTY() FRAME_TTY (SELECTED_FRAME()) -#define TTY_NAME(t) ((t)->name) -#define TTY_TYPE(t) ((t)->type) - #define TTY_INPUT(t) ((t)->input) #define TTY_OUTPUT(t) ((t)->output) #define TTY_TERMSCRIPT(t) ((t)->termscript) @@ -221,11 +223,5 @@ #define TTY_SCROLL_REGION_COST(t) ((t)->scroll_region_cost) #define TTY_MEMORY_BELOW_FRAME(t) ((t)->memory_below_frame) -#if 0 -/* These are not used anywhere. */ -#define TTY_MIN_PADDING_SPEED(t) ((t)->min_padding_speed) -#define TTY_DONT_CALCULATE_COSTS(t) ((t)->dont_calculate_costs) -#endif - /* arch-tag: bf9f0d49-842b-42fb-9348-ec8759b27193 (do not change this comment) */
