2017-09-08 16:00 UTC Viktor Szakats (vszakats users.noreply.github.com)
* *
* partial sync with the 3.4 fork codebase. These are the things
synces for the most part:
- copyright headers
- grammar/typos in comments and some readmes
- comment/whitespace/decorations
- variable scoping in C files
- DO CASE/SWITCH and some other alternate syntax usage
- minimal amount of human readable text in strings
- minor code updates
- HB_TRACE() void * casts for pointers and few other changes to
avoid C compiler warnings
- various other, minor code cleanups
- only Harbour/C code/headers were touched in src, utils, contrib,
include. No 3rd party code, no make files, and with just a few
exceptions, no 'tests' code was touched.
- certain components were not touched were 3.4 diverged too much
already, like f.e. hbmk2, hbssl, hbcurl, hbexpat
- the goal was that no actual program logic should be altered by
these changes. Except some possible minor exceptions, any such
change is probably a bug in this patch.
It's a massive patch, if you find anything broken after it, please
open an Issue with the details. Build test was done on macOS.
The goal is make it easier to see what actual code/logic was changed
in 3.4 compared to 3.2 and to make patches easier to apply in both
ways.
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* ACCEPT command related functions
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour) (__AcceptStr())
|
||||
* Copyright 1999 Eddie Runia <eddie@runia.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -44,16 +45,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* __AcceptStr()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbvm.h"
|
||||
#include "hbapigt.h"
|
||||
@@ -62,7 +53,7 @@
|
||||
|
||||
HB_FUNC_EXTERN( QOUT );
|
||||
|
||||
#define ACCEPT_BUFFER_LEN 256 /* length of input buffer for ACCEPT command */
|
||||
#define ACCEPT_BUFFER_LEN 256 /* length of input buffer for ACCEPT command */
|
||||
|
||||
#ifdef HB_CLP_UNDOC
|
||||
|
||||
|
||||
@@ -98,10 +98,10 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo
|
||||
nPos := 0
|
||||
ENDIF
|
||||
|
||||
// Ensure hilighted item can be selected
|
||||
// Ensure highlighted item can be selected
|
||||
nPos := BETWEEN( nFrstItem, nPos, nLastItem )
|
||||
|
||||
// Force hilighted row to be valid
|
||||
// Force highlighted row to be valid
|
||||
nHiLiteRow := BETWEEN( 0, nHiLiteRow, nNumRows - 1 )
|
||||
|
||||
// Force the topmost item to be a valid index of the array
|
||||
@@ -516,7 +516,7 @@ FUNCTION AChoice( nTop, nLeft, nBottom, nRight, acItems, xSelect, xUserFunc, nPo
|
||||
IF nPos > 0 .AND. nMode != AC_EXCEPT
|
||||
|
||||
#if 0
|
||||
/* TOVERIFY: Disabled nRowsClr DispPage().
|
||||
/* TODO: Disabled nRowsClr in DispPage() call:
|
||||
Please verify it, I do not know why it was added but
|
||||
it breaks code which adds dynamically new acItems positions */
|
||||
nRowsClr := Min( nNumRows, nItems )
|
||||
@@ -646,11 +646,12 @@ STATIC FUNCTION Ach_Select( alSelect, nPos )
|
||||
|
||||
IF nPos >= 1 .AND. nPos <= Len( alSelect )
|
||||
sel := alSelect[ nPos ]
|
||||
IF HB_ISEVALITEM( sel )
|
||||
DO CASE
|
||||
CASE HB_ISEVALITEM( sel )
|
||||
sel := Eval( sel )
|
||||
ELSEIF HB_ISSTRING( sel ) .AND. ! Empty( sel )
|
||||
CASE HB_ISSTRING( sel ) .AND. ! Empty( sel )
|
||||
sel := Eval( hb_macroBlock( sel ) )
|
||||
ENDIF
|
||||
ENDCASE
|
||||
IF HB_ISLOGICAL( sel )
|
||||
RETURN sel
|
||||
ENDIF
|
||||
|
||||
@@ -2,17 +2,8 @@
|
||||
* Alert(), hb_Alert() functions
|
||||
*
|
||||
* Released to Public Domain by Vladimir Kazimirchik <v_kazimirchik@yahoo.com>
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* Changes for higher Clipper compatibility, console mode, extensions
|
||||
* __NoNoAlert()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
* Further modifications 1999-2017 Viktor Szakats (vszakats.net/harbour)
|
||||
* Changes for higher Clipper compatibility, console mode, extensions, __NoNoAlert()
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -22,7 +13,7 @@
|
||||
#include "setcurs.ch"
|
||||
#include "hbgtinfo.ch"
|
||||
|
||||
/* TOFIX: Clipper defines a clipped window for Alert() [vszakats] */
|
||||
/* FIXME: Clipper defines a clipped window for Alert() [vszakats] */
|
||||
|
||||
/* NOTE: Clipper will return NIL if the first parameter is not a string, but
|
||||
this is not documented. [vszakats] */
|
||||
@@ -77,13 +68,14 @@ FUNCTION Alert( cMessage, aOptions, cColorNorm )
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
IF Len( aOptionsOK ) == 0
|
||||
DO CASE
|
||||
CASE Len( aOptionsOK ) == 0
|
||||
aOptionsOK := { "Ok" }
|
||||
#ifdef HB_CLP_STRICT
|
||||
ELSEIF Len( aOptionsOK ) > 4 /* NOTE: Clipper allows only four options [vszakats] */
|
||||
CASE Len( aOptionsOK ) > 4 /* NOTE: Clipper allows only four options [vszakats] */
|
||||
ASize( aOptionsOK, 4 )
|
||||
#endif
|
||||
ENDIF
|
||||
ENDCASE
|
||||
|
||||
RETURN hb_gtAlert( cMessage, aOptionsOK, cColorNorm, cColorHigh )
|
||||
|
||||
@@ -114,16 +106,17 @@ FUNCTION hb_Alert( xMessage, aOptions, cColorNorm, nDelay )
|
||||
RETURN NIL
|
||||
ENDIF
|
||||
|
||||
IF HB_ISARRAY( xMessage )
|
||||
DO CASE
|
||||
CASE HB_ISARRAY( xMessage )
|
||||
cMessage := ""
|
||||
FOR EACH cString IN xMessage
|
||||
cMessage += iif( cString:__enumIsFirst(), "", Chr( 10 ) ) + hb_CStr( cString )
|
||||
NEXT
|
||||
ELSEIF HB_ISSTRING( xMessage )
|
||||
CASE HB_ISSTRING( xMessage )
|
||||
cMessage := StrTran( xMessage, ";", Chr( 10 ) )
|
||||
ELSE
|
||||
OTHERWISE
|
||||
cMessage := hb_CStr( xMessage )
|
||||
ENDIF
|
||||
ENDCASE
|
||||
|
||||
IF ! HB_ISSTRING( cColorNorm ) .OR. Empty( cColorNorm )
|
||||
cColorNorm := "W+/R" // first pair color (Box line and Text)
|
||||
@@ -143,13 +136,14 @@ FUNCTION hb_Alert( xMessage, aOptions, cColorNorm, nDelay )
|
||||
ENDIF
|
||||
NEXT
|
||||
|
||||
IF Len( aOptionsOK ) == 0
|
||||
DO CASE
|
||||
CASE Len( aOptionsOK ) == 0
|
||||
aOptionsOK := { "Ok" }
|
||||
#ifdef HB_CLP_STRICT
|
||||
ELSEIF Len( aOptionsOK ) > 4 /* NOTE: Clipper allows only four options [vszakats] */
|
||||
CASE Len( aOptionsOK ) > 4 /* NOTE: Clipper allows only four options [vszakats] */
|
||||
ASize( aOptionsOK, 4 )
|
||||
#endif
|
||||
ENDIF
|
||||
ENDCASE
|
||||
|
||||
RETURN hb_gtAlert( cMessage, aOptionsOK, cColorNorm, cColorHigh, nDelay )
|
||||
|
||||
|
||||
@@ -5,11 +5,6 @@
|
||||
*
|
||||
* 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 of the License, or
|
||||
* (at your option) any later version, with one exception:
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
@@ -49,14 +44,14 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#define ALTD_DISABLE 0
|
||||
#define ALTD_ENABLE 1
|
||||
#define ALTD_DISABLE 0
|
||||
#define ALTD_ENABLE 1
|
||||
|
||||
PROCEDURE AltD( nAction )
|
||||
|
||||
IF PCount() == 0
|
||||
|
||||
/* do not activate the debugger imediatelly because the module
|
||||
/* do not activate the debugger immediately because the module
|
||||
where AltD() was called can have no debugger info - stop
|
||||
on first LINE with debugged info */
|
||||
__dbgInvokeDebug( Set( _SET_DEBUG ) )
|
||||
|
||||
@@ -61,11 +61,9 @@
|
||||
#if defined( HB_OS_WIN )
|
||||
# if ! defined( __TINYC__ )
|
||||
# include <wincrypt.h>
|
||||
# include <process.h>
|
||||
# endif
|
||||
#elif defined( HB_OS_DOS ) || defined( HB_OS_OS2 )
|
||||
# include <sys/types.h>
|
||||
# include <process.h>
|
||||
#else
|
||||
# if ! defined( __WATCOMC__ )
|
||||
# include <sys/param.h>
|
||||
@@ -110,8 +108,8 @@ static struct arc4_stream rs;
|
||||
static HB_I32 arc4_count;
|
||||
|
||||
static HB_CRITICAL_NEW( arc4_lock );
|
||||
#define _ARC4_LOCK() hb_threadEnterCriticalSection( &arc4_lock )
|
||||
#define _ARC4_UNLOCK() hb_threadLeaveCriticalSection( &arc4_lock )
|
||||
#define ARC4_LOCK() hb_threadEnterCriticalSection( &arc4_lock )
|
||||
#define ARC4_UNLOCK() hb_threadLeaveCriticalSection( &arc4_lock )
|
||||
|
||||
#if defined( __BORLANDC__ ) && defined( _HB_INLINE_ )
|
||||
#undef _HB_INLINE_
|
||||
@@ -132,12 +130,12 @@ static _HB_INLINE_ void arc4_init( void )
|
||||
|
||||
static _HB_INLINE_ void arc4_addrandom( const HB_U8 * dat, int datlen )
|
||||
{
|
||||
int n;
|
||||
HB_U8 si;
|
||||
int n;
|
||||
|
||||
rs.i--;
|
||||
for( n = 0; n < 256; ++n )
|
||||
{
|
||||
HB_U8 si;
|
||||
rs.i = ( rs.i + 1 );
|
||||
si = rs.s[ rs.i ];
|
||||
rs.j = rs.j + si + dat[ n % datlen ];
|
||||
@@ -151,11 +149,10 @@ static _HB_INLINE_ void arc4_addrandom( const HB_U8 * dat, int datlen )
|
||||
static HB_ISIZ read_all( int fd, HB_U8 * buf, size_t count )
|
||||
{
|
||||
HB_SIZE numread = 0;
|
||||
HB_ISIZ result;
|
||||
|
||||
while( numread < count )
|
||||
{
|
||||
result = read( fd, buf + numread, count - numread );
|
||||
HB_ISIZ result = read( fd, buf + numread, count - numread );
|
||||
|
||||
if( result < 0 )
|
||||
return -1;
|
||||
@@ -175,18 +172,18 @@ static HB_ISIZ read_all( int fd, HB_U8 * buf, size_t count )
|
||||
static int arc4_seed_win( void )
|
||||
{
|
||||
/* This is adapted from Tor's crypto_seed_rng() */
|
||||
static int provider_set = 0;
|
||||
static HCRYPTPROV provider;
|
||||
static int s_provider_set = 0;
|
||||
static HCRYPTPROV s_provider;
|
||||
unsigned char buf[ ADD_ENTROPY ];
|
||||
|
||||
if( ! provider_set &&
|
||||
! CryptAcquireContext( &provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT ) &&
|
||||
if( ! s_provider_set &&
|
||||
! CryptAcquireContext( &s_provider, NULL, NULL, PROV_RSA_FULL, CRYPT_VERIFYCONTEXT | CRYPT_SILENT ) &&
|
||||
GetLastError() != ( DWORD ) NTE_BAD_KEYSET )
|
||||
return -1;
|
||||
|
||||
provider_set = 1;
|
||||
s_provider_set = 1;
|
||||
|
||||
if( ! CryptGenRandom( provider, sizeof( buf ), buf ) )
|
||||
if( ! CryptGenRandom( s_provider, sizeof( buf ), buf ) )
|
||||
return -1;
|
||||
|
||||
arc4_addrandom( buf, sizeof( buf ) );
|
||||
@@ -324,14 +321,15 @@ static int arc4_seed_proc_sys_kernel_random_uuid( void )
|
||||
* but not /dev/urandom. Let's try /proc/sys/kernel/random/uuid.
|
||||
* Its format is stupid, so we need to decode it from hex.
|
||||
*/
|
||||
int fd;
|
||||
char buf[ 128 ];
|
||||
HB_U8 entropy[ 64 ];
|
||||
int bytes, n, i, nybbles;
|
||||
int bytes, i, nybbles;
|
||||
|
||||
for( bytes = 0; bytes < ADD_ENTROPY; )
|
||||
{
|
||||
fd = open( "/proc/sys/kernel/random/uuid", O_RDONLY, 0 );
|
||||
int fd = open( "/proc/sys/kernel/random/uuid", O_RDONLY, 0 );
|
||||
int n;
|
||||
|
||||
if( fd < 0 )
|
||||
return -1;
|
||||
|
||||
@@ -382,13 +380,16 @@ static int arc4_seed_urandom( void )
|
||||
"/dev/random",
|
||||
NULL
|
||||
};
|
||||
HB_U8 buf[ ADD_ENTROPY ];
|
||||
int fd, i;
|
||||
HB_SIZE n;
|
||||
|
||||
int i;
|
||||
|
||||
for( i = 0; filenames[ i ]; ++i )
|
||||
{
|
||||
fd = open( filenames[ i ], O_RDONLY, 0 );
|
||||
HB_U8 buf[ ADD_ENTROPY ];
|
||||
HB_SIZE n;
|
||||
|
||||
int fd = open( filenames[ i ], O_RDONLY, 0 );
|
||||
|
||||
if( fd < 0 )
|
||||
continue;
|
||||
|
||||
@@ -491,7 +492,7 @@ static void arc4_stir( void )
|
||||
* Discard early keystream, as per recommendations in
|
||||
* "Weaknesses in the Key Scheduling Algorithm of RC4" by
|
||||
* Scott Fluhrer, Itsik Mantin, and Adi Shamir.
|
||||
* http://www.wisdom.weizmann.ac.il/~itsik/RC4/Papers/Rc4_ksa.ps
|
||||
* https://web.archive.org/web/www.wisdom.weizmann.ac.il/~itsik/RC4/Papers/Rc4_ksa.ps
|
||||
*
|
||||
* Ilya Mironov's "(Not So) Random Shuffles of RC4" suggests that
|
||||
* we drop at least 2*256 bytes, with 12*256 as a conservative
|
||||
@@ -560,16 +561,16 @@ static _HB_INLINE_ HB_U32 arc4_getword( void )
|
||||
*/
|
||||
void arc4random_stir( void )
|
||||
{
|
||||
_ARC4_LOCK();
|
||||
ARC4_LOCK();
|
||||
arc4_stir();
|
||||
_ARC4_UNLOCK();
|
||||
ARC4_UNLOCK();
|
||||
}
|
||||
|
||||
void arc4random_addrandom( const unsigned char * dat, int datlen )
|
||||
{
|
||||
int j;
|
||||
|
||||
_ARC4_LOCK();
|
||||
ARC4_LOCK();
|
||||
if( ! rs_initialized )
|
||||
arc4_stir();
|
||||
|
||||
@@ -583,7 +584,7 @@ void arc4random_addrandom( const unsigned char * dat, int datlen )
|
||||
*/
|
||||
arc4_addrandom( dat + j, datlen - j );
|
||||
}
|
||||
_ARC4_UNLOCK();
|
||||
ARC4_UNLOCK();
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -591,13 +592,13 @@ HB_U32 hb_arc4random( void )
|
||||
{
|
||||
HB_U32 val;
|
||||
|
||||
_ARC4_LOCK();
|
||||
ARC4_LOCK();
|
||||
|
||||
arc4_count -= 4;
|
||||
arc4_stir_if_needed();
|
||||
val = arc4_getword();
|
||||
|
||||
_ARC4_UNLOCK();
|
||||
ARC4_UNLOCK();
|
||||
|
||||
return val;
|
||||
}
|
||||
@@ -606,7 +607,7 @@ void hb_arc4random_buf( void * _buf, HB_SIZE n )
|
||||
{
|
||||
HB_U8 * buf = ( HB_U8 * ) _buf;
|
||||
|
||||
_ARC4_LOCK();
|
||||
ARC4_LOCK();
|
||||
|
||||
arc4_stir_if_needed();
|
||||
|
||||
@@ -618,7 +619,7 @@ void hb_arc4random_buf( void * _buf, HB_SIZE n )
|
||||
buf[ n ] = arc4_getbyte();
|
||||
}
|
||||
|
||||
_ARC4_UNLOCK();
|
||||
ARC4_UNLOCK();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -63,7 +63,7 @@ HB_FUNC( HB_AT )
|
||||
const char * pszText = hb_itemGetCPtr( pText );
|
||||
HB_SIZE nTextLength = hb_itemGetCLen( pText );
|
||||
HB_SIZE nStart = hb_parns( 3 );
|
||||
HB_SIZE nFrom, nTo, nPos = 0;
|
||||
HB_SIZE nFrom, nPos = 0;
|
||||
|
||||
if( nStart <= 1 )
|
||||
nStart = nFrom = 0;
|
||||
@@ -74,6 +74,8 @@ HB_FUNC( HB_AT )
|
||||
|
||||
if( nFrom < nTextLength )
|
||||
{
|
||||
HB_SIZE nTo;
|
||||
|
||||
pszText += nFrom;
|
||||
nTextLength -= nFrom;
|
||||
if( HB_ISNUM( 4 ) )
|
||||
|
||||
@@ -53,7 +53,7 @@
|
||||
|
||||
static HB_SIZE s_strAtI( PHB_CODEPAGE cdp, const char * szSub, HB_SIZE nSubLen, const char * szText, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "s_strAtI(%p, %s, %" HB_PFS "u, %s, %" HB_PFS "u)", cdp, szSub, nSubLen, szText, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "s_strAtI(%p, %s, %" HB_PFS "u, %s, %" HB_PFS "u)", ( void * ) cdp, szSub, nSubLen, szText, nLen ) );
|
||||
|
||||
if( nSubLen > 0 && nLen >= nSubLen )
|
||||
{
|
||||
@@ -91,7 +91,7 @@ HB_FUNC( HB_ATI )
|
||||
const char * pszText = hb_itemGetCPtr( pText );
|
||||
HB_SIZE nTextLength = hb_itemGetCLen( pText );
|
||||
HB_SIZE nStart = hb_parns( 3 );
|
||||
HB_SIZE nFrom, nTo, nPos = 0;
|
||||
HB_SIZE nFrom, nPos = 0;
|
||||
|
||||
if( nStart <= 1 )
|
||||
nStart = nFrom = 0;
|
||||
@@ -102,6 +102,8 @@ HB_FUNC( HB_ATI )
|
||||
|
||||
if( nFrom < nTextLength )
|
||||
{
|
||||
HB_SIZE nTo;
|
||||
|
||||
pszText += nFrom;
|
||||
nTextLength -= nFrom;
|
||||
if( HB_ISNUM( 4 ) )
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
* Copyright 2011 Viktor Szakats (vszakats.net/harbour)
|
||||
* [ base64_decode_* functions are part of the libb64 project, and has
|
||||
* been placed in the public domain. Author: Chris Venter
|
||||
* For details, see http://sourceforge.net/projects/libb64 ]
|
||||
* For details, see https://libb64.sourceforge.io/ ]
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -61,26 +61,27 @@ FUNCTION __dbSkipper( nRecs )
|
||||
LOCAL nSkipped := 0
|
||||
|
||||
IF LastRec() != 0
|
||||
IF nRecs == 0
|
||||
DO CASE
|
||||
CASE nRecs == 0
|
||||
dbSkip( 0 )
|
||||
ELSEIF nRecs > 0 .AND. RecNo() != LastRec() + 1
|
||||
CASE nRecs > 0 .AND. RecNo() != LastRec() + 1
|
||||
DO WHILE nSkipped < nRecs
|
||||
dbSkip( 1 )
|
||||
dbSkip()
|
||||
IF Eof()
|
||||
dbSkip( -1 )
|
||||
EXIT
|
||||
ENDIF
|
||||
nSkipped++
|
||||
++nSkipped
|
||||
ENDDO
|
||||
ELSEIF nRecs < 0
|
||||
CASE nRecs < 0
|
||||
DO WHILE nSkipped > nRecs
|
||||
dbSkip( -1 )
|
||||
IF Bof()
|
||||
EXIT
|
||||
ENDIF
|
||||
nSkipped--
|
||||
--nSkipped
|
||||
ENDDO
|
||||
ENDIF
|
||||
ENDCASE
|
||||
ENDIF
|
||||
|
||||
RETURN nSkipped
|
||||
|
||||
@@ -405,9 +405,10 @@ STATIC FUNCTION Skipped( nRecs, lAppend )
|
||||
LOCAL nSkipped := 0
|
||||
|
||||
IF LastRec() != 0
|
||||
IF nRecs == 0
|
||||
DO CASE
|
||||
CASE nRecs == 0
|
||||
dbSkip( 0 )
|
||||
ELSEIF nRecs > 0 .AND. RecNo() != LastRec() + 1
|
||||
CASE nRecs > 0 .AND. RecNo() != LastRec() + 1
|
||||
DO WHILE nSkipped < nRecs
|
||||
dbSkip()
|
||||
IF Eof()
|
||||
@@ -420,7 +421,7 @@ STATIC FUNCTION Skipped( nRecs, lAppend )
|
||||
ENDIF
|
||||
++nSkipped
|
||||
ENDDO
|
||||
ELSEIF nRecs < 0
|
||||
CASE nRecs < 0
|
||||
DO WHILE nSkipped > nRecs
|
||||
dbSkip( -1 )
|
||||
IF Bof()
|
||||
@@ -428,7 +429,7 @@ STATIC FUNCTION Skipped( nRecs, lAppend )
|
||||
ENDIF
|
||||
--nSkipped
|
||||
ENDDO
|
||||
ENDIF
|
||||
ENDCASE
|
||||
ENDIF
|
||||
|
||||
RETURN nSkipped
|
||||
|
||||
@@ -236,7 +236,6 @@ HB_FUNC( HB_UTF8ASC )
|
||||
HB_FUNC( HB_STRTOUTF8 )
|
||||
{
|
||||
HB_SIZE nLen = hb_parclen( 1 ), nDest = 0;
|
||||
const char * szString;
|
||||
char * szDest = NULL;
|
||||
|
||||
if( nLen )
|
||||
@@ -253,7 +252,7 @@ HB_FUNC( HB_STRTOUTF8 )
|
||||
}
|
||||
else
|
||||
{
|
||||
szString = hb_parc( 1 );
|
||||
const char * szString = hb_parc( 1 );
|
||||
nDest = hb_cdpStrAsUTF8Len( cdp, szString, nLen, 0 );
|
||||
szDest = ( char * ) hb_xgrab( nDest + 1 );
|
||||
hb_cdpStrToUTF8( cdp, szString, nLen, szDest, nDest + 1 );
|
||||
|
||||
@@ -170,7 +170,7 @@ STATIC FUNCTION __UnixParseLangCP( cString, /* @ */ cLang )
|
||||
cCP := Stuff( cCP, Len( "iso8859" ) + 1, 0, "-" )
|
||||
ENDIF
|
||||
|
||||
/* Convert UNIX CP name to Harbour CP ID */
|
||||
/* Convert Unix CP name to Harbour CP ID */
|
||||
SWITCH cCP
|
||||
CASE "utf8"
|
||||
CASE "cp437"
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
/*
|
||||
* CP detection (low-level)
|
||||
*
|
||||
* Copyright 2009-2012 Viktor Szakats (vszakats.net/harbour)
|
||||
* Copyright 2009-2014 Viktor Szakats (vszakats.net/harbour)
|
||||
*
|
||||
* 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
|
||||
|
||||
@@ -343,7 +343,7 @@ METHOD New( nRow, nCol, cCaption ) CLASS CheckBox
|
||||
|
||||
RETURN Self
|
||||
|
||||
FUNCTION _CHECKBOX_( lState, cCaption, cMessage, cColorSpec, bFBlock, bSBlock, cStyle, aBitmaps )
|
||||
FUNCTION _CheckBox_( lState, cCaption, cMessage, cColorSpec, bFBlock, bSBlock, cStyle, aBitmaps )
|
||||
|
||||
LOCAL o := HBCheckBox():New( Row(), Col(), cCaption )
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ HB_FUNC( CHR )
|
||||
can be divided by 256 but it's not zero, in this case it
|
||||
will return an empty string instead of a Chr( 0 ). [vszakats] */
|
||||
|
||||
/* Believe it or not, clipper does this! */
|
||||
/* Believe it or not, Cl*pper does this! */
|
||||
#ifdef HB_CLP_STRICT
|
||||
char szChar[ 2 ];
|
||||
szChar[ 0 ] = hb_parnl( 1 ) % 256;
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
#include "hbapiitm.h"
|
||||
#include "hbapierr.h"
|
||||
|
||||
/* hb_UChar( <nCode> ) -> <cText>
|
||||
/* hb_UChar( <nCode> ) --> <cText>
|
||||
* return string with U+nCode character in HVM CP encoding
|
||||
*/
|
||||
HB_FUNC( HB_UCHAR )
|
||||
@@ -69,7 +69,7 @@ HB_FUNC( HB_UCHAR )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1111, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_BChar( <nCode> ) -> <cText>
|
||||
/* hb_BChar( <nCode> ) --> <cText>
|
||||
* return 1 byte string with <nCode> value
|
||||
*/
|
||||
HB_FUNC( HB_BCHAR )
|
||||
@@ -84,8 +84,8 @@ HB_FUNC( HB_BCHAR )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1111, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_UCode( <cText> ) -> <nCode>
|
||||
* return unicode value of 1-st character (not byte) in given string
|
||||
/* hb_UCode( <cText> ) --> <nCode>
|
||||
* return unicode value of 1st character (not byte) in given string
|
||||
*/
|
||||
HB_FUNC( HB_UCODE )
|
||||
{
|
||||
@@ -98,8 +98,8 @@ HB_FUNC( HB_UCODE )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1111, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_BCode( <cText> ) -> <nCode>
|
||||
* return value of 1-st byte in given string
|
||||
/* hb_BCode( <cText> ) --> <nCode>
|
||||
* return value of 1st byte in given string
|
||||
*/
|
||||
HB_FUNC( HB_BCODE )
|
||||
{
|
||||
@@ -111,7 +111,7 @@ HB_FUNC( HB_BCODE )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1111, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_ULen( <cText> ) -> <nChars>
|
||||
/* hb_ULen( <cText> ) --> <nChars>
|
||||
* return string length in characters
|
||||
*/
|
||||
HB_FUNC( HB_ULEN )
|
||||
@@ -125,7 +125,7 @@ HB_FUNC( HB_ULEN )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1111, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_BLen( <cText> ) -> <nBytes>
|
||||
/* hb_BLen( <cText> ) --> <nBytes>
|
||||
* return string length in bytes
|
||||
*/
|
||||
HB_FUNC( HB_BLEN )
|
||||
@@ -138,8 +138,8 @@ HB_FUNC( HB_BLEN )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1111, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_UPeek( <cText>, <n> ) -> <nCode>
|
||||
* return unicode value of <n>-th character in given string
|
||||
/* hb_UPeek( <cText>, <n> ) --> <nCode>
|
||||
* return unicode value of <n>th character in given string
|
||||
*/
|
||||
HB_FUNC( HB_UPEEK )
|
||||
{
|
||||
@@ -167,8 +167,8 @@ HB_FUNC( HB_UPEEK )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1111, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_BPeek( <cText>, <n> ) -> <nCode>
|
||||
* return value of <n>-th byte in given string
|
||||
/* hb_BPeek( <cText>, <n> ) --> <nCode>
|
||||
* return value of <n>th byte in given string
|
||||
*/
|
||||
HB_FUNC( HB_BPEEK )
|
||||
{
|
||||
@@ -185,8 +185,8 @@ HB_FUNC( HB_BPEEK )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1111, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_UPoke( [@]<cText>, <n>, <nVal> ) -> <cText>
|
||||
* change <n>-th character in given string to unicode <nVal> one and return modified text
|
||||
/* hb_UPoke( [@]<cText>, <n>, <nVal> ) --> <cText>
|
||||
* change <n>th character in given string to unicode <nVal> one and return modified text
|
||||
*/
|
||||
HB_FUNC( HB_UPOKE )
|
||||
{
|
||||
@@ -237,8 +237,8 @@ HB_FUNC( HB_UPOKE )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1111, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_BPoke( [@]<cText>, <n>, <nVal> ) -> <cText>
|
||||
* change <n>-th byte in given string to <nVal> and return modified text
|
||||
/* hb_BPoke( [@]<cText>, <n>, <nVal> ) --> <cText>
|
||||
* change <n>th byte in given string to <nVal> and return modified text
|
||||
*/
|
||||
HB_FUNC( HB_BPOKE )
|
||||
{
|
||||
@@ -260,7 +260,7 @@ HB_FUNC( HB_BPOKE )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1111, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_USubStr( <cString>, <nStart>, <nCount> ) -> <cSubstring>
|
||||
/* hb_USubStr( <cString>, <nStart>, <nCount> ) --> <cSubstring>
|
||||
*/
|
||||
HB_FUNC( HB_USUBSTR )
|
||||
{
|
||||
@@ -308,7 +308,7 @@ HB_FUNC( HB_USUBSTR )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1110, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_BSubStr( <cString>, <nStart>, <nCount> ) -> <cSubstring>
|
||||
/* hb_BSubStr( <cString>, <nStart>, <nCount> ) --> <cSubstring>
|
||||
*/
|
||||
HB_FUNC( HB_BSUBSTR )
|
||||
{
|
||||
@@ -354,7 +354,7 @@ HB_FUNC( HB_BSUBSTR )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1110, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_ULeft( <cString>, <nCount> ) -> <cSubstring>
|
||||
/* hb_ULeft( <cString>, <nCount> ) --> <cSubstring>
|
||||
*/
|
||||
HB_FUNC( HB_ULEFT )
|
||||
{
|
||||
@@ -380,7 +380,7 @@ HB_FUNC( HB_ULEFT )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1124, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_BLeft( <cString>, <nCount> ) -> <cSubstring>
|
||||
/* hb_BLeft( <cString>, <nCount> ) --> <cSubstring>
|
||||
*/
|
||||
HB_FUNC( HB_BLEFT )
|
||||
{
|
||||
@@ -404,7 +404,7 @@ HB_FUNC( HB_BLEFT )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1124, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_URight( <cString>, <nCount> ) -> <cSubstring>
|
||||
/* hb_URight( <cString>, <nCount> ) --> <cSubstring>
|
||||
*/
|
||||
HB_FUNC( HB_URIGHT )
|
||||
{
|
||||
@@ -432,7 +432,7 @@ HB_FUNC( HB_URIGHT )
|
||||
hb_retc_null();
|
||||
}
|
||||
|
||||
/* hb_BRight( <cString>, <nCount> ) -> <cSubstring>
|
||||
/* hb_BRight( <cString>, <nCount> ) --> <cSubstring>
|
||||
*/
|
||||
HB_FUNC( HB_BRIGHT )
|
||||
{
|
||||
@@ -452,7 +452,7 @@ HB_FUNC( HB_BRIGHT )
|
||||
}
|
||||
|
||||
|
||||
/* hb_UAt( <cSubString>, <cString>, [<nFrom>], [<nTo>] ) -> <nAt>
|
||||
/* hb_UAt( <cSubString>, <cString>, [<nFrom>], [<nTo>] ) --> <nAt>
|
||||
*/
|
||||
HB_FUNC( HB_UAT )
|
||||
{
|
||||
@@ -465,7 +465,7 @@ HB_FUNC( HB_UAT )
|
||||
const char * pszText = hb_itemGetCPtr( pText );
|
||||
HB_SIZE nTextLength = hb_itemGetCLen( pText );
|
||||
HB_SIZE nStart = hb_parns( 3 );
|
||||
HB_SIZE nFrom, nTo, nPos = 0;
|
||||
HB_SIZE nFrom, nPos = 0;
|
||||
|
||||
if( nStart <= 1 )
|
||||
nStart = nFrom = 0;
|
||||
@@ -474,6 +474,8 @@ HB_FUNC( HB_UAT )
|
||||
|
||||
if( nFrom < nTextLength )
|
||||
{
|
||||
HB_SIZE nTo;
|
||||
|
||||
pszText += nFrom;
|
||||
nTextLength -= nFrom;
|
||||
if( HB_ISNUM( 4 ) )
|
||||
@@ -506,7 +508,7 @@ HB_FUNC( HB_UAT )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1108, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_BAt( <cSubString>, <cString>, [<nFrom>], [<nTo>] ) -> <nAt>
|
||||
/* hb_BAt( <cSubString>, <cString>, [<nFrom>], [<nTo>] ) --> <nAt>
|
||||
*/
|
||||
HB_FUNC( HB_BAT )
|
||||
{
|
||||
@@ -518,7 +520,7 @@ HB_FUNC( HB_BAT )
|
||||
const char * pszText = hb_itemGetCPtr( pText );
|
||||
HB_SIZE nTextLength = hb_itemGetCLen( pText );
|
||||
HB_SIZE nStart = hb_parns( 3 );
|
||||
HB_SIZE nFrom, nTo, nPos = 0;
|
||||
HB_SIZE nFrom, nPos = 0;
|
||||
|
||||
if( nStart <= 1 )
|
||||
nStart = nFrom = 0;
|
||||
@@ -527,6 +529,8 @@ HB_FUNC( HB_BAT )
|
||||
|
||||
if( nFrom < nTextLength )
|
||||
{
|
||||
HB_SIZE nTo;
|
||||
|
||||
pszText += nFrom;
|
||||
nTextLength -= nFrom;
|
||||
if( HB_ISNUM( 4 ) )
|
||||
@@ -558,7 +562,7 @@ HB_FUNC( HB_BAT )
|
||||
hb_errRT_BASE_SubstR( EG_ARG, 1108, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
/* hb_BRAt( <cSubString>, <cString>, [<nFrom>], [<nTo>] ) -> <nAt>
|
||||
/* hb_BRAt( <cSubString>, <cString>, [<nFrom>], [<nTo>] ) --> <nAt>
|
||||
*/
|
||||
HB_FUNC( HB_BRAT )
|
||||
{
|
||||
@@ -612,7 +616,7 @@ HB_FUNC( HB_BRAT )
|
||||
hb_retns( nPos );
|
||||
}
|
||||
|
||||
/* hb_BStuff( <cString>, <nAt>, <nDel>, <cIns> ) -> <cResult>
|
||||
/* hb_BStuff( <cString>, <nAt>, <nDel>, <cIns> ) --> <cResult>
|
||||
*/
|
||||
HB_FUNC( HB_BSTUFF )
|
||||
{
|
||||
@@ -657,7 +661,7 @@ HB_FUNC( HB_BSTUFF )
|
||||
hb_retc_null();
|
||||
}
|
||||
|
||||
/* hb_UStuff( <cString>, <nAt>, <nDel>, <cIns> ) -> <cResult>
|
||||
/* hb_UStuff( <cString>, <nAt>, <nDel>, <cIns> ) --> <cResult>
|
||||
*/
|
||||
HB_FUNC( HB_USTUFF )
|
||||
{
|
||||
@@ -703,5 +707,3 @@ HB_FUNC( HB_USTUFF )
|
||||
else
|
||||
hb_retc_null();
|
||||
}
|
||||
|
||||
/* TODO: PadR(), PadC(), PadL() */
|
||||
|
||||
@@ -52,7 +52,6 @@ HB_FUNC( HB_COLORINDEX )
|
||||
{
|
||||
const char * pszColor = hb_parc( 1 );
|
||||
HB_SIZE nColorPos;
|
||||
HB_SIZE nColorLen;
|
||||
int iColorIndex = hb_parni( 2 );
|
||||
|
||||
/* Skip the given number of commas */
|
||||
@@ -65,6 +64,8 @@ HB_FUNC( HB_COLORINDEX )
|
||||
/* if found, continue */
|
||||
if( iColorIndex == 0 )
|
||||
{
|
||||
HB_SIZE nColorLen;
|
||||
|
||||
/* Skip the spaces after the comma */
|
||||
while( pszColor[ nColorPos ] == ' ' )
|
||||
nColorPos++;
|
||||
|
||||
@@ -2,6 +2,13 @@
|
||||
* The Console API
|
||||
*
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 1999-2015 Viktor Szakats (vszakats.net/harbour) (hb_conNewLine(), DispOutAt(), hb_StrEOL())
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* hb_conOutAlt(), hb_conOutDev(), DevOut(), hb_conDevPos(),
|
||||
* DevPos(), __Eject(),
|
||||
* hb_conOut(), hb_conOutErr(), OutErr(),
|
||||
* hb_conOutStd(), OutStd(), PCol(), PRow(),
|
||||
* SetPRC(), and hb_conInit()
|
||||
*
|
||||
* 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
|
||||
@@ -44,24 +51,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* hb_conOutAlt(), hb_conOutDev(), DevOut(), hb_conDevPos(),
|
||||
* DevPos(), __Eject(),
|
||||
* hb_conOut(), hb_conOutErr(), OutErr(),
|
||||
* hb_conOutStd(), OutStd(), PCol(), PRow(),
|
||||
* SetPRC(), and hb_conInit()
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_conNewLine()
|
||||
* DispOutAt()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapicdp.h"
|
||||
#include "hbapiitm.h"
|
||||
@@ -122,7 +111,7 @@ void hb_conInit( void )
|
||||
|
||||
#if ! defined( HB_OS_WIN )
|
||||
/* On Windows file handles with numbers 0, 1, 2 are
|
||||
transalted inside filesys to:
|
||||
translated inside filesys to:
|
||||
GetStdHandle( STD_INPUT_HANDLE ), GetStdHandle( STD_OUTPUT_HANDLE ),
|
||||
GetStdHandle( STD_ERROR_HANDLE ) */
|
||||
|
||||
@@ -139,7 +128,7 @@ void hb_conInit( void )
|
||||
|
||||
if( iStderr == 0 || iStderr == 1 ) /* //STDERR with no parameter or 0 */
|
||||
s_hFilenoStderr = s_hFilenoStdout;
|
||||
/* disabled in default builds. It's not multiplatform and very
|
||||
/* disabled in default builds. It's not multi-platform and very
|
||||
* dangerous because it can redirect error messages to data files
|
||||
* [druzus]
|
||||
*/
|
||||
@@ -175,7 +164,7 @@ void hb_conRelease( void )
|
||||
/*
|
||||
* Clipper does not restore screen size on exit so I removed the code with:
|
||||
* hb_gtSetMode( s_originalMaxRow + 1, s_originalMaxCol + 1 );
|
||||
* If the low level GT drive change some video adapter parameters which
|
||||
* If the low-level GT drive change some video adapter parameters which
|
||||
* have to be restored on exit then it should does it in its Exit()
|
||||
* method. Here we cannot force any actions because it may cause bad
|
||||
* results in some GTs, f.e. when the screen size is controlled by remote
|
||||
@@ -364,7 +353,6 @@ HB_FUNC( QOUT )
|
||||
|
||||
if( ( pFile = hb_setGetPrinterHandle( HB_SET_PRN_CON ) ) != NULL )
|
||||
{
|
||||
char buf[ 256 ];
|
||||
PHB_PRNPOS pPrnPos = hb_prnPos();
|
||||
|
||||
pPrnPos->row++;
|
||||
@@ -372,6 +360,8 @@ HB_FUNC( QOUT )
|
||||
|
||||
if( pPrnPos->col )
|
||||
{
|
||||
char buf[ 256 ];
|
||||
|
||||
if( pPrnPos->col > ( int ) sizeof( buf ) )
|
||||
{
|
||||
char * pBuf = ( char * ) hb_xgrab( pPrnPos->col );
|
||||
@@ -579,7 +569,7 @@ HB_FUNC( DISPOUT ) /* writes a single value to the screen, but is not affected b
|
||||
|
||||
/* NOTE: Clipper does no checks about the screen positions. [vszakats] */
|
||||
|
||||
HB_FUNC( DISPOUTAT ) /* writes a single value to the screen at speficic position, but is not affected by SET ALTERNATE */
|
||||
HB_FUNC( DISPOUTAT ) /* writes a single value to the screen at specific position, but is not affected by SET ALTERNATE */
|
||||
{
|
||||
char * pszString;
|
||||
HB_SIZE nLen;
|
||||
@@ -612,7 +602,7 @@ HB_FUNC( DISPOUTAT ) /* writes a single value to the screen at speficic position
|
||||
}
|
||||
}
|
||||
|
||||
/* Harbour extension, works like DISPOUTAT but does not change cursor position */
|
||||
/* Harbour extension, works like DispOutAt() but does not change cursor position */
|
||||
|
||||
HB_FUNC( HB_DISPOUTAT )
|
||||
{
|
||||
|
||||
@@ -71,7 +71,7 @@
|
||||
#endif
|
||||
|
||||
/*
|
||||
SecondsCPU(n) -> nTime
|
||||
SecondsCPU( n ) --> nTime
|
||||
FlagShip/CLIP compatible function, which reports how many CPU and/or
|
||||
system seconds have elapsed since the beginning of the program execution.
|
||||
n == 1 utime -> user CPU time of the current process
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
/*
|
||||
* CMonth(), CDoW() functions
|
||||
* CMonth(), CDoW(), hb_CDay() functions
|
||||
*
|
||||
* Copyright 2014 Viktor Szakats (vszakats.net/harbour) (hb_CDay())
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -53,7 +54,7 @@
|
||||
#if defined( __CODEGUARD__ )
|
||||
static const char s_nullStr[ 4 ] = { 0 };
|
||||
#else
|
||||
# define s_nullStr ""
|
||||
#define s_nullStr ""
|
||||
#endif
|
||||
|
||||
const char * hb_dateCMonth( int iMonth )
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* The Date API (C level)
|
||||
*
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* Copyright 2009 Przemyslaw Czerpak <druzus / at / priv.onet.pl> (hb_timeFormat(), hb_timeUnformat(), hb_timeStampFormat(), hb_timeStampUnformat())
|
||||
*
|
||||
* 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
|
||||
@@ -43,18 +44,6 @@
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 2009 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
* hb_timeFormat()
|
||||
* hb_timeUnformat()
|
||||
* hb_timeStampFormat()
|
||||
* hb_timeStampUnformat()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbdate.h"
|
||||
@@ -68,7 +57,7 @@ char * hb_dateFormat( const char * szDate, char * szFormattedDate, const char *
|
||||
*/
|
||||
int format_count, digit_count, size;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dateFormat(%s, %p, %s)", szDate, szFormattedDate, szDateFormat ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dateFormat(%s, %p, %s)", szDate, ( void * ) szFormattedDate, szDateFormat ) );
|
||||
|
||||
/*
|
||||
* Determine the maximum size of the formatted date string
|
||||
@@ -80,7 +69,6 @@ char * hb_dateFormat( const char * szDate, char * szFormattedDate, const char *
|
||||
if( szDate && strlen( szDate ) == 8 ) /* A valid date is always 8 characters */
|
||||
{
|
||||
const char * szPtr;
|
||||
int digit;
|
||||
HB_BOOL used_d, used_m, used_y;
|
||||
|
||||
format_count = 0;
|
||||
@@ -89,7 +77,7 @@ char * hb_dateFormat( const char * szDate, char * szFormattedDate, const char *
|
||||
|
||||
while( format_count < size )
|
||||
{
|
||||
digit = HB_TOUPPER( ( HB_UCHAR ) *szPtr );
|
||||
int digit = HB_TOUPPER( ( HB_UCHAR ) *szPtr );
|
||||
szPtr++;
|
||||
digit_count = 1;
|
||||
while( HB_TOUPPER( ( HB_UCHAR ) *szPtr ) == digit && format_count < size )
|
||||
@@ -249,7 +237,7 @@ static int hb_dateUnformatRaw( const char * szDate, const char * szDateFormat, l
|
||||
int d_value = 0, m_value = 0, y_value = 0;
|
||||
int iSize = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dateUnformatRaw(%s, %s, %p)", szDate, szDateFormat, plDate ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_dateUnformatRaw(%s, %s, %p)", szDate, szDateFormat, ( void * ) plDate ) );
|
||||
|
||||
if( szDate )
|
||||
{
|
||||
@@ -376,9 +364,9 @@ char * hb_timeFormat( char * szBuffer, const char * szTimeFormat, long lMilliSec
|
||||
{
|
||||
char * szTimeBuffer;
|
||||
int iHour, iMinutes, iSeconds, iMSec, iPM, i12;
|
||||
int size, i, ch, count, value, digits, skip;
|
||||
int size, i, value, digits, skip;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_timeFormat(%p, %s, %ld)", szBuffer, szTimeFormat, lMilliSec ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_timeFormat(%p, %s, %ld)", ( void * ) szBuffer, szTimeFormat, lMilliSec ) );
|
||||
|
||||
hb_timeDecode( lMilliSec, &iHour, &iMinutes, &iSeconds, &iMSec );
|
||||
szTimeBuffer = szBuffer;
|
||||
@@ -405,8 +393,8 @@ char * hb_timeFormat( char * szBuffer, const char * szTimeFormat, long lMilliSec
|
||||
i = 0;
|
||||
while( i < size )
|
||||
{
|
||||
count = -i;
|
||||
ch = HB_TOUPPER( szTimeFormat[ i ] );
|
||||
int count = -i;
|
||||
int ch = HB_TOUPPER( szTimeFormat[ i ] );
|
||||
++i;
|
||||
while( ch == HB_TOUPPER( szTimeFormat[ i ] ) && i < size )
|
||||
++i;
|
||||
@@ -503,7 +491,7 @@ char * hb_timeStampFormat( char * szBuffer,
|
||||
{
|
||||
char szDate[ 9 ], * szTimeBuffer;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_timeStampFormat(%p, %s, %s, %ld, %ld)", szBuffer, szDateFormat, szTimeFormat, lJulian, lMilliSec ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_timeStampFormat(%p, %s, %s, %ld, %ld)", ( void * ) szBuffer, szDateFormat, szTimeFormat, lJulian, lMilliSec ) );
|
||||
|
||||
hb_dateDecStr( szDate, lJulian );
|
||||
hb_dateFormat( szDate, szBuffer, szDateFormat );
|
||||
@@ -628,7 +616,7 @@ void hb_timeStampUnformat( const char * szDateTime,
|
||||
const char * szDateFormat, const char * szTimeFormat,
|
||||
long * plJulian, long * plMilliSec )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_timeStampUnformat(%s, %s, %s, %p, %p)", szDateTime, szDateFormat, szTimeFormat, plJulian, plMilliSec ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_timeStampUnformat(%s, %s, %s, %p, %p)", szDateTime, szDateFormat, szTimeFormat, ( void * ) plJulian, ( void * ) plMilliSec ) );
|
||||
|
||||
if( szDateTime )
|
||||
{
|
||||
|
||||
@@ -2,6 +2,9 @@
|
||||
* The Date API (Harbour level)
|
||||
*
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com> (Day(), Month(), Year(), DoW())
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com> (CToD(), Date())
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour) (hb_SToD())
|
||||
*
|
||||
* 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
|
||||
@@ -44,26 +47,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
* Day()
|
||||
* Month()
|
||||
* Year()
|
||||
* DoW()
|
||||
*
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* CToD()
|
||||
* Date()
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_SToD()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapierr.h"
|
||||
#include "hbapiitm.h"
|
||||
@@ -585,7 +568,7 @@ HB_FUNC( HB_STRTOTS )
|
||||
}
|
||||
|
||||
/* get week number and other parts ISO 8601 week date:
|
||||
hb_Week( <dDate>, [@<nYear>], [@<nDayOfWeek>] ) -> <nWeek> */
|
||||
hb_Week( <dDate>, [@<nYear>], [@<nDayOfWeek>] ) --> <nWeek> */
|
||||
HB_FUNC( HB_WEEK )
|
||||
{
|
||||
PHB_ITEM pDate = hb_param( 1, HB_IT_DATETIME );
|
||||
|
||||
@@ -142,25 +142,28 @@ FUNCTION dbEdit( nTop, nLeft, nBottom, nRight, ;
|
||||
|
||||
bBlock := iif( Type( cBlock ) == "M", {|| " <Memo> " }, hb_macroBlock( cBlock ) )
|
||||
|
||||
IF HB_ISARRAY( xColumnHeaders ) .AND. Len( xColumnHeaders ) >= nPos .AND. HB_ISSTRING( xColumnHeaders[ nPos ] )
|
||||
DO CASE
|
||||
CASE HB_ISARRAY( xColumnHeaders ) .AND. Len( xColumnHeaders ) >= nPos .AND. HB_ISSTRING( xColumnHeaders[ nPos ] )
|
||||
cHeading := xColumnHeaders[ nPos ]
|
||||
ELSEIF HB_ISSTRING( xColumnHeaders )
|
||||
CASE HB_ISSTRING( xColumnHeaders )
|
||||
cHeading := xColumnHeaders
|
||||
ENDIF
|
||||
ENDCASE
|
||||
|
||||
oColumn := TBColumnNew( cHeading, bBlock )
|
||||
|
||||
IF HB_ISARRAY( xColumnSayPictures ) .AND. nPos <= Len( xColumnSayPictures ) .AND. HB_ISSTRING( xColumnSayPictures[ nPos ] ) .AND. ! Empty( xColumnSayPictures[ nPos ] )
|
||||
DO CASE
|
||||
CASE HB_ISARRAY( xColumnSayPictures ) .AND. nPos <= Len( xColumnSayPictures ) .AND. HB_ISSTRING( xColumnSayPictures[ nPos ] ) .AND. ! Empty( xColumnSayPictures[ nPos ] )
|
||||
oColumn:picture := xColumnSayPictures[ nPos ]
|
||||
ELSEIF HB_ISSTRING( xColumnSayPictures ) .AND. ! Empty( xColumnSayPictures )
|
||||
CASE HB_ISSTRING( xColumnSayPictures ) .AND. ! Empty( xColumnSayPictures )
|
||||
oColumn:picture := xColumnSayPictures
|
||||
ENDIF
|
||||
ENDCASE
|
||||
|
||||
IF HB_ISARRAY( xColumnFootings ) .AND. nPos <= Len( xColumnFootings ) .AND. HB_ISSTRING( xColumnFootings[ nPos ] )
|
||||
DO CASE
|
||||
CASE HB_ISARRAY( xColumnFootings ) .AND. nPos <= Len( xColumnFootings ) .AND. HB_ISSTRING( xColumnFootings[ nPos ] )
|
||||
oColumn:footing := xColumnFootings[ nPos ]
|
||||
ELSEIF HB_ISSTRING( xColumnFootings )
|
||||
CASE HB_ISSTRING( xColumnFootings )
|
||||
oColumn:footing := xColumnFootings
|
||||
ENDIF
|
||||
ENDCASE
|
||||
|
||||
IF HB_ISARRAY( xHeadingSeparators ) .AND. nPos <= Len( xHeadingSeparators ) .AND. HB_ISSTRING( xHeadingSeparators[ nPos ] )
|
||||
oColumn:headSep := xHeadingSeparators[ nPos ]
|
||||
@@ -179,9 +182,7 @@ FUNCTION dbEdit( nTop, nLeft, nBottom, nRight, ;
|
||||
|
||||
nOldCUrsor := SetCursor( SC_NONE )
|
||||
|
||||
/* --------------------------- */
|
||||
/* Go into the processing loop */
|
||||
/* --------------------------- */
|
||||
|
||||
lAppend := .F.
|
||||
lFlag := .T.
|
||||
@@ -281,10 +282,9 @@ FUNCTION dbEdit( nTop, nLeft, nBottom, nRight, ;
|
||||
RETURN .T.
|
||||
|
||||
|
||||
/* NOTE: CA-Cl*pper uses intermediate function CALLUSER()
|
||||
* to execute user function. We're replicating this behavior
|
||||
* for code which may check ProcName() results in user function
|
||||
*/
|
||||
/* NOTE: CA-Cl*pper uses intermediate function CallUser()
|
||||
to execute user function. We're replicating this behavior
|
||||
for code which may check ProcName() results in user function */
|
||||
STATIC FUNCTION CallUser( oBrowse, xUserFunc, nKey, lAppend, lFlag )
|
||||
|
||||
LOCAL nPrevRecNo
|
||||
@@ -358,10 +358,8 @@ STATIC FUNCTION CallUser( oBrowse, xUserFunc, nKey, lAppend, lFlag )
|
||||
|
||||
|
||||
/* helper function to detect empty tables. It's not perfect but
|
||||
* it functionally uses the same conditions as CA-Cl*pper
|
||||
*/
|
||||
it functionally uses the same conditions as CA-Cl*pper */
|
||||
STATIC FUNCTION IsDbEmpty()
|
||||
|
||||
RETURN LastRec() == 0 .OR. ;
|
||||
( Bof() .AND. ( Eof() .OR. RecNo() == LastRec() + 1 ) )
|
||||
|
||||
@@ -371,14 +369,15 @@ STATIC FUNCTION Skipped( nRecs, lAppend )
|
||||
LOCAL nSkipped := 0
|
||||
|
||||
IF LastRec() != 0
|
||||
IF nRecs == 0
|
||||
DO CASE
|
||||
CASE nRecs == 0
|
||||
IF Eof() .AND. ! lAppend
|
||||
dbSkip( -1 )
|
||||
nSkipped := -1
|
||||
ELSE
|
||||
dbSkip( 0 )
|
||||
ENDIF
|
||||
ELSEIF nRecs > 0 .AND. RecNo() != LastRec() + 1
|
||||
CASE nRecs > 0 .AND. RecNo() != LastRec() + 1
|
||||
DO WHILE nSkipped < nRecs
|
||||
dbSkip()
|
||||
IF Eof()
|
||||
@@ -391,7 +390,7 @@ STATIC FUNCTION Skipped( nRecs, lAppend )
|
||||
ENDIF
|
||||
nSkipped++
|
||||
ENDDO
|
||||
ELSEIF nRecs < 0
|
||||
CASE nRecs < 0
|
||||
DO WHILE nSkipped > nRecs
|
||||
dbSkip( -1 )
|
||||
IF Bof()
|
||||
@@ -399,7 +398,7 @@ STATIC FUNCTION Skipped( nRecs, lAppend )
|
||||
ENDIF
|
||||
nSkipped--
|
||||
ENDDO
|
||||
ENDIF
|
||||
ENDCASE
|
||||
ENDIF
|
||||
|
||||
RETURN nSkipped
|
||||
|
||||
@@ -50,10 +50,9 @@
|
||||
HB_FUNC( __DEFPATH )
|
||||
{
|
||||
char buffer[ HB_PATH_MAX - 1 + 2 ];
|
||||
const char * szDefault;
|
||||
const char * szDefault = hb_setGetDefault();
|
||||
int size = 0;
|
||||
|
||||
szDefault = hb_setGetDefault();
|
||||
if( szDefault )
|
||||
{
|
||||
/* Leave enough space to append a path delimiter */
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbdefs.h"
|
||||
|
||||
#ifdef HB_CLP_UNDOC
|
||||
|
||||
|
||||
@@ -49,7 +49,7 @@
|
||||
|
||||
void hb_strDescend( char * szStringTo, const char * szStringFrom, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_strDescend(%p, %s, %" HB_PFS "u)", szStringTo, szStringFrom, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_strDescend(%p, %s, %" HB_PFS "u)", ( void * ) szStringTo, szStringFrom, nLen ) );
|
||||
|
||||
if( nLen == 1 && szStringFrom[ 0 ] == '\0' )
|
||||
szStringTo[ 0 ] = '\0';
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
* Clipper is a bit schizoid with the treatment of file attributes, but we've
|
||||
* emulated that weirdness here for your viewing amusement.
|
||||
*
|
||||
* In Clippers' homeworld of DOS, there are 5 basic attributes: 'A'rchive,
|
||||
* In Clippers' home world of MS-DOS, there are 5 basic attributes: 'A'rchive,
|
||||
* 'H'idden, 'S'ystem, 'R'eadonly and 'D'irectory. In addition, a file can
|
||||
* have no attributes, and only 1 file per physical partition can have the
|
||||
* 'V'olume label.
|
||||
@@ -61,7 +61,7 @@
|
||||
* unless they also happen to be 'H'idden and that attribute was not requested.
|
||||
*
|
||||
* "V" is a special case - you will get back the entry that describes the
|
||||
* volume label for the drive implied by the filemask.
|
||||
* volume label for the drive implied by the file mask.
|
||||
*
|
||||
* Differences from the 'standard' (where supported):
|
||||
* - Filenames will be returned in the same case as they are stored in the
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/* NOTE: DiskSpace() supports larger disks than 2GB. CA-Cl*pper will always
|
||||
/* NOTE: DiskSpace() supports larger disks than 2 GiB. CA-Cl*pper will always
|
||||
return a (long) value, Harbour may return a (double) for large
|
||||
values, the decimal places are always set to zero, though. */
|
||||
|
||||
@@ -116,9 +116,8 @@ HB_FUNC( DISKSPACE )
|
||||
( ( ( double ) 0xFFFFFFFF ) + 1 ) )
|
||||
|
||||
#else
|
||||
/* NOTE: Borland doesn't seem to deal with the un-named
|
||||
struct that is part of ULARGE_INTEGER
|
||||
[pt] */
|
||||
/* NOTE: For compilers that don't seem to deal with the
|
||||
unnamed struct that is part of ULARGE_INTEGER [pt] */
|
||||
# define HB_GET_LARGE_UINT( v ) ( ( double ) (v).u.LowPart + \
|
||||
( double ) (v).u.HighPart * \
|
||||
( ( ( double ) 0xFFFFFFFF ) + 1 ) )
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Undocumented CA-Cl*pper function used to validate
|
||||
* instance variable type in assign messages.
|
||||
* instance variable type in assign messages.
|
||||
*
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
@@ -57,12 +57,12 @@ FUNCTION __eInstVar52( oVar, cMethod, xValue, cType, nSubCode, xMin, xMax )
|
||||
IF ValType( xValue ) == cType
|
||||
lError := .F.
|
||||
IF xMin != NIL
|
||||
lError := !( xValue >= xMin )
|
||||
lError := ! xValue >= xMin
|
||||
ENDIF
|
||||
/* NOTE: In CA-Cl*pper 5.2, xMin validation result is
|
||||
ignored when xMax != NIL. Harbour is doing the same. */
|
||||
IF xMax != NIL
|
||||
lError := !( xValue <= xMax )
|
||||
lError := ! xValue <= xMax
|
||||
ENDIF
|
||||
ELSE
|
||||
lError := .T.
|
||||
@@ -83,7 +83,7 @@ FUNCTION __eInstVar52( oVar, cMethod, xValue, cType, nSubCode, xMin, xMax )
|
||||
oError:subcode := nSubCode
|
||||
oError:args := { xValue }
|
||||
xValue := Eval( ErrorBlock(), oError )
|
||||
IF !( ValType( xValue ) == cType )
|
||||
IF ! ValType( xValue ) == cType
|
||||
__errInHandler()
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Undocumented CA-Cl*pper function used to validate
|
||||
* instance variable type in assign messages.
|
||||
* instance variable type in assign messages.
|
||||
*
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
@@ -53,7 +53,7 @@ FUNCTION __eInstVar53( oVar, cMethod, xValue, cType, nSubCode, bValid )
|
||||
|
||||
LOCAL oError
|
||||
|
||||
IF !( ValType( xValue ) == cType ) .OR. ;
|
||||
IF ! ValType( xValue ) == cType .OR. ;
|
||||
( bValid != NIL .AND. ! Eval( bValid, oVar, xValue ) )
|
||||
oError := ErrorNew()
|
||||
oError:description := hb_langErrMsg( EG_ARG )
|
||||
@@ -69,7 +69,7 @@ FUNCTION __eInstVar53( oVar, cMethod, xValue, cType, nSubCode, bValid )
|
||||
oError:subcode := nSubCode
|
||||
oError:args := { xValue }
|
||||
xValue := Eval( ErrorBlock(), oError )
|
||||
IF !( ValType( xValue ) == cType )
|
||||
IF ! ValType( xValue ) == cType
|
||||
__errInHandler()
|
||||
ENDIF
|
||||
ENDIF
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Undocumented CA-Cl*pper function used to validate
|
||||
* instance variable type in assign messages.
|
||||
* instance variable type in assign messages.
|
||||
*
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
|
||||
@@ -2,6 +2,8 @@
|
||||
* The Error API
|
||||
*
|
||||
* Copyright 1999 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 1999-2016 Viktor Szakats (vszakats.net/harbour) (DosError(), __errInHandler(), __errRT*(), hb_errLaunch*(), hb_err*Flags(), hb_errRT*())
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl> (rewritten in C ERROR class and all hb_errGet*() and hb_errPut*() functions)
|
||||
*
|
||||
* 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
|
||||
@@ -44,32 +46,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* DosError()
|
||||
* __errInHandler()
|
||||
* __errRT_BASE()
|
||||
* __errRT_SBASE()
|
||||
* hb_errLaunch()
|
||||
* hb_errLaunchSubst()
|
||||
* hb_errGetFlags()
|
||||
* hb_errPutFlags()
|
||||
* hb_errRT_New()
|
||||
* hb_errRT_New_Subst()
|
||||
* hb_errRT_BASE()
|
||||
* hb_errRT_BASE_Ext1()
|
||||
* hb_errRT_BASE_Subst()
|
||||
*
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
* rewritten in C ERROR class and all hb_errGet*() and hb_errPut*()
|
||||
* functions
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapiitm.h"
|
||||
#include "hbapierr.h"
|
||||
@@ -560,7 +536,7 @@ HB_USHORT hb_errLaunch( PHB_ITEM pError )
|
||||
if( pErrData->errorHandler )
|
||||
{
|
||||
/* there is a low-level error handler defined - use it instead
|
||||
* of normal Harbour-level one
|
||||
* of normal Harbour level one
|
||||
*/
|
||||
pErrData->errorHandler->Error = pError;
|
||||
pErrData->errorHandler->ErrorBlock = pErrData->errorBlock;
|
||||
@@ -654,7 +630,7 @@ PHB_ITEM hb_errLaunchSubst( PHB_ITEM pError )
|
||||
if( pErrData->errorHandler )
|
||||
{
|
||||
/* there is a low-level error handler defined - use it instead
|
||||
* of normal Harbour-level one
|
||||
* of normal Harbour level one
|
||||
*/
|
||||
pErrData->errorHandler->Error = pError;
|
||||
pErrData->errorHandler->ErrorBlock = pErrData->errorBlock;
|
||||
@@ -1048,7 +1024,7 @@ HB_USHORT hb_errRT_BASE( HB_ERRCODE errGenCode, HB_ERRCODE errSubCode, const cha
|
||||
HB_ULONG ulArgPos;
|
||||
|
||||
/* I replaced EF_CANRETRY with EF_NONE for Clipper compatibility
|
||||
* If it's wrong and I missed sth please fix me, Druzus.
|
||||
* If it's wrong and I missed something please fix me, Druzus.
|
||||
*/
|
||||
pError = hb_errRT_New( ES_ERROR, HB_ERR_SS_BASE, errGenCode, errSubCode, szDescription, szOperation, 0, EF_NONE /* EF_CANRETRY */ );
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbdefs.h"
|
||||
|
||||
#ifdef HB_CLP_UNDOC
|
||||
|
||||
|
||||
@@ -60,14 +60,14 @@ void hb_errInternal( HB_ERRCODE errCode, const char * szText, const char * szPar
|
||||
if( hb_cmdargCheck( "ERRGPF" ) )
|
||||
{
|
||||
#if defined( _MSC_VER ) && _MSC_VER >= 1800
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable:6011)
|
||||
# pragma warning(push)
|
||||
# pragma warning(disable:6011)
|
||||
#endif
|
||||
int * pGPF = NULL;
|
||||
*pGPF = 0;
|
||||
*( --pGPF ) = 0;
|
||||
#if defined( _MSC_VER ) && _MSC_VER >= 1800
|
||||
#pragma warning(pop)
|
||||
# pragma warning(pop)
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -58,10 +58,9 @@ void hb_errInternalRaw( HB_ERRCODE errCode, const char * szText, const char * sz
|
||||
{
|
||||
char buffer[ 8192 ];
|
||||
char file[ HB_PATH_MAX ];
|
||||
const char * szFile, * szInfo;
|
||||
const char * szFile;
|
||||
HB_BOOL fStack, fLang;
|
||||
HB_USHORT uiLine;
|
||||
int iLevel;
|
||||
FILE * hLog;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_errInternal(%d, %s, %s, %s)", errCode, szText, szPar1, szPar2 ) );
|
||||
@@ -82,6 +81,8 @@ void hb_errInternalRaw( HB_ERRCODE errCode, const char * szText, const char * sz
|
||||
hLog = hb_fopen( szFile, "a+" );
|
||||
if( hLog )
|
||||
{
|
||||
const char * szInfo;
|
||||
|
||||
char szTime[ 9 ];
|
||||
int iYear, iMonth, iDay;
|
||||
|
||||
@@ -120,7 +121,7 @@ void hb_errInternalRaw( HB_ERRCODE errCode, const char * szText, const char * sz
|
||||
|
||||
if( fStack && hb_stackTotalItems() )
|
||||
{
|
||||
iLevel = 0;
|
||||
int iLevel = 0;
|
||||
while( hb_procinfo( iLevel++, buffer, &uiLine, file ) )
|
||||
{
|
||||
char msg[ HB_SYMBOL_NAME_LEN + HB_SYMBOL_NAME_LEN + 32 ];
|
||||
|
||||
@@ -115,7 +115,7 @@ STATIC FUNCTION DefError( oError )
|
||||
iif( cOSError == NIL, "", ";" + cOSError ), aOptions ) ) == 0
|
||||
ENDDO
|
||||
|
||||
IF ! Empty( nChoice )
|
||||
IF ! Empty( nChoice ) /* Alert() may return NIL */
|
||||
SWITCH aOptions[ nChoice ]
|
||||
CASE "Break"
|
||||
Break( oError )
|
||||
@@ -137,12 +137,10 @@ STATIC FUNCTION DefError( oError )
|
||||
|
||||
n := 1
|
||||
DO WHILE ! Empty( ProcName( ++n ) )
|
||||
|
||||
OutErr( hb_eol() )
|
||||
OutErr( hb_StrFormat( "Called from %1$s(%2$d) ", ;
|
||||
ProcName( n ), ;
|
||||
ProcLine( n ) ) )
|
||||
|
||||
ProcName( n ), ;
|
||||
ProcLine( n ) ) )
|
||||
ENDDO
|
||||
|
||||
ErrorLevel( 1 )
|
||||
|
||||
@@ -65,7 +65,6 @@ HB_BOOL hb_fsFile( const char * pszFileName )
|
||||
HB_BOOL hb_fsIsDirectory( const char * pszFileName )
|
||||
{
|
||||
HB_BOOL bResult = HB_FALSE;
|
||||
PHB_FFIND ffind;
|
||||
char * pszFree = NULL;
|
||||
int iLen;
|
||||
|
||||
@@ -80,6 +79,7 @@ HB_BOOL hb_fsIsDirectory( const char * pszFileName )
|
||||
|
||||
if( iLen && iLen <= ( HB_PATH_MAX - 1 ) )
|
||||
{
|
||||
PHB_FFIND ffind;
|
||||
if( ( ffind = hb_fsFindFirst( pszFileName, HB_FA_DIRECTORY ) ) != NULL )
|
||||
{
|
||||
do
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* functions to access files with shared handles and locks
|
||||
* (buffers in the future)
|
||||
* Functions to access files with shared handles and locks
|
||||
* (buffers in the future)
|
||||
*
|
||||
* Copyright 2008 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
@@ -70,8 +70,8 @@
|
||||
#if defined( __USE_LARGEFILE64 )
|
||||
/*
|
||||
* The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is
|
||||
* defined and effectively enables lseek64/flock64/ftruncate64 functions
|
||||
* on 32bit machines.
|
||||
* defined and effectively enables lseek64()/flock64()/ftruncate64()
|
||||
* functions on 32-bit machines.
|
||||
*/
|
||||
#define HB_USE_LARGEFILE64
|
||||
#elif defined( HB_OS_UNIX ) && defined( O_LARGEFILE )
|
||||
@@ -479,7 +479,6 @@ static PHB_FILE s_fileExtOpen( PHB_FILE_FUNCS pFuncs, const char * pszFileName,
|
||||
#endif
|
||||
HB_BOOL fResult, fShared;
|
||||
int iMode;
|
||||
HB_FHANDLE hFile;
|
||||
char * pszFile;
|
||||
|
||||
HB_SYMBOL_UNUSED( pFuncs );
|
||||
@@ -497,8 +496,8 @@ static PHB_FILE s_fileExtOpen( PHB_FILE_FUNCS pFuncs, const char * pszFileName,
|
||||
{
|
||||
if( iMode == FO_WRITE && fShared )
|
||||
{
|
||||
if( access( ( char * ) pszFile, R_OK ) == 0 ||
|
||||
access( ( char * ) pszFile, F_OK ) != 0 )
|
||||
if( access( pszFile, R_OK ) == 0 ||
|
||||
access( pszFile, F_OK ) != 0 )
|
||||
{
|
||||
nExFlags = ( nExFlags ^ FO_WRITE ) | FO_READWRITE;
|
||||
iMode = FO_READWRITE;
|
||||
@@ -517,9 +516,9 @@ static PHB_FILE s_fileExtOpen( PHB_FILE_FUNCS pFuncs, const char * pszFileName,
|
||||
hb_threadEnterCriticalSection( &s_fileMtx );
|
||||
|
||||
# if defined( HB_USE_LARGEFILE64 )
|
||||
fResult = stat64( ( char * ) pszFile, &statbuf ) == 0;
|
||||
fResult = stat64( pszFile, &statbuf ) == 0;
|
||||
# else
|
||||
fResult = stat( ( char * ) pszFile, &statbuf ) == 0;
|
||||
fResult = stat( pszFile, &statbuf ) == 0;
|
||||
# endif
|
||||
hb_fsSetIOError( fResult, 0 );
|
||||
|
||||
@@ -559,7 +558,7 @@ static PHB_FILE s_fileExtOpen( PHB_FILE_FUNCS pFuncs, const char * pszFileName,
|
||||
if( fResult && pFile == NULL )
|
||||
#endif /* HB_OS_UNIX */
|
||||
{
|
||||
hFile = hb_fsExtOpen( pszFile, NULL,
|
||||
HB_FHANDLE hFile = hb_fsExtOpen( pszFile, NULL,
|
||||
nExFlags & ~ ( HB_FATTR ) ( FXO_DEFAULTS | FXO_COPYNAME ),
|
||||
NULL, NULL );
|
||||
if( hFile != FS_ERROR )
|
||||
@@ -623,7 +622,7 @@ static PHB_FILE s_fileExtOpen( PHB_FILE_FUNCS pFuncs, const char * pszFileName,
|
||||
hb_fsClose( hFile );
|
||||
hFile = FS_ERROR;
|
||||
#if defined( HB_USE_SHARELOCKS ) && ! defined( HB_USE_BSDLOCKS )
|
||||
/* TOFIX: possible race condition */
|
||||
/* FIXME: possible race condition */
|
||||
hb_fsLockLarge( pFile->hFile, HB_SHARELOCK_POS, HB_SHARELOCK_SIZE,
|
||||
FL_LOCK | FLX_SHARED );
|
||||
#endif
|
||||
@@ -638,7 +637,7 @@ static PHB_FILE s_fileExtOpen( PHB_FILE_FUNCS pFuncs, const char * pszFileName,
|
||||
}
|
||||
if( hFile != FS_ERROR )
|
||||
{
|
||||
/* TOFIX: possible race condition in MT mode,
|
||||
/* FIXME: possible race condition in MT mode,
|
||||
* close() is not safe due to existing locks
|
||||
* which are removed.
|
||||
*/
|
||||
@@ -1463,8 +1462,10 @@ HB_FHANDLE hb_fileHandle( PHB_FILE pFile )
|
||||
|
||||
/* internal FILE structures only */
|
||||
|
||||
PHB_FILE hb_fileCreateTemp( const char * pszDir, const char * pszPrefix,
|
||||
HB_FATTR ulAttr, char * pszName )
|
||||
PHB_FILE hb_fileCreateTemp( const char * pszDir,
|
||||
const char * pszPrefix,
|
||||
HB_FATTR ulAttr,
|
||||
char * pszName )
|
||||
{
|
||||
PHB_FILE pFile = NULL;
|
||||
HB_FHANDLE hFile;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* dummy I/O driver initialization
|
||||
* Dummy I/O driver initialization
|
||||
*
|
||||
* Copyright 2014 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
|
||||
@@ -51,7 +51,7 @@
|
||||
the required attribute. */
|
||||
|
||||
/* NOTE: CA-Cl*pper RTrim()s the filename before doing the existence check.
|
||||
This is not multiplatform friendly, so Harbour doesn't do any
|
||||
This is not multi-platform friendly, so Harbour doesn't do any
|
||||
modification on the filename. [vszakats]
|
||||
For easier portability in Harbour user can optionally enable
|
||||
leading and trailing spaces stripping by
|
||||
|
||||
@@ -2,6 +2,18 @@
|
||||
* The FileSys API (C level)
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999-2010 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_fsSetError(), hb_fsSetDevMode(), hb_fsReadLarge(), hb_fsWriteLarge()
|
||||
* hb_fsCurDirBuff(), hb_fsBaseDirBuff()
|
||||
* fs_win_get_drive(), fs_win_set_drive()
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
* hb_fsChDrv(), hb_fsCurDrv(), hb_fsIsDrv(), hb_fsIsDevice()
|
||||
* Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>, David G. Holm <dholm@jsd-llc.com>
|
||||
* hb_fsEof()
|
||||
* Copyright 2001 Jose Gimenez (JFG) <jfgimenez@wanadoo.es>, <tecnico.sireinsa@ctv.es>
|
||||
* Added platform check for any compiler to use the Windows
|
||||
* API calls to allow opening an unlimited number of files
|
||||
* simultaneously.
|
||||
*
|
||||
* 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
|
||||
@@ -44,39 +56,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2010 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_fsSetError()
|
||||
* hb_fsSetDevMode()
|
||||
* hb_fsReadLarge()
|
||||
* hb_fsWriteLarge()
|
||||
* hb_fsCurDirBuff()
|
||||
* hb_fsBaseDirBuff()
|
||||
* fs_win_get_drive()
|
||||
* fs_win_set_drive()
|
||||
*
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
* hb_fsChDrv()
|
||||
* hb_fsCurDrv()
|
||||
* hb_fsIsDrv()
|
||||
* hb_fsIsDevice()
|
||||
*
|
||||
* Copyright 2000 Luiz Rafael Culik <culik@sl.conex.net>
|
||||
* and David G. Holm <dholm@jsd-llc.com>
|
||||
* hb_fsEof()
|
||||
*
|
||||
* Copyright 2001 Jose Gimenez (JFG) <jfgimenez@wanadoo.es>
|
||||
* <tecnico.sireinsa@ctv.es>
|
||||
* Added platform check for any compiler to use the Windows
|
||||
* API calls to allow openning an unlimited number of files
|
||||
* simultaneously.
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/* NOTE: In DOS/DJGPP under WinNT4 hb_fsSeek( fhnd, offset < 0, FS_SET ) will
|
||||
set the file pointer to the passed negative value and the subsequent
|
||||
hb_fsWrite() call will fail. In CA-Cl*pper, _fsSeek() will fail,
|
||||
@@ -222,8 +201,8 @@
|
||||
#if defined( __USE_LARGEFILE64 )
|
||||
/*
|
||||
* The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is
|
||||
* defined and effectively enables lseek64/flock64/ftruncate64 functions
|
||||
* on 32bit machines.
|
||||
* defined and effectively enables lseek64()/flock64()/ftruncate64()
|
||||
* functions on 32-bit machines.
|
||||
*/
|
||||
#define HB_USE_LARGEFILE64
|
||||
#elif defined( HB_OS_UNIX ) && defined( O_LARGEFILE ) && ! defined( __WATCOMC__ )
|
||||
@@ -411,20 +390,18 @@ static void fs_win_set_drive( int iDrive )
|
||||
|
||||
static HANDLE DosToWinHandle( HB_FHANDLE fHandle )
|
||||
{
|
||||
if( fHandle == ( HB_FHANDLE ) FS_ERROR )
|
||||
return NULL;
|
||||
|
||||
else if( fHandle == ( HB_FHANDLE ) HB_STDIN_HANDLE )
|
||||
return GetStdHandle( STD_INPUT_HANDLE );
|
||||
|
||||
else if( fHandle == ( HB_FHANDLE ) HB_STDOUT_HANDLE )
|
||||
return GetStdHandle( STD_OUTPUT_HANDLE );
|
||||
|
||||
else if( fHandle == ( HB_FHANDLE ) HB_STDERR_HANDLE )
|
||||
return GetStdHandle( STD_ERROR_HANDLE );
|
||||
|
||||
else
|
||||
return ( HANDLE ) fHandle;
|
||||
switch( fHandle )
|
||||
{
|
||||
case ( HB_FHANDLE ) FS_ERROR:
|
||||
return NULL;
|
||||
case ( HB_FHANDLE ) HB_STDIN_HANDLE:
|
||||
return GetStdHandle( STD_INPUT_HANDLE );
|
||||
case ( HB_FHANDLE ) HB_STDOUT_HANDLE:
|
||||
return GetStdHandle( STD_OUTPUT_HANDLE );
|
||||
case ( HB_FHANDLE ) HB_STDERR_HANDLE:
|
||||
return GetStdHandle( STD_ERROR_HANDLE );
|
||||
}
|
||||
return ( HANDLE ) fHandle;
|
||||
}
|
||||
|
||||
static void convert_open_flags( HB_BOOL fCreate, HB_FATTR nAttr, HB_USHORT uiFlags,
|
||||
@@ -586,7 +563,7 @@ static void convert_open_flags( HB_BOOL fCreate, HB_FATTR nAttr, HB_USHORT uiFla
|
||||
int * flags, unsigned * mode,
|
||||
int * share, int * attr )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "convert_open_flags(%d, %u, %hu, %p, %p, %p, %p)", fCreate, nAttr, uiFlags, flags, mode, share, attr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "convert_open_flags(%d, %u, %hu, %p, %p, %p, %p)", fCreate, nAttr, uiFlags, ( void * ) flags, ( void * ) mode, ( void * ) share, ( void * ) attr ) );
|
||||
|
||||
/* file access mode */
|
||||
#if defined( HB_OS_UNIX )
|
||||
@@ -720,7 +697,7 @@ HB_FHANDLE hb_fsGetOsHandle( HB_FHANDLE hFileHandle )
|
||||
}
|
||||
|
||||
#if defined( HB_OS_UNIX ) || defined( __DJGPP__ )
|
||||
/* for POSIX systems only, hides low level select()/poll() access,
|
||||
/* for POSIX systems only, hides low-level select()/poll() access,
|
||||
intentionally covered by HB_OS_UNIX macro to generate compile time
|
||||
error in code which tries to use it on other platforms */
|
||||
|
||||
@@ -855,7 +832,7 @@ int hb_fsPoll( PHB_POLLFD pPollSet, int iCount, HB_MAXINT nTimeOut )
|
||||
{
|
||||
int iResult;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsPoll(%p, %d, %" PFHL "d)", pPollSet, iCount, nTimeOut ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsPoll(%p, %d, %" PFHL "d)", ( void * ) pPollSet, iCount, nTimeOut ) );
|
||||
|
||||
hb_vmUnlock();
|
||||
|
||||
@@ -1048,7 +1025,7 @@ HB_FHANDLE hb_fsPOpen( const char * pszFileName, const char * pszMode )
|
||||
{
|
||||
HB_FHANDLE hFileHandle = FS_ERROR;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsPOpen(%p, %s)", pszFileName, pszMode ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsPOpen(%p, %s)", ( const void * ) pszFileName, pszMode ) );
|
||||
|
||||
#if defined( HB_OS_UNIX ) && ! defined( HB_OS_VXWORKS ) && ! defined( HB_OS_SYMBIAN )
|
||||
{
|
||||
@@ -1192,16 +1169,16 @@ HB_FHANDLE hb_fsPOpen( const char * pszFileName, const char * pszMode )
|
||||
#if defined( HB_OS_OS2 )
|
||||
# if ! defined( HB_OS2_NONAMEDPIPES ) && ! defined( HB_OS2_USENAMEDPIPES )
|
||||
|
||||
/* In OS2 anonymous pipes are not simulated by named pipes and
|
||||
/* In OS/2 anonymous pipes are not simulated by named pipes and
|
||||
unlike in MS-Windows functions for named pipes cannot be used
|
||||
with anonymous ones. Read/Write operations from/to anonymous
|
||||
pipes are always blocking on OS2. For unblocking access we
|
||||
pipes are always blocking on OS/2. For unblocking access we
|
||||
have to emulate anonymous pipe using named one [druzus] */
|
||||
# define HB_OS2_USENAMEDPIPES
|
||||
|
||||
# endif
|
||||
|
||||
/* the size of sustem IO buffers in OS2 pipes */
|
||||
/* the size of system IO buffers in OS/2 pipes */
|
||||
# define HB_OS2_PIPEBUFSIZE 4096
|
||||
|
||||
#endif
|
||||
@@ -1210,7 +1187,7 @@ HB_BOOL hb_fsPipeCreate( HB_FHANDLE hPipe[ 2 ] )
|
||||
{
|
||||
HB_BOOL fResult;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsPipeCreate(%p)", hPipe ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsPipeCreate(%p)", ( void * ) hPipe ) );
|
||||
|
||||
#if defined( HB_OS_WIN ) && ! defined( HB_OS_WIN_CE )
|
||||
{
|
||||
@@ -1910,7 +1887,7 @@ HB_BOOL hb_fsGetFileTime( const char * pszFileName, long * plJulian, long * plMi
|
||||
{
|
||||
HB_BOOL fResult;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsGetFileTime(%s, %p, %p)", pszFileName, plJulian, plMillisec ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsGetFileTime(%s, %p, %p)", pszFileName, ( void * ) plJulian, ( void * ) plMillisec ) );
|
||||
|
||||
fResult = HB_FALSE;
|
||||
*plJulian = *plMillisec = 0;
|
||||
@@ -2066,7 +2043,7 @@ HB_BOOL hb_fsGetAttr( const char * pszFileName, HB_FATTR * pnAttr )
|
||||
{
|
||||
HB_BOOL fResult;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsGetAttr(%s, %p)", pszFileName, pnAttr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsGetAttr(%s, %p)", pszFileName, ( void * ) pnAttr ) );
|
||||
|
||||
hb_vmUnlock();
|
||||
|
||||
@@ -2875,7 +2852,7 @@ HB_SIZE hb_fsReadAt( HB_FHANDLE hFileHandle, void * pBuff, HB_SIZE nCount, HB_FO
|
||||
}
|
||||
# endif /* HB_WIN_IOREAD_LIMIT */
|
||||
|
||||
/* TOFIX: below are not atom operations. It has to be fixed for RDD
|
||||
/* FIXME: below are not atom operations. It has to be fixed for RDD
|
||||
* file access with shared file handles in aliased work areas
|
||||
*/
|
||||
#elif defined( HB_OS_OS2 )
|
||||
@@ -3014,7 +2991,7 @@ HB_SIZE hb_fsWriteAt( HB_FHANDLE hFileHandle, const void * pBuff, HB_SIZE nCount
|
||||
}
|
||||
# endif /* HB_WIN_IOWRITE_LIMIT */
|
||||
|
||||
/* TOFIX: below are not atom operations. It has to be fixed for RDD
|
||||
/* FIXME: below are not atom operations. It has to be fixed for RDD
|
||||
* file access with shared file handles in aliased work areas
|
||||
*/
|
||||
#elif defined( HB_OS_OS2 )
|
||||
@@ -3152,7 +3129,7 @@ void hb_fsCommit( HB_FHANDLE hFileHandle )
|
||||
|
||||
#else
|
||||
|
||||
/* NOTE: close() functions releases all locks regardles if it is an
|
||||
/* NOTE: close() functions releases all locks regardless if it is an
|
||||
* original or duplicated file handle
|
||||
*/
|
||||
/* This hack is very dangerous. POSIX standard define that if _ANY_
|
||||
@@ -3160,7 +3137,7 @@ void hb_fsCommit( HB_FHANDLE hFileHandle )
|
||||
* pointed by this descriptor are removed. It doesn't matter they
|
||||
* were done using different descriptor. It means that we now clean
|
||||
* all locks on hFileHandle with the code below if the OS is POSIX
|
||||
* compilant. I vote to disable it. [druzus]
|
||||
* compliant. I vote to disable it. [druzus]
|
||||
*/
|
||||
{
|
||||
int dup_handle;
|
||||
@@ -3582,7 +3559,7 @@ HB_ULONG hb_fsSeek( HB_FHANDLE hFileHandle, HB_LONG lOffset, HB_USHORT uiFlags )
|
||||
|
||||
hb_vmUnlock();
|
||||
#if defined( HB_OS_WIN )
|
||||
/* This DOS hack creates 2GB file size limit, Druzus */
|
||||
/* This DOS hack creates 2 GiB file size limit, Druzus */
|
||||
if( lOffset < 0 && nFlags == SEEK_SET )
|
||||
{
|
||||
ulPos = ( ULONG ) INVALID_SET_FILE_POINTER;
|
||||
@@ -3604,7 +3581,7 @@ HB_ULONG hb_fsSeek( HB_FHANDLE hFileHandle, HB_LONG lOffset, HB_USHORT uiFlags )
|
||||
{
|
||||
APIRET ret;
|
||||
|
||||
/* This DOS hack creates 2GB file size limit, Druzus */
|
||||
/* This DOS hack creates 2 GiB file size limit, Druzus */
|
||||
if( lOffset < 0 && nFlags == SEEK_SET )
|
||||
ret = 25; /* 'Seek Error' */
|
||||
else
|
||||
@@ -3618,7 +3595,7 @@ HB_ULONG hb_fsSeek( HB_FHANDLE hFileHandle, HB_LONG lOffset, HB_USHORT uiFlags )
|
||||
}
|
||||
}
|
||||
#else
|
||||
/* This DOS hack creates 2GB file size limit, Druzus */
|
||||
/* This DOS hack creates 2 GiB file size limit, Druzus */
|
||||
if( lOffset < 0 && nFlags == SEEK_SET )
|
||||
{
|
||||
ulPos = ( HB_ULONG ) -1;
|
||||
@@ -3632,7 +3609,7 @@ HB_ULONG hb_fsSeek( HB_FHANDLE hFileHandle, HB_LONG lOffset, HB_USHORT uiFlags )
|
||||
/* small trick to resolve problem with position reported for directories */
|
||||
if( ulPos == LONG_MAX && lOffset == 0 && nFlags == SEEK_END )
|
||||
{
|
||||
/* we do not need to use fstat64() here on 32 bit platforms, [druzus] */
|
||||
/* we do not need to use fstat64() here on 32-bit platforms, [druzus] */
|
||||
struct stat st;
|
||||
|
||||
if( fstat( hFileHandle, &st ) == 0 )
|
||||
@@ -4270,7 +4247,7 @@ HB_BOOL hb_fsGetCWD( char * pszBuffer, HB_SIZE nSize )
|
||||
{
|
||||
HB_BOOL fResult;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsGetCWD(%p,%" HB_PFS "u)", pszBuffer, nSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsGetCWD(%p,%" HB_PFS "u)", ( void * ) pszBuffer, nSize ) );
|
||||
|
||||
pszBuffer[ 0 ] = '\0';
|
||||
|
||||
@@ -4621,7 +4598,7 @@ HB_BOOL hb_fsIsDevice( HB_FHANDLE hFileHandle )
|
||||
return fResult;
|
||||
}
|
||||
|
||||
/* convert file name for hb_fsExtOpen
|
||||
/* convert file name for hb_fsExtOpen()
|
||||
* caller must free the returned buffer
|
||||
*/
|
||||
char * hb_fsExtName( const char * pszFileName, const char * pDefExt,
|
||||
@@ -4707,7 +4684,7 @@ HB_FHANDLE hb_fsExtOpen( const char * pszFileName, const char * pDefExt,
|
||||
const char * szPath;
|
||||
char * szFree = NULL;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsExtOpen(%s, %s, %u, %p, %p)", pszFileName, pDefExt, nExFlags, pPaths, pError ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsExtOpen(%s, %s, %u, %p, %p)", pszFileName, pDefExt, nExFlags, ( const void * ) pPaths, ( void * ) pError ) );
|
||||
|
||||
#if 0
|
||||
#define FXO_TRUNCATE 0x0100 /* Create (truncate if exists) */
|
||||
@@ -4868,8 +4845,8 @@ const char * hb_fsNameConv( const char * pszFileName, char ** pszFree )
|
||||
|
||||
/*
|
||||
Convert file and dir case. The allowed SET options are:
|
||||
LOWER - Convert all caracters of file to lower
|
||||
UPPER - Convert all caracters of file to upper
|
||||
LOWER - Convert all characters of file to lower
|
||||
UPPER - Convert all characters of file to upper
|
||||
MIXED - Leave as is
|
||||
|
||||
The allowed environment options are:
|
||||
@@ -5012,8 +4989,8 @@ HB_WCHAR * hb_fsNameConvU16( const char * pszFileName )
|
||||
|
||||
/*
|
||||
Convert file and dir case. The allowed SET options are:
|
||||
LOWER - Convert all caracters of file to lower
|
||||
UPPER - Convert all caracters of file to upper
|
||||
LOWER - Convert all characters of file to lower
|
||||
UPPER - Convert all characters of file to upper
|
||||
MIXED - Leave as is
|
||||
|
||||
The allowed environment options are:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Memory() function.
|
||||
* Memory() function
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
*
|
||||
|
||||
@@ -53,19 +53,19 @@ HB_BOOL hb_fsCopy( const char * pszSource, const char * pszDest )
|
||||
{
|
||||
HB_BOOL fResult = HB_FALSE;
|
||||
PHB_FILE pSrcFile;
|
||||
PHB_FILE pDstFile;
|
||||
|
||||
if( ( pSrcFile = hb_fileExtOpen( pszSource, NULL, FO_READ | FO_SHARED | FXO_SHARELOCK, NULL, NULL ) ) != NULL )
|
||||
{
|
||||
PHB_FILE pDstFile;
|
||||
HB_ERRCODE errCode;
|
||||
|
||||
if( ( pDstFile = hb_fileExtOpen( pszDest, NULL, FXO_TRUNCATE | FO_READWRITE | FO_EXCLUSIVE | FXO_SHARELOCK, NULL, NULL ) ) != NULL )
|
||||
{
|
||||
HB_SIZE nBytesRead;
|
||||
void * pbyBuffer = hb_xgrab( HB_FSCOPY_BUFFERSIZE );
|
||||
|
||||
for( ;; )
|
||||
{
|
||||
HB_SIZE nBytesRead;
|
||||
if( ( nBytesRead = hb_fileRead( pSrcFile, pbyBuffer, HB_FSCOPY_BUFFERSIZE, -1 ) ) > 0 &&
|
||||
nBytesRead != ( HB_SIZE ) FS_ERROR )
|
||||
{
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
*
|
||||
* Error code translations
|
||||
*
|
||||
* Copyright 2003 Przemyslaw Czerpak <druzus@acn.waw.pl>
|
||||
*
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* hb_FSize() function
|
||||
* hb_fsFSize() function
|
||||
*
|
||||
* Copyright 2000-2001 Jose Lalin <dezac@corevia.com>
|
||||
* Copyright 2000-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
@@ -68,8 +68,8 @@
|
||||
#if defined( __USE_LARGEFILE64 )
|
||||
/*
|
||||
* The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is
|
||||
* defined and effectively enables lseek64/flock64/ftruncate64 functions
|
||||
* on 32bit machines.
|
||||
* defined and effectively enables lseek64()/flock64()/ftruncate64()
|
||||
* functions on 32-bit machines.
|
||||
*/
|
||||
#define HB_USE_LARGEFILE64
|
||||
#elif defined( HB_OS_UNIX ) && defined( O_LARGEFILE )
|
||||
@@ -170,6 +170,7 @@ HB_FOFFSET hb_fsFSize( const char * pszFileName, HB_BOOL bUseDirEntry )
|
||||
return nPos;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -177,5 +178,5 @@ HB_FUNC( HB_FSIZE )
|
||||
{
|
||||
const char * pszFile = hb_parc( 1 );
|
||||
|
||||
hb_retnint( pszFile ? hb_fsFSize( pszFile, hb_parldef( 2, 1 ) ) : 0 );
|
||||
hb_retnint( pszFile ? hb_fsFSize( pszFile, hb_parldef( 2, HB_TRUE ) ) : 0 );
|
||||
}
|
||||
|
||||
@@ -88,8 +88,8 @@
|
||||
#if defined( __USE_LARGEFILE64 )
|
||||
/*
|
||||
* The macro: __USE_LARGEFILE64 is set when _LARGEFILE64_SOURCE is
|
||||
* defined and effectively enables lseek64/flock64/ftruncate64 functions
|
||||
* on 32bit machines.
|
||||
* defined and effectively enables lseek64()/flock64()/ftruncate64()
|
||||
* functions on 32-bit machines.
|
||||
*/
|
||||
#define HB_USE_LARGEFILE64
|
||||
#elif defined( HB_OS_UNIX ) && defined( O_LARGEFILE ) && ! defined( __WATCOMC__ )
|
||||
@@ -101,10 +101,11 @@
|
||||
static HB_BOOL fsGetTempDirByCase( char * pszName, const char * pszTempDir, HB_BOOL fTrans )
|
||||
{
|
||||
HB_BOOL fOK = HB_FALSE;
|
||||
char * pTmp;
|
||||
|
||||
if( pszTempDir && *pszTempDir != '\0' )
|
||||
{
|
||||
char * pTmp;
|
||||
|
||||
if( fTrans )
|
||||
hb_osStrDecode2( pszTempDir, pszName, HB_PATH_MAX - 1 );
|
||||
else
|
||||
@@ -214,11 +215,12 @@ HB_FHANDLE hb_fsCreateTempEx( char * pszName, const char * pszDir, const char *
|
||||
else
|
||||
#endif /* HB_HAS_MKSTEMP */
|
||||
{
|
||||
int i, n;
|
||||
int i;
|
||||
double d = hb_random_num(), x;
|
||||
|
||||
for( i = 0; i < 6; i++ )
|
||||
{
|
||||
int n;
|
||||
d = d * 36;
|
||||
n = ( int ) d;
|
||||
d = modf( d, &x );
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* GetEnv(), GetE() functions
|
||||
*
|
||||
* Copyright 1999 Matthew Hamilton <mhamilton@bunge.com.au>
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour) (GetE())
|
||||
*
|
||||
* 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
|
||||
@@ -44,16 +45,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* GetE()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapiitm.h"
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* GET system active getlist handler for default HBGETLIST/GETSYS/READVAR
|
||||
* GET system active GetList handler for default HBGetList()/GetSys/ReadVar()
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
*
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
* GET system module (default)
|
||||
*
|
||||
* Copyright 1999-2001 Antonio Linares <alinares@fivetech.com>
|
||||
* Copyright 2001 Luiz Rafael Culik (Support for CA-Cl*pper 5.3 GET-system)
|
||||
*
|
||||
* 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
|
||||
@@ -44,18 +45,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 2001 Luiz Rafael Culik
|
||||
* Support for CA-Cl*pper 5.3 Getsystem
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#ifdef HB_COMPAT_C53
|
||||
|
||||
#include "inkey.ch"
|
||||
|
||||
#define SLUPDATED 1
|
||||
#define SOACTIVEGET 8
|
||||
#define SXREADVAR 9
|
||||
@@ -128,8 +121,8 @@ FUNCTION GetActive( oGet )
|
||||
|
||||
IF oGetList == NIL
|
||||
/* NOTE: For complete compatibility we need to make sure this
|
||||
function works even if there is no active getlist.
|
||||
F.e. when 3rd party software manages getlists on its
|
||||
function works even if there is no active GetList.
|
||||
F.e. when 3rd party software manages GetLists on its
|
||||
own and still uses this function. [vszakats] */
|
||||
IF PCount() > 0
|
||||
oGetActiveOld := t_oGetActive
|
||||
|
||||
@@ -57,7 +57,7 @@ static HB_GT_FUNCS SuperTable;
|
||||
|
||||
static void hb_gt_tpl_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFilenoStdout, HB_FHANDLE hFilenoStderr )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Init(%p,%p,%p,%p)", pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Init(%p,%p,%p,%p)", ( void * ) pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
|
||||
/* TODO: */
|
||||
|
||||
@@ -66,7 +66,7 @@ static void hb_gt_tpl_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
|
||||
static void hb_gt_tpl_Exit( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Exit(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Exit(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSUPER_EXIT( pGT );
|
||||
|
||||
@@ -76,7 +76,7 @@ static void hb_gt_tpl_Exit( PHB_GT pGT )
|
||||
|
||||
static int hb_gt_tpl_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_ReadKey(%p,%d)", pGT, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_ReadKey(%p,%d)", ( void * ) pGT, iEventMask ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
HB_SYMBOL_UNUSED( iEventMask );
|
||||
@@ -89,19 +89,19 @@ static int hb_gt_tpl_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
|
||||
static const char * hb_gt_tpl_Version( PHB_GT pGT, int iType )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Version(%p,%d)", pGT, iType ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Version(%p,%d)", ( void * ) pGT, iType ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
if( iType == 0 )
|
||||
return HB_GT_DRVNAME( HB_GT_NAME );
|
||||
|
||||
return "Harbour Terminal: (template)";
|
||||
return "Terminal: (template)";
|
||||
}
|
||||
|
||||
static HB_BOOL hb_gt_tpl_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_SetMode(%p,%d,%d)", pGT, iRows, iCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_SetMode(%p,%d,%d)", ( void * ) pGT, iRows, iCols ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
HB_SYMBOL_UNUSED( iRows );
|
||||
@@ -118,7 +118,7 @@ static void hb_gt_tpl_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
HB_BYTE bAttr;
|
||||
HB_USHORT usChar;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Redraw(%p,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iSize ) );
|
||||
|
||||
while( iSize-- )
|
||||
{
|
||||
@@ -133,7 +133,7 @@ static void hb_gt_tpl_Refresh( PHB_GT pGT )
|
||||
{
|
||||
int iRow, iCol, iStyle;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Refresh(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_tpl_Refresh(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSUPER_REFRESH( pGT );
|
||||
HB_GTSELF_GETSCRCURSOR( pGT, &iRow, &iCol, &iStyle );
|
||||
@@ -146,7 +146,7 @@ static void hb_gt_tpl_Refresh( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", pFuncTable ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", ( void * ) pFuncTable ) );
|
||||
|
||||
pFuncTable->Init = hb_gt_tpl_Init;
|
||||
pFuncTable->Exit = hb_gt_tpl_Exit;
|
||||
|
||||
193
src/rtl/gtapi.c
193
src/rtl/gtapi.c
@@ -2,6 +2,17 @@
|
||||
* The Terminal API
|
||||
*
|
||||
* Copyright 1999 Bil Simser <bsimser@home.com>
|
||||
* Copyright 1999 Paul Tucker <ptucker@sympatico.ca>
|
||||
* hb_gtInit(), hb_gtExit()
|
||||
* hb_gtDispBegin(), hb_gtDispEnd()
|
||||
* hb_gtPreExt(), hb_gtPostExt()
|
||||
* hb_gtGetColorStr(), hb_gtSetColorStr(), hb_gtSetMode()
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_gtDrawShadow()
|
||||
* Copyright 2006 Przemyslaw Czerpak < druzus /at/ priv.onet.pl >
|
||||
* The body of these functions which were usable in new GT API
|
||||
* have been moved to hbgtcore.c to hb_gt_def_*() functions
|
||||
* some of my modifications.
|
||||
*
|
||||
* 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
|
||||
@@ -44,32 +55,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999 Paul Tucker <ptucker@sympatico.ca>
|
||||
* hb_gtInit()
|
||||
* hb_gtExit()
|
||||
* hb_gtDispBegin()
|
||||
* hb_gtDispEnd()
|
||||
* hb_gtPreExt()
|
||||
* hb_gtPostExt()
|
||||
* hb_gtGetColorStr()
|
||||
* hb_gtSetColorStr()
|
||||
* hb_gtSetMode()
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_gtDrawShadow()
|
||||
*
|
||||
* Copyright 2006 Przemyslaw Czerpak < druzus /at/ priv.onet.pl >
|
||||
* The body of these functions which were usable in new GT API
|
||||
* have been moved to hbgtcore.c to hb_gt_def_*() functions
|
||||
* some of my modificaations.
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbgtcore.h"
|
||||
#include "hbset.h"
|
||||
|
||||
@@ -162,7 +147,7 @@ HB_ERRCODE hb_gtBox( int iTop, int iLeft, int iBottom, int iRight, const char *
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtBox(%d, %d, %d, %d, %p)", iTop, iLeft, iBottom, iRight, szFrame ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtBox(%d, %d, %d, %d, %p)", iTop, iLeft, iBottom, iRight, ( const void * ) szFrame ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -176,6 +161,26 @@ HB_ERRCODE hb_gtBox( int iTop, int iLeft, int iBottom, int iRight, const char *
|
||||
return HB_FAILURE;
|
||||
}
|
||||
|
||||
HB_ERRCODE hb_gtBoxEx( int iTop, int iLeft, int iBottom, int iRight, const char * szFrame, int iColor )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtBoxEx(%d, %d, %d, %d, %p, %d)", iTop, iLeft, iBottom, iRight, ( const void * ) szFrame, iColor ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
{
|
||||
if( iColor == -1 )
|
||||
iColor = HB_GTSELF_GETCOLOR( pGT );
|
||||
HB_GTSELF_BOX( pGT, iTop, iLeft, iBottom, iRight, szFrame, iColor );
|
||||
HB_GTSELF_SETPOS( pGT, iTop + 1, iLeft + 1 );
|
||||
HB_GTSELF_FLUSH( pGT );
|
||||
hb_gt_BaseFree( pGT );
|
||||
return HB_SUCCESS;
|
||||
}
|
||||
return HB_FAILURE;
|
||||
}
|
||||
|
||||
HB_ERRCODE hb_gtBoxD( int iTop, int iLeft, int iBottom, int iRight )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
@@ -216,7 +221,7 @@ HB_ERRCODE hb_gtDrawBox( int iTop, int iLeft, int iBottom, int iRight, const cha
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtDrawBox(%d, %d, %d, %d, %p, %d)", iTop, iLeft, iBottom, iRight, szFrame, iColor ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtDrawBox(%d, %d, %d, %d, %p, %d)", iTop, iLeft, iBottom, iRight, ( const void * ) szFrame, iColor ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -373,7 +378,7 @@ HB_ERRCODE hb_gtColorsToString( int * pColors, int iColorCount, char * pszColorS
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtColorsToString(%p, %d, %p, %d)", pColors, iColorCount, pszColorString, iBufSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtColorsToString(%p, %d, %p, %d)", ( void * ) pColors, iColorCount, ( void * ) pszColorString, iBufSize ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -406,7 +411,7 @@ HB_ERRCODE hb_gtGetCursor( int * piCursorStyle )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtGetCursor(%p)", piCursorStyle ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtGetCursor(%p)", ( void * ) piCursorStyle ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -440,7 +445,24 @@ HB_ERRCODE hb_gtGetPos( int * piRow, int * piCol )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtGetPos(%p, %p)", piRow, piCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtGetPos(%p, %p)", ( void * ) piRow, ( void * ) piCol ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
{
|
||||
HB_GTSELF_GETPOS( pGT, piRow, piCol );
|
||||
hb_gt_BaseFree( pGT );
|
||||
return HB_SUCCESS;
|
||||
}
|
||||
*piRow = *piCol = 0;
|
||||
return HB_FAILURE;
|
||||
}
|
||||
|
||||
HB_ERRCODE hb_gtGetPosEx( int * piRow, int * piCol )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtGetPosEx(%p, %p)", ( void * ) piRow, ( void * ) piCol ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -515,7 +537,7 @@ HB_ERRCODE hb_gtScrDim( int * piHeight, int * piWidth )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtScrDim(%p, %p)", piHeight, piWidth ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtScrDim(%p, %p)", ( void * ) piHeight, ( void * ) piWidth ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -548,7 +570,7 @@ HB_ERRCODE hb_gtRectSize( int iTop, int iLeft, int iBottom, int iRight, HB_SIZE
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtRectSize(%d, %d, %d, %d, %p)", iTop, iLeft, iBottom, iRight, pulBuffSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtRectSize(%d, %d, %d, %d, %p)", iTop, iLeft, iBottom, iRight, ( void * ) pulBuffSize ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -633,7 +655,7 @@ HB_ERRCODE hb_gtGetChar( int iRow, int iCol, int * piColor, HB_BYTE * pbAttr, HB
|
||||
HB_ERRCODE errCode = HB_FAILURE;
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtGetChar(%d, %d, %p, %p, %p)", iRow, iCol, piColor, pbAttr, pusChar ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtGetChar(%d, %d, %p, %p, %p)", iRow, iCol, ( void * ) piColor, ( void * ) pbAttr, ( void * ) pusChar ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -701,7 +723,7 @@ HB_ERRCODE hb_gtGetBlink( HB_BOOL * bpBlink )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtGetBlink(%p)", bpBlink ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtGetBlink(%p)", ( void * ) bpBlink ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -752,7 +774,7 @@ HB_ERRCODE hb_gtPutText( int iRow, int iCol,
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtPutText(%d, %d, %p, %" HB_PFS "u, %d)", iRow, iCol, szStr, nLength, iColor ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtPutText(%d, %d, %p, %" HB_PFS "u, %d)", iRow, iCol, ( const void * ) szStr, nLength, iColor ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -773,7 +795,7 @@ HB_ERRCODE hb_gtWriteAt( int iRow, int iCol, const char * szStr, HB_SIZE nLength
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtWriteAt(%d, %d, %p, %" HB_PFS "u)", iRow, iCol, szStr, nLength ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtWriteAt(%d, %d, %p, %" HB_PFS "u)", iRow, iCol, ( const void * ) szStr, nLength ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -790,7 +812,7 @@ HB_ERRCODE hb_gtWrite( const char * szStr, HB_SIZE nLength )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtWrite(%p, %" HB_PFS "u)", szStr, nLength ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtWrite(%p, %" HB_PFS "u)", ( const void * ) szStr, nLength ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -807,7 +829,7 @@ HB_ERRCODE hb_gtWriteCon( const char * szStr, HB_SIZE nLength )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtWriteCon(%p, %" HB_PFS "u)", szStr, nLength ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtWriteCon(%p, %" HB_PFS "u)", ( const void * ) szStr, nLength ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -838,6 +860,29 @@ HB_ERRCODE hb_gtScroll( int iTop, int iLeft, int iBottom, int iRight, int iRows,
|
||||
return HB_FAILURE;
|
||||
}
|
||||
|
||||
HB_ERRCODE hb_gtScrollEx( int iTop, int iLeft, int iBottom, int iRight, int iColor, int iChar, int iRows, int iCols )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtScrollEx(%d, %d, %d, %d, %d, %d, %d, %d)", iTop, iLeft, iBottom, iRight, iColor, iChar, iRows, iCols ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
{
|
||||
if( iColor == -1 )
|
||||
iColor = HB_GTSELF_GETCOLOR( pGT );
|
||||
if( iChar < 0 )
|
||||
iChar = HB_GTSELF_GETCLEARCHAR( pGT );
|
||||
HB_GTSELF_SCROLL( pGT, iTop, iLeft, iBottom, iRight,
|
||||
iColor, ( HB_USHORT ) iChar, iRows, iCols );
|
||||
HB_GTSELF_FLUSH( pGT );
|
||||
hb_gt_BaseFree( pGT );
|
||||
return HB_SUCCESS;
|
||||
}
|
||||
|
||||
return HB_FAILURE;
|
||||
}
|
||||
|
||||
HB_ERRCODE hb_gtScrollUp( int iRows )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtScrollUp(%d)", iRows ) );
|
||||
@@ -961,7 +1006,7 @@ HB_ERRCODE hb_gtOutStd( const char * szStr, HB_SIZE nLen )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtOutStd(%p, %" HB_PFS "u)", szStr, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtOutStd(%p, %" HB_PFS "u)", ( const void * ) szStr, nLen ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -979,7 +1024,7 @@ HB_ERRCODE hb_gtOutErr( const char * szStr, HB_SIZE nLen )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtOutErr(%p, %" HB_PFS "u)", szStr, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtOutErr(%p, %" HB_PFS "u)", ( const void * ) szStr, nLen ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -1064,7 +1109,7 @@ HB_ERRCODE hb_gtInfo( int iType, PHB_GT_INFO pInfo )
|
||||
HB_ERRCODE errCode = HB_FAILURE;
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtInfo(%d, %p)", iType, pInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtInfo(%d, %p)", iType, ( void * ) pInfo ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -1082,7 +1127,7 @@ int hb_gtAlert( PHB_ITEM pMessage, PHB_ITEM pOptions,
|
||||
int iResult = 0;
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtAlert(%p, %p, %d, %d, %f)", pMessage, pOptions, iClrNorm, iClrHigh, dDelay ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtAlert(%p, %p, %d, %d, %f)", ( void * ) pMessage, ( void * ) pOptions, iClrNorm, iClrHigh, dDelay ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -1204,7 +1249,7 @@ HB_ERRCODE hb_gtGetScrChar( int iRow, int iCol, int * piColor, HB_BYTE * pbAttr,
|
||||
HB_ERRCODE errCode = HB_FAILURE;
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtGetScrChar(%d, %d, %p, %p, %p)", iRow, iCol, piColor, pbAttr, pusChar ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtGetScrChar(%d, %d, %p, %p, %p)", iRow, iCol, ( void * ) piColor, ( void * ) pbAttr, ( void * ) pusChar ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
@@ -1249,66 +1294,6 @@ HB_ERRCODE hb_gtFlush( void )
|
||||
return HB_FAILURE;
|
||||
}
|
||||
|
||||
HB_ERRCODE hb_gtGetPosEx( int * piRow, int * piCol )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtGetPosEx(%p, %p)", piRow, piCol ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
{
|
||||
HB_GTSELF_GETPOS( pGT, piRow, piCol );
|
||||
hb_gt_BaseFree( pGT );
|
||||
return HB_SUCCESS;
|
||||
}
|
||||
*piRow = *piCol = 0;
|
||||
return HB_FAILURE;
|
||||
}
|
||||
|
||||
HB_ERRCODE hb_gtScrollEx( int iTop, int iLeft, int iBottom, int iRight, int iColor, int iChar, int iRows, int iCols )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtScrollEx(%d, %d, %d, %d, %d, %d, %d, %d)", iTop, iLeft, iBottom, iRight, iColor, iChar, iRows, iCols ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
{
|
||||
if( iColor == -1 )
|
||||
iColor = HB_GTSELF_GETCOLOR( pGT );
|
||||
if( iChar < 0 )
|
||||
iChar = HB_GTSELF_GETCLEARCHAR( pGT );
|
||||
HB_GTSELF_SCROLL( pGT, iTop, iLeft, iBottom, iRight,
|
||||
iColor, ( HB_USHORT ) iChar, iRows, iCols );
|
||||
HB_GTSELF_FLUSH( pGT );
|
||||
hb_gt_BaseFree( pGT );
|
||||
return HB_SUCCESS;
|
||||
}
|
||||
|
||||
return HB_FAILURE;
|
||||
}
|
||||
|
||||
HB_ERRCODE hb_gtBoxEx( int iTop, int iLeft, int iBottom, int iRight, const char * szFrame, int iColor )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gtBoxEx(%d, %d, %d, %d, %p, %d)", iTop, iLeft, iBottom, iRight, szFrame, iColor ) );
|
||||
|
||||
pGT = hb_gt_Base();
|
||||
if( pGT )
|
||||
{
|
||||
if( iColor == -1 )
|
||||
iColor = HB_GTSELF_GETCOLOR( pGT );
|
||||
HB_GTSELF_BOX( pGT, iTop, iLeft, iBottom, iRight, szFrame, iColor );
|
||||
HB_GTSELF_SETPOS( pGT, iTop + 1, iLeft + 1 );
|
||||
HB_GTSELF_FLUSH( pGT );
|
||||
hb_gt_BaseFree( pGT );
|
||||
return HB_SUCCESS;
|
||||
}
|
||||
return HB_FAILURE;
|
||||
}
|
||||
|
||||
int hb_gtGfxPrimitive( int iType, int iTop, int iLeft, int iBottom, int iRight, int iColor )
|
||||
{
|
||||
PHB_GT pGT;
|
||||
|
||||
@@ -100,7 +100,7 @@ HB_BOOL hb_gtWVis( HB_GT_WND * wnd, HB_USHORT iStatus ) /* USHORT in CA-Cl*pper
|
||||
return HB_FALSE;
|
||||
}
|
||||
|
||||
HB_ERRCODE hb_gtSLR( HB_GT_SLR * pSLR ) /* System Level Request */
|
||||
HB_ERRCODE hb_gtSLR( HB_GT_SLR * pSLR ) /* System-Level Request */
|
||||
{
|
||||
/* Do nothing in Harbour, since the low-level GT API is
|
||||
implemented with a different method than in CA-Cl*pper. */
|
||||
|
||||
@@ -105,7 +105,7 @@ static void hb_gt_cgi_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
{
|
||||
PHB_GTCGI pGTCGI;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Init(%p,%p,%p,%p)", pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Init(%p,%p,%p,%p)", ( void * ) pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
|
||||
HB_GTLOCAL( pGT ) = pGTCGI = ( PHB_GTCGI ) hb_xgrabz( sizeof( HB_GTCGI ) );
|
||||
|
||||
@@ -124,7 +124,7 @@ static void hb_gt_cgi_Exit( PHB_GT pGT )
|
||||
{
|
||||
PHB_GTCGI pGTCGI;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Exit(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Exit(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSELF_REFRESH( pGT );
|
||||
|
||||
@@ -150,7 +150,7 @@ static void hb_gt_cgi_Exit( PHB_GT pGT )
|
||||
|
||||
static int hb_gt_cgi_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_ReadKey(%p,%d)", pGT, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_ReadKey(%p,%d)", ( void * ) pGT, iEventMask ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
HB_SYMBOL_UNUSED( iEventMask );
|
||||
@@ -160,7 +160,7 @@ static int hb_gt_cgi_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
|
||||
static HB_BOOL hb_gt_cgi_IsColor( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_IsColor(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_IsColor(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -172,7 +172,7 @@ static void hb_gt_cgi_Bell( PHB_GT pGT )
|
||||
static const char s_szBell[] = { HB_CHAR_BEL, 0 };
|
||||
PHB_GTCGI pGTCGI;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Bell(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Bell(%p)", ( void * ) pGT ) );
|
||||
|
||||
pGTCGI = HB_GTCGI_GET( pGT );
|
||||
|
||||
@@ -181,7 +181,7 @@ static void hb_gt_cgi_Bell( PHB_GT pGT )
|
||||
|
||||
static const char * hb_gt_cgi_Version( PHB_GT pGT, int iType )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Version(%p,%d)", pGT, iType ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Version(%p,%d)", ( void * ) pGT, iType ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -196,7 +196,7 @@ static void hb_gt_cgi_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int
|
||||
{
|
||||
int iHeight, iWidth;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Scroll(%p,%d,%d,%d,%d,%d,%d,%d,%d)", pGT, iTop, iLeft, iBottom, iRight, iColor, usChar, iRows, iCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Scroll(%p,%d,%d,%d,%d,%d,%d,%d,%d)", ( void * ) pGT, iTop, iLeft, iBottom, iRight, iColor, usChar, iRows, iCols ) );
|
||||
|
||||
/* Provide some basic scroll support for full screen */
|
||||
HB_GTSELF_GETSIZE( pGT, &iHeight, &iWidth );
|
||||
@@ -342,7 +342,7 @@ static void hb_gt_cgi_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
int iLineFeed, iHeight, iWidth, iLen;
|
||||
PHB_GTCGI pGTCGI;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Redraw(%p,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iSize ) );
|
||||
|
||||
pGTCGI = HB_GTCGI_GET( pGT );
|
||||
HB_GTSELF_GETSIZE( pGT, &iHeight, &iWidth );
|
||||
@@ -407,7 +407,7 @@ static void hb_gt_cgi_Refresh( PHB_GT pGT )
|
||||
int iHeight, iWidth;
|
||||
PHB_GTCGI pGTCGI;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Refresh(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_cgi_Refresh(%p)", ( void * ) pGT ) );
|
||||
|
||||
pGTCGI = HB_GTCGI_GET( pGT );
|
||||
HB_GTSELF_GETSIZE( pGT, &iHeight, &iWidth );
|
||||
@@ -426,7 +426,7 @@ static void hb_gt_cgi_Refresh( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", pFuncTable ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", ( void * ) pFuncTable ) );
|
||||
|
||||
pFuncTable->Init = hb_gt_cgi_Init;
|
||||
pFuncTable->Exit = hb_gt_cgi_Exit;
|
||||
|
||||
@@ -12,13 +12,13 @@
|
||||
*
|
||||
* 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
|
||||
* 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.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site https://www.gnu.org/).
|
||||
* along with this program; see the file LICENSE.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
@@ -36,7 +36,7 @@
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
@@ -48,6 +48,8 @@
|
||||
|
||||
/* NOTE: User programs should never call this layer directly! */
|
||||
|
||||
/* TODO: use Harbour FS API */
|
||||
|
||||
#include "hbgtcore.h"
|
||||
#include "hbapifs.h"
|
||||
|
||||
@@ -192,7 +194,7 @@ static int get_val( char ** buf )
|
||||
|
||||
static int parse_line( char * buf, int * from, int * to, char * op, int * val, int * mod )
|
||||
{
|
||||
char *s, *s2;
|
||||
char *s;
|
||||
int ret = 0, ina = 0;
|
||||
|
||||
s = buf;
|
||||
@@ -223,6 +225,7 @@ static int parse_line( char * buf, int * from, int * to, char * op, int * val, i
|
||||
|
||||
if( *s == '@' )
|
||||
{
|
||||
char *s2;
|
||||
++s;
|
||||
s2 = buf;
|
||||
while( *s != '\0' && *s != ' ' )
|
||||
@@ -412,13 +415,13 @@ int hb_gt_chrmapinit( int * piTransTbl, const char * pszTerm, HB_BOOL fSetACSC )
|
||||
|
||||
if( pszTerm != NULL && *pszTerm != '\0' )
|
||||
{
|
||||
char szFile[ HB_PATH_MAX ];
|
||||
char * pszFile = hb_getenv( "HB_CHARMAP" );
|
||||
|
||||
if( pszFile != NULL && *pszFile != '\0' )
|
||||
nRet = hb_gt_chrmapread( pszFile, pszTerm, piTransTbl );
|
||||
if( nRet == -1 )
|
||||
{
|
||||
char szFile[ HB_PATH_MAX ];
|
||||
if( pszFile )
|
||||
hb_xfree( pszFile );
|
||||
pszFile = hb_getenv( "HB_ROOT" );
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Low level ClipBoard code common to some GT drivers
|
||||
* Low-level ClipBoard code common to some GT drivers
|
||||
*
|
||||
* Copyright 2006 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
*
|
||||
* 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
|
||||
* 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.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site https://www.gnu.org/).
|
||||
* along with this program; see the file LICENSE.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
@@ -34,7 +34,7 @@
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
@@ -89,7 +89,7 @@ typedef struct
|
||||
int rbdn_row, rbdn_col;
|
||||
int mbup_row, mbup_col;
|
||||
int mbdn_row, mbdn_col;
|
||||
/* to analize DBLCLK on xterm */
|
||||
/* to analyze DBLCLK on xterm */
|
||||
int click_delay;
|
||||
struct timeval BL_time;
|
||||
struct timeval BR_time;
|
||||
@@ -179,7 +179,7 @@ static void curs_wrkaround( void );
|
||||
|
||||
static int getClipKey( int nKey )
|
||||
{
|
||||
int nRet = 0, nFlag, n;
|
||||
int nRet = 0;
|
||||
|
||||
if( IS_CLIPKEY( nKey ) )
|
||||
nRet = GET_CLIPKEY( nKey );
|
||||
@@ -187,9 +187,9 @@ static int getClipKey( int nKey )
|
||||
nRet = nKey;
|
||||
else
|
||||
{
|
||||
n = GET_KEYMASK( nKey );
|
||||
int nFlag = 0;
|
||||
int n = GET_KEYMASK( nKey );
|
||||
nKey = CLR_KEYMASK( nKey );
|
||||
nFlag = 0;
|
||||
if( n & KEY_SHIFTMASK )
|
||||
nFlag |= HB_KF_SHIFT;
|
||||
if( n & KEY_CTRLMASK )
|
||||
@@ -447,10 +447,10 @@ static void del_efds( InOutBase * ioBase, int fd )
|
||||
|
||||
static void del_all_efds( InOutBase * ioBase )
|
||||
{
|
||||
int i;
|
||||
|
||||
if( ioBase->event_fds != NULL )
|
||||
{
|
||||
int i;
|
||||
|
||||
for( i = 0; i < ioBase->efds_no; i++ )
|
||||
hb_xfree( ioBase->event_fds[ i ] );
|
||||
|
||||
@@ -728,7 +728,7 @@ static void mouse_init( InOutBase * ioBase )
|
||||
GPM_MOVE | GPM_DRAG | GPM_UP | GPM_DOWN | GPM_SINGLE | GPM_DOUBLE;
|
||||
/* give me move events but handle them anyway */
|
||||
ioBase->Conn.defaultMask = GPM_MOVE | GPM_HARD;
|
||||
/* only pure mouse events, no Ctrl,Alt,Shft events */
|
||||
/* only pure mouse events, no Ctrl,Alt,Shift events */
|
||||
ioBase->Conn.minMod = 0;
|
||||
ioBase->Conn.maxMod = ( ( 1 << KG_SHIFT ) | ( 1 << KG_CTRL ) | ( 1 << KG_ALT ) );
|
||||
gpm_zerobased = 1;
|
||||
@@ -1172,7 +1172,7 @@ static void disp_cursor( InOutBase * ioBase )
|
||||
if( ioBase->cursor != ioBase->lcursor )
|
||||
{
|
||||
int lcurs = -1;
|
||||
char escseq[ 64 ], * cv = NULL;
|
||||
char * cv = NULL;
|
||||
|
||||
switch( ioBase->cursor )
|
||||
{
|
||||
@@ -1206,6 +1206,7 @@ static void disp_cursor( InOutBase * ioBase )
|
||||
{
|
||||
if( ioBase->terminal_type == TERM_LINUX )
|
||||
{
|
||||
char escseq[ 64 ];
|
||||
hb_snprintf( escseq, sizeof( escseq ), "\033[?25%c\033[?%dc",
|
||||
ioBase->cursor == SC_NONE ? 'l' : 'h', lcurs );
|
||||
write_ttyseq( ioBase, escseq );
|
||||
@@ -1269,16 +1270,17 @@ static void gt_ttyrestore( InOutBase * ioBase )
|
||||
static HB_BOOL gt_outstr( InOutBase * ioBase, int fd, const char * str,
|
||||
int len )
|
||||
{
|
||||
unsigned char * buf, c;
|
||||
int i;
|
||||
HB_BOOL success;
|
||||
|
||||
if( ioBase->out_transtbl != NULL )
|
||||
{
|
||||
unsigned char * buf;
|
||||
int i;
|
||||
|
||||
buf = ( unsigned char * ) hb_xgrab( len );
|
||||
for( i = 0; i < len; ++i )
|
||||
{
|
||||
c = str[ i ];
|
||||
unsigned char c = str[ i ];
|
||||
if( c != 9 && c != 10 && c != 13 && ioBase->out_transtbl[ c ] )
|
||||
buf[ i ] = ioBase->out_transtbl[ c ];
|
||||
else
|
||||
@@ -1569,10 +1571,9 @@ static void init_keys( InOutBase * ioBase )
|
||||
|
||||
static void gt_tone( InOutBase * ioBase, double dFrequency, double dDuration )
|
||||
{
|
||||
char escseq[ 64 ];
|
||||
|
||||
if( ioBase->terminal_type == TERM_LINUX && ioBase->beep != NULL )
|
||||
{
|
||||
char escseq[ 64 ];
|
||||
hb_snprintf( escseq, sizeof( escseq ), "\033[10;%d]\033[11;%d]%s",
|
||||
( int ) dFrequency,
|
||||
( int ) ( dDuration * 1000.0 / 18.2 ), ioBase->beep );
|
||||
@@ -1591,7 +1592,6 @@ static void set_sig_keys( InOutBase * ioBase, int key_int, int key_brk,
|
||||
{
|
||||
if( isatty( ioBase->base_infd ) )
|
||||
{
|
||||
|
||||
/* set SIGINT character, default ^C */
|
||||
if( key_int >= 0 && key_int <= 255 )
|
||||
ioBase->curr_TIO.c_cc[ VINTR ] = key_int;
|
||||
@@ -1604,7 +1604,7 @@ static void set_sig_keys( InOutBase * ioBase, int key_int, int key_brk,
|
||||
if( key_stp >= 0 && key_stp <= 255 )
|
||||
ioBase->curr_TIO.c_cc[ VSUSP ] = key_stp;
|
||||
|
||||
/* enable siganls from terminal device */
|
||||
/* enable signals from terminal device */
|
||||
if( ioBase->curr_TIO.c_cc[ VINTR ] != 0 ||
|
||||
ioBase->curr_TIO.c_cc[ VQUIT ] != 0 ||
|
||||
ioBase->curr_TIO.c_cc[ VSUSP ] != 0 )
|
||||
@@ -1680,11 +1680,12 @@ static int gt_resize( InOutBase * ioBase )
|
||||
|
||||
static int gt_setsize( InOutBase * ioBase, int rows, int cols )
|
||||
{
|
||||
int ret = -1, r, c;
|
||||
char escseq[ 64 ];
|
||||
int ret = -1;
|
||||
|
||||
if( ioBase->terminal_type == TERM_XTERM )
|
||||
{
|
||||
int r, c;
|
||||
char escseq[ 64 ];
|
||||
hb_snprintf( escseq, sizeof( escseq ), "\033[8;%d;%dt", rows, cols );
|
||||
write_ttyseq( ioBase, escseq );
|
||||
/* dirty hack - wait for SIGWINCH */
|
||||
@@ -1717,10 +1718,10 @@ static int gt_setsize( InOutBase * ioBase, int rows, int cols )
|
||||
|
||||
static void setKeyTrans( InOutBase * ioBase, PHB_CODEPAGE cdpTerm, PHB_CODEPAGE cdpHost )
|
||||
{
|
||||
int i;
|
||||
|
||||
if( cdpTerm && cdpHost && cdpTerm != cdpHost )
|
||||
{
|
||||
int i;
|
||||
|
||||
if( ioBase->in_transtbl == NULL )
|
||||
ioBase->in_transtbl = ( unsigned char * ) hb_xgrab( 256 );
|
||||
|
||||
@@ -1737,13 +1738,12 @@ static void setKeyTrans( InOutBase * ioBase, PHB_CODEPAGE cdpTerm, PHB_CODEPAGE
|
||||
static void setDispTrans( InOutBase * ioBase, PHB_CODEPAGE cdpHost, PHB_CODEPAGE cdpTerm, int transBox )
|
||||
{
|
||||
int i, aSet;
|
||||
chtype ch;
|
||||
|
||||
aSet = ( cdpHost && cdpTerm );
|
||||
|
||||
for( i = 0; i < 256; i++ )
|
||||
{
|
||||
ch = ioBase->charmap[ i ] & 0xffff;
|
||||
chtype ch = ioBase->charmap[ i ] & 0xffff;
|
||||
switch( ( ioBase->charmap[ i ] >> 16 ) & 0xff )
|
||||
{
|
||||
case 1:
|
||||
@@ -1808,7 +1808,7 @@ static InOutBase * create_ioBase( char * term, int infd, int outfd, int errfd,
|
||||
{
|
||||
InOutBase * ioBase;
|
||||
int bg, fg;
|
||||
unsigned int i, n;
|
||||
unsigned int i;
|
||||
char buf[ 256 ], * ptr, * crsterm = NULL;
|
||||
|
||||
ioBase = ( InOutBase * ) hb_xgrabz( sizeof( InOutBase ) );
|
||||
@@ -1872,13 +1872,13 @@ static InOutBase * create_ioBase( char * term, int infd, int outfd, int errfd,
|
||||
memset( ioBase->curr_TIO.c_cc, 0, NCCS );
|
||||
|
||||
/* workaround for bug in some Linux kernels (i.e. 3.13.0-64-generic
|
||||
Ubuntu) in which select() unconditionally accepts stdin for
|
||||
*buntu) in which select() unconditionally accepts stdin for
|
||||
reading if c_cc[ VMIN ] = 0 [druzus] */
|
||||
ioBase->curr_TIO.c_cc[ VMIN ] = 1;
|
||||
}
|
||||
|
||||
|
||||
/* curses SCREEN initialisation */
|
||||
/* curses SCREEN initialization */
|
||||
if( ioBase->base_infd == fileno( stdin ) )
|
||||
ioBase->basein = stdin;
|
||||
else
|
||||
@@ -1922,7 +1922,7 @@ static InOutBase * create_ioBase( char * term, int infd, int outfd, int errfd,
|
||||
ioBase->attr_mask = ( chtype ) -1;
|
||||
if( has_colors() )
|
||||
{
|
||||
/* DOS->CURSES color maping
|
||||
/* DOS->CURSES color mapping
|
||||
DOS -> curses
|
||||
--------------------------------
|
||||
0 black -> COLOR_BLACK
|
||||
@@ -1968,8 +1968,9 @@ static InOutBase * create_ioBase( char * term, int infd, int outfd, int errfd,
|
||||
#endif
|
||||
for( i = 0; i < 256; i++ )
|
||||
{
|
||||
unsigned int n;
|
||||
bg = ( i >> 4 ) & 0x07; /* extract background color bits 4-6 */
|
||||
fg = ( i & 0x07 ); /* extract forground color bits 0-2 */
|
||||
fg = ( i & 0x07 ); /* extract foreground color bits 0-2 */
|
||||
n = bg * 8 + fg;
|
||||
/* n = bg * COLORS + fg */
|
||||
if( n == 0 )
|
||||
@@ -1979,7 +1980,7 @@ static InOutBase * create_ioBase( char * term, int infd, int outfd, int errfd,
|
||||
if( ( i & 0x88 ) == 0 )
|
||||
init_pair( n, color_map[ fg ], color_map[ bg ] );
|
||||
ioBase->attr_map[ i ] = COLOR_PAIR( n );
|
||||
if( i & 0x08 ) /* highlight forground bit 3 */
|
||||
if( i & 0x08 ) /* highlight foreground bit 3 */
|
||||
ioBase->attr_map[ i ] |= A_BOLD;
|
||||
if( i & 0x80 ) /* blink/highlight background bit 7 */
|
||||
ioBase->attr_map[ i ] |= A_BLINK;
|
||||
@@ -1991,13 +1992,13 @@ static InOutBase * create_ioBase( char * term, int infd, int outfd, int errfd,
|
||||
for( i = 0; i < 256; i++ )
|
||||
{
|
||||
bg = ( i >> 4 ) & 0x07; /* extract background color bits 4-6 */
|
||||
fg = ( i & 0x07 ); /* extract forground color bits 0-2 */
|
||||
fg = ( i & 0x07 ); /* extract foreground color bits 0-2 */
|
||||
ioBase->attr_map[ i ] = 0;
|
||||
if( fg < bg )
|
||||
ioBase->attr_map[ i ] |= A_REVERSE;
|
||||
if( fg == 1 ) /* underline? */
|
||||
ioBase->attr_map[ i ] |= A_UNDERLINE;
|
||||
if( i & 0x08 ) /* highlight forground bit 3 */
|
||||
if( i & 0x08 ) /* highlight foreground bit 3 */
|
||||
ioBase->attr_map[ i ] |= A_BOLD;
|
||||
if( i & 0x80 ) /* blink/highlight background bit 7 */
|
||||
ioBase->attr_map[ i ] |= A_BLINK;
|
||||
@@ -2089,7 +2090,7 @@ static void destroy_ioBase( InOutBase * ioBase )
|
||||
/* restore terminal settings */
|
||||
gt_ttyrestore( ioBase );
|
||||
|
||||
/* kill terminal proces if any */
|
||||
/* kill terminal process if any */
|
||||
if( ioBase->termpid > 0 )
|
||||
{
|
||||
kill( ioBase->termpid, SIGTERM );
|
||||
@@ -2177,7 +2178,7 @@ static int set_active_ioBase( int iNO_ioBase )
|
||||
|
||||
static int add_new_ioBase( InOutBase * ioBase )
|
||||
{
|
||||
int i, n, add = 0;
|
||||
int i, add = 0;
|
||||
|
||||
for( i = 0; i < s_iSize_ioBaseTab && ! add; ++i )
|
||||
if( ! s_ioBaseTab[ i ] )
|
||||
@@ -2188,6 +2189,8 @@ static int add_new_ioBase( InOutBase * ioBase )
|
||||
|
||||
if( ! add )
|
||||
{
|
||||
int n;
|
||||
|
||||
if( s_ioBaseTab == NULL )
|
||||
s_ioBaseTab = ( InOutBase ** ) hb_xgrab(
|
||||
( s_iSize_ioBaseTab += 10 ) * sizeof( InOutBase * ) );
|
||||
@@ -2207,14 +2210,14 @@ static int add_new_ioBase( InOutBase * ioBase )
|
||||
|
||||
static int del_ioBase( int iNO_ioBase )
|
||||
{
|
||||
int i;
|
||||
|
||||
if( iNO_ioBase >= 0 && iNO_ioBase < s_iSize_ioBaseTab )
|
||||
{
|
||||
destroy_ioBase( s_ioBaseTab[ iNO_ioBase ] );
|
||||
s_ioBaseTab[ iNO_ioBase ] = NULL;
|
||||
if( s_iActive_ioBase == iNO_ioBase )
|
||||
{
|
||||
int i;
|
||||
|
||||
s_iActive_ioBase = -1;
|
||||
s_ioBase = NULL;
|
||||
for( i = 0; i < s_iSize_ioBaseTab && ! s_ioBase; ++i )
|
||||
@@ -2228,10 +2231,10 @@ static int del_ioBase( int iNO_ioBase )
|
||||
|
||||
static void del_all_ioBase( void )
|
||||
{
|
||||
int i;
|
||||
|
||||
if( s_ioBaseTab )
|
||||
{
|
||||
int i;
|
||||
|
||||
for( i = 0; i < s_iSize_ioBaseTab; ++i )
|
||||
if( s_ioBaseTab[ i ] )
|
||||
destroy_ioBase( s_ioBaseTab[ i ] );
|
||||
@@ -2341,12 +2344,12 @@ void HB_GT_FUNC( gt_CatchSignal( int iSig ) )
|
||||
|
||||
static void hb_gt_crs_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFilenoStdout, HB_FHANDLE hFilenoStderr )
|
||||
{
|
||||
InOutBase * ioBase;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Init(%p,%p,%p,%p)", pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Init(%p,%p,%p,%p)", ( void * ) pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
|
||||
if( ! s_ioBase )
|
||||
{
|
||||
InOutBase * ioBase;
|
||||
|
||||
s_iStdIn = hFilenoStdin;
|
||||
s_iStdOut = hFilenoStdout;
|
||||
s_iStdErr = hFilenoStderr;
|
||||
@@ -2378,7 +2381,7 @@ static void hb_gt_crs_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
|
||||
static void hb_gt_crs_Exit( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Exit(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Exit(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSUPER_EXIT( pGT );
|
||||
|
||||
@@ -2389,7 +2392,7 @@ static void hb_gt_crs_Exit( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_crs_IsColor( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_IsColor(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_IsColor(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2400,7 +2403,7 @@ static HB_BOOL hb_gt_crs_IsColor( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_crs_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_SetMode(%p,%d,%d)", pGT, iRows, iCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_SetMode(%p,%d,%d)", ( void * ) pGT, iRows, iCols ) );
|
||||
|
||||
if( gt_setsize( s_ioBase, iRows, iCols ) == 0 )
|
||||
{
|
||||
@@ -2415,7 +2418,7 @@ static HB_BOOL hb_gt_crs_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
|
||||
static void hb_gt_crs_SetBlink( PHB_GT pGT, HB_BOOL fBlink )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_SetBlink(%p, %d)", pGT, ( int ) fBlink ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_SetBlink(%p, %d)", ( void * ) pGT, ( int ) fBlink ) );
|
||||
|
||||
if( fBlink )
|
||||
s_ioBase->attr_mask |= A_BLINK;
|
||||
@@ -2429,7 +2432,7 @@ static void hb_gt_crs_SetBlink( PHB_GT pGT, HB_BOOL fBlink )
|
||||
|
||||
static void hb_gt_crs_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Tone(%p,%lf,%lf)", ( void * ) pGT, dFrequency, dDuration ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2444,7 +2447,7 @@ static void hb_gt_crs_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
|
||||
static const char * hb_gt_crs_Version( PHB_GT pGT, int iType )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Version(%p,%d)", pGT, iType ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Version(%p,%d)", ( void * ) pGT, iType ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2491,7 +2494,7 @@ static void hb_gt_crs_OutErr( PHB_GT pGT, const char * szStr, HB_SIZE nLen )
|
||||
|
||||
static HB_BOOL hb_gt_crs_Suspend( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Suspend(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Suspend(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2509,7 +2512,7 @@ static HB_BOOL hb_gt_crs_Suspend( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_crs_Resume( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Resume(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Resume(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2529,7 +2532,7 @@ static HB_BOOL hb_gt_crs_Resume( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_crs_PreExt( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_PreExt(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_PreExt(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2543,7 +2546,7 @@ static HB_BOOL hb_gt_crs_PreExt( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_crs_PostExt( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_PostExt(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_PostExt(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2554,7 +2557,7 @@ static HB_BOOL hb_gt_crs_PostExt( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_crs_mouse_IsPresent( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_IsPresent(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_IsPresent(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2565,7 +2568,7 @@ static HB_BOOL hb_gt_crs_mouse_IsPresent( PHB_GT pGT )
|
||||
|
||||
static void hb_gt_crs_mouse_Show( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_Show(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_Show(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2580,7 +2583,7 @@ static void hb_gt_crs_mouse_Show( PHB_GT pGT )
|
||||
|
||||
static void hb_gt_crs_mouse_Hide( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_Hide(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_Hide(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2594,7 +2597,7 @@ static void hb_gt_crs_mouse_Hide( PHB_GT pGT )
|
||||
|
||||
static void hb_gt_crs_mouse_GetPos( PHB_GT pGT, int * piRow, int * piCol )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_Col(%p,%p,%p)", pGT, piRow, piCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_Col(%p,%p,%p)", ( void * ) pGT, ( void * ) piRow, ( void * ) piCol ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2606,7 +2609,7 @@ static void hb_gt_crs_mouse_GetPos( PHB_GT pGT, int * piRow, int * piCol )
|
||||
|
||||
static void hb_gt_crs_mouse_SetPos( PHB_GT pGT, int iRow, int iCol )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_SetPos(%p,%i,%i)", pGT, iRow, iCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_SetPos(%p,%i,%i)", ( void * ) pGT, iRow, iCol ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2622,7 +2625,7 @@ static HB_BOOL hb_gt_crs_mouse_ButtonState( PHB_GT pGT, int iButton )
|
||||
{
|
||||
HB_BOOL ret = HB_FALSE;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_ButtonState(%p,%i)", pGT, iButton ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_ButtonState(%p,%i)", ( void * ) pGT, iButton ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2649,7 +2652,7 @@ static HB_BOOL hb_gt_crs_mouse_ButtonState( PHB_GT pGT, int iButton )
|
||||
|
||||
static int hb_gt_crs_mouse_CountButton( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_CountButton(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_CountButton(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2658,7 +2661,7 @@ static int hb_gt_crs_mouse_CountButton( PHB_GT pGT )
|
||||
|
||||
static void hb_gt_crs_mouse_SetDoubleClickSpeed( PHB_GT pGT, int iSpeed )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_SetDoubleClickSpeed(%p,%d)", pGT, iSpeed ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_mouse_SetDoubleClickSpeed(%p,%d)", ( void * ) pGT, iSpeed ) );
|
||||
|
||||
HB_GTSUPER_MOUSESETDOUBLECLICKSPEED( pGT, iSpeed );
|
||||
s_ioBase->mLastEvt.click_delay = iSpeed;
|
||||
@@ -2670,7 +2673,7 @@ static int hb_gt_crs_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
{
|
||||
int iKey;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_ReadKey(%p,%d)", pGT, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_ReadKey(%p,%d)", ( void * ) pGT, iEventMask ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( iEventMask );
|
||||
|
||||
@@ -2690,7 +2693,7 @@ static int hb_gt_crs_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
|
||||
static HB_BOOL hb_gt_crs_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char * pszHostCDP, HB_BOOL fBox )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_SetDispCP(%p,%s,%s,%d)", pGT, pszTermCDP, pszHostCDP, ( int ) fBox ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_SetDispCP(%p,%s,%s,%d)", ( void * ) pGT, pszTermCDP, pszHostCDP, ( int ) fBox ) );
|
||||
|
||||
if( HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ) )
|
||||
{
|
||||
@@ -2705,7 +2708,7 @@ static HB_BOOL hb_gt_crs_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const c
|
||||
|
||||
static HB_BOOL hb_gt_crs_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const char * pszHostCDP )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_SetKeyCP(%p,%s,%s)", pGT, pszTermCDP, pszHostCDP ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_SetKeyCP(%p,%s,%s)", ( void * ) pGT, pszTermCDP, pszHostCDP ) );
|
||||
|
||||
if( HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ) )
|
||||
{
|
||||
@@ -2719,7 +2722,7 @@ static HB_BOOL hb_gt_crs_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const ch
|
||||
|
||||
static HB_BOOL hb_gt_crs_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Info(%p,%d,%p)", pGT, iType, pInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Info(%p,%d,%p)", ( void * ) pGT, iType, ( void * ) pInfo ) );
|
||||
|
||||
if( s_ioBase )
|
||||
{
|
||||
@@ -2749,7 +2752,7 @@ static HB_BOOL hb_gt_crs_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
|
||||
static void hb_gt_crs_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Redraw(%p,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iSize ) );
|
||||
|
||||
if( s_ioBase )
|
||||
{
|
||||
@@ -2764,8 +2767,8 @@ static void hb_gt_crs_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
if( ! HB_GTSELF_GETSCRUC( pGT, iRow, iCol++, &iColor, &bAttr, &uc, HB_FALSE ) )
|
||||
break;
|
||||
ch = ( s_ioBase->attr_map[ iColor ] & s_ioBase->attr_mask ) |
|
||||
( bAttr & HB_GT_ATTR_BOX ? s_ioBase->box_chmap[ uc ] :
|
||||
s_ioBase->std_chmap[ uc ] );
|
||||
( ( bAttr & HB_GT_ATTR_BOX ) ? s_ioBase->box_chmap[ uc ] :
|
||||
s_ioBase->std_chmap[ uc ] );
|
||||
waddch( s_ioBase->hb_stdscr, ch );
|
||||
}
|
||||
}
|
||||
@@ -2775,7 +2778,7 @@ static void hb_gt_crs_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
|
||||
static void hb_gt_crs_Refresh( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Refresh(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_crs_Refresh(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSUPER_REFRESH( pGT );
|
||||
if( s_ioBase )
|
||||
@@ -2794,7 +2797,7 @@ static void hb_gt_crs_Refresh( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", pFuncTable ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", ( void * ) pFuncTable ) );
|
||||
|
||||
pFuncTable->Init = hb_gt_crs_Init;
|
||||
pFuncTable->Exit = hb_gt_crs_Exit;
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
*
|
||||
* 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
|
||||
* 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.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site https://www.gnu.org/).
|
||||
* along with this program; see the file LICENSE.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
@@ -34,7 +34,7 @@
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#=============================================================================
|
||||
# Copyright 2003 Przemyslaw Czerpak <druzus@polbox.com>,
|
||||
# See COPYING.txt for licensing terms.
|
||||
# See LICENSE.txt for licensing terms.
|
||||
#=============================================================================
|
||||
# Table Syntax:
|
||||
# <:> terminal[|terminal|terminal...] <space> comment
|
||||
|
||||
@@ -2,6 +2,26 @@
|
||||
* Video subsystem for DOS compilers
|
||||
*
|
||||
* Copyright 1999 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_gt_CtrlBrkHandler()
|
||||
* hb_gt_CtrlBrkRestore()
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* hb_gt_ReadKey()
|
||||
* Copyright 2000 Alejandro de Garate <alex_degarate@hotmail.com>
|
||||
* vmode12x40()
|
||||
* vmode25x40()
|
||||
* vmode28x40()
|
||||
* vmode50x40()
|
||||
* vmode12x80()
|
||||
* vmode25x80()
|
||||
* vmode28x80()
|
||||
* vmode43x80()
|
||||
* vmode50x80()
|
||||
* hb_gt_SetMode()
|
||||
* hb_gt_GetDisplay()
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
* Copyright 1999 Luiz Rafael Culik <Culik@sl.conex.net>
|
||||
* Harbour Mouse Subsystem for DOS
|
||||
*
|
||||
* 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
|
||||
@@ -44,40 +64,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_gt_CtrlBrkHandler()
|
||||
* hb_gt_CtrlBrkRestore()
|
||||
*
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* hb_gt_ReadKey()
|
||||
*
|
||||
* Copyright 2000 Alejandro de Garate <alex_degarate@hotmail.com>
|
||||
* vmode12x40()
|
||||
* vmode25x40()
|
||||
* vmode28x40()
|
||||
* vmode50x40()
|
||||
* vmode12x80()
|
||||
* vmode25x80()
|
||||
* vmode28x80()
|
||||
* vmode43x80()
|
||||
* vmode50x80()
|
||||
* hb_gt_SetMode()
|
||||
* hb_gt_GetDisplay()
|
||||
*
|
||||
* Copyright 1999 Jose Lalin <dezac@corevia.com>
|
||||
* Luiz Rafael Culik <Culik@sl.conex.net>
|
||||
* Harbour Mouse Subsystem for DOS
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This module is based on VIDMGR by Andrew Clarke and modified for Harbour.
|
||||
*/
|
||||
/* This module is based on VIDMGR by Andrew Clarke and modified for Harbour. */
|
||||
|
||||
/* NOTE: User programs should never call this layer directly! */
|
||||
|
||||
@@ -96,8 +83,7 @@
|
||||
#include <conio.h>
|
||||
|
||||
|
||||
/*
|
||||
* use mouse driver save/restore state functions,
|
||||
/* Use mouse driver save/restore state functions,
|
||||
* add other compilers for which calling real mode
|
||||
* interrupts with memory pointer is implemented.
|
||||
*/
|
||||
@@ -264,7 +250,7 @@ static int hb_gt_dos_GetScreenMode( void )
|
||||
|
||||
static void hb_gt_dos_GetScreenSize( int * piRows, int * piCols )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_GetScreenSize(%p, %p)", piRows, piCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_GetScreenSize(%p, %p)", ( void * ) piRows, ( void * ) piCols ) );
|
||||
|
||||
*piRows = ( int ) HB_PEEK_BYTE( 0x0040, 0x0084 ) + 1;
|
||||
*piCols = ( int ) HB_PEEK_BYTE( 0x0040, 0x004A );
|
||||
@@ -275,7 +261,7 @@ static HB_BYTE FAR * hb_gt_dos_ScreenAddress( PHB_GT pGT )
|
||||
{
|
||||
HB_BYTE FAR * ptr;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_ScreenAddress(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_ScreenAddress(%p)", ( void * ) pGT ) );
|
||||
|
||||
#if defined( __WATCOMC__ ) && defined( __386__ )
|
||||
if( HB_GTSELF_ISCOLOR( pGT ) )
|
||||
@@ -311,7 +297,7 @@ static void hb_gt_dos_GetScreenContents( PHB_GT pGT )
|
||||
HB_BYTE * pScreenPtr = s_pScreenAddress;
|
||||
#endif
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_GetScreenContents(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_GetScreenContents(%p)", ( void * ) pGT ) );
|
||||
|
||||
bxAttr = 0;
|
||||
cdp = HB_GTSELF_CPTERM( pGT );
|
||||
@@ -333,6 +319,7 @@ static void hb_gt_dos_GetScreenContents( PHB_GT pGT )
|
||||
gettext( iCol + 1, iRow + 1, iCol + 1, iRow + 1, &ch_attr );
|
||||
bChar = ch_attr & 0xFF;
|
||||
bAttr = ch_attr >> 8;
|
||||
HB_SYMBOL_UNUSED( pScreenPtr );
|
||||
#elif defined( __DJGPP__ )
|
||||
int iChar, iAttr;
|
||||
ScreenGetChar( &iChar, &iAttr, iCol, iRow );
|
||||
@@ -354,7 +341,7 @@ static void hb_gt_dos_GetCursorPosition( int * piRow, int * piCol )
|
||||
{
|
||||
union REGS regs;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_GetCursorPosition(%p, %p)", piRow, piCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_GetCursorPosition(%p, %p)", ( void * ) piRow, ( void * ) piCol ) );
|
||||
|
||||
regs.h.ah = 0x03;
|
||||
regs.h.bh = 0;
|
||||
@@ -397,7 +384,7 @@ static void hb_gt_dos_GetCursorSize( unsigned char * start, unsigned char * end
|
||||
{
|
||||
union REGS regs;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_GetCursorSize(%p, %p)", start, end ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_GetCursorSize(%p, %p)", ( void * ) start, ( void * ) end ) );
|
||||
|
||||
regs.h.ah = 0x03;
|
||||
regs.h.bh = 0;
|
||||
@@ -817,7 +804,7 @@ static void hb_gt_dos_mouse_GetBounds( PHB_GT pGT, int * piTop, int * piLeft, in
|
||||
|
||||
static void hb_gt_dos_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFilenoStdout, HB_FHANDLE hFilenoStderr )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Init(%p,%d,%d,%d)", pGT, hFilenoStdin, hFilenoStdout, hFilenoStderr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Init(%p,%d,%d,%d)", ( void * ) pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
|
||||
s_bBreak = HB_FALSE;
|
||||
|
||||
@@ -872,7 +859,7 @@ static void hb_gt_dos_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
|
||||
static void hb_gt_dos_Exit( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Exit(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Exit(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSUPER_EXIT( pGT );
|
||||
}
|
||||
@@ -881,7 +868,7 @@ static int hb_gt_dos_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
{
|
||||
int iKey = 0, iFlags = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_ReadKey(%p,%d)", pGT, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_ReadKey(%p,%d)", ( void * ) pGT, iEventMask ) );
|
||||
|
||||
#if defined( __DJGPP__ )
|
||||
/* Check to see if Ctrl+Break has been detected */
|
||||
@@ -949,7 +936,7 @@ static int hb_gt_dos_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
|
||||
static HB_BOOL hb_gt_dos_IsColor( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_IsColor(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_IsColor(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -958,7 +945,7 @@ static HB_BOOL hb_gt_dos_IsColor( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_dos_GetBlink( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_GetBlink(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_GetBlink(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -969,7 +956,7 @@ static void hb_gt_dos_SetBlink( PHB_GT pGT, HB_BOOL fBlink )
|
||||
{
|
||||
union REGS regs;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_SetBlink(%p,%d)", pGT, ( int ) fBlink ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_SetBlink(%p,%d)", ( void * ) pGT, ( int ) fBlink ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -982,7 +969,7 @@ static void hb_gt_dos_SetBlink( PHB_GT pGT, HB_BOOL fBlink )
|
||||
|
||||
static void hb_gt_dos_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Tone(%p,%lf,%lf)", ( void * ) pGT, dFrequency, dDuration ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -992,6 +979,8 @@ static void hb_gt_dos_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
sound( ( unsigned ) dFrequency );
|
||||
#elif defined( __DJGPP__ )
|
||||
sound( ( int ) dFrequency );
|
||||
#else
|
||||
HB_SYMBOL_UNUSED( dFrequency );
|
||||
#endif
|
||||
|
||||
/* convert Clipper (DOS) timer tick units to seconds ( x / 18.2 ) */
|
||||
@@ -1006,7 +995,7 @@ static void hb_gt_dos_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
|
||||
static const char * hb_gt_dos_Version( PHB_GT pGT, int iType )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Version(%p,%d)", pGT, iType ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Version(%p,%d)", ( void * ) pGT, iType ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -1059,7 +1048,7 @@ static void vmode28x40( void )
|
||||
regs.HB_XREGS.ax = 0x0001; /* video mode 40 cols */
|
||||
HB_DOS_INT86( INT_VIDEO, ®s, ®s );
|
||||
regs.HB_XREGS.bx = 0; /* load block 0 (BL = 0) */
|
||||
regs.HB_XREGS.ax = 0x1111; /* load 8x8 monochrome char set into RAM */
|
||||
regs.HB_XREGS.ax = 0x1111; /* load 8x8 monochrome font into RAM */
|
||||
HB_DOS_INT86( INT_VIDEO, ®s, ®s );
|
||||
}
|
||||
|
||||
@@ -1070,7 +1059,7 @@ static void vmode50x40( void )
|
||||
regs.HB_XREGS.ax = 0x0001;
|
||||
HB_DOS_INT86( INT_VIDEO, ®s, ®s );
|
||||
regs.HB_XREGS.bx = 0; /* load block 0 (BL = 0) */
|
||||
regs.HB_XREGS.ax = 0x1112; /* load 8x8 double dot char set into RAM */
|
||||
regs.HB_XREGS.ax = 0x1112; /* load 8x8 double dot font into RAM */
|
||||
HB_DOS_INT86( INT_VIDEO, ®s, ®s );
|
||||
outportw( 0x03D4, 0x060A );
|
||||
}
|
||||
@@ -1099,7 +1088,7 @@ static void vmode25x80( void )
|
||||
regs.HB_XREGS.ax = 0x0083; /* mode in AL, if higher bit is on, No CLS */
|
||||
HB_DOS_INT86( INT_VIDEO, ®s, ®s );
|
||||
regs.HB_XREGS.bx = 0; /* load block 0 (BL = 0) */
|
||||
regs.HB_XREGS.ax = 0x1114; /* load 8x14 VGA char set into RAM */
|
||||
regs.HB_XREGS.ax = 0x1114; /* load 8x14 VGA font into RAM */
|
||||
HB_DOS_INT86( INT_VIDEO, ®s, ®s );
|
||||
}
|
||||
|
||||
@@ -1110,7 +1099,7 @@ static void vmode28x80( void )
|
||||
regs.HB_XREGS.ax = 0x0003; /* mode in AL, if higher bit is on, No CLS */
|
||||
HB_DOS_INT86( INT_VIDEO, ®s, ®s );
|
||||
regs.HB_XREGS.bx = 0; /* load block 0 (BL = 0) */
|
||||
regs.HB_XREGS.ax = 0x1111; /* load 8x8 monochrome char set into RAM */
|
||||
regs.HB_XREGS.ax = 0x1111; /* load 8x8 monochrome font into RAM */
|
||||
HB_DOS_INT86( INT_VIDEO, ®s, ®s );
|
||||
}
|
||||
|
||||
@@ -1118,18 +1107,18 @@ static void vmode43x80( void )
|
||||
{
|
||||
union REGS regs;
|
||||
|
||||
regs.HB_XREGS.ax = 0x1201; /* select 350 scan line mode */
|
||||
regs.HB_XREGS.ax = 0x1201; /* select 350 scan line mode */
|
||||
regs.h.bl = 0x30;
|
||||
HB_DOS_INT86( INT_VIDEO, ®s, ®s );
|
||||
regs.HB_XREGS.ax = 0x0003; /* mode in AL, if higher bit is on, No CLS */
|
||||
regs.HB_XREGS.ax = 0x0003; /* mode in AL, if higher bit is on, No CLS */
|
||||
HB_DOS_INT86( INT_VIDEO, ®s, ®s );
|
||||
regs.h.bh = 0x1; /* bytes per character */
|
||||
regs.h.bl = 0x0; /* load block 0 */
|
||||
regs.HB_XREGS.ax = 0x1112; /* load 8x8 double dot char set into RAM */
|
||||
regs.h.bh = 0x1; /* bytes per character */
|
||||
regs.h.bl = 0x0; /* load block 0 */
|
||||
regs.HB_XREGS.ax = 0x1112; /* load 8x8 double dot font into RAM */
|
||||
HB_DOS_INT86( INT_VIDEO, ®s, ®s );
|
||||
outportw( 0x03D4, 0x060A ); /* update cursor size / pointers */
|
||||
outportw( 0x03D4, 0x060A ); /* update cursor size / pointers */
|
||||
#if ! defined( __DJGPP__ )
|
||||
HB_POKE_BYTE( 0x40, 0x84, 42 ); /* 42 rows number update */
|
||||
HB_POKE_BYTE( 0x40, 0x84, 42 ); /* 42 rows number update */
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1143,7 +1132,7 @@ static void vmode50x80( void )
|
||||
regs.HB_XREGS.ax = 0x0003; /* mode in AL, if bit 7 is on, No CLS */
|
||||
HB_DOS_INT86( INT_VIDEO, ®s, ®s );
|
||||
regs.HB_XREGS.bx = 0; /* load block 0 (BL = 0) */
|
||||
regs.HB_XREGS.ax = 0x1112; /* load 8x8 double dot char set into RAM */
|
||||
regs.HB_XREGS.ax = 0x1112; /* load 8x8 double dot font into RAM */
|
||||
HB_DOS_INT86( INT_VIDEO, ®s, ®s );
|
||||
}
|
||||
|
||||
@@ -1188,7 +1177,7 @@ static HB_BOOL hb_gt_dos_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
/* HB_GTSELF_ISCOLOR( pGT ) test for color card, we need to know if it is a VGA board...*/
|
||||
HB_BOOL bIsVGA, bIsVesa, bSuccess;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_SetMode(%p,%d,%d)", pGT, iRows, iCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_SetMode(%p,%d,%d)", ( void * ) pGT, iRows, iCols ) );
|
||||
|
||||
bIsVGA = ( hb_gt_dos_GetDisplay() == 8 );
|
||||
bIsVesa = HB_FALSE;
|
||||
@@ -1232,7 +1221,7 @@ static HB_BOOL hb_gt_dos_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
|
||||
hb_gt_dos_GetScreenSize( &s_iRows, &s_iCols );
|
||||
|
||||
/* Check for succesful */
|
||||
/* Check for success */
|
||||
if( s_iRows == iRows && s_iCols == iCols )
|
||||
{
|
||||
bSuccess = HB_TRUE;
|
||||
@@ -1260,7 +1249,7 @@ static HB_BOOL hb_gt_dos_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
|
||||
static HB_BOOL hb_gt_dos_PostExt( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_PostExt(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_PostExt(%p)", ( void * ) pGT ) );
|
||||
|
||||
hb_gt_dos_GetCursorPosition( &s_iCurRow, &s_iCurCol );
|
||||
hb_gt_dos_GetScreenContents( pGT );
|
||||
@@ -1271,7 +1260,7 @@ static HB_BOOL hb_gt_dos_PostExt( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_dos_Resume( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Resume(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Resume(%p)", ( void * ) pGT ) );
|
||||
|
||||
s_iScreenMode = hb_gt_dos_GetScreenMode();
|
||||
#if ! defined( __DJGPP__ )
|
||||
@@ -1301,7 +1290,7 @@ static void hb_gt_dos_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
HB_UCHAR uc;
|
||||
int iLen = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Redraw(%p,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iSize ) );
|
||||
|
||||
while( iLen < iSize )
|
||||
{
|
||||
@@ -1312,6 +1301,7 @@ static void hb_gt_dos_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
{
|
||||
short ch_attr = ( ( short ) iColor << 8 ) | uc;
|
||||
puttext( iCol + iLen + 1, iRow + 1, iCol + iLen + 1, iRow + 1, &ch_attr );
|
||||
HB_SYMBOL_UNUSED( pScreenPtr );
|
||||
}
|
||||
#elif defined( __DJGPP__ )
|
||||
ScreenPutChar( uc, iColor, iCol + iLen, iRow );
|
||||
@@ -1326,7 +1316,7 @@ static void hb_gt_dos_Refresh( PHB_GT pGT )
|
||||
{
|
||||
int iRow, iCol, iStyle;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Refresh(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Refresh(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSUPER_REFRESH( pGT );
|
||||
|
||||
@@ -1343,7 +1333,7 @@ static void hb_gt_dos_Refresh( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_dos_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Info(%p,%d,%p)", pGT, iType, pInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_dos_Info(%p,%d,%p)", ( void * ) pGT, iType, pInfo ) );
|
||||
|
||||
switch( iType )
|
||||
{
|
||||
@@ -1369,7 +1359,7 @@ static HB_BOOL hb_gt_dos_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
|
||||
static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", pFuncTable ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", ( void * ) pFuncTable ) );
|
||||
|
||||
pFuncTable->Init = hb_gt_dos_Init;
|
||||
pFuncTable->Exit = hb_gt_dos_Exit;
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* Mini GT for GUI programs.
|
||||
* Now it supports only low level TONE and CLIPBOARD code for Windows
|
||||
* Now it supports only low-level Tone() and CLIPBOARD code for Windows
|
||||
*
|
||||
* Copyright 2006 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
@@ -98,7 +98,6 @@ static int hb_gt_gui_optionId( const char * pszOption )
|
||||
if( pszOption )
|
||||
{
|
||||
HB_SIZE nSize;
|
||||
int i;
|
||||
|
||||
while( HB_ISSPACE( *pszOption ) )
|
||||
pszOption++;
|
||||
@@ -108,6 +107,7 @@ static int hb_gt_gui_optionId( const char * pszOption )
|
||||
|
||||
if( nSize >= 2 && nSize <= 9 )
|
||||
{
|
||||
int i;
|
||||
for( i = 0; i < ( int ) _HB_BUTTON_COUNT; ++i )
|
||||
{
|
||||
if( nSize == s_buttons[ i ].len &&
|
||||
@@ -241,7 +241,7 @@ static int hb_gt_gui_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions,
|
||||
|
||||
static const char * hb_gt_gui_Version( PHB_GT pGT, int iType )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_gui_Version(%p,%d)", pGT, iType ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_gui_Version(%p,%d)", ( void * ) pGT, iType ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -255,7 +255,7 @@ static const char * hb_gt_gui_Version( PHB_GT pGT, int iType )
|
||||
/* dDuration is in 'Ticks' (18.2 per second) */
|
||||
static void hb_gt_gui_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_gui_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_gui_Tone(%p,%lf,%lf)", ( void * ) pGT, dFrequency, dDuration ) );
|
||||
|
||||
#if defined( HB_OS_WIN )
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
@@ -269,7 +269,7 @@ static void hb_gt_gui_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
|
||||
static HB_BOOL hb_gt_gui_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_gui_Info(%p,%d,%p)", pGT, iType, pInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_gui_Info(%p,%d,%p)", ( void * ) pGT, iType, ( void * ) pInfo ) );
|
||||
|
||||
switch( iType )
|
||||
{
|
||||
@@ -310,7 +310,7 @@ static HB_BOOL hb_gt_gui_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
|
||||
static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", pFuncTable ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", ( void * ) pFuncTable ) );
|
||||
|
||||
pFuncTable->Version = hb_gt_gui_Version;
|
||||
pFuncTable->Tone = hb_gt_gui_Tone;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Low level keyboard shift state functions common to some GT drivers
|
||||
* Low-level keyboard shift state functions common to some GT drivers
|
||||
*
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
@@ -44,10 +44,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* NOTE: User programs should never call this layer directly! */
|
||||
|
||||
|
||||
#include "hbgtcore.h"
|
||||
|
||||
#if defined( HB_OS_WIN )
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* hb_gt_dos_keyCodeTranslate()
|
||||
* function used by DOS, WIN and OS2 ports of few GTs which use
|
||||
* getkey()/getch()/_read_kbd()/KbdCharIn() or similar function
|
||||
* for keyboard input
|
||||
* based on hb_gt_ReadKey() from GTDOS code by:
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* function used by MS-DOS, Windows and OS/2 ports of few GTs which
|
||||
* use getkey()/getch()/_read_kbd()/KbdCharIn() or similar function
|
||||
* for keyboard input
|
||||
*
|
||||
* Copyright 2006, 2015 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
* based on hb_gt_ReadKey() from GTDOS code by:
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
*
|
||||
* 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
|
||||
@@ -49,7 +49,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* NOTE: User programs should never call this layer directly! */
|
||||
|
||||
#include "hbgtcore.h"
|
||||
|
||||
@@ -2,6 +2,30 @@
|
||||
* Video subsystem for OS/2 compilers
|
||||
*
|
||||
* Copyright 1999-2001 {list of individual authors and e-mail addresses}
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* hb_gt_os2_ReadKey()
|
||||
*
|
||||
* Copyright 1999 Chen Kedem <niki@synel.co.il>
|
||||
* hb_gt_os2_mouse_Init()
|
||||
* hb_gt_os2_mouse_Exit()
|
||||
* hb_gt_os2_mouse_IsPresent()
|
||||
* hb_gt_os2_mouse_Show()
|
||||
* hb_gt_os2_mouse_Hide()
|
||||
* hb_gt_os2_mouse_SetPos()
|
||||
* hb_gt_os2_mouse_CountButton()
|
||||
* hb_gt_os2_Tone()
|
||||
* hb_gt_os2_IsColor()
|
||||
* hb_gt_os2_SetCursorSize()
|
||||
* hb_gt_os2_GetCharHeight()
|
||||
* hb_gt_os2_GetCursorStyle()
|
||||
* hb_gt_os2_SetCursorStyle()
|
||||
* hb_gt_os2_GetBlink()
|
||||
* hb_gt_os2_SetBlink()
|
||||
*
|
||||
* Copyright 2000-2001 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* hb_gt_DispBegin() / hb_gt_DispEnd()
|
||||
* hb_gt_ScreenPtr() and hb_gt_xYYYY() functions and virtual screen support inside hb_gt_XXXX()s
|
||||
* 16-bit KBD subsystem use inside hb_gt_os2_ReadKey()
|
||||
*
|
||||
* 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
|
||||
@@ -44,41 +68,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* hb_gt_os2_ReadKey()
|
||||
*
|
||||
* Copyright 1999 Chen Kedem <niki@synel.co.il>
|
||||
* hb_gt_os2_mouse_Init()
|
||||
* hb_gt_os2_mouse_Exit()
|
||||
* hb_gt_os2_mouse_IsPresent()
|
||||
* hb_gt_os2_mouse_Show()
|
||||
* hb_gt_os2_mouse_Hide()
|
||||
* hb_gt_os2_mouse_SetPos()
|
||||
* hb_gt_os2_mouse_CountButton()
|
||||
* hb_gt_os2_Tone()
|
||||
* hb_gt_os2_IsColor()
|
||||
* hb_gt_os2_SetCursorSize()
|
||||
* hb_gt_os2_GetCharHeight()
|
||||
* hb_gt_os2_GetCursorStyle()
|
||||
* hb_gt_os2_SetCursorStyle()
|
||||
* hb_gt_os2_GetBlink()
|
||||
* hb_gt_os2_SetBlink()
|
||||
*
|
||||
* Copyright 2000-2001 Maurilio Longo <maurilio.longo@libero.it>
|
||||
* hb_gt_DispBegin() / hb_gt_DispEnd()
|
||||
* hb_gt_ScreenPtr() and hb_gt_xYYYY() functions and virtual screen support inside hb_gt_XXXX()s
|
||||
* 16 bit KBD subsystem use inside hb_gt_os2_ReadKey()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* This module is partially based on VIDMGR by Andrew Clarke and modified for Harbour.
|
||||
*/
|
||||
/* This module is partially based on VIDMGR by Andrew Clarke and modified for Harbour. */
|
||||
|
||||
/* NOTE: User programs should never call this layer directly! */
|
||||
|
||||
@@ -131,7 +121,7 @@ static int s_iCursorStyle;
|
||||
static int s_iLineBufSize = 0;
|
||||
static char * s_sLineBuf;
|
||||
|
||||
/* Code page ID of active codepage at the time harbour program was start */
|
||||
/* Code page ID of active codepage at the time Harbour program was start */
|
||||
static HB_USHORT s_usOldCodePage;
|
||||
|
||||
/* Instead of calling VioGetMode() every time I need MaxRow() or MaxCol() I
|
||||
@@ -233,7 +223,7 @@ static void hb_gt_os2_mouse_Exit( PHB_GT pGT )
|
||||
|
||||
if( s_uMouHandle )
|
||||
{
|
||||
MouClose( s_uMouHandle ); /* relese mouse handle */
|
||||
MouClose( s_uMouHandle ); /* release mouse handle */
|
||||
s_uMouHandle = 0;
|
||||
}
|
||||
}
|
||||
@@ -271,7 +261,7 @@ static void hb_gt_os2_mouse_Hide( PHB_GT pGT )
|
||||
con: calling function from another module, GT must be linked in
|
||||
con: VioGetMode is been called twice
|
||||
*/
|
||||
vi.cb = sizeof( VIOMODEINFO );
|
||||
vi.cb = sizeof( vi );
|
||||
VioGetMode( &vi, 0 );
|
||||
rect.row = 0; /* x-coordinate upper left */
|
||||
rect.col = 0; /* y-coordinate upper left */
|
||||
@@ -437,7 +427,7 @@ static void hb_gt_os2_GetCursorPosition( int * piRow, int * piCol )
|
||||
{
|
||||
USHORT y, x;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_GetCursorPosition(%p, %p)", piRow, piCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_GetCursorPosition(%p, %p)", ( void * ) piRow, ( void * ) piCol ) );
|
||||
|
||||
VioGetCurPos( &y, &x, 0 );
|
||||
|
||||
@@ -559,7 +549,7 @@ static void hb_gt_os2_GetScreenContents( PHB_GT pGT )
|
||||
char * pBufPtr;
|
||||
HB_BYTE bxAttr;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_GetScreenContents(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_GetScreenContents(%p)", ( void * ) pGT ) );
|
||||
|
||||
bxAttr = 0;
|
||||
cdp = HB_GTSELF_CPTERM( pGT );
|
||||
@@ -600,9 +590,9 @@ static PVOID hb_gt_os2_allocMem( int iSize )
|
||||
|
||||
static void hb_gt_os2_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFilenoStdout, HB_FHANDLE hFilenoStderr )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Init(%p,%p,%p,%p)", pGT, ( HB_PTRUINT ) hFilenoStdin, ( HB_PTRUINT ) hFilenoStdout, ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Init(%p,%p,%p,%p)", ( void * ) pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
|
||||
s_vi.cb = sizeof( VIOMODEINFO );
|
||||
s_vi.cb = sizeof( s_vi );
|
||||
VioGetMode( &s_vi, 0 ); /* fill structure with current video mode settings */
|
||||
|
||||
/* Alloc tileable memory for calling a 16 subsystem */
|
||||
@@ -665,7 +655,7 @@ static void hb_gt_os2_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
|
||||
static void hb_gt_os2_Exit( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Exit(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Exit(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSUPER_EXIT( pGT );
|
||||
|
||||
@@ -688,10 +678,10 @@ static int hb_gt_os2_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
{
|
||||
int iKey = 0, iFlags = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_ReadKey(%p,%d)", pGT, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_ReadKey(%p,%d)", ( void * ) pGT, iEventMask ) );
|
||||
|
||||
/* zero out keyboard event record */
|
||||
memset( s_key, 0, sizeof( KBDKEYINFO ) );
|
||||
memset( s_key, 0, sizeof( *s_key ) );
|
||||
|
||||
#if defined( __WATCOMC__ )
|
||||
if( s_fBreak )
|
||||
@@ -751,22 +741,22 @@ static int hb_gt_os2_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
|
||||
static HB_BOOL hb_gt_os2_IsColor( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_IsColor(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_IsColor(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
return s_vi.fbType != 0; /* 0 = monochrom-compatible mode */
|
||||
return s_vi.fbType != 0; /* 0 = monochrome-compatible mode */
|
||||
}
|
||||
|
||||
static HB_BOOL hb_gt_os2_GetBlink( PHB_GT pGT )
|
||||
{
|
||||
VIOINTENSITY vi;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_GetBlink(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_GetBlink(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
vi.cb = sizeof( VIOINTENSITY ); /* 6 */
|
||||
vi.cb = sizeof( vi ); /* 6 */
|
||||
vi.type = 2; /* get intensity/blink toggle */
|
||||
VioGetState( &vi, 0 );
|
||||
|
||||
@@ -777,11 +767,11 @@ static void hb_gt_os2_SetBlink( PHB_GT pGT, HB_BOOL fBlink )
|
||||
{
|
||||
VIOINTENSITY vi;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_SetBlink(%p,%d)", pGT, ( int ) fBlink ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_SetBlink(%p,%d)", ( void * ) pGT, ( int ) fBlink ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
vi.cb = sizeof( VIOINTENSITY ); /* 6 */
|
||||
vi.cb = sizeof( vi ); /* 6 */
|
||||
vi.type = 2; /* set intensity/blink toggle */
|
||||
vi.fs = ( fBlink ? 0 : 1 ); /* 0 = blink, 1 = intens */
|
||||
VioSetState( &vi, 0 );
|
||||
@@ -791,7 +781,7 @@ static void hb_gt_os2_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
{
|
||||
ULONG ulDuration;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Tone(%p,%lf,%lf)", ( void * ) pGT, dFrequency, dDuration ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -814,7 +804,7 @@ static void hb_gt_os2_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
|
||||
static const char * hb_gt_os2_Version( PHB_GT pGT, int iType )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Version(%p,%d)", pGT, iType ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Version(%p,%d)", ( void * ) pGT, iType ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -826,7 +816,7 @@ static const char * hb_gt_os2_Version( PHB_GT pGT, int iType )
|
||||
|
||||
static HB_BOOL hb_gt_os2_Resize( PHB_GT pGT, int iRows, int iCols )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Resize(%p,%d,%d)", pGT, iRows, iCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Resize(%p,%d,%d)", ( void * ) pGT, iRows, iCols ) );
|
||||
|
||||
if( HB_GTSUPER_RESIZE( pGT, iRows, iCols ) )
|
||||
{
|
||||
@@ -849,11 +839,11 @@ static HB_BOOL hb_gt_os2_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
{
|
||||
HB_BOOL fResult = HB_FALSE;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_SetMode(%p,%d,%d)", pGT, iRows, iCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_SetMode(%p,%d,%d)", ( void * ) pGT, iRows, iCols ) );
|
||||
|
||||
if( iRows > 0 && iCols > 0 )
|
||||
{
|
||||
s_vi.cb = sizeof( VIOMODEINFO );
|
||||
s_vi.cb = sizeof( s_vi );
|
||||
VioGetMode( &s_vi, 0 ); /* fill structure with current settings */
|
||||
s_vi.row = iRows;
|
||||
s_vi.col = iCols;
|
||||
@@ -861,7 +851,7 @@ static HB_BOOL hb_gt_os2_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
|
||||
if( ! fResult )
|
||||
{
|
||||
s_vi.cb = sizeof( VIOMODEINFO );
|
||||
s_vi.cb = sizeof( s_vi );
|
||||
VioGetMode( &s_vi, 0 ); /* fill structure with current settings */
|
||||
}
|
||||
|
||||
@@ -879,7 +869,7 @@ static HB_BOOL hb_gt_os2_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
|
||||
static HB_BOOL hb_gt_os2_PostExt( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_PostExt(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_PostExt(%p)", ( void * ) pGT ) );
|
||||
|
||||
hb_gt_os2_GetCursorPosition( &s_iCurRow, &s_iCurCol );
|
||||
HB_GTSELF_SETPOS( pGT, s_iCurRow, s_iCurCol );
|
||||
@@ -890,9 +880,9 @@ static HB_BOOL hb_gt_os2_PostExt( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_os2_Resume( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Resume(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Resume(%p)", ( void * ) pGT ) );
|
||||
|
||||
s_vi.cb = sizeof( VIOMODEINFO );
|
||||
s_vi.cb = sizeof( s_vi );
|
||||
VioGetMode( &s_vi, 0 ); /* fill structure with current settings */
|
||||
hb_gt_os2_GetCursorPosition( &s_iCurRow, &s_iCurCol );
|
||||
s_iCursorStyle = hb_gt_os2_GetCursorStyle();
|
||||
@@ -913,7 +903,7 @@ static void hb_gt_os2_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
HB_UCHAR uc;
|
||||
int iLen = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Redraw(%p,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iSize ) );
|
||||
|
||||
while( iLen < iSize )
|
||||
{
|
||||
@@ -932,7 +922,7 @@ static void hb_gt_os2_Refresh( PHB_GT pGT )
|
||||
{
|
||||
int iRow, iCol, iStyle;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Refresh(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Refresh(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSUPER_REFRESH( pGT );
|
||||
|
||||
@@ -949,7 +939,7 @@ static void hb_gt_os2_Refresh( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_os2_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Info(%p,%d,%p)", pGT, iType, pInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_os2_Info(%p,%d,%p)", ( void * ) pGT, iType, pInfo ) );
|
||||
|
||||
switch( iType )
|
||||
{
|
||||
@@ -990,7 +980,7 @@ static HB_BOOL hb_gt_os2_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
|
||||
static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", pFuncTable ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", ( void * ) pFuncTable ) );
|
||||
|
||||
pFuncTable->Init = hb_gt_os2_Init;
|
||||
pFuncTable->Exit = hb_gt_os2_Exit;
|
||||
|
||||
@@ -189,9 +189,9 @@ static void hb_gt_pca_termOut( const char * szStr, int iLen )
|
||||
{
|
||||
if( s_iOutBufSize )
|
||||
{
|
||||
int i;
|
||||
while( iLen > 0 )
|
||||
{
|
||||
int i;
|
||||
if( s_iOutBufSize == s_iOutBufIndex )
|
||||
hb_gt_pca_termFlush();
|
||||
i = s_iOutBufSize - s_iOutBufIndex;
|
||||
@@ -229,7 +229,7 @@ static void hb_gt_pca_AnsiGetCurPos( int * iRow, int * iCol )
|
||||
{
|
||||
static HB_BOOL s_fIsAnswer = HB_TRUE;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_AnsiGetCurPos(%p, %p)", iRow, iCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_AnsiGetCurPos(%p, %p)", ( void * ) iRow, ( void * ) iCol ) );
|
||||
|
||||
if( s_fIsAnswer && s_bStdinConsole && s_bStdoutConsole )
|
||||
{
|
||||
@@ -248,7 +248,7 @@ static void hb_gt_pca_AnsiGetCurPos( int * iRow, int * iCol )
|
||||
timer = hb_timerInit( timeout );
|
||||
for( ;; )
|
||||
{
|
||||
/* loking for cursor position in "\033[%d;%dR" */
|
||||
/* looking for cursor position in "\033[%d;%dR" */
|
||||
while( j < n && rdbuf[ j ] != '\033' )
|
||||
++j;
|
||||
if( n - j >= 6 )
|
||||
@@ -357,8 +357,8 @@ static void hb_gt_pca_AnsiSetAttributes( int iAttr )
|
||||
|
||||
bg = s_AnsiColors[ ( iAttr >> 4 ) & 0x07 ];
|
||||
fg = s_AnsiColors[ iAttr & 0x07 ];
|
||||
bold = iAttr & 0x08 ? 1 : 0;
|
||||
blink = iAttr & 0x80 ? 1 : 0;
|
||||
bold = ( iAttr & 0x08 ) ? 1 : 0;
|
||||
blink = ( iAttr & 0x80 ) ? 1 : 0;
|
||||
|
||||
if( s_iCurrentSGR == -1 )
|
||||
{
|
||||
@@ -434,7 +434,7 @@ static void hb_gt_pca_AnsiInit( void )
|
||||
|
||||
static void hb_gt_pca_AnsiPutStr( int iRow, int iCol, int iColor, const char * szStr, int iLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_AnsiPutStr(%d,%d,%d,%p,%d)", iRow, iCol, iColor, szStr, iLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_AnsiPutStr(%d,%d,%d,%p,%d)", iRow, iCol, iColor, ( const void * ) szStr, iLen ) );
|
||||
|
||||
hb_gt_pca_AnsiSetAttributes( ( HB_BYTE ) iColor );
|
||||
hb_gt_pca_AnsiSetCursorPos( iRow, iCol );
|
||||
@@ -447,7 +447,7 @@ static void hb_gt_pca_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
{
|
||||
int iRows = 25, iCols = 80;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Init(%p,%p,%p,%p)", pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Init(%p,%p,%p,%p)", ( void * ) pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
|
||||
s_hFilenoStdin = hFilenoStdin;
|
||||
s_hFilenoStdout = hFilenoStdout;
|
||||
@@ -502,7 +502,7 @@ static void hb_gt_pca_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
s_curr_TIO.c_cc[ VMIN ] = 0;
|
||||
#else
|
||||
/* workaround for bug in some Linux kernels (i.e. 3.13.0-64-generic
|
||||
Ubuntu) in which select() unconditionally accepts stdin for
|
||||
*buntu) in which select() unconditionally accepts stdin for
|
||||
reading if c_cc[ VMIN ] = 0 [druzus] */
|
||||
s_curr_TIO.c_cc[ VMIN ] = 1;
|
||||
#endif
|
||||
@@ -546,7 +546,7 @@ static void hb_gt_pca_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
|
||||
static void hb_gt_pca_Exit( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Exit(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Exit(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSELF_REFRESH( pGT );
|
||||
/* set default color */
|
||||
@@ -583,7 +583,7 @@ static int hb_gt_pca_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
{
|
||||
int ch = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_ReadKey(%p,%d)", pGT, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_ReadKey(%p,%d)", ( void * ) pGT, iEventMask ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
HB_SYMBOL_UNUSED( iEventMask );
|
||||
@@ -685,7 +685,7 @@ static void hb_gt_pca_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
static double s_dLastSeconds = 0;
|
||||
double dCurrentSeconds;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Tone(%p, %lf, %lf)", pGT, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Tone(%p, %lf, %lf)", ( void * ) pGT, dFrequency, dDuration ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -710,7 +710,7 @@ static void hb_gt_pca_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
|
||||
static void hb_gt_pca_Bell( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Bell(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Bell(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -720,7 +720,7 @@ static void hb_gt_pca_Bell( PHB_GT pGT )
|
||||
|
||||
static const char * hb_gt_pca_Version( PHB_GT pGT, int iType )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Version(%p,%d)", pGT, iType ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Version(%p,%d)", ( void * ) pGT, iType ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -732,7 +732,7 @@ static const char * hb_gt_pca_Version( PHB_GT pGT, int iType )
|
||||
|
||||
static HB_BOOL hb_gt_pca_Suspend( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Suspend(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Suspend(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
#if defined( HB_HAS_TERMIOS )
|
||||
@@ -748,7 +748,7 @@ static HB_BOOL hb_gt_pca_Suspend( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_pca_Resume( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Resume(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Resume(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
#if defined( HB_HAS_TERMIOS )
|
||||
@@ -764,7 +764,7 @@ static HB_BOOL hb_gt_pca_Resume( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_pca_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char * pszHostCDP, HB_BOOL fBox )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_SetDispCP(%p,%s,%s,%d)", pGT, pszTermCDP, pszHostCDP, ( int ) fBox ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_SetDispCP(%p,%s,%s,%d)", ( void * ) pGT, pszTermCDP, pszHostCDP, ( int ) fBox ) );
|
||||
|
||||
if( HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ) )
|
||||
{
|
||||
@@ -783,7 +783,7 @@ static void hb_gt_pca_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
HB_USHORT usChar;
|
||||
int iLen = 0, iColor2 = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Redraw(%p,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iSize ) );
|
||||
|
||||
while( iSize-- )
|
||||
{
|
||||
@@ -834,7 +834,7 @@ static void hb_gt_pca_Refresh( PHB_GT pGT )
|
||||
{
|
||||
int iWidth, iHeight, iRow, iCol, iStyle;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Refresh(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Refresh(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSELF_GETSIZE( pGT, &iHeight, &iWidth );
|
||||
|
||||
@@ -865,7 +865,7 @@ static void hb_gt_pca_Refresh( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_pca_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Info(%p,%d,%p)", pGT, iType, pInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_pca_Info(%p,%d,%p)", ( void * ) pGT, iType, ( void * ) pInfo ) );
|
||||
|
||||
switch( iType )
|
||||
{
|
||||
@@ -884,7 +884,7 @@ static HB_BOOL hb_gt_pca_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
|
||||
static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", pFuncTable ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", ( void * ) pFuncTable ) );
|
||||
|
||||
pFuncTable->Init = hb_gt_pca_Init;
|
||||
pFuncTable->Exit = hb_gt_pca_Exit;
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
*
|
||||
* 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
|
||||
* 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.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site https://www.gnu.org/).
|
||||
* along with this program; see the file LICENSE.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
@@ -34,7 +34,7 @@
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
@@ -105,7 +105,7 @@ static int s_iCursorStyle = SC_NORMAL;
|
||||
/* indicate if we are currently running a command from system */
|
||||
static HB_BOOL s_bSuspended = HB_FALSE;
|
||||
|
||||
/* the name of an environmet variable containig a definition of nation chars.*/
|
||||
/* the name of an environment variable containing a definition of nation chars.*/
|
||||
/* A definition is a list of pairs of chars. The first char in each pair is */
|
||||
/* an ASCII key, which should be pressed *after* a "DeadKey" was pressed to */
|
||||
/* get the nation char, a second in that pair is a corresponding nation char */
|
||||
@@ -130,10 +130,12 @@ static void sigwinch_handler( int iSig )
|
||||
|
||||
static void hb_sln_colorTrans( void )
|
||||
{
|
||||
int i, clr, fg, bg;
|
||||
int i;
|
||||
|
||||
for( i = 0; i < 256; i++ )
|
||||
{
|
||||
int clr, fg, bg;
|
||||
|
||||
fg = ( i & 0x0F );
|
||||
/*
|
||||
* bit 7 is a blinking attribute - not used when console is not in
|
||||
@@ -212,7 +214,7 @@ static void hb_sln_setSingleBox( void )
|
||||
|
||||
static void hb_sln_setACSCtrans( void )
|
||||
{
|
||||
unsigned char * p, ch;
|
||||
unsigned char * p;
|
||||
SLsmg_Char_Type chBoard[ 3 ], chArrow[ 4 ];
|
||||
|
||||
memset( &chArrow, 0, sizeof( chArrow ) );
|
||||
@@ -236,7 +238,7 @@ static void hb_sln_setACSCtrans( void )
|
||||
memset( &SLch, 0, sizeof( SLsmg_Char_Type ) );
|
||||
for( i = 0; i < len; i += 2 )
|
||||
{
|
||||
ch = *p++;
|
||||
unsigned char ch = *p++;
|
||||
HB_SLN_BUILD_RAWCHAR( SLch, *p++, 0 );
|
||||
HB_SLN_SET_ACSC( SLch );
|
||||
switch( ch )
|
||||
@@ -404,7 +406,7 @@ static void hb_sln_setKeyTrans( PHB_GT pGT )
|
||||
p = getenv( hb_NationCharsEnvName );
|
||||
if( p )
|
||||
{
|
||||
int len = strlen( p ) >> 1, ch;
|
||||
int len = strlen( p ) >> 1;
|
||||
|
||||
/* no more than 128 National chars are allowed */
|
||||
if( len > 128 )
|
||||
@@ -416,7 +418,7 @@ static void hb_sln_setKeyTrans( PHB_GT pGT )
|
||||
len <<= 1;
|
||||
for( i = 0; i < len; i += 2 )
|
||||
{
|
||||
ch = ( unsigned char ) p[ i + 1 ];
|
||||
int ch = ( unsigned char ) p[ i + 1 ];
|
||||
hb_sln_convKDeadKeys[ i + 1 ] = ( unsigned char ) p[ i ];
|
||||
hb_sln_convKDeadKeys[ i + 2 ] = ch;
|
||||
hb_sln_inputTab[ ( unsigned char ) p[ i ] ] = ch;
|
||||
@@ -437,7 +439,7 @@ static void hb_sln_SetCursorStyle( int iStyle )
|
||||
{
|
||||
SLtt_set_cursor_visibility( iStyle != SC_NONE );
|
||||
|
||||
/* NOTE: cursor apearence works only under linux console */
|
||||
/* NOTE: cursor appearance works only under linux console */
|
||||
if( hb_sln_UnderLinuxConsole && s_iCursorStyle != iStyle )
|
||||
{
|
||||
/* keyseq to define cursor shape under linux console */
|
||||
@@ -462,7 +464,7 @@ static void hb_sln_SetCursorStyle( int iStyle )
|
||||
break;
|
||||
|
||||
case SC_SPECIAL2:
|
||||
/* TODO: find a proper sequqnce to set a cursor
|
||||
/* TODO: find a proper sequence to set a cursor
|
||||
to SC_SPECIAL2 under Linux console */
|
||||
cursDefseq[ 3 ] = '4';
|
||||
break;
|
||||
@@ -495,7 +497,7 @@ static int hb_sln_isUTF8( int iStdOut, int iStdIn )
|
||||
timer = hb_timerInit( timeout );
|
||||
for( ;; )
|
||||
{
|
||||
/* loking for cursor position in "\033[%d;%dR" */
|
||||
/* looking for cursor position in "\033[%d;%dR" */
|
||||
while( j < n && rdbuf[ j ] != '\033' )
|
||||
++j;
|
||||
if( n - j >= 6 )
|
||||
@@ -552,7 +554,7 @@ static void hb_gt_sln_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
{
|
||||
HB_BOOL gt_Inited = HB_FALSE;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Init(%p,%p,%p,%p)", pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Init(%p,%p,%p,%p)", ( void * ) pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
|
||||
/* stdin && stdout && stderr */
|
||||
s_hStdIn = hFilenoStdin;
|
||||
@@ -567,7 +569,7 @@ static void hb_gt_sln_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
SLang_TT_Read_FD = -1;
|
||||
SLang_TT_Write_FD = -1;
|
||||
|
||||
/* read a terminal descripion from a terminfo database */
|
||||
/* read a terminal description from a terminfo database */
|
||||
SLtt_get_terminfo();
|
||||
|
||||
/* initialize higher-level Slang routines */
|
||||
@@ -597,7 +599,7 @@ static void hb_gt_sln_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
/* do not indicate USER_BREAK in SLang_Error - ??? */
|
||||
SLang_Ignore_User_Abort = 1;
|
||||
|
||||
/* no default abort procesing */
|
||||
/* no default abort processing */
|
||||
SLang_set_abort_signal( NULL );
|
||||
|
||||
/* NOTE: this is incompatible with CLIPPER
|
||||
@@ -610,7 +612,7 @@ static void hb_gt_sln_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
s_iCursorStyle = SC_UNAVAIL;
|
||||
|
||||
/* NOTE: this driver is implemented in a way that it is
|
||||
imposible to get intensity/blinking background mode.
|
||||
impossible to get intensity/blinking background mode.
|
||||
The reason is the way Slang is written.
|
||||
This is incompatible with Clipper.
|
||||
But when the console is in UTF-8 mode we don't need
|
||||
@@ -693,7 +695,7 @@ static void hb_gt_sln_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
|
||||
static void hb_gt_sln_Exit( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Exit(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Exit(%p)", ( void * ) pGT ) );
|
||||
|
||||
/* restore a standard bell frequency and duration */
|
||||
if( hb_sln_UnderLinuxConsole )
|
||||
@@ -721,7 +723,7 @@ static void hb_gt_sln_Exit( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_sln_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_SetMode(%p,%d,%d)", pGT, iRows, iCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_SetMode(%p,%d,%d)", ( void * ) pGT, iRows, iCols ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
HB_SYMBOL_UNUSED( iRows );
|
||||
@@ -735,7 +737,7 @@ static HB_BOOL hb_gt_sln_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
|
||||
static HB_BOOL hb_gt_sln_IsColor( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_IsColor(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_IsColor(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -746,7 +748,7 @@ static HB_BOOL hb_gt_sln_IsColor( PHB_GT pGT )
|
||||
|
||||
static void hb_gt_sln_SetBlink( PHB_GT pGT, HB_BOOL fBlink )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_SetBlink(%p,%d)", pGT, ( int ) fBlink ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_SetBlink(%p,%d)", ( void * ) pGT, ( int ) fBlink ) );
|
||||
|
||||
/*
|
||||
* We cannot switch remote terminal between blinking and highlight mode
|
||||
@@ -769,7 +771,7 @@ static void hb_gt_sln_SetBlink( PHB_GT pGT, HB_BOOL fBlink )
|
||||
|
||||
static void hb_gt_sln_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Tone(%p,%lf,%lf)", ( void * ) pGT, dFrequency, dDuration ) );
|
||||
|
||||
/* TODO: Implement this for other consoles than linux ? */
|
||||
|
||||
@@ -804,7 +806,7 @@ static void hb_gt_sln_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
|
||||
static const char * hb_gt_sln_Version( PHB_GT pGT, int iType )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Version(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Version(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -882,7 +884,7 @@ static HB_BOOL hb_gt_sln_PostExt( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_sln_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Info(%p,%d,%p)", pGT, iType, pInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Info(%p,%d,%p)", ( void * ) pGT, iType, ( void * ) pInfo ) );
|
||||
|
||||
switch( iType )
|
||||
{
|
||||
@@ -939,7 +941,7 @@ static HB_BOOL hb_gt_sln_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const ch
|
||||
|
||||
static void hb_gt_sln_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Redraw(%p,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iSize ) );
|
||||
|
||||
if( s_fActive )
|
||||
{
|
||||
@@ -988,7 +990,7 @@ static void hb_gt_sln_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
|
||||
static void hb_gt_sln_Refresh( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Refresh(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_Refresh(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSUPER_REFRESH( pGT );
|
||||
if( s_fActive )
|
||||
@@ -1009,7 +1011,7 @@ static void hb_gt_sln_Refresh( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", pFuncTable ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", ( void * ) pFuncTable ) );
|
||||
|
||||
pFuncTable->Init = hb_gt_sln_Init;
|
||||
pFuncTable->Exit = hb_gt_sln_Exit;
|
||||
|
||||
@@ -95,7 +95,7 @@
|
||||
} while( 0 )
|
||||
#define HB_SLN_BUILD_CHAR( slch, ch, clr, attr ) \
|
||||
do { \
|
||||
SLsmg_Char_Type * outTab = ( attr ) & HB_GT_ATTR_BOX ? \
|
||||
SLsmg_Char_Type * outTab = ( ( attr ) & HB_GT_ATTR_BOX ) ? \
|
||||
s_outboxTab : s_outputTab; \
|
||||
( slch ).color = outTab[ ( HB_BYTE ) ( ch ) ].color | \
|
||||
s_colorTab[ ( HB_BYTE ) ( clr ) ]; \
|
||||
@@ -144,7 +144,7 @@
|
||||
} while( 0 )
|
||||
#define HB_SLN_BUILD_CHAR( slch, ch, clr, attr ) \
|
||||
do { \
|
||||
( slch ) = ( ( attr ) & HB_GT_ATTR_BOX ? \
|
||||
( slch ) = ( ( ( attr ) & HB_GT_ATTR_BOX ) ? \
|
||||
s_outboxTab : s_outputTab )[ ( HB_BYTE ) ( ch ) ] | \
|
||||
s_colorTab[ ( HB_BYTE ) ( clr ) ]; \
|
||||
} while( 0 )
|
||||
|
||||
@@ -160,10 +160,10 @@ static void hb_sln_Init_KeyTranslations( void )
|
||||
};
|
||||
|
||||
/* on Unix systems ESC is a special key so let
|
||||
assume ESC is a doble pressed ESC key */
|
||||
assume ESC is a double pressed ESC key */
|
||||
SLkp_define_keysym( ( char * ) "^[^[", SL_KEY_ESC );
|
||||
|
||||
/* try to define Shft-Fn and Ctrl-Fn keys.
|
||||
/* try to define Shift-Fn and Ctrl-Fn keys.
|
||||
Because we assume terminal has only 10 Fkeys
|
||||
so F11-F30 is generated with Shift & Ctrl.
|
||||
This is not guaranteed to work in all cases */
|
||||
@@ -171,7 +171,7 @@ static void hb_sln_Init_KeyTranslations( void )
|
||||
keyname[ 0 ] = 'F';
|
||||
keyname[ 2 ] = 0;
|
||||
|
||||
/* Shft & Ctrl FKeys definition takes place in two
|
||||
/* Shift & Ctrl FKeys definition takes place in two
|
||||
phases : from '1' to '9' and from 'A' to 'K' */
|
||||
for( i = 1; i <= 2; i++ )
|
||||
{
|
||||
@@ -202,7 +202,7 @@ static void hb_sln_Init_KeyTranslations( void )
|
||||
keyname[ 1 ] = ch;
|
||||
|
||||
/* QUESTION: why Slang reports error for defining Alt+O ???.
|
||||
Have I any hidden error in key definitiions ??? */
|
||||
Have I any hidden error in key definitions ??? */
|
||||
if( ch != 'O' )
|
||||
SLkp_define_keysym( keyname, SL_KEY_ALT( ch ) );
|
||||
}
|
||||
@@ -300,7 +300,7 @@ int hb_gt_sln_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
HB_BOOL fInput;
|
||||
int iKey;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_ReadKey(%p,%d)", pGT, ( int ) iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_sln_ReadKey(%p,%d)", ( void * ) pGT, ( int ) iEventMask ) );
|
||||
|
||||
/* user AbortKey break */
|
||||
if( SLKeyBoard_Quit == 1 )
|
||||
@@ -340,13 +340,13 @@ int hb_gt_sln_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
{
|
||||
if( hb_sln_escDelay == 0 )
|
||||
{
|
||||
/* standard acction, wait a 1 second for next char and if not then exit */
|
||||
/* standard action, wait a 1 second for next char and if not then exit */
|
||||
if( 0 == SLang_input_pending( 10 ) )
|
||||
return 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* wait hb_sln_escDelay milisec for next char and in not return ESC keycode */
|
||||
/* wait hb_sln_escDelay millisec for next char and in not return ESC keycode */
|
||||
if( 0 == SLang_input_pending( -HB_MAX( hb_sln_escDelay, 0 ) ) )
|
||||
return 033;
|
||||
}
|
||||
@@ -400,7 +400,7 @@ int hb_gt_sln_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
if( tmp != 0 )
|
||||
return tmp;
|
||||
|
||||
/* TOFIX: this code is broken - needs a diffrent aproach */
|
||||
/* FIXME: this code is broken - needs a different approach */
|
||||
tmp = hb_sln_FindKeyTranslation( ch );
|
||||
if( tmp != 0 || ch > 256 )
|
||||
return tmp;
|
||||
@@ -469,7 +469,7 @@ static int hb_sln_try_get_Kbd_State( void )
|
||||
IOcommand = KB_ISSCANCODE;
|
||||
if( ioctl( 0, TCSETSC, &IOcommand ) >= 0 )
|
||||
{
|
||||
/* if SCANCODE mode is set corectly try get KBD state */
|
||||
/* if SCANCODE mode is set correctly try get KBD state */
|
||||
if( ioctl( 0, KDGKBSTATE, &modifiers ) < 0 )
|
||||
modifiers = 0;
|
||||
|
||||
|
||||
@@ -381,16 +381,17 @@ static int KeyTranslationTable[][ 2 ] =
|
||||
|
||||
/* *********************************************************************** */
|
||||
|
||||
#define KeyTranslationTableSize \
|
||||
( sizeof( KeyTranslationTable ) / ( 2 * sizeof ( int ) ) )
|
||||
#define KeyTranslationTableSize HB_SIZEOFARRAY( KeyTranslationTable )
|
||||
|
||||
/* a very simple sort algorithm */
|
||||
static void hb_sln_SortKeyTranslationTable( void )
|
||||
{
|
||||
int i, j, min, KeyTmp[ 2 ];
|
||||
int i;
|
||||
|
||||
for( i = 0; i < ( ( int ) KeyTranslationTableSize - 1 ); i++ )
|
||||
{
|
||||
int j, min, KeyTmp[ 2 ];
|
||||
|
||||
min = i;
|
||||
|
||||
for( j = i + 1; j < ( int ) KeyTranslationTableSize; j++ )
|
||||
@@ -412,11 +413,10 @@ static void hb_sln_SortKeyTranslationTable( void )
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
#if 0
|
||||
for( i = 0; i < KeyTranslationTableSize; i++ )
|
||||
fprintf( stderr, "%02x %8x %8x\n", i, KeyTranslationTable[ i ][ 0 ], KeyTranslationTable[ i ][ 1 ] );
|
||||
*/
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
@@ -424,16 +424,14 @@ static void hb_sln_SortKeyTranslationTable( void )
|
||||
/* standard binary search */
|
||||
static int hb_sln_FindKeyTranslation( int SlangKey )
|
||||
{
|
||||
int Start, Stop, CurPos;
|
||||
|
||||
if( ( SlangKey >= KeyTranslationTable[ 0 ][ 0 ] ) &&
|
||||
( SlangKey <= KeyTranslationTable[ KeyTranslationTableSize - 1 ][ 0 ] ) )
|
||||
{
|
||||
Start = 0; Stop = KeyTranslationTableSize - 1;
|
||||
int Start = 0, Stop = KeyTranslationTableSize - 1;
|
||||
|
||||
while( Start <= Stop )
|
||||
{
|
||||
CurPos = ( Start + Stop ) / 2;
|
||||
int CurPos = ( Start + Stop ) / 2;
|
||||
|
||||
/* fprintf( stderr, "%d %d %d\n", i, KeyTranslationTable[ i ][ 0 ], KeyTranslationTable[ i ][ 1 ] ); */
|
||||
|
||||
|
||||
@@ -349,7 +349,7 @@ void hb_gt_sln_mouse_Init( void )
|
||||
Conn.eventMask = GPM_MOVE | GPM_UP | GPM_DOWN | GPM_DRAG | GPM_DOUBLE;
|
||||
/* give me move events but handle them anyway */
|
||||
Conn.defaultMask= GPM_MOVE | GPM_HARD;
|
||||
/* only pure mouse events, no Ctrl,Alt,Shft events */
|
||||
/* only pure mouse events, no Ctrl,Alt,Shift events */
|
||||
Conn.minMod = 0;
|
||||
Conn.maxMod = 0;
|
||||
|
||||
@@ -396,7 +396,7 @@ void hb_gt_sln_mouse_Exit( void )
|
||||
if( hb_sln_UnderXterm )
|
||||
{
|
||||
const char * DisabTrack = "\033[?1000l"; /* disable mouse tracking */
|
||||
const char * RestoHilit = "\033[?1001r"; /* restore old hilittracking */
|
||||
const char * RestoHilit = "\033[?1001r"; /* restore old hilit tracking */
|
||||
|
||||
/* restore xterm settings */
|
||||
SLtt_write_string( ( char * ) HB_UNCONST( DisabTrack ) );
|
||||
|
||||
@@ -189,7 +189,7 @@ static void hb_gt_std_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
{
|
||||
PHB_GTSTD pGTSTD;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Init(%p,%p,%p,%p)", pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Init(%p,%p,%p,%p)", ( void * ) pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
|
||||
HB_GTLOCAL( pGT ) = pGTSTD = ( PHB_GTSTD ) hb_xgrabz( sizeof( HB_GTSTD ) );
|
||||
|
||||
@@ -242,7 +242,7 @@ static void hb_gt_std_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
pGTSTD->curr_TIO.c_cc[ VMIN ] = 0;
|
||||
#else
|
||||
/* workaround for bug in some Linux kernels (i.e. 3.13.0-64-generic
|
||||
Ubuntu) in which select() unconditionally accepts stdin for
|
||||
*buntu) in which select() unconditionally accepts stdin for
|
||||
reading if c_cc[ VMIN ] = 0 [druzus] */
|
||||
pGTSTD->curr_TIO.c_cc[ VMIN ] = 1;
|
||||
#endif
|
||||
@@ -283,7 +283,7 @@ static void hb_gt_std_Exit( PHB_GT pGT )
|
||||
PHB_GTSTD pGTSTD;
|
||||
int iRow, iCol;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Exit(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Exit(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSELF_REFRESH( pGT );
|
||||
HB_GTSELF_GETPOS( pGT, &iRow, &iCol );
|
||||
@@ -323,7 +323,7 @@ static int hb_gt_std_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
PHB_GTSTD pGTSTD;
|
||||
int ch = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_ReadKey(%p,%d)", pGT, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_ReadKey(%p,%d)", ( void * ) pGT, iEventMask ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( iEventMask );
|
||||
|
||||
@@ -438,7 +438,7 @@ static int hb_gt_std_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
|
||||
static HB_BOOL hb_gt_std_IsColor( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_IsColor(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_IsColor(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -450,7 +450,7 @@ static void hb_gt_std_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
double dCurrentSeconds;
|
||||
PHB_GTSTD pGTSTD;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Tone(%p,%lf,%lf)", ( void * ) pGT, dFrequency, dDuration ) );
|
||||
|
||||
pGTSTD = HB_GTSTD_GET( pGT );
|
||||
|
||||
@@ -475,14 +475,14 @@ static void hb_gt_std_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
|
||||
static void hb_gt_std_Bell( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Bell(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Bell(%p)", ( void * ) pGT ) );
|
||||
|
||||
hb_gt_std_termOut( HB_GTSTD_GET( pGT ), s_szBell, 1 );
|
||||
}
|
||||
|
||||
static const char * hb_gt_std_Version( PHB_GT pGT, int iType )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Version(%p,%d)", pGT, iType ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Version(%p,%d)", ( void * ) pGT, iType ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -494,7 +494,7 @@ static const char * hb_gt_std_Version( PHB_GT pGT, int iType )
|
||||
|
||||
static HB_BOOL hb_gt_std_Suspend( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Suspend(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Suspend(%p)", ( void * ) pGT ) );
|
||||
|
||||
#if defined( HB_HAS_TERMIOS )
|
||||
{
|
||||
@@ -509,7 +509,7 @@ static HB_BOOL hb_gt_std_Suspend( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_std_Resume( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Resume(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Resume(%p)", ( void * ) pGT ) );
|
||||
|
||||
|
||||
#if defined( HB_HAS_TERMIOS )
|
||||
@@ -527,7 +527,7 @@ static void hb_gt_std_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int
|
||||
{
|
||||
int iHeight, iWidth;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Scroll(%p,%d,%d,%d,%d,%d,%d,%d,%d)", pGT, iTop, iLeft, iBottom, iRight, iColor, usChar, iRows, iCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Scroll(%p,%d,%d,%d,%d,%d,%d,%d,%d)", ( void * ) pGT, iTop, iLeft, iBottom, iRight, iColor, usChar, iRows, iCols ) );
|
||||
|
||||
/* Provide some basic scroll support for full screen */
|
||||
HB_GTSELF_GETSIZE( pGT, &iHeight, &iWidth );
|
||||
@@ -598,7 +598,7 @@ static void hb_gt_std_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
int iLineFeed, iBackSpace, iMin;
|
||||
PHB_GTSTD pGTSTD;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Redraw(%p,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iSize ) );
|
||||
|
||||
iLineFeed = iBackSpace = 0;
|
||||
pGTSTD = HB_GTSTD_GET( pGT );
|
||||
@@ -684,7 +684,7 @@ static void hb_gt_std_Refresh( PHB_GT pGT )
|
||||
int iHeight, iSize;
|
||||
PHB_GTSTD pGTSTD;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Refresh(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Refresh(%p)", ( void * ) pGT ) );
|
||||
|
||||
pGTSTD = HB_GTSTD_GET( pGT );
|
||||
HB_GTSELF_GETSIZE( pGT, &iHeight, &pGTSTD->iWidth );
|
||||
@@ -699,10 +699,10 @@ static void hb_gt_std_Refresh( PHB_GT pGT )
|
||||
HB_GTSUPER_REFRESH( pGT );
|
||||
if( pGTSTD->fFullRedraw )
|
||||
{
|
||||
int i;
|
||||
|
||||
if( pGTSTD->iRow < iHeight - 1 )
|
||||
{
|
||||
int i;
|
||||
|
||||
for( i = pGTSTD->iRow + 1; i < iHeight; ++i )
|
||||
hb_gt_std_DispLine( pGT, i, 0, -1 );
|
||||
}
|
||||
@@ -711,7 +711,7 @@ static void hb_gt_std_Refresh( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_std_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Info(%p,%d,%p)", pGT, iType, pInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_std_Info(%p,%d,%p)", ( void * ) pGT, iType, ( void * ) pInfo ) );
|
||||
|
||||
switch( iType )
|
||||
{
|
||||
@@ -730,7 +730,7 @@ static HB_BOOL hb_gt_std_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
|
||||
static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", pFuncTable ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", ( void * ) pFuncTable ) );
|
||||
|
||||
pFuncTable->Init = hb_gt_std_Init;
|
||||
pFuncTable->Exit = hb_gt_std_Exit;
|
||||
|
||||
@@ -10,13 +10,13 @@
|
||||
*
|
||||
* 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
|
||||
* 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.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site https://www.gnu.org/).
|
||||
* along with this program; see the file LICENSE.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
@@ -34,7 +34,7 @@
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
@@ -46,8 +46,6 @@
|
||||
|
||||
/* NOTE: User programs should never call this layer directly! */
|
||||
|
||||
/* *********************************************************************** */
|
||||
|
||||
/* This definition has to be placed before #include "hbapigt.h" */
|
||||
#define HB_GT_NAME NUL
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
/*
|
||||
* Low level tone code common to some GT drivers
|
||||
* Low-level tone code common to some GT drivers
|
||||
*
|
||||
* Copyright 2006 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
* the body of TONE function from Windows taken from GTWIN created by
|
||||
* the body of Tone() function from Windows taken from GTWIN created by
|
||||
* the following authors:
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* Copyright 1999-2006 Paul Tucker <ptucker@sympatico.ca>
|
||||
@@ -51,10 +51,8 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/* NOTE: User programs should never call this layer directly! */
|
||||
|
||||
|
||||
#include "hbgtcore.h"
|
||||
|
||||
#if defined( HB_OS_WIN )
|
||||
@@ -90,7 +88,7 @@ static int hb_Inp9x( unsigned short int usPort )
|
||||
__emit__(0x32,0xE4); /* ASM XOR AH, AH */
|
||||
usVal = _AX;
|
||||
|
||||
#elif defined( __XCC__ ) || defined( __POCC__ ) || defined( __BORLANDC__ )
|
||||
#elif defined( __BORLANDC__ ) || defined( __POCC__ ) || defined( __XCC__ )
|
||||
|
||||
__asm {
|
||||
mov dx, usPort
|
||||
@@ -100,6 +98,7 @@ static int hb_Inp9x( unsigned short int usPort )
|
||||
}
|
||||
|
||||
#elif defined( __MINGW32__ )
|
||||
|
||||
__asm__ __volatile__ ("inb %w1,%b0":"=a" (usVal):"Nd" (usPort));
|
||||
|
||||
#elif defined( __WATCOMC__ )
|
||||
@@ -115,8 +114,6 @@ static int hb_Inp9x( unsigned short int usPort )
|
||||
return usVal;
|
||||
}
|
||||
|
||||
/* *********************************************************************** */
|
||||
|
||||
static int hb_Outp9x( unsigned short int usPort, unsigned short int usVal )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_Outp9x(%hu, %hu)", usPort, usVal ) );
|
||||
@@ -127,7 +124,7 @@ static int hb_Outp9x( unsigned short int usPort, unsigned short int usVal )
|
||||
_AL = usVal;
|
||||
__emit__(0xEE); /* ASM OUT DX, AL */
|
||||
|
||||
#elif defined( __XCC__ ) || defined( __POCC__ ) || defined( __BORLANDC__ )
|
||||
#elif defined( __BORLANDC__ ) || defined( __POCC__ ) || defined( __XCC__ )
|
||||
|
||||
__asm {
|
||||
mov dx, usPort
|
||||
@@ -152,7 +149,6 @@ static int hb_Outp9x( unsigned short int usPort, unsigned short int usVal )
|
||||
return usVal;
|
||||
}
|
||||
|
||||
/* *********************************************************************** */
|
||||
/* dDurat is in seconds */
|
||||
static void hb_gt_w9xTone( double dFreq, double dDurat )
|
||||
{
|
||||
@@ -211,7 +207,6 @@ static void hb_gt_w9xTone( double dFreq, double dDurat )
|
||||
|
||||
#endif
|
||||
|
||||
/* *********************************************************************** */
|
||||
/* dDurat is in seconds */
|
||||
static void hb_gt_wNtTone( double dFreq, double dDurat )
|
||||
{
|
||||
@@ -226,7 +221,6 @@ static void hb_gt_wNtTone( double dFreq, double dDurat )
|
||||
hb_idleSleep( dDurat );
|
||||
}
|
||||
|
||||
/* *********************************************************************** */
|
||||
/* dDuration is in 'Ticks' (18.2 per second) */
|
||||
void hb_gt_winapi_tone( double dFrequency, double dDuration )
|
||||
{
|
||||
@@ -234,7 +228,7 @@ void hb_gt_winapi_tone( double dFrequency, double dDuration )
|
||||
|
||||
/*
|
||||
* According to the Clipper NG, the duration in 'ticks' is truncated to the
|
||||
* interger portion ... Depending on the platform, Harbour allows a finer
|
||||
* integer portion ... Depending on the platform, Harbour allows a finer
|
||||
* resolution, but the minimum is 1 tick (for compatibility)
|
||||
*/
|
||||
/* Convert from ticks to seconds */
|
||||
|
||||
@@ -11,10 +11,10 @@
|
||||
* Now it support the following terminals:
|
||||
* linux, pc-ansi, xterm
|
||||
*
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus /at/ priv.onet.pl>
|
||||
*
|
||||
* I used my code from other GT drivers (GTCRS, GTPCA)
|
||||
*
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus /at/ priv.onet.pl>
|
||||
*
|
||||
* 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)
|
||||
@@ -565,9 +565,9 @@ static void hb_gt_trm_termOut( PHB_GTTRM pTerm, const char * pStr, int iLen )
|
||||
{
|
||||
if( pTerm->iOutBufSize )
|
||||
{
|
||||
int i;
|
||||
while( iLen > 0 )
|
||||
{
|
||||
int i;
|
||||
if( pTerm->iOutBufSize == pTerm->iOutBufIndex )
|
||||
hb_gt_trm_termFlush( pTerm );
|
||||
i = pTerm->iOutBufSize - pTerm->iOutBufIndex;
|
||||
@@ -710,10 +710,10 @@ static void del_efds( PHB_GTTRM pTerm, int fd )
|
||||
|
||||
static void del_all_efds( PHB_GTTRM pTerm )
|
||||
{
|
||||
int i;
|
||||
|
||||
if( pTerm->event_fds != NULL )
|
||||
{
|
||||
int i;
|
||||
|
||||
for( i = 0; i < pTerm->efds_no; i++ )
|
||||
hb_xfree( pTerm->event_fds[ i ] );
|
||||
|
||||
@@ -1006,7 +1006,7 @@ static void mouse_init( PHB_GTTRM pTerm )
|
||||
GPM_MOVE | GPM_DRAG | GPM_UP | GPM_DOWN | GPM_SINGLE | GPM_DOUBLE;
|
||||
/* give me move events but handle them anyway */
|
||||
pTerm->Conn.defaultMask = GPM_MOVE | GPM_HARD;
|
||||
/* report Ctrl,Alt,Shft events */
|
||||
/* report Ctrl,Alt,Shift events */
|
||||
pTerm->Conn.minMod = 0;
|
||||
pTerm->Conn.maxMod = ( ( 1 << KG_SHIFT ) | ( 1 << KG_CTRL ) | ( 1 << KG_ALT ) );
|
||||
gpm_zerobased = 1;
|
||||
@@ -1055,11 +1055,12 @@ static void mouse_exit( PHB_GTTRM pTerm )
|
||||
|
||||
static int read_bufch( PHB_GTTRM pTerm, int fd )
|
||||
{
|
||||
int n = 0, i;
|
||||
int n = 0;
|
||||
|
||||
if( STDIN_BUFLEN > pTerm->stdin_inbuf )
|
||||
{
|
||||
unsigned char buf[ STDIN_BUFLEN ];
|
||||
int i;
|
||||
|
||||
#if defined( HB_OS_UNIX ) || defined( __DJGPP__ )
|
||||
n = read( fd, buf, STDIN_BUFLEN - pTerm->stdin_inbuf );
|
||||
@@ -1082,14 +1083,15 @@ static int read_bufch( PHB_GTTRM pTerm, int fd )
|
||||
static int get_inch( PHB_GTTRM pTerm, HB_MAXINT timeout )
|
||||
{
|
||||
int nRet = 0, nNext = 0, npfd = -1, nchk = pTerm->efds_no, lRead = 0;
|
||||
int mode, i, n, counter;
|
||||
int mode, i, n;
|
||||
evtFD * pefd = NULL;
|
||||
HB_MAXUINT timer;
|
||||
|
||||
timer = hb_timerInit( timeout );
|
||||
HB_MAXUINT timer = hb_timerInit( timeout );
|
||||
|
||||
do
|
||||
{
|
||||
int counter;
|
||||
|
||||
for( i = n = 0; i < pTerm->efds_no; i++ )
|
||||
{
|
||||
if( pTerm->event_fds[ i ]->status == EVTFDSTAT_RUN )
|
||||
@@ -1429,7 +1431,7 @@ again:
|
||||
*/
|
||||
static void hb_gt_trm_LinuxSetTermMode( PHB_GTTRM pTerm, int iAM )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_LinuxSetTermMode(%p,%d)", pTerm, iAM ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_LinuxSetTermMode(%p,%d)", ( void * ) pTerm, iAM ) );
|
||||
|
||||
if( iAM != pTerm->iAM )
|
||||
{
|
||||
@@ -1445,7 +1447,7 @@ static void hb_gt_trm_LinuxTone( PHB_GTTRM pTerm, double dFrequency, double dDur
|
||||
{
|
||||
char escseq[ 64 ];
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_LinuxTone(%p,%lf,%lf)", pTerm, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_LinuxTone(%p,%lf,%lf)", ( void * ) pTerm, dFrequency, dDuration ) );
|
||||
|
||||
if( pTerm->iACSC )
|
||||
{
|
||||
@@ -1463,7 +1465,7 @@ static void hb_gt_trm_LinuxTone( PHB_GTTRM pTerm, double dFrequency, double dDur
|
||||
|
||||
static void hb_gt_trm_LinuxSetCursorStyle( PHB_GTTRM pTerm, int iStyle )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_LinuxSetCursorStyle(%p,%d)", pTerm, iStyle ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_LinuxSetCursorStyle(%p,%d)", ( void * ) pTerm, iStyle ) );
|
||||
|
||||
if( pTerm->iCursorStyle != iStyle )
|
||||
{
|
||||
@@ -1504,7 +1506,7 @@ static void hb_gt_trm_LinuxSetCursorStyle( PHB_GTTRM pTerm, int iStyle )
|
||||
|
||||
static void hb_gt_trm_LinuxSetPalette( PHB_GTTRM pTerm, int iIndexFrom, int iIndexTo )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_LinuxSetPalette(%p,%d,%d)", pTerm, iIndexFrom, iIndexTo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_LinuxSetPalette(%p,%d,%d)", ( void * ) pTerm, iIndexFrom, iIndexTo ) );
|
||||
|
||||
if( iIndexFrom < 0 )
|
||||
iIndexFrom = 0;
|
||||
@@ -1541,7 +1543,7 @@ static void hb_gt_trm_LinuxSetPalette( PHB_GTTRM pTerm, int iIndexFrom, int iInd
|
||||
|
||||
static void hb_gt_trm_LinuxResetPalette( PHB_GTTRM pTerm )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_LinuxResetPalette(%p)", pTerm ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_LinuxResetPalette(%p)", ( void * ) pTerm ) );
|
||||
|
||||
hb_gt_trm_termOut( pTerm, "\033]R", 3 );
|
||||
}
|
||||
@@ -1554,7 +1556,7 @@ static HB_BOOL hb_gt_trm_XtermSetMode( PHB_GTTRM pTerm, int * piRows, int * piCo
|
||||
int iHeight, iWidth;
|
||||
char escseq[ 64 ];
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_XtermSetMode(%p,%d,%d)", pTerm, *piRows, *piCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_XtermSetMode(%p,%d,%d)", ( void * ) pTerm, *piRows, *piCols ) );
|
||||
|
||||
HB_GTSELF_GETSIZE( pTerm->pGT, &iHeight, &iWidth );
|
||||
hb_snprintf( escseq, sizeof( escseq ), "\033[8;%d;%dt", *piRows, *piCols );
|
||||
@@ -1576,7 +1578,7 @@ static HB_BOOL hb_gt_trm_XtermSetMode( PHB_GTTRM pTerm, int * piRows, int * piCo
|
||||
|
||||
static void hb_gt_trm_XtermSetAttributes( PHB_GTTRM pTerm, int iAttr )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_XtermSetAttributes(%p,%d)", pTerm, iAttr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_XtermSetAttributes(%p,%d)", ( void * ) pTerm, iAttr ) );
|
||||
|
||||
if( pTerm->iCurrentSGR != iAttr )
|
||||
{
|
||||
@@ -1592,8 +1594,8 @@ static void hb_gt_trm_XtermSetAttributes( PHB_GTTRM pTerm, int iAttr )
|
||||
{
|
||||
bg = s_AnsiColors[ ( iAttr >> 4 ) & 0x07 ];
|
||||
fg = s_AnsiColors[ iAttr & 0x07 ];
|
||||
bold = iAttr & 0x08 ? 1 : 0;
|
||||
blink = iAttr & 0x80 ? 1 : 0;
|
||||
bold = ( iAttr & 0x08 ) ? 1 : 0;
|
||||
blink = ( iAttr & 0x80 ) ? 1 : 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1856,7 +1858,7 @@ static void hb_gt_trm_XtermSetAttributes( PHB_GTTRM pTerm, int iAttr )
|
||||
|
||||
static void hb_gt_trm_XtermSetTitle( PHB_GTTRM pTerm, const char * szTitle )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_XtermSetTitle(%p,%s)", pTerm, szTitle ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_XtermSetTitle(%p,%s)", ( void * ) pTerm, szTitle ) );
|
||||
|
||||
hb_gt_trm_termOut( pTerm, "\033]0;", 4 );
|
||||
if( szTitle )
|
||||
@@ -1871,7 +1873,7 @@ static void hb_gt_trm_XtermSetTitle( PHB_GTTRM pTerm, const char * szTitle )
|
||||
static HB_BOOL hb_gt_trm_BsdGetCursorPos( PHB_GTTRM pTerm, int * iRow, int * iCol,
|
||||
const char * szPost )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_BsdGetCursorPos(%p,%p,%p,%s)", pTerm, iRow, iCol, szPost ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_BsdGetCursorPos(%p,%p,%p,%s)", ( void * ) pTerm, ( void * ) iRow, ( void * ) iCol, szPost ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( szPost );
|
||||
|
||||
@@ -1886,7 +1888,7 @@ static HB_BOOL hb_gt_trm_BsdGetCursorPos( PHB_GTTRM pTerm, int * iRow, int * iCo
|
||||
|
||||
static void hb_gt_trm_BsdSetCursorStyle( PHB_GTTRM pTerm, int iStyle )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_BsdSetCursorStyle(%p,%d)", pTerm, iStyle ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_BsdSetCursorStyle(%p,%d)", ( void * ) pTerm, iStyle ) );
|
||||
|
||||
if( pTerm->iCursorStyle != iStyle )
|
||||
{
|
||||
@@ -1922,7 +1924,7 @@ static void hb_gt_trm_BsdTone( PHB_GTTRM pTerm, double dFrequency, double dDurat
|
||||
{
|
||||
char escseq[ 64 ];
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_BsdTone(%p,%lf,%lf)", pTerm, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_BsdTone(%p,%lf,%lf)", ( void * ) pTerm, dFrequency, dDuration ) );
|
||||
|
||||
hb_snprintf( escseq, sizeof( escseq ), "\033[=%d;%dB\007",
|
||||
( int ) dFrequency, ( int ) ( dDuration * 10.0 / 18.2 ) );
|
||||
@@ -1940,7 +1942,7 @@ static void hb_gt_trm_BsdTone( PHB_GTTRM pTerm, double dFrequency, double dDurat
|
||||
*/
|
||||
static void hb_gt_trm_AnsiSetTermMode( PHB_GTTRM pTerm, int iAM )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiSetTermMode(%p,%d)", pTerm, iAM ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiSetTermMode(%p,%d)", ( void * ) pTerm, iAM ) );
|
||||
|
||||
if( iAM != pTerm->iAM )
|
||||
{
|
||||
@@ -1962,7 +1964,7 @@ static void hb_gt_trm_AnsiSetTermMode( PHB_GTTRM pTerm, int iAM )
|
||||
static HB_BOOL hb_gt_trm_AnsiGetCursorPos( PHB_GTTRM pTerm, int * iRow, int * iCol,
|
||||
const char * szPost )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiGetCursorPos(%p,%p,%p,%s)", pTerm, iRow, iCol, szPost ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiGetCursorPos(%p,%p,%p,%s)", ( void * ) pTerm, ( void * ) iRow, ( void * ) iCol, szPost ) );
|
||||
|
||||
if( pTerm->fPosAnswer )
|
||||
{
|
||||
@@ -1984,7 +1986,7 @@ static HB_BOOL hb_gt_trm_AnsiGetCursorPos( PHB_GTTRM pTerm, int * iRow, int * iC
|
||||
timer = hb_timerInit( timeout );
|
||||
for( ;; )
|
||||
{
|
||||
/* loking for cursor position in "\033[%d;%dR" */
|
||||
/* looking for cursor position in "\033[%d;%dR" */
|
||||
while( j < n && rdbuf[ j ] != '\033' )
|
||||
++j;
|
||||
if( n - j >= 6 )
|
||||
@@ -2064,7 +2066,7 @@ static HB_BOOL hb_gt_trm_AnsiGetCursorPos( PHB_GTTRM pTerm, int * iRow, int * iC
|
||||
|
||||
static void hb_gt_trm_AnsiSetCursorPos( PHB_GTTRM pTerm, int iRow, int iCol )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiSetCursorPos(%p,%d,%d)", pTerm, iRow, iCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiSetCursorPos(%p,%d,%d)", ( void * ) pTerm, iRow, iCol ) );
|
||||
|
||||
if( pTerm->iRow != iRow || pTerm->iCol != iCol )
|
||||
{
|
||||
@@ -2078,7 +2080,7 @@ static void hb_gt_trm_AnsiSetCursorPos( PHB_GTTRM pTerm, int iRow, int iCol )
|
||||
|
||||
static void hb_gt_trm_AnsiSetCursorStyle( PHB_GTTRM pTerm, int iStyle )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiSetCursorStyle(%p,%d)", pTerm, iStyle ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiSetCursorStyle(%p,%d)", ( void * ) pTerm, iStyle ) );
|
||||
|
||||
if( pTerm->iCursorStyle != iStyle )
|
||||
{
|
||||
@@ -2090,7 +2092,7 @@ static void hb_gt_trm_AnsiSetCursorStyle( PHB_GTTRM pTerm, int iStyle )
|
||||
|
||||
static void hb_gt_trm_AnsiSetAttributes( PHB_GTTRM pTerm, int iAttr )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiSetAttributes(%p,%d)", pTerm, iAttr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiSetAttributes(%p,%d)", ( void * ) pTerm, iAttr ) );
|
||||
|
||||
if( pTerm->iCurrentSGR != iAttr )
|
||||
{
|
||||
@@ -2101,11 +2103,11 @@ static void hb_gt_trm_AnsiSetAttributes( PHB_GTTRM pTerm, int iAttr )
|
||||
buff[ 0 ] = 0x1b;
|
||||
buff[ 1 ] = '[';
|
||||
|
||||
acsc = iAttr & HB_GTTRM_ATTR_ACSC ? 1 : 0;
|
||||
acsc = ( iAttr & HB_GTTRM_ATTR_ACSC ) ? 1 : 0;
|
||||
bg = s_AnsiColors[ ( iAttr >> 4 ) & 0x07 ];
|
||||
fg = s_AnsiColors[ iAttr & 0x07 ];
|
||||
bold = iAttr & 0x08 ? 1 : 0;
|
||||
blink = iAttr & 0x80 ? 1 : 0;
|
||||
bold = ( iAttr & 0x08 ) ? 1 : 0;
|
||||
blink = ( iAttr & 0x80 ) ? 1 : 0;
|
||||
|
||||
if( pTerm->iCurrentSGR == -1 )
|
||||
{
|
||||
@@ -2193,7 +2195,7 @@ static int hb_gt_trm_AnsiGetAcsc( PHB_GTTRM pTerm, unsigned char c )
|
||||
{
|
||||
const unsigned char * ptr;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiGetAcsc(%p,%d)", pTerm, c ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiGetAcsc(%p,%d)", ( void * ) pTerm, c ) );
|
||||
|
||||
for( ptr = ( const unsigned char * ) pTerm->szAcsc; *ptr && *( ptr + 1 ); ptr += 2 )
|
||||
{
|
||||
@@ -2223,7 +2225,7 @@ static int hb_gt_trm_AnsiGetAcsc( PHB_GTTRM pTerm, unsigned char c )
|
||||
|
||||
static HB_BOOL hb_gt_trm_AnsiSetMode( PHB_GTTRM pTerm, int * piRows, int * piCols )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiSetMode(%p,%d,%d)", pTerm, *piRows, *piCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiSetMode(%p,%d,%d)", ( void * ) pTerm, *piRows, *piCols ) );
|
||||
|
||||
if( pTerm->terminal_ext & TERM_PUTTY )
|
||||
return hb_gt_trm_XtermSetMode( pTerm, piRows, piCols );
|
||||
@@ -2233,7 +2235,7 @@ static HB_BOOL hb_gt_trm_AnsiSetMode( PHB_GTTRM pTerm, int * piRows, int * piCol
|
||||
|
||||
static void hb_gt_trm_AnsiBell( PHB_GTTRM pTerm )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiBell(%p)", pTerm ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiBell(%p)", ( void * ) pTerm ) );
|
||||
|
||||
hb_gt_trm_termOut( pTerm, s_szBell, 1 );
|
||||
hb_gt_trm_termFlush( pTerm );
|
||||
@@ -2243,7 +2245,7 @@ static void hb_gt_trm_AnsiTone( PHB_GTTRM pTerm, double dFrequency, double dDura
|
||||
{
|
||||
double dCurrentSeconds;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiTone(%p,%lf,%lf)", pTerm, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiTone(%p,%lf,%lf)", ( void * ) pTerm, dFrequency, dDuration ) );
|
||||
|
||||
/* Output an ASCII BEL character to cause a sound */
|
||||
/* but throttle to max once per second, in case of sound */
|
||||
@@ -2266,7 +2268,7 @@ static void hb_gt_trm_AnsiTone( PHB_GTTRM pTerm, double dFrequency, double dDura
|
||||
|
||||
static void hb_gt_trm_AnsiInit( PHB_GTTRM pTerm )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiInit(%p)", pTerm ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiInit(%p)", ( void * ) pTerm ) );
|
||||
|
||||
pTerm->iCurrentSGR = pTerm->iRow = pTerm->iCol =
|
||||
pTerm->iCursorStyle = pTerm->iACSC = pTerm->iAM = -1;
|
||||
@@ -2274,7 +2276,7 @@ static void hb_gt_trm_AnsiInit( PHB_GTTRM pTerm )
|
||||
|
||||
static void hb_gt_trm_AnsiExit( PHB_GTTRM pTerm )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiExit(%p)", pTerm ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_AnsiExit(%p)", ( void * ) pTerm ) );
|
||||
|
||||
/* set default color */
|
||||
pTerm->SetAttributes( pTerm, 0x07 & pTerm->iAttrMask );
|
||||
@@ -2354,7 +2356,7 @@ static HB_BOOL hb_trm_isUTF8( PHB_GTTRM pTerm )
|
||||
|
||||
static void hb_gt_trm_PutStr( PHB_GTTRM pTerm, int iRow, int iCol, int iAttr, const char * pStr, int iLen, int iChars )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_PutStr(%p,%d,%d,%d,%p,%d,%d)", pTerm, iRow, iCol, iAttr, pStr, iLen, iChars ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_PutStr(%p,%d,%d,%d,%p,%d,%d)", ( void * ) pTerm, iRow, iCol, iAttr, ( const void * ) pStr, iLen, iChars ) );
|
||||
|
||||
if( pTerm->iOutBufSize )
|
||||
{
|
||||
@@ -2372,7 +2374,7 @@ static void hb_gt_trm_PutStr( PHB_GTTRM pTerm, int iRow, int iCol, int iAttr, co
|
||||
|
||||
static void hb_gt_trm_SetPalette( PHB_GTTRM pTerm, int iIndexFrom, int iIndexTo )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetPalette(%p,%d,%d)", pTerm, iIndexFrom, iIndexTo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetPalette(%p,%d,%d)", ( void * ) pTerm, iIndexFrom, iIndexTo ) );
|
||||
|
||||
if( pTerm->terminal_type == TERM_LINUX ||
|
||||
( pTerm->terminal_ext & TERM_PUTTY ) )
|
||||
@@ -2383,7 +2385,7 @@ static void hb_gt_trm_SetPalette( PHB_GTTRM pTerm, int iIndexFrom, int iIndexTo
|
||||
|
||||
static void hb_gt_trm_ResetPalette( PHB_GTTRM pTerm )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_ResetPalette(%p)", pTerm ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_ResetPalette(%p)", ( void * ) pTerm ) );
|
||||
|
||||
if( pTerm->terminal_type == TERM_LINUX ||
|
||||
( pTerm->terminal_ext & TERM_PUTTY ) )
|
||||
@@ -2394,7 +2396,7 @@ static void hb_gt_trm_ResetPalette( PHB_GTTRM pTerm )
|
||||
|
||||
static void hb_gt_trm_SetTitle( PHB_GTTRM pTerm, const char * szTitle )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetTitle(%p,%s)", pTerm, szTitle ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetTitle(%p,%s)", ( void * ) pTerm, szTitle ) );
|
||||
|
||||
if( pTerm->terminal_type == TERM_XTERM ||
|
||||
( pTerm->terminal_ext & TERM_PUTTY ) )
|
||||
@@ -2410,7 +2412,7 @@ static void hb_gt_trm_SetKeyTrans( PHB_GTTRM pTerm )
|
||||
cdpHost = HB_GTSELF_HOSTCP( pTerm->pGT );
|
||||
int i;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetKeyTrans(%p,%p,%p)", pTerm, cdpTerm, cdpHost ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetKeyTrans(%p,%p,%p)", ( void * ) pTerm, ( void * ) cdpTerm, ( void * ) cdpHost ) );
|
||||
|
||||
for( i = 0; i < 256; ++i )
|
||||
pTerm->keyTransTbl[ i ] = ( unsigned char )
|
||||
@@ -2422,15 +2424,15 @@ static void hb_gt_trm_SetDispTrans( PHB_GTTRM pTerm, int box )
|
||||
{
|
||||
PHB_CODEPAGE cdpTerm = HB_GTSELF_TERMCP( pTerm->pGT ),
|
||||
cdpHost = HB_GTSELF_HOSTCP( pTerm->pGT );
|
||||
int i, ch, mode;
|
||||
int i;
|
||||
|
||||
memset( pTerm->chrattr, 0, sizeof( pTerm->chrattr ) );
|
||||
memset( pTerm->boxattr, 0, sizeof( pTerm->boxattr ) );
|
||||
|
||||
for( i = 0; i < 256; i++ )
|
||||
{
|
||||
ch = pTerm->charmap[ i ] & 0xffff;
|
||||
mode = ! pTerm->fUTF8 ? ( pTerm->charmap[ i ] >> 16 ) & 0xff : 1;
|
||||
int ch = pTerm->charmap[ i ] & 0xffff;
|
||||
int mode = ! pTerm->fUTF8 ? ( pTerm->charmap[ i ] >> 16 ) & 0xff : 1;
|
||||
|
||||
switch( mode )
|
||||
{
|
||||
@@ -3144,7 +3146,7 @@ static void hb_gt_trm_SetTerm( PHB_GTTRM pTerm )
|
||||
const char * szTerm;
|
||||
int iValue;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetTerm(%p)", pTerm ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetTerm(%p)", ( void * ) pTerm ) );
|
||||
|
||||
if( pTerm->iOutBufSize == 0 )
|
||||
{
|
||||
@@ -3324,7 +3326,7 @@ static void hb_gt_trm_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
int iRows = 24, iCols = 80;
|
||||
PHB_GTTRM pTerm;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Init(%p,%p,%p,%p)", pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Init(%p,%p,%p,%p)", ( void * ) pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
|
||||
HB_GTLOCAL( pGT ) = pTerm = ( PHB_GTTRM ) hb_xgrabz( sizeof( HB_GTTRM ) );
|
||||
|
||||
@@ -3372,7 +3374,7 @@ static void hb_gt_trm_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
|
||||
memset( pTerm->curr_TIO.c_cc, 0, NCCS );
|
||||
/* workaround for bug in some Linux kernels (i.e. 3.13.0-64-generic
|
||||
Ubuntu) in which select() unconditionally accepts stdin for
|
||||
*buntu) in which select() unconditionally accepts stdin for
|
||||
reading if c_cc[ VMIN ] = 0 [druzus] */
|
||||
pTerm->curr_TIO.c_cc[ VMIN ] = 1;
|
||||
/* pTerm->curr_TIO.c_cc[ VMIN ] = 0; */
|
||||
@@ -3424,7 +3426,7 @@ static void hb_gt_trm_Exit( PHB_GT pGT )
|
||||
{
|
||||
PHB_GTTRM pTerm;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Exit(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Exit(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSELF_REFRESH( pGT );
|
||||
|
||||
@@ -3461,7 +3463,7 @@ static void hb_gt_trm_Exit( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_trm_mouse_IsPresent( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_IsPresent(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_IsPresent(%p)", ( void * ) pGT ) );
|
||||
|
||||
return HB_GTTRM_GET( pGT )->mouse_type != MOUSE_NONE;
|
||||
}
|
||||
@@ -3470,7 +3472,7 @@ static void hb_gt_trm_mouse_Show( PHB_GT pGT )
|
||||
{
|
||||
PHB_GTTRM pTerm;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_Show(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_Show(%p)", ( void * ) pGT ) );
|
||||
|
||||
pTerm = HB_GTTRM_GET( pGT );
|
||||
#if defined( HB_HAS_GPM )
|
||||
@@ -3482,7 +3484,7 @@ static void hb_gt_trm_mouse_Show( PHB_GT pGT )
|
||||
|
||||
static void hb_gt_trm_mouse_Hide( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_Hide(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_Hide(%p)", ( void * ) pGT ) );
|
||||
|
||||
#if defined( HB_HAS_GPM )
|
||||
if( HB_GTTRM_GET( pGT )->mouse_type & MOUSE_GPM )
|
||||
@@ -3498,7 +3500,7 @@ static void hb_gt_trm_mouse_GetPos( PHB_GT pGT, int * piRow, int * piCol )
|
||||
{
|
||||
PHB_GTTRM pTerm;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_Col(%p,%p,%p)", pGT, piRow, piCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_Col(%p,%p,%p)", ( void * ) pGT, ( void * ) piRow, ( void * ) piCol ) );
|
||||
|
||||
pTerm = HB_GTTRM_GET( pGT );
|
||||
*piRow = pTerm->mLastEvt.row;
|
||||
@@ -3509,7 +3511,7 @@ static void hb_gt_trm_mouse_SetPos( PHB_GT pGT, int iRow, int iCol )
|
||||
{
|
||||
PHB_GTTRM pTerm;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_SetPos(%p,%i,%i)", pGT, iRow, iCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_SetPos(%p,%i,%i)", ( void * ) pGT, iRow, iCol ) );
|
||||
|
||||
pTerm = HB_GTTRM_GET( pGT );
|
||||
/* it does really nothing */
|
||||
@@ -3523,7 +3525,7 @@ static HB_BOOL hb_gt_trm_mouse_ButtonState( PHB_GT pGT, int iButton )
|
||||
PHB_GTTRM pTerm;
|
||||
HB_BOOL ret = HB_FALSE;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_ButtonState(%p,%i)", pGT, iButton ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_ButtonState(%p,%i)", ( void * ) pGT, iButton ) );
|
||||
|
||||
pTerm = HB_GTTRM_GET( pGT );
|
||||
if( pTerm->mouse_type != MOUSE_NONE )
|
||||
@@ -3547,7 +3549,7 @@ static HB_BOOL hb_gt_trm_mouse_ButtonState( PHB_GT pGT, int iButton )
|
||||
|
||||
static int hb_gt_trm_mouse_CountButton( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_CountButton(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_mouse_CountButton(%p)", ( void * ) pGT ) );
|
||||
|
||||
return HB_GTTRM_GET( pGT )->mButtons;
|
||||
}
|
||||
@@ -3556,7 +3558,7 @@ static int hb_gt_trm_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
{
|
||||
int iKey;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_ReadKey(%p,%d)", pGT, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_ReadKey(%p,%d)", ( void * ) pGT, iEventMask ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( iEventMask );
|
||||
|
||||
@@ -3582,7 +3584,7 @@ static void hb_gt_trm_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
{
|
||||
PHB_GTTRM pTerm;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Tone(%p,%lf,%lf)", ( void * ) pGT, dFrequency, dDuration ) );
|
||||
|
||||
pTerm = HB_GTTRM_GET( pGT );
|
||||
pTerm->Tone( pTerm, dFrequency, dDuration );
|
||||
@@ -3592,7 +3594,7 @@ static void hb_gt_trm_Bell( PHB_GT pGT )
|
||||
{
|
||||
PHB_GTTRM pTerm;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Bell(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Bell(%p)", ( void * ) pGT ) );
|
||||
|
||||
pTerm = HB_GTTRM_GET( pGT );
|
||||
pTerm->Bell( pTerm );
|
||||
@@ -3600,7 +3602,7 @@ static void hb_gt_trm_Bell( PHB_GT pGT )
|
||||
|
||||
static const char * hb_gt_trm_Version( PHB_GT pGT, int iType )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Version(%p,%d)", pGT, iType ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Version(%p,%d)", ( void * ) pGT, iType ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -3614,7 +3616,7 @@ static HB_BOOL hb_gt_trm_Suspend( PHB_GT pGT )
|
||||
{
|
||||
PHB_GTTRM pTerm;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Suspend(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Suspend(%p)", ( void * ) pGT ) );
|
||||
|
||||
pTerm = HB_GTTRM_GET( pGT );
|
||||
if( pTerm->mouse_type & MOUSE_XTERM )
|
||||
@@ -3633,7 +3635,7 @@ static HB_BOOL hb_gt_trm_Resume( PHB_GT pGT )
|
||||
PHB_GTTRM pTerm;
|
||||
int iHeight, iWidth;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Resume(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Resume(%p)", ( void * ) pGT ) );
|
||||
|
||||
pTerm = HB_GTTRM_GET( pGT );
|
||||
#if defined( HB_OS_UNIX ) || defined( __DJGPP__ )
|
||||
@@ -3656,7 +3658,7 @@ static HB_BOOL hb_gt_trm_Resume( PHB_GT pGT )
|
||||
static void hb_gt_trm_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight,
|
||||
int iColor, HB_USHORT usChar, int iRows, int iCols )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Scroll(%p,%d,%d,%d,%d,%d,%d,%d,%d)", pGT, iTop, iLeft, iBottom, iRight, iColor, usChar, iRows, iCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Scroll(%p,%d,%d,%d,%d,%d,%d,%d,%d)", ( void * ) pGT, iTop, iLeft, iBottom, iRight, iColor, usChar, iRows, iCols ) );
|
||||
|
||||
/* Provide some basic scroll support for full screen */
|
||||
if( iCols == 0 && iRows > 0 && iTop == 0 && iLeft == 0 )
|
||||
@@ -3689,7 +3691,7 @@ static void hb_gt_trm_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int
|
||||
|
||||
static HB_BOOL hb_gt_trm_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetMode(%p,%d,%d)", pGT, iRows, iCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetMode(%p,%d,%d)", ( void * ) pGT, iRows, iCols ) );
|
||||
|
||||
if( iRows > 0 && iCols > 0 )
|
||||
{
|
||||
@@ -3707,7 +3709,7 @@ static void hb_gt_trm_SetBlink( PHB_GT pGT, HB_BOOL fBlink )
|
||||
{
|
||||
PHB_GTTRM pTerm;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetBlink(%p,%d)", pGT, ( int ) fBlink ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetBlink(%p,%d)", ( void * ) pGT, ( int ) fBlink ) );
|
||||
|
||||
pTerm = HB_GTTRM_GET( pGT );
|
||||
|
||||
@@ -3738,7 +3740,7 @@ static void hb_gt_trm_SetBlink( PHB_GT pGT, HB_BOOL fBlink )
|
||||
|
||||
static HB_BOOL hb_gt_trm_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const char * pszHostCDP, HB_BOOL fBox )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetDispCP(%p,%s,%s,%d)", pGT, pszTermCDP, pszHostCDP, ( int ) fBox ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetDispCP(%p,%s,%s,%d)", ( void * ) pGT, pszTermCDP, pszHostCDP, ( int ) fBox ) );
|
||||
|
||||
if( HB_GTSUPER_SETDISPCP( pGT, pszTermCDP, pszHostCDP, fBox ) )
|
||||
{
|
||||
@@ -3752,7 +3754,7 @@ static HB_BOOL hb_gt_trm_SetDispCP( PHB_GT pGT, const char * pszTermCDP, const c
|
||||
#ifndef HB_GT_UNICODE_BUF
|
||||
static HB_BOOL hb_gt_trm_SetKeyCP( PHB_GT pGT, const char * pszTermCDP, const char * pszHostCDP )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetKeyCP(%p,%s,%s)", pGT, pszTermCDP, pszHostCDP ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_SetKeyCP(%p,%s,%s)", ( void * ) pGT, pszTermCDP, pszHostCDP ) );
|
||||
|
||||
if( HB_GTSUPER_SETKEYCP( pGT, pszTermCDP, pszHostCDP ) )
|
||||
{
|
||||
@@ -3771,7 +3773,7 @@ static void hb_gt_trm_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
HB_USHORT usChar;
|
||||
int iLen, iChars, iAttribute, iColor;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Redraw(%p,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iSize ) );
|
||||
|
||||
iLen = iChars = iAttribute = 0;
|
||||
pTerm = HB_GTTRM_GET( pGT );
|
||||
@@ -3863,7 +3865,7 @@ static void hb_gt_trm_Refresh( PHB_GT pGT )
|
||||
HB_SIZE nLineBufSize;
|
||||
PHB_GTTRM pTerm;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Refresh(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Refresh(%p)", ( void * ) pGT ) );
|
||||
|
||||
pTerm = HB_GTTRM_GET( pGT );
|
||||
|
||||
@@ -3903,7 +3905,7 @@ static HB_BOOL hb_gt_trm_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
void * hVal;
|
||||
int iVal;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Info(%p,%d,%p)", pGT, iType, pInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_trm_Info(%p,%d,%p)", ( void * ) pGT, iType, ( void * ) pInfo ) );
|
||||
|
||||
pTerm = HB_GTTRM_GET( pGT );
|
||||
switch( iType )
|
||||
@@ -4031,7 +4033,7 @@ static HB_BOOL hb_gt_trm_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
|
||||
static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", pFuncTable ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", ( void * ) pFuncTable ) );
|
||||
|
||||
pFuncTable->Init = hb_gt_trm_Init;
|
||||
pFuncTable->Exit = hb_gt_trm_Exit;
|
||||
|
||||
@@ -10,8 +10,6 @@
|
||||
* Copyright 1999-2000 Paul Tucker <ptucker@sympatico.ca>
|
||||
* (with 2004 work on Readkey)
|
||||
*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999-2010 Viktor Szakats (vszakats.net/harbour)
|
||||
* hb_gt_win_CtrlHandler()
|
||||
* hb_gt_win_SetCloseButton()
|
||||
@@ -21,8 +19,6 @@
|
||||
* hb_gt_Tone()
|
||||
* hb_gt_ReadKey()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
* 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)
|
||||
@@ -30,13 +26,13 @@
|
||||
*
|
||||
* 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
|
||||
* 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.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site https://www.gnu.org/).
|
||||
* along with this program; see the file LICENSE.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
@@ -54,7 +50,7 @@
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
@@ -426,7 +422,7 @@ static void hb_gt_win_xGetScreenContents( PHB_GT pGT, SMALL_RECT * psrWin )
|
||||
HB_BYTE bxAttr;
|
||||
#endif
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_xGetScreenContents(%p,%p)", pGT, psrWin ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_xGetScreenContents(%p,%p)", ( void * ) pGT, ( void * ) psrWin ) );
|
||||
|
||||
#if ! defined( UNICODE )
|
||||
bxAttr = 0;
|
||||
@@ -466,7 +462,7 @@ static void hb_gt_win_xGetScreenContents( PHB_GT pGT, SMALL_RECT * psrWin )
|
||||
|
||||
static void hb_gt_win_xInitScreenParam( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_xInitScreenParam(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_xInitScreenParam(%p)", ( void * ) pGT ) );
|
||||
|
||||
if( GetConsoleScreenBufferInfo( s_HOutput, &s_csbi ) )
|
||||
{
|
||||
@@ -492,7 +488,7 @@ static void hb_gt_win_xInitScreenParam( PHB_GT pGT )
|
||||
s_iUpdtBottom = s_iUpdtRight = 0;
|
||||
|
||||
/*
|
||||
* Unfortunatelly Windows refuse to read to big area :-(
|
||||
* Unfortunately Windows refuse to read to big area :-(
|
||||
* (I do not know why) so we cannot read the whole console
|
||||
* buffer { 0, 0, s_csbi.dwSize.Y - 1, s_csbi.dwSize.X - 1 }
|
||||
* because it reads nothing, [druzus]
|
||||
@@ -729,7 +725,7 @@ static HB_BOOL hb_gt_win_SetCloseButton( HB_BOOL bSet, HB_BOOL bClosable )
|
||||
|
||||
static void hb_gt_win_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFilenoStdout, HB_FHANDLE hFilenoStderr )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Init(%p,%p,%p,%p)", pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Init(%p,%p,%p,%p)", ( void * ) pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
|
||||
s_fWin9x = hb_iswin9x();
|
||||
|
||||
@@ -753,8 +749,8 @@ static void hb_gt_win_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
* This is a hack for MSYS console. It does not support full screen output
|
||||
* so nothing can be seen on the screen and we have to close the MSYS
|
||||
* console to be able to allocate the MS-Windows one.
|
||||
* Unfortunatelly I do not know any method to detect the MSYS console
|
||||
* so I used this hack with checking OSTYPE environemnt variable. [druzus]
|
||||
* Unfortunately I do not know any method to detect the MSYS console
|
||||
* so I used this hack with checking OSTYPE environment variable. [druzus]
|
||||
*/
|
||||
{
|
||||
TCHAR lpOsType[ 16 ];
|
||||
@@ -785,7 +781,7 @@ static void hb_gt_win_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
}
|
||||
#endif
|
||||
if( s_HInput == INVALID_HANDLE_VALUE )
|
||||
hb_errInternal( 10001, "Can't allocate console", NULL, NULL );
|
||||
hb_errInternal( 10001, "Could not allocate console", NULL, NULL );
|
||||
}
|
||||
|
||||
/* Add Ctrl+Break handler [vszakats] */
|
||||
@@ -801,7 +797,7 @@ static void hb_gt_win_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
0, 0 );
|
||||
|
||||
if( s_HOutput == INVALID_HANDLE_VALUE )
|
||||
hb_errInternal( 10001, "Can't allocate console (output)", NULL, NULL );
|
||||
hb_errInternal( 10001, "Could not allocate console (output)", NULL, NULL );
|
||||
|
||||
s_HInput = CreateFile( TEXT( "CONIN$" ), /* filename */
|
||||
GENERIC_READ | GENERIC_WRITE, /* Access flag */
|
||||
@@ -811,7 +807,7 @@ static void hb_gt_win_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
0, 0 );
|
||||
|
||||
if( s_HInput == INVALID_HANDLE_VALUE )
|
||||
hb_errInternal( 10001, "Can't allocate console (input)", NULL, NULL );
|
||||
hb_errInternal( 10001, "Could not allocate console (input)", NULL, NULL );
|
||||
|
||||
GetConsoleScreenBufferInfo( s_HOutput, &s_csbi );
|
||||
|
||||
@@ -847,7 +843,7 @@ static void hb_gt_win_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
|
||||
static void hb_gt_win_Exit( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Exit(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Exit(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSELF_REFRESH( pGT );
|
||||
|
||||
@@ -886,7 +882,7 @@ static HB_BOOL hb_gt_win_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
{
|
||||
HB_BOOL fRet = HB_FALSE;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_SetMode(%p,%d,%d)", pGT, iRows, iCols ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_SetMode(%p,%d,%d)", ( void * ) pGT, iRows, iCols ) );
|
||||
|
||||
if( s_HOutput != INVALID_HANDLE_VALUE && iRows > 0 && iCols > 0 )
|
||||
{
|
||||
@@ -981,7 +977,7 @@ static HB_BOOL hb_gt_win_SetMode( PHB_GT pGT, int iRows, int iCols )
|
||||
|
||||
static const char * hb_gt_win_Version( PHB_GT pGT, int iType )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Version(%p,%d)", pGT, iType ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Version(%p,%d)", ( void * ) pGT, iType ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -995,7 +991,7 @@ static const char * hb_gt_win_Version( PHB_GT pGT, int iType )
|
||||
|
||||
static HB_BOOL hb_gt_win_PostExt( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_PostExt(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_PostExt(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSUPER_POSTEXT( pGT );
|
||||
if( s_pCharInfoScreen )
|
||||
@@ -1007,7 +1003,7 @@ static HB_BOOL hb_gt_win_PostExt( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_win_Suspend( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Suspend(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Suspend(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -1022,7 +1018,7 @@ static HB_BOOL hb_gt_win_Suspend( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_win_Resume( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Resume(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Resume(%p)", ( void * ) pGT ) );
|
||||
|
||||
if( s_pCharInfoScreen )
|
||||
{
|
||||
@@ -1181,7 +1177,7 @@ static int hb_gt_win_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
{
|
||||
int iKey = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_ReadKey(%p,%d)", pGT, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_ReadKey(%p,%d)", ( void * ) pGT, iEventMask ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( iEventMask );
|
||||
|
||||
@@ -1204,7 +1200,7 @@ static int hb_gt_win_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
{
|
||||
#if defined( UNICODE )
|
||||
/* Workaround for UNICOWS bug:
|
||||
http://blogs.msdn.com/michkap/archive/2007/01/13/1460724.aspx
|
||||
https://web.archive.org/web/blogs.msdn.com/michkap/archive/2007/01/13/1460724.aspx
|
||||
[vszakats] */
|
||||
|
||||
if( s_fWin9x )
|
||||
@@ -1217,10 +1213,10 @@ static int hb_gt_win_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
#endif
|
||||
|
||||
/* Read keyboard input */
|
||||
ReadConsoleInput( s_HInput, /* input buffer handle */
|
||||
s_irBuffer, /* buffer to read into */
|
||||
INPUT_BUFFER_LEN, /* size of read buffer */
|
||||
&s_dwNumRead ); /* number of records read */
|
||||
ReadConsoleInput( s_HInput, /* input buffer handle */
|
||||
s_irBuffer, /* buffer to read into */
|
||||
INPUT_BUFFER_LEN, /* size of read buffer */
|
||||
&s_dwNumRead ); /* number of records read */
|
||||
/* Set up to process the first input event */
|
||||
s_dwNumIndex = 0;
|
||||
|
||||
@@ -1347,10 +1343,10 @@ static int hb_gt_win_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Under Win9x, Upper row keys are affected by caps-lock
|
||||
* Under Win9x, upper row keys are affected by caps-lock
|
||||
* and should not be. There are 2 solutions - the first
|
||||
* is to enable the calling of SpecialHandling below - which
|
||||
* will only be activated under Win9x (Preferrably under user
|
||||
* will only be activated under Win9x (Preferably under user
|
||||
* control, since they know if their keyboard isn't working), or
|
||||
* just enable KeyB handling in config.sys, and do not enable the
|
||||
* following call.
|
||||
@@ -1359,7 +1355,7 @@ static int hb_gt_win_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
* (With some clarification by Paul Tucker)
|
||||
* If making this fix the default under Win98, then it doesn't
|
||||
* work for non-US keyboards. (The default has now been changed)
|
||||
* I tried to replicate the problem under Win98SE (spanish),
|
||||
* I tried to replicate the problem under Win98SE (Spanish),
|
||||
* but it works fine. I hope someone could tell me how the
|
||||
* problem appears, for try to fix it.
|
||||
|
||||
@@ -1733,7 +1729,7 @@ static int hb_gt_win_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
{
|
||||
int iFlags = hb_gt_win_keyFlags( pInRec->Event.MouseEvent.dwControlKeyState );
|
||||
|
||||
/* mouse wheel events use screen based mouse possition */
|
||||
/* mouse wheel events use screen based mouse position */
|
||||
if( pInRec->Event.MouseEvent.dwEventFlags == MOUSE_HWHEELED )
|
||||
{
|
||||
/* unsupported */
|
||||
@@ -1809,7 +1805,7 @@ static int hb_gt_win_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
/* dDuration is in 'Ticks' (18.2 per second) */
|
||||
static void hb_gt_win_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Tone(%p,%lf,%lf)", ( void * ) pGT, dFrequency, dDuration ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -1870,7 +1866,7 @@ static HB_BOOL hb_gt_win_FullScreen( HB_BOOL bFullScreen )
|
||||
|
||||
static HB_BOOL hb_gt_win_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Info(%p,%d,%p)", pGT, iType, pInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Info(%p,%d,%p)", ( void * ) pGT, iType, pInfo ) );
|
||||
|
||||
switch( iType )
|
||||
{
|
||||
@@ -2153,7 +2149,7 @@ static int hb_gt_win_mouse_CountButton( PHB_GT pGT )
|
||||
|
||||
static void hb_gt_win_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Redraw(%p,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iSize ) );
|
||||
|
||||
if( iSize > 0 && s_pCharInfoScreen &&
|
||||
iRow < ( int ) _GetScreenHeight() && iCol < ( int ) _GetScreenWidth() )
|
||||
@@ -2188,7 +2184,7 @@ static void hb_gt_win_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
|
||||
static void hb_gt_win_Refresh( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Refresh(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_win_Refresh(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSUPER_REFRESH( pGT );
|
||||
if( s_pCharInfoScreen )
|
||||
@@ -2215,7 +2211,7 @@ static void hb_gt_win_Refresh( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", pFuncTable ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", ( void * ) pFuncTable ) );
|
||||
|
||||
pFuncTable->Init = hb_gt_win_Init;
|
||||
pFuncTable->Exit = hb_gt_win_Exit;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Video subsystem for Windows using GUI windows instead of Console
|
||||
* Video subsystem for Windows using GDI windows instead of Console
|
||||
* Copyright 2003 Peter Rees <peter@rees.co.nz>
|
||||
* Rees Software & Systems Ltd
|
||||
* based on
|
||||
@@ -13,28 +13,31 @@
|
||||
* Copyright 2006 Przemyslaw Czerpak <druzus /at/ priv.onet.pl>
|
||||
* Adopted to new GT API
|
||||
*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
*
|
||||
* Copyright 1999 David G. Holm <dholm@jsd-llc.com>
|
||||
* hb_gt_Tone()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
* Copyright 2003-2004 Giancarlo Niccolai <gc@niccolai.ws>
|
||||
* Standard xplatform GT Info system,
|
||||
* Graphical object system and event system.
|
||||
* hb_gtInfo() And GTO_* implementation.
|
||||
*
|
||||
* Copyright 2004 Mauricio Abre <maurifull@datafull.com>
|
||||
* Cross-GT, multi-platform Graphics API
|
||||
*
|
||||
* 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 )
|
||||
* 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
|
||||
* 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.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site https://www.gnu.org/ ).
|
||||
* along with this program; see the file LICENSE.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
@@ -52,7 +55,7 @@
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
@@ -62,18 +65,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* Individual authors:
|
||||
* (C) 2003-2004 Giancarlo Niccolai <gc at niccolai dot ws>
|
||||
* Standard xplatform GT Info system,
|
||||
* Graphical object system and event system.
|
||||
* hb_gtInfo() And GTO_* implementation.
|
||||
*
|
||||
* (C) 2004 Mauricio Abre <maurifull@datafull.com>
|
||||
* Cross-GT, multiplatform Graphics API
|
||||
*
|
||||
*/
|
||||
|
||||
#include "gtwvt.h"
|
||||
|
||||
#ifndef WS_EX_COMPOSITED
|
||||
@@ -324,7 +315,7 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow )
|
||||
pWVT->COLORS[ 14 ] = YELLOW;
|
||||
pWVT->COLORS[ 15 ] = WHITE;
|
||||
|
||||
/* THESE are the default font parameters, if not changed by user */
|
||||
/* These are the default font parameters, if not changed by user */
|
||||
pWVT->PTEXTSIZE.x = WVT_DEFAULT_FONT_WIDTH;
|
||||
pWVT->PTEXTSIZE.y = WVT_DEFAULT_FONT_HEIGHT;
|
||||
pWVT->fontWidth = WVT_DEFAULT_FONT_WIDTH;
|
||||
@@ -489,7 +480,7 @@ static HBITMAP hb_gt_wvt_DefineBoxChar( PHB_GTWVT pWVT, HB_USHORT usCh )
|
||||
HBITMAP hBitMap = NULL;
|
||||
int cellx = pWVT->PTEXTSIZE.x;
|
||||
int celly = pWVT->PTEXTSIZE.y;
|
||||
int i, y, x, yy, xx, skip, start, mod;
|
||||
int i, y, x, yy, xx;
|
||||
POINT pts[ 3 ];
|
||||
RECT rc;
|
||||
|
||||
@@ -937,6 +928,9 @@ static HBITMAP hb_gt_wvt_DefineBoxChar( PHB_GTWVT pWVT, HB_USHORT usCh )
|
||||
case HB_BOXCH_FILLER1:
|
||||
case HB_BOXCH_FILLER2:
|
||||
case HB_BOXCH_FILLER3:
|
||||
{
|
||||
int skip, start, mod;
|
||||
|
||||
hBitMap = hb_gt_wvt_bitmap_char( pWVT, cellx, celly );
|
||||
|
||||
if( usCh == HB_BOXCH_FILLER1 )
|
||||
@@ -963,7 +957,7 @@ static HBITMAP hb_gt_wvt_DefineBoxChar( PHB_GTWVT pWVT, HB_USHORT usCh )
|
||||
if( usCh == HB_BOXCH_FILLER3 )
|
||||
hb_bm_invertrect( 0, 0, cellx, celly );
|
||||
break;
|
||||
|
||||
}
|
||||
case HB_BOXCH_ARROW_R:
|
||||
hBitMap = hb_gt_wvt_bitmap_char( pWVT, cellx, celly );
|
||||
|
||||
@@ -1708,10 +1702,6 @@ static void hb_gt_wvt_FitSize( PHB_GTWVT pWVT )
|
||||
int borderHeight;
|
||||
int left;
|
||||
int top;
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int iCalcWidth = 0;
|
||||
int iCalcHeight = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_FitSize()" ) );
|
||||
|
||||
@@ -1740,6 +1730,11 @@ static void hb_gt_wvt_FitSize( PHB_GTWVT pWVT )
|
||||
int fontWidth;
|
||||
int n;
|
||||
|
||||
int i = 0;
|
||||
int j = 0;
|
||||
int iCalcWidth = 0;
|
||||
int iCalcHeight = 0;
|
||||
|
||||
fontHeight = maxHeight / pWVT->ROWS;
|
||||
fontWidth = maxWidth / pWVT->COLS;
|
||||
|
||||
@@ -1830,7 +1825,7 @@ static void hb_gt_wvt_FitSize( PHB_GTWVT pWVT )
|
||||
else
|
||||
{
|
||||
/* I did it this way, so that "Courier New" would size and maximize as expected.
|
||||
* "Courier New" appears to not scale linearily, sometimes by just decreasing the
|
||||
* "Courier New" appears to not scale linearly, sometimes by just decreasing the
|
||||
* font width by one with some font heights makes it all work out?
|
||||
* This code never seems to get executed with "Lucida Console"
|
||||
* Width scaling with some Heights is an issue with Courier New and Terminal
|
||||
@@ -1889,7 +1884,7 @@ static void hb_gt_wvt_ResetWindowSize( PHB_GTWVT pWVT, HFONT hFont )
|
||||
TEXTMETRIC tm;
|
||||
int n;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_ResetWindowSize(%p,%p)", pWVT, hFont ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_ResetWindowSize(%p,%p)", ( void * ) pWVT, ( void * ) hFont ) );
|
||||
|
||||
if( ! pWVT->hFont || hFont )
|
||||
{
|
||||
@@ -2053,8 +2048,8 @@ static HB_BOOL hb_gt_wvt_SetWindowSize( PHB_GTWVT pWVT, int iRows, int iCols )
|
||||
pWVT->COLS = iCols;
|
||||
return HB_TRUE;
|
||||
}
|
||||
|
||||
return HB_FALSE;
|
||||
else
|
||||
return HB_FALSE;
|
||||
}
|
||||
|
||||
static HB_BOOL hb_gt_wvt_InitWindow( PHB_GTWVT pWVT, int iRow, int iCol, HFONT hFont )
|
||||
@@ -2125,7 +2120,8 @@ static HB_BOOL hb_gt_wvt_SetMousePos( PHB_GTWVT pWVT, int iRow, int iCol )
|
||||
pWVT->MousePos.x = iCol;
|
||||
return HB_TRUE;
|
||||
}
|
||||
return HB_FALSE;
|
||||
else
|
||||
return HB_FALSE;
|
||||
}
|
||||
|
||||
static int hb_gt_wvt_GetKeyFlags( void )
|
||||
@@ -2280,7 +2276,7 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L
|
||||
#if defined( UNICODE )
|
||||
usChar = hb_cdpGetU16Ctrl( usChar );
|
||||
#else
|
||||
usChar = hb_cdpGetUC( bAttr & HB_GT_ATTR_BOX ? cdpBox : cdpHost, usChar, '?' );
|
||||
usChar = hb_cdpGetUC( ( bAttr & HB_GT_ATTR_BOX ) ? cdpBox : cdpHost, usChar, '?' );
|
||||
#endif
|
||||
sBuffer[ n++ ] = ( TCHAR ) usChar;
|
||||
}
|
||||
@@ -2615,7 +2611,7 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
|
||||
{
|
||||
iKey = ( int ) wParam;
|
||||
|
||||
if( ( iFlags & HB_KF_CTRL ) != 0 && ( iKey >= 0 && iKey < 32 ) )
|
||||
if( ( iFlags & HB_KF_CTRL ) != 0 && iKey >= 0 && iKey < 32 )
|
||||
{
|
||||
iKey += 'A' - 1;
|
||||
iKey = HB_INKEY_NEW_KEY( iKey, iFlags );
|
||||
@@ -2777,7 +2773,7 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
|
||||
}
|
||||
|
||||
/*
|
||||
* hb_gt_wvt_TextOut converts col and row to x and y ( pixels ) and calls
|
||||
* Convert col and row to x and y ( pixels ) and calls
|
||||
* the Windows function TextOut with the expected coordinates
|
||||
*/
|
||||
static void hb_gt_wvt_TextOut( PHB_GTWVT pWVT, HDC hdc, int col, int row, int iColor, LPCTSTR lpString, UINT cbString )
|
||||
@@ -2814,7 +2810,7 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT )
|
||||
PAINTSTRUCT ps;
|
||||
HDC hdc;
|
||||
RECT rcRect;
|
||||
int iRow, iCol, startCol, len;
|
||||
int iRow;
|
||||
int iColor, iOldColor = 0;
|
||||
HB_BYTE bAttr;
|
||||
HB_BOOL fFixMetric = ( pWVT->fontAttribute & HB_GTI_FONTA_FIXMETRIC ) != 0;
|
||||
@@ -2893,6 +2889,8 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT )
|
||||
|
||||
for( iRow = rcRect.top; iRow <= rcRect.bottom; ++iRow )
|
||||
{
|
||||
int iCol, startCol, len;
|
||||
|
||||
iCol = startCol = rcRect.left;
|
||||
len = 0;
|
||||
|
||||
@@ -3001,7 +2999,7 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara
|
||||
}
|
||||
}
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_WndProc(%p,%u)", hWnd, message ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_WndProc(%p,%u)", ( void * ) hWnd, message ) );
|
||||
|
||||
if( pWVT ) switch( message )
|
||||
{
|
||||
@@ -3329,19 +3327,19 @@ static HB_BOOL hb_gt_wvt_FullScreen( PHB_GT pGT )
|
||||
|
||||
static void hb_gt_wvt_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFilenoStdout, HB_FHANDLE hFilenoStderr )
|
||||
{
|
||||
HANDLE hInstance;
|
||||
HINSTANCE hInstance;
|
||||
int iCmdShow;
|
||||
PHB_GTWVT pWVT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Init(%p,%p,%p,%p)", pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Init(%p,%p,%p,%p)", ( void * ) pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
|
||||
if( ! hb_winmainArgGet( &hInstance, NULL, &iCmdShow ) )
|
||||
{
|
||||
hInstance = GetModuleHandle( NULL );
|
||||
hInstance = ( HINSTANCE ) GetModuleHandle( NULL );
|
||||
iCmdShow = 1;
|
||||
}
|
||||
|
||||
pWVT = hb_gt_wvt_New( pGT, ( HINSTANCE ) hInstance, iCmdShow );
|
||||
pWVT = hb_gt_wvt_New( pGT, hInstance, iCmdShow );
|
||||
if( pWVT )
|
||||
{
|
||||
HB_GTLOCAL( pGT ) = ( void * ) pWVT;
|
||||
@@ -3364,7 +3362,7 @@ static void hb_gt_wvt_Exit( PHB_GT pGT )
|
||||
{
|
||||
PHB_GTWVT pWVT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Exit(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Exit(%p)", ( void * ) pGT ) );
|
||||
|
||||
pWVT = HB_GTWVT_GET( pGT );
|
||||
HB_GTSUPER_EXIT( pGT );
|
||||
@@ -3380,7 +3378,7 @@ static HB_BOOL hb_gt_wvt_SetMode( PHB_GT pGT, int iRow, int iCol )
|
||||
PHB_GTWVT pWVT;
|
||||
HB_BOOL fResult = HB_FALSE;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_SetMode(%p,%d,%d)", pGT, iRow, iCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_SetMode(%p,%d,%d)", ( void * ) pGT, iRow, iCol ) );
|
||||
|
||||
pWVT = HB_GTWVT_GET( pGT );
|
||||
|
||||
@@ -3426,7 +3424,7 @@ static HB_BOOL hb_gt_wvt_SetMode( PHB_GT pGT, int iRow, int iCol )
|
||||
|
||||
static const char * hb_gt_wvt_Version( PHB_GT pGT, int iType )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Version(%p,%d)", pGT, iType ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Version(%p,%d)", ( void * ) pGT, iType ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -3444,7 +3442,7 @@ static int hb_gt_wvt_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
int c = 0;
|
||||
HB_BOOL fKey;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_ReadKey(%p,%d)", pGT, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_ReadKey(%p,%d)", ( void * ) pGT, iEventMask ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( iEventMask ); /* we ignore the eventmask! */
|
||||
|
||||
@@ -3462,7 +3460,7 @@ static int hb_gt_wvt_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
/* dDuration is in 'Ticks' (18.2 per second) */
|
||||
static void hb_gt_wvt_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Tone(%p,%lf,%lf)", ( void * ) pGT, dFrequency, dDuration ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -3473,7 +3471,7 @@ static void hb_gt_wvt_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
|
||||
static HB_BOOL hb_gt_wvt_mouse_IsPresent( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_mouse_IsPresent(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_mouse_IsPresent(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -3484,7 +3482,7 @@ static void hb_gt_wvt_mouse_GetPos( PHB_GT pGT, int * piRow, int * piCol )
|
||||
{
|
||||
PHB_GTWVT pWVT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_mouse_GetPos(%p,%p,%p)", pGT, piRow, piCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_mouse_GetPos(%p,%p,%p)", ( void * ) pGT, ( void * ) piRow, ( void * ) piCol ) );
|
||||
|
||||
pWVT = HB_GTWVT_GET( pGT );
|
||||
*piRow = pWVT->MousePos.y;
|
||||
@@ -3493,14 +3491,14 @@ static void hb_gt_wvt_mouse_GetPos( PHB_GT pGT, int * piRow, int * piCol )
|
||||
|
||||
static void hb_gt_wvt_mouse_SetPos( PHB_GT pGT, int iRow, int iCol )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_mouse_SetPos(%p,%i,%i)", pGT, iRow, iCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_mouse_SetPos(%p,%i,%i)", ( void * ) pGT, iRow, iCol ) );
|
||||
|
||||
hb_gt_wvt_SetMousePos( HB_GTWVT_GET( pGT ), iRow, iCol );
|
||||
}
|
||||
|
||||
static HB_BOOL hb_gt_wvt_mouse_ButtonState( PHB_GT pGT, int iButton )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_mouse_ButtonState(%p,%i)", pGT, iButton ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_mouse_ButtonState(%p,%i)", ( void * ) pGT, iButton ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -3518,7 +3516,7 @@ static HB_BOOL hb_gt_wvt_mouse_ButtonState( PHB_GT pGT, int iButton )
|
||||
|
||||
static int hb_gt_wvt_mouse_CountButton( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_mouse_CountButton(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_mouse_CountButton(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -3532,7 +3530,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
PHB_GTWVT pWVT;
|
||||
int iVal;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Info(%p,%d,%p)", pGT, iType, pInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Info(%p,%d,%p)", ( void * ) pGT, iType, ( void * ) pInfo ) );
|
||||
|
||||
pWVT = HB_GTWVT_GET( pGT );
|
||||
|
||||
@@ -3977,7 +3975,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
pWVT->hIconToFree = hIconToFree;
|
||||
pWVT->hIcon = hIcon;
|
||||
}
|
||||
pInfo->pResult = hb_itemPutNInt( pInfo->pResult, ( HB_PTRUINT ) pWVT->hIcon );
|
||||
pInfo->pResult = hb_itemPutPtr( pInfo->pResult, ( void * ) ( HB_PTRUINT ) pWVT->hIcon );
|
||||
break;
|
||||
}
|
||||
case HB_GTI_VIEWPORTWIDTH:
|
||||
@@ -4312,18 +4310,19 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
static int hb_gt_wvt_gfx_Primitive( PHB_GT pGT, int iType, int iTop, int iLeft, int iBottom, int iRight, int iColor )
|
||||
{
|
||||
PHB_GTWVT pWVT;
|
||||
HDC hdc;
|
||||
HPEN hPen, hOldPen;
|
||||
HBRUSH hBrush, hOldBrush;
|
||||
RECT r;
|
||||
int iRet = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_gfx_Primitive(%p,%d,%d,%d,%d,%d,%d)", pGT, iType, iTop, iLeft, iBottom, iRight, iColor ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_gfx_Primitive(%p,%d,%d,%d,%d,%d,%d)", ( void * ) pGT, iType, iTop, iLeft, iBottom, iRight, iColor ) );
|
||||
|
||||
pWVT = HB_GTWVT_GET( pGT );
|
||||
|
||||
if( pWVT->hWnd )
|
||||
{
|
||||
HDC hdc;
|
||||
HPEN hPen, hOldPen;
|
||||
HBRUSH hBrush, hOldBrush;
|
||||
|
||||
if( pWVT->bComposited )
|
||||
hb_gt_wvt_Composited( pWVT, HB_FALSE );
|
||||
|
||||
@@ -4446,7 +4445,7 @@ static void hb_gt_wvt_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
{
|
||||
PHB_GTWVT pWVT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Redraw(%p,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iSize ) );
|
||||
|
||||
pWVT = HB_GTWVT_GET( pGT );
|
||||
if( pWVT )
|
||||
@@ -4474,7 +4473,7 @@ static void hb_gt_wvt_Refresh( PHB_GT pGT )
|
||||
{
|
||||
PHB_GTWVT pWVT;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Refresh(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_wvt_Refresh(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_GTSUPER_REFRESH( pGT );
|
||||
|
||||
@@ -4496,7 +4495,7 @@ static void hb_gt_wvt_Refresh( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", pFuncTable ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", ( void * ) pFuncTable ) );
|
||||
|
||||
pFuncTable->Init = hb_gt_wvt_Init;
|
||||
pFuncTable->Exit = hb_gt_wvt_Exit;
|
||||
|
||||
@@ -67,9 +67,8 @@
|
||||
#include "hbwince.h"
|
||||
#endif
|
||||
|
||||
#define WVT_CHAR_QUEUE_SIZE 128
|
||||
#define WVT_MAX_TITLE_SIZE 128
|
||||
#define WVT_MAX_WINDOWS 256
|
||||
#define WVT_MAX_WINDOWS 256
|
||||
|
||||
#if defined( HB_OS_WIN_CE )
|
||||
# define WVT_DEFAULT_ROWS 15
|
||||
# define WVT_DEFAULT_COLS 50
|
||||
@@ -81,29 +80,30 @@
|
||||
# define WVT_DEFAULT_FONT_HEIGHT 20
|
||||
# define WVT_DEFAULT_FONT_WIDTH 10
|
||||
#endif
|
||||
#define WVT_DEFAULT_FONT_ATTR 0
|
||||
#define WVT_DEFAULT_FONT_NAME TEXT( "Courier New" )
|
||||
|
||||
#define WVT_EXTKEY_FLAG ( 1 << 24 )
|
||||
#define WVT_DEFAULT_FONT_ATTR 0
|
||||
#define WVT_DEFAULT_FONT_NAME TEXT( "Courier New" )
|
||||
|
||||
#define BLACK RGB( 0x00, 0x00, 0x00 )
|
||||
#define BLUE RGB( 0x00, 0x00, 0xAA )
|
||||
#define GREEN RGB( 0x00, 0xAA, 0x00 )
|
||||
#define CYAN RGB( 0x00, 0xAA, 0xAA )
|
||||
#define RED RGB( 0xAA, 0x00, 0x00 )
|
||||
#define MAGENTA RGB( 0xAA, 0x00, 0xAA )
|
||||
#define BROWN RGB( 0xAA, 0x55, 0x00 )
|
||||
#define LIGHT_GRAY RGB( 0xAA, 0xAA, 0xAA )
|
||||
#define GRAY RGB( 0x55, 0x55, 0x55 )
|
||||
#define BRIGHT_BLUE RGB( 0x55, 0x55, 0xFF )
|
||||
#define BRIGHT_GREEN RGB( 0x55, 0xFF, 0x55 )
|
||||
#define BRIGHT_CYAN RGB( 0x55, 0xFF, 0xFF )
|
||||
#define BRIGHT_RED RGB( 0xFF, 0x55, 0x55 )
|
||||
#define BRIGHT_MAGENTA RGB( 0xFF, 0x55, 0xFF )
|
||||
#define YELLOW RGB( 0xFF, 0xFF, 0x55 )
|
||||
#define WHITE RGB( 0xFF, 0xFF, 0xFF )
|
||||
#define WVT_EXTKEY_FLAG ( 1 << 24 )
|
||||
|
||||
#define WM_MY_UPDATE_CARET ( WM_USER + 0x0101 )
|
||||
#define BLACK RGB( 0x00, 0x00, 0x00 )
|
||||
#define BLUE RGB( 0x00, 0x00, 0xAA )
|
||||
#define GREEN RGB( 0x00, 0xAA, 0x00 )
|
||||
#define CYAN RGB( 0x00, 0xAA, 0xAA )
|
||||
#define RED RGB( 0xAA, 0x00, 0x00 )
|
||||
#define MAGENTA RGB( 0xAA, 0x00, 0xAA )
|
||||
#define BROWN RGB( 0xAA, 0x55, 0x00 )
|
||||
#define LIGHT_GRAY RGB( 0xAA, 0xAA, 0xAA )
|
||||
#define GRAY RGB( 0x55, 0x55, 0x55 )
|
||||
#define BRIGHT_BLUE RGB( 0x55, 0x55, 0xFF )
|
||||
#define BRIGHT_GREEN RGB( 0x55, 0xFF, 0x55 )
|
||||
#define BRIGHT_CYAN RGB( 0x55, 0xFF, 0xFF )
|
||||
#define BRIGHT_RED RGB( 0xFF, 0x55, 0x55 )
|
||||
#define BRIGHT_MAGENTA RGB( 0xFF, 0x55, 0xFF )
|
||||
#define YELLOW RGB( 0xFF, 0xFF, 0x55 )
|
||||
#define WHITE RGB( 0xFF, 0xFF, 0xFF )
|
||||
|
||||
#define WM_MY_UPDATE_CARET ( WM_USER + 0x0101 )
|
||||
|
||||
/* Box char unicode values */
|
||||
#define HB_BOXCH_ARROW_R 0x0010 /* ARROW RIGHT */
|
||||
@@ -274,7 +274,7 @@ typedef struct
|
||||
|
||||
POINT MousePos; /* the last mouse position */
|
||||
|
||||
int Keys[ WVT_CHAR_QUEUE_SIZE ]; /* Array to hold the characters & events */
|
||||
int Keys[ 128 ]; /* Array to hold the characters & events */
|
||||
int keyPointerIn; /* Offset into key array for character to be placed */
|
||||
int keyPointerOut; /* Offset into key array of next character to read */
|
||||
int keyLastPos; /* last inkey code position in buffer */
|
||||
@@ -355,23 +355,23 @@ typedef struct
|
||||
} HB_GTWVT, * PHB_GTWVT;
|
||||
|
||||
#ifndef WM_MOUSEWHEEL
|
||||
# define WM_MOUSEWHEEL 0x020A
|
||||
#define WM_MOUSEWHEEL 0x020A
|
||||
#endif
|
||||
#ifndef WM_ENTERSIZEMOVE
|
||||
# define WM_ENTERSIZEMOVE 561
|
||||
#define WM_ENTERSIZEMOVE 0x0231
|
||||
#endif
|
||||
#ifndef WM_EXITSIZEMOVE
|
||||
# define WM_EXITSIZEMOVE 562
|
||||
#define WM_EXITSIZEMOVE 0x0232
|
||||
#endif
|
||||
|
||||
#ifndef SWP_DEFERERASE
|
||||
# define SWP_DEFERERASE 0x2000
|
||||
#define SWP_DEFERERASE 0x2000
|
||||
#endif
|
||||
#ifndef SW_NORMAL
|
||||
# define SW_NORMAL 1
|
||||
#define SW_NORMAL 1
|
||||
#endif
|
||||
#ifndef SC_MAXIMIZE
|
||||
# define SC_MAXIMIZE 0xF030
|
||||
#define SC_MAXIMIZE 0xF030
|
||||
#endif
|
||||
|
||||
#define SYS_EV_MARK 1000
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
* XWindow Console
|
||||
* Copyright 2003 - Giancarlo Niccolai <antispam /at/ niccolai.ws>
|
||||
* Copyright 2004/2006 - Przemyslaw Czerpak <druzus /at/ priv.onet.pl>
|
||||
* X11 (X Window System) console
|
||||
*
|
||||
* Copyright 2003 Giancarlo Niccolai <antispam /at/ niccolai.ws>
|
||||
* Copyright 2004-2006 Przemyslaw Czerpak <druzus /at/ priv.onet.pl>
|
||||
*
|
||||
* 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
|
||||
@@ -10,13 +11,13 @@
|
||||
*
|
||||
* 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
|
||||
* 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.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site https://www.gnu.org/).
|
||||
* along with this program; see the file LICENSE.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
@@ -34,7 +35,7 @@
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
@@ -470,7 +471,7 @@ static HB_BOOL hb_gt_xwc_DefineBoxChar( PXWND_DEF wnd, HB_USHORT usCh, XWC_CharT
|
||||
|
||||
int cellx = wnd->fontWidth;
|
||||
int celly = wnd->fontHeight;
|
||||
int i, y, x, yy, xx, skip, start, mod;
|
||||
int i, y, x, yy, xx;
|
||||
|
||||
if( usCh >= HB_BOXCH_RC_MIN && usCh <= HB_BOXCH_RC_MAX )
|
||||
switch( usCh )
|
||||
@@ -1328,6 +1329,9 @@ static HB_BOOL hb_gt_xwc_DefineBoxChar( PXWND_DEF wnd, HB_USHORT usCh, XWC_CharT
|
||||
case HB_BOXCH_FILLER1:
|
||||
case HB_BOXCH_FILLER2:
|
||||
case HB_BOXCH_FILLER3:
|
||||
{
|
||||
int skip, start, mod;
|
||||
|
||||
if( usCh == HB_BOXCH_FILLER1 )
|
||||
{
|
||||
skip = 4;
|
||||
@@ -1365,7 +1369,7 @@ static HB_BOOL hb_gt_xwc_DefineBoxChar( PXWND_DEF wnd, HB_USHORT usCh, XWC_CharT
|
||||
}
|
||||
type = size == 0 ? CH_NONE : CH_PTS;
|
||||
break;
|
||||
|
||||
}
|
||||
case HB_BOXCH_ARROW_R:
|
||||
i = HB_MIN( ( celly >> 1 ), cellx ) - 3;
|
||||
pts[ 0 ].x = ( ( cellx - i ) >> 1 );
|
||||
@@ -2715,7 +2719,7 @@ static void hb_gt_xwc_ProcessKey( PXWND_DEF wnd, XKeyEvent * evt )
|
||||
{
|
||||
i = Xutf8LookupString( wnd->ic, evt, buf, ( int ) sizeof( buf ), &outISO, &status_return );
|
||||
buf[ HB_MAX( i, 0 ) ] = '\0';
|
||||
printf( "UTF8: KeySym=%lx, keySymISO=%lx, keystr[%d]='%s'\n", out, outISO, i, buf ); fflush( stdout );
|
||||
printf( "UTF-8: KeySym=%lx, keySymISO=%lx, keystr[%d]='%s'\n", out, outISO, i, buf ); fflush( stdout );
|
||||
}
|
||||
else
|
||||
# endif
|
||||
@@ -2846,7 +2850,7 @@ static void hb_gt_xwc_ProcessKey( PXWND_DEF wnd, XKeyEvent * evt )
|
||||
ikey = HB_KX_F12;
|
||||
break;
|
||||
|
||||
/* Keys with special meanings to clipper */
|
||||
/* Keys with special meanings to Cl*pper */
|
||||
case XK_Pause:
|
||||
ikey = HB_KX_PAUSE;
|
||||
break;
|
||||
@@ -2935,7 +2939,7 @@ static void hb_gt_xwc_ProcessKey( PXWND_DEF wnd, XKeyEvent * evt )
|
||||
if( i <= 0 )
|
||||
{
|
||||
/*
|
||||
* This is a temporary hack for Latin-x input see gt_SetKeyCP
|
||||
* This is a temporary hack for Latin-x input see gt_SetKeyCP()
|
||||
*/
|
||||
if( outISO >= 0x0100 && outISO <= 0x0fff && ( outISO & 0x80 ) == 0x80 )
|
||||
{
|
||||
@@ -3267,7 +3271,6 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent * evt )
|
||||
if( evt->xselection.property != None )
|
||||
{
|
||||
XTextProperty text;
|
||||
unsigned long nItem;
|
||||
|
||||
if( XGetTextProperty( wnd->dpy, wnd->window, &text,
|
||||
evt->xselection.property ) != 0 )
|
||||
@@ -3311,9 +3314,9 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent * evt )
|
||||
else if( evt->xselection.target == s_atomTargets && text.format == 32 )
|
||||
{
|
||||
Atom aValue;
|
||||
|
||||
unsigned long nItem;
|
||||
#ifdef XWC_DEBUG
|
||||
printf( "text.nitems=%ld, text.format=%d\n", text.nitems, text.format ); fflush( stdout );
|
||||
printf( "text.nitems=%lu, text.format=%d\n", text.nitems, text.format ); fflush( stdout );
|
||||
#endif
|
||||
for( nItem = 0; nItem < text.nitems; ++nItem )
|
||||
{
|
||||
@@ -3326,9 +3329,9 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent * evt )
|
||||
aNextRequest = s_atomText;
|
||||
#ifdef XWC_DEBUG
|
||||
if( aValue )
|
||||
printf( "%ld, %8lx (%s)\n", nItem, aValue, XGetAtomName( wnd->dpy, aValue ) );
|
||||
printf( "%lu, %8lx (%s)\n", nItem, aValue, XGetAtomName( wnd->dpy, aValue ) );
|
||||
else
|
||||
printf( "%ld, %8lx (NULL)\n", nItem, aValue );
|
||||
printf( "%lu, %8lx (NULL)\n", nItem, aValue );
|
||||
fflush( stdout );
|
||||
#endif
|
||||
}
|
||||
@@ -3522,7 +3525,7 @@ static void hb_gt_xwc_WndProc( PXWND_DEF wnd, XEvent * evt )
|
||||
*/
|
||||
|
||||
/* *********************************************************************** */
|
||||
/* collor allocation */
|
||||
/* color allocation */
|
||||
static int hb_gt_xwc_GetColormapSize( PXWND_DEF wnd )
|
||||
{
|
||||
XVisualInfo visInfo, *visInfoPtr;
|
||||
@@ -3562,7 +3565,7 @@ static HB_BOOL hb_gt_xwc_AllocColor( PXWND_DEF wnd, XColor * pColor )
|
||||
* with ideas from David Tong's "noflash" library ;-)
|
||||
*/
|
||||
int i, iClosestColor;
|
||||
double dDiff, dDistance, dClosestColorDist = 0;
|
||||
double dDiff, dDistance;
|
||||
XColor *colorTable;
|
||||
HB_BYTE *checkTable;
|
||||
|
||||
@@ -3577,12 +3580,14 @@ static HB_BOOL hb_gt_xwc_AllocColor( PXWND_DEF wnd, XColor * pColor )
|
||||
|
||||
do
|
||||
{
|
||||
double dClosestColorDist;
|
||||
|
||||
iClosestColor = -1;
|
||||
/*
|
||||
* Look for the color that best approximates the desired one
|
||||
* and has not been checked so far and try to allocate it.
|
||||
* If allocation fails, it must mean that the color was read-write
|
||||
* (so we can't use it, since its owner might change it) or else
|
||||
* (so we cannot use it, since its owner might change it) or else
|
||||
* it was already freed. Repeat until something succeeds or
|
||||
* we test all colors in given maximum of approximation.
|
||||
*
|
||||
@@ -3708,11 +3713,11 @@ static HB_U32 hb_gt_xwc_HashCurrChar( HB_BYTE attr, HB_BYTE color, HB_USHORT chr
|
||||
|
||||
static void hb_gt_xwc_RepaintChar( PXWND_DEF wnd, int colStart, int rowStart, int colStop, int rowStop )
|
||||
{
|
||||
HB_USHORT irow, icol, startCol = 0, len, basex, basey, nsize;
|
||||
HB_USHORT irow, startCol = 0, basex, basey, nsize;
|
||||
HB_BYTE oldColor = 0, color, attr;
|
||||
HB_USHORT usCh16, usChBuf[ XWC_MAX_COLS ];
|
||||
HB_U32 u32Curr = 0xFFFFFFFF;
|
||||
int i, iColor, scridx;
|
||||
int i, iColor;
|
||||
XWC_CharTrans * chTrans;
|
||||
|
||||
#ifdef XWC_DEBUG
|
||||
@@ -3730,6 +3735,9 @@ static void hb_gt_xwc_RepaintChar( PXWND_DEF wnd, int colStart, int rowStart, in
|
||||
|
||||
for( irow = rowStart; irow <= rowStop; irow++ )
|
||||
{
|
||||
HB_USHORT icol, len;
|
||||
int scridx;
|
||||
|
||||
icol = colStart;
|
||||
scridx = icol + irow * wnd->cols;
|
||||
len = 0;
|
||||
@@ -3956,11 +3964,11 @@ static void hb_gt_xwc_InvalidateFull( PXWND_DEF wnd )
|
||||
static void hb_gt_xwc_InvalidatePart( PXWND_DEF wnd,
|
||||
int left, int top, int right, int bottom )
|
||||
{
|
||||
int row, col, scridx;
|
||||
int row, col;
|
||||
|
||||
for( row = top; row <= bottom; row++ )
|
||||
{
|
||||
scridx = row * wnd->cols + left;
|
||||
int scridx = row * wnd->cols + left;
|
||||
for( col = left; col <= right; col++, scridx++ )
|
||||
wnd->pCurrScr[ scridx ] = 0xFFFFFFFF;
|
||||
}
|
||||
@@ -4586,10 +4594,10 @@ static HB_BOOL hb_gt_xwc_ConnectX( PXWND_DEF wnd, HB_BOOL fExit )
|
||||
{
|
||||
/* TODO: a standard Harbour error should be generated here when
|
||||
it can run without console!
|
||||
hb_errRT_TERM( EG_CREATE, 10001, NULL, "Can't connect to X server", 0, 0 );
|
||||
hb_errRT_TERM( EG_CREATE, 10001, NULL, "Could not connect to X server", 0, 0 );
|
||||
*/
|
||||
s_fNoXServer = HB_TRUE;
|
||||
hb_errInternal( 10001, "Can't connect to X server.", NULL, NULL );
|
||||
hb_errInternal( 10001, "Could not connect to X server.", NULL, NULL );
|
||||
}
|
||||
return HB_FALSE;
|
||||
}
|
||||
@@ -4677,7 +4685,7 @@ static void hb_gt_xwc_DissConnectX( PXWND_DEF wnd )
|
||||
wnd->dpy = NULL;
|
||||
|
||||
/* Hack to avoid race condition inside some XLIB library - it looks
|
||||
* in heavy stres MT tests that it can receive some events bound with
|
||||
* in heavy stress MT tests that it can receive some events bound with
|
||||
* destroyed objects and executes our error handler.
|
||||
*/
|
||||
s_fIgnoreErrors = HB_TRUE;
|
||||
@@ -4719,7 +4727,7 @@ static void hb_gt_xwc_SetResizing( PXWND_DEF wnd )
|
||||
|
||||
/* with StaticGravity XMoveWindow expects upper left corner of client area
|
||||
* and with NorthWestGravity it expect upper left corner of window with
|
||||
* frame and title bar. ConfigureNotify always returns client area possition
|
||||
* frame and title bar. ConfigureNotify always returns client area position
|
||||
* so working with NorthWestGravity it's necessary to update cords returned
|
||||
* to user in hb_gt_xwc_UpdateWindowCords()
|
||||
*/
|
||||
@@ -4764,11 +4772,11 @@ static void hb_gt_xwc_CreateWindow( PXWND_DEF wnd )
|
||||
|
||||
/* TODO: a standard Harbour error should be generated here when
|
||||
it can run without console!
|
||||
hb_errRT_TERM( EG_CREATE, 10001, NULL, "Can't load 'fixed' font", 0, 0 );
|
||||
hb_errRT_TERM( EG_CREATE, 10001, NULL, "Cannot load 'fixed' font", 0, 0 );
|
||||
return;
|
||||
*/
|
||||
s_fNoXServer = HB_TRUE;
|
||||
hb_errInternal( 10001, "Can't load 'fixed' font", NULL, NULL );
|
||||
hb_errInternal( 10001, "Cannot load 'fixed' font", NULL, NULL );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4915,7 +4923,7 @@ static void hb_gt_xwc_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
|
||||
{
|
||||
PXWND_DEF wnd;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_Init(%p,%p,%p,%p)", pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_Init(%p,%p,%p,%p)", ( void * ) pGT, ( void * ) ( HB_PTRUINT ) hFilenoStdin, ( void * ) ( HB_PTRUINT ) hFilenoStdout, ( void * ) ( HB_PTRUINT ) hFilenoStderr ) );
|
||||
|
||||
#ifdef HB_XWC_USE_LOCALE
|
||||
setlocale( LC_CTYPE, "" );
|
||||
@@ -4958,7 +4966,7 @@ static void hb_gt_xwc_Exit( PHB_GT pGT )
|
||||
{
|
||||
PXWND_DEF wnd;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_Exit(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_Exit(%p)", ( void * ) pGT ) );
|
||||
|
||||
wnd = HB_GTXWC_GET( pGT );
|
||||
|
||||
@@ -4977,7 +4985,7 @@ static HB_BOOL hb_gt_xwc_SetMode( PHB_GT pGT, int iRow, int iCol )
|
||||
{
|
||||
HB_BOOL fResult = HB_FALSE;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_SetMode(%p,%d,%d)", pGT, iRow, iCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_SetMode(%p,%d,%d)", ( void * ) pGT, iRow, iCol ) );
|
||||
|
||||
if( iCol >= XWC_MIN_COLS && iRow >= XWC_MIN_ROWS &&
|
||||
iCol <= XWC_MAX_COLS && iRow <= XWC_MAX_ROWS )
|
||||
@@ -5051,7 +5059,7 @@ static HB_BOOL hb_gt_xwc_SetMode( PHB_GT pGT, int iRow, int iCol )
|
||||
|
||||
static HB_BOOL hb_gt_xwc_GetBlink( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_GetBlink(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_GetBlink(%p)", ( void * ) pGT ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -5077,7 +5085,7 @@ static int hb_gt_xwc_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
PXWND_DEF wnd;
|
||||
int c = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_ReadKey(%p,%d)", pGT, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_ReadKey(%p,%d)", ( void * ) pGT, iEventMask ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( iEventMask );
|
||||
|
||||
@@ -5098,7 +5106,7 @@ static void hb_gt_xwc_Tone( PHB_GT pGT, double dFrequency, double dDuration )
|
||||
{
|
||||
PXWND_DEF wnd;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_Tone(%p,%lf,%lf)", ( void * ) pGT, dFrequency, dDuration ) );
|
||||
|
||||
/* The conversion from Clipper (DOS) timer tick units to
|
||||
milliseconds is * 1000.0 / 18.2. */
|
||||
@@ -5127,7 +5135,7 @@ static HB_BOOL hb_gt_xwc_mouse_IsPresent( PHB_GT pGT )
|
||||
{
|
||||
PXWND_DEF wnd;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_mouse_IsPresent(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_mouse_IsPresent(%p)", ( void * ) pGT ) );
|
||||
|
||||
wnd = HB_GTXWC_GET( pGT );
|
||||
hb_gt_xwc_ConnectX( wnd, HB_TRUE );
|
||||
@@ -5140,7 +5148,7 @@ static void hb_gt_xwc_mouse_GetPos( PHB_GT pGT, int * piRow, int * piCol )
|
||||
{
|
||||
PXWND_DEF wnd;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_mouse_GetPos(%p,%p,%p)", pGT, piRow, piCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_mouse_GetPos(%p,%p,%p)", ( void * ) pGT, ( void * ) piRow, ( void * ) piCol ) );
|
||||
|
||||
wnd = HB_GTXWC_GET( pGT );
|
||||
if( wnd )
|
||||
@@ -5157,7 +5165,7 @@ static void hb_gt_xwc_mouse_SetPos( PHB_GT pGT, int iRow, int iCol )
|
||||
{
|
||||
PXWND_DEF wnd;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_mouse_SetPos(%p,%d,%d)", pGT, iRow, iCol ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_mouse_SetPos(%p,%d,%d)", ( void * ) pGT, iRow, iCol ) );
|
||||
|
||||
wnd = HB_GTXWC_GET( pGT );
|
||||
wnd->mouseGotoRow = iRow;
|
||||
@@ -5171,7 +5179,7 @@ static HB_BOOL hb_gt_xwc_mouse_ButtonState( PHB_GT pGT, int iButton )
|
||||
{
|
||||
PXWND_DEF wnd;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_mouse_ButtonState(%p,%i)", pGT, iButton ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_mouse_ButtonState(%p,%i)", ( void * ) pGT, iButton ) );
|
||||
|
||||
wnd = HB_GTXWC_GET( pGT );
|
||||
hb_gt_xwc_ConnectX( wnd, HB_TRUE );
|
||||
@@ -5187,7 +5195,7 @@ static int hb_gt_xwc_mouse_CountButton( PHB_GT pGT )
|
||||
{
|
||||
PXWND_DEF wnd;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_mouse_CountButton(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_mouse_CountButton(%p)", ( void * ) pGT ) );
|
||||
|
||||
wnd = HB_GTXWC_GET( pGT );
|
||||
hb_gt_xwc_ConnectX( wnd, HB_TRUE );
|
||||
@@ -5213,7 +5221,7 @@ static HB_BOOL hb_gt_xwc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
PXWND_DEF wnd;
|
||||
int iVal;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_Info(%p,%d,%p)", pGT, iType, pInfo ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_Info(%p,%d,%p)", ( void * ) pGT, iType, ( void * ) pInfo ) );
|
||||
|
||||
wnd = HB_GTXWC_GET( pGT );
|
||||
if( ! wnd->dpy )
|
||||
@@ -5746,7 +5754,7 @@ static HB_BOOL hb_gt_xwc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
if( wnd->window && pInfo->pNewVal &&
|
||||
( ( HB_IS_ARRAY( pInfo->pNewVal ) &&
|
||||
hb_arrayLen( pInfo->pNewVal ) == ( HB_SIZE )
|
||||
( hb_arrayGetType( pInfo->pNewVal, 4 ) & HB_IT_NUMERIC ? 4 : 3 ) ) ||
|
||||
( ( hb_arrayGetType( pInfo->pNewVal, 4 ) & HB_IT_NUMERIC ) ? 4 : 3 ) ) ||
|
||||
HB_IS_STRING( pInfo->pNewVal ) ) )
|
||||
{
|
||||
XImage * xImage = NULL;
|
||||
@@ -5890,7 +5898,7 @@ static int hb_gt_xwc_gfx_Primitive( PHB_GT pGT, int iType, int iTop, int iLeft,
|
||||
XColor color;
|
||||
XImage * image;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_gfx_Primitive(%p,%d,%d,%d,%d,%d,%d)", pGT, iType, iTop, iLeft, iBottom, iRight, iColor ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_gfx_Primitive(%p,%d,%d,%d,%d,%d,%d)", ( void * ) pGT, iType, iTop, iLeft, iBottom, iRight, iColor ) );
|
||||
|
||||
wnd = HB_GTXWC_GET( pGT );
|
||||
if( ! wnd->fInit )
|
||||
@@ -6080,7 +6088,7 @@ static void hb_gt_xwc_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
{
|
||||
PXWND_DEF wnd;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_Redraw(%p,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iSize ) );
|
||||
|
||||
wnd = HB_GTXWC_GET( pGT );
|
||||
if( wnd && ! s_fNoXServer )
|
||||
@@ -6130,7 +6138,7 @@ static void hb_gt_xwc_Refresh( PHB_GT pGT )
|
||||
{
|
||||
PXWND_DEF wnd;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_Refresh(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_xwc_Refresh(%p)", ( void * ) pGT ) );
|
||||
|
||||
wnd = HB_GTXWC_GET( pGT );
|
||||
HB_GTSUPER_REFRESH( pGT );
|
||||
@@ -6148,7 +6156,7 @@ static void hb_gt_xwc_Refresh( PHB_GT pGT )
|
||||
|
||||
static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", pFuncTable ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_FuncInit(%p)", ( void * ) pFuncTable ) );
|
||||
|
||||
pFuncTable->Init = hb_gt_xwc_Init;
|
||||
pFuncTable->Exit = hb_gt_xwc_Exit;
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
/*
|
||||
* XWindow Console
|
||||
* Copyright 2003 - Giancarlo Niccolai <antispam /at/ niccolai.ws>
|
||||
* Copyright 2004/2006 - Przemyslaw Czerpak <druzus /at/ priv.onet.pl>
|
||||
*
|
||||
* Copyright 2003 Giancarlo Niccolai <antispam /at/ niccolai.ws>
|
||||
* Copyright 2004-2006 Przemyslaw Czerpak <druzus /at/ priv.onet.pl>
|
||||
*
|
||||
* 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
|
||||
@@ -10,13 +11,13 @@
|
||||
*
|
||||
* 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
|
||||
* 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.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site https://www.gnu.org/).
|
||||
* along with this program; see the file LICENSE.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
@@ -34,7 +35,7 @@
|
||||
* 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
|
||||
* 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.
|
||||
*
|
||||
@@ -51,11 +52,11 @@
|
||||
|
||||
#define HB_GT_NAME XWC
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbgtcore.h"
|
||||
#include "hbinit.h"
|
||||
#include "hbset.h"
|
||||
#include "hbvm.h"
|
||||
#include "hbapi.h"
|
||||
#include "hbapiitm.h"
|
||||
#include "hbapierr.h"
|
||||
#include "inkey.ch"
|
||||
|
||||
11
src/rtl/gx.c
11
src/rtl/gx.c
@@ -2,6 +2,7 @@
|
||||
* NoSnow(), SetMode(), IsColor() functions
|
||||
*
|
||||
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
|
||||
* Copyright 1999 Paul Tucker <ptucker@sympatico.ca> (SetMode())
|
||||
*
|
||||
* 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
|
||||
@@ -44,16 +45,6 @@
|
||||
*
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following parts are Copyright of the individual authors.
|
||||
*
|
||||
* Copyright 1999 Paul Tucker <ptucker@sympatico.ca>
|
||||
* SetMode()
|
||||
*
|
||||
* See COPYING.txt for licensing terms.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapi.h"
|
||||
#include "hbapigt.h"
|
||||
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
* adler32 checksum function
|
||||
*
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
* Algorithm taken from adler32.c Copyright (C) 1995-2002 Mark Adler
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
|
||||
@@ -57,7 +57,7 @@ static const HB_BLOWFISH * hb_bf_keyparam( void )
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/* hb_blowfishKey( <cPasswd> ) -> <cBfKey>
|
||||
/* hb_blowfishKey( <cPasswd> ) --> <cBfKey>
|
||||
*/
|
||||
HB_FUNC( HB_BLOWFISHKEY )
|
||||
{
|
||||
@@ -72,7 +72,7 @@ HB_FUNC( HB_BLOWFISHKEY )
|
||||
}
|
||||
}
|
||||
|
||||
/* hb_blowfishEncrypt( <cBfKey>, <cText> [, <lRaw>=.F. ] ) -> <cCipher> | NIL
|
||||
/* hb_blowfishEncrypt( <cBfKey>, <cText> [, <lRaw>=.F. ] ) --> <cCipher> | NIL
|
||||
* return string encrypted using ECB (electronic codebook) mode or
|
||||
* NIL on error (wrong parameters),
|
||||
* in raw mode passed string is padded to 8 bytes with '\0'
|
||||
@@ -85,12 +85,13 @@ HB_FUNC( HB_BLOWFISHENCRYPT )
|
||||
|
||||
if( bf && pData )
|
||||
{
|
||||
HB_SIZE nLen = hb_itemGetCLen( pData ), nSize;
|
||||
HB_SIZE nLen = hb_itemGetCLen( pData );
|
||||
|
||||
if( nLen )
|
||||
{
|
||||
char * pszData;
|
||||
HB_BOOL fRaw = hb_parl( 3 );
|
||||
HB_SIZE nSize;
|
||||
|
||||
/* In raw mode passed string is padded to 8 bytes with '\0'
|
||||
* otherwise ANSI X.923 padding is used
|
||||
@@ -118,7 +119,7 @@ HB_FUNC( HB_BLOWFISHENCRYPT )
|
||||
}
|
||||
}
|
||||
|
||||
/* hb_blowfishDecrypt( <cBfKey>, <cCipher> [, <lRaw>=.F. ] ) -> <cText> | NIL
|
||||
/* hb_blowfishDecrypt( <cBfKey>, <cCipher> [, <lRaw>=.F. ] ) --> <cText> | NIL
|
||||
* return string decrypted using ECB (electronic codebook) mode or
|
||||
* NIL on error (wrong parameters),
|
||||
* in raw mode whole passed string is decoded as is
|
||||
@@ -131,13 +132,14 @@ HB_FUNC( HB_BLOWFISHDECRYPT )
|
||||
|
||||
if( bf && pData )
|
||||
{
|
||||
HB_SIZE nSize = hb_itemGetCLen( pData ), nLen;
|
||||
HB_SIZE nSize = hb_itemGetCLen( pData );
|
||||
|
||||
if( nSize >= 8 && ( nSize & 0x07 ) == 0 )
|
||||
{
|
||||
const char * pszSource;
|
||||
char * pszData;
|
||||
HB_BOOL fRaw = hb_parl( 3 );
|
||||
HB_SIZE nLen;
|
||||
|
||||
pszData = ( char * ) hb_xgrab( nSize + ( fRaw ? 1 : 0 ) );
|
||||
pszSource = hb_itemGetCPtr( pData );
|
||||
@@ -194,7 +196,7 @@ static void hb_bf_encode( const HB_BLOWFISH * bf, HB_BYTE * vect )
|
||||
}
|
||||
|
||||
/* hb_blowfishEncrypt_CFB( <cBfKey>, <cText> [, <cInitSeed> ] )
|
||||
* -> <cCipher> | NIL
|
||||
* --> <cCipher> | NIL
|
||||
* return string encrypted using CFB (cipher feedback) mode or
|
||||
* NIL on error (wrong parameters)
|
||||
*/
|
||||
@@ -205,13 +207,14 @@ HB_FUNC( HB_BLOWFISHENCRYPT_CFB )
|
||||
|
||||
if( bf && pData )
|
||||
{
|
||||
HB_SIZE nLen = hb_itemGetCLen( pData ), n;
|
||||
HB_SIZE nLen = hb_itemGetCLen( pData );
|
||||
|
||||
if( nLen )
|
||||
{
|
||||
const char * pszSource = hb_itemGetCPtr( pData );
|
||||
char * pszData = ( char * ) hb_xgrab( nLen + 1 );
|
||||
HB_BYTE vect[ HB_BF_CIPHERBLOCK ];
|
||||
HB_SIZE n;
|
||||
|
||||
hb_bf_initvect( vect );
|
||||
|
||||
@@ -230,7 +233,7 @@ HB_FUNC( HB_BLOWFISHENCRYPT_CFB )
|
||||
}
|
||||
|
||||
/* hb_blowfishDecrypt_CFB( <cBfKey>, <cCipher> [, <cInitSeed> ] )
|
||||
* -> <cText> | NIL
|
||||
* --> <cText> | NIL
|
||||
* return string decrypted using CFB (cipher feedback) mode or
|
||||
* NIL on error (wrong parameters),
|
||||
*/
|
||||
@@ -241,13 +244,14 @@ HB_FUNC( HB_BLOWFISHDECRYPT_CFB )
|
||||
|
||||
if( bf && pData )
|
||||
{
|
||||
HB_SIZE nLen = hb_itemGetCLen( pData ), n;
|
||||
HB_SIZE nLen = hb_itemGetCLen( pData );
|
||||
|
||||
if( nLen )
|
||||
{
|
||||
const char * pszSource = hb_itemGetCPtr( pData );
|
||||
char * pszData = ( char * ) hb_xgrab( nLen + 1 );
|
||||
HB_BYTE vect[ HB_BF_CIPHERBLOCK ];
|
||||
HB_SIZE n;
|
||||
|
||||
hb_bf_initvect( vect );
|
||||
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
/*
|
||||
* This code implements BlowFish algorithm designed by Bruce Schneier.
|
||||
* The description of BlowFish algorithm can be found at:
|
||||
* http://www.schneier.com/paper-blowfish-fse.html
|
||||
* This code uses for initial s-boxes and p-array values PI hex digits
|
||||
* taken from tables public at:
|
||||
* http://www.schneier.com/blowfish.html
|
||||
* which can be downloaded from:
|
||||
* http://www.schneier.com/code/constants.txt
|
||||
* The description of BlowFish algorithm can be found at:
|
||||
* https://www.schneier.com/paper-blowfish-fse.html
|
||||
* This code uses for initial s-boxes and p-array values PI hex digits
|
||||
* taken from tables public at:
|
||||
* https://www.schneier.com/blowfish.html
|
||||
* which can be downloaded from:
|
||||
* https://www.schneier.com/code/constants.txt
|
||||
*
|
||||
* Copyright 2009 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
|
||||
@@ -340,7 +340,7 @@ static PHB_SOCKEX s_sockexNext( PHB_SOCKEX pSock, PHB_ITEM pParams )
|
||||
return pSockNew;
|
||||
}
|
||||
|
||||
/* hb_socketNewBFSock( <pSocket>, [<hParams>] ) -> <pSocket> */
|
||||
/* hb_socketNewBFSock( <pSocket>, [<hParams>] ) --> <pSocket> */
|
||||
HB_FUNC( HB_SOCKETNEWBFSOCK )
|
||||
{
|
||||
PHB_SOCKEX pSock = hb_sockexParam( 1 );
|
||||
|
||||
@@ -711,7 +711,7 @@ int hb_comInputCount( int iPort )
|
||||
hb_comSetOsError( pCom, iResult == -1 );
|
||||
#elif defined( FIONREAD ) && ! defined( HB_OS_CYGWIN )
|
||||
/* Cygwin sys/termios.h explicitly says that "TIOCINQ is
|
||||
* utilized instead of FIONREAD which has been accupied for
|
||||
* utilized instead of FIONREAD which has been occupied for
|
||||
* other purposes under CYGWIN", so don't give Cygwin
|
||||
* even a chance to hit this code path. */
|
||||
int iResult = ioctl( pCom->fd, FIONREAD, &iCount );
|
||||
@@ -807,7 +807,7 @@ int hb_comFlush( int iPort, int iType )
|
||||
*/
|
||||
|
||||
#ifdef HB_OS_LINUX
|
||||
/* hack for missing defintions in standard header files */
|
||||
/* hack for missing definitions in standard header files */
|
||||
# ifndef TIOCM_OUT1
|
||||
# define TIOCM_OUT1 0x2000
|
||||
# endif
|
||||
@@ -1329,7 +1329,7 @@ long hb_comRecv( int iPort, void * data, long len, HB_MAXINT timeout )
|
||||
#else
|
||||
if( timeout != pCom->rdtimeout )
|
||||
{
|
||||
/* TODO: implent timeout settings
|
||||
/* TODO: implement timeout settings
|
||||
* tio.c_cc[ VTIME ] = ( timeout + 50 ) / 100;
|
||||
* tio.c_cc[ VMIN ] = 0;
|
||||
* in DJGPP builds
|
||||
@@ -1383,7 +1383,7 @@ int hb_comInit( int iPort, int iBaud, int iParity, int iSize, int iStop )
|
||||
tio.c_cc[ VMIN ] = 0; /* minimum number of characters for read */
|
||||
#else
|
||||
/* workaround for bug in some Linux kernels (i.e. 3.13.0-64-generic
|
||||
Ubuntu) in which select() unconditionally accepts stdin for
|
||||
*buntu) in which select() unconditionally accepts stdin for
|
||||
reading if c_cc[ VMIN ] = 0 [druzus] */
|
||||
tio.c_cc[ VMIN ] = 1;
|
||||
#endif
|
||||
@@ -3185,7 +3185,7 @@ static void hb_comSetOsError( PHB_COM pCom, int iError )
|
||||
break;
|
||||
case SER_ERR_IRQ_NOT_FOUND: /* Could not find an IRQ for the specified COM port */
|
||||
case SER_ERR_LOCK_MEM: /* Could not lock memory in DPMI mode */
|
||||
case SER_ERR_UNKNOWN: /* An unknown error occured */
|
||||
case SER_ERR_UNKNOWN: /* An unknown error occurred */
|
||||
default:
|
||||
pCom->error = iError < 0 ? HB_COM_ERR_OTHER : 0;
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ HB_FUNC( HB_COMOUTPUTSTATE )
|
||||
|
||||
HB_FUNC( HB_COMSENDBREAK )
|
||||
{
|
||||
/* 50ms break is enough for baudrate 300 and higher */
|
||||
/* 50ms break is enough for baud-rate 300 and higher */
|
||||
hb_retl( hb_comSendBreak( hb_parni( 1 ), hb_parnidef( 2, 50 ) ) == 0 );
|
||||
}
|
||||
|
||||
|
||||
@@ -196,7 +196,7 @@ HB_MAXUINT hb_crc( HB_MAXUINT crc, const void * buf, HB_SIZE len, HB_MAXUINT pol
|
||||
crc ^= *ucbuf++;
|
||||
do
|
||||
{
|
||||
crc = crc & 1 ? revp ^ ( crc >> 1 ) : crc >> 1;
|
||||
crc = ( crc & 1 ) ? revp ^ ( crc >> 1 ) : crc >> 1;
|
||||
}
|
||||
while( --i );
|
||||
}
|
||||
@@ -229,7 +229,7 @@ HB_MAXUINT hb_crcct( HB_MAXUINT crc, const void * buf, HB_SIZE len, HB_MAXUINT p
|
||||
crc ^= ( HB_MAXUINT ) ( *ucbuf++ );
|
||||
do
|
||||
{
|
||||
crc = crc & mask ? poly ^ ( crc << 1 ) : crc << 1;
|
||||
crc = ( crc & mask ) ? poly ^ ( crc << 1 ) : crc << 1;
|
||||
}
|
||||
while( --i );
|
||||
}
|
||||
@@ -245,7 +245,7 @@ HB_MAXUINT hb_crcct( HB_MAXUINT crc, const void * buf, HB_SIZE len, HB_MAXUINT p
|
||||
crc ^= ( HB_MAXUINT ) ( *ucbuf++ ) << bits;
|
||||
do
|
||||
{
|
||||
crc = crc & mask ? poly ^ ( crc << 1 ) : crc << 1;
|
||||
crc = ( crc & mask ) ? poly ^ ( crc << 1 ) : crc << 1;
|
||||
}
|
||||
while( --i );
|
||||
}
|
||||
|
||||
@@ -178,7 +178,7 @@ static HB_U64 hb_u64par( PHB_ITEM pParam, PHB_DYNARG pArg )
|
||||
break;
|
||||
|
||||
case HB_DYN_CTYPE_LLONG_UNSIGNED:
|
||||
/* TOFIX: Digits are lost. */
|
||||
/* FIXME: Digits are lost. */
|
||||
#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF )
|
||||
pArg->value.t.n64 = ( HB_MAXUINT ) hb_itemGetNInt( pParam );
|
||||
#else
|
||||
@@ -188,7 +188,7 @@ static HB_U64 hb_u64par( PHB_ITEM pParam, PHB_DYNARG pArg )
|
||||
break;
|
||||
|
||||
case HB_DYN_CTYPE_FLOAT:
|
||||
/* TOFIX */
|
||||
/* FIXME */
|
||||
|
||||
case HB_DYN_CTYPE_DOUBLE:
|
||||
HB_PUT_LE_DOUBLE( ( HB_BYTE * ) &pArg->value.t.n64, hb_itemGetND( pParam ) );
|
||||
@@ -384,7 +384,7 @@ static PHB_ITEM hb_u64ret( PHB_ITEM pItem, int iRetType, int iEncoding, HB_DYNVA
|
||||
break;
|
||||
|
||||
case HB_DYN_CTYPE_FLOAT:
|
||||
hb_itemPutND( pItem, value.t.nFL );
|
||||
hb_itemPutND( pItem, ( double ) value.t.nFL );
|
||||
break;
|
||||
|
||||
case HB_DYN_CTYPE_DOUBLE:
|
||||
@@ -539,7 +539,7 @@ static void hb_u32par( PHB_ITEM pParam, PHB_DYNARG pArg, HB_U32 * r1, HB_U32 * r
|
||||
|
||||
case HB_DYN_CTYPE_LLONG_UNSIGNED:
|
||||
#if ! defined( HB_LONG_LONG_OFF )
|
||||
/* TOFIX: Digits are lost. */
|
||||
/* FIXME: Digits are lost. */
|
||||
#if HB_VMLONG_MAX == INT32_MAX || defined( HB_LONG_LONG_OFF )
|
||||
pArg->value.t.n64 = ( HB_MAXUINT ) hb_itemGetNInt( pParam );
|
||||
#else
|
||||
@@ -767,7 +767,7 @@ static PHB_ITEM hb_u32ret( PHB_ITEM pItem, int iRetType, int iEncoding, HB_DYNVA
|
||||
break;
|
||||
|
||||
case HB_DYN_CTYPE_FLOAT:
|
||||
hb_itemPutND( pItem, value.t.nFL );
|
||||
hb_itemPutND( pItem, ( double ) value.t.nFL );
|
||||
break;
|
||||
|
||||
case HB_DYN_CTYPE_DOUBLE:
|
||||
|
||||
@@ -226,7 +226,7 @@ FUNCTION hb_DirSepAdd( cDir )
|
||||
|
||||
IF ! Empty( cDir ) .AND. ;
|
||||
! _ISDRIVESPEC( cDir ) .AND. ;
|
||||
!( Right( cDir, 1 ) == hb_ps() )
|
||||
! Right( cDir, 1 ) == hb_ps()
|
||||
|
||||
cDir += hb_ps()
|
||||
ENDIF
|
||||
@@ -241,14 +241,14 @@ FUNCTION hb_DirSepDel( cDir )
|
||||
|
||||
IF Empty( hb_osDriveSeparator() )
|
||||
DO WHILE Len( cDir ) > 1 .AND. Right( cDir, 1 ) == hb_ps() .AND. ;
|
||||
!( cDir == hb_ps() + hb_ps() )
|
||||
! cDir == hb_ps() + hb_ps()
|
||||
|
||||
cDir := hb_StrShrink( cDir )
|
||||
ENDDO
|
||||
ELSE
|
||||
DO WHILE Len( cDir ) > 1 .AND. Right( cDir, 1 ) == hb_ps() .AND. ;
|
||||
!( cDir == hb_ps() + hb_ps() ) .AND. ;
|
||||
!( Right( cDir, Len( hb_osDriveSeparator() ) + 1 ) == hb_osDriveSeparator() + hb_ps() )
|
||||
! cDir == hb_ps() + hb_ps() .AND. ;
|
||||
! Right( cDir, Len( hb_osDriveSeparator() ) + 1 ) == hb_osDriveSeparator() + hb_ps()
|
||||
|
||||
cDir := hb_StrShrink( cDir )
|
||||
ENDDO
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Harbour Graphic Terminal low level code
|
||||
* Harbour Graphic Terminal low-level code
|
||||
*
|
||||
* Copyright 2006 Przemyslaw Czerpak < druzus /at/ priv.onet.pl >
|
||||
*
|
||||
@@ -293,7 +293,7 @@ static HB_BOOL hb_gt_def_IsColor( PHB_GT pGT )
|
||||
[vszakats] */
|
||||
static void hb_gt_def_GetColorStr( PHB_GT pGT, char * pszColorString )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_GetColorStr(%p,%s)", pGT, pszColorString ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_GetColorStr(%p,%s)", ( void * ) pGT, pszColorString ) );
|
||||
|
||||
HB_GTSELF_COLORSTOSTRING( pGT, pGT->pColor, pGT->iColorCount,
|
||||
pszColorString, HB_CLRSTR_LEN );
|
||||
@@ -301,7 +301,7 @@ static void hb_gt_def_GetColorStr( PHB_GT pGT, char * pszColorString )
|
||||
|
||||
static void hb_gt_def_SetColorStr( PHB_GT pGT, const char * szColorString )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_SetColorStr(%p,%s)", pGT, szColorString ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_SetColorStr(%p,%s)", ( void * ) pGT, szColorString ) );
|
||||
|
||||
HB_GTSELF_STRINGTOCOLORS( pGT, szColorString, &pGT->pColor, &pGT->iColorCount );
|
||||
pGT->iColorIndex = HB_CLR_STANDARD; /* HB_GTSELF_COLORSELECT( pGT, HB_CLR_STANDARD ); */
|
||||
@@ -373,7 +373,7 @@ static const char * hb_gt_def_ColorDecode( const char * szColorString, int * piC
|
||||
int nColor = 0, iCount = 0;
|
||||
HB_BOOL bFore = HB_TRUE;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_ColorDecode(%s,%p)", szColorString, piColor ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_ColorDecode(%s,%p)", szColorString, ( void * ) piColor ) );
|
||||
|
||||
while( ( c = *szColorString++ ) != 0 )
|
||||
{
|
||||
@@ -478,10 +478,9 @@ static int hb_gt_def_ColorNum( PHB_GT pGT, const char * szColorString )
|
||||
static void hb_gt_def_StringToColors( PHB_GT pGT, const char * szColorString, int ** pColorsPtr, int * piColorCount )
|
||||
{
|
||||
int * pColors;
|
||||
int nPos = 0;
|
||||
int nColor;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_StringToColors(%p,%s,%p,%p)", pGT, szColorString, pColorsPtr, piColorCount ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_StringToColors(%p,%s,%p,%p)", ( void * ) pGT, szColorString, ( void * ) pColorsPtr, ( void * ) piColorCount ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -503,6 +502,8 @@ static void hb_gt_def_StringToColors( PHB_GT pGT, const char * szColorString, in
|
||||
}
|
||||
else
|
||||
{
|
||||
int nPos = 0;
|
||||
|
||||
do
|
||||
{
|
||||
szColorString = hb_gt_def_ColorDecode( szColorString, &nColor );
|
||||
@@ -529,7 +530,7 @@ static void hb_gt_def_ColorsToString( PHB_GT pGT, int * pColors, int iColorCount
|
||||
{
|
||||
int iColorIndex, iPos;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_ColorsToString(%p,%p,%d,%p,%d)", pGT, pColors, iColorCount, pszColorString, iBufSize ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_ColorsToString(%p,%p,%d,%p,%d)", ( void * ) pGT, ( void * ) pColors, iColorCount, ( void * ) pszColorString, iBufSize ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -643,7 +644,7 @@ static void hb_gt_def_SetSnowFlag( PHB_GT pGT, HB_BOOL fNoSnow )
|
||||
{
|
||||
/*
|
||||
* NOTE: This is a compatibility function which have to be implemented
|
||||
* in low level GT driver.
|
||||
* in low-level GT driver.
|
||||
* If you're running on a CGA and snow is a problem speak up!
|
||||
*/
|
||||
|
||||
@@ -1365,7 +1366,7 @@ static void hb_gt_def_DrawShadow( PHB_GT pGT, int iTop, int iLeft, int iBottom,
|
||||
static void hb_gt_def_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int iRight,
|
||||
int iColor, HB_USHORT usChar, int iRows, int iCols )
|
||||
{
|
||||
int iColOld, iColNew, iColSize, iColClear, iClrs, iLength, iFlag = 0;
|
||||
int iColOld, iColNew, iColSize, iColClear, iClrs, iLength;
|
||||
|
||||
iColSize = iRight - iLeft;
|
||||
iLength = iColSize + 1;
|
||||
@@ -1388,6 +1389,7 @@ static void hb_gt_def_Scroll( PHB_GT pGT, int iTop, int iLeft, int iBottom, int
|
||||
if( iLength > 0 && iTop <= iBottom )
|
||||
{
|
||||
void * pBuffer = NULL;
|
||||
int iFlag = 0;
|
||||
|
||||
if( ( iRows || iCols ) && iColSize >= 0 && ( iBottom - iTop >= iRows ) )
|
||||
{
|
||||
@@ -1470,7 +1472,7 @@ static void hb_gt_def_ScrollArea( PHB_GT pGT, int iTop, int iLeft, int iBottom,
|
||||
|
||||
while( iTop <= iBottom )
|
||||
{
|
||||
int iRowPos, i;
|
||||
int iRowPos;
|
||||
|
||||
if( iRows >= 0 )
|
||||
iRowPos = iTop++;
|
||||
@@ -1480,6 +1482,8 @@ static void hb_gt_def_ScrollArea( PHB_GT pGT, int iTop, int iLeft, int iBottom,
|
||||
if( fMove && ( iRows == 0 ||
|
||||
( iRowPos + iRows >= iTop && iRowPos + iRows <= iBottom ) ) )
|
||||
{
|
||||
int i;
|
||||
|
||||
lIndex = ( long ) iRowPos * iWidth + iColNew;
|
||||
if( lOffset < 0 )
|
||||
{
|
||||
@@ -1874,7 +1878,7 @@ static HB_BOOL hb_gt_def_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
if( ! pInfo->pResult )
|
||||
pInfo->pResult = hb_itemNew( NULL );
|
||||
hb_arrayNew( pInfo->pResult, 7 );
|
||||
/* 7-th item is allocated for GTCTW window number */
|
||||
/* 7th item is allocated for GTCTW window number */
|
||||
HB_GTSELF_GETPOS( pGT, &iRow, &iCol );
|
||||
hb_arraySetNI( pInfo->pResult, 1, iRow );
|
||||
hb_arraySetNI( pInfo->pResult, 2, iCol );
|
||||
@@ -2001,16 +2005,13 @@ static int hb_gt_def_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions,
|
||||
pOptions && ( iOptions = ( int ) hb_arrayLen( pOptions ) ) > 0 )
|
||||
{
|
||||
HB_SIZE nLen;
|
||||
void * hMessage, * hOpt;
|
||||
const HB_WCHAR * szMessageW = hb_itemGetStrU16( pMessage, HB_CDP_ENDIAN_NATIVE, &hMessage, &nLen ),
|
||||
* szOptW;
|
||||
void * hMessage;
|
||||
const HB_WCHAR * szMessageW = hb_itemGetStrU16( pMessage, HB_CDP_ENDIAN_NATIVE, &hMessage, &nLen );
|
||||
HB_BOOL fScreen = HB_FALSE, fKeyBoard = HB_FALSE;
|
||||
PHB_CODEPAGE cdp = HB_GTSELF_HOSTCP( pGT );
|
||||
char szKey[ HB_MAX_CHAR_LEN ];
|
||||
HB_SIZE nChar;
|
||||
int iKey, i, iDspCount, iStyle, iRows, iCols,
|
||||
iRow, iCol, iTop, iLeft, iBottom, iRight, iMnuCol, iPos, iClr;
|
||||
void * pBuffer = NULL;
|
||||
int iKey, i, iRows, iCols;
|
||||
HB_GT_INFO gtInfo;
|
||||
|
||||
memset( >Info, 0, sizeof( gtInfo ) );
|
||||
@@ -2032,6 +2033,8 @@ static int hb_gt_def_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions,
|
||||
|
||||
if( fScreen )
|
||||
{
|
||||
void * pBuffer = NULL;
|
||||
int iDspCount, iStyle, iRow, iCol, iTop, iLeft, iBottom, iRight, iPos, iClr;
|
||||
HB_UINT ulLines = 0, ulWidth = 0, ulCurrWidth = 0, ulMsg = 0, ulDst = 0,
|
||||
ulLast = 0, ulSpace1 = 0, ulSpace2 = 0, ulDefWidth, ulMaxWidth;
|
||||
HB_WCHAR * szMsgDsp;
|
||||
@@ -2190,10 +2193,13 @@ static int hb_gt_def_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions,
|
||||
iPos = 1;
|
||||
while( iRet == 0 )
|
||||
{
|
||||
int iMnuCol;
|
||||
HB_GTSELF_DISPBEGIN( pGT );
|
||||
iMnuCol = iLeft + ( ( ulWidth - ulCurrWidth ) >> 1 ) + 3;
|
||||
for( i = 1; i <= iOptions; ++i )
|
||||
{
|
||||
void * hOpt;
|
||||
const HB_WCHAR * szOptW;
|
||||
iClr = i == iPos ? iClrHigh : iClrNorm;
|
||||
szOptW = hb_arrayGetStrU16( pOptions, i, HB_CDP_ENDIAN_NATIVE, &hOpt, &nLen );
|
||||
HB_GTSELF_PUTTEXTW( pGT, iBottom - 1, iMnuCol, iClr, s_szSpaceW, 1 );
|
||||
@@ -2614,7 +2620,7 @@ static int hb_gt_def_InkeyFilter( PHB_GT pGT, int iKey, int iEventMask )
|
||||
{
|
||||
int iMask;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyFilter(%p,%d,%d)", pGT, iKey, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyFilter(%p,%d,%d)", ( void * ) pGT, iKey, iEventMask ) );
|
||||
|
||||
HB_SYMBOL_UNUSED( pGT );
|
||||
|
||||
@@ -2747,7 +2753,7 @@ static void hb_gt_def_InkeyPut( PHB_GT pGT, int iKey )
|
||||
{
|
||||
int iHead;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyPut(%p,%d)", pGT, iKey ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyPut(%p,%d)", ( void * ) pGT, iKey ) );
|
||||
|
||||
iHead = pGT->inkeyHead;
|
||||
|
||||
@@ -2784,7 +2790,7 @@ static void hb_gt_def_InkeyPut( PHB_GT pGT, int iKey )
|
||||
/* Inset the key into head of keyboard buffer */
|
||||
static void hb_gt_def_InkeyIns( PHB_GT pGT, int iKey )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyIns(%p,%d)", pGT, iKey ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyIns(%p,%d)", ( void * ) pGT, iKey ) );
|
||||
|
||||
if( --pGT->inkeyTail < 0 )
|
||||
pGT->inkeyTail = pGT->inkeyBufferSize - 1;
|
||||
@@ -2805,7 +2811,7 @@ static void hb_gt_def_InkeyIns( PHB_GT pGT, int iKey )
|
||||
/* helper internal function */
|
||||
static HB_BOOL hb_gt_def_InkeyNextCheck( PHB_GT pGT, int iEventMask, int * iKey )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyNextCheck(%p,%p)", pGT, iKey ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyNextCheck(%p,%p)", ( void * ) pGT, ( void * ) iKey ) );
|
||||
|
||||
if( pGT->StrBuffer )
|
||||
{
|
||||
@@ -2840,7 +2846,7 @@ static void hb_gt_def_InkeyPollDo( PHB_GT pGT )
|
||||
{
|
||||
int iKey;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyPollDo(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyPollDo(%p)", ( void * ) pGT ) );
|
||||
|
||||
iKey = HB_GTSELF_READKEY( pGT, HB_INKEY_ALL | HB_INKEY_EXT );
|
||||
|
||||
@@ -2897,14 +2903,14 @@ static void hb_gt_def_InkeyPollDo( PHB_GT pGT )
|
||||
/* Poll the console keyboard to stuff the Harbour buffer */
|
||||
static void hb_gt_def_InkeyPoll( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyPoll(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyPoll(%p)", ( void * ) pGT ) );
|
||||
|
||||
/*
|
||||
* Clipper 5.3 always poll events without respecting
|
||||
* _SET_TYPEAHEAD when CL5.2 only when it's non zero.
|
||||
* IMHO keeping CL5.2 behavior will be more accurate for harbour
|
||||
* IMHO keeping CL5.2 behavior will be more accurate for Harbour
|
||||
* because it allows to control it by user what some times could be
|
||||
* necessary due to different low level GT behavior on some platforms
|
||||
* necessary due to different low-level GT behavior on some platforms
|
||||
*/
|
||||
if( hb_setGetTypeAhead() )
|
||||
hb_gt_def_InkeyPollDo( pGT );
|
||||
@@ -2915,7 +2921,7 @@ static int hb_gt_def_InkeyNext( PHB_GT pGT, int iEventMask )
|
||||
{
|
||||
int iKey = 0;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyNext(%p,%d)", pGT, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyNext(%p,%d)", ( void * ) pGT, iEventMask ) );
|
||||
|
||||
HB_GTSELF_INKEYPOLL( pGT );
|
||||
hb_gt_def_InkeyNextCheck( pGT, iEventMask, &iKey );
|
||||
@@ -2930,14 +2936,14 @@ static int hb_gt_def_InkeyGet( PHB_GT pGT, HB_BOOL fWait, double dSeconds, int i
|
||||
HB_MAXINT timeout;
|
||||
PHB_ITEM pKey;
|
||||
HB_BOOL fPop;
|
||||
int iKey;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyGet(%p,%d,%f,%d)", pGT, ( int ) fWait, dSeconds, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyGet(%p,%d,%f,%d)", ( void * ) pGT, ( int ) fWait, dSeconds, iEventMask ) );
|
||||
|
||||
pKey = NULL;
|
||||
|
||||
if( pGT->pInkeyReadBlock )
|
||||
{
|
||||
int iKey;
|
||||
HB_GTSELF_UNLOCK( pGT );
|
||||
iKey = hb_itemGetNI( hb_vmEvalBlock( pGT->pInkeyReadBlock ) );
|
||||
HB_GTSELF_LOCK( pGT );
|
||||
@@ -2988,7 +2994,7 @@ static int hb_gt_def_InkeyGet( PHB_GT pGT, HB_BOOL fWait, double dSeconds, int i
|
||||
/* Return the value of the last key that was extracted */
|
||||
static int hb_gt_def_InkeyLast( PHB_GT pGT, int iEventMask )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyLast(%p,%d)", pGT, iEventMask ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyLast(%p,%d)", ( void * ) pGT, iEventMask ) );
|
||||
|
||||
HB_GTSELF_INKEYPOLL( pGT );
|
||||
|
||||
@@ -3000,7 +3006,7 @@ static int hb_gt_def_InkeySetLast( PHB_GT pGT, int iKey )
|
||||
{
|
||||
int iLast;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeySetLast(%p,%d)", pGT, iKey ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeySetLast(%p,%d)", ( void * ) pGT, iKey ) );
|
||||
|
||||
iLast = pGT->inkeyLast;
|
||||
pGT->inkeyLast = iKey;
|
||||
@@ -3011,7 +3017,7 @@ static int hb_gt_def_InkeySetLast( PHB_GT pGT, int iKey )
|
||||
/* Set text into inkey buffer */
|
||||
static void hb_gt_def_InkeySetText( PHB_GT pGT, const char * szText, HB_SIZE nLen )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeySetText(%p,%s,%" HB_PFS "u)", pGT, szText, nLen ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeySetText(%p,%s,%" HB_PFS "u)", ( void * ) pGT, szText, nLen ) );
|
||||
|
||||
if( pGT->StrBuffer )
|
||||
{
|
||||
@@ -3043,7 +3049,7 @@ static void hb_gt_def_InkeyReset( PHB_GT pGT )
|
||||
{
|
||||
int iTypeAhead;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyReset(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyReset(%p)", ( void * ) pGT ) );
|
||||
|
||||
if( pGT->StrBuffer )
|
||||
{
|
||||
@@ -3078,7 +3084,7 @@ static void hb_gt_def_InkeyReset( PHB_GT pGT )
|
||||
/* reset inkey pool to default state and free any allocated resources */
|
||||
static void hb_gt_def_InkeyExit( PHB_GT pGT )
|
||||
{
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyExit(%p)", pGT ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_def_InkeyExit(%p)", ( void * ) pGT ) );
|
||||
|
||||
if( pGT->StrBuffer )
|
||||
{
|
||||
@@ -3378,7 +3384,7 @@ static void hb_gt_def_WhoCares( PHB_GT pGT, void * pCargo )
|
||||
HB_SYMBOL_UNUSED( pCargo );
|
||||
}
|
||||
|
||||
/* ************************************************************************* */
|
||||
/* - */
|
||||
|
||||
#if defined( __GNUC__ ) && 0
|
||||
static const HB_GT_FUNCS s_gtCoreFunc =
|
||||
@@ -3640,7 +3646,7 @@ static const HB_GT_FUNCS s_gtCoreFunc =
|
||||
};
|
||||
#endif
|
||||
|
||||
/* ************************************************************************* */
|
||||
/* - */
|
||||
|
||||
static char s_gtNameBuf[ HB_GT_NAME_MAX_ + 1 ];
|
||||
|
||||
@@ -3724,11 +3730,9 @@ HB_BOOL hb_gtRegister( const HB_GT_INIT * gtInit )
|
||||
|
||||
PHB_GT hb_gtLoad( const char * szGtName, PHB_GT pGT, PHB_GT_FUNCS pSuperTable )
|
||||
{
|
||||
int iPos;
|
||||
|
||||
if( szGtName )
|
||||
{
|
||||
iPos = hb_gt_FindEntry( szGtName );
|
||||
int iPos = hb_gt_FindEntry( szGtName );
|
||||
|
||||
if( iPos == -1 )
|
||||
{
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
/*
|
||||
* hb_NumToHex()
|
||||
* hb_HexToNum()
|
||||
* hb_NumToHex(), hb_HexToNum()
|
||||
*
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
@@ -182,7 +181,6 @@ HB_FUNC( HB_HEXTOSTR )
|
||||
{
|
||||
HB_SIZE nDest, ul;
|
||||
const char * szPtr;
|
||||
char * szDest;
|
||||
|
||||
szPtr = szStr;
|
||||
ul = nStr;
|
||||
@@ -202,7 +200,8 @@ HB_FUNC( HB_HEXTOSTR )
|
||||
{
|
||||
int iVal = 0x10;
|
||||
|
||||
szDest = ( char * ) hb_xgrab( nDest + 1 );
|
||||
char * szDest = ( char * ) hb_xgrab( nDest + 1 );
|
||||
|
||||
/* ul = 0; see above stop condition */
|
||||
do
|
||||
{
|
||||
|
||||
@@ -141,7 +141,7 @@ static const HB_PLURAL_FORMS s_plural_forms[] =
|
||||
{ "VI", HB_I18N_PLURAL_VI }
|
||||
};
|
||||
|
||||
#define HB_PLURAL_FOMRS_COUNT ( sizeof( s_plural_forms ) / sizeof( HB_PLURAL_FORMS ) )
|
||||
#define HB_PLURAL_FOMRS_COUNT HB_SIZEOFARRAY( s_plural_forms )
|
||||
|
||||
static const HB_UCHAR s_signature[ 4 ] = { 193, 'H', 'B', 'L' };
|
||||
typedef struct _HB_I18N_TRANS
|
||||
@@ -379,7 +379,7 @@ static PHB_I18N_TRANS hb_i18n_initialize( PHB_ITEM pTable )
|
||||
|
||||
if( HB_IS_HASH( pTable ) )
|
||||
{
|
||||
PHB_ITEM pKey, pContext, pDefContext = NULL, pValue;
|
||||
PHB_ITEM pKey, pContext, pDefContext = NULL;
|
||||
|
||||
pKey = hb_itemPutCConst( NULL, "CONTEXT" );
|
||||
pContext = hb_hashGetItemPtr( pTable, pKey, 0 );
|
||||
@@ -391,6 +391,8 @@ static PHB_I18N_TRANS hb_i18n_initialize( PHB_ITEM pTable )
|
||||
|
||||
if( pContext && pDefContext )
|
||||
{
|
||||
PHB_ITEM pValue;
|
||||
|
||||
pI18N = ( PHB_I18N_TRANS ) hb_xgrabz( sizeof( HB_I18N_TRANS ) );
|
||||
hb_atomic_set( &pI18N->iUsers, 1 );
|
||||
pI18N->table = pTable;
|
||||
@@ -660,7 +662,7 @@ static const char * hb_i18n_setcodepage( PHB_I18N_TRANS pI18N,
|
||||
const char * szCdpID,
|
||||
HB_BOOL fBase, HB_BOOL fTranslate )
|
||||
{
|
||||
const char * szOldCdpID = NULL, * szKey;
|
||||
const char * szOldCdpID = NULL;
|
||||
|
||||
if( pI18N )
|
||||
{
|
||||
@@ -671,6 +673,8 @@ static const char * hb_i18n_setcodepage( PHB_I18N_TRANS pI18N,
|
||||
szOldCdpID = cdpage->id;
|
||||
if( cdp && cdp != cdpage )
|
||||
{
|
||||
const char * szKey;
|
||||
|
||||
if( fTranslate && cdpage )
|
||||
{
|
||||
HB_SIZE nHashLen = hb_hashLen( pI18N->context_table ), ul;
|
||||
@@ -1036,9 +1040,10 @@ HB_FUNC( HB_I18N_ADDTEXT )
|
||||
{
|
||||
if( HB_IS_ARRAY( pTrans ) )
|
||||
{
|
||||
HB_SIZE nLen = hb_arrayLen( pTrans ), n;
|
||||
HB_SIZE nLen = hb_arrayLen( pTrans );
|
||||
if( nLen != 0 )
|
||||
{
|
||||
HB_SIZE n;
|
||||
for( n = 1; n <= nLen; ++n )
|
||||
{
|
||||
if( ! HB_IS_STRING( hb_arrayGetItemPtr( pTrans, n ) ) )
|
||||
|
||||
@@ -1,15 +1,13 @@
|
||||
/*
|
||||
* The internet protocol / TCP support
|
||||
*
|
||||
* Copyright 2002 Giancarlo Niccolai [gian@niccolai.ws]
|
||||
* Copyright 2002 Giancarlo Niccolai <gian@niccolai.ws>
|
||||
* Ron Pinkas [Ron@RonPinkas.com]
|
||||
* Marcelo Lombardo [marcelo.lombardo@newage-software.com.br]
|
||||
*
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
* updated and ported to Harbour
|
||||
*
|
||||
* Copyright 2008 Miguel Angel marchuet <miguelangel@marchuet.net>
|
||||
* added dinamic system buffer
|
||||
* added dynamic system buffer
|
||||
*
|
||||
* 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
|
||||
@@ -93,8 +91,8 @@ typedef struct
|
||||
do \
|
||||
{ \
|
||||
HB_INET_INITIALIZE(); \
|
||||
s = ( PHB_SOCKET_STRUCT ) hb_gcAllocate( sizeof( HB_SOCKET_STRUCT ), &s_gcInetFuncs ); \
|
||||
memset( s, 0, sizeof( HB_SOCKET_STRUCT ) ); \
|
||||
s = ( PHB_SOCKET_STRUCT ) hb_gcAllocate( sizeof( *s ), &s_gcInetFuncs ); \
|
||||
memset( s, 0, sizeof( *s ) ); \
|
||||
s->sd = HB_NO_SOCKET; \
|
||||
s->readahead = HB_INET_BUFFER_LEN; \
|
||||
s->iTimeout = -1; \
|
||||
@@ -230,9 +228,7 @@ static const HB_GC_FUNCS s_gcInetFuncs =
|
||||
hb_inetSocketMark
|
||||
};
|
||||
|
||||
/*****************************************************
|
||||
* Socket Initialization
|
||||
***/
|
||||
/* Socket Initialization */
|
||||
|
||||
static void hb_inetAutoInit( void )
|
||||
{
|
||||
@@ -320,9 +316,7 @@ HB_FUNC( HB_INETCLEANUP )
|
||||
hb_socketCleanup();
|
||||
}
|
||||
|
||||
/*****************************************************
|
||||
* Socket Creation and destruction
|
||||
***/
|
||||
/* Socket Creation and destruction */
|
||||
|
||||
HB_FUNC( HB_INETCREATE )
|
||||
{
|
||||
@@ -372,9 +366,7 @@ HB_FUNC( HB_INETFD )
|
||||
hb_inetErrRT();
|
||||
}
|
||||
|
||||
/************************************************
|
||||
* Socket data access & management
|
||||
***/
|
||||
/* Socket data access & management */
|
||||
|
||||
HB_FUNC( HB_INETSTATUS )
|
||||
{
|
||||
@@ -653,9 +645,7 @@ HB_FUNC( HB_INETSETRCVBUFSIZE )
|
||||
|
||||
|
||||
|
||||
/********************************************************************
|
||||
* TCP receive and send functions
|
||||
***/
|
||||
/* TCP receive and send functions */
|
||||
|
||||
static long s_inetRecv( PHB_SOCKET_STRUCT socket, char * buffer, long size,
|
||||
HB_BOOL readahead, HB_MAXINT timeout )
|
||||
@@ -1100,9 +1090,7 @@ HB_FUNC( HB_INETSENDALL )
|
||||
}
|
||||
|
||||
|
||||
/*******************************************
|
||||
* Name resolution interface functions
|
||||
***/
|
||||
/* Name resolution interface functions */
|
||||
|
||||
HB_FUNC( HB_INETGETHOSTS )
|
||||
{
|
||||
@@ -1143,9 +1131,8 @@ HB_FUNC( HB_INETGETALIAS )
|
||||
}
|
||||
|
||||
|
||||
/**********************************************
|
||||
* Interface information function
|
||||
****/
|
||||
/* Interface information function */
|
||||
|
||||
HB_FUNC( HB_INETIFINFO )
|
||||
{
|
||||
PHB_ITEM pInfo;
|
||||
@@ -1159,9 +1146,7 @@ HB_FUNC( HB_INETIFINFO )
|
||||
hb_reta( 0 );
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
* Server Specific functions
|
||||
****/
|
||||
/* Server Specific functions */
|
||||
|
||||
static int s_inetBind( PHB_SOCKET_STRUCT socket, const void * pSockAddr, unsigned uiLen )
|
||||
{
|
||||
@@ -1247,22 +1232,21 @@ HB_FUNC( HB_INETACCEPT )
|
||||
}
|
||||
}
|
||||
|
||||
/**********************************************
|
||||
* Client specific (connection functions)
|
||||
****/
|
||||
/* Client specific (connection functions) */
|
||||
|
||||
static void hb_inetConnectInternal( HB_BOOL fResolve )
|
||||
{
|
||||
const char * szHost = hb_parc( 1 );
|
||||
char * szAddr = NULL;
|
||||
PHB_SOCKET_STRUCT socket = HB_PARSOCKET( 3 );
|
||||
PHB_ITEM pSocket = NULL;
|
||||
int iPort = hb_parni( 2 );
|
||||
|
||||
if( szHost == NULL || iPort == 0 || ( socket == NULL && ! HB_ISNIL( 3 ) ) )
|
||||
hb_inetErrRT();
|
||||
else
|
||||
{
|
||||
PHB_ITEM pSocket = NULL;
|
||||
|
||||
if( ! socket )
|
||||
HB_SOCKET_INIT( socket, pSocket );
|
||||
else if( socket->sd != HB_NO_SOCKET )
|
||||
@@ -1320,9 +1304,7 @@ HB_FUNC( HB_INETCONNECTIP )
|
||||
hb_inetConnectInternal( HB_FALSE );
|
||||
}
|
||||
|
||||
/***********************************************************
|
||||
* Datagram functions
|
||||
************************************************************/
|
||||
/* Datagram functions */
|
||||
|
||||
HB_FUNC( HB_INETDGRAMBIND )
|
||||
{
|
||||
@@ -1479,7 +1461,7 @@ HB_FUNC( HB_INETDGRAMRECV )
|
||||
{
|
||||
fRepeat = HB_FALSE;
|
||||
if( socket->remote )
|
||||
hb_xfree( socket->remote );
|
||||
hb_xfree( socket->remote ); /* FIXME: double free */
|
||||
iMax = hb_socketRecvFrom( socket->sd, buffer, iLen, 0,
|
||||
&socket->remote, &socket->remotelen,
|
||||
socket->iTimeout );
|
||||
@@ -1503,10 +1485,7 @@ HB_FUNC( HB_INETDGRAMRECV )
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/***********************************************************
|
||||
* Generic utility(?) functions
|
||||
************************************************************/
|
||||
/* Generic utility(?) functions */
|
||||
|
||||
HB_FUNC( HB_INETCRLF )
|
||||
{
|
||||
|
||||
@@ -3,43 +3,44 @@
|
||||
*
|
||||
* Copyright 2002 Giancarlo Niccolai <gian@niccolai.ws>
|
||||
*
|
||||
* 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
|
||||
* 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,
|
||||
* 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.
|
||||
* 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.txt. if not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site https://www.gnu.org/).
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; see the file LICENSE.txt. If not, write to
|
||||
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301 USA (or visit https://www.gnu.org/licenses/).
|
||||
*
|
||||
* As a special exception, xHarbour license gives permission for
|
||||
* additional uses of the text contained in its release of xHarbour.
|
||||
* 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 xHarbour libraries with other
|
||||
* 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.
|
||||
* 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 xHarbour library code into it.
|
||||
* 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 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 with this xHarbour
|
||||
* explicit exception. if you add/copy code from other sources,
|
||||
* as the General public License permits, the above exception does
|
||||
* 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 xHarbour, it is your choice
|
||||
* 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.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -49,7 +50,7 @@
|
||||
* ; A line starting with a ';' is a comment
|
||||
* # Also, a '#' marks a comment up to the end of the line
|
||||
* [NewSection]
|
||||
* Variable = Value
|
||||
* Variable=Value
|
||||
* OtherVariable: Value
|
||||
*
|
||||
* You can pass a list of "potential" .ini files in a ';' separated path;
|
||||
@@ -64,7 +65,7 @@
|
||||
* "SectionN" => { "Key1" => "Val1", ... , "KeyN" => "ValN" }
|
||||
* }
|
||||
*
|
||||
* Main is the default section (variables that are declared without a section).
|
||||
* 'MAIN' is the default section (variables that are declared without a section).
|
||||
*
|
||||
*/
|
||||
|
||||
@@ -96,7 +97,6 @@ FUNCTION hb_iniNew( lAutoMain )
|
||||
RETURN hIni
|
||||
|
||||
FUNCTION hb_iniRead( cFileSpec, lKeyCaseSens, cSplitters, lAutoMain )
|
||||
|
||||
RETURN hb_iniReadStr( iif( HB_ISSTRING( cFileSpec ), hb_iniFileLow( cFileSpec ), "" ), lKeyCaseSens, cSplitters, lAutoMain )
|
||||
|
||||
FUNCTION hb_iniReadStr( cData, lKeyCaseSens, cSplitters, lAutoMain )
|
||||
@@ -160,7 +160,7 @@ STATIC FUNCTION hb_iniStringLow( hIni, cData, lKeyCaseSens, cSplitters, lAutoMai
|
||||
reSection := hb_regexComp( "[[](.*)[]]" )
|
||||
reSplitters := hb_regexComp( cSplitters )
|
||||
|
||||
/* Always begin with the MAIN section */
|
||||
/* Always begin with the 'MAIN' section */
|
||||
hCurrentSection := iif( lAutoMain, hIni[ "MAIN" ], hIni )
|
||||
|
||||
cLine := ""
|
||||
@@ -283,27 +283,27 @@ FUNCTION hb_iniWriteStr( hIni, cCommentBegin, cCommentEnd, lAutoMain )
|
||||
lAutoMain := .F.
|
||||
ENDIF
|
||||
|
||||
/* Write toplevel section */
|
||||
/* Write top-level section */
|
||||
IF lAutoMain
|
||||
/* When automain is on, write the main section */
|
||||
/* When lAutoMain is on, write the 'main' section */
|
||||
hb_HEval( hIni[ "MAIN" ], {| cKey, xVal | ;
|
||||
cBuffer += hb_CStr( cKey ) + "=" + hb_CStr( xVal ) + cNewLine } )
|
||||
ELSE
|
||||
/* When automain is off, just write all the toplevel variables. */
|
||||
/* When lAutoMain is off, just write all the top-level variables. */
|
||||
hb_HEval( hIni, {| cKey, xVal | iif( HB_ISHASH( xVal ), /* nothing */, ;
|
||||
cBuffer += hb_CStr( cKey ) + "=" + hb_CStr( xVal ) + cNewLine ) } )
|
||||
ENDIF
|
||||
|
||||
FOR EACH cSection IN hIni
|
||||
|
||||
/* Avoid re-processing main section */
|
||||
/* Avoid re-processing 'MAIN' section */
|
||||
IF lAutoMain
|
||||
/* When automain is on, skip section named MAIN */
|
||||
/* When lAutoMain is on, skip section named 'MAIN' */
|
||||
IF cSection:__enumKey == "MAIN"
|
||||
LOOP
|
||||
ENDIF
|
||||
ELSE
|
||||
/* When automain is off, skip all the toplevel variables. */
|
||||
/* When lAutoMain is off, skip all the top-level variables. */
|
||||
IF ! HB_ISHASH( cSection )
|
||||
LOOP
|
||||
ENDIF
|
||||
|
||||
@@ -52,14 +52,14 @@
|
||||
|
||||
/*
|
||||
The application/json Media Type for JavaScript Object Notation (JSON)
|
||||
http://www.ietf.org/rfc/rfc4627.txt
|
||||
https://tools.ietf.org/html/rfc4627
|
||||
|
||||
C level functions:
|
||||
char * hb_jsonEncode( PHB_ITEM pValue, HB_SIZE * pnLen, HB_BOOL fHuman );
|
||||
pValue - value to encode;
|
||||
pnLen - if pnLen is not NULL, length of returned buffer is
|
||||
stored to *pnLen;
|
||||
fHuman - format to be human redable;
|
||||
fHuman - format to be human readable;
|
||||
returns pointer to encoded JSON buffer. buffer must be fried
|
||||
by the caller.
|
||||
|
||||
@@ -72,8 +72,9 @@
|
||||
purposes. Returns 0 on error.
|
||||
|
||||
Harbour level functions:
|
||||
hb_jsonDecode( cJSON, @xValue ) --> nLengthDecoded
|
||||
hb_jsonEncode( xValue [, lHuman = .F. ] ) --> cJSON
|
||||
hb_jsonDecode( cJSON ) --> xValue
|
||||
hb_jsonDecode( cJSON, @xValue ) --> nLengthDecoded
|
||||
|
||||
Note:
|
||||
- JSON encode functions are safe for recursive arrays and hashes.
|
||||
@@ -174,7 +175,7 @@ static void _hb_jsonEncode( PHB_ITEM pValue, PHB_JSON_ENCODE_CTX pCtx,
|
||||
|
||||
if( HB_IS_STRING( pValue ) )
|
||||
{
|
||||
HB_SIZE nPos, nPos2, nLen;
|
||||
HB_SIZE nPos, nLen;
|
||||
const char * szString;
|
||||
void * hString = NULL;
|
||||
char buf[ 8 ];
|
||||
@@ -194,7 +195,7 @@ static void _hb_jsonEncode( PHB_ITEM pValue, PHB_JSON_ENCODE_CTX pCtx,
|
||||
while( nPos < nLen )
|
||||
{
|
||||
unsigned char uch = szString[ nPos ];
|
||||
nPos2 = nPos;
|
||||
HB_SIZE nPos2 = nPos;
|
||||
while( uch >= ' ' && uch != '\\' && uch != '\"' )
|
||||
uch = szString[ ++nPos2 ];
|
||||
if( nPos2 > nPos )
|
||||
@@ -389,7 +390,7 @@ static void _hb_jsonEncode( PHB_ITEM pValue, PHB_JSON_ENCODE_CTX pCtx,
|
||||
}
|
||||
else
|
||||
{
|
||||
/* All unsupported types are replacd by null */
|
||||
/* All unsupported types are replaced by null */
|
||||
_hb_jsonCtxAdd( pCtx, "null", 4 );
|
||||
}
|
||||
}
|
||||
@@ -733,9 +734,7 @@ HB_FUNC( HB_JSONENCODE )
|
||||
if( pItem )
|
||||
{
|
||||
HB_SIZE nLen;
|
||||
char * szRet;
|
||||
|
||||
szRet = hb_jsonEncodeCP( pItem, &nLen, hb_parl( 2 ), _hb_jsonCdpPar( 3 ) );
|
||||
char * szRet = hb_jsonEncodeCP( pItem, &nLen, hb_parl( 2 ), _hb_jsonCdpPar( 3 ) );
|
||||
hb_retclen_buffer( szRet, nLen );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,24 +44,21 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
#include "hbapiitm.h"
|
||||
#include "hbapierr.h"
|
||||
#include "hbdate.h"
|
||||
#include "hblpp.h"
|
||||
|
||||
|
||||
PHB_LPP hb_lppCreate( HB_SOCKET sd )
|
||||
{
|
||||
PHB_LPP pSocket;
|
||||
|
||||
pSocket = ( PHB_LPP ) hb_xgrabz( sizeof( HB_LPP ) );
|
||||
pSocket->sd = sd;
|
||||
pSocket = ( PHB_LPP ) hb_xgrabz( sizeof( HB_LPP ) );
|
||||
pSocket->sd = sd;
|
||||
pSocket->nLimit = 1024;
|
||||
return pSocket;
|
||||
}
|
||||
|
||||
|
||||
void hb_lppDestroy( PHB_LPP pSocket )
|
||||
{
|
||||
if( pSocket->pSendBuffer )
|
||||
@@ -73,19 +70,16 @@ void hb_lppDestroy( PHB_LPP pSocket )
|
||||
hb_xfree( pSocket );
|
||||
}
|
||||
|
||||
|
||||
void hb_lppSetLimit( PHB_LPP pSocket, HB_SIZE nLimit )
|
||||
{
|
||||
pSocket->nLimit = nLimit;
|
||||
}
|
||||
|
||||
|
||||
int hb_lppError( PHB_LPP pSocket )
|
||||
{
|
||||
return pSocket->iError;
|
||||
}
|
||||
|
||||
|
||||
HB_BOOL hb_lppSend( PHB_LPP pSocket, const void * data, HB_SIZE len, HB_MAXINT timeout )
|
||||
{
|
||||
HB_MAXUINT timer;
|
||||
@@ -120,7 +114,7 @@ HB_BOOL hb_lppSend( PHB_LPP pSocket, const void * data, HB_SIZE len, HB_MAXINT t
|
||||
{
|
||||
hb_xfree( pSocket->pSendBuffer );
|
||||
pSocket->pSendBuffer = NULL;
|
||||
pSocket->iError = 0;
|
||||
pSocket->iError = 0;
|
||||
return HB_TRUE;
|
||||
}
|
||||
if( ( timeout = hb_timerTest( timeout, &timer ) ) == 0 )
|
||||
@@ -131,7 +125,6 @@ HB_BOOL hb_lppSend( PHB_LPP pSocket, const void * data, HB_SIZE len, HB_MAXINT t
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HB_BOOL hb_lppRecv( PHB_LPP pSocket, void ** data, HB_SIZE * len, HB_MAXINT timeout )
|
||||
{
|
||||
HB_MAXUINT timer;
|
||||
@@ -139,8 +132,8 @@ HB_BOOL hb_lppRecv( PHB_LPP pSocket, void ** data, HB_SIZE * len, HB_MAXINT time
|
||||
|
||||
if( ! pSocket->pRecvBuffer )
|
||||
{
|
||||
pSocket->pRecvBuffer = ( char * ) hb_xgrab( 4 );
|
||||
pSocket->nRecvLen = 0;
|
||||
pSocket->pRecvBuffer = ( char * ) hb_xgrab( 4 );
|
||||
pSocket->nRecvLen = 0;
|
||||
pSocket->fRecvHasSize = HB_FALSE;
|
||||
}
|
||||
|
||||
@@ -182,7 +175,7 @@ HB_BOOL hb_lppRecv( PHB_LPP pSocket, void ** data, HB_SIZE * len, HB_MAXINT time
|
||||
return HB_FALSE;
|
||||
}
|
||||
|
||||
pSocket->nRecvLen = 0;
|
||||
pSocket->nRecvLen = 0;
|
||||
pSocket->fRecvHasSize = HB_TRUE;
|
||||
if( pSocket->nRecvSize != 4 )
|
||||
pSocket->pRecvBuffer = ( char * ) hb_xrealloc( pSocket->pRecvBuffer, pSocket->nRecvSize );
|
||||
@@ -209,10 +202,10 @@ HB_BOOL hb_lppRecv( PHB_LPP pSocket, void ** data, HB_SIZE * len, HB_MAXINT time
|
||||
pSocket->nRecvLen += lRecv;
|
||||
if( pSocket->nRecvSize == pSocket->nRecvLen )
|
||||
{
|
||||
* data = pSocket->pRecvBuffer;
|
||||
* len = pSocket->nRecvLen;
|
||||
*data = pSocket->pRecvBuffer;
|
||||
*len = pSocket->nRecvLen;
|
||||
pSocket->pRecvBuffer = NULL;
|
||||
pSocket->iError = 0;
|
||||
pSocket->iError = 0;
|
||||
return HB_TRUE;
|
||||
}
|
||||
if( ( timeout = hb_timerTest( timeout, &timer ) ) == 0 )
|
||||
@@ -223,13 +216,11 @@ HB_BOOL hb_lppRecv( PHB_LPP pSocket, void ** data, HB_SIZE * len, HB_MAXINT time
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
HB_SIZE hb_lppSendLen( PHB_LPP pSocket )
|
||||
{
|
||||
return pSocket->nSendLen - pSocket->nSendPos;
|
||||
}
|
||||
|
||||
|
||||
HB_SIZE hb_lppRecvLen( PHB_LPP pSocket )
|
||||
{
|
||||
return pSocket->nRecvLen;
|
||||
|
||||
@@ -44,20 +44,17 @@
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
|
||||
Idea and protocol
|
||||
/* Idea and protocol
|
||||
=================
|
||||
Very often it is required to accept the whole data message from
|
||||
TCP connection. Because of stream nature of TCP, this requires
|
||||
additional steps from application like start/end marker, or sending
|
||||
length of structure before the structure. The latter simple approach
|
||||
was used in Length Prefix Protocol (LPP). Protocol can easily be
|
||||
described by simple Clipper expression:
|
||||
Bin2L(Len(cData)) + cData
|
||||
described by simple Harbour expression:
|
||||
Bin2L( hb_BLen( cData ) ) + cData
|
||||
|
||||
Future extensions: Protocol is limitted to 4GB size for a single LPP
|
||||
Future extensions: Protocol is limited to 4 GiB size for a single LPP
|
||||
message. This can be extended in future to use highest bit of length
|
||||
(or some highest length values 2^32-1, etc) as a special marker for
|
||||
64-bit or similar length encoding.
|
||||
@@ -74,13 +71,13 @@
|
||||
the only new error code (until now) is HB_LPP_ERROR_TOOLARGE
|
||||
hb_lppSetLimit( hLPP, nLimit )
|
||||
Sets size limit for receiving data. Sending 4 bytes containing
|
||||
large 32-bit value makes receiving application to alllocate a
|
||||
large 32-bit value makes receiving application to allocate a
|
||||
large memory block for storage of data to be received. It is very
|
||||
easy to crash application (or system) using such protocol and
|
||||
logic. hb_lppSetLimit() helps to protect against such attacks.
|
||||
On hb_lppCreate() limit is set to 1024 bytes. This is enough
|
||||
for server/client authentification. After successful
|
||||
authentification server can increase size limit and large LPP
|
||||
for server/client authentication. After successful
|
||||
authentication server can increase size limit and large LPP
|
||||
packets can be used.
|
||||
hb_lppSend( hLPP, cBuf [, nTimeout = FOREVER ] ) --> lSuccess
|
||||
hb_lppRecv( hLPP, @cBuf [, nTimeout = FOREVER ] ) --> lSuccess
|
||||
@@ -95,7 +92,7 @@
|
||||
hLPP := hb_lppCreate( hSocket )
|
||||
DO WHILE ! ( lI := hb_lppSend( hLPP, cData, nTimeout ) ) .AND. ;
|
||||
hb_lppError( hLPP ) == HB_SOCKET_ERR_TIMEOUT )
|
||||
// draw progressbar using hb_lppSendLen( hLPP )
|
||||
// draw progress bar using hb_lppSendLen( hLPP )
|
||||
ENDDO
|
||||
IF lI // or hb_lppError( hLPP ) == 0
|
||||
// Sent OK
|
||||
@@ -108,7 +105,7 @@
|
||||
// recv sample
|
||||
DO WHILE ! ( lI := hb_lppRecv( hLPP, @cData, nTimeout ) ) .AND. ;
|
||||
hb_lppError( hLPP ) == HB_SOCKET_ERR_TIMEOUT )
|
||||
// draw progressbar using hb_lppRecvLen( hLPP )
|
||||
// draw progress bar using hb_lppRecvLen( hLPP )
|
||||
ENDDO
|
||||
IF lI
|
||||
// Rcvd OK, data in cData
|
||||
@@ -117,7 +114,6 @@
|
||||
ELSE
|
||||
// error
|
||||
ENDIF
|
||||
|
||||
*/
|
||||
|
||||
#include "hbapiitm.h"
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
/*
|
||||
* WARNING: Outdated, insecure algorithm.
|
||||
*
|
||||
* Harbour MD5 Support
|
||||
*
|
||||
* Copyright 2004 Dmitry V. Korzhov <dk@april26.spb.ru>
|
||||
*
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
* updated for current Harbour code, other then x86@32 machines,
|
||||
* files and buffers longer then 2^32 and some fixes
|
||||
@@ -53,7 +54,7 @@
|
||||
|
||||
PRG functions:
|
||||
|
||||
hb_MD5( <cString> ) -> <cMD5>
|
||||
hb_MD5( <cString> ) --> <cMD5>
|
||||
Calculates RFC 1321 MD5 digest (128-bit checksum)
|
||||
Parameters:
|
||||
<cString> - string variable to calculate MD5
|
||||
@@ -61,7 +62,7 @@
|
||||
ASCII hex MD5 digest as 32-byte string
|
||||
empty string on error
|
||||
|
||||
hb_MD5File( <cFileName> ) -> <cMD5>
|
||||
hb_MD5File( <cFileName> ) --> <cMD5>
|
||||
Calculates RFC 1321 MD5 digest (128-bit checksum) of a file contents
|
||||
(file size is limited by OS limits only)
|
||||
Parameters:
|
||||
@@ -84,7 +85,7 @@ typedef struct
|
||||
} MD5_BUF;
|
||||
|
||||
/*
|
||||
Pseudofunctions;
|
||||
Pseudo-functions;
|
||||
A[x] - accumulators[4]
|
||||
T[x] - Value table[64]
|
||||
X[x] - buffer[16]
|
||||
@@ -248,7 +249,7 @@ void hb_md5( const void * data, HB_SIZE nLen, char * digest )
|
||||
|
||||
/* perform startup procedures */
|
||||
hb_md5accinit( md5.accum );
|
||||
/* count full 512bit blocks in data*/
|
||||
/* count full 512-bit blocks in data*/
|
||||
n = nLen >> 6;
|
||||
/* process full blocks */
|
||||
for( i = 0; i < n; i++, ucdata += 64 )
|
||||
@@ -358,7 +359,7 @@ HB_BOOL hb_md5file( const char * pszFileName, char * digest )
|
||||
return HB_FALSE;
|
||||
}
|
||||
|
||||
HB_FUNC( HB_MD5 )
|
||||
HB_FUNC( HB_MD5 ) /* Considered insecure. Use SHA256 or higher instead. */
|
||||
{
|
||||
const char * pszStr = hb_parc( 1 );
|
||||
|
||||
@@ -382,7 +383,7 @@ HB_FUNC( HB_MD5 )
|
||||
hb_retc_null(); /* return empty string on wrong call */
|
||||
}
|
||||
|
||||
HB_FUNC( HB_MD5FILE )
|
||||
HB_FUNC( HB_MD5FILE ) /* Considered insecure. Use SHA256 or higher instead. */
|
||||
{
|
||||
const char * pszFileName = hb_parc( 1 );
|
||||
char dststr[ 16 ];
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*
|
||||
* PRG functions for MD5 encryption/decryption using
|
||||
* CFB (cipher feedback) mode
|
||||
* CFB (cipher feedback) mode
|
||||
*
|
||||
* Copyright 2012 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
*
|
||||
@@ -63,7 +63,7 @@ static void hb_md5_next_seed( char * vect, const char * pszKey, int iLen )
|
||||
hb_md5( vect, 16, vect );
|
||||
}
|
||||
|
||||
/* hb_MD5Encrypt( <cText>, <cPasswd> ) -> <cCipher>
|
||||
/* hb_MD5Encrypt( <cText>, <cPasswd> ) --> <cCipher>
|
||||
*/
|
||||
HB_FUNC( HB_MD5ENCRYPT )
|
||||
{
|
||||
@@ -71,7 +71,7 @@ HB_FUNC( HB_MD5ENCRYPT )
|
||||
|
||||
if( pData && hb_parclen( 2 ) > 0 )
|
||||
{
|
||||
HB_SIZE nLen = hb_itemGetCLen( pData ), n;
|
||||
HB_SIZE nLen = hb_itemGetCLen( pData );
|
||||
|
||||
if( nLen )
|
||||
{
|
||||
@@ -80,6 +80,7 @@ HB_FUNC( HB_MD5ENCRYPT )
|
||||
const char * pszKey = hb_parc( 2 );
|
||||
int iLen = ( int ) hb_parclen( 2 );
|
||||
char vect[ 16 ];
|
||||
HB_SIZE n;
|
||||
|
||||
hb_md5_init_seed( vect, pszKey, iLen );
|
||||
|
||||
@@ -97,7 +98,7 @@ HB_FUNC( HB_MD5ENCRYPT )
|
||||
}
|
||||
}
|
||||
|
||||
/* hb_MD5Decrypt( <cCipher>, <cPasswd> ] ) -> <cText>
|
||||
/* hb_MD5Decrypt( <cCipher>, <cPasswd> ] ) --> <cText>
|
||||
*/
|
||||
HB_FUNC( HB_MD5DECRYPT )
|
||||
{
|
||||
@@ -105,7 +106,7 @@ HB_FUNC( HB_MD5DECRYPT )
|
||||
|
||||
if( pData && hb_parclen( 2 ) > 0 )
|
||||
{
|
||||
HB_SIZE nLen = hb_itemGetCLen( pData ), n;
|
||||
HB_SIZE nLen = hb_itemGetCLen( pData );
|
||||
|
||||
if( nLen )
|
||||
{
|
||||
@@ -114,6 +115,7 @@ HB_FUNC( HB_MD5DECRYPT )
|
||||
const char * pszKey = hb_parc( 2 );
|
||||
int iLen = ( int ) hb_parclen( 2 );
|
||||
char vect[ 16 ];
|
||||
HB_SIZE n;
|
||||
|
||||
hb_md5_init_seed( vect, pszKey, iLen );
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* low level functions to create, wait and terminate processes
|
||||
* Low-level functions to create, wait and terminate processes
|
||||
*
|
||||
* Copyright 2009 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
* based on xHarbour code by
|
||||
@@ -235,7 +235,7 @@ static void hb_getCommand( const char * pszFileName,
|
||||
|
||||
#elif defined( HB_PROCESS_USEFILES ) || defined( HB_OS_UNIX )
|
||||
|
||||
/* convert command to argument list using standard bourne shell encoding:
|
||||
/* convert command to argument list using standard Bourne shell encoding:
|
||||
* "" and '' can be used to group parameters with blank characters,
|
||||
* the escape character is '\', quoting by '' disables escape character.
|
||||
*/
|
||||
@@ -508,7 +508,7 @@ HB_FHANDLE hb_fsProcessOpen( const char * pszFileName,
|
||||
HB_FHANDLE hResult = FS_ERROR;
|
||||
HB_BOOL fError = HB_FALSE;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsProcessOpen(%s, %p, %p, %p, %d, %p)", pszFileName, phStdin, phStdout, phStderr, fDetach, pulPID ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsProcessOpen(%s, %p, %p, %p, %d, %p)", pszFileName, ( void * ) phStdin, ( void * ) phStdout, ( void * ) phStderr, fDetach, ( void * ) pulPID ) );
|
||||
|
||||
if( phStdin != NULL )
|
||||
fError = ! hb_fsPipeCreate( hPipeIn );
|
||||
@@ -1133,7 +1133,7 @@ int hb_fsProcessRun( const char * pszFileName,
|
||||
HB_SIZE nOutSize, nErrSize, nOutBuf, nErrBuf;
|
||||
int iResult;
|
||||
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsProcessRun(%s, %p, %" HB_PFS "u, %p, %p, %p, %p, %d)", pStdInBuf, pStdInBuf, nStdInLen, pStdOutPtr, pulStdOut, pStdErrPtr, pulStdErr, fDetach ) );
|
||||
HB_TRACE( HB_TR_DEBUG, ( "hb_fsProcessRun(%s, %p, %" HB_PFS "u, %p, %p, %p, %p, %d)", pszFileName, ( const void * ) pStdInBuf, nStdInLen, ( void * ) pStdOutPtr, ( void * ) pulStdOut, ( void * ) pStdErrPtr, ( void * ) pulStdErr, fDetach ) );
|
||||
|
||||
nOutBuf = nErrBuf = nOutSize = nErrSize = 0;
|
||||
pOutBuf = pErrBuf = NULL;
|
||||
@@ -1693,6 +1693,8 @@ int hb_fsProcessRun( const char * pszFileName,
|
||||
int iTODO;
|
||||
|
||||
HB_SYMBOL_UNUSED( nStdInLen );
|
||||
HB_SYMBOL_UNUSED( nOutSize );
|
||||
HB_SYMBOL_UNUSED( nErrSize );
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -56,10 +56,6 @@ HB_FUNC( HB_PROCESSOPEN )
|
||||
PHB_ITEM pStdIn = hb_param( 2, HB_IT_BYREF );
|
||||
PHB_ITEM pStdOut = hb_param( 3, HB_IT_BYREF );
|
||||
PHB_ITEM pStdErr = hb_param( 4, HB_IT_BYREF );
|
||||
HB_BOOL fDetach = hb_parl( 5 );
|
||||
HB_FHANDLE hStdIn, *phStdIn, hStdOut, *phStdOut, hStdErr, *phStdErr;
|
||||
HB_FHANDLE hProcess;
|
||||
HB_ULONG ulPID;
|
||||
|
||||
if( szName &&
|
||||
( pStdIn || HB_ISNIL( 2 ) ) &&
|
||||
@@ -69,6 +65,11 @@ HB_FUNC( HB_PROCESSOPEN )
|
||||
( HB_ISBYREF( 6 ) || HB_ISNIL( 6 ) ) &&
|
||||
( ! pStdIn || ( pStdIn != pStdOut && pStdIn != pStdErr ) ) )
|
||||
{
|
||||
HB_BOOL fDetach = hb_parl( 5 );
|
||||
HB_FHANDLE hStdIn, *phStdIn, hStdOut, *phStdOut, hStdErr, *phStdErr;
|
||||
HB_FHANDLE hProcess;
|
||||
HB_ULONG ulPID;
|
||||
|
||||
phStdIn = pStdIn ? &hStdIn : NULL;
|
||||
phStdOut = pStdOut ? &hStdOut : NULL;
|
||||
phStdErr = pStdErr ? ( pStdOut == pStdErr ? phStdOut : &hStdErr ) : NULL;
|
||||
@@ -121,7 +122,7 @@ HB_FUNC( HB_PROCESSCLOSE )
|
||||
}
|
||||
|
||||
/* hb_processRun( <cCommand>, [ <cStdIn> ], [ @<cStdOut> ], [ @<cStdErr> ], ;
|
||||
[ <lDetach> ] ) -> <nResult> */
|
||||
[ <lDetach> ] ) --> <nResult> */
|
||||
HB_FUNC( HB_PROCESSRUN )
|
||||
{
|
||||
const char * szName = hb_parc( 1 );
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user