diff --git a/src/WNT/Degrees.hxx b/src/WNT/Degrees.hxx deleted file mode 100755 index 8c73ba9df0..0000000000 --- a/src/WNT/Degrees.hxx +++ /dev/null @@ -1,20 +0,0 @@ -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - -#define pi 3.1415926535897932385 -#define DEG(x) float(((x)*pi)/180.) - diff --git a/src/WNT/EHDC.cxx b/src/WNT/EHDC.cxx deleted file mode 100755 index db6a88c896..0000000000 --- a/src/WNT/EHDC.cxx +++ /dev/null @@ -1,1668 +0,0 @@ -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - -// Modifications: PLOTNIKOV Eugeny at July 1998 (BUC60286) - -#include "EHDC.hxx" - -#include -#include - -#define ROUNDL( d ) ( LONG )( ( d ) + 0.5 ) -#define Y( y ) ( mySize.cy - ( y ) ) - -typedef struct _fpoint { - - FLOAT x; - FLOAT y; - - } FPOINT, *PFPOINT; - -typedef struct _ddap { - - EHDC* _this; - PPOINT pp; - - } DDAP, *PDDAP; - -static void WINAPI _XFORMultiply ( PXFORM, PXFORM, PXFORM ); -static void WINAPI _XFORMApply ( PPOINT, int, PXFORM ); -static void WINAPI _XFORMApplyf ( PFPOINT, int, PXFORM ); - -static void WINAPI _RenderPath ( HDC, LPPOINT, PBYTE, int ); -static int WINAPI _TextPath ( HDC, int, int, void*, LPPOINT, PBYTE, int, PSIZE, BOOL ); - -EHDC :: EHDC ( HDC hdc, PSIZE szClient ) { - - _Init (); - - SetDC ( hdc, szClient ); - -} // end EHDC constructor ( 1 ) - -EHDC :: EHDC () { - - _Init (); - -} // end EHDC constructor ( 2 ) - -EHDC :: ~EHDC () { - - HANDLE hHeap = GetProcessHeap (); - - if ( myHDC != NULL ) { - - SelectPen( myHDC, GetStockObject ( NULL_PEN ) ); - SelectBrush( myHDC, GetStockObject ( NULL_BRUSH ) ); - - } // end if - - if ( myTextBrush != NULL ) DeleteBrush( myTextBrush ); - if ( myTextPen != NULL ) DeletePen( myTextPen ); - - if ( myTextPath != NULL ) HeapFree ( - hHeap, 0, - ( LPVOID )myTextPath - ); - if ( myPStyle != NULL && ( myFlags & EHDCF_SFREE ) ) - - HeapFree ( hHeap, 0, ( LPVOID )myPStyle ); - - if ( myPBrush != NULL ) DeleteBrush( myPBrush ); - if ( myPPen != NULL ) DeletePen( myPPen ); - - if ( myFlags & EHDCF_PPUSH ) { - - if ( myPPenPush != NULL ) DeletePen( myPPenPush ); - if ( myPBrushPush != NULL ) DeleteBrush( myPBrushPush ); - - } // end if - - HeapFree ( hHeap, 0, ( LPVOID )myDDA1 ); - HeapFree ( hHeap, 0, ( LPVOID )myDDA2 ); - -} // end EHDC destructor - -void EHDC :: SetDC ( HDC hdc, PSIZE szClient ) { - - myHDC = hdc; - myTextHScale = - myTextVScale = 1.0; - myTextSlant = 0.0; - mySize = *szClient; - - SelectPen( myHDC, myPPen ); - SelectBrush( myHDC, myPBrush ); - - MoveToEx ( 0, 0, NULL ); - ResetURect (); - -} // end EHDC :: SetDC - -HBRUSH EHDC :: SelectEPen ( - DWORD dwWidth, - CONST LOGBRUSH* lplb, - DWORD dwStyleCount, - DWORD* lpStyle, - BOOL fNoAlloc - ) { - - DWORD dwLen = dwStyleCount * sizeof ( DWORD ); - - if ( dwStyleCount ) { - - if ( !fNoAlloc ) { - - if ( myPStyle == NULL ) { - - myPStyle = ( PDWORD )HeapAlloc ( - GetProcessHeap (), - HEAP_GENERATE_EXCEPTIONS, - dwLen - ); -setPBS: - myPBS = dwStyleCount; - - } else if ( myPBS < dwStyleCount ) { - - myPStyle = ( PDWORD )HeapReAlloc ( - GetProcessHeap (), - HEAP_GENERATE_EXCEPTIONS, - myPStyle, dwLen - ); - - goto setPBS; - - } // end if - - CopyMemory ( myPStyle, lpStyle, dwLen ); - myFlags |= EHDCF_SFREE; - - } else if ( myPStyle != NULL && ( myFlags & EHDCF_SFREE ) ) { - - HeapFree ( GetProcessHeap (), 0, ( LPVOID )myPStyle ); - myPStyle = lpStyle; - - } // end if - - } // end if - - myPIndex = 0; - myPWidth = dwWidth; - myPNS = dwStyleCount; - - if ( myPBrush != NULL ) { - - LOGBRUSH lb; - - GetObject ( myPBrush, sizeof ( LOGBRUSH ), &lb ); - - if ( lb.lbStyle != lplb -> lbStyle || - lb.lbColor != lplb -> lbColor || - lb.lbHatch != lplb -> lbHatch - ) { - - SelectBrush( myHDC, GetStockObject ( NULL_BRUSH ) ); - DeleteBrush( myPBrush ); -newBrush: - myPBrush = CreateBrushIndirect ( lplb ); - - } // end if - - if ( dwWidth > 1 ) { - - myFlags |= ( EHDCF_EPEN | EHDCF_PDRAW | EHDCF_CJOIN ); - myFlags &= ~EHDCF_JOIN; - - } else myFlags &= ~EHDCF_EPEN; - - } else goto newBrush; - - if ( myPPen != NULL ) { - - LOGPEN lp; - - GetObject ( myPPen, sizeof ( LOGPEN ), &lp ); - - if ( lp.lopnColor != lplb -> lbColor || - lp.lopnWidth.x != 0 - ) { - - SelectPen( myHDC, GetStockObject ( NULL_PEN ) ); - DeletePen( myPPen ); -newPen: - myPPen = CreatePen ( PS_SOLID, 0, lplb -> lbColor ); - - } // end if - - } else goto newPen; - - SelectPen( myHDC, myPPen ); - - return SelectBrush( myHDC, myPBrush ); - -} // end EHDC :: SelectEPen - -void EHDC :: SelectEPen ( - DWORD dwWidth, - CONST LOGBRUSH* lplb - ) { - - if ( dwWidth == 0xFFFFFFFF && ( myFlags & EHDCF_PPUSH ) ) { - - SelectPen( myHDC, myPPenPush ); - SelectBrush( myHDC, myPBrushPush ); - DeletePen( myPPen ); - DeleteBrush( myPBrush ); - - myFlags &= ~EHDCF_PPUSH; - myPPen = myPPenPush; - myPBrush = myPBrushPush; - myPWidth = myPWPush; - myFlags |= ( myfXpenPush ? EHDCF_EPEN : 0 ); - - } else if ( !( myFlags & EHDCF_PPUSH ) ){ - - myFlags |= EHDCF_PPUSH; - myfXpenPush = ( myFlags & EHDCF_EPEN ); - myPPenPush = myPPen; - myPBrushPush = myPBrush; - myPWPush = myPWidth; - - myPWidth = dwWidth; - SelectBrush( myHDC, myPBrush = CreateBrushIndirect ( lplb ) ); - SelectPen( myHDC, myPPen = CreatePen ( PS_SOLID, 0, lplb -> lbColor ) ); - - if ( dwWidth > 1 ) { - - myFlags |= ( EHDCF_EPEN | EHDCF_PDRAW | EHDCF_CJOIN ); - myFlags &= ~EHDCF_JOIN; - - } else myFlags &= ~EHDCF_EPEN; - - } // end if - -} // end EHDC :: SelectEPen - -HPEN EHDC :: SelectEPen ( HPEN hPen ) { - - HPEN retVal = NULL; - - if ( myHDC != NULL ) retVal = SelectPen( myHDC, hPen ); - - myFlags &= ~EHDCF_EPEN; - - return hPen; - -} // end EHDC :: SelectEPen - -void EHDC :: SelectEBrush ( PLOGBRUSH lplb, PLOGBRUSH lplbo ) { - - if ( lplb == NULL ) { - - DeleteBrush( myBrush ); - myBrush = NULL; - - } else if ( myBrush != NULL ) { - - LOGBRUSH lb; - - GetObject ( myBrush, sizeof ( LOGBRUSH ), &lb ); - - if ( lplbo != NULL ) *lplbo = lb; - - if ( lb.lbStyle != lplb -> lbStyle || - lb.lbColor != lplb -> lbColor || - lb.lbHatch != lplb -> lbHatch - ) { - - DeleteBrush( myBrush ); -newBrush: - myBrush = CreateBrushIndirect ( lplb ); - - } // end if - - } else goto newBrush; - -} // end EHDC :: SelectEBrush - -void EHDC :: SetMiter ( BOOL fMiter ) { - - if ( fMiter ) - - myFlags &= ~EHDCF_JBEVL; - - else - - myFlags |= EHDCF_JBEVL; - -} // end EHDC :: SetMiter - -void EHDC :: MoveToEx ( int x, int y, LPPOINT lpPoint ) { - - if ( lpPoint != NULL ) *lpPoint = myStart; - - myStart.x = x; - myStart.y = y; - - if ( myFlags & EHDCF_XFORM ) _XFORMApply ( &myStart, 1, &myXform ); - - myStart.y = Y( myStart.y ); - Register ( &myStart, 1 ); - - ::MoveToEx ( myHDC, myStart.x, myStart.y, NULL ); - - myClose = myStart; - myPIndex = 0; - myFlags &= ~EHDCF_JOIN; - myFlags |= ( EHDCF_PDRAW | EHDCF_DDAF ); - myPIndex = 0; - myPRlen = 0; - -} // end EHDC :: MoveToEx - -BOOL EHDC :: LineTo ( int x, int y ) { - - POINT p = { x, y }; - - if ( myFlags & EHDCF_XFORM ) _XFORMApply ( &p, 1, &myXform ); - - p.y = Y( p.y ); - - if ( myFlags & EHDCF_EPEN ) { - - if ( myPNS == 0 ) - - _DrawTo ( &p ); - - else if ( !_DrawToEx ( &p ) ) return FALSE; - - if ( myFlags & EHDCF_CJOIN ) { - - myFlags &= ~EHDCF_CJOIN; - myCJoin = p; - - } // end if - - if ( myFlags & EHDCF_JOIN ) - - _Join (); - - else - - myJoin = p; - - if ( myFlags & EHDCF_PDRAW && !( myFlags & EHDCF_NJOIN ) ) - - myFlags |= EHDCF_JOIN; - - else - - myFlags &= ~( EHDCF_JOIN | EHDCF_NJOIN ); - - } else if ( myPNS == 0 ) { - - Register ( &p, 1 ); - - ::LineTo ( myHDC, p.x, p.y ); - - myStart = p; - - } else _LineTo ( &p ); - - return TRUE; - -} // end EHDC :: LineTo - -void EHDC :: ClosePath ( void ) { - - BOOL ltf; - POINT pa = myStart; - POINT pb = myClose; - DWORD dw = ( myFlags & EHDCF_XFORM ); - - myFlags &= ~EHDCF_XFORM; - - if ( myStart.x != myClose.x || - myStart.y != myClose.y - ) { - - ltf = LineTo ( myClose.x, Y( myClose.y ) ); - - myFlags |= dw; - - if ( ltf && ( myFlags & EHDCF_PDRAW ) && ( myFlags & EHDCF_EPEN ) ) { - - myA = pa; - myB = pb; - myStart = myCJoin; - - _Join (); - - } // end if - - } else myFlags |= dw; - - myFlags &= ~EHDCF_JOIN; - myPIndex = 0; - myFlags |= ( EHDCF_PDRAW | EHDCF_CJOIN ); - myPRlen = 0; - -} // end EHDC :: ClosePath - -void EHDC :: Polyline ( CONST POINT* lpPts, int nPts, BOOL fClose ) { - - DWORD dwPIndex = myPIndex; - DWORD dwPRlen = myPRlen; - DWORD dwFlags = myFlags; - POINT pA = myA; - POINT pB = myB; - POINT pClose = myClose; - POINT pJoin = myJoin; - POINT pCJoin = myCJoin; - POINT pStart; - - myFlags |= EHDCF_CJOIN; - - MoveToEx ( lpPts -> x, lpPts -> y, &pStart ); - - for ( int i = 1; i < nPts; ++i ) - - LineTo ( lpPts[ i ].x, lpPts[ i ].y ); - - if ( fClose ) ClosePath (); - - myFlags = dwFlags; - myA = pA; - myB = pB; - myClose = pClose; - myJoin = pJoin; - myCJoin = pCJoin; - myStart = pStart; - myPRlen = dwPRlen; - myPIndex = dwPIndex; - -} // end EHDC :: Polyline - -void EHDC :: Polygon ( CONST POINT* lpPts, int nPts, DWORD dwFlags ) { - - POINT p; - HPEN hpo = SelectPen( myHDC, GetStockObject ( NULL_PEN ) ); - HBRUSH hbo = SelectBrush( myHDC, myBrush ? myBrush : GetStockObject ( NULL_BRUSH ) ); - - BeginPath ( myHDC ); - - p.x = lpPts -> x; - p.y = lpPts -> y; - - if ( myFlags & EHDCF_XFORM ) _XFORMApply ( &p, 1, &myXform ); - - ::MoveToEx ( myHDC, p.x, Y( p.y ), NULL ); - - for ( int i = 1; i < nPts; ++i ) { - - p.x = lpPts[ i ].x; - p.y = lpPts[ i ].y; - - if ( myFlags & EHDCF_XFORM ) _XFORMApply ( &p, 1, &myXform ); - - ::LineTo ( myHDC, p.x, Y( p.y ) ); - - } // end for - - CloseFigure ( myHDC ); - - EndPath ( myHDC ); - - FillPath ( myHDC ); - - SelectBrush( myHDC, hbo ); - SelectPen( myHDC, hpo ); - - if ( dwFlags & POLYF_NOCLOSEDGE ) - - Polyline ( lpPts, nPts, FALSE ); - - else if ( !( dwFlags & POLYF_NOEDGE ) ) - - Polyline ( lpPts, nPts, TRUE ); - -} // end EHDC :: Polygon - -void EHDC :: Arc ( - int x, int y, int xr, int yr, double sa, double oa, DWORD dwAFlags - ) { - - int i = 0, j, n; - double delta; - FPOINT fp[ 362 ]; - BOOL fXform = ( myFlags & EHDCF_XFORM ); - DWORD dwPIndex = myPIndex; - DWORD dwPRlen = myPRlen; - DWORD dwFlags = myFlags; - POINT pA = myA; - POINT pB = myB; - POINT pClose = myClose; - POINT pJoin = myJoin; - POINT pCJoin = myCJoin; - POINT pStart = myStart; - - myFlags &= ~EHDCF_XFORM; - - if ( oa > 6.28318 ) - - oa = 6.28318; - - else if ( oa < -6.28318 ) - - oa = -6.28318; - - n = abs ( ROUNDL( oa * 180.0 / 3.14159 ) ); - delta = oa / n; - - fp[ i ].x = ( FLOAT )x; - fp[ i++ ].y = ( FLOAT )y; - n += 2; - - for ( ; i < n; ++i, sa += delta ) { - - fp[ i ].x = FLOAT( x + xr * cos ( sa ) ); - fp[ i ].y = FLOAT( y + yr * sin ( sa ) ); - - } // end for - - if ( fXform ) _XFORMApplyf ( fp, n, &myXform ); - - i = 0; - - if ( dwAFlags & ARCF_PIE ) { - - myFlags &= ~EHDCF_JBEVL; - MoveToEx ( ROUNDL( fp[ 0 ].x ), ROUNDL( fp[ 0 ].y ), NULL ); - LineTo ( ROUNDL( fp[ 1 ].x ), ROUNDL( fp[ 1 ].y ) ); - - ++i; - - if ( i >= n ) goto end; - - LineTo ( ROUNDL( fp[ i ].x ), ROUNDL( fp[ i ].y ) ); - - ++i; - - } else { - - MoveToEx ( ROUNDL( fp[ 1 ].x ), ROUNDL( fp[ 1 ].y ), NULL ); - ++i; - - } // end else - - myFlags |= EHDCF_JBEVL; - - for ( j = i - 1; i < n; ++i ) { - - x = ROUNDL( fp[ i ].x ); - y = ROUNDL( fp[ i ].y ); - - if ( x == ROUNDL( fp[ j ].x ) && y == ROUNDL( fp[ j ].y ) ) continue; - - LineTo ( x, y ); - j = i; - - } // end for -end: - if ( dwAFlags & ( ARCF_PIE | ARCF_CHORD ) || fabs ( oa ) == 6.28318 ) { - - myFlags &= ~EHDCF_JBEVL; - ClosePath (); - - } // end if - - myFlags = dwFlags; - myA = pA; - myB = pB; - myClose = pClose; - myJoin = pJoin; - myCJoin = pCJoin; - myStart = pStart; - myPRlen = dwPRlen; - myPIndex = dwPIndex; - -} // end EHDC :: Arc - -void EHDC :: Polyarc ( - int x, int y, int xr, int yr, double sa, double oa, BOOL fChord - ) { - - int i = 0, n; - double ssa = sa, delta; - FPOINT fp[ 362 ]; - BOOL fXform = ( myFlags & EHDCF_XFORM ); - - if ( oa > 6.28318 ) - - oa = 6.28318; - - else if ( oa < -6.28318 ) - - oa = -6.28318; - - n = abs ( ROUNDL( oa * 180.0 / 3.14159 ) ); - delta = oa / n; - - fp[ i ].x = ( FLOAT )x; - fp[ i++ ].y = ( FLOAT )y; - n += 2; - - for ( ; i < n; ++i, sa += delta ) { - - fp[ i ].x = FLOAT( x + xr * cos ( sa ) ); - fp[ i ].y = FLOAT( y + yr * sin ( sa ) ); - - } // end for - - if ( fXform ) _XFORMApplyf ( fp, n, &myXform ); - - i = 0; - - HPEN hpo = SelectPen( myHDC, GetStockObject ( NULL_PEN ) ); - HBRUSH hbo = SelectBrush( myHDC, myBrush ? myBrush : GetStockObject ( NULL_BRUSH ) ); - - BeginPath ( myHDC ); - - if ( !fChord ) { - - ::MoveToEx ( - myHDC, - ROUNDL( fp[ 0 ].x ), Y( ROUNDL( fp[ 0 ].y ) ), NULL - ); - ::LineTo ( - myHDC, - ROUNDL( fp[ 1 ].x ), Y( ROUNDL( fp[ 1 ].y ) ) - ); - - ++i; - - if ( i >= n ) goto end; - - ::LineTo ( - myHDC, - ROUNDL( fp[ i ].x ), Y( ROUNDL( fp[ i ].y ) ) - ); - - } else { - - ::MoveToEx ( - myHDC, - ROUNDL( fp[ 1 ].x ), Y( ROUNDL( fp[ 1 ].y ) ), NULL - ); - ++i; - - } // end else - - for ( ; i < n; ++i ) ::LineTo ( - myHDC, - ROUNDL( fp[ i ].x ), Y( ROUNDL( fp[ i ].y ) ) - ); -end: - CloseFigure ( myHDC ); - - EndPath ( myHDC ); - - FillPath ( myHDC ); - - SelectBrush( myHDC, hbo ); - SelectPen( myHDC, hpo ); - - Arc ( x, y, xr, yr, ssa, oa, fChord ? ARCF_CHORD : ARCF_PIE ); - -} // end EHDC :: Polyarc - -void EHDC :: SetPixel ( int x, int y, COLORREF c ) { - - POINT p = { x, y }; - - if ( myFlags & EHDCF_XFORM ) _XFORMApply ( &p, 1, &myXform ); - - p.y = Y( p.y ); - - ::SetPixel ( myHDC, p.x, p.y, c ); - -} // end EHDC :: SetPixel - -void EHDC :: SetTextColor ( COLORREF c ) { - - LOGPEN lp; - - GetObject ( myTextPen, sizeof ( LOGPEN ), &lp ); - - if ( lp.lopnColor != c ) { - - LOGBRUSH lb = { BS_SOLID, c, 0 }; - - if ( myTextBrush != NULL ) DeleteBrush( myTextBrush ); - if ( myTextPen != NULL ) DeletePen( myTextPen ); - - myTextPen = CreatePen ( PS_SOLID, 0, c ); - myTextBrush = CreateBrushIndirect ( &lb ); - - } // end if - -} // end EHDC :: SetTextColor - -void EHDC :: SetTextAttrib ( COLORREF c, HFONT f, double slant, double hs, double vs ) { - - SetTextColor ( c ); - - myTextFont = f; - myTextSlant = slant; - myTextHScale = hs; - myTextVScale = vs; - -} // end EHDC :: SetTextAttrib - -void EHDC :: ETextOut ( int x, int y, char* str, double angle, BOOL fOutline ) { - - _ETextOut ( x, y, str, angle, fOutline ); - -} // end EHDC :: TextOut - -void EHDC :: ETextOut ( int x, int y, wchar_t* str, double angle, BOOL fOutline ) { - - _ETextOut ( x, y, str, angle, fOutline, TRUE ); - -} // end EHDC :: TextOut - -void EHDC :: PolyTextOut ( - int x, int y, char* str, double angle, - double margin, BOOL fOutline, BOOL fNofill, BOOL fNoframe - ) { - - _PolyTextOut ( x, y, str, angle, margin, fOutline, FALSE, fNofill, fNoframe ); - -} // end EHDC :: PolyTextOut - -void EHDC :: PolyTextOut ( - int x, int y, wchar_t* str, double angle, double margin, - BOOL fOutline, BOOL fNofill, BOOL fNoframe - ) { - - _PolyTextOut ( x, y, str, angle, margin, fOutline, TRUE, fNofill, fNoframe ); - -} // end EHDC :: PolyTextOut - -void EHDC :: SetWorldTransform ( XFORM* xf ) { - - if ( xf == NULL ) - - myFlags &= ~EHDCF_XFORM; - - else { - - myXform = *xf; - myFlags |= EHDCF_XFORM; - - } // end else - -} // end EHDC :: SetWorldTransform - -void EHDC :: ModifyWorldTransform ( XFORM* xf, DWORD iMode ) { - - XFORM rxf; - PXFORM pxfLeft; - PXFORM pxfRight; - - if ( iMode == MWT_RIGHTMULTIPLY ) { - - pxfLeft = &myXform; - pxfRight = xf; - - } else if ( iMode == MWT_LEFTMULTIPLY ) { - - pxfLeft = xf; - pxfRight = &myXform; - - } else if ( iMode == MWT_IDENTITY ) { - - myXform.eM11 = 1.0F; myXform.eM12 = 0.0F; - myXform.eM21 = 0.0F; myXform.eM22 = 1.0F; - myXform.eDx = 0.0F; myXform.eDy = 0.0F; - - myFlags &= ~EHDCF_XFORM; - - return; - - } else return; - - _XFORMultiply ( &rxf, pxfLeft, pxfRight ); - - myXform = rxf; - myFlags |= EHDCF_XFORM; - -} // end EHDC :: ModifyWorldTransform - -void EHDC :: Transform ( LPPOINT p, int n ) { - - _XFORMApply ( p, n, &myXform ); - -} // end TransformXY - -void EHDC :: ResetURect ( void ) { - - myURect.left = LONG_MAX; - myURect.top = LONG_MAX; - myURect.right = LONG_MIN; - myURect.bottom = LONG_MIN; - -} // end EHDC :: ResetURect - -void EHDC :: GetURect ( LPRECT lpRect ) { - - *lpRect = myURect; - - if ( lpRect -> top < 0 ) lpRect -> top = 0; - if ( lpRect -> left < 0 ) lpRect -> left = 0; - if ( lpRect -> bottom > mySize.cy ) lpRect -> bottom = mySize.cy; - if ( lpRect -> right > mySize.cx ) lpRect -> right = mySize.cx; - -} // end EHDC :: GetURect - -void EHDC :: _Init ( void ) { - - myTextPen = ( HPEN )GetStockObject ( WHITE_PEN ); - myTextBrush = ( HBRUSH )GetStockObject ( WHITE_BRUSH ); - myTextFont = NULL; - myTextPath = NULL; - myPPen = myTextPen; - myPBrush = - myBrush = myTextBrush; - myPStyle = NULL; - myTextBS = - myPBS = - myPNS = 0; - myFlags = 0; - myTextSlant = 0.0; - myTextHScale = - myTextVScale = 1.0; - myNDDA = 1024; - myDDA1 = ( PPOINT )HeapAlloc ( - GetProcessHeap (), HEAP_GENERATE_EXCEPTIONS, - sizeof ( POINT ) * myNDDA - ); - myDDA2 = ( PPOINT )HeapAlloc ( - GetProcessHeap (), HEAP_GENERATE_EXCEPTIONS, - sizeof ( POINT ) * myNDDA - ); - myIDDA = 0; - - ModifyWorldTransform ( NULL, MWT_IDENTITY ); - myFlags &= ~EHDCF_XFORM; - -} // end EHDC :: _Init - -void EHDC :: _DrawTo ( PPOINT p ) { - - POINT ip[ 4 ]; - double dx, dy, dxhw, dyhw, factor; - - dx = ( double )( p -> x - myStart.x ); - dy = ( double )( p -> y - myStart.y ); - - if ( dx == 0.0 && dy == 0.0 ) return; - - factor = myPWidth / 2.0 / sqrt ( dx * dx + dy * dy ); - dxhw = dy * factor; - dyhw = dx * factor; - - ip[ 0 ].x = ROUNDL( myStart.x + dxhw ); - ip[ 0 ].y = ROUNDL( myStart.y - dyhw ); - - ip[ 1 ].x = ROUNDL( p -> x + dxhw ); - ip[ 1 ].y = ROUNDL( p -> y - dyhw ); - - ip[ 2 ].x = ROUNDL( p -> x - dxhw ); - ip[ 2 ].y = ROUNDL( p -> y + dyhw ); - - ip[ 3 ].x = ROUNDL( myStart.x - dxhw ); - ip[ 3 ].y = ROUNDL( myStart.y + dyhw ); - - Register ( ip, 4 ); - - ::Polygon ( myHDC, ip, 4 ); - - myA = myB; - myB = myStart; - myStart = *p; - -} // end EHDC :: _DrawTo - -void EHDC :: _Join ( void ) { - - int np; - POINT p[ 4 ]; - double r, ba, bc, dxba, dyba, dxbc, dybc, - s, sa, fc, xd, yd, xe, ye, - xf, yf, m1, m2, n1, - n2, rm1, rm2, rn1, rn2; - - r = myPWidth / 2.0; - dxba = ( double )( myA.x - myB.x ); dyba = ( FLOAT )( myA.y - myB.y ); - dxbc = ( double )( myStart.x - myB.x ); dybc = ( FLOAT )( myStart.y - myB.y ); - ba = sqrt ( dxba * dxba + dyba * dyba ); - bc = sqrt ( dxbc * dxbc + dybc * dybc ); - - if ( ba == 0.0 || bc == 0.0 ) return; - - n1 = -dxba / ba; n2 = dyba / ba; - m1 = -dxbc / bc; m2 = dybc / bc; - s = m1 * n2 - n1 * m2; - - if ( ( sa = fabs ( s ) ) < 0.001 ) return; - - fc = r / sa; - xd = myB.x + fc * ( m1 + n1 ); - yd = myB.y - fc * ( m2 + n2 ); - rm1 = r * m1; rm2 = r * m2; - rn1 = r * n1; rn2 = r * n2; - - if ( s > 0.0 ) { - - xe = myB.x - rm2; ye = myB.y - rm1; - xf = myB.x + rn2; yf = myB.y + rn1; - - } else if ( s < 0.0 ) { - - xe = myB.x + rm2; ye = myB.y + rm1; - xf = myB.x - rn2; yf = myB.y - rn1; - - } else return; - - p[ 0 ] = myB; - p[ 1 ].x = ROUNDL( xf ); p[ 1 ].y = ROUNDL( yf ); - - if ( !( myFlags & EHDCF_JBEVL ) ) { - - p[ 2 ].x = ROUNDL( xd ); p[ 2 ].y = ROUNDL( yd ); - p[ 3 ].x = ROUNDL( xe ); p[ 3 ].y = ROUNDL( ye ); - np = 4; - - } else { - - p[ 2 ].x = ROUNDL( xe ); p[ 2 ].y = ROUNDL( ye ); - np = 3; - - } // end else - - Register ( p, np ); -#if 0 - ::SetPixel ( myHDC, p[ 0 ].x, p[ 0 ].y, RGB( 255, 255, 255 ) ); - ::SetPixel ( myHDC, p[ 1 ].x, p[ 1 ].y, RGB( 255, 255, 255 ) ); - ::SetPixel ( myHDC, p[ 2 ].x, p[ 2 ].y, RGB( 255, 255, 255 ) ); - ::SetPixel ( myHDC, p[ 3 ].x, p[ 3 ].y, RGB( 255, 255, 255 ) ); -#endif - HPEN hpo = SelectPen( myHDC, GetStockObject ( NULL_PEN ) ); - ::Polygon ( myHDC, p, np ); - SelectPen( myHDC, hpo ); - -} // end EHDC :: _Join - -BOOL EHDC :: _DrawToEx ( PPOINT p ) { - - DWORD i = 0, j, k; - DDAP ddap = { this }; - POINT pp[ 4 ]; - double dx, dy, dxhw, dyhw, factor; - - dx = ( double )( p -> x - myStart.x ); - dy = ( double )( p -> y - myStart.y ); - - if ( dx == 0.0 && dy == 0.0 ) return FALSE; - - factor = myPWidth / 2.0 / sqrt ( dx * dx + dy * dy ); - dxhw = dy * factor; - dyhw = dx * factor; - - pp[ 0 ].x = ROUNDL( myStart.x + dxhw ); - pp[ 0 ].y = ROUNDL( myStart.y - dyhw ); - - pp[ 1 ].x = ROUNDL( myStart.x - dxhw ); - pp[ 1 ].y = ROUNDL( myStart.y + dyhw ); - - pp[ 2 ].x = ROUNDL( p -> x - dxhw ); - pp[ 2 ].y = ROUNDL( p -> y + dyhw ); - - pp[ 3 ].x = ROUNDL( p -> x + dxhw ); - pp[ 3 ].y = ROUNDL( p -> y - dyhw ); - - myIDDA = 0; - myFlags &= ~EHDCF_DDAF; - ddap.pp = myDDA1; - LineDDA ( pp[ 0 ].x, pp[ 0 ].y, pp[ 3 ].x, pp[ 3 ].y, &___auxDDAF, ( LPARAM )&ddap ); - k = myIDDA; - myIDDA = 0; - myFlags &= ~EHDCF_DDAF; - ddap.pp = myDDA2; - LineDDA ( pp[ 1 ].x, pp[ 1 ].y, pp[ 2 ].x, pp[ 2 ].y, &___auxDDAF, ( LPARAM )&ddap ); - myIDDA = min( k, myIDDA ); - HPEN hpo = SelectPen( myHDC, GetStockObject ( NULL_PEN ) ); - - for(;;) { - - if ( myPRlen == 0 ) { - - myPRlen = myPStyle[ myPIndex++ ]; - - if ( myPIndex == myPNS ) myPIndex = 0; - - } // end if - - j = i; - - while ( myPRlen != 0 && j < myIDDA ) ++j, --myPRlen; - - if ( j == myIDDA ) { - - myDDA1[ j ] = pp[ 3 ]; - myDDA2[ j ] = pp[ 2 ]; - - } // end if - - if ( myFlags & EHDCF_PDRAW ) { - - POINT p[ 4 ]; - - p[ 0 ] = myDDA1[ i ]; - p[ 1 ] = myDDA1[ j ]; - p[ 2 ] = myDDA2[ j ]; - p[ 3 ] = myDDA2[ i ]; - - Register ( p, 4 ); - ::Polygon ( myHDC, p, 4 ); - - } // end if - - if ( myPRlen == 0 ) - - myFlags ^= EHDCF_PDRAW; - - else break; - - i = j; - - if ( j >= myIDDA ) break; - - } // end while - - SelectPen( myHDC, hpo ); - - if ( myPRlen == 0 ) myFlags |= EHDCF_NJOIN; - - myA = myB; - myB = myStart; - myStart = *p; - - return TRUE; - -} // end EHDC :: _DrawToEx - -void EHDC :: _LineTo ( PPOINT p ) { - - DWORD i = 0; - DDAP ddap = { this }; - - Register ( p, 1 ); - - myIDDA = 0; - ddap.pp = myDDA1; - LineDDA ( myStart.x, myStart.y, p -> x, p -> y, &___auxDDAF, ( LPARAM )&ddap ); - - for(;;) { - - if ( myPRlen == 0 ) { - - myPRlen = myPStyle[ myPIndex++ ]; - - if ( myPIndex == myPNS ) myPIndex = 0; - - } // end if - - if ( myFlags & EHDCF_PDRAW ) ::MoveToEx ( myHDC, myDDA1[ i ].x, myDDA1[ i ].y, NULL ); - - while ( myPRlen != 0 && i < myIDDA ) ++i, --myPRlen; - - if ( i == myIDDA ) myDDA1[ i ] = *p; - - if ( myFlags & EHDCF_PDRAW ) - - ::LineTo ( myHDC, myDDA1[ i ].x, myDDA1[ i ].y ); - - if ( myPRlen == 0 ) - - myFlags ^= EHDCF_PDRAW; - - else break; - - } // end while - - myStart = *p; - -} // end EHDC :: _LineTo - -void EHDC :: _ETextOut ( int x, int y, void* str, double angle, BOOL fOutline, BOOL fWide ) { -#if 1 - int i; - DWORD dwLen; - HPEN hpo; - HBRUSH hbo = NULL; - HFONT hfo; - XFORM lXfm, rXfm, xfm; - PXFORM pXfm; - SIZE sz; - double tanVal; - double sinVal; - double cosVal; - LPPOINT lp; - - angle = -angle; - tanVal = tan ( myTextSlant ) * myTextVScale; - sinVal = sin ( angle ); - cosVal = cos ( angle ); - - if ( !( myFlags & EHDCF_TPATH ) ) { - - hfo = SelectFont( myHDC, myTextFont ); - - i = myTextNP = _TextPath ( - myHDC, 0, 0, str, NULL, NULL, 0, &sz, fWide - ); - - SelectFont( myHDC, hfo ); - - if ( i <= 0 ) return; - - if ( myTextBS < myTextNP ) { - - dwLen = sizeof ( POINT ) * myTextNP + sizeof ( BYTE ) * myTextNP; - - if ( myTextPath == NULL ) - - myTextPath = ( LPPOINT )HeapAlloc ( - GetProcessHeap (), - HEAP_GENERATE_EXCEPTIONS, dwLen - ); - - else - - myTextPath = ( LPPOINT )HeapReAlloc ( - GetProcessHeap (), - HEAP_GENERATE_EXCEPTIONS, - myTextPath, dwLen - ); - - myTextBS = myTextNP; - - } // end if - - myTextType = ( PBYTE )( myTextPath + myTextNP ); - - _TextPath ( myHDC, 0, 0, str, myTextPath, myTextType, myTextNP, NULL, fWide ); - - lp = myTextPath; - - while ( i-- ) { - - lp -> y -= sz.cy; - ++lp; - - } // end while - - } // end if - - lXfm.eM11 = ( FLOAT )myTextHScale; lXfm.eM21 = ( FLOAT )-tanVal; - lXfm.eM12 = 0.0F; lXfm.eM22 = ( FLOAT )myTextVScale; - lXfm.eDx = 0.0F; - lXfm.eDy = 0.0F; - - rXfm.eM11 = ( FLOAT ) cosVal; rXfm.eM12 = ( FLOAT )sinVal; - rXfm.eM21 = ( FLOAT )-sinVal; rXfm.eM22 = ( FLOAT )cosVal; - rXfm.eDx = 0.0F; - rXfm.eDy = 0.0F; - _XFORMultiply ( &xfm, &lXfm, &rXfm ); - - rXfm.eM11 = 1.0F; rXfm.eM21 = 0.0F; - rXfm.eM12 = 0.0F; rXfm.eM22 = -1.0F; - rXfm.eDx = ( FLOAT )x; - rXfm.eDy = ( FLOAT )y; - _XFORMultiply ( &lXfm, &xfm, &rXfm ); - - if ( myFlags & EHDCF_XFORM ) { - - _XFORMultiply ( &xfm, &lXfm, &myXform ); - pXfm = &xfm; - - } else pXfm = &lXfm; - - _XFORMApply ( myTextPath, myTextNP, pXfm ); - - i = myTextNP; - lp = myTextPath; - - while ( i-- ) lp -> y = Y( lp -> y ), ++lp; - - hpo = SelectPen( myHDC, myTextPen ); - - if ( !fOutline ) hbo = SelectBrush( myHDC, myTextBrush ); - - if ( !( myFlags & EHDCF_TREG ) ) Register ( myTextPath, myTextNP ); - - BeginPath ( myHDC ); - _RenderPath ( myHDC, myTextPath, myTextType, myTextNP ); - EndPath ( myHDC ); - - if ( !fOutline ) { - - FillPath ( myHDC ); - SelectBrush( myHDC, hbo ); - - } else StrokePath ( myHDC ); - - SelectPen( myHDC, hpo ); -#else - int i; - DWORD dwLen; - HPEN hpo; - HBRUSH hbo; - HFONT hfo; - XFORM lXfm, rXfm, xfm; - PXFORM pXfm; - SIZE sz; - double tanVal; - double sinVal; - double cosVal; - LPPOINT lp; - BOOL fNew = FALSE; - - angle = -angle; - tanVal = tan ( myTextSlant ); - sinVal = sin ( angle ); - cosVal = cos ( angle ); - - if ( !( myFlags & EHDCF_TPATH ) ) { - - hfo = SelectFont( myHDC, myTextFont ); - - if ( myTextVScale != 1.0 || myTextHScale != 1.0 ) { - - LOGFONT lf; - TEXTMETRIC tm; - - GetObject ( myTextFont, sizeof ( LOGFONT ), &lf ); - GetTextMetrics ( myHDC, &tm ); - - lf.lfHeight = ROUNDL( lf.lfHeight * myTextVScale ); - lf.lfWidth = ROUNDL( lf.lfWidth * myTextHScale ); - - lf.lfQuality = DRAFT_QUALITY; - - if ( lf.lfWidth == 0 ) - - lf.lfWidth = ROUNDL( tm.tmAveCharWidth * myTextHScale ); - - SelectFont( myHDC, hfo ); - - hfo = SelectFont( myHDC, CreateFontIndirect ( &lf ) ); - fNew = TRUE; - - } // end if - - i = myTextNP = _TextPath ( - myHDC, 0, 0, str, NULL, NULL, 0, &sz, fWide - ); - - hfo = SelectFont( myHDC, hfo ); - - if ( fNew ) DeleteFont( hfo ); - - if ( i <= 0 ) return; - - if ( myTextBS < myTextNP ) { - - dwLen = sizeof ( POINT ) * myTextNP + sizeof ( BYTE ) * myTextNP; - - if ( myTextPath == NULL ) - - myTextPath = ( LPPOINT )HeapAlloc ( - GetProcessHeap (), - HEAP_GENERATE_EXCEPTIONS, dwLen - ); - - else - - myTextPath = ( LPPOINT )HeapReAlloc ( - GetProcessHeap (), - HEAP_GENERATE_EXCEPTIONS, - myTextPath, dwLen - ); - - myTextBS = myTextNP; - - } // end if - - myTextType = ( PBYTE )( myTextPath + myTextNP ); - - _TextPath ( myHDC, 0, 0, str, myTextPath, myTextType, myTextNP, NULL, fWide ); - - lp = myTextPath; - - while ( i-- ) { - - lp -> y -= sz.cy; - ++lp; - - } // end while - - } // end if - - lXfm.eM11 = 1.0F; lXfm.eM21 = ( FLOAT )-tanVal; - lXfm.eM12 = 0.0F; lXfm.eM22 = 1.0F; - lXfm.eDx = 0.0F; - lXfm.eDy = 0.0F; - - rXfm.eM11 = ( FLOAT ) cosVal; rXfm.eM12 = ( FLOAT )sinVal; - rXfm.eM21 = ( FLOAT )-sinVal; rXfm.eM22 = ( FLOAT )cosVal; - rXfm.eDx = 0.0F; - rXfm.eDy = 0.0F; - _XFORMultiply ( &xfm, &lXfm, &rXfm ); - - rXfm.eM11 = 1.0F; rXfm.eM21 = 0.0F; - rXfm.eM12 = 0.0F; rXfm.eM22 = -1.0F; - rXfm.eDx = ( FLOAT )x; - rXfm.eDy = ( FLOAT )y; - _XFORMultiply ( &lXfm, &xfm, &rXfm ); - - if ( myFlags & EHDCF_XFORM ) { - - _XFORMultiply ( &xfm, &lXfm, &myXform ); - pXfm = &xfm; - - } else pXfm = &lXfm; - - _XFORMApply ( myTextPath, myTextNP, pXfm ); - - i = myTextNP; - lp = myTextPath; - - while ( i-- ) lp -> y = Y( lp -> y ), ++lp; - - hpo = SelectPen( myHDC, myTextPen ); - - if ( !fOutline ) hbo = SelectBrush( myHDC, myTextBrush ); - - if ( !( myFlags & EHDCF_TREG ) ) Register ( myTextPath, myTextNP ); - - BeginPath ( myHDC ); - _RenderPath ( myHDC, myTextPath, myTextType, myTextNP ); - EndPath ( myHDC ); - - if ( !fOutline ) { - - FillPath ( myHDC ); - SelectBrush( myHDC, hbo ); - - } else StrokePath ( myHDC ); - - SelectPen( myHDC, hpo ); -#endif -} // end EHDC :: _ETextOut - -void EHDC :: _PolyTextOut ( - int x, int y, void* str, double angle, double margin, - BOOL fOutline, BOOL fWide, BOOL fNofill, BOOL fNoframe - ) { - - POINT p[ 4 ]; - XFORM lXfm, xfm; - PXFORM pXfm; - SIZE sz; - HFONT hfo; - DWORD dwFlags; - TEXTMETRIC tm; - double sinVal = sin ( angle ); - double cosVal = cos ( angle ); - double tanVal = -tan ( myTextSlant ); - double height; - - hfo = SelectFont( myHDC, myTextFont ); - - if ( !fWide ) - - GetTextExtentPoint32A ( - myHDC, ( char* )str, lstrlenA ( ( char* )str ), &sz - ); - - else - - GetTextExtentPoint32W ( - myHDC, ( wchar_t* )str, lstrlenW ( ( wchar_t* )str ), &sz - ); - - GetTextMetrics ( myHDC, &tm ); - SelectFont( myHDC, hfo ); - - sz.cy -= tm.tmInternalLeading; - - p[ 0 ].x = 0; - p[ 0 ].y = ROUNDL( sz.cy * myTextVScale ); - p[ 1 ].x = ROUNDL( sz.cx * myTextHScale ); - p[ 1 ].y = p[ 0 ].y; - p[ 2 ].x = p[ 1 ].x; - p[ 2 ].y = 0; - p[ 3 ].x = 0; - p[ 3 ].y = 0; - - tanVal *= p[ 1 ].y; - - if ( myTextSlant < 0.0F ) { - - p[ 0 ].x -= ( LONG )tanVal; - p[ 3 ].x -= ( LONG )tanVal; - - } else { - - p[ 1 ].x -= ( LONG )tanVal; - p[ 2 ].x -= ( LONG )tanVal; - - } /* end else */ - - height = ROUNDL( p[ 0 ].y * margin / 2.0 ); - - p[ 0 ].x = ROUNDL( p[ 0 ].x - height ); - p[ 0 ].y = ROUNDL( p[ 0 ].y + height ); - p[ 1 ].x = ROUNDL( p[ 1 ].x + height ); - p[ 1 ].y = ROUNDL( p[ 1 ].y + height ); - p[ 2 ].x = ROUNDL( p[ 2 ].x + height ); - p[ 2 ].y = ROUNDL( p[ 2 ].y - height ); - p[ 3 ].x = ROUNDL( p[ 3 ].x - height ); - p[ 3 ].y = ROUNDL( p[ 3 ].y - height ); - - lXfm.eM11 = ( FLOAT ) cosVal; lXfm.eM12 = ( FLOAT )sinVal; - lXfm.eM21 = ( FLOAT )-sinVal; lXfm.eM22 = ( FLOAT )cosVal; - lXfm.eDx = ( FLOAT )x; - lXfm.eDy = ( FLOAT )y; - - if ( myFlags & EHDCF_XFORM ) { - - _XFORMultiply ( &xfm, &lXfm, &myXform ); - pXfm = &xfm; - - } else pXfm = &lXfm; - - _XFORMApply ( p, 4, pXfm ); - - dwFlags = ( myFlags & EHDCF_XFORM ); - myFlags &= ~EHDCF_XFORM; - - if ( fNofill ) - - Polyline ( p, 4, TRUE ); - - else - - Polygon ( p, 4, fNoframe ? POLYF_NOEDGE : 0 ); - - myFlags |= dwFlags; - - _ETextOut ( x, y, str, angle, fOutline, fWide ); - -} // end EHDC :: _PolyTextOut - -void EHDC :: Register ( LPPOINT lpPts, int nPts ) { - - while ( nPts-- ) { - - if ( lpPts -> x < myURect.left ) - - myURect.left = lpPts -> x - 1; - - else if ( lpPts -> x > myURect.right ) - - myURect.right = lpPts -> x + 2; - - if ( lpPts -> y < myURect.top ) - - myURect.top = lpPts -> y - 1; - - else if ( lpPts -> y > myURect.bottom ) - - myURect.bottom = lpPts -> y + 2; - - ++lpPts; - - } // end while - -} // end EHDC :: _Register -//+++// -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// -//+++// -static void WINAPI _XFORMultiply ( PXFORM res, PXFORM left, PXFORM right ) { - - res -> eM11 = left -> eM11 * right -> eM11 + left -> eM12 * right -> eM21; - res -> eM12 = left -> eM11 * right -> eM12 + left -> eM12 * right -> eM22; - res -> eDx = left -> eDx * right -> eM11 + left -> eDy * right -> eM21 + right -> eDx; - - res -> eM21 = left -> eM21 * right -> eM11 + left -> eM22 * right -> eM21; - res -> eM22 = left -> eM21 * right -> eM12 + left -> eM22 * right -> eM22; - res -> eDy = left -> eDx * right -> eM12 + left -> eDy * right -> eM22 + right -> eDy; - -} /* end _XFORMultiply */ - -static void WINAPI _XFORMApply ( PPOINT pp, int n, PXFORM xf ) { - - int i; - double dx, dy; - - for ( i = 0; i < n; ++i ) { - - dx = pp[ i ].x * xf -> eM11 + pp[ i ].y * xf -> eM21 + xf -> eDx; - dy = pp[ i ].x * xf -> eM12 + pp[ i ].y * xf -> eM22 + xf -> eDy; - - pp[ i ].x = ROUNDL( dx ); - pp[ i ].y = ROUNDL( dy ); - - } /* end for */ - -} /* end _XFORMApply */ - -static void WINAPI _XFORMApplyf ( PFPOINT pp, int n, PXFORM xf ) { - - int i; - double dx, dy; - - for ( i = 0; i < n; ++i ) { - - dx = pp[ i ].x * xf -> eM11 + pp[ i ].y * xf -> eM21 + xf -> eDx; - dy = pp[ i ].x * xf -> eM12 + pp[ i ].y * xf -> eM22 + xf -> eDy; - - pp[ i ].x = ( FLOAT )dx; - pp[ i ].y = ( FLOAT )dy; - - } /* end for */ - -} /* end _XFORMApply */ - -static void WINAPI _RenderPath ( HDC hdc, LPPOINT lpPts, PBYTE lpType, int nPts ) { - - LPPOINT pp = NULL; - - for ( int i = 0; i < nPts; ++i ) { - - switch ( lpType[ i ] ) { - - case PT_MOVETO: - - MoveToEx ( hdc, lpPts[ i ].x, lpPts[ i ].y, NULL ); - pp = &lpPts[ i ]; - - continue; - - case PT_LINETO: - case PT_LINETO | PT_CLOSEFIGURE: - - LineTo ( hdc, lpPts[ i ].x, lpPts[ i ].y ); - goto testClose; - - case PT_BEZIERTO: - case PT_BEZIERTO | PT_CLOSEFIGURE: - - PolyBezierTo ( hdc, &lpPts[ i ], 3 ); - - i += 2; -testClose: - if ( lpType[ i ] & PT_CLOSEFIGURE ) LineTo ( hdc, pp -> x, pp -> y ); - - } /* end switch */ - - } /* end for */ - -} /* end _RenderPath */ - -static int WINAPI _TextPath ( - HDC hdc, int x, int y, void* str, LPPOINT lpPts, PBYTE lpType, - int nPts, PSIZE pSz, BOOL fWide - ) { - - int retVal; - - if ( lpPts == NULL ) { - - int bmo = SetBkMode ( hdc, TRANSPARENT ); - - BeginPath ( hdc ); - - if ( !fWide ) - - TextOutA ( hdc, x, y, ( char* )str, lstrlenA ( ( char* )str ) ); - - else - - TextOutW ( hdc, x, y, ( wchar_t* )str, lstrlenW ( ( wchar_t* )str ) ); - - EndPath ( hdc ); - - SetBkMode ( hdc, bmo ); - - } /* end if */ - - retVal = GetPath ( hdc, lpPts, lpType, nPts ); - - if ( pSz != NULL ) - - if ( !fWide ) - - GetTextExtentPoint32A ( hdc, ( char* )str, lstrlenA ( ( char* )str ), pSz ); - - else - - GetTextExtentPoint32W ( hdc, ( wchar_t* )str, lstrlenW ( ( wchar_t* )str ), pSz ); - - return retVal; - -} /* end _TextPath */ - -VOID CALLBACK ___auxDDAF ( int x, int y, LPARAM lpParam ) { - - PDDAP p = ( PDDAP )lpParam; - - p -> pp[ p -> _this -> myIDDA ].x = x; - p -> pp[ p -> _this -> myIDDA++ ].y = y; - - if ( p -> _this -> myIDDA >= p -> _this -> myNDDA ) { - - p -> _this -> myDDA1 = ( PPOINT )HeapReAlloc ( - GetProcessHeap (), HEAP_GENERATE_EXCEPTIONS, - p -> _this -> myDDA1, p -> _this -> myNDDA <<= 1 - ); - p -> _this -> myDDA2 = ( PPOINT )HeapReAlloc ( - GetProcessHeap (), HEAP_GENERATE_EXCEPTIONS, - p -> _this -> myDDA2, p -> _this -> myNDDA <<= 1 - ); - - } // end if - -} // end ___auxDDAF -//+++// -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// diff --git a/src/WNT/EHDC.hxx b/src/WNT/EHDC.hxx deleted file mode 100755 index c036690ac9..0000000000 --- a/src/WNT/EHDC.hxx +++ /dev/null @@ -1,217 +0,0 @@ -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - -/*****************************************************************************/ -/* */ -/* EXTENDED HDC */ -/* */ -/* Abstract: extends existing WIN32's HDC ( styled lines drawing etc. ) */ -/* Note : use it only in Windows 95 since Windows NT provides these */ -/* functionalities */ -/* */ -/* History : JAN-1998 EUG ( creation ) */ -/* */ -/*****************************************************************************/ -#ifndef __EHDC_HXX -# define __EHDC_HXX - -# ifndef __cplusplus -# error "C++ compiler required for EHDC stuff" -# endif /* __cplusplus */ - -# ifndef _WINDOWS_ -# ifndef STRICT -# define STRICT -# endif /* STRICT */ -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# include -# include -# endif /* WIN32_LEAN_AND_MEAN */ -# endif /* _WINDOWS_ */ - -# define ARCF_PIE 0x00000001 -# define ARCF_CHORD 0x00000002 - -# define POLYF_NOEDGE 0x00000001 -# define POLYF_NOCLOSEDGE 0x00000002 - -# define EHDCF_XFORM 0x00000001 -# define EHDCF_EPEN 0x00000002 -# define EHDCF_JOIN 0x00000004 -# define EHDCF_PDRAW 0x00000008 -# define EHDCF_CJOIN 0x00000010 -# define EHDCF_NJOIN 0x00000020 -# define EHDCF_JBEVL 0x00000040 -# define EHDCF_SFREE 0x80000000 -# define EHDCF_TPATH 0x40000000 -# define EHDCF_TREG 0x20000000 -# define EHDCF_PPUSH 0x10000000 -# define EHDCF_BPUSH 0x08000000 -# define EHDCF_DDAF 0x04000000 - -class EHDC { /* defined extended HDC */ - - public: - - EHDC ( HDC, PSIZE ); /* constructor */ - EHDC (); /* yet another one */ - ~EHDC (); /* destructor */ - - /*****************/ - /* DC MANAGEMENT */ - /*****************/ - - void SetDC ( HDC, PSIZE ); - /* sets WIN32's DC for graphics operations */ - HDC Hdc ( void ) { return myHDC; } - /* returns WIN32's HDC */ - HBRUSH SelectEPen ( DWORD, CONST LOGBRUSH*, DWORD, DWORD*, BOOL = FALSE ); - /* selects pen for line drawing */ - void SelectEPen ( DWORD, CONST LOGBRUSH* ); - /* selects pen for line drawing ( old one is saved ) */ - HPEN SelectEPen ( HPEN ); - /* selects pen for line drawing */ - void SelectEBrush ( PLOGBRUSH, PLOGBRUSH = NULL ); - /* selects brush for polygon filling */ - int SetPolyFillMode ( int aMode ) { return ::SetPolyFillMode ( myHDC, aMode ); } - /* sets polygon fill mode */ - - BOOL Miter ( void ) { return !( myFlags & EHDCF_JBEVL ); } - /* checks for line join style */ - void SetMiter ( BOOL ); - /* sets line join style */ - - void Extent ( PSIZE psz ) { *psz = mySize; } - /* Retrieves viewport extents */ - - /*******************/ - /* DRAWING METHODS */ - /*******************/ - - void MoveToEx ( int, int, LPPOINT ); - /* moves current point and begins a new path */ - BOOL LineTo ( int, int ); - /* draws a segment from current position and */ - /* updates this position */ - void ClosePath ( void ); - /* closes current path */ - void Polyline ( CONST POINT*, int, BOOL = FALSE ); - /* draws a polyline ( path and current position */ - /* are unchanged ) */ - void Polygon ( CONST POINT*, int, DWORD = 0 ); - /* draws a filled polygon ( path and current position */ - /* are unchanged ) */ - /* Note: specify n - 1 points in parameters */ - void Arc ( int, int, int, int, double = 0.0, double = 6.283185, DWORD = 0 ); - /* Draws an arc ( path and current position */ - /* are unchanged ) */ - void Polyarc ( int, int, int, int, double = 0.0, double = 6.283185, BOOL = TRUE ); - /* draws a polyarc ( path and current position */ - /* are unchanged ) */ - void SetPixel ( int, int, COLORREF ); - /* draws single pixel */ - - /****************/ - /* TEXT METHODS */ - /****************/ - - void SetTextColor ( COLORREF ); - void SetTextAttrib ( COLORREF, HFONT, double = 0.0, double = 1.0, double = 1.0 ); - void ETextOut ( int, int, char*, double = 0.0, BOOL = FALSE ); - void ETextOut ( int, int, wchar_t*, double = 0.0, BOOL = FALSE ); - void PolyTextOut ( - int, int, char*, double = 0.0, double = 0.1, BOOL = FALSE, BOOL = FALSE, - BOOL = FALSE - ); - void PolyTextOut ( - int, int, wchar_t*, double = 0.0, double = 0.1, BOOL = FALSE, BOOL = FALSE, - BOOL = FALSE - ); - - /**************************/ - /* TRANSFORMATION METHODS */ - /**************************/ - - void SetWorldTransform ( XFORM* ); - void ModifyWorldTransform ( XFORM*, DWORD ); - void GetWorldTransform ( XFORM* xf ) { *xf = myXform; } - void Transform ( LPPOINT, int ); - - /**************************/ - /* UPDATED REGION METHODS */ - /**************************/ - - void ResetURect ( void ); - void SetURect ( LPRECT lpRect ) { myURect = *lpRect; } - void GetURect ( LPRECT ); - void Register ( LPPOINT, int ); - - protected: - - void _Init ( void ); - void _DrawTo ( PPOINT ); - void _Join ( void ); - BOOL _DrawToEx ( PPOINT ); - void _LineTo ( PPOINT ); - void _ETextOut ( int, int, void*, double = 0.0, BOOL = FALSE, BOOL = FALSE ); - void _PolyTextOut ( - int, int, void*, double = 0.0, double = 0.1, - BOOL = FALSE, BOOL = FALSE, BOOL = FALSE, BOOL = FALSE - ); - - HDC myHDC; - POINT myStart; - POINT myClose; - POINT myA, myB; - POINT myJoin; - POINT myCJoin; - XFORM myXform; - DWORD myFlags; - PPOINT myTextPath; - PBYTE myTextType; - DWORD myTextNP; - DWORD myTextBS; - HPEN myTextPen; - HBRUSH myTextBrush; - HFONT myTextFont; - double myTextSlant; - double myTextHScale; - double myTextVScale; - DWORD myPWidth, myPWPush; - HPEN myPPen, myPPenPush; - HBRUSH myPBrush, myPBrushPush; - BOOL myfXpenPush; - PDWORD myPStyle; - DWORD myPNS; - DWORD myPBS; - DWORD myPIndex; - DWORD myPRlen; - RECT myURect; - HBRUSH myBrush, myBrushPush; - HBRUSH myOBrush; - SIZE mySize; - PPOINT myDDA1; - PPOINT myDDA2; - DWORD myNDDA; - DWORD myIDDA; - - friend VOID CALLBACK ___auxDDAF ( int, int, LPARAM ); - -}; - -#endif /* __EHDC_HXX */ diff --git a/src/WNT/FILES b/src/WNT/FILES index e963b74ff6..ee102a6c7d 100755 --- a/src/WNT/FILES +++ b/src/WNT/FILES @@ -2,26 +2,9 @@ WNT.edl WNT_WOKSteps.edl WNT_CMPLRS.edl WNT_WOKUMake.edl -Degrees.hxx -EHDC.hxx -W32_Allocator.hxx -W95_Allocator.hxx -WNT_Allocator.hxx -WNT_ColorRef.hxx WNT_Dword.hxx -WNT_LogFont.hxx -WNT_Long.hxx WNT_Uint.hxx -WNT.h -WNT_Bitmap.h WNT_WindowData.hxx -EHDC.cxx -W32_Allocator.cxx -W95_Allocator.cxx -WNT_Allocator.cxx -WNT_ColorRef.cxx WNT_Dword.cxx -WNT_LogFont.cxx -WNT_Long.cxx WNT_Uint.cxx WNT_WindowData.cxx diff --git a/src/WNT/W32_Allocator.cxx b/src/WNT/W32_Allocator.cxx deleted file mode 100755 index 9f27702b26..0000000000 --- a/src/WNT/W32_Allocator.cxx +++ /dev/null @@ -1,292 +0,0 @@ -// Created by: PLOTNIKOV Eugeny & CHABROVSKY Dmitry -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - - -#include -#include -#include - -#include - -#pragma comment( lib, "gdi32.lib" ) -#pragma comment( lib, "user32.lib" ) - -//////////////////////////////////////////////////////////////////////////////// -// I N I T I A L I Z A T I O N // -//////////////////////////////////////////////////////////////////////////////// -#define DEF_BLOCK_SIZE ( 2 * s_dwPageSize ) - -static DWORD s_dwPageSize; - -PW32_Allocator ( *W32_GetAllocator ) ( int, PW32_Allocator ); -double W32_TextFactor; - -static PW32_Allocator W95_GetAllocator ( int anID, PW32_Allocator head ) { - - return new W95_Allocator ( anID, head ); - -} // end W95_GetAllocator - -static PW32_Allocator WNT_GetAllocator ( int anID, PW32_Allocator head ) { - - return new WNT_Allocator ( anID, head ); - -} // end WNT_GetAllocator - -class _initAllocator { - - public: - - _initAllocator (); - -}; - -_initAllocator :: _initAllocator () { - - OSVERSIONINFO os; - SYSTEM_INFO si; - - GetSystemInfo ( &si ); - - s_dwPageSize = si.dwPageSize; - - os.dwOSVersionInfoSize = sizeof ( OSVERSIONINFO ); - GetVersionEx ( &os ); - - if ( os.dwPlatformId == VER_PLATFORM_WIN32_WINDOWS ) { -doWin95: - W32_GetAllocator = &W95_GetAllocator; - W32_TextFactor = 5.0; - - } else { - - GetEnvironmentVariable ( TEXT( "CSF_WNT_FORCE_WIN95" ), NULL, 0 ); - - if ( GetLastError () != ERROR_ENVVAR_NOT_FOUND ) goto doWin95; - - W32_GetAllocator = &WNT_GetAllocator; - W32_TextFactor = 1.0; - - } // end else - -} // end constructor - -static _initAllocator s_InitAllocator; -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ A L L O C A T O R S T U F F // -//////////////////////////////////////////////////////////////////////////////// -W32_Allocator :: W32_Allocator ( int anID, PW32_Allocator head ) : - myID ( anID ), myFlags ( W32F_EMPTY ), myEnd ( NULL ), - myNext ( NULL ) { - - LOGFONT lf; - HDC hdc = GetDC ( NULL ); - - GetObject ( hdc, sizeof ( LOGFONT ), &lf ); - - ReleaseDC ( NULL, hdc ); - - lf.lfOutPrecision |= OUT_TT_ONLY_PRECIS; - - if ( head != NULL ) { - - while ( head -> myNext != NULL ) head = head -> myNext; - - head -> myNext = this; - - } // end if - - myStart = MakeBlock ( DEF_BLOCK_SIZE ); - - myTextFont = CreateFontIndirect ( &lf ); - myTextSlant = 0.0; - myTextHScale = - myTextVScale = 1.0 / W32_TextFactor; - - myScaleX = myScaleY = 1.0; - myAngle = 0.0; - myPivot.x = myMove.x = - myPivot.y = myMove.y = 0; - - myFlags = ( W32F_EMPTY | W32F_POUTL | W32F_DFONT ); - myPrimitive = zzNone; - - myPointColor = - myMarkerPointColor = RGB( 255, 255, 255 ); - -} // end constructor - -W32_Allocator :: ~W32_Allocator () { - - KillBlocks ( myStart ); - - if ( myFlags & W32F_DFONT ) DeleteFont( myTextFont ); - -} // end destructor - -PW32_Block W32_Allocator :: MakeBlock ( int aBlockSize ) { - - PW32_Block retVal; - - aBlockSize = ( s_dwPageSize / aBlockSize + 1 ) * s_dwPageSize; - - retVal = ( PW32_Block )VirtualAlloc ( - NULL, aBlockSize, MEM_RESERVE | MEM_COMMIT, - PAGE_READWRITE - ); - - if ( retVal == NULL ) RaiseException ( STATUS_NO_MEMORY, 0, 0, NULL ); - - if ( myEnd != NULL ) myEnd -> next = retVal; - - myEnd = retVal; - - retVal -> next = NULL; - retVal -> size = aBlockSize / sizeof ( int ) - sizeof ( W32_Block ) / sizeof ( int ); - retVal -> free = 0; - - return retVal; - -} // end W32_Allocator :: MakeBlock - -PW32_Block W32_Allocator :: KillBlock ( PW32_Block aVictim ) { - - PW32_Block next = aVictim -> next; - - ReleaseBlock ( aVictim ); - - VirtualFree ( ( LPVOID )aVictim, 0, MEM_RELEASE ); - - return next; - -} // end W32_Allocator :: KillBlock - -void W32_Allocator :: KillBlocks ( PW32_Block aBegin ) { - - while ( ( aBegin = KillBlock ( aBegin ) ) != NULL ); - -} // end W32_Allocator :: KillBlocks - -void W32_Allocator :: ClearBlocks ( void ) { - - if ( myStart -> next != NULL ) KillBlocks ( myStart -> next ); - - ReleaseBlock ( myStart ); - - myStart -> next = NULL; - myStart -> free = 0; - myEnd = myStart; - - myFlags &= ~W32F_DRAWN; - myFlags |= W32F_EMPTY; - -} // end W32_Allocator :: ClearBlocks - -void W32_Allocator :: ReleaseBlock ( PW32_Block pb ) { - - for ( int i = 0; i < pb -> free; i += pb -> data[ i ] ) - - if ( pb -> data[ i + 1 ] != __W32_DATA ) { - - W32_Note* pNote = ( W32_Note* )&( pb -> data[ i + 1 ] ); - pNote -> ~W32_Note (); - - } // end if - -} // end W32_Allocator :: ReleaseBlock - -BOOL W32_Allocator :: FreeSpace ( PW32_Block aBlock, int aQuerySize ) { - - return ( aBlock -> size >= ( aBlock -> free + aQuerySize + 1 ) ); - -} // end W32_Allocator :: FreeSpace - -PW32_Block W32_Allocator :: ReserveData ( unsigned int iSize ) { - - if ( !FreeSpace ( myEnd, iSize ) ) return NULL; - - return myEnd; - -} // end W32_Allocator :: ReserveData - -PW32_Block W32_Allocator :: ReserveFind ( unsigned int iSize ) { - - PW32_Block aBlock = myStart; - for ( ; aBlock != NULL; aBlock = aBlock -> next ) - - if ( FreeSpace ( aBlock, iSize ) ) break; - - return aBlock; - -} // end W32_Allocator :: ReserveFind - -void* W32_Allocator :: ReserveBlock ( PW32_Block aBlock, int aQuerySize, BOOL fData ) { - - void* retVal; - - ++aQuerySize; - - retVal = fData ? &( aBlock -> data[ aBlock -> free + 2 ] ) : - &( aBlock -> data[ aBlock -> free + 1 ] ); - - aBlock -> data[ aBlock -> free ] = aQuerySize; - aBlock -> data[ aBlock -> free + 1 ] = __W32_DATA; - aBlock -> free += aQuerySize; - - return retVal; - -} // end W32_Allocator :: ReserveBlock - -void* W32_Allocator :: NewClass ( unsigned int nBytes ) { - - PW32_Block aBlock = myEnd; - - nBytes = ( ( nBytes + 3 ) / sizeof ( int ) ); - - if ( !FreeSpace ( aBlock, nBytes ) ) aBlock = MakeBlock ( nBytes ); - - myFlags &= ~W32F_EMPTY; - - return ReserveBlock ( aBlock, nBytes ); - -} // end W32_Allocator :: NewClass - -void* W32_Allocator :: NewData ( unsigned int nBytes, BOOL fFind ) { - - PW32_Block aBlock; - - nBytes = ( ( nBytes + 3 ) / sizeof ( int ) ) + 1; - - aBlock = fFind ? ReserveFind ( nBytes ) : ReserveData ( nBytes ); - - if ( aBlock == NULL ) aBlock = MakeBlock ( nBytes ); - - return ReserveBlock ( myEnd, nBytes, TRUE ); - -} // end W32_Allocator :: NewData - -void* W32_Note :: operator new ( size_t cSize, PW32_Allocator anAllocator ) { - - W32_Note* note = ( W32_Note* )anAllocator -> NewClass ( cSize ); - - note -> myAllocator = anAllocator; - - return ( void* )note; - -} // end W32_Note :: operator new diff --git a/src/WNT/W32_Allocator.hxx b/src/WNT/W32_Allocator.hxx deleted file mode 100755 index b53f1dd39a..0000000000 --- a/src/WNT/W32_Allocator.hxx +++ /dev/null @@ -1,788 +0,0 @@ -// Created by: PLOTNIKOV Eugeny & CHABROVSKY Dmitry -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - - -#ifndef __W32_ALLOCATOR_HXX -# define __W32_ALLOCATOR_HXX - -# ifndef _WINDOWS_ -# ifndef STRICT -# define STRICT -# endif /* STRICT */ -# ifndef WIN32_LEAN_AND_MEAN -# define WIN32_LEAN_AND_MEAN -# ifdef NOGDI -# undef NOGDI /* we need GDI definitions here... */ -# endif -# include -# endif /* WIN32_LEAN_AND_MEAN */ -# endif /* _WINDOWS */ - -# define __W32_DATA -1 - -# define EPS 0.005F - -# define W32F_TOUTLINE 0x00000001 // text flags -# define W32F_TUNICODE 0x00000002 -# define W32F_TINDEX 0x00000004 -# define W32F_TFREE 0x00000008 -# define W32F_TFULINED 0x00000010 - -# define W32F_EMPTY 0x00000001 -# define W32F_DRAWN 0x00000002 -# define W32F_XFORM 0x00000004 -# define W32F_MONO 0x00000008 -# define W32F_DBUFF 0x00000010 -# define W32F_START 0x00000020 -# define W32F_WIN95 0x00000040 -# define W32F_DVDRV 0x00000080 -# define W32F_TULIN 0x00000100 -# define W32F_MINIT 0x00000200 -# define W32F_NOFIL 0x00000400 -# define W32F_MFILL 0x80000000 -# define W32F_MOUTL 0x40000000 -# define W32F_POUTL 0x20000000 -# define W32F_DFONT 0x10000000 - -#define OCC5415 /* avoid warning C4291 in MS VC++ 6.0 */ - -typedef enum { - - zzNone, zzPoint, zzLine, zzPolyRect, zzRect, zzPolyEllipse, - zzRoundRect, zzPolyRoundRect, zzArc, zzChord, zzPolyChord, zzSector, - zzPolySector, zzPolygon, zzPolyline, zzLinkedPolyline, zzBezier, zzText, - zzPolyText, zzMarker - -} W32_Primitive; - -struct W32_Allocator; -typedef W32_Allocator* PW32_Allocator; - -typedef struct _W32_Block { // memory block - - _W32_Block* next; - int size; - int free; - int data[ 1 ]; - -} W32_Block, *PW32_Block; - -typedef struct _W32_bitmap { - - int nUsed; - HBITMAP hBmp; - - } W32_Bitmap, *PW32_Bitmap; - -typedef struct _W32_FCallParam { - - void* pAllocator; - void* pDriver; - - } W32_FCALLPARAM, *PW32_FCALLPARAM; - -typedef void ( WINAPI *GetPointFunc ) ( int, int, int, LPPOINT, int*, void* ); - -typedef void ( __cdecl *W32_FCall ) ( PW32_FCALLPARAM ); - -struct W32_Note { // base class to represent graphic object - - W32_Note () {} - virtual ~W32_Note () {} - - void* operator new ( size_t, W32_Allocator* ); - - virtual void Play ( BOOL = TRUE ) = 0; - virtual void Xform ( void ) {} - virtual void Release ( void ) {} - - PW32_Allocator myAllocator; - -#ifdef OCC5415 - void operator delete (void*, W32_Allocator*) {} -private: // to protect against possible accidental usage - void operator delete (void*) {} -#endif -}; -/// -///////////////////////// POINTS //////////////////////////// -/// -struct W32_PointNote : public W32_Note { - - W32_PointNote ( int, int ); - - virtual void Play ( BOOL = TRUE ); - - int myX, myY; - -}; - -struct WNT_PointNote : public W32_PointNote { - - WNT_PointNote ( int, int ); - - virtual void Play ( BOOL = TRUE ); - virtual void Xform ( void ); - - int myTX, myTY; - -}; - -struct W32_MarkerPointNote : public W32_PointNote { - - W32_MarkerPointNote ( int, int ); - - virtual void Play ( BOOL = TRUE ); - -}; - -struct WNT_MarkerPointNote : public WNT_PointNote { - - WNT_MarkerPointNote ( int, int ); - - virtual void Play ( BOOL = TRUE ); - -}; -/// -///////////////////////// LINES ////////////////////////////// -/// -struct W32_LineNote : public W32_PointNote { - - W32_LineNote ( int, int, int, int ); - - virtual void Play ( BOOL = TRUE ); - - int myX2, myY2; - -}; - -struct WNT_LineNote : public WNT_PointNote { - - WNT_LineNote ( int, int, int, int ); - - virtual void Play ( BOOL = TRUE ); - virtual void Xform ( void ); - - int myX2, myY2, myTX2, myTY2; - -}; -/// -////////////////////// POLY ELLIPSES ///////////////////////// -/// -struct W32_PolyEllipseNote : public W32_PointNote { - - W32_PolyEllipseNote ( int, int, int, int ); - - virtual void Play ( BOOL = TRUE ); - - int myXr, myYr; - -}; - -struct WNT_PolyEllipseNote : public WNT_PointNote { - - WNT_PolyEllipseNote ( int, int, int, int ); - - virtual void Play ( BOOL = TRUE ); - virtual void Xform ( void ); - - int myXr, myYr, myTXr, myTYr; - -}; -/// -///////////////////////// ELLIPSES /////////////////////////// -/// -struct W32_EllipseNote : public W32_PolyEllipseNote { - - W32_EllipseNote ( int, int, int, int ); - - virtual void Play ( BOOL = TRUE ); - -}; - -struct WNT_EllipseNote : public WNT_PolyEllipseNote { - - WNT_EllipseNote ( int, int, int, int ); - - virtual void Play ( BOOL = TRUE ); - -}; -/// -/////////////////////////// ARCS ///////////////////////////// -/// -struct W32_ArcNote : public W32_PolyEllipseNote { - - W32_ArcNote ( int, int, int, int, double, double ); - - virtual void Play ( BOOL = TRUE ); - - double mySa, myOa; - -}; - -struct WNT_ArcNote : public WNT_PolyEllipseNote { - - WNT_ArcNote ( int, int, int, int, double, double ); - - virtual void Play ( BOOL = TRUE ); - virtual void Xform ( void ); - - int mySX, mySY, myTSX, myTSY, - myEX, myEY, myTEX, myTEY, - myDirect; -}; -/// -/////////////////////// POLY CHORDS ////////////////////////// -/// -struct W32_PolyChordNote : public W32_ArcNote { - - W32_PolyChordNote ( int, int, int, int, double, double ); - - virtual void Play ( BOOL = TRUE ); - -}; - -struct WNT_PolyChordNote : public WNT_ArcNote { - - WNT_PolyChordNote ( int, int, int, int, double, double ); - - virtual void Play ( BOOL = TRUE ); - -}; -/// -////////////////////////// CHORDS //////////////////////////// -/// -struct W32_ChordNote : public W32_PolyChordNote { - - W32_ChordNote ( int, int, int, int, double, double ); - - virtual void Play ( BOOL = TRUE ); - -}; - -struct WNT_ChordNote : public WNT_PolyChordNote { - - WNT_ChordNote ( int, int, int, int, double, double ); - - virtual void Play ( BOOL = TRUE ); - -}; -/// -////////////////////// POLY SECTORS ////////////////////////// -/// -struct W32_PolySectorNote : public W32_ArcNote { - - W32_PolySectorNote ( int, int, int, int, double, double ); - - virtual void Play ( BOOL = TRUE ); - -}; - -struct WNT_PolySectorNote : public WNT_ArcNote { - - WNT_PolySectorNote ( int, int, int, int, double, double ); - - virtual void Play ( BOOL = TRUE ); - -}; -/// -/////////////////////// SECTORS ////////////////////////////// -/// -struct W32_SectorNote : public W32_PolySectorNote { - - W32_SectorNote ( int, int, int, int, double, double ); - - virtual void Play ( BOOL = TRUE ); - -}; - -struct WNT_SectorNote : public WNT_PolySectorNote { - - WNT_SectorNote ( int, int, int, int, double, double ); - - virtual void Play ( BOOL = TRUE ); - -}; -/// -/////////////////////// MARKERS ////////////////////////////// -/// -struct W32_PolyMarkerNote : public W32_Note { - - W32_PolyMarkerNote ( int ); - - void Replace ( int, int, int ); - - virtual void Play ( BOOL = TRUE ) {} - - int myMaxPoints, mySetPoints; - LPPOINT myPoints; - -}; - -struct W32_PolyMarker1Note : public W32_PolyMarkerNote { - - W32_PolyMarker1Note ( int, GetPointFunc, int, void* ); - - virtual void Play ( BOOL = TRUE ); - -}; - -struct WNT_PolyMarker1Note : public W32_PolyMarker1Note { - - WNT_PolyMarker1Note ( int, GetPointFunc, int, void* ); - - virtual void Play ( BOOL = TRUE ); - -}; - -struct W32_PolyMarker2Note : public W32_PolyMarker1Note { - - W32_PolyMarker2Note ( int, GetPointFunc, int, void* ); - - virtual void Play ( BOOL = TRUE ); - -}; - -struct WNT_PolyMarker2Note : public WNT_PolyMarker1Note { - - WNT_PolyMarker2Note ( int, GetPointFunc, int, void* ); - - virtual void Play ( BOOL = TRUE ); - -}; -/// -/////////////////////// POLYGONS ///////////////////////////// -/// -struct W32_PolygonNote : public W32_PolyMarkerNote { - - W32_PolygonNote ( int ); - - void Add ( int, int ); - - virtual void Play ( BOOL = TRUE ); - -}; - -struct WNT_PolygonNote : public W32_PolygonNote { - - WNT_PolygonNote ( int ); - - virtual void Play ( BOOL = TRUE ); - virtual void Xform ( void ); - - LPPOINT myTPoints; - -}; -/// -/////////////////////// POLYLINES //////////////////////////// -/// -struct W32_PolylineNote : public W32_PolygonNote { - - W32_PolylineNote ( int ); - - virtual void Play ( BOOL = TRUE ); - -}; - -struct WNT_PolylineNote : public WNT_PolygonNote { - - WNT_PolylineNote ( int ); - - virtual void Play ( BOOL = TRUE ); - -}; -/// -///////////////////////// IMAGES ///////////////////////////// -/// -struct W32_ImageNote : public W32_PointNote { - - W32_ImageNote ( int, int, PW32_Bitmap, double = 1.0 ); - virtual ~W32_ImageNote (); - - virtual void Play ( BOOL = TRUE ); - - PW32_Bitmap myBitmap; - double myScale; - -}; - -struct WNT_ImageNote : public WNT_PointNote { - - WNT_ImageNote ( int, int, PW32_Bitmap, double = 1.0 ); - virtual ~WNT_ImageNote (); - - virtual void Play ( BOOL = TRUE ); - - PW32_Bitmap myBitmap; - double myScale; - -}; -/// -///////////////////////// TEXTS ////////////////////////////// -/// -struct W32_TextNote : public W32_PointNote { - - W32_TextNote ( int, int, double, void*, BOOL = FALSE, BOOL = FALSE ); - - virtual void Play ( BOOL = TRUE ); - - void* myText; - double myAngle; - DWORD myFlags; - -}; - -struct WNT_TextNote : public WNT_PointNote { - - WNT_TextNote ( int, int, double, void*, BOOL = FALSE, BOOL = FALSE ); - - virtual void Play ( BOOL = TRUE ); - virtual void Xform ( void ); - void SetAttribs (); - void RestoreAttribs (); - void PaintText (); - void OutlineText (); - void FillText (); - - void* myText; - double mySlant; - DWORD myFlags; - int myShift; - XFORM RMatrix, - IMatrix, - SMatrix; - -}; -/// -/////////////////////// POLYTEXTS //////////////////////////// -/// -struct W32_PolyTextNote : public W32_TextNote { - - W32_PolyTextNote ( int, int, double, double, void*, BOOL = FALSE, BOOL = FALSE ); - - virtual void Play ( BOOL = TRUE ); - - double myMargin; - -}; - -struct WNT_PolyTextNote : public WNT_TextNote { - - WNT_PolyTextNote ( int, int, double, double, void*, BOOL = FALSE, BOOL = FALSE ); - - virtual void Play ( BOOL = TRUE ); - - double myMargin; - -}; -/// -////////////////// BEGIN/END MARKERS ///////////////////////// -/// -struct W32_BeginMarkerNote : public W32_PointNote { - - W32_BeginMarkerNote ( int, int, int, int, double ); - - virtual void Play ( BOOL = TRUE ); - - int myWidth, myHeight; - double myAngle; - -}; - -struct WNT_BeginMarkerNote : public WNT_PointNote { - - WNT_BeginMarkerNote ( int, int, int, int, double ); - - virtual void Play ( BOOL = TRUE ); - virtual void Xform ( void ); - - int myWidth, myHeight; - double myAngle, myPrevAngle; - XFORM myMatrix; - -}; - -struct W32_EndMarkerNote : public W32_Note { - - W32_EndMarkerNote (); - - virtual void Play ( BOOL = TRUE ); - -}; - -struct WNT_EndMarkerNote : public W32_Note { - - WNT_EndMarkerNote (); - - virtual void Play ( BOOL = TRUE ); - -}; -/// -//////////////////// A T T R I B U T E S ///////////////////// -/// -struct W32_LineAttribNote : public W32_Note { - - W32_LineAttribNote ( DWORD, PLOGBRUSH, DWORD = 0, PDWORD = NULL ); - - virtual void Play ( BOOL = TRUE ); - - LOGBRUSH myLogBrush; - DWORD myPenWidth; - DWORD myStyleCount; - PDWORD myStyles; - -}; - -struct WNT_LineAttribNote : public W32_Note { - - WNT_LineAttribNote ( DWORD, PLOGBRUSH, DWORD = 0, PDWORD = NULL ); - virtual ~WNT_LineAttribNote (); - - virtual void Play ( BOOL = TRUE ); - - HPEN myPen; - DWORD myWidth; - COLORREF myPointColor; - -}; - -struct W32_PolyAttribNote : public W32_Note { - - W32_PolyAttribNote ( PLOGBRUSH, BOOL, int = ALTERNATE ); - - virtual void Play ( BOOL = TRUE ); - - LOGBRUSH myBrush; - BOOL myfEdge; - int myFillMode; - -}; - -struct WNT_PolyAttribNote : public W32_Note { - - WNT_PolyAttribNote ( PLOGBRUSH, BOOL, int = ALTERNATE ); - virtual ~WNT_PolyAttribNote (); - - virtual void Play ( BOOL = TRUE ); - - HBRUSH myBrush; - BOOL myfEdge; - int myFillMode; - BOOL myNoFill; - -}; - -struct W32_TextAttribNote : public W32_Note { - - W32_TextAttribNote ( - HFONT, COLORREF, double = 0.0, double = 1.0, double = 1.0, - BOOL = FALSE, BOOL = FALSE, BOOL = FALSE - ); - virtual ~W32_TextAttribNote (); - - virtual void Play ( BOOL = TRUE ); - - COLORREF myColor; - HFONT myFont; - DWORD myFlags; - double mySlant, - myHScale, - myVScale; - -}; - -struct WNT_TextAttribNote : public W32_Note { - - WNT_TextAttribNote ( - HFONT, COLORREF, double = 0.0, double = 1.0, double = 1.0, - BOOL = FALSE, BOOL = FALSE, BOOL = FALSE - ); - virtual ~WNT_TextAttribNote (); - - virtual void Play ( BOOL = TRUE ); - - COLORREF myColor; - HPEN myPen; - HBRUSH myBrush; - HFONT myFont; - BOOL myfFree; - DWORD myFlags; - double mySlant, - myHScale, - myVScale; - -}; - -struct W32_MarkerAttribNote : public W32_Note { - - W32_MarkerAttribNote ( COLORREF, DWORD, BOOL ); - - virtual void Play ( BOOL = TRUE ); - - LOGBRUSH myLogBrush; - -}; - -struct WNT_MarkerAttribNote : public W32_Note { - - WNT_MarkerAttribNote ( COLORREF, DWORD, BOOL ); - virtual ~WNT_MarkerAttribNote (); - - virtual void Play ( BOOL = TRUE ); - - HPEN myPen; - COLORREF myMarkerPointColor; - BOOL myFill; - -}; -/// -//////////////////// F U N C T I O N C A L L //////////////// -/// -struct W32_FCallNote : public W32_Note { - - W32_FCallNote ( W32_FCall, int, PW32_FCALLPARAM ); - - virtual void Play ( BOOL = TRUE ); - - W32_FCall myFunc; - PW32_FCALLPARAM myParam; - -}; -/// -//////////////////// A L L O C A T O R /////////////////////// -/// -struct W32_Allocator { - - W32_Allocator ( int, PW32_Allocator = NULL ); - virtual ~W32_Allocator (); - - PW32_Block MakeBlock ( int ); - // allocates memory block - virtual PW32_Block KillBlock ( PW32_Block ); - // deallocates memory block - void KillBlocks ( PW32_Block ); - // deallocates memory blocks starting from specified one - void ClearBlocks ( void ); - // resets allocator - void ReleaseBlock ( PW32_Block ); - // releases graphics primitives in the specified block - BOOL FreeSpace ( PW32_Block, int ); - // checks for free space in the specified block - PW32_Block ReserveData ( unsigned int ); - // checks for free space in the current block - PW32_Block ReserveFind ( unsigned int ); - // searches for free space - void* ReserveBlock ( PW32_Block, int, BOOL = FALSE ); - // reserves data in the specified block - void* NewClass ( unsigned int ); - // gets space for a new class ( W32_Note ) - void* NewData ( unsigned int, BOOL = FALSE ); - // gets space for a new data - virtual void Xform ( void ) = 0; - // sets world transformation in the device context - - virtual void Play ( HDC, PSIZE ) = 0; - // plays notes - virtual void URect ( LPRECT ) = 0; - // gets updated rectangle - - virtual void Point ( int, int ) = 0; - // stores a point - virtual void MarkerPoint ( int, int ) = 0; - // stores a marker point - virtual void Line ( int, int, int, int ) = 0; - // stores a line segment - virtual void PolyEllipse ( int, int, int, int ) = 0; - // stores a polyellipse - virtual void Ellipse ( int, int, int, int ) = 0; - // stores an ellipse - virtual void Arc ( int, int, int, int, double, double ) = 0; - // stores an arc - virtual void PolyChord ( int, int, int, int, double, double ) = 0; - // stores a polychord - virtual void Chord ( int, int, int, int, double, double ) = 0; - // stores a chord - virtual void PolySector ( int, int, int, int, double, double ) = 0; - // stores a polysector - virtual void Sector ( int, int, int, int, double, double ) = 0; - // stores a sector - virtual void PolyMarker ( int ) = 0; - // stores a polymarker - virtual void PolyMarker1 ( int, GetPointFunc, int, void* ) = 0; - // stores a polymarker1 - virtual void PolyMarker2 ( int, GetPointFunc, int, void* ) = 0; - // stores a polymarker2 - virtual W32_Note* Polygon ( int ) = 0; - // stores a polygon - virtual W32_Note* Polyline ( int ) = 0; - // stores a polyline - virtual void Image ( int, int, PW32_Bitmap, double = 1.0 ) = 0; - // stores an image - virtual void Text ( int, int, double, void*, BOOL = FALSE, BOOL = FALSE ) = 0; - // stores a text - virtual void Polytext ( int, int, double, double, void*, BOOL = FALSE, BOOL = FALSE ) = 0; - // stores a polytext - virtual void BeginMarker ( int, int, int, int, double ) = 0; - // stores the begin of marker - virtual void EndMarker ( void ) = 0; - // stores end of the marker - virtual void LineAttrib ( DWORD, PLOGBRUSH, DWORD = 0, PDWORD = NULL ) = 0; - // stores line attributes - virtual void PolyAttrib ( PLOGBRUSH, BOOL, int = ALTERNATE ) = 0; - // stores polygon attributes - virtual void TextAttrib ( - HFONT, COLORREF, double = 0.0, double = 1.0, double = 1.0, - BOOL = FALSE, BOOL = FALSE, BOOL = FALSE - ) = 0; - //stores text attributes - virtual void MarkerAttrib ( COLORREF, DWORD, BOOL ) = 0; - // stores marker attributes - virtual void FunCall ( W32_FCall, int, PW32_FCALLPARAM ) = 0; - // stores function call - - virtual int TextSize ( HDC, char*, PSIZE ) = 0; - virtual int TextSize ( HDC, wchar_t*, PSIZE ) = 0; - //obtains dimensions of the text string - - int myID; - PW32_Allocator myNext; - PW32_Block myStart, myEnd; - W32_Primitive myPrimitive; - W32_Note* myNote; - int myFillMode; - DWORD myFlags; - POINT myPivot; - POINT myMove; - double myScaleX, myScaleY; - double myAngle; - double myTextVScale; - double myTextHScale; - double myTextSlant; - HFONT myTextFont; - COLORREF myPointColor, - myMarkerPointColor; - -}; - -extern PW32_Allocator ( *W32_GetAllocator ) ( int, PW32_Allocator ); - -#define P(v) LONG( ( v ) / myPixelToUnit + 0.5 ) -#define U(v) ( ( v ) * myPixelToUnit ) - -#endif // __W32_ALLOCATOR_HXX diff --git a/src/WNT/W95_Allocator.cxx b/src/WNT/W95_Allocator.cxx deleted file mode 100755 index e577eeb7e1..0000000000 --- a/src/WNT/W95_Allocator.cxx +++ /dev/null @@ -1,1219 +0,0 @@ -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - -//////////////////////////////////////////////////////////////////////////////// -// W95_Allocator // -// Provides memory management and drawing operations for Windows 95. // -// World transformations and styled lines are managed by EHDC stuff. // -// // -//FEB-98 - creation (EUG) // -// MAR-98 - modification (DCB) // -// // -// Notes: bitmap rotation code was created by MPO // -//////////////////////////////////////////////////////////////////////////////// -#include "W95_Allocator.hxx" - -#include -#include - -#define SGN( x ) ( ( x ) > 0 ? 1 : ( ( x ) < 0 ? -1 : 0 ) ) -#define ALLOCATOR ( ( PW95_Allocator )myAllocator ) - -#define MIN4( a, b, c, d ) min( min( ( a ), ( b ) ), min( ( c ), ( d ) ) ) -#define MAX4( a, b, c, d ) max( max( \ -( ( a ) == INT_MAX ? INT_MIN : ( a ) ), \ - ( ( b ) == INT_MAX ? INT_MIN : ( b ) ) \ - ), \ - max( \ - ( ( c ) == INT_MAX ? INT_MIN : ( c ) ), \ - ( ( d ) == INT_MAX ? INT_MIN : ( d ) ) \ - ) \ - ) - -static void WINAPI _InitXform ( PXFORM, double, int, int ); -static VOID CALLBACK _LineDDAProc ( int, int, LPARAM ); - -W95_Allocator :: W95_Allocator ( int anID, PW32_Allocator prev ) : - W32_Allocator ( anID, prev ) { - - myLinePenWidth = 0; - myLineBrush.lbStyle = BS_SOLID; - myLineBrush.lbColor = RGB( 0, 0, 0 ); - myLineBrush.lbHatch = 0; - myLineStyleCount = 0; - myLineStyles = NULL; - - myPolyBrush.lbStyle = BS_NULL; - - myTextColor = RGB( 0, 0, 0 ); - - myMarkerBrush = myPolyBrush; - myMarkerWidth = 0; - myFlags |= W32F_WIN95; - -} // end constructor - -W95_Allocator :: ~W95_Allocator () { - - if ( myLineStyles != NULL ) HeapFree ( - GetProcessHeap (), 0, ( LPVOID )myLineStyles - ); - -} // end destructor - -void W95_Allocator :: Play ( HDC hdc, PSIZE szClient ) { - - if ( !( myFlags & W32F_EMPTY ) ) { - - myHDC.SetDC ( hdc, szClient ); - myHDC.ResetURect (); - myHDC.SelectEPen ( - myLinePenWidth, &myLineBrush, - myLineStyleCount, myLineStyles - ); - myHDC.SelectEBrush ( &myPolyBrush, NULL ); - myHDC.SetTextAttrib ( - myTextColor, myTextFont, myTextSlant, - myTextHScale, myTextVScale - ); - myHDC.SetPolyFillMode ( myFillMode ); - - Xform (); - - for ( PW32_Block aBlock = myStart; aBlock != NULL; aBlock = aBlock -> next ) - - for ( int i = 0; i < aBlock -> free; i += aBlock -> data[ i ] ) - - if ( aBlock -> data[ i + 1 ] != __W32_DATA ) { - - W32_Note* pNote = ( W32_Note* )&( aBlock -> data[ i + 1 ] ); - pNote -> Play (); - - } // end if - - } // end if - -} // end W95_Allocator :: Play - -void W95_Allocator :: URect ( LPRECT lpRect ) { - - myHDC.GetURect ( lpRect ); - -} // end W95_Allocator :: URect - -void W95_Allocator :: Xform ( void ) { - - if ( myAngle != 0.0 || myPivot.x != 0 || myPivot.y != 0 || - myMove.x != 0 || myMove.y != 0 || - myScaleX != 1.0 || myScaleY != 1.0 - ) { - - XFORM xf; - double sinVal, cosVal; - - sinVal = sin ( myAngle ); - cosVal = cos ( myAngle ); - - xf.eM11 = 1.0F; xf.eM12 = 0.0F; - xf.eM21 = 0.0F; xf.eM22 = 1.0F; - xf.eDx = ( FLOAT )-myPivot.x; xf.eDy = ( FLOAT )-myPivot.y; - myHDC.SetWorldTransform ( &xf ); - - xf.eM11 = FLOAT ( cosVal * myScaleX ); xf.eM12 = FLOAT ( sinVal * myScaleX ); - xf.eM21 = FLOAT ( -sinVal * myScaleY ); xf.eM22 = FLOAT ( cosVal * myScaleY ); - xf.eDx = 0.0F; xf.eDy = 0.0F; - myHDC.ModifyWorldTransform ( &xf, MWT_RIGHTMULTIPLY ); - - xf.eM11 = 1.0F; xf.eM12 = 0.0F; - xf.eM21 = 0.0F; xf.eM22 = 1.0F; - xf.eDx = FLOAT ( myPivot.x + myMove.x ); xf.eDy = FLOAT ( myPivot.y + myMove.y ); - myHDC.ModifyWorldTransform ( &xf, MWT_RIGHTMULTIPLY ); - - myFlags |= W32F_XFORM; - - } else { - - myHDC.ModifyWorldTransform ( NULL, MWT_IDENTITY ); - myFlags &= ~W32F_XFORM; - - } // end else - -} // end W95_Allocator :: Xform - -void W95_Allocator :: Point ( int x, int y ) { - - new ( this ) W32_PointNote ( x, y ); - -} // end W95_Allocator :: Point - -void W95_Allocator :: MarkerPoint ( int x, int y ) { - - new ( this ) W32_MarkerPointNote ( x, y ); - -} // end W95_Allocator :: MarkerPoint - -void W95_Allocator :: Line ( int x, int y, int x1, int y1 ) { - - new ( this ) W32_LineNote ( x, y, x1, y1 ); - -} // end W95_Allocator :: Line - -void W95_Allocator :: PolyEllipse ( int xc, int yc, int xr, int yr ) { - - new ( this ) W32_PolyEllipseNote ( xc, yc, xr, yr ); - -} // end W95_Allocator :: PolyEllipse - -void W95_Allocator :: Ellipse ( int xc, int yc, int xr, int yr ) { - - new ( this ) W32_EllipseNote ( xc, yc, xr, yr ); - -} // end W95_Allocator :: Ellipse - -void W95_Allocator :: Arc ( - int xc, int yc, int xr, int yr, - double sa, double oa - ) { - - new ( this ) W32_ArcNote ( xc, yc, xr, yr, sa, oa ); - -} // end W95_Allocator :: Arc - -void W95_Allocator :: PolyChord ( - int xc, int yc, int xr, int yr, - double sa, double oa - ) { - - new ( this ) W32_PolyChordNote ( xc, yc, xr, yr, sa, oa ); - -} // end W95_Allocator :: PolyChord - -void W95_Allocator :: Chord ( - int xc, int yc, int xr, int yr, - double sa, double oa - ) { - - new ( this ) W32_PolyChordNote ( xc, yc, xr, yr, sa, oa ); - -} // end W95_Allocator :: Chord - -void W95_Allocator :: PolySector ( - int xc, int yc, int xr, int yr, - double sa, double oa - ) { - - new ( this ) W32_PolySectorNote ( xc, yc, xr, yr, sa, oa ); - -} // end W95_Allocator :: PolySector - -void W95_Allocator :: Sector ( - int xc, int yc, int xr, int yr, - double sa, double oa - ) { - - new ( this ) W32_SectorNote ( xc, yc, xr, yr, sa, oa ); - -} // end W95_Allocator :: Sector - -void W95_Allocator :: PolyMarker ( int aMaxPoints ) { - - new ( this ) W32_PolyMarkerNote ( aMaxPoints ); - -} // end W95_Allocator :: PolyMarker - -void W95_Allocator :: PolyMarker1 ( - int aMaxPoints, GetPointFunc fn, - int aStartPoint, void* fParam - ) { - - new ( this ) W32_PolyMarker1Note ( - aMaxPoints, fn, aStartPoint, fParam - ); - -} // end W95_Allocator :: PolyMarker1 - -void W95_Allocator :: PolyMarker2 ( - int aMaxPoints, GetPointFunc fn, - int aStartPoint, void* fParam - ) { - - new ( this ) W32_PolyMarker2Note ( - aMaxPoints, fn, aStartPoint, fParam - ); - -} // end W95_Allocator :: PolyMarker1 - -W32_Note* W95_Allocator :: Polygon ( int aMaxPoints ) { - - return new ( this ) W32_PolygonNote ( aMaxPoints ); - -} // end W95_Allocator :: Polygon - -W32_Note* W95_Allocator :: Polyline ( int aMaxPoints ) { - - return new ( this ) W32_PolylineNote ( aMaxPoints ); - -} // end W95_Allocator :: Polyline - -void W95_Allocator :: Image ( - int x, int y, PW32_Bitmap pBmp, double aScale - ) { - - new ( this ) W32_ImageNote ( x, y, pBmp, aScale ); - -} // end W95_Allocator :: Image - -void W95_Allocator :: Text ( - int x, int y, double angle, void* text, - BOOL fWide, BOOL fOutlined - ) { - - new ( this ) W32_TextNote ( x, y, angle, text, fWide, fOutlined ); - -} // end W95_Allocator :: Text - -void W95_Allocator :: Polytext ( - int x, int y, double angle, double margin, - void* text, BOOL fWide, BOOL fOutlined - ) { - - new ( this ) W32_PolyTextNote ( x, y, angle, margin, text, fWide, fOutlined ); - -} // end W95_Allocator :: Polytext - -void W95_Allocator :: BeginMarker ( - int x, int y, int w, int h, double angle - ) { - - new ( this ) W32_BeginMarkerNote ( x, y, w, h, angle ); - -} // end W95_Allocator :: BeginMarker - -void W95_Allocator :: EndMarker ( void ) { - - new ( this ) W32_EndMarkerNote (); - -} // end W95_Allocator :: EndMarker - -void W95_Allocator :: LineAttrib ( - DWORD width, PLOGBRUSH plb, - DWORD nStyles, PDWORD pdwStyle - ) { - - new ( this ) W32_LineAttribNote ( width, plb, nStyles, pdwStyle ); - -} // end W95_Allocator :: LineAttrib - -void W95_Allocator :: PolyAttrib ( - PLOGBRUSH plb, BOOL fDrawEdge, int aFillMode - ) { - - new ( this ) W32_PolyAttribNote ( plb, fDrawEdge, aFillMode ); - -} // end W95_Allocator :: PolyAttrib - -void W95_Allocator :: TextAttrib ( - HFONT hFont, COLORREF color, double slant, - double hScale, double vScale, - BOOL fUnderlined, BOOL fFree, BOOL fIndex - ) { - - if ( myFlags & W32F_START ) - - new ( this ) W32_TextAttribNote ( - hFont, color, slant, hScale, vScale, - fUnderlined, fFree, fIndex - ); - - else { - - if ( myFlags & W32F_DFONT && !fIndex ) { - - DeleteFont( myTextFont ); - myFlags &= ~W32F_DFONT; - - } // end if - - myTextColor = color; - myTextFont = hFont; - myTextSlant = slant; - myTextHScale = vScale; - myTextVScale = hScale; - myFlags |= ( fUnderlined ? W32F_TULIN : 0 ); - - } // end else - -} // end W95_Allocator :: TextAttrib - -void W95_Allocator :: MarkerAttrib ( - COLORREF color, DWORD dwWidth, BOOL fFill - ) { - - new ( this ) W32_MarkerAttribNote ( color, dwWidth, fFill ); - -} // end W95_Allocator :: MarkerAttrib - -void W95_Allocator :: FunCall ( - W32_FCall fCall, int sz, PW32_FCALLPARAM param - ) { - - new ( this ) W32_FCallNote ( fCall, sz, param ); - -} // end W95_Allocator :: FunCall - -int W95_Allocator :: TextSize ( HDC hdc, char* str, PSIZE psz ) -{ - ABC abcf; - GetTextExtentPoint32A ( hdc, str, lstrlenA ( str ), psz ); - GetCharABCWidthsA ( hdc, str[ 0 ], str[ 0 ], &abcf ); - psz->cx = LONG ( psz->cx * myTextHScale ); - psz->cy = LONG ( psz->cy * myTextVScale ); - abcf.abcA = UINT ( abcf.abcA * myTextHScale ); - return abcf.abcA; -} // end W95_Allocator :: TextSize - -int W95_Allocator :: TextSize ( HDC hdc, wchar_t* str, PSIZE psz ) -{ - ABC abcf; - GetTextExtentPoint32W ( hdc, str, lstrlenW ( str ), psz ); - GetCharABCWidthsW ( hdc, str[ 0 ], str[ 0 ], &abcf ); - psz->cx = LONG ( psz->cx * myTextHScale ); - psz->cy = LONG ( psz->cy * myTextVScale ); - abcf.abcA = UINT ( abcf.abcA * myTextHScale ); - return abcf.abcA; -} // end W95_Allocator :: TextSize -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ P o i n t N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_PointNote :: W32_PointNote ( int x, int y ) { - - myX = x; - myY = y; - -} // end constructor - -void W32_PointNote :: Play ( BOOL ) { - - ALLOCATOR -> myHDC.SetPixel ( myX, myY, ALLOCATOR -> myPointColor ); - -} // end W32_PointNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ M a r k e r P o i n t N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_MarkerPointNote :: W32_MarkerPointNote ( int x, int y ) : - W32_PointNote ( x, y ) { - -} // end constructor - -void W32_MarkerPointNote :: Play ( BOOL ) { - - ALLOCATOR -> myHDC.SetPixel ( myX, myY, ALLOCATOR -> myMarkerPointColor ); - -} // end W32_MarkerPointNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ L i n e N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_LineNote :: W32_LineNote ( int x, int y, int x1, int y1 ) : - W32_PointNote ( x, y ) { - - myX2 = x1; - myY2 = y1; - -} // end constructor - -void W32_LineNote :: Play ( BOOL ) { - - EHDC* pe = &ALLOCATOR -> myHDC; - - pe -> MoveToEx ( myX, myY, NULL ); - pe -> LineTo ( myX2, myY2 ); - -} // end W32_LineNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ P o l y E l l i p s e N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_PolyEllipseNote :: W32_PolyEllipseNote ( int xc, int yc, int xr, int yr ) : - W32_PointNote ( xc, yc ) { - - myXr = xr; - myYr = yr; - -} // end constructor - -void W32_PolyEllipseNote :: Play ( BOOL ) { - - ALLOCATOR -> myHDC.Polyarc ( myX, myY, myXr, myYr ); - -} // end W32_PolyEllipseNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ E l l i p s e N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_EllipseNote :: W32_EllipseNote ( int xc, int yc, int xr, int yr ) : - W32_PolyEllipseNote ( xc, yc, xr, yr ) { - -} // end constructor - -void W32_EllipseNote :: Play ( BOOL ) { - - ALLOCATOR -> myHDC.Arc ( myX, myY, myXr, myYr ); - -} // end W32_PolyEllipseNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ A r c N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_ArcNote :: W32_ArcNote ( - int xc, int yc, int xr, int yr, double sa, double oa - ) : W32_PolyEllipseNote ( xc, yc, xr, yr ) { - - mySa = sa; - myOa = oa; - -} // end constructor - -void W32_ArcNote :: Play ( BOOL ) { - - ALLOCATOR -> myHDC.Arc ( myX, myY, myXr, myYr, mySa, myOa ); - -} // end W32_ArcNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ P o l y C h o r d N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_PolyChordNote :: W32_PolyChordNote ( - int xc, int yc, int xr, int yr, double sa, double oa - ) : W32_ArcNote ( xc, yc, xr, yr, sa, oa ) { - -} // end constructor - -void W32_PolyChordNote :: Play ( BOOL ) { - - ALLOCATOR -> myHDC.Polyarc ( myX, myY, myXr, myYr, mySa, myOa ); - -} // end W32_PolyChordNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ C h o r d N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_ChordNote :: W32_ChordNote ( - int xc, int yc, int xr, int yr, double sa, double oa - ) : W32_PolyChordNote ( xc, yc, xr, yr, sa, oa ) { - -} // end constructor - -void W32_ChordNote :: Play ( BOOL ) { - - ALLOCATOR -> myHDC.Arc ( myX, myY, myXr, myYr, mySa, myOa ); - -} // end W32_ChordNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ P o l y S e c t o r N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_PolySectorNote :: W32_PolySectorNote ( - int xc, int yc, int xr, int yr, double sa, double oa - ) : W32_ArcNote ( xc, yc, xr, yr, sa, oa ) { - -} // end constructor - -void W32_PolySectorNote :: Play ( BOOL ) { - - ALLOCATOR -> myHDC.Polyarc ( myX, myY, myXr, myYr, mySa, myOa, FALSE ); - -} // end W32_PolySectorNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ S e c t o r N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_SectorNote :: W32_SectorNote ( - int xc, int yc, int xr, int yr, double sa, double oa - ) : W32_PolySectorNote ( xc, yc, xr, yr, sa, oa ) { - -} // end constructor - -void W32_SectorNote :: Play ( BOOL ) { - - ALLOCATOR -> myHDC.Arc ( myX, myY, myXr, myYr, mySa, myOa, ARCF_PIE ); - -} // end W32_SectorNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ P o l y M a r k e r N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_PolyMarkerNote :: W32_PolyMarkerNote ( int aMaxPoints ) { - - myMaxPoints = aMaxPoints; - mySetPoints = 0; - myPoints = ( LPPOINT )myAllocator -> NewData ( - myMaxPoints * sizeof ( POINT ) - ); - -} // end constructor - -void W32_PolyMarkerNote :: Replace ( int idx, int x, int y ) { - - if ( idx >= myMaxPoints ) return; - - myPoints[ idx ].x = x; - myPoints[ idx ].y = y; - -} // end CPolyMarkerNote :: Replace -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ P o l y M a r k e r 1 N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_PolyMarker1Note :: W32_PolyMarker1Note ( - int aMaxPoints, GetPointFunc fn, int aStartPoint, - void* fParam - ) : W32_PolyMarkerNote ( aMaxPoints ) { - - ( *fn ) ( aStartPoint, myMaxPoints, aStartPoint, myPoints, &mySetPoints, fParam ); - -} // end constructor - -void W32_PolyMarker1Note :: Play ( BOOL ) { - - if ( ALLOCATOR -> myFlags & W32F_MFILL ) - - ALLOCATOR -> myHDC.Polygon ( - myPoints, mySetPoints, - POLYF_NOCLOSEDGE - ); - - else - - ALLOCATOR -> myHDC.Polyline ( myPoints, mySetPoints ); - -} // end W32_PolyMarker1Note :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ P o l y M a r k e r 2 N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_PolyMarker2Note :: W32_PolyMarker2Note ( - int aMaxPoints, GetPointFunc fn, int aStartPoint, - void* fParam - ) : W32_PolyMarker1Note ( - aMaxPoints, fn, aStartPoint, fParam - ) { - -} // end constructor - -void W32_PolyMarker2Note :: Play ( BOOL ) { - - if ( ALLOCATOR -> myFlags & W32F_MFILL ) - - ALLOCATOR -> myHDC.Polygon ( myPoints, mySetPoints - 1 ); - - else - - ALLOCATOR -> myHDC.Polyline ( myPoints, mySetPoints - 1, TRUE ); - -} // end W32_PolyMarker2Note :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ P o l y g o n N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_PolygonNote :: W32_PolygonNote ( int aMaxPoints ) : - W32_PolyMarkerNote ( aMaxPoints ) { - -} // end constructor - -void W32_PolygonNote :: Play ( BOOL ) { - - ALLOCATOR -> myHDC.Polygon ( - myPoints, mySetPoints, - ALLOCATOR -> myFlags & W32F_POUTL ? 0 : POLYF_NOEDGE - ); - -} // end W32_PolygonNote :: Play - -void W32_PolygonNote :: Add ( int aX,int aY ) { - - if ( mySetPoints == myMaxPoints ) return; - - ( myPoints + mySetPoints ) -> x = aX; - ( myPoints + mySetPoints ) -> y = aY; - - ++mySetPoints; - -} // end W32_CPolygonNote :: Add -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ P o l y l i n e N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_PolylineNote :: W32_PolylineNote ( int aMaxPoints ) : - W32_PolygonNote ( aMaxPoints ) { - -} // end constructor - -void W32_PolylineNote :: Play ( BOOL ) { - - DWORD nPts; - BOOL fClose; - int idx = mySetPoints - 1; - - if ( myPoints -> x == myPoints[ idx ].x && - myPoints -> y == myPoints[ idx ].y - ) { - - nPts = idx; - fClose = TRUE; - - } else { - - nPts = mySetPoints; - fClose = FALSE; - - } // end else - - ALLOCATOR -> myHDC.Polyline ( myPoints, nPts, fClose ); - -} // end W32_PolylineNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ I m a g e N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_ImageNote :: W32_ImageNote ( - int x, int y, PW32_Bitmap pBmp, double aScale - ) : W32_PointNote ( x, y ) { - - myBitmap = pBmp; - ++pBmp -> nUsed; - myScale = aScale; - -} // end constructor - -W32_ImageNote :: ~W32_ImageNote () { - - if ( myBitmap -> hBmp != NULL && --myBitmap -> nUsed == 0 ) { - - DeleteObject ( myBitmap -> hBmp ); - HeapFree ( GetProcessHeap (), 0, ( PVOID )myBitmap ); - - } // end if - -} // end W32_ImageNote :: ~W32_ImageNote - -void W32_ImageNote :: Play ( BOOL ) { - - int xx, yy, w, h; - HDC hdc, hdcMem; - BITMAP bmp; - HBITMAP hbo; - SIZE sz; - POINT up[ 4 ]; - BOOL fScale = FALSE; - - ALLOCATOR -> myHDC.Extent ( &sz ); - GetObject ( myBitmap -> hBmp, sizeof ( BITMAP ), &bmp ); - - xx = myX; - yy = myY; - w = bmp.bmWidth; - h = bmp.bmHeight; - - if ( myScale != 1.0 ) { - - w = int ( w * myScale + 0.5 ); - h = int ( h * myScale + 0.5 ); - - fScale = TRUE; - - } - - if ( ALLOCATOR -> myScaleX != 1.0 ) { - - xx = int ( xx * ALLOCATOR -> myScaleX + 0.5 ); - w = int ( w * ALLOCATOR -> myScaleX + 0.5 ); - - fScale = TRUE; - - } // end if - - if ( ALLOCATOR -> myScaleY != 1.0 ) { - - yy = int ( yy * ALLOCATOR -> myScaleY + 0.5 ); - h = int ( h * ALLOCATOR -> myScaleY + 0.5 ); - - fScale = TRUE; - - } // end if - - xx = xx - ( w >> 1 ) + ALLOCATOR -> myPivot.x + ALLOCATOR -> myMove.x ; - yy = sz.cy - ( yy + ( h >> 1 ) ) - ALLOCATOR -> myPivot.y - ALLOCATOR -> myMove.y; - - hdc = ALLOCATOR -> myHDC.Hdc (); - hdcMem = CreateCompatibleDC ( hdc ); - hbo = SelectBitmap( hdcMem, myBitmap -> hBmp ); - - if ( ALLOCATOR -> myAngle == 0.0 ) { - - StretchBlt ( - hdc, xx, yy, w, h, - hdcMem, 0, 0, bmp.bmWidth, bmp.bmHeight, - SRCCOPY - ); - - up[ 0 ].x = xx; up[ 0 ].y = yy; - up[ 1 ].x = xx + w; up[ 1 ].y = up[ 0 ].y; - up[ 2 ].x = up[ 1 ].x; up[ 2 ].y = yy + h; - up[ 3 ].x = up[ 0 ].x; up[ 3 ].y = up[ 2 ].y; - - ALLOCATOR -> myHDC.Register ( up, 4 ); - - } else { - - int i, j; - int x1 = xx; - int y1 = sz.cy - yy - h; - int x2 = x1 + w; - int y2 = y1; - int x3 = x2; - int y3 = y1 + h; - int x4 = x1; - int y4 = y3; - int xmin = MIN4( x1, x2, x3, x4 ); - int ymin = MIN4( y1, y2, y3, y4 ); - double DeltaX = cos ( -ALLOCATOR -> myAngle ); - double DeltaY = sin ( -ALLOCATOR -> myAngle ); - int X1 = int ( x1 * DeltaX + y1 * DeltaY ); - int Y1 = int ( -x1 * DeltaY + y1 * DeltaX ); - int X2 = int ( x2 * DeltaX + y2 * DeltaY ); - int Y2 = int ( -x2 * DeltaY + y2 * DeltaX ); - int X3 = int ( x3 * DeltaX + y3 * DeltaY ); - int Y3 = int ( -x3 * DeltaY + y3 * DeltaX ); - int X4 = int ( x4 * DeltaX + y4 * DeltaY ); - int Y4 = int ( -x4 * DeltaY + y4 * DeltaX ); - int YHeight = max( abs ( Y1 - Y3 ), abs ( Y2 - Y4 ) ) + 1; - int Ymin = MIN4( Y1, Y2, Y3, Y4 ); - PINT line1, line2, line3, line4; - PPOINT lines; - HBITMAP hbo2 = NULL, hBmp = NULL; - - if ( fScale ) { - - HDC hdcMem2 = CreateCompatibleDC ( hdc ); - hBmp = CreateCompatibleBitmap ( hdc, w, h ); - - hbo2 = SelectBitmap( hdcMem2, hBmp ); - StretchBlt ( - hdcMem2, 0, 0, w, h, - hdcMem, 0, 0, bmp.bmWidth, bmp.bmHeight, - SRCCOPY - ); - SelectBitmap( hdcMem2, hbo2 ); - DeleteDC ( hdcMem2 ); - - hbo2 = SelectBitmap( hdcMem, hBmp ); - - } // end if - - lines = ( PPOINT )VirtualAlloc ( - NULL, ( ( j = ( sizeof ( int ) * YHeight ) ) << 2 ) + - ( i = YHeight * sizeof ( POINT ) ), - MEM_RESERVE | MEM_COMMIT, PAGE_READWRITE - ); - - line1 = PINT ( ( ( PBYTE )lines ) + i ); - line2 = PINT ( ( ( PBYTE )line1 ) + j ); - line3 = PINT ( ( ( PBYTE )line2 ) + j ); - line4 = PINT ( ( ( PBYTE )line3 ) + j ); - - for ( i = 0; i < YHeight; ++i ) - - line1[ i ] = line2[ i ] = line3[ i ] = line4[ i ] = INT_MAX; - - LineDDA ( X1, Y1 - Ymin, X2, Y2 - Ymin, &_LineDDAProc, ( LPARAM )line1 ); - LineDDA ( X2, Y2 - Ymin, X3, Y3 - Ymin, &_LineDDAProc, ( LPARAM )line2 ); - LineDDA ( X3, Y3 - Ymin, X4, Y4 - Ymin, &_LineDDAProc, ( LPARAM )line3 ); - LineDDA ( X4, Y4 - Ymin, X1, Y1 - Ymin, &_LineDDAProc, ( LPARAM )line4 ); - - for ( i = 0; i < YHeight; ++i ) { - - lines[ i ].x = MIN4( line1[ i ], line2[ i ], line3[ i ], line4[ i ] ); - - if ( lines[ i ].x < 0 ) lines[ i ].x = 0; - - lines[ i ].y = MAX4( line1[ i ], line2[ i ], line3[ i ], line4[ i ] ); - - } // end for - - for ( j = ( -Ymin < 0 ? 0 : -Ymin ); j < YHeight; ++j ) { - - int Yt = sz.cy - ( j + Ymin ); - int Yy = j + Ymin; - double XB = lines[ j ].x * DeltaX - Yy * DeltaY - xmin; - double YB = h - ( lines[ j ].x * DeltaY + Yy * DeltaX - ymin ); - - up[ 0 ].x = lines[ j ].x; up[ 0 ].y = Yt; - up[ 1 ].x = lines[ j ].y; up[ 1 ].y = Yt; - - ALLOCATOR -> myHDC.Register ( up, 2 ); - - for ( i = lines[ j ].x; i <= lines[ j ].y; ++i ) { - - SetPixel ( - hdc, i, Yt, GetPixel ( hdcMem, ( int )XB, ( int )YB ) - ); - - XB += DeltaX; YB -= DeltaY; - - } // end for ( i ) - - } // end for ( j ) - - VirtualFree ( ( LPVOID )lines, 0, MEM_DECOMMIT | MEM_RELEASE ); - - if ( fScale ) { - - SelectBitmap( hdcMem, hbo2 ); - DeleteBitmap( hBmp ); - - } // end if - - ALLOCATOR -> Xform (); - - } // end else - - SelectBitmap( hdcMem, hbo ); - DeleteDC ( hdcMem ); - -} // end W32_ImageNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ T e x t N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_TextNote :: W32_TextNote ( - int x, int y, double angle, void* text, - BOOL fWide, BOOL fOutlined - ) : W32_PointNote ( x, y ), myAngle ( angle ) { - - DWORD dwLen = fWide ? ( ( lstrlenW ( ( LPCWSTR )text ) + 1 ) << 1 ) - : ( ( lstrlenA ( ( LPCSTR )text ) + 1 ) << 0 ); - - myText = ALLOCATOR -> NewData ( dwLen ); - CopyMemory ( myText, text, dwLen ); - - myFlags = ( ( fWide ? W32F_TUNICODE : 0 ) | - ( fOutlined ? W32F_TOUTLINE : 0 ) - ); - -} // end constructor - -void W32_TextNote :: Play ( BOOL ) { - - if ( myFlags & W32F_TUNICODE ) - - ALLOCATOR -> myHDC.ETextOut ( - myX, myY, ( wchar_t* )myText, myAngle, - myFlags & W32F_TOUTLINE || ALLOCATOR -> myFlags & W32F_MONO - ); - - else - - ALLOCATOR -> myHDC.ETextOut ( - myX, myY, ( char* )myText, myAngle, - myFlags & W32F_TOUTLINE || ALLOCATOR -> myFlags & W32F_MONO - ); - -} // end W32_TextNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ P o l y T e x t N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_PolyTextNote :: W32_PolyTextNote ( - int x, int y, double angle, double margin, - void* text, BOOL fWide, BOOL fOutlined - ) : W32_TextNote ( x, y, angle, text, fWide, fOutlined ), - myMargin ( margin ) { - -} // end constructor - -void W32_PolyTextNote :: Play ( BOOL ) { - - BOOL fNofill = ( ALLOCATOR -> myFlags & W32F_NOFIL ? TRUE : FALSE ); - BOOL fNoframe = ( ALLOCATOR -> myFlags & W32F_POUTL ? FALSE : TRUE ); - - if ( myFlags & W32F_TUNICODE ) - - ALLOCATOR -> myHDC.PolyTextOut ( - myX, myY, ( wchar_t* )myText, myAngle, - myMargin, myFlags & W32F_TOUTLINE || ALLOCATOR -> myFlags & W32F_MONO, fNofill, - fNoframe - ); - - else - - ALLOCATOR -> myHDC.PolyTextOut ( - myX, myY, ( char* )myText, myAngle, - myMargin, myFlags & W32F_TOUTLINE || ALLOCATOR -> myFlags & W32F_MONO, fNofill, - fNoframe - ); - -} // end W32_PolyTextNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ B e g i n M a r k e r N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_BeginMarkerNote :: W32_BeginMarkerNote ( - int x, int y, int w, int h, double angle - ) : W32_PointNote ( x, y ), - myAngle ( angle ), myWidth ( w ), myHeight ( h ) { - -} // end constructor - -void W32_BeginMarkerNote :: Play ( BOOL ) { - - XFORM xfm; - LOGBRUSH lb = { BS_SOLID, ALLOCATOR -> myMarkerPointColor, 0 }; - POINT p = { myX, myY }; - - if ( ALLOCATOR -> myFlags & W32F_XFORM ) ALLOCATOR -> myHDC.Transform ( &p, 1 ); - - _InitXform ( &xfm, myAngle, p.x, p.y ); - - ALLOCATOR -> myHDC.SetWorldTransform ( &xfm ); - ALLOCATOR -> myHDC.SelectEPen ( - ALLOCATOR -> myMarkerWidth, &lb - ); - ALLOCATOR -> myHDC.SelectEBrush ( - &ALLOCATOR -> myMarkerBrush, - &ALLOCATOR -> myMarkerBrushOrig - ); - -} // end W32_BeginMarkerNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ E n d M a r k e r N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_EndMarkerNote :: W32_EndMarkerNote () {} - -void W32_EndMarkerNote :: Play ( BOOL ) { - - ALLOCATOR -> Xform (); - ALLOCATOR -> myHDC.SelectEPen ( 0xFFFFFFFF, NULL ); - ALLOCATOR -> myHDC.SelectEBrush ( &ALLOCATOR -> myMarkerBrushOrig ); - -} // end W32_EndMarkerNote :: Play - -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// -//////////////////////////////////////////////////////////////////////////////// -#define SET_ATTRIB \ - ( ((ALLOCATOR->myFlags & W32F_MONO) && (ALLOCATOR->myFlags & W32F_MINIT)) ||\ - !(ALLOCATOR->myFlags & W32F_MONO)\ - ) -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ L i n e A t t r i b N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_LineAttribNote :: W32_LineAttribNote ( - DWORD width, PLOGBRUSH plb, - DWORD nStyles, PDWORD pdwStyle - ) { - - myPenWidth = width; - myLogBrush = *plb; - myStyleCount = nStyles; - - if ( myStyleCount != 0 ) { - - DWORD dwLen = nStyles * sizeof ( DWORD ); - - myStyles = ( PDWORD )ALLOCATOR -> NewData ( dwLen ); - - CopyMemory ( myStyles, pdwStyle, dwLen ); - - } // end if - - Play ( FALSE ); - -} // end constructor - -void W32_LineAttribNote :: Play ( BOOL fRealize ) { - - ALLOCATOR -> myPointColor = myLogBrush.lbColor; - ALLOCATOR -> myLineBrush = myLogBrush; - ALLOCATOR -> myLinePenWidth = myPenWidth; - - if ( myStyleCount != 0 ) { - - DWORD dwLen = myStyleCount * sizeof ( DWORD ); - - if ( ALLOCATOR -> myLineStyles != NULL ) - - ALLOCATOR -> myLineStyles = ( PDWORD )HeapReAlloc ( - GetProcessHeap (), - HEAP_GENERATE_EXCEPTIONS, - ALLOCATOR -> myLineStyles, - dwLen - ); - - else - - ALLOCATOR -> myLineStyles = ( PDWORD )HeapAlloc ( - GetProcessHeap (), - HEAP_GENERATE_EXCEPTIONS, - dwLen - ); - - CopyMemory ( ALLOCATOR -> myLineStyles, myStyles, dwLen ); - ALLOCATOR -> myLineStyleCount = myStyleCount; - - } // end if - - if ( fRealize ) ALLOCATOR -> myHDC.SelectEPen ( - myPenWidth, &myLogBrush, - myStyleCount, myStyles - ); - -} // end W32_LineAttribNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ P o l y A t t r i b N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_PolyAttribNote :: W32_PolyAttribNote ( - PLOGBRUSH plb, BOOL fDrawEdge, int aFillMode - ) { - - myBrush = *plb; - myfEdge = fDrawEdge; - myFillMode = aFillMode; - - Play ( FALSE ); - -} // end constructor - -void W32_PolyAttribNote :: Play ( BOOL fRealize ) { - - ALLOCATOR -> myFillMode = myFillMode; - if ( myfEdge ) ALLOCATOR -> myFlags |= W32F_POUTL; - else ALLOCATOR -> myFlags &= ~W32F_POUTL; - if ( myBrush.lbStyle == BS_NULL ) ALLOCATOR -> myFlags |= W32F_NOFIL; - else ALLOCATOR -> myFlags &= ~W32F_NOFIL; - - ALLOCATOR -> myPolyBrush = myBrush; - if ( fRealize ) { - ALLOCATOR -> myHDC.SelectEBrush ( &myBrush ); - ALLOCATOR -> myHDC.SetPolyFillMode ( myFillMode ); - } // end if - -} // end W32_PolyAttribNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ T e x t A t t r i b N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_TextAttribNote :: W32_TextAttribNote ( - HFONT hFont, COLORREF color, double slant, - double hScale, double vScale, - BOOL fUnderlined, BOOL fFree, BOOL fIndex - ) { - - myColor = color; - myFont = hFont; - mySlant = slant; - myHScale = vScale; - myVScale = hScale; - myFlags = ( fUnderlined ? W32F_TFULINED : 0 ) | - ( fIndex ? W32F_TINDEX : 0 ) | - ( fFree ? W32F_TFREE : 0 ); - - Play ( FALSE ); - -} // end constructor - -W32_TextAttribNote :: ~W32_TextAttribNote () { - - if ( myFlags & W32F_TFREE ) DeleteFont( myFont ); - -} // end destructor - -void W32_TextAttribNote :: Play ( BOOL fRealize ) { - - if ( ( ALLOCATOR -> myFlags & W32F_DFONT ) && !( myFlags & W32F_TINDEX ) ) { - DeleteFont( ALLOCATOR -> myTextFont ); - ALLOCATOR -> myFlags &= ~W32F_DFONT; - } // end if - - ALLOCATOR -> myTextFont = myFont; - ALLOCATOR -> myTextSlant = mySlant; - ALLOCATOR -> myTextHScale = myHScale; - ALLOCATOR -> myTextVScale = myVScale; - if ( myFlags & W32F_TFULINED ) ALLOCATOR -> myFlags |= W32F_TULIN; - else ALLOCATOR -> myFlags &= ~W32F_TULIN; - - ALLOCATOR -> myTextColor = myColor; - if ( fRealize && !( myFlags & W32F_TINDEX ) ) - ALLOCATOR -> myHDC.SetTextAttrib ( - myColor, myFont, mySlant, - myHScale, myVScale - ); - -} // end W32_TextAttribNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ M a r k e r A t t r i b N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_MarkerAttribNote :: W32_MarkerAttribNote ( - COLORREF color, DWORD dwWidth, BOOL fFill - ) { - - myLogBrush.lbStyle = fFill; - myLogBrush.lbColor = color; - myLogBrush.lbHatch = dwWidth; - - Play (); - -} // end constructor - -void W32_MarkerAttribNote :: Play ( BOOL ) { - - ALLOCATOR -> myMarkerBrush.lbStyle = BS_SOLID; - ALLOCATOR -> myMarkerBrush.lbColor = ALLOCATOR -> myPolyBrush.lbColor; - ALLOCATOR -> myMarkerBrush.lbHatch = 0; - ALLOCATOR -> myMarkerWidth = myLogBrush.lbHatch; - ALLOCATOR -> myMarkerPointColor = myLogBrush.lbColor; - - if ( myLogBrush.lbStyle ) - ALLOCATOR -> myFlags |= W32F_MFILL; - else - ALLOCATOR -> myFlags &= ~W32F_MFILL; - -} // end W32_MarkerAttribNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W 3 2 _ F C a l l N o t e // -//////////////////////////////////////////////////////////////////////////////// -W32_FCallNote :: W32_FCallNote ( - W32_FCall fCall, int sz, PW32_FCALLPARAM param - ) { - - myFunc = fCall; - - myParam = ( PW32_FCALLPARAM )ALLOCATOR -> NewData ( sz ); - - CopyMemory ( myParam, param, sz ); - -} // end constructor - -void W32_FCallNote :: Play ( BOOL ) { - - ( *myFunc ) ( myParam ); - -} // end W32_FCallNote :: Play -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// -// M i s c e l l a n e o u s +// -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// -static void WINAPI _InitXform ( PXFORM pxf, double angle, int x, int y ) { - - double cosVal, sinVal; - - cosVal = cos ( angle ); - sinVal = sin ( angle ); - - pxf -> eM11 = ( FLOAT ) cosVal; pxf -> eM12 = ( FLOAT )sinVal; - pxf -> eM21 = ( FLOAT )-sinVal; pxf -> eM22 = ( FLOAT )cosVal; - pxf -> eDx = ( FLOAT ) x; pxf -> eDy = ( FLOAT ) y; - -} // end _InitXform - -static VOID CALLBACK _LineDDAProc ( int x, int y, LPARAM lpData ) { - - ( ( PINT )lpData )[ y ] = x; - -} // end LineDDAProc -//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++// diff --git a/src/WNT/W95_Allocator.hxx b/src/WNT/W95_Allocator.hxx deleted file mode 100755 index 595ec88427..0000000000 --- a/src/WNT/W95_Allocator.hxx +++ /dev/null @@ -1,88 +0,0 @@ -// Created by: PLOTNIKOV Eugeny & CHABROVSKY Dmitry -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - - -#ifndef __W95_ALLOCATOR_HXX -# define __W95_ALLOCATOR_HXX - -# include "EHDC.hxx" -# include "W32_Allocator.hxx" - -struct W95_Allocator : public W32_Allocator { - - W95_Allocator ( int, PW32_Allocator = NULL ); - virtual ~W95_Allocator (); - - virtual void Xform ( void ); - - virtual void Play ( HDC, PSIZE ); - virtual void URect ( LPRECT ); - - virtual void Point ( int, int ); - virtual void MarkerPoint ( int, int ); - virtual void Line ( int, int, int, int ); - virtual void PolyEllipse ( int, int, int, int ); - virtual void Ellipse ( int, int, int, int ); - virtual void Arc ( int, int, int, int, double, double ); - virtual void PolyChord ( int, int, int, int, double, double ); - virtual void Chord ( int, int, int, int, double, double ); - virtual void PolySector ( int, int, int, int, double, double ); - virtual void Sector ( int, int, int, int, double, double ); - virtual void PolyMarker ( int ); - virtual void PolyMarker1 ( int, GetPointFunc, int, void* ); - virtual void PolyMarker2 ( int, GetPointFunc, int, void* ); - virtual W32_Note* Polygon ( int ); - virtual W32_Note* Polyline( int ); - virtual void Image ( int, int, PW32_Bitmap, double = 1.0 ); - virtual void Text ( int, int, double, void*, BOOL = FALSE, BOOL = FALSE ); - virtual void Polytext ( int, int, double, double, void*, BOOL = FALSE, BOOL = FALSE ); - virtual void BeginMarker ( int, int, int, int, double ); - virtual void EndMarker ( void ); - virtual void LineAttrib ( DWORD, PLOGBRUSH, DWORD = 0, PDWORD = NULL ); - virtual void PolyAttrib ( PLOGBRUSH, BOOL, int = ALTERNATE ); - virtual void TextAttrib ( - HFONT, COLORREF, double = 0.0, double = 1.0, double = 1.0, - BOOL = FALSE, BOOL = FALSE, BOOL = FALSE - ); - virtual void MarkerAttrib ( COLORREF, DWORD, BOOL ); - virtual void FunCall ( W32_FCall, int, PW32_FCALLPARAM ); - - virtual int TextSize ( HDC, char*, PSIZE ); - virtual int TextSize ( HDC, wchar_t*, PSIZE ); - - LOGBRUSH myLineBrush; // line attributes - DWORD myLinePenWidth; - DWORD myLineStyleCount; - PDWORD myLineStyles; - - LOGBRUSH myPolyBrush; // polygon attributes - - COLORREF myTextColor; // text attributes - - LOGBRUSH myMarkerBrush; // marker attributes - LOGBRUSH myMarkerBrushOrig; - DWORD myMarkerWidth; - - EHDC myHDC; - -}; - -typedef W95_Allocator* PW95_Allocator; - -#endif // __W95_ALLOCATOR_HXX diff --git a/src/WNT/WNT.cdl b/src/WNT/WNT.cdl index c3311d5bf9..218d901565 100755 --- a/src/WNT/WNT.cdl +++ b/src/WNT/WNT.cdl @@ -60,10 +60,6 @@ package WNT ---Purpose: Creates a Windows NT window class. ---Category: Classes - class Image; - ---Purpose: Defines the class - ---Category: Classes - --------------------------- -- Category: Enumerations --------------------------- @@ -75,13 +71,6 @@ package WNT end OrientationType; ---Purpose: Portrait/landscape orientation. - enumeration TypeOfImage is - - TOI_BMP, --Windows NT's device independent bitmap - TOI_XWD, --X windows's image format - TOI_GIF --CompuServe's Graphic Interchange Format - - end TypeOfImage; --------------------------- @@ -89,10 +78,6 @@ package WNT --------------------------- - imported Long; - ---Purpose: Defines a Windows NT LONG type. - ---Category: Imported types - imported Dword; ---Purpose: Defines a Windows NT DWORD type. ---Category: Imported types @@ -101,14 +86,6 @@ package WNT ---Purpose: Defines a Windows NT UINT type. ---Category: Imported types - imported LogFont; - ---Purpose: Defines a Windows NT LOGFONT type. - ---Category: Imported types - - imported ColorRef; - ---Purpose: Defines a Windows NT COLORREF type. - ---Category: Imported types - imported WindowData; ---Purpose: Defines additional window data type. ---Category: Imported types @@ -120,17 +97,4 @@ package WNT pointer WindowPtr to Window from WNT; - --------------------------------- - -- Category: Instantiated classes - --------------------------------- - - class ColorTable instantiates - Array1 from TCollection ( ColorRef from WNT ); - - class HColorTable instantiates - HArray1 from TCollection ( ColorRef from WNT, ColorTable from WNT ); - - class SequenceOfImage instantiates - Sequence from TCollection ( Image from WNT ); - end WNT; diff --git a/src/WNT/WNT.h b/src/WNT/WNT.h deleted file mode 100755 index 2377f172b4..0000000000 --- a/src/WNT/WNT.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - Copyright (c) 1999-2012 OPEN CASCADE SAS - - The content of this file is subject to the Open CASCADE Technology Public - License Version 6.5 (the "License"). You may not use the content of this file - except in compliance with the License. Please obtain a copy of the License - at http://www.opencascade.org and read it completely before using this file. - - The Initial Developer of the Original Code is Open CASCADE S.A.S., having its - main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. - - The Original Code and all software distributed under the License is - distributed on an "AS IS" basis, without warranty of any kind, and the - Initial Developer hereby disclaims all such warranties, including without - limitation, any warranties of merchantability, fitness for a particular - purpose or non-infringement. Please see the License for the specific terms - and conditions governing the rights and limitations under the License. - -*/ - -#ifndef __WNT_H -# define __WNT_H - -# ifdef __cplusplus -extern "C" { -# endif /* __cplusplus */ - -# ifndef __WNT_API -# if !defined(HAVE_NO_DLL) -# ifdef __WNT_DLL -# define __WNT_API __declspec( dllexport ) -# else -# define __WNT_API __declspec( dllimport ) -# endif /* __WNT_DLL */ -# else -# define __WNT_API -# endif -# endif /* __WNT_API */ - -__WNT_API int WNT_SysPalInUse ( void ); - -# ifdef __cplusplus -} -# endif /* __cplusplus */ - -#endif /* __WNT_H */ diff --git a/src/WNT/WNT_Allocator.cxx b/src/WNT/WNT_Allocator.cxx deleted file mode 100755 index 0f15af97e4..0000000000 --- a/src/WNT/WNT_Allocator.cxx +++ /dev/null @@ -1,1291 +0,0 @@ -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - -//////////////////////////////////////////////////////////////////////////////// -// WNT_Allocator // -// Provides memory management and drawing operations for Windows 95. // -// World transformations and styled lines are managed by EHDC stuff. // -// // -//FEB-98 - creation (EUG) // -// MAR-98 - modification (DCB) // -//////////////////////////////////////////////////////////////////////////////// - -#define PRO19042 //GG_251199 Avoid to crash with an insuffisant resources messag - -#include "WNT_Allocator.hxx" - -#include -#include -#include - -#define ALLOCATOR ( ( PWNT_Allocator )myAllocator ) - -static XFORM xfmIdent = { ( FLOAT )0.8660, ( FLOAT )0.5000, - ( FLOAT )-0.5000, ( FLOAT )0.8660, - ( FLOAT )0.0000, ( FLOAT )0.0000 - }; - -WNT_Allocator :: WNT_Allocator ( int anID, PW32_Allocator prev ) : - W32_Allocator ( anID, prev ) -{ - myLinePen = (HPEN) GetStockObject ( NULL_PEN ); - myLineWidth = 1; - myPolyBrush = (HBRUSH) GetStockObject ( NULL_BRUSH ); - myTextPen = (HPEN) GetStockObject ( NULL_PEN ); - myTextBrush = (HBRUSH) GetStockObject ( NULL_BRUSH ); - myTextFont = (HFONT) GetStockObject ( SYSTEM_FONT ); - myMarkerPen = (HPEN) GetStockObject ( NULL_PEN ); - myTextSlant = EPS; - - myPO = (HPEN) NULL; - myBO = (HBRUSH) NULL; - myFO = (HFONT) NULL; - SetRectEmpty ( &myURect ); - - myMatrix.eM11 = myMatrix.eM22 = 1.0F; - myMatrix.eM12 = myMatrix.eM21 = 0.0F; - myMatrix.eDx = myMatrix.eDy = 0.0F; - - myFlags &= ~W32F_WIN95; -} // end constructor - -WNT_Allocator :: ~WNT_Allocator () -{ - DeletePen ( myLinePen ); - DeleteBrush ( myPolyBrush ); - DeletePen ( myTextPen ); - DeleteBrush ( myTextBrush ); - DeletePen ( myMarkerPen ); -} // end destructor - -void WNT_Allocator :: TransformPoint (int& X, int& Y) -{ - X = int ( myScaleX * ( X - myPivot.x ) ); - Y = int ( myScaleY * ( Y - myPivot.y ) ); -} // WNT_Allocator :: TransformPoint - -void WNT_Allocator :: TransformPoint (LPPOINT lpPoint) -{ - lpPoint->x = int ( myScaleX * ( lpPoint->x - myPivot.x ) ); - lpPoint->y = int ( myScaleY * ( lpPoint->y - myPivot.y ) ); -} // WNT_Allocator :: TransformPoint - -#define ADD_POINT_TO_RECT(aPoint) \ - { if ( aPoint.x < myURect.left ) myURect.left = aPoint.x - myLineWidth - 1; \ - if ( aPoint.x > myURect.right ) myURect.right = aPoint.x + myLineWidth + 1; \ - if ( aPoint.y < myURect.top ) myURect.top = aPoint.y - myLineWidth - 1; \ - if ( aPoint.y > myURect.bottom ) myURect.bottom = aPoint.y + myLineWidth + 1; \ - } - -void WNT_Allocator :: Register ( int x, int y ) -{ - static POINT pt; - pt.x = x; pt.y = y; - LPtoDP ( myHDC, &pt, 1 ); - ADD_POINT_TO_RECT (pt); -} // WNT_Allocator :: Register - -void WNT_Allocator :: Register ( LPPOINT lpPts, int nPts ) -{ - for ( int i = 0; i < nPts; i++ ) - Register ( lpPts[i].x, lpPts[i].y ); -} // WNT_Allocator :: Register - -void WNT_Allocator :: Register ( LPRECT lpRect ) -{ - Register ( lpRect->left, lpRect->top ); - Register ( lpRect->left, lpRect->bottom ); - Register ( lpRect->right, lpRect->top ); - Register ( lpRect->right, lpRect->bottom ); -} // WNT_Allocator :: Register - -void WNT_Allocator :: RecalcMatrix ( - XFORM& Matrix, double Angle, - double PivotX, double PivotY - ) -{ - float CosA = ( float )cos ( Angle ); - float SinA = ( float )sin ( Angle ); - Matrix.eM11 = float ( CosA ); - Matrix.eM12 = float ( SinA ); - Matrix.eM21 = -float ( SinA ); - Matrix.eM22 = float ( CosA ); - Matrix.eDx = float ( PivotX ); - Matrix.eDy = float ( PivotY ); -} // end WNT_Allocator :: RecalcMatrix - -void WNT_Allocator :: Play ( HDC hdc, PSIZE szClient ) -{ - CopyMemory ( &mySize, szClient, sizeof ( SIZE ) ); - if ( !( myFlags & W32F_EMPTY ) ) { - POINT pVOExt; - SIZE szWExt, szVExt; - int nMapMode, nGMode, nBkMode; - - myHDC = hdc; - nMapMode = SetMapMode ( myHDC, MM_ISOTROPIC ); - SetRect ( &myURect, mySize.cx, mySize.cy, 0, 0 ); - SetWindowExtEx ( myHDC, szClient->cx, -szClient->cy, &szWExt ); - SetViewportExtEx ( myHDC, szClient->cx, szClient->cy, &szVExt ); - SetViewportOrgEx ( myHDC, 0, szClient->cy - 1, &pVOExt ); - nGMode = SetGraphicsMode ( myHDC, GM_ADVANCED ); - nBkMode = SetBkMode ( myHDC, TRANSPARENT ); - SelectPen ( myHDC, myLinePen ); - SelectBrush ( myHDC, myPolyBrush ); - SetTextColor ( myHDC, myTextColor ); - - Xform (); - for ( PW32_Block aBlock = myStart; aBlock != NULL; aBlock = aBlock -> next ) - for ( int i = 0; i < aBlock -> free; i += aBlock -> data[ i ] ) - if ( aBlock -> data[ i + 1 ] != __W32_DATA ) { - W32_Note* pNote = ( W32_Note* )&( aBlock -> data[ i + 1 ] ); - pNote -> Play (); - } // end if - - SetMapMode ( myHDC, nMapMode ); - SetWindowExtEx ( myHDC, szWExt.cx, szWExt.cy, NULL ); - SetViewportExtEx ( myHDC, szVExt.cx, szVExt.cy, NULL ); - SetViewportOrgEx ( myHDC, pVOExt.x, pVOExt.y, NULL ); - SetBkMode ( myHDC, nBkMode ); - SetGraphicsMode ( myHDC, nGMode ); - } // end if -} // end WNT_Allocator :: Play - -void WNT_Allocator :: URect ( LPRECT lpRect ) -{ - CopyRect ( lpRect, &myURect ); - if ( lpRect -> top < 0 ) lpRect -> top = 0; - if ( lpRect -> left < 0 ) lpRect -> left = 0; - if ( lpRect -> right > mySize.cx ) lpRect -> right = mySize.cx; - if ( lpRect -> bottom > mySize.cy ) lpRect -> bottom = mySize.cy; -} // end WNT_Allocator :: URect - -void WNT_Allocator :: Xform ( void ) -{ - if ( myAngle != 0.0 || myPivot.x != 0 || myPivot.y != 0 || - myMove.x != 0 || myMove.y != 0 ) - { - RecalcMatrix ( myMatrix, myAngle, - myPivot.x + myMove.x, - myPivot.y + myMove.y ); - SetWorldTransform ( myHDC, &myMatrix ); - } else { - ModifyWorldTransform ( myHDC, NULL, MWT_IDENTITY ); - } -} // end WNT_Allocator :: Xform - -void WNT_Allocator :: Point ( int x, int y ) { - - new ( this ) WNT_PointNote ( x, y ); - -} // end WNT_Allocator :: Point - -void WNT_Allocator :: MarkerPoint ( int x, int y ) { - - new ( this ) WNT_MarkerPointNote ( x, y ); - -} // end WNT_Allocator :: MarkerPoint - -void WNT_Allocator :: Line ( int x, int y, int x1, int y1 ) { - - new ( this ) WNT_LineNote ( x, y, x1, y1 ); - -} // end WNT_Allocator :: Line - -void WNT_Allocator :: PolyEllipse ( int xc, int yc, int xr, int yr ) { - - new ( this ) WNT_PolyEllipseNote ( xc, yc, xr, yr ); - -} // end WNT_Allocator :: PolyEllipse - -void WNT_Allocator :: Ellipse ( int xc, int yc, int xr, int yr ) { - - new ( this ) WNT_EllipseNote ( xc, yc, xr, yr ); - -} // end WNT_Allocator :: Ellipse - -void WNT_Allocator :: Arc ( - int xc, int yc, int xr, int yr, - double sa, double oa - ) { - - new ( this ) WNT_ArcNote ( xc, yc, xr, yr, sa, oa ); - -} // end WNT_Allocator :: Arc - -void WNT_Allocator :: PolyChord ( - int xc, int yc, int xr, int yr, - double sa, double oa - ) { - - new ( this ) WNT_PolyChordNote ( xc, yc, xr, yr, sa, oa ); - -} // end WNT_Allocator :: PolyChord - -void WNT_Allocator :: Chord ( - int xc, int yc, int xr, int yr, - double sa, double oa - ) { - - new ( this ) WNT_PolyChordNote ( xc, yc, xr, yr, sa, oa ); - -} // end WNT_Allocator :: Chord - -void WNT_Allocator :: PolySector ( - int xc, int yc, int xr, int yr, - double sa, double oa - ) { - - new ( this ) WNT_PolySectorNote ( xc, yc, xr, yr, sa, oa ); - -} // end WNT_Allocator :: PolySector - -void WNT_Allocator :: Sector ( - int xc, int yc, int xr, int yr, - double sa, double oa - ) { - - new ( this ) WNT_SectorNote ( xc, yc, xr, yr, sa, oa ); - -} // end WNT_Allocator :: Sector - -void WNT_Allocator :: PolyMarker ( int aMaxPoints ) { - - new ( this ) W32_PolyMarkerNote ( aMaxPoints ); - -} // end WNT_Allocator :: PolyMarker - -void WNT_Allocator :: PolyMarker1 ( - int aMaxPoints, GetPointFunc fn, - int aStartPoint, void* fParam - ) { - - new ( this ) WNT_PolyMarker1Note ( - aMaxPoints, fn, aStartPoint, fParam - ); - -} // end WNT_Allocator :: PolyMarker1 - -void WNT_Allocator :: PolyMarker2 ( - int aMaxPoints, GetPointFunc fn, - int aStartPoint, void* fParam - ) { - - new ( this ) WNT_PolyMarker2Note ( - aMaxPoints, fn, aStartPoint, fParam - ); - -} // end WNT_Allocator :: PolyMarker1 - -W32_Note* WNT_Allocator :: Polygon ( int aMaxPoints ) { - - return new ( this ) WNT_PolygonNote ( aMaxPoints ); - -} // end WNT_Allocator :: Polygon - -W32_Note* WNT_Allocator :: Polyline ( int aMaxPoints ) { - - return new ( this ) WNT_PolylineNote ( aMaxPoints ); - -} // end WNT_Allocator :: Polyline - -void WNT_Allocator :: Image ( - int x, int y, PW32_Bitmap pBmp, double aScale - ) { - - new ( this ) WNT_ImageNote ( x, y, pBmp, aScale ); - -} // end WNT_Allocator :: Image - -void WNT_Allocator :: Text ( - int x, int y, double angle, void* text, - BOOL fWide, BOOL fOutlined - ) { - - new ( this ) WNT_TextNote ( x, y, angle, text, fWide, fOutlined ); - -} // end WNT_Allocator :: Text - -void WNT_Allocator :: Polytext ( - int x, int y, double angle, double margin, - void* text, BOOL fWide, BOOL fOutlined - ) { - - new ( this ) WNT_PolyTextNote ( x, y, angle, margin, text, fWide, fOutlined ); - -} // end WNT_Allocator :: Polytext - -void WNT_Allocator :: BeginMarker ( - int x, int y, int w, int h, double angle - ) { - - new ( this ) WNT_BeginMarkerNote ( x, y, w, h, angle ); - -} // end WNT_Allocator :: BeginMarker - -void WNT_Allocator :: EndMarker ( void ) { - - new ( this ) WNT_EndMarkerNote (); - -} // end WNT_Allocator :: EndMarker - -void WNT_Allocator :: LineAttrib ( - DWORD width, PLOGBRUSH plb, - DWORD nStyles, PDWORD pdwStyle - ) { - - new ( this ) WNT_LineAttribNote ( width, plb, nStyles, pdwStyle ); - -} // end WNT_Allocator :: LineAttrib - -void WNT_Allocator :: PolyAttrib ( - PLOGBRUSH plb, BOOL fDrawEdge, int aFillMode - ) { - - new ( this ) WNT_PolyAttribNote ( plb, fDrawEdge, aFillMode ); - -} // end WNT_Allocator :: PolyAttrib - -void WNT_Allocator :: TextAttrib ( - HFONT hFont, COLORREF color, double slant, - double hScale, double vScale, - BOOL fUnderlined, BOOL fFree, BOOL fIndex - ) { - - new ( this ) WNT_TextAttribNote ( - hFont, color, slant, hScale, vScale, - fUnderlined, fFree, fIndex - ); - -} // end WNT_Allocator :: TextAttrib - -void WNT_Allocator :: MarkerAttrib ( - COLORREF color, DWORD dwWidth, BOOL fFill - ) { - - new ( this ) WNT_MarkerAttribNote ( color, dwWidth, fFill ); - -} // end WNT_Allocator :: MarkerAttrib - -void WNT_Allocator :: FunCall ( - W32_FCall fCall, int sz, PW32_FCALLPARAM param - ) { - - new ( this ) W32_FCallNote ( fCall, sz, param ); - -} // end WNT_Allocator :: FunCall - -void WNT_Allocator :: GetExtent ( LPSIZE lpSZ ) -{ - CopyMemory ( lpSZ, &mySize, sizeof ( SIZE ) ); -} - -int WNT_Allocator :: TextSize ( HDC hdc, char* str, PSIZE psz ) { - - int gMode = GetGraphicsMode ( hdc ); - XFORM xfm, xfms; - POINT pt; - ABC abcf; - - if ( gMode == GM_ADVANCED ) - GetWorldTransform ( hdc, &xfms ); - else - SetGraphicsMode ( hdc, GM_ADVANCED ); - - ModifyWorldTransform ( hdc, &xfmIdent, MWT_IDENTITY ); - xfm.eM11 = 1.0F; - xfm.eM12 = 0.0F; - xfm.eM21 = ( FLOAT )tan ( myTextSlant ); - xfm.eM22 = 1.0F; - xfm.eDx = 0.0F; - xfm.eDy = 0.0F; - ModifyWorldTransform ( hdc, &xfm, MWT_LEFTMULTIPLY ); - xfm.eM11 = FLOAT ( myTextHScale * myScaleX ); - xfm.eM12 = 0.0F; - xfm.eM21 = 0.0F; - xfm.eM22 = FLOAT ( myTextVScale * myScaleY ); - xfm.eDx = 0.0F; - xfm.eDy = 0.0F; - ModifyWorldTransform ( hdc, &xfm, MWT_LEFTMULTIPLY ); - - MoveToEx ( hdc, 0, 0, &pt ); - GetTextExtentPoint32A ( - hdc, str, lstrlenA ( str ), psz - ); - GetCharABCWidthsA ( hdc, str[ 0 ], str[ 0 ], &abcf ); - MoveToEx ( hdc, pt.x, pt.y, NULL ); - - if ( gMode == GM_ADVANCED ) - SetWorldTransform ( hdc, &xfms ); - else { - psz->cx = LONG ( psz->cx * xfm.eM11 ); - psz->cy = LONG ( psz->cy * xfm.eM22 ); - abcf.abcA = UINT ( abcf.abcA * xfm.eM11 ); - SetGraphicsMode ( hdc, gMode ); - } // end else - - return abcf.abcA; -} // end WNT_Allocator :: TextSize - -int WNT_Allocator :: TextSize ( HDC hdc, wchar_t* str, PSIZE psz ) { - - int gMode = GetGraphicsMode ( hdc ); - XFORM xfm, xfms; - POINT pt; - ABC abcf; - - if ( gMode == GM_ADVANCED ) - GetWorldTransform ( hdc, &xfms ); - else - SetGraphicsMode ( hdc, GM_ADVANCED ); - - ModifyWorldTransform ( hdc, &xfmIdent, MWT_IDENTITY ); - xfm.eM11 = 1.0F; - xfm.eM12 = 0.0F; - xfm.eM21 = ( FLOAT )tan ( myTextSlant ); - xfm.eM22 = 1.0F; - xfm.eDx = 0.0F; - xfm.eDy = 0.0F; - ModifyWorldTransform ( hdc, &xfm, MWT_LEFTMULTIPLY ); - xfm.eM11 = FLOAT ( myTextHScale * myScaleX ); - xfm.eM12 = 0.0F; - xfm.eM21 = 0.0F; - xfm.eM22 = FLOAT ( myTextVScale * myScaleY ); - xfm.eDx = 0.0F; - xfm.eDy = 0.0F; - ModifyWorldTransform ( hdc, &xfm, MWT_LEFTMULTIPLY ); - - MoveToEx ( hdc, 0, 0, &pt ); - GetTextExtentPoint32W ( - hdc, str, lstrlenW ( str ), psz - ); - GetCharABCWidthsW ( hdc, str[ 0 ], str[ 0 ], &abcf ); - MoveToEx ( hdc, pt.x, pt.y, NULL ); - - if ( gMode == GM_ADVANCED ) - SetWorldTransform ( hdc, &xfms ); - else { - psz->cx = LONG ( psz->cx * xfm.eM11 ); - psz->cy = LONG ( psz->cy * xfm.eM22 ); - abcf.abcA = UINT ( abcf.abcA * xfm.eM11 ); - SetGraphicsMode ( hdc, gMode ); - } // end else - - return abcf.abcA; -} // end WNT_Allocator :: TextSize - -//////////////////////////////////////////////////////////////////////////////// -// W N T _ P o i n t N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_PointNote :: WNT_PointNote ( int x, int y ) : - W32_PointNote ( x, y ) -{ -} // end constructor - -void WNT_PointNote :: Play ( BOOL ) -{ - Xform (); - SetPixel ( ALLOCATOR -> myHDC, myTX, myTY, ALLOCATOR -> myPointColor ); -} // end WNT_PointNote :: Play - -void WNT_PointNote :: Xform () -{ - myTX = myX; - myTY = myY; - ALLOCATOR -> TransformPoint ( myTX, myTY ); - ALLOCATOR -> Register ( myTX, myTY ); -} -//////////////////////////////////////////////////////////////////////////////// -// W N T _ M a r k e r P o i n t N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_MarkerPointNote :: WNT_MarkerPointNote ( int x, int y ) : - WNT_PointNote ( x, y ) -{ -} // end constructor - -void WNT_MarkerPointNote :: Play ( BOOL ) -{ - Xform (); - SetPixel ( ALLOCATOR -> myHDC, myTX, myTY, ALLOCATOR -> myMarkerPointColor ); -} // end WNT_MarkerPointNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ L i n e N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_LineNote :: WNT_LineNote ( int x, int y, int x1, int y1 ) : - WNT_PointNote ( x, y ) -{ - myX2 = x1; - myY2 = y1; -} // end constructor - -void WNT_LineNote :: Play ( BOOL ) -{ - Xform (); - MoveToEx ( ALLOCATOR -> myHDC, myTX , myTY, NULL ); - LineTo ( ALLOCATOR -> myHDC, myTX2, myTY2 ); -} // end WNT_LineNote :: Play - -void WNT_LineNote :: Xform () -{ - WNT_PointNote :: Xform (); - myTX2 = myX2; - myTY2 = myY2; - ALLOCATOR -> TransformPoint ( myTX2, myTY2 ); - ALLOCATOR -> Register ( myTX2, myTY2 ); -} -//////////////////////////////////////////////////////////////////////////////// -// W N T _ P o l y E l l i p s e N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_PolyEllipseNote :: WNT_PolyEllipseNote ( int xc, int yc, int xr, int yr ) : - WNT_PointNote ( xc, yc ) -{ - myXr = xr; - myYr = yr; -} // end constructor - -void WNT_PolyEllipseNote :: Play ( BOOL ) -{ - Xform (); - Ellipse ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr, - myTX + myTXr, myTY + myTYr ); -} // end WNT_PolyEllipseNote :: Play - -void WNT_PolyEllipseNote :: Xform () -{ - WNT_PointNote :: Xform (); - myTXr = int (myXr * ALLOCATOR -> myScaleX); - myTYr = int (myYr * ALLOCATOR -> myScaleY); - RECT r = { myTX - myTXr, myTY - myTYr, myTX + myTXr, myTY + myTYr }; - ALLOCATOR -> Register ( &r ); -} -//////////////////////////////////////////////////////////////////////////////// -// W N T _ E l l i p s e N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_EllipseNote :: WNT_EllipseNote ( int xc, int yc, int xr, int yr ) : - WNT_PolyEllipseNote ( xc, yc, xr, yr ) -{ -} // end constructor - -void WNT_EllipseNote :: Play ( BOOL ) -{ - Xform (); - HBRUSH hob = SelectBrush ( ALLOCATOR -> myHDC, GetStockObject (NULL_BRUSH) ); - Ellipse ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr, - myTX + myTXr, myTY + myTYr ); - SelectBrush ( ALLOCATOR -> myHDC, hob ); -} // end WNT_PolyEllipseNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ A r c N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_ArcNote :: WNT_ArcNote ( - int xc, int yc, int xr, int yr, double sa, double oa - ) : WNT_PolyEllipseNote ( xc, yc, xr, yr ) -{ - int Radius = max ( xr, yr ); - double sSinA = sin ( sa + oa ); - double sCosA = cos ( sa + oa ); - double eSinA = sin ( sa ); - double eCosA = cos ( sa ); - myDirect = ( sa + oa > 0. ) ? AD_COUNTERCLOCKWISE : AD_CLOCKWISE; - - mySX = int ( sCosA * 2 * Radius + xc ); - mySY = int ( sSinA * 2 * Radius + yc ); - myEX = int ( eCosA * 2 * Radius + xc ); - myEY = int ( eSinA * 2 * Radius + yc ); -} // end constructor - -void WNT_ArcNote :: Play ( BOOL ) -{ - Xform (); - SetArcDirection ( ALLOCATOR -> myHDC, myDirect ); - Arc ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr, - myTX + myTXr, myTY + myTYr, - myTSX, myTSY, myTEX, myTEY ); -} // end WNT_ArcNote :: Play - -void WNT_ArcNote :: Xform () -{ - WNT_PolyEllipseNote :: Xform (); - myTSX = mySX; - myTSY = mySY; - ALLOCATOR -> TransformPoint ( myTSX, myTSY ); - myTEX = myEX; - myTEY = myEY; - ALLOCATOR -> TransformPoint ( myTEX, myTEY ); -} -//////////////////////////////////////////////////////////////////////////////// -// W N T _ P o l y C h o r d N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_PolyChordNote :: WNT_PolyChordNote ( - int xc, int yc, int xr, int yr, double sa, double oa - ) : WNT_ArcNote ( xc, yc, xr, yr, sa, oa ) -{ -} // end constructor - -void WNT_PolyChordNote :: Play ( BOOL ) -{ - Xform (); - Chord ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr, - myTX + myTXr, myTY + myTYr, - myTEX, myTEY, myTSX, myTSY ); -} // end WNT_PolyChordNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ C h o r d N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_ChordNote :: WNT_ChordNote ( - int xc, int yc, int xr, int yr, double sa, double oa - ) : WNT_PolyChordNote ( xc, yc, xr, yr, sa, oa ) -{ -} // end constructor - -void WNT_ChordNote :: Play ( BOOL ) -{ - Xform (); - HBRUSH hob = SelectBrush ( ALLOCATOR -> myHDC, GetStockObject (NULL_BRUSH) ); - Chord ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr, - myTX + myTXr, myTY + myTYr, - myTEX, myTEY, myTSX, myTSY ); - SelectBrush ( ALLOCATOR -> myHDC, hob ); -} // end WNT_ChordNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ P o l y S e c t o r N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_PolySectorNote :: WNT_PolySectorNote ( - int xc, int yc, int xr, int yr, double sa, double oa - ) : WNT_ArcNote ( xc, yc, xr, yr, sa, oa ) -{ -} // end constructor - -void WNT_PolySectorNote :: Play ( BOOL ) -{ - Xform (); - Pie ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr, - myTX + myTXr, myTY + myTYr, - myTEX, myTEY, myTSX, myTSY ); -} // end WNT_PolySectorNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ S e c t o r N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_SectorNote :: WNT_SectorNote ( - int xc, int yc, int xr, int yr, double sa, double oa - ) : WNT_PolySectorNote ( xc, yc, xr, yr, sa, oa ) -{ -} // end constructor - -void WNT_SectorNote :: Play ( BOOL ) -{ - Xform (); - HBRUSH hob = SelectBrush ( ALLOCATOR -> myHDC, GetStockObject (NULL_BRUSH) ); - Pie ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr, - myTX + myTXr, myTY + myTYr, - myTEX, myTEY, myTSX, myTSY ); - SelectBrush ( ALLOCATOR -> myHDC, hob ); -} // end WNT_SectorNote :: Play - -//////////////////////////////////////////////////////////////////////////////// -// D r a w P o l y l i n e // -//////////////////////////////////////////////////////////////////////////////// -void DrawPolyline ( HDC hdc, LPPOINT lpPts, int nPts, BOOL fClose ) -{ - BeginPath ( hdc ); - Polyline ( hdc, lpPts, nPts ); - if (fClose) - CloseFigure ( hdc ); - EndPath ( hdc ); - StrokePath ( hdc ); -} -//////////////////////////////////////////////////////////////////////////////// -// D r a w P o l y g o n // -//////////////////////////////////////////////////////////////////////////////// -void DrawPolygon ( HDC hdc, LPPOINT lpPts, int nPts, UINT dwFlags ) -{ - HPEN hpo = SelectPen ( hdc, GetStockObject ( NULL_PEN ) ); - Polygon ( hdc, lpPts, nPts ); - SelectPen ( hdc, hpo ); - - if ( dwFlags & POLYF_NOCLOSEDGE ) - DrawPolyline ( hdc, lpPts, nPts, FALSE ); - else if ( !( dwFlags & POLYF_NOEDGE ) ) - DrawPolyline ( hdc, lpPts, nPts, TRUE ); -} -//////////////////////////////////////////////////////////////////////////////// -// W N T _ P o l y M a r k e r 1 N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_PolyMarker1Note :: WNT_PolyMarker1Note ( - int aMaxPoints, GetPointFunc fn, int aStartPoint, - void* fParam - ) : W32_PolyMarker1Note ( aMaxPoints, fn, aStartPoint, fParam) -{ -} // end constructor - -void WNT_PolyMarker1Note :: Play ( BOOL ) -{ - if ( ALLOCATOR -> myFlags & W32F_MFILL ) - DrawPolygon ( ALLOCATOR -> myHDC, myPoints, mySetPoints, POLYF_NOCLOSEDGE ); - else - DrawPolyline ( ALLOCATOR -> myHDC, myPoints, mySetPoints, FALSE ); -} // end WNT_PolyMarker1Note :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ P o l y M a r k e r 2 N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_PolyMarker2Note :: WNT_PolyMarker2Note ( - int aMaxPoints, GetPointFunc fn, int aStartPoint, - void* fParam - ) : WNT_PolyMarker1Note ( - aMaxPoints, fn, aStartPoint, fParam - ) -{ -} // end constructor - -void WNT_PolyMarker2Note :: Play ( BOOL ) -{ - if ( ALLOCATOR -> myFlags & W32F_MFILL ) - DrawPolygon ( ALLOCATOR -> myHDC, myPoints, mySetPoints - 1, 0 ); - else - DrawPolyline ( ALLOCATOR -> myHDC, myPoints, mySetPoints - 1, TRUE ); -} // end WNT_PolyMarker2Note :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ P o l y g o n N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_PolygonNote :: WNT_PolygonNote ( int aMaxPoints ) : - W32_PolygonNote ( aMaxPoints ) -{ - myTPoints = ( LPPOINT ) ALLOCATOR -> NewData (myMaxPoints * sizeof ( POINT )); -} // end constructor - -void WNT_PolygonNote :: Play ( BOOL ) -{ - Xform (); - DrawPolygon ( - ALLOCATOR -> myHDC, myTPoints, mySetPoints, - ALLOCATOR -> myFlags & W32F_POUTL ? 0 : POLYF_NOEDGE - ); -} // end WNT_PolygonNote :: Play - -void WNT_PolygonNote :: Xform () -{ - CopyMemory ( myTPoints, myPoints, mySetPoints*sizeof(POINT) ); - for ( int i = 0; i < mySetPoints; i++ ) - ALLOCATOR -> TransformPoint ( (myTPoints + i) ); - ALLOCATOR -> Register ( myTPoints, mySetPoints ); -} -//////////////////////////////////////////////////////////////////////////////// -// W N T _ P o l y l i n e N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_PolylineNote :: WNT_PolylineNote ( int aMaxPoints ) : - WNT_PolygonNote ( aMaxPoints ) -{ -} // end constructor - -void WNT_PolylineNote :: Play ( BOOL ) -{ - Xform (); - DWORD nPts; - BOOL fClose; - int idx = mySetPoints - 1; - if ( myPoints -> x == myPoints[ idx ].x && - myPoints -> y == myPoints[ idx ].y - ) { - nPts = idx; - fClose = TRUE; - } else { - nPts = mySetPoints; - fClose = FALSE; - } // end else - DrawPolyline ( ALLOCATOR->myHDC, myTPoints, nPts, fClose ); -} // end WNT_PolylineNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ I m a g e N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_ImageNote :: WNT_ImageNote ( - int x, int y, PW32_Bitmap pBmp, double aScale - ) : WNT_PointNote ( x, y ) -{ - myBitmap = pBmp; - ++pBmp -> nUsed; - myScale = aScale; -} // end constructor - -WNT_ImageNote :: ~WNT_ImageNote () -{ - if ( myBitmap -> hBmp != NULL && --myBitmap -> nUsed == 0 ) { - DeleteObject ( myBitmap -> hBmp ); - HeapFree ( GetProcessHeap (), 0, ( PVOID )myBitmap ); - } // end if -} // end WNT_ImageNote :: ~WNT_ImageNote - -void WNT_ImageNote :: Play ( BOOL ) -{ - Xform (); - int xx, yy, w, h; - HDC hdcMem; - BITMAP bmp; - HBITMAP hbo; - - GetObject ( myBitmap -> hBmp, sizeof ( BITMAP ), &bmp ); - xx = myTX; - yy = myTY; - w = bmp.bmWidth; - h = bmp.bmHeight; - if ( myScale != 1.0 ) { - w = int ( w * myScale + 0.5 ); - h = int ( h * myScale + 0.5 ); - } - if ( ALLOCATOR -> myScaleX != 1.0 ) { - xx = int ( xx * ALLOCATOR -> myScaleX + 0.5 ); - w = int ( w * ALLOCATOR -> myScaleX + 0.5 ); - } // end if - if ( ALLOCATOR -> myScaleY != 1.0 ) { - yy = int ( yy * ALLOCATOR -> myScaleY + 0.5 ); - h = int ( h * ALLOCATOR -> myScaleY + 0.5 ); - } // end if - xx = xx - ( w >> 1 ); - yy = yy + ( h >> 1 ); - hdcMem = CreateCompatibleDC ( ALLOCATOR -> myHDC ); - hbo = SelectBitmap ( hdcMem, myBitmap -> hBmp ); - SetStretchBltMode ( hdcMem, COLORONCOLOR ); - StretchBlt ( - ALLOCATOR -> myHDC, xx, yy, w, -h, - hdcMem, 0, 0, bmp.bmWidth, bmp.bmHeight, - SRCCOPY - ); - RECT r = { xx, yy, xx + w, yy - h }; - ALLOCATOR -> Register ( &r ); - SelectBitmap ( hdcMem, hbo ); - DeleteDC ( hdcMem ); -} // end WNT_ImageNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ T e x t N o t e // -//////////////////////////////////////////////////////////////////////////////// -#define ROUNDL( d ) ( ( long )( ( d ) + ( ( d ) > 0 ? 0.5 : -0.5 ) ) ) -WNT_TextNote :: WNT_TextNote ( - int x, int y, double angle, void* text, - BOOL fWide, BOOL fOutlined - ) : WNT_PointNote ( x, y ) -{ - DWORD dwLen = fWide ? ( ( lstrlenW ( ( LPCWSTR )text ) + 1 ) << 1 ) - : ( ( lstrlenA ( ( LPCSTR )text ) + 1 ) << 0 ); - myText = ALLOCATOR -> NewData ( dwLen ); - CopyMemory ( myText, text, dwLen ); - myFlags = ( ( fWide ? W32F_TUNICODE : 0 ) | - ( fOutlined ? W32F_TOUTLINE : 0 ) - ); - ALLOCATOR -> RecalcMatrix ( RMatrix, angle ); -} // end constructor - -void WNT_TextNote :: PaintText () -{ - if (myFlags & W32F_TUNICODE) - TextOutW ( ALLOCATOR -> myHDC, 0, myShift, (LPCWSTR)myText, lstrlenW ((LPCWSTR)myText) ); - else - TextOutA ( ALLOCATOR -> myHDC, 0, myShift, (LPCSTR)myText, lstrlenA ((LPCSTR)myText) ); -} // end WNT_TextNote :: PaintText - -void WNT_TextNote :: SetAttribs () -{ - ALLOCATOR -> myPO = SelectPen (ALLOCATOR -> myHDC, ALLOCATOR -> myTextPen ); - ALLOCATOR -> myBO = SelectBrush (ALLOCATOR -> myHDC, ALLOCATOR -> myTextBrush); - ALLOCATOR -> myFO = SelectFont (ALLOCATOR -> myHDC, ALLOCATOR -> myTextFont ); -} // end WNT_TextNote :: SetAttribs - -void WNT_TextNote :: RestoreAttribs () -{ - SelectPen ( ALLOCATOR -> myHDC, ALLOCATOR -> myPO ); - SelectBrush ( ALLOCATOR -> myHDC, ALLOCATOR -> myBO ); - SelectFont ( ALLOCATOR -> myHDC, ALLOCATOR -> myFO ); - ALLOCATOR -> Xform (); -} // end WNT_TextNote :: RestoreAttribs - -void WNT_TextNote :: OutlineText () -{ - BeginPath ( ALLOCATOR -> myHDC ); - PaintText ( ); - EndPath ( ALLOCATOR -> myHDC ); - StrokePath ( ALLOCATOR -> myHDC ); -} // end WNT_TextNote :: OutlineText - -void WNT_TextNote :: FillText () -{ - PaintText (); -} // end WNT_TextNote :: FillText - -void WNT_TextNote :: Play ( BOOL ) -{ - Xform (); - SIZE size; - RECT rect; - HDC hdc = ALLOCATOR -> myHDC; - // Set new world transform and attribs to get text size and metrics - SetAttribs (); - if ( myFlags & W32F_TUNICODE ) - ALLOCATOR -> TextSize ( hdc, ( wchar_t* )myText, &size ); - else - ALLOCATOR -> TextSize ( hdc, ( char* )myText, &size ); - ModifyWorldTransform ( hdc, &RMatrix, MWT_LEFTMULTIPLY ); - // Register and draw the bounding rect - rect.left = 0; - rect.top = 0; - rect.right = ROUNDL( ( FLOAT )size.cx * SMatrix.eM11 ); - rect.bottom = -ROUNDL( ( FLOAT )size.cy * SMatrix.eM22 ); - if (ALLOCATOR -> myTextSlant >= 0.F) - rect.right += ROUNDL( ( FLOAT )rect.bottom * IMatrix.eM21 ); - else - rect.left += ROUNDL( ( FLOAT )rect.bottom * IMatrix.eM21 ); - ALLOCATOR -> Register ( &rect ); - // Draw ( fill or outline ) text - myShift = -size.cy; - ModifyWorldTransform ( hdc, &IMatrix, MWT_LEFTMULTIPLY ); - ModifyWorldTransform ( hdc, &SMatrix, MWT_LEFTMULTIPLY ); - if ( myFlags & W32F_TOUTLINE || ALLOCATOR -> myFlags & W32F_MONO ) OutlineText (); - else FillText (); - RestoreAttribs (); -} // end WNT_TextNote :: Play - -void WNT_TextNote :: Xform ( void ) -{ - WNT_PointNote :: Xform (); - RMatrix.eDx = float ( myTX ); - RMatrix.eDy = float ( myTY ); - SMatrix.eM11 = float ( ALLOCATOR -> myTextHScale * ALLOCATOR -> myScaleX ); - SMatrix.eM12 = 0.0F; - SMatrix.eM21 = 0.0F; - SMatrix.eM22 = -float ( ALLOCATOR -> myTextVScale * ALLOCATOR -> myScaleY ); - SMatrix.eDx = 0.0F; - SMatrix.eDy = 0.0F; - IMatrix.eM11 = 1.0F; - IMatrix.eM12 = 0.0F; - IMatrix.eM21 = float ( tan (ALLOCATOR -> myTextSlant) ); - IMatrix.eM22 = 1.0F; - IMatrix.eDx = 0.0F; - IMatrix.eDy = 0.0F; -} // enf WNT_TextNote :: Xform -//////////////////////////////////////////////////////////////////////////////// -// W N T _ P o l y T e x t N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_PolyTextNote :: WNT_PolyTextNote ( - int x, int y, double angle, double margin, - void* text, BOOL fWide, BOOL fOutlined - ) : WNT_TextNote ( x, y, angle, text, fWide, fOutlined ), - myMargin ( margin ) -{ -} // end constructor - -void WNT_PolyTextNote :: Play ( BOOL ) -{ - Xform (); - SIZE size; - RECT rect; - int height; - HDC hdc = ALLOCATOR -> myHDC; - // Set new world transform and attribs to get text size and metrics - SetAttribs (); - if ( myFlags & W32F_TUNICODE ) - ALLOCATOR -> TextSize ( hdc, ( wchar_t* )myText, &size ); - else - ALLOCATOR -> TextSize ( hdc, ( char* )myText, &size ); - RestoreAttribs (); - ModifyWorldTransform ( hdc, &RMatrix, MWT_LEFTMULTIPLY ); - // Register and draw the bounding rect - rect.left = 0; - rect.top = 0; - rect.right = ROUNDL( ( FLOAT )size.cx * SMatrix.eM11 ); - rect.bottom = -ROUNDL( ( FLOAT )size.cy * SMatrix.eM22 ); - if (ALLOCATOR -> myTextSlant >= 0.F) - rect.right += ROUNDL( ( FLOAT )rect.bottom * IMatrix.eM21 ); - else - rect.left += ROUNDL( ( FLOAT )rect.bottom * IMatrix.eM21 ); - height = ROUNDL( (FLOAT)rect.bottom * (FLOAT)myMargin / 2.0F ); - InflateRect ( &rect, height, height ); - // Drawing round rectangle - HPEN hpo = ( (ALLOCATOR->myFlags & W32F_POUTL) ? - SelectPen ( hdc, ALLOCATOR -> myLinePen ): - SelectPen ( hdc, GetStockObject (NULL_PEN) ) ); - HBRUSH hbo = ( (ALLOCATOR->myFlags & W32F_NOFIL) ? - SelectBrush ( hdc, GetStockObject (NULL_BRUSH) ): - SelectBrush ( hdc, ALLOCATOR -> myPolyBrush ) ); - Rectangle ( hdc, rect.left, rect.top, rect.right, rect.bottom ); - SelectBrush ( hdc, hbo ); - SelectPen ( hdc, hpo ); - ALLOCATOR -> Register ( &rect ); - // Draw ( fill or outline ) text - myShift = -size.cy; - ModifyWorldTransform ( hdc, &IMatrix, MWT_LEFTMULTIPLY ); - ModifyWorldTransform ( hdc, &SMatrix, MWT_LEFTMULTIPLY ); - SetAttribs (); - if (myFlags & W32F_TOUTLINE || ALLOCATOR -> myFlags & W32F_MONO) OutlineText (); - else FillText (); - RestoreAttribs (); -} // end WNT_PolyTextNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ B e g i n M a r k e r N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_BeginMarkerNote :: WNT_BeginMarkerNote ( - int x, int y, int w, int h, double angle - ) : WNT_PointNote ( x, y ), - myAngle ( angle ), myWidth ( w ), myHeight ( h ) -{ - myPrevAngle = ALLOCATOR -> myAngle; - ALLOCATOR -> RecalcMatrix (myMatrix, myAngle - myPrevAngle, myX, myY); -} // end constructor - -void WNT_BeginMarkerNote :: Play ( BOOL ) -{ - ALLOCATOR -> myPO = SelectPen (ALLOCATOR -> myHDC, ALLOCATOR -> myMarkerPen); -#ifdef PRO19042 - if ( ALLOCATOR -> myFlags & W32F_MFILL ) -#else - if ( ALLOCATOR -> myFlags | W32F_MFILL ) -#endif - ALLOCATOR -> myBO = SelectBrush (ALLOCATOR -> myHDC, ALLOCATOR -> myPolyBrush); - else - ALLOCATOR -> myBO = SelectBrush (ALLOCATOR -> myHDC, GetStockObject (NULL_BRUSH)); - Xform (); -} // end WNT_BeginMarkerNote :: Play - -void WNT_BeginMarkerNote :: Xform () -{ - WNT_PointNote :: Xform (); - if (myPrevAngle != ALLOCATOR -> myAngle) { - myPrevAngle = ALLOCATOR -> myAngle; - ALLOCATOR -> RecalcMatrix (myMatrix, myAngle - myPrevAngle, myX, myY); - } // end if - myMatrix.eDx = float ( myTX ); - myMatrix.eDy = float ( myTY ); - ModifyWorldTransform ( ALLOCATOR -> myHDC, &myMatrix, MWT_LEFTMULTIPLY ); - RECT r = { -myWidth / 2, -myHeight / 2, myWidth / 2, myHeight / 2 }; - ALLOCATOR -> Register ( &r ); -} -//////////////////////////////////////////////////////////////////////////////// -// W N T _ E n d M a r k e r N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_EndMarkerNote :: WNT_EndMarkerNote () -{ -} - -void WNT_EndMarkerNote :: Play ( BOOL ) -{ - ALLOCATOR -> Xform (); - SelectPen ( ALLOCATOR -> myHDC, ALLOCATOR -> myPO ); - SelectBrush ( ALLOCATOR -> myHDC, ALLOCATOR -> myBO ); -} // end WNT_EndMarkerNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ L i n e A t t r i b N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_LineAttribNote :: WNT_LineAttribNote ( - DWORD width, PLOGBRUSH plb, - DWORD nStyles, PDWORD pdwStyle - ) -{ - myPointColor = plb -> lbColor; - myWidth = ((width == 0) ? 1 : width); - - if ((width == 0 || width == 1) && (nStyles == 0)) { - myPen = CreatePen (PS_SOLID, width, plb->lbColor); - } else { - DWORD pStyle = ( nStyles > 0 ? PS_USERSTYLE : PS_SOLID ); - pStyle |= ( PS_ENDCAP_FLAT | PS_JOIN_MITER | PS_GEOMETRIC ); - myPen = ExtCreatePen ( pStyle, width, plb, nStyles, pdwStyle ); - if ( !myPen ) { - char err[1024]; - DWORD errCode = GetLastError(); - printf ( " *** WNT_LineAttribNote : Can't create extended pen: %lu\n", errCode ); - wsprintf ( err, "Can't create extended pen: %lu", errCode ); - MessageBox ( NULL, err, "WNT_Allocator", MB_OK | MB_ICONEXCLAMATION ); - myPen = CreatePen ( PS_SOLID, 1, RGB(170,170,70) ); - } - } - Play ( FALSE ); -} // end constructor - -WNT_LineAttribNote :: ~WNT_LineAttribNote ( void ) -{ -#ifdef PRO19042 - if ( myPen ) { -#ifdef DEB -printf(" *** Destroy:WNT_LineAttribNote %x/%x\n",myPen,ALLOCATOR->myLinePen); -#endif - DeletePen( myPen ); - myPen = NULL; - } -#else - if ( myPen && myPen != ALLOCATOR -> myLinePen ) - DeletePen( myPen ); -#endif -} // enf WNT_LineAttribNote :: ~WNT_LineAttribNote - -void WNT_LineAttribNote :: Play ( BOOL fRealize ) -{ - ALLOCATOR -> myLinePen = myPen; - ALLOCATOR -> myLineWidth = myWidth; - ALLOCATOR -> myPointColor = myPointColor; - if ( fRealize ) - SelectPen ( ALLOCATOR -> myHDC, myPen ); -} // end WNT_LineAttribNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ P o l y A t t r i b N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_PolyAttribNote :: WNT_PolyAttribNote ( - PLOGBRUSH plb, BOOL fDrawEdge, int /*aFillMode*/ - ) -{ - myfEdge = fDrawEdge; - myNoFill = ( plb -> lbStyle == BS_NULL ); - myBrush = CreateBrushIndirect ( plb ); - Play ( FALSE ); -} // end constructor - -WNT_PolyAttribNote :: ~WNT_PolyAttribNote ( void ) -{ -#ifdef PRO19042 - if ( myBrush ) { -#ifdef DEB -printf(" *** Destroy:WNT_PolyAttribNote %x/%x\n",myBrush,ALLOCATOR->myPolyBrush); -#endif - DeleteBrush( myBrush ); - myBrush = NULL; - } -#else - if ( myBrush && myBrush != ALLOCATOR -> myPolyBrush ) - DeleteBrush( myBrush ); -#endif -} // enf WNT_PolyAttribNote :: ~WNT_PolyAttribNote - -void WNT_PolyAttribNote :: Play ( BOOL fRealize ) -{ - if ( myfEdge ) ALLOCATOR -> myFlags |= W32F_POUTL; - else ALLOCATOR -> myFlags &= ~W32F_POUTL; - if ( myNoFill ) ALLOCATOR -> myFlags |= W32F_NOFIL; - else ALLOCATOR -> myFlags &= ~W32F_NOFIL; - ALLOCATOR -> myPolyBrush = myBrush; - if ( fRealize ) { - SelectPen ( ALLOCATOR -> myHDC, ALLOCATOR -> myLinePen ); - SelectBrush ( ALLOCATOR -> myHDC, ALLOCATOR -> myPolyBrush ); - } -} // end WNT_PolyAttribNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ T e x t A t t r i b N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_TextAttribNote :: WNT_TextAttribNote ( - HFONT hFont, COLORREF color, double slant, - double hScale, double vScale, - BOOL fUnderlined, BOOL fFree, BOOL fIndex - ) -{ - myFont = hFont; - mySlant = (slant == 0.0 ? EPS : slant); - myHScale = vScale; - myVScale = hScale; - myFlags = ( fUnderlined ? W32F_TFULINED : 0 ) | - ( fIndex ? W32F_TINDEX : 0 ) | - ( fFree ? W32F_TFREE : 0 ); - myColor = color; - myPen = CreatePen ( PS_SOLID, 0, color ); - myBrush = CreateSolidBrush ( color ); - Play ( FALSE ); -} // end constructor - -WNT_TextAttribNote :: ~WNT_TextAttribNote () -{ -#ifdef PRO19042 - if ( myFont && (myFlags & W32F_TFREE) ) { -#ifdef DEB -printf(" *** Destroy:WNT_TextAttribNote_FONT %x/%x\n",myFont,ALLOCATOR->myTextFont); -#endif - DeleteFont ( myFont ); - myFont = NULL; - } - if ( myPen ) { -#ifdef DEB -printf(" *** Destroy:WNT_TextAttribNote_PEN %x/%x\n",myPen,ALLOCATOR->myTextPen); -#endif - DeletePen ( myPen ); - myPen = NULL; - } - if ( myBrush ) { -#ifdef DEB -printf(" *** Destroy:WNT_TextAttribNote_BRUSH %x/%x\n",myBrush,ALLOCATOR->myTextBrush); -#endif - DeleteBrush ( myBrush ); - myBrush = NULL; - } -#else - if ( myFlags & W32F_TFREE ) DeleteFont ( myFont ); - if ( myPen && myPen != ALLOCATOR -> myTextPen ) DeletePen ( myPen ); - if ( myBrush && myBrush != ALLOCATOR -> myTextBrush ) DeleteBrush ( myBrush ); -#endif -} // end destructor - -void WNT_TextAttribNote :: Play ( BOOL fRealize ) -{ - if ( ( ALLOCATOR -> myFlags & W32F_DFONT ) && !( myFlags & W32F_TINDEX ) ) { - DeleteFont( ALLOCATOR -> myTextFont ); - ALLOCATOR -> myFlags &= ~W32F_DFONT; - } // end if - ALLOCATOR -> myTextFont = myFont; - ALLOCATOR -> myTextSlant = mySlant; - ALLOCATOR -> myTextHScale = myHScale; - ALLOCATOR -> myTextVScale = myVScale; - ALLOCATOR -> myTextColor = myColor; - ALLOCATOR -> myTextPen = myPen; - ALLOCATOR -> myTextBrush = myBrush; - if (myFlags & W32F_TFULINED) ALLOCATOR -> myFlags |= W32F_TULIN; - else ALLOCATOR -> myFlags &= ~W32F_TULIN; - if ( fRealize && !( myFlags & W32F_TINDEX ) ) { - SetTextColor ( ALLOCATOR -> myHDC, ALLOCATOR -> myTextColor ); - SelectPen ( ALLOCATOR -> myHDC, ALLOCATOR -> myTextPen ); - SelectBrush ( ALLOCATOR -> myHDC, ALLOCATOR -> myTextBrush ); - SelectFont ( ALLOCATOR -> myHDC, ALLOCATOR -> myTextFont ); - } -} // end WNT_TextAttribNote :: Play -//////////////////////////////////////////////////////////////////////////////// -// W N T _ M a r k e r A t t r i b N o t e // -//////////////////////////////////////////////////////////////////////////////// -WNT_MarkerAttribNote :: WNT_MarkerAttribNote ( - COLORREF color, DWORD dwWidth, BOOL fFill - ) -{ - DWORD width = (dwWidth == 0) ? 1 : dwWidth; - - myFill = fFill; - myMarkerPointColor = color; - myPen = CreatePen ( PS_SOLID, width, color ); - Play (); -} // end constructor - -WNT_MarkerAttribNote :: ~WNT_MarkerAttribNote ( void ) -{ -#ifdef PRO19042 - if ( myPen ) { -#ifdef DEB -printf(" *** Destroy:WNT_MarkerAttribNote %x/%x\n",myPen,ALLOCATOR->myMarkerPen); -#endif - DeletePen( myPen ); - myPen = NULL; - } -#else - if ( myPen && myPen != ALLOCATOR -> myMarkerPen ) DeletePen( myPen ); -#endif -} // enf WNT_MarkerAttribNote :: ~WNT_MarkerAttribNote - -void WNT_MarkerAttribNote :: Play ( BOOL ) -{ - if (myFill) ALLOCATOR -> myFlags |= W32F_MFILL; - else ALLOCATOR -> myFlags &= ~W32F_MFILL; - - ALLOCATOR -> myMarkerPen = myPen; - ALLOCATOR -> myMarkerPointColor = myMarkerPointColor; -} // end WNT_MarkerAttribNote :: Play diff --git a/src/WNT/WNT_Allocator.hxx b/src/WNT/WNT_Allocator.hxx deleted file mode 100755 index 3e2a0b507f..0000000000 --- a/src/WNT/WNT_Allocator.hxx +++ /dev/null @@ -1,100 +0,0 @@ -// Created by: PLOTNIKOV Eugeny & CHABROVSKY Dmitry -// Copyright (c) 1998-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - - -#ifndef __WNT_ALLOCATOR_HXX -# define __WNT_ALLOCATOR_HXX - -# include "EHDC.hxx" -# include "W32_Allocator.hxx" - -struct WNT_Allocator : public W32_Allocator { - - WNT_Allocator ( int, PW32_Allocator = NULL ); - virtual ~WNT_Allocator (); - - virtual void Xform ( void ); - - virtual void Play ( HDC, PSIZE ); - virtual void URect ( LPRECT ); - - virtual void Point ( int, int ); - virtual void MarkerPoint ( int, int ); - virtual void Line ( int, int, int, int ); - virtual void PolyEllipse ( int, int, int, int ); - virtual void Ellipse ( int, int, int, int ); - virtual void Arc ( int, int, int, int, double, double ); - virtual void PolyChord ( int, int, int, int, double, double ); - virtual void Chord ( int, int, int, int, double, double ); - virtual void PolySector ( int, int, int, int, double, double ); - virtual void Sector ( int, int, int, int, double, double ); - virtual void PolyMarker ( int ); - virtual void PolyMarker1 ( int, GetPointFunc, int, void* ); - virtual void PolyMarker2 ( int, GetPointFunc, int, void* ); - virtual W32_Note* Polygon ( int ); - virtual W32_Note* Polyline( int ); - virtual void Image ( int, int, PW32_Bitmap, double = 1.0 ); - virtual void Text ( int, int, double, void*, BOOL = FALSE, BOOL = FALSE ); - virtual void Polytext ( int, int, double, double, void*, BOOL = FALSE, BOOL = FALSE ); - virtual void BeginMarker ( int, int, int, int, double ); - virtual void EndMarker ( void ); - virtual void LineAttrib ( DWORD, PLOGBRUSH, DWORD = 0, PDWORD = NULL ); - virtual void PolyAttrib ( PLOGBRUSH, BOOL, int = ALTERNATE ); - virtual void TextAttrib ( - HFONT, COLORREF, double = 0.0, double = 1.0, double = 1.0, - BOOL = FALSE, BOOL = FALSE, BOOL = FALSE - ); - virtual void MarkerAttrib ( COLORREF, DWORD, BOOL ); - virtual void FunCall ( W32_FCall, int, PW32_FCALLPARAM ); - - virtual int TextSize ( HDC, char*, PSIZE ); - virtual int TextSize ( HDC, wchar_t*, PSIZE ); - - void GetExtent ( LPSIZE lpSZ ); - void TransformPoint ( int&, int& ); - void TransformPoint ( LPPOINT ); - void RecalcMatrix ( XFORM&, double = 0.0, - double = 0.0, double = 0.0 - ); - void Register ( int, int ); - void Register ( LPPOINT, int ); - void Register ( LPRECT ); - - SIZE mySize; // HDC's extent - HDC myHDC; // HDC to draw - RECT myURect; // Update RECT - XFORM myMatrix; // World transformation matrix - - HPEN myLinePen; // Line attributes - DWORD myLineWidth; - HBRUSH myPolyBrush; // Poly attributes - HPEN myTextPen; // Text attributes - HBRUSH myTextBrush; - COLORREF myTextColor; - HPEN myMarkerPen; // Marker attributes - - HPEN myPO; // Used to remember old - HBRUSH myBO; // pen, brush and font - HFONT myFO; - -}; - -typedef WNT_Allocator* PWNT_Allocator; - -#endif // __WNT_ALLOCATOR_HXX diff --git a/src/WNT/WNT_Bitmap.h b/src/WNT/WNT_Bitmap.h deleted file mode 100755 index 3117f72a5e..0000000000 --- a/src/WNT/WNT_Bitmap.h +++ /dev/null @@ -1,48 +0,0 @@ -/* - Copyright (c) 1999-2012 OPEN CASCADE SAS - - The content of this file is subject to the Open CASCADE Technology Public - License Version 6.5 (the "License"). You may not use the content of this file - except in compliance with the License. Please obtain a copy of the License - at http://www.opencascade.org and read it completely before using this file. - - The Initial Developer of the Original Code is Open CASCADE S.A.S., having its - main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. - - The Original Code and all software distributed under the License is - distributed on an "AS IS" basis, without warranty of any kind, and the - Initial Developer hereby disclaims all such warranties, including without - limitation, any warranties of merchantability, fitness for a particular - purpose or non-infringement. Please see the License for the specific terms - and conditions governing the rights and limitations under the License. - -*/ - -#ifndef __WNT_BITMAP_H -# define __WNT_BITMAP_H - -# ifndef __WINDOWS_H_INCLUDED -# define __WINDOWS_H_INCLUDED -# ifndef STRICT -# define STRICT -# endif /* STRICT */ -# define WIN32_LEAN_AND_MEAN -# include - -#ifdef DrawText -#undef DrawText -#endif - -# ifdef THIS -# undef THIS -# endif // THIS -# endif // __WINDOWS_H_INCLUDED - -typedef struct _wnt_bitmap { - - int nUsed; - HBITMAP hBmp; - - } WNT_Bitmap, *PWNT_Bitmap; - -#endif /* __WNT_SAFEBITMAP_H */ diff --git a/src/WNT/WNT_ColorRef.cxx b/src/WNT/WNT_ColorRef.cxx deleted file mode 100755 index e95152b84e..0000000000 --- a/src/WNT/WNT_ColorRef.cxx +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 1996-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - -#ifndef __WNT_ColorRef_HeaderFile -# include -#endif // __WNT_ColorRef_HeaderFile - -const Handle( Standard_Type )& STANDARD_TYPE( WNT_ColorRef ) { - - static Handle( Standard_Type ) _aType = new Standard_Type ( - "WNT_ColorRef", sizeof ( WNT_ColorRef ) - ); - - return _aType; - -} // end function diff --git a/src/WNT/WNT_ColorRef.hxx b/src/WNT/WNT_ColorRef.hxx deleted file mode 100755 index 291ad3fb36..0000000000 --- a/src/WNT/WNT_ColorRef.hxx +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 1996-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - -#ifndef __WNT_ColorRef_HeaderFile -# define __WNT_ColorRef_HeaderFile - -# ifndef __WINDOWS_H_INCLUDED -# define __WINDOWS_H_INCLUDED -# ifndef STRICT -# define STRICT -# endif /* STRICT */ -# define WIN32_LEAN_AND_MEAN -# include - -#ifdef DrawText -#undef DrawText -#endif - -# ifdef THIS -# undef THIS -# endif // THIS -# endif // __WINDOWS_H_INCLUDED - -# ifndef __STANDARD_TYPE_HXX_INCLUDED -# define __STANDARD_TYPE_HXX_INCLUDED -# include -# endif // __STANDARD_TYPE_HXX_INCLUDED - -typedef COLORREF WNT_ColorRef; - -extern const Handle( Standard_Type )& STANDARD_TYPE( WNT_ColorRef ); - -#endif // __WNT_ColorRef_HeaderFile diff --git a/src/WNT/WNT_Image.cdl b/src/WNT/WNT_Image.cdl deleted file mode 100755 index 83d3a3c93b..0000000000 --- a/src/WNT/WNT_Image.cdl +++ /dev/null @@ -1,56 +0,0 @@ --- Created by: PLOTNIKOV Eugeny --- Copyright (c) 1996-1999 Matra Datavision --- Copyright (c) 1999-2012 OPEN CASCADE SAS --- --- The content of this file is subject to the Open CASCADE Technology Public --- License Version 6.5 (the "License"). You may not use the content of this file --- except in compliance with the License. Please obtain a copy of the License --- at http://www.opencascade.org and read it completely before using this file. --- --- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its --- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. --- --- The Original Code and all software distributed under the License is --- distributed on an "AS IS" basis, without warranty of any kind, and the --- Initial Developer hereby disclaims all such warranties, including without --- limitation, any warranties of merchantability, fitness for a particular --- purpose or non-infringement. Please see the License for the specific terms --- and conditions governing the rights and limitations under the License. - - - -class Image from WNT inherits TShared from MMgt - - ---Purpose: Internal class for image management - - uses - - Handle from Aspect - - is - - Create ( aBitmap : Handle from Aspect; aHashCode : Integer from Standard ) - returns mutable Image from WNT; - ---Purpose: Creates a class. - - Destroy ( me : mutable ) is virtual; - ---Level: Public - ---Purpose: Destroys all ressources attached to the Image - ---C++: alias ~ - - HBITMAP ( me ) returns Handle from Aspect; - ---Level: Public - ---Purpose: Returns bitmap handle - ---C++: inline - - Image ( me ) returns Address from Standard; - ---Level: Public - ---Purpose: Returns pointer to internal structure - ---C++: inline - - fields - - myImage : Address from Standard is protected; - myHashCode : Integer from Standard is protected; - -end Image; diff --git a/src/WNT/WNT_Image.cxx b/src/WNT/WNT_Image.cxx deleted file mode 100755 index 0358bb286c..0000000000 --- a/src/WNT/WNT_Image.cxx +++ /dev/null @@ -1,64 +0,0 @@ -// Copyright (c) 1996-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - - -// include windows.h first to have all definitions available -#include -#include - -#include - -//======================================================================= -//function : WNT_Image -//purpose : -//======================================================================= - -WNT_Image::WNT_Image ( const Aspect_Handle aBitmap, - const Standard_Integer aHashCode ) -{ - - myImage = ( Standard_Address )HeapAlloc ( - GetProcessHeap (), - HEAP_ZERO_MEMORY | HEAP_GENERATE_EXCEPTIONS, - sizeof ( WNT_Bitmap ) - ); - - ( ( PW32_Bitmap )myImage ) -> hBmp = ( ::HBITMAP )aBitmap; - ( ( PW32_Bitmap )myImage ) -> nUsed = 1; - myHashCode = aHashCode; - -} // end constructor - -//======================================================================= -//function : Destroy -//purpose : -//======================================================================= - -void WNT_Image::Destroy () { - - if ( --( ( PW32_Bitmap )myImage ) -> nUsed == 0 && - ( ( PW32_Bitmap )myImage ) -> hBmp != NULL - ) { - - DeleteObject ( ( ( PW32_Bitmap )myImage ) -> hBmp ); - HeapFree ( GetProcessHeap (), 0, ( PVOID )myImage ); - - } // end if - -} // end WNT_Image :: Destroy - diff --git a/src/WNT/WNT_Image.lxx b/src/WNT/WNT_Image.lxx deleted file mode 100755 index 4ae83b8229..0000000000 --- a/src/WNT/WNT_Image.lxx +++ /dev/null @@ -1,33 +0,0 @@ -// Copyright (c) 1996-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - -#ifndef __WNT_BITMAP_H -# include -#endif // __WNT_BITMAP_H - -inline Aspect_Handle WNT_Image :: HBITMAP () const { - - return ( ( PWNT_Bitmap )myImage ) -> hBmp; - -} // end WNT_Image :: HBITMAP - -inline Standard_Address WNT_Image :: Image () const { - - return myImage; - -} // end WNT_Image :: HBITMAP diff --git a/src/WNT/WNT_LogFont.cxx b/src/WNT/WNT_LogFont.cxx deleted file mode 100755 index 188151960c..0000000000 --- a/src/WNT/WNT_LogFont.cxx +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 1996-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - -#ifndef __WNT_LogFont_HeaderFile -# include -#endif // __WNT_LogFont_HeaderFile - -const Handle( Standard_Type )& STANDARD_TYPE( WNT_LogFont ) { - - static Handle( Standard_Type ) _aType = new Standard_Type ( - "WNT_LogFont", sizeof ( WNT_LogFont ) - ); - - return _aType; - -} // end function diff --git a/src/WNT/WNT_LogFont.hxx b/src/WNT/WNT_LogFont.hxx deleted file mode 100755 index dc7b31e91d..0000000000 --- a/src/WNT/WNT_LogFont.hxx +++ /dev/null @@ -1,51 +0,0 @@ -// Copyright (c) 1996-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - -#ifndef __WNT_LogFont_HeaderFile -# define __WNT_LogFont_HeaderFile - -# ifndef __WINDOWS_H_INCLUDED -# define __WINDOWS_H_INCLUDED -# ifndef STRICT -# define STRICT -# endif /* STRICT */ -# define WIN32_LEAN_AND_MEAN -# ifdef NOGDI -# undef NOGDI /* we need GDI definitions here... */ -# endif -# include - -#ifdef DrawText -#undef DrawText -#endif - -# ifdef THIS -# undef THIS -# endif // THIS -# endif // __WINDOWS_H_INCLUDED - -# ifndef __STANDARD_TYPE_HXX_INCLUDED -# define __STANDARD_TYPE_HXX_INCLUDED -# include -# endif // __STANDARD_TYPE_HXX_INCLUDED - -typedef LOGFONT WNT_LogFont; - -extern const Handle( Standard_Type )& STANDARD_TYPE( WNT_LogFont ); - -#endif // __WNT_LogFont_HeaderFile diff --git a/src/WNT/WNT_Long.cxx b/src/WNT/WNT_Long.cxx deleted file mode 100755 index bfccfb44d6..0000000000 --- a/src/WNT/WNT_Long.cxx +++ /dev/null @@ -1,31 +0,0 @@ -// Copyright (c) 1996-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - -#ifndef __WNT_Long_HeaderFile -# include -#endif // __WNT_Long_HeaderFile - -const Handle( Standard_Type )& STANDARD_TYPE( WNT_Long ) { - - static Handle( Standard_Type ) _aType = new Standard_Type ( - "WNT_Long", sizeof ( WNT_Long ) - ); - - return _aType; - -} // end function diff --git a/src/WNT/WNT_Long.hxx b/src/WNT/WNT_Long.hxx deleted file mode 100755 index b9a6ea5a96..0000000000 --- a/src/WNT/WNT_Long.hxx +++ /dev/null @@ -1,48 +0,0 @@ -// Copyright (c) 1996-1999 Matra Datavision -// Copyright (c) 1999-2012 OPEN CASCADE SAS -// -// The content of this file is subject to the Open CASCADE Technology Public -// License Version 6.5 (the "License"). You may not use the content of this file -// except in compliance with the License. Please obtain a copy of the License -// at http://www.opencascade.org and read it completely before using this file. -// -// The Initial Developer of the Original Code is Open CASCADE S.A.S., having its -// main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. -// -// The Original Code and all software distributed under the License is -// distributed on an "AS IS" basis, without warranty of any kind, and the -// Initial Developer hereby disclaims all such warranties, including without -// limitation, any warranties of merchantability, fitness for a particular -// purpose or non-infringement. Please see the License for the specific terms -// and conditions governing the rights and limitations under the License. - -#ifndef __WNT_Long_HeaderFile -# define __WNT_Long_HeaderFile - -# ifndef __WINDOWS_H_INCLUDED -# define __WINDOWS_H_INCLUDED -# ifndef STRICT -# define STRICT -# endif /* STRICT */ -# define WIN32_LEAN_AND_MEAN -# include - -#ifdef DrawText -#undef DrawText -#endif - -# ifdef THIS -# undef THIS -# endif // THIS -# endif // __WINDOWS_H_INCLUDED - -# ifndef __STANDARD_TYPE_HXX_INCLUDED -# define __STANDARD_TYPE_HXX_INCLUDED -# include -# endif // __STANDARD_TYPE_HXX_INCLUDED - -typedef LONG WNT_Long; - -extern const Handle( Standard_Type )& STANDARD_TYPE( WNT_Long ); - -#endif // __WNT_Long_HeaderFile diff --git a/src/WNT/WNT_Window.cdl b/src/WNT/WNT_Window.cdl index 8abfdd1741..57ad4c4ccf 100755 --- a/src/WNT/WNT_Window.cdl +++ b/src/WNT/WNT_Window.cdl @@ -31,7 +31,6 @@ class Window from WNT inherits Window from Aspect Ratio from Quantity, WClass from WNT, Uint from WNT, - Long from WNT, Dword from WNT, WindowData from WNT