comparison src/sysdep.c @ 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 f82e3a6f5ccb
children 2ecd1f669db9
comparison
equal deleted inserted replaced
82988:f82e3a6f5ccb 82989:f3845715a5f6
250 int emacs_ospeed; 250 int emacs_ospeed;
251 251
252 void croak P_ ((char *)); 252 void croak P_ ((char *));
253 253
254 #ifdef AIXHFT 254 #ifdef AIXHFT
255 void hft_init P_ ((struct tty_output *)); 255 void hft_init P_ ((struct tty_display_info *));
256 void hft_reset P_ ((struct tty_output *)); 256 void hft_reset P_ ((struct tty_display_info *));
257 #endif 257 #endif
258 258
259 /* Temporary used by `sigblock' when defined in terms of signprocmask. */ 259 /* Temporary used by `sigblock' when defined in terms of signprocmask. */
260 260
261 SIGMASKTYPE sigprocmask_set; 261 SIGMASKTYPE sigprocmask_set;
283 &buf.main, 0, 0, terminator_mask, 0, 0); 283 &buf.main, 0, 0, terminator_mask, 0, 0);
284 queue_kbd_input (); 284 queue_kbd_input ();
285 #else /* not VMS */ 285 #else /* not VMS */
286 #ifdef APOLLO 286 #ifdef APOLLO
287 { 287 {
288 struct tty_output *tty; 288 struct tty_display_info *tty;
289 for (tty = tty_list; tty; tty = tty->next) 289 for (tty = tty_list; tty; tty = tty->next)
290 { 290 {
291 int zero = 0; 291 int zero = 0;
292 ioctl (fileno (TTY_INPUT (tty)), TIOCFLUSH, &zero); 292 ioctl (fileno (TTY_INPUT (tty)), TIOCFLUSH, &zero);
293 } 293 }
296 #ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */ 296 #ifdef MSDOS /* Demacs 1.1.1 91/10/16 HIRANO Satoshi */
297 while (dos_keyread () != -1) 297 while (dos_keyread () != -1)
298 ; 298 ;
299 #else /* not MSDOS */ 299 #else /* not MSDOS */
300 { 300 {
301 struct tty_output *tty; 301 struct tty_display_info *tty;
302 for (tty = tty_list; tty; tty = tty->next) 302 for (tty = tty_list; tty; tty = tty->next)
303 { 303 {
304 EMACS_GET_TTY (fileno (TTY_INPUT (tty)), &buf); 304 EMACS_GET_TTY (fileno (TTY_INPUT (tty)), &buf);
305 EMACS_SET_TTY (fileno (TTY_INPUT (tty)), &buf, 0); 305 EMACS_SET_TTY (fileno (TTY_INPUT (tty)), &buf, 0);
306 } 306 }
1293 #endif 1293 #endif
1294 1294
1295 void 1295 void
1296 init_all_sys_modes (void) 1296 init_all_sys_modes (void)
1297 { 1297 {
1298 struct tty_output *tty; 1298 struct tty_display_info *tty;
1299 for (tty = tty_list; tty; tty = tty->next) 1299 for (tty = tty_list; tty; tty = tty->next)
1300 init_sys_modes (tty); 1300 init_sys_modes (tty);
1301 } 1301 }
1302 1302
1303 void 1303 void
1304 init_sys_modes (tty_out) 1304 init_sys_modes (tty_out)
1305 struct tty_output *tty_out; 1305 struct tty_display_info *tty_out;
1306 { 1306 {
1307 struct emacs_tty tty; 1307 struct emacs_tty tty;
1308 1308
1309 #ifdef MAC_OS8 1309 #ifdef MAC_OS8
1310 /* cus-start.el complains if delete-exited-processes is not defined */ 1310 /* cus-start.el complains if delete-exited-processes is not defined */
1794 1794
1795 1795
1796 void 1796 void
1797 reset_all_sys_modes (void) 1797 reset_all_sys_modes (void)
1798 { 1798 {
1799 struct tty_output *tty; 1799 struct tty_display_info *tty;
1800 for (tty = tty_list; tty; tty = tty->next) 1800 for (tty = tty_list; tty; tty = tty->next)
1801 reset_sys_modes (tty); 1801 reset_sys_modes (tty);
1802 } 1802 }
1803 1803
1804 /* Prepare the terminal for closing it; move the cursor to the 1804 /* Prepare the terminal for closing it; move the cursor to the
1805 bottom of the frame, turn off interrupt-driven I/O, etc. */ 1805 bottom of the frame, turn off interrupt-driven I/O, etc. */
1806 void 1806 void
1807 reset_sys_modes (tty_out) 1807 reset_sys_modes (tty_out)
1808 struct tty_output *tty_out; 1808 struct tty_display_info *tty_out;
1809 { 1809 {
1810 if (noninteractive) 1810 if (noninteractive)
1811 { 1811 {
1812 fflush (stdout); 1812 fflush (stdout);
1813 return; 1813 return;
5108 5108
5109 #ifdef AIXHFT 5109 #ifdef AIXHFT
5110 5110
5111 /* Called from init_sys_modes. */ 5111 /* Called from init_sys_modes. */
5112 void 5112 void
5113 hft_init (struct tty_output *tty_out) 5113 hft_init (struct tty_display_info *tty_out)
5114 { 5114 {
5115 int junk; 5115 int junk;
5116 5116
5117 /* If we're not on an HFT we shouldn't do any of this. We determine 5117 /* If we're not on an HFT we shouldn't do any of this. We determine
5118 if we are on an HFT by trying to get an HFT error code. If this 5118 if we are on an HFT by trying to get an HFT error code. If this
5163 } 5163 }
5164 5164
5165 /* Reset the rubout key to backspace. */ 5165 /* Reset the rubout key to backspace. */
5166 5166
5167 void 5167 void
5168 hft_reset (struct tty_output *tty_out) 5168 hft_reset (struct tty_display_info *tty_out)
5169 { 5169 {
5170 struct hfbuf buf; 5170 struct hfbuf buf;
5171 struct hfkeymap keymap; 5171 struct hfkeymap keymap;
5172 int junk; 5172 int junk;
5173 5173