More common code now.

This commit is contained in:
William McBrine
2019-09-10 19:14:58 -04:00
parent e7b15a9f5e
commit 492b402134
8 changed files with 13 additions and 37 deletions

View File

@@ -1,7 +1,8 @@
PDCurses Implementor's Guide
============================
- Version 1.6 - 2019/09/?? - added PDC_doupdate(); removed
- Version 1.6 - 2019/09/?? - added PDC_doupdate(); removed SP allocation
from PDC_scr_open(); removed
PDC_init_pair(), PDC_pair_content()
- Version 1.5 - 2019/09/06 - PDC_has_mouse(), removed PDC_get_input_fd()
- Version 1.4 - 2018/12/31 - PDCurses.md -> USERS.md, MANUAL.md; new dir
@@ -254,15 +255,13 @@ The platform-specific part of initscr(). It's actually called from
Xinitscr(); the arguments, if present, correspond to those used with
main(), and may be used to set the title of the terminal window, or for
other, platform-specific purposes. (The arguments are currently used
only in X11.) PDC_scr_open() must allocate memory for SP, and must
initialize acs_map[] (unless it's preset) and several members of SP,
including lines, cols, mouse_wait, orig_attr (and if orig_attr is TRUE,
orig_fore and orig_back), mono, _restore and _preserve. (Although SP is
used the same way in all ports, it's allocated here in order to allow
the X11 port to map it to a block of shared memory.) If using an
existing terminal, and the environment variable PDC_RESTORE_SCREEN is
set, this function may also store the existing screen image for later
restoration by PDC_scr_close().
only in X11.) PDC_scr_open() must initialize acs_map[] (unless it's
preset) and several members of SP, including lines, cols, mouse_wait,
orig_attr (and if orig_attr is TRUE, orig_fore and orig_back), mono,
_restore and _preserve. If using an existing terminal, and the
environment variable PDC_RESTORE_SCREEN is set, this function may also
store the existing screen image for later restoration by
PDC_scr_close().
pdcsetsc.c:

View File

@@ -496,11 +496,6 @@ int PDC_scr_open(int argc, char **argv)
PDC_LOG(("PDC_scr_open() - called\n"));
SP = calloc(1, sizeof(SCREEN));
if (!SP)
return ERR;
for (i = 0; i < 16; i++)
pdc_curstoreal[realtocurs[i]] = i;

View File

@@ -93,11 +93,6 @@ int PDC_scr_open(int argc, char **argv)
PDC_LOG(("PDC_scr_open() - called\n"));
SP = calloc(1, sizeof(SCREEN));
if (!SP)
return ERR;
for (i = 0; i < 16; i++)
pdc_curstoreal[realtocurs[i]] = i;

View File

@@ -128,6 +128,10 @@ WINDOW *Xinitscr(int argc, char *argv[])
if (SP && SP->alive)
return NULL;
SP = calloc(1, sizeof(SCREEN));
if (!SP)
return NULL;
if (PDC_scr_open(argc, argv) == ERR)
{
fprintf(stderr, "initscr(): Unable to create SP\n");

View File

@@ -128,11 +128,6 @@ int PDC_scr_open(int argc, char **argv)
{
PDC_LOG(("PDC_scr_open() - called\n"));
SP = calloc(1, sizeof(SCREEN));
if (!SP)
return ERR;
pdc_own_screen = !pdc_screen;
if (pdc_own_screen)

View File

@@ -138,11 +138,6 @@ int PDC_scr_open(int argc, char **argv)
{
PDC_LOG(("PDC_scr_open() - called\n"));
SP = calloc(1, sizeof(SCREEN));
if (!SP)
return ERR;
pdc_own_window = !pdc_window;
if (pdc_own_window)

View File

@@ -385,11 +385,6 @@ int PDC_scr_open(int argc, char **argv)
PDC_LOG(("PDC_scr_open() - called\n"));
SP = calloc(1, sizeof(SCREEN));
if (!SP)
return ERR;
for (i = 0; i < 16; i++)
{
pdc_curstoreal[realtocurs[i]] = i;

View File

@@ -561,8 +561,6 @@ int PDC_scr_open(int argc, char **argv)
if (!strcmp(pdc_app_data.textCursor, "vertical"))
pdc_vertical_cursor = TRUE;
SP = calloc(1, sizeof(SCREEN));
SP->lines = LINES;
SP->cols = COLS;