b311480e |
1 | -- Created by: CHABROVSKY Dmitry |
2 | -- Copyright (c) 1998-1999 Matra Datavision |
3 | -- Copyright (c) 1999-2012 OPEN CASCADE SAS |
4 | -- |
5 | -- The content of this file is subject to the Open CASCADE Technology Public |
6 | -- License Version 6.5 (the "License"). You may not use the content of this file |
7 | -- except in compliance with the License. Please obtain a copy of the License |
8 | -- at http://www.opencascade.org and read it completely before using this file. |
9 | -- |
10 | -- The Initial Developer of the Original Code is Open CASCADE S.A.S., having its |
11 | -- main offices at: 1, place des Freres Montgolfier, 78280 Guyancourt, France. |
12 | -- |
13 | -- The Original Code and all software distributed under the License is |
14 | -- distributed on an "AS IS" basis, without warranty of any kind, and the |
15 | -- Initial Developer hereby disclaims all such warranties, including without |
16 | -- limitation, any warranties of merchantability, fitness for a particular |
17 | -- purpose or non-infringement. Please see the License for the specific terms |
18 | -- and conditions governing the rights and limitations under the License. |
19 | |
7fd59977 |
20 | |
21 | class TextManager from WNT inherits TextManager from MFT |
22 | |
23 | uses |
24 | Length from Quantity, |
25 | PlaneAngle from Quantity, |
26 | TypeOfText from Aspect |
27 | |
28 | is |
29 | ------------------------- |
30 | -- Category: Constructors |
31 | ------------------------- |
32 | Create (aPixelToUnit: Real from Standard) |
33 | returns mutable TextManager from WNT; |
34 | |
35 | ------------------------- |
36 | -- Category: Draw methods |
37 | ------------------------- |
38 | BeginString (me: mutable; |
39 | X,Y: Length from Quantity; |
40 | anOrientation: PlaneAngle from Quantity; |
41 | aWidth,aHeight: Length from Quantity; |
42 | aSlant: PlaneAngle from Quantity; |
43 | aPaintType: Integer from Standard) |
44 | is redefined; |
45 | ---Purpose: Calls when string drawing is started. |
46 | -- with a string aspect <aPaintType> : |
47 | -- 0 for filled string |
48 | -- 1 for stroke string |
49 | -- 2 for outline string |
50 | -- The origine of the string <X>,<Y>, |
51 | -- The orientation of the string <anOrientation>, |
52 | -- The medium size of the char <aWidth,aHeight>, |
53 | -- The Slant of the char <aSlant>, |
54 | |
55 | BeginChar (me: mutable; |
56 | aCharCode: Integer from Standard; |
57 | X,Y: Length from Quantity) |
58 | returns Boolean from Standard is redefined; |
59 | ---Purpose: Calls when a char drawing is started |
60 | -- and give the current string position for this char. |
61 | -- and give the relative char position from the beginning |
62 | -- of the string. |
63 | -- The application can returns FALSE for skipping the char drawing. |
64 | |
65 | SetCharBoundingBox (me: mutable; |
66 | X1,Y1,X2,Y2,X3,Y3,X4,Y4: Length from Quantity) |
67 | returns Boolean from Standard is redefined; |
68 | ---Purpose: Calls to defines the current char bounding-box. |
69 | -- The application can returns FALSE for ending the char drawing. |
70 | |
71 | SetCharEncoding (me: mutable; |
72 | anEncoding: CString from Standard) |
73 | returns Boolean from Standard is redefined; |
74 | ---Purpose: Calls to defines the current char encoding. |
75 | -- Warning: The application can returns FALSE for skipping the char drawing. |
76 | |
77 | Moveto (me: mutable; X,Y: Length from Quantity) |
78 | returns Boolean from Standard is redefined; |
79 | ---Purpose: Calls to sets the current string position. |
80 | -- The application can returns FALSE for ending the char drawing. |
81 | |
82 | Lineto (me: mutable; X,Y: Length from Quantity) |
83 | returns Boolean from Standard is redefined; |
84 | ---Purpose: Calls to drawn to the current string position. |
85 | -- The application can returns FALSE for ending the char drawing. |
86 | |
87 | Curveto (me: mutable; X1,Y1,X2,Y2,X3,Y3,X4,Y4: Length from Quantity) |
88 | returns Boolean from Standard is redefined; |
89 | ---Purpose: Calls to drawn to the current string position. |
90 | -- The application can drawn the curve defined by |
91 | -- his descriptor P1,P2,P3,P4 or |
92 | -- returns FALSE to let the interpretor compute the curve |
93 | -- vectors. |
94 | |
95 | ClosePath (me: mutable) |
96 | is redefined; |
97 | ---Purpose: Calls when a char path drawing is ended |
98 | |
99 | EndChar (me: mutable; X,Y: Length from Quantity) |
100 | returns Boolean from Standard is redefined; |
101 | ---Purpose: Calls when a char drawing is ended |
102 | -- and give the relative char ending position from the |
103 | -- beginning of the string. |
104 | -- The application can returns FALSE for skipping the string |
105 | -- drawing. |
106 | |
107 | EndString (me: mutable) |
108 | is redefined; |
109 | ---Purpose: Calls when string drawing is ended (Normally the last call). |
110 | |
111 | SetDrawAttribs (me: mutable; aDrawData: Address from Standard); |
112 | ---Purpose: Called when starting to draw the string |
113 | |
114 | ------------------------- |
115 | -- Category: Private methods |
116 | ------------------------- |
117 | SetTextAttribs (me: mutable ; |
118 | aTextColor: Integer from Standard; |
119 | aTypeOfText: TypeOfText from Aspect; |
120 | anUnderlinePosition: Length from Quantity = 0.0); |
121 | ---Purpose: Sets the current attribs of the text. |
122 | |
123 | fields |
124 | myPixelToUnit: Real from Standard; |
125 | myDevContext: Integer from Standard; |
126 | myWin95: Boolean from Standard; |
127 | myDevWidth: Integer from Standard; |
128 | myDevHeight: Integer from Standard; |
129 | myUWidth: Integer from Standard; |
130 | myMonoBuf: Integer from Standard; |
131 | |
132 | friends |
133 | class WDriver from WNT |
134 | |
135 | end TextManager from WNT; |