diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 9a9a6e818b..73738dec0b 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,26 @@ +2000-07-28 15:00 UTC-0400 David G. Holm + + * include/hbapigt.h + * source/rtl/gtapi.c + * Changed hb_gtSetPos() to hb_gtSetPosContext(). + * Restored hb_gtSetPos() with only two parameters + for Clipper GT API compatibility (what it does is + call hb_gtSetPosContext() with the third parameter + set to HB_GT_SET_POS_BEFORE, which still calls the + hb_gt_SetPos() function, so that the low-level + drivers didn't need to be changed again). + + * source/rtl/console.c + * source/rtl/gtapi.c + * source/rtl/oldclear.c + * source/rtl/setpos.c + * source/rtl/setposbs.c + * source/rtl/xsavescr.c + * All calls to hb_gtSetPos() changed to hb_gtSetPosContext(). + + * source/rtl/gtwin/gtwin.c + ! Corrected call to hb_gtSetPos() to call hb_gt_SetPos(). + 2000-07-28 18:15 UTC+0100 Ryszard Glab *source/compiler/harbour.l diff --git a/harbour/include/hbapigt.h b/harbour/include/hbapigt.h index 6e6374ada2..c0ad668502 100644 --- a/harbour/include/hbapigt.h +++ b/harbour/include/hbapigt.h @@ -151,7 +151,8 @@ extern USHORT hb_gtSetBlink( BOOL bBlink ); extern USHORT hb_gtSetColorStr( char * pszColorString ); extern USHORT hb_gtSetCursor( USHORT uiCursorShape ); extern USHORT hb_gtSetMode( USHORT uiRows, USHORT uiCols ); -extern USHORT hb_gtSetPos( SHORT iRow, SHORT iCol, SHORT iMode ); +extern USHORT hb_gtSetPos( SHORT iRow, SHORT iCol ); +extern USHORT hb_gtSetPosContext( SHORT iRow, SHORT iCol, SHORT iMode ); extern USHORT hb_gtSetSnowFlag( BOOL bNoSnow ); extern void hb_gtTone( double dFrequency, double dDuration ); extern USHORT hb_gtWrite( BYTE * pbyStr, ULONG ulLen ); diff --git a/harbour/source/rtl/console.c b/harbour/source/rtl/console.c index 9fd31b5316..1cde316520 100644 --- a/harbour/source/rtl/console.c +++ b/harbour/source/rtl/console.c @@ -397,7 +397,7 @@ static void hb_conDevPos( SHORT iRow, SHORT iCol ) hb_fsSetError( uiErrorOld ); /* Restore last user file error code */ } else - hb_gtSetPos( iRow, iCol, HB_GT_SET_POS_BEFORE ); + hb_gtSetPosContext( iRow, iCol, HB_GT_SET_POS_BEFORE ); } /* NOTE: This should be placed after the hb_devpos() definition. */ diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index a545662dd2..9727ede37e 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -191,7 +191,7 @@ USHORT hb_gtBox( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, B else hb_gt_HorizLine( uiTop, uiLeft, uiRight, szBox[ 1 ], ( BYTE ) s_pColor[ s_uiColorIndex ] ); - hb_gtSetPos( uiTop + 1, uiLeft + 1, HB_GT_SET_POS_AFTER ); + hb_gtSetPosContext( uiTop + 1, uiLeft + 1, HB_GT_SET_POS_AFTER ); return 0; } @@ -220,7 +220,7 @@ USHORT hb_gtBoxD( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight ) else hb_gt_HorizLine( uiTop, uiLeft, uiRight, HB_B_DOUBLE_V, ( BYTE ) s_pColor[ s_uiColorIndex ] ); - hb_gtSetPos( uiTop + 1, uiLeft + 1, HB_GT_SET_POS_AFTER ); + hb_gtSetPosContext( uiTop + 1, uiLeft + 1, HB_GT_SET_POS_AFTER ); return 0; } @@ -249,7 +249,7 @@ USHORT hb_gtBoxS( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight ) else hb_gt_HorizLine( uiTop, uiLeft, uiRight, HB_B_SINGLE_H, ( BYTE ) s_pColor[ s_uiColorIndex ] ); - hb_gtSetPos( uiTop + 1, uiLeft + 1, HB_GT_SET_POS_AFTER ); + hb_gtSetPosContext( uiTop + 1, uiLeft + 1, HB_GT_SET_POS_AFTER ); return 0; } @@ -647,12 +647,19 @@ USHORT hb_gtGetPos( SHORT * piRow, SHORT * piCol ) return 0; } -USHORT hb_gtSetPos( SHORT iRow, SHORT iCol, SHORT iMethod ) +USHORT hb_gtSetPos( SHORT iRow, SHORT iCol ) +{ + HB_TRACE(HB_TR_DEBUG, ("hb_gtSetPos(%hd, %hd)", iRow, iCol )); + + return hb_gtSetPosContext( iRow, iCol, HB_GT_SET_POS_BEFORE ); +} + +USHORT hb_gtSetPosContext( SHORT iRow, SHORT iCol, SHORT iMethod ) { USHORT uiMaxRow; USHORT uiMaxCol; - HB_TRACE(HB_TR_DEBUG, ("hb_gtSetPos(%hd, %hd, %hd)", iRow, iCol, iMethod)); + HB_TRACE(HB_TR_DEBUG, ("hb_gtSetPosContext(%hd, %hd, %hd)", iRow, iCol, iMethod)); uiMaxRow = hb_gt_GetScreenHeight(); uiMaxCol = hb_gt_GetScreenWidth(); @@ -801,7 +808,7 @@ USHORT hb_gtWrite( BYTE * pStr, ULONG ulLength ) } /* Finally, save the new cursor position, even if off-screen */ - hb_gtSetPos( s_iRow, s_iCol + ( SHORT ) ulLength, HB_GT_SET_POS_AFTER ); + hb_gtSetPosContext( s_iRow, s_iCol + ( SHORT ) ulLength, HB_GT_SET_POS_AFTER ); return 0; } @@ -824,7 +831,7 @@ USHORT hb_gtWriteAt( USHORT uiRow, USHORT uiCol, BYTE * pStr, ULONG ulLength ) } /* Finally, save the new cursor position, even if off-screen */ - hb_gtSetPos( uiRow, uiCol + ( SHORT ) ulLength, HB_GT_SET_POS_AFTER ); + hb_gtSetPosContext( uiRow, uiCol + ( SHORT ) ulLength, HB_GT_SET_POS_AFTER ); return 0; } @@ -854,7 +861,7 @@ USHORT hb_gtWriteCon( BYTE * pStr, ULONG ulLength ) iCol = ( s_iCol <= iMaxCol ) ? s_iCol : iMaxCol; if( iRow != s_iRow || iCol != s_iCol ) - hb_gtSetPos( iRow, iCol, HB_GT_SET_POS_BEFORE ); + hb_gtSetPosContext( iRow, iCol, HB_GT_SET_POS_BEFORE ); while( ulLength-- ) { @@ -940,7 +947,7 @@ USHORT hb_gtWriteCon( BYTE * pStr, ULONG ulLength ) and cursor off top edge of display */ hb_gtScroll( 0, 0, iMaxRow, iMaxCol, 1, 0 ); } - hb_gtSetPos( iRow, iCol, HB_GT_SET_POS_AFTER ); + hb_gtSetPosContext( iRow, iCol, HB_GT_SET_POS_AFTER ); bDisp = FALSE; bNewLine = FALSE; } diff --git a/harbour/source/rtl/gtwin/gtwin.c b/harbour/source/rtl/gtwin/gtwin.c index 2db90f7446..9d31036c58 100644 --- a/harbour/source/rtl/gtwin/gtwin.c +++ b/harbour/source/rtl/gtwin/gtwin.c @@ -675,7 +675,7 @@ BOOL hb_gt_AdjustPos( BYTE * pStr, ULONG ulLen ) GetConsoleScreenBufferInfo( s_HActive, &csbi ); - hb_gtSetPos( csbi.dwCursorPosition.Y, csbi.dwCursorPosition.X, HB_GT_SET_POS_AFTER ); + hb_gt_SetPos( csbi.dwCursorPosition.Y, csbi.dwCursorPosition.X, HB_GT_SET_POS_AFTER ); return TRUE; } diff --git a/harbour/source/rtl/oldclear.c b/harbour/source/rtl/oldclear.c index e8332477c2..7b91678349 100644 --- a/harbour/source/rtl/oldclear.c +++ b/harbour/source/rtl/oldclear.c @@ -41,7 +41,7 @@ HB_FUNC( __ATCLEAR ) { if( hb_pcount() == 4 ) { - hb_gtSetPos( hb_parni( 1 ), hb_parni( 2 ), HB_GT_SET_POS_BEFORE ); + hb_gtSetPosContext( hb_parni( 1 ), hb_parni( 2 ), HB_GT_SET_POS_BEFORE ); hb_gtScroll( hb_parni( 1 ), hb_parni( 2 ), hb_parni( 3 ), hb_parni( 4 ), 0, 0 ); } } @@ -49,7 +49,7 @@ HB_FUNC( __ATCLEAR ) HB_FUNC( __CLEAR ) { hb_gtScroll( 0, 0, hb_gtMaxRow(), hb_gtMaxCol(), 0, 0 ); - hb_gtSetPos( 0, 0, HB_GT_SET_POS_AFTER ); + hb_gtSetPosContext( 0, 0, HB_GT_SET_POS_AFTER ); } #endif diff --git a/harbour/source/rtl/setpos.c b/harbour/source/rtl/setpos.c index f88c0308e0..075e74452e 100644 --- a/harbour/source/rtl/setpos.c +++ b/harbour/source/rtl/setpos.c @@ -50,7 +50,7 @@ HB_FUNC( SETPOS ) /* Sets the screen position */ { if( ISNUM( 1 ) && ISNUM( 2 ) ) - hb_gtSetPos( hb_parni( 1 ), hb_parni( 2 ), HB_GT_SET_POS_BEFORE ); + hb_gtSetPosContext( hb_parni( 1 ), hb_parni( 2 ), HB_GT_SET_POS_BEFORE ); } HB_FUNC( ROW ) /* Return the current screen row position (zero origin) */ diff --git a/harbour/source/rtl/setposbs.c b/harbour/source/rtl/setposbs.c index 0045d9908e..6311a65ed5 100644 --- a/harbour/source/rtl/setposbs.c +++ b/harbour/source/rtl/setposbs.c @@ -47,6 +47,6 @@ HB_FUNC( SETPOSBS ) /* Move the screen position to the right by one column */ [vszakats] */ hb_gtGetPos( &iRow, &iCol ); - hb_gtSetPos( iRow, iCol + 1, HB_GT_SET_POS_AFTER ); + hb_gtSetPosContext( iRow, iCol + 1, HB_GT_SET_POS_AFTER ); } diff --git a/harbour/source/rtl/xsavescr.c b/harbour/source/rtl/xsavescr.c index 7a29e3679b..e1d08bb3f6 100644 --- a/harbour/source/rtl/xsavescr.c +++ b/harbour/source/rtl/xsavescr.c @@ -91,7 +91,7 @@ HB_FUNC( __XRESTSCREEN ) hb_xfree( s_pBuffer ); s_pBuffer = NULL; - hb_gtSetPos( s_iRow, s_iCol, HB_GT_SET_POS_AFTER ); + hb_gtSetPosContext( s_iRow, s_iCol, HB_GT_SET_POS_AFTER ); } }