0023024: Update headers of OCCT files
[occt.git] / src / Aspect / Aspect_Window.cdl
CommitLineData
b311480e 1-- Created by: NW,JPB,CAL
2-- Copyright (c) 1991-1999 Matra Datavision
3-- Copyright (c) 1999-2012 OPEN CASCADE SAS
7fd59977 4--
b311480e 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-- Modified: GG 28/01/00 G004 Add gamma correction value in Dump methods.
21-- GG 07/03/00 G004 Add MMSize() method
22-- TCL 26/10/00 G002 SetBackground(aName: CString) method
23-- GG 28/11/00 G002 Add BackgroundImage(),
24-- BackgroundFillMethod(),
25-- HBackground() methods.
26-- SAV 24/11/01 SetBackground(Quantity_Color)
7fd59977 27
28deferred class Window from Aspect
29
30inherits
31 TShared from MMgt
32
33 ---Purpose: This class allows the definition of a window
34 -- Warning: The position and size for the creation of the window
35 -- are defined in Device Screen Unit (DSU)
36 -- floating [0,1] space.
37
38uses
39 Background from Aspect,
40 GradientBackground from Aspect,
41 GraphicDevice from Aspect,
42 TypeOfResize from Aspect,
43 FillMethod from Aspect,
44 Handle from Aspect,
45 PixMap from Aspect,
46 Ratio from Quantity,
47 Parameter from Quantity,
48 NameOfColor from Quantity,
49 Color from Quantity,
50 AsciiString from TCollection
51
52raises
53 WindowDefinitionError from Aspect,
54 WindowError from Aspect
55
56is
57 Initialize(aGraphicDevice: GraphicDevice from Aspect);
58 ---Level: Public
59 ---Purpose: Initializes the datas of a Window.
60
61 ---------------------------------------------------
62 -- Category: Methods to modify the class definition
63 ---------------------------------------------------
64
65 SetBackground ( me : mutable;
66 ABack : Background from Aspect ) is deferred;
67 ---Level: Public
68 ---Purpose: Modifies the window background.
69 ---Category: Methods to modify the class definition
70
71 SetBackground ( me : mutable ;
72 BackColor : NameOfColor from Quantity ) is deferred;
73 ---Level: Public
74 ---Purpose: Modifies the window background from a Named Color.
75 ---Category: Methods to modify the class definition
76
77 SetBackground ( me : mutable; color : Color from Quantity ) is deferred;
78 ---Level: Public
79 ---Purpose: Modifies the window background.
80 ---Category: Methods to modify the class definition
81
82 SetBackground( me: mutable;
83 aName : CString from Standard;
84 aMethod : FillMethod from Aspect = Aspect_FM_CENTERED)
85 returns Boolean from Standard is deferred;
86 ---Level: Public
87 ---Purpose: Loads the window background from an image file <aName>
88 -- defined with a supported format XWD,GIF or BMP
89 -- and returns TRUE if the operation is successfull.
90 ---Category: Methods to modify the class definition
91
92 SetBackground( me: mutable;
93 aBitmap: Handle from Aspect) is deferred;
94 ---Level: Advanced
95 ---Purpose: Loads the window background from a predefined bitmap.
96 -- Warning: the bitmap and window must have the same depth.
97 ---Category: Methods to modify the class definition
98
99 SetBackground( me: mutable;
100 ABackground: GradientBackground from Aspect) is deferred;
101 ---Level: Public
102 ---Purpose: Modifies the window gradient background.
103 ---Category: Methods to modify the class definition
104
105 SetDoubleBuffer ( me : mutable ;
106 DBmode : Boolean from Standard )
107 ---Level: Advanced
108 ---Purpose: Activates/Deactivates the Double Buffering capability
109 -- for this window.
110 -- Warning: Double Buffering is always DISABLE by default
111 -- If there is not enought ressources to activate the
112 -- double-buffering the DB mode flag can be set to FALSE.
113 ---Category: Methods to modify the class definition
114 is deferred;
115
116 Flush ( me )
117 ---Level: Advanced
118 ---Purpose: Flushs all graphics to the screen and Swap the Double
119 -- buffer if Enable
120 ---Category: Methods to modify the class definition
121 ---Trigger: Raises if Something is WRONG at Drawing Time.
122 raises WindowError from Aspect is deferred;
123
124 Map ( me )
125 raises WindowError from Aspect is deferred;
126 ---Level: Public
127 ---Purpose: Opens the window <me>.
128 ---Category: Methods to modify the class definition
129
130 Unmap ( me )
131 raises WindowError from Aspect is deferred;
132 ---Level: Public
133 ---Purpose: Closes the window <me>.
134 ---Category: Methods to modify the class definition
135
136 DoResize ( me ) returns TypeOfResize from Aspect
137 raises WindowError from Aspect is deferred;
138 ---Level: Advanced
139 ---Purpose: Apply the resizing to the window <me>.
140 ---Category: Methods to modify the class definition
141
142 DoMapping ( me ) returns Boolean from Standard
143 raises WindowError from Aspect is deferred;
144 ---Level: Advanced
145 ---Purpose: Apply the mapping change to the window <me>.
146 -- and returns TRUE if the window is mapped at screen.
147 ---Category: Methods to modify the class definition
148
149 Destroy ( me : mutable )
150 raises WindowError from Aspect is deferred;
151 ---Level: Advanced
152 ---Purpose: Destroy the Window
153 ---Category: Methods to modify the class definition
154
155 Clear (me)
156 raises WindowError from Aspect is deferred;
157 ---Level: Public
158 ---Purpose: Clear The Window in the Background Color
159 ---Category: Methods to modify the class definition
160
161 ClearArea (me;
162 XCenter, YCenter: Integer from Standard;
163 Width , Height: Integer from Standard)
164 raises WindowError from Aspect is deferred;
165 ---Level: Public
166 ---Purpose: Clear The Window Area defined in PIXELS
167 -- in the Background Color
168 ---Category: Methods to modify the class definition
169
170 Restore(me)
171 ---Level: Public
172 ---Purpose: Restore the BackingStored Window <me>.
173 ---Category: Methods to modify the class definition
174 ---Trigger: Raises if BackingStore() is disable.
175 raises WindowError from Aspect is deferred;
176
177 RestoreArea (me;
178 XCenter, YCenter: Integer from Standard;
179 Width , Height: Integer from Standard)
180 ---Level: Public
181 ---Purpose: Restore the BackingStored Window Area
182 -- defined in PIXELS.
183 ---Category: Methods to modify the class definition
184 ---Trigger: Raises if BackingStore() is disable.
185 raises WindowError from Aspect is deferred;
186
187 Dump ( me ; aFilename : CString from Standard;
188 aGammaValue: Real from Standard = 1.0) returns Boolean
189 ---Level: Advanced
190 ---Purpose: Dumps the Window to an image file (PNG, BMP, JPEG, GIF) with
191 --an optional gamma correction value according to the graphic system
192 --and returns TRUE if the dump occurs normaly.
193 ---Category: Methods to modify the class definition
194 ---Trigger: Raises if Window is not defined properly
195 raises WindowError from Aspect is deferred;
196
197 DumpArea ( me ; aFilename : CString from Standard ;
198 Xc, Yc : Integer from Standard ;
199 Width, Height : Integer from Standard;
200 aGammaValue: Real from Standard = 1.0 ) returns Boolean
201 ---Level: Advanced
202 ---Purpose: Dumps the Window Area defined by his center and PIXEL size
203 -- to an image file with
204 -- an optional gamma correction value according to the graphic system
205 --and returns TRUE if the dump occurs normaly.
206 ---Category: Methods to modify the class definition
207 ---Trigger: Raises if Window is not defined properly
208 -- or the area is out of the Window.
209 raises WindowError from Aspect is deferred;
210
211 ToPixMap ( me )
212 returns PixMap from Aspect
213 ---Level : Public
214 ---Purpose : dump the full contents of the window to a pixmap.
215 is deferred;
216
217 Load ( me ; aFilename : CString from Standard) returns Boolean
218 ---Level: Advanced
219 ---Purpose: Loads the XWD file to this Window.
220 -- Returns TRUE if the loading occurs normaly.
221 -- Warning: Note that the Window is enlarged automatically
222 --when the image size is too large for this window.
223 ---Category: Methods to modify the class definition
224 ---Trigger: Raises if Window is not defined properly
225 raises WindowError from Aspect is deferred;
226
227 LoadArea ( me ; aFilename : CString from Standard ;
228 Xc, Yc : Integer from Standard ;
229 Width, Height : Integer from Standard ) returns Boolean
230 ---Level: Advanced
231 ---Purpose: Loads the XWD file to Window Area defined by his center
232 --and PIXEL size
233 -- Returns TRUE if the loading occurs normaly.
234 -- Warning: Note that the Image is zoomed automatically
235 --when the image size is too large for this window area.
236 ---Category: Methods to modify the class definition
237 ---Trigger: Raises if Window is not defined properly
238 -- or the area is out of the Window.
239 raises WindowError from Aspect is deferred;
240
241 ----------------------------
242 -- Category: Inquire methods
243 ----------------------------
244
245 Background ( me ) returns Background from Aspect;
246 ---Level: Public
247 ---Purpose: Returns the window background.
248 ---Category: Inquire methods
249
250 BackgroundImage ( me ) returns CString from Standard;
251 ---Level: Public
252 ---Purpose: Returns the current image background string
253 -- or NULL if nothing is defined.
254
255 BackgroundFillMethod( me ) returns FillMethod from Aspect;
256 ---Level: Public
257 ---Purpose: Returns the current image background fill mode.
258
259 GradientBackground ( me ) returns GradientBackground from Aspect;
260 ---Level: Public
261 ---Purpose: Returns the window gradient background.
262
263 HBackground ( me )
264 returns Handle from Aspect;
265 ---Level: Advanced
266 ---Purpose: Returns the background bitmap handle or
267 -- 0 when nothing is defined
268 ---C++: inline
269
270 GraphicDevice ( me ) returns GraphicDevice from Aspect;
271 ---Level: Public
272 ---Purpose: Returns the Graphic Device associated to this Window.
273 ---Category: Inquire methods
274
275 IsMapped ( me ) returns Boolean from Standard is deferred;
276 ---Level: Public
277 ---Purpose: Returns True if the window <me> is opened
278 -- and False if the window is closed.
279 ---Category: Inquire methods
280
281 IsVirtual ( me ) returns Boolean from Standard;
282 ---Level: Public
283 ---Purpose: Returns True if the window <me> is virtual
284 ---Category: Inquire methods
285
286 SetVirtual ( me : mutable;
287 theVirtual : Boolean from Standard );
288 ---Level: Public
289 ---Purpose: Setup the virtual state
290 ---Category: Inquire methods
291
292 Ratio ( me ) returns Ratio from Quantity is deferred;
293 ---Level: Public
294 ---Purpose: Returns The Window RATIO equal to the physical
295 -- WIDTH/HEIGHT dimensions
296 ---Category: Inquire methods
297
298 Position ( me ;
299 X1, Y1 ,X2, Y2 : out Parameter from Quantity)
300 is deferred;
301 ---Level: Public
302 ---Purpose: Returns The Window POSITION in DSU
303 ---Category: Inquire methods
304
305 Position ( me ;
306 X1, Y1, X2, Y2 : out Integer from Standard )
307 is deferred;
308 ---Level: Public
309 ---Purpose: Returns The Window POSITION in PIXEL
310 ---Category: Inquire methods
311
312 Size ( me ;
313 Width, Height : out Parameter from Quantity )
314 is deferred;
315 ---Level: Public
316 ---Purpose: Returns The Window SIZE in DSU
317 ---Category: Inquire methods
318
319 Size ( me ;
320 Width, Height : out Integer from Standard )
321 is deferred;
322 ---Level: Public
323 ---Purpose: Returns The Window SIZE in PIXEL
324 ---Category: Inquire methods
325
326 MMSize ( me ;
327 Width, Height : out Real from Standard )
328 is deferred;
329 ---Level: Public
330 ---Purpose: Returns The Window SIZE in MM
331 ---Category: Inquire methods
332
333 Convert ( me ; PV : Integer from Standard )
334 returns Parameter from Quantity is deferred;
335 ---Level: Public
336 ---Purpose: Returns the DSU value depending of the PIXEL value.
337 ---Category: Inquire methods
338
339 Convert ( me ; DV : Parameter from Quantity )
340 returns Integer from Standard is deferred;
341 ---Level: Public
342 ---Purpose: Returns the PIXEL value depending of the DSU value.
343 ---Category: Inquire methods
344
345 Convert ( me ;
346 PX, PY : Integer from Standard ;
347 DX, DY : out Parameter from Quantity ) is deferred;
348 ---Level: Public
349 ---Purpose: Returns the DSU position depending of the PIXEL position.
350 ---Category: Inquire methods
351
352 Convert ( me ;
353 DX, DY : Parameter from Quantity ;
354 PX, PY : out Integer from Standard ) is deferred;
355 ---Level: Public
356 ---Purpose: Returns the PIXEL position depending of the DSU position.
357 ---Category: Inquire methods
358
359 BackingStore(me) returns Boolean from Standard is deferred;
360 ---Level: Advanced
361 ---Purpose: Returns the BackingStore capability for this Window .
362 -- If Answer is True Exposure can be recovered by
363 -- Restore RestoreArea methods .
364 -- If Answer is False,Application must Redraw
365 -- the exposed area.
366 ---Category: Inquire methods
367
368 DoubleBuffer ( me )
369 returns Boolean from Standard is deferred;
370 ---Level: Advanced
371 ---Purpose: Returns the DoubleBuffer state.
372 ---Category: Inquire methods
373
374fields
375 MyGraphicDevice : GraphicDevice from Aspect is protected;
376 MyBackground : Background from Aspect is protected;
377 MyBackgroundImage : AsciiString from TCollection is protected;
378 MyBackgroundFillMethod : FillMethod from Aspect is protected;
379 MyHBackground : Handle from Aspect is protected;
380 MyGradientBackground : GradientBackground from Aspect is protected;
381 MyIsVirtual : Boolean from Standard is protected;
382
383end Window;