Exemplo n.º 1
0
VOID ClearScreen(THREAD *pstThd)
  {
  VIOCELL Cell;
  VIOPS *pVio = &pstThd->stVio;
  BYTE byBackground;
  BYTE byForeground;


  byBackground = ClrTable[pVio->wBackground].PSClr;
  byForeground = ClrTable[pVio->wForeground].PSClr;


  /*
  ** Set foreground and background colors in ANSI, so that the
  ** VioWrtTTY function will pick up the correct colors.
  */
  chAnsi[ANSI_FORE] = QueryAnsiClr(byForeground);
  chAnsi[ANSI_BACK] = QueryAnsiClr(byBackground);
  VioSetAnsi (ANSI_ON,pVio->hpsVio);
  VioWrtTTY( (PCH)chAnsi,sizeof(chAnsi),pVio->hpsVio);
  if (!pstThd->stCfg.bEnableAnsi)
    VioSetAnsi (ANSI_OFF,pVio->hpsVio);

  /*
  ** Set Presentation Space to a known state - full of spaces.
  */
  Cell.vc      = ' ';
  Cell.ExtAttr = Cell.Spare = 0;
  Cell.Attr    =  (byBackground << 4) | byForeground;
  VioWrtNCell((PBYTE)&Cell,pVio->usPsWidth * pVio->usPsDepth,0,0,pVio->hpsVio);
  VioSetOrg(0,0,pVio->hpsVio);
  VioSetCurPos(0,0,pVio->hpsVio);

  /*
  ** Zero the scroll bars.
  */
  WinSendMsg(WinWindowFromID(pstThd->hwndFrame,FID_VERTSCROLL),
             SBM_SETPOS,
             MPFROMSHORT(0),
             MPFROMSHORT(0));

  WinSendMsg(WinWindowFromID(pstThd->hwndFrame,FID_HORZSCROLL),
             SBM_SETPOS,
             MPFROMSHORT(0),
             MPFROMSHORT(0));

  WinSendMsg(WinWindowFromID(pstThd->hwndFrame,FID_VERTSCROLL),
              SBM_SETTHUMBSIZE,
              MPFROM2SHORT(pVio->usWndWidth,pVio->usPsWidth),
              (MPARAM)NULL);

  WinSendMsg(WinWindowFromID(pstThd->hwndFrame,FID_HORZSCROLL),
              SBM_SETTHUMBSIZE,
              MPFROM2SHORT(pVio->usWndDepth,pVio->usPsDepth),
              (MPARAM)NULL);

  }
Exemplo n.º 2
0
USHORT __pascal VIOSETANSI(const USHORT Ansi, const HVIO Handle)
{
  return VioSetAnsi(Ansi, Handle);
}
Exemplo n.º 3
0
void display_comment(char *cmt)
#endif
{
 unsigned char c;
 #if SFX_LEVEL>=ARJSFXV
  int is_ansi=0;
 #endif
 #if TARGET==OS2
  USHORT af;
 #endif

 #if SFX_LEVEL>=ARJ
  if(new_stderr==new_stdout)
   return;
 #endif
 #if TARGET==OS2
  fflush(stdout);
  VioGetAnsi(&af, 0);
  VioSetAnsi(ANSI_ON, 0);
 #endif
 while((c=*(cmt++))!='\0')
 {
  #if SFX_LEVEL>=ARJSFXV
   if(c==ANSI_ESC)
    is_ansi=1;
  #endif
 #if SFX_LEVEL>=ARJSFXV&&!defined(DIRECT_TO_ANSI)
  if(is_ansi)
  {
   display_ansi(c);
   if(c==LF)
    display_ansi(CR);
  }
  else
  {
 #endif
   /* Substitute non-printable control characters with "?"'s */
   #ifndef DIRECT_TO_ANSI
    if(c<' '&&c!=TAB&&c!=LF&&c!=CR)
     c=UNDISP_CHAR;
   #endif
   #if SFX_LEVEL>=ARJSFXV
    nputc((int)c);
   #else
    fputc((int)c, stdout);
   #endif
   #if SFX_LEVEL>=ARJ
    if(c==LF)
    {
     lines_scrolled++;
     if(lines_scrolled>=lines_per_page-1)
     {
      lines_scrolled=0;
      if(!yes_on_all_queries&&prompt_for_more&&is_tty(stdout))
      {
       if(!pause())
        return;
      }
     }
    }
   #endif
 #if SFX_LEVEL>=ARJSFXV&&!defined(DIRECT_TO_ANSI)
  }
 #endif
 }
 #if SFX_LEVEL>=ARJSFXV
  if(is_ansi)
  {
   #ifdef DIRECT_TO_ANSI
    printf("\x1B[0m\n");
   #else
    display_ansi(LF);
   #endif
  }
 #endif
 #if TARGET==OS2
  VioSetAnsi(af, 0);
 #endif
}