mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-25 08:15:27 +00:00
Last of the platform ifdefs in the pdcurses directory. To Do: The win32
PDC_scr_close() needs work.
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
* See the file maintain.er for details of the current maintainer. *
|
||||
************************************************************************/
|
||||
|
||||
/* $Id: curspriv.h,v 1.112 2006/08/11 19:50:51 wmcbrine Exp $ */
|
||||
/* $Id: curspriv.h,v 1.113 2006/08/11 20:59:44 wmcbrine Exp $ */
|
||||
|
||||
/* CURSPRIV.H
|
||||
|
||||
@@ -105,7 +105,7 @@ void PDC_reset_prog_mode(void);
|
||||
void PDC_reset_shell_mode(void);
|
||||
int PDC_resize_screen(int, int);
|
||||
void PDC_restore_screen_mode(int);
|
||||
int PDC_scr_close(void);
|
||||
void PDC_scr_close(void);
|
||||
void PDC_scr_exit(void);
|
||||
int PDC_scr_open(int, char **);
|
||||
int PDC_set_ctrl_break(bool);
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
# include <sys/movedata.h>
|
||||
#endif
|
||||
|
||||
RCSID("$Id: pdcscrn.c,v 1.41 2006/08/11 19:50:51 wmcbrine Exp $");
|
||||
RCSID("$Id: pdcscrn.c,v 1.42 2006/08/11 20:59:44 wmcbrine Exp $");
|
||||
|
||||
Regs regs; /* used in various other modules */
|
||||
|
||||
@@ -45,11 +45,11 @@ static int saved_cols = 0;
|
||||
This function returns OK on success, otherwise an ERR is returned.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_scr_close(void);
|
||||
PDCurses void PDC_scr_close(void);
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
int PDC_scr_close(void)
|
||||
void PDC_scr_close(void)
|
||||
{
|
||||
#if SMALL || MEDIUM
|
||||
# ifndef __PACIFIC__
|
||||
@@ -59,10 +59,8 @@ int PDC_scr_close(void)
|
||||
#endif
|
||||
PDC_LOG(("PDC_scr_close() - called\n"));
|
||||
|
||||
if (getenv("PDC_RESTORE_SCREEN") != NULL)
|
||||
if ((getenv("PDC_RESTORE_SCREEN") != NULL) && (saved_screen != NULL))
|
||||
{
|
||||
if (saved_screen == NULL)
|
||||
return OK;
|
||||
#ifdef __DJGPP__
|
||||
dosmemput(saved_screen, saved_lines * saved_cols * 2,
|
||||
(unsigned long)_FAR_POINTER(SP->video_seg,
|
||||
@@ -86,7 +84,14 @@ int PDC_scr_close(void)
|
||||
saved_screen = NULL;
|
||||
}
|
||||
|
||||
return OK;
|
||||
reset_shell_mode();
|
||||
|
||||
if (SP->visibility != 1)
|
||||
curs_set(1);
|
||||
|
||||
/* Position cursor to the bottom left of the screen. */
|
||||
|
||||
PDC_gotoyx(PDC_get_rows() - 2, 0);
|
||||
}
|
||||
|
||||
void PDC_scr_exit(void)
|
||||
|
||||
@@ -20,7 +20,7 @@
|
||||
#include <curses.h>
|
||||
#include <stdlib.h>
|
||||
|
||||
RCSID("$Id: pdcscrn.c,v 1.38 2006/08/11 19:50:51 wmcbrine Exp $");
|
||||
RCSID("$Id: pdcscrn.c,v 1.39 2006/08/11 20:59:44 wmcbrine Exp $");
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
static unsigned char *saved_screen = NULL;
|
||||
@@ -53,11 +53,11 @@ extern int PDC_set_font(int);
|
||||
This function returns OK on success, otherwise an ERR is returned.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_scr_close(void);
|
||||
PDCurses void PDC_scr_close(void);
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
int PDC_scr_close(void)
|
||||
void PDC_scr_close(void)
|
||||
{
|
||||
char *ptr;
|
||||
|
||||
@@ -69,10 +69,8 @@ int PDC_scr_close(void)
|
||||
if (DosScanEnv("PDC_RESTORE_SCREEN", (PSZ *)&ptr))
|
||||
ptr = NULL;
|
||||
#endif
|
||||
if (ptr != NULL)
|
||||
if ((ptr != NULL) && (saved_screen != NULL))
|
||||
{
|
||||
if (saved_screen == NULL)
|
||||
return OK;
|
||||
#ifdef EMXVIDEO
|
||||
v_putline(saved_screen, 0, 0, saved_lines * saved_cols);
|
||||
#else
|
||||
@@ -83,7 +81,14 @@ int PDC_scr_close(void)
|
||||
saved_screen = NULL;
|
||||
}
|
||||
|
||||
return OK;
|
||||
reset_shell_mode();
|
||||
|
||||
if (SP->visibility != 1)
|
||||
curs_set(1);
|
||||
|
||||
/* Position cursor to the bottom left of the screen. */
|
||||
|
||||
PDC_gotoyx(PDC_get_rows() - 2, 0);
|
||||
}
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
# undef wnoutrefresh
|
||||
#endif
|
||||
|
||||
RCSID("$Id: initscr.c,v 1.68 2006/08/11 19:50:51 wmcbrine Exp $");
|
||||
RCSID("$Id: initscr.c,v 1.69 2006/08/11 20:59:44 wmcbrine Exp $");
|
||||
|
||||
const char *_curses_notice = "PDCurses 3.0 - Public Domain 2006";
|
||||
|
||||
@@ -286,21 +286,6 @@ int endwin(void)
|
||||
|
||||
PDC_scr_close();
|
||||
|
||||
#if defined(DOS) || defined(OS2)
|
||||
reset_shell_mode();
|
||||
#endif
|
||||
|
||||
if (SP->visibility != 1)
|
||||
curs_set(1);
|
||||
|
||||
/* Position cursor to the bottom left of the screen. */
|
||||
|
||||
#ifdef WIN32
|
||||
PDC_gotoyx(PDC_get_buffer_rows() - 2, 0);
|
||||
#else
|
||||
PDC_gotoyx(PDC_get_rows() - 2, 0);
|
||||
#endif
|
||||
|
||||
SP->alive = FALSE;
|
||||
|
||||
return OK;
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
#define CURSES_LIBRARY 1
|
||||
#include <curses.h>
|
||||
|
||||
RCSID("$Id: pdcscrn.c,v 1.51 2006/08/11 19:50:51 wmcbrine Exp $");
|
||||
RCSID("$Id: pdcscrn.c,v 1.52 2006/08/11 20:59:44 wmcbrine Exp $");
|
||||
|
||||
#define PDC_RESTORE_NONE 0
|
||||
#define PDC_RESTORE_BUFFER 1
|
||||
@@ -50,11 +50,11 @@ static DWORD dwConsoleMode = 0;
|
||||
This function returns OK on success, otherwise an ERR is returned.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_scr_close(void);
|
||||
PDCurses void PDC_scr_close(void);
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
int PDC_scr_close(void)
|
||||
void PDC_scr_close(void)
|
||||
{
|
||||
COORD origin;
|
||||
SMALL_RECT rect;
|
||||
@@ -89,13 +89,18 @@ int PDC_scr_close(void)
|
||||
|
||||
if (!WriteConsoleOutput(hConOut, ciSaveBuffer,
|
||||
orig_scr.dwSize, origin, &rect))
|
||||
return ERR;
|
||||
return;
|
||||
}
|
||||
|
||||
SetConsoleActiveScreenBuffer(hConOut);
|
||||
SetConsoleMode(hConIn, dwConsoleMode);
|
||||
|
||||
return OK;
|
||||
if (SP->visibility != 1)
|
||||
curs_set(1);
|
||||
|
||||
/* Position cursor to the bottom left of the screen. */
|
||||
|
||||
PDC_gotoyx(PDC_get_buffer_rows() - 2, 0);
|
||||
}
|
||||
|
||||
void PDC_scr_exit(void)
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include "pdcx11.h"
|
||||
|
||||
RCSID("$Id: pdcscrn.c,v 1.35 2006/08/11 19:50:51 wmcbrine Exp $");
|
||||
RCSID("$Id: pdcscrn.c,v 1.36 2006/08/11 20:59:44 wmcbrine Exp $");
|
||||
|
||||
/*man-start**************************************************************
|
||||
|
||||
@@ -32,15 +32,13 @@ RCSID("$Id: pdcscrn.c,v 1.35 2006/08/11 19:50:51 wmcbrine Exp $");
|
||||
This function returns OK on success, otherwise an ERR is returned.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_scr_close(void);
|
||||
PDCurses void PDC_scr_close(void);
|
||||
|
||||
**man-end****************************************************************/
|
||||
|
||||
int PDC_scr_close(void)
|
||||
void PDC_scr_close(void)
|
||||
{
|
||||
PDC_LOG(("PDC_scr_close() - called\n"));
|
||||
|
||||
return OK;
|
||||
}
|
||||
|
||||
void PDC_scr_exit(void)
|
||||
|
||||
Reference in New Issue
Block a user