1 -- Created on: 1993-07-01
2 -- Created by: Gerard GRAS
3 -- Copyright (c) 1993-1999 Matra Datavision
4 -- Copyright (c) 1999-2012 OPEN CASCADE SAS
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.
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.
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.
23 class Driver from Xw inherits WindowDriver from Aspect
27 ---Purpose: This class defines a X window Driver.
28 -- Warning: A Driver is associated with one window and lets you
29 -- draw any primitives with any attributes you choose
30 -- inside that window. All Values and coordinates are
31 -- defined in Device Window Unit (DWU) space, which is
32 -- the Normalized Floating Pixel space limited by the size
33 -- of the window. The Maps Driver must be initialized
34 -- with Aspect_Driver::SetXXXXMap(aMap) where XXXX
35 -- may correspond to Color, Mark, Type, Width and Font.
41 ExtendedString from TCollection,
45 PlaneAngle from Quantity,
46 Array1OfShortReal from TShort,
47 TypeOfResize from Aspect,
48 TypeOfDrawMode from Aspect,
49 TypeOfText from Aspect,
50 TypeOfPrimitive from Aspect,
58 HArray1OfInteger from TColStd,
59 HListOfMFTFonts from Xw,
60 HArray1OfShortReal from TShort,
65 DriverDefinitionError from Aspect,
66 DriverError from Aspect
70 -------------------------
71 -- Category: Constructors
72 -------------------------
74 Create (aWindow: Window from Xw)
75 returns mutable Driver from Xw
76 raises DriverDefinitionError from Aspect;
78 ---Purpose: Creates the X Window Driver associated to the X window
81 -- - DrawMode : TODM_REPLACE
83 ---------------------------------------------------
84 -- Category: Methods to modify the class definition
85 ---------------------------------------------------
87 BeginDraw (me: mutable;
88 DoubleBuffer: Boolean = Standard_True;
89 aRetainBuffer: Integer = 0)
91 ---Purpose: Begin graphics and drawn directly to the Window or Pixmap if
92 --<aRetainBuffer> is 0 or in the retain buffer if > 0.
93 raises DriverError from Aspect is virtual;
94 ---Trigger: Raises if the retain buffer is not open.
95 -- call BufferIsOpen() method before.
96 ---Category: Methods to modify the class definition
98 EndDraw (me: mutable; Synchronize: Boolean = Standard_False) is virtual;
100 ---Purpose: Called by the method Graphic2d_View::Update, this
101 -- method manages the buffer flushing and Wait after up to date
102 -- display when Synchronize is TRUE.
103 ---Category: Methods to modify the class definition
106 ResizeSpace (me : mutable)
107 returns TypeOfResize from Aspect
109 ---Purpose: Resizes the WorkSpace depending of the Window size
110 -- MUST be call after a Resize or Move WindowDriver Event
111 -- Returns the TypeOfResize gravity mode .
112 -- Trigger: Raises if the type of resizing is unknown.
113 raises DriverError from Aspect is virtual;
114 ---Category: Methods to modify the class definition
116 ---------------------------------------------
117 -- Category: Methods to define the attributes
118 ---------------------------------------------
120 InitializeColorMap (me: mutable;
121 Colormap: ColorMap from Aspect)
123 ---Purpose: Defines the color map.
125 -- Trigger: Raises if the definition failed.
126 raises DriverError from Aspect is virtual protected;
127 ---Category: Methods to define the color indices.
129 InitializeTypeMap (me: mutable;
130 Typemap: TypeMap from Aspect)
131 ---Purpose: Defines the line type map.
133 -- Trigger: Raises if the definition failed.
134 raises DriverError from Aspect is virtual protected;
135 ---Category: Methods to define the type of line indices.
137 InitializeWidthMap (me: mutable;
138 Widthmap: WidthMap from Aspect)
139 ---Purpose: Defines the width line map.
141 -- Trigger: Raises if the definition failed.
142 raises DriverError from Aspect is virtual protected;
143 ---Category: Methods to define the width of line indices.
145 InitializeFontMap (me: mutable;
146 Fontmap: FontMap from Aspect)
147 ---Purpose: Defines the font map.
149 -- Trigger: Raises if the definition failed.
150 raises DriverError from Aspect is virtual protected;
151 ---Category: Methods to define the font indices.
153 InitializeMarkMap (me: mutable;
154 Markmap: MarkMap from Aspect)
155 ---Purpose: Defines the mark map.
157 -- Trigger: Raises if the definition failed.
158 raises DriverError from Aspect is virtual protected;
159 ---Category: Methods to define the marker indices.
161 ---------------------------------------------
162 -- Category: Methods to set the attributes
163 ---------------------------------------------
165 SetDrawMode (me:mutable; aMode: TypeOfDrawMode from Aspect) is virtual;
167 ---Purpose: Defines the draw mode for all primitives drawing.
174 SetLineAttrib (me: mutable;
175 ColorIndex: Integer from Standard;
176 TypeIndex: Integer from Standard;
177 WidthIndex: Integer from Standard)
179 ---Purpose: Sets the line attributes.
180 -- Category: Methods to set the line attributes
181 -- Trigger: Raises if one of the index is out of range.
182 raises DriverError from Aspect is virtual;
184 SetTextAttrib (me: mutable;
185 ColorIndex: Integer from Standard;
186 FontIndex: Integer from Standard)
188 ---Purpose: Sets the text attributes.
189 -- Category: Methods to set the text attributes
190 -- Trigger: Raises if one of the index is out of range.
191 raises DriverError from Aspect is virtual;
193 SetTextAttrib (me: mutable;
194 ColorIndex: Integer from Standard;
195 FontIndex: Integer from Standard;
196 aSlant: PlaneAngle from Quantity;
197 aHScale: Factor from Quantity;
198 aWScale: Factor from Quantity;
199 isUnderlined: Boolean from Standard = Standard_False)
201 ---Purpose: Sets the Extended text attributes.
202 -- Category: Methods to set the text attributes
203 -- Trigger: Raises if one of the index is out of range.
204 raises DriverError from Aspect is virtual;
206 SetPolyAttrib (me: mutable;
207 ColorIndex: Integer from Standard;
208 TileIndex: Integer from Standard;
209 DrawEdgeFlag: Boolean from Standard = Standard_False)
211 ---Purpose: Sets the polygon attributes.
213 -- <ColorIndex> is the background poly color index.
214 -- <TileIndex> is the background poly fill rule index.
215 -- If <DrawEdgeFlag> is TRUE the edge of the poly is drawn with the
216 -- current line attributes.
217 -- Category: Methods to set the poly attributes
218 -- Trigger: Raises if one of the index is out of range.
219 raises DriverError from Aspect is virtual;
221 SetMarkerAttrib (me: mutable;
222 ColorIndex: Integer from Standard;
223 EdgeWidthIndex: Integer from Standard;
224 FillMarker: Boolean from Standard = Standard_False)
226 ---Purpose: Sets the marker attributes.
228 -- <ColorIndex> is the edge or fill marker color index.
229 -- <EdgeWidthIndex> is the edge marker thickness index.
230 -- If <FillMarker> is TRUE the marker is filled on the first set
231 -- of consecutive drawn points.
232 -- Category: Methods to set the marker attributes
233 -- Trigger: Raises if one of the index is out of range.
234 raises DriverError from Aspect is virtual;
236 -----------------------------------------
237 -- Category: Methods to manage the images
238 -----------------------------------------
240 IsKnownImage (me: mutable; anImage: Transient from Standard)
241 returns Boolean from Standard is virtual;
243 ---Purpose: Returns Standard_True if the associated driver
244 -- have stored the image and Standard_False if not.
245 ---Category: Methods to manage the images
247 SizeOfImageFile (me; anImageFile: CString from Standard;
248 aWidth,aHeight: out Integer from Standard)
249 returns Boolean from Standard is virtual;
251 ---Purpose: Returns Standard_True and the Image Size in PIXEL
252 -- if the image file exist and can be computed by the driver,
253 -- NOTE that only XWD image file type are recognized today.
254 ---Category: Methods to manage the images
256 ClearImage (me: mutable; anImageId: Transient from Standard) is virtual;
258 ---Purpose: Clears the image in <me>.
259 ---Category: Methods to manage the images
261 ClearImageFile (me: mutable; anImageFile: CString from Standard)
264 ---Purpose: Clears the image associated with the image file .
265 ---Category: Methods to manage the images
267 DrawImage (me: mutable; anImageId: Transient from Standard;
268 aX, aY: ShortReal from Standard)
270 ---Purpose: Draws the image in <me>.
271 -- <aX>, <aY> is the center of the image.
272 -- Image center must be defined in DWU space.
273 raises DriverError from Aspect is virtual;
274 ---Trigger: If the anImageId is not found
275 ---Category: Methods to manage the images
277 DrawImageFile (me: mutable; anImageFile: CString from Standard;
278 aX, aY: ShortReal from Standard;
279 aScale: Factor from Quantity = 1.0)
281 ---Purpose: Draws the image file in <me>.
282 -- <aX>, <aY> is the center of the image.
283 -- <aScale> the scale factor which is apply on this image
284 -- Image center must be defined in DWU space.
285 -- anImageFile must be defined with the full pathname
286 -- of the form /..../xxxxx.ext or $DIR/xxxxxx.ext
287 -- with DIR defined in a setenv variable.
288 -- xxxxxx the image file name.
289 -- ext the image file extension.
290 raises DriverError from Aspect is virtual;
291 ---Trigger: If the anImageFile is not found
292 -- or the Image type is not an XWD.
293 ---Category: Methods to manage the images
295 FillAndDrawImage (me: mutable; anImageId: Transient from Standard;
296 aX, aY: ShortReal from Standard;
297 Width, Height: Integer from Standard;
298 anArrayOfPixels: Address from Standard)
300 ---Purpose: Stores a complete image and draws it in <me>.
301 -- Image size must be defined in DWU space>
302 -- Category: Methods to manage the images
303 -- Trigger: Raises if the creation of the image failed.
304 raises DriverError from Aspect is virtual;
306 FillAndDrawImage (me: mutable; anImageId: Transient from Standard;
307 aX, aY: ShortReal from Standard;
308 anIndexOfLine, Width, Height: Integer from Standard;
309 anArrayOfPixels: Address from Standard)
311 ---Purpose: Stores a line of an image and draws it in <me>.
312 -- Warning: 0<= anIndexOfLine < aHeight
313 -- anIndexOfLine = 0 must be the first call
314 -- Category: Methods to manage the images
315 -- Trigger: Raises if the creation of the image failed.
316 raises DriverError from Aspect is virtual;
318 ---------------------------------------
319 -- Category: Methods to draw primitives
320 ---------------------------------------
322 DrawPolyline (me : mutable;
323 ListX: Array1OfShortReal from TShort;
324 ListY: Array1OfShortReal from TShort)
326 ---Purpose: Draws the polyline depending of SetLineAttrib() attributes.
327 -- Warning: Coordinates must be defined in DWU space.
328 -- Trigger: Raises if Polyline has too many points (> 1024)
329 -- Raises if the length of <ListX> is not equal to
330 -- the length of <ListY>.
331 raises DriverError from Aspect is virtual;
332 ---Category: Methods to draw primitives
334 DrawPolygon (me : mutable;
335 ListX: Array1OfShortReal from TShort;
336 ListY: Array1OfShortReal from TShort)
338 ---Purpose: Draws the polygone depending of SetPolyAttrib() attributes.
339 -- Warning: Coordinates must be defined in DWU space.
340 -- Trigger: Raises if Polygone has too many points (> 1024)
341 -- Raises if the length of <ListX> is not equal to
342 -- the length of <ListY>.
343 raises DriverError from Aspect is virtual;
344 ---Category: Methods to draw primitives
346 DrawSegment (me : mutable;
347 X1, Y1: ShortReal from Standard;
348 X2, Y2: ShortReal from Standard)
350 ---Purpose: Draws the segment depending of SetLineAttrib() attributes.
351 -- Warning: Coordinates must be defined in DWU space.
352 raises DriverError from Aspect is virtual;
353 ---Category: Methods to draw primitives
355 DrawText (me : mutable;
356 Text: ExtendedString from TCollection;
357 Xpos, Ypos: ShortReal from Standard;
358 anAngle: ShortReal from Standard = 0.0;
359 aType: TypeOfText from Aspect = Aspect_TOT_SOLID)
361 ---Purpose: Draws the text depending of SetTextAttrib() attributes.
362 -- Category: Methods to draw primitives
363 -- Warning: Coordinates must be defined in DWU space.
364 -- Trigger: Raises if Text has too many chars (> 1024)
365 raises DriverError from Aspect is virtual;
367 DrawText (me : mutable;
368 Text: CString from Standard;
369 Xpos, Ypos: ShortReal from Standard;
370 anAngle: ShortReal from Standard = 0.0;
371 aType: TypeOfText from Aspect = Aspect_TOT_SOLID)
373 ---Purpose: Draws the text depending of SetTextAttrib() attributes.
374 -- Category: Methods to draw primitives
375 -- Warning: Coordinates must be defined in DWU space.
376 -- Angle must be defined in RADIAN.
377 -- Trigger: Raises if Text has too many chars (> 1024)
378 raises DriverError from Aspect is virtual;
380 DrawPolyText (me : mutable;
381 aText: ExtendedString from TCollection;
382 Xpos: ShortReal from Standard;
383 Ypos: ShortReal from Standard;
384 aMarge: Ratio from Quantity = 0.1;
385 anAngle: ShortReal from Standard = 0.0;
386 aType: TypeOfText from Aspect = Aspect_TOT_SOLID)
388 ---Purpose: Draws an framed text depending of the
389 -- SetTextAttrib() and SetPolyAttrib() attributes.
390 -- Warning: Coordinates must be defined in DWU space.
391 -- <aMarge> defines the ratio of the space between the
392 -- polygon borders and the bounding box of the text and
393 -- depending of the height of the text.
394 raises DriverError from Aspect is virtual;
395 ---Trigger: Raises if Text has too many chars (> 1024)
396 -- or <aMarge is < 0 or > 1.
397 ---Category: Methods to draw primitives
399 DrawPolyText (me : mutable;
400 aText: CString from Standard;
401 Xpos: ShortReal from Standard;
402 Ypos: ShortReal from Standard;
403 aMarge: Ratio from Quantity = 0.1;
404 anAngle: ShortReal from Standard = 0.0;
405 aType: TypeOfText from Aspect = Aspect_TOT_SOLID)
407 ---Purpose: Draws an framed text depending of the
408 -- SetTextAttrib() and SetPolyAttrib() attributes.
409 -- Warning: Coordinates must be defined in DWU space.
410 -- <aMarge> defines the ratio of the space between the
411 -- polygon borders and the bounding box of the text and
412 -- depending of the height of the text.
413 raises DriverError from Aspect is virtual;
414 ---Trigger: Raises if Text has too many chars (> 1024)
415 -- or <aMarge is < 0 or > 1.
416 ---Category: Methods to draw primitives
418 DrawPoint (me : mutable; X, Y: ShortReal from Standard)
420 ---Purpose: Draws a 1 PIXEL point depending of the SetMarkerAttrib()
421 --color attribute or add a point depending of the incremental
422 --BeginXxxxxx() primitive used.
423 raises DriverError from Aspect is virtual;
424 ---Category: Methods to draw primitives
426 DrawMarker (me : mutable;
427 aMarker: Integer from Standard;
428 Xpos, Ypos: ShortReal from Standard;
429 Width,Height: ShortReal from Standard;
430 Angle: ShortReal from Standard = 0.0)
432 ---Purpose: Draws the previously defined marker depending of
433 -- the SetMarkerAttrib() attributes.
434 -- Warning: Coordinates and sizes must be defined in DWU space.
435 -- Angle must be defined in RADIAN.
436 -- A one pixel marker is drawn when aMarker index is undefined.
437 raises DriverError from Aspect is virtual;
438 ---Category: Methods to draw primitives
440 DrawArc (me : mutable; X,Y : ShortReal from Standard;
441 aXradius,aYradius : ShortReal from Standard;
442 aStartAngle: ShortReal from Standard = 0.0;
443 anOpenAngle: ShortReal from Standard = 6.283185)
446 ---Purpose: Draws an Ellipsoid arc of center <X,Y> and Radius
447 -- <aXradius,aYradius> of relative angle <anOpenAngle> from
448 -- the base angle <aStartAngle>
449 -- Warning: Returns FALSE if the hardware can't drawing this
450 -- primitive properly,application must to simulate it.
451 raises DriverError from Aspect is virtual;
452 ---Trigger: Raises if one of <aXradius,aYradius> is <= 0.
454 DrawPolyArc (me : mutable; X,Y : ShortReal from Standard;
455 anXradius,anYradius : ShortReal from Standard;
456 aStartAngle: ShortReal from Standard = 0.0;
457 anOpenAngle: ShortReal from Standard = 6.283185)
460 ---Purpose: Draws an filled Ellipsoid arc of center <X,Y> and Radius
461 -- <anXradius,anYradius> of relative angle <anOpenAngle> from
462 -- the base angle <aStartAngle> and depending of the SetPolyAttrib()
464 -- Warning: Returns FALSE if the hardware can't drawing this
465 -- primitive properly,application must to simulate it.
466 raises DriverError from Aspect is virtual;
467 ---Trigger: Raises if one of <aXradius,aYradius> is <= 0.
469 BeginPolyline (me : mutable; aNumber : Integer) is virtual;
471 ---Purpose: Begin a polyline primitive of <aNumber> of points .
472 -- Warning: Points must be added by the DrawPoint() method.
474 BeginPolygon (me : mutable; aNumber : Integer) is virtual;
476 ---Purpose: Begin a polygon primitive of <aNumber> of points .
477 -- Warning: Points must be added by the DrawPoint() method.
479 BeginSegments (me : mutable) is virtual;
481 ---Purpose: Begin a set of segments .
482 -- Warning: Segments must be added by DrawSegment() method.
484 BeginArcs (me : mutable) is virtual;
486 ---Purpose: Begin a set of circles or ellips .
487 -- Warning: Arcs must be added by the DrawArc() method.
489 BeginPolyArcs (me : mutable) is virtual;
491 ---Purpose: Begin a set of polygon circles or ellips .
492 -- Warning: Arcs must be added by the DrawPolyArc() method.
494 BeginMarkers (me : mutable) is virtual;
496 ---Purpose: Begin a set of markers .
497 -- Warning: Markers must be added by the DrawMarker() method.
499 BeginPoints (me : mutable) is virtual;
501 ---Purpose: Begin a set of points .
502 -- Warning: Points must be added by the DrawPoint() method.
504 ClosePrimitive (me : mutable)
506 ---Purpose: Close the last Begining primitive
507 raises DriverError from Aspect is virtual;
508 ---Trigger: Raises if no primitive have been opened by BeginXxxxxx().
510 ---------------------------------------
511 -- Category: Methods to Manage buffers
512 ---------------------------------------
514 OpenBuffer (me : mutable; aRetainBuffer: Integer;
515 aPivotX: ShortReal = 0.0;
516 aPivotY: ShortReal = 0.0;
517 aWidthIndex: Integer = 0;
518 aColorIndex: Integer = 0;
519 aFontIndex: Integer = 0;
520 aDrawMode: TypeOfDrawMode = Aspect_TODM_REPLACE)
521 returns Boolean is virtual;
522 ---Purpose: Allocate the retain buffer <aRetainBuffer> ,
523 -- Defines the DWU coordinates of the pivot point for all primitives
525 -- Defines the buffer color, line width and font index :
526 -- the default color is the highlight color of the colormap.
527 -- the default font is the default system font of the fontmap.
528 -- The other attributes are fixed :
529 -- line type is Solid,
530 -- line width is 1 Pixel,
531 -- polygon fill mode is Solid,
532 -- Warning: The number of allocated buffers is limited,it's
533 -- recommended to close unused buffers some time!
534 -- The TypeOfDrawMode REPLACE is enabled only if the
535 -- background drawing has been drawn with the DoubleBuffer
536 -- flag set to ENABLE at the last BeginDraw time.
537 -- The TypeOfDrawMode XOR is enabled in any case.
538 -- The other TypeOfDrawMode are not authorized.
539 -- Returns TRUE if the buffer is allocated and enabled for drawing.
541 CloseBuffer (me; aRetainBuffer: Integer)
542 ---Purpose: Clear & Deallocate the retain buffer <aRetainBuffer>.
543 raises DriverError from Aspect is virtual;
544 ---Trigger: Raises if the retain buffer is not opened.
545 -- call BufferIsOpen() method before.
547 ClearBuffer (me; aRetainBuffer: Integer)
548 ---Purpose: Erase & Clear ALL primitives retains in the buffer <aRetainBuffer>.
549 raises DriverError from Aspect is virtual;
550 ---Trigger: Raises if the retain buffer is not opened.
551 -- call BufferIsOpen() method before.
553 DrawBuffer (me; aRetainBuffer: Integer)
554 ---Purpose: Draw ALL primitives retains in the buffer <aRetainBuffer>.
555 -- Warning: Note that the aspect of a retain buffer drawing is mono-colored
556 -- with the current buffer attributes and
557 -- depending of the DoubleBuffer state flag at the BeginDraw() buffer time,
558 -- when DB is TRUE,an XOR method is use for drawing and erasing buffers in the
559 -- same way.In this case,some color side effect can occurs depending of the
560 -- traversal primitive colors and the supported hardware.
561 -- when DB is FALSE and the background drawing has been generated with
562 -- DB at TRUE,no color side effect occurs because the DB is used for restoring
563 -- the drawing context at EraseBuffer() time,this is more powerfull for the
564 -- drawing quality excepted for large buffers (flicking) .
565 raises DriverError from Aspect is virtual;
566 ---Trigger: Raises if the retain buffer is not opened.
567 -- call BufferIsOpen() method before.
569 EraseBuffer (me; aRetainBuffer: Integer)
570 ---Purpose: Erase ALL primitives retains in the buffer <aRetainBuffer>.
571 raises DriverError from Aspect is virtual;
572 ---Trigger: Raises if the retain buffer is not opened.
573 -- call BufferIsOpen() method before.
575 MoveBuffer (me; aRetainBuffer: Integer;
576 aPivotX: ShortReal = 0.0;
577 aPivotY: ShortReal = 0.0)
578 ---Purpose: Erase , Translate and reDraw ALL primitives retains in the buffer
580 --<aPivotX,aPivotY> are the new DWU attached point absolute coordinates
581 --of the buffer pivot point.
582 raises DriverError from Aspect is virtual;
583 ---Trigger: Raises if the retain buffer is not opened.
584 -- call BufferIsOpen() method before.
586 ScaleBuffer (me; aRetainBuffer: Integer; aScaleX: Factor = 1.0;
587 aScaleY: Factor = 1.0)
588 ---Purpose: Erase , Scale the buffer from the Pivot point and reDraw ALL primitives
589 --retains in the buffer <aRetainBuffer>.
590 -- The transformation is relative since the creation time of the buffer.
591 --<aScaleX,aScaleY> are the relative scale factors apply on the two axis.
592 -- Warning: Note that the scalling of some primitives can provided some bad
593 --smoothing side effect (i.e: Circles,...)
594 raises DriverError from Aspect is virtual;
595 ---Trigger: Raises if the retain buffer is not opened or
596 --one of <aScale> factor is <= 0.
597 -- call BufferIsOpen() method before.
599 RotateBuffer (me; aRetainBuffer: Integer; anAngle: PlaneAngle = 0.0)
600 ---Purpose: Erase , Rotate the buffer from the Pivot point and reDraw ALL primitives
601 -- retains in the buffer <aRetainBuffer>.
602 -- The transformation is relative since the creation time of the buffer.
603 -- <anAngle> is the relative counter-clockwise rotation angle from the
605 raises DriverError from Aspect is virtual;
606 ---Trigger: Raises if the retain buffer is not opened.
607 -- call BufferIsOpen() method before.
609 ----------------------------
610 -- Category: Inquire methods
611 ----------------------------
613 WorkSpace (me; Width, Heigth: out Length from Quantity) is virtual;
615 ---Purpose: Returns the Available WorkSpace in DWU coordinates
616 -- Category: Inquire methods
618 TextSize (me; aText: ExtendedString from TCollection;
619 aWidth, aHeight: out ShortReal from Standard;
620 aFontIndex: Integer from Standard = -1)
621 raises DriverError from Aspect is virtual;
623 ---Purpose: Returns the TEXT size in DWU space depending
624 -- of the required FontIndex if aFontIndex is >= 0
625 -- or the current FontIndex if < 0 (default).
626 ---Category: Inquire methods
628 TextSize (me; aText: ExtendedString from TCollection;
629 aWidth, aHeight, anXoffset, anYoffset: out ShortReal from Standard;
630 aFontIndex: Integer from Standard = -1)
631 raises DriverError from Aspect is virtual;
633 ---Purpose: Returns the extended TEXT size and offsets
634 -- in DWU space depending
635 -- of the required FontIndex if aFontIndex is >= 0
636 -- or the current FontIndex if < 0 (default).
637 -- NOTE that the text offsets defines the relative position of the
638 -- of the text string origin from the lower left corner of the text
640 ---Category: Inquire methods
642 TextSize (me; aText: CString from Standard;
643 aWidth, aHeight, anXoffset, anYoffset: out ShortReal from Standard;
644 aFontIndex: Integer from Standard = -1)
645 raises DriverError from Aspect is virtual;
647 ---Purpose: Returns the ascii TEXT size and offsets
648 -- in DWU space depending
649 -- of the required FontIndex if aFontIndex is >= 0
650 -- or the current FontIndex if < 0 (default).
651 -- NOTE that the text offsets defines the relative position of the
652 -- of the text string origin from the lower left corner of the text
654 ---Category: Inquire methods
656 FontSize (me; aSlant: out PlaneAngle from Quantity;
657 aSize,aBheight: out ShortReal from Standard;
658 aFontIndex: Integer from Standard = -1)
659 returns CString from Standard
660 ---Trigger: Raises if font is not defined.
661 raises DriverError from Aspect is virtual;
663 ---Purpose: Returns the font string,slant,size and
664 -- baseline height in DWU space depending
665 -- of the required FontIndex if aFontIndex is >= 0
666 -- or the current FontIndex if < 0 (default).
667 ---Category: Inquire methods
669 Convert (me; PV: Integer from Standard)
670 returns Length from Quantity is virtual;
672 ---Purpose: Returns the DWU value depending of
674 ---Category: Inquire methods
676 Convert (me; DV: Length from Quantity)
677 returns Integer from Standard is virtual;
679 ---Purpose: Returns the PIXEL value depending of
681 ---Category: Inquire methods
683 Convert (me; PX, PY: Integer from Standard;
684 DX, DY: out Length from Quantity) is virtual;
686 ---Purpose: Returns the DWU position depending of
687 -- the PIXEL position .
688 ---Category: Inquire methods
690 Convert (me; DX, DY: Length from Quantity;
691 PX, PY: out Integer from Standard) is virtual;
693 ---Purpose: Returns the PIXEL position depending of
694 -- the DWU position .
695 ---Category: Inquire methods
697 BufferIsOpen(me; aRetainBuffer : Integer) returns Boolean is virtual;
698 ---Purpose: Returns TRUE if the retain buffer <aRetainBuffer> is enabled
701 BufferIsEmpty(me; aRetainBuffer : Integer) returns Boolean is virtual;
702 ---Purpose: Returns TRUE if the retain buffer has not been opened or empty.
703 --- Returns FALSE if a lot of primitives have been stored inside
704 -- because a BeginDraw(..,<aRetainBuffer>) has been done previously.
706 BufferIsDrawn(me; aRetainBuffer : Integer) returns Boolean is virtual;
707 ---Purpose: Returns TRUE if the retain buffer s actually displayed at screen.
709 AngleOfBuffer(me; aRetainBuffer : Integer; anAngle: out PlaneAngle)
710 ---Purpose: Returns the current buffer rotate angle from the X axis.
711 raises DriverError from Aspect is virtual;
712 ---Trigger: Raises if the retain buffer is not opened.
713 -- call BufferIsOpen() method before.
715 ScaleOfBuffer(me; aRetainBuffer : Integer; aScaleX,aScaleY: out Factor)
716 ---Purpose: Returns the current buffer scale factors.
717 raises DriverError from Aspect is virtual;
718 ---Trigger: Raises if the retain buffer is not opened.
719 -- call BufferIsOpen() method before.
721 PositionOfBuffer(me; aRetainBuffer : Integer; aPivotX,aPivotY: out ShortReal )
722 ---Purpose: Returns the current buffer position.
723 raises DriverError from Aspect is virtual;
724 ---Trigger: Raises if the retain buffer is not opened.
725 -- call BufferIsOpen() method before.
727 ColorBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
731 -- Returns the min and max driver virtual color indexs.
732 ---Category: Inquire methods
734 LocalColorIndex(me; anIndex : Integer from Standard)
735 returns Integer from Standard is virtual;
738 -- Returns the local colormap hardware index from a virtual driver color
739 -- index or returns -1 if the index is not defined.
740 ---Category: Inquire methods
742 FontBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
746 -- Returns the min and max driver virtual font indexs.
747 ---Category: Inquire methods
749 LocalFontIndex(me; anIndex : Integer from Standard)
750 returns Integer from Standard is virtual;
753 -- Returns the associated fontmap hardware index from a virtual driver font
754 -- index or returns -1 if the index is not defined.
755 ---Category: Inquire methods
757 TypeBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
761 -- Returns the min and max driver virtual type indexs.
762 ---Category: Inquire methods
764 LocalTypeIndex(me; anIndex : Integer from Standard)
765 returns Integer from Standard is virtual;
768 -- Returns the associated typemap hardware index from a virtual driver type
769 -- index or returns -1 if the index is not defined.
770 ---Category: Inquire methods
772 WidthBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
776 -- Returns the min and max driver virtual width indexs.
777 ---Category: Inquire methods
779 LocalWidthIndex(me; anIndex : Integer from Standard)
780 returns Integer from Standard is virtual;
783 -- Returns the associated widthmap hardware index from a virtual driver width
784 -- index or returns -1 if the index is not defined.
785 ---Category: Inquire methods
787 MarkBoundIndexs(me; aMinIndex,aMaxIndex : out Integer from Standard)
791 -- Returns the min and max driver virtual marker indexs.
792 ---Category: Inquire methods
794 LocalMarkIndex(me; anIndex : Integer from Standard)
795 returns Integer from Standard is virtual;
798 -- Returns the local markmap hardware index from a virtual driver marker -- index or returns -1 if the index is not defined.
799 ---Category: Inquire methods
801 ----------------------------
802 -- Category: Private methods
803 ----------------------------
805 PrintError(myclass) is protected;
806 ---Purpose: Print last error or raise depending of the error gravity.
808 DrawRectangle(me; Xpos,Ypos,Angle,Xoffset,Yoffset,Width,Height:
809 ShortReal from Standard) is private;
810 ---Purpose: Draw an oriented rectangle
812 FillRectangle(me; Xpos,Ypos,Angle,Xoffset,Yoffset,Width,Height:
813 ShortReal from Standard) is private;
814 ---Purpose: Draw an oriented fill rectangle
818 MyVisualClass: TypeOfVisual from Xw is protected;
819 MyExtendedDrawable: Address from Standard is protected;
820 MyExtendedColorMap: Address from Standard is protected;
821 MyExtendedTypeMap: Address from Standard is protected;
822 MyExtendedWidthMap: Address from Standard is protected;
823 MyExtendedFontMap: Address from Standard is protected;
824 MyExtendedMarkMap: Address from Standard is protected;
825 MyImage: Address from Standard is protected;
827 MyLineColor: Integer from Standard is protected;
828 MyLineType: Integer from Standard is protected;
829 MyLineWidth: Integer from Standard is protected;
830 MyPolyColor: Integer from Standard is protected;
831 MyPolyType: Integer from Standard is protected;
832 MyPolyTile: Integer from Standard is protected;
833 MyTextColor: Integer from Standard is protected;
834 MyTextFont: Integer from Standard is protected;
835 MyTextType: Integer from Standard is protected;
836 MyTextHScale: Real from Standard is protected;
837 MyTextWScale: Real from Standard is protected;
838 MyTextHSize: Real from Standard is protected;
839 MyTextWSize: Real from Standard is protected;
840 MyTextSlant: Real from Standard is protected;
841 MyTextMinHeight: Real from Standard is protected;
842 MyTextIsUnderlined: Boolean from Standard is protected;
843 MyMarkerColor: Integer from Standard is protected;
844 MyMarkerType: Boolean from Standard is protected;
845 MyMarkerWidth: Integer from Standard is protected;
847 MyColorIndexs: HArray1OfInteger from TColStd is protected;
848 MyTypeIndexs: HArray1OfInteger from TColStd is protected;
849 MyWidthIndexs: HArray1OfInteger from TColStd is protected;
850 MyFontIndexs: HArray1OfInteger from TColStd is protected;
851 MyMarkerIndexs: HArray1OfInteger from TColStd is protected;
853 MyPrimitiveType: TypeOfPrimitive from Aspect is protected;
854 MyMFTFonts: HListOfMFTFonts from Xw is protected;
855 MyMFTSizes: HArray1OfShortReal from TShort is protected;
856 MyTextManager: TextManager from Xw is protected;