From 356827d57d57e24352c69b60386054e5d40ff062 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Fri, 25 Jun 2010 07:06:30 +0000 Subject: [PATCH] 2010-06-25 09:05 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * contrib/gtwvg/gtwvg.c * contrib/gtwvg/gtwvg.h * contrib/gtwvg/wvggui.c * contrib/gtwvg/wvgcuig.c * contrib/gtwvg/wvgutils.c * contrib/gtwvg/wvgcore.c * Formatting. % Using hb_par*def() in one place. --- harbour/ChangeLog | 10 ++ harbour/contrib/gtwvg/gtwvg.c | 24 ++--- harbour/contrib/gtwvg/gtwvg.h | 74 ++++++------- harbour/contrib/gtwvg/wvgcore.c | 100 +++++++++--------- harbour/contrib/gtwvg/wvgcuig.c | 14 +-- harbour/contrib/gtwvg/wvggui.c | 14 +-- harbour/contrib/gtwvg/wvgutils.c | 173 ++++++++++++++++--------------- 7 files changed, 210 insertions(+), 199 deletions(-) diff --git a/harbour/ChangeLog b/harbour/ChangeLog index 8294540658..e4c478f23f 100644 --- a/harbour/ChangeLog +++ b/harbour/ChangeLog @@ -16,6 +16,16 @@ The license applies to all entries newer than 2009-04-28. */ +2010-06-25 09:05 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) + * contrib/gtwvg/gtwvg.c + * contrib/gtwvg/gtwvg.h + * contrib/gtwvg/wvggui.c + * contrib/gtwvg/wvgcuig.c + * contrib/gtwvg/wvgutils.c + * contrib/gtwvg/wvgcore.c + * Formatting. + % Using hb_par*def() in one place. + 2010-06-25 08:46 UTC+0200 Viktor Szakats (harbour.01 syenar.hu) * external/libhpdf/Makefile - external/libhpdf/libhpdf.dif diff --git a/harbour/contrib/gtwvg/gtwvg.c b/harbour/contrib/gtwvg/gtwvg.c index 4ec855de89..1a4b8fb04d 100644 --- a/harbour/contrib/gtwvg/gtwvg.c +++ b/harbour/contrib/gtwvg/gtwvg.c @@ -1359,7 +1359,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.dwFlags = TME_LEAVE | TME_HOVER ; + tmi.dwFlags = TME_LEAVE | TME_HOVER; tmi.hwndTrack = pWVT->hWnd; tmi.dwHoverTime = 1; pWVT->bTracking = _TrackMouseEvent( &tmi ); @@ -1803,10 +1803,10 @@ static void hb_gt_wvt_PaintText( PHB_GTWVT pWVT, RECT updateRect ) rcRect = hb_gt_wvt_GetColRowFromXYRect( pWVT, updateRect ); /* Required, GUI Paint mechanism is based on it */ - pWVT->rowStart = rcRect.top ; - pWVT->rowStop = rcRect.bottom ; - pWVT->colStart = rcRect.left ; - pWVT->colStop = rcRect.right ; + pWVT->rowStart = rcRect.top; + pWVT->rowStop = rcRect.bottom; + pWVT->colStart = rcRect.left; + pWVT->colStop = rcRect.right; BeginPaint( pWVT->hWnd, &ps ); hdc = pWVT->hGuiDC; @@ -2167,8 +2167,8 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara case HB_MSG_NOTIFYICON: if( lParam == WM_RBUTTONUP ) { - NOTIFYICONDATA tnid ; - tnid.cbSize = sizeof( NOTIFYICONDATA ) ; + NOTIFYICONDATA tnid; + tnid.cbSize = sizeof( NOTIFYICONDATA ); tnid.hWnd = hWnd; tnid.uID = HB_ID_NOTIFYICON; tnid.uCallbackMessage = HB_MSG_NOTIFYICON; @@ -2376,7 +2376,7 @@ static void hb_gt_wvt_GetBorders( HWND hWnd, int * iBorderLeft, int * iTitlebarH GetWindowRect( hWnd, &wi ); GetClientRect( hWnd, &ci ); - i = ( wi.right - wi.left - ( ci.right - ci.left ) ) / 2 ; + i = ( wi.right - wi.left - ( ci.right - ci.left ) ) / 2; *iBorderLeft = i; *iTitlebarHeight = ( ( wi.bottom - wi.top - ( ci.bottom - ci.top ) ) - i ); @@ -3539,7 +3539,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) int mode = hb_arrayGetNI( pInfo->pNewVal2, 1 ); int iIconType = hb_arrayGetNI( pInfo->pNewVal2, 2 ); HICON hIcon = 0; - NOTIFYICONDATA tnid ; + NOTIFYICONDATA tnid; if( iIconType == 0 ) { @@ -3560,16 +3560,16 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) MAKEINTRESOURCE( ( HB_MAXINT ) hb_arrayGetNInt( pInfo->pNewVal2, 3 ) ) ); } - tnid.cbSize = sizeof( NOTIFYICONDATA ) ; + tnid.cbSize = sizeof( NOTIFYICONDATA ); tnid.hWnd = pWVT->hWnd; tnid.uID = HB_ID_NOTIFYICON; tnid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; tnid.uCallbackMessage = HB_MSG_NOTIFYICON; - tnid.hIcon = hIcon ; + tnid.hIcon = hIcon; HB_TCHAR_COPYTO( tnid.szTip, hb_arrayGetCPtr( pInfo->pNewVal2, 4 ), HB_SIZEOFARRAY( tnid.szTip ) - 1 ); - Shell_NotifyIcon( mode, &tnid ) ; + Shell_NotifyIcon( mode, &tnid ); if( hIcon ) DestroyIcon( hIcon ); diff --git a/harbour/contrib/gtwvg/gtwvg.h b/harbour/contrib/gtwvg/gtwvg.h index 8d37a50999..36470e65cf 100644 --- a/harbour/contrib/gtwvg/gtwvg.h +++ b/harbour/contrib/gtwvg/gtwvg.h @@ -238,50 +238,50 @@ typedef BOOL ( WINAPI *wvtSetLayeredWindowAttributes )( typedef struct { - int iTop ; - int iLeft ; - int iBottom ; - int iRight ; + int iTop; + int iLeft; + int iBottom; + int iRight; } HB_GOBJ_OFFSET ; typedef struct _tag_GOBJS { - int iObjType ; - int iHandle ; - int iState ; - int iTop ; - int iLeft ; - int iBottom ; - int iRight ; - HB_GOBJ_OFFSET aOffset ; - int iHeight ; - int iWidth ; /* iThick */ - int iOrient ; - int iAlign ; - int iAlignVert ; - int iFormat ; - int iStyle ; /* iShape */ - int iData ; /* iSlot, etc */ - COLORREF crRGB ; - COLORREF crRGBText ; - COLORREF crRGBBk ; - HFONT hFont ; - HPEN hPen ; - HBRUSH hBrush ; + int iObjType; + int iHandle; + int iState; + int iTop; + int iLeft; + int iBottom; + int iRight; + HB_GOBJ_OFFSET aOffset; + int iHeight; + int iWidth; /* iThick */ + int iOrient; + int iAlign; + int iAlignVert; + int iFormat; + int iStyle; /* iShape */ + int iData; /* iSlot, etc */ + COLORREF crRGB; + COLORREF crRGBText; + COLORREF crRGBBk; + HFONT hFont; + HPEN hPen; + HBRUSH hBrush; #if ! defined( HB_OS_WIN_CE ) - IPicture * iPicture ; + IPicture * iPicture; #endif - HB_BOOL bDestroyFont ; - HB_BOOL bDestroyPen ; - HB_BOOL bDestroyBrush ; - HB_BOOL bDestroyPicture ; - TRIVERTEX vert[ 2 ] ; - LPTSTR lpText ; - PHB_ITEM bBlock ; - struct _tag_GOBJS * gObjNext ; + HB_BOOL bDestroyFont; + HB_BOOL bDestroyPen; + HB_BOOL bDestroyBrush; + HB_BOOL bDestroyPicture; + TRIVERTEX vert[ 2 ]; + LPTSTR lpText; + PHB_ITEM bBlock; + struct _tag_GOBJS * gObjNext; -} HB_GOBJS, * PHB_GOBJS ; +} HB_GOBJS, * PHB_GOBJS; typedef struct { @@ -312,7 +312,7 @@ typedef struct #if ! defined( HB_OS_WIN_CE ) IPicture *iPicture[ WVT_PICTURES_MAX ]; /* Array to hold the Picture Streams to avoid recurring loading and unloading */ #endif - HFONT hUserFonts[ WVT_FONTS_MAX ] ; /* User defined font handles */ + 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 */ diff --git a/harbour/contrib/gtwvg/wvgcore.c b/harbour/contrib/gtwvg/wvgcore.c index 1b74f9ce30..bade84bbbc 100644 --- a/harbour/contrib/gtwvg/wvgcore.c +++ b/harbour/contrib/gtwvg/wvgcore.c @@ -475,7 +475,7 @@ BOOL CALLBACK hb_wvt_gtDlgProcModal( HWND hDlg, UINT message, WPARAM wParam, LPA if ( iFirst > 0 && iFirst <= WVT_DLGMD_MAX ) { - _s->hDlgModal[ iFirst-1 ] = hDlg ; + _s->hDlgModal[ iFirst-1 ] = hDlg; SendMessage( hDlg, WM_INITDIALOG, 0, 0 ); return lReturn; } @@ -591,12 +591,12 @@ HB_BOOL hb_wvt_DrawImage( HDC hdc, int x1, int y1, int wd, int ht, const char * DWORD nReadByte; LONG lWidth,lHeight; int x,y,xe,ye; - int c = x1 ; - int r = y1 ; - int dc = wd ; - int dr = ht ; - int tor = 0 ; - int toc = 0 ; + int c = x1; + int r = y1; + int dc = wd; + int dr = ht; + int tor = 0; + int toc = 0; HRGN hrgn1; POINT lpp = { 0,0 }; HB_BOOL bResult = HB_FALSE; @@ -672,7 +672,7 @@ HB_BOOL hb_wvt_DrawImage( HDC hdc, int x1, int y1, int wd, int ht, const char * DeleteObject( hrgn1 ); HB_VTBL( iPicture )->Release( HB_THIS( iPicture ) ); - bResult = HB_TRUE ; + bResult = HB_TRUE; } } GlobalFree( hGlobal ); @@ -987,9 +987,9 @@ HB_FUNC( WVT_SETPEN ) hb_retl( HB_FALSE ); } - iPenStyle = hb_parni( 1 ) ; + iPenStyle = hb_parni( 1 ); iPenWidth = hb_parni( 2 ); - crColor = HB_ISNUM( 3 ) ? ( COLORREF ) hb_parnl( 3 ) : RGB( 0,0,0 ); + crColor = ( COLORREF ) hb_parnldef( 3, RGB( 0, 0, 0 ) ); hPen = CreatePen( iPenStyle, iPenWidth, crColor ); @@ -1174,7 +1174,7 @@ HB_FUNC( WVT_DRAWIMAGE ) xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); iTop = xy.y + hb_parvni( 6,1 ); - iLeft = xy.x + hb_parvni( 6,2 ) ; + iLeft = xy.x + hb_parvni( 6,2 ); xy = hb_wvt_gtGetXYFromColRow( hb_parni( 4 ) + 1, hb_parni( 3 ) + 1 ); iBottom = xy.y - 1 + hb_parvni( 6,3 ); @@ -1186,11 +1186,11 @@ HB_FUNC( WVT_DRAWIMAGE ) } else { - hb_wvt_DrawImage( _s->hdc, iLeft, iTop, ( iRight - iLeft ) + 1, ( iBottom - iTop ) + 1, hb_parcx( 5 ) ) ; + hb_wvt_DrawImage( _s->hdc, iLeft, iTop, ( iRight - iLeft ) + 1, ( iBottom - iTop ) + 1, hb_parcx( 5 ) ); #if defined( __SETGUI__ ) if ( _s->bGui ) { - hb_wvt_DrawImage( _s->hGuiDC, iLeft, iTop, ( iRight - iLeft ) + 1, ( iBottom - iTop ) + 1, hb_parcx( 5 ) ) ; + hb_wvt_DrawImage( _s->hGuiDC, iLeft, iTop, ( iRight - iLeft ) + 1, ( iBottom - iTop ) + 1, hb_parcx( 5 ) ); } #endif } @@ -1359,21 +1359,21 @@ HB_FUNC( WVT_DRAWLINE ) iThick = hb_parni( 9 ); cr = !HB_ISNUM( 10 ) ? 0 : ( COLORREF ) hb_parnl( 10 ); - x = iLeft ; - y = iTop ; + x = iLeft; + y = iTop; switch ( iAlign ) { case 0: /* Center */ if ( iOrient == 0 ) /* Horizontal */ { - iOffset = ( ( iBottom - iTop ) / 2 ) ; - y = iTop + iOffset ; + iOffset = ( ( iBottom - iTop ) / 2 ); + y = iTop + iOffset; } else { - iOffset = ( ( iRight - iLeft ) / 2 ) ; - x = iLeft + iOffset ; + iOffset = ( ( iRight - iLeft ) / 2 ); + x = iLeft + iOffset; } break; @@ -1803,15 +1803,15 @@ HB_FUNC( WVT_DRAWBUTTON ) RECT rc = { 0,0,0,0 }; int iTop, iLeft, iBottom, iRight; int iAlign; - int iTextHeight /*, iTextWidth */ ; + int iTextHeight /*, iTextWidth */; LOGBRUSH lb = { 0,0,0 }; HBRUSH hBrush; HB_BOOL bText = HB_ISCHAR( 5 ); HB_BOOL bImage = ( HB_ISNUM( 6 ) || HB_ISCHAR( 6 ) ); int iFormat = hb_parni( 7 ); - COLORREF textColor = !HB_ISNUM( 8 ) ? _s->COLORS[ 0 ] : ( COLORREF ) hb_parnl( 8 ) ; - COLORREF bkColor = !HB_ISNUM( 9 ) ? _s->COLORS[ 7 ] : ( COLORREF ) hb_parnl( 9 ) ; + COLORREF textColor = !HB_ISNUM( 8 ) ? _s->COLORS[ 0 ] : ( COLORREF ) hb_parnl( 8 ); + COLORREF bkColor = !HB_ISNUM( 9 ) ? _s->COLORS[ 7 ] : ( COLORREF ) hb_parnl( 9 ); /* int iImageAt = hb_parni( 10 ); */ xy = hb_wvt_gtGetXYFromColRow( hb_parni( 2 ), hb_parni( 1 ) ); @@ -1829,8 +1829,8 @@ HB_FUNC( WVT_DRAWBUTTON ) #else hBrush = CreateSolidBrush( lb.lbColor ); #endif - rc.left = iLeft ; - rc.top = iTop ; + rc.left = iLeft; + rc.top = iTop; rc.right = iRight + 1; rc.bottom = iBottom + 1; @@ -1885,7 +1885,7 @@ HB_FUNC( WVT_DRAWBUTTON ) /* iTextWidth = sz.cx; */ iTextHeight = sz.cy; - xy.x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ) ; + xy.x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); if ( bImage ) { @@ -1893,7 +1893,7 @@ HB_FUNC( WVT_DRAWBUTTON ) } else { - xy.y = iTop + ( ( iBottom - iTop + 1 - iTextHeight ) / 2 ) ; + xy.y = iTop + ( ( iBottom - iTop + 1 - iTextHeight ) / 2 ); } if ( iFormat == 1 ) @@ -1902,7 +1902,7 @@ HB_FUNC( WVT_DRAWBUTTON ) xy.y = xy.y + 2; } - iAlign = TA_CENTER + TA_TOP ; + iAlign = TA_CENTER + TA_TOP; SetTextAlign( _s->hdc, iAlign ); SetBkMode( _s->hdc, TRANSPARENT ); @@ -2110,8 +2110,8 @@ HB_FUNC( WVT_DRAWLINEEX ) PHB_GTWVT _s = hb_wvt_gtGetWVT(); POINT xy = { 0,0 }; - int iTop, iLeft, iBottom, iRight, iOffset ; - int iOrient, iFormat, iAlign ; + int iTop, iLeft, iBottom, iRight, iOffset; + int iOrient, iFormat, iAlign; int x, y; HPEN hPen; int iSlot = hb_parni( 8 ) - 1; @@ -2129,8 +2129,8 @@ HB_FUNC( WVT_DRAWLINEEX ) iFormat = hb_parni( 6 ); iAlign = hb_parni( 7 ); - x = iLeft ; - y = iTop ; + x = iLeft; + y = iTop; switch ( iAlign ) { @@ -2138,13 +2138,13 @@ HB_FUNC( WVT_DRAWLINEEX ) { if ( iOrient == 0 ) /* Horizontal */ { - iOffset = ( ( iBottom - iTop ) / 2 ) ; - y = iTop + iOffset ; + iOffset = ( ( iBottom - iTop ) / 2 ); + y = iTop + iOffset; } else { - iOffset = ( ( iRight - iLeft ) / 2 ) ; - x = iLeft + iOffset ; + iOffset = ( ( iRight - iLeft ) / 2 ); + x = iLeft + iOffset; } } break; @@ -2427,7 +2427,7 @@ HB_FUNC( WVT_DRAWLABELOBJ ) rect.bottom = iBottom; rect.right = iRight; - uiOptions = ETO_CLIPPED | ETO_OPAQUE ; + uiOptions = ETO_CLIPPED | ETO_OPAQUE; ExtTextOut( _s->hdc, x, y, uiOptions, &rect, text, lstrlen( text ), NULL ); #if defined( __SETGUI__ ) @@ -2516,7 +2516,7 @@ HB_FUNC( WVT_DRAWSCROLLBUTTON ) POINT * Point; POINT xy = { 0,0 }; int iHeight, iOff; - HB_BOOL bDepressed = hb_parl( 7 ) ; + HB_BOOL bDepressed = hb_parl( 7 ); Point = ( POINT * ) hb_xgrab( 3 * sizeof( POINT ) ); iOff = 6; @@ -2550,7 +2550,7 @@ HB_FUNC( WVT_DRAWSCROLLBUTTON ) { xy.y = iTop + iOff - 1; xy.x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); - Point[ 0 ] = xy ; + Point[ 0 ] = xy; xy.y = iBottom - iOff - 1; xy.x = iLeft + iOff - 1; Point[ 1 ] = xy; @@ -2563,7 +2563,7 @@ HB_FUNC( WVT_DRAWSCROLLBUTTON ) { xy.y = iTop + ( ( iBottom - iTop + 1 ) / 2 ); xy.x = iLeft + iOff; - Point[ 0 ] = xy ; + Point[ 0 ] = xy; xy.x = iRight - iOff - 1; xy.y = iTop + iOff - 1; Point[ 1 ] = xy; @@ -2576,7 +2576,7 @@ HB_FUNC( WVT_DRAWSCROLLBUTTON ) { xy.x = iLeft + ( ( iRight - iLeft + 1 ) / 2 ); xy.y = iBottom - iOff; - Point[ 0 ] = xy ; + Point[ 0 ] = xy; xy.x = iLeft + iOff - 1; xy.y = iBottom - iHeight + iOff + 1; Point[ 1 ] = xy; @@ -2589,7 +2589,7 @@ HB_FUNC( WVT_DRAWSCROLLBUTTON ) { xy.x = iRight - iOff - 1; xy.y = iTop + ( ( iBottom - iTop + 1 ) / 2 ); - Point[ 0 ] = xy ; + Point[ 0 ] = xy; xy.x = iLeft + iOff + 1; xy.y = iTop + iOff - 1; Point[ 1 ] = xy; @@ -2734,7 +2734,7 @@ HB_FUNC( WVT_DRAWSHADEDRECT ) if ( _s->pGUI->hMSImg32 ) { - TRIVERTEX vert[ 2 ] ; + TRIVERTEX vert[ 2 ]; GRADIENT_RECT gRect = { 0,0 }; int iTop = ( _s->PTEXTSIZE.y * hb_parni( 1 ) ) + hb_parvni( 5,1 ); @@ -2742,7 +2742,7 @@ HB_FUNC( WVT_DRAWSHADEDRECT ) int iBottom = ( _s->PTEXTSIZE.y * ( hb_parni( 3 ) + 1 ) ) - 1 + hb_parvni( 5,3 ); int iRight = ( _s->PTEXTSIZE.x * ( hb_parni( 4 ) + 1 ) ) - 1 + hb_parvni( 5,4 ); - int iMode = !HB_ISNUM( 6 ) ? GRADIENT_FILL_RECT_H : hb_parni( 6 ) ; + int iMode = !HB_ISNUM( 6 ) ? GRADIENT_FILL_RECT_H : hb_parni( 6 ); vert[ 0 ].x = iLeft; vert[ 0 ].y = iTop; @@ -2860,7 +2860,7 @@ HB_FUNC( WVT_DRAWPROGRESSBAR ) iPercent = hb_parni( 6 ); bImage = HB_ISCHAR( 9 ); - bVertical = hb_parl( 10 ) ; + bVertical = hb_parl( 10 ); iDirection = hb_parni( 11 ); if ( bVertical ) @@ -2979,7 +2979,7 @@ HB_FUNC( WVT_LOADPICTURE ) PHB_GTWVT _s = hb_wvt_gtGetWVT(); IPicture * iPicture = hb_wvt_gtLoadPicture( hb_parcx( 2 ) ); - int iSlot = hb_parni( 1 ) - 1 ; + int iSlot = hb_parni( 1 ) - 1; if ( iPicture ) { @@ -3004,7 +3004,7 @@ HB_FUNC( WVT_LOADPICTUREFROMRESOURCE ) PHB_GTWVT _s = hb_wvt_gtGetWVT(); IPicture * iPicture = hb_wvt_gtLoadPictureFromResource( hb_parcx( 2 ),hb_parcx( 3 ) ); - int iSlot = hb_parni( 1 ) - 1 ; + int iSlot = hb_parni( 1 ) - 1; if ( iPicture ) { @@ -3073,7 +3073,7 @@ HB_FUNC( WVT_LOADPEN ) HPEN hPen; int iSlot = hb_parni( 1 ) - 1; - iPenStyle = hb_parni( 2 ) ; + iPenStyle = hb_parni( 2 ); iPenWidth = hb_parni( 3 ); crColor = !HB_ISNUM( 4 ) ? RGB( 0,0,0 ) : ( COLORREF ) hb_parnl( 4 ); @@ -3120,7 +3120,7 @@ HB_FUNC( WVT_SAVESCREEN ) iWidth = iRight - iLeft + 1; iHeight = iBottom - iTop + 1; - hBmp = CreateCompatibleBitmap( _s->hdc, iWidth, iHeight ) ; + hBmp = CreateCompatibleBitmap( _s->hdc, iWidth, iHeight ); hCompDC = CreateCompatibleDC( _s->hdc ); oldBmp = (HBITMAP) SelectObject( hCompDC, hBmp ); @@ -3159,8 +3159,8 @@ HB_FUNC( WVT_RESTSCREEN ) iBottom = xy.y-1; iRight = xy.x-1; - iWidth = iRight - iLeft + 1 ; - iHeight = iBottom - iTop + 1 ; + iWidth = iRight - iLeft + 1; + iHeight = iBottom - iTop + 1; hCompDC = CreateCompatibleDC( _s->hdc ); hBmp = (HBITMAP) SelectObject( hCompDC, ( HBITMAP ) ( HB_PTRDIFF ) hb_parvnint( 5,3 ) ); diff --git a/harbour/contrib/gtwvg/wvgcuig.c b/harbour/contrib/gtwvg/wvgcuig.c index fb7d1f5e31..d1a07a9dba 100644 --- a/harbour/contrib/gtwvg/wvgcuig.c +++ b/harbour/contrib/gtwvg/wvgcuig.c @@ -860,21 +860,21 @@ static void hb_wvg_Line( PHB_GTWVT pWVT, PHB_GOBJS gObj, int iLeft, int iTop, in HPEN hPen, hOldPen; int iOffset; - int x = iLeft ; - int y = iTop ; + int x = iLeft; + int y = iTop; switch ( gObj->iAlign ) { case 0: /* Center */ if ( gObj->iOrient == 0 ) /* Horizontal */ { - iOffset = ( ( iBottom - iTop ) / 2 ) ; - y = iTop + iOffset ; + iOffset = ( ( iBottom - iTop ) / 2 ); + y = iTop + iOffset; } else { - iOffset = ( ( iRight - iLeft ) / 2 ) ; - x = iLeft + iOffset ; + iOffset = ( ( iRight - iLeft ) / 2 ); + x = iLeft + iOffset; } break; @@ -1156,7 +1156,7 @@ HB_FUNC( WVG_SHADEDRECT ) gObj->aOffset.iBottom = hb_parvni( 5,3 ); gObj->aOffset.iRight = hb_parvni( 5,4 ); - gObj->iData = !HB_ISNUM( 6 ) ? GRADIENT_FILL_RECT_H : hb_parni( 6 ) ; + gObj->iData = !HB_ISNUM( 6 ) ? GRADIENT_FILL_RECT_H : hb_parni( 6 ); gObj->vert[ 0 ].x = 0; gObj->vert[ 0 ].y = 0; diff --git a/harbour/contrib/gtwvg/wvggui.c b/harbour/contrib/gtwvg/wvggui.c index 2f27e08708..e369a89908 100644 --- a/harbour/contrib/gtwvg/wvggui.c +++ b/harbour/contrib/gtwvg/wvggui.c @@ -553,7 +553,7 @@ static void hb_gt_wvt_MouseEvent( PHB_GTWVT pWVT, UINT message, WPARAM wParam, L { TRACKMOUSEEVENT tmi; tmi.cbSize = sizeof( TRACKMOUSEEVENT ); - tmi.dwFlags = TME_LEAVE | TME_HOVER ; + tmi.dwFlags = TME_LEAVE | TME_HOVER; tmi.hwndTrack = pWVT->hWnd; tmi.dwHoverTime = 1; pWVT->bTracking = _TrackMouseEvent( &tmi ); @@ -1029,8 +1029,8 @@ static LRESULT CALLBACK hb_gt_wvt_WndProc( HWND hWnd, UINT message, WPARAM wPara { if( lParam == WM_RBUTTONUP ) { - NOTIFYICONDATA tnid ; - tnid.cbSize = sizeof( NOTIFYICONDATA ) ; + NOTIFYICONDATA tnid; + tnid.cbSize = sizeof( NOTIFYICONDATA ); tnid.hWnd = hWnd; tnid.uID = HB_ID_NOTIFYICON; tnid.uCallbackMessage = HB_MSG_NOTIFYICON; @@ -1933,7 +1933,7 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) int mode = hb_arrayGetNI( pInfo->pNewVal2, 1 ); int iIconType = hb_arrayGetNI( pInfo->pNewVal2, 2 ); HICON hIcon = 0; - NOTIFYICONDATA tnid ; + NOTIFYICONDATA tnid; if( iIconType == 0 ) { @@ -1954,16 +1954,16 @@ static HB_BOOL hb_gt_wvt_Info( PHB_GT pGT, int iType, PHB_GT_INFO pInfo ) MAKEINTRESOURCE( ( HB_MAXINT ) hb_arrayGetNInt( pInfo->pNewVal2, 3 ) ) ); } - tnid.cbSize = sizeof( NOTIFYICONDATA ) ; + tnid.cbSize = sizeof( NOTIFYICONDATA ); tnid.hWnd = pWVT->hWnd; tnid.uID = HB_ID_NOTIFYICON; tnid.uFlags = NIF_MESSAGE | NIF_ICON | NIF_TIP; tnid.uCallbackMessage = HB_MSG_NOTIFYICON; - tnid.hIcon = hIcon ; + tnid.hIcon = hIcon; HB_TCHAR_COPYTO( tnid.szTip, hb_arrayGetCPtr( pInfo->pNewVal2, 4 ), HB_SIZEOFARRAY( tnid.szTip ) - 1 ); - Shell_NotifyIcon( mode, &tnid ) ; + Shell_NotifyIcon( mode, &tnid ); if( hIcon ) DestroyIcon( hIcon ); diff --git a/harbour/contrib/gtwvg/wvgutils.c b/harbour/contrib/gtwvg/wvgutils.c index d0bb7d9ce5..d68292fdd2 100644 --- a/harbour/contrib/gtwvg/wvgutils.c +++ b/harbour/contrib/gtwvg/wvgutils.c @@ -137,7 +137,7 @@ HB_FUNC( WVT_CHOOSEFONT ) if ( HB_ISNUM( 2 ) ) { - PointSize = -MulDiv( ( LONG ) hb_parnl( 2 ), GetDeviceCaps( _s->hdc, LOGPIXELSY ), 72 ) ; + PointSize = -MulDiv( ( LONG ) hb_parnl( 2 ), GetDeviceCaps( _s->hdc, LOGPIXELSY ), 72 ); } lf.lfHeight = PointSize; @@ -159,7 +159,7 @@ HB_FUNC( WVT_CHOOSEFONT ) cf.hDC = ( HDC ) NULL; cf.lpLogFont = &lf; cf.iPointSize = 0; - cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_SHOWHELP | CF_INITTOLOGFONTSTRUCT ; + cf.Flags = CF_SCREENFONTS | CF_EFFECTS | CF_SHOWHELP | CF_INITTOLOGFONTSTRUCT; cf.rgbColors = RGB( 0,0,0 ); cf.lCustData = 0L; cf.lpfnHook = ( LPCFHOOKPROC ) NULL; @@ -174,7 +174,7 @@ HB_FUNC( WVT_CHOOSEFONT ) { char * szFaceName = HB_TCHAR_CONVFROM( lf.lfFaceName ); - PointSize = -MulDiv( lf.lfHeight, 72, GetDeviceCaps( _s->hdc, LOGPIXELSY ) ) ; + PointSize = -MulDiv( lf.lfHeight, 72, GetDeviceCaps( _s->hdc, LOGPIXELSY ) ); hb_reta( 9 ); hb_storvc( szFaceName , -1, 1 ); @@ -203,7 +203,7 @@ HB_FUNC( WVT_CHOOSEFONT ) hb_storvni( 0 , -1, 9 ); } - return ; + return; #endif } @@ -215,24 +215,24 @@ HB_FUNC( WVT_CHOOSECOLOR ) { PHB_GTWVT _s = hb_wvt_gtGetWVT(); - CHOOSECOLOR cc ; - COLORREF crCustClr[ 16 ] ; - int i ; + CHOOSECOLOR cc; + COLORREF crCustClr[ 16 ]; + int i; - for( i = 0 ; i < 16 ; i++ ) + for( i = 0; i < 16; i++ ) { - crCustClr[ i ] = ( HB_ISARRAY( 2 ) ? ( COLORREF ) hb_parvnl( 2, i+1 ) : GetSysColor( COLOR_BTNFACE ) ) ; + crCustClr[ i ] = ( HB_ISARRAY( 2 ) ? ( COLORREF ) hb_parvnl( 2, i+1 ) : GetSysColor( COLOR_BTNFACE ) ); } - cc.lStructSize = sizeof( CHOOSECOLOR ) ; - cc.hwndOwner = _s->hWnd ; + cc.lStructSize = sizeof( CHOOSECOLOR ); + cc.hwndOwner = _s->hWnd; cc.rgbResult = HB_ISNUM( 1 ) ? ( COLORREF ) hb_parnl( 1 ) : 0; - cc.lpCustColors = crCustClr ; + cc.lpCustColors = crCustClr; cc.Flags = ( WORD ) ( HB_ISNUM( 3 ) ? hb_parnl( 3 ) : CC_ANYCOLOR | CC_RGBINIT | CC_FULLOPEN ); if ( ChooseColor( &cc ) ) { - hb_retnl( cc.rgbResult ) ; + hb_retnl( cc.rgbResult ); } else { @@ -250,7 +250,7 @@ HB_FUNC( WVT_MESSAGEBOX ) LPTSTR title = HB_TCHAR_CONVTO( hb_parc( 1 ) ); LPTSTR msg = HB_TCHAR_CONVTO( hb_parc( 2 ) ); - hb_retni( MessageBox( _s->hWnd, title, msg, HB_ISNUM( 3 ) ? hb_parni( 3 ) : MB_OK ) ) ; + hb_retni( MessageBox( _s->hWnd, title, msg, HB_ISNUM( 3 ) ? hb_parni( 3 ) : MB_OK ) ); HB_TCHAR_FREE( title ); HB_TCHAR_FREE( msg ); } @@ -429,7 +429,7 @@ HB_FUNC( WVT_SETTOOLTIPTITLE ) iIcon = hb_parni( 1 ); if ( iIcon > 3 ) { - iIcon = 0 ; + iIcon = 0; } SendMessage( _s->hWndTT, TTM_SETTITLE, ( WPARAM ) iIcon, ( LPARAM ) hb_parc( 2 ) ); } @@ -677,7 +677,7 @@ HB_FUNC( WVT_SETMENU ) RECT rc = { 0, 0, 0, 0 }; int height, width; - SetMenu( _s->hWnd, ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ) ) ; + SetMenu( _s->hWnd, ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ) ); GetWindowRect( _s->hWnd, &wi ); GetClientRect( _s->hWnd, &ci ); @@ -702,7 +702,7 @@ HB_FUNC( WVT_SETPOPUPMENU ) { PHB_GTWVT _s = hb_wvt_gtGetWVT(); - HMENU hPopup = _s->hPopup ; + HMENU hPopup = _s->hPopup; _s->hPopup = ( HMENU ) ( HB_PTRDIFF ) hb_parnint( 1 ); if ( hPopup ) @@ -788,7 +788,7 @@ HB_FUNC( WVT_SETMENUKEYEVENT ) if( HB_ISNUM( 1 ) ) _s->MenuKeyEvent = hb_parni( 1 ); - hb_retni( iOldEvent ) ; + hb_retni( iOldEvent ); } /*----------------------------------------------------------------------*/ @@ -797,7 +797,7 @@ HB_FUNC( WVT_DRAWMENUBAR ) { PHB_GTWVT _s = hb_wvt_gtGetWVT(); - DrawMenuBar( _s->hWnd ) ; + DrawMenuBar( _s->hWnd ); } /*----------------------------------------------------------------------*/ @@ -917,7 +917,7 @@ HB_FUNC( WVT_CREATEDIALOGDYNAMIC ) PHB_GTWVT _s = hb_wvt_gtGetWVT(); PHB_ITEM pFirst = hb_param( 3,HB_IT_ANY ); - PHB_ITEM pFunc = NULL ; + PHB_ITEM pFunc = NULL; PHB_DYNS pExecSym; HWND hDlg = 0; int iType = 0; @@ -1045,7 +1045,7 @@ HB_FUNC( WVT_CREATEDIALOGMODAL ) PHB_GTWVT _s = hb_wvt_gtGetWVT(); PHB_ITEM pFirst = hb_param( 3,HB_IT_ANY ); - PHB_ITEM pFunc = NULL ; + PHB_ITEM pFunc = NULL; PHB_DYNS pExecSym; int iIndex; int iResource = hb_parni( 4 ); @@ -1132,10 +1132,10 @@ HB_FUNC( WVT_CREATEDIALOGMODAL ) HB_FUNC( WVT__MAKEDLGTEMPLATE ) { - WORD *p, *pdlgtemplate ; - WORD nItems = ( WORD ) hb_parvni( 1, 4 ) ; - int i, nchar ; - DWORD lStyle ; + WORD *p, *pdlgtemplate; + WORD nItems = ( WORD ) hb_parvni( 1, 4 ); + int i, nchar; + DWORD lStyle; /* Parameters: 12 arrays */ /* 1 for DLG template */ @@ -1143,103 +1143,104 @@ HB_FUNC( WVT__MAKEDLGTEMPLATE ) /* 64k allow to build up to 255 items on the dialog */ /* */ - pdlgtemplate = p = ( PWORD ) LocalAlloc( LPTR, 65534 ) ; + pdlgtemplate = p = ( PWORD ) LocalAlloc( LPTR, 65534 ); - lStyle = hb_parvnl(1,3) ; + lStyle = hb_parvnl(1,3); /* start to fill in the dlgtemplate information. addressing by WORDs */ - *p++ = 1 ; /* version */ - *p++ = 0xFFFF ; /* signature */ - *p++ = LOWORD ( hb_parvnl(1,1) ) ; /* Help Id */ - *p++ = HIWORD ( hb_parvnl(1,1) ) ; + *p++ = 1; /* version */ + *p++ = 0xFFFF; /* signature */ + *p++ = LOWORD ( hb_parvnl(1,1) ); /* Help Id */ + *p++ = HIWORD ( hb_parvnl(1,1) ); - *p++ = LOWORD ( hb_parvnl(1,2) ) ; /* ext. style */ - *p++ = HIWORD ( hb_parvnl(1,2) ) ; + *p++ = LOWORD ( hb_parvnl(1,2) ); /* ext. style */ + *p++ = HIWORD ( hb_parvnl(1,2) ); - *p++ = LOWORD (lStyle) ; - *p++ = HIWORD (lStyle) ; + *p++ = LOWORD (lStyle); + *p++ = HIWORD (lStyle); - *p++ = (WORD) nItems ; /* NumberOfItems */ - *p++ = (short) hb_parvni(1,5) ; /* x */ - *p++ = (short) hb_parvni(1,6) ; /* y */ - *p++ = (short) hb_parvni(1,7) ; /* cx */ - *p++ = (short) hb_parvni(1,8) ; /* cy */ - *p++ = (short) 0 ; /* Menu (ignored for now.) */ - *p++ = (short) 0x00 ; /* Class also ignored */ + *p++ = (WORD) nItems; /* NumberOfItems */ + *p++ = (short) hb_parvni(1,5); /* x */ + *p++ = (short) hb_parvni(1,6); /* y */ + *p++ = (short) hb_parvni(1,7); /* cx */ + *p++ = (short) hb_parvni(1,8); /* cy */ + *p++ = (short) 0; /* Menu (ignored for now.) */ + *p++ = (short) 0x00; /* Class also ignored */ if ( hb_parinfa( 1,11 ) == HB_IT_STRING ) { - nchar = nCopyAnsiToWideChar( p, (LPCSTR) hb_parvc( 1,11 ) ) ; - p += nchar ; + nchar = nCopyAnsiToWideChar( p, (LPCSTR) hb_parvc( 1,11 ) ); + p += nchar; } else { - *p++ =0 ; + *p++ = 0; } /* add in the wPointSize and szFontName here iff the DS_SETFONT bit on */ if ( ( lStyle & DS_SETFONT ) ) { - *p++ = (short) hb_parvni(1,12) ; - *p++ = (short) hb_parvni(1,13) ; - *p++ = (short) hb_parvni(1,14) ; + *p++ = (short) hb_parvni(1,12); + *p++ = (short) hb_parvni(1,13); + *p++ = (short) hb_parvni(1,14); - nchar = nCopyAnsiToWideChar( p, (LPCSTR) hb_parvc( 1,15 ) ) ; - p += nchar ; - } ; + nchar = nCopyAnsiToWideChar( p, (LPCSTR) hb_parvc( 1,15 ) ); + p += nchar; + } - for ( i = 1 ; i <= nItems ; i++ ) { + for ( i = 1; i <= nItems; i++ ) + { /* make sure each item starts on a DWORD boundary */ - p = lpwAlign (p) ; + p = lpwAlign (p); - *p++ = LOWORD ( hb_parvnl(2,i) ) ; /* help id */ - *p++ = HIWORD ( hb_parvnl(2,i) ) ; + *p++ = LOWORD ( hb_parvnl(2,i) ); /* help id */ + *p++ = HIWORD ( hb_parvnl(2,i) ); - *p++ = LOWORD ( hb_parvnl(3,i) ) ; /* ext. style */ - *p++ = HIWORD ( hb_parvnl(3,i) ) ; + *p++ = LOWORD ( hb_parvnl(3,i) ); /* ext. style */ + *p++ = HIWORD ( hb_parvnl(3,i) ); - *p++ = LOWORD ( hb_parvnl(4,i) ) ; /* style */ - *p++ = HIWORD ( hb_parvnl(4,i) ) ; + *p++ = LOWORD ( hb_parvnl(4,i) ); /* style */ + *p++ = HIWORD ( hb_parvnl(4,i) ); - *p++ = (short) hb_parvni(5,i) ; /* x */ - *p++ = (short) hb_parvni(6,i) ; /* y */ - *p++ = (short) hb_parvni(7,i) ; /* cx */ - *p++ = (short) hb_parvni(8,i) ; /* cy */ + *p++ = (short) hb_parvni(5,i); /* x */ + *p++ = (short) hb_parvni(6,i); /* y */ + *p++ = (short) hb_parvni(7,i); /* cx */ + *p++ = (short) hb_parvni(8,i); /* cy */ - *p++ = LOWORD ( hb_parvnl(9,i) ) ; /* id */ - *p++ = HIWORD ( hb_parvnl(9,i) ) ; /* id */ + *p++ = LOWORD ( hb_parvnl(9,i) ); /* id */ + *p++ = HIWORD ( hb_parvnl(9,i) ); /* id */ if ( hb_parinfa( 10,i ) == HB_IT_STRING ) { - nchar = nCopyAnsiToWideChar( p, (LPCSTR) hb_parvc( 10,i ) ) ; /* class */ - p += nchar ; - } + nchar = nCopyAnsiToWideChar( p, (LPCSTR) hb_parvc( 10,i ) ); /* class */ + p += nchar; + } else - { - *p++ = 0xFFFF ; - *p++ = (WORD) hb_parvni(10,i) ; - } + { + *p++ = 0xFFFF; + *p++ = (WORD) hb_parvni(10,i); + } if ( hb_parinfa( 11,i ) == HB_IT_STRING ) - { - nchar = nCopyAnsiToWideChar( p, (LPCSTR) hb_parvc( 11,i ) ) ; /* text */ - p += nchar ; - } + { + nchar = nCopyAnsiToWideChar( p, (LPCSTR) hb_parvc( 11,i ) ); /* text */ + p += nchar; + } else - { - *p++ = 0xFFFF ; - *p++ = (WORD) hb_parvni(11,i) ; - } + { + *p++ = 0xFFFF; + *p++ = (WORD) hb_parvni(11,i); + } - *p++ = 0x00 ; /* extras ( in array 12 ) */ - }; + *p++ = 0x00; /* extras ( in array 12 ) */ + } - p = lpwAlign( p ); + p = lpwAlign( p ); - hb_retclen( ( LPSTR ) pdlgtemplate, ( ( HB_PTRDIFF ) p - ( HB_PTRDIFF ) pdlgtemplate ) ) ; + hb_retclen( ( LPSTR ) pdlgtemplate, ( ( HB_PTRDIFF ) p - ( HB_PTRDIFF ) pdlgtemplate ) ); - LocalFree( LocalHandle( pdlgtemplate ) ); + LocalFree( LocalHandle( pdlgtemplate ) ); } /*----------------------------------------------------------------------*/ @@ -1499,7 +1500,7 @@ HB_FUNC( WVT__GETOPENFILENAME ) memset( &ofn, 0, sizeof( ofn ) ); - ofn.hInstance = GetModuleHandle( NULL ) ; + ofn.hInstance = GetModuleHandle( NULL ); ofn.lStructSize = sizeof( ofn ); ofn.hwndOwner = HB_ISNUM( 1 ) ? ( HWND ) ( HB_PTRDIFF ) hb_parnint( 1 ) : GetActiveWindow(); ofn.lpstrTitle = lpstrTitle;