From a74c61ec5bb35baebba5294aab763f18457d6481 Mon Sep 17 00:00:00 2001 From: Paul Tucker Date: Sat, 25 Mar 2000 14:31:41 +0000 Subject: [PATCH] Updated DispCount handling --- harbour/ChangeLog | 14 ++++++++++++++ harbour/source/rtl/gtcrs/gtcrs.c | 11 +++++++++++ harbour/source/rtl/gtdos/gtdos.c | 11 +++++++++-- harbour/source/rtl/gtpca/gtpca.c | 13 +++++++++++++ 4 files changed, 47 insertions(+), 2 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index c8978ce43a..aee3e299fe 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,17 @@ +20000325-09:22 EST Paul Tucker + * include/hbapigt.h + source/rtl/gtcrs/gtcrs.c + source/rtl/gtdos/gtdos.c + source/rtl/gtos2/gtos2.c + source/rtl/gtpca/gtpca.c + source/rtl/gtsln/gtsln.c + source/rtl/gtstd/gtstd.c + source/rtl/gtwin/gtwin.c + source/rtl/gt_tpl/gt_tpl.c + + hb_gt_DispCount() + * source/rtl/gtapi.c + * modified DispCount Handling. + 20000325-07:50 EST Paul Tucker * source/rtl/gtwin/gtwin.c * correct handling of the screen buffers and fix a gpf when diff --git a/harbour/source/rtl/gtcrs/gtcrs.c b/harbour/source/rtl/gtcrs/gtcrs.c index 5ccbccaea2..2dda5f7d36 100644 --- a/harbour/source/rtl/gtcrs/gtcrs.c +++ b/harbour/source/rtl/gtcrs/gtcrs.c @@ -38,6 +38,8 @@ #include "hbapigt.h" #include "hbinit.h" +static USHORT s_uiDispCount; + static void gt_GetMaxRC(int* r, int* c); static void gt_GetRC(int* r, int* c); static void gt_SetRC(int r, int c); @@ -111,6 +113,8 @@ void hb_gt_Init( int iFilenoStdin, int iFilenoStdout, int iFilenoStderr ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_Init()")); + s_uiDispCount=0; + initscr(); if( has_colors() ) { @@ -363,6 +367,7 @@ 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? @@ -374,6 +379,7 @@ 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 */ } @@ -454,3 +460,8 @@ char * hb_gt_Version( void ) { return "Harbour Terminal: Curses"; } + +USHORT hb_gt_DispCount() +{ + return s_uiDispCount; +} diff --git a/harbour/source/rtl/gtdos/gtdos.c b/harbour/source/rtl/gtdos/gtdos.c index 1257a113d1..03ded19269 100644 --- a/harbour/source/rtl/gtdos/gtdos.c +++ b/harbour/source/rtl/gtdos/gtdos.c @@ -126,6 +126,7 @@ static void hb_gt_GetCursorSize( char * start, char * end ); #endif static BOOL s_bBreak; /* Used to signal Ctrl+Break to hb_inkeyPoll() */ +static USHORT s_uiDispCount; #ifndef __DJGPP__ #if defined(__WATCOMC__) @@ -168,6 +169,7 @@ void hb_gt_Init( int iFilenoStdin, int iFilenoStdout, int iFilenoStderr ) HB_SYMBOL_UNUSED( iFilenoStderr ); s_bBreak = FALSE; + s_uiDispCount = 0; #if defined(__DJGPP__) gppconio_init(); @@ -926,7 +928,7 @@ void hb_gt_DispBegin( void ) /* ptucker */ #ifndef __DJGPP__ - if( hb_gtDispCount() == 1 ) + if( ++s_uiDispCount == 1 ) { char FAR * ptr; ULONG nSize; @@ -948,7 +950,7 @@ void hb_gt_DispEnd( void ) /* ptucker */ #ifndef __DJGPP__ - if( hb_gtDispCount() == 1 ) + if( --s_uiDispCount == 0 ) { char FAR * ptr; ULONG nSize; @@ -1074,3 +1076,8 @@ char * hb_gt_Version( void ) { return "Harbour Terminal: DOS console"; } + +USHORT hb_gt_DispCount() +{ + return s_uiDispCount; +} diff --git a/harbour/source/rtl/gtpca/gtpca.c b/harbour/source/rtl/gtpca/gtpca.c index 1ca5fc61ba..205d9349a5 100644 --- a/harbour/source/rtl/gtpca/gtpca.c +++ b/harbour/source/rtl/gtpca/gtpca.c @@ -63,6 +63,8 @@ static char s_szSpaces[] = " static void hb_gt_AnsiGetCurPos( USHORT * row, USHORT * col ); +static USHORT s_uiDispCount; + void hb_gt_Init( int iFilenoStdin, int iFilenoStdout, int iFilenoStderr ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_Init()")); @@ -334,12 +336,18 @@ void hb_gt_SetAttribute( USHORT usTop, USHORT usLeft, USHORT usBottom, USHORT us void hb_gt_DispBegin( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_DispBegin()")); + + ++s_uiDispCount; + /* TODO: */ } void hb_gt_DispEnd( void ) { HB_TRACE(HB_TR_DEBUG, ("hb_gt_DispEnd()")); + + --s_uiDispCount; + /* TODO: here we flush the buffer, and restore normal screen writes */ } @@ -387,3 +395,8 @@ char * hb_gt_Version( void ) { return "Harbour Terminal: PC ANSI"; } + +USHORT hb_gt_DispCount() +{ + return s_uiDispCount; +}