2010-02-07 11:49 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
* contrib/hbwin/wapi_wingdi.c
* contrib/hbwin/hbwin.ch
+ Added WAPI_EXTTEXTOUT()
* contrib/hbwin/axcore.c
* contrib/hbwin/olecore.c
* USHORT -> HB_USHORT
* contrib/hbwin/win_prn2.c
* USHORT -> HB_SIZE plus some changes accordingly.
* src/rtl/gtwin/gtwin.c
* src/rtl/gtwvt/gtwvt.c
* USHORT -> HB_WCHAR, HB_USHORT
* contrib/gtwvg/gtwvg.c
* contrib/gtwvg/wvggui.c
* contrib/gtwvg/wvggui.h
* contrib/gtwvg/wvgwin.c
* contrib/gtwvg/wvgutils.c
* contrib/gtwvg/wvgcore.c
* contrib/gtwvg/wvgsink.c
* contrib/gtwvg/wvgwing.c
* USHORT -> HB_WCHAR, HB_USHORT, UINT, int
* contrib/gtwvg/gtwvg.h
* contrib/gtwvg/wvggui.h
- Deleted unused structures (using USHORT).
This commit is contained in:
@@ -17,6 +17,36 @@
|
||||
past entries belonging to author(s): Viktor Szakats.
|
||||
*/
|
||||
|
||||
2010-02-07 11:49 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* contrib/hbwin/wapi_wingdi.c
|
||||
* contrib/hbwin/hbwin.ch
|
||||
+ Added WAPI_EXTTEXTOUT()
|
||||
|
||||
* contrib/hbwin/axcore.c
|
||||
* contrib/hbwin/olecore.c
|
||||
* USHORT -> HB_USHORT
|
||||
|
||||
* contrib/hbwin/win_prn2.c
|
||||
* USHORT -> HB_SIZE plus some changes accordingly.
|
||||
|
||||
* src/rtl/gtwin/gtwin.c
|
||||
* src/rtl/gtwvt/gtwvt.c
|
||||
* USHORT -> HB_WCHAR, HB_USHORT
|
||||
|
||||
* contrib/gtwvg/gtwvg.c
|
||||
* contrib/gtwvg/wvggui.c
|
||||
* contrib/gtwvg/wvggui.h
|
||||
* contrib/gtwvg/wvgwin.c
|
||||
* contrib/gtwvg/wvgutils.c
|
||||
* contrib/gtwvg/wvgcore.c
|
||||
* contrib/gtwvg/wvgsink.c
|
||||
* contrib/gtwvg/wvgwing.c
|
||||
* USHORT -> HB_WCHAR, HB_USHORT, UINT, int
|
||||
|
||||
* contrib/gtwvg/gtwvg.h
|
||||
* contrib/gtwvg/wvggui.h
|
||||
- Deleted unused structures (using USHORT).
|
||||
|
||||
2010-02-07 10:32 UTC+0100 Viktor Szakats (harbour.01 syenar.hu)
|
||||
* include/hbdefs.h
|
||||
! Fixed typo when restructuring types causing no HB_MAXINT
|
||||
|
||||
@@ -1240,7 +1240,7 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L
|
||||
{
|
||||
int iColor;
|
||||
HB_BYTE bAttr;
|
||||
USHORT usChar;
|
||||
HB_USHORT usChar;
|
||||
|
||||
if( !HB_GTSELF_GETSCRCHAR( pWVT->pGT, irow, icol, &iColor, &bAttr, &usChar ) )
|
||||
break;
|
||||
@@ -1726,7 +1726,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
|
||||
* 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, USHORT cbString )
|
||||
static HB_BOOL hb_gt_wvt_TextOut( PHB_GTWVT pWVT, HDC hdc, int col, int row, int iColor, LPCTSTR lpString, UINT cbString )
|
||||
{
|
||||
POINT xy;
|
||||
RECT rClip;
|
||||
@@ -1756,7 +1756,7 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect )
|
||||
#if ! defined( UNICODE )
|
||||
HFONT hFont, hOldFont = NULL;
|
||||
#endif
|
||||
USHORT usChar;
|
||||
HB_USHORT usChar;
|
||||
TCHAR text[ WVT_MAX_ROWS ];
|
||||
|
||||
if( pWVT->bGui && pWVT->bKillFocus )
|
||||
@@ -1825,7 +1825,7 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect )
|
||||
}
|
||||
else if( iColor != iOldColor )
|
||||
{
|
||||
hb_gt_wvt_TextOut( pWVT, hdc, startCol, iRow, iOldColor, text, ( USHORT ) len );
|
||||
hb_gt_wvt_TextOut( pWVT, hdc, startCol, iRow, iOldColor, text, ( UINT ) len );
|
||||
iOldColor = iColor;
|
||||
startCol = iCol;
|
||||
len = 0;
|
||||
@@ -1844,7 +1844,7 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect )
|
||||
}
|
||||
else if( iColor != iOldColor || hFont != hOldFont )
|
||||
{
|
||||
hb_gt_wvt_TextOut( pWVT, hdc, startCol, iRow, iOldColor, text, ( USHORT ) len );
|
||||
hb_gt_wvt_TextOut( pWVT, hdc, startCol, iRow, iOldColor, text, ( UINT ) len );
|
||||
if( hFont != hOldFont )
|
||||
{
|
||||
SelectObject( hdc, hFont );
|
||||
@@ -1859,7 +1859,7 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect )
|
||||
iCol++;
|
||||
}
|
||||
if( len > 0 )
|
||||
hb_gt_wvt_TextOut( pWVT, hdc, startCol, iRow, iOldColor, text, ( USHORT ) len );
|
||||
hb_gt_wvt_TextOut( pWVT, hdc, startCol, iRow, iOldColor, text, ( UINT ) len );
|
||||
}
|
||||
|
||||
/* Transfer on screen from bitmap */
|
||||
@@ -2725,7 +2725,7 @@ static HB_BOOL hb_gt_wvt_SetMode( PHB_GT pGT, int iRow, int iCol )
|
||||
/* ********************************************************************** */
|
||||
|
||||
static HB_BOOL hb_gt_wvt_PutChar( PHB_GT pGT, int iRow, int iCol,
|
||||
int iColor, HB_BYTE bAttr, USHORT usChar )
|
||||
int iColor, HB_BYTE bAttr, HB_USHORT usChar )
|
||||
{
|
||||
if( HB_GTSUPER_PUTCHAR( pGT, iRow, iCol, iColor, bAttr, usChar ) )
|
||||
{
|
||||
|
||||
@@ -534,20 +534,6 @@ typedef enum
|
||||
GTEVENT_SHUTDOWN = 7
|
||||
} HB_gt_event_enum;
|
||||
|
||||
typedef struct _tag_HB_GT_GCOLOR
|
||||
{
|
||||
USHORT usAlpha;
|
||||
USHORT usRed;
|
||||
USHORT usGreen;
|
||||
USHORT usBlue;
|
||||
} HB_GT_GCOLOR;
|
||||
|
||||
typedef struct _tag_HB_GT_COLDEF
|
||||
{
|
||||
char *name;
|
||||
HB_GT_GCOLOR color;
|
||||
} HB_GT_COLDEF;
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
/* xHarbour compatible definitions */
|
||||
|
||||
@@ -113,7 +113,7 @@ void hb_wvt_GetStringAttrib( int top, int left, int bottom, int right, HB_BYTE *
|
||||
{
|
||||
int iColor;
|
||||
HB_BYTE bAttr;
|
||||
USHORT usChar;
|
||||
HB_USHORT usChar;
|
||||
|
||||
if( hb_gtGetScrChar( irow, icol, &iColor, &bAttr, &usChar ) == HB_FAILURE )
|
||||
break;
|
||||
|
||||
@@ -775,7 +775,7 @@ static HB_BOOL hb_gt_wvt_KeyEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam,
|
||||
if( pWVT->inCDP )
|
||||
{
|
||||
#if defined( UNICODE )
|
||||
c = hb_cdpGetChar( pWVT->inCDP, HB_FALSE, ( USHORT ) c );
|
||||
c = hb_cdpGetChar( pWVT->inCDP, HB_FALSE, ( HB_WCHAR ) c );
|
||||
#else
|
||||
if( c > 0 && c <= 255 && pWVT->keyTransTbl[ c ] )
|
||||
c = pWVT->keyTransTbl[ c ];
|
||||
|
||||
@@ -265,8 +265,8 @@ typedef struct
|
||||
HINSTANCE hInstance;
|
||||
int iCmdShow;
|
||||
|
||||
USHORT ROWS; /* number of displayable rows in window */
|
||||
USHORT COLS; /* number of displayable columns in window */
|
||||
int ROWS; /* number of displayable rows in window */
|
||||
int COLS; /* number of displayable columns in window */
|
||||
|
||||
POINT MousePos; /* the last mouse position */
|
||||
HB_BOOL MouseMove; /* Flag to say whether to return mouse movement events */
|
||||
@@ -391,20 +391,6 @@ typedef enum
|
||||
GTEVENT_SHUTDOWN = 7
|
||||
} HB_gt_event_enum;
|
||||
|
||||
typedef struct _tag_HB_GT_GCOLOR
|
||||
{
|
||||
USHORT usAlpha;
|
||||
USHORT usRed;
|
||||
USHORT usGreen;
|
||||
USHORT usBlue;
|
||||
} HB_GT_GCOLOR;
|
||||
|
||||
typedef struct _tag_HB_GT_COLDEF
|
||||
{
|
||||
char *name;
|
||||
HB_GT_GCOLOR color;
|
||||
} HB_GT_COLDEF;
|
||||
|
||||
/*----------------------------------------------------------------------*/
|
||||
|
||||
/* xHarbour compatible definitions */
|
||||
|
||||
@@ -273,7 +273,7 @@ static HRESULT STDMETHODCALLTYPE Invoke( IEventHandler *lpThis, DISPID dispid, R
|
||||
&pParams->rgvarg[ iCount - i ] );
|
||||
}
|
||||
|
||||
hb_vmSend( ( USHORT ) ( iCount + ( pKey == NULL ? 1 : 0 ) ) );
|
||||
hb_vmSend( ( HB_USHORT ) ( iCount + ( pKey == NULL ? 1 : 0 ) ) );
|
||||
|
||||
if( pVarResult )
|
||||
hb_oleItemToVariant( pVarResult, hb_stackReturnItem() );
|
||||
|
||||
@@ -679,18 +679,18 @@ HB_FUNC( WVT_SETMENU )
|
||||
RECT wi = { 0, 0, 0, 0 };
|
||||
RECT ci = { 0, 0, 0, 0 };
|
||||
RECT rc = { 0, 0, 0, 0 };
|
||||
USHORT height, width;
|
||||
int height, width;
|
||||
|
||||
SetMenu( _s->hWnd, ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ) ) ;
|
||||
|
||||
GetWindowRect( _s->hWnd, &wi );
|
||||
GetClientRect( _s->hWnd, &ci );
|
||||
|
||||
height = ( USHORT ) ( _s->PTEXTSIZE.y * _s->ROWS );
|
||||
width = ( USHORT ) ( _s->PTEXTSIZE.x * _s->COLS );
|
||||
height = ( int ) ( _s->PTEXTSIZE.y * _s->ROWS );
|
||||
width = ( int ) ( _s->PTEXTSIZE.x * _s->COLS );
|
||||
|
||||
width += ( USHORT ) ( wi.right - wi.left - ci.right );
|
||||
height += ( USHORT ) ( wi.bottom - wi.top - ci.bottom );
|
||||
width += ( int ) ( wi.right - wi.left - ci.right );
|
||||
height += ( int ) ( wi.bottom - wi.top - ci.bottom );
|
||||
|
||||
if( _s->CentreWindow && SystemParametersInfo( SPI_GETWORKAREA, 0, &rc, 0 ) )
|
||||
{
|
||||
|
||||
@@ -277,7 +277,7 @@ HB_FUNC( WVG_SETDLGITEMTEXT )
|
||||
|
||||
HB_FUNC( WVG_GETDLGITEMTEXT )
|
||||
{
|
||||
USHORT iLen = ( USHORT ) SendMessage( GetDlgItem( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), hb_parni( 2 ) ), WM_GETTEXTLENGTH, 0, 0 ) + 1;
|
||||
int iLen = ( int ) SendMessage( GetDlgItem( ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ), hb_parni( 2 ) ), WM_GETTEXTLENGTH, 0, 0 ) + 1;
|
||||
LPTSTR cText = ( LPTSTR ) hb_xgrab( iLen * sizeof( TCHAR ) );
|
||||
char * szText;
|
||||
UINT iResult;
|
||||
|
||||
@@ -479,12 +479,12 @@ HB_FUNC( WVG_STATUSBARCREATEPANEL )
|
||||
int iParts;
|
||||
RECT rc = { 0, 0, 0, 0 };
|
||||
int n;
|
||||
USHORT width;
|
||||
int width;
|
||||
|
||||
iParts = ( int ) SendMessage( hWndSB, SB_GETPARTS, ( WPARAM ) WIN_STATUSBAR_MAX_PARTS, ( LPARAM ) ( LPINT ) ptArray );
|
||||
|
||||
GetClientRect( hWndSB, &rc );
|
||||
width = ( USHORT ) ( rc.right / ( iParts + 1 ) );
|
||||
width = ( int ) ( rc.right / ( iParts + 1 ) );
|
||||
for( n = 0; n < iParts; n++ )
|
||||
ptArray[ n ] = ( width * ( n + 1 ) );
|
||||
|
||||
|
||||
@@ -380,7 +380,7 @@ static HRESULT STDMETHODCALLTYPE Invoke( IDispatch* lpThis, DISPID dispid, REFII
|
||||
&pParams->rgvarg[ iCount - i ] );
|
||||
}
|
||||
|
||||
hb_vmSend( ( USHORT ) ( iCount + ( pKey == NULL ? 1 : 0 ) ) );
|
||||
hb_vmSend( ( HB_USHORT ) ( iCount + ( pKey == NULL ? 1 : 0 ) ) );
|
||||
|
||||
if( pVarResult )
|
||||
hb_oleItemToVariant( pVarResult, hb_stackReturnItem() );
|
||||
|
||||
@@ -253,6 +253,17 @@
|
||||
#define WIN_TRANSPARENT 1
|
||||
#define WIN_OPAQUE 2
|
||||
|
||||
/* WAPI_EXTTEXTOUT() options */
|
||||
#define WIN_ETO_OPAQUE 0x00002
|
||||
#define WIN_ETO_CLIPPED 0x00004
|
||||
#define WIN_ETO_GLYPH_INDEX 0x00010
|
||||
#define WIN_ETO_RTLREADING 0x00080
|
||||
#define WIN_ETO_NUMERICSLOCAL 0x00400
|
||||
#define WIN_ETO_NUMERICSLATIN 0x00800
|
||||
#define WIN_ETO_IGNORELANGUAGE 0x01000
|
||||
#define WIN_ETO_PDY 0x02000
|
||||
#define WIN_ETO_REVERSE_INDEX_MAP 0x10000
|
||||
|
||||
/* WAPI_DRAWTEXT() format methods */
|
||||
#define WIN_DT_BOTTOM 0x00008
|
||||
#define WIN_DT_CALCRECT 0x00400
|
||||
|
||||
@@ -1089,7 +1089,7 @@ static void PutParams( DISPPARAMS * dispparam )
|
||||
if( !pItem )
|
||||
pItem = hb_itemNew( NULL );
|
||||
hb_oleVariantToItem( pItem, &dispparam->rgvarg[ dispparam->cArgs - uiArg ] );
|
||||
hb_itemParamStoreForward( ( USHORT ) uiArg, pItem );
|
||||
hb_itemParamStoreForward( ( HB_USHORT ) uiArg, pItem );
|
||||
VariantClear( pRefs );
|
||||
pRefs++;
|
||||
}
|
||||
|
||||
@@ -459,6 +459,57 @@ HB_FUNC( WAPI_TEXTOUT )
|
||||
hb_errRT_BASE( EG_ARG, 2010, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
HB_FUNC( WAPI_EXTTEXTOUT )
|
||||
{
|
||||
HDC hDC = hbwapi_par_HDC( 1 );
|
||||
|
||||
if( hDC )
|
||||
{
|
||||
void * hData;
|
||||
HB_SIZE nDataLen;
|
||||
LPCTSTR lpData = HB_PARSTR( 6, &hData, &nDataLen );
|
||||
RECT rect;
|
||||
PHB_ITEM pFontWidths = hb_param( 7, HB_IT_ARRAY );
|
||||
int * lpFontWidths;
|
||||
|
||||
if( pFontWidths )
|
||||
{
|
||||
HB_SIZE nFontWidthsLen = hb_arrayLen( pFontWidths );
|
||||
HB_SIZE tmp;
|
||||
int iWidth = 0;
|
||||
|
||||
lpFontWidths = ( int * ) hb_xgrab( nDataLen * sizeof( int ) );
|
||||
|
||||
for( tmp = 0; tmp < nDataLen; ++tmp )
|
||||
{
|
||||
/* Pad width array with last known value if passed array was smaller than length of the string. */
|
||||
if( tmp < nFontWidthsLen )
|
||||
iWidth = hb_arrayGetNI( pFontWidths, tmp + 1 );
|
||||
|
||||
lpFontWidths[ tmp ] = iWidth;
|
||||
}
|
||||
}
|
||||
else
|
||||
lpFontWidths = NULL;
|
||||
|
||||
|
||||
hb_retl( ExtTextOut( hDC, hb_parni( 2 ) /* iRow */,
|
||||
hb_parni( 3 ) /* iCol */,
|
||||
( UINT ) hb_parni( 4 ) /* fuOptions */,
|
||||
hbwapi_par_RECT( &rect, 5, HB_FALSE ),
|
||||
lpData,
|
||||
nDataLen,
|
||||
lpFontWidths ) );
|
||||
|
||||
if( lpFontWidths )
|
||||
hb_xfree( lpFontWidths );
|
||||
|
||||
hb_strfree( hData );
|
||||
}
|
||||
else
|
||||
hb_errRT_BASE( EG_ARG, 2010, NULL, HB_ERR_FUNCNAME, HB_ERR_ARGS_BASEPARAMS );
|
||||
}
|
||||
|
||||
HB_FUNC( WAPI_SETTEXTCOLOR )
|
||||
{
|
||||
HDC hDC = hbwapi_par_HDC( 1 );
|
||||
|
||||
@@ -388,9 +388,9 @@ HB_FUNC( WIN_PRINTFILERAW )
|
||||
{
|
||||
HB_BYTE pbyBuffer[ 32 * 1024 ];
|
||||
DWORD dwWritten = 0;
|
||||
USHORT nRead;
|
||||
HB_SIZE nRead;
|
||||
|
||||
while( ( nRead = hb_fsRead( fhnd, pbyBuffer, sizeof( pbyBuffer ) ) ) > 0 )
|
||||
while( ( nRead = hb_fsReadLarge( fhnd, pbyBuffer, sizeof( pbyBuffer ) ) ) > 0 )
|
||||
{
|
||||
#if 0
|
||||
/* TOFIX: This check seems wrong for any input files
|
||||
@@ -401,7 +401,7 @@ HB_FUNC( WIN_PRINTFILERAW )
|
||||
nRead--; /* Skip the EOF() character */
|
||||
#endif
|
||||
|
||||
WritePrinter( hPrinter, pbyBuffer, nRead, &dwWritten );
|
||||
WritePrinter( hPrinter, pbyBuffer, ( DWORD ) nRead, &dwWritten );
|
||||
}
|
||||
|
||||
iResult = 1;
|
||||
|
||||
@@ -1304,7 +1304,7 @@ static int hb_gt_win_ReadKey( PHB_GT pGT, int iEventMask )
|
||||
|
||||
#if defined( UNICODE )
|
||||
ch = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.uChar.UnicodeChar;
|
||||
ch = hb_cdpGetChar( s_cdpIn, HB_FALSE, ( USHORT ) ch );
|
||||
ch = hb_cdpGetChar( s_cdpIn, HB_FALSE, ( HB_WCHAR ) ch );
|
||||
#else
|
||||
ch = s_irInBuf[ s_cNumIndex ].Event.KeyEvent.uChar.AsciiChar;
|
||||
#endif
|
||||
@@ -1807,7 +1807,7 @@ static void hb_gt_win_Redraw( PHB_GT pGT, int iRow, int iCol, int iSize )
|
||||
{
|
||||
int iColor;
|
||||
HB_BYTE bAttr;
|
||||
USHORT usChar;
|
||||
HB_USHORT usChar;
|
||||
int iFirst = iCol;
|
||||
int i = ( iRow * _GetScreenWidth() + iCol );
|
||||
|
||||
|
||||
@@ -1068,7 +1068,7 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L
|
||||
{
|
||||
int iColor;
|
||||
HB_BYTE bAttr;
|
||||
USHORT usChar;
|
||||
HB_USHORT usChar;
|
||||
|
||||
if( !HB_GTSELF_GETSCRCHAR( pWVT->pGT, irow, icol, &iColor, &bAttr, &usChar ) )
|
||||
break;
|
||||
@@ -1559,7 +1559,7 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect )
|
||||
#if ! defined( UNICODE )
|
||||
HFONT hFont, hOldFont = NULL;
|
||||
#endif
|
||||
USHORT usChar;
|
||||
HB_USHORT usChar;
|
||||
|
||||
hdc = BeginPaint( pWVT->hWnd, &ps );
|
||||
#if defined( UNICODE )
|
||||
|
||||
Reference in New Issue
Block a user