From c8aa43edefa82633407a1817a2b862d6bcadc763 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Sun, 16 Jul 2006 18:08:16 +0000 Subject: [PATCH] Common initialized values from PDC_scr_open() to initscr(). To Do: Some of these aren't really used. --- dos/pdcscrn.c | 20 +------------------- os2/pdcscrn.c | 20 +------------------- pdcurses/initscr.c | 21 ++++++++++++++++++++- win32/pdcscrn.c | 22 +--------------------- x11/pdcscrn.c | 20 +------------------- 5 files changed, 24 insertions(+), 79 deletions(-) diff --git a/dos/pdcscrn.c b/dos/pdcscrn.c index ede52c38..0cd2c751 100644 --- a/dos/pdcscrn.c +++ b/dos/pdcscrn.c @@ -24,7 +24,7 @@ # include #endif -RCSID("$Id: pdcscrn.c,v 1.31 2006/07/16 16:42:31 wmcbrine Exp $"); +RCSID("$Id: pdcscrn.c,v 1.32 2006/07/16 18:08:16 wmcbrine Exp $"); Regs regs; /* used in various other modules */ @@ -129,17 +129,9 @@ int PDC_scr_open(SCREEN *internal) PDC_get_cursor_pos(&internal->cursrow, &internal->curscol); internal->direct_video = TRUE; /* Assume that we can */ - internal->autocr = TRUE; /* cr -> lf by default */ - internal->raw_out = FALSE; /* tty I/O modes */ - internal->raw_inp = FALSE; /* tty I/O modes */ - internal->cbreak = TRUE; - internal->save_key_modifiers = FALSE; - internal->return_key_modifiers = FALSE; - internal->echo = FALSE; internal->video_seg = 0xb000; /* Base screen segment addr */ internal->video_ofs = 0x0; /* Base screen segment ofs */ internal->video_page = 0; /* Current Video Page */ - internal->visible_cursor= TRUE; /* Assume that it is visible */ internal->cursor = PDC_get_cursor_mode(); internal->adapter = PDC_query_adapter_type(); @@ -149,18 +141,8 @@ int PDC_scr_open(SCREEN *internal) internal->lines = PDC_get_rows(); internal->cols = PDC_get_columns(); - internal->audible = TRUE; - internal->visibility = 1; internal->orig_cursor = internal->cursor; internal->orgcbr = PDC_get_ctrl_break(); - internal->blank = ' '; - internal->resized = FALSE; - internal->shell = FALSE; - internal->_trap_mbe = 0L; - internal->_map_mbe_to_key = 0L; - internal->linesrippedoff = 0; - internal->linesrippedoffontop = 0; - internal->delaytenths = 0; /* If the environment variable PDCURSES_BIOS is set, the DOS int10() BIOS calls are used in place of direct video memory diff --git a/os2/pdcscrn.c b/os2/pdcscrn.c index e59eb31d..d930a5cf 100644 --- a/os2/pdcscrn.c +++ b/os2/pdcscrn.c @@ -20,7 +20,7 @@ #include #include -RCSID("$Id: pdcscrn.c,v 1.27 2006/07/16 16:42:31 wmcbrine Exp $"); +RCSID("$Id: pdcscrn.c,v 1.28 2006/07/16 18:08:16 wmcbrine Exp $"); #ifdef EMXVIDEO static unsigned char *saved_screen = NULL; @@ -153,14 +153,6 @@ int PDC_scr_open(SCREEN *internal) PDC_get_cursor_pos(&internal->cursrow, &internal->curscol); - internal->autocr = TRUE; /* cr -> lf by default */ - internal->raw_out = FALSE; /* tty I/O modes */ - internal->raw_inp = FALSE; /* tty I/O modes */ - internal->cbreak = TRUE; - internal->save_key_modifiers = FALSE; - internal->return_key_modifiers = FALSE; - internal->echo = FALSE; - internal->visible_cursor = TRUE; /* Assume that it is visible */ internal->cursor = PDC_get_cursor_mode(); #ifdef EMXVIDEO internal->tahead = -1; @@ -188,18 +180,8 @@ int PDC_scr_open(SCREEN *internal) internal->orig_font = internal->font = PDC_get_font(); internal->lines = PDC_get_rows(); internal->cols = PDC_get_columns(); - internal->audible = TRUE; - internal->visibility = 1; internal->orig_cursor = internal->cursor; internal->orgcbr = PDC_get_ctrl_break(); - internal->blank = ' '; - internal->resized = FALSE; - internal->shell = FALSE; - internal->_trap_mbe = 0L; - internal->_map_mbe_to_key = 0L; - internal->linesrippedoff = 0; - internal->linesrippedoffontop = 0; - internal->delaytenths = 0; internal->sizeable = TRUE; /* This code for preserving the current screen */ diff --git a/pdcurses/initscr.c b/pdcurses/initscr.c index 23f691e0..b1857770 100644 --- a/pdcurses/initscr.c +++ b/pdcurses/initscr.c @@ -38,7 +38,7 @@ # undef wnoutrefresh #endif -RCSID("$Id: initscr.c,v 1.53 2006/07/16 16:42:31 wmcbrine Exp $"); +RCSID("$Id: initscr.c,v 1.54 2006/07/16 18:08:16 wmcbrine Exp $"); const char *_curses_notice = "PDCurses 3.0 - Public Domain 2006"; @@ -189,6 +189,25 @@ WINDOW *Xinitscr(int argc, char *argv[]) PDC_scr_open(SP); + SP->autocr = TRUE; /* cr -> lf by default */ + SP->raw_out = FALSE; /* tty I/O modes */ + SP->raw_inp = FALSE; /* tty I/O modes */ + SP->cbreak = TRUE; + SP->save_key_modifiers = FALSE; + SP->return_key_modifiers = FALSE; + SP->echo = FALSE; + SP->visible_cursor = TRUE; /* Assume that it is visible */ + SP->visibility = 1; + SP->audible = TRUE; + SP->blank = ' '; + SP->resized = FALSE; + SP->shell = FALSE; + SP->_trap_mbe = 0L; + SP->_map_mbe_to_key = 0L; + SP->linesrippedoff = 0; + SP->linesrippedoffontop = 0; + SP->delaytenths = 0; + LINES = SP->lines; COLS = SP->cols; diff --git a/win32/pdcscrn.c b/win32/pdcscrn.c index fe77899e..72818695 100644 --- a/win32/pdcscrn.c +++ b/win32/pdcscrn.c @@ -19,7 +19,7 @@ #define INCLUDE_WINDOWS_H #include -RCSID("$Id: pdcscrn.c,v 1.37 2006/07/16 16:42:31 wmcbrine Exp $"); +RCSID("$Id: pdcscrn.c,v 1.38 2006/07/16 18:08:16 wmcbrine Exp $"); #define PDC_RESTORE_NONE 0 #define PDC_RESTORE_BUFFER 1 @@ -270,33 +270,13 @@ int PDC_scr_open(SCREEN *internal) PDC_get_cursor_pos(&internal->cursrow, &internal->curscol); - internal->autocr = TRUE; /* cr -> lf by default */ - internal->raw_out = FALSE; /* tty I/O modes */ - internal->raw_inp = FALSE; /* tty I/O modes */ - internal->cbreak = TRUE; - internal->save_key_modifiers = FALSE; - internal->return_key_modifiers = FALSE; - internal->echo = FALSE; - internal->visible_cursor= TRUE; /* Assume that it is visible */ - internal->cursor = PDC_get_cursor_mode(); internal->adapter = PDC_query_adapter_type(); - internal->audible = TRUE; - internal->visibility = 1; internal->orig_cursor = internal->cursor; internal->orgcbr = PDC_get_ctrl_break(); - internal->blank = ' '; - internal->resized = FALSE; - internal->shell = FALSE; - internal->_trap_mbe = 0L; - internal->_map_mbe_to_key = 0L; - internal->linesrippedoff = 0; - internal->linesrippedoffontop = 0; - internal->delaytenths = 0; - #ifdef PDC_THREAD_BUILD /* Create the anonymous pipe and thread for handling input */ diff --git a/x11/pdcscrn.c b/x11/pdcscrn.c index 185521b0..29868162 100644 --- a/x11/pdcscrn.c +++ b/x11/pdcscrn.c @@ -17,7 +17,7 @@ #include "pdcx11.h" -RCSID("$Id: pdcscrn.c,v 1.25 2006/07/16 16:42:31 wmcbrine Exp $"); +RCSID("$Id: pdcscrn.c,v 1.26 2006/07/16 18:08:16 wmcbrine Exp $"); bool GLOBAL_sb_on = FALSE; bool GLOBAL_slk_on = FALSE; @@ -74,29 +74,11 @@ int PDC_scr_open(SCREEN *internal) PDC_LOG(("PDC_scr_open() - called\n")); internal->cursrow = internal->curscol = 0; - internal->autocr = TRUE; /* cr -> lf by default */ - internal->raw_out = FALSE; /* tty I/O modes */ - internal->raw_inp = FALSE; /* tty I/O modes */ - internal->cbreak = TRUE; - internal->save_key_modifiers = FALSE; - internal->return_key_modifiers = FALSE; - internal->echo = FALSE; - internal->visible_cursor= TRUE; /* Assume that it is visible */ internal->cursor = 0; internal->adapter = 0; - internal->audible = TRUE; - internal->visibility = 1; internal->orig_cursor = internal->cursor; internal->orig_attr = FALSE; internal->orgcbr = 0; - internal->blank = ' '; - internal->resized = FALSE; - internal->shell = FALSE; - internal->_trap_mbe = 0L; - internal->_map_mbe_to_key = 0L; - internal->linesrippedoff = 0; - internal->linesrippedoffontop = 0; - internal->delaytenths = 0; internal->sb_on = sb_started; internal->sb_total_y = 0; internal->sb_viewport_y = 0;