2010-02-25 20:52 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/gtwvg/gtwvg.c
* contrib/gtwvg/gtwvg.h
* Synced color RGB values with GTWVT.
* contrib/hbgd/hbgd.hbc
! Fixed to reference hbct lib. hbgd requires it for
some math functions.
* contrib/hbxpp/Makefile
* contrib/hbxpp/hbxpp.ch
+ contrib/hbxpp/xppopc.c
+ contrib/hbxpp/xppop.prg
+ contrib/hbxpp/tests/opover.prg
+ Added support for 'string[ n ]' syntax.
Note, you have to #include "hbxpp.ch" to activate it.
(of course you can pick the logic and copy it to app
code, it's only two lines)
(copied and adapted from existing xhb lib implementation)
* contrib/xhb/xhbmsgs.c
! Fixed HB_LONG -> HB_ISIZ
* contrib/hbxpp/hbxppext.ch
* Updated.
This commit is contained in:
@@ -17,6 +17,32 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2010-02-25 20:52 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/gtwvg/gtwvg.c
|
||||
* contrib/gtwvg/gtwvg.h
|
||||
* Synced color RGB values with GTWVT.
|
||||
|
||||
* contrib/hbgd/hbgd.hbc
|
||||
! Fixed to reference hbct lib. hbgd requires it for
|
||||
some math functions.
|
||||
|
||||
* contrib/hbxpp/Makefile
|
||||
* contrib/hbxpp/hbxpp.ch
|
||||
+ contrib/hbxpp/xppopc.c
|
||||
+ contrib/hbxpp/xppop.prg
|
||||
+ contrib/hbxpp/tests/opover.prg
|
||||
+ Added support for 'string[ n ]' syntax.
|
||||
Note, you have to #include "hbxpp.ch" to activate it.
|
||||
(of course you can pick the logic and copy it to app
|
||||
code, it's only two lines)
|
||||
(copied and adapted from existing xhb lib implementation)
|
||||
|
||||
* contrib/xhb/xhbmsgs.c
|
||||
! Fixed HB_LONG -> HB_ISIZ
|
||||
|
||||
* contrib/hbxpp/hbxppext.ch
|
||||
* Updated.
|
||||
|
||||
2010-02-25 10:08 UTC-0800 Pritpal Bedi (pritpal@vouchcac.com)
|
||||
* contrib/hbqt/gtqtc/gtqtc.cpp
|
||||
* contrib/hbqt/gtqtc/gtqtc.h
|
||||
@@ -37,14 +63,14 @@
|
||||
* contrib/hbide/idesaveload.prg
|
||||
* contrib/hbide/idethemes.prg
|
||||
|
||||
+ Splash screen popping up at the startup before main
|
||||
+ Splash screen popping up at the startup before main
|
||||
window is displayed. Your comments are welcome.
|
||||
|
||||
! Enabled menu options which were accidentally got disabled some
|
||||
time back, do not remember - why.
|
||||
|
||||
! Themes: centralized "Set as Default" option in "Images" dialog.
|
||||
Removed from <Setup> menu option.
|
||||
Removed from <Setup> menu option.
|
||||
|
||||
! Some more rationalizations.
|
||||
|
||||
@@ -64,7 +90,7 @@
|
||||
|
||||
2010-02-25 13:41 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* include/hbdefs.h
|
||||
+ Added HB_FUNC_TRANSLATE() macro to replace this logic:
|
||||
+ Added HB_FUNC_TRANSLATE( func_name, original_func_name ) macro to replace this logic:
|
||||
'HB_FUNC_EXTERN( original_func_name ); HB_FUNC( func_name ) { HB_FUNC_EXEC( original_func_name ); }'
|
||||
|
||||
* contrib/hbxpp/pvalue.c
|
||||
|
||||
@@ -347,15 +347,15 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow )
|
||||
pWVT->COLORS[ 4] = RED;
|
||||
pWVT->COLORS[ 5] = MAGENTA;
|
||||
pWVT->COLORS[ 6] = BROWN;
|
||||
pWVT->COLORS[ 7] = WHITE;
|
||||
pWVT->COLORS[ 8] = LIGHT_GRAY;
|
||||
pWVT->COLORS[ 7] = LIGHT_GRAY;
|
||||
pWVT->COLORS[ 8] = GRAY;
|
||||
pWVT->COLORS[ 9] = BRIGHT_BLUE;
|
||||
pWVT->COLORS[10] = BRIGHT_GREEN;
|
||||
pWVT->COLORS[11] = BRIGHT_CYAN;
|
||||
pWVT->COLORS[12] = BRIGHT_RED;
|
||||
pWVT->COLORS[13] = BRIGHT_MAGENTA;
|
||||
pWVT->COLORS[14] = YELLOW;
|
||||
pWVT->COLORS[15] = BRIGHT_WHITE;
|
||||
pWVT->COLORS[15] = WHITE;
|
||||
|
||||
/* THESE are the default font parameters, if not changed by user */
|
||||
pWVT->PTEXTSIZE.x = WVT_DEFAULT_FONT_WIDTH;
|
||||
@@ -3402,9 +3402,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
|
||||
{
|
||||
int i;
|
||||
if( !pInfo->pResult )
|
||||
{
|
||||
pInfo->pResult = hb_itemNew( NULL );
|
||||
}
|
||||
hb_arrayNew( pInfo->pResult, 16 );
|
||||
for( i = 1; i <= 16; i++ )
|
||||
hb_arraySetNL( pInfo->pResult, i, pWVT->COLORS[ i - 1 ] );
|
||||
|
||||
@@ -126,22 +126,22 @@ HB_EXTERN_BEGIN
|
||||
#endif
|
||||
#define WVT_DEFAULT_FONT_NAME "Courier New"
|
||||
|
||||
#define BLACK RGB( 0x0 ,0x0 ,0x0 )
|
||||
#define BLUE RGB( 0x0 ,0x0 ,0x85 )
|
||||
#define GREEN RGB( 0x0 ,0x85,0x0 )
|
||||
#define CYAN RGB( 0x0 ,0x85,0x85 )
|
||||
#define RED RGB( 0x85,0x0 ,0x0 )
|
||||
#define MAGENTA RGB( 0x85,0x0 ,0x85 )
|
||||
#define BROWN RGB( 0x85,0x85,0x0 )
|
||||
#define WHITE RGB( 0xC6,0xC6,0xC6 )
|
||||
#define LIGHT_GRAY RGB( 0x60,0x60,0x60 )
|
||||
#define BRIGHT_BLUE RGB( 0x00,0x00,0xFF )
|
||||
#define BRIGHT_GREEN RGB( 0x60,0xFF,0x60 )
|
||||
#define BRIGHT_CYAN RGB( 0x60,0xFF,0xFF )
|
||||
#define BRIGHT_RED RGB( 0xF8,0x00,0x26 )
|
||||
#define BRIGHT_MAGENTA RGB( 0xFF,0x60,0xFF )
|
||||
#define YELLOW RGB( 0xFF,0xFF,0x00 )
|
||||
#define BRIGHT_WHITE RGB( 0xFF,0xFF,0xFF )
|
||||
#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 )
|
||||
|
||||
|
||||
@@ -9,4 +9,6 @@ libs=hbgd
|
||||
{linux}libs=gdlib png jpeg freetype m
|
||||
{darwin}libs=gd
|
||||
|
||||
libs=../hbct/hbct.hbc
|
||||
|
||||
-L/opt/local/lib{darwin}
|
||||
|
||||
@@ -18,6 +18,7 @@ C_SOURCES := \
|
||||
oemansix.c \
|
||||
philesx.c \
|
||||
pvalue.c \
|
||||
xppopc.c \
|
||||
|
||||
PRG_SOURCES := \
|
||||
browdbx.prg \
|
||||
@@ -35,6 +36,7 @@ PRG_SOURCES := \
|
||||
thfuncx.prg \
|
||||
tthreadx.prg \
|
||||
typefilx.prg \
|
||||
xppop.prg \
|
||||
|
||||
PRG_HEADERS := \
|
||||
dll.ch \
|
||||
|
||||
@@ -63,6 +63,11 @@
|
||||
|
||||
#include "hbclass.ch"
|
||||
|
||||
#if ! defined( XPP_OP_OVERLOAD_OFF )
|
||||
#pragma -ks+
|
||||
REQUEST XPP_OP_OVERLOAD
|
||||
#endif
|
||||
|
||||
#xtranslate IsPrinter([<x>]) => hb_IsPrinter(<x>)
|
||||
#xtranslate DispOutAt(<x,...>) => hb_DispOutAt(<x>)
|
||||
#xtranslate AAdd(<a>,<v>,<p>) => hb_AIns(<a>,<v>,<p>,.T.)
|
||||
|
||||
@@ -56,7 +56,8 @@
|
||||
EXTERNAL XPP_GET
|
||||
EXTERNAL XPP_TBROWSE
|
||||
EXTERNAL XPP_TBCOLUMN
|
||||
EXTERNAL XPP_SLEEP
|
||||
EXTERNAL RUNSHELL
|
||||
EXTERNAL SLEEP
|
||||
EXTERNAL BIN2U
|
||||
EXTERNAL BIN2F
|
||||
EXTERNAL F2BIN
|
||||
|
||||
10
harbour/contrib/hbxpp/tests/opover.prg
Normal file
10
harbour/contrib/hbxpp/tests/opover.prg
Normal file
@@ -0,0 +1,10 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
#include "hbxpp.ch"
|
||||
|
||||
PROCEDURE Main()
|
||||
LOCAL cString := "ABC"
|
||||
? cString[ 2 ] // ------> 'B'
|
||||
RETURN
|
||||
73
harbour/contrib/hbxpp/xppop.prg
Normal file
73
harbour/contrib/hbxpp/xppop.prg
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Xbase++ operator emulation
|
||||
*
|
||||
* Copyright 2010 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "common.ch"
|
||||
#include "hbclass.ch"
|
||||
|
||||
ANNOUNCE XPP_OP_OVERLOAD
|
||||
|
||||
/* It's a hack which directly manipulates class definition.
|
||||
* It should not be used in user code. [druzus]
|
||||
*/
|
||||
#xcommand OPTIONAL INHERIT <!className!> => ;
|
||||
IF Type( <"className">+"()" ) == "UI" ;;
|
||||
AAdd( oClass:asSuper, @__<className>() ) ;;
|
||||
ENDIF
|
||||
|
||||
INIT PROCEDURE xpp_Init()
|
||||
ASSOCIATE CLASS xpp_op_Character WITH TYPE Character
|
||||
RETURN
|
||||
|
||||
CREATE CLASS Character FUNCTION xpp_op_Character
|
||||
OPTIONAL INHERIT HBCharacter
|
||||
OPERATOR "[]" FUNCTION XHB_INDEX()
|
||||
ENDCLASS
|
||||
136
harbour/contrib/hbxpp/xppopc.c
Normal file
136
harbour/contrib/hbxpp/xppopc.c
Normal file
@@ -0,0 +1,136 @@
|
||||
/*
|
||||
* $Id$
|
||||
*/
|
||||
|
||||
/*
|
||||
* Harbour Project source code:
|
||||
* Xbase++ compatible messages used in overloaded scalar classes
|
||||
*
|
||||
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
|
||||
* www - http://www.harbour-project.org
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2, or (at your option)
|
||||
* any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this software; see the file COPYING. If not, write to
|
||||
* the Free Software Foundation, Inc., 59 Temple Place, Suite 330,
|
||||
* Boston, MA 02111-1307 USA (or visit the web site http://www.gnu.org/).
|
||||
*
|
||||
* As a special exception, the Harbour Project gives permission for
|
||||
* additional uses of the text contained in its release of Harbour.
|
||||
*
|
||||
* The exception is that, if you link the Harbour libraries with other
|
||||
* files to produce an executable, this does not by itself cause the
|
||||
* resulting executable to be covered by the GNU General Public License.
|
||||
* Your use of that executable is in no way restricted on account of
|
||||
* linking the Harbour library code into it.
|
||||
*
|
||||
* This exception does not however invalidate any other reasons why
|
||||
* the executable file might be covered by the GNU General Public License.
|
||||
*
|
||||
* This exception applies only to the code released by the Harbour
|
||||
* Project under the name Harbour. If you copy code from other
|
||||
* Harbour Project or Free Software Foundation releases into a copy of
|
||||
* Harbour, as the General Public License permits, the exception does
|
||||
* not apply to the code that you add in this way. To avoid misleading
|
||||
* anyone as to the status of such modified files, you must delete
|
||||
* this exception notice from them.
|
||||
*
|
||||
* If you write modifications of your own for Harbour, it is your choice
|
||||
* whether to permit this exception to apply to your modifications.
|
||||
* If you do not wish that, delete this exception notice.
|
||||
*
|
||||
*/
|
||||
|
||||
#include "hbapiitm.h"
|
||||
#include "hbapierr.h"
|
||||
#include "hbapilng.h"
|
||||
#include "hbstack.h"
|
||||
|
||||
HB_FUNC( XHB_INDEX )
|
||||
{
|
||||
PHB_ITEM pSelf = hb_stackSelfItem();
|
||||
PHB_ITEM pIndex = hb_param( 1, HB_IT_ANY );
|
||||
|
||||
if( hb_pcount() == 2 )
|
||||
{ /* ASSIGN */
|
||||
PHB_ITEM pValue = hb_param( 2, HB_IT_ANY );
|
||||
if( HB_IS_NUMERIC( pIndex ) )
|
||||
{
|
||||
HB_SIZE ulIndex = hb_itemGetNL( pIndex );
|
||||
if( HB_IS_ARRAY( pSelf ) )
|
||||
{
|
||||
HB_SIZE ulLen = hb_arrayLen( pSelf );
|
||||
if( HB_IS_VALID_INDEX( ulIndex, ulLen ) )
|
||||
hb_itemMoveRef( hb_arrayGetItemPtr( pSelf, ulIndex ), pValue );
|
||||
else
|
||||
hb_errRT_BASE( EG_BOUND, 1133, NULL, hb_langDGetErrorDesc( EG_ARRASSIGN ), 1, pIndex );
|
||||
}
|
||||
else if( HB_IS_STRING( pSelf ) )
|
||||
{
|
||||
HB_SIZE ulLen = hb_itemGetCLen( pSelf );
|
||||
if( HB_IS_VALID_INDEX( ulIndex, ulLen ) )
|
||||
{
|
||||
char cValue = HB_IS_STRING( pValue ) ? hb_itemGetCPtr( pValue )[ 0 ] :
|
||||
( char ) hb_itemGetNI( pValue );
|
||||
if( ulLen == 1 )
|
||||
hb_itemPutCL( pSelf, &cValue, 1 );
|
||||
else
|
||||
{
|
||||
char * pszText;
|
||||
if( hb_itemGetWriteCL( pSelf, &pszText, &ulLen ) &&
|
||||
ulIndex < ulLen )
|
||||
pszText[ ulIndex - 1 ] = cValue;
|
||||
}
|
||||
}
|
||||
else
|
||||
hb_errRT_BASE( EG_BOUND, 1133, NULL, hb_langDGetErrorDesc( EG_ARRASSIGN ), 1, pIndex );
|
||||
}
|
||||
else
|
||||
hb_errRT_BASE( EG_ARG, 1069, NULL, hb_langDGetErrorDesc( EG_ARRASSIGN ), 1, pIndex );
|
||||
}
|
||||
else
|
||||
hb_errRT_BASE( EG_ARG, 1069, NULL, hb_langDGetErrorDesc( EG_ARRASSIGN ), 1, pIndex );
|
||||
|
||||
hb_itemReturn( pSelf );
|
||||
}
|
||||
else
|
||||
{ /* ACCESS */
|
||||
if( HB_IS_NUMERIC( pIndex ) )
|
||||
{
|
||||
HB_SIZE ulIndex = hb_itemGetNL( pIndex );
|
||||
if( HB_IS_ARRAY( pSelf ) )
|
||||
{
|
||||
HB_SIZE ulLen = hb_arrayLen( pSelf );
|
||||
if( HB_IS_VALID_INDEX( ulIndex, ulLen ) )
|
||||
hb_itemReturn( hb_arrayGetItemPtr( pSelf, ulIndex ) );
|
||||
else
|
||||
hb_errRT_BASE( EG_BOUND, 1132, NULL, hb_langDGetErrorDesc( EG_ARRACCESS ), 2, pSelf, pIndex );
|
||||
}
|
||||
else if( HB_IS_STRING( pSelf ) )
|
||||
{
|
||||
HB_SIZE ulLen = hb_itemGetCLen( pSelf );
|
||||
if( HB_IS_VALID_INDEX( ulIndex, ulLen ) )
|
||||
hb_retclen( hb_itemGetCPtr( pSelf ) + ulIndex - 1, 1 );
|
||||
else
|
||||
hb_errRT_BASE( EG_BOUND, 1132, NULL, hb_langDGetErrorDesc( EG_ARRACCESS ), 2, pSelf, pIndex );
|
||||
}
|
||||
else
|
||||
hb_errRT_BASE( EG_ARG, 1068, NULL, hb_langDGetErrorDesc( EG_ARRACCESS ), 2, pSelf, pIndex );
|
||||
}
|
||||
else
|
||||
{
|
||||
PHB_ITEM pResult = hb_errRT_BASE_Subst( EG_ARG, 1068, NULL, hb_langDGetErrorDesc( EG_ARRACCESS ), 2, pSelf, pIndex );
|
||||
if( pResult )
|
||||
hb_itemReturnRelease( pResult );
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -297,7 +297,7 @@ HB_FUNC( XHB_GREATEREQ )
|
||||
* data from tail
|
||||
*/
|
||||
#undef HB_IS_VALID_INDEX
|
||||
#define HB_IS_VALID_INDEX( idx, max ) ( ( ( HB_LONG ) (idx) < 0 ? (idx) += (max) + 1 : (idx) ) > 0 && ( HB_SIZE ) (idx) <= (max) )
|
||||
#define HB_IS_VALID_INDEX( idx, max ) ( ( ( HB_ISIZ ) (idx) < 0 ? (idx) += (max) + 1 : (idx) ) > 0 && ( HB_SIZE ) (idx) <= (max) )
|
||||
|
||||
HB_FUNC( XHB_INDEX )
|
||||
{
|
||||
@@ -314,9 +314,7 @@ HB_FUNC( XHB_INDEX )
|
||||
{
|
||||
HB_SIZE ulLen = hb_arrayLen( pSelf );
|
||||
if( HB_IS_VALID_INDEX( ulIndex, ulLen ) )
|
||||
{
|
||||
hb_itemMoveRef( hb_arrayGetItemPtr( pSelf, ulIndex ), pValue );
|
||||
}
|
||||
else
|
||||
hb_errRT_BASE( EG_BOUND, 1133, NULL, hb_langDGetErrorDesc( EG_ARRASSIGN ), 1, pIndex );
|
||||
}
|
||||
@@ -344,9 +342,8 @@ HB_FUNC( XHB_INDEX )
|
||||
hb_errRT_BASE( EG_ARG, 1069, NULL, hb_langDGetErrorDesc( EG_ARRASSIGN ), 1, pIndex );
|
||||
}
|
||||
else
|
||||
{
|
||||
hb_errRT_BASE( EG_ARG, 1069, NULL, hb_langDGetErrorDesc( EG_ARRASSIGN ), 1, pIndex );
|
||||
}
|
||||
|
||||
hb_itemReturn( pSelf );
|
||||
}
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user