diff --git a/harbour/source/rtl/gtsln/gtsln.c b/harbour/source/rtl/gtsln/gtsln.c index d8f57a42e1..9d848032d7 100644 --- a/harbour/source/rtl/gtsln/gtsln.c +++ b/harbour/source/rtl/gtsln/gtsln.c @@ -39,10 +39,14 @@ #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()")); + s_uiDispCount = 0; + SLtt_get_terminfo(); SLkp_init(); SLang_init_tty(34, /* Ctrl-G */ @@ -286,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? @@ -297,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 +368,8 @@ char * hb_gt_Version( void ) { return "Harbour Terminal: Slang"; } + +USHORT hb_gt_DispCount() +{ + return s_uiDispCount; +}