From 14bdf627b14b8ffd4d1aa1a3617338bc01206c38 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Tue, 25 Apr 2000 02:34:47 +0000 Subject: [PATCH] 20000425-04:37 GMT+1 Victor Szakats --- harbour/ChangeLog | 14 +++++ harbour/makefile.bc | 9 +-- harbour/makefile.vc | 4 +- harbour/source/rtl/Makefile | 2 +- harbour/source/rtl/setfunc.prg | 3 + .../source/rtl/{xsavescr.prg => xsavescr.c} | 57 +++++++++++++++---- harbour/source/vm/arrays.c | 2 +- 7 files changed, 70 insertions(+), 21 deletions(-) rename harbour/source/rtl/{xsavescr.prg => xsavescr.c} (54%) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 21e366a8de..59c98485a8 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -1,3 +1,17 @@ +20000425-04:37 GMT+1 Victor Szakats + + * source/vm/arrays.c + ! Trace line text fixed. + + * source/rtl/setfunc.prg + ! HB_EXTENSION guards added. + + - source/rtl/xsavescr.prg + + source/rtl/xsavescr.c + * source/rtl/Makefile + * makefile.bc + * makefile.vc + 20000425-03:49 GMT+1 Victor Szakats * source/rtl/gtstd.c diff --git a/harbour/makefile.bc b/harbour/makefile.bc index 854df3bf63..c0c0ef9a2a 100644 --- a/harbour/makefile.bc +++ b/harbour/makefile.bc @@ -257,6 +257,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\version.obj \ $(OBJ_DIR)\word.obj \ $(OBJ_DIR)\xhelp.obj \ + $(OBJ_DIR)\xsavescr.obj \ \ $(OBJ_DIR)\achoice.obj \ $(OBJ_DIR)\adir.obj \ @@ -291,8 +292,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\tlabel.obj \ $(OBJ_DIR)\treport.obj \ $(OBJ_DIR)\typefile.obj \ - $(OBJ_DIR)\wait.obj \ - $(OBJ_DIR)\xsavescr.obj + $(OBJ_DIR)\wait.obj # # LANG.LIB rules @@ -1532,10 +1532,7 @@ $(OBJ_DIR)\xhelp.obj : $(RTL_DIR)\xhelp.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(RTL_LIB) $(ARFLAGS) -+$@,, -$(OBJ_DIR)\xsavescr.c : $(RTL_DIR)\xsavescr.prg - $(HARBOUR_EXE) $(HARBOURFLAGS) $** -o$@ - -$(OBJ_DIR)\xsavescr.obj : $(OBJ_DIR)\xsavescr.c +$(OBJ_DIR)\xsavescr.obj : $(RTL_DIR)\xsavescr.c $(CC) $(CLIBFLAGS) -o$@ $** tlib $(RTL_LIB) $(ARFLAGS) -+$@,, diff --git a/harbour/makefile.vc b/harbour/makefile.vc index c8d7954d54..6c6a004aac 100644 --- a/harbour/makefile.vc +++ b/harbour/makefile.vc @@ -290,6 +290,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\version.obj \ $(OBJ_DIR)\word.obj \ $(OBJ_DIR)\xhelp.obj \ + $(OBJ_DIR)\xsavescr.obj \ \ $(OBJ_DIR)\achoice.obj \ $(OBJ_DIR)\adir.obj \ @@ -324,8 +325,7 @@ RTL_LIB_OBJS = \ $(OBJ_DIR)\tlabel.obj \ $(OBJ_DIR)\treport.obj \ $(OBJ_DIR)\typefile.obj \ - $(OBJ_DIR)\wait.obj \ - $(OBJ_DIR)\xsavescr.obj + $(OBJ_DIR)\wait.obj # # LANG.LIB rules diff --git a/harbour/source/rtl/Makefile b/harbour/source/rtl/Makefile index 7ef9f7ecd3..4333c97087 100644 --- a/harbour/source/rtl/Makefile +++ b/harbour/source/rtl/Makefile @@ -105,6 +105,7 @@ C_SOURCES=\ version.c \ word.c \ xhelp.c \ + xsavescr.c \ PRG_SOURCES=\ achoice.prg \ @@ -141,7 +142,6 @@ PRG_SOURCES=\ treport.prg \ typefile.prg \ wait.prg \ - xsavescr.prg \ LIBNAME=rtl diff --git a/harbour/source/rtl/setfunc.prg b/harbour/source/rtl/setfunc.prg index 683a1889f8..cf6b721ae6 100644 --- a/harbour/source/rtl/setfunc.prg +++ b/harbour/source/rtl/setfunc.prg @@ -35,6 +35,7 @@ #include "inkey.ch" #include "common.ch" +#include "hbsetup.ch" PROCEDURE __SetFunction( nFunctionKey, cString ) @@ -43,8 +44,10 @@ PROCEDURE __SetFunction( nFunctionKey, cString ) DO CASE CASE nFunctionKey == 1 ; nFunctionKey := K_F1 +#ifdef HB_EXTENSION CASE nFunctionKey == 11 ; nFunctionKey := K_F11 CASE nFunctionKey == 12 ; nFunctionKey := K_F12 +#endif OTHERWISE ; nFunctionKey := -nFunctionKey + 1 ENDCASE diff --git a/harbour/source/rtl/xsavescr.prg b/harbour/source/rtl/xsavescr.c similarity index 54% rename from harbour/source/rtl/xsavescr.prg rename to harbour/source/rtl/xsavescr.c index e69bfaae70..b0936c483e 100644 --- a/harbour/source/rtl/xsavescr.prg +++ b/harbour/source/rtl/xsavescr.c @@ -33,20 +33,55 @@ * */ -STATIC s_cScrn +/* + * The following parts are Copyright of the individual authors. + * www - http://www.harbour-project.org + * + * Copyright 2000 Victor Szakats + * Rewritten in C + * + * See doc/license.txt for licensing terms. + * + */ -PROCEDURE __XSAVESCREEN() +#include "hbapigt.h" - s_cScrn := { Row(), Col(), SaveScreen() } +/* NOTE: In original CA-Cl*pper 5.x these functions are written in Clipper + [vszakats] */ - RETURN +static SHORT s_iRow; +static SHORT s_iCol; +static void * s_pBuffer = NULL; -PROCEDURE __XRESTSCREEN() +HB_FUNC( __XSAVESCREEN ) +{ + if( s_pBuffer != NULL ) + hb_xfree( s_pBuffer ); - IF s_cScrn != NIL - RestScreen( , , , , s_cScrn[ 3 ] ) - SetPos( s_cScrn[ 1 ], s_cScrn[ 2 ] ) - s_cScrn := NIL - ENDIF + hb_gtGetPos( &s_iRow, &s_iCol ); + + { + USHORT uiSize; + hb_gtRectSize( 0, 0, hb_gtMaxRow(), hb_gtMaxCol(), &uiSize ); + s_pBuffer = hb_xgrab( uiSize ); + } + + hb_gtSave( 0, 0, hb_gtMaxRow(), hb_gtMaxCol(), s_pBuffer ); +} + +/* NOTE: There's no check about the screen size on restore, so this will + fail if the user has changed the screen resolution before calling it. + [vszakats] */ + +HB_FUNC( __XRESTSCREEN ) +{ + if( s_pBuffer != NULL ) + { + hb_gtRest( 0, 0, hb_gtMaxRow(), hb_gtMaxCol(), s_pBuffer ); + hb_xfree( s_pBuffer ); + s_pBuffer = NULL; + + hb_gtSetPos( s_iRow, s_iCol ); + } +} - RETURN diff --git a/harbour/source/vm/arrays.c b/harbour/source/vm/arrays.c index 495413082d..b24c901c88 100644 --- a/harbour/source/vm/arrays.c +++ b/harbour/source/vm/arrays.c @@ -226,7 +226,7 @@ BOOL hb_arrayIns( PHB_ITEM pArray, ULONG ulIndex ) BOOL hb_arraySet( PHB_ITEM pArray, ULONG ulIndex, PHB_ITEM pItem ) { - HB_TRACE(HB_TR_DEBUG, ("hb_arrayError(%p, %lu, %p)", pArray, ulIndex, pItem)); + HB_TRACE(HB_TR_DEBUG, ("hb_arraySet(%p, %lu, %p)", pArray, ulIndex, pItem)); if( HB_IS_ARRAY( pArray ) && ulIndex > 0 && ulIndex <= pArray->item.asArray.value->ulLen ) {