0023370: MSVC++ warnings issued during compilation for 64bits, WNT_FontMapEntry.cxx
[occt.git] / src / WNT / WNT_DDriver.cdl
1 -- Created on: 1997-03-17
2 -- Created by: EugenyPLOTNIKOV
3 -- Copyright (c) 1997-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 -- Modified:    MAR-98, MAY-98 (DCB)
22 --              OCT-98 (DCB) - see CXX file for details
23
24 class DDriver from WNT inherits PlotterDriver from PlotMgt
25
26         ---Purpose: Defines the device-independent Windows NT driver.
27         --          After graphics output enhanced metafile will be created.
28         --          It is possible to play this file on device several times
29         --          by Spool () method.
30
31 uses
32   Handle                  from Aspect,
33   HColorTable             from WNT,
34   HFontTable              from WNT,
35   HArray1OfInteger        from TColStd,
36   GraphicDevice           from WNT,
37   OrientationType         from WNT,
38   TypeOfText              from Aspect,
39   ColorMap                from Aspect,
40   TypeMap                 from Aspect,
41   WidthMap                from Aspect,
42   FontMap                 from Aspect,
43   MarkMap                 from Aspect,
44   PlotMode                from Aspect,
45   PlaneAngle              from Quantity,
46   Factor                  from Quantity,
47   Ratio                   from Quantity,
48   Length                  from Quantity,
49   Array1OfShortReal       from TShort,
50   ExtendedString          from TCollection,
51   AsciiString             from TCollection,
52   HAsciiString            from TCollection,
53   HSequenceOfAsciiString  from TColStd,
54   FontManager             from MFT,
55   HListOfMFTFonts         from WNT,
56   HArray1OfShortReal      from TShort,
57   TextManager             from WNT
58
59 raises
60
61   DriverDefinitionError   from Aspect,
62   DriverError             from Aspect
63
64 is
65
66   Create (
67     aDeviceName   : CString         from Standard;
68     aFileName     : CString         from Standard;
69     anOrientation : OrientationType from WNT = WNT_OT_LANDSCAPE;
70     aScale        : Factor          from Quantity = 1.0;
71     aCopies       : Integer         from Standard = 1
72   ) returns mutable DDriver from WNT
73     raises DriverDefinitionError from Aspect;
74         ---Purpose: Constructs a device driver framework defined by the
75         -- string aDeviceName, the path specified as an
76         -- argument for OSD_Path, the type of orientation
77         -- anOrientation, the scale aScale, the number of copies
78         -- aCopies and the flag aPrintFlag.
79
80   Create (
81     aFileName : CString from Standard;
82     aCopies   : Integer from Standard = 1
83   ) returns mutable DDriver from WNT;
84         ---Purpose: 
85         -- Creates the class object. An empty path is authorized
86         -- and in this case, a temporary enhanced metafile is
87         -- created. You can delete this file by using the EndDraw function.
88         -- Warning - OSD_Path corresponds to an ASCII string.
89         -- Exceptions
90         -- Aspect_DriverDefinitionError if the driver could not be defined.
91
92   Close(me: mutable)
93   is redefined;
94   ---C++: alias ~ 
95
96   BeginDraw ( me : mutable )
97   is redefined;
98         ---Purpose: Begins a new picture of graphics in the enhanced metafile
99
100   EndDraw ( me : mutable; fSynchronize: Boolean = Standard_False )
101   is redefined;
102         ---Purpose: Flushes all graphics, closes enhanced metafile.
103
104   Spool (me        : mutable;
105     aPlotMode      : PlotMode from Aspect = Aspect_PM_FILEONLY;
106     aDeviceName    : CString from Standard = NULL;
107     anOriginalSize : Boolean from Standard = Standard_False
108   ) returns Boolean from Standard
109   raises DriverError from Aspect is redefined;
110         ---Purpose: Spools the driver onto a printer spool.
111         -- Stretches the picture so that it fits into the device
112         -- workspace if the Boolean anOriginalSize is False
113         -- and the workspace dimensions of the original
114         -- device differ from those of the current device. This
115         -- flag is ignored if aDeviceName is NULL.
116         -- Warning
117         -- If aDeviceName is NULL, then the driver should be
118         -- created with the first constructor. Otherwise, use
119         -- the second constructor to create a class object.
120         -- Exceptions
121         -- Aspect_DriverError if the driver is not correctly defined.
122
123   ---------------------------------------------
124   -- Category: Methods to define the attributes
125   ---------------------------------------------
126
127   SetLineAttrib (
128    me         : mutable;
129    ColorIndex : Integer from Standard;
130    TypeIndex  : Integer from Standard;
131    WidthIndex : Integer from Standard
132   ) raises DriverError from Aspect is redefined;
133         ---Purpose: Defines the Current Line Attibutes
134
135   SetTextAttrib (
136    me         : mutable;
137    ColorIndex : Integer from Standard;
138    FontIndex  : Integer from Standard
139   ) raises DriverError from Aspect is redefined;
140         ---Purpose: Defines the Current Text Attributes
141
142   SetTextAttrib (
143    me: mutable;
144    ColorIndex   : Integer    from Standard;
145    FontIndex    : Integer    from Standard;
146    aSlant       : PlaneAngle from Quantity;
147    aHScale      : Factor     from Quantity;
148    aWScale      : Factor     from Quantity;
149    isUnderlined : Boolean    from Standard = Standard_False
150   ) raises DriverError from Aspect is redefined;
151         ---Purpose: Defines the Current Extended Text Attributes
152
153   SetPolyAttrib (
154    me         : mutable;
155    ColorIndex : Integer from Standard;
156    TileIndex  : Integer from Standard;
157    DrawEdge   : Boolean from Standard = Standard_False
158   ) raises DriverError from Aspect is redefined;
159         ---Purpose: Sets the poly attributes
160
161   SetMarkerAttrib (
162    me         : mutable;
163    ColorIndex : Integer from Standard;
164    WidthIndex : Integer from Standard;
165    FillMarker : Boolean from Standard = Standard_False
166   ) raises DriverError from Aspect is redefined;
167         ---Purpose: Defines the Current Marker Attributes
168
169
170       ---------------------------
171       -- Category: Images methods
172       ---------------------------
173
174   IsKnownImage (
175    me      : mutable;
176    anImage : Transient from Standard
177   ) returns Boolean from Standard is redefined;
178
179   SizeOfImageFile (
180    me;
181    anImageFile     : CString from Standard;
182    aWidth, aHeight : out Integer from Standard
183   ) returns Boolean from Standard is redefined;
184
185   ClearImage (
186    me        : mutable;
187    anImageId : Transient from Standard
188   ) raises DriverError from Aspect is redefined;
189
190   ClearImageFile (
191    me          : mutable;
192    anImageFile : CString from Standard
193   ) raises DriverError from Aspect is redefined;
194
195   DrawImage (
196    me        : mutable;
197    anImageId : Transient from Standard;
198    aX, aY    : ShortReal from Standard
199   ) raises DriverError from Aspect is redefined;
200
201
202   ---------------------------------------
203   -- Category: Methods to draw primitives
204   ---------------------------------------
205   DrawImageFile (
206    me          : mutable;
207    anImageFile : CString from Standard;
208    aX, aY      : ShortReal from Standard;
209    aScale      : Factor from Quantity = 1.0
210   ) raises DriverError from Aspect is redefined;
211
212   FillAndDrawImage (
213    me              : mutable;
214    anImageId       : Transient from Standard;
215    aX, aY          : ShortReal from Standard;
216    aWidth, aHeight : Integer from Standard;
217    anArrayOfPixels : Address from Standard
218   ) raises DriverError from Aspect is redefined;
219         ---Purpose: Fills a complete Image .
220
221   FillAndDrawImage (
222    me                             : mutable; 
223    anImageId                      : Transient from Standard;
224    aX, aY                         : ShortReal from Standard;
225    anIndexOfLine, aWidth, aHeight : Integer from Standard;
226    anArrayOfPixels                : Address from Standard
227   ) raises DriverError from Aspect is redefined;
228         ---Purpose: Fills a line of the Image .
229         --  Warning: 0 <= anIndexOfLine < aHeight
230         --              anIndexOfLine = 0 must be the first call
231
232   PlotPolyline (me : mutable;
233       xArray : Address from Standard;
234       yArray : Address from Standard;
235       nPts   : Address from Standard;
236       nParts : Integer from Standard
237   ) returns Boolean from Standard
238   is redefined protected;
239         ---Purpose: Draws a polyline depending of the SetLineAttrib() attributes.
240
241   PlotPolygon (me : mutable;
242       xArray : Address from Standard;
243       yArray : Address from Standard;
244       nPts   : Address from Standard;
245       nParts : Integer from Standard
246   ) returns Boolean from Standard
247   is redefined protected;
248         ---Purpose: Draws a polygon depending of the SetPolyAttrib() attributes. 
249
250   PlotSegment (
251    me     : mutable;
252    X1, Y1 : ShortReal from Standard;
253    X2, Y2 : ShortReal from Standard
254   ) returns Boolean from Standard
255   is redefined protected;
256         ---Purpose: Draws a segment depending of the SetLineAttrib() attributes.
257
258   PlotText (
259    me      : mutable;
260    aText   : ExtendedString from TCollection;
261    Xpos    : ShortReal      from Standard;
262    Ypos    : ShortReal      from Standard;
263    anAngle : ShortReal      from Standard = 0.0;
264    aType   : TypeOfText     from Aspect = Aspect_TOT_SOLID
265   ) returns Boolean from Standard
266   is redefined protected;
267         ---Purpose: Draws a text depending of the SetTextAttrib() attributes.
268         --  Warning: Coordinates must be defined in DWU space.
269
270   PlotText (
271    me      : mutable;
272    aText   : CString        from Standard;
273    Xpos    : ShortReal      from Standard;
274    Ypos    : ShortReal      from Standard;
275    anAngle : ShortReal      from Standard = 0.0;
276    aType   : TypeOfText     from Aspect = Aspect_TOT_SOLID
277   ) returns Boolean from Standard
278   is redefined protected;
279         ---Purpose: Draws a text depending of the SetTextAttrib() attributes.
280         --  Warning: Coordinates must be defined in DWU space.
281
282   PlotPolyText (
283    me : mutable;
284    aText   : ExtendedString from TCollection;
285    Xpos    : ShortReal      from Standard;
286    Ypos    : ShortReal      from Standard;
287    aMarge  : Ratio          from Quantity = 0.1;
288    anAngle : ShortReal      from Standard = 0.0;
289    aType   : TypeOfText     from Aspect = Aspect_TOT_SOLID
290   ) returns Boolean from Standard
291   is redefined protected;
292         ---Purpose: Draws an framed text depending of the 
293         -- SetTextAttrib() and SetPolyAttrib() attributes.
294         --  Warning: Coordinates must be defined in DWU space.
295         --          <aMarge> defines the ratio of the space between the 
296         --          polygon borders and the bounding box of the text and 
297         --          depending of the height of the text.
298
299   PlotPolyText (
300    me : mutable;
301    aText   : CString        from Standard;
302    Xpos    : ShortReal      from Standard;
303    Ypos    : ShortReal      from Standard;
304    aMarge  : Ratio          from Quantity = 0.1;
305    anAngle : ShortReal      from Standard = 0.0;
306    aType   : TypeOfText     from Aspect = Aspect_TOT_SOLID
307   ) returns Boolean from Standard
308   is redefined protected;
309         ---Purpose: Draws an framed text depending of the 
310         -- SetTextAttrib() and SetPolyAttrib() attributes.
311         --  Warning: Coordinates must be defined in DWU space.
312         --          <aMarge> defines the ratio of the space between the 
313         --          polygon borders and the bounding box of the text and 
314         --          depending of the height of the text.
315
316   PlotPoint ( me : mutable; X, Y : ShortReal from Standard )
317   returns Boolean from Standard
318   is redefined protected;
319         ---Purpose: Draws a 1 PIXEL point depending of the SetMarkerAttrib() 
320         --          color attribute or add a point depending of the incremental BeginXxxxxx() 
321         --          primitive used.
322
323   PlotMarker (
324    me      : mutable;
325    aMarker : Integer   from Standard;
326    Xpos    : ShortReal from Standard;
327    Ypos    : ShortReal from Standard;
328    Width   : ShortReal from Standard;
329    Height  : ShortReal from Standard;
330    Angle   : ShortReal from Standard = 0.0
331   ) returns Boolean from Standard
332   is redefined protected;
333         ---Purpose: Draws the prevously defined marker <aMarker> 
334         --          depending of the SetMarkerAttrib() attributes.
335         --  Warning: Coordinates and sizes must be defined in DWU space.
336         --          Angle must be defined in RADIAN.
337         --          A one pixel marker is drawn when aMarker index is undefined
338
339   PlotArc (
340    me                   : mutable;
341    X, Y                 : ShortReal from Standard;
342    anXradius, anYradius : ShortReal from Standard;
343    aStartAngle          : ShortReal from Standard = 0.0;
344    anOpenAngle          : ShortReal from Standard = 6.283185
345   ) returns Boolean from Standard
346   is redefined protected;
347         ---Purpose: Draws an Ellipsoid arc of center <X,Y> and Radius
348         --          <anXradius,anYradius> of relative angle <anOpenAngle> from 
349         --          the base angle <aStartAngle> and depending of the SetLineAttrib() attributes
350               
351   PlotPolyArc (
352    me                   : mutable;
353    X, Y                 : ShortReal from Standard;
354    anXradius, anYradius : ShortReal from Standard;
355    aStartAngle          : ShortReal from Standard = 0.0;
356    anOpenAngle          : ShortReal from Standard = 6.283185
357   ) returns Boolean from Standard
358   is redefined protected;
359         ---Purpose: Draws an filled Ellipsoid arc of center <X,Y> and Radius
360         --          <anXradius,anYradius> of relative angle <anOpenAngle> from 
361         --          the base angle <aStartAngle> and depending of the SetPolyAttrib() attributes.
362               
363   BeginPolyline ( me : mutable; aNumber : Integer ) is static;
364         ---Purpose: Begin an incremental polyline primitive of <aNumber> of points
365         --  Warning: Points must be added by the the DrawPoint() method.
366
367   BeginPolygon ( me : mutable; aNumber : Integer )
368   is redefined;
369         ---Purpose: Begin an incremental polygon primitive of <aNumber> of points
370         --  Warning: Points must be added by the the DrawPoint() method.
371
372   BeginSegments ( me : mutable )
373   is redefined;
374         ---Purpose: Begin a set of segments .
375         --  Warning: Segments must be added by the DrawSegment() method
376
377   BeginArcs ( me : mutable )
378   is redefined;
379         ---Purpose: Begin a set of circles or ellips .
380         --  Warning: Arcs must be added by the DrawArc() methods
381
382   BeginPolyArcs ( me : mutable )
383   is redefined;
384         ---Purpose: Begin a set of polygon circles or ellips
385         --  Warning: Arcs must be added by the DrawPolyArc() methods
386
387   BeginMarkers ( me : mutable )
388   is redefined;
389         ---Level:   Public
390         ---Purpose: Begin a set of markers .
391         --  Warning: Markers must be added by the DrawMarker() method
392
393   BeginPoints ( me : mutable )
394   is redefined;
395         ---Level:   Public
396         ---Purpose: Begin a set of points .
397         --  Warning: Points must be added by the DrawPoint() method
398
399   ClosePrimitive ( me : mutable ) raises DriverError from Aspect is static;
400         ---Purpose: Close the last Begining primitive
401
402   ---------------------------------------------
403   -- Category: Methods to define the attributes
404   ---------------------------------------------
405   InitializeColorMap(me: mutable; aColorMap: ColorMap from Aspect) 
406   raises DriverError from Aspect is redefined protected;
407         ---Category: Methods to define the ColorIndexs
408
409   InitializeTypeMap(me: mutable; aTypeMap: TypeMap from Aspect)
410   raises DriverError from Aspect is redefined protected;
411         ---Category: Methods to define the TypeIndexs
412
413   InitializeWidthMap(me: mutable; aWidthMap: WidthMap from Aspect)
414   raises DriverError from Aspect is redefined protected;
415         ---Category: Methods to define the WidthIndexs
416
417   InitializeFontMap(me: mutable; aFontMap: FontMap from Aspect)
418   raises DriverError from Aspect is redefined protected;
419         ---Category: Methods to define the FontIndexs
420
421   InitializeMarkMap(me: mutable; aFontMap: MarkMap from Aspect)
422   raises DriverError from Aspect is redefined protected;
423         ---Category: Methods to define the MarkIndexs
424
425
426   ----------------------------
427   -- Category: Inquire methods
428   ----------------------------
429
430
431   WorkSpace ( me ; Width,Heigth : out Length from Quantity ) is static;
432         ---Purpose: Returns the Available WorkSpace in DWU coordinates
433
434   Convert ( me ; PV : Integer from Standard ) returns Length from Quantity is static;
435         ---Purpose: Returns the DWU value depending of
436         --          the PIXEL value.
437
438   Convert ( me ; DV : Length from Quantity ) returns Integer from Standard is static;
439         ---Purpose: Returns the PIXEL value depending of the DWU value.
440
441   Convert (
442    me;
443    PX, PY : Integer    from Standard;
444    DX, DY : out Length from Quantity
445   ) is static;
446         ---Purpose: Returns the DWU position depending of the PIXEL position .
447
448   Convert (
449    me; 
450    DX, DY : Length      from Quantity;
451    PX, PY : out Integer from Standard
452   ) is static;
453         ---Purpose: Returns the PIXEL position depending of the DWU position
454
455   TextSize (
456    me; 
457    aText           : ExtendedString from TCollection;
458    aWidth, aHeight : out ShortReal  from Standard;
459    aFontIndex      : Integer        from Standard = -1
460   ) is static;
461         ---Purpose: Returns the TEXT size in DWU space depending
462         --          of the required FontIndex if aFontIndex is >= 0
463         --          or the current FontIndex if < 0 (default).
464
465   TextSize (
466    me;
467    aText                                 : ExtendedString from TCollection;
468    aWidth, aHeight, anXoffset, anYoffset : out ShortReal from Standard;
469    aFontIndex: Integer from Standard = -1
470   ) is static;
471         ---Purpose: Returns the TEXT size and offsets 
472         --          in DWU space depending
473         --          of the required FontIndex if aFontIndex is >= 0
474         --          or the current FontIndex if < 0 (default).
475
476   TextSize ( 
477    me;  
478    aText                                 : CString from Standard;
479    aWidth, aHeight, anXoffset, anYoffset : out ShortReal from Standard;
480    aFontIndex                            : Integer        from Standard = -1
481   ) is static;
482         ---Purpose: Returns the TEXT size in DWU space depending
483         --          of the required FontIndex if aFontIndex is >= 0
484         --          or the current FontIndex if < 0 (default).
485
486   HDC ( me ) returns Handle from Aspect is static;
487         ---Purpose: Returns device context handle
488
489   ClientRect ( me; aWidth, aHeigth : out Integer from Standard ) is static;
490         ---Purpose: Returns dimensions of the device
491
492   GraphicDevice ( me ) returns GraphicDevice from WNT is static;
493         ---Purpose: Returns graphic device
494
495   DeviceList ( myclass )
496    returns HSequenceOfAsciiString from TColStd
497    raises  DriverError            from Aspect;
498         ---Purpose: Returns list of available graphic devices.
499         --          First element is default device
500
501   DeviceSize (myclass;
502               aDevice        :     AsciiString from TCollection;
503               aWidth, aHeight: out Real        from Standard);
504         ---Purpose: Returns size of a specified device.
505
506   EMFDim (
507     me      : mutable;
508     aWidth  : out Integer from Standard;
509     aHeight : out Integer from Standard;
510     aSwap   : out Integer from Standard
511   ) returns Real from Standard;
512         ---Purpose: returns dimensions, in .01 millimeter units,
513         --           of a rectangle that surrounds the picture stored
514         --           in the metafile ( parameters <aWidth> & <aHeight> ).
515         --           <aSwap> value idicates whether rotate operation
516         --           (portrait/landscape) was performed or not. Valid
517         --           values are: <0> - no rotation
518         --                       <1> - do rotation
519         --                       <2> - could not determine
520         --           Returns ratio between <aWidth> & <aHeight>.
521         --  Warning:  returns <-1> in case of error
522
523   ProcessColorIndex ( me; ColorIndex     : Integer from Standard )
524     returns Integer from Standard is private;
525
526   ProcessWidthIndex ( me; WidthIndex     : Integer from Standard )
527     returns Length  from Quantity is private;
528
529   ProcessTypeIndex  ( me; TypeIndex      : Integer from Standard )
530     returns Integer from Standard is private;
531
532   DoSpool           ( me;
533     anOriginalSize : Boolean from Standard;
534     aPlotMode      : PlotMode from Aspect = Aspect_PM_NPLOTTER
535   ) returns Boolean from Standard is private;
536         ---Purpose: Internal methods
537
538   TextManager (me: mutable)
539   returns TextManager from WNT;
540         ---C++: return const &
541         ---Category: Inquire methods
542
543   MFT_Font (me: mutable; anIndex: Integer)
544   returns FontManager from MFT;
545         ---C++: return const &
546         ---Category: Inquire methods
547
548   MFT_Size (me: mutable; anIndex: Integer)
549   returns ShortReal;
550         ---Category: Inquire methods
551
552 fields
553   myRect             : Address               from Standard;
554   myPrnName          : AsciiString           from TCollection; -- Name of .PRN file
555   myEmfName          : AsciiString           from TCollection; -- Name of .EMF file
556   myAllocators,
557   myAllocator        : Address               from Standard;
558   myPixelToUnit      : Real                  from Standard;
559   myImageName        : HAsciiString          from TCollection;
560   myDevice           : GraphicDevice         from WNT;
561   myHDC              : Handle                from Aspect;
562   myHDCMeta          : Handle                from Aspect;
563   myHMetaFile        : Handle                from Aspect;
564   myImage            : Handle                from Aspect;
565   myOrientation      : OrientationType       from WNT;
566   myScale            : Factor                from Quantity;
567   myFlags            : Integer               from Standard;
568   myNCopies          : Integer               from Standard;
569
570   myColors           : HColorTable           from WNT;
571   myFonts            : HFontTable            from WNT;
572   myTypeIdxs         : HArray1OfInteger      from TColStd;
573   myWidthIdxs        : HArray1OfInteger      from TColStd;
574   myMarkerIdxs       : HArray1OfInteger      from TColStd;
575
576   myMFTFonts         : HListOfMFTFonts       from WNT;
577   myMFTSizes         : HArray1OfShortReal    from TShort;
578   myNTextManager     : TextManager           from WNT;
579
580 end DDriver from WNT;