From 684186b30a01c4e7d9ace7c39b4d79ed6358e57e Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Wed, 12 Dec 2007 21:02:06 +0000 Subject: [PATCH] 2007-12-12 22:01 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/gt_tpl/gt_tpl.c * harbour/source/rtl/gtdos/gtdos.c * harbour/source/rtl/gtos2/gtos2.c * updated for new API * harbour/source/rtl/gtcgi/gtcgi.c * harbour/source/rtl/gtstd/gtstd.c * harbour/source/rtl/gtpca/gtpca.c * harbour/source/rtl/gttrm/gttrm.c * harbour/source/rtl/gtcrs/gtcrs.c * harbour/source/rtl/gtsln/gtsln.c * harbour/source/rtl/gtxwc/gtxwc.c * harbour/source/rtl/gtwin/gtwin.c * harbour/source/rtl/gtwvt/gtwvt.c * harbour/source/rtl/gtalleg/gtalleg.c * cleanup --- harbour/ChangeLog | 18 ++ harbour/source/rtl/gt_tpl/gt_tpl.c | 54 +++--- harbour/source/rtl/gtalleg/gtalleg.c | 4 +- harbour/source/rtl/gtcgi/gtcgi.c | 2 +- harbour/source/rtl/gtcrs/gtcrs.c | 11 +- harbour/source/rtl/gtdos/gtdos.c | 242 ++++++++++++++------------- harbour/source/rtl/gtos2/gtos2.c | 188 +++++++++++---------- harbour/source/rtl/gtpca/gtpca.c | 47 ++++-- harbour/source/rtl/gtsln/gtsln.c | 39 ++--- harbour/source/rtl/gtstd/gtstd.c | 9 +- harbour/source/rtl/gttrm/gttrm.c | 13 +- harbour/source/rtl/gtwin/gtwin.c | 2 +- harbour/source/rtl/gtwvt/gtwvt.c | 8 +- harbour/source/rtl/gtxwc/gtxwc.c | 15 +- 14 files changed, 360 insertions(+), 292 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 5aa4e34a61..246c3affbe 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,24 @@ 2002-12-01 13:30 UTC+0100 Foo Bar */ +2007-12-12 22:01 UTC+0100 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rtl/gt_tpl/gt_tpl.c + * harbour/source/rtl/gtdos/gtdos.c + * harbour/source/rtl/gtos2/gtos2.c + * updated for new API + + * harbour/source/rtl/gtcgi/gtcgi.c + * harbour/source/rtl/gtstd/gtstd.c + * harbour/source/rtl/gtpca/gtpca.c + * harbour/source/rtl/gttrm/gttrm.c + * harbour/source/rtl/gtcrs/gtcrs.c + * harbour/source/rtl/gtsln/gtsln.c + * harbour/source/rtl/gtxwc/gtxwc.c + * harbour/source/rtl/gtwin/gtwin.c + * harbour/source/rtl/gtwvt/gtwvt.c + * harbour/source/rtl/gtalleg/gtalleg.c + * cleanup + 2007-12-13 10:42 UTC+0800 Pritpal Bedi (pritpal@vouchcac.com) * harbour/contrib/hbgtwvg/wvtpaint.prg ! Formatting. diff --git a/harbour/source/rtl/gt_tpl/gt_tpl.c b/harbour/source/rtl/gt_tpl/gt_tpl.c index 0c6bb7802c..e5f8b26a57 100644 --- a/harbour/source/rtl/gt_tpl/gt_tpl.c +++ b/harbour/source/rtl/gt_tpl/gt_tpl.c @@ -56,33 +56,35 @@ #include "hbgtcore.h" #include "hbinit.h" +static int s_GtId; +static HB_GT_FUNCS SuperTable; +#define HB_GTSUPER (&SuperTable) +#define HB_GTID_PTR (&s_GtId) -static HB_GT_FUNCS SuperTable; -#define HB_GTSUPER (&SuperTable) - -static void hb_gt_tpl_Init( FHANDLE hFilenoStdin, FHANDLE hFilenoStdout, FHANDLE hFilenoStderr ) +static void hb_gt_tpl_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStdout, FHANDLE hFilenoStderr ) { - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Init(%p,%p,%p)", hFilenoStdin, hFilenoStdout, hFilenoStderr ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Init(%p,%p,%p,%p)", pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ) ); /* TODO: */ - HB_GTSUPER_INIT( hFilenoStdin, hFilenoStdout, hFilenoStderr ); + HB_GTSUPER_INIT( pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ); } -static void hb_gt_tpl_Exit( void ) +static void hb_gt_tpl_Exit( PHB_GT pGT ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_tpl_Exit()")); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_tpl_Exit(%p)", pGT)); - HB_GTSUPER_EXIT(); + HB_GTSUPER_EXIT( pGT ); /* TODO: */ } -static int hb_gt_tpl_ReadKey( int iEventMask ) +static int hb_gt_tpl_ReadKey( PHB_GT pGT, int iEventMask ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_tpl_ReadKey(%d)", iEventMask)); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_tpl_ReadKey(%p,%d)", pGT, iEventMask)); + HB_SYMBOL_UNUSED( pGT ); HB_SYMBOL_UNUSED( iEventMask ); /* TODO: check the input queue (incoming mouse and keyboard events) @@ -91,9 +93,11 @@ static int hb_gt_tpl_ReadKey( int iEventMask ) return 0; } -static char * hb_gt_tpl_Version( int iType ) +static char * hb_gt_tpl_Version( PHB_GT pGT, int iType ) { - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Version(%d)", iType ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Version(%p,%d)", pGT, iType ) ); + + HB_SYMBOL_UNUSED( pGT ); if( iType == 0 ) return HB_GT_DRVNAME( HB_GT_NAME ); @@ -101,10 +105,11 @@ static char * hb_gt_tpl_Version( int iType ) return "Harbour Terminal: (template)"; } -static BOOL hb_gt_tpl_SetMode( int iRows, int iCols ) +static BOOL hb_gt_tpl_SetMode( PHB_GT pGT, int iRows, int iCols ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_tpl_SetMode(%d, %d)", iRows, iCols)); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_tpl_SetMode(%p,%d,%d)", pGT, iRows, iCols)); + HB_SYMBOL_UNUSED( pGT ); HB_SYMBOL_UNUSED( iRows ); HB_SYMBOL_UNUSED( iCols ); @@ -113,30 +118,30 @@ static BOOL hb_gt_tpl_SetMode( int iRows, int iCols ) return FALSE; } -static void hb_gt_tpl_Redraw( int iRow, int iCol, int iSize ) +static void hb_gt_tpl_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) { BYTE bColor, bAttr; USHORT usChar; - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Redraw(%d, %d, %d)", iRow, iCol, iSize ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) ); while( iSize-- ) { - if( !hb_gt_GetScrChar( iRow, iCol, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol, &bColor, &bAttr, &usChar ) ) break; /* TODO: display usChar at iRow, iCol position with color bColor */ ++iCol; } } -static void hb_gt_tpl_Refresh( void ) +static void hb_gt_tpl_Refresh( PHB_GT pGT ) { int iRow, iCol, iStyle; - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Refresh()" ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Refresh(%p)", pGT ) ); - HB_GTSUPER_REFRESH(); - hb_gt_GetScrCursor( &iRow, &iCol, &iStyle ); + HB_GTSUPER_REFRESH( pGT ); + HB_GTSELF_GETSCRCURSOR( pGT, &iRow, &iCol, &iStyle ); /* TODO: set cursor position and shape */ } @@ -163,9 +168,10 @@ static BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable ) static HB_GT_INIT gtInit = { HB_GT_DRVNAME( HB_GT_NAME ), hb_gt_FuncInit, - HB_GTSUPER }; + HB_GTSUPER, + HB_GTID_PTR }; -HB_GT_ANNOUNCE( HB_GT_NAME ); +HB_GT_ANNOUNCE( HB_GT_NAME ) HB_CALL_ON_STARTUP_BEGIN( _hb_startup_gt_Init_ ) hb_gtRegister( >Init ); diff --git a/harbour/source/rtl/gtalleg/gtalleg.c b/harbour/source/rtl/gtalleg/gtalleg.c index faae5adf34..7afb5a10a6 100644 --- a/harbour/source/rtl/gtalleg/gtalleg.c +++ b/harbour/source/rtl/gtalleg/gtalleg.c @@ -504,7 +504,7 @@ static BOOL hb_gt_alleg_InitializeScreen( PHB_GT pGT, int iRows, int iCols, BOOL al_clear_to_color( al_screen, bColor ); } - HB_GTSUPER_RESIZE( pGT, s_iScrHeight, s_iScrWidth ); + HB_GTSELF_RESIZE( pGT, s_iScrHeight, s_iScrWidth ); HB_GTSELF_EXPOSEAREA( pGT, 0, 0, s_iScrHeight, s_iScrWidth ); HB_GTSELF_REFRESH( pGT ); } @@ -539,7 +539,7 @@ static void hb_gt_alleg_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoS } HB_GTSUPER_INIT( pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ); - HB_GTSUPER_RESIZE( pGT, s_iScrHeight, s_iScrWidth ); + HB_GTSELF_RESIZE( pGT, s_iScrHeight, s_iScrWidth ); } static void hb_gt_alleg_Exit( PHB_GT pGT ) diff --git a/harbour/source/rtl/gtcgi/gtcgi.c b/harbour/source/rtl/gtcgi/gtcgi.c index 212f9fe2ea..f23f36ac36 100644 --- a/harbour/source/rtl/gtcgi/gtcgi.c +++ b/harbour/source/rtl/gtcgi/gtcgi.c @@ -200,7 +200,7 @@ static void hb_gt_cgi_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iBottom >= iHeight - 1 && iRight >= iWidth - 1 ) { /* scroll up the internal screen buffer */ - HB_GTSUPER_SCROLLUP( pGT, iRows, bColor, bChar ); + HB_GTSELF_SCROLLUP( pGT, iRows, bColor, bChar ); /* update our internal row position */ s_iRow -= iRows; if( s_iRow < 0 ) diff --git a/harbour/source/rtl/gtcrs/gtcrs.c b/harbour/source/rtl/gtcrs/gtcrs.c index 6192b6a715..ed6b6231eb 100644 --- a/harbour/source/rtl/gtcrs/gtcrs.c +++ b/harbour/source/rtl/gtcrs/gtcrs.c @@ -2471,7 +2471,7 @@ static void hb_gt_crs_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStd { add_new_ioBase( ioBase ); HB_GTSUPER_INIT( pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ); - HB_GTSUPER_RESIZE( pGT, s_ioBase->maxrow, s_ioBase->maxcol ); + HB_GTSELF_RESIZE( pGT, s_ioBase->maxrow, s_ioBase->maxcol ); HB_GTSELF_SETFLAG( pGT, GTI_COMPATBUFFER, FALSE ); HB_GTSELF_SETBLINK( pGT, TRUE ); } @@ -2511,7 +2511,7 @@ static BOOL hb_gt_crs_SetMode( PHB_GT pGT, int iRows, int iCols ) if( gt_setsize( s_ioBase, iRows, iCols ) == 0 ) { - HB_GTSUPER_RESIZE( pGT, iRows, iCols ); + HB_GTSELF_RESIZE( pGT, iRows, iCols ); return TRUE; } return FALSE; @@ -2788,7 +2788,7 @@ static int hb_gt_crs_ReadKey( PHB_GT pGT, int iEventMask ) if( iKey == K_RESIZE ) { gt_resize( s_ioBase ); - HB_GTSUPER_RESIZE( pGT, s_ioBase->maxrow, s_ioBase->maxcol ); + HB_GTSELF_RESIZE( pGT, s_ioBase->maxrow, s_ioBase->maxcol ); iKey = 0; } @@ -2850,7 +2850,7 @@ static BOOL hb_gt_crs_SetKeyCP( PHB_GT pGT, char *pszTermCDP, char *pszHostCDP ) { HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_SetKeyCP(%p,%s,%s)", pGT, pszTermCDP, pszHostCDP ) ); - HB_SYMBOL_UNUSED( pGT ); + HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); #ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP || !*pszHostCDP ) @@ -2881,9 +2881,6 @@ static BOOL hb_gt_crs_SetKeyCP( PHB_GT pGT, char *pszTermCDP, char *pszHostCDP ) return TRUE; } } -#else - HB_SYMBOL_UNUSED( pszTermCDP ); - HB_SYMBOL_UNUSED( pszHostCDP ); #endif return FALSE; diff --git a/harbour/source/rtl/gtdos/gtdos.c b/harbour/source/rtl/gtdos/gtdos.c index 000d742e99..2a7033f685 100644 --- a/harbour/source/rtl/gtdos/gtdos.c +++ b/harbour/source/rtl/gtdos/gtdos.c @@ -111,7 +111,6 @@ #define HB_MOUSE_SAVE #endif - #if defined(__DJGPP__) #include #include @@ -243,19 +242,19 @@ static void hb_gt_dos_GetScreenSize( int * piRows, int * piCols ) } #if !defined(__DJGPP__) -static char FAR * hb_gt_dos_ScreenAddress() +static char FAR * hb_gt_dos_ScreenAddress( PHB_GT pGT ) { char FAR * ptr; - HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_ScreenAddress()")); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_ScreenAddress(%p)", pGT)); #if defined(__WATCOMC__) && defined(__386__) - if( hb_gt_IsColor() ) + if( HB_GTSELF_ISCOLOR( pGT ) ) ptr = ( char * ) ( 0xB800 << 4 ); else ptr = ( char * )( 0xB000 << 4 ); #else - if( hb_gt_IsColor() ) + if( HB_GTSELF_ISCOLOR( pGT ) ) ptr = ( char FAR * ) MK_FP( 0xB800, 0x0000 ); else ptr = ( char FAR * ) MK_FP( 0xB000, 0x0000 ); @@ -272,7 +271,7 @@ BYTE FAR * hb_gt_dos_ScreenPtr( int iRow, int iCol ) } #endif -static void hb_gt_dos_GetScreenContents( void ) +static void hb_gt_dos_GetScreenContents( PHB_GT pGT ) { int iRow, iCol; BYTE bAttr, bChar; @@ -280,7 +279,7 @@ static void hb_gt_dos_GetScreenContents( void ) BYTE * pScreenPtr = s_pScreenAddres; #endif - HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_GetScreenContents()")); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_GetScreenContents(%p)", pGT)); for( iRow = 0; iRow < s_iRows; ++iRow ) { @@ -301,10 +300,10 @@ static void hb_gt_dos_GetScreenContents( void ) bAttr = *( pScreenPtr + 1 ); pScreenPtr += 2; #endif - hb_gt_PutScrChar( iRow, iCol, bAttr, 0, s_charTransRev[ bChar ] ); + HB_GTSELF_PUTSCRCHAR( pGT, iRow, iCol, bAttr, 0, s_charTransRev[ bChar ] ); } } - hb_gt_ColdArea( 0, 0, s_iRows, s_iCols ); + HB_GTSELF_COLDAREA( pGT, 0, 0, s_iRows, s_iCols ); } static void hb_gt_dos_GetCursorPosition( int * piRow, int * piCol ) @@ -445,7 +444,7 @@ static int s_iMouseRight; static int s_iMouseStorageSize = 0; /* size of mouse storage buffer */ #endif -static void hb_gt_dos_mouse_Init( void ) +static void hb_gt_dos_mouse_Init( PHB_GT pGT ) { union REGS regs; @@ -460,31 +459,35 @@ static void hb_gt_dos_mouse_Init( void ) if( s_iMouseButtons == 0xffff ) s_iMouseButtons = 2; - s_iMouseInitCol = hb_mouse_Col(); - s_iMouseInitRow = hb_mouse_Row(); + s_iMouseInitCol = HB_GTSELF_MOUSECOL( pGT ); + s_iMouseInitRow = HB_GTSELF_MOUSEROW( pGT ); } } -static void hb_gt_dos_mouse_Exit( void ) +static void hb_gt_dos_mouse_Exit( PHB_GT pGT ) { if( s_fMousePresent ) { int iHeight, iWidth; - hb_gt_GetSize( &iHeight, &iWidth ); - hb_mouse_SetPos( s_iMouseInitRow, s_iMouseInitCol ); - hb_mouse_SetBounds( 0, 0, iHeight - 1, iWidth - 1 ); + HB_GTSELF_GETSIZE( pGT, &iHeight, &iWidth ); + HB_GTSELF_MOUSESETPOS( pGT, s_iMouseInitRow, s_iMouseInitCol ); + HB_GTSELF_MOUSESETBOUNDS( pGT, 0, 0, iHeight - 1, iWidth - 1 ); s_fMousePresent = FALSE; } } -static BOOL hb_gt_dos_mouse_IsPresent( void ) +static BOOL hb_gt_dos_mouse_IsPresent( PHB_GT pGT ) { + HB_SYMBOL_UNUSED( pGT ); + return s_fMousePresent; } -static void hb_gt_dos_mouse_Show( void ) +static void hb_gt_dos_mouse_Show( PHB_GT pGT ) { + HB_SYMBOL_UNUSED( pGT ); + if( s_fMousePresent ) { union REGS regs; @@ -496,8 +499,10 @@ static void hb_gt_dos_mouse_Show( void ) } } -static void hb_gt_dos_mouse_Hide( void ) +static void hb_gt_dos_mouse_Hide( PHB_GT pGT ) { + HB_SYMBOL_UNUSED( pGT ); + if( s_fMousePresent ) { union REGS regs; @@ -509,8 +514,10 @@ static void hb_gt_dos_mouse_Hide( void ) } } -static void hb_gt_dos_mouse_GetPos( int * piRow, int * piCol ) +static void hb_gt_dos_mouse_GetPos( PHB_GT pGT, int * piRow, int * piCol ) { + HB_SYMBOL_UNUSED( pGT ); + if( s_fMousePresent ) { union REGS regs; @@ -525,8 +532,10 @@ static void hb_gt_dos_mouse_GetPos( int * piRow, int * piCol ) *piRow = *piCol = 0; } -static void hb_gt_dos_mouse_SetPos( int iRow, int iCol ) +static void hb_gt_dos_mouse_SetPos( PHB_GT pGT, int iRow, int iCol ) { + HB_SYMBOL_UNUSED( pGT ); + if( s_fMousePresent ) { union REGS regs; @@ -538,16 +547,20 @@ static void hb_gt_dos_mouse_SetPos( int iRow, int iCol ) } } -static int hb_gt_dos_mouse_CountButton( void ) +static int hb_gt_dos_mouse_CountButton( PHB_GT pGT ) { + HB_SYMBOL_UNUSED( pGT ); + if( s_fMousePresent ) return s_iMouseButtons; else return 0; } -static BOOL hb_gt_dos_mouse_ButtonState( int iButton ) +static BOOL hb_gt_dos_mouse_ButtonState( PHB_GT pGT, int iButton ) { + HB_SYMBOL_UNUSED( pGT ); + if( s_fMousePresent ) { union REGS regs; @@ -562,8 +575,10 @@ static BOOL hb_gt_dos_mouse_ButtonState( int iButton ) return FALSE; } -static BOOL hb_gt_dos_mouse_ButtonPressed( int iButton, int * piRow, int * piCol ) +static BOOL hb_gt_dos_mouse_ButtonPressed( PHB_GT pGT, int iButton, int * piRow, int * piCol ) { + HB_SYMBOL_UNUSED( pGT ); + if( s_fMousePresent ) { union REGS regs; @@ -584,8 +599,10 @@ static BOOL hb_gt_dos_mouse_ButtonPressed( int iButton, int * piRow, int * piCol return FALSE; } -static BOOL hb_gt_dos_mouse_ButtonReleased( int iButton, int * piRow, int * piCol ) +static BOOL hb_gt_dos_mouse_ButtonReleased( PHB_GT pGT, int iButton, int * piRow, int * piCol ) { + HB_SYMBOL_UNUSED( pGT ); + if( s_fMousePresent ) { union REGS regs; @@ -607,8 +624,10 @@ static BOOL hb_gt_dos_mouse_ButtonReleased( int iButton, int * piRow, int * piCo } #ifdef HB_MOUSE_SAVE -static int hb_gt_dos_mouse_StorageSize( void ) +static int hb_gt_dos_mouse_StorageSize( PHB_GT pGT ) { + HB_SYMBOL_UNUSED( pGT ); + int iSize = 0; if( s_fMousePresent ) @@ -624,7 +643,7 @@ static int hb_gt_dos_mouse_StorageSize( void ) return iSize; } -static void hb_gt_dos_mouse_SaveState( BYTE * pBuffer ) +static void hb_gt_dos_mouse_SaveState( PHB_GT pGT, BYTE * pBuffer ) { if( s_fMousePresent ) { @@ -657,11 +676,11 @@ static void hb_gt_dos_mouse_SaveState( BYTE * pBuffer ) sregs.es = FP_SEG( pBuffer ); HB_DOS_INT86X( 0x33, ®s, ®s, &sregs ); #endif - pBuffer[ s_iMouseStorageSize ] = hb_mouse_GetCursor() ? 1 : 0; + pBuffer[ s_iMouseStorageSize ] = HB_GTSELF_MOUSEGETCURSOR( pGT ) ? 1 : 0; } } -static void hb_gt_dos_mouse_RestoreState( BYTE * pBuffer ) +static void hb_gt_dos_mouse_RestoreState( PHB_GT pGT, BYTE * pBuffer ) { if( s_fMousePresent ) { @@ -676,7 +695,7 @@ static void hb_gt_dos_mouse_RestoreState( BYTE * pBuffer ) * because the real mouse cursor state will be also recovered * by status restoring */ - hb_mouse_SetCursor( pBuffer[ s_iMouseStorageSize ] ); + HB_GTSELF_MOUSESETCURSOR( pGT, pBuffer[ s_iMouseStorageSize ] ); #if defined( __DJGPP__ ) { @@ -706,8 +725,10 @@ static void hb_gt_dos_mouse_RestoreState( BYTE * pBuffer ) } #endif -static void hb_gt_dos_mouse_SetBounds( int iTop, int iLeft, int iBottom, int iRight ) +static void hb_gt_dos_mouse_SetBounds( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight ) { + HB_SYMBOL_UNUSED( pGT ); + if( s_fMousePresent ) { union REGS regs; @@ -730,7 +751,7 @@ static void hb_gt_dos_mouse_SetBounds( int iTop, int iLeft, int iBottom, int iRi } } -static void hb_gt_dos_mouse_GetBounds( int * piTop, int * piLeft, int * piBottom, int * piRight ) +static void hb_gt_dos_mouse_GetBounds( PHB_GT pGT, int * piTop, int * piLeft, int * piBottom, int * piRight ) { if( s_fMouseBound ) { @@ -742,7 +763,7 @@ static void hb_gt_dos_mouse_GetBounds( int * piTop, int * piLeft, int * piBottom else { *piTop = *piLeft = 0; - hb_gt_GetSize( piBottom, piRight ); + HB_GTSELF_GETSIZE( pGT, piBottom, piRight ); --(*piBottom); --(*piRight); } @@ -750,9 +771,9 @@ static void hb_gt_dos_mouse_GetBounds( int * piTop, int * piLeft, int * piBottom /* *********************************************************************** */ -static void hb_gt_dos_Init( FHANDLE hFilenoStdin, FHANDLE hFilenoStdout, FHANDLE hFilenoStderr ) +static void hb_gt_dos_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStdout, FHANDLE hFilenoStderr ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_Init(%p,%p,%p)", hFilenoStdin, hFilenoStdout, hFilenoStderr)); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_Init(%p,%p,%p,%p)", pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr)); s_bBreak = FALSE; @@ -789,36 +810,36 @@ static void hb_gt_dos_Init( FHANDLE hFilenoStdin, FHANDLE hFilenoStdout, FHANDLE #endif /* initialize code page translation */ - hb_gt_SetDispCP( NULL, NULL, FALSE ); - hb_gt_SetKeyCP( NULL, NULL ); + HB_GTSELF_SETDISPCP( pGT, NULL, NULL, FALSE ); + HB_GTSELF_SETKEYCP( pGT, NULL, NULL ); s_iScreenMode = hb_gt_dos_GetScreenMode(); #if !defined(__DJGPP__) - s_pScreenAddres = hb_gt_dos_ScreenAddress(); + s_pScreenAddres = hb_gt_dos_ScreenAddress( pGT ); #endif hb_gt_dos_GetScreenSize( &s_iRows, &s_iCols ); hb_gt_dos_GetCursorPosition( &s_iCurRow, &s_iCurCol ); s_iCursorStyle = hb_gt_dos_GetCursorStyle(); - HB_GTSUPER_INIT( hFilenoStdin, hFilenoStdout, hFilenoStderr ); - HB_GTSUPER_RESIZE( s_iRows, s_iCols ); - hb_gt_dos_GetScreenContents(); - hb_gt_SetPos( s_iCurRow, s_iCurCol ); + HB_GTSUPER_INIT( pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ); + HB_GTSELF_RESIZE( pGT, s_iRows, s_iCols ); + hb_gt_dos_GetScreenContents( pGT ); + HB_GTSELF_SETPOS( pGT, s_iCurRow, s_iCurCol ); if( s_iCursorStyle > 0 ) - hb_gt_SetCursorStyle( s_iCursorStyle ); + HB_GTSELF_SETCURSORSTYLE( pGT, s_iCursorStyle ); } -static void hb_gt_dos_Exit( void ) +static void hb_gt_dos_Exit( PHB_GT pGT ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_Exit()")); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_Exit(%p)", pGT)); - HB_GTSUPER_EXIT(); + HB_GTSUPER_EXIT( pGT ); } -static int hb_gt_dos_ReadKey( int iEventMask ) +static int hb_gt_dos_ReadKey( PHB_GT pGT, int iEventMask ) { int ch = 0; - HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_ReadKey(%d)", iEventMask)); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_ReadKey(%p,%d)", pGT, iEventMask)); #if defined(__DJGPP__) /* Check to see if Ctrl+Break has been detected */ @@ -979,7 +1000,7 @@ static int hb_gt_dos_ReadKey( int iEventMask ) } if( ch == 0 ) { - ch = hb_mouse_ReadKey( iEventMask ); + ch = HB_GTSELF_MOUSEREADKEY( pGT, iEventMask ); } else if( ch > 0 && ch <= 255 ) { @@ -989,16 +1010,20 @@ static int hb_gt_dos_ReadKey( int iEventMask ) return ch; } -static BOOL hb_gt_dos_IsColor( void ) +static BOOL hb_gt_dos_IsColor( PHB_GT pGT ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_IsColor()")); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_IsColor(%p)", pGT)); + + HB_SYMBOL_UNUSED( pGT ); return s_iScreenMode != 7; } -static BOOL hb_gt_dos_GetBlink() +static BOOL hb_gt_dos_GetBlink( PHB_GT pGT ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_GetBlink()")); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_GetBlink(%p)", pGT)); + + HB_SYMBOL_UNUSED( pGT ); #if defined(__WATCOMC__) && defined(__386__) return ( *( ( char * ) 0x0465 ) & 0x10 ) != 0; @@ -1009,11 +1034,13 @@ static BOOL hb_gt_dos_GetBlink() #endif } -static void hb_gt_dos_SetBlink( BOOL fBlink ) +static void hb_gt_dos_SetBlink( PHB_GT pGT, BOOL fBlink ) { union REGS regs; - HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_SetBlink(%d)", (int) fBlink)); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_SetBlink(%p,%d)", pGT, (int) fBlink)); + + HB_SYMBOL_UNUSED( pGT ); regs.h.ah = 0x10; regs.h.al = 0x03; @@ -1022,9 +1049,11 @@ static void hb_gt_dos_SetBlink( BOOL fBlink ) HB_DOS_INT86( 0x10, ®s, ®s ); } -static void hb_gt_dos_Tone( double dFrequency, double dDuration ) +static void hb_gt_dos_Tone( PHB_GT pGT, double dFrequency, double dDuration ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_Tone(%lf, %lf)", dFrequency, dDuration)); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration)); + + HB_SYMBOL_UNUSED( pGT ); dFrequency = HB_MIN( HB_MAX( 0.0, dFrequency ), 32767.0 ); @@ -1044,9 +1073,11 @@ static void hb_gt_dos_Tone( double dFrequency, double dDuration ) #endif } -static char * hb_gt_dos_Version( int iType ) +static char * hb_gt_dos_Version( PHB_GT pGT, int iType ) { - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Version(%d)", iType ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Version(%p,%d)", pGT, iType ) ); + + HB_SYMBOL_UNUSED( pGT ); if( iType == 0 ) return HB_GT_DRVNAME( HB_GT_NAME ); @@ -1213,12 +1244,12 @@ static USHORT hb_gt_dos_GetDisplay( void ) return ( regs.h.al == 0x1A ) ? regs.h.bl : 0xFF; } -static BOOL hb_gt_dos_SetMode( int iRows, int iCols ) +static BOOL hb_gt_dos_SetMode( PHB_GT pGT, int iRows, int iCols ) { - /* hb_gt_IsColor() test for color card, we need to know if it is a VGA board...*/ + /* HB_GTSELF_ISCOLOR( pGT ) test for color card, we need to know if it is a VGA board...*/ BOOL bIsVGA, bIsVesa, bSuccess; - HB_TRACE( HB_TR_DEBUG, ("hb_gt_dos_SetMode(%d, %d)", iRows, iCols) ); + HB_TRACE( HB_TR_DEBUG, ("hb_gt_dos_SetMode(%p,%d,%d)", pGT, iRows, iCols) ); bIsVGA = ( hb_gt_dos_GetDisplay() == 8 ); bIsVesa = FALSE; @@ -1275,71 +1306,57 @@ static BOOL hb_gt_dos_SetMode( int iRows, int iCols ) } s_iScreenMode = hb_gt_dos_GetScreenMode(); #if !defined(__DJGPP__) - s_pScreenAddres = hb_gt_dos_ScreenAddress(); + s_pScreenAddres = hb_gt_dos_ScreenAddress( pGT ); #endif hb_gt_dos_GetCursorPosition( &s_iCurRow, &s_iCurCol ); s_iCursorStyle = hb_gt_dos_GetCursorStyle(); - HB_GTSUPER_RESIZE( s_iRows, s_iCols ); - hb_gt_dos_GetScreenContents(); - hb_gt_SetPos( s_iCurRow, s_iCurCol ); + HB_GTSELF_RESIZE( pGT, s_iRows, s_iCols ); + hb_gt_dos_GetScreenContents( pGT ); + HB_GTSELF_SETPOS( pGT, s_iCurRow, s_iCurCol ); if( s_iCursorStyle > 0 ) - hb_gt_SetCursorStyle( s_iCursorStyle ); + HB_GTSELF_SETCURSORSTYLE( pGT, s_iCursorStyle ); return bSuccess; } -static BOOL hb_gt_dos_PreExt( void ) +static BOOL hb_gt_dos_PostExt( PHB_GT pGT ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_PreExt()")); - - return TRUE; -} - -static BOOL hb_gt_dos_PostExt( void ) -{ - HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_PostExt()")); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_PostExt(%p)", pGT)); hb_gt_dos_GetCursorPosition( &s_iCurRow, &s_iCurCol ); - hb_gt_dos_GetScreenContents(); - hb_gt_SetPos( s_iCurRow, s_iCurCol ); + hb_gt_dos_GetScreenContents( pGT ); + HB_GTSELF_SETPOS( pGT, s_iCurRow, s_iCurCol ); - return TRUE; + return HB_GTSUPER_POSTEXT( pGT ); } -static BOOL hb_gt_dos_Suspend( void ) +static BOOL hb_gt_dos_Resume( PHB_GT pGT ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_Suspend()")); - - return TRUE; -} - -static BOOL hb_gt_dos_Resume( void ) -{ - HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_Resume()")); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_dos_Resume(%p)", pGT)); s_iScreenMode = hb_gt_dos_GetScreenMode(); #if !defined(__DJGPP__) - s_pScreenAddres = hb_gt_dos_ScreenAddress(); + s_pScreenAddres = hb_gt_dos_ScreenAddress( pGT ); #endif hb_gt_dos_GetScreenSize( &s_iRows, &s_iCols ); hb_gt_dos_GetCursorPosition( &s_iCurRow, &s_iCurCol ); s_iCursorStyle = hb_gt_dos_GetCursorStyle(); - HB_GTSUPER_RESIZE( s_iRows, s_iCols ); - hb_gt_dos_GetScreenContents(); - hb_gt_SetPos( s_iCurRow, s_iCurCol ); + HB_GTSELF_RESIZE( pGT, s_iRows, s_iCols ); + hb_gt_dos_GetScreenContents( pGT ); + HB_GTSELF_SETPOS( pGT, s_iCurRow, s_iCurCol ); if( s_iCursorStyle > 0 ) - hb_gt_SetCursorStyle( s_iCursorStyle ); + HB_GTSELF_SETCURSORSTYLE( pGT, s_iCursorStyle ); - return TRUE; + return HB_GTSUPER_RESUME( pGT ); } -static BOOL hb_gt_dos_SetDispCP( char *pszTermCDP, char *pszHostCDP, BOOL fBox ) +static BOOL hb_gt_dos_SetDispCP( PHB_GT pGT, char *pszTermCDP, char *pszHostCDP, BOOL fBox ) { int i; - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_SetDispCP(%s,%s,%d)", pszTermCDP, pszHostCDP, (int) fBox ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_SetDispCP(%p,%s,%s,%d)", pGT, pszTermCDP, pszHostCDP, (int) fBox ) ); - HB_GTSUPER_SETDISPCP( pszTermCDP, pszHostCDP, fBox ); + HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); for( i = 0; i < 256; i++ ) s_charTrans[ i ] = ( BYTE ) i; @@ -1374,11 +1391,13 @@ static BOOL hb_gt_dos_SetDispCP( char *pszTermCDP, char *pszHostCDP, BOOL fBox ) /* *********************************************************************** */ -static BOOL hb_gt_dos_SetKeyCP( char *pszTermCDP, char *pszHostCDP ) +static BOOL hb_gt_dos_SetKeyCP( PHB_GT pGT, char *pszTermCDP, char *pszHostCDP ) { int i; - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_SetKeyCP(%s,%s)", pszTermCDP, pszHostCDP ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_SetKeyCP(%p,%s,%s)", pGT, pszTermCDP, pszHostCDP ) ); + + HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); for( i = 0; i < 256; i++ ) s_keyTrans[ i ] = ( BYTE ) i; @@ -1405,9 +1424,6 @@ static BOOL hb_gt_dos_SetKeyCP( char *pszTermCDP, char *pszHostCDP ) } } } -#else - HB_SYMBOL_UNUSED( pszTermCDP ); - HB_SYMBOL_UNUSED( pszHostCDP ); #endif return TRUE; @@ -1415,7 +1431,7 @@ static BOOL hb_gt_dos_SetKeyCP( char *pszTermCDP, char *pszHostCDP ) /* *********************************************************************** */ -static void hb_gt_dos_Redraw( int iRow, int iCol, int iSize ) +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 ); @@ -1424,11 +1440,11 @@ static void hb_gt_dos_Redraw( int iRow, int iCol, int iSize ) USHORT usChar; int iLen = 0; - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Redraw(%d, %d, %d)", iRow, iCol, iSize ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) ); while( iLen < iSize ) { - if( !hb_gt_GetScrChar( iRow, iCol + iLen, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iLen, &bColor, &bAttr, &usChar ) ) break; #if defined(__DJGPP__TEXT) @@ -1445,15 +1461,15 @@ static void hb_gt_dos_Redraw( int iRow, int iCol, int iSize ) } } -static void hb_gt_dos_Refresh( void ) +static void hb_gt_dos_Refresh( PHB_GT pGT ) { int iRow, iCol, iStyle; - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Refresh()" ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Refresh(%p)", pGT ) ); - HB_GTSUPER_REFRESH(); + HB_GTSUPER_REFRESH( pGT ); - hb_gt_GetScrCursor( &iRow, &iCol, &iStyle ); + HB_GTSELF_GETSCRCURSOR( pGT, &iRow, &iCol, &iStyle ); if( iStyle != SC_NONE ) { if( iRow >= 0 && iCol >= 0 && iRow < s_iRows && iCol < s_iCols ) @@ -1510,9 +1526,9 @@ static void hb_gt_dos_setKbdState( int iKbdState ) HB_POKE_BYTE( 0x0040, 0x0017, ucStat ); } -static BOOL hb_gt_dos_Info( int iType, PHB_GT_INFO pInfo ) +static BOOL hb_gt_dos_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) { - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Info(%d,%p)", iType, pInfo ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Info(%p,%d,%p)", pGT, iType, pInfo ) ); switch ( iType ) { @@ -1528,7 +1544,7 @@ static BOOL hb_gt_dos_Info( int iType, PHB_GT_INFO pInfo ) break; default: - return HB_GTSUPER_INFO( iType, pInfo ); + return HB_GTSUPER_INFO( pGT, iType, pInfo ); } return TRUE; @@ -1549,9 +1565,7 @@ static BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable ) pFuncTable->SetBlink = hb_gt_dos_SetBlink; pFuncTable->GetBlink = hb_gt_dos_GetBlink; pFuncTable->Version = hb_gt_dos_Version; - pFuncTable->Suspend = hb_gt_dos_Suspend; pFuncTable->Resume = hb_gt_dos_Resume; - pFuncTable->PreExt = hb_gt_dos_PreExt; pFuncTable->PostExt = hb_gt_dos_PostExt; pFuncTable->Tone = hb_gt_dos_Tone; pFuncTable->Info = hb_gt_dos_Info; diff --git a/harbour/source/rtl/gtos2/gtos2.c b/harbour/source/rtl/gtos2/gtos2.c index 8ed0990cdf..4abf4422c7 100644 --- a/harbour/source/rtl/gtos2/gtos2.c +++ b/harbour/source/rtl/gtos2/gtos2.c @@ -155,20 +155,24 @@ static PHKBD s_hk; /* mouse logical handle */ static HMOU s_uMouHandle; -static void hb_gt_os2_mouse_Init( void ) +static void hb_gt_os2_mouse_Init( PHB_GT pGT ) { USHORT fsEvents = MOUSE_MOTION_WITH_BN1_DOWN | MOUSE_BN1_DOWN | MOUSE_MOTION_WITH_BN2_DOWN | MOUSE_BN2_DOWN | MOUSE_MOTION_WITH_BN3_DOWN | MOUSE_BN3_DOWN ; + HB_SYMBOL_UNUSED( pGT ); + if( MouOpen ( 0L, &s_uMouHandle ) ) /* try to open mouse */ s_uMouHandle = 0; /* no mouse found */ else MouSetEventMask ( &fsEvents, s_uMouHandle ); /* mask some events */ } -static void hb_gt_os2_mouse_Exit( void ) +static void hb_gt_os2_mouse_Exit( PHB_GT pGT ) { + HB_SYMBOL_UNUSED( pGT ); + if( s_uMouHandle ) { MouClose( s_uMouHandle ); /* relese mouse handle */ @@ -176,26 +180,33 @@ static void hb_gt_os2_mouse_Exit( void ) } } -static BOOL hb_gt_os2_mouse_IsPresent( void ) +static BOOL hb_gt_os2_mouse_IsPresent( PHB_GT pGT ) { + HB_SYMBOL_UNUSED( pGT ); + return s_uMouHandle != 0; } -static void hb_gt_os2_mouse_Show( void ) +static void hb_gt_os2_mouse_Show( PHB_GT pGT ) { + HB_SYMBOL_UNUSED( pGT ); + if( s_uMouHandle ) MouDrawPtr( s_uMouHandle ); } -static void hb_gt_os2_mouse_Hide( void ) +static void hb_gt_os2_mouse_Hide( PHB_GT pGT ) { /* NOTE: mouse cursor always visible if not in full screen */ - NOPTRRECT rect; - VIOMODEINFO vi; /* needed to get max Row/Col */ + HB_SYMBOL_UNUSED( pGT ); + if( s_uMouHandle ) { + NOPTRRECT rect; + VIOMODEINFO vi; /* needed to get max Row/Col */ + /* QUESTION: should I call the GT MaxRow/Col function ? pro: encapsulating of the GetScreen function @@ -212,8 +223,10 @@ static void hb_gt_os2_mouse_Hide( void ) } } -static void hb_gt_os2_mouse_GetPos( int * row, int * col ) +static void hb_gt_os2_mouse_GetPos( PHB_GT pGT, int * row, int * col ) { + HB_SYMBOL_UNUSED( pGT ); + if( s_uMouHandle ) { PTRLOC pos; @@ -223,8 +236,10 @@ static void hb_gt_os2_mouse_GetPos( int * row, int * col ) } } -static void hb_gt_os2_mouse_SetPos( int row, int col ) +static void hb_gt_os2_mouse_SetPos( PHB_GT pGT, int row, int col ) { + HB_SYMBOL_UNUSED( pGT ); + if( s_uMouHandle ) { PTRLOC pos; @@ -292,8 +307,10 @@ static void hb_gt_os2_mouse_ReadMouseState( void ) } } -static BOOL hb_gt_os2_mouse_ButtonState( int iButton ) +static BOOL hb_gt_os2_mouse_ButtonState( PHB_GT pGT, int iButton ) { + HB_SYMBOL_UNUSED( pGT ); + hb_gt_os2_mouse_ReadMouseState(); if( s_uMouHandle && iButton >= 0 && iButton < 3 ) @@ -302,8 +319,10 @@ static BOOL hb_gt_os2_mouse_ButtonState( int iButton ) return FALSE; } -static BOOL hb_gt_os2_mouse_ButtonPressed( int iButton, int * piRow, int * piCol ) +static BOOL hb_gt_os2_mouse_ButtonPressed( PHB_GT pGT, int iButton, int * piRow, int * piCol ) { + HB_SYMBOL_UNUSED( pGT ); + hb_gt_os2_mouse_ReadMouseState(); if( s_uMouHandle && iButton >= 0 && iButton < 3 ) @@ -320,8 +339,10 @@ static BOOL hb_gt_os2_mouse_ButtonPressed( int iButton, int * piRow, int * piCol return FALSE; } -static BOOL hb_gt_os2_mouse_ButtonReleased( int iButton, int * piRow, int * piCol ) +static BOOL hb_gt_os2_mouse_ButtonReleased( PHB_GT pGT, int iButton, int * piRow, int * piCol ) { + HB_SYMBOL_UNUSED( pGT ); + hb_gt_os2_mouse_ReadMouseState(); if( s_uMouHandle && iButton >= 0 && iButton < 3 ) @@ -338,11 +359,15 @@ static BOOL hb_gt_os2_mouse_ButtonReleased( int iButton, int * piRow, int * piCo return FALSE; } -static int hb_gt_os2_mouse_CountButton( void ) +static int hb_gt_os2_mouse_CountButton( PHB_GT pGT ) { USHORT usButtons = 0; + + HB_SYMBOL_UNUSED( pGT ); + if( s_uMouHandle ) MouGetNumButtons ( &usButtons, s_uMouHandle ); + return ( int ) usButtons; } @@ -465,13 +490,13 @@ static void hb_gt_os2_SetCursorStyle( int iStyle ) } } -static void hb_gt_os2_GetScreenContents( void ) +static void hb_gt_os2_GetScreenContents( PHB_GT pGT ) { BYTE Cell[2]; int iRow, iCol; USHORT usSize; - HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_GetScreenContents()")`); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_GetScreenContents(%p)", pGT)); for( iRow = 0; iRow < s_vi.row; ++iRow ) { @@ -479,10 +504,10 @@ static void hb_gt_os2_GetScreenContents( void ) { usSize = 2; VioReadCellStr( ( PBYTE ) Cell, &usSize, iRow, iCol, 0 ); - hb_gt_PutScrChar( iRow, iCol, Cell[ 1 ], 0, Cell[ 0 ] ); + HB_GTSELF_PUTSCRCHAR( pGT, iRow, iCol, Cell[ 1 ], 0, Cell[ 0 ] ); } } - hb_gt_ColdArea( 0, 0, s_vi.row, s_vi.col ); + HB_GTSELF_COLDAREA( pGT, 0, 0, s_vi.row, s_vi.col ); } static PVOID hb_gt_os2_allocMem( int iSize ) @@ -497,9 +522,9 @@ static PVOID hb_gt_os2_allocMem( int iSize ) return pMem; } -static void hb_gt_os2_Init( FHANDLE hFilenoStdin, FHANDLE hFilenoStdout, FHANDLE hFilenoStderr ) +static void hb_gt_os2_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStdout, FHANDLE hFilenoStderr ) { - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Init(%p,%p,%p)", hFilenoStdin, hFilenoStdout, hFilenoStderr ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Init(%p,%p,%p,%p)", pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ) ); s_vi.cb = sizeof( VIOMODEINFO ); VioGetMode( &s_vi, 0 ); /* fill structure with current video mode settings */ @@ -552,30 +577,30 @@ static void hb_gt_os2_Init( FHANDLE hFilenoStdin, FHANDLE hFilenoStdout, FHANDLE hb_gt_os2_GetCursorPosition( &s_iCurRow, &s_iCurCol ); s_iCursorStyle = hb_gt_os2_GetCursorStyle(); - HB_GTSUPER_INIT( hFilenoStdin, hFilenoStdout, hFilenoStderr ); - HB_GTSUPER_RESIZE( s_vi.row, s_vi.col ); - HB_GTSUPER_SETPOS( s_iCurRow, s_iCurCol ); + HB_GTSUPER_INIT( pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ); + HB_GTSELF_RESIZE( pGT, s_vi.row, s_vi.col ); + HB_GTSELF_SETPOS( pGT, s_iCurRow, s_iCurCol ); if( s_iCursorStyle > 0 ) - HB_GTSUPER_SETCURSORSTYLE( s_iCursorStyle ); - hb_gt_os2_GetScreenContents(); + HB_GTSELF_SETCURSORSTYLE( pGT, s_iCursorStyle ); + hb_gt_os2_GetScreenContents( pGT ); } -static void hb_gt_os2_Exit( void ) +static void hb_gt_os2_Exit( PHB_GT pGT ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_Exit()")); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_Exit(%p)", pGT)); - HB_GTSUPER_EXIT(); + HB_GTSUPER_EXIT( pGT ); DosFreeMem( s_key ); DosFreeMem( s_hk ); VioSetCp( 0, s_usOldCodePage, 0 ); } -static int hb_gt_os2_ReadKey( int iEventMask ) +static int hb_gt_os2_ReadKey( PHB_GT pGT, int iEventMask ) { int ch; /* next char if any */ - HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_ReadKey(%d)", iEventMask)); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_ReadKey(%p,%d)", pGT, iEventMask)); /* zero out keyboard event record */ memset( s_key, 0, sizeof( KBDKEYINFO ) ); @@ -716,36 +741,43 @@ static int hb_gt_os2_ReadKey( int iEventMask ) } if( ch == 0 ) { - ch = hb_mouse_ReadKey( iEventMask ); + ch = HB_GTSELF_MOUSEREADKEY( pGT, iEventMask ); } return ch; } -static BOOL hb_gt_os2_IsColor( void ) +static BOOL hb_gt_os2_IsColor( PHB_GT pGT ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_IsColor()")); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_IsColor(%p)", pGT)); + + HB_SYMBOL_UNUSED( pGT ); return s_vi.fbType != 0; /* 0 = monochrom-compatible mode */ } -static BOOL hb_gt_os2_GetBlink() +static BOOL hb_gt_os2_GetBlink( PHB_GT pGT ) { VIOINTENSITY vi; - HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_GetBlink()")); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_GetBlink(%p)", pGT)); + + HB_SYMBOL_UNUSED( pGT ); vi.cb = sizeof( VIOINTENSITY ); /* 6 */ vi.type = 2; /* get intensity/blink toggle */ VioGetState( &vi, 0 ); + return vi.fs == 0; /* 0 = blink, 1 = intens */ } -static void hb_gt_os2_SetBlink( BOOL fBlink ) +static void hb_gt_os2_SetBlink( PHB_GT pGT, BOOL fBlink ) { VIOINTENSITY vi; - HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_SetBlink(%d)", (int) fBlink)); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_SetBlink(%p,%d)", pGT, (int) fBlink)); + + HB_SYMBOL_UNUSED( pGT ); vi.cb = sizeof( VIOINTENSITY ); /* 6 */ vi.type = 2; /* set intensity/blink toggle */ @@ -753,9 +785,11 @@ static void hb_gt_os2_SetBlink( BOOL fBlink ) VioSetState( &vi, 0 ); } -static void hb_gt_os2_Tone( double dFrequency, double dDuration ) +static void hb_gt_os2_Tone( PHB_GT pGT, double dFrequency, double dDuration ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_Tone(%lf, %lf)", dFrequency, dDuration)); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration)); + + HB_SYMBOL_UNUSED( pGT ); /* The conversion from Clipper timer tick units to milliseconds is * 1000.0 / 18.2. */ @@ -781,9 +815,11 @@ static void hb_gt_os2_Tone( double dFrequency, double dDuration ) } } -static char * hb_gt_os2_Version( int iType ) +static char * hb_gt_os2_Version( PHB_GT pGT, int iType ) { - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Version(%d)", iType ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Version(%p,%d)", pGT, iType ) ); + + HB_SYMBOL_UNUSED( pGT ); if( iType == 0 ) return HB_GT_DRVNAME( HB_GT_NAME ); @@ -791,11 +827,11 @@ static char * hb_gt_os2_Version( int iType ) return "Harbour Terminal: OS/2 console"; } -static BOOL hb_gt_os2_SetMode( int iRows, int iCols ) +static BOOL hb_gt_os2_SetMode( PHB_GT pGT, int iRows, int iCols ) { BOOL fResult; - HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_SetMode(%d, %d)", iRows, iCols)); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_SetMode(%p,%d,%d)", pGT, iRows, iCols)); s_vi.cb = sizeof( VIOMODEINFO ); VioGetMode( &s_vi, 0 ); /* fill structure with current settings */ @@ -811,68 +847,54 @@ static BOOL hb_gt_os2_SetMode( int iRows, int iCols ) hb_gt_os2_GetCursorPosition( &s_iCurRow, &s_iCurCol ); s_iCursorStyle = hb_gt_os2_GetCursorStyle(); - HB_GTSUPER_RESIZE( s_vi.row, s_vi.col ); - HB_GTSUPER_SETPOS( s_iCurRow, s_iCurCol ); + HB_GTSELF_RESIZE( pGT, s_vi.row, s_vi.col ); + HB_GTSELF_SETPOS( pGT, s_iCurRow, s_iCurCol ); if( s_iCursorStyle > 0 ) - HB_GTSUPER_SETCURSORSTYLE( s_iCursorStyle ); - hb_gt_os2_GetScreenContents(); + HB_GTSELF_SETCURSORSTYLE( pGT, s_iCursorStyle ); + hb_gt_os2_GetScreenContents( pGT ); return fResult; } -static BOOL hb_gt_os2_PreExt( void ) +static BOOL hb_gt_os2_PostExt( PHB_GT pGT ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_PreExt()")); - - return TRUE; -} - -static BOOL hb_gt_os2_PostExt( void ) -{ - HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_PostExt()")); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_PostExt(%p)", pGT)); hb_gt_os2_GetCursorPosition( &s_iCurRow, &s_iCurCol ); - HB_GTSUPER_SETPOS( s_iCurRow, s_iCurCol ); - hb_gt_os2_GetScreenContents(); + HB_GTSELF_SETPOS( pGT, s_iCurRow, s_iCurCol ); + hb_gt_os2_GetScreenContents( pGT ); - return TRUE; + return HB_GTSUPER_POSTEXT( pGT ); } -static BOOL hb_gt_os2_Suspend( void ) +static BOOL hb_gt_os2_Resume( PHB_GT pGT ) { - HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_Suspend()")); - - return TRUE; -} - -static BOOL hb_gt_os2_Resume( void ) -{ - HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_Resume()")); + HB_TRACE(HB_TR_DEBUG, ("hb_gt_os2_Resume(%p)", pGT)); s_vi.cb = sizeof( VIOMODEINFO ); VioGetMode( &s_vi, 0 ); /* fill structure with current settings */ hb_gt_os2_GetCursorPosition( &s_iCurRow, &s_iCurCol ); s_iCursorStyle = hb_gt_os2_GetCursorStyle(); - HB_GTSUPER_RESIZE( s_vi.row, s_vi.col ); - HB_GTSUPER_SETPOS( s_iCurRow, s_iCurCol ); + HB_GTSELF_RESIZE( pGT, s_vi.row, s_vi.col ); + HB_GTSELF_SETPOS( pGT, s_iCurRow, s_iCurCol ); if( s_iCursorStyle > 0 ) - HB_GTSUPER_SETCURSORSTYLE( s_iCursorStyle ); - hb_gt_os2_GetScreenContents(); + HB_GTSELF_SETCURSORSTYLE( pGT, s_iCursorStyle ); + hb_gt_os2_GetScreenContents( pGT ); - return TRUE; + return HB_GTSUPER_RESUME( pGT ); } -static void hb_gt_os2_Redraw( int iRow, int iCol, int iSize ) +static void hb_gt_os2_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) { BYTE bColor, bAttr; USHORT usChar, usCell; int iLen = 0; - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Redraw(%d, %d, %d)", iRow, iCol, iSize ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) ); while( iLen < iSize ) { - if( !hb_gt_GetScrChar( iRow, iCol + iLen, &bColor, &bAttr, &usChar ) ) + if( !HB_GTSELF_GETSCRCHAR( pGT, iRow, iCol + iLen, &bColor, &bAttr, &usChar ) ) break; /* @@ -888,15 +910,15 @@ static void hb_gt_os2_Redraw( int iRow, int iCol, int iSize ) } } -static void hb_gt_os2_Refresh( void ) +static void hb_gt_os2_Refresh( PHB_GT pGT ) { int iRow, iCol, iStyle; - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Refresh()" ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Refresh(%p)", pGT ) ); - HB_GTSUPER_REFRESH(); + HB_GTSUPER_REFRESH( pGT ); - hb_gt_GetScrCursor( &iRow, &iCol, &iStyle ); + HB_GTSELF_GETSCRCURSOR( pGT, &iRow, &iCol, &iStyle ); if( iStyle != SC_NONE ) { if( iRow >= 0 && iCol >= 0 && iRow < s_vi.row && iCol < s_vi.col ) @@ -907,9 +929,9 @@ static void hb_gt_os2_Refresh( void ) hb_gt_os2_SetCursorStyle( iStyle ); } -static BOOL hb_gt_os2_Info( int iType, PHB_GT_INFO pInfo ) +static BOOL hb_gt_os2_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) { - HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Info(%d,%p)", iType, pInfo ) ); + HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Info(%p,%d,%p)", pGT, iType, pInfo ) ); switch ( iType ) { @@ -919,7 +941,7 @@ static BOOL hb_gt_os2_Info( int iType, PHB_GT_INFO pInfo ) break; default: - return HB_GTSUPER_INFO( iType, pInfo ); + return HB_GTSUPER_INFO( pGT, iType, pInfo ); } return TRUE; @@ -941,9 +963,7 @@ static BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable ) pFuncTable->SetBlink = hb_gt_os2_SetBlink; pFuncTable->GetBlink = hb_gt_os2_GetBlink; pFuncTable->Version = hb_gt_os2_Version; - pFuncTable->Suspend = hb_gt_os2_Suspend; pFuncTable->Resume = hb_gt_os2_Resume; - pFuncTable->PreExt = hb_gt_os2_PreExt; pFuncTable->PostExt = hb_gt_os2_PostExt; pFuncTable->Tone = hb_gt_os2_Tone; pFuncTable->Info = hb_gt_os2_Info; diff --git a/harbour/source/rtl/gtpca/gtpca.c b/harbour/source/rtl/gtpca/gtpca.c index 077e0430b0..1b192d8c89 100644 --- a/harbour/source/rtl/gtpca/gtpca.c +++ b/harbour/source/rtl/gtpca/gtpca.c @@ -125,34 +125,51 @@ static BYTE * s_sOutBuf; static volatile BOOL s_fRestTTY = FALSE; static struct termios s_saved_TIO, s_curr_TIO; +#if defined( SIGTTOU ) static void sig_handler( int iSigNo ) { - int e = errno, stat; - pid_t pid; - switch( iSigNo ) { +#ifdef SIGCHLD case SIGCHLD: - while ( ( pid = waitpid( -1, &stat, WNOHANG ) ) > 0 ) ; + { + int e = errno, stat; + pid_t pid; + do + pid = waitpid( -1, &stat, WNOHANG ); + while( pid > 0 ); + errno = e; break; + } +#endif +#ifdef SIGWINCH case SIGWINCH: /* s_WinSizeChangeFlag = TRUE; */ break; +#endif +#ifdef SIGINT case SIGINT: /* s_InetrruptFlag = TRUE; */ break; +#endif +#ifdef SIGQUIT case SIGQUIT: /* s_BreakFlag = TRUE; */ break; +#endif +#ifdef SIGTSTP case SIGTSTP: /* s_DebugFlag = TRUE; */ break; +#endif +#ifdef SIGTTOU case SIGTTOU: s_fRestTTY = FALSE; break; +#endif } - errno = e; } +#endif #endif @@ -450,10 +467,9 @@ static void hb_gt_pca_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStd s_fRestTTY = FALSE; if( s_bStdinConsole ) { +#if defined( SIGTTOU ) struct sigaction act, old; - s_fRestTTY = TRUE; - /* if( s_saved_TIO.c_lflag & TOSTOP ) != 0 */ sigaction( SIGTTOU, NULL, &old ); memcpy( &act, &old, sizeof( struct sigaction ) ); @@ -467,6 +483,9 @@ static void hb_gt_pca_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStd act.sa_flags = 0; #endif sigaction( SIGTTOU, &act, 0 ); +#endif + + s_fRestTTY = TRUE; tcgetattr( hFilenoStdin, &s_saved_TIO ); memcpy( &s_curr_TIO, &s_saved_TIO, sizeof( struct termios ) ); @@ -476,9 +495,11 @@ static void hb_gt_pca_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStd s_curr_TIO.c_cc[ VMIN ] = 0; s_curr_TIO.c_cc[ VTIME ] = 0; tcsetattr( hFilenoStdin, TCSAFLUSH, &s_curr_TIO ); - act.sa_handler = SIG_DFL; +#if defined( SIGTTOU ) + act.sa_handler = SIG_DFL; sigaction( SIGTTOU, &old, NULL ); +#endif } iRows = 24; @@ -501,7 +522,7 @@ static void hb_gt_pca_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStd s_sOutBuf = ( BYTE * ) hb_xgrab( s_iOutBufSize ); } - HB_GTSUPER_RESIZE( pGT, iRows, iCols ); + HB_GTSELF_RESIZE( pGT, iRows, iCols ); HB_GTSELF_SETFLAG( pGT, GTI_STDOUTCON, s_bStdoutConsole ); HB_GTSELF_SETFLAG( pGT, GTI_STDERRCON, s_bStderrConsole ); @@ -817,7 +838,8 @@ static BOOL hb_gt_pca_SetKeyCP( PHB_GT pGT, char *pszTermCDP, char *pszHostCDP ) { HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_SetKeyCP(%p,%s,%s)", pGT, pszTermCDP, pszHostCDP ) ); - HB_SYMBOL_UNUSED( pGT ); + HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); + #ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP ) pszHostCDP = hb_cdp_page->id; @@ -849,12 +871,9 @@ static BOOL hb_gt_pca_SetKeyCP( PHB_GT pGT, char *pszTermCDP, char *pszHostCDP ) return TRUE; } -#else - HB_SYMBOL_UNUSED( pszTermCDP ); - HB_SYMBOL_UNUSED( pszHostCDP ); #endif - return FALSE; + return TRUE; } static void hb_gt_pca_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize ) diff --git a/harbour/source/rtl/gtsln/gtsln.c b/harbour/source/rtl/gtsln/gtsln.c index 2b288ce519..38ae15415c 100644 --- a/harbour/source/rtl/gtsln/gtsln.c +++ b/harbour/source/rtl/gtsln/gtsln.c @@ -695,7 +695,7 @@ static void hb_gt_sln_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStd s_fActive = TRUE; hb_gt_sln_mouse_Init(); HB_GTSUPER_INIT( pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ); - HB_GTSUPER_RESIZE( pGT, SLtt_Screen_Rows, SLtt_Screen_Cols ); + HB_GTSELF_RESIZE( pGT, SLtt_Screen_Rows, SLtt_Screen_Cols ); HB_GTSELF_SETFLAG( pGT, GTI_COMPATBUFFER, FALSE ); HB_GTSELF_SETFLAG( pGT, GTI_STDOUTCON, s_fStdOutTTY ); HB_GTSELF_SETFLAG( pGT, GTI_STDERRCON, s_fStdErrTTY ); @@ -924,24 +924,23 @@ static BOOL hb_gt_sln_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) static BOOL hb_gt_sln_SetDispCP( PHB_GT pGT, char * pszTermCDP, char * pszHostCDP, BOOL fBox ) { +#ifndef HB_CDP_SUPPORT_OFF + PHB_CODEPAGE cdpTerm = NULL, cdpHost = NULL; + + cdpHost = hb_cdpFind( pszHostCDP ); + if ( pszHostCDP && *pszHostCDP ) + cdpHost = hb_cdpFind( pszHostCDP ); + if ( ! cdpHost ) + cdpHost = hb_cdp_page; + + if ( pszTermCDP && *pszTermCDP ) + cdpTerm = hb_cdpFind( pszTermCDP ); + + hb_sln_setCharTrans( cdpHost, cdpTerm, fBox ); +#endif + HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ); -#ifndef HB_CDP_SUPPORT_OFF - { - PHB_CODEPAGE cdpTerm = NULL, cdpHost = NULL; - - cdpHost = hb_cdpFind( pszHostCDP ); - if ( pszHostCDP && *pszHostCDP ) - cdpHost = hb_cdpFind( pszHostCDP ); - if ( ! cdpHost ) - cdpHost = hb_cdp_page; - - if ( pszTermCDP && *pszTermCDP ) - cdpTerm = hb_cdpFind( pszTermCDP ); - - hb_sln_setCharTrans( cdpHost, cdpTerm, fBox ); - } -#endif return TRUE; } @@ -962,11 +961,9 @@ static BOOL hb_gt_sln_SetKeyCP( PHB_GT pGT, char * pszTermCDP, char * pszHostCDP cdpTerm = hb_cdpFind( pszTermCDP ); hb_sln_setKeyTrans( cdpHost, cdpTerm ); -#else - HB_SYMBOL_UNUSED( pszTermCDP ); - HB_SYMBOL_UNUSED( pszHostCDP ); #endif - HB_SYMBOL_UNUSED( pGT ); + + HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); return TRUE; } diff --git a/harbour/source/rtl/gtstd/gtstd.c b/harbour/source/rtl/gtstd/gtstd.c index 0cce12aafb..4ee22e8c4e 100644 --- a/harbour/source/rtl/gtstd/gtstd.c +++ b/harbour/source/rtl/gtstd/gtstd.c @@ -233,7 +233,7 @@ static void hb_gt_std_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStd if( ioctl( hFilenoStdout, TIOCGWINSZ, ( char * ) &win ) != -1 ) { - HB_GTSUPER_RESIZE( pGT, win.ws_row, win.ws_col ); + HB_GTSELF_RESIZE( pGT, win.ws_row, win.ws_col ); } } #elif defined( HB_WIN32_IO ) && ! defined( HB_WINCE ) @@ -434,7 +434,7 @@ static void hb_gt_std_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iBottom >= iHeight - 1 && iRight >= iWidth - 1 ) { /* scroll up the internal screen buffer */ - HB_GTSUPER_SCROLLUP( pGT, iRows, bColor, bChar ); + HB_GTSELF_SCROLLUP( pGT, iRows, bColor, bChar ); /* update our internal row position */ s_iRow -= iRows; if( s_iRow < 0 ) @@ -472,7 +472,7 @@ static BOOL hb_gt_std_SetKeyCP( PHB_GT pGT, char *pszTermCDP, char *pszHostCDP ) { HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_SetKeyCP(%p,%s,%s)", pGT, pszTermCDP, pszHostCDP ) ); - HB_SYMBOL_UNUSED( pGT ); + HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); #ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP ) @@ -505,9 +505,6 @@ static BOOL hb_gt_std_SetKeyCP( PHB_GT pGT, char *pszTermCDP, char *pszHostCDP ) return TRUE; } -#else - HB_SYMBOL_UNUSED( pszTermCDP ); - HB_SYMBOL_UNUSED( pszHostCDP ); #endif return FALSE; diff --git a/harbour/source/rtl/gttrm/gttrm.c b/harbour/source/rtl/gttrm/gttrm.c index 3f23241acb..b954302931 100644 --- a/harbour/source/rtl/gttrm/gttrm.c +++ b/harbour/source/rtl/gttrm/gttrm.c @@ -2888,7 +2888,7 @@ static void hb_gt_trm_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStd #endif HB_GTSUPER_INIT( pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ); - HB_GTSUPER_RESIZE( pGT, iRows, iCols ); + HB_GTSELF_RESIZE( pGT, iRows, iCols ); HB_GTSELF_SETFLAG( pGT, GTI_COMPATBUFFER, FALSE ); HB_GTSELF_SETFLAG( pGT, GTI_STDOUTCON, pTerm->fStdoutTTY ); HB_GTSELF_SETFLAG( pGT, GTI_STDERRCON, pTerm->fStderrTTY ); @@ -3051,7 +3051,7 @@ static int hb_gt_trm_ReadKey( PHB_GT pGT, int iEventMask ) int iRows, iCols; if( hb_gt_trm_getSize( HB_GTTRM_GET( pGT ), &iRows, &iCols ) ) - HB_GTSUPER_RESIZE( pGT, iRows, iCols ); + HB_GTSELF_RESIZE( pGT, iRows, iCols ); iKey = 0; } @@ -3147,7 +3147,7 @@ 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_GTSUPER_SCROLLUP( pGT, iRows, bColor, bChar ); + HB_GTSELF_SCROLLUP( pGT, iRows, bColor, bChar ); /* update our internal row position */ do hb_gt_trm_termOut( pTerm, ( BYTE * ) "\n\r", 2 ); @@ -3169,7 +3169,7 @@ static BOOL hb_gt_trm_SetMode( PHB_GT pGT, int iRows, int iCols ) pTerm = HB_GTTRM_GET( pGT ); if( pTerm->SetMode( pTerm, &iRows, &iCols ) ) { - HB_GTSUPER_RESIZE( pGT, iRows, iCols ); + HB_GTSELF_RESIZE( pGT, iRows, iCols ); return TRUE; } return FALSE; @@ -3238,6 +3238,8 @@ static BOOL hb_gt_trm_SetKeyCP( PHB_GT pGT, char *pszTermCDP, char *pszHostCDP ) { HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetKeyCP(%p,%s,%s)", pGT, pszTermCDP, pszHostCDP ) ); + HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); + #ifndef HB_CDP_SUPPORT_OFF if( !pszHostCDP ) pszHostCDP = hb_cdp_page->id; @@ -3274,9 +3276,6 @@ static BOOL hb_gt_trm_SetKeyCP( PHB_GT pGT, char *pszTermCDP, char *pszHostCDP ) return TRUE; } -#else - HB_SYMBOL_UNUSED( pszTermCDP ); - HB_SYMBOL_UNUSED( pszHostCDP ); #endif return FALSE; diff --git a/harbour/source/rtl/gtwin/gtwin.c b/harbour/source/rtl/gtwin/gtwin.c index 9574852b48..dbce5533a4 100644 --- a/harbour/source/rtl/gtwin/gtwin.c +++ b/harbour/source/rtl/gtwin/gtwin.c @@ -579,7 +579,7 @@ static void hb_gt_win_xInitScreenParam( PHB_GT pGT ) ULONG ulSize = ( ULONG ) _GetScreenWidth() * _GetScreenHeight() * sizeof( CHAR_INFO ); - HB_GTSUPER_RESIZE( pGT, _GetScreenHeight(), _GetScreenWidth() ); + HB_GTSELF_RESIZE( pGT, _GetScreenHeight(), _GetScreenWidth() ); if( s_pCharInfoScreen == NULL || ulSize != s_ulScreenBuffSize ) { diff --git a/harbour/source/rtl/gtwvt/gtwvt.c b/harbour/source/rtl/gtwvt/gtwvt.c index cda138d860..e46c7251b0 100644 --- a/harbour/source/rtl/gtwvt/gtwvt.c +++ b/harbour/source/rtl/gtwvt/gtwvt.c @@ -224,7 +224,7 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT ) static BOOL hb_gt_wvt_SetWindowSize( PHB_GTWVT pWVT, int iRow, int iCol ) { - if( HB_GTSUPER_RESIZE( pWVT->pGT, iRow, iCol ) ) + if( HB_GTSELF_RESIZE( pWVT->pGT, iRow, iCol ) ) { pWVT->ROWS = ( USHORT ) iRow; pWVT->COLS = ( USHORT ) iCol; @@ -1298,8 +1298,8 @@ static void hb_gt_wvt_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStd /* SUPER GT initialization */ HB_GTSUPER_INIT( pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ); - HB_GTSUPER_RESIZE( pGT, pWVT->ROWS, pWVT->COLS ); - HB_GTSUPER_EXPOSEAREA( pGT, 0, 0, pWVT->ROWS, pWVT->COLS ); + HB_GTSELF_RESIZE( pGT, pWVT->ROWS, pWVT->COLS ); + HB_GTSELF_EXPOSEAREA( pGT, 0, 0, pWVT->ROWS, pWVT->COLS ); } /* ********************************************************************** */ @@ -1979,6 +1979,8 @@ static void hb_gt_wvt_Refresh( PHB_GT pGT ) HB_TRACE( HB_TR_DEBUG, ("hb_gt_wvt_Refresh(%p)", pGT) ); + HB_GTSUPER_REFRESH( pGT ); + pWVT = HB_GTWVT_GET( pGT ); if( pWVT && pWVT->hWnd ) { diff --git a/harbour/source/rtl/gtxwc/gtxwc.c b/harbour/source/rtl/gtxwc/gtxwc.c index 3d9345c25f..dcbe82dabf 100644 --- a/harbour/source/rtl/gtxwc/gtxwc.c +++ b/harbour/source/rtl/gtxwc/gtxwc.c @@ -2903,7 +2903,7 @@ static void hb_gt_xwc_SetScrBuff( PXWND_DEF wnd, USHORT cols, USHORT rows ) memset( wnd->pCurrScr, 0xFFFFFFFFL, iSize * sizeof( ULONG ) ); hb_gt_xwc_InvalidateChar( wnd, 0, 0, wnd->cols - 1, wnd->rows - 1 ); - HB_GTSUPER_RESIZE( wnd->pGT, wnd->rows, wnd->cols ); + HB_GTSELF_RESIZE( wnd->pGT, wnd->rows, wnd->cols ); } } @@ -3349,7 +3349,7 @@ static void hb_gt_xwc_Init( PHB_GT pGT, FHANDLE hFilenoStdin, FHANDLE hFilenoStd wnd->cursorBlinkRate = 350; wnd->cursorStateTime = 0; - HB_GTSUPER_RESIZE( pGT, wnd->rows, wnd->cols ); + HB_GTSELF_RESIZE( pGT, wnd->rows, wnd->cols ); HB_GTSELF_SEMICOLD( pGT ); /* For immediate connection to XSarver and screen Window show */ @@ -3394,7 +3394,7 @@ static BOOL hb_gt_xwc_SetMode( PHB_GT pGT, int iRow, int iCol ) if( iCol == wnd->cols && iRow == wnd->rows ) { fResult = TRUE; - HB_GTSUPER_RESIZE( pGT, wnd->rows, wnd->cols ); + HB_GTSELF_RESIZE( pGT, wnd->rows, wnd->cols ); } else if( !wnd->fInit ) { @@ -3406,7 +3406,7 @@ static BOOL hb_gt_xwc_SetMode( PHB_GT pGT, int iRow, int iCol ) hb_gt_xwc_Disable(); fResult = hb_gt_xwc_Resize( wnd, iCol, iRow ); if( fResult ) - HB_GTSUPER_RESIZE( pGT, wnd->rows, wnd->cols ); + HB_GTSELF_RESIZE( pGT, wnd->rows, wnd->cols ); hb_gt_xwc_Enable(); } } @@ -3594,6 +3594,9 @@ static BOOL hb_gt_xwc_SetDispCP( PHB_GT pGT, char * pszTermCDP, char * pszHostCD static BOOL hb_gt_xwc_SetKeyCP( PHB_GT pGT, char * pszTermCDP, char * pszHostCDP ) { + + HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ); + #ifndef HB_CDP_SUPPORT_OFF /* * Basic Xlib api has no function to return character key val in @@ -3618,10 +3621,6 @@ static BOOL hb_gt_xwc_SetKeyCP( PHB_GT pGT, char * pszTermCDP, char * pszHostCDP HB_GTXWC_GET( pGT )->inCDP = cdpTerm; } } -#else - HB_SYMBOL_UNUSED( pGT ); - HB_SYMBOL_UNUSED( pszTermCDP ); - HB_SYMBOL_UNUSED( pszHostCDP ); #endif return TRUE;