Updated DispCount handling

This commit is contained in:
Paul Tucker
2000-03-25 14:31:41 +00:00
parent 5bc284905e
commit a74c61ec5b
4 changed files with 47 additions and 2 deletions

View File

@@ -1,3 +1,17 @@
20000325-09:22 EST Paul Tucker <ptucker@sympatico.ca>
* 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 <ptucker@sympatico.ca>
* source/rtl/gtwin/gtwin.c
* correct handling of the screen buffers and fix a gpf when

View File

@@ -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;
}

View File

@@ -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;
}

View File

@@ -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;
}