diff --git a/harbour/include/hbapigt.h b/harbour/include/hbapigt.h index 9d22d4b88f..b9113dd3fa 100644 --- a/harbour/include/hbapigt.h +++ b/harbour/include/hbapigt.h @@ -158,6 +158,7 @@ extern void hb_gt_GetText( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHOR extern void hb_gt_PutText( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE * pbySrc ); extern void hb_gt_SetAttribute( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr ); extern void hb_gt_DispBegin( void ); +extern USHORT hb_gt_DispCount( void ); extern void hb_gt_DispEnd( void ); extern BOOL hb_gt_SetMode( USHORT uiRows, USHORT uiCols ); extern BOOL hb_gt_GetBlink( void ); diff --git a/harbour/source/rtl/gt_tpl/gt_tpl.c b/harbour/source/rtl/gt_tpl/gt_tpl.c index 90c3ccd9f6..9d5d4adfd7 100644 --- a/harbour/source/rtl/gt_tpl/gt_tpl.c +++ b/harbour/source/rtl/gt_tpl/gt_tpl.c @@ -39,6 +39,8 @@ #include "hbapigt.h" +static USHORT s_uiDispCount; + void hb_gt_Init( int iFilenoStdin, int iFilenoStdout, int iFilenoStderr ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_Init()")); @@ -288,6 +290,8 @@ void hb_gt_DispBegin( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_DispBegin()")); + ++s_uiDispCount; + /* TODO: Is there a way to change screen buffers? ie: can we write somewhere without it going to the screen and then update the screen from this buffer at a later time? @@ -299,6 +303,8 @@ void hb_gt_DispEnd() { HB_TRACE(HB_TR_DEBUG, ("hb_gt_DispEnd()")); + --s_uiDispCount; + /* TODO: here we flush the buffer, and restore normal screen writes */ } @@ -360,3 +366,8 @@ char * hb_gt_Version( void ) { return "Harbour Terminal: (template)" } + +USHORT hb_gt_DispCount() +{ + return s_uiDispCount; +} diff --git a/harbour/source/rtl/gtstd/gtstd.c b/harbour/source/rtl/gtstd/gtstd.c index 269c8159b0..82b4c112ca 100644 --- a/harbour/source/rtl/gtstd/gtstd.c +++ b/harbour/source/rtl/gtstd/gtstd.c @@ -51,7 +51,7 @@ static USHORT s_uiMaxCol; static USHORT s_uiCursorStyle; static BOOL s_bBlink; static int s_iFilenoStdout; -static USHORT s_uiDispBegin; +static USHORT s_uiDispCount; void hb_gt_Init( int iFilenoStdin, int iFilenoStdout, int iFilenoStderr ) { @@ -60,7 +60,7 @@ void hb_gt_Init( int iFilenoStdin, int iFilenoStdout, int iFilenoStderr ) HB_SYMBOL_UNUSED( iFilenoStdin ); HB_SYMBOL_UNUSED( iFilenoStderr ); - s_uiDispBegin = 0; + s_uiDispCount = 0; s_iRow = 0; s_iCol = 0;