diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 30181e6f7c..147a5d2e5c 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -17,6 +17,34 @@ past entries belonging to author(s): Viktor Szakats. */ +2009-07-10 11:40 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * include/hbgtcore.h + * include/hbapigt.h + * source/rtl/gtdos/gtdos.c + * source/rtl/gtwin/gtwin.c + * source/rtl/gtxwc/gtxwc.c + * source/rtl/gtcrs/gtcrs.c + * source/rtl/gtstd/gtstd.c + * source/rtl/gttrm/gttrm.c + * source/rtl/gtcgi/gtcgi.c + * source/rtl/gtapi.c + * source/rtl/gtos2/gtos2.c + * source/rtl/hbgtcore.c + * source/rtl/gtsln/gtsln.c + * source/rtl/gtpca/gtpca.c + * source/rtl/gtwvt/gtwvt.c + * contrib/hbct/screen2.c + * contrib/hbct/ctwin.c + * contrib/hbct/screen1.c + * contrib/hbnf/ftattr.c + * Changed color representation to be 'int' in all places. + This means changes in high level and low level GT interfaces. + ; QUESTION: In hbct UCHAR is used in a few places, I didn't want to + touch it. + ; Please test and review. + ; TODO: Clean char type usage (from int, UCHAR, BYTE, USHORT to what?) + ; TODO: Clean attr type usage to be hbU8, or HB_ATTR, or else? + 2009-07-10 10:35 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * include/hbapigt.h * source/rtl/gtapi.c diff --git a/harbour/contrib/hbct/ctwin.c b/harbour/contrib/hbct/ctwin.c index 6461f9a334..45f9873021 100644 --- a/harbour/contrib/hbct/ctwin.c +++ b/harbour/contrib/hbct/ctwin.c @@ -576,7 +576,7 @@ static int hb_ctw_MaxWindow( PHB_GTCTW pCTW ) static int hb_ctw_CreateWindow( PHB_GTCTW pCTW, int iTop, int iLeft, int iBottom, int iRight, BOOL fClear, int iColor, BOOL fVisible ) { PHB_CT_WND pWnd; - BYTE bAttr, bColor; + BYTE bAttr; USHORT usChar; int iRow, iCol, iHeight, iWidth, iTmp; long lIndex; @@ -668,7 +668,8 @@ static int hb_ctw_CreateWindow( PHB_GTCTW pCTW, int iTop, int iLeft, int iBottom if( pWnd->iShadowAttr >= 0 ) fClear = TRUE; bAttr = 0; - bColor = iColor >= 0 ? ( BYTE ) iColor : ( BYTE ) HB_GTSELF_GETCOLOR( pCTW->pGT ); + if( iColor < 0 ) + iColor = HB_GTSELF_GETCOLOR( pCTW->pGT ); usChar = ( USHORT ) HB_GTSELF_GETCLEARCHAR( pCTW->pGT ); lIndex = 0; @@ -676,14 +677,14 @@ static int hb_ctw_CreateWindow( PHB_GTCTW pCTW, int iTop, int iLeft, int iBottom { for( iCol = pWnd->iFirstCol; iCol < pWnd->iFirstCol + pWnd->iWidth; ++iCol ) { - if( !fClear && !HB_GTSELF_GETSCRCHAR( pCTW->pGT, iRow, iCol, &bColor, &bAttr, &usChar ) ) + if( !fClear && !HB_GTSELF_GETSCRCHAR( pCTW->pGT, iRow, iCol, &iColor, &bAttr, &usChar ) ) { usChar = ( USHORT ) HB_GTSELF_GETCLEARCHAR( pCTW->pGT ); - bColor = ( BYTE ) HB_GTSELF_GETCOLOR( pCTW->pGT ); + iColor = HB_GTSELF_GETCOLOR( pCTW->pGT ); bAttr = 0; } pWnd->screenBuffer[ lIndex ].c.usChar = usChar; - pWnd->screenBuffer[ lIndex ].c.bColor = bColor; + pWnd->screenBuffer[ lIndex ].c.bColor = ( BYTE ) iColor; pWnd->screenBuffer[ lIndex ].c.bAttr = 0; ++lIndex; } @@ -1610,12 +1611,12 @@ static void hb_ctw_gt_GetScrCursor( PHB_GT pGT, int * piRow, int * piCol, int * } static BOOL hb_ctw_gt_GetScrChar( PHB_GT pGT, int iRow, int iCol, - BYTE * pbColor, BYTE * pbAttr, USHORT * pusChar ) + int * piColor, BYTE * pbAttr, USHORT * pusChar ) { PHB_GTCTW pCTW; int iWindow, iShadow; - HB_TRACE(HB_TR_DEBUG, ("hb_ctw_gt_GetScrChar(%p,%d,%d,%p,%p,%p)", pGT, iRow, iCol, pbColor, pbAttr, pusChar)); + HB_TRACE(HB_TR_DEBUG, ("hb_ctw_gt_GetScrChar(%p,%d,%d,%p,%p,%p)", pGT, iRow, iCol, piColor, pbAttr, pusChar)); pCTW = HB_GTCTW_GET( pGT ); iWindow = iShadow = 0; @@ -1637,29 +1638,29 @@ static BOOL hb_ctw_gt_GetScrChar( PHB_GT pGT, int iRow, int iCol, { long lIndex = ( long ) iRow * pWnd->iWidth + iCol; *pusChar = pWnd->screenBuffer[ lIndex ].c.usChar; - *pbColor = pWnd->screenBuffer[ lIndex ].c.bColor; + *piColor = pWnd->screenBuffer[ lIndex ].c.bColor; *pbAttr = pWnd->screenBuffer[ lIndex ].c.bAttr; } else return FALSE; } - else if( ! HB_GTSUPER_GETSCRCHAR( pGT, iRow, iCol, pbColor, pbAttr, pusChar ) ) + else if( ! HB_GTSUPER_GETSCRCHAR( pGT, iRow, iCol, piColor, pbAttr, pusChar ) ) return FALSE; if( iShadow > 0 ) { PHB_CT_WND pWnd = pCTW->windows[ iShadow & ~HB_CTW_SHADOW_MASK ]; if( pWnd->iShadowAttr >= 0 ) - *pbColor = ( BYTE ) pWnd->iShadowAttr; + *piColor = pWnd->iShadowAttr; else if( pWnd->iShadowAttr == HB_CTW_SHADOW_EXT || pWnd->iShadowAttr == HB_CTW_SHADOW_EXT2 ) { - if( ( *pbColor & 0x80 ) == 0 ) - *pbColor &= 0x0F; - if( ( *pbColor & 0x08 ) == 0 ) - *pbColor &= 0xF0; - if( ( *pbColor &= 0x77 ) == 0 || ( iShadow & HB_CTW_SHADOW_MASK ) ) - *pbColor = 0x07; + if( ( *piColor & 0x80 ) == 0 ) + *piColor &= 0x0F; + if( ( *piColor & 0x08 ) == 0 ) + *piColor &= 0xF0; + if( ( *piColor &= 0x77 ) == 0 || ( iShadow & HB_CTW_SHADOW_MASK ) ) + *piColor = 0x07; } *pbAttr |= HB_GT_ATTR_SHADOW; } @@ -1668,19 +1669,19 @@ static BOOL hb_ctw_gt_GetScrChar( PHB_GT pGT, int iRow, int iCol, } static BOOL hb_ctw_gt_GetChar( PHB_GT pGT, int iRow, int iCol, - BYTE * pbColor, BYTE * pbAttr, USHORT * pusChar ) + int * piColor, BYTE * pbAttr, USHORT * pusChar ) { PHB_GTCTW pCTW; PHB_CT_WND pWnd; int iWindow; - HB_TRACE(HB_TR_DEBUG, ("hb_ctw_gt_GetChar(%p,%d,%d,%p,%p,%p)", pGT, iRow, iCol, pbColor, pbAttr, pusChar)); + HB_TRACE(HB_TR_DEBUG, ("hb_ctw_gt_GetChar(%p,%d,%d,%p,%p,%p)", pGT, iRow, iCol, piColor, pbAttr, pusChar)); pCTW = HB_GTCTW_GET( pGT ); iWindow = HB_CTW_GETCURRENT( pCTW ); if( iWindow == 0 ) /* TODO: it may badly interacts with character translations */ - return HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, pbColor, pbAttr, pusChar ); + return HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, piColor, pbAttr, pusChar ); pWnd = pCTW->windows[ iWindow ]; iRow += pWnd->iTopMargin; @@ -1690,7 +1691,7 @@ static BOOL hb_ctw_gt_GetChar( PHB_GT pGT, int iRow, int iCol, { long lIndex = ( long ) iRow * pWnd->iWidth + iCol; *pusChar = pWnd->screenBuffer[ lIndex ].c.usChar; - *pbColor = pWnd->screenBuffer[ lIndex ].c.bColor; + *piColor = pWnd->screenBuffer[ lIndex ].c.bColor; *pbAttr = pWnd->screenBuffer[ lIndex ].c.bAttr; return TRUE; } @@ -1699,12 +1700,12 @@ static BOOL hb_ctw_gt_GetChar( PHB_GT pGT, int iRow, int iCol, } static BOOL hb_ctw_gt_PutChar( PHB_GT pGT, int iRow, int iCol, - BYTE bColor, BYTE bAttr, USHORT usChar ) + int iColor, BYTE bAttr, USHORT usChar ) { PHB_GTCTW pCTW; int iWindow, iCurrWindow; - HB_TRACE(HB_TR_DEBUG, ("hb_ctw_gt_PutChar(%p,%d,%d,%d,%d,%hu)", pGT, iRow, iCol, (int)bColor, (int)bAttr, (int)usChar)); + HB_TRACE(HB_TR_DEBUG, ("hb_ctw_gt_PutChar(%p,%d,%d,%d,%d,%hu)", pGT, iRow, iCol, iColor, (int)bAttr, (int)usChar)); pCTW = HB_GTCTW_GET( pGT ); iWindow = iCurrWindow = HB_CTW_GETCURRENT( pCTW ); @@ -1729,13 +1730,14 @@ static BOOL hb_ctw_gt_PutChar( PHB_GT pGT, int iRow, int iCol, { int iShadow = pCTW->pShadowMap[ lIndex ] & ~HB_CTW_SHADOW_MASK; if( pCTW->windows[ iShadow ]->iShadowAttr >= 0 && - ( BYTE ) pCTW->windows[ iShadow ]->iShadowAttr == bColor ) + pCTW->windows[ iShadow ]->iShadowAttr == iColor ) { - BYTE bClr, bAtr; + int iClr; + BYTE bAtr; USHORT usCh; - if( HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, &bClr, &bAtr, &usCh ) ) + if( HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, &iClr, &bAtr, &usCh ) ) { - if( usCh == usChar && bClr == bColor ) + if( usCh == usChar && iClr == iColor ) return TRUE; } } @@ -1776,7 +1778,7 @@ static BOOL hb_ctw_gt_PutChar( PHB_GT pGT, int iRow, int iCol, long lIndex = ( long ) iWndRow * pWnd->iWidth + iWndCol; pWnd->screenBuffer[ lIndex ].c.usChar = usChar; - pWnd->screenBuffer[ lIndex ].c.bColor = bColor; + pWnd->screenBuffer[ lIndex ].c.bColor = ( BYTE ) iColor; pWnd->screenBuffer[ lIndex ].c.bAttr = bAttr; if( ! pWnd->fHidden ) { @@ -1792,7 +1794,7 @@ static BOOL hb_ctw_gt_PutChar( PHB_GT pGT, int iRow, int iCol, return FALSE; } - return HB_GTSUPER_PUTCHAR( pGT, iRow, iCol, bColor, bAttr, usChar ); + return HB_GTSUPER_PUTCHAR( pGT, iRow, iCol, iColor, bAttr, usChar ); } static BOOL hb_ctw_gt_Resize( PHB_GT pGT, int iRows, int iCols ) @@ -2096,10 +2098,13 @@ static int hb_ctw_gt_ReadKey( PHB_GT pGT, int iEventMask ) static UINT32 hb_ctw_gt_cellValue( PHB_GT pGT, int iRow, int iCol ) { HB_SCREENCELL cell; + int iColor; cell.uiValue = 0; HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, - &cell.c.bColor, &cell.c.bAttr, &cell.c.usChar ); + &iColor, &cell.c.bAttr, &cell.c.usChar ); + cell.c.bColor = ( BYTE ) iColor; + return cell.uiValue; } diff --git a/harbour/contrib/hbct/screen1.c b/harbour/contrib/hbct/screen1.c index bf8db9808c..9ee37aec55 100644 --- a/harbour/contrib/hbct/screen1.c +++ b/harbour/contrib/hbct/screen1.c @@ -102,7 +102,8 @@ HB_FUNC( SCREENATTR ) { int iRow, iCol; - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; hb_gtGetPos( &iRow, &iCol ); @@ -111,10 +112,10 @@ HB_FUNC( SCREENATTR ) if( HB_ISNUM( 2 ) ) iCol = hb_parni( 2 ); - if( hb_gtGetChar( iRow, iCol, &bColor, &bAttr, &usChar ) != HB_SUCCESS ) - bColor = 0; + if( hb_gtGetChar( iRow, iCol, &iColor, &bAttr, &usChar ) != HB_SUCCESS ) + iColor = 0; - hb_retni( ( int ) bColor ); + hb_retni( iColor ); } @@ -248,9 +249,10 @@ HB_FUNC( SAYSCREEN ) i = iCol; do { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; - if( hb_gtGetChar( iRow, i, &bColor, &bAttr, &usChar ) != HB_SUCCESS ) + if( hb_gtGetChar( iRow, i, &iColor, &bAttr, &usChar ) != HB_SUCCESS ) { if( ++iRow > hb_gtMaxRow() ) break; @@ -258,7 +260,7 @@ HB_FUNC( SAYSCREEN ) i = iCol; } else - hb_gtPutChar( iRow, i++, bColor, bAttr, ( UCHAR ) *szText++ ); + hb_gtPutChar( iRow, i++, iColor, bAttr, ( UCHAR ) *szText++ ); } while( --ulLen ); hb_gtEndWrite(); @@ -339,12 +341,13 @@ HB_FUNC( CLEARWIN ) if( hb_ctGetWinCord( &iTop, &iLeft, &iBottom, &iRight ) ) { - BYTE bColor, bChar; + int iColor; + BYTE bChar; - bColor = ( BYTE ) hb_ctGetClearColor( 5 ); - bChar = ( BYTE ) hb_ctGetClearChar( 6 ); + iColor = hb_ctGetClearColor( 5 ); + bChar = ( BYTE ) hb_ctGetClearChar( 6 ); - hb_gtScrollEx( iTop, iLeft, iBottom, iRight, bColor, bChar, 0, 0 ); + hb_gtScrollEx( iTop, iLeft, iBottom, iRight, iColor, bChar, 0, 0 ); } hb_retc_null(); @@ -390,14 +393,15 @@ HB_FUNC( INVERTWIN ) int iCol = iLeft; while( iCol <= iRight ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; - hb_gtGetChar( iTop, iCol, &bColor, &bAttr, &usChar ); - bColor = ( bColor & 0x88 ) | - ( ( bColor & 0x07 ) << 4 ) | - ( ( bColor >> 4 ) & 0x07 ); - hb_gtPutChar( iTop, iCol, bColor, bAttr, usChar ); + hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar ); + iColor = ( iColor & 0x88 ) | + ( ( iColor & 0x07 ) << 4 ) | + ( ( iColor >> 4 ) & 0x07 ); + hb_gtPutChar( iTop, iCol, iColor, bAttr, usChar ); ++iCol; } ++iTop; @@ -486,13 +490,14 @@ HB_FUNC( UNTEXTWIN ) int iCol = iLeft; while( iCol <= iRight ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; - hb_gtGetChar( iTop, iCol, &bColor, &bAttr, &usChar ); + hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar ); if( ucInit <= ucEnd ? ( usChar < ucInit || usChar > ucEnd ) : ( usChar > ucEnd && usChar < ucInit ) ) - hb_gtPutChar( iTop, iCol, bColor, bAttr, ucRepl ); + hb_gtPutChar( iTop, iCol, iColor, bAttr, ucRepl ); ++iCol; } ++iTop; @@ -565,12 +570,13 @@ HB_FUNC( CHARWIN ) int iCol = iLeft; while( iCol <= iRight ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; - hb_gtGetChar( iTop, iCol, &bColor, &bAttr, &usChar ); + hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar ); if( fAll || usChar == ucOldChar ) - hb_gtPutChar( iTop, iCol, bColor, bAttr, ucNewChar ); + hb_gtPutChar( iTop, iCol, iColor, bAttr, ucNewChar ); ++iCol; } ++iTop; @@ -644,11 +650,12 @@ HB_FUNC( COLORWIN ) int iCol = iLeft; while( iCol <= iRight ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; - hb_gtGetChar( iTop, iCol, &bColor, &bAttr, &usChar ); - if( fAll || bColor == ucOldColor ) + hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar ); + if( fAll || iColor == ucOldColor ) hb_gtPutChar( iTop, iCol, ucNewColor, bAttr, usChar ); ++iCol; } @@ -707,9 +714,10 @@ HB_FUNC( SCREENTEXT ) int iCol = iLeft; while( iCol <= iRight ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; - hb_gtGetChar( iTop, iCol, &bColor, &bAttr, &usChar ); + hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar ); *szText++ = ( char ) usChar; ++iCol; } @@ -773,11 +781,12 @@ HB_FUNC( COLORREPL ) iCol = 0; while( iCol <= iMaxCol ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; - hb_gtGetChar( iRow, iCol, &bColor, &bAttr, &usChar ); - if( fAll || bColor == ucOldColor ) + hb_gtGetChar( iRow, iCol, &iColor, &bAttr, &usChar ); + if( fAll || iColor == ucOldColor ) hb_gtPutChar( iRow, iCol, ucNewColor, bAttr, usChar ); ++iCol; } diff --git a/harbour/contrib/hbct/screen2.c b/harbour/contrib/hbct/screen2.c index 3ccd443b27..faa64c5dbc 100644 --- a/harbour/contrib/hbct/screen2.c +++ b/harbour/contrib/hbct/screen2.c @@ -125,7 +125,7 @@ HB_FUNC( SAYSPREAD ) if( iRow >= 0 && iCol >= 0 && iRow <= iMaxRow && iCol <= iMaxCol ) { - BYTE bColor = hb_gtGetCurrColor(); + int iColor = hb_gtGetCurrColor(); ulPos = ulLen >> 1; ulLen = ulLen & 1; @@ -139,7 +139,7 @@ HB_FUNC( SAYSPREAD ) do { for( ul = 0; ul < ulLen && iCol + ( int ) ul <= iMaxCol; ++ul ) - hb_gtPutChar( iRow, iCol + ( int ) ul, bColor, 0, ( UCHAR ) szText[ulPos + ul] ); + hb_gtPutChar( iRow, iCol + ( int ) ul, iColor, 0, ( UCHAR ) szText[ulPos + ul] ); ulLen += 2; if( lDelay ) { @@ -181,7 +181,7 @@ HB_FUNC( SAYMOVEIN ) iCol = hb_parni( 4 ); if( iRow >= 0 && iCol >= 0 && iRow <= iMaxRow && iCol <= iMaxCol ) { - BYTE bColor = hb_gtGetCurrColor(); + int iColor = hb_gtGetCurrColor(); iNewCol = iCol + ( int ) ulLen; if( fBack ) @@ -198,14 +198,14 @@ HB_FUNC( SAYMOVEIN ) if( iCol <= iMaxCol ) { for( ul = 0; ul < ulChars; ++ul ) - hb_gtPutChar( iRow, iCol + ( int ) ul, bColor, 0, ( UCHAR ) szText[ul] ); + hb_gtPutChar( iRow, iCol + ( int ) ul, iColor, 0, ( UCHAR ) szText[ul] ); } --iCol; } else { for( ul = 0; ul < ulChars; ++ul ) - hb_gtPutChar( iRow, iCol + ( int ) ul, bColor, 0, ( UCHAR ) szText[ul] ); + hb_gtPutChar( iRow, iCol + ( int ) ul, iColor, 0, ( UCHAR ) szText[ul] ); --szText; } if( ( int ) ulChars + iCol <= iMaxCol ) @@ -251,7 +251,8 @@ HB_FUNC( CLEARSLOW ) if( iTop >= 0 && iLeft >= 0 && iTop <= iBottom && iLeft <= iRight ) { - char pszFrame[2], bColor = ( BYTE ) hb_gtGetCurrColor(); + char pszFrame[ 2 ]; + int iColor = hb_gtGetCurrColor(); double dX, dY, dXX, dYY; pszFrame[0] = ( char ) ucChar; @@ -274,7 +275,7 @@ HB_FUNC( CLEARSLOW ) hb_gtBeginWrite(); for( ;; ) { - hb_gtBoxEx( iTop, iLeft, iBottom, iRight, pszFrame, bColor ); + hb_gtBoxEx( iTop, iLeft, iBottom, iRight, pszFrame, iColor ); if( lDelay ) { hb_gtEndWrite(); @@ -340,11 +341,12 @@ HB_FUNC( SCREENSTR ) iC = iCol; do { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; - hb_gtGetChar( iRow, iC, &bColor, &bAttr, &usChar ); + hb_gtGetChar( iRow, iC, &iColor, &bAttr, &usChar ); *szText++ = ( char ) usChar; - *szText++ = ( char ) bColor; + *szText++ = ( char ) iColor; } while( --ulCount && ++iC <= iMaxCol ); } @@ -385,8 +387,8 @@ HB_FUNC( STRSCREEN ) do { USHORT usChar = ( UCHAR ) *szText++; - BYTE bColor = *szText++; - hb_gtPutChar( iRow, iC, bColor, 0, usChar ); + int iColor = *szText++; + hb_gtPutChar( iRow, iC, iColor, 0, usChar ); ulLen -= 2; } while( ulLen && ++iC <= iMaxCol ); @@ -437,8 +439,8 @@ HB_FUNC( _HB_CTDSPTIME ) iHour -= 12; else if( iHour == 0 ) iHour = 12; - szTime[0] = ( iHour / 10 ) + '0'; - szTime[1] = ( iHour % 10 ) + '0'; + szTime[0] = ( char ) ( iHour / 10 ) + '0'; + szTime[1] = ( char ) ( iHour % 10 ) + '0'; } if( szTime[0] == '0' ) diff --git a/harbour/contrib/hbnf/ftattr.c b/harbour/contrib/hbnf/ftattr.c index 89e65d8c80..917b5ba6d3 100644 --- a/harbour/contrib/hbnf/ftattr.c +++ b/harbour/contrib/hbnf/ftattr.c @@ -202,10 +202,11 @@ HB_FUNC( FT_SAVEATT ) int iCol = iLeft; while( iCol <= iRight ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; - hb_gtGetChar( iTop, iCol, &bColor, &bAttr, &usChar ); - *pBuffer++ = ( char ) bColor; + hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar ); + *pBuffer++ = ( char ) iColor; ++iCol; } ++iTop; @@ -414,11 +415,12 @@ HB_FUNC( FT_RESTATT ) int iCol = iLeft; while( ulLen && iCol <= iRight ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; - hb_gtGetChar( iTop, iCol, &bColor, &bAttr, &usChar ); - bColor = *pAttrib++; - hb_gtPutChar( iTop, iCol, bColor, bAttr, usChar ); + hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar ); + iColor = *pAttrib++; + hb_gtPutChar( iTop, iCol, iColor, bAttr, usChar ); ++iCol; --ulLen; } diff --git a/harbour/include/hbapigt.h b/harbour/include/hbapigt.h index d5c0183aff..93a6527052 100644 --- a/harbour/include/hbapigt.h +++ b/harbour/include/hbapigt.h @@ -181,7 +181,7 @@ extern HB_EXPORT HB_ERRCODE hb_gtColorsToString( int * pColors, int iColorCount, extern HB_EXPORT HB_ERRCODE hb_gtDispBegin( void ); extern HB_EXPORT int hb_gtDispCount( void ); extern HB_EXPORT HB_ERRCODE hb_gtDispEnd( void ); -extern HB_EXPORT HB_ERRCODE hb_gtDrawShadow( int iTop, int iLeft, int iBottom, int iRight, BYTE bColor ); +extern HB_EXPORT HB_ERRCODE hb_gtDrawShadow( int iTop, int iLeft, int iBottom, int iRight, int iColor ); extern HB_EXPORT HB_ERRCODE hb_gtGetBlink( BOOL * pbBlink ); extern HB_EXPORT HB_ERRCODE hb_gtGetColorStr( char * pszColorString ); extern HB_EXPORT HB_ERRCODE hb_gtGetCursor( int * piCursorShape ); @@ -198,14 +198,14 @@ extern HB_EXPORT HB_ERRCODE hb_gtRectSize( int iTop, int iLeft, int iBottom, int extern HB_EXPORT HB_ERRCODE hb_gtRepChar( int iRow, int iCol, USHORT usChar, ULONG ulCount ); extern HB_EXPORT HB_ERRCODE hb_gtSave( int iTop, int iLeft, int iBottom, int iRight, void * pScrBuff ); extern HB_EXPORT HB_ERRCODE hb_gtRest( int iTop, int iLeft, int iBottom, int iRight, const void * pScrBuff ); -extern HB_EXPORT HB_ERRCODE hb_gtGetChar( int iRow, int iCol, BYTE * pbColor, BYTE * pbAttr, USHORT * pusChar ); -extern HB_EXPORT HB_ERRCODE hb_gtPutChar( int iRow, int iCol, BYTE bColor, BYTE bAttr, USHORT usChar ); +extern HB_EXPORT HB_ERRCODE hb_gtGetChar( int iRow, int iCol, int * piColor, BYTE * pbAttr, USHORT * pusChar ); +extern HB_EXPORT HB_ERRCODE hb_gtPutChar( int iRow, int iCol, int iColor, BYTE bAttr, USHORT usChar ); extern HB_EXPORT HB_ERRCODE hb_gtBeginWrite( void ); extern HB_EXPORT HB_ERRCODE hb_gtEndWrite( void ); extern HB_EXPORT HB_ERRCODE hb_gtScrDim( int * piHeight, int * piWidth ); extern HB_EXPORT HB_ERRCODE hb_gtScroll( int iTop, int iLeft, int iBottom, int iRight, int iRows, int iCols ); extern HB_EXPORT HB_ERRCODE hb_gtScrollUp( int iRows ); -extern HB_EXPORT HB_ERRCODE hb_gtSetAttribute( int iTop, int iLeft, int iBottom, int iRight, BYTE bColor ); +extern HB_EXPORT HB_ERRCODE hb_gtSetAttribute( int iTop, int iLeft, int iBottom, int iRight, int iColor ); extern HB_EXPORT HB_ERRCODE hb_gtSetBlink( BOOL bBlink ); extern HB_EXPORT HB_ERRCODE hb_gtSetColorStr( const char * pszColorString ); extern HB_EXPORT HB_ERRCODE hb_gtSetCursor( int iCursorShape ); @@ -230,8 +230,8 @@ extern HB_EXPORT int hb_gtGetClearColor( void ); extern HB_EXPORT HB_ERRCODE hb_gtSetClearColor( int ); extern HB_EXPORT int hb_gtGetClearChar( void ); extern HB_EXPORT HB_ERRCODE hb_gtSetClearChar( int ); -extern HB_EXPORT HB_ERRCODE hb_gtGetScrChar( int iRow, int iCol, BYTE * pbColor, BYTE * pbAttr, USHORT * pusChar ); -extern HB_EXPORT HB_ERRCODE hb_gtPutScrChar( int iRow, int iCol, BYTE bColor, BYTE bAttr, USHORT usChar ); +extern HB_EXPORT HB_ERRCODE hb_gtGetScrChar( int iRow, int iCol, int * piColor, BYTE * pbAttr, USHORT * pusChar ); +extern HB_EXPORT HB_ERRCODE hb_gtPutScrChar( int iRow, int iCol, int iColor, BYTE bAttr, USHORT usChar ); extern HB_EXPORT HB_ERRCODE hb_gtFlush( void ); extern HB_EXPORT HB_ERRCODE hb_gtGetPosEx( int * piRow, int * piCol ); extern HB_EXPORT HB_ERRCODE hb_gtScrollEx( int iTop, int iLeft, int iBottom, int iRight, int iColor, int iChar, int iRows, int iCols ); diff --git a/harbour/include/hbgtcore.h b/harbour/include/hbgtcore.h index 3d4b246959..df6930a4bf 100644 --- a/harbour/include/hbgtcore.h +++ b/harbour/include/hbgtcore.h @@ -122,7 +122,7 @@ typedef struct void (* SemiCold) ( HB_GT_PTR ); void (* ColdArea) ( HB_GT_PTR, int, int, int, int ); void (* ExposeArea) ( HB_GT_PTR, int, int, int, int ); - void (* ScrollArea) ( HB_GT_PTR, int, int, int, int, BYTE, BYTE, int, int ); + void (* ScrollArea) ( HB_GT_PTR, int, int, int, int, int, BYTE, int, int ); void (* TouchLine) ( HB_GT_PTR, int ); void (* TouchCell) ( HB_GT_PTR, int, int ); void (* Redraw) ( HB_GT_PTR, int, int, int ); @@ -150,30 +150,30 @@ typedef struct int (* GetCursorStyle) ( HB_GT_PTR ); void (* SetCursorStyle) ( HB_GT_PTR, int ); void (* GetScrCursor) ( HB_GT_PTR, int *, int *, int * ); - BOOL (* GetScrChar) ( HB_GT_PTR, int, int, BYTE *, BYTE *, USHORT * ); - BOOL (* PutScrChar) ( HB_GT_PTR, int, int, BYTE, BYTE, USHORT ); + BOOL (* GetScrChar) ( HB_GT_PTR, int, int, int *, BYTE *, USHORT * ); + BOOL (* PutScrChar) ( HB_GT_PTR, int, int, int, BYTE, USHORT ); void (* DispBegin) ( HB_GT_PTR ); void (* DispEnd) ( HB_GT_PTR ); int (* DispCount) ( HB_GT_PTR ); - BOOL (* GetChar) ( HB_GT_PTR, int, int, BYTE *, BYTE *, USHORT * ); - BOOL (* PutChar) ( HB_GT_PTR, int, int, BYTE, BYTE, USHORT ); + BOOL (* GetChar) ( HB_GT_PTR, int, int, int *, BYTE *, USHORT * ); + BOOL (* PutChar) ( HB_GT_PTR, int, int, int, BYTE, USHORT ); long (* RectSize) ( HB_GT_PTR, int, int, int, int ); void (* Save) ( HB_GT_PTR, int, int, int, int, void * ); void (* Rest) ( HB_GT_PTR, int, int, int, int, const void * ); - void (* PutText) ( HB_GT_PTR, int, int, BYTE, const char *, ULONG ); - void (* Replicate) ( HB_GT_PTR, int, int, BYTE, BYTE, USHORT, ULONG ); + void (* PutText) ( HB_GT_PTR, int, int, int, const char *, ULONG ); + void (* Replicate) ( HB_GT_PTR, int, int, int, BYTE, USHORT, ULONG ); void (* WriteAt) ( HB_GT_PTR, int, int, const char *, ULONG ); void (* Write) ( HB_GT_PTR, const char *, ULONG ); void (* WriteCon) ( HB_GT_PTR, const char *, ULONG ); - void (* SetAttribute) ( HB_GT_PTR, int, int, int, int, BYTE ); - void (* DrawShadow) ( HB_GT_PTR, int, int, int, int, BYTE ); - void (* Scroll) ( HB_GT_PTR, int, int, int, int, BYTE, BYTE, int, int ); - void (* ScrollUp) ( HB_GT_PTR, int, BYTE, BYTE ); - void (* Box) ( HB_GT_PTR, int, int, int, int, const char *, BYTE ); - void (* BoxD) ( HB_GT_PTR, int, int, int, int, const char *, BYTE ); - void (* BoxS) ( HB_GT_PTR, int, int, int, int, const char *, BYTE ); - void (* HorizLine) ( HB_GT_PTR, int, int, int, BYTE, BYTE ); - void (* VertLine) ( HB_GT_PTR, int, int, int, BYTE, BYTE ); + void (* SetAttribute) ( HB_GT_PTR, int, int, int, int, int ); + void (* DrawShadow) ( HB_GT_PTR, int, int, int, int, int ); + void (* Scroll) ( HB_GT_PTR, int, int, int, int, int, BYTE, int, int ); + void (* ScrollUp) ( HB_GT_PTR, int, int, BYTE ); + void (* Box) ( HB_GT_PTR, int, int, int, int, const char *, int ); + void (* BoxD) ( HB_GT_PTR, int, int, int, int, const char *, int ); + void (* BoxS) ( HB_GT_PTR, int, int, int, int, const char *, int ); + void (* HorizLine) ( HB_GT_PTR, int, int, int, BYTE, int ); + void (* VertLine) ( HB_GT_PTR, int, int, int, BYTE, int ); BOOL (* GetBlink) ( HB_GT_PTR ); void (* SetBlink) ( HB_GT_PTR, BOOL ); void (* SetSnowFlag) ( HB_GT_PTR, BOOL ); diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index e7ef18f0d1..0a3108157f 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -636,34 +636,34 @@ HB_ERRCODE hb_gtRest( int iTop, int iLeft, int iBottom, int iRight, const void * return HB_FAILURE; } -HB_ERRCODE hb_gtGetChar( int iRow, int iCol, BYTE * pbColor, BYTE * pbAttr, USHORT * pusChar ) +HB_ERRCODE hb_gtGetChar( int iRow, int iCol, int * piColor, BYTE * pbAttr, USHORT * pusChar ) { HB_ERRCODE errCode = HB_FAILURE; PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtGetChar(%d, %d, %p, %p, %p)", iRow, iCol, pbColor, pbAttr, pusChar)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtGetChar(%d, %d, %p, %p, %p)", iRow, iCol, piColor, pbAttr, pusChar)); pGT = hb_gt_Base(); if( pGT ) { - if( HB_GTSELF_GETCHAR( pGT, iRow, iCol, pbColor, pbAttr, pusChar ) ) + if( HB_GTSELF_GETCHAR( pGT, iRow, iCol, piColor, pbAttr, pusChar ) ) errCode = HB_SUCCESS; hb_gt_BaseFree( pGT ); } return errCode; } -HB_ERRCODE hb_gtPutChar( int iRow, int iCol, BYTE bColor, BYTE bAttr, USHORT usChar ) +HB_ERRCODE hb_gtPutChar( int iRow, int iCol, int iColor, BYTE bAttr, USHORT usChar ) { HB_ERRCODE errCode = HB_FAILURE; PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtPutChar(%d, %d, %hu, %hu, %hu)", iRow, iCol, bColor, bAttr, usChar)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtPutChar(%d, %d, %d, %hu, %hu)", iRow, iCol, iColor, bAttr, usChar)); pGT = hb_gt_Base(); if( pGT ) { - if( HB_GTSELF_PUTCHAR( pGT, iRow, iCol, bColor, bAttr, usChar ) ) + if( HB_GTSELF_PUTCHAR( pGT, iRow, iCol, iColor, bAttr, usChar ) ) errCode = HB_SUCCESS; hb_gt_BaseFree( pGT ); } @@ -863,16 +863,16 @@ HB_ERRCODE hb_gtScrollUp( int iRows ) return HB_FAILURE; } -HB_ERRCODE hb_gtDrawShadow( int iTop, int iLeft, int iBottom, int iRight, BYTE bColor ) +HB_ERRCODE hb_gtDrawShadow( int iTop, int iLeft, int iBottom, int iRight, int iColor ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtDrawShadow(%d, %d, %d, %d, %d)", iTop, iLeft, iBottom, iRight, ( int ) bColor)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtDrawShadow(%d, %d, %d, %d, %d)", iTop, iLeft, iBottom, iRight, iColor)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_DRAWSHADOW( pGT, iTop, iLeft, iBottom, iRight, bColor ); + HB_GTSELF_DRAWSHADOW( pGT, iTop, iLeft, iBottom, iRight, iColor ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; @@ -912,16 +912,16 @@ const char * hb_gtVersion( int iType ) return szVersion; } -HB_ERRCODE hb_gtSetAttribute( int iTop, int iLeft, int iBottom, int iRight, BYTE bColor ) +HB_ERRCODE hb_gtSetAttribute( int iTop, int iLeft, int iBottom, int iRight, int iColor ) { PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtSetAttribute(%d, %d, %d, %d, %d)", iTop, iLeft, iBottom, iRight, ( int ) bColor)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtSetAttribute(%d, %d, %d, %d, %d)", iTop, iLeft, iBottom, iRight, iColor)); pGT = hb_gt_Base(); if( pGT ) { - HB_GTSELF_SETATTRIBUTE( pGT, iTop, iLeft, iBottom, iRight, bColor ); + HB_GTSELF_SETATTRIBUTE( pGT, iTop, iLeft, iBottom, iRight, iColor ); HB_GTSELF_FLUSH( pGT ); hb_gt_BaseFree( pGT ); return HB_SUCCESS; @@ -1165,34 +1165,34 @@ HB_ERRCODE hb_gtSetClearChar( int iChar ) return HB_FAILURE; } -HB_ERRCODE hb_gtGetScrChar( int iRow, int iCol, BYTE * pbColor, BYTE * pbAttr, USHORT * pusChar ) +HB_ERRCODE hb_gtGetScrChar( int iRow, int iCol, int * piColor, BYTE * pbAttr, USHORT * pusChar ) { HB_ERRCODE errCode = HB_FAILURE; PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtScrGetChar(%d, %d, %p, %p, %p)", iRow, iCol, pbColor, pbAttr, pusChar)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtScrGetChar(%d, %d, %p, %p, %p)", iRow, iCol, piColor, pbAttr, pusChar)); pGT = hb_gt_Base(); if( pGT ) { - if( HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, pbColor, pbAttr, pusChar ) ) + if( HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, piColor, pbAttr, pusChar ) ) errCode = HB_SUCCESS; hb_gt_BaseFree( pGT ); } return errCode; } -HB_ERRCODE hb_gtPutScrChar( int iRow, int iCol, BYTE bColor, BYTE bAttr, USHORT usChar ) +HB_ERRCODE hb_gtPutScrChar( int iRow, int iCol, int iColor, BYTE bAttr, USHORT usChar ) { HB_ERRCODE errCode = HB_FAILURE; PHB_GT pGT; - HB_TRACE(HB_TR_DEBUG, ("hb_gtPutScrChar(%d, %d, %d, %d, %hu)", iRow, iCol, bColor, bAttr, usChar)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtPutScrChar(%d, %d, %d, %d, %hu)", iRow, iCol, iColor, ( int ) bAttr, usChar)); pGT = hb_gt_Base(); if( pGT ) { - if( HB_GTSELF_PUTSCRCHAR( pGT, iRow, iCol, bColor, bAttr, usChar ) ) + if( HB_GTSELF_PUTSCRCHAR( pGT, iRow, iCol, iColor, bAttr, usChar ) ) errCode = HB_SUCCESS; hb_gt_BaseFree( pGT ); } diff --git a/harbour/source/rtl/gtcgi/gtcgi.c b/harbour/source/rtl/gtcgi/gtcgi.c index 3c59751217..e20cdcd679 100644 --- a/harbour/source/rtl/gtcgi/gtcgi.c +++ b/harbour/source/rtl/gtcgi/gtcgi.c @@ -199,11 +199,11 @@ static const char * hb_gt_cgi_Version( PHB_GT pGT, int iType ) } static void hb_gt_cgi_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, - BYTE bColor, BYTE bChar, int iRows, int iCols ) + int iColor, BYTE bChar, int iRows, int iCols ) { int iHeight, iWidth; - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Scroll(%p,%d,%d,%d,%d,%d,%d,%d,%d)", pGT, iTop, iLeft, iBottom, iRight, bColor, bChar, iRows, iCols ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Scroll(%p,%d,%d,%d,%d,%d,%d,%d,%d)", pGT, iTop, iLeft, iBottom, iRight, iColor, bChar, iRows, iCols ) ); /* Provide some basic scroll support for full screen */ HB_GTSELF_GETSIZE( pGT, &iHeight, &iWidth ); @@ -214,7 +214,7 @@ static void hb_gt_cgi_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int PHB_GTCGI pGTCGI = HB_GTCGI_GET( pGT ); /* scroll up the internal screen buffer */ - HB_GTSELF_SCROLLUP( pGT, iRows, bColor, bChar ); + HB_GTSELF_SCROLLUP( pGT, iRows, iColor, bChar ); /* update our internal row position */ pGTCGI->iRow -= iRows; if( pGTCGI->iRow < 0 ) @@ -222,7 +222,7 @@ static void hb_gt_cgi_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int pGTCGI->iLastCol = pGTCGI->iCol = 0; } else - HB_GTSUPER_SCROLL( pGT, iTop, iLeft, iBottom, iRight, bColor, bChar, iRows, iCols ); + HB_GTSUPER_SCROLL( pGT, iTop, iLeft, iBottom, iRight, iColor, bChar, iRows, iCols ); } static BOOL hb_gt_cgi_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char *pszHostCDP, BOOL fBox ) @@ -338,7 +338,8 @@ static void hb_gt_cgi_WriteAt( PHB_GT pGT, int iRow, int iCol, const char * szTe static void hb_gt_cgi_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; int iLineFeed, iHeight, iWidth, iLen; PHB_GTCGI pGTCGI; @@ -368,7 +369,7 @@ static void hb_gt_cgi_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) } while( iSize > 0 && iCol + iSize > pGTCGI->iLastCol && - HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iSize - 1, &bColor, &bAttr, &usChar ) ) + HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iSize - 1, &iColor, &bAttr, &usChar ) ) { if( usChar != ' ' ) break; @@ -383,7 +384,7 @@ static void hb_gt_cgi_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) while( iLen < iSize ) { - if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, &iColor, &bAttr, &usChar ) ) break; pGTCGI->sLineBuf[ iLen++ ] = ( char ) usChar; ++iCol; diff --git a/harbour/source/rtl/gtcrs/gtcrs.c b/harbour/source/rtl/gtcrs/gtcrs.c index 1faf8c6b3f..3ed7820d58 100644 --- a/harbour/source/rtl/gtcrs/gtcrs.c +++ b/harbour/source/rtl/gtcrs/gtcrs.c @@ -2923,16 +2923,17 @@ static void hb_gt_crs_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) if( s_ioBase ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; chtype ch; wmove( s_ioBase->stdscr, iRow, iCol ); while( iSize-- > 0 ) { - if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol++, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol++, &iColor, &bAttr, &usChar ) ) break; - ch = ( s_ioBase->attr_map[ bColor ] & s_ioBase->attr_mask ) | + ch = ( s_ioBase->attr_map[ iColor ] & s_ioBase->attr_mask ) | ( bAttr & HB_GT_ATTR_BOX ? s_ioBase->box_chmap[ usChar & 0xff ] : s_ioBase->std_chmap[ usChar & 0xff ] ); waddch( s_ioBase->stdscr, ch ); diff --git a/harbour/source/rtl/gtdos/gtdos.c b/harbour/source/rtl/gtdos/gtdos.c index 2f3d08b69c..36cc891a29 100644 --- a/harbour/source/rtl/gtdos/gtdos.c +++ b/harbour/source/rtl/gtdos/gtdos.c @@ -1325,7 +1325,8 @@ static void hb_gt_dos_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) #if !defined( __DJGPP__ ) USHORT FAR *pScreenPtr = (USHORT FAR *) hb_gt_dos_ScreenPtr( iRow, iCol ); #endif - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; int iLen = 0; @@ -1333,18 +1334,18 @@ static void hb_gt_dos_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) while( iLen < iSize ) { - if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iLen, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iLen, &iColor, &bAttr, &usChar ) ) break; #if defined( __DJGPP__TEXT ) { - short ch_attr = ( ( short ) bColor << 8 ) | s_charTrans[ usChar & 0xff ]; + short ch_attr = ( ( short ) iColor << 8 ) | s_charTrans[ usChar & 0xff ]; puttext( iCol + iLen + 1, iRow + 1, iCol + iLen + 1, iRow + 1, &ch_attr ); } #elif defined( __DJGPP__ ) - ScreenPutChar( s_charTrans[ usChar & 0xff ], bColor, iCol + iLen, iRow ); + ScreenPutChar( s_charTrans[ usChar & 0xff ], iColor, iCol + iLen, iRow ); #else - *pScreenPtr++ = ( bColor << 8 ) + s_charTrans[ usChar & 0xff ]; + *pScreenPtr++ = ( iColor << 8 ) + s_charTrans[ usChar & 0xff ]; #endif iLen++; } diff --git a/harbour/source/rtl/gtos2/gtos2.c b/harbour/source/rtl/gtos2/gtos2.c index cd68fad633..2e7a33e3c1 100644 --- a/harbour/source/rtl/gtos2/gtos2.c +++ b/harbour/source/rtl/gtos2/gtos2.c @@ -786,7 +786,9 @@ static BOOL hb_gt_os2_Resume( PHB_GT pGT ) static void hb_gt_os2_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) { - char * pBufPtr = s_sLineBuf, bColor, bAttr; + char * pBufPtr = s_sLineBuf; + int iColor; + char bAttr; USHORT usChar; int iLen = 0; @@ -794,11 +796,11 @@ static void hb_gt_os2_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) while( iLen < iSize ) { - if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iLen, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iLen, &iColor, &bAttr, &usChar ) ) break; *pBufPtr++ = ( char ) usChar; - *pBufPtr++ = bColor; + *pBufPtr++ = ( char ) iColor; ++iLen; } diff --git a/harbour/source/rtl/gtpca/gtpca.c b/harbour/source/rtl/gtpca/gtpca.c index 9fc919ae65..d31c7f0844 100644 --- a/harbour/source/rtl/gtpca/gtpca.c +++ b/harbour/source/rtl/gtpca/gtpca.c @@ -436,11 +436,11 @@ static void hb_gt_pca_AnsiInit( void ) s_iCurrentSGR = s_iRow = s_iCol = s_iCursorStyle = s_iAM = -1; } -static void hb_gt_pca_AnsiPutStr( int iRow, int iCol, BYTE bAttr, char * szStr, int iLen ) +static void hb_gt_pca_AnsiPutStr( int iRow, int iCol, int iColor, char * szStr, int iLen ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_pca_AnsiPutStr(%d,%d,%hu,%p,%d)", iRow, iCol, bAttr, szStr, iLen)); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_pca_AnsiPutStr(%d,%d,%d,%p,%d)", iRow, iCol, iColor, szStr, iLen)); - hb_gt_pca_AnsiSetAttributes( bAttr ); + hb_gt_pca_AnsiSetAttributes( ( BYTE ) iColor ); hb_gt_pca_AnsiSetCursorPos( iRow, iCol ); hb_gt_pca_AnsiSetAutoMargin( 0 ); hb_gt_pca_termOut( szStr, iLen ); @@ -840,29 +840,30 @@ static BOOL hb_gt_pca_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * static void hb_gt_pca_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; - int iLen = 0, iColor = 0; + int iLen = 0, iColor2 = 0; HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) ); while( iSize-- ) { - if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iLen, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iLen, &iColor, &bAttr, &usChar ) ) break; if( iLen == 0 ) - iColor = bColor; - else if( iColor != bColor ) + iColor2 = iColor; + else if( iColor2 != iColor ) { #ifndef HB_CDP_SUPPORT_OFF if( s_fDispTrans ) hb_cdpnTranslate( ( char * ) s_sLineBuf, s_cdpHost, s_cdpTerm, iLen ); #endif - hb_gt_pca_AnsiPutStr( iRow, iCol, ( BYTE ) iColor, s_sLineBuf, iLen ); + hb_gt_pca_AnsiPutStr( iRow, iCol, iColor2, s_sLineBuf, iLen ); iCol += iLen; iLen = 0; - iColor = bColor; + iColor2 = iColor; } if( usChar < 32 || usChar == 127 ) usChar = '.'; @@ -874,7 +875,7 @@ static void hb_gt_pca_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) if( s_fDispTrans ) hb_cdpnTranslate( ( char * ) s_sLineBuf, s_cdpHost, s_cdpTerm, iLen ); #endif - hb_gt_pca_AnsiPutStr( iRow, iCol, ( BYTE ) iColor, s_sLineBuf, iLen ); + hb_gt_pca_AnsiPutStr( iRow, iCol, iColor2, s_sLineBuf, iLen ); } } diff --git a/harbour/source/rtl/gtsln/gtsln.c b/harbour/source/rtl/gtsln/gtsln.c index 313e4c869d..a2a7d0c5c0 100644 --- a/harbour/source/rtl/gtsln/gtsln.c +++ b/harbour/source/rtl/gtsln/gtsln.c @@ -1026,15 +1026,16 @@ static void hb_gt_sln_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) if( s_fActive ) { SLsmg_Char_Type SLchar; - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; while( iSize-- > 0 ) { - if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, &iColor, &bAttr, &usChar ) ) break; SLsmg_gotorc( iRow, iCol ); - HB_SLN_BUILD_CHAR( SLchar, usChar & 0xff, bColor, bAttr ); + HB_SLN_BUILD_CHAR( SLchar, usChar & 0xFF, iColor, bAttr ); SLsmg_write_raw( &SLchar, 1 ); ++iCol; } diff --git a/harbour/source/rtl/gtstd/gtstd.c b/harbour/source/rtl/gtstd/gtstd.c index 8fb2a15404..8c338be0bc 100644 --- a/harbour/source/rtl/gtstd/gtstd.c +++ b/harbour/source/rtl/gtstd/gtstd.c @@ -503,11 +503,11 @@ static BOOL hb_gt_std_Resume( PHB_GT pGT ) } static void hb_gt_std_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, - BYTE bColor, BYTE bChar, int iRows, int iCols ) + int iColor, BYTE bChar, int iRows, int iCols ) { int iHeight, iWidth; - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Scroll(%p,%d,%d,%d,%d,%d,%d,%d,%d)", pGT, iTop, iLeft, iBottom, iRight, bColor, bChar, iRows, iCols ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Scroll(%p,%d,%d,%d,%d,%d,%d,%d,%d)", pGT, iTop, iLeft, iBottom, iRight, iColor, bChar, iRows, iCols ) ); /* Provide some basic scroll support for full screen */ HB_GTSELF_GETSIZE( pGT, &iHeight, &iWidth ); @@ -517,7 +517,7 @@ static void hb_gt_std_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int { PHB_GTSTD pGTSTD; /* scroll up the internal screen buffer */ - HB_GTSELF_SCROLLUP( pGT, iRows, bColor, bChar ); + HB_GTSELF_SCROLLUP( pGT, iRows, iColor, bChar ); /* update our internal row position */ pGTSTD = HB_GTSTD_GET( pGT ); pGTSTD->iRow -= iRows; @@ -525,7 +525,7 @@ static void hb_gt_std_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int pGTSTD->iRow = 0; } else - HB_GTSUPER_SCROLL( pGT, iTop, iLeft, iBottom, iRight, bColor, bChar, iRows, iCols ); + HB_GTSUPER_SCROLL( pGT, iTop, iLeft, iBottom, iRight, iColor, bChar, iRows, iCols ); } static BOOL hb_gt_std_SetDispCP( PHB_GT pGT, const char *pszTermCDP, const char *pszHostCDP, BOOL fBox ) @@ -598,14 +598,15 @@ static BOOL hb_gt_std_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * static void hb_gt_std_DispLine( PHB_GT pGT, int iRow ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; int iCol, iMin = 0; PHB_GTSTD pGTSTD = HB_GTSTD_GET( pGT ); for( iCol = 0; iCol < pGTSTD->iLineBufSize; ++iCol ) { - if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, &iColor, &bAttr, &usChar ) ) break; if( usChar < 32 || usChar == 127 ) usChar = '.'; @@ -622,7 +623,8 @@ static void hb_gt_std_DispLine( PHB_GT pGT, int iRow ) static void hb_gt_std_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; int iLineFeed, iBackSpace, iLen, iMin; PHB_GTSTD pGTSTD; @@ -662,7 +664,7 @@ static void hb_gt_std_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) iMin = iLineFeed > 0 || pGTSTD->iLastCol <= iCol ? 0 : pGTSTD->iLastCol - iCol; while( iSize > iMin && - HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iSize - 1, &bColor, &bAttr, &usChar ) ) + HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iSize - 1, &iColor, &bAttr, &usChar ) ) { if( usChar != ' ' ) break; @@ -704,7 +706,7 @@ static void hb_gt_std_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) for( iLen = 0; iLen < iSize; ++iLen ) { - if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, &iColor, &bAttr, &usChar ) ) break; if( usChar < 32 || usChar == 127 ) usChar = '.'; diff --git a/harbour/source/rtl/gttrm/gttrm.c b/harbour/source/rtl/gttrm/gttrm.c index 80f378b5bc..6b83200bb1 100644 --- a/harbour/source/rtl/gttrm/gttrm.c +++ b/harbour/source/rtl/gttrm/gttrm.c @@ -3227,9 +3227,9 @@ static BOOL hb_gt_trm_Resume( PHB_GT pGT ) } static void hb_gt_trm_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, - BYTE bColor, BYTE bChar, int iRows, int iCols ) + int iColor, BYTE bChar, int iRows, int iCols ) { - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Scroll(%p,%d,%d,%d,%d,%d,%d,%d,%d)", pGT, iTop, iLeft, iBottom, iRight, bColor, bChar, iRows, iCols ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Scroll(%p,%d,%d,%d,%d,%d,%d,%d,%d)", pGT, iTop, iLeft, iBottom, iRight, iColor, bChar, iRows, iCols ) ); /* Provide some basic scroll support for full screen */ if( iCols == 0 && iRows > 0 && iTop == 0 && iLeft == 0 ) @@ -3242,10 +3242,10 @@ static void hb_gt_trm_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int pTerm->iRow == iHeight - 1 ) { /* scroll up the internal screen buffer */ - HB_GTSELF_SCROLLUP( pGT, iRows, bColor, bChar ); + HB_GTSELF_SCROLLUP( pGT, iRows, iColor, bChar ); /* set default color for terminals which use it to erase * scrolled area */ - pTerm->SetAttributes( pTerm, bColor & pTerm->iAttrMask ); + pTerm->SetAttributes( pTerm, iColor & pTerm->iAttrMask ); /* update our internal row position */ do hb_gt_trm_termOut( pTerm, "\n\r", 2 ); @@ -3255,7 +3255,7 @@ static void hb_gt_trm_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int } } - HB_GTSUPER_SCROLL( pGT, iTop, iLeft, iBottom, iRight, bColor, bChar, iRows, iCols ); + HB_GTSUPER_SCROLL( pGT, iTop, iLeft, iBottom, iRight, iColor, bChar, iRows, iCols ); } static BOOL hb_gt_trm_SetMode( PHB_GT pGT, int iRows, int iCols ) @@ -3402,9 +3402,10 @@ static BOOL hb_gt_trm_SetKeyCP( PHB_GT pGT, const char *pszTermCDP, const char * static void hb_gt_trm_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) { PHB_GTTRM pTerm; - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; - int iLen = 0, iAttribute = 0, iColor; + int iLen = 0, iAttribute = 0, iColor2; HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) ); @@ -3413,33 +3414,33 @@ static void hb_gt_trm_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) pTerm->SetCursorStyle( pTerm, SC_NONE ); while( iSize-- ) { - if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iLen, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iLen, &iColor, &bAttr, &usChar ) ) break; usChar &= 0xff; if( bAttr & HB_GT_ATTR_BOX ) { - iColor = bColor | ( pTerm->boxattr[ usChar ] & ~HB_GTTRM_ATTR_CHAR ); + iColor2 = iColor | ( pTerm->boxattr[ usChar ] & ~HB_GTTRM_ATTR_CHAR ); if( !pTerm->fUTF8 ) usChar = pTerm->boxattr[ usChar ] & HB_GTTRM_ATTR_CHAR; else - iColor |= HB_GTTRM_ATTR_BOX; + iColor2 |= HB_GTTRM_ATTR_BOX; } else { - iColor = bColor | ( pTerm->chrattr[ usChar ] & ~HB_GTTRM_ATTR_CHAR ); + iColor2 = iColor | ( pTerm->chrattr[ usChar ] & ~HB_GTTRM_ATTR_CHAR ); if( !pTerm->fUTF8 ) usChar = pTerm->chrattr[ usChar ] & HB_GTTRM_ATTR_CHAR; } if( iLen == 0 ) - iAttribute = iColor; - else if( iColor != iAttribute ) + iAttribute = iColor2; + else if( iColor2 != iAttribute ) { hb_gt_trm_PutStr( pTerm, iRow, iCol, iAttribute, pTerm->pLineBuf, iLen ); iCol += iLen; iLen = 0; - iAttribute = iColor; + iAttribute = iColor2; } pTerm->pLineBuf[ iLen++ ] = ( char ) usChar; } diff --git a/harbour/source/rtl/gtwin/gtwin.c b/harbour/source/rtl/gtwin/gtwin.c index 16aab7bd67..61668efb5b 100644 --- a/harbour/source/rtl/gtwin/gtwin.c +++ b/harbour/source/rtl/gtwin/gtwin.c @@ -1758,17 +1758,18 @@ static void hb_gt_win_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) if( iSize > 0 && s_pCharInfoScreen && iRow < ( int ) _GetScreenHeight() && iCol < ( int ) _GetScreenWidth() ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; int iFirst = iCol; int i = ( iRow * _GetScreenWidth() + iCol ); while( iSize-- > 0 ) { - if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol++, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol++, &iColor, &bAttr, &usChar ) ) break; s_pCharInfoScreen[ i ].Char.AsciiChar = ( CHAR ) s_charTrans[ usChar & 0xFF ]; - s_pCharInfoScreen[ i ].Attributes = ( WORD ) ( bColor & 0xFF ); + s_pCharInfoScreen[ i ].Attributes = ( WORD ) ( iColor & 0xFF ); ++i; } diff --git a/harbour/source/rtl/gtwvt/gtwvt.c b/harbour/source/rtl/gtwvt/gtwvt.c index f1436cb20b..b8a2376085 100644 --- a/harbour/source/rtl/gtwvt/gtwvt.c +++ b/harbour/source/rtl/gtwvt/gtwvt.c @@ -1051,10 +1051,11 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L { for( icol = left; icol <= right; icol++ ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; - if( !HB_GTSELF_GETSCRCHAR( pWVT->pGT, irow, icol, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pWVT->pGT, irow, icol, &iColor, &bAttr, &usChar ) ) break; sBuffer[ j++ ] = ( char ) usChar; @@ -1515,15 +1516,15 @@ static BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, LPA * hb_gt_wvt_TextOut converts col and row to x and y ( pixels ) and calls * the Windows function TextOut with the expected coordinates */ -static BOOL hb_gt_wvt_TextOut( PHB_GTWVT pWVT, HDC hdc, int col, int row, BYTE attr, LPCTSTR lpString, USHORT cbString ) +static BOOL hb_gt_wvt_TextOut( PHB_GTWVT pWVT, HDC hdc, int col, int row, int iColor, LPCTSTR lpString, USHORT cbString ) { POINT xy; RECT rClip; /* set foreground color */ - SetTextColor( hdc, pWVT->COLORS[ attr & 0x0F ] ); + SetTextColor( hdc, pWVT->COLORS[ iColor & 0x0F ] ); /* set background color */ - SetBkColor( hdc, pWVT->COLORS[ ( attr >> 4 ) & 0x0F ] ); + SetBkColor( hdc, pWVT->COLORS[ ( iColor >> 4 ) & 0x0F ] ); SetTextAlign( hdc, TA_LEFT ); @@ -1540,7 +1541,8 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect ) HDC hdc; RECT rcRect; int iRow, iCol, startCol, len; - BYTE bColor, bAttr, bOldColor = 0; + int iColor, iOldColor = 0; + BYTE bAttr; #if ! defined( UNICODE ) HFONT hFont, hOldFont = NULL; #endif @@ -1558,19 +1560,19 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect ) while( iCol <= rcRect.right ) { - if( !HB_GTSELF_GETSCRCHAR( pWVT->pGT, iRow, iCol, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pWVT->pGT, iRow, iCol, &iColor, &bAttr, &usChar ) ) break; #if defined( UNICODE ) usChar = hb_cdpGetU16( bAttr & HB_GT_ATTR_BOX ? pWVT->boxCDP : pWVT->hostCDP, TRUE, ( BYTE ) usChar ); if( len == 0 ) { - bOldColor = bColor; + iOldColor = iColor; } - else if( bColor != bOldColor ) + else if( iColor != iOldColor ) { - hb_gt_wvt_TextOut( pWVT, hdc, startCol, iRow, bOldColor, text, ( USHORT ) len ); - bOldColor = bColor; + hb_gt_wvt_TextOut( pWVT, hdc, startCol, iRow, iOldColor, text, ( USHORT ) len ); + iOldColor = iColor; startCol = iCol; len = 0; } @@ -1584,17 +1586,17 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect ) SelectObject( hdc, hFont ); hOldFont = hFont; } - bOldColor = bColor; + iOldColor = iColor; } - else if( bColor != bOldColor || hFont != hOldFont ) + else if( iColor != iOldColor || hFont != hOldFont ) { - hb_gt_wvt_TextOut( pWVT, hdc, startCol, iRow, bOldColor, text, ( USHORT ) len ); + hb_gt_wvt_TextOut( pWVT, hdc, startCol, iRow, iOldColor, text, ( USHORT ) len ); if( hFont != hOldFont ) { SelectObject( hdc, hFont ); hOldFont = hFont; } - bOldColor = bColor; + iOldColor = iColor; startCol = iCol; len = 0; } @@ -1603,7 +1605,7 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect ) iCol++; } if( len > 0 ) - hb_gt_wvt_TextOut( pWVT, hdc, startCol, iRow, bOldColor, text, ( USHORT ) len ); + hb_gt_wvt_TextOut( pWVT, hdc, startCol, iRow, iOldColor, text, ( USHORT ) len ); } EndPaint( pWVT->hWnd, &ps ); diff --git a/harbour/source/rtl/gtxwc/gtxwc.c b/harbour/source/rtl/gtxwc/gtxwc.c index dd74dc5585..791eea2eb7 100644 --- a/harbour/source/rtl/gtxwc/gtxwc.c +++ b/harbour/source/rtl/gtxwc/gtxwc.c @@ -4280,15 +4280,16 @@ static void hb_gt_xwc_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) #if 0 else if( !wnd->fData ) { - BYTE bDefColor = HB_GTSELF_GETCOLOR( pGT ); - BYTE bColor, bAttr; + int iDefColor = HB_GTSELF_GETCOLOR( pGT ); + int iColor; + BYTE bAttr; USHORT usChar; while( iSize-- ) { - if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol++, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol++, &iColor, &bAttr, &usChar ) ) break; - if( bColor != bDefColor || usChar != ' ' ) + if( iColor != iDefColor || usChar != ' ' ) { wnd->fData = TRUE; break; diff --git a/harbour/source/rtl/hbgtcore.c b/harbour/source/rtl/hbgtcore.c index 66a792f294..5464391bc1 100644 --- a/harbour/source/rtl/hbgtcore.c +++ b/harbour/source/rtl/hbgtcore.c @@ -116,7 +116,8 @@ static void * hb_gt_def_New( PHB_GT pGT ) { ULONG ulSize, ulIndex; USHORT usChar; - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; int i; hb_gt_def_BaseInit( pGT ); @@ -135,12 +136,12 @@ static void * hb_gt_def_New( PHB_GT pGT ) pGT->pLines[ i ] = TRUE; usChar = HB_GTSELF_GETCLEARCHAR( pGT ); - bColor = HB_GTSELF_GETCLEARCOLOR( pGT ); + iColor = HB_GTSELF_GETCLEARCOLOR( pGT ); bAttr = 0; for( ulIndex = 0; ulIndex < ulSize; ++ulIndex ) { pGT->screenBuffer[ ulIndex ].c.usChar = usChar; - pGT->screenBuffer[ ulIndex ].c.bColor = bColor; + pGT->screenBuffer[ ulIndex ].c.bColor = ( BYTE ) iColor; pGT->screenBuffer[ ulIndex ].c.bAttr = bAttr; pGT->prevBuffer[ ulIndex ].c.bAttr = HB_GT_ATTR_REFRESH; } @@ -730,14 +731,14 @@ static const char * hb_gt_def_Version( PHB_GT pGT, int iType ) } static BOOL hb_gt_def_GetChar( PHB_GT pGT, int iRow, int iCol, - BYTE * pbColor, BYTE * pbAttr, USHORT * pusChar ) + int * piColor, BYTE * pbAttr, USHORT * pusChar ) { long lIndex; if( HB_GTSELF_CHECKPOS( pGT, iRow, iCol, &lIndex ) ) { *pusChar = pGT->screenBuffer[ lIndex ].c.usChar; - *pbColor = pGT->screenBuffer[ lIndex ].c.bColor; + *piColor = pGT->screenBuffer[ lIndex ].c.bColor; *pbAttr = pGT->screenBuffer[ lIndex ].c.bAttr; return TRUE; } @@ -745,14 +746,14 @@ static BOOL hb_gt_def_GetChar( PHB_GT pGT, int iRow, int iCol, } static BOOL hb_gt_def_PutChar( PHB_GT pGT, int iRow, int iCol, - BYTE bColor, BYTE bAttr, USHORT usChar ) + int iColor, BYTE bAttr, USHORT usChar ) { long lIndex; if( HB_GTSELF_CHECKPOS( pGT, iRow, iCol, &lIndex ) ) { pGT->screenBuffer[ lIndex ].c.usChar = usChar; - pGT->screenBuffer[ lIndex ].c.bColor = bColor; + pGT->screenBuffer[ lIndex ].c.bColor = ( BYTE ) iColor; pGT->screenBuffer[ lIndex ].c.bAttr = bAttr; pGT->pLines[ iRow ] = TRUE; pGT->fRefresh = TRUE; @@ -761,17 +762,17 @@ static BOOL hb_gt_def_PutChar( PHB_GT pGT, int iRow, int iCol, return FALSE; } -static void hb_gt_def_PutText( PHB_GT pGT, int iRow, int iCol, BYTE bColor, const char * szText, ULONG ulLen ) +static void hb_gt_def_PutText( PHB_GT pGT, int iRow, int iCol, int iColor, const char * szText, ULONG ulLen ) { while( ulLen-- ) { - if( !HB_GTSELF_PUTCHAR( pGT, iRow, iCol, bColor, 0, *szText++ ) ) + if( !HB_GTSELF_PUTCHAR( pGT, iRow, iCol, iColor, 0, *szText++ ) ) break; ++iCol; } } -static void hb_gt_def_Replicate( PHB_GT pGT, int iRow, int iCol, BYTE bColor, +static void hb_gt_def_Replicate( PHB_GT pGT, int iRow, int iCol, int iColor, BYTE bAttr, USHORT usChar, ULONG ulLen ) { if( iCol < 0 ) @@ -784,7 +785,7 @@ static void hb_gt_def_Replicate( PHB_GT pGT, int iRow, int iCol, BYTE bColor, } while( ulLen-- ) { - if( !HB_GTSELF_PUTCHAR( pGT, iRow, iCol, bColor, bAttr, usChar ) ) + if( !HB_GTSELF_PUTCHAR( pGT, iRow, iCol, iColor, bAttr, usChar ) ) break; ++iCol; } @@ -971,28 +972,29 @@ static void hb_gt_def_Save( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iR while( iTop <= iBottom ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; int iCol; for( iCol = iLeft; iCol <= iRight; ++iCol ) { - if( !HB_GTSELF_GETCHAR( pGT, iTop, iCol, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETCHAR( pGT, iTop, iCol, &iColor, &bAttr, &usChar ) ) { usChar = HB_GTSELF_GETCLEARCHAR( pGT ); - bColor = HB_GTSELF_GETCLEARCOLOR( pGT ); + iColor = HB_GTSELF_GETCLEARCOLOR( pGT ); bAttr = 0x00; } if( pGT->fVgaCell ) { *pbyBuffer++ = ( BYTE ) usChar; - *pbyBuffer++ = bColor; + *pbyBuffer++ = ( BYTE ) iColor; } else { HB_PUT_LE_UINT16( pbyBuffer, usChar ); pbyBuffer += 2; - *pbyBuffer++ = bColor; + *pbyBuffer++ = ( BYTE ) iColor; *pbyBuffer++ = bAttr; } } @@ -1007,7 +1009,8 @@ static void hb_gt_def_Rest( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iR while( iTop <= iBottom ) { - BYTE bColor, bAttr; + int iColor; + BYTE bAttr; USHORT usChar; int iCol; @@ -1016,36 +1019,37 @@ static void hb_gt_def_Rest( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iR if( pGT->fVgaCell ) { usChar = *pbyBuffer++; - bColor = *pbyBuffer++; + iColor = *pbyBuffer++; bAttr = 0; } else { usChar = HB_GET_LE_UINT16( pbyBuffer ); pbyBuffer += 2; - bColor = *pbyBuffer++; + iColor = *pbyBuffer++; bAttr = *pbyBuffer++; } - HB_GTSELF_PUTCHAR( pGT, iTop, iCol, bColor, bAttr, usChar ); + HB_GTSELF_PUTCHAR( pGT, iTop, iCol, iColor, bAttr, usChar ); } ++iTop; } } static void hb_gt_def_SetAttribute( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, - BYTE bColor ) + int iColor ) { while( iTop <= iBottom ) { - BYTE bColorOld, bAttr; + int iColorOld; + BYTE bAttr; USHORT usChar; int iCol; for( iCol = iLeft; iCol <= iRight; ++iCol ) { - if( !HB_GTSELF_GETCHAR( pGT, iTop, iCol, &bColorOld, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETCHAR( pGT, iTop, iCol, &iColorOld, &bAttr, &usChar ) ) break; - if( !HB_GTSELF_PUTCHAR( pGT, iTop, iCol, bColor, bAttr, usChar ) ) + if( !HB_GTSELF_PUTCHAR( pGT, iTop, iCol, iColor, bAttr, usChar ) ) break; } ++iTop; @@ -1053,7 +1057,7 @@ static void hb_gt_def_SetAttribute( PHB_GT pGT, int iTop, int iLeft, int iBottom } static void hb_gt_def_DrawShadow( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, - BYTE bColor ) + int iColor ) { int iMaxRow, iMaxCol, i; @@ -1078,18 +1082,18 @@ static void hb_gt_def_DrawShadow( PHB_GT pGT, int iTop, int iLeft, int iBottom, /* Draw the bottom edge */ if( iBottom <= iMaxRow && iLeft <= iMaxCol ) - HB_GTSELF_SETATTRIBUTE( pGT, iBottom, iLeft, iBottom, HB_MIN( iRight, iMaxCol ), bColor ); + HB_GTSELF_SETATTRIBUTE( pGT, iBottom, iLeft, iBottom, HB_MIN( iRight, iMaxCol ), iColor ); ++iRight; ++iTop; /* Draw the right edge */ if( iTop <= iMaxRow && iRight <= iMaxCol ) - HB_GTSELF_SETATTRIBUTE( pGT, iTop, iRight, iBottom, HB_MIN( iRight + 1, iMaxCol ), bColor ); + HB_GTSELF_SETATTRIBUTE( pGT, iTop, iRight, iBottom, HB_MIN( iRight + 1, iMaxCol ), iColor ); } static void hb_gt_def_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, - BYTE bColor, BYTE bChar, int iRows, int iCols ) + int iColor, BYTE bChar, int iRows, int iCols ) { int iColOld, iColNew, iColSize, iColClear, iClrs, iLength; @@ -1138,10 +1142,10 @@ static void hb_gt_def_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int HB_GTSELF_SAVE( pGT, iRowPos + iRows, iColOld, iRowPos + iRows, iColOld + iColSize, pBuffer ); HB_GTSELF_REST( pGT, iRowPos, iColNew, iRowPos, iColNew + iColSize, pBuffer ); if( iClrs ) - HB_GTSELF_REPLICATE( pGT, iRowPos, iColClear, bColor, 0, bChar, iClrs ); + HB_GTSELF_REPLICATE( pGT, iRowPos, iColClear, iColor, 0, bChar, iClrs ); } else - HB_GTSELF_REPLICATE( pGT, iRowPos, iLeft, bColor, 0, bChar, iLength ); + HB_GTSELF_REPLICATE( pGT, iRowPos, iLeft, iColor, 0, bChar, iLength ); } if( pBuffer ) @@ -1150,7 +1154,7 @@ static void hb_gt_def_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int } static void hb_gt_def_ScrollArea( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, - BYTE bColor, BYTE bChar, int iRows, int iCols ) + int iColor, BYTE bChar, int iRows, int iCols ) { if( iRows || iCols ) { @@ -1224,16 +1228,16 @@ static void hb_gt_def_ScrollArea( PHB_GT pGT, int iTop, int iLeft, int iBottom, } } if( iClrs ) - HB_GTSELF_REPLICATE( pGT, iRowPos, iColClear, bColor, 0, bChar, iClrs ); + HB_GTSELF_REPLICATE( pGT, iRowPos, iColClear, iColor, 0, bChar, iClrs ); } else - HB_GTSELF_REPLICATE( pGT, iRowPos, iLeft, bColor, 0, bChar, iLength ); + HB_GTSELF_REPLICATE( pGT, iRowPos, iLeft, iColor, 0, bChar, iLength ); } } } } -static void hb_gt_def_ScrollUp( PHB_GT pGT, int iRows, BYTE bColor, BYTE bChar ) +static void hb_gt_def_ScrollUp( PHB_GT pGT, int iRows, int iColor, BYTE bChar ) { if( iRows > 0 ) { @@ -1260,7 +1264,7 @@ static void hb_gt_def_ScrollUp( PHB_GT pGT, int iRows, BYTE bColor, BYTE bChar ) for( j = 0; j < iWidth; ++j ) { pGT->screenBuffer[ lIndex ].c.usChar = bChar; - pGT->screenBuffer[ lIndex ].c.bColor = bColor; + pGT->screenBuffer[ lIndex ].c.bColor = ( BYTE ) iColor; pGT->screenBuffer[ lIndex ].c.bAttr = bAttr; ++lIndex; } @@ -1271,7 +1275,7 @@ static void hb_gt_def_ScrollUp( PHB_GT pGT, int iRows, BYTE bColor, BYTE bChar ) } static void hb_gt_def_Box( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, - const char * szFrame, BYTE bColor ) + const char * szFrame, int iColor ) { int iMaxRow, iMaxCol, iRows, iCols, iFirst, i; @@ -1307,9 +1311,9 @@ static void hb_gt_def_Box( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRi szBox[ i ] = '\0'; if( iTop == iBottom ) - HB_GTSELF_HORIZLINE( pGT, iTop, iLeft, iRight, szBox[ 1 ], bColor ); + HB_GTSELF_HORIZLINE( pGT, iTop, iLeft, iRight, szBox[ 1 ], iColor ); else if( iLeft == iRight ) - HB_GTSELF_VERTLINE( pGT, iLeft, iTop, iBottom, szBox[ 3 ], bColor ); + HB_GTSELF_VERTLINE( pGT, iLeft, iTop, iBottom, szBox[ 3 ], iColor ); else { BYTE bAttr = HB_GT_ATTR_BOX; @@ -1322,11 +1326,11 @@ static void hb_gt_def_Box( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRi if( iTop >= 0 ) { if( iLeft >= 0 ) - HB_GTSELF_PUTCHAR( pGT, iTop, iLeft, bColor, bAttr, szBox[ 0 ] ); + HB_GTSELF_PUTCHAR( pGT, iTop, iLeft, iColor, bAttr, szBox[ 0 ] ); if( iCols ) - HB_GTSELF_REPLICATE( pGT, iTop, iFirst, bColor, bAttr, szBox[ 1 ], iCols ); + HB_GTSELF_REPLICATE( pGT, iTop, iFirst, iColor, bAttr, szBox[ 1 ], iCols ); if( iRight <= iMaxCol ) - HB_GTSELF_PUTCHAR( pGT, iTop, iFirst + iCols, bColor, bAttr, szBox[ 2 ] ); + HB_GTSELF_PUTCHAR( pGT, iTop, iFirst + iCols, iColor, bAttr, szBox[ 2 ] ); iTop++; } else @@ -1334,41 +1338,41 @@ static void hb_gt_def_Box( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRi for( i = 0; i < iRows; ++i ) { if( iLeft >= 0 ) - HB_GTSELF_PUTCHAR( pGT, iTop + i, iLeft, bColor, bAttr, szBox[ 7 ] ); + HB_GTSELF_PUTCHAR( pGT, iTop + i, iLeft, iColor, bAttr, szBox[ 7 ] ); if( iCols && szBox[ 8 ] ) - HB_GTSELF_REPLICATE( pGT, iTop + i, iFirst, bColor, bAttr, szBox[ 8 ], iCols ); + HB_GTSELF_REPLICATE( pGT, iTop + i, iFirst, iColor, bAttr, szBox[ 8 ], iCols ); if( iRight <= iMaxCol ) - HB_GTSELF_PUTCHAR( pGT, iTop + i, iFirst + iCols, bColor, bAttr, szBox[ 3 ] ); + HB_GTSELF_PUTCHAR( pGT, iTop + i, iFirst + iCols, iColor, bAttr, szBox[ 3 ] ); } if( iBottom <= iMaxRow ) { if( iLeft >= 0 ) - HB_GTSELF_PUTCHAR( pGT, iBottom, iLeft, bColor, bAttr, szBox[ 6 ] ); + HB_GTSELF_PUTCHAR( pGT, iBottom, iLeft, iColor, bAttr, szBox[ 6 ] ); if( iCols ) - HB_GTSELF_REPLICATE( pGT, iBottom, iFirst, bColor, bAttr, szBox[ 5 ], iCols ); + HB_GTSELF_REPLICATE( pGT, iBottom, iFirst, iColor, bAttr, szBox[ 5 ], iCols ); if( iRight <= iMaxCol ) - HB_GTSELF_PUTCHAR( pGT, iBottom, iFirst + iCols, bColor, bAttr, szBox[ 4 ] ); + HB_GTSELF_PUTCHAR( pGT, iBottom, iFirst + iCols, iColor, bAttr, szBox[ 4 ] ); } } } } static void hb_gt_def_BoxS( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, - const char * szFrame, BYTE bColor ) + const char * szFrame, int iColor ) { HB_GTSELF_BOX( pGT, iTop, iLeft, iBottom, iRight, - szFrame ? szFrame : _B_SINGLE, bColor ); + szFrame ? szFrame : _B_SINGLE, iColor ); } static void hb_gt_def_BoxD( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight, - const char * szFrame, BYTE bColor ) + const char * szFrame, int iColor ) { HB_GTSELF_BOX( pGT, iTop, iLeft, iBottom, iRight, - szFrame ? szFrame : _B_DOUBLE, bColor ); + szFrame ? szFrame : _B_DOUBLE, iColor ); } static void hb_gt_def_HorizLine( PHB_GT pGT, int iRow, int iLeft, int iRight, - BYTE bChar, BYTE bColor ) + BYTE bChar, int iColor ) { int iLength, iCol; @@ -1383,11 +1387,11 @@ static void hb_gt_def_HorizLine( PHB_GT pGT, int iRow, int iLeft, int iRight, iCol = iRight; } - HB_GTSELF_REPLICATE( pGT, iRow, iCol, bColor, HB_GT_ATTR_BOX, bChar, iLength ); + HB_GTSELF_REPLICATE( pGT, iRow, iCol, iColor, HB_GT_ATTR_BOX, bChar, iLength ); } static void hb_gt_def_VertLine( PHB_GT pGT, int iCol, int iTop, int iBottom, - BYTE bChar, BYTE bColor ) + BYTE bChar, int iColor ) { int iLength, iRow; @@ -1410,7 +1414,7 @@ static void hb_gt_def_VertLine( PHB_GT pGT, int iCol, int iTop, int iBottom, while( --iLength >= 0 ) { - if( !HB_GTSELF_PUTCHAR( pGT, iRow, iCol, bColor, HB_GT_ATTR_BOX, bChar ) ) + if( !HB_GTSELF_PUTCHAR( pGT, iRow, iCol, iColor, HB_GT_ATTR_BOX, bChar ) ) break; ++iRow; } @@ -2015,7 +2019,7 @@ static BOOL hb_gt_def_Resize( PHB_GT pGT, int iRows, int iCols ) for( ulIndex = 0; ulIndex < ulLen; ++ulIndex ) { pGT->screenBuffer[ ulIndex ].c.usChar = HB_GTSELF_GETCLEARCHAR( pGT ); - pGT->screenBuffer[ ulIndex ].c.bColor = HB_GTSELF_GETCLEARCOLOR( pGT ); + pGT->screenBuffer[ ulIndex ].c.bColor = ( BYTE ) HB_GTSELF_GETCLEARCOLOR( pGT ); pGT->screenBuffer[ ulIndex ].c.bAttr = 0x00; pGT->prevBuffer[ ulIndex ].c.bAttr = HB_GT_ATTR_REFRESH; }