From 0acecef1af86d435e087ab64caa6f3894efe80df Mon Sep 17 00:00:00 2001 From: Przemyslaw Czerpak Date: Thu, 23 Oct 2008 02:35:36 +0000 Subject: [PATCH] 2008-10-23 04:35 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/gtapi.c * LOCK/UNLOCK GT in hb_gtBeginWrite()/hb_gtEndWrite() * harbour/contrib/hbct/showtime.prg ! added missing common.ch * harbour/contrib/hbct/screen2.c % use hb_gtPutText() in _HB_CTDSPTIME() * harbour/contrib/hbct/screen1.c * forrmatting --- harbour/ChangeLog | 13 +++++++++++++ harbour/contrib/hbct/screen1.c | 2 +- harbour/contrib/hbct/screen2.c | 5 +---- harbour/contrib/hbct/showtime.prg | 2 ++ harbour/source/rtl/gtapi.c | 14 ++++++++++++-- 5 files changed, 29 insertions(+), 7 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 20615e7b5b..9b7ed49da9 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -8,6 +8,19 @@ 2008-12-31 13:59 UTC+0100 Foo Bar (foo.bar foobar.org) */ +2008-10-23 04:35 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) + * harbour/source/rtl/gtapi.c + * LOCK/UNLOCK GT in hb_gtBeginWrite()/hb_gtEndWrite() + + * harbour/contrib/hbct/showtime.prg + ! added missing common.ch + + * harbour/contrib/hbct/screen2.c + % use hb_gtPutText() in _HB_CTDSPTIME() + + * harbour/contrib/hbct/screen1.c + * forrmatting + 2008-10-23 04:01 UTC+0200 Przemyslaw Czerpak (druzus/at/priv.onet.pl) * harbour/source/rtl/gtxwc/gtxwc.h * harbour/source/rtl/gtxwc/gtxwc.c diff --git a/harbour/contrib/hbct/screen1.c b/harbour/contrib/hbct/screen1.c index ef786f3c42..793c65a05c 100644 --- a/harbour/contrib/hbct/screen1.c +++ b/harbour/contrib/hbct/screen1.c @@ -389,7 +389,7 @@ HB_FUNC( INVERTWIN ) { BYTE bColor, bAttr; USHORT usChar; - + hb_gtGetChar( iTop, iCol, &bColor, &bAttr, &usChar ); bColor = ( bColor & 0x88 ) | ( ( bColor & 0x07 ) << 4 ) | diff --git a/harbour/contrib/hbct/screen2.c b/harbour/contrib/hbct/screen2.c index 5e1371e1cd..d0a4b25153 100644 --- a/harbour/contrib/hbct/screen2.c +++ b/harbour/contrib/hbct/screen2.c @@ -442,8 +442,5 @@ HB_FUNC( _HB_CTDSPTIME ) if( szTime[0] == '0' ) szTime[0] = ' '; - hb_gtDispBegin(); - for( i = 0; i < iLen; ++sCol, ++i ) - hb_gtPutScrChar( sRow, sCol, iColor, 0, szTime[i] ); - hb_gtDispEnd(); + hb_gtPutText( sRow, sCol, ( BYTE * ) szTime, iLen, iColor ); } diff --git a/harbour/contrib/hbct/showtime.prg b/harbour/contrib/hbct/showtime.prg index 29966099b7..69a20d1386 100644 --- a/harbour/contrib/hbct/showtime.prg +++ b/harbour/contrib/hbct/showtime.prg @@ -51,6 +51,8 @@ * */ +#include "common.ch" + FUNCTION SHOWTIME( nRow, nCol, lNoSec, cColor, l12, lAmPm ) STATIC s_hTimer := NIL diff --git a/harbour/source/rtl/gtapi.c b/harbour/source/rtl/gtapi.c index fd909781ef..6448b707ad 100644 --- a/harbour/source/rtl/gtapi.c +++ b/harbour/source/rtl/gtapi.c @@ -675,11 +675,20 @@ HB_EXPORT ERRCODE hb_gtPutChar( USHORT uiRow, USHORT uiCol, BYTE bColor, BYTE bA HB_EXPORT ERRCODE hb_gtBeginWrite( void ) { + ERRCODE errCode = FAILURE; + PHB_GT pGT; + HB_TRACE(HB_TR_DEBUG, ("hb_gtBeginWrite()")); - /* Do nothing in Harbour */ + pGT = hb_gt_Base(); + if( pGT ) + { + if( HB_GTSELF_LOCK( pGT ) ) + errCode = SUCCESS; + hb_gt_BaseFree( pGT ); + } - return SUCCESS; + return errCode; } HB_EXPORT ERRCODE hb_gtEndWrite( void ) @@ -692,6 +701,7 @@ HB_EXPORT ERRCODE hb_gtEndWrite( void ) if( pGT ) { HB_GTSELF_FLUSH( pGT ); + HB_GTSELF_UNLOCK( pGT ); hb_gt_BaseFree( pGT ); return SUCCESS; }