Files
harbour-core/contrib/hbnf/ftattr.c
Viktor Szakats b414d00664 2013-04-05 16:24 UTC+0200 Viktor Szakats (harbour syenar.net)
* bin/check.hb
  * tests/fixcase.hb
    + some exceptions for casing
    * deleted one file exception (a readme)

  * contrib/gtwvg/gtwvgd.c
  * contrib/gtwvg/wvgcore.c
  * contrib/gtwvg/wvgcuig.c
  * contrib/gtwvg/wvgwin.c
  * contrib/gtwvg/wvgwing.c
  * contrib/hbamf/amfenc.c
  * contrib/hbbz2/core.c
  * contrib/hbct/ctcom1.c
  * contrib/hbct/ctcom2.c
  * contrib/hbct/ctnet.c
  * contrib/hbct/ctstr.c
  * contrib/hbct/ctwfunc.c
  * contrib/hbct/ctwin.c
  * contrib/hbct/disk.c
  * contrib/hbct/finan.c
  * contrib/hbct/screen2.c
  * contrib/hbct/token1.c
  * contrib/hbct/token2.c
  * contrib/hbct/trig.c
  * contrib/hbgd/gdwrp.c
  * contrib/hbhpdf/image.c
  * contrib/hbmisc/irm.c
  * contrib/hbnetio/netiocli.c
  * contrib/hbnetio/netiosrv.c
  * contrib/hbnetio/readme.txt
  * contrib/hbnf/dispc.c
  * contrib/hbnf/ftattr.c
  * contrib/hbnf/origin.c
  * contrib/hbssl/ssl.c
  * contrib/hbwin/wapi_commctrl.c
  * contrib/hbwin/wapi_winuser.c
  * contrib/hbwin/win_dlg.c
  * contrib/hbwin/win_prn2.c
  * contrib/hbwin/win_shell.c
  * contrib/rddads/ads1.c
  * contrib/rddads/adsfunc.c
  * contrib/xhb/fparse.c
  * contrib/xhb/hbcrypt.c
  * contrib/xhb/hbserv.c
  * contrib/xhb/hbxml.c
  * contrib/xhb/txtline.c
  * contrib/xhb/xhbarr.c
  * contrib/xhb/xhbarrex.c
  * extras/gfspell/spellc.c
  * extras/gtwvw/gtwvwd.c
  * extras/gtwvw/hbgtwvw.h
  * extras/gtwvw/wvwcheck.c
  * extras/gtwvw/wvwdraw.c
  * extras/gtwvw/wvwedit.c
  * extras/gtwvw/wvwfuncs.c
  * extras/gtwvw/wvwmenu.c
  * extras/gtwvw/wvwpush.c
  * extras/gtwvw/wvwstbar.c
  * extras/gtwvw/wvwtbar.c
  * include/hbapi.h
  * include/hbapirdd.h
  * include/hbdefs.h
  * include/hbexpra.c
  * include/hbexprb.c
  * include/hbpcode.h
  * include/hbpp.h
  * include/hbrddcdx.h
  * include/hbrddnsx.h
  * src/codepage/cp_utf8.c
  * src/common/expropt1.c
  * src/common/expropt2.c
  * src/compiler/cmdcheck.c
  * src/compiler/genc.c
  * src/compiler/gencc.c
  * src/compiler/hbfunchk.c
  * src/compiler/hbopt.c
  * src/pp/pplib.c
  * src/rdd/dbcmd.c
  * src/rdd/dbf1.c
  * src/rdd/dbfcdx/dbfcdx1.c
  * src/rdd/hbsix/sxcompr.c
  * src/rdd/hbsix/sxord.c
  * src/rdd/hsx/hsx.c
  * src/rtl/chruni.c
  * src/rtl/cputime.c
  * src/rtl/dateshb.c
  * src/rtl/filehb.c
  * src/rtl/filesys.c
  * src/rtl/gtsln/gtsln.c
  * src/rtl/gtwvt/gtwvt.c
  * src/rtl/gtxwc/gtxwc.c
  * src/rtl/hbgtcore.c
  * src/rtl/hbinet.c
  * src/rtl/hblpphb.c
  * src/rtl/hbmd5.c
  * src/rtl/hbproces.c
  * src/rtl/hbsocket.c
  * src/rtl/hbsockhb.c
  * src/rtl/hbtoken.c
  * src/rtl/hbzlib.c
  * src/rtl/hbzlibgz.c
  * src/rtl/langapi.c
  * src/rtl/mlcfunc.c
  * src/rtl/philes.c
  * src/rtl/soundex.c
  * src/rtl/strzero.c
  * src/rtl/transfrm.c
  * src/vm/arrayshb.c
  * src/vm/classes.c
  * src/vm/dynsym.c
  * src/vm/eval.c
  * src/vm/garbage.c
  * src/vm/hvm.c
  * src/vm/macro.c
  * src/vm/memvars.c
  * src/vm/runner.c
  * src/vm/set.c
  * src/vm/thread.c
    * run tests/fixcase.hb now that it's able to fixup casing
      inside all comments
2013-04-05 16:27:40 +02:00

142 lines
3.4 KiB
C

/*
* Author....: Ted Means
* CIS ID....: 73067,3332
*
* This is an original work by Ted Means and is placed in the
* public domain.
*
* Modification history:
* ---------------------
*
* Rev 1.2 03 Oct 1992 14:35:14 GLENN
* Ted Means made modifications to support use of DispBegin()/DispEnd().
*
* Rev 1.1 15 Aug 1991 23:07:58 GLENN
* Forest Belt proofread/edited/cleaned up doc
*
* Rev 1.0 12 Jun 1991 01:30:20 GLENN
* Initial revision.
*
*/
#include "hbapi.h"
#include "hbapigt.h"
HB_FUNC( FT_SAVEATT )
{
int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */
int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */
int iMaxRow = hb_gtMaxRow();
int iMaxCol = hb_gtMaxCol();
int iBottom = hb_parnidef( 3, iMaxRow );
int iRight = hb_parnidef( 4, iMaxRow );
if( iTop < 0 )
iTop = 0;
if( iLeft < 0 )
iLeft = 0;
if( iBottom > iMaxRow )
iBottom = iMaxRow;
if( iRight > iMaxCol )
iRight = iMaxCol;
if( iTop <= iBottom && iLeft <= iRight )
{
HB_SIZE nSize;
char * pBuffer;
char * pAttrib;
nSize = ( iBottom - iTop + 1 ) * ( iRight - iLeft + 1 );
pBuffer = pAttrib = ( char * ) hb_xgrab( nSize + 1 );
while( iTop <= iBottom )
{
int iCol = iLeft;
while( iCol <= iRight )
{
int iColor;
HB_BYTE bAttr;
HB_USHORT usChar;
hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar );
*pBuffer++ = ( char ) iColor;
++iCol;
}
++iTop;
}
hb_retclen_buffer( pAttrib, nSize );
}
else
hb_retc_null();
}
/*
* Author....: Ted Means
* CIS ID....: 73067,3332
*
* This is an original work by Ted Means and is placed in the
* public domain.
*
* Modification history:
* ---------------------
*
* Rev 1.2 03 Oct 1992 14:33:46 GLENN
* Ted Means made modifications so these functions will work with
* DispBegin() and DispEnd().
*
* Rev 1.1 15 Aug 1991 23:08:02 GLENN
* Forest Belt proofread/edited/cleaned up doc
*
* Rev 1.0 12 Jun 1991 01:30:14 GLENN
* Initial revision.
*
*/
HB_FUNC( FT_RESTATT )
{
HB_SIZE nLen = hb_parclen( 5 );
if( nLen )
{
int iTop = hb_parni( 1 ); /* Defaults to zero on bad type */
int iLeft = hb_parni( 2 ); /* Defaults to zero on bad type */
int iMaxRow = hb_gtMaxRow();
int iMaxCol = hb_gtMaxCol();
int iBottom = hb_parnidef( 3, iMaxRow );
int iRight = hb_parnidef( 4, iMaxCol );
if( iTop < 0 )
iTop = 0;
if( iLeft < 0 )
iLeft = 0;
if( iBottom > iMaxRow )
iBottom = iMaxRow;
if( iRight > iMaxCol )
iRight = iMaxCol;
if( iTop <= iBottom && iLeft <= iRight )
{
const char * pAttrib = hb_parc( 5 );
hb_gtDispBegin();
while( nLen && iTop <= iBottom )
{
int iCol = iLeft;
while( nLen && iCol <= iRight )
{
int iColor;
HB_BYTE bAttr;
HB_USHORT usChar;
hb_gtGetChar( iTop, iCol, &iColor, &bAttr, &usChar );
iColor = ( HB_UCHAR ) *pAttrib++;
hb_gtPutChar( iTop, iCol, iColor, bAttr, usChar );
++iCol;
--nLen;
}
++iTop;
}
hb_gtDispEnd();
}
}
}