2009-07-10 01:01 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)

* include/hbapigt.h
  * contrib/hbct/screen2.c
  * contrib/hbct/cursor.c
  * contrib/hbct/screen1.c
  * contrib/hbct/setrc.c
  * contrib/hbclipsm/status.c
  * contrib/hbclipsm/gauge.c
  * source/rtl/scroll.c
  * source/rtl/setposbs.c
  * source/rtl/oldbox.c
  * source/rtl/setpos.c
  * source/rtl/box.c
  * source/rtl/gtapi.c
  * source/rtl/console.c
  * source/rtl/oldclear.c
  * source/rtl/xsavescr.c
    * SHORT -> int (hb_gtGetPos(), hb_gtSetPos(), hb_gtScroll(), hb_gtBox*(), hb_gtDrawBox())
    * UCHAR -> char

  * examples/hbdoc/hbdoc.hbp
  - examples/hbdoc/hbdfrdln.c
  * examples/hbmake/hbmake.hbp
  * examples/hbmake/hbmakec.c
    - Deleted local copies of contrib functions, now using
      contrib libs instead. Now that these are in examples,
      this is okay.

  * ChangeLog
    * Marked TODO as DONE.
This commit is contained in:
Viktor Szakats
2009-07-09 23:03:23 +00:00
parent 6150fa9aa2
commit f3cb2c3bf6
21 changed files with 177 additions and 715 deletions

View File

@@ -17,6 +17,37 @@
past entries belonging to author(s): Viktor Szakats.
*/
2009-07-10 01:01 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* include/hbapigt.h
* contrib/hbct/screen2.c
* contrib/hbct/cursor.c
* contrib/hbct/screen1.c
* contrib/hbct/setrc.c
* contrib/hbclipsm/status.c
* contrib/hbclipsm/gauge.c
* source/rtl/scroll.c
* source/rtl/setposbs.c
* source/rtl/oldbox.c
* source/rtl/setpos.c
* source/rtl/box.c
* source/rtl/gtapi.c
* source/rtl/console.c
* source/rtl/oldclear.c
* source/rtl/xsavescr.c
* SHORT -> int (hb_gtGetPos(), hb_gtSetPos(), hb_gtScroll(), hb_gtBox*(), hb_gtDrawBox())
* UCHAR -> char
* examples/hbdoc/hbdoc.hbp
- examples/hbdoc/hbdfrdln.c
* examples/hbmake/hbmake.hbp
* examples/hbmake/hbmakec.c
- Deleted local copies of contrib functions, now using
contrib libs instead. Now that these are in examples,
this is okay.
* ChangeLog
* Marked TODO as DONE.
2009-07-10 00:24 UTC+0200 Viktor Szakats (harbour.01 syenar.hu)
* include/hbgtcore.h
* source/rtl/gtapi.c
@@ -383,7 +414,7 @@
* hb_gtRepChar() character parameter BYTE -> USHORT.
% Unnecessary casts deleted.
; TODO: Screen save/restore buffer kept as BYTE, but it also should be
converted to something else. void * probably.
converted to something else. void * probably. [DONE]
; QUESTION: Single chars are represented as USHORT. Shouldn't we
change it to 'char'?

View File

@@ -70,11 +70,11 @@
static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent )
{
SHORT iCenter = ( SHORT ) ( ( ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) ) / 2 ) + 1 );
SHORT iRatio = ( SHORT ) ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) - 1 );
SHORT iRow;
SHORT iCols;
SHORT iMax;
int iCenter = ( ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) ) / 2 ) + 1;
int iRatio = hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) - 1;
int iRow;
int iCols;
int iMax;
char szOldColor[ HB_CLRSTR_LEN ];
const char * szStr = " ";
char szPct[ 5 ];
@@ -83,27 +83,27 @@ static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent )
hb_gtSetColorStr( hb_arrayGetCPtr( pArray, B_BARCOLOR ) );
fPercent = ( fPercent < 0 ? 0 : ( fPercent > 1 ? 1 : fPercent ) );
iCols = ( SHORT ) ( fPercent * iRatio );
iCols = ( int ) ( fPercent * iRatio );
if( hb_arrayGetL( pArray, B_DISPLAYNUM ) )
{
hb_snprintf( szPct, sizeof( szPct ), "%3.0f%%", fPercent * 100 );
hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
hb_gtWriteAt( hb_arrayGetNI( pArray, B_TOP ),
iCenter + 2,
szPct, 4 );
}
hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ) + 1,
( SHORT ) hb_arrayGetNI( pArray, B_LEFT ) + 1,
( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ) - 1,
( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ) - 1,
hb_gtBox( hb_arrayGetNI( pArray, B_TOP ) + 1,
hb_arrayGetNI( pArray, B_LEFT ) + 1,
hb_arrayGetNI( pArray, B_BOTTOM ) - 1,
hb_arrayGetNI( pArray, B_RIGHT ) - 1,
szStr );
iMax = ( SHORT ) ( hb_arrayGetNI( pArray, B_BOTTOM ) - hb_arrayGetNI( pArray, B_TOP ) - 1 );
iMax = ( int ) ( hb_arrayGetNI( pArray, B_BOTTOM ) - hb_arrayGetNI( pArray, B_TOP ) - 1 );
for( iRow = 1; iRow <= iMax; iRow++ )
{
hb_gtRepChar( ( SHORT ) ( hb_arrayGetNI( pArray, B_TOP ) + iRow ),
( SHORT ) ( hb_arrayGetNI( pArray, B_LEFT ) + 1 ),
hb_gtRepChar( hb_arrayGetNI( pArray, B_TOP ) + iRow,
hb_arrayGetNI( pArray, B_LEFT ) + 1,
* hb_arrayGetCPtr( pArray, B_BARCHAR ),
iCols );
}
@@ -150,27 +150,27 @@ HB_FUNC( GAUGEDISPLAY )
if( pArray )
{
SHORT iCenter = ( SHORT ) ( ( ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) ) / 2 ) + 1 );
int iCenter = ( ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) ) / 2 ) + 1;
char szOldColor[ HB_CLRSTR_LEN ];
const char * szStr = " ";
hb_gtGetColorStr( szOldColor );
hb_gtSetColorStr( hb_arrayGetCPtr( pArray, B_BACKCOLOR ) );
hb_gtBox( ( SHORT) hb_arrayGetNI( pArray, B_TOP ),
( SHORT) hb_arrayGetNI( pArray, B_LEFT ),
( SHORT) hb_arrayGetNI( pArray, B_BOTTOM ),
( SHORT) hb_arrayGetNI( pArray, B_RIGHT ),
hb_gtBox( hb_arrayGetNI( pArray, B_TOP ),
hb_arrayGetNI( pArray, B_LEFT ),
hb_arrayGetNI( pArray, B_BOTTOM ),
hb_arrayGetNI( pArray, B_RIGHT ),
szStr );
hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
( SHORT ) hb_arrayGetNI( pArray, B_LEFT ),
( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ),
( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ),
hb_gtBox( hb_arrayGetNI( pArray, B_TOP ),
hb_arrayGetNI( pArray, B_LEFT ),
hb_arrayGetNI( pArray, B_BOTTOM ),
hb_arrayGetNI( pArray, B_RIGHT ),
B_BOXLINES );
if( hb_arrayGetL( pArray, B_DISPLAYNUM ) )
hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
hb_gtWriteAt( hb_arrayGetNI( pArray, B_TOP ),
iCenter,
"[ ]", 8 );

View File

@@ -67,8 +67,8 @@ HB_FUNC( STATUSNEW )
{
PHB_ITEM pReturn = hb_itemArrayNew( ST_LEN ); /* Create array */
hb_arraySetNL( pReturn, ST_ROW, hb_parni( ST_ROW ) );
hb_arraySetNL( pReturn, ST_COL, hb_parni( ST_COL ) );
hb_arraySetNI( pReturn, ST_ROW, hb_parni( ST_ROW ) );
hb_arraySetNI( pReturn, ST_COL, hb_parni( ST_COL ) );
hb_arraySetC( pReturn, ST_COLOR, HB_ISCHAR( ST_COLOR ) ? hb_parc( ST_COLOR ) : "W+/N" );
hb_arraySetNL( pReturn, ST_CURRENT, 1 );
@@ -93,8 +93,8 @@ HB_FUNC( STATUSUPDATE )
hb_gtGetColorStr( ( char * ) szOldColor );
hb_gtSetColorStr( hb_arrayGetCPtr( pArray, ST_COLOR ) );
hb_gtWriteAt( ( USHORT ) hb_arrayGetNL( pArray, ST_ROW ),
( USHORT ) hb_arrayGetNL( pArray, ST_COL ),
hb_gtWriteAt( hb_arrayGetNI( pArray, ST_ROW ),
hb_arrayGetNI( pArray, ST_COL ),
szDisplay + lCurrent - 1, 1 );
hb_gtSetColorStr( ( char * ) szOldColor );

View File

@@ -57,16 +57,16 @@
HB_FUNC( SAVECURSOR )
{
SHORT sRow, sCol;
int iRow, iCol;
USHORT usCursor;
hb_gtGetPos( &sRow, &sCol );
hb_gtGetPos( &iRow, &iCol );
hb_gtGetCursor( &usCursor );
#ifdef HB_C52_STRICT
usCursor = ( usCursor != 0 );
#endif
hb_retnl( ( long ) sCol | ( sRow << 8 ) | ( usCursor << 16 ) );
hb_retnl( ( long ) iCol | ( iRow << 8 ) | ( usCursor << 16 ) );
}
@@ -74,7 +74,7 @@ HB_FUNC( RESTCURSOR )
{
long lCursor = hb_parnl( 1 );
hb_gtSetPos( ( SHORT ) ( ( lCursor >> 8 ) & 0xff ), ( SHORT ) ( lCursor & 0xff ) );
hb_gtSetPos( ( int ) ( ( lCursor >> 8 ) & 0xff ), ( int ) ( lCursor & 0xff ) );
#ifdef HB_C52_STRICT
hb_gtSetCursor( ( USHORT ) ( ( lCursor >> 16 ) & 0x01 ) );
#else

View File

@@ -101,14 +101,14 @@
HB_FUNC( SCREENATTR )
{
SHORT sRow, sCol;
SHORT iRow, iCol;
int sRow, sCol;
int iRow, iCol;
BYTE bColor, bAttr;
USHORT usChar;
hb_gtGetPos( &sRow, &sCol );
iRow = HB_ISNUM( 1 ) ? ( SHORT ) hb_parni( 1 ) : sRow;
iCol = HB_ISNUM( 2 ) ? ( SHORT ) hb_parni( 2 ) : sCol;
iRow = HB_ISNUM( 1 ) ? hb_parni( 1 ) : sRow;
iCol = HB_ISNUM( 2 ) ? hb_parni( 2 ) : sCol;
if( hb_gtGetChar( iRow, iCol, &bColor, &bAttr, &usChar ) != HB_SUCCESS )
bColor = 0;
@@ -151,8 +151,8 @@ HB_FUNC( SCREENMIX )
const char * szText = hb_parc( 1 );
const char * szAttr;
ULONG ulAttr = hb_parclen( 2 ), ul = 0;
SHORT sRow, sCol;
SHORT iRow, iCol, i;
int sRow, sCol;
int iRow, iCol, i;
if( ulAttr == 0 )
{
@@ -163,8 +163,8 @@ HB_FUNC( SCREENMIX )
szAttr = hb_parc( 2 );
hb_gtGetPos( &sRow, &sCol );
iRow = HB_ISNUM( 3 ) ? ( SHORT ) hb_parni( 3 ) : sRow;
iCol = HB_ISNUM( 4 ) ? ( SHORT ) hb_parni( 4 ) : sCol;
iRow = HB_ISNUM( 3 ) ? hb_parni( 3 ) : sRow;
iCol = HB_ISNUM( 4 ) ? hb_parni( 4 ) : sCol;
if( iRow >= 0 && iCol >= 0 &&
iRow <= hb_gtMaxRow() && iCol <= hb_gtMaxCol() )
@@ -231,12 +231,12 @@ HB_FUNC( SAYSCREEN )
if( ulLen )
{
const char * szText = hb_parc( 1 );
SHORT sRow, sCol;
SHORT iRow, iCol, i;
int sRow, sCol;
int iRow, iCol, i;
hb_gtGetPos( &sRow, &sCol );
iRow = HB_ISNUM( 2 ) ? ( SHORT ) hb_parni( 2 ) : sRow;
iCol = HB_ISNUM( 3 ) ? ( SHORT ) hb_parni( 3 ) : sCol;
iRow = HB_ISNUM( 2 ) ? hb_parni( 2 ) : sRow;
iCol = HB_ISNUM( 3 ) ? hb_parni( 3 ) : sCol;
if( iRow >= 0 && iCol >= 0 &&
iRow <= hb_gtMaxRow() && iCol <= hb_gtMaxCol() )

View File

@@ -62,16 +62,16 @@ HB_FUNC( SAYDOWN )
if( ulLen )
{
const UCHAR * szText = ( const UCHAR * ) hb_parc( 1 );
SHORT sRow, sCol;
const char * szText = hb_parc( 1 );
int sRow, sCol;
int iRow, iCol, iMaxRow, iMaxCol;
long lDelay;
lDelay = HB_ISNUM( 2 ) ? hb_parnl( 2 ) : 4;
hb_gtGetPos( &sRow, &sCol );
iRow = HB_ISNUM( 3 ) ? hb_parni( 3 ) : ( int ) sRow;
iCol = HB_ISNUM( 4 ) ? hb_parni( 4 ) : ( int ) sCol;
iRow = HB_ISNUM( 3 ) ? hb_parni( 3 ) : sRow;
iCol = HB_ISNUM( 4 ) ? hb_parni( 4 ) : sCol;
iMaxRow = hb_gtMaxRow();
iMaxCol = hb_gtMaxCol();
@@ -106,9 +106,9 @@ HB_FUNC( SAYSPREAD )
if( ulLen )
{
const UCHAR * szText = ( const UCHAR * ) hb_parc( 1 );
const char * szText = hb_parc( 1 );
ULONG ulPos, ul;
SHORT sRow, sCol;
int sRow, sCol;
int iRow, iCol, iMaxRow, iMaxCol;
long lDelay;
@@ -117,7 +117,7 @@ HB_FUNC( SAYSPREAD )
iMaxRow = hb_gtMaxRow();
iMaxCol = hb_gtMaxCol();
hb_gtGetPos( &sRow, &sCol );
iRow = HB_ISNUM( 3 ) ? hb_parni( 3 ) : ( int ) sRow;
iRow = HB_ISNUM( 3 ) ? hb_parni( 3 ) : sRow;
iCol = HB_ISNUM( 4 ) ? hb_parni( 4 ) : ( iMaxCol >> 1 );
if( iRow >= 0 && iCol >= 0 && iRow <= iMaxRow && iCol <= iMaxCol )
@@ -160,9 +160,9 @@ HB_FUNC( SAYMOVEIN )
if( ulLen )
{
const UCHAR * szText = ( const UCHAR * ) hb_parc( 1 );
const char * szText = hb_parc( 1 );
ULONG ulChars, ul;
SHORT sRow, sCol;
int sRow, sCol;
int iRow, iCol, iMaxRow, iMaxCol;
long lDelay;
BOOL fBack;
@@ -311,19 +311,19 @@ HB_FUNC( CLEARSLOW )
HB_FUNC( SCREENSTR )
{
SHORT sRow, sCol, sMaxRow, sMaxCol, sC;
int sRow, sCol, sMaxRow, sMaxCol, sC;
char * pBuffer, * szText;
ULONG ulSize, ulCount = ULONG_MAX;
hb_gtGetPos( &sRow, &sCol );
if( HB_ISNUM( 1 ) )
sRow = ( SHORT ) hb_parni( 1 );
sRow = hb_parni( 1 );
if( HB_ISNUM( 2 ) )
sCol = ( SHORT ) hb_parni( 2 );
sCol = hb_parni( 2 );
if( HB_ISNUM( 3 ) )
ulCount = hb_parnl( 3 );
sMaxRow = ( SHORT ) hb_gtMaxRow();
sMaxCol = ( SHORT ) hb_gtMaxCol();
sMaxRow = hb_gtMaxRow();
sMaxCol = hb_gtMaxCol();
if( sRow >= 0 && sRow <= sMaxRow && sCol >= 0 && sCol <= sMaxCol && ulCount )
{
@@ -363,16 +363,16 @@ HB_FUNC( STRSCREEN )
if( ulLen )
{
const UCHAR * szText = ( const UCHAR * ) hb_parc( 1 );
SHORT sRow, sCol, sMaxRow, sMaxCol, sC;
const char * szText = hb_parc( 1 );
int sRow, sCol, sMaxRow, sMaxCol, sC;
hb_gtGetPos( &sRow, &sCol );
if( HB_ISNUM( 2 ) )
sRow = ( SHORT ) hb_parni( 2 );
sRow = hb_parni( 2 );
if( HB_ISNUM( 3 ) )
sCol = ( SHORT ) hb_parni( 3 );
sMaxRow = ( SHORT ) hb_gtMaxRow();
sMaxCol = ( SHORT ) hb_gtMaxCol();
sCol = hb_parni( 3 );
sMaxRow = hb_gtMaxRow();
sMaxCol = hb_gtMaxCol();
if( sRow >= 0 && sRow <= sMaxRow && sCol >= 0 && sCol <= sMaxCol )
{
@@ -402,12 +402,12 @@ HB_FUNC( STRSCREEN )
*/
HB_FUNC( _HB_CTDSPTIME )
{
SHORT sRow, sCol;
int sRow, sCol;
int iColor, iLen;
char szTime[ 10 ];
sRow = ( SHORT ) hb_parni( 1 );
sCol = ( SHORT ) hb_parni( 2 );
sRow = hb_parni( 1 );
sCol = hb_parni( 2 );
if( HB_ISNUM( 4 ) )
iColor = hb_parni( 4 );
else if( HB_ISCHAR( 4 ) )

View File

@@ -57,12 +57,12 @@ HB_FUNC( SETRC )
BOOL fRow = HB_ISNUM( 1 ), fCol = HB_ISNUM( 2 );
if( fRow && fCol )
hb_gtSetPos( ( SHORT ) hb_parni( 1 ), ( SHORT ) hb_parni( 2 ) );
hb_gtSetPos( hb_parni( 1 ), hb_parni( 2 ) );
else
{
SHORT sRow, sCol;
hb_gtGetPos( &sRow, &sCol );
hb_gtSetPos( fRow ? ( SHORT ) hb_parni( 1 ) : sRow, fCol ? ( SHORT ) hb_parni( 2 ) : sCol );
int iRow, iCol;
hb_gtGetPos( &iRow, &iCol );
hb_gtSetPos( fRow ? hb_parni( 1 ) : iRow, fCol ? hb_parni( 2 ) : iCol );
}
hb_retc_null();

View File

@@ -1,241 +0,0 @@
/*
* $Id$
*/
/*
* xHarbour Project source code:
* Text file reading functions
*
* Copyright 2003 Marcelo Lombardo - lombardo@uol.com.br
* http://www.xharbour.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2, or (at your option)
* any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this software; see the file COPYING. If not, write to
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
*
* As a special exception, the Harbour Project gives permission for
* additional uses of the text contained in its release of Harbour.
*
* The exception is that, if you link the Harbour libraries with other
* files to produce an executable, this does not by itself cause the
* resulting executable to be covered by the GNU General Public License.
* Your use of that executable is in no way restricted on account of
* linking the Harbour library code into it.
*
* This exception does not however invalidate any other reasons why
* the executable file might be covered by the GNU General Public License.
*
* This exception applies only to the code released by the Harbour
* Project under the name Harbour. If you copy code from other
* Harbour Project or Free Software Foundation releases into a copy of
* Harbour, as the General Public License permits, the exception does
* not apply to the code that you add in this way. To avoid misleading
* anyone as to the status of such modified files, you must delete
* this exception notice from them.
*
* If you write modifications of your own for Harbour, it is your choice
* whether to permit this exception to apply to your modifications.
* If you do not wish that, delete this exception notice.
*
*/
#include "hbapi.h"
#include "hbapifs.h"
#include "hbset.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#define READING_BLOCK 4096
char * hb_fsReadLine( HB_FHANDLE hFileHandle, LONG * plBuffLen, const char ** Term, int * iTermSizes, USHORT iTerms, BOOL * bFound, BOOL * bEOF )
{
USHORT uiPosTerm = 0, iPos, uiPosition;
USHORT nTries;
LONG lRead = 0, lOffset, lSize;
char * pBuff;
HB_TRACE(HB_TR_DEBUG, ("hb_fsReadLine(%p, %ld, %p, %p, %hu, %i, %i)", ( void * ) ( HB_PTRDIFF ) hFileHandle, *plBuffLen, Term, iTermSizes, iTerms, *bFound, *bEOF ));
*bFound = FALSE;
*bEOF = FALSE;
nTries = 0;
lOffset = 0;
lSize = *plBuffLen;
if( *plBuffLen < 10 )
*plBuffLen = READING_BLOCK;
pBuff = ( char * ) hb_xgrab( *plBuffLen );
do
{
if( nTries > 0 )
{
/* pBuff can be enlarged to hold the line as needed.. */
lSize = ( *plBuffLen * ( nTries + 1 ) ) + 1;
pBuff = ( char * ) hb_xrealloc( pBuff, lSize );
lOffset += lRead;
}
/* read from file */
lRead = hb_fsReadLarge( hFileHandle, pBuff + lOffset, lSize - lOffset );
/* scan the read buffer */
if( lRead > 0 )
{
for( iPos = 0; iPos < lRead; iPos++ )
{
for( uiPosTerm = 0; uiPosTerm < iTerms; uiPosTerm++ )
{
/* Compare with the LAST terminator byte */
if( pBuff[lOffset+iPos] == Term[uiPosTerm][iTermSizes[uiPosTerm]-1] && (iTermSizes[uiPosTerm]-1) <= (iPos+lOffset) )
{
*bFound = TRUE;
for(uiPosition=0; uiPosition < (iTermSizes[uiPosTerm]-1); uiPosition++)
{
if(Term[uiPosTerm][uiPosition] != pBuff[ lOffset+(iPos-iTermSizes[uiPosTerm])+uiPosition+1 ])
{
*bFound = FALSE;
break;
}
}
if( *bFound )
break;
}
}
if( *bFound )
break;
}
if( *bFound )
{
*plBuffLen = lOffset + iPos - iTermSizes[ uiPosTerm ] + 1;
pBuff[ *plBuffLen ] = '\0';
/* Set handle pointer in the end of the line */
hb_fsSeek( hFileHandle, (((lRead-((LONG)iPos)))*-1)+1, FS_RELATIVE );
return( pBuff );
}
}
else
{
if( ! *bFound )
{
if( nTries == 0 )
{
pBuff[ 0 ] = '\0';
*plBuffLen = 0;
}
else
{
pBuff[ lOffset + lRead ] = '\0';
*plBuffLen = lOffset + lRead;
}
*bEOF = TRUE;
}
}
nTries++;
}
while( ( ! *bFound ) && lRead > 0 );
return( pBuff );
}
/* PRG level fReadLine( <Handle>, <@buffer>, [<aTerminators | cTerminator>], [<nReadingBlock>] ) */
HB_FUNC( HB_FREADLINE )
{
PHB_ITEM pTerm1;
HB_FHANDLE hFileHandle = ( HB_FHANDLE ) hb_parnint( 1 );
const char ** Term;
char * pBuffer;
int * iTermSizes;
LONG lSize = hb_parnl( 4 );
USHORT i, iTerms;
BOOL bFound, bEOF;
if( ( !HB_ISBYREF( 2 ) ) || ( !HB_ISNUM( 1 ) ) )
{
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, 4,
hb_paramError( 1 ),
hb_paramError( 2 ),
hb_paramError( 3 ),
hb_paramError( 4 ) );
return;
}
if( HB_ISARRAY( 3 ) || HB_ISCHAR( 3 ) )
{
if( HB_ISARRAY( 3 ) )
{
pTerm1 = hb_param( 3, HB_IT_ARRAY );
iTerms = ( USHORT ) hb_arrayLen( pTerm1 );
if( iTerms <= 0 )
{
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, 4,
hb_paramError( 1 ),
hb_paramError( 2 ),
hb_paramError( 3 ),
hb_paramError( 4 ) );
return;
}
Term = ( const char ** ) hb_xgrab( sizeof( char * ) * iTerms );
iTermSizes = ( int * ) hb_xgrab( sizeof( int ) * iTerms );
for( i = 0; i < iTerms; i++ )
{
Term[ i ] = hb_arrayGetCPtr( pTerm1, i + 1 );
iTermSizes[ i ] = hb_arrayGetCLen( pTerm1, i + 1 );
}
}
else
{
pTerm1 = hb_param( 3, HB_IT_STRING );
Term = ( const char ** ) hb_xgrab( sizeof( char * ) );
iTermSizes = ( int * ) hb_xgrab( sizeof( int ) );
Term[ 0 ] = hb_itemGetCPtr( pTerm1 );
iTermSizes[ 0 ] = hb_itemGetCLen( pTerm1 );
iTerms = 1;
}
}
else
{
Term = ( const char ** ) hb_xgrab( sizeof( char * ) );
iTermSizes = ( int * ) hb_xgrab( sizeof( int ) );
Term[ 0 ] = "\r\n"; /* Should be preplaced with the default EOL sequence */
iTerms = 1;
iTermSizes[ 0 ] = 2;
}
if( lSize == 0 )
lSize = READING_BLOCK;
pBuffer = hb_fsReadLine( hFileHandle, &lSize, Term, iTermSizes, iTerms, &bFound, &bEOF );
if( ! hb_storclen_buffer( pBuffer, lSize, 2 ) )
hb_xfree( pBuffer );
hb_retnl( bEOF ? -1 : 0 );
hb_xfree( Term );
hb_xfree( iTermSizes );
}

View File

@@ -13,4 +13,5 @@ genos2.prg
genpdf1.prg
genrtf.prg
gentrf.prg
hbdfrdln.c
-lxhb

View File

@@ -7,5 +7,8 @@
hbmake.prg
hbmakec.c
-lhbclipsm
-lxhb
# Copy to Harbour binary directory for convenience
-instpath=${HB_BIN}/

View File

@@ -6,7 +6,6 @@
* Harbour Project source code:
* hbmake C support code
*
* Copyright 2000 Jose Lalin <dezac@corevia.com> [GAUGE*()]
* Copyright 2000,2001 Luiz Rafael Culik <culik@sl.conex.net> [GETUSERLANG()]
* Copyright 2003 Marcelo Lombardo - lombardo@uol.com.br [HB_FREADLINE()]
* www - http://www.harbour-project.org
@@ -55,337 +54,6 @@
#define HB_OS_WIN_USED
#include "hbapi.h"
#include "hbapi.h"
#include "hbapifs.h"
#include "hbapiitm.h"
#include "hbapierr.h"
#include "hbset.h"
/* Box array definitions */
#define B_TOP 1
#define B_LEFT 2
#define B_BOTTOM 3
#define B_RIGHT 4
#define B_BACKCOLOR 5
#define B_BARCOLOR 6
#define B_DISPLAYNUM 8
#define B_BARCHAR 7
#define B_PERCENT 9
#define B_LEN B_PERCENT
#define B_BOXLINES "ÚÄ¿³ÙÄÀ³"
static void hb_gaugeUpdate( PHB_ITEM pArray, float fPercent )
{
SHORT iCenter = ( SHORT ) ( ( ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) ) / 2 ) + 1 );
SHORT iRatio = ( SHORT ) ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) - 1 );
SHORT iRow;
SHORT iCols;
SHORT iMax;
char szOldColor[ HB_CLRSTR_LEN ];
const char * szStr = " ";
char szPct[ 5 ];
hb_gtGetColorStr( szOldColor );
hb_gtSetColorStr( hb_arrayGetCPtr( pArray, B_BARCOLOR ) );
fPercent = ( fPercent < 0 ? 0 : ( fPercent > 1 ? 1 : fPercent ) );
iCols = ( SHORT ) ( fPercent * iRatio );
if( hb_arrayGetL( pArray, B_DISPLAYNUM ) )
{
hb_snprintf( szPct, sizeof( szPct ), "%3.0f%%", fPercent * 100 );
hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
iCenter + 2,
szPct, 4 );
}
hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ) + 1,
( SHORT ) hb_arrayGetNI( pArray, B_LEFT ) + 1,
( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ) - 1,
( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ) - 1,
szStr );
iMax = ( SHORT ) ( hb_arrayGetNI( pArray, B_BOTTOM ) - hb_arrayGetNI( pArray, B_TOP ) - 1 );
for( iRow = 1; iRow <= iMax; iRow++ )
{
hb_gtRepChar( ( SHORT ) ( hb_arrayGetNI( pArray, B_TOP ) + iRow ),
( SHORT ) ( hb_arrayGetNI( pArray, B_LEFT ) + 1 ),
* hb_arrayGetCPtr( pArray, B_BARCHAR ),
iCols );
}
hb_gtSetColorStr( szOldColor );
}
/* GaugeNew( <nRowTop>, <nColumnTop>, <nRowBottom>, <nColumnBottom>,
[<cBackgroundColor>],
[<cGaugeColor>],
[<cGaugeCharacter>] ) --> aGauge
*/
HB_FUNC( GAUGENEW )
{
PHB_ITEM pReturn = hb_itemArrayNew( B_LEN ); /* Create array */
hb_arraySetNL( pReturn, B_TOP, hb_parni( B_TOP ) );
hb_arraySetNL( pReturn, B_LEFT, hb_parni( B_LEFT ) );
hb_arraySetNL( pReturn, B_BOTTOM,
HB_ISNUM( B_BOTTOM ) ?
( hb_parni( B_BOTTOM ) < hb_parni( B_TOP ) + 2 ?
hb_parni( B_TOP ) + 2 : hb_parni( B_BOTTOM ) ) : 0 );
hb_arraySetNL( pReturn, B_RIGHT,
HB_ISNUM( B_RIGHT ) ?
( hb_parni( B_RIGHT ) < hb_parni( B_LEFT ) + 4 ?
hb_parni( B_LEFT ) + 4 : hb_parni( B_RIGHT ) ) : 0 );
hb_arraySetC( pReturn, B_BACKCOLOR, HB_ISCHAR( B_BACKCOLOR ) ? hb_parc( B_BACKCOLOR ) : "W/N" );
hb_arraySetC( pReturn, B_BARCOLOR, HB_ISCHAR( B_BARCOLOR ) ? hb_parc( B_BARCOLOR ) : "W+/N" );
hb_arraySetL( pReturn, B_DISPLAYNUM,
!( HB_ISNUM( B_RIGHT ) &&
HB_ISNUM( B_LEFT ) &&
( hb_parni( B_RIGHT ) < hb_parni( B_LEFT ) + 9 ) ) );
hb_arraySetC( pReturn, B_BARCHAR, HB_ISCHAR( B_BARCHAR ) ? hb_parc( B_BARCHAR ) : "\xdb" );
hb_arraySetNL( pReturn, B_PERCENT, 0 );
hb_itemReturnRelease( pReturn );
}
/* GaugeDisplay( aGauge ) --> aGauge
*/
HB_FUNC( GAUGEDISPLAY )
{
PHB_ITEM pArray = hb_param( 1, HB_IT_ARRAY );
if( pArray )
{
SHORT iCenter = ( SHORT ) ( ( ( hb_arrayGetNI( pArray, B_RIGHT ) - hb_arrayGetNI( pArray, B_LEFT ) ) / 2 ) + 1 );
char szOldColor[ HB_CLRSTR_LEN ];
const char * szStr = " ";
hb_gtGetColorStr( szOldColor );
hb_gtSetColorStr( hb_arrayGetCPtr( pArray, B_BACKCOLOR ) );
hb_gtBox( ( SHORT) hb_arrayGetNI( pArray, B_TOP ),
( SHORT) hb_arrayGetNI( pArray, B_LEFT ),
( SHORT) hb_arrayGetNI( pArray, B_BOTTOM ),
( SHORT) hb_arrayGetNI( pArray, B_RIGHT ),
szStr );
hb_gtBox( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
( SHORT ) hb_arrayGetNI( pArray, B_LEFT ),
( SHORT ) hb_arrayGetNI( pArray, B_BOTTOM ),
( SHORT ) hb_arrayGetNI( pArray, B_RIGHT ),
B_BOXLINES );
if( hb_arrayGetL( pArray, B_DISPLAYNUM ) )
hb_gtWriteAt( ( SHORT ) hb_arrayGetNI( pArray, B_TOP ),
iCenter,
"[ ]", 8 );
hb_gtSetColorStr( szOldColor );
hb_gaugeUpdate( pArray, ( float ) hb_arrayGetND( pArray, B_PERCENT ) );
hb_itemReturn( pArray );
}
}
/* GaugeUpdate( aGauge, nPercent ) --> aGauge
*/
HB_FUNC( GAUGEUPDATE )
{
PHB_ITEM pArray = hb_param( 1, HB_IT_ARRAY );
if( pArray )
{
hb_gaugeUpdate( pArray, HB_ISNUM( 2 ) ? ( float ) hb_parnd( 2 ) : 0 );
hb_itemReturn( pArray );
}
}
#define READING_BLOCK 4096
char * hb_fsReadLine( HB_FHANDLE hFileHandle, LONG * plBuffLen, const char ** Term, int * iTermSizes, USHORT iTerms, BOOL * bFound, BOOL * bEOF )
{
USHORT uiPosTerm = 0, iPos, uiPosition;
USHORT nTries;
LONG lRead = 0, lOffset, lSize;
char * pBuff;
HB_TRACE(HB_TR_DEBUG, ("hb_fsReadLine(%p, %ld, %p, %p, %hu, %i, %i)", ( void * ) ( HB_PTRDIFF ) hFileHandle, *plBuffLen, Term, iTermSizes, iTerms, *bFound, *bEOF ));
*bFound = FALSE;
*bEOF = FALSE;
nTries = 0;
lOffset = 0;
lSize = *plBuffLen;
if( *plBuffLen < 10 )
*plBuffLen = READING_BLOCK;
pBuff = ( char * ) hb_xgrab( *plBuffLen );
do
{
if( nTries > 0 )
{
/* pBuff can be enlarged to hold the line as needed.. */
lSize = ( *plBuffLen * ( nTries + 1 ) ) + 1;
pBuff = ( char * ) hb_xrealloc( pBuff, lSize );
lOffset += lRead;
}
/* read from file */
lRead = hb_fsReadLarge( hFileHandle, pBuff + lOffset, lSize - lOffset );
/* scan the read buffer */
if( lRead > 0 )
{
for( iPos = 0; iPos < lRead; iPos++ )
{
for( uiPosTerm = 0; uiPosTerm < iTerms; uiPosTerm++ )
{
/* Compare with the LAST terminator byte */
if( pBuff[lOffset+iPos] == Term[uiPosTerm][iTermSizes[uiPosTerm]-1] && (iTermSizes[uiPosTerm]-1) <= (iPos+lOffset) )
{
*bFound = TRUE;
for(uiPosition=0; uiPosition < (iTermSizes[uiPosTerm]-1); uiPosition++)
{
if(Term[uiPosTerm][uiPosition] != pBuff[ lOffset+(iPos-iTermSizes[uiPosTerm])+uiPosition+1 ])
{
*bFound = FALSE;
break;
}
}
if( *bFound )
break;
}
}
if( *bFound )
break;
}
if( *bFound )
{
*plBuffLen = lOffset + iPos - iTermSizes[ uiPosTerm ] + 1;
pBuff[ *plBuffLen ] = '\0';
/* Set handle pointer in the end of the line */
hb_fsSeek( hFileHandle, (((lRead-((LONG)iPos)))*-1)+1, FS_RELATIVE );
return( pBuff );
}
}
else
{
if( ! *bFound )
{
if( nTries == 0 )
{
pBuff[ 0 ] = '\0';
*plBuffLen = 0;
}
else
{
pBuff[ lOffset + lRead ] = '\0';
*plBuffLen = lOffset + lRead;
}
*bEOF = TRUE;
}
}
nTries++;
}
while( ( ! *bFound ) && lRead > 0 );
return( pBuff );
}
/* PRG level fReadLine( <Handle>, <@buffer>, [<aTerminators | cTerminator>], [<nReadingBlock>] ) */
HB_FUNC( HB_FREADLINE )
{
PHB_ITEM pTerm1;
HB_FHANDLE hFileHandle = ( HB_FHANDLE ) hb_parnint( 1 );
const char ** Term;
char * pBuffer;
int * iTermSizes;
LONG lSize = hb_parnl( 4 );
USHORT i, iTerms;
BOOL bFound, bEOF;
if( ( !HB_ISBYREF( 2 ) ) || ( !HB_ISNUM( 1 ) ) )
{
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, 4,
hb_paramError( 1 ),
hb_paramError( 2 ),
hb_paramError( 3 ),
hb_paramError( 4 ) );
return;
}
if( HB_ISARRAY( 3 ) || HB_ISCHAR( 3 ) )
{
if( HB_ISARRAY( 3 ) )
{
pTerm1 = hb_param( 3, HB_IT_ARRAY );
iTerms = ( USHORT ) hb_arrayLen( pTerm1 );
if( iTerms <= 0 )
{
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, 4,
hb_paramError( 1 ),
hb_paramError( 2 ),
hb_paramError( 3 ),
hb_paramError( 4 ) );
return;
}
Term = ( const char ** ) hb_xgrab( sizeof( char * ) * iTerms );
iTermSizes = ( int * ) hb_xgrab( sizeof( int ) * iTerms );
for( i = 0; i < iTerms; i++ )
{
Term[ i ] = hb_arrayGetCPtr( pTerm1, i + 1 );
iTermSizes[ i ] = hb_arrayGetCLen( pTerm1, i + 1 );
}
}
else
{
pTerm1 = hb_param( 3, HB_IT_STRING );
Term = ( const char ** ) hb_xgrab( sizeof( char * ) );
iTermSizes = ( int * ) hb_xgrab( sizeof( int ) );
Term[ 0 ] = hb_itemGetCPtr( pTerm1 );
iTermSizes[ 0 ] = hb_itemGetCLen( pTerm1 );
iTerms = 1;
}
}
else
{
Term = ( const char ** ) hb_xgrab( sizeof( char * ) );
iTermSizes = ( int * ) hb_xgrab( sizeof( int ) );
Term[ 0 ] = "\r\n"; /* Should be preplaced with the default EOL sequence */
iTerms = 1;
iTermSizes[ 0 ] = 2;
}
if( lSize == 0 )
lSize = READING_BLOCK;
pBuffer = hb_fsReadLine( hFileHandle, &lSize, Term, iTermSizes, iTerms, &bFound, &bEOF );
if( ! hb_storclen_buffer( pBuffer, lSize, 2 ) )
hb_xfree( pBuffer );
hb_retnl( bEOF ? -1 : 0 );
hb_xfree( Term );
hb_xfree( iTermSizes );
}
HB_FUNC( GETUSERLANG )
{

View File

@@ -171,10 +171,10 @@ extern HB_EXPORT HB_ERRCODE hb_gtInit( HB_FHANDLE hFilenoStdin, HB_FHANDLE hFile
extern HB_EXPORT HB_ERRCODE hb_gtExit( void );
extern HB_EXPORT HB_ERRCODE hb_gtLock( void );
extern HB_EXPORT HB_ERRCODE hb_gtUnlock( void );
extern HB_EXPORT HB_ERRCODE hb_gtBox( SHORT uiTop, SHORT uiLeft, SHORT uiBottom, SHORT uiRight, const char * szFrame );
extern HB_EXPORT HB_ERRCODE hb_gtBoxD( SHORT uiTop, SHORT uiLeft, SHORT uiBottom, SHORT uiRight );
extern HB_EXPORT HB_ERRCODE hb_gtBoxS( SHORT uiTop, SHORT uiLeft, SHORT uiBottom, SHORT uiRight );
extern HB_EXPORT HB_ERRCODE hb_gtDrawBox( SHORT uiTop, SHORT uiLeft, SHORT uiBottom, SHORT uiRight, const char * szFrame, int iColor );
extern HB_EXPORT HB_ERRCODE hb_gtBox( int iTop, int iLeft, int iBottom, int iRight, const char * szFrame );
extern HB_EXPORT HB_ERRCODE hb_gtBoxD( int iTop, int iLeft, int iBottom, int iRight );
extern HB_EXPORT HB_ERRCODE hb_gtBoxS( int iTop, int iLeft, int iBottom, int iRight );
extern HB_EXPORT HB_ERRCODE hb_gtDrawBox( int iTop, int iLeft, int iBottom, int iRight, const char * szFrame, int iColor );
extern HB_EXPORT HB_ERRCODE hb_gtColorSelect( USHORT uiColorIndex );
extern HB_EXPORT int hb_gtColorToN( const char * szColorString );
extern HB_EXPORT HB_ERRCODE hb_gtColorsToString( int * pColors, int iColorCount, char * pszColorString, int iBufSize );
@@ -185,7 +185,7 @@ extern HB_EXPORT HB_ERRCODE hb_gtDrawShadow( USHORT uiTop, USHORT uiLeft, USHORT
extern HB_EXPORT HB_ERRCODE hb_gtGetBlink( BOOL * pbBlink );
extern HB_EXPORT HB_ERRCODE hb_gtGetColorStr( char * pszColorString );
extern HB_EXPORT HB_ERRCODE hb_gtGetCursor( USHORT * puiCursorShape );
extern HB_EXPORT HB_ERRCODE hb_gtGetPos( SHORT * piRow, SHORT * piCol );
extern HB_EXPORT HB_ERRCODE hb_gtGetPos( int * piRow, int * piCol );
extern HB_EXPORT BOOL hb_gtIsColor( void );
extern HB_EXPORT USHORT hb_gtMaxCol( void );
extern HB_EXPORT USHORT hb_gtMaxRow( void );
@@ -203,14 +203,14 @@ extern HB_EXPORT HB_ERRCODE hb_gtPutChar( USHORT uiRow, USHORT uiCol, BYTE bColo
extern HB_EXPORT HB_ERRCODE hb_gtBeginWrite( void );
extern HB_EXPORT HB_ERRCODE hb_gtEndWrite( void );
extern HB_EXPORT HB_ERRCODE hb_gtScrDim( USHORT * puiHeight, USHORT * puiWidth );
extern HB_EXPORT HB_ERRCODE hb_gtScroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, SHORT iRows, SHORT iCols );
extern HB_EXPORT HB_ERRCODE hb_gtScroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, int iRows, int iCols );
extern HB_EXPORT HB_ERRCODE hb_gtScrollUp( USHORT uiRows );
extern HB_EXPORT HB_ERRCODE hb_gtSetAttribute( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, BYTE byAttr );
extern HB_EXPORT HB_ERRCODE hb_gtSetBlink( BOOL bBlink );
extern HB_EXPORT HB_ERRCODE hb_gtSetColorStr( const char * pszColorString );
extern HB_EXPORT HB_ERRCODE hb_gtSetCursor( USHORT uiCursorShape );
extern HB_EXPORT HB_ERRCODE hb_gtSetMode( USHORT uiRows, USHORT uiCols );
extern HB_EXPORT HB_ERRCODE hb_gtSetPos( SHORT iRow, SHORT iCol );
extern HB_EXPORT HB_ERRCODE hb_gtSetPos( int iRow, int iCol );
extern HB_EXPORT HB_ERRCODE hb_gtSetSnowFlag( BOOL bNoSnow );
extern HB_EXPORT HB_ERRCODE hb_gtTone( double dFrequency, double dDuration );
extern HB_EXPORT HB_ERRCODE hb_gtWrite( const char * szStr, ULONG ulLen );

View File

@@ -94,16 +94,16 @@ HB_FUNC( DISPBOX )
}
if( hb_parni( 5 ) == 2 )
hb_gtBoxD( ( SHORT ) hb_itemGetNI( pTop ),
( SHORT ) hb_itemGetNI( pLeft),
( SHORT ) hb_itemGetNI( pBottom ),
( SHORT ) hb_itemGetNI( pRight ) );
hb_gtBoxD( hb_itemGetNI( pTop ),
hb_itemGetNI( pLeft),
hb_itemGetNI( pBottom ),
hb_itemGetNI( pRight ) );
else
hb_gtBoxS( ( SHORT ) hb_itemGetNI( pTop ),
( SHORT ) hb_itemGetNI( pLeft),
( SHORT ) hb_itemGetNI( pBottom ),
( SHORT ) hb_itemGetNI( pRight ) );
hb_gtBoxS( hb_itemGetNI( pTop ),
hb_itemGetNI( pLeft),
hb_itemGetNI( pBottom ),
hb_itemGetNI( pRight ) );
if( pszColor )
hb_gtSetColorStr( szOldColor );
@@ -131,10 +131,10 @@ HB_FUNC( HB_DISPBOX )
else
iColor = -1;
hb_gtDrawBox( ( SHORT ) hb_itemGetNI( pTop ),
( SHORT ) hb_itemGetNI( pLeft),
( SHORT ) hb_itemGetNI( pBottom ),
( SHORT ) hb_itemGetNI( pRight ),
hb_gtDrawBox( hb_itemGetNI( pTop ),
hb_itemGetNI( pLeft),
hb_itemGetNI( pBottom ),
hb_itemGetNI( pRight ),
*pszBox ? pszBox : " ",
iColor );
}

View File

@@ -403,11 +403,11 @@ HB_FUNC( PCOL ) /* Returns the current printer row position */
hb_retni( ( int ) hb_prnPos()->col );
}
static void hb_conDevPos( SHORT iRow, SHORT iCol )
static void hb_conDevPos( int iRow, int iCol )
{
HB_FHANDLE hFile;
HB_TRACE(HB_TR_DEBUG, ("hb_conDevPos(%hd, %hd)", iRow, iCol));
HB_TRACE(HB_TR_DEBUG, ("hb_conDevPos(%d, %d)", iRow, iCol));
/* Position printer if SET DEVICE TO PRINTER and valid printer file
otherwise position console */
@@ -480,7 +480,7 @@ static void hb_conDevPos( SHORT iRow, SHORT iCol )
HB_FUNC( DEVPOS ) /* Sets the screen and/or printer position */
{
if( HB_ISNUM( 1 ) && HB_ISNUM( 2 ) )
hb_conDevPos( ( SHORT ) hb_parni( 1 ), ( SHORT ) hb_parni( 2 ) );
hb_conDevPos( hb_parni( 1 ), hb_parni( 2 ) );
}
HB_FUNC( SETPRC ) /* Sets the current printer row and column positions */

View File

@@ -165,17 +165,17 @@ int hb_gtReadKey( int iEventMask )
return iKey;
}
HB_ERRCODE hb_gtBox( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right, const char * szFrame )
HB_ERRCODE hb_gtBox( int iTop, int iLeft, int iBottom, int iRight, const char * szFrame )
{
PHB_GT pGT;
HB_TRACE(HB_TR_DEBUG, ("hb_gtBox(%hd, %hd, %hd, %hd, %p)", Top, Left, Bottom, Right, szFrame));
HB_TRACE(HB_TR_DEBUG, ("hb_gtBox(%d, %d, %d, %d, %p)", iTop, iLeft, iBottom, iRight, szFrame));
pGT = hb_gt_Base();
if( pGT )
{
HB_GTSELF_BOX( pGT, Top, Left, Bottom, Right, szFrame, HB_GTSELF_GETCOLOR( pGT ) );
HB_GTSELF_SETPOS( pGT, Top + 1, Left + 1 );
HB_GTSELF_BOX( pGT, iTop, iLeft, iBottom, iRight, szFrame, HB_GTSELF_GETCOLOR( pGT ) );
HB_GTSELF_SETPOS( pGT, iTop + 1, iLeft + 1 );
HB_GTSELF_FLUSH( pGT );
hb_gt_BaseFree( pGT );
return HB_SUCCESS;
@@ -183,17 +183,17 @@ HB_ERRCODE hb_gtBox( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right, const cha
return HB_FAILURE;
}
HB_ERRCODE hb_gtBoxD( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right )
HB_ERRCODE hb_gtBoxD( int iTop, int iLeft, int iBottom, int iRight )
{
PHB_GT pGT;
HB_TRACE(HB_TR_DEBUG, ("hb_gtBoxD(%hd, %hd, %hd, %hd)", Top, Left, Bottom, Right));
HB_TRACE(HB_TR_DEBUG, ("hb_gtBoxD(%d, %d, %d, %d)", iTop, iLeft, iBottom, iRight));
pGT = hb_gt_Base();
if( pGT )
{
HB_GTSELF_BOXD( pGT, Top, Left, Bottom, Right, _B_DOUBLE, HB_GTSELF_GETCOLOR( pGT ) );
HB_GTSELF_SETPOS( pGT, Top + 1, Left + 1 );
HB_GTSELF_BOXD( pGT, iTop, iLeft, iBottom, iRight, _B_DOUBLE, HB_GTSELF_GETCOLOR( pGT ) );
HB_GTSELF_SETPOS( pGT, iTop + 1, iLeft + 1 );
HB_GTSELF_FLUSH( pGT );
hb_gt_BaseFree( pGT );
return HB_SUCCESS;
@@ -201,17 +201,17 @@ HB_ERRCODE hb_gtBoxD( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right )
return HB_FAILURE;
}
HB_ERRCODE hb_gtBoxS( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right )
HB_ERRCODE hb_gtBoxS( int iTop, int iLeft, int iBottom, int iRight )
{
PHB_GT pGT;
HB_TRACE(HB_TR_DEBUG, ("hb_gtBoxS(%hd, %hd, %hd, %hd)", Top, Left, Bottom, Right));
HB_TRACE(HB_TR_DEBUG, ("hb_gtBoxS(%d, %d, %d, %d)", iTop, iLeft, iBottom, iRight));
pGT = hb_gt_Base();
if( pGT )
{
HB_GTSELF_BOXD( pGT, Top, Left, Bottom, Right, _B_SINGLE, HB_GTSELF_GETCOLOR( pGT ) );
HB_GTSELF_SETPOS( pGT, Top + 1, Left + 1 );
HB_GTSELF_BOXD( pGT, iTop, iLeft, iBottom, iRight, _B_SINGLE, HB_GTSELF_GETCOLOR( pGT ) );
HB_GTSELF_SETPOS( pGT, iTop + 1, iLeft + 1 );
HB_GTSELF_FLUSH( pGT );
hb_gt_BaseFree( pGT );
return HB_SUCCESS;
@@ -219,11 +219,11 @@ HB_ERRCODE hb_gtBoxS( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right )
return HB_FAILURE;
}
HB_ERRCODE hb_gtDrawBox( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right, const char * szFrame, int iColor )
HB_ERRCODE hb_gtDrawBox( int iTop, int iLeft, int iBottom, int iRight, const char * szFrame, int iColor )
{
PHB_GT pGT;
HB_TRACE(HB_TR_DEBUG, ("hb_gtDrawBox(%hd, %hd, %hd, %hd, %p, %d)", Top, Left, Bottom, Right, szFrame, iColor));
HB_TRACE(HB_TR_DEBUG, ("hb_gtDrawBox(%d, %d, %d, %d, %p, %d)", iTop, iLeft, iBottom, iRight, szFrame, iColor));
pGT = hb_gt_Base();
if( pGT )
@@ -231,7 +231,7 @@ HB_ERRCODE hb_gtDrawBox( SHORT Top, SHORT Left, SHORT Bottom, SHORT Right, const
if( iColor == -1 )
iColor = HB_GTSELF_GETCOLOR( pGT );
HB_GTSELF_BOX( pGT, Top, Left, Bottom, Right, szFrame, iColor );
HB_GTSELF_BOX( pGT, iTop, iLeft, iBottom, iRight, szFrame, iColor );
HB_GTSELF_FLUSH( pGT );
hb_gt_BaseFree( pGT );
return HB_SUCCESS;
@@ -444,7 +444,7 @@ HB_ERRCODE hb_gtSetCursor( USHORT uiCursorStyle )
return HB_FAILURE;
}
HB_ERRCODE hb_gtGetPos( SHORT * piRow, SHORT * piCol )
HB_ERRCODE hb_gtGetPos( int * piRow, int * piCol )
{
PHB_GT pGT;
@@ -456,8 +456,8 @@ HB_ERRCODE hb_gtGetPos( SHORT * piRow, SHORT * piCol )
int iRow, iCol;
HB_GTSELF_GETPOS( pGT, &iRow, &iCol );
*piRow = ( SHORT ) iRow;
*piCol = ( SHORT ) iCol;
*piRow = iRow;
*piCol = iCol;
hb_gt_BaseFree( pGT );
return HB_SUCCESS;
}
@@ -468,11 +468,11 @@ HB_ERRCODE hb_gtGetPos( SHORT * piRow, SHORT * piCol )
/* NOTE: Should be exactly the same as hb_gtSetPosContext(), but without the
additional third parameter. */
HB_ERRCODE hb_gtSetPos( SHORT iRow, SHORT iCol )
HB_ERRCODE hb_gtSetPos( int iRow, int iCol )
{
PHB_GT pGT;
HB_TRACE(HB_TR_DEBUG, ("hb_gtSetPos(%hd, %hd)", iRow, iCol));
HB_TRACE(HB_TR_DEBUG, ("hb_gtSetPos(%d, %d)", iRow, iCol));
pGT = hb_gt_Base();
if( pGT )
@@ -831,9 +831,9 @@ HB_ERRCODE hb_gtWriteCon( const char * szStr, ULONG ulLength )
return HB_FAILURE;
}
HB_ERRCODE hb_gtScroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, SHORT iRows, SHORT iCols )
HB_ERRCODE hb_gtScroll( USHORT uiTop, USHORT uiLeft, USHORT uiBottom, USHORT uiRight, int iRows, int iCols )
{
HB_TRACE(HB_TR_DEBUG, ("hb_gtScroll(%hu, %hu, %hu, %hu, %hd, %hd)", uiTop, uiLeft, uiBottom, uiRight, iRows, iCols));
HB_TRACE(HB_TR_DEBUG, ("hb_gtScroll(%hu, %hu, %hu, %hu, %d, %d)", uiTop, uiLeft, uiBottom, uiRight, iRows, iCols));
if( uiTop <= uiBottom && uiLeft <= uiRight )
{

View File

@@ -65,10 +65,10 @@ HB_FUNC( __BOX )
const char * pszBox = hb_parc( 5 );
if( pTop && pLeft && pBottom && pRight && pszBox )
hb_gtBox( ( SHORT ) hb_itemGetNI( pTop ),
( SHORT ) hb_itemGetNI( pLeft),
( SHORT ) hb_itemGetNI( pBottom ),
( SHORT ) hb_itemGetNI( pRight ),
hb_gtBox( hb_itemGetNI( pTop ),
hb_itemGetNI( pLeft),
hb_itemGetNI( pBottom ),
hb_itemGetNI( pRight ),
*pszBox ? pszBox : " " );
}
@@ -80,10 +80,10 @@ HB_FUNC( __BOXD )
PHB_ITEM pRight = hb_param( 4, HB_IT_NUMERIC );
if( pTop && pLeft && pBottom && pRight )
hb_gtBoxD( ( SHORT ) hb_itemGetNI( pTop ),
( SHORT ) hb_itemGetNI( pLeft),
( SHORT ) hb_itemGetNI( pBottom ),
( SHORT ) hb_itemGetNI( pRight ) );
hb_gtBoxD( hb_itemGetNI( pTop ),
hb_itemGetNI( pLeft),
hb_itemGetNI( pBottom ),
hb_itemGetNI( pRight ) );
}
HB_FUNC( __BOXS )
@@ -94,10 +94,10 @@ HB_FUNC( __BOXS )
PHB_ITEM pRight = hb_param( 4, HB_IT_NUMERIC );
if( pTop && pLeft && pBottom && pRight )
hb_gtBoxS( ( SHORT ) hb_itemGetNI( pTop ),
( SHORT ) hb_itemGetNI( pLeft),
( SHORT ) hb_itemGetNI( pBottom ),
( SHORT ) hb_itemGetNI( pRight ) );
hb_gtBoxS( hb_itemGetNI( pTop ),
hb_itemGetNI( pLeft),
hb_itemGetNI( pBottom ),
hb_itemGetNI( pRight ) );
}
#endif

View File

@@ -58,7 +58,7 @@ HB_FUNC( __ATCLEAR )
{
if( hb_pcount() == 4 )
{
hb_gtSetPos( ( SHORT ) hb_parni( 1 ), ( SHORT ) hb_parni( 2 ) );
hb_gtSetPos( hb_parni( 1 ), hb_parni( 2 ) );
hb_gtScroll( ( USHORT ) hb_parni( 1 ),
( USHORT ) hb_parni( 2 ),
( USHORT ) hb_parni( 3 ),

View File

@@ -105,8 +105,8 @@ HB_FUNC( SCROLL )
( USHORT ) iLeft,
( USHORT ) iBottom,
( USHORT ) iRight,
( SHORT ) hb_parni( 5 ), /* Defaults to zero on bad type */
( SHORT ) hb_parni( 6 ) ); /* Defaults to zero on bad type */
hb_parni( 5 ), /* Defaults to zero on bad type */
hb_parni( 6 ) ); /* Defaults to zero on bad type */
}
HB_FUNC( HB_SCROLL )
@@ -167,7 +167,7 @@ HB_FUNC( HB_SCROLL )
if( HB_ISNUM( 8 ) )
iChar = hb_parni( 8 );
else if( HB_ISCHAR( 8 ) )
iChar = ( UCHAR ) hb_parc( 8 )[0];
iChar = ( int ) hb_parc( 8 )[0];
else
iChar = -1;

View File

@@ -67,13 +67,13 @@
HB_FUNC( SETPOS ) /* Sets the screen position */
{
if( HB_ISNUM( 1 ) && HB_ISNUM( 2 ) )
hb_gtSetPos( ( SHORT ) hb_parni( 1 ), ( SHORT ) hb_parni( 2 ) );
hb_gtSetPos( hb_parni( 1 ), hb_parni( 2 ) );
}
HB_FUNC( ROW ) /* Return the current screen row position (zero origin) */
{
SHORT iRow;
SHORT iCol;
int iRow;
int iCol;
hb_gtGetPos( &iRow, &iCol );
@@ -82,8 +82,8 @@ HB_FUNC( ROW ) /* Return the current screen row position (zero origin) */
HB_FUNC( COL ) /* Return the current screen column position (zero origin) */
{
SHORT iRow;
SHORT iCol;
int iRow;
int iCol;
hb_gtGetPos( &iRow, &iCol );

View File

@@ -60,8 +60,8 @@
HB_FUNC( SETPOSBS ) /* Move the screen position to the right by one column */
{
SHORT iRow;
SHORT iCol;
int iRow;
int iCol;
/* NOTE: CA-Cl*pper does no checks about reaching the border or anything.
[vszakats] */

View File

@@ -69,8 +69,8 @@
typedef struct
{
SHORT row;
SHORT col;
int row;
int col;
void * buffer;
} HB_SCRDATA, * PHB_SCRDATA;