0023510: Integration of test grid "vis" into the new testing system
[occt.git] / src / WNT / WNT_WDriver.cdl
1 -- Created on: 1996-01-25
2 -- Created by: s:       LAVNIKOV Alexey & PLOTNIKOV Eugeny
3 -- Copyright (c) 1996-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
5 --
6 -- The content of this file is subject to the Open CASCADE Technology Public
7 -- License Version 6.5 (the "License"). You may not use the content of this file
8 -- except in compliance with the License. Please obtain a copy of the License
9 -- at http://www.opencascade.org and read it completely before using this file.
10 --
11 -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its
12 -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France.
13 --
14 -- The Original Code and all software distributed under the License is
15 -- distributed on an "AS IS" basis, without warranty of any kind, and the
16 -- Initial Developer hereby disclaims all such warranties, including without
17 -- limitation, any warranties of merchantability, fitness for a particular
18 -- purpose or non-infringement. Please see the License for the specific terms
19 -- and conditions governing the rights and limitations under the License.
20
21
22 class WDriver from WNT inherits WindowDriver from Aspect
23
24         ---Purpose: This class defines Windows NT window driver
25
26  uses
27  
28     ExtendedString        from TCollection,
29     Length                from Quantity,
30     Factor                from Quantity,
31     Ratio                 from Quantity,
32     PlaneAngle            from Quantity,
33     Array1OfShortReal     from TShort,
34     TypeOfResize          from Aspect,
35     TypeOfDrawMode        from Aspect,
36     TypeOfText            from Aspect,
37     ColorMap              from Aspect,
38     TypeMap               from Aspect,
39     WidthMap              from Aspect,
40     FontMap               from Aspect,
41     MarkMap               from Aspect,
42     Window                from WNT,
43     HColorTable           from WNT,
44     HFontTable            from WNT,
45     HArray1OfInteger      from TColStd,
46     FontMapEntry          from WNT,
47
48     FontManager           from MFT,
49     HListOfMFTFonts       from WNT,
50     HArray1OfShortReal    from TShort,
51     TextManager           from WNT
52
53  raises
54  
55     DriverDefinitionError from Aspect,
56     DriverError           from Aspect
57
58  is
59
60     Create ( aWindow : Window from WNT )
61      returns mutable WDriver from WNT
62      raises  DriverDefinitionError from Aspect;
63         ---Level:   Public
64         ---Purpose: Creates Windows NT window driver associated
65         --          with the Windows NT window
66
67
68     Destroy ( me : mutable )
69     raises DriverError from Aspect is virtual;
70         ---Level: Public
71         ---Purpose: Destroy the Driver
72         ---Category: Methods to modify the class definition
73         ---C++: alias ~
74
75         SelectBuffer( me; aRetainBuffer: Integer from Standard) returns Address from Standard;
76         ---Level: Public
77         ---Purpose: Selects RetainBuffer for output
78         ---Category: Methods to manage buffers
79
80
81     BeginDraw (
82      me            : mutable;
83      aDoubleBuffer : Boolean = Standard_True;
84      aRetainBuffer : Integer = 0
85     )
86         ---Purpose: Begin graphics and drawn directly to the Window or Pixmap if
87         --<aRetainBuffer> is 0 or in the retain buffer if > 0.
88     raises DriverError from Aspect is virtual;
89         ---Trigger: Raises if the retain buffer is not open.
90         --         call BufferIsOpen() method before.
91
92     EndDraw ( me : mutable; aSynchronize : Boolean = Standard_False ) is virtual;
93         ---Level:   Public
94         ---Purpose: Called by the method Graphic2d_View::Update, this
95         --          method manages the buffer flushing and Wait after up to date
96         --          display when Synchronize is TRUE.
97         ---Category: Methods to modify the class definition
98
99     ResizeSpace ( me: mutable )
100      returns TypeOfResize from Aspect
101         ---Level:   Public
102         ---Purpose: Resizes the WorkSpace depending of the Window size
103         --          MUST be call after a Resize or Move WindowDriver Event
104         --          Returns the TypeOfResize gravity mode.
105         --  Trigger: Raises if the type of resizing is unknown.
106      raises DriverError from Aspect is virtual;
107         ---Category: Methods to modify the class definition
108
109
110         ---------------------------------------------
111         -- Category: Methods to set the attributes
112         ---------------------------------------------
113
114
115     SetHighlightColor ( me; aColorIdx : Integer from Standard )
116      returns Boolean from Standard is static;
117         ---Level:   Public
118         ---Purpose: Sets the highlight color for the drawing. Returns False
119         --          if the graphic device does not support palette mechanism.
120
121     SetDrawMode (
122      me    : mutable;
123      aMode : TypeOfDrawMode from Aspect
124     )
125      is virtual;
126         ---Level:   Public
127         ---Purpose: Change the current drawing mode of the Driver
128         --          TODM_REPLACE : the primitive is drawn with his defined color.
129         --          TODM_ERASE   : the primitive is erased from the window.
130         --          TODM_XOR     : the primitive is xored to the window.
131         --          TODM_XORLIGHT: the primitive is xored depending of the current
132         --                         highlight and background colors.
133
134     SetLineAttrib (
135      me         : mutable;
136      ColorIndex : Integer from Standard;
137      TypeIndex  : Integer from Standard;
138      WidthIndex : Integer from Standard
139     )
140         ---Level:    Public
141         ---Purpose:  Sets the line attributes.
142         --  Category: Methods to set the line attributes
143         --  Trigger:  Raises if one of the index is out of range.
144      raises DriverError from Aspect is virtual;
145
146     SetTextAttrib (
147      me         :  mutable;
148      ColorIndex : Integer from Standard;
149      FontIndex  : Integer from Standard
150     )
151         ---Level:    Public
152         ---Purpose:  Sets the text attributes.
153         --  Category: Methods to set the text attributes
154         --  Trigger:  Raises if one of the index is out of range.
155      raises DriverError from Aspect is virtual;
156
157     SetTextAttrib (
158      me           : mutable;
159      ColorIndex   : Integer    from Standard;
160      FontIndex    : Integer    from Standard;
161      aSlant       : PlaneAngle from Quantity;
162      aHScale      : Factor     from Quantity;
163      aWScale      : Factor     from Quantity;
164      isUnderlined : Boolean    from Standard = Standard_False
165     )
166         ---Level:    Public
167         ---Purpose:  Sets the Extended text attributes.
168         --  Category: Methods to set the text attributes
169         --  Trigger:  Raises if one of the index is out of range.
170      raises DriverError from Aspect is virtual;
171
172     SetPolyAttrib (
173      me           : mutable;
174      ColorIndex   : Integer from Standard;
175      TileIndex    : Integer from Standard;
176      DrawEdgeFlag : Boolean from Standard = Standard_False
177     )
178         ---Level:    Public
179         ---Purpose:  Sets the polygon attributes.
180         --  Warning:
181         -- <ColorIndex> is the background poly color index.
182         -- <TileIndex> is the background poly fill rule index.
183         -- If <DrawEdgeFlag> is TRUE the edge of the poly is drawn with the
184         --  current line attributes.
185         --  Category: Methods to set the poly attributes
186         --  Trigger:  Raises if one of the index is out of range.
187      raises DriverError from Aspect is virtual;
188
189         SetPolyAttrib (
190      me           : mutable;
191      ColorIndex   : Integer from Standard;
192      TileIndex    : Integer from Standard;
193          PolygonMode  : Integer from Standard;
194      DrawEdgeFlag : Boolean from Standard = Standard_False
195     )
196         ---Level:    Public
197         ---Purpose:  Sets the polygon attributes.
198         --  Warning:
199     --  <PolygonMode> way to fill consecutive lines
200         --  Category: Methods to set the poly attributes
201         --  Trigger:  Raises if one of the index is out of range.
202      raises DriverError from Aspect;
203
204     SetMarkerAttrib (
205      me             : mutable;
206      ColorIndex     : Integer from Standard;
207      EdgeWidthIndex : Integer from Standard;
208      FillMarker     : Boolean from Standard = Standard_False
209     )
210         ---Level:   Public
211         ---Purpose: Sets the marker attributes.
212         --  Warning:
213         -- <ColorIndex> is the edge or fill marker color index.
214         -- <EdgeWidthIndex> is the edge marker thickness index.
215         -- If <FillMarker> is TRUE the marker is filled on the first set
216         --  of consecutive drawn points.
217         --  Trigger:  Raises if one of the index is out of range.
218      raises DriverError from Aspect is virtual;
219      
220
221         -----------------------------------------
222         -- Category: Methods to manage the images
223         -----------------------------------------
224         
225     IsKnownImage ( me : mutable; anImage : Transient from Standard )
226      returns Boolean from Standard is virtual;
227         ---Level:   Public
228         ---Purpose: Returns Standard_True if the associated driver
229         --          have stored the image and Standard_False if not.
230
231     SizeOfImageFile (
232      me;
233      anImageFile    : CString     from Standard;
234      aWidth,aHeight : out Integer from Standard
235     )
236      returns Boolean from Standard is virtual;
237         ---Level:   Public
238         ---Purpose: Returns Standard_True and the Image Size in PIXEL 
239         --          if the image file exist and can be computed by the driver,
240         --          NOTE that only XWD and DIB image file type are recognized
241         --               today. 
242
243     ClearImage (
244      me        : mutable;
245      anImageId : Transient from Standard
246     )
247      is virtual;
248         ---Level:   Public
249         ---Purpose: Clears the image in <me>.
250
251     ClearImageFile (
252      me          : mutable;
253      anImageFile : CString from Standard
254     ) 
255      is virtual;
256         ---Level:   Public
257         ---Purpose: Clears the image associated with the image file.
258
259     DrawImage (
260      me        : mutable;
261      anImageId : Transient from Standard;
262      aX, aY    : ShortReal from Standard
263     )
264         ---Level:   Public
265         ---Purpose: Draws the image in <me>.
266         --          <aX>, <aY> is the center of the image.
267         --          Image center must be defined in DWU space.
268      raises DriverError from Aspect is virtual;
269         ---Trigger: If the anImageId is not found 
270
271     DrawImageFile (
272      me          : mutable;
273      anImageFile : CString   from Standard;
274      aX, aY      : ShortReal from Standard;
275      aScale      : Factor    from Quantity = 1.0
276     )
277         ---Level:   Public
278         ---Purpose: Draws the image file in <me>.
279         --          <aX>, <aY> is the center of the image.
280         --          <aScale> the scale factor which is apply on this image
281         --          Image center must be defined in DWU space.
282         --          anImageFile must be defined with the full pathname
283         --          of the form dev:\path\name.ext or $DIR\name.ext
284         --          with DIR defined in a setenv variable.
285      raises DriverError from Aspect is virtual;
286         ---Trigger: If the anImageFile is not found 
287         --          or the Image type is neither XWD nor DIB.
288
289     FillAndDrawImage (
290      me              : mutable;
291      anImageId       : Transient from Standard;
292      aX, aY          : ShortReal from Standard;
293      Width, Height   : Integer from Standard;
294      anArrayOfPixels : Address from Standard
295     )
296         ---Level:   Public
297         ---Purpose: Stores a complete image and draws it in <me>.
298         --          Image size must be defined in DWU space>
299         --  Trigger: Raises if the creation of the image failed.
300       raises DriverError from Aspect is virtual;
301
302     FillAndDrawImage (
303      me                           : mutable;
304      anImageId                    : Transient from Standard;
305      aX, aY                       : ShortReal from Standard;
306      anIndexOfLine, Width, Height : Integer from Standard;
307      anArrayOfPixels              : Address from Standard
308     )
309         ---Level:   Advanced
310         ---Purpose: Stores a line of an image and draws it in <me>.
311         --  Warning: 0<= anIndexOfLine < aHeight
312         --          anIndexOfLine = 0 must be the first call
313         --  Trigger: Raises if the creation of the image failed.
314      raises DriverError from Aspect is virtual;
315
316
317         ---------------------------------------
318         -- Category: Methods to draw primitives
319         ---------------------------------------
320
321
322     DrawPolyline (
323      me    : mutable;
324      ListX : Array1OfShortReal from TShort;
325      ListY : Array1OfShortReal from TShort
326     )
327         ---Level:   Public
328         ---Purpose: Draws the polyline depending of SetLineAttrib() attributes.
329         --  Warning: Coordinates must be defined in DWU space.
330         --  Trigger: Raises if Polyline has too many points (> 1024)
331         --          Raises if the length of <ListX> is not equal to
332         --          the length of <ListY>.
333      raises DriverError from Aspect is virtual;
334
335     DrawPolygon (
336      me    : mutable;
337      ListX : Array1OfShortReal from TShort;
338      ListY : Array1OfShortReal from TShort
339     )
340         ---Level:   Public
341         ---Purpose: Draws the polygone depending of SetPolyAttrib() attributes.
342         --  Warning: Coordinates must be defined in DWU space.
343         --  Trigger: Raises if Polygone has too many points (> 1024)
344         --          Raises if the length of <ListX> is not equal to
345         --          the length of <ListY>.
346      raises DriverError from Aspect is virtual;
347
348     DrawSegment (
349      me     : mutable;
350      X1, Y1 : ShortReal from Standard;
351      X2, Y2 : ShortReal from Standard
352     )
353         ---Level:   Public
354         ---Purpose: Draws the segment depending of SetLineAttrib() attributes.
355         --  Warning: Coordinates must be defined in DWU space.
356      raises DriverError from Aspect is virtual;
357
358     DrawText (
359      me         : mutable;
360      Text       : ExtendedString from TCollection;
361      Xpos, Ypos : ShortReal      from Standard;
362      anAngle    : ShortReal      from Standard = 0.0;
363      aType      : TypeOfText     from Aspect = Aspect_TOT_SOLID
364     )
365         ---Level:   Public
366         ---Purpose: Draws the text depending of SetTextAttrib() attributes.
367         --  Warning: Coordinates must be defined in DWU space.
368         --  Trigger: Raises if Text has too many chars (> 1024)
369      raises DriverError from Aspect is virtual;
370
371     DrawText (
372      me         : mutable;
373      Text       : CString    from Standard;
374      Xpos, Ypos : ShortReal  from Standard;
375      anAngle    : ShortReal  from Standard = 0.0;
376      aType      : TypeOfText from Aspect = Aspect_TOT_SOLID
377     )
378         ---Level  : Public
379         ---Purpose: Draws the text depending of SetTextAttrib() attributes.
380         --  Warning: Coordinates must be defined in DWU space.
381         --          Angle must be defined in RADIAN.
382         --  Trigger: Raises if Text has too many chars (> 1024)
383      raises DriverError from Aspect is virtual;
384
385     DrawPolyText (
386      me      : mutable;
387      aText   : ExtendedString from TCollection;
388      Xpos    : ShortReal      from Standard;
389      Ypos    : ShortReal      from Standard;
390      aMarge  : Ratio          from Quantity = 0.1;
391      anAngle : ShortReal      from Standard = 0.0;
392      aType   : TypeOfText     from Aspect = Aspect_TOT_SOLID
393     )
394         ---Level:   Public
395         ---Purpose: Draws an framed text depending of the
396         -- SetTextAttrib() and SetPolyAttrib() attributes.
397         --  Warning: Coordinates must be defined in DWU space.
398         --          <aMarge> defines the ratio of the space between the 
399         --          polygon borders and the bounding box of the text and 
400         --          depending of the height of the text. 
401         --  Trigger: Raises if Text has too many chars (> 1024)
402         --          or <aMarge is < 0 or > 1.
403      raises DriverError from Aspect is virtual;
404
405      DrawPolyText (
406       me      : mutable;
407       aText   : CString    from Standard;
408       Xpos    : ShortReal  from Standard;
409       Ypos    : ShortReal  from Standard;
410       aMarge  : Ratio      from Quantity = 0.1;
411       anAngle : ShortReal  from Standard = 0.0;
412       aType   : TypeOfText from Aspect = Aspect_TOT_SOLID
413      )
414         ---Level:   Public
415         ---Purpose: Draws an framed text depending of the
416         -- SetTextAttrib() and SetPolyAttrib() attributes.
417         --  Warning: Coordinates must be defined in DWU space.
418         --          <aMarge> defines the ratio of the space between the 
419         --          polygon borders and the bounding box of the text and 
420         --          depending of the height of the text. 
421         --  Trigger: Raises if Text has too many chars (> 1024)
422         --          or <aMarge is < 0 or > 1.
423       raises DriverError from Aspect is virtual;
424
425      DrawPoint ( me : mutable; X, Y : ShortReal from Standard )
426         ---Level:   Public
427         ---Purpose: Draws a 1 PIXEL point depending of the SetMarkerAttrib() 
428         --          color attribute or add a point depending of the incremental 
429         --          BeginXxxxxx() primitive used.
430       raises DriverError from Aspect is virtual;
431
432      DrawMarker (
433       me            : mutable;
434       aMarker       : Integer   from Standard;
435       Xpos, Ypos    : ShortReal from Standard;
436       Width, Height : ShortReal from Standard;
437       Angle         : ShortReal from Standard = 0.0
438      )
439         ---Level: Public
440         ---Purpose: Draws the previously defined marker depending of 
441         --          the SetMarkerAttrib() attributes.
442         --  Warning: Coordinates and sizes must be defined in DWU space.
443         --          Angle must be defined in RADIAN.
444         --          A one pixel marker is drawn when aMarker index is undefined.
445       raises DriverError from Aspect is virtual;
446
447      DrawArc (
448       me                 : mutable;
449       X, Y               : ShortReal from Standard;
450       aXradius, aYradius : ShortReal from Standard;
451       aStartAngle        : ShortReal from Standard = 0.0;
452       anOpenAngle        : ShortReal from Standard = 6.283185
453      )
454       returns Boolean
455         ---Level:   Public
456         ---Purpose: Draws an Ellipsoid arc of center <X,Y> and Radius
457         --          <aXradius,aYradius> of relative angle <anOpenAngle> from
458         --          the base angle <aStartAngle>
459         --  Warning: Returns FALSE if the hardware can't drawing this
460         --          primitive properly,application must to simulate it.
461         --  Trigger: Raises if one of <aXradius,aYradius> is <= 0.
462       raises DriverError from Aspect is virtual;
463
464      DrawPolyArc (
465       me                   : mutable;
466       X, Y                 : ShortReal from Standard;
467       anXradius, anYradius : ShortReal from Standard;
468       aStartAngle          : ShortReal from Standard = 0.0;
469       anOpenAngle          : ShortReal from Standard = 6.283185
470      )
471       returns Boolean
472         ---Level:   Public
473         ---Purpose: Draws an filled Ellipsoid arc of center <X,Y> and Radius
474         --          <anXradius,anYradius> of relative angle <anOpenAngle> from
475         --          the base angle <aStartAngle> and  depending of the
476         --          SetPolyAttrib() attributes.
477         --  Warning: Returns FALSE if the hardware can't drawing this
478         --          primitive properly,application must to simulate it.
479         --  Trigger: Raises if one of <aXradius,aYradius> is <= 0.
480       raises DriverError from Aspect is virtual;
481
482      BeginPolyline ( me : mutable; aNumber : Integer ) is virtual;
483         ---Level:   Public
484         ---Purpose: Begin a polyline primitive of <aNumber> of points.
485         --  Warning: Points must be added by the DrawPoint() method.
486
487      BeginPolygon ( me : mutable; aNumber : Integer ) is virtual;
488         ---Level:   Public
489         ---Purpose: Begin a polygon primitive of <aNumber> of points .
490         --  Warning: Points must be added by the DrawPoint() method.
491  
492      BeginSegments ( me : mutable ) is virtual;
493         ---Level:   Public
494         ---Purpose: Begin a set of segments .
495         --  Warning: Segments must be added by DrawSegment() method.
496
497      BeginArcs ( me : mutable ) is virtual;
498         ---Level:   Public
499         ---Purpose: Begin a set of circles or ellips .
500         --  Warning: Arcs must be added by the DrawArc() method.
501
502      BeginPolyArcs ( me : mutable ) is virtual;
503         ---Level:   Public
504         ---Purpose: Begin a set of polygon circles or ellips .
505         --  Warning: Arcs must be added by the DrawPolyArc() method.
506  
507      BeginMarkers ( me : mutable ) is virtual;
508         ---Level:   Public
509         ---Purpose: Begin a set of markers .
510         --  Warning: Markers must be added by the DrawMarker() method.
511  
512      BeginPoints ( me : mutable ) is virtual;
513         ---Level:   Public
514         ---Purpose: Begin a set of points .
515         --  Warning: Points must be added by the DrawPoint() method.
516
517      ClosePrimitive ( me : mutable )
518         ---Level:   Public
519         ---Purpose: Close the last Begining primitive
520         --  Trigger: Raises if no primitive have been opened by BeginXxxxxx().
521       raises DriverError from Aspect is virtual;
522
523
524         ---------------------------------------------
525         -- Category: Methods to define the attributes
526         ---------------------------------------------
527
528
529      InitializeColorMap (
530       me       : mutable;
531       Colormap : ColorMap from Aspect
532      )
533         ---Level:   Public
534         ---Purpose: Defines the color map.
535         --  Level:   Public
536         --  Trigger: Raises if the definition failed.
537       raises DriverError from Aspect is virtual protected;
538         ---Category: Methods to define the color indices.
539
540      InitializeTypeMap (
541       me      : mutable;
542       Typemap : TypeMap from Aspect
543      )
544         ---Purpose: Defines the line type map.
545         --  Level: Public
546         --  Trigger: Raises if the definition failed.
547         raises DriverError from Aspect is virtual protected;
548         ---Category: Methods to define the type of line indices.
549
550      InitializeWidthMap (
551       me       : mutable;
552       Widthmap : WidthMap from Aspect
553      )
554         ---Purpose: Defines the width line map.
555         --  Level: Public
556         --  Trigger: Raises if the definition failed.
557       raises DriverError from Aspect is virtual protected;
558         ---Category: Methods to define the width of line indices.
559
560      InitializeFontMap (
561       me      : mutable;
562       Fontmap : FontMap from Aspect
563      )
564         ---Purpose: Defines the font map.
565         --  Level: Public
566         --  Trigger: Raises if the definition failed.
567       raises DriverError from Aspect is virtual protected;
568         ---Category: Methods to define the font indices.
569
570      InitializeMarkMap (
571       me      : mutable;
572       Markmap : MarkMap from Aspect
573      )
574         ---Purpose: Defines the mark map.
575         --  Level: Public
576         --  Trigger: Raises if the definition failed.
577       raises DriverError from Aspect is virtual protected;
578         ---Category: Methods to define the marker indices.
579
580
581         -------------------------------------------------------------
582         -- Category: Methods to define or edit a buffer of primitives
583         -------------------------------------------------------------
584   InternalOpenBuffer (
585      me            : mutable;
586      aRetainBuffer : Integer;
587      aMono         : Boolean;
588      aPivotX       : ShortReal;
589      aPivotY       : ShortReal;
590      aColorIndex   : Integer;
591      aWidthIndex   : Integer;
592      aTypeIndex    : Integer;
593      aFontIndex    : Integer;
594      aDrawMode     : TypeOfDrawMode = Aspect_TODM_REPLACE
595     )
596     returns Address is private;
597
598     OpenBuffer (
599      me            : mutable;
600      aRetainBuffer : Integer;
601      aPivotX       : ShortReal = 0.0;
602      aPivotY       : ShortReal = 0.0; 
603      aWidthIndex   : Integer = 0;
604      aColorIndex   : Integer = 0;
605      aFontIndex    : Integer = 0;
606      aDrawMode     : TypeOfDrawMode = Aspect_TODM_REPLACE
607     )
608     returns Boolean is virtual;
609         ---Purpose: Allocate the retain buffer <aRetainBuffer> ,
610         -- Defines the DWU coordinates of the pivot point for all primitives 
611         --  contains inside.
612         -- Defines the buffer color and font index :
613         --  the default color is the highlight color of the colormap.
614         --  the default font is the default system font of the fontmap. 
615         -- The other attributes are fixed :
616         --  line type is Solid,
617         --  line width is 1 Pixel,
618         --  polygon fill mode is Solid,   
619         -- Returns TRUE if the buffer is allocated and enabled for drawing.
620
621     OpenColorBuffer (
622      me            : mutable;
623      aRetainBuffer : Integer;
624      aPivotX       : ShortReal = 0.0;
625      aPivotY       : ShortReal = 0.0;
626      aWidthIndex   : Integer = 0;
627      aColorIndex   : Integer = 0;
628      aFontIndex    : Integer = 0;
629      aDrawMode     : TypeOfDrawMode = Aspect_TODM_REPLACE
630     )
631     returns Boolean;
632         ---Purpose: Allocate the retain buffer <aRetainBuffer> ,
633         -- Defines the DWU coordinates of the pivot point for all primitives 
634         --  contains inside.
635         -- Defines the buffer color and font index :
636         --  the default color is the highlight color of the colormap.
637         --  the default font is the default system font of the fontmap. 
638         --  the default line type,
639         --  the default line width,
640         --  the default polygon fill mode,   
641         -- Returns TRUE if the buffer is allocated and enabled for drawing.
642
643
644     CloseBuffer (
645      me ; 
646      aRetainBuffer: Integer
647     )
648         ---Purpose: Clear & Deallocate the retain buffer <aRetainBuffer>.
649     raises DriverError from Aspect is virtual;
650         ---Trigger: Raises if the retain buffer is not opened.
651         --         call BufferIsOpen() method before.
652
653     ClearBuffer (
654      me; 
655      aRetainBuffer: Integer
656     )
657         ---Purpose: Erase & Clear ALL primitives retains in the buffer <aRetainBuffer>.
658     raises DriverError from Aspect is virtual;
659         ---Trigger: Raises if the retain buffer is not opened.
660         --         call BufferIsOpen() method before.
661
662     DrawBuffer ( me; aRetainBuffer : Integer )
663         ---Purpose: Draw ALL primitives retains in the buffer <aRetainBuffer>.
664         --  Warning: Note that the aspect of a retain buffer drawing is 
665         -- mono-colored with the current buffer Attributes and 
666         -- Depending of the DoubleBuffer state flag at the BeginDraw() buffer time,
667         -- when DB is TRUE,an XOR method is use for drawing and erasing buffers in the
668         -- same way.In this case,some color side effect can occurs depending of the 
669         -- traversal primitive colors and the supported hardware.
670         -- when DB is FALSE and the background drawing has been generated with
671         -- DB at TRUE,no color side effect occurs because the DB is used for restoring
672         -- the drawing context at EraseBuffer() time,this is more powerfull for the
673         -- drawing quality excepted for large buffers (flicking) . 
674      raises DriverError from Aspect is virtual;
675         ---Trigger: Raises if the retain buffer is not opened.
676         --         call BufferIsOpen() method before.
677
678     EraseBuffer ( me; aRetainBuffer : Integer )
679         ---Purpose: Erase ALL primitives retains in the buffer <aRetainBuffer>.
680      raises DriverError from Aspect is virtual;
681         ---Trigger: Raises if the retain buffer is not opened.
682         --         call BufferIsOpen() method before.
683
684     MoveBuffer (
685      me;
686      aRetainBuffer : Integer;
687      aPivotX       : ShortReal = 0.0;
688      aPivotY       : ShortReal = 0.0
689     ) 
690         ---Purpose: Erase , Translate and reDraw ALL primitives retains in the buffer 
691         --  <aRetainBuffer>.
692         --  <aPivotX,aPivotY> are the new DWU attached point absolute coordinates 
693         --  of the buffer pivot point.
694      raises DriverError from Aspect is virtual;
695         ---Trigger: Raises if the retain buffer is not opened
696         --         call BufferIsOpen() method before.
697
698     ScaleBuffer (
699      me;
700      aRetainBuffer : Integer; 
701      aScaleX       : Factor = 1.0;
702      aScaleY       : Factor = 1.0
703     )
704         ---Purpose: Erase , Scale the buffer from the Pivot point and reDraw ALL primitives 
705         --  retains in the buffer <aRetainBuffer>.
706         --  <aScaleX,aScaleY> are the absolute scale factors apply on the two axis.
707         --  Warning: Note that the scalling of some primitives can provided some bad 
708         --  smoothing side effect (i.e: Circles,...)
709      raises DriverError from Aspect is virtual;
710         ---Trigger: Raises if the retain buffer is not opened or 
711         --one of <aScale> factor is <= 0.
712         --         call BufferIsOpen() method before.
713
714     RotateBuffer (
715      me;
716      aRetainBuffer : Integer;
717      anAngle       : PlaneAngle = 0.0
718     )
719         ---Purpose: Erase , Rotate the buffer from the Pivot point and reDraw ALL primitives 
720         --  retains in the buffer <aRetainBuffer>.
721         --  <anAngle> is the absolute counter-clockwise rotation angle from the 
722         --  Horizontal axis.
723      raises DriverError from Aspect is virtual;
724         ---Trigger: Raises if the retain buffer is not opened.
725         --         call BufferIsOpen() method before.
726
727
728         ----------------------------
729         -- Category: Inquire methods
730         ----------------------------
731
732     WorkSpace ( me; Width, Heigth : out Length from Quantity ) is virtual;
733         ---Level:   Public
734         ---Purpose: Returns the Available WorkSpace in DWU coordinates
735
736     Convert  ( me; PV : Integer from Standard )
737      returns Length from Quantity is virtual;
738         ---Level:   Public
739         ---Purpose: Returns the DWU value depending of
740         --          the PIXEL value.
741
742     Convert ( me; DV : Length from Quantity )
743      returns Integer from Standard is virtual;
744         ---Level: Public
745         ---Purpose: Returns the PIXEL value depending of
746         --          the DWU value.
747
748     Convert (
749      me;
750      PX, PY : Integer    from Standard;
751      DX, DY : out Length from Quantity
752     )
753      is virtual;
754         ---Level: Public
755         ---Purpose: Returns the DWU position depending of
756         --          the PIXEL position .
757
758     Convert (
759      me;
760      DX, DY : Length      from Quantity;
761      PX, PY : out Integer from Standard
762     )
763      is virtual;
764         ---Level: Public
765         ---Purpose: Returns the PIXEL position depending of
766         --          the DWU position .
767
768     ProcessColorIndex( me; ColorIndex : Integer) returns Integer from Standard is private;
769
770     ProcessWidthIndex( me; WidthIndex : Integer) returns Length from Quantity is private;
771
772     ProcessTypeIndex ( me; TypeIndex  : Integer) returns Integer from Standard is private;
773
774     BufferIsOpen ( me; aRetainBuffer : Integer )
775      returns Boolean is virtual;
776         ---Purpose: Returns TRUE if the retain buffer <aRetainBuffer> is enabled 
777         --for drawing.
778
779     BufferIsEmpty ( me; aRetainBuffer : Integer )
780      returns Boolean is virtual;
781         ---Purpose: Returns TRUE if the retain buffer has not been opened or empty. 
782         ---         Returns FALSE if a lot of primitives have been stored inside
783         --          because a BeginDraw(..,<aRetainBuffer>) has been done previously.
784
785     BufferIsDrawn ( me; aRetainBuffer : Integer )
786      returns Boolean is virtual;
787         ---Purpose: Returns TRUE if the retain buffer s actually displayed at screen.
788
789     AngleOfBuffer ( me; aRetainBuffer : Integer; anAngle: out PlaneAngle )
790         ---Purpose: Returns the current buffer rotate angle from the X axis.
791      raises DriverError from Aspect is virtual;
792         ---Trigger: Raises if the retain buffer is not opened.
793         --          call BufferIsOpen() method before.
794
795     ScaleOfBuffer ( me; aRetainBuffer : Integer; aScaleX,aScaleY : out Factor )
796         ---Purpose: Returns the current buffer scale factors.
797      raises DriverError from Aspect is virtual;
798         ---Trigger: Raises if the retain buffer is not opened.
799         --         call BufferIsOpen() method before.
800
801     PositionOfBuffer (
802      me;
803      aRetainBuffer    : Integer;
804      aPivotX, aPivotY : out ShortReal
805     )
806         ---Purpose: Returns the current buffer position.
807      raises DriverError from Aspect is virtual;
808         ---Trigger: Raises if the retain buffer is not opened.
809         --         call BufferIsOpen() method before.
810
811     TextSize (
812      me; 
813      aText           : ExtendedString from TCollection;
814      aWidth, aHeight : out ShortReal  from Standard;
815      aFontIndex      : Integer        from Standard = -1
816     )
817         ---Level: Public
818         ---Purpose: Returns the TEXT size in DWU space depending
819         --          of the required FontIndex if aFontIndex is >= 0
820         --          or the current FontIndex if < 0 (default).
821         --  Trigger: Raises if font is not defined.
822      raises DriverError from Aspect is virtual;
823         ---Category: Inquire methods
824     
825     TextSize (
826       me;
827       aText                                 : ExtendedString from TCollection;
828       aWidth, aHeight, anXoffset, anYoffset : out ShortReal from Standard;
829       aFontIndex: Integer from Standard = -1)
830         ---Level: Public
831         ---Purpose: Returns the TEXT size and offsets 
832         --          in DWU space depending
833         --          of the required FontIndex if aFontIndex is >= 0
834         --          or the current FontIndex if < 0 (default).
835         --  Trigger: Raises if font is not defined.
836     raises DriverError from Aspect is virtual;
837         ---Category: Inquire methods
838  
839     TextSize ( 
840      me;  
841      aText                : CString from Standard;
842      aWidth, aHeight,
843      anXoffset, anYoffset : out ShortReal from Standard;
844      aFontIndex           : Integer       from Standard = -1
845     )
846         ---Level: Public
847         ---Purpose: Returns the TEXT size in DWU space depending
848         --          of the required FontIndex if aFontIndex is >= 0
849         --          or the current FontIndex if < 0 (default).
850         --  Trigger: Raises if font is not defined.
851      raises DriverError from Aspect is virtual;
852         ---Category: Inquire methods
853  
854     FontSize (
855      me;
856      aSlant :         out PlaneAngle from Quantity;
857      aSize,aBheight : out ShortReal  from Standard;
858      aFontIndex     : Integer from Standard = -1
859     )
860      returns CString from Standard
861         ---Level: Public
862         ---Purpose: Returns the font string,slant,size and
863         --  baseline height in DWU space depending
864         --          of the required FontIndex if aFontIndex is >= 0
865         --          or the current FontIndex if < 0 (default).
866         --  Trigger: Raises if font is not defined.
867      raises DriverError from Aspect is virtual;
868         ---Category: Inquire methods
869  
870         ColorBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
871                                                                 is redefined;
872         ---Level: Advanced
873         ---Purpose: 
874         -- Returns the min and max driver virtual color indexs.
875         ---Category: Inquire methods
876
877         LocalColorIndex(me; anIndex : Integer from Standard)
878                                 returns Integer from Standard is redefined;
879         ---Level: Advanced
880         ---Purpose: 
881         -- Returns the local colormap hardware index from a virtual driver color
882         -- index or returns -1 if the index is not defined.
883         ---Category: Inquire methods
884  
885         FontBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
886                                                                 is redefined;
887         ---Level: Advanced
888         ---Purpose: 
889         -- Returns the min and max driver virtual font indexs.
890         ---Category: Inquire methods
891
892         LocalFontIndex(me; anIndex : Integer from Standard)
893                                 returns Integer from Standard is redefined;
894         ---Level: Advanced
895         ---Purpose:
896         -- Returns the associated fontmap hardware index from a virtual driver font
897         -- index or returns -1 if the index is not defined.
898         ---Category: Inquire methods
899  
900         TypeBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
901                                                                 is redefined;
902         ---Level: Advanced
903         ---Purpose: 
904         -- Returns the min and max driver virtual type indexs.
905         ---Category: Inquire methods
906
907         LocalTypeIndex(me; anIndex : Integer from Standard)
908                                 returns Integer from Standard is redefined;
909         ---Level: Advanced
910         ---Purpose: 
911         -- Returns the associated typemap hardware index from a virtual driver type
912         -- index or returns -1 if the index is not defined.
913         ---Category: Inquire methods
914  
915         WidthBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
916                                                                 is redefined;
917         ---Level: Advanced
918         ---Purpose: 
919         -- Returns the min and max driver virtual width indexs.
920         ---Category: Inquire methods
921
922         LocalWidthIndex(me; anIndex : Integer from Standard)
923                                 returns Integer from Standard is redefined;
924         ---Level: Advanced
925         ---Purpose:
926         -- Returns the associated widthmap hardware index from a virtual driver width
927         -- index or returns -1 if the index is not defined.
928         ---Category: Inquire methods
929  
930         MarkBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
931                                                                 is redefined;
932         ---Level: Advanced
933         ---Purpose: 
934         -- Returns the min and max driver virtual marker indexs.
935         ---Category: Inquire methods
936
937   LocalMarkIndex(me; anIndex : Integer from Standard)
938                returns Integer from Standard is redefined;
939         ---Level: Advanced
940         ---Purpose:
941         -- Returns the local markmap hardware index from a virtual driver marker
942         -- index or returns -1 if the index is not defined.
943         ---Category: Inquire methods
944
945   TextManager (me: mutable)
946   returns TextManager from WNT;
947         ---C++: return const &
948         ---Category: Inquire methods
949
950   MFT_Font (me: mutable; anIndex: Integer)
951   returns FontManager from MFT;
952         ---C++: return const &
953         ---Category: Inquire methods
954
955   MFT_Size (me: mutable; anIndex: Integer)
956   returns ShortReal;
957         ---Category: Inquire methods
958
959 fields
960  
961   myAllocators,
962   myAllocator        : Address               from Standard;
963   myWNTWindow        : Window                from WNT;
964   myPixelToUnit      : Real                  from Standard;
965
966   myColors           : HColorTable           from WNT;
967   myFonts            : HFontTable            from WNT;
968   myTypeIdxs         : HArray1OfInteger      from TColStd;
969   myWidthIdxs        : HArray1OfInteger      from TColStd;
970   myMarkerIdxs       : HArray1OfInteger      from TColStd;
971
972   myMFTFonts         : HListOfMFTFonts       from WNT;
973   myMFTSizes         : HArray1OfShortReal    from TShort;
974   myTextManager      : TextManager           from WNT;
975
976 end WDriver;