示例#1
0
static void hb_gt_dos_GetScreenContents( PHB_GT pGT )
{
   PHB_CODEPAGE cdp;
   int iRow, iCol;
   HB_BYTE bAttr, bChar, bxAttr;
   HB_USHORT usChar;

#if ! defined( __DJGPP__ )
   HB_BYTE * pScreenPtr = s_pScreenAddress;
#endif

   HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_GetScreenContents(%p)", pGT ) );

   bxAttr = 0;
   cdp = HB_GTSELF_CPTERM( pGT );
   if( ! cdp )
   {
      cdp = HB_GTSELF_CPBOX( pGT );
      if( cdp )
         bxAttr = HB_GT_ATTR_BOX;
      else
         cdp = HB_GTSELF_HOSTCP( pGT );
   }

   for( iRow = 0; iRow < s_iRows; ++iRow )
   {
      for( iCol = 0; iCol < s_iCols; ++iCol )
      {
#if defined( __DJGPP__TEXT )
         short ch_attr;
         gettext( iCol + 1, iRow + 1, iCol + 1, iRow + 1, &ch_attr );
         bChar = ch_attr & 0xFF;
         bAttr = ch_attr >> 8;
         HB_SYMBOL_UNUSED( pScreenPtr );
#elif defined( __DJGPP__ )
         int iChar, iAttr;
         ScreenGetChar( &iChar, &iAttr, iCol, iRow );
         bAttr = iAttr;
         bChar = iChar;
#else
         bChar = *pScreenPtr;
         bAttr = *( pScreenPtr + 1 );
         pScreenPtr += 2;
#endif
         usChar = hb_cdpGetU16( cdp, bChar );
         HB_GTSELF_PUTSCRCHAR( pGT, iRow, iCol, bAttr, bxAttr, usChar );
      }
   }
   HB_GTSELF_COLDAREA( pGT, 0, 0, s_iRows, s_iCols );
}
示例#2
0
PHB_CODEPAGE hb_gtHostCP( void )
{
   PHB_CODEPAGE cdp = NULL;
   PHB_GT pGT;

   HB_TRACE( HB_TR_DEBUG, ( "hb_gtHostCP()" ) );

   pGT = hb_gt_Base();
   if( pGT )
   {
      cdp = HB_GTSELF_HOSTCP( pGT );
      hb_gt_BaseFree( pGT );
   }
   return cdp;
}
示例#3
0
文件: gtcgi.c 项目: emazv72/core
static void hb_gt_cgi_WriteCon( PHB_GT pGT, const char * szText, HB_SIZE nLength )
{
   hb_gt_cgi_conOut( pGT, szText, nLength, HB_GTSELF_HOSTCP( pGT ), HB_GTSELF_TERMCP( pGT ) );
}