mirror of
https://github.com/VARCem/PDCurses.git
synced 2026-09-24 07:45:21 +00:00
Allow "special" characters like Ctrl-S to be returned by OS/2 keyboard handler.
This commit is contained in:
3
curses.h
3
curses.h
@@ -18,7 +18,7 @@
|
||||
***************************************************************************
|
||||
*/
|
||||
/*
|
||||
$Id: curses.h,v 1.8 2002/01/12 03:37:57 mark Exp $
|
||||
$Id: curses.h,v 1.9 2002/01/12 04:04:18 mark Exp $
|
||||
*/
|
||||
/*
|
||||
*----------------------------------------------------------------------
|
||||
@@ -937,6 +937,7 @@ typedef struct
|
||||
# else
|
||||
VIOMODEINFO scrnmode; /* default screen mode */
|
||||
VIOCONFIGINFO adapter; /* Screen type */
|
||||
KBDINFO kbdinfo; /* keyboard info */
|
||||
# endif
|
||||
#else
|
||||
int adapter; /* Screen type */
|
||||
|
||||
19
curspriv.h
19
curspriv.h
@@ -18,7 +18,7 @@
|
||||
***************************************************************************
|
||||
*/
|
||||
/*
|
||||
$Id: curspriv.h,v 1.3 2001/01/10 08:31:37 mark Exp $
|
||||
$Id: curspriv.h,v 1.4 2002/01/12 04:04:18 mark Exp $
|
||||
*/
|
||||
/*
|
||||
*
|
||||
@@ -337,17 +337,24 @@ void PDC_usleep( long );
|
||||
int PDC_validchar( int );
|
||||
int PDC_vsscanf( char *, const char *, va_list);
|
||||
|
||||
int PDC_query_adapter_type( void );
|
||||
int PDC_get_scrn_mode( void );
|
||||
void PDC_slk_calc( void );
|
||||
|
||||
|
||||
# if defined( OS2 ) && !defined( EMXVIDEO )
|
||||
int PDC_set_scrn_mode( VIOMODEINFO);
|
||||
bool PDC_scrn_modes_equal (VIOMODEINFO, VIOMODEINFO);
|
||||
int PDC_get_scrn_mode( VIOMODEINFO *);
|
||||
int PDC_query_adapter_type( VIOCONFIGINFO * );
|
||||
int PDC_get_keyboard_info( KBDINFO * );
|
||||
int PDC_set_keyboard_binary( void );
|
||||
int PDC_set_keyboard_default( void );
|
||||
int PDC_reset_shell_mode( void );
|
||||
int PDC_reset_prog_mode( void );
|
||||
# else
|
||||
int PDC_set_scrn_mode( int );
|
||||
bool PDC_scrn_modes_equal (int, int);
|
||||
int PDC_get_scrn_mode( void );
|
||||
int PDC_query_adapter_type( void );
|
||||
# endif
|
||||
|
||||
# ifdef FLEXOS
|
||||
@@ -456,17 +463,19 @@ void PDC_usleep( /* long */ );
|
||||
int PDC_validchar( /* int */ );
|
||||
int PDC_vsscanf( /* char *, const char *, ... */);
|
||||
|
||||
int PDC_query_adapter_type( /* void */ );
|
||||
int PDC_get_scrn_mode( /* void */ );
|
||||
void PDC_slk_calc( /* void */ );
|
||||
|
||||
|
||||
# if defined( OS2 ) && !defined( EMXVIDEO )
|
||||
int PDC_set_scrn_mode( /* VIOMODEINFO*/ );
|
||||
bool PDC_scrn_modes_equal ( /*VIOMODEINFO, VIOMODEINFO*/ );
|
||||
int PDC_get_scrn_mode( /* VIOMODEINFO * */ );
|
||||
int PDC_query_adapter_type( /* VIOCONFIGINFO * */ );
|
||||
# else
|
||||
int PDC_set_scrn_mode( /* int */ );
|
||||
bool PDC_scrn_modes_equal ( /*int, int*/ );
|
||||
int PDC_get_scrn_mode( /* void */ );
|
||||
int PDC_query_adapter_type( /* void */ );
|
||||
# endif
|
||||
|
||||
# ifdef FLEXOS
|
||||
|
||||
@@ -12,8 +12,7 @@
|
||||
#
|
||||
################################################################################
|
||||
#
|
||||
# This makefile requires the following environment variables with values like:
|
||||
# PDCURSES_SRCDIR=c:\pdcurses
|
||||
# Change these for your environment...
|
||||
#
|
||||
################################################################################
|
||||
PDCURSES_HOME =$(PDCURSES_SRCDIR)
|
||||
@@ -44,11 +43,13 @@ ifeq ($(EMXVIDEO),Y)
|
||||
VIDLIB = -lvideo
|
||||
BINDFLAGS = -acm
|
||||
DLLTARGET =
|
||||
DISTTARGETS = pdcurses.a pdcurses.lib panel.a panel.lib
|
||||
else
|
||||
EMXVID =
|
||||
VIDLIB =
|
||||
BINDFLAGS =
|
||||
DLLTARGET = curses.dll
|
||||
DISTTARGETS = curses.a curses.dll curses.lib pdcurses.a pdcurses.lib panel.a panel.lib
|
||||
endif
|
||||
|
||||
ifeq ($(DEBUG),Y)
|
||||
@@ -206,6 +207,7 @@ pdcurses.a : $(LIBOBJS) $(PDCOBJS)
|
||||
|
||||
curses.dll : $(DLLOBJS) $(PDCDLOS)
|
||||
$(LINK) $(DLLFLAGS) -o curses.dll $(DLLOBJS) $(PDCDLOS) $(osdir)\pdcurses.def
|
||||
lxlite curses.dll
|
||||
emximp -o curses.lib $(osdir)\pdcurses.def
|
||||
emximp -o curses.a curses.lib
|
||||
|
||||
@@ -529,7 +531,7 @@ xmas.exe: xmas.o $(LIBCURSES)
|
||||
$(EMXBIND) xmas $(BINDFLAGS)
|
||||
|
||||
|
||||
testcurs_dyn.exe: testcurs.obj pdcurses.dll
|
||||
testcurs_dyn.exe: testcurs.obj curses.dll
|
||||
$(LINK) $(LDFLAGS) $(DLLFLAGS) -o testcurs_dyn testcurs.obj $(DLLCURSES) -L$(CCLIBDIR) $(CCLIBS)
|
||||
$(EMXBIND) testcurs_dyn $(BINDFLAGS)
|
||||
|
||||
@@ -550,23 +552,23 @@ testcurs.obj: $(demodir)\testcurs.c $(PDCURSES_CURSES_H)
|
||||
|
||||
tui.o: $(demodir)\tui.c $(demodir)\tui.h $(PDCURSES_CURSES_H)
|
||||
$(CC) $(CCFLAGS) -I$(demodir) -o $@ $(demodir)\tui.c
|
||||
|
||||
|
||||
tuidemo.o: $(demodir)\tuidemo.c $(PDCURSES_CURSES_H)
|
||||
$(CC) $(CCFLAGS) -I$(demodir) -o $@ $(demodir)\tuidemo.c
|
||||
|
||||
xmas.o: $(demodir)\xmas.c $(PDCURSES_CURSES_H)
|
||||
$(CC) $(CCFLAGS) -o$@ $(demodir)\xmas.c
|
||||
|
||||
dist: curses.a curses.dll curses.lib pdcurses.a pdcurses.lib panel.a panel.lib
|
||||
dist: $(DISTTARGETS)
|
||||
-mkdir tmp
|
||||
copy $(PDCURSES_HOME)\README tmp\README
|
||||
copy $(PDCURSES_HOME)\readme.?? tmp
|
||||
copy $(PDCURSES_HOME)\curses.h tmp
|
||||
copy $(PDCURSES_HOME)\curspriv.h tmp
|
||||
copy $(PDCURSES_HOME)\maintain.er tmp
|
||||
copy curses.dll tmp
|
||||
copy curses.lib tmp
|
||||
copy curses.a tmp
|
||||
-copy curses.dll tmp
|
||||
-copy curses.lib tmp
|
||||
-copy curses.a tmp
|
||||
copy pdcurses.a tmp
|
||||
copy pdcurses.lib tmp
|
||||
copy panel.a tmp
|
||||
|
||||
440
os2/pdcgetsc.c
440
os2/pdcgetsc.c
@@ -17,538 +17,480 @@
|
||||
* See the file maintain.er for details of the current maintainer.
|
||||
***************************************************************************
|
||||
*/
|
||||
#define CURSES_LIBRARY 1
|
||||
#define CURSES_LIBRARY 1
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <curses.h>
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.2 2001/01/10 08:29:33 mark Exp $";
|
||||
#endif
|
||||
|
||||
#if !defined( EMXVIDEO )
|
||||
VIOCONFIGINFO configInfo={0};
|
||||
VIOMODEINFO modeInfo={0};
|
||||
char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.3 2002/01/12 04:04:18 mark Exp $";
|
||||
#endif
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_get_cursor_pos() - return current cursor position
|
||||
PDC_get_cursor_pos() - return current cursor position
|
||||
|
||||
PDCurses Description:
|
||||
This is a private PDCurses function
|
||||
This is a private PDCurses function
|
||||
|
||||
Gets the cursor position in video page 0. 'row' and 'column'
|
||||
are the cursor address. At this time, there is no support for
|
||||
use of multiple screen pages.
|
||||
Gets the cursor position in video page 0. 'row' and 'column'
|
||||
are the cursor address. At this time, there is no support for
|
||||
use of multiple screen pages.
|
||||
|
||||
PDCurses Return Value:
|
||||
This routine will return OK upon success and otherwise ERR will be
|
||||
returned.
|
||||
This routine will return OK upon success and otherwise ERR will be
|
||||
returned.
|
||||
|
||||
PDCurses Errors:
|
||||
There are no defined errors for this routine.
|
||||
There are no defined errors for this routine.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_get_cursor_pos( int* row, int* col );
|
||||
PDCurses int PDC_get_cursor_pos( int* row, int* col );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_get_cursor_pos(int *row, int *col)
|
||||
#else
|
||||
int PDC_get_cursor_pos(row,col)
|
||||
int *row;
|
||||
int *col;
|
||||
#endif
|
||||
int PDC_get_cursor_pos(int *row, int *col)
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_get_cursor_pos() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_get_cursor_pos() - called\n");
|
||||
#endif
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
v_getxy (col, row);
|
||||
v_getxy (col, row);
|
||||
#else
|
||||
VioGetCurPos((PUSHORT)row,(PUSHORT)col,0);
|
||||
VioGetCurPos((PUSHORT)row,(PUSHORT)col,0);
|
||||
#endif
|
||||
return( OK );
|
||||
return( OK );
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_get_cur_col() - get current column position of cursor
|
||||
PDC_get_cur_col() - get current column position of cursor
|
||||
|
||||
PDCurses Description:
|
||||
This is a private PDCurses function
|
||||
This is a private PDCurses function
|
||||
|
||||
This routine returns the current column position of the cursor on
|
||||
screen.
|
||||
This routine returns the current column position of the cursor on
|
||||
screen.
|
||||
|
||||
PDCurses Return Value:
|
||||
This routine returns the current column position of the cursor. No
|
||||
error is returned.
|
||||
This routine returns the current column position of the cursor. No
|
||||
error is returned.
|
||||
|
||||
PDCurses Errors:
|
||||
There are no defined errors for this routine.
|
||||
There are no defined errors for this routine.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_get_cur_col( void );
|
||||
PDCurses int PDC_get_cur_col( void );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_get_cur_col(void)
|
||||
#else
|
||||
int PDC_get_cur_col()
|
||||
#endif
|
||||
int PDC_get_cur_col(void)
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef EMXVIDEO
|
||||
int curCol=0, curRow=0;
|
||||
int curCol=0, curRow=0;
|
||||
#else
|
||||
USHORT curCol=0, curRow=0;
|
||||
USHORT curCol=0, curRow=0;
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_get_cur_col() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_get_cur_col() - called\n");
|
||||
#endif
|
||||
|
||||
/* find the current cursor position */
|
||||
/* find the current cursor position */
|
||||
#ifdef EMXVIDEO
|
||||
v_getxy (&curCol, &curRow);
|
||||
v_getxy (&curCol, &curRow);
|
||||
#else
|
||||
VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0);
|
||||
VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0);
|
||||
#endif
|
||||
return (curCol);
|
||||
|
||||
return (curCol);
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_get_cur_row() - get current row position of cursor
|
||||
PDC_get_cur_row() - get current row position of cursor
|
||||
|
||||
PDCurses Description:
|
||||
This is a private PDCurses function
|
||||
This is a private PDCurses function
|
||||
|
||||
This routine returns the current row position of the cursor on
|
||||
screen.
|
||||
This routine returns the current row position of the cursor on
|
||||
screen.
|
||||
|
||||
PDCurses Return Value:
|
||||
This routine returns the current row position of the cursor. No
|
||||
error is returned.
|
||||
This routine returns the current row position of the cursor. No
|
||||
error is returned.
|
||||
|
||||
PDCurses Errors:
|
||||
There are no defined errors for this routine.
|
||||
There are no defined errors for this routine.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_get_cur_row( void );
|
||||
PDCurses int PDC_get_cur_row( void );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_get_cur_row(void)
|
||||
#else
|
||||
int PDC_get_cur_row()
|
||||
#endif
|
||||
int PDC_get_cur_row(void)
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef EMXVIDEO
|
||||
int curCol=0, curRow=0;
|
||||
int curCol=0, curRow=0;
|
||||
#else
|
||||
USHORT curCol=0, curRow=0;
|
||||
USHORT curCol=0, curRow=0;
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_get_cur_row() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_get_cur_row() - called\n");
|
||||
#endif
|
||||
|
||||
/* find the current cursor position */
|
||||
/* find the current cursor position */
|
||||
#ifdef EMXVIDEO
|
||||
v_getxy (&curCol, &curRow);
|
||||
v_getxy (&curCol, &curRow);
|
||||
#else
|
||||
VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0);
|
||||
VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0);
|
||||
#endif
|
||||
return (curRow);
|
||||
|
||||
return (curRow);
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_get_attribute() - Get attribute at current cursor
|
||||
PDC_get_attribute() - Get attribute at current cursor
|
||||
|
||||
PDCurses Description:
|
||||
This is a private PDCurses function
|
||||
This is a private PDCurses function
|
||||
|
||||
Return the current attr at current cursor position on the screen.
|
||||
Return the current attr at current cursor position on the screen.
|
||||
|
||||
PDCurses Return Value:
|
||||
This routine will return OK upon success and otherwise ERR will be
|
||||
returned.
|
||||
This routine will return OK upon success and otherwise ERR will be
|
||||
returned.
|
||||
|
||||
PDCurses Errors:
|
||||
There are no defined errors for this routine.
|
||||
There are no defined errors for this routine.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_get_attribute( void );
|
||||
PDCurses int PDC_get_attribute( void );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_get_attribute(void)
|
||||
#else
|
||||
int PDC_get_attribute()
|
||||
#endif
|
||||
int PDC_get_attribute(void)
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifndef EMXVIDEO
|
||||
USHORT cellLen = 2;
|
||||
USHORT cellLen = 2;
|
||||
#endif
|
||||
int curRow=0, curCol=0;
|
||||
char Cell[4];
|
||||
|
||||
int curRow=0, curCol=0;
|
||||
char Cell[4];
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_get_attribute() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_get_attribute() - called\n");
|
||||
#endif
|
||||
|
||||
PDC_get_cursor_pos(&curRow, &curCol);
|
||||
PDC_get_cursor_pos(&curRow, &curCol);
|
||||
#ifdef EMXVIDEO
|
||||
v_getline (Cell, curCol, curRow, 1);
|
||||
v_getline (Cell, curCol, curRow, 1);
|
||||
#else
|
||||
VioReadCellStr((PCH)&Cell, (PUSHORT)&cellLen, (USHORT)curRow, (USHORT)curCol, 0);
|
||||
VioReadCellStr((PCH)&Cell, (PUSHORT)&cellLen, (USHORT)curRow, (USHORT)curCol, 0);
|
||||
#endif
|
||||
return ((int) Cell[1]);
|
||||
|
||||
return ((int) Cell[1]);
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_get_columns() - return width of screen/viewport.
|
||||
PDC_get_columns() - return width of screen/viewport.
|
||||
|
||||
PDCurses Description:
|
||||
This is a private PDCurses function
|
||||
This is a private PDCurses function
|
||||
|
||||
This function will return the width of the current screen.
|
||||
This function will return the width of the current screen.
|
||||
|
||||
PDCurses Return Value:
|
||||
This routine will return OK upon success and otherwise ERR will be
|
||||
returned.
|
||||
This routine will return OK upon success and otherwise ERR will be
|
||||
returned.
|
||||
|
||||
PDCurses Errors:
|
||||
There are no defined errors for this routine.
|
||||
There are no defined errors for this routine.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_get_columns( void );
|
||||
PDCurses int PDC_get_columns( void );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_get_columns(void)
|
||||
#else
|
||||
int PDC_get_columns()
|
||||
#endif
|
||||
int PDC_get_columns(void)
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef EMXVIDEO
|
||||
int rows=0;
|
||||
int rows=0;
|
||||
#else
|
||||
VIOMODEINFO modeInfo={0};
|
||||
VIOMODEINFO modeInfo={0};
|
||||
#endif
|
||||
int cols=0;
|
||||
char *env_cols=NULL;
|
||||
|
||||
|
||||
int cols=0;
|
||||
char *env_cols=NULL;
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_get_columns() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_get_columns() - called\n");
|
||||
#endif
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
v_dimen (&cols, &rows);
|
||||
v_dimen (&cols, &rows);
|
||||
#else
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
VioGetMode(&modeInfo, 0);
|
||||
cols = modeInfo.col;
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
VioGetMode(&modeInfo, 0);
|
||||
cols = modeInfo.col;
|
||||
#endif
|
||||
|
||||
env_cols = (char *)getenv("COLS");
|
||||
if (env_cols != (char *)NULL)
|
||||
{
|
||||
cols = min(atoi(env_cols),cols);
|
||||
}
|
||||
env_cols = (char *)getenv("COLS");
|
||||
if (env_cols != (char *)NULL)
|
||||
{
|
||||
cols = min(atoi(env_cols),cols);
|
||||
}
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_get_columns() - returned: cols %d\n",cols);
|
||||
if (trace_on) PDC_debug("PDC_get_columns() - returned: cols %d\n",cols);
|
||||
#endif
|
||||
return(cols);
|
||||
|
||||
return(cols);
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_get_cursor_mode() - Get the cursor start and stop scan lines.
|
||||
PDC_get_cursor_mode() - Get the cursor start and stop scan lines.
|
||||
|
||||
PDCurses Description:
|
||||
Gets the cursor type to begin in scan line startrow and end in
|
||||
scan line endrow. Both values should be 0-31.
|
||||
Gets the cursor type to begin in scan line startrow and end in
|
||||
scan line endrow. Both values should be 0-31.
|
||||
|
||||
PDCurses Return Value:
|
||||
This function returns OK on success and ERR on error.
|
||||
This function returns OK on success and ERR on error.
|
||||
|
||||
PDCurses Errors:
|
||||
No errors are defined for this function.
|
||||
No errors are defined for this function.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_get_cursor_mode( void );
|
||||
PDCurses int PDC_get_cursor_mode( void );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_get_cursor_mode(void)
|
||||
#else
|
||||
int PDC_get_cursor_mode()
|
||||
#endif
|
||||
int PDC_get_cursor_mode(void)
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef EMXVIDEO
|
||||
int curstart=0, curend=0;
|
||||
int curstart=0, curend=0;
|
||||
#else
|
||||
VIOCURSORINFO cursorInfo;
|
||||
VIOCURSORINFO cursorInfo;
|
||||
#endif
|
||||
short cmode=0;
|
||||
short cmode=0;
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_get_cursor_mode() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_get_cursor_mode() - called\n");
|
||||
#endif
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
v_getctype (&curstart, &curend);
|
||||
cmode = ((curstart << 8) | (curend));
|
||||
v_getctype (&curstart, &curend);
|
||||
cmode = ((curstart << 8) | (curend));
|
||||
#else
|
||||
VioGetCurType (&cursorInfo, 0);
|
||||
VioGetCurType (&cursorInfo, 0);
|
||||
/* I am not sure about this JGB */
|
||||
cmode = ((cursorInfo.yStart << 8) | (cursorInfo.cEnd));
|
||||
cmode = ((cursorInfo.yStart << 8) | (cursorInfo.cEnd));
|
||||
#endif
|
||||
return(cmode);
|
||||
|
||||
return(cmode);
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_get_font() - Get the current font size
|
||||
PDC_get_font() - Get the current font size
|
||||
|
||||
PDCurses Description:
|
||||
This is a private PDCurses routine.
|
||||
This is a private PDCurses routine.
|
||||
|
||||
This function returns the current font size. This function only
|
||||
works if the #define FAST_VIDEO is true.
|
||||
This function returns the current font size. This function only
|
||||
works if the #define FAST_VIDEO is true.
|
||||
|
||||
PDCurses Return Value:
|
||||
This function returns OK on success and ERR on error.
|
||||
This function returns OK on success and ERR on error.
|
||||
|
||||
PDCurses Errors:
|
||||
An ERR will be returned if FAST_VIDEO is not true.
|
||||
An ERR will be returned if FAST_VIDEO is not true.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_get_font( void );
|
||||
PDCurses int PDC_get_font( void );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_get_font(void)
|
||||
#else
|
||||
int PDC_get_font()
|
||||
#endif
|
||||
int PDC_get_font(void)
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef EMXVIDEO
|
||||
int retval=0;
|
||||
int retval=0;
|
||||
#else
|
||||
VIOMODEINFO modeInfo={0};
|
||||
VIOMODEINFO modeInfo={0};
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_get_font() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_get_font() - called\n");
|
||||
#endif
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
retval = v_hardware();
|
||||
return (retval == V_MONOCHROME) ? 14 : (retval == V_COLOR_8) ? 8 : 12;
|
||||
retval = v_hardware();
|
||||
return (retval == V_MONOCHROME) ? 14 : (retval == V_COLOR_8) ? 8 : 12;
|
||||
#else
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
/* set most parameters of modeInfo */
|
||||
VioGetMode(&modeInfo, 0);
|
||||
return ( modeInfo.vres / modeInfo.row);
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
/* set most parameters of modeInfo */
|
||||
VioGetMode(&modeInfo, 0);
|
||||
return ( modeInfo.vres / modeInfo.row);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_get_rows() - Return number of screen rows.
|
||||
PDC_get_rows() - Return number of screen rows.
|
||||
|
||||
PDCurses Description:
|
||||
This is a private PDCurses routine.
|
||||
This is a private PDCurses routine.
|
||||
|
||||
Returns the maximum number of rows supported by the display.
|
||||
e.g. 25, 28, 43, 50, 60, 66...
|
||||
Returns the maximum number of rows supported by the display.
|
||||
e.g. 25, 28, 43, 50, 60, 66...
|
||||
|
||||
PDCurses Return Value:
|
||||
This function returns OK on success and ERR on error.
|
||||
This function returns OK on success and ERR on error.
|
||||
|
||||
PDCurses Errors:
|
||||
No errors are defined for this function.
|
||||
No errors are defined for this function.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_get_rows( void );
|
||||
PDCurses int PDC_get_rows( void );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_get_rows(void)
|
||||
#else
|
||||
int PDC_get_rows()
|
||||
#endif
|
||||
int PDC_get_rows(void)
|
||||
/***********************************************************************/
|
||||
{
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
int cols=0;
|
||||
int cols=0;
|
||||
#else
|
||||
VIOMODEINFO modeInfo={0};
|
||||
VIOMODEINFO modeInfo={0};
|
||||
#endif
|
||||
int rows=0;
|
||||
char *env_rows=NULL;
|
||||
int rows=0;
|
||||
char *env_rows=NULL;
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_get_rows() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_get_rows() - called\n");
|
||||
#endif
|
||||
|
||||
/* use the value from LINES environment variable, if set. MH 10-Jun-92 */
|
||||
/* and use the minimum of LINES and *ROWS. MH 18-Jun-92 */
|
||||
#ifdef EMXVIDEO
|
||||
v_dimen (&cols, &rows);
|
||||
v_dimen (&cols, &rows);
|
||||
#else
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
VioGetMode(&modeInfo, 0);
|
||||
rows = modeInfo.row;
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
VioGetMode(&modeInfo, 0);
|
||||
rows = modeInfo.row;
|
||||
#endif
|
||||
env_rows = (char *)getenv("LINES");
|
||||
if (env_rows != (char *)NULL)
|
||||
rows = min(atoi(env_rows),rows);
|
||||
env_rows = (char *)getenv("LINES");
|
||||
if (env_rows != (char *)NULL)
|
||||
rows = min(atoi(env_rows),rows);
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_get_rows() - returned: rows %d\n",rows);
|
||||
if (trace_on) PDC_debug("PDC_get_rows() - returned: rows %d\n",rows);
|
||||
#endif
|
||||
return(rows);
|
||||
|
||||
return(rows);
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_get_scrn_mode() - Return the current BIOS video mode
|
||||
PDC_get_scrn_mode() - Return the current BIOS video mode
|
||||
|
||||
PDCurses Description:
|
||||
This is a private PDCurses routine.
|
||||
This is a private PDCurses routine.
|
||||
|
||||
|
||||
PDCurses Return Value:
|
||||
Returns the current BIOS Video Mode Number.
|
||||
Returns the current BIOS Video Mode Number.
|
||||
|
||||
PDCurses Errors:
|
||||
The FLEXOS version of this routine returns an ERR.
|
||||
The UNIX version of this routine returns an ERR.
|
||||
The EMXVIDEO version of this routine returns an ERR.
|
||||
The FLEXOS version of this routine returns an ERR.
|
||||
The UNIX version of this routine returns an ERR.
|
||||
The EMXVIDEO version of this routine returns an ERR.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_get_scrn_mode( void );
|
||||
PDCurses int PDC_get_scrn_mode( void );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_get_scrn_mode(void)
|
||||
#if defined(EMXVIDEO)
|
||||
int PDC_get_scrn_mode( void )
|
||||
#else
|
||||
int PDC_get_scrn_mode()
|
||||
int PDC_get_scrn_mode( VIOMODEINFO *modeinfo )
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
|
||||
#ifndef EMXVIDEO
|
||||
VIOMODEINFO amodeinfo;
|
||||
#endif
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_get_scrn_mode() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_get_scrn_mode() - called\n");
|
||||
#endif
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
return(ERR);
|
||||
return(ERR);
|
||||
#else
|
||||
VioGetMode (&modeInfo, 0);
|
||||
return(OK);
|
||||
VioGetMode ( &amodeinfo, 0 );
|
||||
*modeinfo = amodeinfo;
|
||||
return(OK);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_query_adapter_type() - Determine PC video adapter type
|
||||
PDC_query_adapter_type() - Determine PC video adapter type
|
||||
|
||||
PDCurses Description:
|
||||
This is a private PDCurses routine.
|
||||
This is a private PDCurses routine.
|
||||
|
||||
Thanks to Jeff Duntemann, K16RA for providing the impetus
|
||||
(through the Dr. Dobbs Journal, March 1989 issue) for getting
|
||||
the routines below merged into Bjorn Larsson's PDCurses 1.3...
|
||||
-- frotz@dri.com 900730
|
||||
Thanks to Jeff Duntemann, K16RA for providing the impetus
|
||||
(through the Dr. Dobbs Journal, March 1989 issue) for getting
|
||||
the routines below merged into Bjorn Larsson's PDCurses 1.3...
|
||||
-- frotz@dri.com 900730
|
||||
|
||||
PDCurses Return Value:
|
||||
This function returns a macro identifier indicating the adapter
|
||||
type. See the list of adapter types in CURSPRIV.H.
|
||||
This function returns a macro identifier indicating the adapter
|
||||
type. See the list of adapter types in CURSPRIV.H.
|
||||
|
||||
PDCurses Errors:
|
||||
No errors are defined for this function.
|
||||
No errors are defined for this function.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_query_adapter_type( void );
|
||||
PDCurses int PDC_query_adapter_type( void );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_query_adapter_type(void)
|
||||
#if defined(EMXVIDEO)
|
||||
int PDC_query_adapter_type( void )
|
||||
#else
|
||||
int PDC_query_adapter_type()
|
||||
int PDC_query_adapter_type( VIOCONFIGINFO *configinfo )
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
int retval = _NONE;
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_query_adapter_type() - called\n");
|
||||
#endif
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
SP->adapter = v_hardware();
|
||||
if (SP->adapter == V_MONOCHROME)
|
||||
{
|
||||
SP->mono = TRUE;
|
||||
retval = _UNIX_MONO;
|
||||
}
|
||||
else
|
||||
{
|
||||
SP->mono = FALSE;
|
||||
retval = _UNIX_COLOR;
|
||||
}
|
||||
SP->sizeable = TRUE;
|
||||
SP->bogus_adapter = FALSE;
|
||||
return(retval);
|
||||
#ifndef EMXVIDEO
|
||||
VIOCONFIGINFO aconfiginfo;
|
||||
#else
|
||||
VioGetConfig(0, &configInfo, 0);
|
||||
SP->sizeable = TRUE;
|
||||
return(OK);
|
||||
int retval = _NONE;
|
||||
#endif
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_query_adapter_type() - called\n");
|
||||
#endif
|
||||
#ifdef EMXVIDEO
|
||||
if (v_hardware() == V_MONOCHROME)
|
||||
retval = _UNIX_MONO;
|
||||
else
|
||||
retval = _UNIX_COLOR;
|
||||
return(retval);
|
||||
#else
|
||||
VioGetConfig( 0, &aconfiginfo, 0 );
|
||||
*configinfo = aconfiginfo;
|
||||
return(OK);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
783
os2/pdckbd.c
783
os2/pdckbd.c
File diff suppressed because it is too large
Load Diff
373
os2/pdcscrn.c
373
os2/pdcscrn.c
@@ -17,303 +17,328 @@
|
||||
* See the file maintain.er for details of the current maintainer.
|
||||
***************************************************************************
|
||||
*/
|
||||
#define CURSES_LIBRARY 1
|
||||
#define CURSES_LIBRARY 1
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#define INCL_DOSMISC
|
||||
#include <curses.h>
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
char *rcsid_PDCscrn = "$Id: pdcscrn.c,v 1.2 2001/01/10 08:29:40 mark Exp $";
|
||||
char *rcsid_PDCscrn = "$Id: pdcscrn.c,v 1.3 2002/01/12 04:04:18 mark Exp $";
|
||||
#endif
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
static unsigned char *saved_screen = NULL;
|
||||
static int saved_lines = 0;
|
||||
static int saved_cols = 0;
|
||||
static unsigned char *saved_screen = NULL;
|
||||
static int saved_lines = 0;
|
||||
static int saved_cols = 0;
|
||||
#else
|
||||
static PCH saved_screen = NULL;
|
||||
static USHORT saved_lines = 0;
|
||||
static USHORT saved_cols = 0;
|
||||
static PCH saved_screen = NULL;
|
||||
static USHORT saved_lines = 0;
|
||||
static USHORT saved_cols = 0;
|
||||
#endif
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_scr_close() - Internal low-level binding to close the physical screen
|
||||
PDC_scr_close() - Internal low-level binding to close the physical screen
|
||||
|
||||
PDCurses Description:
|
||||
This function provides a low-level binding for the Flexos
|
||||
platform which must close the screen before writing to it.
|
||||
This is a nop for the DOS platform.
|
||||
This function provides a low-level binding for the Flexos
|
||||
platform which must close the screen before writing to it.
|
||||
This is a nop for the DOS platform.
|
||||
|
||||
This function is provided in order to reset the FlexOS 16 bit
|
||||
character set for input rather than the limited input
|
||||
character set associated with the VT52.
|
||||
This function is provided in order to reset the FlexOS 16 bit
|
||||
character set for input rather than the limited input
|
||||
character set associated with the VT52.
|
||||
|
||||
PDCurses Return Value:
|
||||
This function returns OK on success, otherwise an ERR is returned.
|
||||
This function returns OK on success, otherwise an ERR is returned.
|
||||
|
||||
PDCurses Errors:
|
||||
The DOS platform will never fail. The Flexos platform may fail
|
||||
depending on the ability to close the current virtual console in
|
||||
8 (as opposed to 16) bit mode.
|
||||
The DOS platform will never fail. The Flexos platform may fail
|
||||
depending on the ability to close the current virtual console in
|
||||
8 (as opposed to 16) bit mode.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_scr_close( void );
|
||||
PDCurses int PDC_scr_close( void );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_scr_close(void)
|
||||
#else
|
||||
int PDC_scr_close()
|
||||
#endif
|
||||
int PDC_scr_close(void)
|
||||
/***********************************************************************/
|
||||
{
|
||||
char *ptr;
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_scr_close() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_scr_close() - called\n");
|
||||
#endif
|
||||
if (getenv("PDC_RESTORE_SCREEN") != NULL)
|
||||
{
|
||||
if (saved_screen == NULL)
|
||||
return( OK );
|
||||
#ifdef EMXVIDEO
|
||||
v_putline(saved_screen,0,0,saved_lines*saved_cols);
|
||||
ptr = getenv("PDC_RESTORE_SCREEN");
|
||||
#else
|
||||
VioWrtCellStr(saved_screen,saved_lines*saved_cols*2,0,0,(HVIO)NULL);
|
||||
if ( DosScanEnv( "PDC_RESTORE_SCREEN", (PSZ *)&ptr ) )
|
||||
ptr = NULL;
|
||||
#endif
|
||||
free(saved_screen);
|
||||
saved_screen = NULL;
|
||||
}
|
||||
return( OK );
|
||||
if (ptr != NULL)
|
||||
{
|
||||
if (saved_screen == NULL)
|
||||
return( OK );
|
||||
#ifdef EMXVIDEO
|
||||
v_putline(saved_screen,0,0,saved_lines*saved_cols);
|
||||
#else
|
||||
VioWrtCellStr(saved_screen,saved_lines*saved_cols*2,0,0,(HVIO)NULL);
|
||||
#endif
|
||||
free(saved_screen);
|
||||
saved_screen = NULL;
|
||||
}
|
||||
return( OK );
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_scrn_modes_equal() - Decide if two screen modes are equal
|
||||
PDC_scrn_modes_equal() - Decide if two screen modes are equal
|
||||
|
||||
PDCurses Description:
|
||||
Mainly required for OS/2. It decides if two screen modes
|
||||
Mainly required for OS/2. It decides if two screen modes
|
||||
(VIOMODEINFO structure) are equal. Under DOS it just compares
|
||||
two integers
|
||||
|
||||
PDCurses Return Value:
|
||||
This function returns TRUE if equal else FALSe.
|
||||
This function returns TRUE if equal else FALSe.
|
||||
|
||||
PDCurses Errors:
|
||||
No errors are defined for this function.
|
||||
No errors are defined for this function.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_scrn_modes_equal( int mode1, int mode2 );
|
||||
OS2 PDCurses int PDC_scrn_modes_equal( VIOMODEINFO mode1, VIOMODEINFO mode2 );
|
||||
PDCurses int PDC_scrn_modes_equal( int mode1, int mode2 );
|
||||
OS2 PDCurses int PDC_scrn_modes_equal( VIOMODEINFO mode1, VIOMODEINFO mode2 );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#if !defined( EMXVIDEO )
|
||||
bool PDC_scrn_modes_equal(VIOMODEINFO mode1, VIOMODEINFO mode2)
|
||||
bool PDC_scrn_modes_equal(VIOMODEINFO mode1, VIOMODEINFO mode2)
|
||||
#else
|
||||
# ifdef HAVE_PROTO
|
||||
bool PDC_scrn_modes_equal(int mode1, int mode2)
|
||||
# else
|
||||
bool PDC_scrn_modes_equal(mode1,mode2)
|
||||
int mode1;
|
||||
int mode2;
|
||||
# endif
|
||||
bool PDC_scrn_modes_equal(int mode1, int mode2)
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_scrn_modes_equal() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_scrn_modes_equal() - called\n");
|
||||
#endif
|
||||
|
||||
#if !defined( EMXVIDEO )
|
||||
return ((mode1.cb == mode2.cb) && (mode1.fbType == mode2.fbType)
|
||||
&& (mode1.color == mode2.color) && (mode1.col == mode2.col)
|
||||
&& (mode1.row == mode2.row) && (mode1.hres == mode2.vres)
|
||||
&& (mode1.vres == mode2.vres) );
|
||||
return ((mode1.cb == mode2.cb) && (mode1.fbType == mode2.fbType)
|
||||
&& (mode1.color == mode2.color) && (mode1.col == mode2.col)
|
||||
&& (mode1.row == mode2.row) && (mode1.hres == mode2.vres)
|
||||
&& (mode1.vres == mode2.vres) );
|
||||
#else
|
||||
return (mode1 == mode2);
|
||||
return (mode1 == mode2);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_scr_open() - Internal low-level binding to open the physical screen
|
||||
PDC_scr_open() - Internal low-level binding to open the physical screen
|
||||
|
||||
PDCurses Description:
|
||||
This function provides a low-level binding for the Flexos
|
||||
platform which must open the screen before writing to it.
|
||||
This function provides a low-level binding for the Flexos
|
||||
platform which must open the screen before writing to it.
|
||||
|
||||
This function is provided in order to access the FlexOS 16 bit
|
||||
character set for input rather than the limited input
|
||||
character set associated with the VT52.
|
||||
This function is provided in order to access the FlexOS 16 bit
|
||||
character set for input rather than the limited input
|
||||
character set associated with the VT52.
|
||||
|
||||
PDCurses Return Value:
|
||||
This function returns OK on success, otherwise an ERR is returned.
|
||||
This function returns OK on success, otherwise an ERR is returned.
|
||||
|
||||
PDCurses Errors:
|
||||
The DOS platform will never fail. The Flexos platform may fail
|
||||
depending on the ability to open the current virtual console in
|
||||
8 (as opposed to 16) bit mode.
|
||||
The DOS platform will never fail. The Flexos platform may fail
|
||||
depending on the ability to open the current virtual console in
|
||||
8 (as opposed to 16) bit mode.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_scr_open( SCREEN* internal, bool echo );
|
||||
PDCurses int PDC_scr_open( SCREEN* internal, bool echo );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_scr_open(SCREEN *internal, bool echo)
|
||||
#else
|
||||
int PDC_scr_open(internal,echo)
|
||||
SCREEN *internal;
|
||||
bool echo;
|
||||
#endif
|
||||
int PDC_scr_open(SCREEN *internal, bool echo)
|
||||
/***********************************************************************/
|
||||
{
|
||||
char *ptr;
|
||||
#if !defined( EMXVIDEO )
|
||||
extern VIOCONFIGINFO configInfo;
|
||||
extern VIOMODEINFO modeInfo;
|
||||
USHORT totchars=0;
|
||||
USHORT totchars=0;
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_scr_open() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_scr_open() - called. internal: %x, echo: %d\n", internal, echo);
|
||||
#endif
|
||||
|
||||
internal->orig_attr = 0;
|
||||
internal->orig_emulation = 0;
|
||||
PDC_get_cursor_pos(&internal->cursrow, &internal->curscol);
|
||||
internal->direct_video = TRUE; /* Assume that we can */
|
||||
internal->autocr = TRUE; /* lf -> crlf 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 = echo;
|
||||
internal->orig_attr = 0;
|
||||
internal->orig_emulation = 0;
|
||||
PDC_get_cursor_pos(&internal->cursrow, &internal->curscol);
|
||||
internal->direct_video = TRUE; /* Assume that we can */
|
||||
internal->autocr = TRUE; /* lf -> crlf 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 = echo;
|
||||
/* under System V Curses, typeahead checking is enabled by default */
|
||||
internal->refrbrk = TRUE; /* allow premature end of refresh*/
|
||||
internal->video_page = 0; /* Current Video Page */
|
||||
internal->visible_cursor= TRUE; /* Assume that it is visible */
|
||||
internal->cursor = PDC_get_cursor_mode();
|
||||
internal->refrbrk = TRUE; /* allow premature end of refresh*/
|
||||
internal->video_page = 0; /* Current Video Page */
|
||||
internal->visible_cursor= TRUE; /* Assume that it is visible */
|
||||
internal->cursor = PDC_get_cursor_mode();
|
||||
#if defined(EMXVIDEO)
|
||||
internal->tahead = -1;
|
||||
internal->tahead = -1;
|
||||
#endif
|
||||
|
||||
#if !defined(EMXVIDEO)
|
||||
(void)PDC_query_adapter_type();
|
||||
memcpy((char *)&internal->adapter,(char *)&configInfo,sizeof(VIOCONFIGINFO));
|
||||
(void)PDC_get_scrn_mode();
|
||||
memcpy((char *)&internal->scrnmode,(char *)&modeInfo,sizeof(VIOMODEINFO));
|
||||
(void)PDC_query_adapter_type( &internal->adapter );
|
||||
(void)PDC_get_scrn_mode( &internal->scrnmode );
|
||||
(void)PDC_get_keyboard_info( &internal->kbdinfo );
|
||||
# ifdef PDCDEBUG1
|
||||
if (trace_on) PDC_debug("PDC_scr_open() - after PDC_get_keyboard_info(). cb: %x, fsMask: %x, chTurnAround: %x, fsInterim: %x, fsState: %x\n",
|
||||
SP->kbdinfo.cb,
|
||||
SP->kbdinfo.fsMask,
|
||||
SP->kbdinfo.chTurnAround,
|
||||
SP->kbdinfo.fsInterim,
|
||||
SP->kbdinfo.fsState);
|
||||
# endif
|
||||
/*
|
||||
* Now set the keyboard into binary mode
|
||||
*/
|
||||
(void)PDC_set_keyboard_binary();
|
||||
#else
|
||||
internal->adapter = PDC_query_adapter_type();
|
||||
internal->adapter = PDC_query_adapter_type();
|
||||
if ( internal->adapter == _UNIX_MONO )
|
||||
internal->mono = TRUE;
|
||||
#endif
|
||||
|
||||
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;
|
||||
/*
|
||||
* This code for preserving the current screen...
|
||||
*/
|
||||
if (getenv("PDC_RESTORE_SCREEN") != NULL)
|
||||
{
|
||||
saved_lines = internal->lines;
|
||||
saved_cols = internal->cols;
|
||||
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...
|
||||
*/
|
||||
#ifdef EMXVIDEO
|
||||
if ((saved_screen = (unsigned char*)malloc(2*saved_lines*saved_cols*sizeof(unsigned char))) == NULL)
|
||||
return(ERR);
|
||||
v_getline(saved_screen,0,0,saved_lines*saved_cols);
|
||||
ptr = getenv("PDC_RESTORE_SCREEN");
|
||||
#else
|
||||
if ((saved_screen = (PCH)malloc(2*saved_lines*saved_cols*sizeof(unsigned char))) == NULL)
|
||||
return(ERR);
|
||||
totchars = saved_lines*saved_cols*2;
|
||||
VioReadCellStr((PCH)saved_screen,&totchars,0,0,(HVIO)NULL);
|
||||
if ( DosScanEnv( "PDC_RESTORE_SCREEN", (PSZ *)&ptr ) )
|
||||
ptr = NULL;
|
||||
#endif
|
||||
}
|
||||
if (ptr != NULL)
|
||||
{
|
||||
saved_lines = internal->lines;
|
||||
saved_cols = internal->cols;
|
||||
#ifdef EMXVIDEO
|
||||
if ((saved_screen = (unsigned char*)malloc(2*saved_lines*saved_cols*sizeof(unsigned char))) == NULL)
|
||||
return(ERR);
|
||||
v_getline(saved_screen,0,0,saved_lines*saved_cols);
|
||||
#else
|
||||
if ((saved_screen = (PCH)malloc(2*saved_lines*saved_cols*sizeof(unsigned char))) == NULL)
|
||||
return(ERR);
|
||||
totchars = saved_lines*saved_cols*2;
|
||||
VioReadCellStr((PCH)saved_screen,&totchars,0,0,(HVIO)NULL);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (getenv("PDC_PRESERVE_SCREEN") != NULL)
|
||||
internal->_preserve = TRUE;
|
||||
else
|
||||
internal->_preserve = FALSE;
|
||||
#ifdef EMXVIDEO
|
||||
ptr = getenv("PDC_PRESERVE_SCREEN");
|
||||
#else
|
||||
if ( DosScanEnv( "PDC_PRESERVE_SCREEN", (PSZ *)&ptr ) )
|
||||
ptr = NULL;
|
||||
#endif
|
||||
if (ptr != NULL)
|
||||
internal->_preserve = TRUE;
|
||||
else
|
||||
internal->_preserve = FALSE;
|
||||
|
||||
return( OK );
|
||||
return( OK );
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_resize_screen() - Internal low-level function to resize screen
|
||||
PDC_resize_screen() - Internal low-level function to resize screen
|
||||
|
||||
PDCurses Description:
|
||||
This function provides a means for the application program to
|
||||
resize the overall dimensions of the screen. Under DOS and OS/2
|
||||
the application can tell PDCurses what size to make the screen;
|
||||
under X11, resizing is done by the user and this function simply
|
||||
adjusts its internal structures to fit the new size.
|
||||
This function provides a means for the application program to
|
||||
resize the overall dimensions of the screen. Under DOS and OS/2
|
||||
the application can tell PDCurses what size to make the screen;
|
||||
under X11, resizing is done by the user and this function simply
|
||||
adjusts its internal structures to fit the new size.
|
||||
|
||||
PDCurses Return Value:
|
||||
This function returns OK on success, otherwise an ERR is returned.
|
||||
This function returns OK on success, otherwise an ERR is returned.
|
||||
|
||||
PDCurses Errors:
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_resize_screen( int, int );
|
||||
PDCurses int PDC_resize_screen( int, int );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_resize_screen(int nlines, int ncols)
|
||||
#else
|
||||
int PDC_resize_screen(nlines, ncols)
|
||||
int nlines,ncols;
|
||||
#endif
|
||||
int PDC_resize_screen(int nlines, int ncols)
|
||||
/***********************************************************************/
|
||||
{
|
||||
int rc=OK;
|
||||
#ifndef EMXVIDEO
|
||||
VIOMODEINFO modeInfo={0};
|
||||
USHORT result=0;
|
||||
VIOMODEINFO modeInfo={0};
|
||||
USHORT result=0;
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_resize_screen() - called. Lines: %d Cols: %d\n",nlines,ncols);
|
||||
if (trace_on) PDC_debug("PDC_resize_screen() - called. Lines: %d Cols: %d\n",nlines,ncols);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
if (nlines >= 43) PDC_set_font(_FONT8);
|
||||
else if (nlines > 25) PDC_set_font(_FONT14);
|
||||
else PDC_set_80x25();
|
||||
return ( rc );
|
||||
#ifdef EMXVIDEO
|
||||
return (ERR);
|
||||
#else
|
||||
|
||||
# ifdef EMXVIDEO
|
||||
return (ERR);
|
||||
# else
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
/* set most parameters of modeInfo */
|
||||
VioGetMode(&modeInfo, 0);
|
||||
modeInfo.fbType = 1;
|
||||
modeInfo.row = nlines;
|
||||
modeInfo.col = ncols;
|
||||
result = VioSetMode(&modeInfo, 0);
|
||||
LINES = PDC_get_rows();
|
||||
COLS = PDC_get_columns();
|
||||
return ((result == 0) ? OK : ERR);
|
||||
# endif
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
/* set most parameters of modeInfo */
|
||||
VioGetMode(&modeInfo, 0);
|
||||
modeInfo.fbType = 1;
|
||||
modeInfo.row = nlines;
|
||||
modeInfo.col = ncols;
|
||||
result = VioSetMode(&modeInfo, 0);
|
||||
LINES = PDC_get_rows();
|
||||
COLS = PDC_get_columns();
|
||||
return ((result == 0) ? OK : ERR);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !defined(EMXVIDEO)
|
||||
/***********************************************************************/
|
||||
int PDC_reset_shell_mode( void )
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_reset_shell_mode() - called.\n");
|
||||
#endif
|
||||
PDC_set_keyboard_default();
|
||||
return OK;
|
||||
}
|
||||
|
||||
/***********************************************************************/
|
||||
int PDC_reset_prog_mode( void )
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_reset_prog_mode() - called.\n");
|
||||
#endif
|
||||
PDC_set_keyboard_binary();
|
||||
return OK;
|
||||
}
|
||||
#endif
|
||||
|
||||
353
os2/pdcsetsc.c
353
os2/pdcsetsc.c
@@ -17,301 +17,265 @@
|
||||
* See the file maintain.er for details of the current maintainer.
|
||||
***************************************************************************
|
||||
*/
|
||||
#define CURSES_LIBRARY 1
|
||||
#define CURSES_LIBRARY 1
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
#include <curses.h>
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
char *rcsid_PDCsetsc = "$Id: pdcsetsc.c,v 1.2 2001/01/10 08:29:42 mark Exp $";
|
||||
char *rcsid_PDCsetsc = "$Id: pdcsetsc.c,v 1.3 2002/01/12 04:04:18 mark Exp $";
|
||||
#endif
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_set_80x25() - force a known screen state: 80x25 text mode.
|
||||
PDC_set_80x25() - force a known screen state: 80x25 text mode.
|
||||
|
||||
PDCurses Description:
|
||||
This is a private PDCurses function.
|
||||
This is a private PDCurses function.
|
||||
|
||||
Forces the appropriate 80x25 alpha mode given the display adapter.
|
||||
Forces the appropriate 80x25 alpha mode given the display adapter.
|
||||
|
||||
Since we currently do not support changing the virtual console size,
|
||||
this routine is a NOP under Flexos.
|
||||
Since we currently do not support changing the virtual console size,
|
||||
this routine is a NOP under Flexos.
|
||||
|
||||
PDCurses Return Value:
|
||||
This function returns OK upon success otherwise ERR is returned.
|
||||
This function returns OK upon success otherwise ERR is returned.
|
||||
|
||||
PDCurses Errors:
|
||||
No errors are defined for this routine.
|
||||
No errors are defined for this routine.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_set_80x25( void );
|
||||
PDCurses int PDC_set_80x25( void );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_set_80x25(void)
|
||||
#else
|
||||
int PDC_set_80x25()
|
||||
#endif
|
||||
int PDC_set_80x25(void)
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifndef EMXVIDEO
|
||||
VIOMODEINFO modeInfo={0};
|
||||
VIOMODEINFO modeInfo={0};
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_set_80x25() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_set_80x25() - called\n");
|
||||
#endif
|
||||
|
||||
#ifndef EMXVIDEO
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
/* set most parameters of modeInfo */
|
||||
VioGetMode(&modeInfo, 0);
|
||||
modeInfo.fbType = 1;
|
||||
VioSetMode(&modeInfo, 0);
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
/* set most parameters of modeInfo */
|
||||
VioGetMode(&modeInfo, 0);
|
||||
modeInfo.fbType = 1;
|
||||
VioSetMode(&modeInfo, 0);
|
||||
#endif
|
||||
return( OK );
|
||||
return( OK );
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_set_cursor_mode() - Set the cursor start and stop scan lines.
|
||||
PDC_set_cursor_mode() - Set the cursor start and stop scan lines.
|
||||
|
||||
PDCurses Description:
|
||||
Sets the cursor type to begin in scan line startrow and end in
|
||||
scan line endrow. Both values should be 0-31.
|
||||
Sets the cursor type to begin in scan line startrow and end in
|
||||
scan line endrow. Both values should be 0-31.
|
||||
|
||||
PDCurses Return Value:
|
||||
This function returns OK on success and ERR on error.
|
||||
This function returns OK on success and ERR on error.
|
||||
|
||||
PDCurses Errors:
|
||||
No errors are defined for this function.
|
||||
No errors are defined for this function.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_set_cursor_mode( int startrow, int endrow );
|
||||
PDCurses int PDC_set_cursor_mode( int startrow, int endrow );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_set_cursor_mode( int startrow, int endrow )
|
||||
#else
|
||||
int PDC_set_cursor_mode(startrow,endrow)
|
||||
int startrow;
|
||||
int endrow;
|
||||
#endif
|
||||
int PDC_set_cursor_mode( int startrow, int endrow )
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifndef EMXVIDEO
|
||||
VIOCURSORINFO cursorInfo={0};
|
||||
VIOCURSORINFO cursorInfo={0};
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_set_cursor_mode() - called: startrow %d endrow %d\n",startrow,endrow);
|
||||
if (trace_on) PDC_debug("PDC_set_cursor_mode() - called: startrow %d endrow %d\n",startrow,endrow);
|
||||
#endif
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
if (endrow <= startrow)
|
||||
v_hidecursor();
|
||||
else
|
||||
v_ctype (startrow, endrow);
|
||||
return( OK );
|
||||
if (endrow <= startrow)
|
||||
v_hidecursor();
|
||||
else
|
||||
v_ctype (startrow, endrow);
|
||||
return( OK );
|
||||
#else
|
||||
cursorInfo.yStart = startrow;
|
||||
cursorInfo.cEnd = endrow;
|
||||
cursorInfo.cx = 1;
|
||||
cursorInfo.attr = 0;
|
||||
return (VioSetCurType (&cursorInfo, 0) == 0);
|
||||
cursorInfo.yStart = startrow;
|
||||
cursorInfo.cEnd = endrow;
|
||||
cursorInfo.cx = 1;
|
||||
cursorInfo.attr = 0;
|
||||
return (VioSetCurType (&cursorInfo, 0) == 0);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_set_font() - sets the current font size
|
||||
PDC_set_font() - sets the current font size
|
||||
|
||||
PDCurses Description:
|
||||
This is a private PDCurses function.
|
||||
This is a private PDCurses function.
|
||||
|
||||
This routine sets the current font size, if the adapter allows
|
||||
such a change.
|
||||
This routine sets the current font size, if the adapter allows
|
||||
such a change.
|
||||
|
||||
PDCurses Return Value:
|
||||
This function returns OK upon success otherwise ERR is returned.
|
||||
This function returns OK upon success otherwise ERR is returned.
|
||||
|
||||
PDCurses Errors:
|
||||
It is an error to attempt to change the font size on a "bogus"
|
||||
adapter. The reason for this is that we have a known video
|
||||
adapter identity problem. e.g. Two adapters report the same
|
||||
identifying characteristics.
|
||||
It is an error to attempt to change the font size on a "bogus"
|
||||
adapter. The reason for this is that we have a known video
|
||||
adapter identity problem. e.g. Two adapters report the same
|
||||
identifying characteristics.
|
||||
|
||||
It is also an error to attempt to change the size of the Flexos
|
||||
console (as there is currently no support for that).
|
||||
It is also an error to attempt to change the size of the Flexos
|
||||
console (as there is currently no support for that).
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_set_font( int size );
|
||||
PDCurses int PDC_set_font( int size );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_set_font(int size)
|
||||
#else
|
||||
int PDC_set_font(size)
|
||||
int size;
|
||||
#endif
|
||||
int PDC_set_font(int size)
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifndef EMXVIDEO
|
||||
VIOMODEINFO modeInfo={0};
|
||||
VIOMODEINFO modeInfo={0};
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_set_font() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_set_font() - called\n");
|
||||
#endif
|
||||
|
||||
#ifndef EMXVIDEO
|
||||
if (SP->sizeable && (SP->font != size))
|
||||
{
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
/* set most parameters of modeInfo */
|
||||
VioGetMode(&modeInfo, 0);
|
||||
modeInfo.cb = 8; /* ignore horiz an vert resolution */
|
||||
modeInfo.row = modeInfo.vres / size;
|
||||
VioSetMode(&modeInfo, 0);
|
||||
}
|
||||
if (SP->visible_cursor)
|
||||
PDC_cursor_on();
|
||||
else
|
||||
PDC_cursor_off();
|
||||
SP->font = PDC_get_font();
|
||||
if (SP->sizeable && (SP->font != size))
|
||||
{
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
/* set most parameters of modeInfo */
|
||||
VioGetMode(&modeInfo, 0);
|
||||
modeInfo.cb = 8; /* ignore horiz an vert resolution */
|
||||
modeInfo.row = modeInfo.vres / size;
|
||||
VioSetMode(&modeInfo, 0);
|
||||
}
|
||||
if (SP->visible_cursor)
|
||||
PDC_cursor_on();
|
||||
else
|
||||
PDC_cursor_off();
|
||||
SP->font = PDC_get_font();
|
||||
#endif
|
||||
return( OK );
|
||||
|
||||
return( OK );
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_set_rows() - sets the physical number of rows on screen
|
||||
PDC_set_rows() - sets the physical number of rows on screen
|
||||
|
||||
PDCurses Description:
|
||||
This is a private PDCurses function.
|
||||
This is a private PDCurses function.
|
||||
|
||||
This routine attempts to set the number of rows on the physical
|
||||
screen to the passed value.
|
||||
This routine attempts to set the number of rows on the physical
|
||||
screen to the passed value.
|
||||
|
||||
PDCurses Return Value:
|
||||
This function returns OK upon success otherwise ERR is returned.
|
||||
This function returns OK upon success otherwise ERR is returned.
|
||||
|
||||
PDCurses Errors:
|
||||
It is an error to attempt to change the screen size on a "bogus"
|
||||
adapter. The reason for this is that we have a known video
|
||||
adapter identity problem. e.g. Two adapters report the same
|
||||
identifying characteristics.
|
||||
It is an error to attempt to change the screen size on a "bogus"
|
||||
adapter. The reason for this is that we have a known video
|
||||
adapter identity problem. e.g. Two adapters report the same
|
||||
identifying characteristics.
|
||||
|
||||
It is also an error to attempt to change the size of the Flexos
|
||||
console (as there is currently no support for that).
|
||||
It is also an error to attempt to change the size of the Flexos
|
||||
console (as there is currently no support for that).
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_set_rows( int rows );
|
||||
PDCurses int PDC_set_rows( int rows );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_set_rows(int rows)
|
||||
#else
|
||||
int PDC_set_rows(rows)
|
||||
int rows;
|
||||
#endif
|
||||
int PDC_set_rows(int rows)
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifndef EMXVIDEO
|
||||
VIOMODEINFO modeInfo={0};
|
||||
USHORT result=0;
|
||||
VIOMODEINFO modeInfo={0};
|
||||
USHORT result=0;
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_set_rows() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_set_rows() - called\n");
|
||||
#endif
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
return (ERR);
|
||||
return (ERR);
|
||||
#else
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
/* set most parameters of modeInfo */
|
||||
VioGetMode(&modeInfo, 0);
|
||||
modeInfo.fbType = 1;
|
||||
modeInfo.row = rows;
|
||||
result = VioSetMode(&modeInfo, 0);
|
||||
SP->font = PDC_get_font();
|
||||
LINES = PDC_get_rows();
|
||||
COLS = PDC_get_columns();
|
||||
return ((result == 0) ? OK : ERR);
|
||||
modeInfo.cb = sizeof(modeInfo);
|
||||
/* set most parameters of modeInfo */
|
||||
VioGetMode(&modeInfo, 0);
|
||||
modeInfo.fbType = 1;
|
||||
modeInfo.row = rows;
|
||||
result = VioSetMode(&modeInfo, 0);
|
||||
SP->font = PDC_get_font();
|
||||
LINES = PDC_get_rows();
|
||||
COLS = PDC_get_columns();
|
||||
return ((result == 0) ? OK : ERR);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_set_scrn_mode() - Set BIOS Video Mode
|
||||
PDC_set_scrn_mode() - Set BIOS Video Mode
|
||||
|
||||
PDCurses Description:
|
||||
Sets the BIOS Video Mode Number ONLY if it is different from
|
||||
the current video mode. This routine is for DOS systems only.
|
||||
Sets the BIOS Video Mode Number ONLY if it is different from
|
||||
the current video mode. This routine is for DOS systems only.
|
||||
|
||||
PDCurses Return Value:
|
||||
This function returns OK on success and ERR on error.
|
||||
This function returns OK on success and ERR on error.
|
||||
|
||||
PDCurses Errors:
|
||||
No errors are defined for this function.
|
||||
No errors are defined for this function.
|
||||
|
||||
Portability:
|
||||
PDCurses int PDC_set_scrn_mode( int new_mode );
|
||||
PDCurses int PDC_set_scrn_mode( int new_mode );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
|
||||
/***********************************************************************/
|
||||
#if !defined( EMXVIDEO )
|
||||
int PDC_set_scrn_mode(VIOMODEINFO new_mode)
|
||||
int PDC_set_scrn_mode(VIOMODEINFO new_mode)
|
||||
#else
|
||||
# ifdef HAVE_PROTO
|
||||
int PDC_set_scrn_mode(int new_mode)
|
||||
# else
|
||||
int PDC_set_scrn_mode(new_mode)
|
||||
int new_mode;
|
||||
# endif
|
||||
int PDC_set_scrn_mode(int new_mode)
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_set_scrn_mode() - called\n");
|
||||
if (trace_on) PDC_debug("PDC_set_scrn_mode() - called\n");
|
||||
#endif
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
return ( OK );
|
||||
return ( OK );
|
||||
#else
|
||||
if (VioSetMode (&new_mode, 0) != 0)
|
||||
{
|
||||
SP->font = PDC_get_font();
|
||||
memcpy((char *)&SP->scrnmode,(char *)&new_mode,sizeof(VIOMODEINFO));
|
||||
LINES = PDC_get_rows();
|
||||
COLS = PDC_get_columns();
|
||||
return( OK );
|
||||
}
|
||||
else
|
||||
return (ERR);
|
||||
if (VioSetMode (&new_mode, 0) != 0)
|
||||
{
|
||||
SP->font = PDC_get_font();
|
||||
memcpy((char *)&SP->scrnmode,(char *)&new_mode,sizeof(VIOMODEINFO));
|
||||
LINES = PDC_get_rows();
|
||||
COLS = PDC_get_columns();
|
||||
return( OK );
|
||||
}
|
||||
else
|
||||
return (ERR);
|
||||
#endif
|
||||
}
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_curs_set(int visibility)
|
||||
#else
|
||||
int PDC_curs_set(visibility)
|
||||
int visibility;
|
||||
#endif
|
||||
int PDC_curs_set(int visibility)
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifndef EMXVIDEO
|
||||
@@ -321,79 +285,72 @@ int visibility;
|
||||
int ret_vis=0,hidden=0;
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_curs_set() - called: visibility=%d\n",visibility);
|
||||
if (trace_on) PDC_debug("PDC_curs_set() - called: visibility=%d\n",visibility);
|
||||
#endif
|
||||
|
||||
ret_vis = SP->visibility;
|
||||
SP->visibility = visibility;
|
||||
ret_vis = SP->visibility;
|
||||
SP->visibility = visibility;
|
||||
|
||||
switch(visibility)
|
||||
{
|
||||
case 0: /* invisible */
|
||||
switch(visibility)
|
||||
{
|
||||
case 0: /* invisible */
|
||||
#ifdef EMXVIDEO
|
||||
start = end = 0;
|
||||
start = end = 0;
|
||||
#else
|
||||
start = SP->font / 4;
|
||||
end = SP->font;
|
||||
start = SP->font / 4;
|
||||
end = SP->font;
|
||||
#endif
|
||||
hidden = (-1);
|
||||
break;
|
||||
case 2: /* highly visible */
|
||||
start = 2; /* almost full-height block */
|
||||
end = SP->font-1;
|
||||
break;
|
||||
default: /* normal visibility */
|
||||
start = SP->font - (SP->font / 4);
|
||||
end = SP->font-1;
|
||||
break;
|
||||
}
|
||||
hidden = (-1);
|
||||
break;
|
||||
case 2: /* highly visible */
|
||||
start = 2; /* almost full-height block */
|
||||
end = SP->font-1;
|
||||
break;
|
||||
default: /* normal visibility */
|
||||
start = SP->font - (SP->font / 4);
|
||||
end = SP->font-1;
|
||||
break;
|
||||
}
|
||||
|
||||
#ifdef EMXVIDEO
|
||||
if (!visibility)
|
||||
v_hidecursor();
|
||||
else
|
||||
v_ctype (start, end);
|
||||
if (!visibility)
|
||||
v_hidecursor();
|
||||
else
|
||||
v_ctype (start, end);
|
||||
#else
|
||||
pvioCursorInfo.yStart = (USHORT)start;
|
||||
pvioCursorInfo.cEnd = (USHORT)end;
|
||||
pvioCursorInfo.cx = (USHORT)1;
|
||||
pvioCursorInfo.attr = hidden;
|
||||
VioSetCurType((PVIOCURSORINFO)&pvioCursorInfo,0);
|
||||
pvioCursorInfo.yStart = (USHORT)start;
|
||||
pvioCursorInfo.cEnd = (USHORT)end;
|
||||
pvioCursorInfo.cx = (USHORT)1;
|
||||
pvioCursorInfo.attr = hidden;
|
||||
VioSetCurType((PVIOCURSORINFO)&pvioCursorInfo,0);
|
||||
#endif
|
||||
|
||||
return( ret_vis );
|
||||
return( ret_vis );
|
||||
}
|
||||
|
||||
/*man-start*********************************************************************
|
||||
|
||||
PDC_set_title() - Set window title
|
||||
PDC_set_title() - Set window title
|
||||
|
||||
PDCurses Description:
|
||||
Sets the title of the window in which the curses program is running.
|
||||
This function may not do anything on some platforms.
|
||||
Sets the title of the window in which the curses program is running.
|
||||
This function may not do anything on some platforms.
|
||||
|
||||
PDCurses Return Value:
|
||||
N/A
|
||||
N/A
|
||||
|
||||
PDCurses Errors:
|
||||
No errors are defined for this function.
|
||||
No errors are defined for this function.
|
||||
|
||||
Portability:
|
||||
PDCurses void PDC_set_title( char *title );
|
||||
PDCurses void PDC_set_title( char *title );
|
||||
|
||||
**man-end**********************************************************************/
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
void PDC_set_title(char *title)
|
||||
#else
|
||||
void PDC_set_title(title)
|
||||
char *title;
|
||||
#endif
|
||||
void PDC_set_title(char *title)
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("PDC_set_title() - called:<%s>\n",title);
|
||||
if (trace_on) PDC_debug("PDC_set_title() - called:<%s>\n",title);
|
||||
#endif
|
||||
|
||||
return;
|
||||
return;
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -17,7 +17,7 @@
|
||||
* See the file maintain.er for details of the current maintainer.
|
||||
***************************************************************************
|
||||
*/
|
||||
#define CURSES_LIBRARY 1
|
||||
#define CURSES_LIBRARY 1
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include <config.h>
|
||||
#endif
|
||||
@@ -33,27 +33,27 @@
|
||||
#endif
|
||||
|
||||
/* undefine any macros for functions defined in this module */
|
||||
#undef def_prog_mode
|
||||
#undef def_shell_mode
|
||||
#undef reset_prog_mode
|
||||
#undef reset_shell_mode
|
||||
#undef resetty
|
||||
#undef savetty
|
||||
#undef getsyx
|
||||
#undef setsyx
|
||||
#undef ripoffline
|
||||
#undef curs_set
|
||||
#undef napms
|
||||
#undef draino
|
||||
#undef def_prog_mode
|
||||
#undef def_shell_mode
|
||||
#undef reset_prog_mode
|
||||
#undef reset_shell_mode
|
||||
#undef resetty
|
||||
#undef savetty
|
||||
#undef getsyx
|
||||
#undef setsyx
|
||||
#undef ripoffline
|
||||
#undef curs_set
|
||||
#undef napms
|
||||
#undef draino
|
||||
|
||||
/* undefine any macros for functions called by this module if in debug mode */
|
||||
#ifdef PDCDEBUG
|
||||
# undef move
|
||||
# undef wmove
|
||||
# undef move
|
||||
# undef wmove
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
char *rcsid_kernel = "$Id: kernel.c,v 1.1 2001/01/10 08:27:13 mark Exp $";
|
||||
char *rcsid_kernel = "$Id: kernel.c,v 1.2 2002/01/12 04:04:18 mark Exp $";
|
||||
#endif
|
||||
|
||||
RIPPEDOFFLINE linesripped[5];
|
||||
@@ -64,85 +64,85 @@ char linesrippedoff=0;
|
||||
Name: kernel
|
||||
|
||||
Synopsis:
|
||||
int def_prog_mode(void);
|
||||
int def_shell_mode(void);
|
||||
int reset_prog_mode(void);
|
||||
int reset_shell_mode(void);
|
||||
int resetty(void);
|
||||
int savetty(void);
|
||||
int getsyx(int *y, int *x);
|
||||
int setsyx(int y, int x);
|
||||
int ripoffline(int line, int (*init)(WINDOW *,int));
|
||||
int curs_set(int visibility);
|
||||
int napms(int ms);
|
||||
int draino(int ms);
|
||||
int def_prog_mode(void);
|
||||
int def_shell_mode(void);
|
||||
int reset_prog_mode(void);
|
||||
int reset_shell_mode(void);
|
||||
int resetty(void);
|
||||
int savetty(void);
|
||||
int getsyx(int *y, int *x);
|
||||
int setsyx(int y, int x);
|
||||
int ripoffline(int line, int (*init)(WINDOW *,int));
|
||||
int curs_set(int visibility);
|
||||
int napms(int ms);
|
||||
int draino(int ms);
|
||||
|
||||
X/Open Description:
|
||||
The def_prog_mode() and def_shell_mode() functions save the
|
||||
current terminal modes as the "program" (in curses) or
|
||||
"shell" (not in curses) state for use by the reset_prog_mode()
|
||||
and reset_shell_mode() functions. This is done automatically by
|
||||
initscr().
|
||||
The def_prog_mode() and def_shell_mode() functions save the
|
||||
current terminal modes as the "program" (in curses) or
|
||||
"shell" (not in curses) state for use by the reset_prog_mode()
|
||||
and reset_shell_mode() functions. This is done automatically by
|
||||
initscr().
|
||||
|
||||
The reset_prog_mode() and reset_shell_mode() functions restore
|
||||
the terminal to "program" (in curses) or "shell" (not in curses)
|
||||
state. These are done automatically by endwin()
|
||||
and doupdate() after an endwin(), so they would normally not
|
||||
be called before these functions.
|
||||
The reset_prog_mode() and reset_shell_mode() functions restore
|
||||
the terminal to "program" (in curses) or "shell" (not in curses)
|
||||
state. These are done automatically by endwin()
|
||||
and doupdate() after an endwin(), so they would normally not
|
||||
be called before these functions.
|
||||
|
||||
The savetty() and resetty() routines save and restore the state of
|
||||
the terminal modes. The savetty() function saves the current state
|
||||
in a buffer and resetty() restores the state to what it was at the
|
||||
last call to savetty().
|
||||
The savetty() and resetty() routines save and restore the state of
|
||||
the terminal modes. The savetty() function saves the current state
|
||||
in a buffer and resetty() restores the state to what it was at the
|
||||
last call to savetty().
|
||||
|
||||
The getsyx() routine obtains the coordinates of the virtual screen
|
||||
cursor. If leaveok() is currently TRUE, then -1, -1 is returned. If
|
||||
lines have been removed from the top of the screen with ripoffline()
|
||||
then getsyx() includes those lines, so y and x should only be used
|
||||
by setyx().
|
||||
The setyx() routine sets the cursor position of the virtual screen
|
||||
to the y,x coordinates. If y,x are -1,-1, leaveok() is set TRUE.
|
||||
The getsyx() and setsyx() routines are designed to be used by a
|
||||
library routine that manipulates curses windows, but does not want
|
||||
to change the position of the cursor.
|
||||
The getsyx() routine obtains the coordinates of the virtual screen
|
||||
cursor. If leaveok() is currently TRUE, then -1, -1 is returned. If
|
||||
lines have been removed from the top of the screen with ripoffline()
|
||||
then getsyx() includes those lines, so y and x should only be used
|
||||
by setyx().
|
||||
The setyx() routine sets the cursor position of the virtual screen
|
||||
to the y,x coordinates. If y,x are -1,-1, leaveok() is set TRUE.
|
||||
The getsyx() and setsyx() routines are designed to be used by a
|
||||
library routine that manipulates curses windows, but does not want
|
||||
to change the position of the cursor.
|
||||
|
||||
The curs_set() function enables the appearance of the text cursor
|
||||
to be altered. A value of 0 for visibility makes the cursor
|
||||
disappear; a value of 1 makes the cursor appear "normal" (usually
|
||||
an underline) and 2 makes the cursor "highly visible"; a block.
|
||||
The curs_set() function enables the appearance of the text cursor
|
||||
to be altered. A value of 0 for visibility makes the cursor
|
||||
disappear; a value of 1 makes the cursor appear "normal" (usually
|
||||
an underline) and 2 makes the cursor "highly visible"; a block.
|
||||
|
||||
The ripoffline() function allows the user to reduce the size of
|
||||
stdscr by 1 line. If the value of line is positive, the line is
|
||||
removed from the top of the screen; negative from the bottom. Up to
|
||||
5 lines can be ripped off stdscr by calling ripoffline()
|
||||
consecutively.
|
||||
The function argument, init, is called from within initscr() or
|
||||
newterm(), so ripoffline() must be called before either of these
|
||||
functions. The init function is passed a pointer to a 1 line
|
||||
WINDOW and the width of the window. Calling ripoffline() with a
|
||||
NULL initialise function pointer is not advisable!
|
||||
The ripoffline() function allows the user to reduce the size of
|
||||
stdscr by 1 line. If the value of line is positive, the line is
|
||||
removed from the top of the screen; negative from the bottom. Up to
|
||||
5 lines can be ripped off stdscr by calling ripoffline()
|
||||
consecutively.
|
||||
The function argument, init, is called from within initscr() or
|
||||
newterm(), so ripoffline() must be called before either of these
|
||||
functions. The init function is passed a pointer to a 1 line
|
||||
WINDOW and the width of the window. Calling ripoffline() with a
|
||||
NULL initialise function pointer is not advisable!
|
||||
|
||||
The napms() and draino() functions, suspends the program for the
|
||||
specified number of milliseconds.
|
||||
The napms() and draino() functions, suspends the program for the
|
||||
specified number of milliseconds.
|
||||
|
||||
PDCurses Description:
|
||||
FYI: It is very unclear whether savetty() and resetty() functions
|
||||
are a duplication of the reset_prog_mode() and reset_shell_mode()
|
||||
functions or whether this is a backing store type of operation.
|
||||
At this time, they are implemented similar to the reset_*_mode()
|
||||
routines.
|
||||
FYI: It is very unclear whether savetty() and resetty() functions
|
||||
are a duplication of the reset_prog_mode() and reset_shell_mode()
|
||||
functions or whether this is a backing store type of operation.
|
||||
At this time, they are implemented similar to the reset_*_mode()
|
||||
routines.
|
||||
|
||||
The curs_set() routine is used to set the visibility of the cursor.
|
||||
The cursor can be made invisible, normal or highly visible by setting
|
||||
the parameter to 0, 1 or 2 respectively. If an invalid value is passed
|
||||
the function will set the cursor to "normal".
|
||||
The curs_set() routine is used to set the visibility of the cursor.
|
||||
The cursor can be made invisible, normal or highly visible by setting
|
||||
the parameter to 0, 1 or 2 respectively. If an invalid value is passed
|
||||
the function will set the cursor to "normal".
|
||||
|
||||
X/Open Return Value:
|
||||
All functions return OK on success and ERR on error except curs_set()
|
||||
which returns the previous visibility.
|
||||
All functions return OK on success and ERR on error except curs_set()
|
||||
which returns the previous visibility.
|
||||
|
||||
X/Open Errors:
|
||||
No errors are defined for this function.
|
||||
No errors are defined for this function.
|
||||
|
||||
Portability X/Open BSD SYS V
|
||||
Dec '88
|
||||
@@ -163,348 +163,341 @@ char linesrippedoff=0;
|
||||
#ifndef UNIX
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_CDECL def_prog_mode(void)
|
||||
int PDC_CDECL def_prog_mode(void)
|
||||
#else
|
||||
int PDC_CDECL def_prog_mode()
|
||||
int PDC_CDECL def_prog_mode()
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("def_prog_mode() - called\n");
|
||||
if (trace_on) PDC_debug("def_prog_mode() - called\n");
|
||||
#endif
|
||||
|
||||
#ifdef FLEXOS
|
||||
_flexos_16bitmode();
|
||||
#ifdef FLEXOS
|
||||
_flexos_16bitmode();
|
||||
#endif
|
||||
c_pr_tty.been_set = TRUE;
|
||||
c_pr_tty.been_set = TRUE;
|
||||
|
||||
memcpy(&c_pr_tty.saved, SP, sizeof(SCREEN));
|
||||
memcpy(&c_pr_tty.saved, SP, sizeof(SCREEN));
|
||||
|
||||
return( OK );
|
||||
return( OK );
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef UNIX
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_CDECL def_shell_mode(void)
|
||||
int PDC_CDECL def_shell_mode(void)
|
||||
#else
|
||||
int PDC_CDECL def_shell_mode()
|
||||
int PDC_CDECL def_shell_mode()
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("def_shell_mode() - called\n");
|
||||
if (trace_on) PDC_debug("def_shell_mode() - called\n");
|
||||
#endif
|
||||
|
||||
#ifdef FLEXOS
|
||||
_flexos_8bitmode();
|
||||
#ifdef FLEXOS
|
||||
_flexos_8bitmode();
|
||||
#endif
|
||||
c_sh_tty.been_set = TRUE;
|
||||
c_sh_tty.been_set = TRUE;
|
||||
|
||||
memcpy(&c_sh_tty.saved, SP, sizeof(SCREEN));
|
||||
memcpy(&c_sh_tty.saved, SP, sizeof(SCREEN));
|
||||
|
||||
return( OK );
|
||||
return( OK );
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef UNIX
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_CDECL reset_prog_mode(void)
|
||||
int PDC_CDECL reset_prog_mode(void)
|
||||
#else
|
||||
int PDC_CDECL reset_prog_mode()
|
||||
int PDC_CDECL reset_prog_mode()
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
#if defined(OS2) && !defined(EMXVIDEO)
|
||||
extern VIOMODEINFO modeInfo;
|
||||
VIOMODEINFO modeInfo;
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("reset_prog_mode() - called\n");
|
||||
if (trace_on) PDC_debug("reset_prog_mode() - called\n");
|
||||
#endif
|
||||
if (c_pr_tty.been_set == TRUE)
|
||||
{
|
||||
memcpy(SP, &c_pr_tty.saved, sizeof(SCREEN));
|
||||
|
||||
if (c_pr_tty.been_set == TRUE)
|
||||
{
|
||||
|
||||
memcpy(SP, &c_pr_tty.saved, sizeof(SCREEN));
|
||||
|
||||
mvcur(0, 0, c_pr_tty.saved.cursrow, c_pr_tty.saved.curscol);
|
||||
if (PDC_get_ctrl_break() != c_pr_tty.saved.orgcbr)
|
||||
PDC_set_ctrl_break(c_pr_tty.saved.orgcbr);
|
||||
if (c_pr_tty.saved.raw_out)
|
||||
raw();
|
||||
if (c_pr_tty.saved.visible_cursor)
|
||||
PDC_cursor_on();
|
||||
SP->font = PDC_get_font();
|
||||
PDC_set_font(c_pr_tty.saved.font);
|
||||
mvcur(0, 0, c_pr_tty.saved.cursrow, c_pr_tty.saved.curscol);
|
||||
if (PDC_get_ctrl_break() != c_pr_tty.saved.orgcbr)
|
||||
PDC_set_ctrl_break(c_pr_tty.saved.orgcbr);
|
||||
if (c_pr_tty.saved.raw_out)
|
||||
raw();
|
||||
if (c_pr_tty.saved.visible_cursor)
|
||||
PDC_cursor_on();
|
||||
SP->font = PDC_get_font();
|
||||
PDC_set_font(c_pr_tty.saved.font);
|
||||
#if !defined (XCURSES)
|
||||
# if !defined(EMXVIDEO)
|
||||
# if defined(OS2)
|
||||
(void)PDC_get_scrn_mode();
|
||||
if (!PDC_scrn_modes_equal (modeInfo, c_pr_tty.saved.scrnmode))
|
||||
PDC_set_scrn_mode(c_pr_tty.saved.scrnmode);
|
||||
# else
|
||||
if (!PDC_scrn_modes_equal (PDC_get_scrn_mode(), c_pr_tty.saved.scrnmode))
|
||||
PDC_set_scrn_mode(c_pr_tty.saved.scrnmode);
|
||||
# endif
|
||||
# if !defined(EMXVIDEO)
|
||||
# if defined(OS2)
|
||||
(void)PDC_get_scrn_mode( &modeInfo );
|
||||
if ( !PDC_scrn_modes_equal( modeInfo, c_pr_tty.saved.scrnmode ) )
|
||||
PDC_set_scrn_mode( c_pr_tty.saved.scrnmode );
|
||||
# else
|
||||
if ( !PDC_scrn_modes_equal( PDC_get_scrn_mode(), c_pr_tty.saved.scrnmode ) )
|
||||
PDC_set_scrn_mode( c_pr_tty.saved.scrnmode );
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
PDC_set_rows(c_pr_tty.saved.lines);
|
||||
}
|
||||
|
||||
#ifdef FLEXOS
|
||||
_flexos_16bitmode();
|
||||
PDC_set_rows(c_pr_tty.saved.lines);
|
||||
}
|
||||
#ifdef FLEXOS
|
||||
_flexos_16bitmode();
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
PDC_reset_prog_mode();
|
||||
#if defined(WIN32) || (defined(OS2) && !defined(EMXVIDEO))
|
||||
PDC_reset_prog_mode();
|
||||
#endif
|
||||
|
||||
return( OK );
|
||||
return( OK );
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifndef UNIX
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_CDECL reset_shell_mode(void)
|
||||
int PDC_CDECL reset_shell_mode(void)
|
||||
#else
|
||||
int PDC_CDECL reset_shell_mode()
|
||||
int PDC_CDECL reset_shell_mode()
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
#if defined(OS2) && !defined(EMXVIDEO)
|
||||
extern VIOMODEINFO modeInfo;
|
||||
VIOMODEINFO modeInfo;
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("reset_shell_mode() - called\n");
|
||||
if (trace_on) PDC_debug("reset_shell_mode() - called\n");
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef WIN32
|
||||
if (c_sh_tty.been_set == TRUE)
|
||||
{
|
||||
if (c_sh_tty.been_set == TRUE)
|
||||
{
|
||||
memcpy(SP, &c_sh_tty.saved, sizeof(SCREEN));
|
||||
|
||||
memcpy(SP, &c_sh_tty.saved, sizeof(SCREEN));
|
||||
|
||||
mvcur(0, 0, c_sh_tty.saved.cursrow, c_sh_tty.saved.curscol);
|
||||
if (PDC_get_ctrl_break() != c_sh_tty.saved.orgcbr)
|
||||
PDC_set_ctrl_break(c_sh_tty.saved.orgcbr);
|
||||
if (c_sh_tty.saved.raw_out)
|
||||
raw();
|
||||
if (c_sh_tty.saved.visible_cursor)
|
||||
PDC_cursor_on();
|
||||
SP->font = PDC_get_font();
|
||||
PDC_set_font(c_sh_tty.saved.font);
|
||||
mvcur(0, 0, c_sh_tty.saved.cursrow, c_sh_tty.saved.curscol);
|
||||
if (PDC_get_ctrl_break() != c_sh_tty.saved.orgcbr)
|
||||
PDC_set_ctrl_break(c_sh_tty.saved.orgcbr);
|
||||
if (c_sh_tty.saved.raw_out)
|
||||
raw();
|
||||
if (c_sh_tty.saved.visible_cursor)
|
||||
PDC_cursor_on();
|
||||
SP->font = PDC_get_font();
|
||||
PDC_set_font(c_sh_tty.saved.font);
|
||||
#if !defined (XCURSES)
|
||||
# if !defined(EMXVIDEO)
|
||||
# if defined(OS2)
|
||||
(void)PDC_get_scrn_mode();
|
||||
if (!PDC_scrn_modes_equal (modeInfo, c_sh_tty.saved.scrnmode))
|
||||
PDC_set_scrn_mode(c_sh_tty.saved.scrnmode);
|
||||
# else
|
||||
if (!PDC_scrn_modes_equal (PDC_get_scrn_mode(), c_sh_tty.saved.scrnmode))
|
||||
PDC_set_scrn_mode(c_sh_tty.saved.scrnmode);
|
||||
# endif
|
||||
# if !defined(EMXVIDEO)
|
||||
# if defined(OS2)
|
||||
(void)PDC_get_scrn_mode( &modeInfo );
|
||||
if ( !PDC_scrn_modes_equal( modeInfo, c_sh_tty.saved.scrnmode ) )
|
||||
PDC_set_scrn_mode( c_sh_tty.saved.scrnmode );
|
||||
# else
|
||||
if ( !PDC_scrn_modes_equal( PDC_get_scrn_mode(), c_sh_tty.saved.scrnmode ) )
|
||||
PDC_set_scrn_mode( c_sh_tty.saved.scrnmode );
|
||||
# endif
|
||||
# endif
|
||||
#endif
|
||||
#if defined(OS2) || defined(WIN32)
|
||||
PDC_resize_screen(c_sh_tty.saved.lines,c_sh_tty.saved.cols);
|
||||
PDC_resize_screen(c_sh_tty.saved.lines,c_sh_tty.saved.cols);
|
||||
#else
|
||||
PDC_set_rows(c_sh_tty.saved.lines);
|
||||
PDC_set_rows(c_sh_tty.saved.lines);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef FLEXOS
|
||||
_flexos_8bitmode();
|
||||
#ifdef FLEXOS
|
||||
_flexos_8bitmode();
|
||||
#endif
|
||||
|
||||
#ifdef WIN32
|
||||
PDC_reset_shell_mode();
|
||||
#if defined(WIN32) || (defined(OS2) && !defined(EMXVIDEO))
|
||||
PDC_reset_shell_mode();
|
||||
#endif
|
||||
|
||||
return( OK );
|
||||
return( OK );
|
||||
}
|
||||
#endif
|
||||
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_CDECL resetty(void)
|
||||
int PDC_CDECL resetty(void)
|
||||
#else
|
||||
int PDC_CDECL resetty()
|
||||
int PDC_CDECL resetty()
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
#if defined(OS2) && !defined(EMXVIDEO)
|
||||
extern VIOMODEINFO modeInfo;
|
||||
VIOMODEINFO modeInfo;
|
||||
#endif
|
||||
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("resetty() - called\n");
|
||||
if (trace_on) PDC_debug("resetty() - called\n");
|
||||
#endif
|
||||
|
||||
#ifndef UNIX
|
||||
if (c_save_tty.been_set == TRUE)
|
||||
{
|
||||
memcpy(SP, &c_save_tty.saved, sizeof(SCREEN));
|
||||
|
||||
mvcur(0, 0, c_save_tty.saved.cursrow, c_save_tty.saved.curscol);
|
||||
if (PDC_get_ctrl_break() != c_save_tty.saved.orgcbr)
|
||||
PDC_set_ctrl_break(c_save_tty.saved.orgcbr);
|
||||
if (c_save_tty.saved.raw_out)
|
||||
raw();
|
||||
if (c_save_tty.saved.visible_cursor)
|
||||
PDC_cursor_on();
|
||||
SP->font = PDC_get_font();
|
||||
PDC_set_font(c_save_tty.saved.font);
|
||||
#if !defined (XCURSES)
|
||||
if (c_save_tty.been_set == TRUE)
|
||||
{
|
||||
memcpy(SP, &c_save_tty.saved, sizeof(SCREEN));
|
||||
mvcur(0, 0, c_save_tty.saved.cursrow, c_save_tty.saved.curscol);
|
||||
if (PDC_get_ctrl_break() != c_save_tty.saved.orgcbr)
|
||||
PDC_set_ctrl_break(c_save_tty.saved.orgcbr);
|
||||
if (c_save_tty.saved.raw_out)
|
||||
raw();
|
||||
if (c_save_tty.saved.visible_cursor)
|
||||
PDC_cursor_on();
|
||||
SP->font = PDC_get_font();
|
||||
PDC_set_font(c_save_tty.saved.font);
|
||||
# if !defined (XCURSES)
|
||||
# if !defined(EMXVIDEO)
|
||||
# if defined(OS2)
|
||||
(void)PDC_get_scrn_mode();
|
||||
if (!PDC_scrn_modes_equal (modeInfo, c_save_tty.saved.scrnmode))
|
||||
PDC_set_scrn_mode(c_save_tty.saved.scrnmode);
|
||||
# else
|
||||
if (!PDC_scrn_modes_equal (PDC_get_scrn_mode(), c_save_tty.saved.scrnmode))
|
||||
PDC_set_scrn_mode(c_save_tty.saved.scrnmode);
|
||||
# endif
|
||||
# if defined(OS2)
|
||||
(void)PDC_get_scrn_mode( &modeInfo );
|
||||
if ( !PDC_scrn_modes_equal( modeInfo, c_save_tty.saved.scrnmode ) )
|
||||
PDC_set_scrn_mode( c_save_tty.saved.scrnmode );
|
||||
# else
|
||||
if ( !PDC_scrn_modes_equal( PDC_get_scrn_mode(), c_save_tty.saved.scrnmode ) )
|
||||
PDC_set_scrn_mode( c_save_tty.saved.scrnmode );
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# if defined(OS2)
|
||||
PDC_resize_screen(c_save_tty.saved.lines,c_save_tty.saved.cols);
|
||||
# else
|
||||
PDC_set_rows(c_save_tty.saved.lines);
|
||||
# endif
|
||||
}
|
||||
#endif
|
||||
#if defined(OS2)
|
||||
PDC_resize_screen(c_save_tty.saved.lines,c_save_tty.saved.cols);
|
||||
#else
|
||||
PDC_set_rows(c_save_tty.saved.lines);
|
||||
#endif
|
||||
}
|
||||
#endif
|
||||
return( c_save_tty.been_set ? OK : ERR );
|
||||
return( c_save_tty.been_set ? OK : ERR );
|
||||
}
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_CDECL savetty(void)
|
||||
int PDC_CDECL savetty(void)
|
||||
#else
|
||||
int PDC_CDECL savetty()
|
||||
int PDC_CDECL savetty()
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("savetty() - called\n");
|
||||
if (trace_on) PDC_debug("savetty() - called\n");
|
||||
#endif
|
||||
|
||||
c_save_tty.been_set = TRUE;
|
||||
memcpy(&c_save_tty.saved, SP, sizeof(SCREEN));
|
||||
return( OK );
|
||||
c_save_tty.been_set = TRUE;
|
||||
memcpy(&c_save_tty.saved, SP, sizeof(SCREEN));
|
||||
return( OK );
|
||||
}
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_CDECL getsyx(int *y, int *x)
|
||||
int PDC_CDECL getsyx(int *y, int *x)
|
||||
#else
|
||||
int PDC_CDECL getsyx(y,x)
|
||||
int PDC_CDECL getsyx(y,x)
|
||||
int *y,*x;
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("getsyx() - called\n");
|
||||
if (trace_on) PDC_debug("getsyx() - called\n");
|
||||
#endif
|
||||
|
||||
if (curscr->_leaveit)
|
||||
*y = *x = (-1);
|
||||
else
|
||||
{
|
||||
*y = curscr->_cury - SP->linesrippedoffontop;
|
||||
*x = curscr->_curx;
|
||||
}
|
||||
return( OK );
|
||||
if (curscr->_leaveit)
|
||||
*y = *x = (-1);
|
||||
else
|
||||
{
|
||||
*y = curscr->_cury - SP->linesrippedoffontop;
|
||||
*x = curscr->_curx;
|
||||
}
|
||||
return( OK );
|
||||
}
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_CDECL setsyx(int y, int x)
|
||||
int PDC_CDECL setsyx(int y, int x)
|
||||
#else
|
||||
int PDC_CDECL setsyx(y,x)
|
||||
int PDC_CDECL setsyx(y,x)
|
||||
int y,x;
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("setsyx() - called\n");
|
||||
if (trace_on) PDC_debug("setsyx() - called\n");
|
||||
#endif
|
||||
|
||||
if (y < 0 && x < 0)
|
||||
curscr->_leaveit = TRUE;
|
||||
else
|
||||
{
|
||||
curscr->_cury = y + SP->linesrippedoffontop;
|
||||
curscr->_curx = x;
|
||||
curscr->_leaveit = FALSE;
|
||||
}
|
||||
return( OK );
|
||||
if (y < 0 && x < 0)
|
||||
curscr->_leaveit = TRUE;
|
||||
else
|
||||
{
|
||||
curscr->_cury = y + SP->linesrippedoffontop;
|
||||
curscr->_curx = x;
|
||||
curscr->_leaveit = FALSE;
|
||||
}
|
||||
return( OK );
|
||||
}
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_CDECL curs_set(int visibility)
|
||||
int PDC_CDECL curs_set(int visibility)
|
||||
#else
|
||||
int PDC_CDECL curs_set(visibility)
|
||||
int PDC_CDECL curs_set(visibility)
|
||||
int visibility;
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("curs_set() - called: visibility=%d\n",visibility);
|
||||
if (trace_on) PDC_debug("curs_set() - called: visibility=%d\n",visibility);
|
||||
#endif
|
||||
|
||||
return(PDC_curs_set(visibility));
|
||||
return(PDC_curs_set(visibility));
|
||||
}
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_CDECL ripoffline(int line, int (*init)(WINDOW *,int))
|
||||
int PDC_CDECL ripoffline(int line, int (*init)(WINDOW *,int))
|
||||
#else
|
||||
int PDC_CDECL ripoffline(line, init)
|
||||
int PDC_CDECL ripoffline(line, init)
|
||||
int line;
|
||||
int (*init)();
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("ripoffline() - called: line=%d\n",line);
|
||||
if (trace_on) PDC_debug("ripoffline() - called: line=%d\n",line);
|
||||
#endif
|
||||
|
||||
if (linesrippedoff < 5
|
||||
&& line != 0)
|
||||
{
|
||||
linesripped[(int)linesrippedoff].line = line;
|
||||
linesripped[(int)linesrippedoff++].init = init;
|
||||
}
|
||||
return(OK);
|
||||
if (linesrippedoff < 5
|
||||
&& line != 0)
|
||||
{
|
||||
linesripped[(int)linesrippedoff].line = line;
|
||||
linesripped[(int)linesrippedoff++].init = init;
|
||||
}
|
||||
return(OK);
|
||||
}
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_CDECL napms(int ms)
|
||||
int PDC_CDECL napms(int ms)
|
||||
#else
|
||||
int PDC_CDECL napms(ms)
|
||||
int PDC_CDECL napms(ms)
|
||||
int ms;
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("napms() - called: ms=%d\n",ms);
|
||||
if (trace_on) PDC_debug("napms() - called: ms=%d\n",ms);
|
||||
#endif
|
||||
return(delay_output(ms));
|
||||
return(delay_output(ms));
|
||||
}
|
||||
/***********************************************************************/
|
||||
#ifdef HAVE_PROTO
|
||||
int PDC_CDECL draino(int ms)
|
||||
int PDC_CDECL draino(int ms)
|
||||
#else
|
||||
int PDC_CDECL draino(ms)
|
||||
int PDC_CDECL draino(ms)
|
||||
int ms;
|
||||
#endif
|
||||
/***********************************************************************/
|
||||
{
|
||||
#ifdef PDCDEBUG
|
||||
if (trace_on) PDC_debug("draino() - called: ms=%d\n",ms);
|
||||
if (trace_on) PDC_debug("draino() - called: ms=%d\n",ms);
|
||||
#endif
|
||||
return(delay_output(ms));
|
||||
return(delay_output(ms));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user