b311480e |
1 | -- Created on: 1993-04-29 |
2 | -- Created by: Gerard GRAS |
3 | -- Copyright (c) 1993-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 | |
7fd59977 |
21 | |
7fd59977 |
22 | |
23 | class TextManager from MFT inherits TShared from MMgt |
24 | |
25 | ---Purpose: defines the common behaviour of the MFT output driver. |
26 | -- Warning: Permits to receives draw primitives from the FontManager |
27 | -- at DrawText(...) time. |
28 | -- This class must be redefined by the user as an application class |
29 | -- connected to a user driver. |
30 | |
31 | uses |
32 | FontManager from MFT, |
33 | PlaneAngle from Quantity, |
34 | Length from Quantity |
35 | |
36 | is |
37 | |
38 | |
39 | ------------------------- |
40 | -- Category: Constructors |
41 | ------------------------- |
42 | |
43 | Create returns TextManager from MFT; |
44 | ---Purpose: Does NOTHING |
45 | |
46 | ------------------------- |
47 | -- Category: Draw methods |
48 | ------------------------- |
49 | |
50 | BeginString (me: mutable; |
51 | X,Y: Length from Quantity; |
52 | anOrientation: PlaneAngle from Quantity; |
53 | aWidth,aHeight: Length from Quantity; |
54 | aSlant: PlaneAngle from Quantity; |
55 | aPaintType: Integer from Standard) is virtual; |
56 | ---Purpose: Calls when string drawing is started. |
57 | -- with a string aspect <aPaintType> : |
58 | -- 0 for filled string |
59 | -- 1 for stroke string |
60 | -- 2 for outline string |
61 | -- The origine of the string <X>,<Y>, |
62 | -- The orientation of the string <anOrientation>, |
63 | -- The medium size of the char <aWidth,aHeight>, |
64 | -- The Slant of the char <aSlant>, |
65 | |
66 | BeginChar (me: mutable; |
67 | aCharCode: Integer from Standard; |
68 | X,Y: Length from Quantity) |
69 | returns Boolean from Standard is virtual; |
70 | ---Purpose: Calls when a char drawing is started |
71 | -- and give the relative char start position from the beginning |
72 | -- of the string. |
73 | -- The application can returns FALSE for skipping the char drawing. |
74 | |
75 | SetCharBoundingBox (me: mutable; |
76 | X1,Y1,X2,Y2,X3,Y3,X4,Y4: Length from Quantity) |
77 | returns Boolean from Standard is virtual; |
78 | ---Purpose: Calls to defines the current char bounding-box with : |
79 | -- X1,Y1 : the lower left corner of the box, |
80 | -- X2,Y2 : the lower right corner of the box, |
81 | -- X3,Y3 : the upper right corner of the box, |
82 | -- X4,Y4 : the upper left corner of the box. |
83 | -- Warning: the char bounding box is not rectangular when the Slant is != 0. |
84 | -- The application can returns FALSE for skipping the char drawing. |
85 | |
86 | SetCharEncoding (me: mutable; |
87 | anEncoding: CString from Standard) |
88 | returns Boolean from Standard is virtual; |
89 | ---Purpose: Calls to defines the current char encoding. |
90 | -- Warning: The application can returns FALSE for skipping the char drawing. |
91 | |
92 | Moveto (me: mutable; |
93 | X,Y: Length from Quantity) |
94 | returns Boolean from Standard is virtual; |
95 | ---Purpose: Calls to sets the current string position. |
96 | -- The application can returns FALSE for skipping the char drawing. |
97 | |
98 | Lineto (me: mutable; |
99 | X,Y: Length from Quantity) |
100 | returns Boolean from Standard is virtual; |
101 | ---Purpose: Calls to drawn to the current string position. |
102 | -- The application can returns FALSE for skipping the char drawing. |
103 | Curveto (me: mutable; |
104 | X1,Y1,X2,Y2,X3,Y3,X4,Y4: Length from Quantity) |
105 | returns Boolean from Standard is virtual; |
106 | ---Purpose: Calls to drawn to the current string position. |
107 | -- The application can drawn the curve defined by |
108 | -- his descriptor P1,P2,P3,P4 or |
109 | -- returns FALSE to let the interpretor compute the curve |
110 | -- vectors. |
111 | |
112 | ClosePath (me: mutable) is virtual; |
113 | ---Purpose: Calls when a char path drawing is ended |
114 | |
115 | EndChar (me: mutable; |
116 | X,Y: Length from Quantity) |
117 | returns Boolean from Standard is virtual; |
118 | ---Purpose: Calls when a char drawing is ended |
119 | -- and give the relative char ending position from the |
120 | -- beginning of the string. |
121 | -- The application can returns FALSE for skipping the string |
122 | -- drawing. |
123 | |
124 | EndString (me: mutable ) is virtual; |
125 | ---Purpose: Calls when string drawing is ended (Normally the last call). |
126 | |
127 | ------------------------- |
128 | -- Category: Private methods |
129 | ------------------------- |
130 | |
131 | MinMax (myclass; |
132 | Xmin,Ymin,Xmax,Ymax: out Length from Quantity) |
133 | is private; |
134 | ---Purpose: Returns the current drawn string min-max. |
135 | |
136 | Encoding (myclass) |
137 | returns CString from Standard is private; |
138 | ---Purpose: Returns the current drawn char encoding. |
139 | |
140 | friends |
141 | class FontManager from MFT |
142 | |
143 | end TextManager from MFT; |