Beispiel #1
0
int PDC_get_columns(void)
/***********************************************************************/
{
#ifdef EMXVIDEO
   int rows=0;
#else
   VIOMODEINFO modeInfo={0};
#endif
   int cols=0;
   char *env_cols=NULL;
#ifdef PDCDEBUG
   if (trace_on) PDC_debug("PDC_get_columns() - called\n");
#endif

#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);
}
static int
initTest(WINDOW **win)
{
#ifdef PDCDEBUG
    PDC_debug("initTest called\n");
#endif
#ifdef TRACE
    trace(TRACE_MAXIMUM);
#endif
    initscr();
#ifdef PDCDEBUG
    PDC_debug("after initscr()\n");
#endif
#ifdef A_COLOR
    if (has_colors())
	start_color();
#endif
    width = 60;
    height = 13;		/* Create a drawing window */
    *win = newwin(height, width, (LINES - height) / 2, (COLS - width) / 2);
    if (*win == NULL) {
	exit_curses();
	return 0;
    }
    return 1;
}
Beispiel #3
0
int PDC_get_rows(void)
/***********************************************************************/
{
#ifdef EMXVIDEO
   int   cols=0;
#else
   VIOMODEINFO modeInfo={0};
#endif
   int   rows=0;
   char *env_rows=NULL;

#ifdef PDCDEBUG
   if (trace_on) PDC_debug("PDC_get_rows() - called\n");
#endif

/* use the value from LINES environment variable, if set. MH 10-Jun-92 */
/* and use the minimum of LINES and *ROWS.                MH 18-Jun-92 */
#ifdef EMXVIDEO
   v_dimen (&cols, &rows);
#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);
}
Beispiel #4
0
int	PDC_get_scrn_mode(void)
{
#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_get_scrn_mode() - called\n");
#endif
	return(OK);
}
Beispiel #5
0
int   PDC_clr_update(WINDOW *s)
/***********************************************************************/
{
   extern unsigned char atrtab[MAX_ATRTAB];

   register int   i=0,j=0;
   register chtype *srcp;
   WINDOW *w = NULL;
   bool rc=FALSE;
   COORD bufSize, bufPos;
   SMALL_RECT sr;

#ifdef PDCDEBUG
   if (trace_on) PDC_debug("PDC_clr_update() - called\n");
#endif

   w = curscr;
   if (w == (WINDOW *)NULL)
      return( ERR );
#if 0
   if (SP->full_redraw)
      PDC_clr_scrn(s); /* clear physical screen */
#endif

   s->_clear = FALSE;
   bufPos.X = bufPos.Y = 0;
   bufSize.X = COLS;
   bufSize.Y = 1;
   sr.Left = 0;
   sr.Right = COLS - 1;
   for (i = 0; i < LINES; i++)   /* update physical screen */
   {
      if (s != w)
         memcpy(w->_y[i], s->_y[i], COLS * sizeof(chtype));

      srcp = s->_y[i];

      sr.Top = i;
      sr.Bottom = i;

      for (j = 0; j < COLS; j++)
      {
         ci[j].Char.AsciiChar = *(srcp+j) & A_CHARTEXT;
         ci[j].Attributes = (chtype_attr(*(srcp+j)) & 0xFF00) >> 8 ;
#ifdef HIDE_ATTR
         ci[j].Attributes =  FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
#endif
      }
      WriteConsoleOutput(hConOut, ci, bufSize, bufPos, &sr);

      if (SP->refrbrk && (SP->cbreak || SP->raw_inp)) 
      {
         rc = PDC_breakout();
         if (rc)
            break;
      }
   }
   return( OK );
}
Beispiel #6
0
int	PDC_get_attribute(void)
{
#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_get_attribute() - called\n");
#endif
/* doesnt do anything !! */
	return(0);
}
Beispiel #7
0
bool  PDC_transform_line(register int lineno)
/***********************************************************************/
{
   extern unsigned   char atrtab[MAX_ATRTAB];

   register int j=0;
   register chtype *srcp;
   int   x=0;
   int   endx=0;
   int   len=0;
   bool rc=FALSE;
   COORD bufSize, bufPos;
   SMALL_RECT sr;

#ifdef PDCDEBUG
   if (trace_on) PDC_debug("PDC_transform_line() - called: lineno=%d\n",lineno);
#endif

   if (curscr == (WINDOW *)NULL)
      return( FALSE );

   x = curscr->_firstch[lineno];
   endx = curscr->_lastch[lineno];
   srcp = curscr->_y[lineno] + x;
   len = endx-x+1;

   bufPos.X = bufPos.Y = 0;

   bufSize.X = len;
   bufSize.Y = 1;

   sr.Top = lineno;
   sr.Bottom = lineno;
   sr.Left = x;
   sr.Right = endx;

   for (j = 0; j < len; j++)
   {
      ci[j].Char.AsciiChar = *(srcp+j) & A_CHARTEXT;
      ci[j].Attributes = (chtype_attr(*(srcp+j)) & 0xFF00) >> 8 ;
#ifdef HIDE_ATTR
      ci[j].Attributes =  FOREGROUND_RED | FOREGROUND_GREEN | FOREGROUND_BLUE;
#endif
   }

   WriteConsoleOutput(hConOut, ci, bufSize, bufPos, &sr);

   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);
}
Beispiel #8
0
int vwprintw (WINDOW *win, const char *fmt, va_list args)
{
    char buf[1024];

    if (trace_on)
        PDC_debug ("vwprintw() - called\n");
    _vsnprintf (buf, sizeof(buf), fmt, args);
    return wprintw (win, buf);
}
Beispiel #9
0
int	PDC_set_80x25(void)
{

#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_set_80x25() - called\n");
#endif

	return(OK);
}
Beispiel #10
0
int	PDC_set_scrn_mode(int new_mode)
{

#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_set_scrn_mode() - called\n");
#endif

	return(OK); /* this is N/A */
}
Beispiel #11
0
int	PDC_set_rows(int rows)
{

#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_set_rows() - called\n");
#endif

	return(0);
}
Beispiel #12
0
int	PDC_set_font(int size)
{

#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_set_font() - called\n");
#endif

	return(OK);
}
Beispiel #13
0
bool	PDC_get_ctrl_break()
#endif
/***********************************************************************/
{
#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_get_ctrl_break() - called\n");
#endif
	return(FALSE);
}
Beispiel #14
0
bool PDC_check_bios_key()
#endif
/***********************************************************************/
{
#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_check_bios_key() - called\n");
#endif
	return(XCurses_kbhit());
}         
Beispiel #15
0
int   PDC_scroll(int urow, int lcol, int lrow, int rcol, int nlines, chtype attr)
/***********************************************************************/
{
#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

   return( OK );
}
Beispiel #16
0
int	PDC_set_cursor_mode( int startrow, int endrow )
{

#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_set_cursor_mode() - called: startrow %d endrow %d\n",startrow,endrow);
#endif

	return(OK);
}
Beispiel #17
0
int	PDC_sanity_check(int adapter)
{
#ifdef PDCDEBUG
   if (trace_on) 
      PDC_debug("PDC_sanity_check() - called: Adapter %d\n",adapter);
#endif

   return (adapter);
}
Beispiel #18
0
int	PDC_get_font(void)
{

#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_get_font() - called\n");
#endif

	return(0); /* this is N/A */
}
Beispiel #19
0
int	PDC_get_cur_col(void)
{
#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_get_cur_col() - called\n");
#endif

   GetConsoleScreenBufferInfo(hConOut, &scr);
   return (scr.dwCursorPosition.X);
}
Beispiel #20
0
int	PDC_get_buffer_rows(void)
{

#ifdef PDCDEBUG
   if (trace_on) PDC_debug("PDC_get_buffer_rows() - called\n");
#endif

   GetConsoleScreenBufferInfo( hConOut, &scr );
   return ( scr.dwSize.Y );
}
Beispiel #21
0
unsigned long PDC_get_input_fd()
#endif
/***********************************************************************/
{

#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_get_input_fd() - called\n");
#endif

	return XCurses_get_input_fd();
}
Beispiel #22
0
int	PDC_get_cursor_pos(int *row, int *col)
{
#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_get_cursor_pos() - called\n");
#endif

   GetConsoleScreenBufferInfo(hConOut, &scr);
   *col = scr.dwCursorPosition.X;
   *row = scr.dwCursorPosition.Y;
   return(OK);
}
Beispiel #23
0
int	PDC_get_cursor_mode(void)
{
 CONSOLE_CURSOR_INFO ci;
    
#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_get_cursor_mode() - called\n");
#endif

 GetConsoleCursorInfo(hConOut, &ci);
/* size is between 1 and 100, so convert it */
 return ((ci.dwSize * 32 / 100) - 1);
}
Beispiel #24
0
int	PDC_query_adapter_type(void)
{
	int	retval = _NONE;

#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_query_adapter_type() - called\n");
#endif

	SP->mono = FALSE;
	retval = _VGACOLOR;

	return (retval);
}
Beispiel #25
0
int	PDC_get_columns(void)
{
#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_get_columns() - called\n");
#endif

   GetConsoleScreenBufferInfo(hConOut, &scr);
#if FGC0
   return ( scr.dwSize.X ); /* Allow the whole screen to be accessed */
#else
   return (scr.srWindow.Right - scr.srWindow.Left + 1);
#endif
}
Beispiel #26
0
int	PDC_CDECL	PDC_clearclipboard( void )
{
#ifdef PDCDEBUG
	if (trace_on) PDC_debug("PDC_clearclipboard() - called\n");
#endif

	if (pdc_DOS_clipboard != NULL) 
	{
		free(pdc_DOS_clipboard);
		pdc_DOS_clipboard = NULL;
	}
	return PDC_CLIP_SUCCESS;
}
Beispiel #27
0
int PDC_get_cursor_pos(int *row, int *col)
/***********************************************************************/
{
#ifdef PDCDEBUG
   if (trace_on) PDC_debug("PDC_get_cursor_pos() - called\n");
#endif

#ifdef EMXVIDEO
   v_getxy (col, row);
#else
   VioGetCurPos((PUSHORT)row,(PUSHORT)col,0);
#endif
   return( OK );
}
Beispiel #28
0
int   PDC_cursor_on(void)
/***********************************************************************/
{
CONSOLE_CURSOR_INFO cci;

#ifdef PDCDEBUG
   if (trace_on) PDC_debug("PDC_cursor_on() - called\n");
#endif

   if (!SP->visible_cursor)
   {
      SP->visible_cursor = TRUE;
      GetConsoleCursorInfo(hConOut,&cci);
      cci.bVisible = TRUE;
      SetConsoleCursorInfo(hConOut,&cci);
   }
   return( OK );
}
Beispiel #29
0
int   PDC_gotoxy(int row, int col)
/***********************************************************************/
{
   COORD coord;

#ifdef PDCDEBUG
   if (trace_on) PDC_debug("PDC_gotoxy() - called: row %d col %d\n",row,col);
#endif

   if ((SP->cursrow == row) && (SP->curscol == col))
   return( OK );

   coord.X = col;
   coord.Y = row;

   SetConsoleCursorPosition(hConOut, coord);
   return(OK);
}
Beispiel #30
0
int PDC_get_scrn_mode( VIOMODEINFO *modeinfo )
#endif
/***********************************************************************/
{
#ifndef EMXVIDEO
   VIOMODEINFO amodeinfo;
#endif
#ifdef PDCDEBUG
   if (trace_on) PDC_debug("PDC_get_scrn_mode() - called\n");
#endif
#ifdef EMXVIDEO
   return(ERR);
#else
   VioGetMode ( &amodeinfo, 0 );
   *modeinfo = amodeinfo;
   return(OK);
#endif
}