1 -- Created on: 1996-03-11
2 -- Created by: PLOTNIKOV Eugeny <eugeny@maniax>
3 -- Copyright (c) 1996-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.
21 -- Modifications: PLOTNIKOV Eugeny at July 1998 (BUC60286)
24 class ImageManager from WNT inherits TShared from MMgt
26 ---Purpose: This class defines image management
32 SequenceOfImage from WNT,
39 Create ( aWindow : WindowPtr from WNT )
40 returns mutable ImageManager from WNT;
41 ---Purpose: Creates a class instance
43 Destroy ( me : mutable )
45 ---Purpose: Deletes all resources associated with the class instance.
48 SetFormat ( me : mutable; aFormat : TypeOfImage from WNT = WNT_TOI_XWD )
50 ---Purpose: Sets image format for output.
52 Add ( me : mutable; anImage : Image from WNT )
54 ---Purpose: Adds <anImage> to manager.
56 Image ( me : mutable; anIndex : Integer from Standard )
57 returns Image from WNT is static;
58 ---Purpose: returns Image stored at <anIndex>.
60 Load ( me : mutable; aFileName : CString from Standard )
61 returns Integer from Standard
63 ---Purpose: Loads image from file and returns its index in the
65 -- Warning: Returns 0 if loading was failed.
69 aFileName : CString from Standard;
70 aX, aY, aWidth, aHeight : Integer from Standard
72 returns Boolean from Standard
74 ---Purpose: Stories image to the file according to <myFormat>
75 -- class field. Returns True on success, otherwise
80 aFileName : CString from Standard;
81 aX, aY, aWidth, aHeight : Integer from Standard
83 returns Boolean from Standard
85 ---Purpose: Stories contents of the double buffer window pixmap.
90 anIndex : Integer from Standard;
91 Xc, Yc : Integer from Standard;
92 aWidth : Integer from Standard;
93 aHeight : Integer from Standard;
94 anAngle : Real from Standard = 0.0
97 ---Purpose: Displays the image according to the DoubleBuffer state
98 -- of the associated window.
100 Delete ( me : mutable; anIndex : Integer from Standard )
102 ---Purpose: Deletes an image at index <anIndex>.
104 Discard ( me : mutable; anIndex : Integer from Standard )
106 ---Purpose: Places an image to the trash
110 anIndex : Integer from Standard;
111 aScaleX : Real from Standard;
112 aScaleY : Real from Standard;
113 aReplace : Boolean from Standard = Standard_False
114 ) returns Handle from Aspect is static;
115 ---Purpose: Scales the specified image.
117 Size ( me ) returns Integer from Standard is static;
118 ---Purpose: Returns number of loaded images.
122 anIndex : Integer from Standard
123 ) returns Handle from Aspect is static;
124 ---Purpose: Returns image handle.
128 anIndex : Integer from Standard;
129 aWidth, aHeight : out Integer from Standard
132 ---Purpose: Returns image dimensions.
136 anIndex : Integer from Standard
138 returns Integer from Standard is redefined static;
139 ---Purpose: Returns image's hash code.
143 aHashCode : Integer from Standard
145 returns Integer from Standard is static;
146 ---Purpose: Returns image's index.
150 aString : CString from Standard
152 returns Integer from Standard is static;
153 ---Purpose: Returns hash code of the string.
157 aDC : Handle from Aspect;
158 aWidth : Integer from Standard;
159 aHeight : Integer from Standard;
160 aHashCode : Integer from Standard
162 returns Integer from Standard is static;
163 ---Purpose: Creates new empty image and returns its index
167 myWindow : Address from Standard is protected;
168 myImages : SequenceOfImage from WNT is protected;
169 myTrash : SequenceOfImage from WNT is protected;
170 myFormat : TypeOfImage from WNT is protected;
171 myLastImage : Image from WNT is protected;
172 myLastIndex : Integer from Standard is protected;
176 class WDriver from WNT,
177 class Window from WNT