From d2c13fcb3c3d69d39b5cd97c294225e14fa860e5 Mon Sep 17 00:00:00 2001 From: William McBrine Date: Tue, 3 Jan 2006 19:36:45 +0000 Subject: [PATCH] Drop the pretense of supporting FlexOS. --- flexos/README | 19 - flexos/fo_16bit.c | 74 -- flexos/fo_8bit.c | 69 -- flexos/fo_gname.c | 62 -- flexos/pdcdisp.c | 1881 --------------------------------------------- flexos/pdcgetsc.c | 1244 ------------------------------ flexos/pdckbd.c | 955 ----------------------- flexos/pdcprint.c | 116 --- flexos/pdcscrn.c | 376 --------- flexos/pdcsetsc.c | 696 ----------------- 10 files changed, 5492 deletions(-) delete mode 100644 flexos/README delete mode 100644 flexos/fo_16bit.c delete mode 100644 flexos/fo_8bit.c delete mode 100644 flexos/fo_gname.c delete mode 100644 flexos/pdcdisp.c delete mode 100644 flexos/pdcgetsc.c delete mode 100644 flexos/pdckbd.c delete mode 100644 flexos/pdcprint.c delete mode 100644 flexos/pdcscrn.c delete mode 100644 flexos/pdcsetsc.c diff --git a/flexos/README b/flexos/README deleted file mode 100644 index 8a6c74ac..00000000 --- a/flexos/README +++ /dev/null @@ -1,19 +0,0 @@ - - Welcome to PDCurses - - Contents - -------- - This directory contains core PDCurses source code files specific to - the FlexOS platform. - - - Distribution Status - ------------------- - - The files in this directory are released to the Public Domain. - - - Acknowlegements - --------------- - - Generic FlexOS port was provided by Frotz (????) diff --git a/flexos/fo_16bit.c b/flexos/fo_16bit.c deleted file mode 100644 index 0d070391..00000000 --- a/flexos/fo_16bit.c +++ /dev/null @@ -1,74 +0,0 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_fo_16bit = "$Id: fo_16bit.c,v 1.1 2001/01/10 08:31:02 mark Exp $"; -#endif - - - - -#ifdef FLEXOS -/*man-start********************************************************************* - - _flexos_16bitmode() - Puts console 16 bit mode. - - PDCurses Description: - This routine sets 16 bit mode (8 bit character + - 8 bit attribute) for Flexos. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - Under FLEXOS, an ERR will be returned if the s_get() call - fails, or if the s_set() call fails. You are referred to - the Flexos Programmer's Reference Guide for details on the - actual error. - - Portability: - PDCurses int _flexos_16bitmode( void ); - -**man-end**********************************************************************/ - -int _flexos_16bitmode(void) -{ -extern VIRCON vir; /* Allocate a Virtual Console Structure */ - - retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir)); - if (retcode < 0L) - return( ERR ); - - vir.vc_kbmode = vir.vc_kbmode | (VCKM_NABORT | VCKM_NSTOP | - VCKM_NXLAT | VCKM_NESC | - VCKM_16BIT | VCKM_NECHO | - VCKM_NEOF); - - vir.vc_smode = vir.vc_smode | VCSM_16BIT; - - retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir)); - return( (retcode < 0L) ? ERR : OK ); -} -#endif diff --git a/flexos/fo_8bit.c b/flexos/fo_8bit.c deleted file mode 100644 index d3cd599b..00000000 --- a/flexos/fo_8bit.c +++ /dev/null @@ -1,69 +0,0 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_fo_8bit = "$Id: fo_8bit.c,v 1.1 2001/01/10 08:31:03 mark Exp $"; -#endif - - - - -#ifdef FLEXOS -/*man-start********************************************************************* - - _flexos_8bitmode() - Puts console into 8 bit mode. - - PDCurses Description: - This routine sets 8 bit mode (no 8 bit attribute) for Flexos. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - Under FLEXOS, an ERR will be returned if the s_get() call - fails, or if the s_set() call fails. You are referred to - the Flexos Programmer's Reference Guide for details on the - actual error. - - Portability: - PDCurses int _flexos_16bitmode( void ); - -**man-end**********************************************************************/ - -int _flexos_8bitmode(void) -{ -extern VIRCON vir; /* Allocate a Virtual Console Structure */ - - retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir)); - if (retcode < 0L) - return( ERR ); - - vir.vc_kbmode = vir.vc_kbmode & ~VCKM_16BIT; - vir.vc_smode = vir.vc_smode & ~VCKM_16BIT; - - retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir)); - return( (retcode < 0L) ? ERR : OK ); -} -#endif diff --git a/flexos/fo_gname.c b/flexos/fo_gname.c deleted file mode 100644 index 9ded00f5..00000000 --- a/flexos/fo_gname.c +++ /dev/null @@ -1,62 +0,0 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_fo_gname = "$Id: fo_gname.c,v 1.1 2001/01/10 08:31:04 mark Exp $"; -#endif - - - - -#ifdef FLEXOS -VIRCON vir; /* Allocate a Virtual Console Structure */ - -/*man-start********************************************************************* - - _flexos_gname() - FLEXOS: Return virtual console name - - PDCurses Description: - This is a Flexos platform PDCurses function. - - This routine returns the name of the Flexos virtual console. - The VIRCON vir structure is initialized within the initscr() - calltree. - - PDCurses Return Value: - This routine returns a character pointer. - - PDCurses Errors: - No errors are defined for this routine. - - Portability: - PDCurses char* _flexos_gname( void ); - -**man-end**********************************************************************/ - -char* _flexos_gname(void) -{ - return (&vir.vc_wname[0]); -} -#endif diff --git a/flexos/pdcdisp.c b/flexos/pdcdisp.c deleted file mode 100644 index 8aec6114..00000000 --- a/flexos/pdcdisp.c +++ /dev/null @@ -1,1881 +0,0 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#include - -#ifdef HAVE_MEMORY_H -# include -#endif - -#ifdef UNIX -# include -# include -#endif - -#ifndef HAVE_MEMMOVE -# define memmove PDC_memmove -#endif - -#ifdef PDCDEBUG -char *rcsid_PDCdisp = "$Id: pdcdisp.c,v 1.1 2001/01/10 08:31:06 mark Exp $"; -#endif - -/*man-start********************************************************************* - - PDC_backchar() - Visually erase character in window - - PDCurses Description: - This is a private PDCurses function - - This routine will visually erase a character. It is called by - the PDCurses character I/O routines. - - PDCurses Return Value: - This routine will return OK upon success and otherwise ERR will be - returned. - - PDCurses Errors: - It is an error to pass a NULL WINDOW pointer. - - Portability: - PDCurses int PDC_backchar( WINDOW* w, char* ch, int* len ); - -**man-end**********************************************************************/ - -#ifdef THESE_FUNCTIONS_ARENT_USED -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_backchar(WINDOW *w, char *ch, int *len) -#else -int PDC_backchar(w,ch,len) -WINDOW *w; -char *ch; -int *len; -#endif -/***********************************************************************/ -{ - int nbs = 0; - int x = w->_curx; - int ts = w->_tabsize; - chtype s = (w->_y[w->_cury][x - 1] & CHR_MSK); - char* p = c_strbeg; - bool save_raw_out = SP->raw_out; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_backchar() - called\n"); -#endif - - if (w == (WINDOW *)NULL) - return( ERR ); - - (*len)--; /* Now we are zero relative */ - (*len)--; /* Now we are looking at the previous - * character */ - if( *len >= 0 ) { - nbs++; - /* - * Determine number of characters to erase... - */ - if ((ch[*len] < ' ') || (s == 0x7f)) /* ctrl-char has size 2 */ - { - nbs++; - (*len)--; - } - - if( *len >= 0 ) - if (ch[*len] == '\t') /* tabs are very special */ - { - for (; p < ch; p++) - { - if (*p == '\t') - x = ((x / ts) + 1) * ts; - else - { - if ((*p < ' ') || (*p == 0x7f)) - x += 2; - else - x++; - } - if (x >= w->_maxx) /* go to next line? */ - x = 0; - } - if (!(w->_curx)) - nbs = w->_maxx - x; - else - nbs = w->_curx - x; - } - } - if( *len < 0 ) - { - beep(); - *len = 0; - } - /* - * Erase the characters and update... - */ - SP->raw_out = FALSE; /* ensure backspace handled in xlat mode */ - while ( nbs-- > 0 ) - { - if (w->_curx > 0) - { -/* waddstr(w, "\b \b");*/ - mvwaddch(w, w->_cury, w->_curx-1, ' '); - wmove(w, w->_cury, w->_curx-1); - } - else - if (w->_cury) - { - mvwaddch(w, w->_cury - 1, w->_maxx - 1, ' '); - wmove(w, w->_cury - 1, w->_maxx - 1); - } - } - ch[*len] = '\0'; - SP->raw_out = save_raw_out; - wrefresh(w); - return( OK ); -} - -/*man-start********************************************************************* - - PDC_chg_attr_pair() - Writes character and attribute to physical screen - - PDCurses Description: - This is a private PDCurses function. - - Writes a single character 'chr' with attribute 'attr' to the - current cursor location. - - NOTE: Though passed as 16 bit quantities, only the lower 8 bits - will be used to create a character/attribute pair. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function under DOS. - - An ERR may be returned under FLEXOS if s_copy() fails. See the - Flexos Programmer's Reference Manual for details on the error. - - Portability: - PDCurses int PDC_chg_attr_pair( chtype chr, chtype attr ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_chg_attr_pair(chtype chr, chtype attr) -#else -int PDC_chg_attr_pair(chr,attr) -chtype chr; -chtype attr; -#endif -/***********************************************************************/ -{ - extern unsigned char atrtab[MAX_ATRTAB]; - int phys_attr=chtype_attr(attr); - -#ifdef OS2 -# ifdef EMXVIDEO - int curCol, curRow,cell; -# else - USHORT curCol, curRow, cell; -# endif -#endif - -#ifdef FLEXOS - UBYTE c = (UBYTE) chr; - UBYTE a = (UBYTE) phys_attr; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_chg_attr_pair() - called\n"); -#endif - -#ifdef FLEXOS - drect.r_row = PDC_get_cur_row(); - drect.r_col = PDC_get_cur_col(); - drect.r_nrow = 1; - drect.r_ncol = 1; - - sframe.fr_pl[0] = (UBYTE *) & c; - sframe.fr_pl[1] = (UBYTE *) & a; - sframe.fr_pl[2] = (UBYTE *) " "; - sframe.fr_nrow = 1; - sframe.fr_ncol = 1; - sframe.fr_use = 0x00; - - srect.r_col = 0; - srect.r_row = 0; - srect.r_nrow = 1; - srect.r_ncol = 1; - - retcode = s_copy(0x03, 0x01L, 0L, (far unsigned short *) &drect, (far unsigned short *) &sframe, (far unsigned short *) &srect); - return( (retcode < 0L) ? ERR : OK ); -#endif - -#ifdef DOS - regs.h.ah = 0x09; - regs.h.al = chr & A_CHARTEXT; - regs.h.bh = SP->video_page; - regs.h.bl = (char)(phys_attr >> 8); -# ifdef WATCOMC - regs.w.cx = 0x01; -# else - regs.x.cx = 0x01; -# endif - int86(0x10, ®s, ®s); - return( OK ); -#endif - -#ifdef OS2 - /* find the current cursor position */ -# ifdef EMXVIDEO - cell = (int)((chr & A_CHARTEXT) | phys_attr); - v_getxy (&curCol, &curRow); - v_putline ((char*)&cell, curCol, curRow, 1); -# else - cell = (USHORT)((chr & A_CHARTEXT) | phys_attr); - VioGetCurPos((PUSHORT) &curRow, (PUSHORT) &curCol, 0); - VioWrtNCell((PBYTE)&cell,1,curRow,curCol,0); -# endif - return( OK ); -#endif - -#ifdef UNIX -/* INCOMPLETE - check attribute and output attr and/or color */ - putchar(chr & A_CHARTEXT); - return(OK); -#endif -} -#endif - -/*man-start********************************************************************* - - PDC_chadd() - Low level; Put a character to a window - - PDCurses Description: - This is a private PDCurses function. - - This routine will insert the character 'c' at the current cursor - position in the passed window. - - If 'xlat' is TRUE, PDC_chadd() will handle things in a cooked - manner (tabs, newlines, carriage returns, etc). If 'xlat' is - FALSE, the characters are simply output directly. - - If 'advance' is TRUE, PDC_chadd() will move the current cusor position - appropriately. The *addch functions call PDC_chadd() with advance TRUE, - while the *insch functions call PDC_chadd() with advance FALSE. - - The normal curses routines (non-raw-output-mode) call PDC_chadd() - with 'xlat' TRUE. - - If an alternate character is to be displayed, the character is - displayed without translation (minus the A_ALTCHARSET of course). - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - It is an error to call this function with a NULL window pointer. - - Portability: - PDCurses int PDC_chadd( WINDOW* win, chtype ch, bool xlat, bool advance ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_chadd(register WINDOW *win, chtype ch,bool xlat, bool advance) -#else -int PDC_chadd(win,ch,xlat,advance) -register WINDOW *win; -chtype ch; -bool xlat; -bool advance; -#endif -/***********************************************************************/ -{ - int retval = ERR; - int x=0; - int y=0; - int newx=0; - chtype attr=0, bktmp=0; - int ts=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_chadd() - called: char=%c attr=0x%x xlat=%d advance=%d\n",ch & A_CHARTEXT,ch & A_ATTRIBUTES,xlat,advance); -#endif - - if (win == (WINDOW *)NULL) - return( retval ); - - x = win->_curx; - y = win->_cury; - ts = win->_tabsize; - -/* - Remove any A_ALTCHASET attribute from the ch before any further - testing. If the character has A_ALTCHARSET, set xlat to FALSE. - */ - if (ch & A_ALTCHARSET) - { - xlat = FALSE; - ch = ch & (~A_ALTCHARSET); - } -/* - if the incoming character doesn't have its own attribute - then use the current attributes for the window. - if the incoming character has attributes but not a colour - component, or the attributes to the current attributes - for the window. - if the incoming character has a colour component use the - attributes solely from the incoming character - */ - - if ((ch & A_ATTRIBUTES) == 0) - attr = win->_attrs; - else - if ((ch & A_COLOR) == 0) - attr = (ch & A_ATTRIBUTES) | win->_attrs; - else - attr = (ch & A_ATTRIBUTES); - - ch = (ch & A_CHARTEXT); - -/* wrs (4/10/93) */ -/* apply the same sort of logic for the window background, in that it only */ -/* takes precedence if other color attributes are not there and that */ -/* the background character will only print if the printing character is */ -/* blank. */ - - if ((attr & A_COLOR) == 0) - attr = (attr | (win->_bkgd & A_ATTRIBUTES)); - else { - bktmp = (win->_bkgd & A_COLOR); - attr = (attr | ( (win->_bkgd & A_ATTRIBUTES) ^ bktmp )); - } - - if ( ch == ' ' ) - ch = ((win->_bkgd & A_CHARTEXT)); - - - if ((y > win->_maxy) || - (x > win->_maxx) || - (y < 0) || - (x < 0)) - { - return( retval ); - } - - if (xlat) - { - switch (ch) { - case '\t': - for (newx = ((x / ts) + 1) * ts; x < newx; x++) - { - if (waddch(win, ' ') == ERR) - { - return( retval ); - } - /* - * if tab to next line - */ - if (win->_curx == 0) - { - /* - * exit the loop - */ - return( OK ); - } - } - return( OK ); - - case '\n': - if (SP->autocr && !(SP->raw_out)) - { - /* - * if lf -> crlf - */ - x = 0; - } - wclrtoeol( win ); - if ((y = PDC_newline(win, y)) < 0) - return( retval ); - if (advance) - { - win->_cury = y; - win->_curx = x; - } - return( OK ); - - case '\r': - if (advance) - win->_curx = x = 0; - return( OK ); - - case '\b': - if (--x < 0) - { - /* - * no back over left margin - */ - x = 0; - } - if (advance) - win->_curx = x; - return( OK ); - - case 0x7f: - if (waddch(win, '^') == ERR) - { - return( retval ); - } - retval = waddch(win, '?'); - return( retval ); - - default: - break; - } /* switch */ - - if (ch < ' ') - { - /* - * handle control chars - */ - if (waddch(win, '^') == ERR) - return( retval ); - - retval = (waddch(win, ch + '@')); - return( retval ); - } - } - - /* - * Add the attribute back into the character. - */ - ch |= attr; -/*********************************************************************/ -/* only change _firstch/_lastch if character to be added is different */ -/* to the character/attribute that is already in that position in the */ -/* window. */ -/* Removing this fixes display problems with different windows in the */ -/* same physical position. MH 20-03-93 */ -/* Restored again. MH 02-04-93 */ -/*********************************************************************/ - if (win->_y[y][x] != ch) - { - /* - * only if data change - */ - if (win->_firstch[y] == _NO_CHANGE) - { - win->_firstch[y] = win->_lastch[y] = x; - } - else - { - if (x < win->_firstch[y]) - { - win->_firstch[y] = x; - } - else - { - if (x > win->_lastch[y]) - { - win->_lastch[y] = x; - } - } - } - } - win->_y[y][x++] = ch; - if (x >= win->_maxx) - { - /* - * wrap around test - */ - x = 0; - if ((y = PDC_newline(win, y)) < 0) - return( retval ); - } - if (advance) - { - win->_curx = x; - win->_cury = y; - } - return( OK ); -} - -/*man-start********************************************************************* - - PDC_chg_attrs() - Change attributes in a rectangle - - PDCurses Description: - This routine will change the attribute(s) from a starting (y,x) - position to an ending (y,x) position to the specified attribute. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - It is an error to call this function with a NULL window pointer. - It is also an error to pass rectangular coordinates that lay - outside of window. - - Portability: - PDCurses int PDC_chg_attrs( WINDOW* w, chtype attr, - int sy, int sx, - int ey, int ex ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_chg_attrs(WINDOW *w, chtype attr, int sy, int sx, int ey, int ex) -#else -int PDC_chg_attrs(w,attr,sy,sx,ey,ex) -WINDOW *w; -chtype attr; -int sy; -int sx; -int ey; -int ex; -#endif -/***********************************************************************/ -{ - chtype oldattr = w->_attrs; - int c=0; - int l=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_chr_attrs() - called\n"); -#endif - - if (w == (WINDOW *)NULL) return( ERR ); - if (sy > w->_maxy) return( ERR ); - if (sx > w->_maxx) return( ERR ); - if (ey >= w->_maxy) ey = w->_maxy - 1; - if (ex >= w->_maxx) ex = w->_maxx - 1; - - wattrset(w, attr); - for (l = sy; l <= ey; l++) - { - for (c = sx; c <= ex; c++) - w->_y[l][c] = (w->_y[l][c] & A_CHARTEXT) | attr; - - if (w->_firstch[l] == _NO_CHANGE) - { - w->_firstch[l] = sx; - w->_lastch[l] = ex; - } - else - if (w->_firstch[l] != _NO_CHANGE) - { - if (sx < w->_firstch[l]) - w->_firstch[l] = sx; - if (ex > w->_lastch[l]) - w->_lastch[l] = ex; - } - } - w->_attrs = oldattr; - return( OK ); -} - -/*man-start********************************************************************* - - PDC_chins() - Low-level insert character in window - - PDCurses Description: - This is a private PDCurses routine. - - This routine provides the basic functionality for the X/Open - [mv][w]insch() routines. The xlat flag indicates that normal - character translation is performed or not. If not, then the - character is output as is. - - The 'xlat' flag is TRUE for the normal curses routines. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - It is an error to call this function with a NULL window pointer. - - Portability: - PDCurses int PDC_chins( WINDOW* win, chtype c, bool xlat ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_chins(WINDOW *win, chtype c, bool xlat) -#else -int PDC_chins(win,c,xlat) -WINDOW *win; -chtype c; -bool xlat; -#endif -/***********************************************************************/ -{ - int retval = ERR; - int x=0; - int y=0; - int maxx=0; - int offset=0; - chtype *temp1; - char ch = (c & A_CHARTEXT); - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_chins() - called\n"); -#endif - - if (win == (WINDOW *)NULL) - return( retval ); - - x = win->_curx; - y = win->_cury; - maxx = win->_maxx; - offset = 1; - temp1 = &win->_y[y][x]; - - if ((ch < ' ') && xlat) - { - offset++; - } - - memmove( temp1+offset, temp1, (maxx - x -offset) * sizeof(chtype) ); - - win->_lastch[y] = maxx-1; - - if ((win->_firstch[y] == _NO_CHANGE) || - (win->_firstch[y] > x)) - { - win->_firstch[y] = x; - } - /* - * PDC_chadd() fixes CTRL-chars too - */ - retval = (PDC_chadd(win, c, xlat,FALSE)); - return( retval ); -} - -/*man-start********************************************************************* - - PDC_clr_scrn() - Clears the physical screen and homes the cursor. - - PDCurses Description: - This is an internal routine called by the doupdate() routines. - - PDCurses Return Value: - This routine always returns OK. - - Portability: - PDCurses int PDC_clr_scrn( WINDOW* win ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_clr_scrn(WINDOW *win) -#else -int PDC_clr_scrn(win) -WINDOW *win; -#endif -/***********************************************************************/ -{ -#if defined(UNIX_WCLR) - chtype attrs = win->_attrs; -#else - chtype attrs = win->_bkgd; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_clr_scrn() - called\n"); -#endif - -#if defined(XCURSES) - XCursesInstruct(CURSES_CLEAR); -#else - PDC_scroll(0, 0, LINES - 1, COLS - 1, 0, attrs); - PDC_gotoxy(0, 0); -#endif - - return( OK ); -} -/*man-start********************************************************************* - - PDC_clr_update() - Updates the screen with a full redraw. - - PDCurses Description: - Updates the screen by clearing it and then redraw it in its - entirety. If SP->refrbrk is TRUE, and there is pending - input characters, the update will be prematurely terminated. - - PDCurses Return Value: - This routine returns ERR if it is unable to accomplish it's task. - This return value is ONLY under FLEXOS. - - The return value OK is returned if there were no errors. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_clr_update( WINDOW* s ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_clr_update(WINDOW *s) -#else -int PDC_clr_update(s) -WINDOW *s; -#endif -/***********************************************************************/ -{ -register int i=0,j=0; - WINDOW* w=NULL; -#if defined(UNIX) - chtype* ch; -#else - unsigned short* ch; -#endif - bool rc=FALSE; - -#if defined(DOS) -# if SMALL || MEDIUM -struct SREGS segregs; -int ds=0; -# endif -#endif - -#ifdef FLEXOS - char line[80]; - char attr[80]; - FFRAME sframe; - RECT drect, - srect; -#endif -#if defined(DOS) && defined(NDP) - int *VIDPOINT; -#endif - - extern unsigned char atrtab[MAX_ATRTAB]; - -/* the next two variables have been changed from chtype to unsigned short */ -/* as this is the correct datatype for a physical character/attribute */ - unsigned short temp_line[256]; /* this should be enough for the maximum width of a screen. MH-920715 */ - unsigned short chr; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_clr_update() - called\n"); -#endif - - w = curscr; - if (w == (WINDOW *)NULL) - return( ERR ); -/* if (SP->full_redraw) - PDC_clr_scrn(s); *//* clear physical screen */ - - s->_clear = FALSE; - for (i = 0; i < LINES; i++) /* update physical screen */ - { - if (s != w) /* copy s to curscr */ - memcpy(w->_y[i], s->_y[i], COLS * sizeof(chtype)); - - ch = temp_line; /* now have ch pointing to area to contain real attributes. MH-920715 */ - - -#if defined(DOS) || defined(OS2) -# if 0 - memcpy(ch,s->_y[i],COLS*sizeof(chtype)); /* copy current line to temp_line. MH-920715 */ - for (j=0;j_y[i][j] & A_CHARTEXT); - temp_line[j] = chtype_attr(s->_y[i][j]) | chr; - } -# endif -#endif - - if (SP->direct_video) - { -#ifdef FLEXOS - PDC_split_plane(w, &line[0], &attr[0], i, 0, i, COLS); -/* need to translate attr[] array to real attributes before displaying it. MH-920715 */ - drect.r_row = i; - drect.r_col = 0; - drect.r_nrow = 1; - drect.r_ncol = COLS; - - sframe.fr_pl[0] = (UBYTE *) line; - sframe.fr_pl[1] = (UBYTE *) attr; - sframe.fr_nrow = 1; - sframe.fr_ncol = COLS; - sframe.fr_use = 0x03; - - srect.r_col = 0; - srect.r_row = 0; - srect.r_nrow = 1; - srect.r_ncol = COLS; - - s_copy(0x03, 0x01L, 0L, (far unsigned short *) &drect, - (far unsigned short *) &sframe, - (far unsigned short *) &srect); -#endif - -#ifdef DOS -# ifdef GO32 - dosmemput (ch, COLS * sizeof(unsigned short), - (void *)_FAR_POINTER(SP->video_seg, - SP->video_ofs + (i * COLS * sizeof(unsigned short)))); -# else -# if (SMALL || MEDIUM) - segread(&segregs); - ds = segregs.ds; - movedata(ds, (int)ch, - SP->video_seg, - SP->video_ofs + (i*COLS*sizeof(unsigned short)), - (COLS * sizeof(unsigned short))); -# else -/* -# ifdef NDP - VIDPOINT = (int *) mapdev(MK_FP(SP->video_seg, - SP->video_ofs + (i * COLS * sizeof(unsigned short))), - (COLS * sizeof(unsigned short))); - memcpy(VIDPOINT, (int *) ch, (COLS * sizeof(unsigned short))); -*/ - memcpy((void *)_FAR_POINTER(SP->video_seg, - SP->video_ofs + (i * COLS * sizeof(unsigned short))), - ch, (COLS * sizeof(unsigned short))); -# endif -# endif -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - v_putline ((char *)ch, 0, i, COLS); -# else - VioWrtCellStr ((PCH)ch, (USHORT)(COLS * sizeof(unsigned short)), (USHORT)i, 0, 0); -# endif -#endif - } - else - { - -#ifdef UNIX - PDC_gotoxy(i, 0); - for (j = 0; j < COLS; j++) - { - PDC_putc( (*ch & A_CHARTEXT), (*ch & A_ATTRIBUTES) ); - ch++; - } -#endif - -#if defined(DOS) || defined(OS2) - for (j = 0; j < COLS; j++) - { - PDC_gotoxy(i, j); - PDC_putc( (*ch & A_CHARTEXT), (*ch & A_ATTRIBUTES) >> 8 ); - ch++; - } -#endif - -#if defined(XCURSES) - XCurses_transform_line(w->_y[i],i,0,COLS); -#endif - - } - - if (SP->refrbrk && (SP->cbreak || SP->raw_inp)) - { - rc = PDC_breakout(); - if(rc) - break; - } - w->_firstch[i] = _NO_CHANGE; - w->_lastch[i] = _NO_CHANGE; - } -#if 0 -#if defined(XCURSES) - XCurses_wait_for_display(); -#endif -#endif - return( OK ); -} - -/*man-start********************************************************************* - - PDC_cursor_on() - Turns on the hardware cursor. - - PDCurses Description: - Turns on the hardware curses, it does nothing if it is already on. - - PDCurses Return Value: - Returns OK upon success, ERR upon failure. - - Portability: - PDCurses int PDC_cursor_on( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_cursor_on(void) -#else -int PDC_cursor_on() -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_cursor_on() - called\n"); -#endif - -#ifndef UNIX - if (!SP->visible_cursor) - { - SP->visible_cursor = TRUE; -/* PDC_fix_cursor(SP->orig_emulation);*/ - if (SP->bogus_adapter) - { - PDC_set_cursor_mode((SP->cursor & 0xff00) >> 8, - (SP->cursor & 0x00ff)); - } - else - { -#ifdef OS2 - PDC_set_cursor_mode((SP->cursor & 0xff00) >> 8, - (SP->cursor & 0x00ff)); -#else - switch (SP->adapter) { - case _MDA: - case _CGA: - case _EGACOLOR: - case _EGAMONO: - case _VGACOLOR: - case _VGAMONO: - case _MDS_GENIUS: -/* PDC_set_cursor_mode(SP->font - 2, SP->font - 1);*/ - PDC_set_cursor_mode((SP->cursor & 0xff00) >> 8, - (SP->cursor & 0x00ff)); - break; - case _MCGACOLOR: - case _MCGAMONO: -/* PDC_set_cursor_mode(SP->font - 1, SP->font - 2);*/ - PDC_set_cursor_mode((SP->cursor & 0xff00) >> 8, - (SP->cursor & 0x00ff)); - break; - case _FLEXOS: - PDC_set_cursor_mode(SP->visible_cursor, 0); - break; - default: - break; - } -#endif - } - } -#endif - return( OK ); -} - -/*man-start********************************************************************* - - PDC_cursor_off() - Turns off the hardware cursor. - - PDCurses Description: - Turns off the hardware curses, it does nothing if it is already off. - - PDCurses Return Value: - Returns OK upon success, ERR upon failure. - - PDCurses Errors: - ERR will be returned (in the case of FLEXOS) if the hardware cursor - can not be disabled. - - Portability: - PDCurses int PDC_cursor_off( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_cursor_off(void) -#else -int PDC_cursor_off() -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_cursor_off() - called\n"); -#endif - -#ifndef UNIX - if (SP->visible_cursor) - { - SP->visible_cursor = FALSE; -#ifdef OS2 - PDC_set_cursor_mode(32, 33); /* turn it off */ -#else - switch (SP->adapter) - { - case _FLEXOS: - PDC_set_cursor_mode(SP->visible_cursor, 0); - break; - default: - PDC_set_cursor_mode(32, 33); /* turn it off */ - break; - } -#endif - } -#endif - return( OK ); -} - -/*man-start********************************************************************* - - PDC_fix_cursor() - Fix the cursor start and stop scan lines (if necessary) - - PDCurses Description: - This is a private PDCurses routine. - - This routine will fix the cursor shape for certain video adapters. - Normally, the values used are correct, but some adapters choke. - The most noticable choke is on a monochrome adapter. The "correct" - scan lines will result in the cursor being set in the middle of the - character cell, rather than at the bottom. - - The passed flag indicates whether the cursor is visible or not. - - This only applies to the DOS platform. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_fix_cursor( int flag ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_fix_cursor(int flag) -#else -int PDC_fix_cursor(flag) -int flag; -#endif -/***********************************************************************/ -{ -#ifdef DOS - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_fix_cursor() - called\n"); -#endif - -#ifdef FLEXOS - return( OK ); -#endif - - if (SP->bogus_adapter) - return( OK ); - - switch (SP->adapter) - { - case _EGACOLOR: - case _EGAMONO: - case _MDS_GENIUS: /* Some clones look like a Genius;-) */ - if (flag & 0x01) - setdosmembyte (0x487, getdosmembyte (0x487) | 0x01); /* Enable emulation */ - else - setdosmembyte (0x487, getdosmembyte (0x487) & ~0x01); /* Disable emulation */ - break; - - case _VGACOLOR: - case _VGAMONO: - if (flag & 0x01) -#ifdef WATCOMC - regs.w.ax = 0x1200; /* Enable emulation */ -#else - regs.x.ax = 0x1200; /* Enable emulation */ -#endif - else -#ifdef WATCOMC - regs.w.ax = 0x1201; /* Disable emulation */ -#else - regs.x.ax = 0x1201; /* Disable emulation */ -#endif - regs.h.bl = 0x34; - int86(0x10, ®s, ®s); - - break; - - case _MCGACOLOR: - case _MCGAMONO: - case _MDA: - case _CGA: - case _NONE: - default: - break; - } - return( OK ); -#endif - -#ifdef OS2 - return( OK ); -#endif - -#ifdef UNIX - return( OK ); -#endif -} -#ifdef UNIX -#include -#include -#endif - -/*man-start********************************************************************* - - PDC_gotoxy() - position hardware cursor at (x, y) - - PDCurses Description: - This is a private PDCurses routine. - - Moves the physical cursor to the desired address on the - screen. We don't optimize here -- on a PC, it takes more time - to optimize than to do things directly. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_gotoxy( int row, int col ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_gotoxy(int row, int col) -#else -int PDC_gotoxy(row,col) -int row; -int col; -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_gotoxy() - called: row %d col %d\n",row,col); -#endif - -#ifndef UNIX - if ((SP->cursrow == row) && (SP->curscol == col)) - return( OK ); -#endif - -#ifdef FLEXOS - retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir)); - if (retcode < 0L) - return( ERR ); - vir.vc_cursor.pos_row = row; - vir.vc_cursor.pos_col = col; - retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir)); - return( (retcode < 0L) ? ERR : OK ); -#endif - -#ifdef DOS - regs.h.ah = 0x02; - regs.h.bh = SP->video_page; - regs.h.dh = (unsigned char) row; - regs.h.dl = (unsigned char) col; - int86(0x10, ®s, ®s); - return( OK ); -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - v_gotoxy (col, row); -# else - VioSetCurPos (row, col, 0); -# endif - return(OK); -#endif - -#ifdef UNIX - if (cursor_address != NULL) - { - putp(tparm(cursor_address,row,col)); - } - return(OK); -#endif - -#if defined (XCURSES) - XCurses_display_cursor(SP->cursrow,SP->curscol,row,col); -#if 0 - XCurses_display_cursor(SP->cursrow,SP->curscol, - curscr->_y[SP->cursrow][SP->curscol], - row,col,curscr->_y[row][col]); -#endif - return(OK); -#endif -} - -/*man-start********************************************************************* - - PDC_newline() - Advances 1 newline from supplied line number. - - PDCurses Description: - This is a private PDCurses routine. - - Does line advance and returns the new cursor line. If error, - return -1. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_newline( WINDOW* win, int lin ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_newline(WINDOW *win, int lin) -#else -int PDC_newline(win,lin) -WINDOW *win; -int lin; -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_newline() - called: line %d\n",lin); -#endif - - if (win == (WINDOW *)NULL) - return( -1 ); - - if (++lin > win->_bmarg) - { - lin--; - if (win->_scroll) - { - scroll(win); - -/* wrs -- 7/11/93 ** it seems that System V Curses automatically refreshes - * a window when scrolling occurs via a newline. This - * could be a feature that isn't intended, but I'll - * implement it here as well for consistency. - */ - wrefresh(win); - } - else - return( -1 ); - } - return( lin ); -} - -/*man-start********************************************************************* - - PDC_putc() - Output a character in the current attribute. - - PDCurses Description: - This is a private PDCurses routine. - - Outputs character 'chr' to screen in tty fashion. If a colour - mode is active, the character is written with colour 'colour'. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_putc( chtype character, chtype color ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_putc( chtype character, chtype color ) -#else -int PDC_putc(character,color) -chtype character; -chtype color; -#endif -/***********************************************************************/ -{ -#ifdef OS2 - int curRow=0, curCol=0; -# ifdef EMXVIDEO - char Cell[2]; -# endif -#endif - -#ifdef UNIX -static chtype last_attribute=0; -# ifdef CHTYPE_LONG -static bool last_acs=FALSE; -# endif -static int curses_to_ansi[] = {0,4,2,6,1,5,3,7}; -short fore=0,back=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_putc() - called:char=%c attrib=0x%x color=0x%x\n",character & A_CHARTEXT,character & A_ATTRIBUTES,color); -#endif - -#ifdef FLEXOS - retcode = s_write(0x00, 0x01L, (_far char *) &character, 1L, 0); - return( (retcode < 0L) ? ERR : OK ); -#endif - -#ifdef DOS - regs.h.ah = 0x09; /* Avoid screen wrap. Don't advance cursor. */ - regs.h.al = (unsigned char) (character & A_CHARTEXT); - regs.h.bh = SP->video_page; - regs.h.bl = (unsigned char) (color); -#ifdef WATCOMC - regs.w.cx = 1; -#else - regs.x.cx = 1; -#endif - int86(0x10, ®s, ®s); - return( OK ); -#endif - -#ifdef OS2 - PDC_get_cursor_pos (&curRow, &curCol); -# ifdef EMXVIDEO - Cell[0] = (char)character; - Cell[1] = (char)color; - v_putline (Cell, curCol, curRow, 1); -# else - VioWrtTTY ((PCH)&character, 1, 0); - VioWrtNAttr ((PBYTE)&color, 1, (USHORT)curRow, (USHORT)curCol, 0); - PDC_gotoxy (curRow, curCol); -# endif - return( OK ); -#endif - -#ifdef UNIX - if (last_attribute != color) - { - if (exit_attribute_mode != NULL) - putp(exit_attribute_mode); - last_attribute = color; - if ((color & A_COLOR) && has_colors()) - { - pair_content(PAIR_NUMBER(color),&fore,&back); - putp(tparm(set_foreground,curses_to_ansi[fore])); - putp(tparm(set_background,curses_to_ansi[back])); - } - if (color & A_BOLD) - if (enter_bold_mode != NULL) - putp(enter_bold_mode); - if (color & A_BLINK) - if (enter_blink_mode != NULL) - putp(enter_blink_mode); - if (color & A_REVERSE) - if (enter_reverse_mode != NULL) - putp(enter_reverse_mode); -#ifdef CHTYPE_LONG - if (color & A_STANDOUT) - if (enter_standout_mode != NULL) - putp(enter_standout_mode); - if (color & A_ALTCHARSET) - { - if (last_acs == FALSE) - if (enter_alt_charset_mode != NULL) - putp(enter_alt_charset_mode); - last_acs = TRUE; - } - else - { - last_acs = FALSE; - if (exit_alt_charset_mode != NULL) - putp(exit_alt_charset_mode); - } -#endif - } - putchar(character & A_CHARTEXT); - return( OK ); -#endif -} - -/*man-start********************************************************************* - - PDC_putctty() - Output a character and attribute in TTY fashion. - - PDCurses Description: - This is a private PDCurses routine. - - Outputs character 'chr' to screen in tty fashion. If a colour - mode is active, the character is written with colour 'colour'. - - This function moves the physical cursor after writing so the - screen will scroll if necessary. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_putctty( chtype character, chtype color ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_putctty( chtype character, chtype color ) -#else -int PDC_putctty(character,color) -chtype character; -chtype color; -#endif -/***********************************************************************/ -{ -#ifdef OS2 - int curRow=0, curCol=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_putctty() - called\n"); -#endif - -#ifdef FLEXOS - retcode = s_write(0x00, 0x01L, (_far char *) &character, 1L, 0); - return( (retcode < 0L) ? ERR : OK ); -#endif - -#ifdef DOS - regs.h.ah = 0x0e; /* Write in TTY fashion, advance cursor. */ - regs.h.al = (unsigned char) (character & A_CHARTEXT); - regs.h.bh = SP->video_page; - regs.h.bl = (unsigned char) ((color & A_ATTRIBUTES) >> 8); - int86(0x10, ®s, ®s); - return( OK ); -#endif - -#ifdef OS2 - PDC_get_cursor_pos (&curRow, &curCol); -# ifdef EMXVIDEO - v_attrib (color); - v_putc (character); -# else - VioWrtTTY ((PCH)&character, 1, 0); - VioWrtNAttr ((PBYTE)&color, 1, (USHORT)curRow, (USHORT)curCol, 0); -# endif - return( OK ); -#endif - -#ifdef UNIX -/* INCOMPLETE */ - return( OK ); -#endif -} - -/*man-start********************************************************************* - - PDC_scroll() - low level screen scroll - - PDCurses Description: - Scrolls a window in the current page up or down. Urow, lcol, - lrow, rcol are the window coordinates. Lines is the number of - lines to scroll. If 0, clears the window, if < 0 scrolls down, - if > 0 scrolls up. Blanks areas that are left, and sets - character attributes to attr. If in a colour graphics mode, - fills them with the colour 'attr' instead. - - PDCurses Return Value: - The PDC_scroll() function returns OK on success otherwise ERR is returned. - - PDCurses Errors: - An error will only be returned on the Flexos platform if s_copy() - fails. - - Portability: - PDCurses int PDC_scroll( int urow, int lcol, int rcol, - int nlines, chtype attr ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_scroll(int urow, int lcol, int lrow, int rcol, int nlines, chtype attr) -#else -int PDC_scroll(urow,lcol,lrow,rcol,nlines,attr) -int urow; -int lcol; -int lrow; -int rcol; -int nlines; -chtype attr; -#endif -/***********************************************************************/ -{ - extern unsigned char atrtab[MAX_ATRTAB]; - int phys_attr=chtype_attr(attr); -#ifdef FLEXOS - int srow=0; - int scol=0; - int drow=0; - int dcol=0; - int nrows=0; - int ncols=0; - char blank = (char) SP->blank; -#endif - -#ifdef OS2 -# ifndef EMXVIDEO - USHORT ch=(phys_attr | SP->blank); -# endif -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_scroll() - called: urow %d lcol %d lrow %d rcol %d nlines %d\n",urow,lcol,lrow,rcol,nlines); -#endif - -#ifdef FLEXOS - if (nlines == 0) - { - sframe.fr_pl[0] = (UBYTE *) & blank; - sframe.fr_pl[1] = (UBYTE *) & attr; - sframe.fr_pl[2] = (UBYTE *) " "; - sframe.fr_nrow = 1; - sframe.fr_ncol = 1; - sframe.fr_use = 0x00; - nrows = lrow; - ncols = rcol; - srow = drow = 0; - scol = dcol = 0; - } - else - if (nlines < 0) - { - srow = urow; - scol = lcol; - drow = lrow; - dcol = rcol; - } - else - if (nlines > 0) - { - srow = urow; - scol = lcol; - drow = lrow; - dcol = lcol; - } - - drect.r_row = drow; - drect.r_col = dcol; - drect.r_nrow = nrows; - drect.r_ncol = ncols; - - srect.r_col = scol; - srect.r_row = srow; - srect.r_nrow = nrows; - srect.r_ncol = ncols; - - if (nlines != 0) - retcode = s_copy(0x03, 0x01L, 0L, (far unsigned short *) &drect, 0L, (far unsigned short *) &srect); - else - retcode = s_copy(0x03, 0x01L, 0L, (far unsigned short *) &drect, (far unsigned short *) &sframe, (far unsigned short *) &srect); - return( (retcode < 0L) ? ERR : OK ); -#endif - -#ifdef DOS - if (nlines >= 0) - { - regs.h.ah = 0x06; - regs.h.al = (unsigned char) nlines; - } - else - { - regs.h.ah = 0x07; - regs.h.al = (unsigned char) (-nlines); - } - regs.h.bh = (unsigned char)(phys_attr >> 8); - regs.h.ch = (unsigned char) urow; - regs.h.cl = (unsigned char) lcol; - regs.h.dh = (unsigned char) lrow; - regs.h.dl = (unsigned char) rcol; - int86(0x10, ®s, ®s); - return( OK ); -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - v_attrib (phys_attr); - if (nlines > 0) - v_scroll (lcol, urow, rcol, lrow, nlines, V_SCROLL_UP); - else - if (nlines < 0) - v_scroll (lcol, urow, rcol, lrow, -nlines, V_SCROLL_DOWN); - else /* this clears the whole screen */ - v_scroll (lcol, urow, rcol, lrow, -1, V_SCROLL_CLEAR); -# else - if (nlines > 0) - VioScrollUp(urow, lcol, lrow, rcol, nlines, (PBYTE)&ch, 0); - else - if (nlines < 0) - VioScrollDn(urow, lcol, lrow, rcol, nlines, (PBYTE)&ch, 0); - else -/* this clears the whole screen ?? */ - VioScrollUp(0, 0, -1, -1, -1, (PBYTE)&ch, 0); -# endif -#endif - -#ifdef UNIX -/* INCOMPLETE */ -#endif -} - -/*man-start********************************************************************* - - PDC_transform_line() - display a physical line of the screen - - PDCurses Description: - This is a private PDCurses function. - - Updates the given physical line to look like the corresponding - line in _curscr. - - PDCurses Return Value: - This routine returns TRUE if a premature refresh end - is allowed, and there is an input character pending. Otherwise, - FALSE is returned. - - PDCurses Errors: - No errors are defined for this routine. - - Portability: - PDCurses bool PDC_transform_line( int lineno ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -bool PDC_transform_line(register int lineno) -#else -bool PDC_transform_line(lineno) -register int lineno; -#endif -/***********************************************************************/ -{ -#if defined (MSC) && defined (DOS) -chtype* dstp=NULL; -chtype* srcp=NULL; -#else -register chtype* dstp=NULL; -register chtype* srcp=NULL; -#endif - -#ifdef DOS -#if SMALL || MEDIUM -struct SREGS segregs; -int ds=0; -#endif -#endif - - int x=0; - int endx=0; - int len=0; -#if defined(DOS) && defined(NDP) - int *VIDPOINT; -#endif - extern unsigned char atrtab[MAX_ATRTAB]; - -#if defined(DOS) || defined(OS2) - unsigned short temp_line[256]; /* this should be enough for the maximum width of a screen. MH-920715 */ - unsigned short chr=0; - unsigned short* ch=NULL; -#else - chtype temp_line[256]; /* this should be enough for the maximum width of a screen. MH-920715 */ - chtype chr=0; - chtype* ch=NULL; -#endif - - register int j=0; - bool rc=FALSE; - -#ifdef FLEXOS - char line[80]; - char attr[80]; - FFRAME sframe; - RECT drect; - RECT srect; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_transform_line() - called: line %d\n",lineno); -#endif - - if (curscr == (WINDOW *)NULL) - return( FALSE ); - - memset(temp_line,' ',sizeof(temp_line)); - - x = curscr->_firstch[lineno]; - endx = curscr->_lastch[lineno]; - dstp = curscr->_y[lineno] + x; - srcp = curscr->_y[lineno] + x; - len = endx-x+1; - - ch = temp_line; /* now have ch pointing to area to contain real attributes. MH-920715 */ - -/* replace the attribute part of the chtype with the actual colour value */ -/* replacing the number that points to the actual colour value. */ - -#if defined(DOS) || defined(OS2) -# if 0 - memcpy(ch, srcp, len * sizeof(chtype)); - for (j=0;jdirect_video) - { - -#if IS_THIS_REALLY_NEEDED - memcpy(dstp, srcp, len * sizeof(chtype)); -#endif - -#ifdef FLEXOS - _split_plane(curscr, &line[0], &attr[0], lineno, x, lineno, endx); - - drect.r_row = lineno; - drect.r_col = x; - drect.r_nrow = 1; - drect.r_ncol = len; - - sframe.fr_pl[0] = (UBYTE *) line; - sframe.fr_pl[1] = (UBYTE *) attr; - sframe.fr_nrow = 1; - sframe.fr_ncol = len; - sframe.fr_use = 0x03; - - srect.r_col = 0; - srect.r_row = 0; - srect.r_nrow = 1; - srect.r_ncol = len; - - s_copy(0x03, 0x01L, 0L, (far unsigned short *) &drect, - (far unsigned short *) &sframe, (far unsigned - short *) &srect); - -#endif - -#ifdef DOS -# ifdef GO32 - dosmemput (ch, len * sizeof(unsigned short), - (void *)_FAR_POINTER(SP->video_seg, - SP->video_ofs + (((lineno * curscr->_maxx) + x) * sizeof(unsigned short)))); -# else -# if SMALL || MEDIUM - segread(&segregs); - ds = segregs.ds; - movedata(ds,(int)ch, - SP->video_seg, - SP->video_ofs+(((lineno*curscr->_maxx)+x)*sizeof(unsigned short)), - len * sizeof(unsigned short)); -# else - memcpy((void *)_FAR_POINTER(SP->video_seg, - SP->video_ofs + (((lineno * curscr->_maxx) + x) * sizeof(unsigned short))), - ch, len * sizeof(unsigned short)); -# endif -# endif -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - v_putline ((char*)ch, x, lineno, len); -# else - VioWrtCellStr ((PCH)ch, (USHORT)(len*sizeof(unsigned short)), (USHORT)lineno, (USHORT)x, 0); -# endif -#endif - } - else - { - -#ifdef UNIX - PDC_gotoxy(lineno,x); - for (; x <= endx; x++) - { - PDC_putc( (*ch & A_CHARTEXT),(*ch & A_ATTRIBUTES) ); - ch++; - } -#endif - -#if defined(DOS) || defined(OS2) - for (; x <= endx; x++) - { - PDC_gotoxy(lineno, x); - PDC_putc( (*ch & A_CHARTEXT),(*ch & A_ATTRIBUTES) >> 8 ); - ch++; - } -#endif - -#if defined(XCURSES) - XCurses_transform_line(dstp,lineno,x,len); -#endif - - } - curscr->_firstch[lineno] = _NO_CHANGE; - curscr->_lastch[lineno] = _NO_CHANGE; - - if (SP->refrbrk && (SP->cbreak || SP->raw_inp)) - { - rc = PDC_breakout(); - if(rc) - return(TRUE); - } - return(FALSE); -} diff --git a/flexos/pdcgetsc.c b/flexos/pdcgetsc.c deleted file mode 100644 index 4e5247ff..00000000 --- a/flexos/pdcgetsc.c +++ /dev/null @@ -1,1244 +0,0 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef UNIX -#include -#include -#endif - -#ifdef PDCDEBUG -char *rcsid_PDCgetsc = "$Id: pdcgetsc.c,v 1.1 2001/01/10 08:31:07 mark Exp $"; -#endif - -#if defined( OS2 ) && !defined( EMXVIDEO ) - VIOCONFIGINFO configInfo={0}; - VIOMODEINFO modeInfo={0}; -#endif - -/*man-start********************************************************************* - - PDC_get_cursor_pos() - return current cursor position - - PDCurses Description: - 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. - - PDCurses Return Value: - This routine will return OK upon success and otherwise ERR will be - returned. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - 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 -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_cursor_pos() - called\n"); -#endif - -#ifdef FLEXOS - retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir)); - if (retcode < 0L) - return( ERR ); - *row = vir.vc_cursor.pos_row; - *col = vir.vc_cursor.pos_col; - return( OK ); -#endif - -#ifdef DOS - regs.h.ah = 0x03; - regs.h.bh = SP->video_page; - int86(0x10, ®s, ®s); - *row = regs.h.dh; - *col = regs.h.dl; - return( OK ); -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - v_getxy (col, row); -# else - VioGetCurPos((PUSHORT)row,(PUSHORT)col,0); -# endif - return( OK ); -#endif - -#ifdef UNIX -/* INCOMPLETE */ -#endif -} - -/*man-start********************************************************************* - - PDC_get_cur_col() - get current column position of cursor - - PDCurses Description: - This is a private PDCurses function - - 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. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - 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 -/***********************************************************************/ -{ -#ifdef OS2 -# ifdef EMXVIDEO - int curCol=0, curRow=0; -# else - USHORT curCol=0, curRow=0; -# endif -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_cur_col() - called\n"); -#endif - -#ifdef FLEXOS - retcode = s_get(T_VIRCON, 1L, (char *) &vir, (long) sizeof(vir)); - return( (retcode < 0L) ? ERR : vir.vc_cursor.pos_col ); -#endif - -#ifdef DOS -# ifdef WATCOMC - regs.w.ax = 0x0003; -# else - regs.x.ax = 0x0003; -# endif - regs.h.bh = SP->video_page; - int86(0x10, ®s, ®s); - return((int) regs.h.dl); -#endif - -#ifdef OS2 - /* find the current cursor position */ -# ifdef EMXVIDEO - v_getxy (&curCol, &curRow); -# else - VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0); -# endif - return (curCol); -#endif - -#ifdef UNIX -/* INCOMPLETE */ -#endif -} - -/*man-start********************************************************************* - - PDC_get_cur_row() - get current row position of cursor - - PDCurses Description: - This is a private PDCurses function - - 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. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - 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 -/***********************************************************************/ -{ -#ifdef OS2 -# ifdef EMXVIDEO - int curCol=0, curRow=0; -# else - USHORT curCol=0, curRow=0; -# endif -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_cur_row() - called\n"); -#endif - -#ifdef FLEXOS - retcode = s_get(T_VIRCON, 1L, (char *) &vir, (long) sizeof(vir)); - return( (retcode < 0L) ? ERR : vir.vc_cursor.pos_col ); -#endif - -#ifdef DOS -# ifdef WATCOMC - regs.w.ax = 0x0003; -# else - regs.x.ax = 0x0003; -# endif - regs.h.bh = SP->video_page; - int86(0x10, ®s, ®s); - return ((int) regs.h.dh); -#endif - -#ifdef OS2 - /* find the current cursor position */ -# ifdef EMXVIDEO - v_getxy (&curCol, &curRow); -# else - VioGetCurPos ((PUSHORT) &curRow, (PUSHORT) &curCol, 0); -# endif - return (curRow); -#endif - -#ifdef UNIX -/* INCOMPLETE */ -#endif -} - -/*man-start********************************************************************* - - PDC_get_attribute() - Get attribute at current cursor - - PDCurses Description: - This is a private PDCurses function - - 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. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - PDCurses int PDC_get_attribute( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_attribute(void) -#else -int PDC_get_attribute() -#endif -/***********************************************************************/ -{ -#ifdef OS2 -# ifndef EMXVIDEO - USHORT cellLen = 2; -# endif - int curRow=0, curCol=0; - char Cell[4]; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_attribute() - called\n"); -#endif - -#ifdef FLEXOS - /* Get and return current attribute. Force error until fixed. */ - return ((COLOR_CYAN) >> ((sizeof(ch type) / 2) * 8)); -#endif - -#ifdef DOS -# ifdef WATCOMC - regs.w.ax = 0x0800; -# else - regs.x.ax = 0x0800; -# endif - regs.h.bh = SP->video_page; - int86(0x10, ®s, ®s); - return ((int) regs.h.ah); -#endif - -#ifdef OS2 - PDC_get_cursor_pos(&curRow, &curCol); -# ifdef EMXVIDEO - v_getline (Cell, curCol, curRow, 1); -# else - VioReadCellStr((PCH)&Cell, (PUSHORT)&cellLen, (USHORT)curRow, (USHORT)curCol, 0); -# endif - return ((int) Cell[1]); -#endif - -#ifdef UNIX -/* INCOMPLETE */ -#endif -} - -/*man-start********************************************************************* - - PDC_get_columns() - return width of screen/viewport. - - PDCurses Description: - This is a private PDCurses function - - 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. - - PDCurses Errors: - There are no defined errors for this routine. - - Portability: - PDCurses int PDC_get_columns( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_columns(void) -#else -int PDC_get_columns() -#endif -/***********************************************************************/ -{ -#ifdef DOS - int cols=0; - char *env_cols=NULL; -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - int rows=0; -# else - VIOMODEINFO modeInfo={0}; -# endif - int cols=0; - char *env_cols=NULL; -#endif - - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_columns() - called\n"); -#endif - -#ifdef FLEXOS - return( vir.vc_size.rs_ncols ); -#endif - -#ifdef DOS -/* use the value from COLS environment variable, if set. MH 10-Jun-92 */ -/* and use the minimum of COLS and return from int10h MH 18-Jun-92 */ - regs.h.ah = 0x0f; - int86(0x10, ®s, ®s); - cols = (int)regs.h.ah; - 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); -#endif - return(cols); -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - v_dimen (&cols, &rows); -# else - 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); - } -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_columns() - returned: cols %d\n",cols); -#endif - return(cols); -#endif - -#ifdef UNIX -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_columns() - returned: cols %d\n",columns); -#endif - return(columns); -#endif - -#if defined(XCURSES) - return(XCurses_get_cols()); -#endif -} - -/*man-start********************************************************************* - - 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. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - 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 -/***********************************************************************/ -{ -#ifdef DOS - short cmode=0; -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - int curstart=0, curend=0; -# else - VIOCURSORINFO cursorInfo; -# endif - short cmode=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_cursor_mode() - called\n"); -#endif - -#ifdef FLEXOS - /* - * Under FLEXOS, this routine returns 1 if the cursor is on and 0 if - * the cursor is off... - */ - s_getfield(T_VIRCON, VC_MODE, STDOUT, (far BYTE *) & vir, - sizeof(vir.vc_mode)); - - if (vir.vc_mode & VCWM_CURSOR) - return (TRUE); - else - return (FALSE); -#endif - -#ifdef DOS - cmode = getdosmemword (0x460); - return (cmode); -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - v_getctype (&curstart, &curend); - cmode = ((curstart << 8) | (curend)); -# else - VioGetCurType (&cursorInfo, 0); -/* I am not sure about this JGB */ - cmode = ((cursorInfo.yStart << 8) | (cursorInfo.cEnd)); -# endif - return(cmode); -#endif - -#ifdef UNIX - return(0);/* this is N/A */ -#endif - -#if defined (XCURSES) - return(0);/* this is N/A */ -#endif -} - -/*man-start********************************************************************* - - PDC_get_font() - Get the current font size - - PDCurses Description: - This is a private PDCurses routine. - - 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. - - PDCurses Errors: - An ERR will be returned if FAST_VIDEO is not true. - - Portability: - PDCurses int PDC_get_font( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_font(void) -#else -int PDC_get_font() -#endif -/***********************************************************************/ -{ -#if defined (DOS) && defined (FAST_VIDEO) - int retval=0; -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - int retval=0; -# else - VIOMODEINFO modeInfo={0}; -# endif -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_font() - called\n"); -#endif - -#if defined (DOS) && defined (FAST_VIDEO) - retval = getdosmemword (0x485); - if ((retval == 0) && (SP->adapter == _MDS_GENIUS)) - { - retval = _FONT15; /* Assume the MDS Genius is in 66 line mode. */ - } - switch (SP->adapter) - { - case _MDA: - retval = 10; /* POINTS is not certain on MDA/Hercules */ - break; - case _EGACOLOR: - case _EGAMONO: - switch (retval) - { - case _FONT8: - case _FONT14: - break; - default: - retval = _FONT14; - } - break; - - case _VGACOLOR: - case _VGAMONO: - switch (retval) - { - case _FONT8: - case _FONT14: - case _FONT16: - break; - default: - break; - } - break; - default: - break; - } - return( retval ); -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - 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); -# endif -#endif - -#ifdef UNIX - return(0); /* this is N/A */ -#endif -} - -/*man-start********************************************************************* - - PDC_get_rows() - Return number of screen rows. - - PDCurses Description: - This is a private PDCurses routine. - - 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. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_rows( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_rows(void) -#else -int PDC_get_rows() -#endif -/***********************************************************************/ -{ -#ifdef DOS - char *env_rows=NULL; - int rows=0; -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - int cols=0; -# else - VIOMODEINFO modeInfo={0}; -# endif - int rows=0; - char *env_rows=NULL; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_rows() - called\n"); -#endif - -#ifdef FLEXOS - return (vir.vc_size.rs_nrows); -#endif - -#ifdef DOS -/* 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 */ - rows = getdosmembyte(0x484) + 1; - env_rows = (char *)getenv("LINES"); - if (env_rows != (char *)NULL) - rows = min(atoi(env_rows),rows); - - if ((rows == 1) && (SP->adapter == _MDS_GENIUS)) - rows = 66; - if ((rows == 1) && (SP->adapter == _MDA)) - rows = 25; /* new test MH 10-Jun-92 */ - if (rows == 1) - { - rows = _default_lines; /* Allow pre-setting LINES */ - SP->direct_video = FALSE; - } - switch (SP->adapter) - { - case _EGACOLOR: - case _EGAMONO: - switch (rows) - { - case 25: - case 43: - break; - default: - rows = 25; - } - break; - - case _VGACOLOR: - case _VGAMONO: -/* lets be reasonably flexible with VGAs - they could be Super VGAs */ -/* capable of displaying any number of lines. MH 10-Jun-92 */ -/* - switch (rows) - { - case 25: - case 28: - case 50: - break; - default: - rows = 25; - } -*/ - break; - - default: - rows = 25; - break; - } -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_rows() - returned: rows %d\n",rows); -#endif - return (rows); -#endif - -#ifdef OS2 -/* 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); -# else - 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); -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_rows() - returned: rows %d\n",rows); -#endif - return(rows); -#endif - -#ifdef UNIX -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_rows() - returned: rows %d\n",lines); -#endif - return(lines); -#endif - -#if defined(XCURSES) - return(XCurses_get_rows()); -#endif -} - -/*man-start********************************************************************* - - PDC_get_scrn_mode() - Return the current BIOS video mode - - PDCurses Description: - This is a private PDCurses routine. - - - PDCurses Return Value: - 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. - - Portability: - PDCurses int PDC_get_scrn_mode( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_scrn_mode(void) -#else -int PDC_get_scrn_mode() -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_scrn_mode() - called\n"); -#endif - -#ifdef FLEXOS - return( ERR ); -#endif - -#ifdef DOS - regs.h.ah = 0x0f; - int86(0x10, ®s, ®s); - return ((int) regs.h.al); -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - return(ERR); -# else - VioGetMode (&modeInfo, 0); - return(OK); -# endif -#endif - -#ifdef UNIX - return(ERR); /* this is N/A */ -#endif -} - -/*man-start********************************************************************* - - PDC_query_adapter_type() - Determine PC video adapter type - - PDCurses Description: - 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 - - PDCurses Return Value: - 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. - - Portability: - PDCurses int PDC_query_adapter_type( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_query_adapter_type(void) -#else -int PDC_query_adapter_type() -#endif -/***********************************************************************/ -{ - int retval = _NONE; - -#ifdef DOS - /* thanks to paganini@ax.apc.org for the GO32 fix */ -# if defined(GO32) && defined(NOW_WORKS) -# include - _go32_dpmi_registers dpmi_regs; -# endif - int equip; - struct SREGS segs; - short video_base = getdosmemword (0x463); -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_query_adapter_type() - called\n"); -#endif - -#ifdef FLEXOS - return (_FLEXOS); -#endif - -#ifdef DOS - /* - * Attempt to call VGA Identify Adapter Function... - */ - regs.h.ah = 0x1a; - regs.h.al = 0; - int86(0x10, ®s, ®s); - if ((regs.h.al == 0x1a) && (retval == _NONE)) - { - /* - * We know that the PS/2 video BIOS is alive and well. - */ - switch (regs.h.al) - { - case 0: - retval = _NONE; - break; - case 1: - retval = _MDA; - break; - case 2: - retval = _CGA; - break; - case 4: - retval = _EGACOLOR; - SP->sizeable = TRUE; - break; - case 5: - retval = _EGAMONO; - break; - case 26: - retval = _VGACOLOR; /* ...alt. VGA BIOS... */ - case 7: - retval = _VGACOLOR; - SP->sizeable = TRUE; - break; - case 8: - retval = _VGAMONO; - break; - case 10: - case 13: - retval = _MCGACOLOR; - break; - case 12: - retval = _MCGAMONO; - break; - default: - retval = _CGA; - break; - } - } - else - { - /* - * No VGA BIOS, check for an EGA BIOS by selecting an - * Alternate Function Service... - * - * bx == 0x0010 --> return EGA information - */ - regs.h.ah = 0x12; -# ifdef WATCOMC - regs.w.bx = 0x10; -# else - regs.x.bx = 0x10; -# endif - int86(0x10, ®s, ®s); - if ((regs.h.bl != 0x10) && (retval == _NONE)) - { - /* - * An EGA BIOS exists... - */ - regs.h.ah = 0x12; - regs.h.bl = 0x10; - int86(0x10, ®s, ®s); - if (regs.h.bh == 0) - retval = _EGACOLOR; - else - retval = _EGAMONO; - } - else - if (retval == _NONE) - { - /* - * Now we know we only have CGA or MDA... - */ - int86(0x11, ®s, ®s); - equip = (regs.h.al & 0x30) >> 4; - switch (equip) - { - case 1: - case 2: - retval = _CGA; - break; - case 3: - retval = _MDA; - break; - default: - retval = _NONE; - break; - } - } - } - if (video_base == 0x3d4) - { - SP->video_seg = 0xb800; - switch (retval) - { - case _EGAMONO: - retval = _EGACOLOR; - break; - case _VGAMONO: - retval = _VGACOLOR; - break; - default: - break; - } - } - if (video_base == 0x3b4) - { - SP->video_seg = 0xb000; - switch (retval) - { - case _EGACOLOR: - retval = _EGAMONO; - break; - case _VGACOLOR: - retval = _VGAMONO; - break; - default: - break; - } - } - if ((retval == _NONE) -#ifndef CGA_DIRECT - || (retval == _CGA) -#endif - ) - { - SP->direct_video = FALSE; - } - if ((unsigned int) SP->video_seg == 0xb000) - SP->mono = TRUE; - else - SP->mono = FALSE; - - /* Check for DESQview shadow buffer */ - /* thanks to paganini@ax.apc.org for the GO32 fix */ -#if defined(GO32) && defined(NOW_WORKS) - dpmi_regs.h.ah = 0xfe; - dpmi_regs.h.al = 0; - dpmi_regs.x.di = SP->video_ofs; - dpmi_regs.x.es = SP->video_seg; - _go32_dpmi_simulate_int(0x10, &dpmi_regs); - SP->video_ofs = dpmi_regs.x.di; - SP->video_seg = dpmi_regs.x.es; -#endif - -#if !defined(GO32) && !defined(WATCOMC) - regs.h.ah = 0xfe; - regs.h.al = 0; - regs.x.di = SP->video_ofs; - segs.es = SP->video_seg; - int86x(0x10, ®s, ®s, &segs); - SP->video_ofs = regs.x.di; - SP->video_seg = segs.es; -#endif - - if (!SP->adapter) - SP->adapter = retval; - return (PDC_sanity_check(retval)); -#endif - -#ifdef OS2 -# 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); -# else - VioGetConfig(0, &configInfo, 0); - SP->sizeable = TRUE; - return(OK); - -# if 0 - switch (configInfo.adapter) - { - case 0: - retval = _MDA; - SP->mono =TRUE; - break; - case 1: - retval = _CGA; - SP->mono = FALSE; - break; - case 2: switch (configInfo.display) - { - case 0: - case 3: - retval = _EGAMONO; - SP->mono = TRUE; - break; - case 1: - case 2: - case 4: - case 9: - retval = _EGACOLOR; - SP->mono = FALSE; - break; - } - break; - case 3: switch (configInfo.display) - { - case 0: - case 3: - retval = _VGAMONO; - SP->sizeable = TRUE; - SP->mono = TRUE; - break; - case 1: - case 2: - case 4: - case 9: - retval = _VGACOLOR; - SP->sizeable = TRUE; - SP->mono = FALSE; - break; - } - break; - default: - retval = _CGA; - SP->mono = FALSE; - break; - } - return (PDC_sanity_check(retval)); -# endif -# endif -#endif - -#ifdef UNIX - if (set_foreground != NULL && set_background != NULL) /* we have a colour monitor */ - { - SP->mono = FALSE; - retval = _UNIX_COLOR; - } - else - { - SP->mono = TRUE; - retval = _UNIX_MONO; - } - SP->sizeable = FALSE; - SP->bogus_adapter = FALSE; -return(retval); -#endif -} - -/*man-start********************************************************************* - - PDC_sanity_check() - A video adapter identification sanity check - - PDCurses Description: - This is a private PDCurses routine. - - This routine will force sane values for various control flags. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_sanity_check( int adapter ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_sanity_check(int adapter) -#else -int PDC_sanity_check(adapter) -int adapter; -#endif -/***********************************************************************/ -{ - int fontsize = PDC_get_font(); - int rows = PDC_get_rows(); - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_sanity_check() - called: Adapter %d\n",adapter); -#endif - - switch (adapter) - { - case _EGACOLOR: - case _EGAMONO: - switch (rows) - { - case 25: break; - case 43: break; - default: - SP->bogus_adapter = TRUE; - break; - } - - switch (fontsize) - { - case _FONT8: break; - case _FONT14: break; - default: - SP->bogus_adapter = TRUE; - break; - } - break; - - case _VGACOLOR: - case _VGAMONO: - -/* */ -/* lets be reasonably flexible with VGAs - they could be Super VGAs */ -/* capable of displaying any number of lines. MH 10-Jun-92 */ -/* This also applies to font size. MH 16-Jun-92 */ -/* - switch (rows) - { - case 25: break; - case 43: break; - case 50: break; - default: - SP->bogus_adapter = TRUE; - break; - } - - switch (fontsize) - { - case _FONT8: break; - case _FONT14: break; - case _FONT16: break; - default: - SP->bogus_adapter = TRUE; - break; - } -*/ - break; - - case _CGA: - case _MDA: - case _MCGACOLOR: - case _MCGAMONO: - switch (rows) - { - case 25: break; - default: - SP->bogus_adapter = TRUE; - break; - } - break; - - default: - SP->bogus_adapter = TRUE; - break; - } - if (SP->bogus_adapter) - { - SP->sizeable = FALSE; - SP->direct_video = FALSE; - } - return (adapter); -} diff --git a/flexos/pdckbd.c b/flexos/pdckbd.c deleted file mode 100644 index 1910a848..00000000 --- a/flexos/pdckbd.c +++ /dev/null @@ -1,955 +0,0 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -/*#define NEEDS_OS2 1*/ - -#if defined (DOS) -#include -#endif - -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef OS2 -# if defined (CURSES__32BIT__) || defined(CSET2) || defined(TC) -# include -# else -# define INCL_DOSSIGNALS -# define INCL_NOCOMMON -# include -# endif -#endif - -#ifdef UNIX -#include -#endif - -#ifdef PDCDEBUG -char *rcsid_PDCkbd = "$Id: pdckbd.c,v 1.2 2005/12/11 01:07:19 wmcbrine Exp $"; -#endif - -static unsigned long pdc_key_modifiers=0L; - -/******************************************************************************* -* Table for key code translation of function keys in keypad mode -* These values are for strict IBM keyboard compatibles only -*******************************************************************************/ - - -#if defined(DOS) || defined(OS2) -static int kptab[] = -{ - /* Normal Function Keys */ - 0x3b, KEY_F(1), 0x3c, KEY_F(2), 0x3d, KEY_F(3), 0x3e, KEY_F(4), - 0x3f, KEY_F(5), 0x40, KEY_F(6), 0x41, KEY_F(7), 0x42, KEY_F(8), - 0x43, KEY_F(9), 0x44, KEY_F(10), - - /* Normal Keypad */ - 0x47, KEY_HOME, 0x48, KEY_UP, 0x49, KEY_PPAGE, - 0x4b, KEY_LEFT, 0x4c, KEY_B2, 0x4d, KEY_RIGHT, - 0x4f, KEY_END, 0x50, KEY_DOWN, 0x51, KEY_NPAGE, - 0x52, KEY_IC, 0x53, KEY_DC, - - /* Shft-Function Keys */ - 0x54, KEY_F(11), 0x55, KEY_F(12), 0x56, KEY_F(13), 0x57, KEY_F(14), - 0x58, KEY_F(15), 0x59, KEY_F(16), 0x5a, KEY_F(17), 0x5b, KEY_F(18), - 0x5c, KEY_F(19), 0x5d, KEY_F(20), - - /* Ctl-Function Keys */ - 0x5e, KEY_F(21), 0x5f, KEY_F(22), 0x60, KEY_F(23), 0x61, KEY_F(24), - 0x62, KEY_F(25), 0x63, KEY_F(26), 0x64, KEY_F(27), 0x65, KEY_F(28), - 0x66, KEY_F(29), 0x67, KEY_F(30), - - /* Alt-Function Keys */ - 0x68, KEY_F(31), 0x69, KEY_F(32), 0x6a, KEY_F(33), 0x6b, KEY_F(34), - 0x6c, KEY_F(35), 0x6d, KEY_F(36), 0x6e, KEY_F(37), 0x6f, KEY_F(38), - 0x70, KEY_F(39), 0x71, KEY_F(40), - - /* Control-Keypad */ - 0x77, CTL_HOME, 0x84, CTL_PGUP, - 0x73, CTL_LEFT, 0x74, CTL_RIGHT, - 0x75, CTL_END, 0x76, CTL_PGDN, - - /* Alt-Numbers */ - 0x78, ALT_1, 0x79, ALT_2, 0x7a, ALT_3, 0x7b, ALT_4, - 0x7c, ALT_5, 0x7d, ALT_6, 0x7e, ALT_7, 0x7f, ALT_8, - 0x80, ALT_9, 0x81, ALT_0, - - /* Extended codes */ - 0x85, KEY_F(41), 0x86, KEY_F(42), 0x87, KEY_F(43), 0x88, KEY_F(44), - 0x89, KEY_F(45), 0x8a, KEY_F(46), 0x8b, KEY_F(47), 0x8c, KEY_F(48), - 0x03, 0, /* NULL */ - -#if defined(NUMKEYPAD) - 0xff, (int)'/', 0x0d, (int)'\n', - 0xfa, (int)'*', 0xfd, (int)'-', 0xfb, (int)'+', -#else - 0xff, PADSLASH, 0x0d, PADENTER, - 0xfa, PADSTAR, 0xfd, PADMINUS, 0xfb, PADPLUS, -#endif - - 0x0a, CTL_PADENTER, - 0xa6, ALT_PADENTER, 0x53, SHF_PADSTOP, 0xfc, CTL_ENTER, - 0x93, CTL_DEL, 0x8f, CTL_PADCENTER, 0x90, CTL_PADPLUS, - 0x8e, CTL_PADMINUS, 0x95, CTL_PADSLASH, 0x96, CTL_PADSTAR, - 0x4e, ALT_PADPLUS, 0x4a, ALT_PADMINUS, 0xa4, ALT_PADSLASH, - 0x37, ALT_PADSTAR, 0x92, CTL_INS, 0xa2, ALT_INS, - 0xa3, ALT_DEL, 0x8d, CTL_UP, 0x91, CTL_DOWN, - 0x94, CTL_TAB, 0xa5, ALT_TAB, 0x82, ALT_MINUS, - 0x83, ALT_EQUAL, 0x99, ALT_PGUP, 0xa1, ALT_PGDN, - 0x9f, ALT_END, 0x98, ALT_UP, 0xa0, ALT_DOWN, - 0x9d, ALT_RIGHT, 0x9b, ALT_LEFT, 0x1c, ALT_ENTER, - 0x97, ALT_HOME, 0x01, ALT_ESC, 0x0e, ALT_BKSP, - 0x29, ALT_BQUOTE, 0x1a, ALT_LBRACKET, 0x1b, ALT_RBRACKET, - 0x27, ALT_SEMICOLON,0x28, ALT_FQUOTE, 0x33, ALT_COMMA, - 0x34, ALT_STOP, 0x35, ALT_FSLASH, 0x2b, ALT_BSLASH, - - /* Alt-Alphabet */ - 0x1e, ALT_A, 0x30, ALT_B, 0x2e, ALT_C, 0x20, ALT_D, - 0x12, ALT_E, 0x21, ALT_F, 0x22, ALT_G, 0x23, ALT_H, - 0x17, ALT_I, 0x24, ALT_J, 0x25, ALT_K, 0x26, ALT_L, - 0x32, ALT_M, 0x31, ALT_N, 0x18, ALT_O, 0x19, ALT_P, - 0x10, ALT_Q, 0x13, ALT_R, 0x1f, ALT_S, 0x14, ALT_T, - 0x16, ALT_U, 0x2f, ALT_V, 0x11, ALT_W, 0x2d, ALT_X, - 0x15, ALT_Y, 0x2c, ALT_Z, - 0x0f, KEY_BTAB, - 0x100, (-1) -}; - /* End of kptab[] */ -#endif - -#ifdef FLEXOS -int kptab[] = -{ - /* Normal Function Keys */ - 0x1001, KEY_F(1), 0x1002, KEY_F(2), 0x1003, KEY_F(3), 0x1004, KEY_F(4), - 0x1005, KEY_F(5), 0x1006, KEY_F(6), 0x1007, KEY_F(7), 0x1008, KEY_F(8), - 0x1009, KEY_F(9), 0x100A, KEY_F(10), - - /* Normal Keypad */ - 0x2018, KEY_HOME, 0x2010, KEY_UP, 0x2014, KEY_PPAGE, - 0x2012, KEY_LEFT, 0x2035, KEY_B2, 0x2013, KEY_RIGHT, - 0x2008, KEY_LL, 0x2011, KEY_DOWN, 0x2015, KEY_NPAGE, - 0x2009, KEY_IC, 0x200A, KEY_DC, - - /* Shft-Function Keys */ - 0x1401, KEY_F(11), 0x1402, KEY_F(12), 0x1403, KEY_F(13), 0x1404, KEY_F(14), - 0x1405, KEY_F(15), 0x1406, KEY_F(16), 0x1407, KEY_F(17), 0x1408, KEY_F(18), - 0x1409, KEY_F(19), 0x140A, KEY_F(20), - - /* Ctl-Function Keys */ - 0x1101, KEY_F(21), 0x1102, KEY_F(22), 0x1103, KEY_F(23), 0x1104, KEY_F(24), - 0x1105, KEY_F(25), 0x1106, KEY_F(26), 0x1107, KEY_F(27), 0x1108, KEY_F(28), - 0x1109, KEY_F(29), 0x110A, KEY_F(30), - - /* Alt-Function Keys */ - 0x1201, KEY_F(31), 0x1202, KEY_F(32), 0x1203, KEY_F(33), 0x1204, KEY_F(34), - 0x1205, KEY_F(35), 0x1206, KEY_F(36), 0x1207, KEY_F(37), 0x1208, KEY_F(38), - 0x1209, KEY_F(39), 0x120A, KEY_F(40), - - /* Control-Keypad */ - 0x2118, CTL_HOME, 0x2114, CTL_PGUP, - 0x2112, CTL_LEFT, 0x2113, CTL_RIGHT, - 0x2108, CTL_END, 0x2115, CTL_PGDN, - - /* Alt-Numbers */ - 0x2231, ALT_1, 0x2232, ALT_2, 0x2233, ALT_3, 0x2234, ALT_4, - 0x2235, ALT_5, 0x2236, ALT_6, 0x2237, ALT_7, 0x2238, ALT_8, - 0x2239, ALT_9, 0x2230, ALT_0, - - /* Alt-Alphabet */ - 0x0200 | (unsigned) 'A', ALT_A, 0x0200 | (unsigned) 'B', ALT_B, - 0x0200 | (unsigned) 'C', ALT_C, 0x0200 | (unsigned) 'D', ALT_D, - 0x0200 | (unsigned) 'E', ALT_E, 0x0200 | (unsigned) 'F', ALT_F, - 0x0200 | (unsigned) 'G', ALT_G, 0x0200 | (unsigned) 'H', ALT_H, - 0x0200 | (unsigned) 'I', ALT_I, 0x0200 | (unsigned) 'J', ALT_J, - 0x0200 | (unsigned) 'K', ALT_K, 0x0200 | (unsigned) 'L', ALT_L, - 0x0200 | (unsigned) 'M', ALT_M, 0x0200 | (unsigned) 'N', ALT_N, - 0x0200 | (unsigned) 'O', ALT_O, 0x0200 | (unsigned) 'P', ALT_P, - 0x0200 | (unsigned) 'Q', ALT_Q, 0x0200 | (unsigned) 'R', ALT_R, - 0x0200 | (unsigned) 'S', ALT_S, 0x0200 | (unsigned) 'T', ALT_T, - 0x0200 | (unsigned) 'U', ALT_U, 0x0200 | (unsigned) 'V', ALT_V, - 0x0200 | (unsigned) 'W', ALT_W, 0x0200 | (unsigned) 'X', ALT_X, - 0x0200 | (unsigned) 'Y', ALT_Y, 0x0200 | (unsigned) 'Z', ALT_Z, - - 0x0200 | (unsigned) 'a', ALT_A, 0x0200 | (unsigned) 'b', ALT_B, - 0x0200 | (unsigned) 'c', ALT_C, 0x0200 | (unsigned) 'd', ALT_D, - 0x0200 | (unsigned) 'e', ALT_E, 0x0200 | (unsigned) 'f', ALT_F, - 0x0200 | (unsigned) 'g', ALT_G, 0x0200 | (unsigned) 'h', ALT_H, - 0x0200 | (unsigned) 'i', ALT_I, 0x0200 | (unsigned) 'j', ALT_J, - 0x0200 | (unsigned) 'k', ALT_K, 0x0200 | (unsigned) 'l', ALT_L, - 0x0200 | (unsigned) 'm', ALT_M, 0x0200 | (unsigned) 'n', ALT_N, - 0x0200 | (unsigned) 'o', ALT_O, 0x0200 | (unsigned) 'p', ALT_P, - 0x0200 | (unsigned) 'q', ALT_Q, 0x0200 | (unsigned) 'r', ALT_R, - 0x0200 | (unsigned) 's', ALT_S, 0x0200 | (unsigned) 't', ALT_T, - 0x0200 | (unsigned) 'u', ALT_U, 0x0200 | (unsigned) 'v', ALT_V, - 0x0200 | (unsigned) 'w', ALT_W, 0x0200 | (unsigned) 'x', ALT_X, - 0x0200 | (unsigned) 'y', ALT_Y, 0x0200 | (unsigned) 'z', ALT_Z, - - 0x0f, KEY_BTAB, - - /* End of kptab[] */ - 0x100, -1 -}; -#endif - -/*man-start********************************************************************* - - PDC_get_input_fd() - Get file descriptor used for PDCurses input - - PDCurses Description: - This is a private PDCurses routine. - - This routine will return the file descriptor that PDCurses reads - its input from. It can be used for select(). - - PDCurses Return Value: - Returns a file descriptor. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_input_fd( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_input_fd(void) -#else -int PDC_get_input_fd() -#endif -/***********************************************************************/ -{ - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_input_fd() - called\n"); -#endif - - return fileno (stdin); -} - -/*man-start********************************************************************* - - PDC_check_bios_key() - Check BIOS key data area for input - - PDCurses Description: - This is a private PDCurses routine. - - This routine will check the BIOS for any indication that - keystrokes are pending. - - PDCurses Return Value: - Returns 1 if a keyboard character is available, 0 otherwise. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses bool PDC_check_bios_key( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -bool PDC_check_bios_key(void) -#else -bool PDC_check_bios_key() -#endif -/***********************************************************************/ -{ -#ifdef OS2 -# if !defined(MSC) && !defined(EMXVIDEO) - KBDKEYINFO keyInfo={0}; -# endif -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_check_bios_key() - called\n"); -#endif - -#ifdef FLEXOS - retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir)); - return( (retcode < 0L) ? ERR : vir.vc_tahead ); -#endif - -#if defined (DOS) - return(kbhit()); -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - if (SP->tahead == -1) /* Nothing typed yet */ - { /* See if there's anything */ - SP->tahead = _read_kbd (0, 0, 0); - if (SP->tahead == 0) /* Read additional */ - SP->tahead = (_read_kbd (0, 1, 0) << 8); - } - return(SP->tahead != -1) ? 1 : 0; -# else -# if !defined(MSC) -/* KbdCharIn(&keyInfo, IO_NOWAIT, 0);*/ /* get a character */ - KbdPeek(&keyInfo, 0); /* peek at keyboard */ - return (keyInfo.fbStatus != 0); -# else - return(kbhit()); -# endif -# endif -#endif - -#ifdef UNIX - return(PDC_kbhit()); -#endif - -#if defined(XCURSES) - return(XCurses_kbhit()); -#endif -} - -/*man-start********************************************************************* - - PDC_get_bios_key() - Returns the next key available from the BIOS. - - PDCurses Description: - This is a private PDCurses routine. - - Returns the next key code struck at the keyboard. If the low 8 - bits are 0, the upper bits contain the extended character - code. If bit 0-7 are non-zero, the upper bits = 0. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_bios_key( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_get_bios_key(void) -#else -int PDC_get_bios_key() -#endif -/***********************************************************************/ -{ -#ifdef FLEXOS -unsigned ch = 0; -#endif - -#if defined (DOS) - int ascii=0,scan=0; - static unsigned char keyboard_function=0xFF; -#endif - -#if defined (OS2) - int ascii=0,scan=0; -# ifndef EMXVIDEO - KBDKEYINFO keyInfo={0}; -# endif -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_bios_key() - called\n"); -#endif - -#ifdef FLEXOS - retcode = s_read(0x00, 0L, (char *) &ch, 2L, 0L); - return( (retcode < 0L) ? ERR : ch ); -#endif - -#if defined (DOS) - if (keyboard_function == 0xFF) - { - regs.h.ah = 0x02; /* get shift status for all keyboards */ - int86(0x16, ®s, ®s); - scan = regs.h.al; - regs.h.ah = 0x12; /* get shift status for enhanced keyboards */ - int86(0x16, ®s, ®s); - if (scan == regs.h.al - && getdosmembyte(0x496) == 0x10) - keyboard_function = 0x10; - else - keyboard_function = 0x0; - } - regs.h.ah = keyboard_function; - int86(0x16, ®s, ®s); - ascii = regs.h.al; - scan = regs.h.ah; -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - if (SP->tahead == -1) - { - SP->tahead = _read_kbd (0, 1, 0); - if (SP->tahead == 0) /* Read additional */ - SP->tahead = (_read_kbd (0, 1, 0) << 8); - } - ascii = SP->tahead & 0xff; - scan = SP->tahead >> 8; - SP->tahead = -1; -# else - KbdCharIn(&keyInfo, IO_WAIT, 0); /* get a character */ - ascii = keyInfo.chChar; - scan = keyInfo.chScan; -# endif -#endif - -#if defined (DOS) || defined (OS2) - if (scan == 0x1c && ascii == 0x0a) /* ^Enter */ - return ((int) (0xfc00)); - if ((scan == 0x03 && ascii == 0x00) /* ^@ - Null */ - || (scan == 0xe0 && ascii == 0x0d) /* PadEnter */ - || (scan == 0xe0 && ascii == 0x0a)) /* ^PadEnter */ - return ((int) (ascii << 8)); - if ((scan == 0x37 && ascii == 0x2a) /* Star */ - || (scan == 0x4a && ascii == 0x2d) /* Minus */ - || (scan == 0x4e && ascii == 0x2b) /* Plus */ - || (scan == 0xe0 && ascii == 0x2f)) /* Slash */ - return ((int) ((ascii & 0x0f) | 0xf0) << 8); - if (ascii == 0x00 || ascii == 0xe0) - return ((int) (scan << 8)); - return ((int) (ascii)); -#endif -} - -/*man-start********************************************************************* - - PDC_get_ctrl_break() - return OS control break state - - PDCurses Description: - This is a private PDCurses routine. - - Returns the current OS Control Break Check state. - - PDCurses Return Value: - DOS: - This function returns TRUE on if the Control Break - Check is enabled otherwise FALSE is returned. - - FLEXOS: - This function returns TRUE on if the Keyboard Mode - allows a break to bre reported otherwise FALSE is returned. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses bool PDC_get_ctrl_break( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -bool PDC_get_ctrl_break(void) -#else -bool PDC_get_ctrl_break() -#endif -/***********************************************************************/ -{ -#ifdef OS2 -# if defined(CURSES__32BIT__) || defined(CSET2) || defined(TC) -# if defined(TC) - void __cdecl (*oldAction) (int); -# else - void (*oldAction) (int); -# endif -# endif -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_ctrl_break() - called\n"); -#endif - -#ifdef FLEXOS - return ((kbmode & 0x01) ? TRUE : FALSE); -#endif - -#ifdef DOS - regs.h.ah = 0x33; - regs.h.al = 0x00; - int86(0x21, ®s, ®s); - return ((bool) regs.h.dl); -#endif - -#ifdef OS2 -# if defined(CURSES__32BIT__) || defined(CSET2) || defined(TC) - oldAction = signal (SIGINT, SIG_DFL); - if (oldAction == SIG_ERR) return FALSE; - else signal (SIGINT, oldAction); - return (oldAction != SIG_IGN); -# else - PFNSIGHANDLER oldHandler, oldHandler1; - USHORT oldAction, oldAction1; - /* get the current state, and set to ignore */ - DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction, - SIGA_IGNORE, SIG_CTRLBREAK); - /* restore the previous state */ - DosSetSigHandler(oldHandler, &oldHandler1, &oldAction1, - oldAction, SIG_CTRLBREAK); - return(oldAction != SIGA_IGNORE); -# endif -#endif - -#ifdef UNIX -/* INCOMPLETE - use signals?*/ -#endif -} - -/*man-start********************************************************************* - - PDC_rawgetch() - Returns the next uninterpreted character (if available). - - PDCurses Description: - Gets a character without any interpretation at all and returns - it. If keypad mode is active for the designated window, - function key translation will be performed. Otherwise, - function keys are ignored. If nodelay mode is active in the - window, then PDC_rawgetch() returns -1 if no character is - available. - - WARNING: It is unknown whether the FUNCTION key translation - is performed at this level. --Frotz 911130 BUG - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_rawgetch( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_rawgetch(void) -#else -int PDC_rawgetch() -#endif -/***********************************************************************/ -{ -extern WINDOW* _getch_win_; -/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ - /* is the same window - all references to w changed*/ - /* to _getch_win_ - marked with @@ */ - - int c=0; - int oldc=0; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_rawgetch() - called\n"); -#endif - - if (_getch_win_ == (WINDOW *)NULL) /* @@ */ - return( -1 ); - - if (_getch_win_->_nodelay && !PDC_breakout()) /* @@ */ - return( -1 ); - -#ifdef UNIX - c = getchar(); - return(c); -#endif - -#if defined(XCURSES) - c = XCurses_rawgetch(); - return(c); -#else - while (1) /* loop to get valid char */ - { - c = PDC_get_bios_key(); - oldc = c; - /* - * Return the key if it is not a special key. - */ - if ((c = PDC_validchar(c)) >= 0) - { /* get & check next char */ - return( c ); - } - if (_getch_win_->_use_keypad) - return( oldc ); - } -#endif -} - -/*man-start********************************************************************* - - PDC_set_ctrl_break() - Enables/Disables the host OS BREAK key check. - - PDCurses Description: - This is a private PDCurses routine. - - Enables/Disables the host OS BREAK key check. If the supplied setting - is TRUE, this enables CTRL/C and CTRL/BREAK to abort the process. - If FALSE, CTRL/C and CTRL/BREAK are ignored. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_set_ctrl_break( bool setting ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_ctrl_break(bool setting) -#else -int PDC_set_ctrl_break(setting) -bool setting; -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_ctrl_break() - called\n"); -#endif - -#ifdef FLEXOS - retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir)); - if (retcode < 0L) - return( ERR ); - - vir.vc_kbmode = ((vir.vc_kbmode & ~0x01) & (setting) ? 0x01 : 0x00); - - retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir)); - return( (retcode < 0L) ? ERR : OK ); -#endif - -#ifdef DOS -# ifdef NDP - if( setting ) - _ignore_breaks(); - else - _watch_breaks(); -# else - regs.h.ah = 0x33; - regs.h.al = 0x00; - regs.h.dl = (unsigned char) (setting ? 1 : 0); - int86(0x21, ®s, ®s); -# endif - return( OK ); -#endif - -#ifdef OS2 -# if defined (CURSES__32BIT__) || defined (CSET2) || defined(TC) - if (setting) { - signal (SIGINT, SIG_DFL); - signal (SIGBREAK, SIG_DFL); - } else { - signal (SIGINT, SIG_IGN); - signal (SIGBREAK, SIG_IGN); - } - return( OK ); -# else - PFNSIGHANDLER oldHandler; - USHORT oldAction, Action; - - /* turn off control C checking */ - if (setting) - Action = SIGA_KILL; - else - Action = SIGA_IGNORE; - DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction, - Action, SIG_CTRLBREAK); - DosSetSigHandler((PFNSIGHANDLER) NULL, &oldHandler, &oldAction, - Action, SIG_CTRLC); - return( OK ); -# endif -#endif - -#ifdef UNIX -/* INCOMPLETE */ -#endif -} - -/*man-start********************************************************************* - - PDC_sysgetch() - Return a character using default system routines. - - PDCurses Description: - This is a private PDCurses function. - - Gets a character without normal ^S, ^Q, ^P and ^C interpretation - and returns it. If keypad mode is active for the designated - window, function key translation will be performed. Otherwise, - function keys are ignored. If nodelay mode is active in the - window, then sysgetch() returns -1 if no character is - available. - - PDCurses Return Value: - This function returns OK upon success otherwise ERR is returned. - - PDCurses Errors: - No errors are defined for this routine. - - Portability: - PDCurses int PDC_sysgetch( void ); - -**man-end**********************************************************************/ - -#ifdef UNIX -static bool alarmed; -#endif - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_sysgetch(void) -#else -int PDC_sysgetch() -#endif -/***********************************************************************/ -{ -extern WINDOW* _getch_win_; -/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ - /* is the same window - all references to w changed*/ - /* to _getch_win_ - marked with @@ */ - - int c=0; - -#ifdef UNIX - void (*oldsig)(); - void sigalrm(); - char keybuf[10]; - char *bufp=keybuf; - int val=0; - register int i=0; -#define MATCH_FALSE 0 -#define MATCH_PARTIAL 1 -#define MATCH_TRUE 2 - char match=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_sysgetch() - called\n"); -#endif - - if (_getch_win_ == (WINDOW *)NULL) /* @@ */ - return (-1); - - if (_getch_win_->_nodelay && !PDC_breakout()) - return (-1); - -#ifdef UNIX -/* INCOMPLETE */ - oldsig = signal(SIGALRM,sigalrm); - alarmed = FALSE; - while(1) - { - c = getchar(); - if (c != EOF) - { - *(bufp+i++) = c; - *(bufp+i) = '\0'; - } - if (alarmed) - break; - val = find_key(keybuf,i); - if (val == MATCH_FALSE) - { - alarm(0); - signal(SIGALRM,oldsig); - return(keybuf[0]); - } - if (val != MATCH_PARTIAL) - { - alarm(0); - signal(SIGALRM,oldsig); - return(val); - } - alarm(1); - } - alarm(0); - signal(SIGALRM,oldsig); -/* INCOMPLETE */ - return(c); -#else - while (1) - { - c = PDC_get_bios_key(); -#if defined (DOS) || defined (OS2) - /* - * Return the key if it is not a special key. - */ - if ((unsigned int)c < 256) - return(c); -#endif - if ((c = PDC_validchar(c)) >= 0) - { - return (c); /* get & check next char */ - } - } -#endif -} - -#ifdef UNIX -static void sigalrm() -{ - alarmed = TRUE; - signal(SIGALRM,sigalrm); -} -static int find_key(char *seq,int len) -{ - register int i=0; - - for (i=0;inumber_keys;i++) - { - if (strcmp(seq,SP->key_seq[i]) == 0) - return(SP->key_num[i]); - if (memcmp(seq,SP->key_seq[i],len) == 0) - return(MATCH_PARTIAL); - } - return(MATCH_FALSE); -} -#endif - -/*man-start********************************************************************* - - PDC_validchar() - validate/translate passed character - - PDCurses Description: - This is a private PDCurses function. - - Checks that 'c' is a valid character, and if so returns it, - with function key translation applied if 'w' has keypad mode - set. If char is invalid, returns -1. - - PDCurses Return Value: - This function returns -1 if the passed character is invalid, or - the WINDOW* 'w' is NULL, or 'w's keypad is not active. - - This function returns 0 under Flexos if the passed character - is 0x0300. (-:Forget why. --Frotz 911130:-) - - Otherwise, this function returns the PDCurses equivalent of the - passed character. See the function key and key macros in - - - PDCurses Errors: - There are no errors defined for this routine. - - Portability: - PDCurses int PDC_validchar( int c ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_validchar(int c) -#else -int PDC_validchar(c) -int c; -#endif -/***********************************************************************/ -{ -extern WINDOW* _getch_win_; -/* extern WINDOW* w;*/ /* w defined in wgetch() as static - _getch_win_ */ - /* is the same window - all references to w changed*/ - /* to _getch_win_ - marked with @@ */ - - int *scanp=NULL; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_validchar() - called\n"); -#endif - - if (_getch_win_ == (WINDOW *)NULL) - return (-1); /* bad window pointer */ - -#ifdef FLEXOS - if (c == 0x0300) - return (0); /* special case, ^@ = NULL */ -#endif - - if ((unsigned int)c < 256) return (c); /* normal character */ - if (!(_getch_win_->_use_keypad)) return (-1); /* skip if keys if !keypad mode */ - -#if defined (DOS) || defined (OS2) - /* - * Under DOS, extended keys are in the upper byte. Shift down for a - * comparison. - */ - c = (c >> 8) & 0xFF; -#endif - -#if defined(XCURSES) -/* Nothing to do for Xcurses */ -#else - scanp = kptab; - while (*scanp > 0) /* search for value */ - { /* (stops on table entry 0x100) */ - if (*scanp++ == c) - { - return (*scanp); /* found, return it */ - } - scanp++; - } - return( -1 ); /* not found, invalid */ -#endif -} - -/*man-start********************************************************************* - - PDC_get_key_modifiers() - Returns the keyboard modifier(s) at time of last getch() - - PDCurses Description: - This is a private PDCurses routine. - - Returns the keyboard modifiers effective at the time of the last getch() - call only if PDC_save_key_modifiers(TRUE) has been called before the - getch(); - Use the macros; PDC_KEY_MODIFIER_* to determine which modifier(s) - were set. - - PDCurses Return Value: - This function returns the modifiers. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_get_key_modifiers( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -unsigned long PDC_get_key_modifiers(void) -#else -unsigned long PDC_get_key_modifiers() -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_get_key_modifiers() - called\n"); -#endif - return(pdc_key_modifiers); -} diff --git a/flexos/pdcprint.c b/flexos/pdcprint.c deleted file mode 100644 index 359e663e..00000000 --- a/flexos/pdcprint.c +++ /dev/null @@ -1,116 +0,0 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_PDCprint = "$Id: pdcprint.c,v 1.1 2001/01/10 08:31:10 mark Exp $"; -#endif - -#ifdef OS2 -# if !defined (CURSES__32BIT__) && !defined(CSET2) && !defined(MSC) &&!defined(TC) -#define INCL_DOS -#include -#endif -char Printer[]="LPT1:"; -#endif - - -/*man-start********************************************************************* - - PDC_print() - Provides primitive access to the BIOS printer functions - - PDCurses Description: - This is a private PDCurses routine. - - Implements write/init/read printer services at the BIOS level. - - This provides the basic support that PDCurses needs to dump the - contents of windows or pads to the printer attached to the BIOS - printer port. - - PDCurses Return Value: - See the BIOS INT 0x17 specifications. - - PDCurses Errors: - See the BIOS INT 0x17 specifications. - - Portability: - PDCurses int PDC_print( int cmd, int byte, int port ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_print(int cmd, int byte, int port) -#else -int PDC_print(cmd,byte,port) -int cmd; -int byte; -int port; -#endif -/***********************************************************************/ -{ -#ifdef OS2 -# if !defined (CURSES__32BIT__) && !defined(CSET2) && !defined(TC) - HFILE Lpt; - USHORT Action=0; - USHORT NoWritten=0; -# endif -#endif - -#ifdef DOS - int status = 0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_print() - called\n"); -#endif - -#ifdef FLEXOS - return( OK ); -#endif - -#ifdef DOS - regs.h.ah = (unsigned char)cmd; - regs.h.al = (unsigned char)byte; -# ifdef WATCOMC - regs.w.dx = (unsigned int)port; -# else - regs.x.dx = (unsigned int)port; -# endif - int86(0x17, ®s, ®s); - status = regs.h.ah; - return (status); -#endif - -#ifdef OS2 -# if !defined (CURSES__32BIT__) && !defined(CSET2) && !defined(TC) - if (DosOpen((PSZ)Printer, &Lpt, &Action, 0,0,0,0,0) != 0) - return(ERR); - DosWrite(Lpt,&byte,1,&NoWritten); - DosClose(Lpt); - return(NoWritten == 1); -# endif -#endif -} diff --git a/flexos/pdcscrn.c b/flexos/pdcscrn.c deleted file mode 100644 index 0ced7ad9..00000000 --- a/flexos/pdcscrn.c +++ /dev/null @@ -1,376 +0,0 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef UNIX -#include -#include -#undef lines -#endif - -#ifdef PDCDEBUG -char *rcsid_PDCscrn = "$Id: pdcscrn.c,v 1.2 2005/12/11 05:51:24 wmcbrine Exp $"; -#endif - -/*man-start********************************************************************* - - 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 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. - - 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. - - Portability: - PDCurses int PDC_scr_close( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_scr_close(void) -#else -int PDC_scr_close() -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_scr_close() - called\n"); -#endif - -#ifdef FLEXOS - _flexos_8bitmode(); - vir.vc_kbmode = kbmode; - vir.vc_smode = smode; - vir.vc_mode = cmode; - retcode = s_set(T_VIRCON, 1L, (char *) &vir, (long) sizeof(vir)); - if (retcode < 0L) - return( ERR ); - return( OK ); -#endif - - return( OK ); -} - -/*man-start********************************************************************* - - PDC_scrn_modes_equal() - Decide if two screen modes are equal - - PDCurses Description: - 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. - - PDCurses Errors: - 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 ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#if defined( OS2 ) && !defined( EMXVIDEO ) -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 -#endif -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_scrn_modes_equal() - called\n"); -#endif - -#if defined( OS2 ) && !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) ); -#else - return (mode1 == mode2); -#endif -} - -/*man-start********************************************************************* - - 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 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. - - 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. - - Portability: - 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 -/***********************************************************************/ -{ -#if defined( OS2 ) && !defined( EMXVIDEO ) - extern VIOCONFIGINFO configInfo; - extern VIOMODEINFO modeInfo; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_scr_open() - called\n"); -#endif - -#ifdef FLEXOS - retcode = s_get(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir)); - if (retcode < 0L) - return( ERR ); - - kbmode = vir.vc_kbmode; - cmode = vir.vc_mode; - vir.vc_mode = 0; - - if (!echo) vir.vc_kbmode |= VCKM_NECHO; - else vir.vc_kbmode &= ~VCKM_NECHO; - - smode = vir.vc_smode; - retcode = s_set(T_VIRCON, 0L, (char *) &vir, (long) sizeof(vir)); - if (retcode < 0L) - return( ERR ); - - if (vir.vc_type & 0x03) internal->mono = TRUE; - else internal->mono = FALSE; - - internal->orig_attr = vir.vc_flcolor | vir.vc_blcolor; - _flexos_16bitmode(); -#endif - -#ifdef DOS - internal->orig_attr = 0; - internal->orig_emulation = getdosmembyte (0x487); -#endif - -#ifdef OS2 - internal->orig_attr = 0; - internal->orig_emulation = 0; -#endif - -#ifdef UNIX - PDC_get_cursor_pos(&internal->cursrow, &internal->curscol); - internal->autocr = FALSE; /* lf -> crlf by default */ - internal->raw_out = FALSE; /* tty I/O modes */ - internal->raw_inp = FALSE; /* tty I/O modes */ - internal->cbreak = FALSE; - internal->save_key_modifiers = FALSE; - internal->return_key_modifiers = FALSE; - internal->echo = echo; - internal->refrbrk = FALSE; /* no premature end of refresh*/ - internal->visible_cursor= TRUE; /* Assume that it is visible */ - internal->cursor = 0; - internal->font = 0; - internal->lines = PDC_get_rows(); - internal->cols = PDC_get_columns(); - internal->audible = TRUE; - internal->direct_video = FALSE; /* Assume that we can */ - internal->adapter = PDC_query_adapter_type(); - _CUR_TERM.prog_mode.c_iflag &= ~(ICRNL); - _CUR_TERM.prog_mode.c_oflag &= ~(ONLCR|OPOST); - _CUR_TERM.prog_mode.c_lflag &= ~(ICANON|ECHO); - _CUR_TERM.prog_mode.c_cc[VMIN] = 1; - ioctl(_CUR_TERM.fd, TCSETA, &_CUR_TERM.prog_mode); - return(OK); -#endif - -#if defined(XCURSES) - internal->cursrow = internal->curscol = 0; - internal->direct_video = FALSE; /* Assume that we can't */ -#else - PDC_get_cursor_pos(&internal->cursrow, &internal->curscol); - internal->direct_video = TRUE; /* Assume that we can */ -#endif - - 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->echo = echo; - internal->refrbrk = FALSE; /* no premature end of refresh*/ -#if !defined(OS2) && !defined(XCURSES) - internal->video_seg = 0xb000; /* Base screen segment addr */ - internal->video_ofs = 0x0; /* Base screen segment ofs */ -#endif - 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; -#endif - -#if defined(OS2) && !defined(EMXVIDEO) - (void)PDC_query_adapter_type(); - memcpy(internal->adapter,configInfo,sizeof(VIOCONFIGINFO)); - (void)PDC_get_scrn_mode(); - memcpy(internal->scrnmode,modeInfo,sizeof(VIOMODEINFO)); -#else - internal->adapter = PDC_query_adapter_type(); -# if !defined(EMXVIDEO) && !defined(XCURSES) - internal->scrnmode = PDC_get_scrn_mode(); -# endif -#endif - -#if !defined(XCURSES) - internal->orig_font = internal->font = PDC_get_font(); - internal->lines = PDC_get_rows(); - internal->cols = PDC_get_columns(); -#endif - - 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; - - return( OK ); -} - -/*man-start********************************************************************* - - 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. - - PDCurses Return Value: - This function returns OK on success, otherwise an ERR is returned. - - PDCurses Errors: - - Portability: - 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 rc=OK; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_resize_screen() - called. Lines: %d Cols: %d\n",nlines,ncols); -#endif - -#ifdef FLEXOS - /* - * Under FlexOS, this is functionally equivalent to a recallable - * initscr() because FlexOS does not yet support determination of - * screen fonts and therefore font loading and therefore text mode - * screen resolution changes... - */ - return( ERR ); -#endif - -#if defined(DOS) - switch (SP->adapter) - { - case _EGACOLOR: - if (nlines >= 43) PDC_set_font(_FONT8); - else PDC_set_80x25(); - break; - - case _VGACOLOR: - if (nlines > 28) PDC_set_font(_FONT8); - else if (nlines > 25) PDC_set_font(_FONT14); - else PDC_set_80x25(); - break; - - default: - break; - } -#endif - -#ifdef OS2 - if (nlines >= 43) PDC_set_font(_FONT8); - else if (nlines > 25) PDC_set_font(_FONT14); - else PDC_set_80x25(); -#endif - -#ifdef XCURSES - rc = XCursesResizeScreen(nlines,ncols); -#endif - - return ( rc ); -} diff --git a/flexos/pdcsetsc.c b/flexos/pdcsetsc.c deleted file mode 100644 index fc0a8d15..00000000 --- a/flexos/pdcsetsc.c +++ /dev/null @@ -1,696 +0,0 @@ -/* -*************************************************************************** -* This file comprises part of PDCurses. PDCurses is Public Domain software. -* You may use this code for whatever purposes you desire. This software -* is provided AS IS with NO WARRANTY whatsoever. -* Should this software be used in another application, an acknowledgement -* that PDCurses code is used would be appreciated, but is not mandatory. -* -* Any changes which you make to this software which may improve or enhance -* it, should be forwarded to the current maintainer for the benefit of -* other users. -* -* The only restriction placed on this code is that no distribution of -* modified PDCurses code be made under the PDCurses name, by anyone -* other than the current maintainer. -* -* See the file maintain.er for details of the current maintainer. -*************************************************************************** -*/ -#define CURSES_LIBRARY 1 -#ifdef HAVE_CONFIG_H -# include -#endif -#include - -#ifdef PDCDEBUG -char *rcsid_PDCsetsc = "$Id: pdcsetsc.c,v 1.1 2001/01/10 08:31:13 mark Exp $"; -#endif - -/*man-start********************************************************************* - - PDC_set_80x25() - force a known screen state: 80x25 text mode. - - PDCurses Description: - This is a private PDCurses function. - - 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. - - PDCurses Return Value: - This function returns OK upon success otherwise ERR is returned. - - PDCurses Errors: - No errors are defined for this routine. - - Portability: - PDCurses int PDC_set_80x25( void ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_80x25(void) -#else -int PDC_set_80x25() -#endif -/***********************************************************************/ -{ -#if defined( OS2 ) && !defined( EMXVIDEO ) - VIOMODEINFO modeInfo={0}; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_80x25() - called\n"); -#endif - -#ifdef FLEXOS - return( OK ); -#endif - -#ifdef DOS - switch (SP->adapter) - { - case _CGA: - case _EGACOLOR: - case _EGAMONO: - case _VGACOLOR: - case _VGAMONO: - case _MCGACOLOR: - case _MCGAMONO: - regs.h.ah = 0x00; - regs.h.al = 0x03; - int86(0x10, ®s, ®s); - break; - case _MDA: - regs.h.ah = 0x00; - regs.h.al = 0x07; - int86(0x10, ®s, ®s); - default: - break; - } - return( OK ); -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - return( OK ); -# else - modeInfo.cb = sizeof(modeInfo); - /* set most parameters of modeInfo */ - VioGetMode(&modeInfo, 0); - modeInfo.fbType = 1; - VioSetMode(&modeInfo, 0); -# endif -#endif - -#ifdef UNIX -/* INCOMPLETE */ -#endif -} - -/*man-start********************************************************************* - - 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. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - 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 -/***********************************************************************/ -{ -#ifdef OS2 -# ifndef EMXVIDEO - VIOCURSORINFO cursorInfo={0}; -# endif -#endif - -#ifdef FLEXOS - unsigned short mybuff = 0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_cursor_mode() - called: startrow %d endrow %d\n",startrow,endrow); -#endif - -#ifdef FLEXOS - /* - * Under FLEXOS, this routine translates the input parameters in the - * following way: - * - * startrow --> visible_cursor endrow --> cursor type: - * underline = 0; block = 1; - * - * VCWM_CURSOR 0x0100 bit - 8 Cursor off VCWM_BLOCK - * 0x0200 bit - 9 Block Cursor - * - */ - retcode = s_getfield(T_VIRCON, VC_MODE, 1L, (void far *) &mybuff, 2L); - if (retcode < 0L) - return( ERR ); - if (startrow) - mybuff &= ~VCWM_CURSOR; - else - mybuff |= VCWM_CURSOR; - - if (endrow) - mybuff |= VCWM_BLOCK; - else - mybuff &= ~VCWM_BLOCK; - - retcode = s_setfield(T_VIRCON, VC_MODE, 1L, (void far *) &mybuff, 2L); - return( (retcode < 0L) ? ERR : OK ); -#endif - -#ifdef DOS - regs.h.ah = 0x01; - regs.h.ch = (unsigned char) startrow; - regs.h.cl = (unsigned char) endrow; - int86(0x10, ®s, ®s); - return( OK ); -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - 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); -# endif -#endif - -#ifdef UNIX - return(0); /* this is N/A */ -#endif -} - -/*man-start********************************************************************* - - PDC_set_font() - sets the current font size - - PDCurses Description: - This is a private PDCurses function. - - 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. - - 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 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 ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_font(int size) -#else -int PDC_set_font(size) -int size; -#endif -/***********************************************************************/ -{ -#ifdef OS2 -# ifndef EMXVIDEO - VIOMODEINFO modeInfo={0}; -# endif -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_font() - called\n"); -#endif - -#ifdef FLEXOS - return( ERR ); -#endif - -#ifdef DOS - if (SP->bogus_adapter) - return( ERR ); - - switch (SP->adapter) - { - case _CGA: - case _MDA: - case _MCGACOLOR: - case _MCGAMONO: - case _MDS_GENIUS: - break; - - case _EGACOLOR: - case _EGAMONO: - if (SP->sizeable && (SP->font != size)) - { - switch (size) - { - case _FONT8: - regs.h.ah = 0x11; - regs.h.al = 0x12; - regs.h.bl = 0x00; - int86(0x10, ®s, ®s); - break; - case _FONT14: - regs.h.ah = 0x11; - regs.h.al = 0x11; - regs.h.bl = 0x00; - int86(0x10, ®s, ®s); - break; - default: - break; - } - } - break; - - case _VGACOLOR: - case _VGAMONO: - if (SP->sizeable && (SP->font != size)) - { - switch (size) - { - case _FONT8: - regs.h.ah = 0x11; - regs.h.al = 0x12; - regs.h.bl = 0x00; - int86(0x10, ®s, ®s); - break; - case _FONT14: - regs.h.ah = 0x11; - regs.h.al = 0x11; - regs.h.bl = 0x00; - int86(0x10, ®s, ®s); - break; - case _FONT16: - regs.h.ah = 0x11; - regs.h.al = 0x14; - regs.h.bl = 0x00; - int86(0x10, ®s, ®s); - break; - default: - break; - } - } - break; - default: - break; - } - if (SP->visible_cursor) - PDC_cursor_on(); - else - PDC_cursor_off(); - SP->font = PDC_get_font(); - return( OK ); -#endif - -#ifdef OS2 -# 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(); -# endif - return( OK ); -#endif - -#ifdef UNIX - return(OK); /* this is N/A */ -#endif -} - -/*man-start********************************************************************* - - PDC_set_rows() - sets the physical number of rows on screen - - PDCurses Description: - This is a private PDCurses function. - - 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. - - 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 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 ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_set_rows(int rows) -#else -int PDC_set_rows(rows) -int rows; -#endif -/***********************************************************************/ -{ -#ifdef OS2 -# ifndef EMXVIDEO - VIOMODEINFO modeInfo={0}; - USHORT result=0; -# endif -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_rows() - called\n"); -#endif - -#ifdef FLEXOS - return( ERR ); -#endif - -#ifdef DOS - if (SP->bogus_adapter) - return( ERR ); - - switch (SP->adapter) - { - case _EGACOLOR: - case _EGAMONO: - if (rows < 43) - PDC_set_font(_FONT14); - else - PDC_set_font(_FONT8); - break; - - case _VGACOLOR: - case _VGAMONO: - if (rows < 28) - PDC_set_font(_FONT16); - else - if (rows < 50) - PDC_set_font(_FONT14); - else - PDC_set_font(_FONT8); - break; - - case _MCGACOLOR: - case _MCGAMONO: - case _MDA: - case _CGA: - case _MDS_GENIUS: - default: - break; - } - SP->font = PDC_get_font(); - LINES = PDC_get_rows(); - COLS = PDC_get_columns(); - return( OK ); -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - 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); -# endif -#endif - -#ifdef UNIX - return(0); /* this is N/A */ -#endif -} - -/*man-start********************************************************************* - - 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. - - PDCurses Return Value: - This function returns OK on success and ERR on error. - - PDCurses Errors: - No errors are defined for this function. - - Portability: - PDCurses int PDC_set_scrn_mode( int new_mode ); - -**man-end**********************************************************************/ - -/***********************************************************************/ -#if defined( OS2 ) && !defined( EMXVIDEO ) -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 -#endif -/***********************************************************************/ -{ - -#ifdef DOS - int cur=0; -#endif - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_scrn_mode() - called\n"); -#endif - -#ifdef FLEXOS - return( OK ); -#endif - -#ifdef DOS - cur = (int) PDC_get_scrn_mode(); - if (cur != new_mode) - { - regs.h.ah = 0x00; - regs.h.al = (char) new_mode; - int86(0x10, ®s, ®s); - } - SP->font = PDC_get_font(); - SP->scrnmode = new_mode; - LINES = PDC_get_rows(); - COLS = PDC_get_columns(); - return( OK ); -#endif - -#ifdef OS2 -# ifdef EMXVIDEO - return ( OK ); -# else - if (VioSetMode (&new_mode, 0) != 0) - { - SP->font = PDC_get_font(); - memcpy(SP->scrnmode,new_mode,sizeof(VIOMODEINFO)); - LINES = PDC_get_rows(); - COLS = PDC_get_columns(); - return( OK ); - } - else - return (ERR); -# endif -#endif - -#ifdef UNIX - return(OK); /* this is N/A */ -#endif -} -/***********************************************************************/ -#ifdef HAVE_PROTO -int PDC_curs_set(int visibility) -#else -int PDC_curs_set(visibility) -int visibility; -#endif -/***********************************************************************/ -{ -#ifdef OS2 -# ifndef EMXVIDEO - VIOCURSORINFO pvioCursorInfo; -# endif -#endif -#if defined(DOS) || defined(OS2) - int start,end,hidden=0; -#endif - int ret_vis; - -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_curs_set() - called: visibility=%d\n",visibility); -#endif - - ret_vis = SP->visibility; - SP->visibility = visibility; - -#ifdef UNIX - switch(visibility) - { - case 0: /* invisible */ - if (cursor_invisible != NULL) - putp(cursor_invisible); - break; - case 2: /* highly visible */ - if (cursor_visible != NULL) - putp(cursor_visible); - break; - default: /* normal visibility */ - if (cursor_visible != NULL) - putp(cursor_visible); - break; - } - return(OK); -#endif - -#if defined(DOS) || defined(OS2) - switch(visibility) - { - case 0: /* invisible */ -# ifdef OS2 -# ifdef EMXVIDEO - start = end = 0; -# else - start = SP->font / 4; - end = SP->font; -# endif -# else - start = 32; - end = 32; /* was 33 */ -# 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 - 4; - end = SP->font-1; - break; - } - -# ifdef OS2 -# ifdef EMXVIDEO - if (hidden) - 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); -# endif -# endif - -# ifdef DOS - regs.h.ah = 0x01; - regs.h.al = (unsigned char)SP->scrnmode; /* if not set, some BIOSes hang */ - regs.h.ch = (unsigned char)start; - regs.h.cl = (unsigned char)end; - int86(0x10, ®s, ®s); -# endif - return( ret_vis ); -#endif - -#if defined (XCURSES) - XCurses_display_cursor(SP->cursrow,SP->curscol,SP->cursrow,SP->curscol); - return(ret_vis); -#endif - -} - -/*man-start********************************************************************* - - 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. - - PDCurses Return Value: - N/A - - PDCurses Errors: - No errors are defined for this function. - - Portability: - 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 -/***********************************************************************/ -{ -#ifdef PDCDEBUG - if (trace_on) PDC_debug("PDC_set_title() - called:<%s>\n",title); -#endif - - return; -}