1 // Copyright (c) 1999-2012 OPEN CASCADE SAS
3 // The content of this file is subject to the Open CASCADE Technology Public
4 // License Version 6.5 (the "License"). You may not use the content of this file
5 // except in compliance with the License. Please obtain a copy of the License
6 // at http://www.opencascade.org and read it completely before using this file.
8 // The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
9 // main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
11 // The Original Code and all software distributed under the License is
12 // distributed on an "AS IS" basis, without warranty of any kind, and the
13 // Initial Developer hereby disclaims all such warranties, including without
14 // limitation, any warranties of merchantability, fitness for a particular
15 // purpose or non-infringement. Please see the License for the specific terms
16 // and conditions governing the rights and limitations under the License.
18 ////////////////////////////////////////////////////////////////////////////////
20 // Provides memory management and drawing operations for Windows 95. //
21 // World transformations and styled lines are managed by EHDC stuff. //
23 //FEB-98 - creation (EUG) //
24 // MAR-98 - modification (DCB) //
25 ////////////////////////////////////////////////////////////////////////////////
27 #define PRO19042 //GG_251199 Avoid to crash with an insuffisant resources messag
29 #include "WNT_Allocator.hxx"
35 #define ALLOCATOR ( ( PWNT_Allocator )myAllocator )
37 static XFORM xfmIdent = { ( FLOAT )0.8660, ( FLOAT )0.5000,
38 ( FLOAT )-0.5000, ( FLOAT )0.8660,
39 ( FLOAT )0.0000, ( FLOAT )0.0000
42 WNT_Allocator :: WNT_Allocator ( int anID, PW32_Allocator prev ) :
43 W32_Allocator ( anID, prev )
45 myLinePen = (HPEN) GetStockObject ( NULL_PEN );
47 myPolyBrush = (HBRUSH) GetStockObject ( NULL_BRUSH );
48 myTextPen = (HPEN) GetStockObject ( NULL_PEN );
49 myTextBrush = (HBRUSH) GetStockObject ( NULL_BRUSH );
50 myTextFont = (HFONT) GetStockObject ( SYSTEM_FONT );
51 myMarkerPen = (HPEN) GetStockObject ( NULL_PEN );
57 SetRectEmpty ( &myURect );
59 myMatrix.eM11 = myMatrix.eM22 = 1.0F;
60 myMatrix.eM12 = myMatrix.eM21 = 0.0F;
61 myMatrix.eDx = myMatrix.eDy = 0.0F;
63 myFlags &= ~W32F_WIN95;
66 WNT_Allocator :: ~WNT_Allocator ()
68 DeletePen ( myLinePen );
69 DeleteBrush ( myPolyBrush );
70 DeletePen ( myTextPen );
71 DeleteBrush ( myTextBrush );
72 DeletePen ( myMarkerPen );
75 void WNT_Allocator :: TransformPoint (int& X, int& Y)
77 X = int ( myScaleX * ( X - myPivot.x ) );
78 Y = int ( myScaleY * ( Y - myPivot.y ) );
79 } // WNT_Allocator :: TransformPoint
81 void WNT_Allocator :: TransformPoint (LPPOINT lpPoint)
83 lpPoint->x = int ( myScaleX * ( lpPoint->x - myPivot.x ) );
84 lpPoint->y = int ( myScaleY * ( lpPoint->y - myPivot.y ) );
85 } // WNT_Allocator :: TransformPoint
87 #define ADD_POINT_TO_RECT(aPoint) \
88 { if ( aPoint.x < myURect.left ) myURect.left = aPoint.x - myLineWidth - 1; \
89 if ( aPoint.x > myURect.right ) myURect.right = aPoint.x + myLineWidth + 1; \
90 if ( aPoint.y < myURect.top ) myURect.top = aPoint.y - myLineWidth - 1; \
91 if ( aPoint.y > myURect.bottom ) myURect.bottom = aPoint.y + myLineWidth + 1; \
94 void WNT_Allocator :: Register ( int x, int y )
98 LPtoDP ( myHDC, &pt, 1 );
99 ADD_POINT_TO_RECT (pt);
100 } // WNT_Allocator :: Register
102 void WNT_Allocator :: Register ( LPPOINT lpPts, int nPts )
104 for ( int i = 0; i < nPts; i++ )
105 Register ( lpPts[i].x, lpPts[i].y );
106 } // WNT_Allocator :: Register
108 void WNT_Allocator :: Register ( LPRECT lpRect )
110 Register ( lpRect->left, lpRect->top );
111 Register ( lpRect->left, lpRect->bottom );
112 Register ( lpRect->right, lpRect->top );
113 Register ( lpRect->right, lpRect->bottom );
114 } // WNT_Allocator :: Register
116 void WNT_Allocator :: RecalcMatrix (
117 XFORM& Matrix, double Angle,
118 double PivotX, double PivotY
121 float CosA = ( float )cos ( Angle );
122 float SinA = ( float )sin ( Angle );
123 Matrix.eM11 = float ( CosA );
124 Matrix.eM12 = float ( SinA );
125 Matrix.eM21 = -float ( SinA );
126 Matrix.eM22 = float ( CosA );
127 Matrix.eDx = float ( PivotX );
128 Matrix.eDy = float ( PivotY );
129 } // end WNT_Allocator :: RecalcMatrix
131 void WNT_Allocator :: Play ( HDC hdc, PSIZE szClient )
133 CopyMemory ( &mySize, szClient, sizeof ( SIZE ) );
134 if ( !( myFlags & W32F_EMPTY ) ) {
137 int nMapMode, nGMode, nBkMode;
140 nMapMode = SetMapMode ( myHDC, MM_ISOTROPIC );
141 SetRect ( &myURect, mySize.cx, mySize.cy, 0, 0 );
142 SetWindowExtEx ( myHDC, szClient->cx, -szClient->cy, &szWExt );
143 SetViewportExtEx ( myHDC, szClient->cx, szClient->cy, &szVExt );
144 SetViewportOrgEx ( myHDC, 0, szClient->cy - 1, &pVOExt );
145 nGMode = SetGraphicsMode ( myHDC, GM_ADVANCED );
146 nBkMode = SetBkMode ( myHDC, TRANSPARENT );
147 SelectPen ( myHDC, myLinePen );
148 SelectBrush ( myHDC, myPolyBrush );
149 SetTextColor ( myHDC, myTextColor );
152 for ( PW32_Block aBlock = myStart; aBlock != NULL; aBlock = aBlock -> next )
153 for ( int i = 0; i < aBlock -> free; i += aBlock -> data[ i ] )
154 if ( aBlock -> data[ i + 1 ] != __W32_DATA ) {
155 W32_Note* pNote = ( W32_Note* )&( aBlock -> data[ i + 1 ] );
159 SetMapMode ( myHDC, nMapMode );
160 SetWindowExtEx ( myHDC, szWExt.cx, szWExt.cy, NULL );
161 SetViewportExtEx ( myHDC, szVExt.cx, szVExt.cy, NULL );
162 SetViewportOrgEx ( myHDC, pVOExt.x, pVOExt.y, NULL );
163 SetBkMode ( myHDC, nBkMode );
164 SetGraphicsMode ( myHDC, nGMode );
166 } // end WNT_Allocator :: Play
168 void WNT_Allocator :: URect ( LPRECT lpRect )
170 CopyRect ( lpRect, &myURect );
171 if ( lpRect -> top < 0 ) lpRect -> top = 0;
172 if ( lpRect -> left < 0 ) lpRect -> left = 0;
173 if ( lpRect -> right > mySize.cx ) lpRect -> right = mySize.cx;
174 if ( lpRect -> bottom > mySize.cy ) lpRect -> bottom = mySize.cy;
175 } // end WNT_Allocator :: URect
177 void WNT_Allocator :: Xform ( void )
179 if ( myAngle != 0.0 || myPivot.x != 0 || myPivot.y != 0 ||
180 myMove.x != 0 || myMove.y != 0 )
182 RecalcMatrix ( myMatrix, myAngle,
183 myPivot.x + myMove.x,
184 myPivot.y + myMove.y );
185 SetWorldTransform ( myHDC, &myMatrix );
187 ModifyWorldTransform ( myHDC, NULL, MWT_IDENTITY );
189 } // end WNT_Allocator :: Xform
191 void WNT_Allocator :: Point ( int x, int y ) {
193 new ( this ) WNT_PointNote ( x, y );
195 } // end WNT_Allocator :: Point
197 void WNT_Allocator :: MarkerPoint ( int x, int y ) {
199 new ( this ) WNT_MarkerPointNote ( x, y );
201 } // end WNT_Allocator :: MarkerPoint
203 void WNT_Allocator :: Line ( int x, int y, int x1, int y1 ) {
205 new ( this ) WNT_LineNote ( x, y, x1, y1 );
207 } // end WNT_Allocator :: Line
209 void WNT_Allocator :: PolyEllipse ( int xc, int yc, int xr, int yr ) {
211 new ( this ) WNT_PolyEllipseNote ( xc, yc, xr, yr );
213 } // end WNT_Allocator :: PolyEllipse
215 void WNT_Allocator :: Ellipse ( int xc, int yc, int xr, int yr ) {
217 new ( this ) WNT_EllipseNote ( xc, yc, xr, yr );
219 } // end WNT_Allocator :: Ellipse
221 void WNT_Allocator :: Arc (
222 int xc, int yc, int xr, int yr,
226 new ( this ) WNT_ArcNote ( xc, yc, xr, yr, sa, oa );
228 } // end WNT_Allocator :: Arc
230 void WNT_Allocator :: PolyChord (
231 int xc, int yc, int xr, int yr,
235 new ( this ) WNT_PolyChordNote ( xc, yc, xr, yr, sa, oa );
237 } // end WNT_Allocator :: PolyChord
239 void WNT_Allocator :: Chord (
240 int xc, int yc, int xr, int yr,
244 new ( this ) WNT_PolyChordNote ( xc, yc, xr, yr, sa, oa );
246 } // end WNT_Allocator :: Chord
248 void WNT_Allocator :: PolySector (
249 int xc, int yc, int xr, int yr,
253 new ( this ) WNT_PolySectorNote ( xc, yc, xr, yr, sa, oa );
255 } // end WNT_Allocator :: PolySector
257 void WNT_Allocator :: Sector (
258 int xc, int yc, int xr, int yr,
262 new ( this ) WNT_SectorNote ( xc, yc, xr, yr, sa, oa );
264 } // end WNT_Allocator :: Sector
266 void WNT_Allocator :: PolyMarker ( int aMaxPoints ) {
268 new ( this ) W32_PolyMarkerNote ( aMaxPoints );
270 } // end WNT_Allocator :: PolyMarker
272 void WNT_Allocator :: PolyMarker1 (
273 int aMaxPoints, GetPointFunc fn,
274 int aStartPoint, void* fParam
277 new ( this ) WNT_PolyMarker1Note (
278 aMaxPoints, fn, aStartPoint, fParam
281 } // end WNT_Allocator :: PolyMarker1
283 void WNT_Allocator :: PolyMarker2 (
284 int aMaxPoints, GetPointFunc fn,
285 int aStartPoint, void* fParam
288 new ( this ) WNT_PolyMarker2Note (
289 aMaxPoints, fn, aStartPoint, fParam
292 } // end WNT_Allocator :: PolyMarker1
294 W32_Note* WNT_Allocator :: Polygon ( int aMaxPoints ) {
296 return new ( this ) WNT_PolygonNote ( aMaxPoints );
298 } // end WNT_Allocator :: Polygon
300 W32_Note* WNT_Allocator :: Polyline ( int aMaxPoints ) {
302 return new ( this ) WNT_PolylineNote ( aMaxPoints );
304 } // end WNT_Allocator :: Polyline
306 void WNT_Allocator :: Image (
307 int x, int y, PW32_Bitmap pBmp, double aScale
310 new ( this ) WNT_ImageNote ( x, y, pBmp, aScale );
312 } // end WNT_Allocator :: Image
314 void WNT_Allocator :: Text (
315 int x, int y, double angle, void* text,
316 BOOL fWide, BOOL fOutlined
319 new ( this ) WNT_TextNote ( x, y, angle, text, fWide, fOutlined );
321 } // end WNT_Allocator :: Text
323 void WNT_Allocator :: Polytext (
324 int x, int y, double angle, double margin,
325 void* text, BOOL fWide, BOOL fOutlined
328 new ( this ) WNT_PolyTextNote ( x, y, angle, margin, text, fWide, fOutlined );
330 } // end WNT_Allocator :: Polytext
332 void WNT_Allocator :: BeginMarker (
333 int x, int y, int w, int h, double angle
336 new ( this ) WNT_BeginMarkerNote ( x, y, w, h, angle );
338 } // end WNT_Allocator :: BeginMarker
340 void WNT_Allocator :: EndMarker ( void ) {
342 new ( this ) WNT_EndMarkerNote ();
344 } // end WNT_Allocator :: EndMarker
346 void WNT_Allocator :: LineAttrib (
347 DWORD width, PLOGBRUSH plb,
348 DWORD nStyles, PDWORD pdwStyle
351 new ( this ) WNT_LineAttribNote ( width, plb, nStyles, pdwStyle );
353 } // end WNT_Allocator :: LineAttrib
355 void WNT_Allocator :: PolyAttrib (
356 PLOGBRUSH plb, BOOL fDrawEdge, int aFillMode
359 new ( this ) WNT_PolyAttribNote ( plb, fDrawEdge, aFillMode );
361 } // end WNT_Allocator :: PolyAttrib
363 void WNT_Allocator :: TextAttrib (
364 HFONT hFont, COLORREF color, double slant,
365 double hScale, double vScale,
366 BOOL fUnderlined, BOOL fFree, BOOL fIndex
369 new ( this ) WNT_TextAttribNote (
370 hFont, color, slant, hScale, vScale,
371 fUnderlined, fFree, fIndex
374 } // end WNT_Allocator :: TextAttrib
376 void WNT_Allocator :: MarkerAttrib (
377 COLORREF color, DWORD dwWidth, BOOL fFill
380 new ( this ) WNT_MarkerAttribNote ( color, dwWidth, fFill );
382 } // end WNT_Allocator :: MarkerAttrib
384 void WNT_Allocator :: FunCall (
385 W32_FCall fCall, int sz, PW32_FCALLPARAM param
388 new ( this ) W32_FCallNote ( fCall, sz, param );
390 } // end WNT_Allocator :: FunCall
392 void WNT_Allocator :: GetExtent ( LPSIZE lpSZ )
394 CopyMemory ( lpSZ, &mySize, sizeof ( SIZE ) );
397 int WNT_Allocator :: TextSize ( HDC hdc, char* str, PSIZE psz ) {
399 int gMode = GetGraphicsMode ( hdc );
404 if ( gMode == GM_ADVANCED )
405 GetWorldTransform ( hdc, &xfms );
407 SetGraphicsMode ( hdc, GM_ADVANCED );
409 ModifyWorldTransform ( hdc, &xfmIdent, MWT_IDENTITY );
412 xfm.eM21 = ( FLOAT )tan ( myTextSlant );
416 ModifyWorldTransform ( hdc, &xfm, MWT_LEFTMULTIPLY );
417 xfm.eM11 = FLOAT ( myTextHScale * myScaleX );
420 xfm.eM22 = FLOAT ( myTextVScale * myScaleY );
423 ModifyWorldTransform ( hdc, &xfm, MWT_LEFTMULTIPLY );
425 MoveToEx ( hdc, 0, 0, &pt );
426 GetTextExtentPoint32A (
427 hdc, str, lstrlenA ( str ), psz
429 GetCharABCWidthsA ( hdc, str[ 0 ], str[ 0 ], &abcf );
430 MoveToEx ( hdc, pt.x, pt.y, NULL );
432 if ( gMode == GM_ADVANCED )
433 SetWorldTransform ( hdc, &xfms );
435 psz->cx = LONG ( psz->cx * xfm.eM11 );
436 psz->cy = LONG ( psz->cy * xfm.eM22 );
437 abcf.abcA = UINT ( abcf.abcA * xfm.eM11 );
438 SetGraphicsMode ( hdc, gMode );
442 } // end WNT_Allocator :: TextSize
444 int WNT_Allocator :: TextSize ( HDC hdc, wchar_t* str, PSIZE psz ) {
446 int gMode = GetGraphicsMode ( hdc );
451 if ( gMode == GM_ADVANCED )
452 GetWorldTransform ( hdc, &xfms );
454 SetGraphicsMode ( hdc, GM_ADVANCED );
456 ModifyWorldTransform ( hdc, &xfmIdent, MWT_IDENTITY );
459 xfm.eM21 = ( FLOAT )tan ( myTextSlant );
463 ModifyWorldTransform ( hdc, &xfm, MWT_LEFTMULTIPLY );
464 xfm.eM11 = FLOAT ( myTextHScale * myScaleX );
467 xfm.eM22 = FLOAT ( myTextVScale * myScaleY );
470 ModifyWorldTransform ( hdc, &xfm, MWT_LEFTMULTIPLY );
472 MoveToEx ( hdc, 0, 0, &pt );
473 GetTextExtentPoint32W (
474 hdc, str, lstrlenW ( str ), psz
476 GetCharABCWidthsW ( hdc, str[ 0 ], str[ 0 ], &abcf );
477 MoveToEx ( hdc, pt.x, pt.y, NULL );
479 if ( gMode == GM_ADVANCED )
480 SetWorldTransform ( hdc, &xfms );
482 psz->cx = LONG ( psz->cx * xfm.eM11 );
483 psz->cy = LONG ( psz->cy * xfm.eM22 );
484 abcf.abcA = UINT ( abcf.abcA * xfm.eM11 );
485 SetGraphicsMode ( hdc, gMode );
489 } // end WNT_Allocator :: TextSize
491 ////////////////////////////////////////////////////////////////////////////////
492 // W N T _ P o i n t N o t e //
493 ////////////////////////////////////////////////////////////////////////////////
494 WNT_PointNote :: WNT_PointNote ( int x, int y ) :
495 W32_PointNote ( x, y )
499 void WNT_PointNote :: Play ( BOOL )
502 SetPixel ( ALLOCATOR -> myHDC, myTX, myTY, ALLOCATOR -> myPointColor );
503 } // end WNT_PointNote :: Play
505 void WNT_PointNote :: Xform ()
509 ALLOCATOR -> TransformPoint ( myTX, myTY );
510 ALLOCATOR -> Register ( myTX, myTY );
512 ////////////////////////////////////////////////////////////////////////////////
513 // W N T _ M a r k e r P o i n t N o t e //
514 ////////////////////////////////////////////////////////////////////////////////
515 WNT_MarkerPointNote :: WNT_MarkerPointNote ( int x, int y ) :
516 WNT_PointNote ( x, y )
520 void WNT_MarkerPointNote :: Play ( BOOL )
523 SetPixel ( ALLOCATOR -> myHDC, myTX, myTY, ALLOCATOR -> myMarkerPointColor );
524 } // end WNT_MarkerPointNote :: Play
525 ////////////////////////////////////////////////////////////////////////////////
526 // W N T _ L i n e N o t e //
527 ////////////////////////////////////////////////////////////////////////////////
528 WNT_LineNote :: WNT_LineNote ( int x, int y, int x1, int y1 ) :
529 WNT_PointNote ( x, y )
535 void WNT_LineNote :: Play ( BOOL )
538 MoveToEx ( ALLOCATOR -> myHDC, myTX , myTY, NULL );
539 LineTo ( ALLOCATOR -> myHDC, myTX2, myTY2 );
540 } // end WNT_LineNote :: Play
542 void WNT_LineNote :: Xform ()
544 WNT_PointNote :: Xform ();
547 ALLOCATOR -> TransformPoint ( myTX2, myTY2 );
548 ALLOCATOR -> Register ( myTX2, myTY2 );
550 ////////////////////////////////////////////////////////////////////////////////
551 // W N T _ P o l y E l l i p s e N o t e //
552 ////////////////////////////////////////////////////////////////////////////////
553 WNT_PolyEllipseNote :: WNT_PolyEllipseNote ( int xc, int yc, int xr, int yr ) :
554 WNT_PointNote ( xc, yc )
560 void WNT_PolyEllipseNote :: Play ( BOOL )
563 Ellipse ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr,
564 myTX + myTXr, myTY + myTYr );
565 } // end WNT_PolyEllipseNote :: Play
567 void WNT_PolyEllipseNote :: Xform ()
569 WNT_PointNote :: Xform ();
570 myTXr = int (myXr * ALLOCATOR -> myScaleX);
571 myTYr = int (myYr * ALLOCATOR -> myScaleY);
572 RECT r = { myTX - myTXr, myTY - myTYr, myTX + myTXr, myTY + myTYr };
573 ALLOCATOR -> Register ( &r );
575 ////////////////////////////////////////////////////////////////////////////////
576 // W N T _ E l l i p s e N o t e //
577 ////////////////////////////////////////////////////////////////////////////////
578 WNT_EllipseNote :: WNT_EllipseNote ( int xc, int yc, int xr, int yr ) :
579 WNT_PolyEllipseNote ( xc, yc, xr, yr )
583 void WNT_EllipseNote :: Play ( BOOL )
586 HBRUSH hob = SelectBrush ( ALLOCATOR -> myHDC, GetStockObject (NULL_BRUSH) );
587 Ellipse ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr,
588 myTX + myTXr, myTY + myTYr );
589 SelectBrush ( ALLOCATOR -> myHDC, hob );
590 } // end WNT_PolyEllipseNote :: Play
591 ////////////////////////////////////////////////////////////////////////////////
592 // W N T _ A r c N o t e //
593 ////////////////////////////////////////////////////////////////////////////////
594 WNT_ArcNote :: WNT_ArcNote (
595 int xc, int yc, int xr, int yr, double sa, double oa
596 ) : WNT_PolyEllipseNote ( xc, yc, xr, yr )
598 int Radius = max ( xr, yr );
599 double sSinA = sin ( sa + oa );
600 double sCosA = cos ( sa + oa );
601 double eSinA = sin ( sa );
602 double eCosA = cos ( sa );
603 myDirect = ( sa + oa > 0. ) ? AD_COUNTERCLOCKWISE : AD_CLOCKWISE;
605 mySX = int ( sCosA * 2 * Radius + xc );
606 mySY = int ( sSinA * 2 * Radius + yc );
607 myEX = int ( eCosA * 2 * Radius + xc );
608 myEY = int ( eSinA * 2 * Radius + yc );
611 void WNT_ArcNote :: Play ( BOOL )
614 SetArcDirection ( ALLOCATOR -> myHDC, myDirect );
615 Arc ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr,
616 myTX + myTXr, myTY + myTYr,
617 myTSX, myTSY, myTEX, myTEY );
618 } // end WNT_ArcNote :: Play
620 void WNT_ArcNote :: Xform ()
622 WNT_PolyEllipseNote :: Xform ();
625 ALLOCATOR -> TransformPoint ( myTSX, myTSY );
628 ALLOCATOR -> TransformPoint ( myTEX, myTEY );
630 ////////////////////////////////////////////////////////////////////////////////
631 // W N T _ P o l y C h o r d N o t e //
632 ////////////////////////////////////////////////////////////////////////////////
633 WNT_PolyChordNote :: WNT_PolyChordNote (
634 int xc, int yc, int xr, int yr, double sa, double oa
635 ) : WNT_ArcNote ( xc, yc, xr, yr, sa, oa )
639 void WNT_PolyChordNote :: Play ( BOOL )
642 Chord ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr,
643 myTX + myTXr, myTY + myTYr,
644 myTEX, myTEY, myTSX, myTSY );
645 } // end WNT_PolyChordNote :: Play
646 ////////////////////////////////////////////////////////////////////////////////
647 // W N T _ C h o r d N o t e //
648 ////////////////////////////////////////////////////////////////////////////////
649 WNT_ChordNote :: WNT_ChordNote (
650 int xc, int yc, int xr, int yr, double sa, double oa
651 ) : WNT_PolyChordNote ( xc, yc, xr, yr, sa, oa )
655 void WNT_ChordNote :: Play ( BOOL )
658 HBRUSH hob = SelectBrush ( ALLOCATOR -> myHDC, GetStockObject (NULL_BRUSH) );
659 Chord ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr,
660 myTX + myTXr, myTY + myTYr,
661 myTEX, myTEY, myTSX, myTSY );
662 SelectBrush ( ALLOCATOR -> myHDC, hob );
663 } // end WNT_ChordNote :: Play
664 ////////////////////////////////////////////////////////////////////////////////
665 // W N T _ P o l y S e c t o r N o t e //
666 ////////////////////////////////////////////////////////////////////////////////
667 WNT_PolySectorNote :: WNT_PolySectorNote (
668 int xc, int yc, int xr, int yr, double sa, double oa
669 ) : WNT_ArcNote ( xc, yc, xr, yr, sa, oa )
673 void WNT_PolySectorNote :: Play ( BOOL )
676 Pie ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr,
677 myTX + myTXr, myTY + myTYr,
678 myTEX, myTEY, myTSX, myTSY );
679 } // end WNT_PolySectorNote :: Play
680 ////////////////////////////////////////////////////////////////////////////////
681 // W N T _ S e c t o r N o t e //
682 ////////////////////////////////////////////////////////////////////////////////
683 WNT_SectorNote :: WNT_SectorNote (
684 int xc, int yc, int xr, int yr, double sa, double oa
685 ) : WNT_PolySectorNote ( xc, yc, xr, yr, sa, oa )
689 void WNT_SectorNote :: Play ( BOOL )
692 HBRUSH hob = SelectBrush ( ALLOCATOR -> myHDC, GetStockObject (NULL_BRUSH) );
693 Pie ( ALLOCATOR -> myHDC, myTX - myTXr, myTY - myTYr,
694 myTX + myTXr, myTY + myTYr,
695 myTEX, myTEY, myTSX, myTSY );
696 SelectBrush ( ALLOCATOR -> myHDC, hob );
697 } // end WNT_SectorNote :: Play
699 ////////////////////////////////////////////////////////////////////////////////
700 // D r a w P o l y l i n e //
701 ////////////////////////////////////////////////////////////////////////////////
702 void DrawPolyline ( HDC hdc, LPPOINT lpPts, int nPts, BOOL fClose )
705 Polyline ( hdc, lpPts, nPts );
711 ////////////////////////////////////////////////////////////////////////////////
712 // D r a w P o l y g o n //
713 ////////////////////////////////////////////////////////////////////////////////
714 void DrawPolygon ( HDC hdc, LPPOINT lpPts, int nPts, UINT dwFlags )
716 HPEN hpo = SelectPen ( hdc, GetStockObject ( NULL_PEN ) );
717 Polygon ( hdc, lpPts, nPts );
718 SelectPen ( hdc, hpo );
720 if ( dwFlags & POLYF_NOCLOSEDGE )
721 DrawPolyline ( hdc, lpPts, nPts, FALSE );
722 else if ( !( dwFlags & POLYF_NOEDGE ) )
723 DrawPolyline ( hdc, lpPts, nPts, TRUE );
725 ////////////////////////////////////////////////////////////////////////////////
726 // W N T _ P o l y M a r k e r 1 N o t e //
727 ////////////////////////////////////////////////////////////////////////////////
728 WNT_PolyMarker1Note :: WNT_PolyMarker1Note (
729 int aMaxPoints, GetPointFunc fn, int aStartPoint,
731 ) : W32_PolyMarker1Note ( aMaxPoints, fn, aStartPoint, fParam)
735 void WNT_PolyMarker1Note :: Play ( BOOL )
737 if ( ALLOCATOR -> myFlags & W32F_MFILL )
738 DrawPolygon ( ALLOCATOR -> myHDC, myPoints, mySetPoints, POLYF_NOCLOSEDGE );
740 DrawPolyline ( ALLOCATOR -> myHDC, myPoints, mySetPoints, FALSE );
741 } // end WNT_PolyMarker1Note :: Play
742 ////////////////////////////////////////////////////////////////////////////////
743 // W N T _ P o l y M a r k e r 2 N o t e //
744 ////////////////////////////////////////////////////////////////////////////////
745 WNT_PolyMarker2Note :: WNT_PolyMarker2Note (
746 int aMaxPoints, GetPointFunc fn, int aStartPoint,
748 ) : WNT_PolyMarker1Note (
749 aMaxPoints, fn, aStartPoint, fParam
754 void WNT_PolyMarker2Note :: Play ( BOOL )
756 if ( ALLOCATOR -> myFlags & W32F_MFILL )
757 DrawPolygon ( ALLOCATOR -> myHDC, myPoints, mySetPoints - 1, 0 );
759 DrawPolyline ( ALLOCATOR -> myHDC, myPoints, mySetPoints - 1, TRUE );
760 } // end WNT_PolyMarker2Note :: Play
761 ////////////////////////////////////////////////////////////////////////////////
762 // W N T _ P o l y g o n N o t e //
763 ////////////////////////////////////////////////////////////////////////////////
764 WNT_PolygonNote :: WNT_PolygonNote ( int aMaxPoints ) :
765 W32_PolygonNote ( aMaxPoints )
767 myTPoints = ( LPPOINT ) ALLOCATOR -> NewData (myMaxPoints * sizeof ( POINT ));
770 void WNT_PolygonNote :: Play ( BOOL )
774 ALLOCATOR -> myHDC, myTPoints, mySetPoints,
775 ALLOCATOR -> myFlags & W32F_POUTL ? 0 : POLYF_NOEDGE
777 } // end WNT_PolygonNote :: Play
779 void WNT_PolygonNote :: Xform ()
781 CopyMemory ( myTPoints, myPoints, mySetPoints*sizeof(POINT) );
782 for ( int i = 0; i < mySetPoints; i++ )
783 ALLOCATOR -> TransformPoint ( (myTPoints + i) );
784 ALLOCATOR -> Register ( myTPoints, mySetPoints );
786 ////////////////////////////////////////////////////////////////////////////////
787 // W N T _ P o l y l i n e N o t e //
788 ////////////////////////////////////////////////////////////////////////////////
789 WNT_PolylineNote :: WNT_PolylineNote ( int aMaxPoints ) :
790 WNT_PolygonNote ( aMaxPoints )
794 void WNT_PolylineNote :: Play ( BOOL )
799 int idx = mySetPoints - 1;
800 if ( myPoints -> x == myPoints[ idx ].x &&
801 myPoints -> y == myPoints[ idx ].y
809 DrawPolyline ( ALLOCATOR->myHDC, myTPoints, nPts, fClose );
810 } // end WNT_PolylineNote :: Play
811 ////////////////////////////////////////////////////////////////////////////////
812 // W N T _ I m a g e N o t e //
813 ////////////////////////////////////////////////////////////////////////////////
814 WNT_ImageNote :: WNT_ImageNote (
815 int x, int y, PW32_Bitmap pBmp, double aScale
816 ) : WNT_PointNote ( x, y )
823 WNT_ImageNote :: ~WNT_ImageNote ()
825 if ( myBitmap -> hBmp != NULL && --myBitmap -> nUsed == 0 ) {
826 DeleteObject ( myBitmap -> hBmp );
827 HeapFree ( GetProcessHeap (), 0, ( PVOID )myBitmap );
829 } // end WNT_ImageNote :: ~WNT_ImageNote
831 void WNT_ImageNote :: Play ( BOOL )
839 GetObject ( myBitmap -> hBmp, sizeof ( BITMAP ), &bmp );
844 if ( myScale != 1.0 ) {
845 w = int ( w * myScale + 0.5 );
846 h = int ( h * myScale + 0.5 );
848 if ( ALLOCATOR -> myScaleX != 1.0 ) {
849 xx = int ( xx * ALLOCATOR -> myScaleX + 0.5 );
850 w = int ( w * ALLOCATOR -> myScaleX + 0.5 );
852 if ( ALLOCATOR -> myScaleY != 1.0 ) {
853 yy = int ( yy * ALLOCATOR -> myScaleY + 0.5 );
854 h = int ( h * ALLOCATOR -> myScaleY + 0.5 );
856 xx = xx - ( w >> 1 );
857 yy = yy + ( h >> 1 );
858 hdcMem = CreateCompatibleDC ( ALLOCATOR -> myHDC );
859 hbo = SelectBitmap ( hdcMem, myBitmap -> hBmp );
860 SetStretchBltMode ( hdcMem, COLORONCOLOR );
862 ALLOCATOR -> myHDC, xx, yy, w, -h,
863 hdcMem, 0, 0, bmp.bmWidth, bmp.bmHeight,
866 RECT r = { xx, yy, xx + w, yy - h };
867 ALLOCATOR -> Register ( &r );
868 SelectBitmap ( hdcMem, hbo );
870 } // end WNT_ImageNote :: Play
871 ////////////////////////////////////////////////////////////////////////////////
872 // W N T _ T e x t N o t e //
873 ////////////////////////////////////////////////////////////////////////////////
874 #define ROUNDL( d ) ( ( long )( ( d ) + ( ( d ) > 0 ? 0.5 : -0.5 ) ) )
875 WNT_TextNote :: WNT_TextNote (
876 int x, int y, double angle, void* text,
877 BOOL fWide, BOOL fOutlined
878 ) : WNT_PointNote ( x, y )
880 DWORD dwLen = fWide ? ( ( lstrlenW ( ( LPCWSTR )text ) + 1 ) << 1 )
881 : ( ( lstrlenA ( ( LPCSTR )text ) + 1 ) << 0 );
882 myText = ALLOCATOR -> NewData ( dwLen );
883 CopyMemory ( myText, text, dwLen );
884 myFlags = ( ( fWide ? W32F_TUNICODE : 0 ) |
885 ( fOutlined ? W32F_TOUTLINE : 0 )
887 ALLOCATOR -> RecalcMatrix ( RMatrix, angle );
890 void WNT_TextNote :: PaintText ()
892 if (myFlags & W32F_TUNICODE)
893 TextOutW ( ALLOCATOR -> myHDC, 0, myShift, (LPCWSTR)myText, lstrlenW ((LPCWSTR)myText) );
895 TextOutA ( ALLOCATOR -> myHDC, 0, myShift, (LPCSTR)myText, lstrlenA ((LPCSTR)myText) );
896 } // end WNT_TextNote :: PaintText
898 void WNT_TextNote :: SetAttribs ()
900 ALLOCATOR -> myPO = SelectPen (ALLOCATOR -> myHDC, ALLOCATOR -> myTextPen );
901 ALLOCATOR -> myBO = SelectBrush (ALLOCATOR -> myHDC, ALLOCATOR -> myTextBrush);
902 ALLOCATOR -> myFO = SelectFont (ALLOCATOR -> myHDC, ALLOCATOR -> myTextFont );
903 } // end WNT_TextNote :: SetAttribs
905 void WNT_TextNote :: RestoreAttribs ()
907 SelectPen ( ALLOCATOR -> myHDC, ALLOCATOR -> myPO );
908 SelectBrush ( ALLOCATOR -> myHDC, ALLOCATOR -> myBO );
909 SelectFont ( ALLOCATOR -> myHDC, ALLOCATOR -> myFO );
910 ALLOCATOR -> Xform ();
911 } // end WNT_TextNote :: RestoreAttribs
913 void WNT_TextNote :: OutlineText ()
915 BeginPath ( ALLOCATOR -> myHDC );
917 EndPath ( ALLOCATOR -> myHDC );
918 StrokePath ( ALLOCATOR -> myHDC );
919 } // end WNT_TextNote :: OutlineText
921 void WNT_TextNote :: FillText ()
924 } // end WNT_TextNote :: FillText
926 void WNT_TextNote :: Play ( BOOL )
931 HDC hdc = ALLOCATOR -> myHDC;
932 // Set new world transform and attribs to get text size and metrics
934 if ( myFlags & W32F_TUNICODE )
935 ALLOCATOR -> TextSize ( hdc, ( wchar_t* )myText, &size );
937 ALLOCATOR -> TextSize ( hdc, ( char* )myText, &size );
938 ModifyWorldTransform ( hdc, &RMatrix, MWT_LEFTMULTIPLY );
939 // Register and draw the bounding rect
942 rect.right = ROUNDL( ( FLOAT )size.cx * SMatrix.eM11 );
943 rect.bottom = -ROUNDL( ( FLOAT )size.cy * SMatrix.eM22 );
944 if (ALLOCATOR -> myTextSlant >= 0.F)
945 rect.right += ROUNDL( ( FLOAT )rect.bottom * IMatrix.eM21 );
947 rect.left += ROUNDL( ( FLOAT )rect.bottom * IMatrix.eM21 );
948 ALLOCATOR -> Register ( &rect );
949 // Draw ( fill or outline ) text
951 ModifyWorldTransform ( hdc, &IMatrix, MWT_LEFTMULTIPLY );
952 ModifyWorldTransform ( hdc, &SMatrix, MWT_LEFTMULTIPLY );
953 if ( myFlags & W32F_TOUTLINE || ALLOCATOR -> myFlags & W32F_MONO ) OutlineText ();
956 } // end WNT_TextNote :: Play
958 void WNT_TextNote :: Xform ( void )
960 WNT_PointNote :: Xform ();
961 RMatrix.eDx = float ( myTX );
962 RMatrix.eDy = float ( myTY );
963 SMatrix.eM11 = float ( ALLOCATOR -> myTextHScale * ALLOCATOR -> myScaleX );
966 SMatrix.eM22 = -float ( ALLOCATOR -> myTextVScale * ALLOCATOR -> myScaleY );
971 IMatrix.eM21 = float ( tan (ALLOCATOR -> myTextSlant) );
975 } // enf WNT_TextNote :: Xform
976 ////////////////////////////////////////////////////////////////////////////////
977 // W N T _ P o l y T e x t N o t e //
978 ////////////////////////////////////////////////////////////////////////////////
979 WNT_PolyTextNote :: WNT_PolyTextNote (
980 int x, int y, double angle, double margin,
981 void* text, BOOL fWide, BOOL fOutlined
982 ) : WNT_TextNote ( x, y, angle, text, fWide, fOutlined ),
987 void WNT_PolyTextNote :: Play ( BOOL )
993 HDC hdc = ALLOCATOR -> myHDC;
994 // Set new world transform and attribs to get text size and metrics
996 if ( myFlags & W32F_TUNICODE )
997 ALLOCATOR -> TextSize ( hdc, ( wchar_t* )myText, &size );
999 ALLOCATOR -> TextSize ( hdc, ( char* )myText, &size );
1001 ModifyWorldTransform ( hdc, &RMatrix, MWT_LEFTMULTIPLY );
1002 // Register and draw the bounding rect
1005 rect.right = ROUNDL( ( FLOAT )size.cx * SMatrix.eM11 );
1006 rect.bottom = -ROUNDL( ( FLOAT )size.cy * SMatrix.eM22 );
1007 if (ALLOCATOR -> myTextSlant >= 0.F)
1008 rect.right += ROUNDL( ( FLOAT )rect.bottom * IMatrix.eM21 );
1010 rect.left += ROUNDL( ( FLOAT )rect.bottom * IMatrix.eM21 );
1011 height = ROUNDL( (FLOAT)rect.bottom * (FLOAT)myMargin / 2.0F );
1012 InflateRect ( &rect, height, height );
1013 // Drawing round rectangle
1014 HPEN hpo = ( (ALLOCATOR->myFlags & W32F_POUTL) ?
1015 SelectPen ( hdc, ALLOCATOR -> myLinePen ):
1016 SelectPen ( hdc, GetStockObject (NULL_PEN) ) );
1017 HBRUSH hbo = ( (ALLOCATOR->myFlags & W32F_NOFIL) ?
1018 SelectBrush ( hdc, GetStockObject (NULL_BRUSH) ):
1019 SelectBrush ( hdc, ALLOCATOR -> myPolyBrush ) );
1020 Rectangle ( hdc, rect.left, rect.top, rect.right, rect.bottom );
1021 SelectBrush ( hdc, hbo );
1022 SelectPen ( hdc, hpo );
1023 ALLOCATOR -> Register ( &rect );
1024 // Draw ( fill or outline ) text
1026 ModifyWorldTransform ( hdc, &IMatrix, MWT_LEFTMULTIPLY );
1027 ModifyWorldTransform ( hdc, &SMatrix, MWT_LEFTMULTIPLY );
1029 if (myFlags & W32F_TOUTLINE || ALLOCATOR -> myFlags & W32F_MONO) OutlineText ();
1032 } // end WNT_PolyTextNote :: Play
1033 ////////////////////////////////////////////////////////////////////////////////
1034 // W N T _ B e g i n M a r k e r N o t e //
1035 ////////////////////////////////////////////////////////////////////////////////
1036 WNT_BeginMarkerNote :: WNT_BeginMarkerNote (
1037 int x, int y, int w, int h, double angle
1038 ) : WNT_PointNote ( x, y ),
1039 myAngle ( angle ), myWidth ( w ), myHeight ( h )
1041 myPrevAngle = ALLOCATOR -> myAngle;
1042 ALLOCATOR -> RecalcMatrix (myMatrix, myAngle - myPrevAngle, myX, myY);
1043 } // end constructor
1045 void WNT_BeginMarkerNote :: Play ( BOOL )
1047 ALLOCATOR -> myPO = SelectPen (ALLOCATOR -> myHDC, ALLOCATOR -> myMarkerPen);
1049 if ( ALLOCATOR -> myFlags & W32F_MFILL )
1051 if ( ALLOCATOR -> myFlags | W32F_MFILL )
1053 ALLOCATOR -> myBO = SelectBrush (ALLOCATOR -> myHDC, ALLOCATOR -> myPolyBrush);
1055 ALLOCATOR -> myBO = SelectBrush (ALLOCATOR -> myHDC, GetStockObject (NULL_BRUSH));
1057 } // end WNT_BeginMarkerNote :: Play
1059 void WNT_BeginMarkerNote :: Xform ()
1061 WNT_PointNote :: Xform ();
1062 if (myPrevAngle != ALLOCATOR -> myAngle) {
1063 myPrevAngle = ALLOCATOR -> myAngle;
1064 ALLOCATOR -> RecalcMatrix (myMatrix, myAngle - myPrevAngle, myX, myY);
1066 myMatrix.eDx = float ( myTX );
1067 myMatrix.eDy = float ( myTY );
1068 ModifyWorldTransform ( ALLOCATOR -> myHDC, &myMatrix, MWT_LEFTMULTIPLY );
1069 RECT r = { -myWidth / 2, -myHeight / 2, myWidth / 2, myHeight / 2 };
1070 ALLOCATOR -> Register ( &r );
1072 ////////////////////////////////////////////////////////////////////////////////
1073 // W N T _ E n d M a r k e r N o t e //
1074 ////////////////////////////////////////////////////////////////////////////////
1075 WNT_EndMarkerNote :: WNT_EndMarkerNote ()
1079 void WNT_EndMarkerNote :: Play ( BOOL )
1081 ALLOCATOR -> Xform ();
1082 SelectPen ( ALLOCATOR -> myHDC, ALLOCATOR -> myPO );
1083 SelectBrush ( ALLOCATOR -> myHDC, ALLOCATOR -> myBO );
1084 } // end WNT_EndMarkerNote :: Play
1085 ////////////////////////////////////////////////////////////////////////////////
1086 // W N T _ L i n e A t t r i b N o t e //
1087 ////////////////////////////////////////////////////////////////////////////////
1088 WNT_LineAttribNote :: WNT_LineAttribNote (
1089 DWORD width, PLOGBRUSH plb,
1090 DWORD nStyles, PDWORD pdwStyle
1093 myPointColor = plb -> lbColor;
1094 myWidth = ((width == 0) ? 1 : width);
1096 if ((width == 0 || width == 1) && (nStyles == 0)) {
1097 myPen = CreatePen (PS_SOLID, width, plb->lbColor);
1099 DWORD pStyle = ( nStyles > 0 ? PS_USERSTYLE : PS_SOLID );
1100 pStyle |= ( PS_ENDCAP_FLAT | PS_JOIN_MITER | PS_GEOMETRIC );
1101 myPen = ExtCreatePen ( pStyle, width, plb, nStyles, pdwStyle );
1104 DWORD errCode = GetLastError();
1105 printf ( " *** WNT_LineAttribNote : Can't create extended pen: %lu\n", errCode );
1106 wsprintf ( err, "Can't create extended pen: %lu", errCode );
1107 MessageBox ( NULL, err, "WNT_Allocator", MB_OK | MB_ICONEXCLAMATION );
1108 myPen = CreatePen ( PS_SOLID, 1, RGB(170,170,70) );
1112 } // end constructor
1114 WNT_LineAttribNote :: ~WNT_LineAttribNote ( void )
1119 printf(" *** Destroy:WNT_LineAttribNote %x/%x\n",myPen,ALLOCATOR->myLinePen);
1125 if ( myPen && myPen != ALLOCATOR -> myLinePen )
1128 } // enf WNT_LineAttribNote :: ~WNT_LineAttribNote
1130 void WNT_LineAttribNote :: Play ( BOOL fRealize )
1132 ALLOCATOR -> myLinePen = myPen;
1133 ALLOCATOR -> myLineWidth = myWidth;
1134 ALLOCATOR -> myPointColor = myPointColor;
1136 SelectPen ( ALLOCATOR -> myHDC, myPen );
1137 } // end WNT_LineAttribNote :: Play
1138 ////////////////////////////////////////////////////////////////////////////////
1139 // W N T _ P o l y A t t r i b N o t e //
1140 ////////////////////////////////////////////////////////////////////////////////
1141 WNT_PolyAttribNote :: WNT_PolyAttribNote (
1142 PLOGBRUSH plb, BOOL fDrawEdge, int /*aFillMode*/
1145 myfEdge = fDrawEdge;
1146 myNoFill = ( plb -> lbStyle == BS_NULL );
1147 myBrush = CreateBrushIndirect ( plb );
1149 } // end constructor
1151 WNT_PolyAttribNote :: ~WNT_PolyAttribNote ( void )
1156 printf(" *** Destroy:WNT_PolyAttribNote %x/%x\n",myBrush,ALLOCATOR->myPolyBrush);
1158 DeleteBrush( myBrush );
1162 if ( myBrush && myBrush != ALLOCATOR -> myPolyBrush )
1163 DeleteBrush( myBrush );
1165 } // enf WNT_PolyAttribNote :: ~WNT_PolyAttribNote
1167 void WNT_PolyAttribNote :: Play ( BOOL fRealize )
1169 if ( myfEdge ) ALLOCATOR -> myFlags |= W32F_POUTL;
1170 else ALLOCATOR -> myFlags &= ~W32F_POUTL;
1171 if ( myNoFill ) ALLOCATOR -> myFlags |= W32F_NOFIL;
1172 else ALLOCATOR -> myFlags &= ~W32F_NOFIL;
1173 ALLOCATOR -> myPolyBrush = myBrush;
1175 SelectPen ( ALLOCATOR -> myHDC, ALLOCATOR -> myLinePen );
1176 SelectBrush ( ALLOCATOR -> myHDC, ALLOCATOR -> myPolyBrush );
1178 } // end WNT_PolyAttribNote :: Play
1179 ////////////////////////////////////////////////////////////////////////////////
1180 // W N T _ T e x t A t t r i b N o t e //
1181 ////////////////////////////////////////////////////////////////////////////////
1182 WNT_TextAttribNote :: WNT_TextAttribNote (
1183 HFONT hFont, COLORREF color, double slant,
1184 double hScale, double vScale,
1185 BOOL fUnderlined, BOOL fFree, BOOL fIndex
1189 mySlant = (slant == 0.0 ? EPS : slant);
1192 myFlags = ( fUnderlined ? W32F_TFULINED : 0 ) |
1193 ( fIndex ? W32F_TINDEX : 0 ) |
1194 ( fFree ? W32F_TFREE : 0 );
1196 myPen = CreatePen ( PS_SOLID, 0, color );
1197 myBrush = CreateSolidBrush ( color );
1199 } // end constructor
1201 WNT_TextAttribNote :: ~WNT_TextAttribNote ()
1204 if ( myFont && (myFlags & W32F_TFREE) ) {
1206 printf(" *** Destroy:WNT_TextAttribNote_FONT %x/%x\n",myFont,ALLOCATOR->myTextFont);
1208 DeleteFont ( myFont );
1213 printf(" *** Destroy:WNT_TextAttribNote_PEN %x/%x\n",myPen,ALLOCATOR->myTextPen);
1215 DeletePen ( myPen );
1220 printf(" *** Destroy:WNT_TextAttribNote_BRUSH %x/%x\n",myBrush,ALLOCATOR->myTextBrush);
1222 DeleteBrush ( myBrush );
1226 if ( myFlags & W32F_TFREE ) DeleteFont ( myFont );
1227 if ( myPen && myPen != ALLOCATOR -> myTextPen ) DeletePen ( myPen );
1228 if ( myBrush && myBrush != ALLOCATOR -> myTextBrush ) DeleteBrush ( myBrush );
1232 void WNT_TextAttribNote :: Play ( BOOL fRealize )
1234 if ( ( ALLOCATOR -> myFlags & W32F_DFONT ) && !( myFlags & W32F_TINDEX ) ) {
1235 DeleteFont( ALLOCATOR -> myTextFont );
1236 ALLOCATOR -> myFlags &= ~W32F_DFONT;
1238 ALLOCATOR -> myTextFont = myFont;
1239 ALLOCATOR -> myTextSlant = mySlant;
1240 ALLOCATOR -> myTextHScale = myHScale;
1241 ALLOCATOR -> myTextVScale = myVScale;
1242 ALLOCATOR -> myTextColor = myColor;
1243 ALLOCATOR -> myTextPen = myPen;
1244 ALLOCATOR -> myTextBrush = myBrush;
1245 if (myFlags & W32F_TFULINED) ALLOCATOR -> myFlags |= W32F_TULIN;
1246 else ALLOCATOR -> myFlags &= ~W32F_TULIN;
1247 if ( fRealize && !( myFlags & W32F_TINDEX ) ) {
1248 SetTextColor ( ALLOCATOR -> myHDC, ALLOCATOR -> myTextColor );
1249 SelectPen ( ALLOCATOR -> myHDC, ALLOCATOR -> myTextPen );
1250 SelectBrush ( ALLOCATOR -> myHDC, ALLOCATOR -> myTextBrush );
1251 SelectFont ( ALLOCATOR -> myHDC, ALLOCATOR -> myTextFont );
1253 } // end WNT_TextAttribNote :: Play
1254 ////////////////////////////////////////////////////////////////////////////////
1255 // W N T _ M a r k e r A t t r i b N o t e //
1256 ////////////////////////////////////////////////////////////////////////////////
1257 WNT_MarkerAttribNote :: WNT_MarkerAttribNote (
1258 COLORREF color, DWORD dwWidth, BOOL fFill
1261 DWORD width = (dwWidth == 0) ? 1 : dwWidth;
1264 myMarkerPointColor = color;
1265 myPen = CreatePen ( PS_SOLID, width, color );
1267 } // end constructor
1269 WNT_MarkerAttribNote :: ~WNT_MarkerAttribNote ( void )
1274 printf(" *** Destroy:WNT_MarkerAttribNote %x/%x\n",myPen,ALLOCATOR->myMarkerPen);
1280 if ( myPen && myPen != ALLOCATOR -> myMarkerPen ) DeletePen( myPen );
1282 } // enf WNT_MarkerAttribNote :: ~WNT_MarkerAttribNote
1284 void WNT_MarkerAttribNote :: Play ( BOOL )
1286 if (myFill) ALLOCATOR -> myFlags |= W32F_MFILL;
1287 else ALLOCATOR -> myFlags &= ~W32F_MFILL;
1289 ALLOCATOR -> myMarkerPen = myPen;
1290 ALLOCATOR -> myMarkerPointColor = myMarkerPointColor;
1291 } // end WNT_MarkerAttribNote :: Play