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:
Viktor Szakats
2017-09-08 16:25:13 +00:00
parent d55bdd18b7
commit 5a2a287752
916 changed files with 10432 additions and 13266 deletions

View File

@@ -10,6 +10,34 @@
* Change, ! Fix, % Optimization, + Addition, - Removal, ; Comment
*/
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.
2017-09-07 08:38 UTC Viktor Szakats (vszakats users.noreply.github.com)
* contrib/hbct/charsprd.c
* contrib/hbct/dattime3.c

View File

@@ -1,5 +1,6 @@
/*
* QT Console
*
* Copyright 2013 Przemyslaw Czerpak <druzus /at/ priv.onet.pl>
* Slightly based on GTQTC
* Copyright 2009-2011 Pritpal Bedi <pritpal@vouchcac.com>
@@ -15,9 +16,9 @@
* 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 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.
@@ -164,11 +165,11 @@
#define HB_BOXCH_SNG_V_DBL_L 0x255E /* BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE (Single Vertical double left junction) */
#define HB_BOXCH_SNG_V_DBL_R 0x2561 /* BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE (Single vertical double right junction) */
#define HB_BOXCH_SNG_DBL_CRS 0x256A /* BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE (Single cross (double horiz) */
#define HB_BOXCH_SNG_DBL_CRS 0x256A /* BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE (Single cross (double horizontal) */
#define HB_BOXCH_DBL_L_SNG_T 0x2553 /* BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE (Double left single top angle) */
#define HB_BOXCH_DBL_T_SNG_D 0x2564 /* BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE (Double top signle junction down) */
#define HB_BOXCH_DBL_T_SNG_D 0x2564 /* BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE (Double top single junction down) */
#define HB_BOXCH_DBL_R_SNG_T 0x2555 /* BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE (Double right single top angle) */
#define HB_BOXCH_DBL_L_SNG_B 0x2559 /* BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE (Double left single bottom angle) */
@@ -177,7 +178,7 @@
#define HB_BOXCH_DBL_V_SNG_R 0x2562 /* BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE (Double Vertical single left junction) */
#define HB_BOXCH_DBL_V_SNG_L 0x255F /* BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE (Double vertical single right junction) */
#define HB_BOXCH_DBL_SNG_CRS 0x256B /* BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE (Double cross (single horiz) */
#define HB_BOXCH_DBL_SNG_CRS 0x256B /* BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE (Double cross (single horizontal) */
#define HB_BOXCH_FULL 0x2588 /* FULL BLOCK */
#define HB_BOXCH_FULL_B 0x2584 /* LOWER HALF BLOCK */
@@ -315,7 +316,7 @@ typedef struct
QBitmap * boxImage[ HB_BOXCH_TRANS_MAX ]; /* bitmaps with box drawing characters */
HB_UCHAR boxIndex[ HB_BOXCH_TRANS_COUNT ]; /* indexes to bitmap array */
int boxCount; /* numebr of defined box characters */
int boxCount; /* number of defined box characters */
QIcon * qIcon; /* application icon */
QString * wndTitle; /* window title */
@@ -323,8 +324,8 @@ typedef struct
HB_BOOL fAltEnter; /* ALT+ENTER switch between fullscreen mode */
HB_BOOL fResizable; /* enable/disable window resizing */
HB_BOOL fResizeInc; /* enable/disable resize progression */
HB_BOOL fMaximized; /* enter/leave mximize mode */
HB_BOOL fMinimized; /* enter/leave mximize ( e.g. as icon in taskbar ) mode */
HB_BOOL fMaximized; /* enter/leave maximize mode */
HB_BOOL fMinimized; /* enter/leave maximize (e.g. as icon in TaskBar) mode */
HB_BOOL fFullScreen; /* enable/disable fullscreen mode */
HB_BOOL fSelectCopy; /* allow marking texts by mouse left button with shift */
HB_BOOL fRepaint; /* force internal image repainting */

View File

@@ -1,5 +1,6 @@
/*
* QT Console
*
* Copyright 2013 Przemyslaw Czerpak <druzus /at/ priv.onet.pl>
* Slightly based on GTQTC
* Copyright 2009-2011 Pritpal Bedi <pritpal@vouchcac.com>
@@ -15,9 +16,9 @@
* 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 http://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.
@@ -75,7 +76,7 @@ static HB_GT_FUNCS SuperTable;
static QApplication * s_qtapp = NULL;
/* *********************************************************************** */
/* --- */
static void hb_gt_qtc_appFree( void * cargo )
{
@@ -115,7 +116,7 @@ static PHB_ITEM hb_gt_qtc_itemPutQString( PHB_ITEM pItem, const QString * pqStr
#endif
}
/* *********************************************************************** */
/* --- */
#define hb_bm_paint_begin( qBitMap ) do { \
QPainter painter( qBitMap ); \
@@ -191,7 +192,7 @@ static QBitmap * hb_gt_qtc_defineBoxChar( PHB_GTQTC pQTC, HB_USHORT usCh )
QBitmap * qBitMap = NULL;
int cellx = pQTC->cellX;
int celly = pQTC->cellY;
int i, y, x, yy, xx, skip, start, mod;
int i, y, x, yy, xx;
QPoint pts[ 3 ];
if( usCh >= HB_BOXCH_RC_MIN && usCh <= HB_BOXCH_RC_MAX )
@@ -700,6 +701,9 @@ static QBitmap * hb_gt_qtc_defineBoxChar( PHB_GTQTC pQTC, HB_USHORT usCh )
case HB_BOXCH_FILLER1:
case HB_BOXCH_FILLER2:
case HB_BOXCH_FILLER3:
{
int skip, start, mod;
qBitMap = hb_gt_qtc_bitmap_char( cellx, celly );
hb_bm_paint_begin( qBitMap );
@@ -728,7 +732,7 @@ static QBitmap * hb_gt_qtc_defineBoxChar( PHB_GTQTC pQTC, HB_USHORT usCh )
hb_bm_invertrect( 0, 0, cellx, celly );
hb_bm_paint_end();
break;
}
case HB_BOXCH_ARROW_R:
qBitMap = hb_gt_qtc_bitmap_char( cellx, celly );
hb_bm_paint_begin( qBitMap );
@@ -1301,7 +1305,7 @@ static void hb_gt_qtc_resetBoxCharBitmaps( PHB_GTQTC pQTC )
pQTC->boxIndex[ i ] = HB_BOXCH_TRANS_MAX;
}
/* *********************************************************************** */
/* --- */
static void hb_gt_qtc_free( PHB_GTQTC pQTC )
{
@@ -1633,7 +1637,7 @@ static void hb_gt_qtc_createConsoleWindow( PHB_GTQTC pQTC )
pQTC->qWnd->update();
}
/* *********************************************************************** */
/* --- */
static void hb_gt_qtc_InitMT( void );
@@ -1681,13 +1685,13 @@ static void hb_gt_qtc_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
HB_GTSELF_SEMICOLD( pGT );
}
/* *********************************************************************** */
/* --- */
static void hb_gt_qtc_Exit( PHB_GT pGT )
{
PHB_GTQTC pQTC;
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_Exit(%p)", pGT ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_Exit(%p)", ( void * ) pGT ) );
pQTC = HB_GTQTC_GET( pGT );
HB_GTSUPER_EXIT( pGT );
@@ -1696,13 +1700,13 @@ static void hb_gt_qtc_Exit( PHB_GT pGT )
hb_gt_qtc_free( pQTC );
}
/* *********************************************************************** */
/* --- */
static void hb_gt_qtc_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
{
PHB_GTQTC pQTC;
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_Redraw(%p,%d,%d,%d)", pGT, iRow, iCol, iSize ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_Redraw(%p,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iSize ) );
pQTC = HB_GTQTC_GET( pGT );
if( pQTC )
@@ -1717,13 +1721,13 @@ static void hb_gt_qtc_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
}
}
/* *********************************************************************** */
/* --- */
static void hb_gt_qtc_Refresh( PHB_GT pGT )
{
PHB_GTQTC pQTC;
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_Refresh(%p)", pGT ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_Refresh(%p)", ( void * ) pGT ) );
HB_GTSUPER_REFRESH( pGT );
@@ -1737,14 +1741,14 @@ static void hb_gt_qtc_Refresh( PHB_GT pGT )
}
}
/* *********************************************************************** */
/* --- */
static HB_BOOL hb_gt_qtc_SetMode( PHB_GT pGT, int iRows, int iCols )
{
PHB_GTQTC pQTC;
HB_BOOL fResult, fCenter;
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_SetMode(%p,%d,%d)", pGT, iRows, iCols ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_SetMode(%p,%d,%d)", ( void * ) pGT, iRows, iCols ) );
pQTC = HB_GTQTC_GET( pGT );
fCenter = iRows != pQTC->iRows || iCols != pQTC->iCols;
@@ -1763,11 +1767,11 @@ static HB_BOOL hb_gt_qtc_SetMode( PHB_GT pGT, int iRows, int iCols )
return fResult;
}
/* *********************************************************************** */
/* --- */
static const char * hb_gt_qtc_Version( PHB_GT pGT, int iType )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_Version(%p,%d)", pGT, iType ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_Version(%p,%d)", ( void * ) pGT, iType ) );
HB_SYMBOL_UNUSED( pGT );
@@ -1777,13 +1781,13 @@ static const char * hb_gt_qtc_Version( PHB_GT pGT, int iType )
return "Harbour Terminal: QT GUI console (QTC)";
}
/* *********************************************************************** */
/* --- */
static int hb_gt_qtc_ReadKey( PHB_GT pGT, int iEventMask )
{
PHB_GTQTC pQTC;
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_ReadKey(%p,%d)", pGT, iEventMask ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_ReadKey(%p,%d)", ( void * ) pGT, iEventMask ) );
HB_SYMBOL_UNUSED( iEventMask );
@@ -1805,25 +1809,25 @@ static int hb_gt_qtc_ReadKey( PHB_GT pGT, int iEventMask )
return 0;
}
/* *********************************************************************** */
/* --- */
static void hb_gt_qtc_Tone( PHB_GT pGT, double dFrequency, double dDuration )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_Tone(%p,%lf,%lf)", pGT, dFrequency, dDuration ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_Tone(%p,%lf,%lf)", ( void * ) pGT, dFrequency, dDuration ) );
HB_SYMBOL_UNUSED( pGT );
HB_SYMBOL_UNUSED( dFrequency );
HB_SYMBOL_UNUSED( dDuration );
/* TODO: add support for sth more advanced then simple system beep */
/* TODO: add support for something more advanced then simple system beep */
QApplication::beep();
}
/* *********************************************************************** */
/* --- */
static HB_BOOL hb_gt_qtc_mouse_IsPresent( PHB_GT pGT )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_mouse_IsPresent(%p)", pGT ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_mouse_IsPresent(%p)", ( void * ) pGT ) );
HB_SYMBOL_UNUSED( pGT );
@@ -1834,7 +1838,7 @@ static void hb_gt_qtc_mouse_GetPos( PHB_GT pGT, int * piRow, int * piCol )
{
PHB_GTQTC pQTC;
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_mouse_GetPos(%p,%p,%p)", pGT, piRow, piCol ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_mouse_GetPos(%p,%p,%p)", ( void * ) pGT, piRow, piCol ) );
pQTC = HB_GTQTC_GET( pGT );
*piRow = pQTC->mouseRow;
@@ -1843,7 +1847,7 @@ static void hb_gt_qtc_mouse_GetPos( PHB_GT pGT, int * piRow, int * piCol )
static HB_BOOL hb_gt_qtc_mouse_ButtonState( PHB_GT pGT, int iButton )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_mouse_ButtonState(%p,%i)", pGT, iButton ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_mouse_ButtonState(%p,%i)", ( void * ) pGT, iButton ) );
HB_SYMBOL_UNUSED( pGT );
@@ -1861,21 +1865,21 @@ static HB_BOOL hb_gt_qtc_mouse_ButtonState( PHB_GT pGT, int iButton )
static int hb_gt_qtc_mouse_CountButton( PHB_GT pGT )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_mouse_CountButton(%p)", pGT ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_mouse_CountButton(%p)", ( void * ) pGT ) );
HB_SYMBOL_UNUSED( pGT );
return 3;
}
/* *********************************************************************** */
/* --- */
static HB_BOOL hb_gt_qtc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
{
PHB_GTQTC pQTC;
int iVal;
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_Info(%p,%d,%p)", pGT, iType, pInfo ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_Info(%p,%d,%p)", ( void * ) pGT, iType, ( void * ) pInfo ) );
pQTC = HB_GTQTC_GET( pGT );
@@ -2293,7 +2297,7 @@ static HB_BOOL hb_gt_qtc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
qImg = QImage( qStr );
}
else if( hb_arrayLen( pInfo->pNewVal ) == static_cast< HB_SIZE >
( hb_arrayGetType( pInfo->pNewVal, 4 ) & HB_IT_NUMERIC ? 4 : 3 ) &&
( ( hb_arrayGetType( pInfo->pNewVal, 4 ) & HB_IT_NUMERIC ) ? 4 : 3 ) &&
( hb_arrayGetType( pInfo->pNewVal, 1 ) & ( HB_IT_POINTER | HB_IT_STRING ) ) &&
( hb_arrayGetType( pInfo->pNewVal, 2 ) & HB_IT_NUMERIC ) &&
( hb_arrayGetType( pInfo->pNewVal, 3 ) & HB_IT_NUMERIC ) )
@@ -2408,14 +2412,16 @@ static HB_BOOL hb_gt_qtc_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
static int hb_gt_qtc_gfx_Primitive( PHB_GT pGT, int iType, int iTop, int iLeft, int iBottom, int iRight, int iColor )
{
PHB_GTQTC pQTC;
int iRet = 1, iTmp;
int iRet = 1;
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_gfx_Primitive(%p,%d,%d,%d,%d,%d,%d)", pGT, iType, iTop, iLeft, iBottom, iRight, iColor ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_gt_qtc_gfx_Primitive(%p,%d,%d,%d,%d,%d,%d)", ( void * ) pGT, iType, iTop, iLeft, iBottom, iRight, iColor ) );
pQTC = HB_GTQTC_GET( pGT );
if( pQTC->qWnd )
{
int iTmp;
switch( iType )
{
case HB_GFX_MAKECOLOR:
@@ -2501,11 +2507,11 @@ static int hb_gt_qtc_gfx_Primitive( PHB_GT pGT, int iType, int iTop, int iLeft,
return iRet;
}
/* *********************************************************************** */
/* --- */
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_qtc_Init;
pFuncTable->Exit = hb_gt_qtc_Exit;
@@ -2527,7 +2533,7 @@ static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
return HB_TRUE;
}
/* *********************************************************************** */
/* --- */
static const HB_GT_INIT gtInit = { HB_GT_DRVNAME( HB_GT_NAME ),
hb_gt_FuncInit,
@@ -2551,7 +2557,7 @@ HB_CALL_ON_STARTUP_END( _hb_startup_gt_Init_ )
#pragma data_seg()
#endif
/* *********************************************************************** */
/* --- */
QTConsole::QTConsole( PHB_GTQTC pStructQTC, QWidget *parnt ) : QWidget( parnt )
{
@@ -2572,7 +2578,7 @@ QTConsole::QTConsole( PHB_GTQTC pStructQTC, QWidget *parnt ) : QWidget( parnt )
/* Qt::WA_InputMethodEnabled disables support for
* national characters in few European countries
* (f.e. Polish characters with ALT in MacOSX)
* (f.e. Polish characters with ALT in macOS)
* If some Asian users needs it then we will have
* to enable it optionally [druzus]
*/
@@ -2616,7 +2622,7 @@ void QTConsole::resetWindowSize( void )
void QTConsole::setFontSize( int iFH, int iFW )
{
int iDec = 0, iDir, iHeight, iWidth, iAscent;
int iDec = 0, iHeight, iWidth, iAscent;
bool bStretch = ( pQTC->fontAttribute & HB_GTI_FONTA_NOSTRETCH ) == 0;
bool bMaxSize = ( pQTC->qWnd->windowState() &
( Qt::WindowMaximized | Qt::WindowFullScreen ) ) != 0;
@@ -2644,6 +2650,8 @@ void QTConsole::setFontSize( int iFH, int iFW )
if( iWidth != iFW )
{
int iDir;
iDec = ( iFW * 100 ) / iWidth;
if( iDec < 1 )
iDec = 1;
@@ -2818,7 +2826,7 @@ void QTConsole::copySelection( void )
void QTConsole::repaintChars( const QRect & rx )
{
int iCol, iRow, iStartCol, iLen, iColor, iTextColor = 0;
int iRow, iColor, iTextColor = 0;
HB_BYTE bAttr;
HB_USHORT usChar;
bool bClrBkg = ( pQTC->fontAttribute & HB_GTI_FONTA_CLRBKG ) != 0;
@@ -2834,6 +2842,8 @@ void QTConsole::repaintChars( const QRect & rx )
for( iRow = rc.top(); iRow <= rc.bottom(); ++iRow )
{
int iCol, iStartCol, iLen;
iCol = iStartCol = rc.left();
iLen = 0;
@@ -2943,7 +2953,7 @@ void QTConsole::paintEvent( QPaintEvent * evt )
if( rSel.intersects( rEvt ) )
{
#if defined( HB_OS_DARWIN )
/* RasterOp operations are not supported in MacOSX */
/* RasterOp operations are not supported in macOS */
rEvt &= rSel;
image->invertPixels();
painter.drawImage( rEvt, *image, rEvt.translated( -pQTC->marginLeft, -pQTC->marginTop ) );
@@ -2963,7 +2973,7 @@ void QTConsole::paintEvent( QPaintEvent * evt )
if( rEvt.intersects( rCrs ) )
{
#if defined( HB_OS_DARWIN )
/* RasterOp operations are not supported in MacOSX,
/* RasterOp operations are not supported in macOS,
* use foreground cell color like hardware VGA cursor
*/
HB_BYTE bAttr;
@@ -3202,7 +3212,7 @@ void QTConsole::keyReleaseEvent( QKeyEvent * evt )
void QTConsole::keyPressEvent( QKeyEvent * evt )
{
int iKey = 0, iFlags = hb_gt_qtc_getKeyFlags( evt->modifiers() ),
iSize, i;
iSize;
/* support for national characters */
if( ( iSize = evt->text().size() ) > 0 )
@@ -3212,6 +3222,8 @@ void QTConsole::keyPressEvent( QKeyEvent * evt )
if( iSize > 1 || ( wc >= 32 && wc != 127 ) )
{
int i;
if( ( iFlags & HB_KF_CTRL ) != 0 && ( iFlags & HB_KF_ALT ) != 0 )
/* workaround for AltGR and German keyboard */
iFlags &= ~( HB_KF_CTRL | HB_KF_ALT );
@@ -3550,7 +3562,7 @@ void QTConsole::keyPressEvent( QKeyEvent * evt )
QWidget::keyPressEvent( evt );
}
/* *********************************************************************** */
/* --- */
QTCWindow::QTCWindow( PHB_GTQTC pQTC )
{
@@ -3662,7 +3674,7 @@ void QTCWindow::setResizing( void )
}
}
/* *********************************************************************** */
/* --- */
#ifdef HB_XLIB_NEEDLOCKS
@@ -3683,4 +3695,4 @@ static void hb_gt_qtc_InitMT( void ) { }
#endif
/* *********************************************************************** */
/* --- */

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbp3State Compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbp3State Compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 07Dec2008
*/
#include "hbclass.ch"
@@ -66,7 +60,7 @@
#xtranslate hb_traceLog( [<x,...>] ) =>
#endif
CREATE CLASS Wvg3State INHERIT WvgWindow, WvgDataRef
CREATE CLASS Wvg3State INHERIT WvgWindow, WvgDataRef
VAR autosize INIT .F.
VAR caption INIT ""

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ Compatible xbpActiveXControl Class
*
* Copyright 2008 Andy Wos
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
@@ -45,14 +45,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ Compatible xbpActiveXControl Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 08Nov2008
*/
#include "hbclass.ch"
@@ -67,7 +61,7 @@
#xtranslate hb_traceLog( [<x,...>] ) =>
#endif
CREATE CLASS WvgActiveXControl FROM WvgWindow
CREATE CLASS WvgActiveXControl INHERIT WvgWindow
VAR oOLE
VAR CLSID INIT ""
@@ -107,7 +101,7 @@ CREATE CLASS WvgActiveXControl FROM WvgWindow
METHOD mouseMove()
METHOD activate()
ERROR HANDLER OnError
ERROR HANDLER OnError()
ENDCLASS

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpBitmap compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpBitmap compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 06Dec2008
*/
#include "hbclass.ch"
@@ -64,12 +58,12 @@
CREATE CLASS WvgBitmap
VAR bits INIT 0 READONLY
VAR bufferOffset INIT 0 READONLY
VAR planes INIT 0 READONLY
VAR bits INIT 0 READONLY
VAR bufferOffset INIT 0 READONLY
VAR planes INIT 0 READONLY
VAR transparentClr INIT 0
VAR xSize INIT 0 READONLY
VAR ySize INIT 0 READONLY
VAR xSize INIT 0 READONLY
VAR ySize INIT 0 READONLY
VAR hBitmap
VAR hDCcompat
@@ -94,11 +88,10 @@ CREATE CLASS WvgBitmap
ENDCLASS
METHOD new() CLASS WvgBitmap
METHOD WvgBitmap:new()
RETURN Self
METHOD create( oPScompat ) CLASS WvgBitmap
METHOD WvgBitmap:create( oPScompat )
IF oPScompat == NIL
::hDCComp := Wvg_GetDC()
@@ -109,7 +102,7 @@ METHOD create( oPScompat ) CLASS WvgBitmap
RETURN Self
METHOD destroy() CLASS WvgBitmap
METHOD WvgBitmap:destroy()
IF ::hBitmap != nil
Wvg_DeleteObject( ::hBitmap )

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpPushButton Compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpPushButton Compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 05Dec2008
*/
#include "hbclass.ch"
@@ -62,7 +56,7 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
CREATE CLASS WvgCheckBox INHERIT WvgWindow, WvgDataRef
CREATE CLASS WvgCheckBox INHERIT WvgWindow, WvgDataRef
VAR autosize INIT .F.
VAR caption INIT ""

View File

@@ -1,28 +1,26 @@
/*
* Wvt*Classes
*
* GUI Components
* Copyright 2007-2012 Pritpal Bedi <bedipritpal@hotmail.com>
* Based On:
*
* Video subsystem for Windows using GUI windows instead of Console
* Copyright 2003 Peter Rees <peter@rees.co.nz>
* Rees Software and Systems Ltd
*
*
* 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.
@@ -40,7 +38,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.
*
@@ -50,12 +48,6 @@
*
*/
/*
* Wvt*Classes
* 2004
* Pritpal Bedi <bedipritpal@hotmail.com>
*/
#include "hbclass.ch"
#include "inkey.ch"
#include "setcurs.ch"
@@ -105,7 +97,7 @@ CREATE CLASS WvtDialog
VAR oldMenuBlock
VAR lGui
/* Dialog Parameters */
/* Dialog parameters */
VAR nRows
VAR nCols
VAR cFont
@@ -116,7 +108,7 @@ CREATE CLASS WvtDialog
VAR cTitle
VAR cColor
/* Objects handelling */
/* Objects handling */
VAR aObjects INIT {}
VAR oCurObj
VAR oLastObj

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpTreeView compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpTreeView compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 26Nov2008
*/
#include "hbclass.ch"
@@ -62,11 +56,11 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
CREATE CLASS WvgComboBox INHERIT WvgWindow, WvgDataRef
CREATE CLASS WvgComboBox INHERIT WvgWindow, WvgDataRef
VAR type INIT WVGCOMBO_DROPDOWN
VAR drawMode INIT WVG_DRAW_NORMAL
VAR nCurSelected INIT 0
VAR type INIT WVGCOMBO_DROPDOWN
VAR drawMode INIT WVG_DRAW_NORMAL
VAR nCurSelected INIT 0
VAR aInfo INIT NIL

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ Compatible xbpCrt Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,13 +44,9 @@
*
*/
// EkOnkar
// ( The LORD is ONE )
//
// Xbase++ Compatible xbpCrt Class
//
// Pritpal Bedi <bedipritpal@hotmail.com>
// 08Nov2008
/* EkOnkar
* ( The LORD is ONE )
*/
#include "hbclass.ch"
#include "inkey.ch"
@@ -60,7 +56,7 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
CREATE CLASS WvgCrt INHERIT WvgWindow, WvgPartHandler
CREATE CLASS WvgCrt INHERIT WvgWindow, WvgPartHandler
VAR oMenu

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ dataRef Compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ dataRef Compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 06Dec2008
*/
#include "hbclass.ch"

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ Compatible xbpDialog Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ Compatible xbpDialog Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 17Nov2008
*/
#include "hbclass.ch"
@@ -62,7 +56,7 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
CREATE CLASS WvgDialog FROM WvgWindow
CREATE CLASS WvgDialog INHERIT WvgWindow
VAR oMenu
VAR aRect

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ WvgDialog's Helper Class
*
* Copyright 2009-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ WvgDialog's Helper Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 15Feb2009
*/
#include "hbclass.ch"
@@ -62,7 +56,7 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
CREATE CLASS WvgDrawingArea INHERIT WvgWindow
CREATE CLASS WvgDrawingArea INHERIT WvgWindow
VAR caption INIT ""
VAR clipParent INIT .T.

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ Parts Compatible functions
*
* Copyright 2011 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,10 @@
*
*/
// EkOnkar
// ( The LORD is ONE )
//
// Xbase++ Parts Compatible functions
//
// Pritpal Bedi <bedipritpal@hotmail.com>
// 03Dec2011
//
/* EkOnkar
* ( The LORD is ONE )
*/
#include "hbclass.ch"
#include "inkey.ch"
#include "hbgtinfo.ch"

View File

@@ -1,7 +1,7 @@
/*
* Header File for Video subsystem for Windows using GUI windows instead of Console
* Copyright 2003 Peter Rees <peter@rees.co.nz>
* Rees Software & Systems Ltd
*
* Copyright 2003 Peter Rees <peter@rees.co.nz> Rees Software & Systems Ltd
*
* 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,8 +44,8 @@
*
*/
#ifndef HB_WVT_H_
#define HB_WVT_H_
#ifndef HB_WGU_H_
#define HB_WGU_H_
#define HB_GT_NAME WGU
@@ -303,34 +303,34 @@ typedef struct
HB_BOOL bResizable;
HB_BOOL bClosable;
/* To Be Split in 2 Structures <1 GUI dynamic> <2 GUI fixed> */
/* To Be Split in 2 Structures <1 GUI dynamic> <2 GUI fixed> */
int rowStart; /* Holds nTop of last WM_PAINT rectangle returned by Wvt_GetPaintRect()*/
int rowStop; /* Holds nBottom of last WM_PAINT rectangle */
int colStart; /* Holds nLeft of last WM_PAINT rectangle */
int colStop; /* Holds nRight of last WM_PAINT rectangle */
int rowStart; /* Holds nTop of last WM_PAINT rectangle returned by wvt_GetPaintRect() */
int rowStop; /* Holds nBottom of last WM_PAINT rectangle */
int colStart; /* Holds nLeft of last WM_PAINT rectangle */
int colStop; /* Holds nRight of last WM_PAINT rectangle */
int iFactor; /* Transparency factor 0~255 */
int iFactor; /* Transparency factor 0~255 */
int LastMenuEvent; /* Last menu item selected */
int MenuKeyEvent; /* User definable event number for windows menu command */
HB_BOOL InvalidateWindow; /* Flag for controlling whether to use ScrollWindowEx() */
HB_BOOL EnableShortCuts; /* Determines whether ALT key enables menu or system menu */
int LastMenuEvent; /* Last menu item selected */
int MenuKeyEvent; /* User definable event number for windows menu command */
HB_BOOL InvalidateWindow; /* Flag for controlling whether to use ScrollWindowEx() */
HB_BOOL EnableShortCuts; /* Determines whether ALT key enables menu or system menu */
HB_BOOL bPaint;
HB_BOOL bGetFocus;
HB_BOOL bSetFocus;
HB_BOOL bKillFocus;
HINSTANCE hMSImg32; /* Handle to the loaded library msimg32.dll */
wvtGradientFill pfnGF; /* Pointer to Address of the GradientFill function in MSImg32.dll*/
HINSTANCE hUser32; /* Handle to the loaded library user32.dll */
wvtSetLayeredWindowAttributes pfnLayered;/* Pointer to set Windows attribute - transparency. */
HINSTANCE hMSImg32; /* Handle to the loaded library msimg32.dll */
wvtGradientFill pfnGF; /* Pointer to Address of the GradientFill function in MSImg32.dll */
HINSTANCE hUser32; /* Handle to the loaded library user32.dll */
wvtSetLayeredWindowAttributes pfnLayered;/* Pointer to set Windows attribute - transparency. */
PHB_GT_PARAMS pPP; /* Presentation Parameters */
PHB_GT_PARAMS pPP; /* Presentation Parameters */
HB_BOOL bTracking; /* To track if mouse has eneter or left the window area */
HB_BOOL bResizing; /* To know when it is in resizing mode */
HB_BOOL bTracking; /* To track if mouse has entered or left the window area */
HB_BOOL bResizing; /* To know when it is in resizing mode */
int width;
int height;
@@ -423,4 +423,4 @@ extern void wvt_Size2ArrayEx( SIZE * siz, PHB_ITEM aSize );
HB_EXTERN_END
#endif /* HB_WVT_H_ */
#endif /* HB_WGU_H_ */

View File

@@ -12,29 +12,29 @@
*
* 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.
* 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 +52,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 +62,6 @@
*
*/
/*
* Individual authors:
* (C) 2003-2004 Giancarlo Niccolai <gc at niccolai dot ws>
* Standard xplatform GT Info system,
* Graphical object system and event system.
* GTINFO() And GTO_* implementation.
*
* (C) 2004 Mauricio Abre <maurifull@datafull.com>
* Cross-GT, multiplatform Graphics API
*
*/
#include "gtwgu.h"
static int s_GtId;
@@ -92,7 +80,7 @@ static int s_wvtCount = 0;
static const TCHAR s_szClassName[] = TEXT( "Harbour_WVGGUI_Class" );
static const int K_Ctrl[] =
static const int s_K_Ctrl[] =
{
K_CTRL_A, K_CTRL_B, K_CTRL_C, K_CTRL_D, K_CTRL_E, K_CTRL_F, K_CTRL_G,
K_CTRL_H, K_CTRL_I, K_CTRL_J, K_CTRL_K, K_CTRL_L, K_CTRL_M, K_CTRL_N,
@@ -117,7 +105,7 @@ static void hb_gt_wvt_RegisterClass( HINSTANCE hInstance )
wndclass.hInstance = hInstance;
/* wndclass.hIcon = NULL; */
wndclass.hCursor = LoadCursor( NULL, IDC_ARROW );
wndclass.hbrBackground = NULL; /*( HBRUSH ) ( COLOR_BTNFACE + 1 ); */
wndclass.hbrBackground = NULL; /* ( HBRUSH ) ( COLOR_BTNFACE + 1 ); */
/* wndclass.lpszMenuName = NULL; */
wndclass.lpszClassName = s_szClassName;
@@ -264,13 +252,12 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow )
{
PHB_ITEM pItem = hb_itemPutCPtr( NULL, hb_cmdargBaseProgName() );
pWVT->lpWindowTitle = HB_ITEMGETSTR( pItem, &pWVT->hWindowTitle, NULL );
hb_itemRelease( pItem );
}
pWVT->pPP = ( HB_GT_PARAMS * ) hb_xgrab( sizeof( HB_GT_PARAMS ) );
pWVT->pPP->style = WS_THICKFRAME|WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX;
pWVT->pPP->style = WS_THICKFRAME | WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
pWVT->pPP->exStyle = 0;
pWVT->pPP->x = 0;
pWVT->pPP->y = 0;
@@ -332,22 +319,19 @@ static void hb_gt_wvt_FireMenuEvent( PHB_GTWVT pWVT, int iMode, int menuIndex )
hb_gt_wvt_FireEvent( pWVT, HB_GTE_MENU, pEvParams );
}
/*
* functions for handling the input queues for the mouse and keyboard
*/
/* functions for handling the input queues for the mouse and keyboard */
static void hb_gt_wvt_AddCharToInputQueue( PHB_GTWVT pWVT, int iKey )
{
int iPos = pWVT->keyPointerIn;
if( iKey == K_MOUSEMOVE || iKey == K_NCMOUSEMOVE )
{
/* Clipper strips repeated mouse movemnt - let's do the same */
/* Clipper strips repeated mouse movement - let's do the same */
if( pWVT->keyLast == iKey && pWVT->keyPointerIn != pWVT->keyPointerOut )
return;
}
/*
* When the buffer is full new event overwrite the last one
/* When the buffer is full new event overwrite the last one
* in the buffer - it's Clipper behavior, [druzus]
*/
pWVT->Keys[ iPos ] = pWVT->keyLast = iKey;
@@ -443,7 +427,6 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L
{
POINT xy;
SHORT keyCode = 0;
SHORT keyState;
HB_SYMBOL_UNUSED( wParam );
if( ! pWVT->MouseMove && ( message == WM_MOUSEMOVE || message == WM_NCMOUSEMOVE ) )
@@ -491,9 +474,7 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L
break;
case WM_MOUSEMOVE:
keyState = ( SHORT ) wParam;
switch( keyState )
switch( ( SHORT ) wParam )
{
case MK_LBUTTON:
keyCode = K_MMLEFTDOWN;
@@ -511,7 +492,7 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L
if( ! pWVT->bTracking )
{
TRACKMOUSEEVENT tmi;
tmi.cbSize = sizeof( TRACKMOUSEEVENT );
tmi.cbSize = sizeof( tmi );
tmi.dwFlags = TME_LEAVE | TME_HOVER;
tmi.hwndTrack = pWVT->hWnd;
tmi.dwHoverTime = 1;
@@ -520,8 +501,7 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L
#endif
break;
case WM_MOUSEWHEEL:
keyState = HIWORD( wParam );
keyCode = keyState > 0 ? K_MWFORWARD : K_MWBACKWARD;
keyCode = ( SHORT ) HIWORD( wParam ) > 0 ? K_MWFORWARD : K_MWBACKWARD;
break;
case WM_NCMOUSEMOVE:
@@ -633,7 +613,7 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
{
HB_BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000;
HB_BOOL bShift = GetKeyState( VK_SHIFT ) & 0x8000;
int iScanCode = HIWORD( lParam ) & 0xFF;
int iScanCode = HIWORD( lParam ) & 0xFF;
if( bCtrl && iScanCode == 76 ) /* CTRL_VK_NUMPAD5 */
hb_gt_wvt_AddCharToInputQueue( pWVT, KP_CTRL_5 );
@@ -691,8 +671,8 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
{
if( bCtrl && iScanCode == 28 ) /* K_CTRL_RETURN */
hb_gt_wvt_AddCharToInputQueue( pWVT, K_CTRL_RETURN );
else if( bCtrl && ( c >= 1 && c <= 26 ) ) /* K_CTRL_A - Z */
hb_gt_wvt_AddCharToInputQueue( pWVT, K_Ctrl[ c - 1 ] );
else if( bCtrl && c >= 1 && c <= 26 ) /* K_CTRL_A - K_CTRL_Z */
hb_gt_wvt_AddCharToInputQueue( pWVT, s_K_Ctrl[ c - 1 ] );
else
{
switch( c )
@@ -734,8 +714,8 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
case WM_SYSCHAR:
if( ! pWVT->IgnoreWM_SYSCHAR )
{
int c, iScanCode = HIWORD( lParam ) & 0xFF;
switch( iScanCode )
int c;
switch( HIWORD( lParam ) & 0xFF )
{
case 2:
c = K_ALT_1;
@@ -956,7 +936,7 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara
if( lParam == WM_RBUTTONUP )
{
NOTIFYICONDATA tnid;
tnid.cbSize = sizeof( NOTIFYICONDATA );
tnid.cbSize = sizeof( tnid );
tnid.hWnd = hWnd;
tnid.uID = HB_ID_NOTIFYICON;
tnid.uCallbackMessage = HB_MSG_NOTIFYICON;
@@ -1194,11 +1174,7 @@ static HB_BOOL hb_gt_wvt_CreateConsoleWindow( PHB_GTWVT pWVT )
return HB_TRUE;
}
/* ********************************************************************** */
/*
* GT Specific Functions
*/
/* ********************************************************************** */
/* GT Specific Functions */
static void hb_gt_wvt_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFilenoStdout, HB_FHANDLE hFilenoStderr )
{
@@ -1206,7 +1182,7 @@ static void hb_gt_wvt_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
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 ) )
{
@@ -1231,13 +1207,13 @@ static void hb_gt_wvt_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
#endif
}
/* ********************************************************************** */
/* --- */
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 );
@@ -1246,7 +1222,7 @@ static void hb_gt_wvt_Exit( PHB_GT pGT )
hb_gt_wvt_Free( pWVT );
}
/* ********************************************************************** */
/* --- */
static int hb_gt_wvt_ReadKey( PHB_GT pGT, int iEventMask )
{
@@ -1254,9 +1230,9 @@ 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! */
HB_SYMBOL_UNUSED( iEventMask ); /* we ignore the event mask! */
pWVT = HB_GTWVT_GET( pGT );
@@ -1268,25 +1244,22 @@ static int hb_gt_wvt_ReadKey( PHB_GT pGT, int iEventMask )
return fKey ? c : 0;
}
/* ********************************************************************** */
/* 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 );
hb_gt_winapi_tone( dFrequency, dDuration );
}
/* ********************************************************************** */
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, pInfo ) );
pWVT = HB_GTWVT_GET( pGT );
@@ -1456,7 +1429,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
}
break;
case HB_GTI_ICONFILE:
if( ( hb_itemType( pInfo->pNewVal ) & HB_IT_STRING ) )
if( hb_itemType( pInfo->pNewVal ) & HB_IT_STRING )
{
HICON hIconToFree = pWVT->bIconToFree ? pWVT->hIcon : NULL;
void * hImageName;
@@ -1646,8 +1619,8 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
case HB_GTI_SETPOS_ROWCOL:
if( pWVT->hWnd )
{
int i1 = -1;
int i2 = -1;
int i1;
int i2;
RECT rect = { 0, 0, 0, 0 };
GetWindowRect( pWVT->hWnd, &rect );
@@ -1656,8 +1629,8 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
if( iType == HB_GTI_SETPOS_ROWCOL )
{
hb_arraySetNI( pInfo->pResult, 1, rect.top / pWVT->fontHeight ); /* Will only return approx value */
hb_arraySetNI( pInfo->pResult, 2, rect.left / pWVT->fontWidth ); /* Will only return approx value */
hb_arraySetNI( pInfo->pResult, 1, rect.top / pWVT->fontHeight ); /* Will only return approximate value */
hb_arraySetNI( pInfo->pResult, 2, rect.left / pWVT->fontWidth ); /* Will only return approximate value */
}
else
{
@@ -1666,7 +1639,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
}
if( ( hb_itemType( pInfo->pNewVal ) & HB_IT_NUMERIC ) &&
( hb_itemType( pInfo->pNewVal2 ) & HB_IT_NUMERIC ) )
( hb_itemType( pInfo->pNewVal2 ) & HB_IT_NUMERIC ) )
{
i1 = hb_itemGetNI( pInfo->pNewVal );
i2 = hb_itemGetNI( pInfo->pNewVal2 );
@@ -1842,9 +1815,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
case HB_GTS_WNDSTATE:
if( pWVT->hWnd )
{
int iSpec = hb_itemGetNI( pInfo->pNewVal2 );
switch( iSpec )
switch( hb_itemGetNI( pInfo->pNewVal2 ) )
{
case HB_GTS_WS_SETONTOP:
{
@@ -2013,11 +1984,11 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
return HB_TRUE;
}
/* ********************************************************************** */
/* --- */
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;
@@ -2029,8 +2000,6 @@ static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
return HB_TRUE;
}
/* ********************************************************************** */
/* --- */
#include "hbgtreg.h"
/* ********************************************************************** */

View File

@@ -1,7 +1,7 @@
/*
* Header File for Video subsystem for Windows using GUI windows instead of Console
* Copyright 2003 Peter Rees <peter@rees.co.nz>
* Rees Software & Systems Ltd
*
* Copyright 2003 Peter Rees <peter@rees.co.nz> Rees Software & Systems Ltd
*
* 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,8 +44,8 @@
*
*/
#ifndef HB_WVT_H_
#define HB_WVT_H_
#ifndef HB_WVG_H_
#define HB_WVG_H_
#define HB_GT_NAME WVG
@@ -266,7 +266,7 @@ typedef struct _tag_GOBJS
HPEN hPen;
HBRUSH hBrush;
#if ! defined( HB_OS_WIN_CE )
IPicture * iPicture;
IPicture * pPicture;
#endif
HB_BOOL bDestroyFont;
HB_BOOL bDestroyPen;
@@ -297,24 +297,24 @@ typedef struct
typedef struct
{
HPEN penWhite; /* White pen to draw GDI elements */
HPEN penBlack; /* Black pen to draw GDI elements */
HPEN penWhiteDim; /* White dim pen to draw GDI elements */
HPEN penDarkGray; /* Dark gray pen to draw GDI elements */
HPEN penGray; /* Gray pen equivilant to Clipper White */
HPEN penNull; /* Null pen */
HBRUSH diagonalBrush; /* Handle to diaoganl brush to draw scrollbars */
HBRUSH solidBrush; /* Handle to solid brush */
HBRUSH whiteBrush; /* Wvt specific White colored brush */
HPEN penWhite; /* White pen to draw GDI elements */
HPEN penBlack; /* Black pen to draw GDI elements */
HPEN penWhiteDim; /* White dim pen to draw GDI elements */
HPEN penDarkGray; /* Dark gray pen to draw GDI elements */
HPEN penGray; /* Gray pen equivalent to Clipper White */
HPEN penNull; /* Null pen */
HBRUSH diagonalBrush; /* Handle to diagonal brush to draw scrollbars */
HBRUSH solidBrush; /* Handle to solid brush */
HBRUSH whiteBrush; /* Wvt specific White colored brush */
#if ! defined( HB_OS_WIN_CE )
IPicture *iPicture[ WVT_PICTURES_MAX ]; /* Array to hold the Picture Streams to avoid recurring loading and unloading */
IPicture * pPicture[ 50 ]; /* Array to hold the Picture Streams to avoid recurring loading and unloading */
#endif
HFONT hUserFonts[ WVT_FONTS_MAX ]; /* User defined font handles */
HPEN hUserPens[ WVT_PENS_MAX ]; /* User defined pens */
HINSTANCE hMSImg32; /* Handle to the loaded library msimg32.dll */
wvtGradientFill pfnGF; /* Pointer to Address of the GradientFill function in MSImg32.dll */
HINSTANCE hUser32; /* Handle to the loaded library user32.dll */
wvtSetLayeredWindowAttributes pfnLayered;/* Pointer to set Windows attribute - transparency. */
HFONT hUserFonts[ 50 ]; /* User defined font handles */
HPEN hUserPens[ 50 ]; /* User defined pens */
HINSTANCE hMSImg32; /* Handle to the loaded library msimg32.dll */
wvtGradientFill pfnGF; /* Pointer to Address of the GradientFill function in MSImg32.dll */
HINSTANCE hUser32; /* Handle to the loaded library user32.dll */
wvtSetLayeredWindowAttributes pfnLayered;/* Pointer to set Windows attribute - transparency. */
} HB_GUIDATA, * PHB_GUIDATA;
@@ -332,7 +332,7 @@ typedef struct
COLORREF COLORS[ 16 ]; /* colors */
HB_BOOL CaretExist; /* HB_TRUE if a caret has been created */
HB_BOOL CaretHidden; /* HB_TRUE if a caret has been hiden */
HB_BOOL CaretHidden; /* HB_TRUE if a caret has been hidden */
int CaretSize; /* Height of solid caret */
int CaretWidth; /* Width of solid caret */
@@ -377,7 +377,7 @@ typedef struct
HB_BOOL IgnoreWM_SYSCHAR;
HB_BOOL bMaximized; /* Flag is set when window has been maximized */
HB_BOOL bBeingMarked; /* Flag to control DOS window like copy operation */
HB_BOOL bBeingMarked; /* Flag to control CUI window like copy operation */
HB_BOOL bBeginMarked;
HB_BOOL bResizable;
@@ -397,21 +397,21 @@ typedef struct
RECT sRectNew;
RECT sRectOld;
/* To Be Split in 2 Structures <1 GUI dynamic> <2 GUI fixed> */
/* To Be Split in 2 Structures <1 GUI dynamic> <2 GUI fixed> */
int rowStart; /* Holds nTop of last WM_PAINT rectangle returned by Wvt_GetPaintRect()*/
int rowStop; /* Holds nBottom of last WM_PAINT rectangle */
int colStart; /* Holds nLeft of last WM_PAINT rectangle */
int colStop; /* Holds nRight of last WM_PAINT rectangle */
int rowStart; /* Holds nTop of last WM_PAINT rectangle returned by wvt_GetPaintRect() */
int rowStop; /* Holds nBottom of last WM_PAINT rectangle */
int colStart; /* Holds nLeft of last WM_PAINT rectangle */
int colStop; /* Holds nRight of last WM_PAINT rectangle */
int iFactor; /* Transparency factor 0~255 */
int iFactor; /* Transparency factor 0~255 */
HDC hdc; /* Handle to Windows Device Context */
HDC hdc; /* Handle to Windows Device Context */
int LastMenuEvent; /* Last menu item selected */
int MenuKeyEvent; /* User definable event number for windows menu command */
HB_BOOL InvalidateWindow; /* Flag for controlling whether to use ScrollWindowEx() */
HB_BOOL EnableShortCuts; /* Determines whether ALT key enables menu or system menu */
int LastMenuEvent; /* Last menu item selected */
int MenuKeyEvent; /* User definable event number for windows menu command */
HB_BOOL InvalidateWindow; /* Flag for controlling whether to use ScrollWindowEx() */
HB_BOOL EnableShortCuts; /* Determines whether ALT key enables menu or system menu */
HB_BOOL bGui;
HDC hGuiDC;
@@ -424,51 +424,51 @@ typedef struct
HB_BOOL bSetFocus;
HB_BOOL bKillFocus;
PHB_DYNS pSymWVT_PAINT; /* Stores pointer to WVT_PAINT function */
PHB_DYNS pSymWVT_SETFOCUS; /* Stores pointer to WVT_SETFOCUS function */
PHB_DYNS pSymWVT_KILLFOCUS; /* Stores pointer to WVT_KILLFOCUS function */
PHB_DYNS pSymWVT_MOUSE; /* Stores pointer to WVT_MOUSE function */
PHB_DYNS pSymWVT_TIMER; /* Stores pointer to WVT_TIMER function */
PHB_DYNS pSymWVT_PAINT; /* Stores pointer to WVT_PAINT function */
PHB_DYNS pSymWVT_SETFOCUS; /* Stores pointer to WVT_SETFOCUS function */
PHB_DYNS pSymWVT_KILLFOCUS; /* Stores pointer to WVT_KILLFOCUS function */
PHB_DYNS pSymWVT_MOUSE; /* Stores pointer to WVT_MOUSE function */
PHB_DYNS pSymWVT_TIMER; /* Stores pointer to WVT_TIMER function */
PHB_DYNS pSymWVT_KEY;
HPEN currentPen; /* Handle to current pen settable at runtime */
HBRUSH currentBrush; /* Handle to current brush settable by runtime */
HPEN currentPen; /* Handle to current pen settable at runtime */
HBRUSH currentBrush; /* Handle to current brush settable by runtime */
PHB_GUIDATA pGUI; /* GUI Data Structure */
PHB_GUIDATA pGUI; /* GUI Data Structure */
HMENU hPopup; /* Handle of context menu invokable with right click */
HWND hWndTT; /* Handle to hold tooltip information */
HB_BOOL bToolTipActive; /* Flag to set whether tooltip is active or not */
HMENU hPopup; /* Handle of context menu invokable with right click */
HWND hWndTT; /* Handle to hold tooltip information */
HB_BOOL bToolTipActive; /* Flag to set whether tooltip is active or not */
HWND hDlgModeless[ WVT_DLGML_MAX ]; /* Handle to a modeless dialog */
PHB_ITEM pFunc[ WVT_DLGML_MAX ]; /* Function pointer for WndProc */
HWND hDlgModeless[ WVT_DLGML_MAX ]; /* Handle to a modeless dialog */
PHB_ITEM pFunc[ WVT_DLGML_MAX ]; /* Function pointer for WndProc */
/* TODO: pcbFunc is redundant and should be removed */
PHB_ITEM pcbFunc[ WVT_DLGML_MAX ]; /*codeblock for WndProc */
PHB_ITEM pcbFunc[ WVT_DLGML_MAX ]; /* codeblock for WndProc */
int iType[ WVT_DLGML_MAX ]; /* Type of Function Pointers - Function 1, Block 2, Method 3 */
HWND hDlgModal[ WVT_DLGMD_MAX ]; /* Handle to a modeless dialog */
PHB_ITEM pFuncModal[ WVT_DLGMD_MAX ]; /* Function pointer for WndProc */
HWND hDlgModal[ WVT_DLGMD_MAX ]; /* Handle to a modeless dialog */
PHB_ITEM pFuncModal[ WVT_DLGMD_MAX ]; /* Function pointer for WndProc */
/* TODO: pcbFuncModal is redundant and should be removed */
PHB_ITEM pcbFuncModal[ WVT_DLGMD_MAX ]; /* codeblock for WndProc */
PHB_ITEM pcbFuncModal[ WVT_DLGMD_MAX ]; /* codeblock for WndProc */
int iTypeModal[ WVT_DLGMD_MAX ]; /* Type of Function Pointers - Function 1, Block 2, Method 3 */
PHB_GT_PARAMS pPP; /* Presentation Parameters */
PHB_GT_PARAMS pPP; /* Presentation Parameters */
HB_BOOL bDeferPaint; /* To create pure Windows dialogs */
HB_BOOL bTracking; /* To track if mouse has eneter or left the window area */
HB_BOOL bDeferPaint; /* To create pure Windows dialogs */
HB_BOOL bTracking; /* To track if mouse has entered or left the window area */
HB_BOOL bResizing; /* To know when it is in resizing mode */
HB_BOOL bResizing; /* To know when it is in resizing mode */
HB_BOOL bAlreadySizing;
HB_BOOL bComposited;
int CloseMode;
PHB_GOBJS gObjs; /* Graphic Objects */
PHB_GOBJS gObjs; /* Graphic Objects */
HWND hWndParent; /* Parent Window Handle, if any */
HWND hWndParent; /* Parent Window Handle, if any */
PHB_ITEM pNotifierGUI; /* Notifier to Wvg*Parts if embedded into a GT Window */
PHB_ITEM pNotifierGUI; /* Notifier to Wvg*Parts if embedded into a GT Window */
HB_THREAD_NO threadNO; /* Will hold the current THREAD No */
HB_THREAD_NO threadNO; /* Will hold the current THREAD No */
} HB_GTWVT, * PHB_GTWVT;
@@ -609,4 +609,4 @@ extern void wvt_Size2ArrayEx( SIZE * siz, PHB_ITEM aSize );
HB_EXTERN_END
#endif /* HB_WVT_H_ */
#endif /* HB_WVG_H_ */

View File

@@ -12,29 +12,29 @@
*
* 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.
* 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 +52,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 +62,6 @@
*
*/
/*
* Individual authors:
* (C) 2003-2004 Giancarlo Niccolai <gc at niccolai dot ws>
* Standard xplatform GT Info system,
* Graphical object system and event system.
* GTINFO() And GTO_* implementation.
*
* (C) 2004 Mauricio Abre <maurifull@datafull.com>
* Cross-GT, multiplatform Graphics API
*
*/
#include "hbwinole.h"
#include "gtwvg.h"
@@ -107,15 +95,15 @@ static HB_CRITICAL_NEW( s_wvtMtx );
#if ( ( defined( _MSC_VER ) && ( _MSC_VER <= 1200 || defined( HB_OS_WIN_CE ) ) ) || \
defined( __DMC__ ) ) && ! defined( HB_ARCH_64BIT )
# ifndef GetWindowLongPtr
# define GetWindowLongPtr GetWindowLong
# endif
# ifndef SetWindowLongPtr
# define SetWindowLongPtr SetWindowLong
# endif
# define HB_GTWVT_LONG_PTR LONG
#ifndef GetWindowLongPtr
#define GetWindowLongPtr GetWindowLong
#endif
#ifndef SetWindowLongPtr
#define SetWindowLongPtr SetWindowLong
#endif
#define HB_GTWVT_LONG_PTR LONG
#else
# define HB_GTWVT_LONG_PTR LONG_PTR
#define HB_GTWVT_LONG_PTR LONG_PTR
#endif
#ifndef WS_OVERLAPPEDWINDOW
@@ -280,7 +268,7 @@ static void hb_gt_wvt_Free( PHB_GTWVT pWVT )
pWVT->pSymWVT_MOUSE = NULL;
pWVT->pSymWVT_TIMER = NULL;
pWVT->pSymWVT_KEY = NULL;
for( iIndex = 0; iIndex < WVT_DLGML_MAX; iIndex++ )
for( iIndex = 0; iIndex < ( int ) HB_SIZEOFARRAY( pWVT->pFunc ); iIndex++ )
{
if( pWVT->pFunc[ iIndex ] != NULL && pWVT->iType[ iIndex ] == 2 )
{
@@ -322,9 +310,9 @@ static void hb_gt_wvt_Free( PHB_GTWVT pWVT )
if( pWVT->gObjs->bBlock )
hb_itemRelease( pWVT->gObjs->bBlock );
#if ! defined( HB_OS_WIN_CE )
if( pWVT->gObjs->iPicture )
if( pWVT->gObjs->pPicture )
if( pWVT->gObjs->bDestroyPicture )
HB_VTBL( pWVT->gObjs->iPicture )->Release( HB_THIS( pWVT->gObjs->iPicture ) );
HB_VTBL( pWVT->gObjs->pPicture )->Release( HB_THIS( pWVT->gObjs->pPicture ) );
#endif
hb_xfree( pWVT->gObjs );
pWVT->gObjs = gObj;
@@ -440,7 +428,7 @@ static PHB_GTWVT hb_gt_wvt_New( PHB_GT pGT, HINSTANCE hInstance, int iCmdShow )
pWVT->bComposited = HB_FALSE;
pWVT->pPP = ( HB_GT_PARAMS * ) hb_xgrab( sizeof( HB_GT_PARAMS ) );
pWVT->pPP->style = WS_THICKFRAME|WS_OVERLAPPED|WS_CAPTION|WS_SYSMENU|WS_MINIMIZEBOX|WS_MAXIMIZEBOX;
pWVT->pPP->style = WS_THICKFRAME | WS_OVERLAPPED | WS_CAPTION | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX;
pWVT->pPP->exStyle = 0;
pWVT->pPP->x = 0;
pWVT->pPP->y = 0;
@@ -503,9 +491,7 @@ static void hb_gt_wvt_FireMenuEvent( PHB_GTWVT pWVT, int iMode, int menuIndex )
hb_gt_wvt_FireEvent( pWVT, HB_GTE_MENU, pEvParams );
}
/*
* use the standard fixed oem font, unless the caller has requested set size fonts
*/
/* use the standard fixed OEM font, unless the caller has requested set size fonts */
static HFONT hb_gt_wvt_GetFont( LPCTSTR lpFace, int iHeight, int iWidth, int iWeight, int iQuality, int iCodePage )
{
if( iHeight > 0 )
@@ -640,22 +626,19 @@ static void hb_gt_wvt_KillCaret( PHB_GTWVT pWVT )
}
}
/*
* functions for handling the input queues for the mouse and keyboard
*/
/* functions for handling the input queues for the mouse and keyboard */
static void hb_gt_wvt_AddCharToInputQueue( PHB_GTWVT pWVT, int iKey )
{
int iPos = pWVT->keyPointerIn;
if( iKey == K_MOUSEMOVE || iKey == K_NCMOUSEMOVE )
{
/* Clipper strips repeated mouse movemnt - let's do the same */
/* Clipper strips repeated mouse movement - let's do the same */
if( pWVT->keyLast == iKey && pWVT->keyPointerIn != pWVT->keyPointerOut )
return;
}
/*
* When the buffer is full new event overwrite the last one
/* When the buffer is full new event overwrite the last one
* in the buffer - it's Clipper behavior, [druzus]
*/
pWVT->Keys[ iPos ] = pWVT->keyLast = iKey;
@@ -785,8 +768,8 @@ static HB_BOOL hb_gt_wvt_FitRows( PHB_GTWVT pWVT )
GetWindowRect( pWVT->hWnd, &wi );
borderWidth = ( wi.right - wi.left - ( ci.right - ci.left ) );
borderHeight = ( wi.bottom - wi.top - ( ci.bottom - ci.top ) );
borderWidth = wi.right - wi.left - ( ci.right - ci.left );
borderHeight = wi.bottom - wi.top - ( ci.bottom - ci.top );
if( pWVT->bMaximized )
{
@@ -805,7 +788,7 @@ static HB_BOOL hb_gt_wvt_FitRows( PHB_GTWVT pWVT )
{
HB_BOOL bOldCentre = pWVT->CentreWindow;
pWVT->CentreWindow = pWVT->bMaximized ? HB_TRUE : HB_FALSE;
HB_GTSELF_SETMODE( pWVT->pGT, ( maxHeight / pWVT->PTEXTSIZE.y ), ( maxWidth / pWVT->PTEXTSIZE.x ) );
HB_GTSELF_SETMODE( pWVT->pGT, maxHeight / pWVT->PTEXTSIZE.y, maxWidth / pWVT->PTEXTSIZE.x );
pWVT->CentreWindow = bOldCentre;
return HB_TRUE;
}
@@ -824,16 +807,15 @@ static HB_BOOL hb_gt_wvt_FitSize( PHB_GTWVT pWVT )
int top;
GetClientRect( pWVT->hWnd, &ci );
if( ! pWVT->bMaximized && ( ci.right - ci.left ) == ( pWVT->PTEXTSIZE.x * pWVT->COLS )
&&
( ci.bottom - ci.top ) == ( pWVT->PTEXTSIZE.y * pWVT->ROWS ) )
if( ! pWVT->bMaximized && ( ci.right - ci.left ) == ( pWVT->PTEXTSIZE.x * pWVT->COLS ) &&
( ci.bottom - ci.top ) == ( pWVT->PTEXTSIZE.y * pWVT->ROWS ) )
{
return HB_FALSE;
}
GetWindowRect( pWVT->hWnd, &wi );
borderWidth = ( wi.right - wi.left - ( ci.right - ci.left ) );
borderHeight = ( wi.bottom - wi.top - ( ci.bottom - ci.top ) );
borderWidth = wi.right - wi.left - ( ci.right - ci.left );
borderHeight = wi.bottom - wi.top - ( ci.bottom - ci.top );
if( pWVT->bMaximized )
{
@@ -855,11 +837,9 @@ static HB_BOOL hb_gt_wvt_FitSize( PHB_GTWVT pWVT )
}
{ /* Just a block */
HFONT hOldFont;
HFONT hFont;
int fontHeight;
int fontWidth;
int n;
fontHeight = maxHeight / pWVT->ROWS;
fontWidth = maxWidth / pWVT->COLS;
@@ -867,6 +847,7 @@ static HB_BOOL hb_gt_wvt_FitSize( PHB_GTWVT pWVT )
hFont = hb_gt_wvt_GetFont( pWVT->fontFace, fontHeight, fontWidth, pWVT->fontWeight, pWVT->fontQuality, pWVT->CodePage );
if( hFont )
{
HFONT hOldFont;
HDC hdc;
int width;
int height;
@@ -887,6 +868,8 @@ static HB_BOOL hb_gt_wvt_FitSize( PHB_GTWVT pWVT )
tm.tmAveCharWidth >= 3 &&
tm.tmHeight >= 4 )
{
int n;
#if ! defined( UNICODE )
if( pWVT->hFontBox && pWVT->hFontBox != pWVT->hFont )
DeleteObject( pWVT->hFontBox );
@@ -925,11 +908,11 @@ static HB_BOOL hb_gt_wvt_FitSize( PHB_GTWVT pWVT )
if( pWVT->bMaximized )
{
left = ( ( wi.right - width ) / 2 );
top = ( ( wi.bottom - height ) / 2 );
left = ( wi.right - width ) / 2;
top = ( wi.bottom - height ) / 2;
left = ( left < 0 ? 0 : left );
top = ( top < 0 ? 0 : top );
left = left < 0 ? 0 : left;
top = top < 0 ? 0 : top;
}
if( ! pWVT->bFullScreen )
@@ -1140,8 +1123,8 @@ static HB_BOOL hb_gt_wvt_SetWindowSize( PHB_GTWVT pWVT, int iRow, int iCol )
pWVT->COLS = iCol;
return HB_TRUE;
}
return HB_FALSE;
else
return HB_FALSE;
}
static HB_BOOL hb_gt_wvt_InitWindow( PHB_GTWVT pWVT, int iRow, int iCol )
@@ -1197,9 +1180,9 @@ static RECT hb_gt_wvt_GetColRowFromXYRect( PHB_GTWVT pWVT, RECT xy )
colrow.left = xy.left / pWVT->PTEXTSIZE.x;
colrow.top = xy.top / pWVT->PTEXTSIZE.y;
colrow.right = xy.right / pWVT->PTEXTSIZE.x -
( xy.right % pWVT->PTEXTSIZE.x ? 0 : 1 ); /* Adjust for when rectangle */
( ( xy.right % pWVT->PTEXTSIZE.x ) ? 0 : 1 ); /* Adjust for when rectangle */
colrow.bottom = xy.bottom / pWVT->PTEXTSIZE.y -
( xy.bottom % pWVT->PTEXTSIZE.y ? 0 : 1 ); /* EXACTLY overlaps characters */
( ( xy.bottom % pWVT->PTEXTSIZE.y ) ? 0 : 1 ); /* EXACTLY overlaps characters */
return colrow;
}
@@ -1214,7 +1197,6 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L
{
POINT xy, colrow;
SHORT keyCode = 0;
SHORT keyState;
HB_SYMBOL_UNUSED( wParam );
@@ -1300,7 +1282,7 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L
right = colrowRC.right;
bottom = colrowRC.bottom;
nSize = ( ( bottom - top + 1 ) * ( right - left + 1 + 2 ) );
nSize = ( bottom - top + 1 ) * ( right - left + 1 + 2 );
sBuffer = ( TCHAR * ) hb_xgrab( nSize * sizeof( TCHAR ) + 1 );
for( j = 0, irow = top; irow <= bottom; irow++ )
@@ -1316,7 +1298,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[ j++ ] = ( TCHAR ) usChar;
}
@@ -1412,9 +1394,7 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L
}
else
{
keyState = ( SHORT ) wParam;
switch( keyState )
switch( ( SHORT ) wParam )
{
case MK_LBUTTON:
keyCode = K_MMLEFTDOWN;
@@ -1432,7 +1412,7 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L
{
#if ! defined( HB_OS_WIN_CE )
TRACKMOUSEEVENT tmi;
tmi.cbSize = sizeof( TRACKMOUSEEVENT );
tmi.cbSize = sizeof( tmi );
tmi.dwFlags = TME_LEAVE | TME_HOVER;
tmi.hwndTrack = pWVT->hWnd;
tmi.dwHoverTime = 1;
@@ -1442,8 +1422,7 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L
break;
}
case WM_MOUSEWHEEL:
keyState = HIWORD( wParam );
keyCode = keyState > 0 ? K_MWFORWARD : K_MWBACKWARD;
keyCode = ( SHORT ) HIWORD( wParam ) > 0 ? K_MWFORWARD : K_MWBACKWARD;
break;
case WM_NCMOUSEMOVE:
@@ -1563,7 +1542,7 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
{
HB_BOOL bCtrl = GetKeyState( VK_CONTROL ) & 0x8000;
HB_BOOL bShift = GetKeyState( VK_SHIFT ) & 0x8000;
int iScanCode = HIWORD( lParam ) & 0xFF;
int iScanCode = HIWORD( lParam ) & 0xFF;
if( bCtrl && iScanCode == 76 ) /* CTRL_VK_NUMPAD5 */
hb_gt_wvt_AddCharToInputQueue( pWVT, KP_CTRL_5 );
@@ -1621,7 +1600,7 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
{
if( bCtrl && iScanCode == 28 ) /* K_CTRL_RETURN */
hb_gt_wvt_AddCharToInputQueue( pWVT, K_CTRL_RETURN );
else if( bCtrl && ( c >= 1 && c <= 26 ) ) /* K_CTRL_A - Z */
else if( bCtrl && c >= 1 && c <= 26 ) /* K_CTRL_A - K_CTRL_Z */
hb_gt_wvt_AddCharToInputQueue( pWVT, K_Ctrl[ c - 1 ] );
else
{
@@ -1665,8 +1644,8 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
case WM_SYSCHAR:
if( ! pWVT->IgnoreWM_SYSCHAR )
{
int c, iScanCode = HIWORD( lParam ) & 0xFF;
switch( iScanCode )
int c;
switch( HIWORD( lParam ) & 0xFF )
{
case 2:
c = K_ALT_1;
@@ -1801,7 +1780,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 HB_BOOL hb_gt_wvt_TextOut( PHB_GTWVT pWVT, HDC hdc, int col, int row, int iColor, LPCTSTR lpString, UINT cbString )
@@ -1828,7 +1807,7 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect )
PAINTSTRUCT ps;
HDC hdc;
RECT rcRect;
int iRow, iCol, startCol, len;
int iRow;
int iColor, iOldColor = 0;
HB_BYTE bAttr;
@@ -1895,6 +1874,8 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect )
for( iRow = rcRect.top; iRow <= rcRect.bottom; ++iRow )
{
int iCol, startCol, len;
iCol = startCol = rcRect.left;
len = 0;
@@ -1958,10 +1939,10 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect )
updateRect.right - updateRect.left, updateRect.bottom - updateRect.top,
pWVT->hGuiDC, updateRect.left, updateRect.top, SRCCOPY );
/* Paint Graphic Objects Supporting CUI Elements */
/* Paint Graphic Objects Supporting CUI Elements */
hb_gt_wvt_PaintGObjects( pWVT, &updateRect );
/* Tell PRG code to execute paint objects - Wvt_Draw*() */
/* Tell PRG code to execute paint objects - wvt_Draw*() */
if( pWVT->bPaint )
{
if( pWVT->pSymWVT_PAINT )
@@ -1976,9 +1957,7 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect )
}
}
else
{
pWVT->bPaint = HB_TRUE;
}
EndPaint( pWVT->hWnd, &ps );
}
@@ -2093,7 +2072,7 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara
{
pWVT->bGetFocus = HB_TRUE;
}
{ /* For mixing gui/cui items */
{ /* For mixing GUI/CUI items */
PHB_ITEM pEvParams = hb_itemNew( NULL );
hb_arrayNew( pEvParams, 3 );
@@ -2382,7 +2361,7 @@ static HB_BOOL hb_gt_wvt_IsDialogMessage( PHB_GTWVT pWVT, LPMSG lpMsg ) /* P
{
int iIndex;
for( iIndex = 0; iIndex < WVT_DLGML_MAX; iIndex++ )
for( iIndex = 0; iIndex < ( int ) HB_SIZEOFARRAY( pWVT->hDlgModeless ); iIndex++ )
{
if( pWVT->hDlgModeless[ iIndex ] != 0 )
{
@@ -2446,7 +2425,7 @@ static void hb_gt_wvt_ShowWindow( PHB_GTWVT pWVT )
/*
* If you wish to show window the way you want, put somewhere in your application
* ANNOUNCE HB_NOSTARTUPWINDOW
* If so compiled, then you need to issue Wvt_ShowWindow( SW_RESTORE )
* If so compiled, then you need to issue wvt_ShowWindow( SW_RESTORE )
* at the point you desire in your code.
*/
if( hb_dynsymFind( "HB_NOSTARTUPWINDOW" ) != NULL )
@@ -2511,7 +2490,7 @@ static HWND hb_gt_wvt_CreateWindow( PHB_GTWVT pWVT, HB_BOOL bResizable )
pWVT->fontWeight = pWVTp->fontWeight;
pWVT->fontQuality = pWVTp->fontQuality;
pWVT->CodePage = pWVTp->CodePage;
HB_STRNCPY( pWVT->fontFace, pWVTp->fontFace, sizeof( pWVTp->fontFace ) - 1 );
HB_STRNCPY( pWVT->fontFace, pWVTp->fontFace, HB_SIZEOFARRAY( pWVTp->fontFace ) - 1 );
pWVT->hFont = hb_gt_wvt_GetFont( pWVT->fontFace, pWVT->fontHeight,
pWVT->fontWidth, pWVT->fontWeight, pWVT->fontQuality, pWVT->CodePage );
@@ -2539,8 +2518,8 @@ static HWND hb_gt_wvt_CreateWindow( PHB_GTWVT pWVT, HB_BOOL bResizable )
pWVT->ROWS = pWVT->pPP->width;
pWVT->COLS = pWVT->pPP->height;
pt.x = ( pWVTp->PTEXTSIZE.x * pWVT->pPP->y );
pt.y = ( pWVTp->PTEXTSIZE.y * pWVT->pPP->x );
pt.x = pWVTp->PTEXTSIZE.x * pWVT->pPP->y;
pt.y = pWVTp->PTEXTSIZE.y * pWVT->pPP->x;
}
else
{
@@ -2585,15 +2564,15 @@ static HWND hb_gt_wvt_CreateWindow( PHB_GTWVT pWVT, HB_BOOL bResizable )
}
/* This can happen if the pGTp is alien to this GT */
/* TOFIX: */
/* FIXME: */
if( ! bByConf )
{
POINT pt;
if( pWVT->pPP->bRowCols )
{
pt.x = ( pWVT->PTEXTSIZE.x * pWVT->pPP->y );
pt.y = ( pWVT->PTEXTSIZE.y * pWVT->pPP->x );
pt.x = pWVT->PTEXTSIZE.x * pWVT->pPP->y;
pt.y = pWVT->PTEXTSIZE.y * pWVT->pPP->x;
pWVT->ROWS = pWVT->pPP->width;
pWVT->COLS = pWVT->pPP->height;
@@ -2611,7 +2590,7 @@ static HWND hb_gt_wvt_CreateWindow( PHB_GTWVT pWVT, HB_BOOL bResizable )
}
if( ! bResizable )
pWVT->pPP->style = ( ( pWVT->pPP->style & ~( WS_THICKFRAME | WS_MAXIMIZEBOX ) ) | WS_BORDER );
pWVT->pPP->style = ( pWVT->pPP->style & ~( WS_THICKFRAME | WS_MAXIMIZEBOX ) ) | WS_BORDER;
hWnd = CreateWindowEx(
pWVT->pPP->exStyle, /* extended style */
@@ -2767,11 +2746,7 @@ static HB_BOOL hb_gt_wvt_FullScreen( PHB_GT pGT )
return HB_TRUE;
}
/* ********************************************************************** */
/*
* GT Specific Functions
*/
/* ********************************************************************** */
/* GT Specific Functions */
static void hb_gt_wvt_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFilenoStdout, HB_FHANDLE hFilenoStderr )
{
@@ -2779,7 +2754,7 @@ static void hb_gt_wvt_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
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 ) )
{
@@ -2801,7 +2776,7 @@ static void hb_gt_wvt_Init( PHB_GT pGT, HB_FHANDLE hFilenoStdin, HB_FHANDLE hFil
/* hb_gt_wvt_CreateConsoleWindow( pWVT ); */
}
/* ********************************************************************** */
/* --- */
static void hb_gt_wvt_Exit( PHB_GT pGT )
{
@@ -2831,14 +2806,14 @@ static void hb_gt_wvt_Exit( PHB_GT pGT )
}
}
/* ********************************************************************** */
/* --- */
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 );
@@ -2873,7 +2848,7 @@ static HB_BOOL hb_gt_wvt_SetMode( PHB_GT pGT, int iRow, int iCol )
return fResult;
}
/* ********************************************************************** */
/* --- */
static HB_BOOL hb_gt_wvt_PutChar( PHB_GT pGT, int iRow, int iCol,
int iColor, HB_BYTE bAttr, HB_USHORT usChar )
@@ -2890,14 +2865,15 @@ static HB_BOOL hb_gt_wvt_PutChar( PHB_GT pGT, int iRow, int iCol,
return HB_TRUE;
}
return HB_FALSE;
else
return HB_FALSE;
}
/* ********************************************************************** */
/* --- */
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 );
@@ -2907,7 +2883,7 @@ static const char * hb_gt_wvt_Version( PHB_GT pGT, int iType )
return "Harbour Terminal: Windows GUI console (WVG)";
}
/* ********************************************************************** */
/* --- */
static int hb_gt_wvt_ReadKey( PHB_GT pGT, int iEventMask )
{
@@ -2915,9 +2891,9 @@ 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! */
HB_SYMBOL_UNUSED( iEventMask ); /* we ignore the event mask! */
pWVT = HB_GTWVT_GET( pGT );
@@ -2929,22 +2905,19 @@ static int hb_gt_wvt_ReadKey( PHB_GT pGT, int iEventMask )
return fKey ? c : 0;
}
/* ********************************************************************** */
/* 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 );
hb_gt_winapi_tone( dFrequency, 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 );
@@ -2955,7 +2928,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, piRow, piCol ) );
pWVT = HB_GTWVT_GET( pGT );
*piRow = pWVT->MousePos.y;
@@ -2964,7 +2937,7 @@ static void hb_gt_wvt_mouse_GetPos( PHB_GT pGT, int * piRow, int * piCol )
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 );
@@ -2982,21 +2955,21 @@ 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 );
return GetSystemMetrics( SM_CMOUSEBUTTONS );
}
/* ********************************************************************** */
/* --- */
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 );
@@ -3218,7 +3191,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
GetWindowRect( pWVT->hWnd, &wi );
borderWidth = ( wi.right - wi.left - ( ci.right - ci.left ) ) / 2;
borderHeight = ( wi.bottom - wi.top - ( ci.bottom - ci.top ) );
borderHeight = wi.bottom - wi.top - ( ci.bottom - ci.top );
pInfo->pResult = hb_itemNew( NULL );
hb_arrayNew( pInfo->pResult, 4 );
@@ -3357,7 +3330,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
case HB_GTI_ICONFILE:
if( ( hb_itemType( pInfo->pNewVal ) & HB_IT_STRING ) )
if( hb_itemType( pInfo->pNewVal ) & HB_IT_STRING )
{
HICON hIconToFree = pWVT->bIconToFree ? pWVT->hIcon : NULL;
void * hImageName;
@@ -3463,8 +3436,6 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
case HB_GTI_SCREENSIZE:
{
int iX, iY;
if( ! pInfo->pResult )
pInfo->pResult = hb_itemNew( NULL );
@@ -3474,8 +3445,8 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
if( ( hb_itemType( pInfo->pNewVal ) & HB_IT_ARRAY ) && hb_arrayLen( pInfo->pNewVal ) == 2 )
{
iY = hb_arrayGetNI( pInfo->pNewVal, 2 );
iX = hb_arrayGetNI( pInfo->pNewVal, 1 );
int iY = hb_arrayGetNI( pInfo->pNewVal, 2 );
int iX = hb_arrayGetNI( pInfo->pNewVal, 1 );
if( iY > 0 )
{
@@ -3530,10 +3501,10 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
BOOL bMax = hb_itemGetL( pInfo->pNewVal );
HB_GTWVT_LONG_PTR style = GetWindowLongPtr( pWVT->hWnd, GWL_STYLE );
if( bMax && ( ! pWVT->bMaximizable ) )
style = style | WS_MAXIMIZEBOX;
else if( ( ! bMax ) && pWVT->bMaximizable )
style = style & ~WS_MAXIMIZEBOX;
if( bMax && ! pWVT->bMaximizable )
style |= WS_MAXIMIZEBOX;
else if( ! bMax && pWVT->bMaximizable )
style &= ~WS_MAXIMIZEBOX;
SetWindowLongPtr( pWVT->hWnd, GWL_STYLE, style );
SetWindowPos( pWVT->hWnd, NULL, 0, 0, 0, 0,
@@ -3553,7 +3524,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
{
HB_GTWVT_LONG_PTR style = GetWindowLongPtr( pWVT->hWnd, GWL_STYLE );
if( pWVT->bResizable )
style = style | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_THICKFRAME;
style |= WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_THICKFRAME;
else
style = ( style & ~( WS_MAXIMIZEBOX | WS_THICKFRAME ) ) | WS_BORDER;
@@ -3902,9 +3873,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
if( pWVT->hWnd )
{
int iSpec = hb_itemGetNI( pInfo->pNewVal2 );
switch( iSpec )
switch( hb_itemGetNI( pInfo->pNewVal2 ) )
{
case HB_GTS_WS_SETONTOP:
{
@@ -4099,15 +4068,12 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
return HB_TRUE;
}
/* ********************************************************************** */
/* --- Graphics API --- */
/* ********** Graphics API ********** */
/*
* NOTE:
/* NOTE:
* GfxPrimitive() parameters may have different meanings
* ie: - Desired color is 'iBottom' for PUTPIXEL and 'iRight' for CIRCLE
* - Red is iTop, Green iLeft and Blue is iBottom for MAKECOLOR
*
*/
#define SetGFXContext( c ) \
@@ -4132,18 +4098,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 );
@@ -4260,13 +4227,13 @@ static void hb_gt_wvt_gfx_Text( PHB_GT pGT, int iTop, int iLeft, const char *cBu
}
#endif
/* ********************************************************************** */
/* --- */
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 )
@@ -4288,13 +4255,13 @@ static void hb_gt_wvt_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
}
}
/* ********************************************************************** */
/* --- */
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 );
@@ -4335,11 +4302,11 @@ 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;
@@ -4364,16 +4331,13 @@ static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
return HB_TRUE;
}
/* ********************************************************************** */
/* --- */
#include "hbgtreg.h"
/* ********************************************************************** */
/* --- */
/*
* WVT specific functions
*/
/* WVT specific functions */
static void hb_wvt_gtLoadGuiData( void )
{
@@ -4442,10 +4406,10 @@ static void hb_wvt_gtReleaseGuiData( void )
#if ! defined( HB_OS_WIN_CE )
for( i = 0; i < WVT_PICTURES_MAX; i++ )
{
if( s_guiData->iPicture[ i ] )
if( s_guiData->pPicture[ i ] )
{
HB_VTBL( s_guiData->iPicture[ i ] )->Release( HB_THIS( s_guiData->iPicture[ i ] ) );
s_guiData->iPicture[ i ] = NULL;
HB_VTBL( s_guiData->pPicture[ i ] )->Release( HB_THIS( s_guiData->pPicture[ i ] ) );
s_guiData->pPicture[ i ] = NULL;
}
}
#endif
@@ -4473,7 +4437,7 @@ static void hb_wvt_gtReleaseGuiData( void )
static void hb_wvt_gtCreateObjects( PHB_GTWVT pWVT )
{
int iIndex;
int iIndex;
pWVT->bDeferPaint = HB_FALSE;
pWVT->bTracking = HB_FALSE;
@@ -4482,9 +4446,9 @@ static void hb_wvt_gtCreateObjects( PHB_GTWVT pWVT )
#if ! defined( HB_OS_WIN_CE )
{
LOGBRUSH lb;
LOGBRUSH lb;
lb.lbStyle = BS_NULL;
lb.lbColor = RGB( 198,198,198 );
lb.lbColor = RGB( 198, 198, 198 );
lb.lbHatch = 0;
pWVT->currentBrush = CreateBrushIndirect( &lb );
}
@@ -4671,11 +4635,7 @@ static void hb_wvt_gtCreateToolTipWindow( PHB_GTWVT pWVT )
pWVT->hWndTT = hwndTT;
}
/*
*
* Exported functions for API calls
*
*/
/* Exported functions for API calls */
PHB_GTWVT hb_wvt_gtGetWVT( void )
{

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpHtmlViewer compatible Class
*
* Copyright 2008 Andy Wos
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
@@ -45,14 +45,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpHtmlViewer compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 08Dec2008
*/
#include "hbclass.ch"

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpTreeView compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpTreeView compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 26Nov2008
*/
#include "hbclass.ch"
@@ -62,7 +56,7 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
CREATE CLASS WvgListBox INHERIT WvgWindow, WvgDataRef
CREATE CLASS WvgListBox INHERIT WvgWindow, WvgDataRef
VAR adjustHeight INIT .F.
VAR horizScroll INIT .F.

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ Compatible xbpMenuBar Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ Compatible xbpMenuBar Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 22Nov2008
*/
#include "hbclass.ch"

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpMLE compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpMLE compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 07Dec2008
*/
#include "hbclass.ch"

View File

@@ -1,21 +1,22 @@
/*
* Routines to manage Wvt*Classes Gui Painting
*
* Copyright 2004 Pritpal Bedi <bedipritpal@hotmail.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
* 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.
@@ -33,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.
*
@@ -51,9 +52,7 @@
THREAD STATIC t_paint_ := { { "", {} } }
/*
* This function must have to be defined in your appls
*/
/* This function must have to be defined in your applications */
#if 0
FUNCTION Wvt_Paint()

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ Compatible xbpPartHandler Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ Compatible xbpPartHandler Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 08Nov2008
*/
#include "hbclass.ch"

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpPushButton Compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpPushButton Compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 26Nov2008
*/
#include "hbclass.ch"
@@ -62,7 +56,7 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
CREATE CLASS WvgPushButton INHERIT WvgWindow
CREATE CLASS WvgPushButton INHERIT WvgWindow
VAR autosize INIT .F.
VAR border INIT .T.

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpPushButton Compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpPushButton Compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 06Dec2008
*/
#include "hbclass.ch"
@@ -62,7 +56,7 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
CREATE CLASS WvgRadioButton INHERIT WvgWindow, WvgDataRef
CREATE CLASS WvgRadioButton INHERIT WvgWindow, WvgDataRef
VAR autosize INIT .F.
VAR caption INIT ""

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpScrollBar Compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpScrollBar Compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 17Feb2009
*/
#include "hbclass.ch"
@@ -62,7 +56,7 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
CREATE CLASS WvgScrollBar INHERIT WvgWindow, WvgDataRef
CREATE CLASS WvgScrollBar INHERIT WvgWindow, WvgDataRef
VAR autoTrack INIT .T.
VAR range INIT { 0, 1 }

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpSLE compatible Class
*
* Copyright 2008-2011 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpSLE compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 07Dec2008
*/
#include "hbclass.ch"

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpStatusBar Compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpStatusBar Compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 25Nov2008
*/
#include "hbclass.ch"
@@ -62,7 +56,7 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
CREATE CLASS WvgStatusBar INHERIT WvgWindow /* WvgActiveXControl */
CREATE CLASS WvgStatusBar INHERIT WvgWindow /* WvgActiveXControl */
VAR caption INIT ""
VAR sizeGrip INIT .T.

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpTreeView compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpTreeView compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 26Nov2008
*/
#include "hbclass.ch"

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ Compatible xbpPartHandler Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ Compatible xbpPartHandler Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 08Nov2008
*/
#include "hbclass.ch"

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpTabPage compatible Class
*
* Copyright 2009-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpTabPage compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 01Mar2009
*/
#include "hbclass.ch"
@@ -62,7 +56,7 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
CREATE CLASS WvgTabPage INHERIT WvgWindow
CREATE CLASS WvgTabPage INHERIT WvgWindow
VAR caption INIT NIL /* Character string, Numeric, Object ("") */
VAR clipChildren INIT .T. /* Determines whether Xbase Parts in the child list are clipped during graphic output. */

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpToolBar Compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpToolBar Compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 23Nov2008
*/
#include "hbclass.ch"
@@ -62,7 +56,7 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
CREATE CLASS WvgToolBar INHERIT WvgWindow /*WvgActiveXControl*/
CREATE CLASS WvgToolBar INHERIT WvgWindow /*WvgActiveXControl*/
VAR appearance
VAR style INIT WVGTOOLBAR_STYLE_STANDARD

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ xbpTreeView compatible Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,14 +44,8 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ xbpTreeView compatible Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 26Nov2008
*/
#include "hbclass.ch"
@@ -62,7 +56,7 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
CREATE CLASS WvgTreeView INHERIT WvgWindow, WvgDataRef
CREATE CLASS WvgTreeView INHERIT WvgWindow, WvgDataRef
VAR alwaysShowSelection INIT .F.
VAR hasButtons INIT .F.

View File

@@ -1,5 +1,5 @@
/*
* Source file for the Wvg*Classes
* Xbase++ Compatible xbpWindow Class
*
* Copyright 2008-2012 Pritpal Bedi <bedipritpal@hotmail.com>
*
@@ -44,16 +44,9 @@
*
*/
/*
* EkOnkar
/* EkOnkar
* ( The LORD is ONE )
*
* Xbase++ Compatible xbpWindow Class
*
* Pritpal Bedi <bedipritpal@hotmail.com>
* 08Nov2008
*/
//
#include "hbclass.ch"
#include "inkey.ch"
@@ -63,16 +56,14 @@
#include "wvtwin.ch"
#include "wvgparts.ch"
//
// To Switch Over from ASCALLBACK() to SET/GET_Prop() calls
//
/* To Switch Over from ASCALLBACK() to SET/GET_Prop() calls */
#if 0
#define __BYASCALLBACK__
#else
#define __BYSETPROP__
#endif
CREATE CLASS WvgWindow INHERIT WvgPartHandler
CREATE CLASS WvgWindow INHERIT WvgPartHandler
/* CONFIGURATION */
VAR animate INIT .F.

View File

@@ -1,5 +1,4 @@
/*
*
* Copyright 2007-2012 Pritpal Bedi <bedipritpal@hotmail.com>
* Based on:
*
@@ -14,22 +13,20 @@
* Copyright 1999-2000 Paul Tucker <ptucker@sympatico.ca>
* Copyright 2002 Przemyslaw Czerpak <druzus@polbox.com>
*
* 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 )
* 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.
@@ -47,7 +44,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.
*
@@ -57,10 +54,7 @@
*
*/
/*
* GUI Drawing Functions
* Pritpal Bedi <bedipritpal@hotmail.com>
*/
/* GUI Drawing Function */
#include "hbwinole.h"
#include "gtwvg.h"
@@ -86,7 +80,7 @@ void hb_wvt_GetStringAttrib( int top, int left, int bottom, int right, HB_BYTE *
{
int irow, icol, j;
HB_TRACE( HB_TR_DEBUG, ( "hb_wvt_GetStringAttrib( %d, %d, %d, %d, %p, %p )", top, left, bottom, right, sBuffer, sAttrib ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_wvt_GetStringAttrib( %d, %d, %d, %d, %p, %p )", top, left, bottom, right, ( void * ) sBuffer, ( void * ) sAttrib ) );
for( j = 0, irow = top; irow <= bottom; irow++ )
{
@@ -110,7 +104,7 @@ void hb_wvt_PutStringAttrib( int top, int left, int bottom, int right, HB_BYTE *
{
int irow, icol, j;
HB_TRACE( HB_TR_DEBUG, ( "hb_wvt_PutStringAttrib( %d, %d, %d, %d, %p, %p )", top, left, bottom, right, sBuffer, sAttrib ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_wvt_PutStringAttrib( %d, %d, %d, %d, %p, %p )", top, left, bottom, right, ( void * ) sBuffer, ( void * ) sAttrib ) );
hb_gtBeginWrite();
for( j = 0, irow = top; irow <= bottom; irow++ )
@@ -1035,7 +1029,7 @@ HB_FUNC( WVT_DRAWIMAGE )
iRight = xy.x - 1 + hb_parvni( 6, 4 );
if( HB_ISNUM( 5 ) )
hb_wvt_gtRenderPicture( iLeft, iTop, ( iRight - iLeft ) + 1, ( iBottom - iTop ) + 1, _s->pGUI->iPicture[ hb_parni( 5 ) - 1 ], hb_parl( 7 ) );
hb_wvt_gtRenderPicture( iLeft, iTop, ( iRight - iLeft ) + 1, ( iBottom - iTop ) + 1, _s->pGUI->pPicture[ hb_parni( 5 ) - 1 ], hb_parl( 7 ) );
else
{
void * hImage;
@@ -1737,7 +1731,7 @@ HB_FUNC( WVT_DRAWBUTTON )
if( HB_ISNUM( 6 ) )
{
IPicture * iPicture = _s->pGUI->iPicture[ hb_parni( 6 ) - 1 ];
IPicture * iPicture = _s->pGUI->pPicture[ hb_parni( 6 ) - 1 ];
hb_wvt_gtRenderPicture( iLeft + 4, iTop + 4, iImageWidth, iImageHeight, iPicture, FALSE );
}
else
@@ -1840,7 +1834,7 @@ HB_FUNC( WVT_DRAWPICTURE )
if( iSlot < WVT_PICTURES_MAX )
{
if( _s->pGUI->iPicture[ iSlot ] )
if( _s->pGUI->pPicture[ iSlot ] )
{
xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) );
iTop = xy.y + hb_parvni( 6, 1 );
@@ -1850,7 +1844,7 @@ HB_FUNC( WVT_DRAWPICTURE )
iBottom = xy.y - 1 + hb_parvni( 6, 3 );
iRight = xy.x - 1 + hb_parvni( 6, 4 );
hb_retl( hb_wvt_gtRenderPicture( iLeft, iTop, iRight - iLeft + 1, iBottom - iTop + 1, _s->pGUI->iPicture[ iSlot ], hb_parl( 7 ) ) );
hb_retl( hb_wvt_gtRenderPicture( iLeft, iTop, iRight - iLeft + 1, iBottom - iTop + 1, _s->pGUI->pPicture[ iSlot ], hb_parl( 7 ) ) );
}
}
#endif
@@ -2746,9 +2740,9 @@ HB_FUNC( WVT_LOADPICTURE )
hb_strfree( hImage );
if( iPicture )
{
if( _s->pGUI->iPicture[ iSlot ] )
hb_wvt_gtDestroyPicture( _s->pGUI->iPicture[ iSlot ] );
_s->pGUI->iPicture[ iSlot ] = iPicture;
if( _s->pGUI->pPicture[ iSlot ] )
hb_wvt_gtDestroyPicture( _s->pGUI->pPicture[ iSlot ] );
_s->pGUI->pPicture[ iSlot ] = iPicture;
bResult = HB_TRUE;
}
#endif
@@ -2793,9 +2787,9 @@ HB_FUNC( WVT_LOADPICTUREFROMRESOURCE )
hb_strfree( hSection );
if( iPicture )
{
if( _s->pGUI->iPicture[ iSlot ] )
hb_wvt_gtDestroyPicture( _s->pGUI->iPicture[ iSlot ] );
_s->pGUI->iPicture[ iSlot ] = iPicture;
if( _s->pGUI->pPicture[ iSlot ] )
hb_wvt_gtDestroyPicture( _s->pGUI->pPicture[ iSlot ] );
_s->pGUI->pPicture[ iSlot ] = iPicture;
bResult = HB_TRUE;
}
#endif

View File

@@ -1,5 +1,4 @@
/*
*
* Copyright 2009-2012 Pritpal Bedi <bedipritpal@hotmail.com>
* Based on:
*
@@ -14,22 +13,20 @@
* Copyright 1999-2000 Paul Tucker <ptucker@sympatico.ca>
* Copyright 2002 Przemyslaw Czerpak <druzus@polbox.com>
*
* 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 )
* 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.
@@ -47,7 +44,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.
*
@@ -65,9 +62,6 @@
* CUI Enhancement Oriented
* No Callbacks etc.
* Pure Statics
* .
* Pritpal Bedi <bedipritpal@hotmail.com>
* 28Feb2009
*/
#include "hbwinole.h"
@@ -139,9 +133,9 @@ HB_FUNC( WVG_CLEARGUIOBJECTS )
if( pWVT->gObjs->bBlock )
hb_itemRelease( pWVT->gObjs->bBlock );
#if ! defined( HB_OS_WIN_CE )
if( pWVT->gObjs->iPicture )
if( pWVT->gObjs->pPicture )
if( pWVT->gObjs->bDestroyPicture )
HB_VTBL( pWVT->gObjs->iPicture )->Release( HB_THIS( pWVT->gObjs->iPicture ) );
HB_VTBL( pWVT->gObjs->pPicture )->Release( HB_THIS( pWVT->gObjs->pPicture ) );
#endif
hb_xfree( pWVT->gObjs );
pWVT->gObjs = gObj;
@@ -214,11 +208,11 @@ HB_FUNC( WVG_SETGOBJDATA )
#if ! defined( HB_OS_WIN_CE )
case GOBJ_OBJDATA_PICTUREEX:
if( HB_ISNUM( 3 ) )
gObj->iPicture = ( IPicture * ) ( HB_PTRUINT ) hb_parni( 3 );
gObj->pPicture = ( IPicture * ) ( HB_PTRUINT ) hb_parni( 3 );
break;
case GOBJ_OBJDATA_PICTURE:
if( HB_ISNUM( 3 ) && hb_parni( 3 ) <= WVT_PICTURES_MAX )
gObj->iPicture = pWVT->pGUI->iPicture[ hb_parni( 3 ) - 1 ];
gObj->pPicture = pWVT->pGUI->pPicture[ hb_parni( 3 ) - 1 ];
break;
case GOBJ_OBJDATA_IMAGE:
{
@@ -227,7 +221,7 @@ HB_FUNC( WVG_SETGOBJDATA )
if( HB_ISNUM( 3 ) )
{
if( hb_parni( 3 ) <= WVT_PICTURES_MAX )
iPicture = pWVT->pGUI->iPicture[ hb_parni( 3 ) - 1 ];
iPicture = pWVT->pGUI->pPicture[ hb_parni( 3 ) - 1 ];
}
else
{
@@ -245,9 +239,9 @@ HB_FUNC( WVG_SETGOBJDATA )
}
if( iPicture )
{
if( gObj->bDestroyPicture && gObj->iPicture )
HB_VTBL( gObj->iPicture )->Release( HB_THIS( gObj->iPicture ) );
gObj->iPicture = iPicture;
if( gObj->bDestroyPicture && gObj->pPicture )
HB_VTBL( gObj->pPicture )->Release( HB_THIS( gObj->pPicture ) );
gObj->pPicture = iPicture;
gObj->bDestroyPicture = HB_TRUE;
}
break;
@@ -1386,7 +1380,7 @@ HB_FUNC( WVG_PICTURE )
gObj->aOffset.iBottom = hb_parvni( 5, 3 );
gObj->aOffset.iRight = hb_parvni( 5, 4 );
gObj->iPicture = pWVT->pGUI->iPicture[ hb_parni( 6 ) - 1 ];
gObj->pPicture = pWVT->pGUI->pPicture[ hb_parni( 6 ) - 1 ];
gObj->iData = ( hb_parl( 7 ) ? 1 : 0 );
gObj->bDestroyPicture = HB_FALSE;
@@ -1420,7 +1414,7 @@ HB_FUNC( WVG_PICTUREEX )
gObj->aOffset.iBottom = hb_parvni( 5, 3 );
gObj->aOffset.iRight = hb_parvni( 5, 4 );
gObj->iPicture = ( IPicture * ) ( HB_PTRUINT ) hb_parnint( 6 );
gObj->pPicture = ( IPicture * ) ( HB_PTRUINT ) hb_parnint( 6 );
gObj->iData = ( hb_parl( 7 ) ? 1 : 0 );
gObj->bDestroyPicture = HB_FALSE;
@@ -1454,7 +1448,7 @@ HB_FUNC( WVG_IMAGE )
{
case GOBJ_IMAGESOURCE_SLOT:
if( HB_ISNUM( 7 ) && hb_parni( 7 ) <= WVT_PICTURES_MAX )
iPicture = pWVT->pGUI->iPicture[ hb_parni( 7 ) - 1 ];
iPicture = pWVT->pGUI->pPicture[ hb_parni( 7 ) - 1 ];
break;
case GOBJ_IMAGESOURCE_RESOURCE:
{
@@ -1490,7 +1484,7 @@ HB_FUNC( WVG_IMAGE )
gObj->aOffset.iBottom = hb_parvni( 5, 3 );
gObj->aOffset.iRight = hb_parvni( 5, 4 );
gObj->iPicture = iPicture;
gObj->pPicture = iPicture;
gObj->iData = ( hb_parl( 9 ) ? 1 : 0 );
if( iSource == GOBJ_IMAGESOURCE_SLOT )
@@ -1517,7 +1511,7 @@ static void hb_wvg_RenderPicture( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int
POINT lpp = { 0, 0 };
HDC hdc = pWVT->hGuiDC;
IPicture * iPicture = gObj->iPicture;
IPicture * iPicture = gObj->pPicture;
if( iPicture )
{

View File

@@ -14,22 +14,20 @@
* Copyright 1999-2000 Paul Tucker <ptucker@sympatico.ca>
* Copyright 2002 Przemyslaw Czerpak <druzus@polbox.com>
*
* 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 )
* 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.
@@ -47,7 +45,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.
*
@@ -59,7 +57,7 @@
#include "gtwvg.h"
/* workaround for missing declaration in MinGW32 */
/* workaround for missing declaration in MinGW */
#if ! defined( TTM_SETTITLE ) && defined( TTM_SETTITLEA )
#define TTM_SETTITLE TTM_SETTITLEA
#endif

View File

@@ -14,22 +14,20 @@
* Copyright 1999-2000 Paul Tucker <ptucker@sympatico.ca>
* Copyright 2002 Przemyslaw Czerpak <druzus@polbox.com>
*
* 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 )
* 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.
@@ -47,7 +45,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.
*
@@ -57,9 +55,7 @@
*
*/
/*
* Direct WinApi Functions - Prefixed WIN_*()
*/
/* Direct WinApi Functions - Prefixed wvg_*() */
#include "gtwvg.h"
#include "hbwapi.h"

View File

@@ -14,22 +14,20 @@
* Copyright 1999-2000 Paul Tucker <ptucker@sympatico.ca>
* Copyright 2002 Przemyslaw Czerpak <druzus@polbox.com>
*
* 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 )
* 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.
@@ -47,7 +45,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.
*
@@ -57,9 +55,7 @@
*
*/
/*
* Direct WinApi Functions - Prefixed WIN_*()
*/
/* Direct WinApi Functions - Prefixed wvg_*() */
#if defined( __BORLANDC__ )
# if ! defined( NONAMELESSUNION )
@@ -87,8 +83,8 @@
#include <windowsx.h>
#if defined( __BORLANDC__ ) && ( __BORLANDC__ >= 0x610 )
# undef NONAMELESSUNION
#if defined( __BORLANDC__ ) && __BORLANDC__ >= 0x0610
#undef NONAMELESSUNION
#endif
#if defined( NONAMELESSUNION )

View File

@@ -1,6 +1,5 @@
/*
* AMF3 headers
* Based on a AmFast C library for Python by Dave Thompson
* AMF3 headers - based on a AmFast C library for Python by Dave Thompson
*
* Copyright 2011-2012 Aleksander Czajczynski <hb/at/fki.pl>
*

View File

@@ -1,14 +1,11 @@
/*******
/* by Aleksander Czajczynski <hb/at/fki.pl> 2011-2012
*
* by Aleksander Czajczynski <hb/at/fki.pl> 2011-2012
* Decoding AMF3 to Harbour items
*
* Decoding AMF3 to Harbour items
*
* Contains portions from
* Dave Thompson's MIT licensed
* AmFast C library for Python
*
********/
* Contains portions from
* Dave Thompson's MIT licensed
* AmFast C library for Python
*/
#include "hbapi.h"
#include "hbapiitm.h"
@@ -109,7 +106,7 @@ static HB_BOOL amfX_decode_double( amfContext * context, double * val )
/*
* Put bytes from byte array into double
* TOFIX: does this aligment work on any platform?
* FIXME: does this alignment work on any platform?
union aligned
{
@@ -175,7 +172,7 @@ static HB_BOOL amf3_decode_int( amfContext * context, int * iVal )
result |= byte & 0xff;
}
/* Move sign bit, since we're converting 29bit->32bit */
/* Move sign bit, since we're converting 29-bit -> 32-bit */
if( result & 0x10000000 )
result -= 0x20000000;
@@ -295,12 +292,12 @@ static HB_BOOL amf3_deserialize_string( amfContext * context, PHB_ITEM pItem )
/* Add the dynamic attributes of an encoded obj to a dict. */
static HB_BOOL amf3_decode_dynamic_dict( amfContext * context, PHB_ITEM pItem )
{
PHB_ITEM pKey;
PHB_ITEM pValue;
HB_BOOL result;
for( ;; )
{
PHB_ITEM pKey;
PHB_ITEM pValue;
HB_BOOL result;
pKey = hb_itemNew( NULL );
if( ! amf3_deserialize_string( context, pKey ) )
{
@@ -331,7 +328,7 @@ static HB_BOOL amf3_decode_dynamic_dict( amfContext * context, PHB_ITEM pItem )
}
}
/* Populate an array with vals from the buffer. */
/* Populate an array with values from the buffer. */
static HB_BOOL decode_dynamic_array_AMF3( amfContext * context, PHB_ITEM pItem, int array_len, HB_BOOL dict )
{
int i;
@@ -423,8 +420,8 @@ static HB_BOOL amf3_deserialize_array( amfContext * context, PHB_ITEM pItem, HB_
}
array_len = ( int ) ( header >> 1 );
/* Original python comment was:
Can't use array_len to create a list of known
/* Original Python comment was:
Cannot use array_len to create a list of known
length, see ticket #46
I think that this is not a problem for Harbour */
@@ -666,8 +663,8 @@ static HB_BOOL amf3_decode_class_def( amfContext * context, PHB_ITEM pClass, int
hb_hashNew( pMappedClassDef ); /* empty hash emulation for now */
}
/* PyObject_CallMethodObjArgs(context->class_mapper,
context->class_def_name, alias, NULL); */
/* PyObject_CallMethodObjArgs( context->class_mapper,
context->class_def_name, alias, NULL ); */
}
hb_itemRelease( pStrAlias );
@@ -709,7 +706,7 @@ static HB_BOOL amf3_decode_class_def( amfContext * context, PHB_ITEM pClass, int
the raw bytes. */
/* TODO: introduce similar RTE?
PyErr_SetString(amfast_DecodeError, "Encoded class is externalizable, but ClassDef is not."); */
PyErr_SetString( amfast_DecodeError, "Encoded class is externalizable, but ClassDef is not." ); */
return HB_FALSE;
}
@@ -800,13 +797,11 @@ static HB_BOOL amf3_deserialize_class_def( amfContext * context, PHB_ITEM pClass
return HB_TRUE;
}
/* Returns a dict with vals from an obj. */
/* Returns a dict with values from an object. */
static HB_BOOL amf3_decode_obj_attrs( amfContext * context, PHB_ITEM pHash, PHB_ITEM pClass )
{
PHB_ITEM pArray;
PHB_ITEM pKey;
PHB_ITEM pValue;
HB_BOOL result;
HB_SIZE static_attr_len;
HB_SIZE i;
@@ -817,12 +812,15 @@ static HB_BOOL amf3_decode_obj_attrs( amfContext * context, PHB_ITEM pHash, PHB_
if( ! pArray )
return HB_FALSE;
/* maybe hb_arrayGetItemPtr(?) could be used */
/* maybe hb_arrayGetItemPtr() could be used? */
static_attr_len = hb_arrayLen( pArray );
for( i = 0; i < static_attr_len; i++ )
{
PHB_ITEM pKey;
HB_BOOL result;
pValue = hb_itemNew( NULL );
if( ! amf3_getItem( context, pValue ) )
{
@@ -866,12 +864,12 @@ static HB_BOOL amf3_decode_anon_obj( amfContext * context, PHB_ITEM pItem, PHB_I
PHB_ITEM pAnonHash = hb_itemNew( NULL );
HB_BOOL result = HB_FALSE;
/* Original python comment which I don't understand:
/* Original Python comment which I don't understand:
We're using merge instead of populating the dict
directly, because we have to setup a reference to the
object before decoding it. ?????? */
/* we (Harbourers) are supplying already initialized hash to next func */
/* we (Harbourers) are supplying already initialized hash to next function */
if( hb_arrayGet( pItem, OBJAMF_VAR_HASH, pAnonHash ) )
result = amf3_decode_obj_attrs( context, pAnonHash, pClass );
@@ -1003,8 +1001,8 @@ static HB_BOOL amf3_deserialize_obj( amfContext * context, PHB_ITEM pItem, HB_BO
{
/* Anonymous obj == OBJAMF */
hb_arrayNew( pItem, OBJAMF_VAR_COUNT );
/* performance TOFIX, cache class id (in context maybe)
to not scan all classes by name everytime */
/* performance FIXME, cache class id (in context maybe)
to not scan all classes by name every time */
hb_objSetClass( pItem, "AMF_OBJ", "AMF_OBJ" );
pValue = hb_itemPutNI( NULL, OBJAMF_VER );
hb_arraySet( pItem, OBJAMF_VAR_VER, pValue );
@@ -1042,7 +1040,7 @@ static HB_BOOL amf3_deserialize_obj( amfContext * context, PHB_ITEM pItem, HB_BO
}
else
{
/* Create obj_val for all typed objs. */
/* Create obj_val for all typed objects. */
#if 0
obj_val = PyObject_CallMethod( class_def, "getInstance", NULL );
#endif

View File

@@ -1,15 +1,12 @@
/*******
/* Ilina Stoilkovska <anili100/at/gmail.com> 2011
* Aleksander Czajczynski <hb/at/fki.pl> 2011-2012
*
* Ilina Stoilkovska <anili100/at/gmail.com> 2011
* Aleksander Czajczynski <hb/at/fki.pl> 2011-2012
* Encoding Harbour items to AMF3
*
* Encoding Harbour items to AMF3
*
* Contains portions from
* Dave Thompson's MIT licensed
* AmFast C library for Python
*
********/
* Contains portions from
* Dave Thompson's MIT licensed
* AmFast C library for Python
*/
#include "hbapi.h"
#include "hbapiitm.h"
@@ -154,7 +151,7 @@ static HB_BOOL amf3_encode_int( amfContext * context, int value )
*
* The int is negative if the 1st bit of the 29 int is set.
*/
value &= 0x1fffffff; /* Ignore 1st 3 bits of 32 bit int, since we're encoding to 29 bit. */
value &= 0x1fffffff; /* Ignore 1st 3 bits of 32-bit int, since we're encoding to 29 bit. */
if( value < 0x80 )
{
tmp_size = 1;
@@ -236,7 +233,7 @@ static HB_BOOL amf3_encode_bool( amfContext * context, PHB_ITEM pItem )
static HB_BOOL amf3_encode_string( amfContext * context, PHB_ITEM pItem )
{
void * hStr = NULL; /* = hb_itemGetCPtr(pItem); not needed with UTF8 conversion */
void * hStr = NULL; /* = hb_itemGetCPtr( pItem ); not needed with UTF-8 conversion */
HB_SIZE len;
const char * utf8str = hb_itemGetStrUTF8( pItem, &hStr, &len );
HB_BOOL result;
@@ -259,14 +256,13 @@ static HB_BOOL amf3_encode_string( amfContext * context, PHB_ITEM pItem )
static int amf3_add_index( amfContext * context, PHB_ITEM pHash, PHB_ITEM pItem )
{
PHB_ITEM pKey;
PHB_ITEM pVal;
int result = 0;
HB_SIZE str_len;
if( context->use_refs )
{
pKey = hb_itemNew( NULL );
PHB_ITEM pKey = hb_itemNew( NULL );
_ref_realItemPtr( pKey, pItem );
if( ! HB_IS_POINTER( pKey ) && ! HB_IS_DATETIME( pKey ) )
{
@@ -288,12 +284,12 @@ static int amf3_add_index( amfContext * context, PHB_ITEM pHash, PHB_ITEM pItem
result = ( int ) ( hb_hashLen( pHash ) - 1 + context->strstr_count );
/* used only when some inner context inside
* conversion function uses only strstr mode
* like AMF3_FROMWA function f.e. */
* like amf3_FromWA() function f.e. */
}
if( ( HB_IS_STRING( pItem ) || HB_IS_MEMO( pItem ) ) && context->use_strstr )
{
str_len = hb_itemGetCLen( pItem );
HB_SIZE str_len = hb_itemGetCLen( pItem );
if( str_len > 3 && str_len < 32 ) /* do this only for mid-sized strings */
{
if( ! context->use_refs )
@@ -312,14 +308,11 @@ static int amf3_add_index( amfContext * context, PHB_ITEM pHash, PHB_ITEM pItem
static int amf3_get_index( amfContext * context, PHB_ITEM pHash, PHB_ITEM pItem )
{
PHB_ITEM pKey;
PHB_ITEM pStrIdx;
HB_SIZE nPos;
HB_SIZE str_len;
if( context->use_refs )
{
pKey = hb_itemNew( NULL );
PHB_ITEM pKey = hb_itemNew( NULL );
HB_SIZE nPos;
_ref_realItemPtr( pKey, pItem );
if( ! HB_IS_POINTER( pKey ) && ! HB_IS_DOUBLE( pKey ) )
{
@@ -337,17 +330,13 @@ static int amf3_get_index( amfContext * context, PHB_ITEM pHash, PHB_ITEM pItem
if( ( HB_IS_STRING( pItem ) || HB_IS_MEMO( pItem ) ) && context->use_strstr )
{
str_len = hb_itemGetCLen( pItem );
if( str_len > 3 && str_len < 32 ) /* do this only for mid-sized strings */
HB_SIZE str_len = hb_itemGetCLen( pItem );
if( str_len > 3 && str_len < 32 ) /* do this only for mid-sized strings */
{
pStrIdx = hb_hashGetItemPtr( context->strstr_ref, pItem, 0 );
PHB_ITEM pStrIdx = hb_hashGetItemPtr( context->strstr_ref, pItem, 0 );
if( pStrIdx )
return ( int ) hb_itemGetNS( pStrIdx );
else
return -1;
}
else
return -1;
}
return -1;
@@ -374,7 +363,6 @@ static int amf3_encode_reference( amfContext * context, PHB_ITEM pHash, PHB_ITEM
if( amf3_add_index( context, pHash, pItem ) == -1 )
return 0;
return -1;
}
@@ -472,15 +460,13 @@ static HB_BOOL amf3_encode_hash( amfContext * context, PHB_ITEM pItem )
static HB_BOOL amf3_encode_dynamic_dict( amfContext * context, PHB_ITEM pItem )
{
PHB_ITEM pKey;
PHB_ITEM pVal;
HB_ISIZ i;
HB_ISIZ len = hb_hashLen( pItem );
HB_ISIZ i;
HB_ISIZ len = hb_hashLen( pItem );
for( i = 1; i <= len; i++ )
{
pKey = hb_hashGetKeyAt( pItem, i );
pVal = hb_hashGetValueAt( pItem, i );
PHB_ITEM pKey = hb_hashGetKeyAt( pItem, i );
PHB_ITEM pVal = hb_hashGetValueAt( pItem, i );
if( HB_IS_STRING( pKey ) )
{
if( ! amf3_serialize_string( context, pKey ) )
@@ -574,10 +560,8 @@ static int amf3_serialize_date( amfContext * context, PHB_ITEM pItem )
static HB_BOOL amf3_encode_array( amfContext * context, PHB_ITEM pItem )
{
HB_SIZE item_len = hb_arrayLen( pItem );
PHB_ITEM pArrayItem;
int i;
int result;
HB_SIZE item_len = hb_arrayLen( pItem );
int i;
if( ! amf3_encode_int( context, ( ( int ) item_len << 1 ) | REFERENCE_BIT ) )
return HB_FALSE;
@@ -587,6 +571,9 @@ static HB_BOOL amf3_encode_array( amfContext * context, PHB_ITEM pItem )
for( i = 1; i <= ( int ) item_len; i++ )
{
PHB_ITEM pArrayItem;
int result;
pArrayItem = hb_itemNew( NULL );
hb_arrayGet( pItem, i, pArrayItem );
if( ! pArrayItem )
@@ -618,8 +605,9 @@ static int amf3_encode_class_def( amfContext * context, PHB_ITEM pClass )
HB_ISIZ i;
PHB_ITEM class_alias;
PHB_ITEM static_attrs;
/* PHB_ITEM attr_len = NULL; */
PHB_ITEM attr_name;
#if 0
PHB_ITEM attr_len = NULL;
#endif
if( ! pClass )
{
@@ -658,7 +646,7 @@ static int amf3_encode_class_def( amfContext * context, PHB_ITEM pClass )
if( ! static_attrs )
return 0;
static_attr_len = hb_arrayLen( static_attrs ); /* array this is -- hb_itemGetCLen(static_attrs); */
static_attr_len = hb_arrayLen( static_attrs ); /* array this is -- hb_itemGetCLen( static_attrs ); */
if( static_attr_len == -1 || static_attr_len > ( MAX_INT >> 4 ) )
return 0;
@@ -667,13 +655,13 @@ static int amf3_encode_class_def( amfContext * context, PHB_ITEM pClass )
return 0;
result = amf3_serialize_string( context, class_alias );
/* not needed hb_itemRelease(class_alias); */
/* not needed hb_itemRelease( class_alias ); */
if( ! result )
return 0;
for( i = 0; i < static_attr_len; i++ )
{
attr_name = hb_itemArrayGet( static_attrs, i );
PHB_ITEM attr_name = hb_itemArrayGet( static_attrs, i );
if( ! attr_name )
{
/* not needed hb_itemRelease( static_attrs ); */
@@ -685,7 +673,7 @@ static int amf3_encode_class_def( amfContext * context, PHB_ITEM pClass )
return 0;
}
/* not needed hb_itemRelease( static_attrs ); */
/* not needed hb_itemRelease( static_attrs ); */
return 1;
}
@@ -1025,9 +1013,6 @@ static amfContext * context_setup( PHB_ITEM pFuncSym, HB_BOOL use_refs, HB_BOOL
memset( context, 0, sizeof( amfContext ) );
context->cBuf = ( char * ) hb_xgrab( sizeof( char ) * 8 );
#if 0
memset( context->cBuf, 0, sizeof( char ) * 8 );
#endif
context->position = 0;
context->length = sizeof( char ) * 8;
context->str_rtrim = str_rtrim;
@@ -1241,7 +1226,6 @@ HB_FUNC( AMF3_FROMWA )
}
}
if( ! bAsArray )
{
pFieldNames = hb_itemNew( NULL );
@@ -1385,9 +1369,6 @@ HB_FUNC( AMF3_ENCODE )
memset( context, 0, sizeof( amfContext ) );
context->cBuf = ( char * ) hb_xgrab( sizeof( char ) * 8 );
#if 0
memset( context->cBuf, 0, sizeof( char ) * 8 );
#endif
context->position = 0;
context->length = sizeof( char ) * 8;
context->str_rtrim = HB_FALSE;

View File

@@ -50,8 +50,8 @@
CREATE CLASS amf_Obj
METHOD New( hCachedData ) CONSTRUCTOR
ERROR HANDLER noMessage
METHOD msgNotFound
ERROR HANDLER noMessage( ... )
METHOD msgNotFound( cMessage, ... )
PROTECTED:
@@ -67,7 +67,7 @@ CREATE CLASS amf_Obj
ACCESS RealClass INLINE ::cRealClass
ACCESS RpcOid INLINE ::nRpcOid
END CLASS
ENDCLASS
METHOD New( hCachedData ) CLASS amf_Obj
@@ -76,7 +76,6 @@ METHOD New( hCachedData ) CLASS amf_Obj
RETURN self
METHOD noMessage( ... ) CLASS amf_Obj
RETURN ::msgNotFound( __GetMessage(), ... )
METHOD msgNotFound( cMessage, ... ) CLASS amf_Obj
@@ -102,7 +101,7 @@ CREATE CLASS amf_Raw
PROTECTED:
VAR cData
END CLASS
ENDCLASS
METHOD New( cData ) CLASS amf_Raw

View File

@@ -1,6 +1,4 @@
--------------------------------------
Short description of Harbour functions
--------------------------------------
Short description of Harbour functions:
cAMF := amf3_Encode( xVal, symConvOut, lBinaryStrings )
xVal - any supported datatype:
@@ -32,7 +30,7 @@ Short description of Harbour functions
bWhile - COPY TO like WHILE codeblock
bFor - COPY TO like FOR codeblock
aFields - array of fieldnames (codeblocks are going to be supported here too)
aFields - array of field names (codeblocks are going to be supported here too)
nCount - NEXT like, process only specified count of records
lStrTrim - RTrim() strings, default is .T.
@@ -46,19 +44,51 @@ Short description of Harbour functions
outbound conversion function, you must pass pointer to
encoding context, otherwise AMF3 references will encoded
incorrectly. Example code of such case:
STATIC FUNCTION ConvOut( xVal, pOuterContext )
LOCAL lClose
IF HB_ISOBJECT( xVal )
IF xVal:className() == "WORKAREAEXPORT"
lClose := xVal:lCloseWA
SELECT ( xVal:nWorkArea )
IF HB_ISOBJECT( xVal ) .AND. xVal:className() == "WORKAREAEXPORT"
lClose := xVal:lCloseWA
dbSelectArea( xVal:nWorkArea )
xVal := amf_Raw():New( amf3_FromWA( xVal:bWhile, xVal:bFor, xVal:aFields, xVal:nCount, xVal:lStrTrim, 1, pOuterContext ) )
IF lClose
CLOSE
ENDIF
xVal := amf_Raw():New( amf3_FromWA( xVal:bWhile, xVal:bFor, xVal:aFields, xVal:nCount, xVal:lStrTrim, 1, pOuterContext ) )
IF lClose
dbCloseArea()
ENDIF
ENDIF
RETURN xVal
RETURN xVal
Issues
======
; amf3_Encode(), amf3_Decode()
- there is no real serialization class-mapping included at the moment,
due to lack of time to make a concept of it complete.
Only anonymous (emulated on Harbour side using ObjAMF class)
and externalizable objects are supported.
- context->positon-- decrements should be removed from the .c code,
before we make the functions able to work on real streams without
buffering. There is no rewind in such situations.
; amf3_FromWA() - generates AMF3 array from current workarea,
but the function doesn't have an idea of SET DELETED switch!
It should have, because it tries to predict the number of records.
As a workaround <bFor> parameter could be used, because it switches
off the prediction. Another option could be creating temporary INDEX FOR,
it should have correct ordKeyCount().
; amf3_Decode() - really doesn't need a hash for references, because
reference id in AMF increase sequentially. It could be okay and faster
to use some array with decent resize schema. Other than that benchmarks (in
ST mode) showed that decoding speed is a little bit faster in this
implementation than with Flash's built-in.
; .c function amf3_encode_string() does string hb_strRTrimLen()
on a UTF-8 values. so far i haven't found a string that was broken
by this, but i have a feeling that it is possible...
Note your issues too!

View File

@@ -246,7 +246,7 @@ FUNCTION BliMgrSts( nParam )
CASE BliCacheSize
CASE BliExtMemAvail
CASE BliOverlayLoc
CASE BliVirMemAvail /* fall through */
CASE BliVirMemAvail /* fallthrough */
ENDSWITCH
RETURN 0

View File

@@ -55,7 +55,7 @@
#define BliCacheLoc 1 /* Get location of real mode overlay cache (EMS/XMS) */
#define BliCacheSize 2 /* Get size of overlay cache */
#define BliExtMemAvail 3 /* Get bytes extended memory available to the extender */
#define BliHostMode 4 /* Get DOS extender host mode (DPMI/VCPI/XMS) */
#define BliHostMode 4 /* Get MS-DOS extender host mode (DPMI/VCPI/XMS) */
#define BliMachineMode 5 /* Get current machine mode (real, protected) */
#define BliOverlayLoc 6 /* Get location of overlay area */
#define BliOverlaySize 7 /* Get size of overlay area */

View File

@@ -90,7 +90,9 @@ static int hb_bz2Compress( const char * szSrc, HB_SIZE nSrc,
stream.bzalloc = hb_bz2Alloc;
stream.bzfree = hb_bz2Free;
/* stream.opaque = NULL; */
#if 0
stream.opaque = NULL;
#endif
iResult = BZ2_bzCompressInit( &stream, iBlockSize, 0, 0 );
if( iResult == BZ_OK )
@@ -132,7 +134,9 @@ static HB_SIZE hb_bz2UncompressedSize( const char * szSrc, HB_SIZE nLen,
stream.bzalloc = hb_bz2Alloc;
stream.bzfree = hb_bz2Free;
/* stream.opaque = NULL; */
#if 0
stream.opaque = NULL;
#endif
*piResult = BZ2_bzDecompressInit( &stream, 0, 0 );
if( *piResult == BZ_OK )
@@ -180,7 +184,9 @@ static int hb_bz2Uncompress( const char * szSrc, HB_SIZE nSrc,
stream.bzalloc = hb_bz2Alloc;
stream.bzfree = hb_bz2Free;
/* stream.opaque = NULL; */
#if 0
stream.opaque = NULL;
#endif
iResult = BZ2_bzDecompressInit( &stream, 0, 0 );
if( iResult == BZ_OK )
@@ -207,17 +213,13 @@ static int hb_bz2Uncompress( const char * szSrc, HB_SIZE nSrc,
return iResult;
}
/*
* hb_bz2_Version() -> <cBZlibVersion>
*/
/* hb_bz2_Version() --> <cBZlibVersion> */
HB_FUNC( HB_BZ2_VERSION )
{
hb_retc( BZ2_bzlibVersion() );
}
/*
* hb_bz2_CompressBound( <cData> | <nDataLen> ) -> <nMaxCompressLen>
*/
/* hb_bz2_CompressBound( <cData> | <nDataLen> ) --> <nMaxCompressLen> */
HB_FUNC( HB_BZ2_COMPRESSBOUND )
{
if( HB_ISCHAR( 1 ) )
@@ -228,10 +230,8 @@ HB_FUNC( HB_BZ2_COMPRESSBOUND )
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
/*
* hb_bz2_UncompressLen( <cCompressedData>, [<@nResult>] )
* -> <nUnCompressedDataLen> or -1 on error
*/
/* hb_bz2_UncompressLen( <cCompressedData>, [<@nResult>] )
--> <nUnCompressedDataLen> or -1 on error */
HB_FUNC( HB_BZ2_UNCOMPRESSLEN )
{
const char * szData = hb_parc( 1 );
@@ -255,10 +255,8 @@ HB_FUNC( HB_BZ2_UNCOMPRESSLEN )
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
/*
* hb_bz2_Compress( <cData>, [<nDstBufLen>|<@cBuffer>], [<@nResult>], [<nLevel>] )
* => <cCompressedData> or NIL on Error
*/
/* hb_bz2_Compress( <cData>, [<nDstBufLen>|<@cBuffer>], [<@nResult>], [<nLevel>] )
--> <cCompressedData> or NIL on Error */
HB_FUNC( HB_BZ2_COMPRESS )
{
const char * szData = hb_parc( 1 );
@@ -315,10 +313,8 @@ HB_FUNC( HB_BZ2_COMPRESS )
hb_errRT_BASE_SubstR( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
/*
* hb_bz2_Uncompress( <cCompressedData>, [<nDstBufLen>|<@cBuffer>], [<@nResult>] )
* => <cUnCompressedData> or NIL on Error
*/
/* hb_bz2_Uncompress( <cCompressedData>, [<nDstBufLen>|<@cBuffer>], [<@nResult>] )
--> <cUnCompressedData> or NIL on Error */
HB_FUNC( HB_BZ2_UNCOMPRESS )
{
PHB_ITEM pBuffer = HB_ISBYREF( 2 ) ? hb_param( 2, HB_IT_STRING ) : NULL;

View File

@@ -44,12 +44,10 @@
*
*/
#include "hbcairo.h"
#include "hbapiitm.h"
#include "hbapierr.h"
HB_FUNC( CAIRO_CLIP )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -58,7 +56,6 @@ HB_FUNC( CAIRO_CLIP )
cairo_clip( pCairo );
}
HB_FUNC( CAIRO_CLIP_EXTENTS )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -77,7 +74,6 @@ HB_FUNC( CAIRO_CLIP_EXTENTS )
}
}
HB_FUNC( CAIRO_CLIP_PRESERVE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -86,7 +82,6 @@ HB_FUNC( CAIRO_CLIP_PRESERVE )
cairo_clip_preserve( pCairo );
}
HB_FUNC( CAIRO_COPY_PAGE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -95,7 +90,6 @@ HB_FUNC( CAIRO_COPY_PAGE )
cairo_copy_page( pCairo );
}
HB_FUNC( CAIRO_CREATE )
{
cairo_surface_t * pSurface = hb_cairo_surface_param( 1 );
@@ -104,7 +98,6 @@ HB_FUNC( CAIRO_CREATE )
hb_cairo_ret( cairo_create( pSurface ) );
}
HB_FUNC( CAIRO_FILL )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -113,7 +106,6 @@ HB_FUNC( CAIRO_FILL )
cairo_fill( pCairo );
}
HB_FUNC( CAIRO_FILL_PRESERVE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -122,7 +114,6 @@ HB_FUNC( CAIRO_FILL_PRESERVE )
cairo_fill_preserve( pCairo );
}
HB_FUNC( CAIRO_GET_DASH )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -147,7 +138,6 @@ HB_FUNC( CAIRO_GET_DASH )
}
}
HB_FUNC( CAIRO_GET_LINE_WIDTH )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -156,7 +146,6 @@ HB_FUNC( CAIRO_GET_LINE_WIDTH )
hb_retnd( cairo_get_line_width( pCairo ) );
}
HB_FUNC( CAIRO_IN_FILL )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -165,7 +154,6 @@ HB_FUNC( CAIRO_IN_FILL )
hb_retl( cairo_in_fill( pCairo, hb_parnd( 2 ), hb_parnd( 3 ) ) );
}
HB_FUNC( CAIRO_IN_STROKE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -174,7 +162,6 @@ HB_FUNC( CAIRO_IN_STROKE )
hb_retl( cairo_in_stroke( pCairo, hb_parnd( 2 ), hb_parnd( 3 ) ) );
}
HB_FUNC( CAIRO_PAINT )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -183,7 +170,6 @@ HB_FUNC( CAIRO_PAINT )
cairo_paint( pCairo );
}
HB_FUNC( CAIRO_PAINT_WITH_ALPHA )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -192,7 +178,6 @@ HB_FUNC( CAIRO_PAINT_WITH_ALPHA )
cairo_paint_with_alpha( pCairo, hb_parnd( 2 ) );
}
HB_FUNC( CAIRO_RESET_CLIP )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -201,7 +186,6 @@ HB_FUNC( CAIRO_RESET_CLIP )
cairo_reset_clip( pCairo );
}
HB_FUNC( CAIRO_RESTORE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -210,7 +194,6 @@ HB_FUNC( CAIRO_RESTORE )
cairo_restore( pCairo );
}
HB_FUNC( CAIRO_SAVE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -219,7 +202,6 @@ HB_FUNC( CAIRO_SAVE )
cairo_save( pCairo );
}
HB_FUNC( CAIRO_SET_DASH )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -248,7 +230,6 @@ HB_FUNC( CAIRO_SET_DASH )
}
}
HB_FUNC( CAIRO_SET_FILL_RULE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -257,7 +238,6 @@ HB_FUNC( CAIRO_SET_FILL_RULE )
cairo_set_fill_rule( pCairo, ( cairo_fill_rule_t ) hb_parni( 2 ) );
}
HB_FUNC( CAIRO_SET_LINE_CAP )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -266,7 +246,6 @@ HB_FUNC( CAIRO_SET_LINE_CAP )
cairo_set_line_cap( pCairo, ( cairo_line_cap_t ) hb_parni( 2 ) );
}
HB_FUNC( CAIRO_SET_LINE_JOIN )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -275,7 +254,6 @@ HB_FUNC( CAIRO_SET_LINE_JOIN )
cairo_set_line_join( pCairo, ( cairo_line_join_t ) hb_parni( 2 ) );
}
HB_FUNC( CAIRO_SET_LINE_WIDTH )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -284,7 +262,6 @@ HB_FUNC( CAIRO_SET_LINE_WIDTH )
cairo_set_line_width( pCairo, hb_parnd( 2 ) );
}
HB_FUNC( CAIRO_SET_MITER_LIMIT )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -293,7 +270,6 @@ HB_FUNC( CAIRO_SET_MITER_LIMIT )
cairo_set_miter_limit( pCairo, hb_parnd( 2 ) );
}
HB_FUNC( CAIRO_SET_OPERATOR )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -302,7 +278,6 @@ HB_FUNC( CAIRO_SET_OPERATOR )
cairo_set_operator( pCairo, ( cairo_operator_t ) hb_parni( 2 ) );
}
HB_FUNC( CAIRO_SET_SOURCE_RGB )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -311,7 +286,6 @@ HB_FUNC( CAIRO_SET_SOURCE_RGB )
cairo_set_source_rgb( pCairo, hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ) );
}
HB_FUNC( CAIRO_SET_SOURCE_RGBA )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -320,7 +294,6 @@ HB_FUNC( CAIRO_SET_SOURCE_RGBA )
cairo_set_source_rgba( pCairo, hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ) );
}
HB_FUNC( CAIRO_SET_TOLERANCE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -337,7 +310,6 @@ HB_FUNC( CAIRO_SHOW_PAGE )
cairo_show_page( pCairo );
}
HB_FUNC( CAIRO_STROKE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -346,7 +318,6 @@ HB_FUNC( CAIRO_STROKE )
cairo_stroke( pCairo );
}
HB_FUNC( CAIRO_STATUS )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -355,7 +326,6 @@ HB_FUNC( CAIRO_STATUS )
hb_retni( cairo_status( pCairo ) );
}
HB_FUNC( CAIRO_STROKE_EXTENTS )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -374,7 +344,6 @@ HB_FUNC( CAIRO_STROKE_EXTENTS )
}
}
HB_FUNC( CAIRO_STROKE_PRESERVE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -383,7 +352,6 @@ HB_FUNC( CAIRO_STROKE_PRESERVE )
cairo_stroke_preserve( pCairo );
}
HB_FUNC( CAIRO_PUSH_GROUP )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -392,7 +360,6 @@ HB_FUNC( CAIRO_PUSH_GROUP )
cairo_push_group( pCairo );
}
HB_FUNC( CAIRO_POP_GROUP_TO_SOURCE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -401,7 +368,6 @@ HB_FUNC( CAIRO_POP_GROUP_TO_SOURCE )
cairo_pop_group_to_source( pCairo );
}
HB_FUNC( CAIRO_SET_SOURCE_SURFACE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -410,7 +376,6 @@ HB_FUNC( CAIRO_SET_SOURCE_SURFACE )
cairo_set_source_surface( pCairo, pSurface, hb_parnd( 3 ), hb_parnd( 4 ) );
}
HB_FUNC( CAIRO_SET_SOURCE )
{
cairo_t * pCairo = hb_cairo_param( 1 );

View File

@@ -48,8 +48,7 @@
#include "hbapiitm.h"
#include "hbapierr.h"
/* ============ cairo_t * support ============ */
/* --- cairo_t * support --- */
static HB_GARBAGE_FUNC( hb_cairo_destructor )
{
cairo_t ** ppCairo = ( cairo_t ** ) Cargo;
@@ -67,7 +66,6 @@ static const HB_GC_FUNCS s_gcCairoFuncs =
hb_gcDummyMark
};
cairo_t * hb_cairoItemGet( PHB_ITEM pItem )
{
cairo_t ** ppCairo = ( cairo_t ** ) hb_itemGetPtrGC( pItem, &s_gcCairoFuncs );
@@ -75,7 +73,6 @@ cairo_t * hb_cairoItemGet( PHB_ITEM pItem )
return ppCairo ? *ppCairo : NULL;
}
PHB_ITEM hb_cairoItemPut( PHB_ITEM pItem, cairo_t * pCairo )
{
cairo_t ** ppCairo = ( cairo_t ** ) hb_gcAllocate( sizeof( cairo_t * ), &s_gcCairoFuncs );
@@ -84,7 +81,6 @@ PHB_ITEM hb_cairoItemPut( PHB_ITEM pItem, cairo_t * pCairo )
return hb_itemPutPtrGC( pItem, ppCairo );
}
cairo_t * hb_cairo_param( int iParam )
{
cairo_t ** ppCairo = ( cairo_t ** ) hb_parptrGC( &s_gcCairoFuncs, iParam );
@@ -96,13 +92,11 @@ cairo_t * hb_cairo_param( int iParam )
return NULL;
}
void hb_cairo_ret( cairo_t * pCairo )
{
hb_cairoItemPut( hb_stackReturnItem(), pCairo );
}
HB_FUNC( CAIRO_DESTROY )
{
cairo_t ** ppCairo = ( cairo_t ** ) hb_parptrGC( &s_gcCairoFuncs, 1 );
@@ -116,8 +110,7 @@ HB_FUNC( CAIRO_DESTROY )
hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
/* ============ cairo_surface_t * support ============ */
/* --- cairo_surface_t * support --- */
static HB_GARBAGE_FUNC( hb_cairo_surface_destructor )
{
cairo_surface_t ** ppSurface = ( cairo_surface_t ** ) Cargo;
@@ -135,7 +128,6 @@ static const HB_GC_FUNCS s_gcSurfaceFuncs =
hb_gcDummyMark
};
cairo_surface_t * hb_cairoSurfaceItemGet( PHB_ITEM pItem )
{
cairo_surface_t ** ppSurface = ( cairo_surface_t ** ) hb_itemGetPtrGC( pItem, &s_gcSurfaceFuncs );
@@ -143,7 +135,6 @@ cairo_surface_t * hb_cairoSurfaceItemGet( PHB_ITEM pItem )
return ppSurface ? *ppSurface : NULL;
}
PHB_ITEM hb_cairoSurfaceItemPut( PHB_ITEM pItem, cairo_surface_t * pSurface )
{
cairo_surface_t ** ppSurface = ( cairo_surface_t ** ) hb_gcAllocate( sizeof( cairo_surface_t * ), &s_gcSurfaceFuncs );
@@ -152,7 +143,6 @@ PHB_ITEM hb_cairoSurfaceItemPut( PHB_ITEM pItem, cairo_surface_t * pSurface )
return hb_itemPutPtrGC( pItem, ppSurface );
}
void hb_cairoSurfaceStor( cairo_surface_t * pSurface, int iParam )
{
cairo_surface_t ** ppSurface = ( cairo_surface_t ** ) hb_gcAllocate( sizeof( cairo_surface_t * ), &s_gcSurfaceFuncs );
@@ -161,7 +151,6 @@ void hb_cairoSurfaceStor( cairo_surface_t * pSurface, int iParam )
hb_storptrGC( ppSurface, iParam );
}
cairo_surface_t * hb_cairo_surface_param( int iParam )
{
cairo_surface_t ** ppSurface = ( cairo_surface_t ** ) hb_parptrGC( &s_gcSurfaceFuncs, iParam );
@@ -173,13 +162,11 @@ cairo_surface_t * hb_cairo_surface_param( int iParam )
return NULL;
}
void hb_cairo_surface_ret( cairo_surface_t * pSurface )
{
hb_cairoSurfaceItemPut( hb_stackReturnItem(), pSurface );
}
HB_FUNC( CAIRO_SURFACE_DESTROY )
{
cairo_surface_t ** ppSurface = ( cairo_surface_t ** ) hb_parptrGC( &s_gcSurfaceFuncs, 1 );
@@ -193,8 +180,7 @@ HB_FUNC( CAIRO_SURFACE_DESTROY )
hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
/* ============ cairo_path_t * support ============ */
/* --- cairo_path_t * support --- */
static HB_GARBAGE_FUNC( hb_cairo_path_destructor )
{
cairo_path_t ** ppPath = ( cairo_path_t ** ) Cargo;
@@ -212,7 +198,6 @@ static const HB_GC_FUNCS s_gcPathFuncs =
hb_gcDummyMark
};
cairo_path_t * hb_cairoPathItemGet( PHB_ITEM pItem )
{
cairo_path_t ** ppPath = ( cairo_path_t ** ) hb_itemGetPtrGC( pItem, &s_gcPathFuncs );
@@ -220,7 +205,6 @@ cairo_path_t * hb_cairoPathItemGet( PHB_ITEM pItem )
return ppPath ? *ppPath : NULL;
}
PHB_ITEM hb_cairoPathItemPut( PHB_ITEM pItem, cairo_path_t * pPath )
{
cairo_path_t ** ppPath = ( cairo_path_t ** ) hb_gcAllocate( sizeof( cairo_path_t * ), &s_gcPathFuncs );
@@ -229,7 +213,6 @@ PHB_ITEM hb_cairoPathItemPut( PHB_ITEM pItem, cairo_path_t * pPath )
return hb_itemPutPtrGC( pItem, ppPath );
}
cairo_path_t * hb_cairo_path_param( int iParam )
{
cairo_path_t ** ppPath = ( cairo_path_t ** ) hb_parptrGC( &s_gcPathFuncs, iParam );
@@ -241,13 +224,11 @@ cairo_path_t * hb_cairo_path_param( int iParam )
return NULL;
}
void hb_cairo_path_ret( cairo_path_t * pPath )
{
hb_cairoPathItemPut( hb_stackReturnItem(), pPath );
}
HB_FUNC( CAIRO_PATH_DESTROY )
{
cairo_path_t ** ppPath = ( cairo_path_t ** ) hb_parptrGC( &s_gcPathFuncs, 1 );
@@ -261,13 +242,10 @@ HB_FUNC( CAIRO_PATH_DESTROY )
hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
/* --- cairo_path_t * iterator support --- */
/* ============ cairo_path_t * iterator support ============ */
/*
* NOTE: Path iterator functions are is not cairo functions.
* This is only a way to pass path data to .prg level
*/
/* NOTE: Path iterator functions are is not cairo functions.
This is only a way to pass path data to .prg level */
typedef struct
{
@@ -275,7 +253,6 @@ typedef struct
int iPos;
} HB_CAIRO_PATH_ITERATOR, * PHB_CAIRO_PATH_ITERATOR;
static HB_GARBAGE_FUNC( hb_cairo_path_iterator_destructor )
{
PHB_CAIRO_PATH_ITERATOR pIterator = ( PHB_CAIRO_PATH_ITERATOR ) Cargo;
@@ -287,7 +264,6 @@ static HB_GARBAGE_FUNC( hb_cairo_path_iterator_destructor )
}
}
static HB_GARBAGE_FUNC( hb_cairo_path_iterator_mark )
{
PHB_CAIRO_PATH_ITERATOR pIterator = ( PHB_CAIRO_PATH_ITERATOR ) Cargo;
@@ -296,14 +272,12 @@ static HB_GARBAGE_FUNC( hb_cairo_path_iterator_mark )
hb_gcMark( pIterator->ppPath );
}
static const HB_GC_FUNCS s_gcIteratorFuncs =
{
hb_cairo_path_iterator_destructor,
hb_cairo_path_iterator_mark
};
HB_FUNC( CAIRO_PATH_ITERATOR_CREATE )
{
cairo_path_t ** ppPath = ( cairo_path_t ** ) hb_parptrGC( &s_gcPathFuncs, 1 );
@@ -320,7 +294,6 @@ HB_FUNC( CAIRO_PATH_ITERATOR_CREATE )
hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( CAIRO_PATH_ITERATOR_DESTROY )
{
PHB_CAIRO_PATH_ITERATOR pIterator = ( PHB_CAIRO_PATH_ITERATOR ) hb_parptrGC( &s_gcIteratorFuncs, 1 );
@@ -334,7 +307,6 @@ HB_FUNC( CAIRO_PATH_ITERATOR_DESTROY )
hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( CAIRO_PATH_ITERATOR_NEXT )
{
PHB_CAIRO_PATH_ITERATOR pIterator = ( PHB_CAIRO_PATH_ITERATOR ) hb_parptrGC( &s_gcIteratorFuncs, 1 );
@@ -358,7 +330,6 @@ HB_FUNC( CAIRO_PATH_ITERATOR_NEXT )
hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( CAIRO_PATH_ITERATOR_GET_POINTS )
{
PHB_CAIRO_PATH_ITERATOR pIterator = ( PHB_CAIRO_PATH_ITERATOR ) hb_parptrGC( &s_gcIteratorFuncs, 1 );
@@ -366,18 +337,18 @@ HB_FUNC( CAIRO_PATH_ITERATOR_GET_POINTS )
if( pIterator && pIterator->ppPath && ( pPath = *( pIterator->ppPath ) ) != NULL )
{
cairo_path_data_t * pData;
if( pIterator->iPos < pPath->num_data && pIterator->iPos != -1 )
{
PHB_ITEM pItem, pArray;
cairo_path_data_t * pData;
PHB_ITEM pArray;
int i;
pData = pPath->data + pIterator->iPos;
pArray = hb_itemArrayNew( pData->header.length - 1 );
for( i = 1; i < pData->header.length; i++ )
{
hb_arrayNew( pItem = hb_arrayGetItemPtr( pArray, i ), 2 );
PHB_ITEM pItem = hb_arrayGetItemPtr( pArray, i );
hb_arrayNew( pItem, 2 );
hb_arraySetND( pItem, 1, pData[ i ].point.x );
hb_arraySetND( pItem, 2, pData[ i ].point.y );
}
@@ -390,7 +361,6 @@ HB_FUNC( CAIRO_PATH_ITERATOR_GET_POINTS )
hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( CAIRO_PATH_ITERATOR_SET_POINTS )
{
PHB_CAIRO_PATH_ITERATOR pIterator = ( PHB_CAIRO_PATH_ITERATOR ) hb_parptrGC( &s_gcIteratorFuncs, 1 );
@@ -399,20 +369,19 @@ HB_FUNC( CAIRO_PATH_ITERATOR_SET_POINTS )
if( pIterator && pIterator->ppPath && ( pPath = *( pIterator->ppPath ) ) != NULL && pArray )
{
cairo_path_data_t * pData;
HB_SIZE nLen;
nLen = hb_arrayLen( pArray );
if( pIterator->iPos < pPath->num_data && pIterator->iPos != -1 &&
( HB_SIZE ) pPath->data[ pIterator->iPos ].header.length == nLen + 1 )
{
PHB_ITEM pItem;
int i;
cairo_path_data_t * pData;
int i;
pData = pPath->data + pIterator->iPos;
for( i = 1; i < pData->header.length; i++ )
{
pItem = hb_arrayGetItemPtr( pArray, i );
PHB_ITEM pItem = hb_arrayGetItemPtr( pArray, i );
if( hb_arrayLen( pItem ) == 2 )
{
pData[ i ].point.x = hb_arrayGetND( pItem, 1 );

View File

@@ -44,10 +44,8 @@
*
*/
#include "hbcairo.h"
HB_FUNC( CAIRO_IMAGE_SURFACE_CREATE )
{
#ifdef CAIRO_HAS_IMAGE_SURFACE

View File

@@ -44,11 +44,9 @@
*
*/
#include "hbcairo.h"
#include "hbapistr.h"
HB_FUNC( CAIRO_APPEND_PATH )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -58,7 +56,6 @@ HB_FUNC( CAIRO_APPEND_PATH )
cairo_append_path( pCairo, pPath );
}
HB_FUNC( CAIRO_ARC )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -67,7 +64,6 @@ HB_FUNC( CAIRO_ARC )
cairo_arc( pCairo, hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ), hb_parnd( 6 ) );
}
HB_FUNC( CAIRO_ARC_NEGATIVE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -76,7 +72,6 @@ HB_FUNC( CAIRO_ARC_NEGATIVE )
cairo_arc_negative( pCairo, hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ), hb_parnd( 6 ) );
}
HB_FUNC( CAIRO_CLOSE_PATH )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -85,7 +80,6 @@ HB_FUNC( CAIRO_CLOSE_PATH )
cairo_close_path( pCairo );
}
HB_FUNC( CAIRO_COPY_PATH )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -94,7 +88,6 @@ HB_FUNC( CAIRO_COPY_PATH )
hb_cairo_path_ret( cairo_copy_path( pCairo ) );
}
HB_FUNC( CAIRO_COPY_PATH_FLAT )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -103,7 +96,6 @@ HB_FUNC( CAIRO_COPY_PATH_FLAT )
hb_cairo_path_ret( cairo_copy_path_flat( pCairo ) );
}
HB_FUNC( CAIRO_CURVE_TO )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -112,7 +104,6 @@ HB_FUNC( CAIRO_CURVE_TO )
cairo_curve_to( pCairo, hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ), hb_parnd( 6 ), hb_parnd( 7 ) );
}
HB_FUNC( CAIRO_GET_CURRENT_POINT )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -128,7 +119,6 @@ HB_FUNC( CAIRO_GET_CURRENT_POINT )
}
}
HB_FUNC( CAIRO_HAS_CURRENT_POINT )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -139,7 +129,6 @@ HB_FUNC( CAIRO_HAS_CURRENT_POINT )
}
}
HB_FUNC( CAIRO_LINE_TO )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -148,7 +137,6 @@ HB_FUNC( CAIRO_LINE_TO )
cairo_line_to( pCairo, hb_parnd( 2 ), hb_parnd( 3 ) );
}
HB_FUNC( CAIRO_MOVE_TO )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -157,7 +145,6 @@ HB_FUNC( CAIRO_MOVE_TO )
cairo_move_to( pCairo, hb_parnd( 2 ), hb_parnd( 3 ) );
}
HB_FUNC( CAIRO_NEW_PATH )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -166,7 +153,6 @@ HB_FUNC( CAIRO_NEW_PATH )
cairo_new_path( pCairo );
}
HB_FUNC( CAIRO_PATH_EXTENTS )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -185,7 +171,6 @@ HB_FUNC( CAIRO_PATH_EXTENTS )
}
}
HB_FUNC( CAIRO_RECTANGLE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -194,7 +179,6 @@ HB_FUNC( CAIRO_RECTANGLE )
cairo_rectangle( pCairo, hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ) );
}
HB_FUNC( CAIRO_REL_CURVE_TO )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -203,7 +187,6 @@ HB_FUNC( CAIRO_REL_CURVE_TO )
cairo_rel_curve_to( pCairo, hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ), hb_parnd( 6 ), hb_parnd( 7 ) );
}
HB_FUNC( CAIRO_REL_LINE_TO )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -212,7 +195,6 @@ HB_FUNC( CAIRO_REL_LINE_TO )
cairo_rel_line_to( pCairo, hb_parnd( 2 ), hb_parnd( 3 ) );
}
HB_FUNC( CAIRO_REL_MOVE_TO )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -221,7 +203,6 @@ HB_FUNC( CAIRO_REL_MOVE_TO )
cairo_rel_move_to( pCairo, hb_parnd( 2 ), hb_parnd( 3 ) );
}
HB_FUNC( CAIRO_TEXT_PATH )
{
cairo_t * pCairo = hb_cairo_param( 1 );

View File

@@ -44,13 +44,11 @@
*
*/
#include "hbcairo.h"
#include "hbapiitm.h"
#include "hbapierr.h"
/* ============ cairo_pattern_t * support ============ */
/* --- cairo_pattern_t * support --- */
static HB_GARBAGE_FUNC( hb_cairo_pattern_destructor )
{
cairo_pattern_t ** ppPattern = ( cairo_pattern_t ** ) Cargo;
@@ -62,14 +60,12 @@ static HB_GARBAGE_FUNC( hb_cairo_pattern_destructor )
}
}
static const HB_GC_FUNCS s_gcPatternFuncs =
{
hb_cairo_pattern_destructor,
hb_gcDummyMark
};
cairo_pattern_t * hb_cairoPatternItemGet( PHB_ITEM pItem )
{
cairo_pattern_t ** ppPattern = ( cairo_pattern_t ** ) hb_itemGetPtrGC( pItem, &s_gcPatternFuncs );
@@ -77,7 +73,6 @@ cairo_pattern_t * hb_cairoPatternItemGet( PHB_ITEM pItem )
return ppPattern ? *ppPattern : NULL;
}
PHB_ITEM hb_cairoPatternItemPut( PHB_ITEM pItem, cairo_pattern_t * pPattern )
{
cairo_pattern_t ** ppPattern = ( cairo_pattern_t ** ) hb_gcAllocate( sizeof( cairo_pattern_t * ), &s_gcPatternFuncs );
@@ -86,7 +81,6 @@ PHB_ITEM hb_cairoPatternItemPut( PHB_ITEM pItem, cairo_pattern_t * pPattern )
return hb_itemPutPtrGC( pItem, ppPattern );
}
cairo_pattern_t * hb_cairo_pattern_param( int iParam )
{
cairo_pattern_t ** ppPattern = ( cairo_pattern_t ** ) hb_parptrGC( &s_gcPatternFuncs, iParam );
@@ -98,13 +92,11 @@ cairo_pattern_t * hb_cairo_pattern_param( int iParam )
return NULL;
}
void hb_cairo_pattern_ret( cairo_pattern_t * pPattern )
{
hb_cairoPatternItemPut( hb_stackReturnItem(), pPattern );
}
HB_FUNC( CAIRO_PATTERN_DESTROY )
{
cairo_pattern_t ** ppPattern = ( cairo_pattern_t ** ) hb_parptrGC( &s_gcPatternFuncs, 1 );
@@ -118,7 +110,6 @@ HB_FUNC( CAIRO_PATTERN_DESTROY )
hb_errRT_BASE( EG_ARG, 3012, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
}
HB_FUNC( CAIRO_PATTERN_ADD_COLOR_STOP_RGB )
{
cairo_pattern_t * pPattern = hb_cairo_pattern_param( 1 );
@@ -127,7 +118,6 @@ HB_FUNC( CAIRO_PATTERN_ADD_COLOR_STOP_RGB )
cairo_pattern_add_color_stop_rgb( pPattern, hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ) );
}
HB_FUNC( CAIRO_PATTERN_ADD_COLOR_STOP_RGBA )
{
cairo_pattern_t * pPattern = hb_cairo_pattern_param( 1 );
@@ -136,7 +126,6 @@ HB_FUNC( CAIRO_PATTERN_ADD_COLOR_STOP_RGBA )
cairo_pattern_add_color_stop_rgba( pPattern, hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ), hb_parnd( 6 ) );
}
HB_FUNC( CAIRO_PATTERN_GET_COLOR_STOP_COUNT )
{
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE( 1, 4, 0 )
@@ -157,7 +146,6 @@ HB_FUNC( CAIRO_PATTERN_GET_COLOR_STOP_COUNT )
#endif
}
HB_FUNC( CAIRO_PATTERN_GET_COLOR_STOP_RGBA )
{
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE( 1, 4, 0 )
@@ -187,19 +175,16 @@ HB_FUNC( CAIRO_PATTERN_GET_COLOR_STOP_RGBA )
#endif
}
HB_FUNC( CAIRO_PATTERN_CREATE_RGB )
{
hb_cairo_pattern_ret( cairo_pattern_create_rgb( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ) ) );
}
HB_FUNC( CAIRO_PATTERN_CREATE_RGBA )
{
hb_cairo_pattern_ret( cairo_pattern_create_rgba( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 3 ) ) );
}
HB_FUNC( CAIRO_PATTERN_GET_RGBA )
{
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE( 1, 4, 0 )
@@ -227,13 +212,11 @@ HB_FUNC( CAIRO_PATTERN_GET_RGBA )
#endif
}
HB_FUNC( CAIRO_PATTERN_CREATE_FOR_SURFACE )
{
hb_cairo_pattern_ret( cairo_pattern_create_for_surface( hb_cairo_surface_param( 1 ) ) );
}
HB_FUNC( CAIRO_PATTERN_GET_SURFACE )
{
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE( 1, 4, 0 )
@@ -255,13 +238,11 @@ HB_FUNC( CAIRO_PATTERN_GET_SURFACE )
#endif
}
HB_FUNC( CAIRO_PATTERN_CREATE_LINEAR )
{
hb_cairo_pattern_ret( cairo_pattern_create_linear( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ) ) );
}
HB_FUNC( CAIRO_PATTERN_GET_LINEAR_POINTS )
{
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE( 1, 4, 0 )
@@ -289,13 +270,11 @@ HB_FUNC( CAIRO_PATTERN_GET_LINEAR_POINTS )
#endif
}
HB_FUNC( CAIRO_PATTERN_CREATE_RADIAL )
{
hb_cairo_pattern_ret( cairo_pattern_create_radial( hb_parnd( 1 ), hb_parnd( 2 ), hb_parnd( 3 ), hb_parnd( 4 ), hb_parnd( 5 ), hb_parnd( 6 ) ) );
}
HB_FUNC( CAIRO_PATTERN_GET_RADIAL_CIRCLES )
{
#if CAIRO_VERSION >= CAIRO_VERSION_ENCODE( 1, 4, 0 )
@@ -327,7 +306,6 @@ HB_FUNC( CAIRO_PATTERN_GET_RADIAL_CIRCLES )
#endif
}
HB_FUNC( CAIRO_PATTERN_STATUS )
{
cairo_pattern_t * pPattern = hb_cairo_pattern_param( 1 );

View File

@@ -44,11 +44,9 @@
*
*/
#include "hbcairo.h"
#include "cairo-pdf.h"
HB_FUNC( CAIRO_PDF_SURFACE_CREATE )
{
#ifdef CAIRO_HAS_PDF_SURFACE
@@ -58,7 +56,6 @@ HB_FUNC( CAIRO_PDF_SURFACE_CREATE )
#endif
}
HB_FUNC( CAIRO_PDF_SURFACE_SET_SIZE )
{
#ifdef CAIRO_HAS_PDF_SURFACE

View File

@@ -44,10 +44,8 @@
*
*/
#include "hbcairo.h"
HB_FUNC( CAIRO_IMAGE_SURFACE_CREATE_FROM_PNG )
{
#ifdef CAIRO_HAS_PNG_FUNCTIONS
@@ -57,7 +55,6 @@ HB_FUNC( CAIRO_IMAGE_SURFACE_CREATE_FROM_PNG )
#endif
}
HB_FUNC( CAIRO_SURFACE_WRITE_TO_PNG )
{
#ifdef CAIRO_HAS_PNG_FUNCTIONS

View File

@@ -44,11 +44,9 @@
*
*/
#include "hbcairo.h"
#include "cairo-ps.h"
HB_FUNC( CAIRO_PS_SURFACE_CREATE )
{
#ifdef CAIRO_HAS_PS_SURFACE
@@ -58,7 +56,6 @@ HB_FUNC( CAIRO_PS_SURFACE_CREATE )
#endif
}
HB_FUNC( CAIRO_PS_SURFACE_SET_SIZE )
{
#ifdef CAIRO_HAS_PS_SURFACE
@@ -71,7 +68,6 @@ HB_FUNC( CAIRO_PS_SURFACE_SET_SIZE )
#endif
}
HB_FUNC( CAIRO_PS_SURFACE_SET_EPS )
{
#ifdef CAIRO_HAS_PS_SURFACE
@@ -84,7 +80,6 @@ HB_FUNC( CAIRO_PS_SURFACE_SET_EPS )
#endif
}
HB_FUNC( CAIRO_PS_SURFACE_GET_EPS )
{
#ifdef CAIRO_HAS_PS_SURFACE

View File

@@ -44,10 +44,8 @@
*
*/
#include "hbcairo.h"
HB_FUNC( CAIRO_SURFACE_STATUS )
{
cairo_surface_t * pSurface = hb_cairo_surface_param( 1 );

View File

@@ -44,12 +44,10 @@
*
*/
#include "hbcairo.h"
#include "hbapistr.h"
#include "hbapierr.h"
HB_FUNC( CAIRO_FONT_EXTENTS )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -69,7 +67,6 @@ HB_FUNC( CAIRO_FONT_EXTENTS )
}
}
HB_FUNC( CAIRO_GET_FONT_MATRIX )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -90,7 +87,6 @@ HB_FUNC( CAIRO_GET_FONT_MATRIX )
}
}
HB_FUNC( CAIRO_SELECT_FONT_FACE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -103,7 +99,6 @@ HB_FUNC( CAIRO_SELECT_FONT_FACE )
}
}
HB_FUNC( CAIRO_SET_FONT_MATRIX )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -128,7 +123,6 @@ HB_FUNC( CAIRO_SET_FONT_MATRIX )
}
}
HB_FUNC( CAIRO_SET_FONT_SIZE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -137,7 +131,6 @@ HB_FUNC( CAIRO_SET_FONT_SIZE )
cairo_set_font_size( pCairo, hb_parnd( 2 ) );
}
HB_FUNC( CAIRO_SHOW_TEXT )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -150,7 +143,6 @@ HB_FUNC( CAIRO_SHOW_TEXT )
}
}
HB_FUNC( CAIRO_TEXT_EXTENTS )
{
cairo_t * pCairo = hb_cairo_param( 1 );

View File

@@ -44,12 +44,10 @@
*
*/
#include "hbcairo.h"
#include "hbapiitm.h"
#include "hbapierr.h"
HB_FUNC( CAIRO_GET_MATRIX )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -70,7 +68,6 @@ HB_FUNC( CAIRO_GET_MATRIX )
}
}
HB_FUNC( CAIRO_IDENTITY_MATRIX )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -79,7 +76,6 @@ HB_FUNC( CAIRO_IDENTITY_MATRIX )
cairo_identity_matrix( pCairo );
}
HB_FUNC( CAIRO_ROTATE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -88,7 +84,6 @@ HB_FUNC( CAIRO_ROTATE )
cairo_rotate( pCairo, hb_parnd( 2 ) );
}
HB_FUNC( CAIRO_SET_MATRIX )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -113,7 +108,6 @@ HB_FUNC( CAIRO_SET_MATRIX )
}
}
HB_FUNC( CAIRO_SCALE )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -122,7 +116,6 @@ HB_FUNC( CAIRO_SCALE )
cairo_scale( pCairo, hb_parnd( 2 ), hb_parnd( 3 ) );
}
HB_FUNC( CAIRO_TRANSFORM )
{
cairo_t * pCairo = hb_cairo_param( 1 );
@@ -147,7 +140,6 @@ HB_FUNC( CAIRO_TRANSFORM )
}
}
HB_FUNC( CAIRO_TRANSLATE )
{
cairo_t * pCairo = hb_cairo_param( 1 );

View File

@@ -44,22 +44,18 @@
*
*/
#include "hbcairo.h"
HB_FUNC( CAIRO_STATUS_TO_STRING )
{
hb_retc( cairo_status_to_string( ( cairo_status_t ) hb_parni( 1 ) ) );
}
HB_FUNC( CAIRO_VERSION )
{
hb_retni( cairo_version() );
}
HB_FUNC( CAIRO_VERSION_STRING )
{
hb_retc( cairo_version_string() );

View File

@@ -62,8 +62,7 @@ typedef struct _HB_FILE
HB_MAXINT timeout;
HB_BOOL fRead;
HB_BOOL fWrite;
}
HB_FILE;
} HB_FILE;
static PHB_FILE s_fileNew( int port, HB_MAXINT timeout, HB_BOOL fRead, HB_BOOL fWrite );

View File

@@ -87,11 +87,10 @@ HB_FUNC( ADDASCII )
if( iCarryOver )
{
HB_SIZE sCurrent;
HB_LONG lResult;
for( sCurrent = sPos; sCurrent > 0 && lValue != 0; sCurrent-- )
{
lResult = ( HB_LONG ) pcSource[ sCurrent - 1 ] + ( lValue % 256 );
HB_LONG lResult = ( HB_LONG ) pcSource[ sCurrent - 1 ] + ( lValue % 256 );
lValue /= 256;
if( lResult > 255 )

View File

@@ -1,6 +1,5 @@
/*
* CT3 string functions
*
* - AfterAtNum()
* - BeforAtNum()
* - AtNum()

View File

@@ -99,10 +99,10 @@ HB_FUNC( ATREPL )
if( nCounter != 0 )
{
/* depending on iReplaceMode: replace all occurences including the nth one
or only the nth occurence
NOTE: if iReplaceMode = false and the nth occurence does not exist,
all occurences are replaced */
/* depending on iReplaceMode: replace all occurrences including the nth one
or only the nth occurrence
NOTE: if iReplaceMode = false and the nth occurrence does not exist,
all occurrences are replaced */
char * pcRetSubStr;
HB_SIZE sRetSubStrLen;
HB_SIZE nMatchCounter = 0;
@@ -141,7 +141,7 @@ HB_FUNC( ATREPL )
nMatchCounter++;
/* replace match ? */
if( ( iReplaceMode == 0 ) || ( nMatchCounter == nCounter ) )
if( iReplaceMode == 0 || nMatchCounter == nCounter )
{
if( nMatchStrLen < nReplaceLen )
{

View File

@@ -89,11 +89,13 @@ HB_BOOL ct_numParam( int iParam, HB_MAXINT * plNum )
HB_FUNC( NUMAND )
{
int iPCount = hb_pcount(), i = 1;
int iPCount = hb_pcount();
HB_MAXINT lValue = -1, lNext = 0;
if( iPCount && ct_numParam( 1, &lValue ) )
{
int i = 1;
while( --iPCount && ct_numParam( ++i, &lNext ) )
lValue &= lNext;
@@ -105,11 +107,13 @@ HB_FUNC( NUMAND )
HB_FUNC( NUMOR )
{
int iPCount = hb_pcount(), i = 1;
int iPCount = hb_pcount();
HB_MAXINT lValue = -1, lNext = 0;
if( iPCount && ct_numParam( 1, &lValue ) )
{
int i = 1;
while( --iPCount && ct_numParam( ++i, &lNext ) )
lValue |= lNext;
@@ -121,11 +125,13 @@ HB_FUNC( NUMOR )
HB_FUNC( NUMXOR )
{
int iPCount = hb_pcount(), i = 1;
int iPCount = hb_pcount();
HB_MAXINT lValue = -1, lNext = 0;
if( iPCount && ct_numParam( 1, &lValue ) )
{
int i = 1;
while( --iPCount && ct_numParam( ++i, &lNext ) )
lValue ^= lNext;
@@ -218,14 +224,16 @@ HB_FUNC( NUMMIRR )
HB_FUNC( CLEARBIT )
{
int iPCount = hb_pcount(), iBit, i = 1;
int iPCount = hb_pcount();
HB_MAXINT lValue;
if( ct_numParam( 1, &lValue ) )
{
int i = 1;
while( --iPCount )
{
iBit = hb_parni( ++i );
int iBit = hb_parni( ++i );
if( iBit < 1 || iBit > 64 )
break;
lValue &= ~( ( ( HB_MAXINT ) 1 ) << ( iBit - 1 ) );
@@ -240,14 +248,16 @@ HB_FUNC( CLEARBIT )
HB_FUNC( SETBIT )
{
int iPCount = hb_pcount(), iBit, i = 1;
int iPCount = hb_pcount();
HB_MAXINT lValue;
if( ct_numParam( 1, &lValue ) )
{
int i = 1;
while( --iPCount )
{
iBit = hb_parni( ++i );
int iBit = hb_parni( ++i );
if( iBit < 1 || iBit > 64 )
break;
lValue |= ( ( HB_MAXINT ) 1 ) << ( iBit - 1 );

View File

@@ -49,14 +49,17 @@
HB_FUNC( CTOBIT )
{
HB_SIZE nString = hb_parclen( 1 ), nPattern, n;
HB_SIZE nString = hb_parclen( 1 );
int iResult = 0;
if( nString > 0 )
{
nPattern = hb_parclen( 2 );
HB_SIZE nPattern = hb_parclen( 2 );
if( nPattern >= 1 && nPattern <= 16 )
{
HB_SIZE n;
const char * pszString = hb_parc( 1 ),
* pszPattern = hb_parc( 2 );
@@ -101,7 +104,7 @@ HB_FUNC( BITTOC )
{
while( nPattern-- > 0 )
{
*--pszResult = iValue & 1 ? pszPattern[ nPattern ] : ' ';
*--pszResult = ( iValue & 1 ) ? pszPattern[ nPattern ] : ' ';
++iLen;
iValue >>= 1;
}

View File

@@ -2,7 +2,6 @@
* CT3 Blank() function
*
* Copyright 2009 Pavel Tsarenko <tpe2@mail.ru>
* http://www.xharbour.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -91,7 +90,8 @@ HB_FUNC( BLANK )
HB_SIZE nLen = hb_itemGetCLen( pItem );
char * szResult = ( char * ) hb_xgrab( nLen + 1 );
hb_xmemset( szResult, ' ', nLen );
if( nLen > 0 )
hb_xmemset( szResult, ' ', nLen );
if( bRef )
hb_storclen( szResult, nLen, 1 );
if( bRet )

View File

@@ -49,12 +49,12 @@
#include "ct.h"
HB_FUNC( CHARSLIST ) /* HB_EXTENSION */
HB_FUNC( CHARSLIST ) /* HB_EXTENSION */
{
ct_charlist( CT_CHARLIST_CHARSLIST );
}
HB_FUNC( CHARHIST ) /* HB_EXTENSION */
HB_FUNC( CHARHIST ) /* HB_EXTENSION */
{
ct_charlist( CT_CHARLIST_CHARHIST );
}

View File

@@ -106,7 +106,6 @@ void ct_charlist( int iMode )
if( acCharCnt[ sCnt ] == cScan )
acCharCnt[ sRetStrLen++ ] = ( HB_UCHAR ) sCnt;
}
}
hb_retclen( acCharCnt, sRetStrLen );
}

View File

@@ -82,7 +82,7 @@ HB_FUNC( CHARMIRR )
if( iDontMirrorSpaces )
{
pc2 = pcRet + sStrLen - 1;
while( ( pc1 >= pcString ) && ( *pc1 == 0x20 ) )
while( pc1 >= pcString && *pc1 == 0x20 )
{
*pc2 = 0x20;
pc1--;

View File

@@ -1,10 +1,9 @@
/*
* CharMix() CT3 function
*
* Initial code: Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
*
* CT3 conformity: Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
* Author: Martin Vogel <vogel@inttec.de>
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour) (Initial code)
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
* Author: Martin Vogel <vogel@inttec.de> (CT3 conformity)
*
* 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

View File

@@ -56,14 +56,14 @@
/* helper function for the *one functions */
static void do_charone( int iSwitch )
{
const char * pcString;
HB_SIZE sStrLen;
const char * pcDeleteSet;
HB_SIZE sDeleteSetLen;
/* param check */
if( HB_ISCHAR( 1 ) )
{
const char * pcString;
const char * pcDeleteSet;
HB_SIZE sStrLen;
HB_SIZE sDeleteSetLen;
if( HB_ISCHAR( 2 ) )
{
pcString = hb_parc( 2 );
@@ -161,7 +161,7 @@ static void do_charone( int iSwitch )
}
}
/* copy last character if string len is odd */
/* copy last character if string length is odd */
if( sStrLen & 1 )
pcRet[ sRetStrLen++ ] = pcString[ sStrLen - 1 ];

View File

@@ -69,10 +69,10 @@ static void do_charonly( int iSwitch )
HB_SIZE sOnlySetLen = hb_parclen( 1 );
char * pcRet;
HB_SIZE sRetStrLen = 0;
int iShift, iBool;
const char * pcSub, * pc;
int iShift;
const char * pcSub;
/* check for zero-length strings */
/* check for zero-length strings */
switch( iSwitch )
{
case DO_CHARONLY_CHARONLY:
@@ -109,19 +109,17 @@ static void do_charonly( int iSwitch )
for( pcSub = pcString; pcSub < pcString + sStrLen + 1 - iShift; pcSub += iShift )
{
pc = ct_at_exact_forward( pcOnlySet, sOnlySetLen, pcSub, iShift, NULL );
iBool = ( ( pc != NULL ) && ( ( ( pc - pcOnlySet ) % iShift ) == 0 ) );
if( iBool ? ( iSwitch == DO_CHARONLY_CHARONLY ||
iSwitch == DO_CHARONLY_WORDONLY )
: ( iSwitch == DO_CHARONLY_CHARREM ||
iSwitch == DO_CHARONLY_WORDREM ) )
const char * pc = ct_at_exact_forward( pcOnlySet, sOnlySetLen, pcSub, iShift, NULL );
HB_BOOL fBool = ( pc != NULL && ( ( pc - pcOnlySet ) % iShift ) == 0 );
if( fBool ? iSwitch == DO_CHARONLY_CHARONLY || iSwitch == DO_CHARONLY_WORDONLY
: iSwitch == DO_CHARONLY_CHARREM || iSwitch == DO_CHARONLY_WORDREM )
{
for( pc = pcSub; pc < pcSub + iShift; pc++ )
pcRet[ sRetStrLen++ ] = *pc;
}
}
/* copy last character if string len is odd */
/* copy last character if string length is odd */
if( iShift == 2 && sStrLen % 2 == 1 )
pcRet[ sRetStrLen++ ] = pcString[ sStrLen - 1 ];
@@ -131,10 +129,12 @@ static void do_charonly( int iSwitch )
else
{
PHB_ITEM pSubst = NULL;
int iArgErrorMode = ct_getargerrormode(), iError = 0;
int iArgErrorMode = ct_getargerrormode();
if( iArgErrorMode != CT_ARGERR_IGNORE )
{
int iError = 0;
switch( iSwitch )
{
case DO_CHARONLY_CHARONLY:

View File

@@ -295,10 +295,11 @@ void ct_charop( int iMode )
{
PHB_ITEM pSubst = NULL;
int iArgErrorMode = ct_getargerrormode();
int iError = 0;
if( iArgErrorMode != CT_ARGERR_IGNORE )
{
int iError = 0;
switch( iMode )
{
case CT_CHAROP_CHARADD:

View File

@@ -52,27 +52,27 @@
#include "ct.h"
HB_FUNC( CHARSUB ) /* HB_EXTENSION */
HB_FUNC( CHARSUB ) /* HB_EXTENSION */
{
ct_charop( CT_CHAROP_CHARSUB );
}
HB_FUNC( CHARSHL ) /* HB_EXTENSION */
HB_FUNC( CHARSHL ) /* HB_EXTENSION */
{
ct_charop( CT_CHAROP_CHARSHL );
}
HB_FUNC( CHARSHR ) /* HB_EXTENSION */
HB_FUNC( CHARSHR ) /* HB_EXTENSION */
{
ct_charop( CT_CHAROP_CHARSHR );
}
HB_FUNC( CHARRLL ) /* HB_EXTENSION */
HB_FUNC( CHARRLL ) /* HB_EXTENSION */
{
ct_charop( CT_CHAROP_CHARRLL );
}
HB_FUNC( CHARRLR ) /* HB_EXTENSION */
HB_FUNC( CHARRLR ) /* HB_EXTENSION */
{
ct_charop( CT_CHAROP_CHARRLR );
}

View File

@@ -83,7 +83,6 @@ HB_FUNC( CHARREPL )
for( sIndex = 0; sIndex < sSearchLen; sIndex++ )
{
HB_SIZE sMatchStrLen;
const char * pc;
HB_SIZE sReplIndex = sIndex;
if( sReplIndex > sReplaceLen - 1 )
@@ -93,7 +92,7 @@ HB_FUNC( CHARREPL )
{
/* no multiple replacements: searching in pcString,
replacing in pcRet */
pc = pcString;
const char * pc = pcString;
while( ( pc = ct_at_exact_forward( pc, sStrLen - ( pc - pcString ),
pcSearch + sIndex, 1,

View File

@@ -54,7 +54,7 @@
#define DO_CHARSWAP_WORDSWAP 1
#define DO_CHARSWAP_WORDSWAP_CHARSWAP 2
/* helper function for the charswap and wordswap functions */
/* helper function for the CharSwap() and WordSwap() functions */
static void do_charswap( int iSwitch )
{
/* suppress return value ? */

View File

@@ -80,11 +80,12 @@ HB_FUNC( COLORTON )
HB_FUNC( NTOCOLOR )
{
char szColorString[ 10 ];
int iColor = hb_parnidef( 1, -1 );
if( iColor >= 0x00 && iColor <= 0xff )
{
char szColorString[ 10 ];
if( hb_parl( 2 ) )
hb_gtColorsToString( &iColor, 1, szColorString, sizeof( szColorString ) );
else

View File

@@ -51,7 +51,7 @@
#define DO_COUNT_COUNTLEFT 0
#define DO_COUNT_COUNTRIGHT 1
/* helper function for the countxxx functions */
/* helper function for the Count*() functions */
static void do_count( int iSwitch )
{
/* param check */
@@ -76,7 +76,7 @@ static void do_count( int iSwitch )
{
case DO_COUNT_COUNTLEFT:
pc = pcString;
while( ( *pc == cSearch ) && ( pc < pcString + sStrLen ) )
while( *pc == cSearch && pc < ( pcString + sStrLen ) )
{
sRetVal++;
pc++;
@@ -85,7 +85,7 @@ static void do_count( int iSwitch )
case DO_COUNT_COUNTRIGHT:
pc = pcString + sStrLen - 1;
while( ( *pc == cSearch ) && ( pc >= pcString ) )
while( *pc == cSearch && pc >= pcString )
{
sRetVal++;
pc--;

View File

@@ -45,12 +45,11 @@
*
*/
#ifndef _CT_CH
#define _CT_CH 1
/* subsystem name */
#define CT_SUBSYSTEM "CT"
#define CT_SUBSYSTEM "CT"
/* CSetArgErr() argument error behaviour */
#include "error.ch"

View File

@@ -1,5 +1,5 @@
/*
* constant values for CT3 serial communication com_*() functions
* Constant values for CT3 serial communication com_*() functions
*
* Copyright 2010 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
*

View File

@@ -77,63 +77,63 @@ static void hb_ctComTestMSR( int iLine )
hb_retl( fResult );
}
/* com_Count( <nComPort> ) -> <nCharactersInInputBuffer>
/* com_Count( <nComPort> ) --> <nCharactersInInputBuffer>
*/
HB_FUNC( COM_COUNT )
{
hb_retni( hb_comInputCount( hb_parni( 1 ) ) );
}
/* com_SCount( <nComPort> ) -> <nCharactersInOutputBuffer>
/* com_SCount( <nComPort> ) --> <nCharactersInOutputBuffer>
*/
HB_FUNC( COM_SCOUNT )
{
hb_retni( hb_comOutputCount( hb_parni( 1 ) ) );
}
/* com_Flush( <nComPort> ) -> <lInputBufferCleared>
/* com_Flush( <nComPort> ) --> <lInputBufferCleared>
*/
HB_FUNC( COM_FLUSH )
{
hb_retl( hb_comFlush( hb_parni( 1 ), HB_COM_IFLUSH ) != -1 );
}
/* com_SFlush( <nComPort> ) -> <lOutputBufferCleared>
/* com_SFlush( <nComPort> ) --> <lOutputBufferCleared>
*/
HB_FUNC( COM_SFLUSH )
{
hb_retl( hb_comFlush( hb_parni( 1 ), HB_COM_OFLUSH ) != -1 );
}
/* com_CTS( <nComPort> ) -> <lCTSActive>
/* com_CTS( <nComPort> ) --> <lCTSActive>
*/
HB_FUNC( COM_CTS )
{
hb_ctComTestMSR( HB_COM_MSR_CTS );
}
/* com_DCD( <nComPort> ) -> <lDCDActive>
/* com_DCD( <nComPort> ) --> <lDCDActive>
*/
HB_FUNC( COM_DCD )
{
hb_ctComTestMSR( HB_COM_MSR_DCD );
}
/* com_DSR( <nComPort> ) -> <lDSRActive>
/* com_DSR( <nComPort> ) --> <lDSRActive>
*/
HB_FUNC( COM_DSR )
{
hb_ctComTestMSR( HB_COM_MSR_DSR );
}
/* com_Ring( <nComPort> ) -> <lActiveRing>
/* com_Ring( <nComPort> ) --> <lActiveRing>
*/
HB_FUNC( COM_RING )
{
hb_ctComTestMSR( HB_COM_MSR_RI );
}
/* com_RTS( <nComPort>, [<lNewRTSStatus>] ) -> <lOldRTSStatus>
/* com_RTS( <nComPort>, [<lNewRTSStatus>] ) --> <lOldRTSStatus>
*/
HB_FUNC( COM_RTS )
{
@@ -150,7 +150,7 @@ HB_FUNC( COM_RTS )
hb_retl( ( iMCR & HB_COM_MCR_RTS ) != 0 );
}
/* com_DTR( <nComPort>, [<lNewDTRStatus>] ) -> <lOldDTRStatus>
/* com_DTR( <nComPort>, [<lNewDTRStatus>] ) --> <lOldDTRStatus>
*/
HB_FUNC( COM_DTR )
{
@@ -167,7 +167,7 @@ HB_FUNC( COM_DTR )
hb_retl( ( iMCR & HB_COM_MCR_DTR ) != 0 );
}
/* com_MCR( <nComPort>, [<nMCR>] ) -> <nMCR> (MCR_*)
/* com_MCR( <nComPort>, [<nMCR>] ) --> <nMCR> (MCR_*)
*/
HB_FUNC( COM_MCR )
{
@@ -187,7 +187,7 @@ HB_FUNC( COM_MCR )
hb_retni( iMCR );
}
/* com_MSR( <nComPort> ) -> <nMSR> (MSR_*)
/* com_MSR( <nComPort> ) --> <nMSR> (MSR_*)
*/
HB_FUNC( COM_MSR )
{
@@ -199,7 +199,7 @@ HB_FUNC( COM_MSR )
hb_retni( iMSR );
}
/* com_LSR( <nComPort> ) -> <nLSR> (LSR_*)
/* com_LSR( <nComPort> ) --> <nLSR> (LSR_*)
*/
HB_FUNC( COM_LSR )
{
@@ -211,14 +211,14 @@ HB_FUNC( COM_LSR )
hb_retni( iLSR );
}
/* com_Break( <nComPort>, <nDurationInMilliSecs>=100 ) -> <lSuccess>
/* com_Break( <nComPort>, <nDurationInMilliSecs>=100 ) --> <lSuccess>
*/
HB_FUNC( COM_BREAK )
{
hb_retl( hb_comSendBreak( hb_parni( 1 ), hb_parnidef( 2, 100 ) ) != 0 );
}
/* com_Hard( <nComPort>, [<lNewHandshake>], [<lDTR/DSR>] ) -> <lOldHandshake>
/* com_Hard( <nComPort>, [<lNewHandshake>], [<lDTR/DSR>] ) --> <lOldHandshake>
*/
HB_FUNC( COM_HARD )
{
@@ -244,7 +244,7 @@ HB_FUNC( COM_HARD )
}
/* com_Soft( <nComPort>, [<lNewHandshake>],
[<cXONchar>], [<cXOFFchar>] ) -> <lOldHandshake>
[<cXONchar>], [<cXOFFchar>] ) --> <lOldHandshake>
*/
HB_FUNC( COM_SOFT )
{
@@ -270,7 +270,7 @@ HB_FUNC( COM_SOFT )
hb_retl( fResult );
}
/* com_Soft_R( <nComPort>, [<lXOFFFlag>] ) -> <lXOFFFlag>
/* com_Soft_R( <nComPort>, [<lXOFFFlag>] ) --> <lXOFFFlag>
*/
HB_FUNC( COM_SOFT_R )
{
@@ -288,7 +288,7 @@ HB_FUNC( COM_SOFT_R )
hb_retl( fResult );
}
/* com_Soft_S( <nComPort> ) -> <lXOFFFlag>
/* com_Soft_S( <nComPort> ) --> <lXOFFFlag>
*/
HB_FUNC( COM_SOFT_S )
{
@@ -301,21 +301,21 @@ HB_FUNC( COM_SOFT_S )
hb_retl( fResult );
}
/* com_ErrChr( <nComPort>, [<nErrorCharacter|cErrorCharacter>] ) -> <lChanged>
/* com_ErrChr( <nComPort>, [<nErrorCharacter|cErrorCharacter>] ) --> <lChanged>
*/
HB_FUNC( COM_ERRCHR )
{
hb_retl( hb_comErrorChar( hb_parni( 1 ), hb_ctComCharParam( 2 ) ) != -1 );
}
/* com_Remote( <nComPort>, [<nCharacter|cCharacter>] ) -> <lActive>
/* com_Remote( <nComPort>, [<nCharacter|cCharacter>] ) --> <lActive>
*/
HB_FUNC( COM_REMOTE )
{
hb_retl( hb_comDiscardChar( hb_parni( 1 ), hb_ctComCharParam( 2 ) ) > 0 );
}
/* com_SMode( <nComPort> ) -> <nSendMode>
/* com_SMode( <nComPort> ) --> <nSendMode>
*/
HB_FUNC( COM_SMODE )
{
@@ -336,7 +336,7 @@ HB_FUNC( COM_SMODE )
hb_retni( iResult );
}
/* com_Event( <nComPort>, <nMode> ) -> <nCode>
/* com_Event( <nComPort>, <nMode> ) --> <nCode>
*/
HB_FUNC( COM_EVENT )
{
@@ -344,7 +344,7 @@ HB_FUNC( COM_EVENT )
hb_retni( 0 );
}
/* com_Key( <nComPort>, [<nKeyValue1>], [<nKeyValue2>] ) -> <lActive>
/* com_Key( <nComPort>, [<nKeyValue1>], [<nKeyValue2>] ) --> <lActive>
*/
HB_FUNC( COM_KEY )
{
@@ -353,7 +353,7 @@ HB_FUNC( COM_KEY )
}
/* com_SKey( [<nComPort>], [<nKeyValue1|cKeyValue1>],
* [<nKeyValue2|cKeyValue2>] ) -> <lActive>
* [<nKeyValue2|cKeyValue2>] ) --> <lActive>
*/
HB_FUNC( COM_SKEY )
{
@@ -362,7 +362,7 @@ HB_FUNC( COM_SKEY )
}
/* com_Init( <nComPort>, [<nBaudRate>=300], [<cParity:E,O,M,S,N>=N],
* [<nDataLength:7,8>=8], [<nStopBits:1,2>=1] ) -> <lInitialized>
* [<nDataLength:7,8>=8], [<nStopBits:1,2>=1] ) --> <lInitialized>
*/
HB_FUNC( COM_INIT )
{
@@ -376,7 +376,7 @@ HB_FUNC( COM_INIT )
}
/* com_Open( <nComPort>, [<nBufferIn>=100] [, <nBufferOut>=0],
* [<lTrapMode>] ) -> <lStatus>
* [<lTrapMode>] ) --> <lStatus>
*/
HB_FUNC( COM_OPEN )
{
@@ -389,7 +389,7 @@ HB_FUNC( COM_OPEN )
hb_retl( hb_comOpen( iPort ) != -1 );
}
/* com_Close( <nComPort> ) -> <lClosed>
/* com_Close( <nComPort> ) --> <lClosed>
*/
HB_FUNC( COM_CLOSE )
{
@@ -399,7 +399,7 @@ HB_FUNC( COM_CLOSE )
hb_retl( hb_comClose( iPort ) != -1 );
}
/* com_Read( <nComPort>, [<nLength>], [<lNoDelete>] ) -> <cCharacterstring>
/* com_Read( <nComPort>, [<nLength>], [<lNoDelete>] ) --> <cCharacterstring>
*/
HB_FUNC( COM_READ )
{
@@ -440,7 +440,7 @@ HB_FUNC( COM_READ )
hb_retclen_buffer( data, lRecv );
}
/* com_Send( <nComPort>, <cString|nChar> ) -> <nNotSendLength>
/* com_Send( <nComPort>, <cString|nChar> ) --> <nNotSendLength>
*/
HB_FUNC( COM_SEND )
{
@@ -469,42 +469,42 @@ HB_FUNC( COM_SEND )
hb_retnl( lLen );
}
/* com_Num() -> <nMaxCom>
/* com_Num() --> <nMaxCom>
*/
HB_FUNC( COM_NUM )
{
hb_retni( hb_comLastNum() );
}
/* com_GetIO( <nComPort> ) -> <nIOPort> | -1
/* com_GetIO( <nComPort> ) --> <nIOPort> | -1
*/
HB_FUNC( COM_GETIO )
{
/* TODO! */
}
/* com_SetIO( <nComPort>, <nIOPort|cIOPort> ) -> <lChanged>
/* com_SetIO( <nComPort>, <nIOPort|cIOPort> ) --> <lChanged>
*/
HB_FUNC( COM_SETIO )
{
/* TODO! */
}
/* com_GetIRQ( <nComPort> ) -> <nIRQ> | -1
/* com_GetIRQ( <nComPort> ) --> <nIRQ> | -1
*/
HB_FUNC( COM_GETIRQ )
{
/* TODO! */
}
/* com_SetIRQ( <nComPort>, <nIRQ|cIRQ> ) -> <lChanged>
/* com_SetIRQ( <nComPort>, <nIRQ|cIRQ> ) --> <lChanged>
*/
HB_FUNC( COM_SETIRQ )
{
/* TODO! */
}
/* com_DevName( <nComPort> [, <cNewName> ] ) -> <cPrevName>
/* com_DevName( <nComPort> [, <cNewName> ] ) --> <cPrevName>
*/
HB_FUNC( COM_DEVNAME )
{

View File

@@ -50,7 +50,7 @@
#include "hbapigt.h"
#include "hbchksum.h"
/* com_DosCon( <cString>, [<nLine>], [<nColumn>] ) -> <cNull>
/* com_DosCon( <cString>, [<nLine>], [<nColumn>] ) --> <cNull>
*/
HB_FUNC( COM_DOSCON )
{
@@ -74,7 +74,7 @@ HB_FUNC( COM_DOSCON )
hb_retc_null();
}
/* com_CRC( <cString>, [<nStart>], [<nPolynomial>] ) -> <nCRC>
/* com_CRC( <cString>, [<nStart>], [<nPolynomial>] ) --> <nCRC>
*/
HB_FUNC( COM_CRC )
{
@@ -90,10 +90,10 @@ HB_FUNC( COM_CRC )
/* NOTE: warning this function is not bug compatible with CT3.
* It fixes few problems in original CT3 implementation
* i.e. it works correctly for 8 bit and smaller polynomials
* i.e. it works correctly for 8-bit and smaller polynomials
* instead of returning 0 or supports much larger polynomials
* up to 64bits.
* For 16/17 bit polynomials it gives the same results as CT3
* up to 64-bit.
* For 16/17-bit polynomials it gives the same results as CT3
* so for most common usage it should be binary compatible
* with CT3. [druzus]
*/
@@ -111,7 +111,7 @@ static char s_xmoblock_sum( const char * szData, HB_SIZE nLen )
return ( char ) uc;
}
/* XMoBlock( <cString>, <nBlockNumber>, [<lCRC>], [<nMode>] ) -> <cXModemBlock>
/* XMoBlock( <cString>, <nBlockNumber>, [<lCRC>], [<nMode>] ) --> <cXModemBlock>
*/
HB_FUNC( XMOBLOCK )
{
@@ -152,17 +152,18 @@ HB_FUNC( XMOBLOCK )
hb_retclen_buffer( pszBlock, nSize );
}
/* XMoCheck( <cString>, [<lCRC>] ) -> <nBlockNumber>|-1
/* XMoCheck( <cString>, [<lCRC>] ) --> <nBlockNumber>|-1
*/
HB_FUNC( XMOCHECK )
{
HB_SIZE nLen = hb_parclen( 1 ), nSize;
HB_SIZE nLen = hb_parclen( 1 );
int iResult = -1;
if( nLen >= 132 )
{
const char * szBlock = hb_parc( 1 );
HB_BOOL fCRC = hb_parl( 2 );
HB_SIZE nSize;
if( *szBlock == 0x01 )
nSize = 128;
@@ -183,7 +184,7 @@ HB_FUNC( XMOCHECK )
hb_retni( iResult );
}
/* ZeroInsert( <cString> ) -> <cDataBlock>
/* ZeroInsert( <cString> ) --> <cDataBlock>
*/
HB_FUNC( ZEROINSERT )
{
@@ -194,7 +195,7 @@ HB_FUNC( ZEROINSERT )
const char * szText;
HB_SIZE nLen, nBits, n;
unsigned int uiVal;
int i, j;
int i;
szText = hb_itemGetCPtr( pString );
nLen = hb_itemGetCLen( pString );
@@ -219,6 +220,7 @@ HB_FUNC( ZEROINSERT )
HB_SIZE nDest = nLen + ( ( nBits + 7 ) >> 3 );
char * pszDest = ( char * ) hb_xgrab( nDest + 1 );
unsigned char c = 0;
int j;
nBits = n = 0;
i = 1;
@@ -265,7 +267,7 @@ HB_FUNC( ZEROINSERT )
hb_retc_null();
}
/* ZeroRemove( <cDataBlock> ) -> cString
/* ZeroRemove( <cDataBlock> ) --> cString
*/
HB_FUNC( ZEROREMOVE )
{

View File

@@ -1,6 +1,9 @@
/*
* Crypt() CA-T*ols compatible function
*
* WARNING: Non-standard, insecure crypto. Use core hb_blowfish*()
* functions or other _standard_ alternatives instead.
*
* Copyright 1999-2001 Viktor Szakats (vszakats.net/harbour)
*
* This program is free software; you can redistribute it and/or modify

View File

@@ -1,5 +1,5 @@
/*
* initialization and switch functions for CT3 math functions
* Initialization and switch functions for CT3 math functions
*
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
* Author: Martin Vogel <vogel@inttec.de>

View File

@@ -1,7 +1,7 @@
/*
* CA-T*ols for Harbour, Math header file
*
* Copyright 2001 Alejandro de garate <alex_degarate@hotmail.com>
* Copyright 2001 Alejandro de Garate <alex_degarate@hotmail.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
@@ -59,7 +59,7 @@ HB_EXTERN_BEGIN
extern int ct_math_init( void );
extern int ct_math_exit( void );
/* set & get precision */
/* set and get precision */
extern void ct_setprecision( int iPrecision );
extern int ct_getprecision( void );

View File

@@ -1,16 +1,14 @@
/*
*
* CT3 mathematical functions
* - Floor()
* - Ceiling()
* - Sign()
* - Log10()
* - Fact()
* CT3 mathematical functions
* - Floor()
* - Ceiling()
* - Sign()
* - Log10()
* - Fact()
*
* Copyright 2001 Alejandro de Garate <alex_degarate@hotmail.com>
*
* Documentation and changes concerning error handling Copyright 2001
* IntTec GmbH, Freiburg, Germany, Author: Martin Vogel <vogel@inttec.de>
* Copyright 2001 IntTec GmbH, Freiburg, Germany
* Author: Martin Vogel <vogel@inttec.de> (Documentation and changes concerning error handling)
*
* 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
@@ -138,13 +136,11 @@ HB_FUNC( SIGN )
if( dInput == 0.00 )
iResult = 0;
else if( dInput > 0.00 )
iResult = 1;
else
{
if( dInput > 0.00 )
iResult = 1;
else
iResult = -1;
}
iResult = -1;
hb_retni( iResult );
}
else
@@ -218,11 +214,12 @@ HB_FUNC( FACT )
if( HB_ISNUM( 1 ) )
{
int iInput = hb_parni( 1 );
int i;
double dResult = 1.0;
if( ( iInput >= 0 ) && ( iInput < 22 ) )
if( iInput >= 0 && iInput < 22 )
{
double dResult = 1.0;
int i;
for( i = 1; i <= iInput; i++ )
dResult *= ( double ) i;
hb_retnd( dResult );

View File

@@ -47,33 +47,33 @@
/*
* CT3 NET Functions Comments:
*
* NetCancel( <cLocalDevice> ) -> lReleased
* NetCancel( <cLocalDevice> ) --> lReleased
* Return true if <cLocalDevice> was disconnected.
*
* NetDisk( cDrive ) -> lSuccess
* NetDisk( cDrive ) --> lSuccess
* Return true if <cDrive> is a network drive, otherwise return false if is a local drive.
*
* NETLOCNAME( cSahredDevice ) -> cLocalDevice
* NetLocName( cSahredDevice ) --> cLocalDevice
* Not implemented yet.
*
* NetPrinter() -> lSuccess
* Return true if a current local printer seted by SET PRINTER TO was connected to a
* NetPrinter() --> lSuccess
* Return true if a current local printer set by SET PRINTER TO was connected to a
* network printer.
*
* NetRedir( cLocalDevice, cSharedDevice, [ cPassword ], [ lShowError] ) -> lSuccess
* NetRedir( cLocalDevice, cSharedDevice, [ cPassword ], [ lShowError] ) --> lSuccess
* Return true if <cLocalDevice> was connected to <cSharedDevice> with <cPassword>, if any.
*
* NetRmtname( cLocalDevice ) -> cSharedName
* NetRmtname( cLocalDevice ) --> cSharedName
* Return the shared resource name connected to a <cLocalDevice>.
* The original parameter <nDevice> in CA-Cl*pper Tools was changed to <cLocalName> in
* xHarbour because in Windows Network I didn't find a number table like in MS-DOS. See
* CA-T*ols help for more details.
*
* Network() -> lSuccess
* Return true if a PC-LAN/MS-NET or Netware type is active.
* Network() --> lSuccess
* Return true if a PC-LAN/MS-NET or NetWare type is active.
*
* NNetwork() -> lSuccess
* Return true if a Netware type is active.
* NNetwork() --> lSuccess
* Return true if a NetWare type is active.
*
*/
@@ -114,7 +114,7 @@ HB_FUNC( NETCANCEL )
#if defined( HB_OS_WIN ) && ! defined( HB_OS_WIN_CE )
void * hDevice;
DWORD dwResult = WNetCancelConnection( HB_PARSTRDEF( 1, &hDevice, NULL ), TRUE ); /* FALSE = fail if exist open files or print jobs. */
DWORD dwResult = WNetCancelConnection( HB_PARSTRDEF( 1, &hDevice, NULL ), TRUE ); /* FALSE = fail if exist open files or print jobs. */
hb_strfree( hDevice );
/* TRUE = force cancel connection even if exist
@@ -129,7 +129,7 @@ HB_FUNC( NETCANCEL )
HB_FUNC( NETPRINTER )
{
#if defined( HB_OS_WIN ) && ! defined( HB_OS_WIN_CE )
const char * cPrn = hb_setGetCPtr( HB_SET_PRINTFILE ); /* query default local printer port. */
const char * cPrn = hb_setGetCPtr( HB_SET_PRINTFILE ); /* query default local printer port. */
if( ! cPrn || ! *cPrn || hb_stricmp( cPrn, "PRN" ) == 0 )
cPrn = "LPT1";

View File

@@ -45,7 +45,6 @@
*/
FUNCTION Random( lMode )
RETURN iif( HB_ISLOGICAL( lMode ) .AND. lMode, ;
hb_RandomInt( -32768, 32767 ), hb_RandomInt( 0, 65535 ) )

View File

@@ -1,5 +1,5 @@
/*
* internal and switch functions for CT3 string functions
* Internal and switch functions for CT3 string functions
*
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
* Author: Martin Vogel <vogel@inttec.de>
@@ -84,16 +84,14 @@ int ct_str_exit( void )
return 1;
}
/* -------------------------- */
/* search for exact substring */
/* -------------------------- */
const char * ct_at_exact_forward( const char * pcString, HB_SIZE sStrLen,
const char * pcMatch, HB_SIZE sMatchLen, HB_SIZE * psMatchStrLen )
{
HB_SIZE sPos;
HB_TRACE( HB_TR_DEBUG, ( "ct_at_exact_forward (\"%s\", %" HB_PFS "u, \"%s\", %" HB_PFS "u, %p)",
pcString, sStrLen, pcMatch, sMatchLen, psMatchStrLen ) );
pcString, sStrLen, pcMatch, sMatchLen, ( void * ) psMatchStrLen ) );
if( sMatchLen == 0 || sStrLen < sMatchLen )
return NULL;
@@ -109,9 +107,7 @@ const char * ct_at_exact_forward( const char * pcString, HB_SIZE sStrLen,
}
}
/* ------------------------------------------------ */
/* search for exact substring in backward direction */
/* ------------------------------------------------ */
const char * ct_at_exact_backward( const char * pcString, HB_SIZE sStrLen,
const char * pcMatch, HB_SIZE sMatchLen, HB_SIZE * psMatchStrLen )
{
@@ -119,7 +115,7 @@ const char * ct_at_exact_backward( const char * pcString, HB_SIZE sStrLen,
const char * pcRet;
HB_TRACE( HB_TR_DEBUG, ( "ct_at_exact_backward (\"%s\", %" HB_PFS "u, \"%s\", %" HB_PFS "u, %p)",
pcString, sStrLen, pcMatch, sMatchLen, psMatchStrLen ) );
pcString, sStrLen, pcMatch, sMatchLen, ( void * ) psMatchStrLen ) );
if( sMatchLen == 0 || sStrLen < sMatchLen )
return NULL;
@@ -143,9 +139,7 @@ const char * ct_at_exact_backward( const char * pcString, HB_SIZE sStrLen,
return NULL;
}
/* ----------------------------------- */
/* search for substring using wildcard */
/* ----------------------------------- */
const char * ct_at_wildcard_forward( const char * pcString, HB_SIZE sStrLen,
const char * pcMatch, HB_SIZE sMatchLen,
char cWildCard, HB_SIZE * psMatchStrLen )
@@ -154,7 +148,7 @@ const char * ct_at_wildcard_forward( const char * pcString, HB_SIZE sStrLen,
const char * pcRet, * pcStop;
HB_TRACE( HB_TR_DEBUG, ( "ct_at_wildcard_forward (\"%s\", %" HB_PFS "u, \"%s\", %" HB_PFS "u, \'%c\', %p)",
pcString, sStrLen, pcMatch, sMatchLen, cWildCard, psMatchStrLen ) );
pcString, sStrLen, pcMatch, sMatchLen, cWildCard, ( void * ) psMatchStrLen ) );
if( sMatchLen == 0 || sStrLen < sMatchLen )
return NULL;
@@ -180,9 +174,7 @@ const char * ct_at_wildcard_forward( const char * pcString, HB_SIZE sStrLen,
return NULL;
}
/* --------------------------------------------------------- */
/* search for substring using wildcard in backward direction */
/* --------------------------------------------------------- */
const char * ct_at_wildcard_backward( const char * pcString, HB_SIZE sStrLen,
const char * pcMatch, HB_SIZE sMatchLen,
char cWildCard, HB_SIZE * psMatchStrLen )
@@ -191,7 +183,7 @@ const char * ct_at_wildcard_backward( const char * pcString, HB_SIZE sStrLen,
const char * pcRet;
HB_TRACE( HB_TR_DEBUG, ( "ct_at_wildcard_backward (\"%s\", %" HB_PFS "u, \"%s\", %" HB_PFS "u, \'%c\', %p)",
pcString, sStrLen, pcMatch, sMatchLen, cWildCard, psMatchStrLen ) );
pcString, sStrLen, pcMatch, sMatchLen, cWildCard, ( void * ) psMatchStrLen ) );
if( sMatchLen == 0 || sStrLen < sMatchLen )
return NULL;
@@ -217,16 +209,14 @@ const char * ct_at_wildcard_backward( const char * pcString, HB_SIZE sStrLen,
return NULL;
}
/* ------------------------------- */
/* search for character from a set */
/* ------------------------------- */
const char * ct_at_charset_forward( const char * pcString, HB_SIZE sStrLen,
const char * pcCharSet, HB_SIZE sCharSetLen, HB_SIZE * psMatchedCharPos )
{
const char * pcRet, * pcSet, * pcStop1, * pcStop2;
HB_TRACE( HB_TR_DEBUG, ( "ct_at_charset_forward (\"%s\", %" HB_PFS "u, \"%s\", %" HB_PFS "u, %p)",
pcString, sStrLen, pcCharSet, sCharSetLen, psMatchedCharPos ) );
pcString, sStrLen, pcCharSet, sCharSetLen, ( void * ) psMatchedCharPos ) );
*( psMatchedCharPos ) = sCharSetLen;
@@ -242,7 +232,7 @@ const char * ct_at_charset_forward( const char * pcString, HB_SIZE sStrLen,
if( *pcSet == *pcRet )
{
if( psMatchedCharPos != NULL )
*( psMatchedCharPos ) = pcSet - pcCharSet;
*psMatchedCharPos = pcSet - pcCharSet;
return pcRet;
}
}
@@ -251,16 +241,14 @@ const char * ct_at_charset_forward( const char * pcString, HB_SIZE sStrLen,
return NULL;
}
/* ----------------------------------------------------- */
/* search for character from a set in backward direction */
/* ----------------------------------------------------- */
const char * ct_at_charset_backward( const char * pcString, HB_SIZE sStrLen,
const char * pcCharSet, HB_SIZE sCharSetLen, HB_SIZE * psMatchedCharPos )
{
const char * pcRet, * pcSet, * pcStop;
HB_TRACE( HB_TR_DEBUG, ( "ct_at_charset_backward (\"%s\", %" HB_PFS "u, \"%s\", %" HB_PFS "u, %p)",
pcString, sStrLen, pcCharSet, sCharSetLen, psMatchedCharPos ) );
pcString, sStrLen, pcCharSet, sCharSetLen, ( void * ) psMatchedCharPos ) );
*( psMatchedCharPos ) = sCharSetLen;
@@ -275,7 +263,7 @@ const char * ct_at_charset_backward( const char * pcString, HB_SIZE sStrLen,
if( *pcSet == *pcRet )
{
if( psMatchedCharPos != NULL )
*( psMatchedCharPos ) = pcSet - pcCharSet;
*psMatchedCharPos = pcSet - pcCharSet;
return pcRet;
}
}
@@ -284,9 +272,7 @@ const char * ct_at_charset_backward( const char * pcString, HB_SIZE sStrLen,
return NULL;
}
/*
* CSetRef() stuff
*/
/* CSetRef() stuff */
void ct_setref( int iNewSwitch )
{
@@ -322,9 +308,7 @@ HB_FUNC( CSETREF )
}
}
/*
* CSetAtMupa() stuff
*/
/* CSetAtMupa() stuff */
void ct_setatmupa( int iNewSwitch )
{
@@ -360,9 +344,7 @@ HB_FUNC( CSETATMUPA )
}
}
/*
* SetAtLike() stuff
*/
/* SetAtLike() stuff */
void ct_setatlike( int iNewMode )
{

View File

@@ -1,5 +1,5 @@
/*
* internal function header for CT3 string functions
* Internal function header for CT3 string functions
*
* Copyright 2001 IntTec GmbH, Neunlindenstr 32, 79106 Freiburg, Germany
* Author: Martin Vogel <vogel@inttec.de>

View File

@@ -1,7 +1,6 @@
/*
* Functions:
* SetFCreate(), CSetSafety(), StrFile(), FileStr(), ScreenFile()
* ScreenFile(), FileScreen()
* StrFile(), FileStr(), ScreenFile(), FileScreen()
* SetFCreate(), CSetSafety()
*
* Copyright 2004 Pavel Tsarenko <tpe2@mail.ru>
*

View File

@@ -73,7 +73,7 @@ FUNCTION TimeToSec( cTime )
ENDIF
ENDIF
RETURN Round( nSec, 2 ) /* round FL val to be sure that you can compare it */
RETURN Round( nSec, 2 ) /* round FL val to be sure that you can compare it */
FUNCTION SecToTime( nSec, lHundredth )

View File

@@ -161,17 +161,17 @@ HB_FUNC( WOPEN )
{
int iColor;
/* 6-th (color) and 7-th (lVisible) parameters are Harbour extensions */
/* 6th (color) and 7th (lVisible) parameters are Harbour extensions */
iColor = hb_ctColorParam( 6, -1 ); /* Harbour extension */ /* HB_EXTENSION */
hb_retni( hb_ctwCreateWindow( hb_parni( 1 ), hb_parni( 2 ),
hb_parni( 3 ), hb_parni( 4 ),
hb_parl( 5 ), iColor,
hb_parldef( 7, 1 ) ) ); /* HB_EXTENSION */
hb_parldef( 7, HB_TRUE ) ) ); /* HB_EXTENSION */
}
HB_FUNC( WCLOSE )
{
/* 1-st parameter (window handle) is Harbour extension */
/* 1st parameter (window handle) is Harbour extension */
hb_retni( hb_ctwCloseWindow( HB_ISNUM( 1 ) ? hb_parni( 1 ) : /* HB_EXTENSION */
hb_ctwCurrentWindow() ) );
}
@@ -181,11 +181,10 @@ HB_FUNC( WACLOSE )
hb_retni( hb_ctwCloseAllWindows() );
}
HB_FUNC( WSELECT )
HB_FUNC( WSELECT ) /* 2nd parameter (fBringToTop) is Harbour extension */
{
/* 2-nd parameter (fBringToTop) is Harbour extension */
hb_retni( HB_ISNUM( 1 ) ? hb_ctwSelectWindow( hb_parni( 1 ),
hb_parldef( 2, 1 ) ) : /* HB_EXTENSION */
hb_parldef( 2, HB_TRUE ) ) : /* HB_EXTENSION */
hb_ctwCurrentWindow() );
}
@@ -388,7 +387,7 @@ HB_FUNC( HBCT_MAXCOL ) /* Return the maximum screen/window column number (zero o
*/
/*
WAlias( <nHandle> ) -> <nHandle> | -1
WAlias( <nHandle> ) --> <nHandle> | -1
change current window handle to <nHandle>
if <nHandle> is not used by other window
or is current window.
@@ -398,7 +397,7 @@ HB_FUNC( WALIAS )
int iWindow = hb_parnidef( 1, -1 );
/* 255 is original CT3 limit,
* harbour CTWIN does not have such intenral limits
* Harbour CTWIN does not have such internal limits
*/
if( iWindow >= 0 && iWindow <= 255 )
iWindow = hb_ctwChangeWindowHandle( iWindow );
@@ -409,8 +408,8 @@ HB_FUNC( WALIAS )
}
/*
WList() -> <cHandleList>
_WStack() -> <cHandleList>
WList() --> <cHandleList>
_WStack() --> <cHandleList>
return string with window handles in each character,
the last character is the top window.

View File

@@ -177,7 +177,7 @@ static void hb_ctw_SetMap( PHB_GTCTW pCTW, int * piMap, int iWindow, int iTop, i
HB_SIZE nIndex;
int i;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetMap(%p,%p,%d,%d,%d,%d,%d,%d)", pCTW, piMap, iWindow, iTop, iLeft, iBottom, iRight, iNested ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetMap(%p,%p,%d,%d,%d,%d,%d,%d)", ( void * ) pCTW, ( void * ) piMap, iWindow, iTop, iLeft, iBottom, iRight, iNested ) );
if( iTop < 0 )
iTop = 0;
@@ -215,7 +215,7 @@ static void hb_ctw_ClearMap( PHB_GTCTW pCTW )
{
HB_SIZE nSize;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_ClearMap(%p)", pCTW ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_ClearMap(%p)", ( void * ) pCTW ) );
nSize = ( HB_SIZE ) pCTW->iMapHeight * pCTW->iMapWidth * sizeof( int );
memset( pCTW->pWindowMap, 0, nSize );
@@ -224,7 +224,7 @@ static void hb_ctw_ClearMap( PHB_GTCTW pCTW )
static void hb_ctw_TouchLines( PHB_GTCTW pCTW, int iFrom, int iTo )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_TouchLines(%p,%d,%d)", pCTW, iFrom, iTo ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_TouchLines(%p,%d,%d)", ( void * ) pCTW, iFrom, iTo ) );
while( iFrom <= iTo )
{
@@ -237,7 +237,7 @@ static void hb_ctw_WindowMap( PHB_GTCTW pCTW, int iWindow, HB_BOOL fExpose )
{
PHB_CT_WND pWnd;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_WindowMap(%p,%d,%d)", pCTW, iWindow, ( int ) fExpose ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_WindowMap(%p,%d,%d)", ( void * ) pCTW, iWindow, ( int ) fExpose ) );
pWnd = pCTW->windows[ iWindow ];
@@ -274,7 +274,7 @@ static void hb_ctw_WindowMap( PHB_GTCTW pCTW, int iWindow, HB_BOOL fExpose )
static void hb_ctw_RemapAllWindows( PHB_GTCTW pCTW, int iFrom, HB_BOOL fExpose )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_RemapAllWindows(%p,%d,%d)", pCTW, iFrom, ( int ) fExpose ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_RemapAllWindows(%p,%d,%d)", ( void * ) pCTW, iFrom, ( int ) fExpose ) );
if( pCTW->iMaxWindow )
{
@@ -293,7 +293,7 @@ static int hb_ctw_SetShadowAttr( PHB_GTCTW pCTW, int iAttr )
{
int iOldAttr;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetShadowAttr(%p,%d)", pCTW, iAttr ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetShadowAttr(%p,%d)", ( void * ) pCTW, iAttr ) );
iOldAttr = pCTW->iShadowAttr;
if( iAttr >= 0 ||
@@ -309,7 +309,7 @@ static int hb_ctw_SetMoveMode( PHB_GTCTW pCTW, int iMode )
{
int iOldMode;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetMoveMode(%p,%d)", pCTW, iMode ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetMoveMode(%p,%d)", ( void * ) pCTW, iMode ) );
iOldMode = pCTW->iMoveMode;
if( iMode >= 0 )
@@ -320,7 +320,7 @@ static int hb_ctw_SetMoveMode( PHB_GTCTW pCTW, int iMode )
static int hb_ctw_SetMoveStep( PHB_GTCTW pCTW, int iVertical, int iHorizontal )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetMoveStep(%p,%d,%d)", pCTW, iVertical, iHorizontal ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetMoveStep(%p,%d,%d)", ( void * ) pCTW, iVertical, iHorizontal ) );
if( iVertical < pCTW->iMapHeight && iHorizontal < pCTW->iMapWidth )
{
@@ -335,7 +335,7 @@ static int hb_ctw_SetMoveStep( PHB_GTCTW pCTW, int iVertical, int iHorizontal )
static int hb_ctw_SetWindowBoard( PHB_GTCTW pCTW, int iTop, int iLeft, int iBottom, int iRight )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetWindowBoard(%p,%d,%d,%d,%d)", pCTW, iTop, iLeft, iBottom, iRight ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetWindowBoard(%p,%d,%d,%d,%d)", ( void * ) pCTW, iTop, iLeft, iBottom, iRight ) );
#ifdef HB_CLP_STRICT
/*
@@ -366,7 +366,7 @@ static int hb_ctw_SetWindowBoard( PHB_GTCTW pCTW, int iTop, int iLeft, int iBott
static int hb_ctw_SetBorderMode( PHB_GTCTW pCTW, int iTop, int iLeft, int iBottom, int iRight )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetBorderMode(%p,%d,%d,%d,%d)", pCTW, iTop, iLeft, iBottom, iRight ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetBorderMode(%p,%d,%d,%d,%d)", ( void * ) pCTW, iTop, iLeft, iBottom, iRight ) );
if( iTop >= 0 )
pCTW->fBoardTop = iTop != 0;
@@ -384,7 +384,7 @@ static int hb_ctw_CurrentWindow( PHB_GTCTW pCTW )
{
PHB_CTWDATA pTSD;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_CurrentWindow(%p)", pCTW ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_CurrentWindow(%p)", ( void * ) pCTW ) );
pTSD = HB_CTW_TSD( pCTW );
@@ -405,7 +405,7 @@ static int hb_ctw_CurrentWindow( PHB_GTCTW pCTW )
static int hb_ctw_SelectWindow( PHB_GTCTW pCTW, int iWindow, HB_BOOL fToTop )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SelectWindow(%p,%d,%d)", pCTW, iWindow, fToTop ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SelectWindow(%p,%d,%d)", ( void * ) pCTW, iWindow, fToTop ) );
if( iWindow == 0 )
HB_CTW_SETCURRENT( pCTW, 0 );
@@ -415,7 +415,7 @@ static int hb_ctw_SelectWindow( PHB_GTCTW pCTW, int iWindow, HB_BOOL fToTop )
HB_CTW_SETCURRENT( pCTW, iWindow );
if( fToTop )
{
int i, iPos;
int i;
/* update window level */
i = pCTW->iOpenWindows - 1;
@@ -423,7 +423,7 @@ static int hb_ctw_SelectWindow( PHB_GTCTW pCTW, int iWindow, HB_BOOL fToTop )
{
if( pCTW->windowStack[ i ] == iWindow )
{
iPos = i;
int iPos = i;
while( i < pCTW->iOpenWindows - 1 &&
pCTW->windows[ pCTW->windowStack[ i + 1 ] ]->iLevel <=
pCTW->windows[ iWindow ]->iLevel )
@@ -455,9 +455,9 @@ static int hb_ctw_SelectWindow( PHB_GTCTW pCTW, int iWindow, HB_BOOL fToTop )
static int hb_ctw_ChangeWindowHandle( PHB_GTCTW pCTW, int iNewWindow )
{
int iWindow, i;
int iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_ChangeWindowHandle(%p,%d)", pCTW, iNewWindow ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_ChangeWindowHandle(%p,%d)", ( void * ) pCTW, iNewWindow ) );
iWindow = HB_CTW_GETCURRENT( pCTW );
if( iWindow != iNewWindow )
@@ -467,6 +467,7 @@ static int hb_ctw_ChangeWindowHandle( PHB_GTCTW pCTW, int iNewWindow )
pCTW->windows[ iNewWindow ] == NULL ) )
{
PHB_CT_WND pWnd = pCTW->windows[ iWindow ];
int i;
if( iNewWindow > pCTW->iMaxWindow )
{
@@ -508,7 +509,7 @@ static int hb_ctw_ChangeWindowHandle( PHB_GTCTW pCTW, int iNewWindow )
static int hb_ctw_GetWindowStack( PHB_GTCTW pCTW, const int ** piStack )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_GetWindowStack(%p,%p)", pCTW, piStack ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_GetWindowStack(%p,%p)", ( void * ) pCTW, ( const void * ) piStack ) );
*piStack = pCTW->windowStack;
@@ -519,7 +520,7 @@ static int hb_ctw_Visible( PHB_GTCTW pCTW, int iWindow, int iVisible )
{
int iResult = HB_CTW_UNDEF;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_Visible(%p,%d,%d)", pCTW, iWindow, iVisible ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_Visible(%p,%d,%d)", ( void * ) pCTW, iWindow, iVisible ) );
if( iWindow == 0 )
iResult = HB_CTW_VISIBLE;
@@ -542,10 +543,9 @@ static int hb_ctw_Visible( PHB_GTCTW pCTW, int iWindow, int iVisible )
static int hb_ctw_SetWindowLevel( PHB_GTCTW pCTW, int iWindow, int iLevel )
{
int iResult = -1, iPos, i;
HB_BOOL fToTop;
int iResult = -1;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetWindowLevel(%p,%d,%d)", pCTW, iWindow, iLevel ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetWindowLevel(%p,%d,%d)", ( void * ) pCTW, iWindow, iLevel ) );
if( iWindow > 0 && iWindow <= pCTW->iMaxWindow &&
pCTW->windows[ iWindow ] != NULL )
@@ -556,6 +556,9 @@ static int hb_ctw_SetWindowLevel( PHB_GTCTW pCTW, int iWindow, int iLevel )
if( iLevel >= HB_CTW_BOTTOM && iLevel <= HB_CTW_TOP &&
pWnd->iLevel != iLevel )
{
HB_BOOL fToTop;
int i;
/* update window level */
fToTop = pWnd->iLevel < iLevel;
pWnd->iLevel = iLevel;
@@ -567,7 +570,7 @@ static int hb_ctw_SetWindowLevel( PHB_GTCTW pCTW, int iWindow, int iLevel )
--i;
if( i >= 0 )
{
iPos = i;
int iPos = i;
if( fToTop )
{
while( i < pCTW->iOpenWindows - 1 && pWnd->iLevel >=
@@ -602,7 +605,7 @@ static int hb_ctw_SetWindowShadow( PHB_GTCTW pCTW, int iWindow, int iAttr )
{
int iResult = -1;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetWindowShadow(%p,%d,%d)", pCTW, iWindow, iAttr ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetWindowShadow(%p,%d,%d)", ( void * ) pCTW, iWindow, iAttr ) );
if( iWindow > 0 && iWindow <= pCTW->iMaxWindow &&
pCTW->windows[ iWindow ] != NULL )
@@ -629,7 +632,7 @@ static int hb_ctw_MaxWindow( PHB_GTCTW pCTW )
{
int i, iMaxHandle = 0;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_MaxWindow(%p)", pCTW ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_MaxWindow(%p)", ( void * ) pCTW ) );
for( i = 0; i < pCTW->iOpenWindows; ++i )
{
@@ -648,7 +651,7 @@ static int hb_ctw_CreateWindow( PHB_GTCTW pCTW, int iTop, int iLeft, int iBottom
int iRow, iCol, iHeight, iWidth, iTmp;
long lIndex;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_CreateWindow(%p,%d,%d,%d,%d,%d,%d,%d)", pCTW, iTop, iLeft, iBottom, iRight, ( int ) fClear, iColor, ( int ) fVisible ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_CreateWindow(%p,%d,%d,%d,%d,%d,%d,%d)", ( void * ) pCTW, iTop, iLeft, iBottom, iRight, ( int ) fClear, iColor, ( int ) fVisible ) );
if( pCTW->iOpenWindows == pCTW->iMaxWindow )
{
@@ -790,7 +793,7 @@ static int hb_ctw_CreateWindow( PHB_GTCTW pCTW, int iTop, int iLeft, int iBottom
static int hb_ctw_CloseWindow( PHB_GTCTW pCTW, int iWindow )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_CloseWindow(%p,%d)", pCTW, iWindow ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_CloseWindow(%p,%d)", ( void * ) pCTW, iWindow ) );
if( iWindow > 0 && iWindow <= pCTW->iMaxWindow && pCTW->windows[ iWindow ] )
{
@@ -834,17 +837,16 @@ static int hb_ctw_CloseWindow( PHB_GTCTW pCTW, int iWindow )
static int hb_ctw_CloseAllWindows( PHB_GTCTW pCTW )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_CloseAllWindows(%p)", pCTW ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_CloseAllWindows(%p)", ( void * ) pCTW ) );
if( pCTW->iOpenWindows > 0 )
{
PHB_CT_WND pWnd;
int i, iWindow;
int i;
for( i = 0; i < pCTW->iOpenWindows; ++i )
{
iWindow = pCTW->windowStack[ i ];
pWnd = pCTW->windows[ iWindow ];
int iWindow = pCTW->windowStack[ i ];
PHB_CT_WND pWnd = pCTW->windows[ iWindow ];
pCTW->windowStack[ i ] = 0;
pCTW->windows[ iWindow ] = NULL;
hb_xfree( pWnd->screenBuffer );
@@ -863,7 +865,7 @@ static int hb_ctw_CloseAllWindows( PHB_GTCTW pCTW )
static int hb_ctw_CenterWindow( PHB_GTCTW pCTW, int iWindow, HB_BOOL fCenter )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_CenterWindow(%p,%d,%d)", pCTW, iWindow, ( int ) fCenter ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_CenterWindow(%p,%d,%d)", ( void * ) pCTW, iWindow, ( int ) fCenter ) );
if( iWindow > 0 && iWindow <= pCTW->iOpenWindows )
{
@@ -911,7 +913,7 @@ static int hb_ctw_CenterWindow( PHB_GTCTW pCTW, int iWindow, HB_BOOL fCenter )
static int hb_ctw_MoveWindow( PHB_GTCTW pCTW, int iWindow, int iRow, int iCol )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_MoveWindow(%p,%d,%d,%d)", pCTW, iWindow, iRow, iCol ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_MoveWindow(%p,%d,%d,%d)", ( void * ) pCTW, iWindow, iRow, iCol ) );
if( iWindow > 0 && iWindow <= pCTW->iOpenWindows )
{
@@ -938,7 +940,7 @@ static int hb_ctw_MoveWindow( PHB_GTCTW pCTW, int iWindow, int iRow, int iCol )
static int hb_ctw_ChangeMargins( PHB_GTCTW pCTW, int iWindow, int iTop, int iLeft, int iBottom, int iRight )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_ChangeMargins(%p,%d,%d,%d,%d,%d)", pCTW, iWindow, iTop, iLeft, iBottom, iRight ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_ChangeMargins(%p,%d,%d,%d,%d,%d)", ( void * ) pCTW, iWindow, iTop, iLeft, iBottom, iRight ) );
if( iWindow > 0 && iWindow <= pCTW->iOpenWindows )
{
@@ -972,7 +974,7 @@ static int hb_ctw_ChangeMargins( PHB_GTCTW pCTW, int iWindow, int iTop, int iLef
static int hb_ctw_SetWindowClip( PHB_GTCTW pCTW, int iWindow, int iTop, int iLeft, int iBottom, int iRight )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetWindowClip(%p,%d,%d,%d,%d,%d)", pCTW, iWindow, iTop, iLeft, iBottom, iRight ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SetWindowClip(%p,%d,%d,%d,%d,%d)", ( void * ) pCTW, iWindow, iTop, iLeft, iBottom, iRight ) );
if( iWindow > 0 && iWindow <= pCTW->iOpenWindows )
{
@@ -1012,7 +1014,7 @@ static int hb_ctw_SetWindowClip( PHB_GTCTW pCTW, int iWindow, int iTop, int iLef
static int hb_ctw_GetWindowCords( PHB_GTCTW pCTW, int iWindow, HB_BOOL fCenter, int * piTop, int * piLeft, int * piBottom, int * piRight )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_GetWindowCords(%p,%d,%d,%p,%p,%p,%p)", pCTW, iWindow, ( int ) fCenter, piTop, piLeft, piBottom, piRight ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_GetWindowCords(%p,%d,%d,%p,%p,%p,%p)", ( void * ) pCTW, iWindow, ( int ) fCenter, ( void * ) piTop, ( void * ) piLeft, ( void * ) piBottom, ( void * ) piRight ) );
if( iWindow > 0 && iWindow <= pCTW->iOpenWindows )
{
@@ -1054,7 +1056,7 @@ static int hb_ctw_GetWindowCords( PHB_GTCTW pCTW, int iWindow, HB_BOOL fCenter,
static int hb_ctw_GetFormatCords( PHB_GTCTW pCTW, int iWindow, HB_BOOL fRelative, int * piTop, int * piLeft, int * piBottom, int * piRight )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_GetFormatCords(%p,%d,%d,%p,%p,%p,%p)", pCTW, iWindow, ( int ) fRelative, piTop, piLeft, piBottom, piRight ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_GetFormatCords(%p,%d,%d,%p,%p,%p,%p)", ( void * ) pCTW, iWindow, ( int ) fRelative, ( void * ) piTop, ( void * ) piLeft, ( void * ) piBottom, ( void * ) piRight ) );
if( iWindow > 0 && iWindow <= pCTW->iOpenWindows )
{
@@ -1098,7 +1100,7 @@ static int hb_ctw_AddWindowBox( PHB_GTCTW pCTW, int iWindow, const HB_WCHAR * sz
{
int iMaxRow, iMaxCol;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_AddWindowBox(%p,%d,%p,%d)", pCTW, iWindow, szBoxW, iColor ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_AddWindowBox(%p,%d,%p,%d)", ( void * ) pCTW, iWindow, ( const void * ) szBoxW, iColor ) );
iMaxRow = HB_GTSELF_MAXROW( pCTW->pGT );
iMaxCol = HB_GTSELF_MAXCOL( pCTW->pGT );
@@ -1125,7 +1127,7 @@ static int hb_ctw_AddWindowBox( PHB_GTCTW pCTW, int iWindow, const HB_WCHAR * sz
static int hb_ctw_SwapWindows( PHB_GTCTW pCTW, int iWindow1, int iWindow2 )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SwapWindows(%p,%d,%d)", pCTW, iWindow1, iWindow2 ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_SwapWindows(%p,%d,%d)", ( void * ) pCTW, iWindow1, iWindow2 ) );
if( iWindow1 > 0 && iWindow1 <= pCTW->iOpenWindows &&
pCTW->windows[ iWindow1 ] != NULL &&
@@ -1156,13 +1158,13 @@ static int hb_ctw_SwapWindows( PHB_GTCTW pCTW, int iWindow1, int iWindow2 )
return -1;
}
/* ********************************************************************** */
/* --- */
static void hb_ctw_Init( PHB_GTCTW pCTW )
{
int iRow, iCol;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_Init(%p)", pCTW ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_Init(%p)", ( void * ) pCTW ) );
pCTW->iShadowWidth = 2;
pCTW->iShadowAttr = -1;
@@ -1180,7 +1182,7 @@ static void hb_ctw_Init( PHB_GTCTW pCTW )
HB_GTSELF_SETPOS( pCTW->pGT, iRow, iCol );
}
/* ********************************************************************** */
/* --- */
static PHB_GTCTW hb_ctw_base( void )
{
@@ -1220,7 +1222,7 @@ static void hb_ctw_gt_Exit( PHB_GT pGT )
{
PHB_GTCTW pCTW;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_Exit(%p)", pGT ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_Exit(%p)", ( void * ) pGT ) );
HB_GTSELF_REFRESH( pGT );
@@ -1249,7 +1251,7 @@ static int hb_ctw_MouseRow( PHB_GT pGT )
PHB_GTCTW pCTW;
int iRow, iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_MouseRow(%p)", pGT ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_MouseRow(%p)", ( void * ) pGT ) );
iRow = HB_GTSUPER_MOUSEROW( pGT );
@@ -1267,7 +1269,7 @@ static int hb_ctw_MouseCol( PHB_GT pGT )
PHB_GTCTW pCTW;
int iCol, iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_MouseCol(%p)", pGT ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_MouseCol(%p)", ( void * ) pGT ) );
iCol = HB_GTSUPER_MOUSECOL( pGT );
@@ -1285,7 +1287,7 @@ static void hb_ctw_gt_GetPos( PHB_GT pGT, int * piRow, int * piCol )
PHB_GTCTW pCTW;
int iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetPos(%p,%p,%p)", pGT, piRow, piCol ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetPos(%p,%p,%p)", ( void * ) pGT, ( void * ) piRow, ( void * ) piCol ) );
pCTW = HB_GTCTW_GET( pGT );
iWindow = HB_CTW_GETCURRENT( pCTW );
@@ -1308,7 +1310,7 @@ static void hb_ctw_gt_SetPos( PHB_GT pGT, int iRow, int iCol )
PHB_GTCTW pCTW;
int iHeight, iWidth, iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetPos(%p,%d,%d)", pGT, iRow, iCol ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetPos(%p,%d,%d)", ( void * ) pGT, iRow, iCol ) );
iHeight = HB_GTSELF_MAXROW( pGT ) + 1;
iWidth = HB_GTSELF_MAXCOL( pGT ) + 1;
@@ -1345,7 +1347,7 @@ static int hb_ctw_gt_MaxCol( PHB_GT pGT )
PHB_GTCTW pCTW;
int iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_MaxCol(%p)", pGT ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_MaxCol(%p)", ( void * ) pGT ) );
pCTW = HB_GTCTW_GET( pGT );
iWindow = HB_CTW_GETCURRENT( pCTW );
@@ -1362,7 +1364,7 @@ static int hb_ctw_gt_MaxRow( PHB_GT pGT )
PHB_GTCTW pCTW;
int iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_MaxRow(%p)", pGT ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_MaxRow(%p)", ( void * ) pGT ) );
pCTW = HB_GTCTW_GET( pGT );
iWindow = HB_CTW_GETCURRENT( pCTW );
@@ -1391,7 +1393,7 @@ static void hb_ctw_gt_WriteCon( PHB_GT pGT, const char * szText, HB_SIZE nLength
HB_SIZE nIndex = 0;
HB_WCHAR wc;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_WriteCon(%p,%p,%" HB_PFS "u)", pGT, szText, nLength ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_WriteCon(%p,%p,%" HB_PFS "u)", ( void * ) pGT, ( const void * ) szText, nLength ) );
iMaxRow = HB_GTSELF_MAXROW( pGT );
iMaxCol = HB_GTSELF_MAXCOL( pGT );
@@ -1514,7 +1516,7 @@ static void hb_ctw_gt_WriteConW( PHB_GT pGT, const HB_WCHAR * szText, HB_SIZE nL
HB_WCHAR szString[ WRITECON_BUFFER_SIZE ];
HB_SIZE nIndex = 0;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_WriteConW(%p,%p,%" HB_PFS "u)", pGT, szText, nLength ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_WriteConW(%p,%p,%" HB_PFS "u)", ( void * ) pGT, ( const void * ) szText, nLength ) );
iMaxRow = HB_GTSELF_MAXROW( pGT );
iMaxCol = HB_GTSELF_MAXCOL( pGT );
@@ -1635,7 +1637,7 @@ static int hb_ctw_gt_GetCursorStyle( PHB_GT pGT )
PHB_GTCTW pCTW;
int iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetCursorStyle(%p)", pGT ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetCursorStyle(%p)", ( void * ) pGT ) );
pCTW = HB_GTCTW_GET( pGT );
iWindow = HB_CTW_GETCURRENT( pCTW );
@@ -1650,7 +1652,7 @@ static void hb_ctw_gt_SetCursorStyle( PHB_GT pGT, int iStyle )
PHB_GTCTW pCTW;
int iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_SetCursorStyle(%p,%d)", pGT, iStyle ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_SetCursorStyle(%p,%d)", ( void * ) pGT, iStyle ) );
pCTW = HB_GTCTW_GET( pGT );
iWindow = HB_CTW_GETCURRENT( pCTW );
@@ -1679,7 +1681,7 @@ static void hb_ctw_gt_GetColorStr( PHB_GT pGT, char * pszColorString )
PHB_GTCTW pCTW;
int iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetColorStr(%p,%p)", pGT, pszColorString ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetColorStr(%p,%p)", ( void * ) pGT, ( void * ) pszColorString ) );
pCTW = HB_GTCTW_GET( pGT );
iWindow = HB_CTW_GETCURRENT( pCTW );
@@ -1697,7 +1699,7 @@ static void hb_ctw_gt_SetColorStr( PHB_GT pGT, const char * szColorString )
PHB_GTCTW pCTW;
int iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_SetColorStr(%p,%s)", pGT, szColorString ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_SetColorStr(%p,%s)", ( void * ) pGT, szColorString ) );
pCTW = HB_GTCTW_GET( pGT );
iWindow = HB_CTW_GETCURRENT( pCTW );
@@ -1716,7 +1718,7 @@ static void hb_ctw_gt_ColorSelect( PHB_GT pGT, int iColorIndex )
PHB_GTCTW pCTW;
int iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_ColorSelect(%p,%d)", pGT, iColorIndex ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_ColorSelect(%p,%d)", ( void * ) pGT, iColorIndex ) );
pCTW = HB_GTCTW_GET( pGT );
iWindow = HB_CTW_GETCURRENT( pCTW );
@@ -1735,7 +1737,7 @@ static int hb_ctw_gt_GetColor( PHB_GT pGT )
PHB_GTCTW pCTW;
int iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetColor(%p)", pGT ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetColor(%p)", ( void * ) pGT ) );
pCTW = HB_GTCTW_GET( pGT );
iWindow = HB_CTW_GETCURRENT( pCTW );
@@ -1753,7 +1755,7 @@ static void hb_ctw_gt_GetColorData( PHB_GT pGT, int ** pColorsPtr, int * piColor
PHB_GTCTW pCTW;
int iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetColor(%p,%p,%p,%p)", pGT, pColorsPtr, piColorCount, piColorIndex ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetColor(%p,%p,%p,%p)", ( void * ) pGT, ( void * ) pColorsPtr, ( void * ) piColorCount, ( void * ) piColorIndex ) );
pCTW = HB_GTCTW_GET( pGT );
iWindow = HB_CTW_GETCURRENT( pCTW );
@@ -1775,7 +1777,7 @@ static void hb_ctw_gt_GetScrCursor( PHB_GT pGT, int * piRow, int * piCol, int *
PHB_GTCTW pCTW;
int iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetScrCursor(%p,%p,%p,%p)", pGT, piRow, piCol, piStyle ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetScrCursor(%p,%p,%p,%p)", ( void * ) pGT, ( void * ) piRow, ( void * ) piCol, ( void * ) piStyle ) );
HB_GTSUPER_GETSCRCURSOR( pGT, piRow, piCol, piStyle );
pCTW = HB_GTCTW_GET( pGT );
@@ -1809,7 +1811,7 @@ static HB_BOOL hb_ctw_gt_GetScrChar( PHB_GT pGT, int iRow, int iCol,
PHB_GTCTW pCTW;
int iWindow, iShadow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetScrChar(%p,%d,%d,%p,%p,%p)", pGT, iRow, iCol, piColor, pbAttr, pusChar ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetScrChar(%p,%d,%d,%p,%p,%p)", ( void * ) pGT, iRow, iCol, ( void * ) piColor, ( void * ) pbAttr, ( void * ) pusChar ) );
pCTW = HB_GTCTW_GET( pGT );
iWindow = iShadow = 0;
@@ -1867,7 +1869,7 @@ static HB_BOOL hb_ctw_gt_GetScrUC( PHB_GT pGT, int iRow, int iCol,
{
HB_USHORT usChar;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetScrUC(%p,%d,%d,%p,%p,%p,%d)", pGT, iRow, iCol, piColor, pbAttr, puChar, fTerm ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetScrUC(%p,%d,%d,%p,%p,%p,%d)", ( void * ) pGT, iRow, iCol, ( void * ) piColor, ( void * ) pbAttr, ( void * ) puChar, fTerm ) );
if( hb_ctw_gt_GetScrChar( pGT, iRow, iCol, piColor, pbAttr, &usChar ) )
{
@@ -1903,7 +1905,7 @@ static HB_BOOL hb_ctw_gt_GetChar( PHB_GT pGT, int iRow, int iCol,
PHB_CT_WND pWnd;
int iWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetChar(%p,%d,%d,%p,%p,%p)", pGT, iRow, iCol, piColor, pbAttr, pusChar ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_GetChar(%p,%d,%d,%p,%p,%p)", ( void * ) pGT, iRow, iCol, ( void * ) piColor, ( void * ) pbAttr, ( void * ) pusChar ) );
pCTW = HB_GTCTW_GET( pGT );
iWindow = HB_CTW_GETCURRENT( pCTW );
@@ -1932,7 +1934,7 @@ static HB_BOOL hb_ctw_gt_PutChar( PHB_GT pGT, int iRow, int iCol,
PHB_GTCTW pCTW;
int iWindow, iCurrWindow;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_PutChar(%p,%d,%d,%d,%d,%d)", pGT, iRow, iCol, iColor, ( int ) bAttr, ( int ) usChar ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_PutChar(%p,%d,%d,%d,%d,%d)", ( void * ) pGT, iRow, iCol, iColor, ( int ) bAttr, ( int ) usChar ) );
pCTW = HB_GTCTW_GET( pGT );
iWindow = iCurrWindow = HB_CTW_GETCURRENT( pCTW );
@@ -2026,7 +2028,7 @@ static HB_BOOL hb_ctw_gt_PutChar( PHB_GT pGT, int iRow, int iCol,
static HB_BOOL hb_ctw_gt_Resize( PHB_GT pGT, int iRows, int iCols )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_Resize(%p,%d,%d)", pGT, iRows, iCols ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_Resize(%p,%d,%d)", ( void * ) pGT, iRows, iCols ) );
if( HB_GTSUPER_RESIZE( pGT, iRows, iCols ) )
{
@@ -2052,7 +2054,7 @@ static HB_BOOL hb_ctw_gt_Resize( PHB_GT pGT, int iRows, int iCols )
static HB_BOOL hb_ctw_gt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
{
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_Info(%p,%d,%p)", pGT, iType, pInfo ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_Info(%p,%d,%p)", ( void * ) pGT, iType, ( void * ) pInfo ) );
switch( iType )
{
@@ -2108,9 +2110,9 @@ static HB_BOOL hb_ctw_gt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo )
static int hb_ctw_gt_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions,
int iClrNorm, int iClrHigh, double dDelay )
{
int iOptions, iRet = 0;
int iOptions;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_Alert(%p,%p,%p,%d,%d,%f)", pGT, pMessage, pOptions, iClrNorm, iClrHigh, dDelay ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_Alert(%p,%p,%p,%d,%d,%f)", ( void * ) pGT, ( void * ) pMessage, ( void * ) pOptions, iClrNorm, iClrHigh, dDelay ) );
if( pMessage && HB_IS_STRING( pMessage ) &&
pOptions && ( iOptions = ( int ) hb_arrayLen( pOptions ) ) > 0 )
@@ -2137,12 +2139,13 @@ static int hb_ctw_gt_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions,
}
if( fScreen )
{
int iRet = 0;
PHB_GTCTW pCTW = HB_GTCTW_GET( pGT );
HB_UINT ulWidth = 0, ulCurrWidth = 0, ulMsg = 0, ul2, ulMaxWidth, ulLast;
char szKey[ HB_MAX_CHAR_LEN ];
HB_SIZE nChar;
int iKey, iDspCount, iLines = 0, iTop, iLeft, iBottom, iRight,
iMnuCol, iPos, iClr, iWnd, iPrevWnd, i;
int iDspCount, iLines = 0, iTop, iLeft, iBottom, iRight, iPos, iClr, iWnd, iPrevWnd, i;
HB_SIZE nLen, nOptLen;
void * hMessage, * hOpt;
const HB_WCHAR * szMessageW = hb_itemGetStrU16( pMessage, HB_CDP_ENDIAN_NATIVE, &hMessage, &nLen ),
@@ -2227,6 +2230,8 @@ static int hb_ctw_gt_Alert( PHB_GT pGT, PHB_ITEM pMessage, PHB_ITEM pOptions,
iPos = 1;
while( iRet == 0 )
{
int iKey, iMnuCol;
HB_GTSELF_DISPBEGIN( pGT );
iMnuCol = ( ( ulWidth - ulCurrWidth ) >> 1 ) + 1;
for( i = 1; i <= iOptions; ++i )
@@ -2321,7 +2326,7 @@ static int hb_ctw_gt_ReadKey( PHB_GT pGT, int iEventMask )
{
int iKey;
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_ReadKey(%p,%d)", pGT, iEventMask ) );
HB_TRACE( HB_TR_DEBUG, ( "hb_ctw_gt_ReadKey(%p,%d)", ( void * ) pGT, iEventMask ) );
iKey = HB_GTSUPER_READKEY( pGT, iEventMask );
@@ -2389,7 +2394,7 @@ static void hb_ctw_gt_RedrawDiff( PHB_GT pGT )
}
}
/* PUBLIC FUNCTIONS */
/* Public functions */
HB_BOOL hb_ctwInit( void )
{
@@ -2770,7 +2775,7 @@ int hb_ctwLastKey( int * piNewKey )
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->Exit = hb_ctw_gt_Exit;
pFuncTable->MouseRow = hb_ctw_MouseRow;
@@ -2802,9 +2807,9 @@ static HB_BOOL hb_gt_FuncInit( PHB_GT_FUNCS pFuncTable )
return HB_TRUE;
}
/* *********************************************************************** */
/* --- */
#define HB_GTSUPER NULL
#include "hbgtreg.h"
/* *********************************************************************** */
/* --- */

View File

@@ -1,7 +1,5 @@
/*
* CT3 video functions:
*
* SaveCursor(), RestCursor()
* CT3 video functions: SaveCursor(), RestCursor()
*
* Copyright 2007 Przemyslaw Czerpak <druzus / at / priv.onet.pl>
*

View File

@@ -1,10 +1,8 @@
/*
* CT3 Date & Time functions: - BoM() / EoM()
* - BoQ() / EoQ()
* - BoY() / EoY()
* - WoM()
* CT3 Date & Time functions: BoM() / EoM(), BoQ() / EoQ(), BoY() / EoY(), WoM()
*
* Copyright 2005 Pavel Tsarenko <tpe2@mail.ru>
* Copyright 1999 Jose Lalin <dezac@corevia.com> (WoM())
*
* 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
@@ -47,16 +45,6 @@
*
*/
/*
* The following parts are Copyright of the individual authors.
*
* Copyright 1999 Jose Lalin <dezac@corevia.com>
* WoM()
*
* See COPYING.txt for licensing terms.
*
*/
#include "hbapi.h"
#include "hbapiitm.h"
#include "hbdate.h"

View File

@@ -1,18 +1,15 @@
/*
* CT3 Date & Time functions, part II: - AddMonth()
* - CToDoW()
* - CToMonth()
* - DaysInMonth()
* - DaysToMonth()
* - DMY()
* - DoY()
* - IsLeap()
* - LastDayOM()
* - MDY()
* - NToCDoW()
* - NToCMonth()
* - Quarter()
* - Week()
* CT3 Date & Time functions, part II:
* AddMonth()
* DMY()
* DoY()
* IsLeap()
* LastDayOM()
* MDY()
* NToCDoW()
* NToCMonth()
* Quarter()
* Week()
*
* Copyright 2006 Pavel Tsarenko <tpe2@mail.ru>
*
@@ -289,9 +286,7 @@ HB_FUNC( ADDMONTH )
iDays = ct_daysinmonth( iMonth, ct_isleap( iYear ) );
if( iDay > iDays )
{
iDay = iDays;
}
lJulian = hb_dateEncode( iYear, iMonth, iDay );
if( fTimeStamp )
@@ -374,7 +369,7 @@ HB_FUNC( LASTDAYOM )
bLeap = ct_isleap( iYear );
}
hb_retni( ( iMonth && ( iMonth <= 12 ) ? ct_daysinmonth( iMonth, bLeap ) : 0 ) );
hb_retni( ( iMonth && iMonth <= 12 ) ? ct_daysinmonth( iMonth, bLeap ) : 0 );
}
HB_FUNC( NTOCDOW )

View File

@@ -47,7 +47,7 @@
/* stime() exists only in SVr4, SVID, X/OPEN and Linux */
#ifndef _SVID_SOURCE
# define _SVID_SOURCE
#define _SVID_SOURCE
#endif
#include "hbapi.h"

View File

@@ -1,6 +1,5 @@
/*
* dbf structure related functions:
*
* FieldSize(), FieldDeci(), FieldNum(), DbfSize()
*
* Copyright 2000 Alexander Kresin <alex@belacy.belgorod.su>
@@ -62,18 +61,16 @@ HB_FUNC( DBFSIZE )
if( ( pArea = ( AREAP ) hb_rddGetCurrentWorkAreaPointer() ) != NULL )
{
PHB_ITEM pSize = hb_itemNew( NULL );
HB_ULONG ulRecSize, ulRecCount;
if( SELF_INFO( pArea, DBI_GETHEADERSIZE, pSize ) == HB_SUCCESS )
{
llSize = hb_itemGetNL( pSize ) + 1;
if( SELF_INFO( pArea, DBI_GETRECSIZE, pSize ) == HB_SUCCESS )
{
HB_ULONG ulRecSize, ulRecCount;
ulRecSize = hb_itemGetNL( pSize );
if( SELF_RECCOUNT( pArea, &ulRecCount ) == HB_SUCCESS )
{
llSize += ( HB_MAXINT ) ulRecCount * ulRecSize;
}
}
}
hb_itemRelease( pSize );

Some files were not shown because too many files have changed in this diff Show More