1 -- Created on: 1991-11-18
2 -- Created by: NW,JPB,CAL,GG
3 -- Copyright (c) 1991-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.
29 AsciiString from TCollection,
30 Background from Aspect,
31 GradientBackground from Aspect,
32 TypeOfResize from Aspect,
34 FillMethod from Aspect,
35 GradientFillMethod from Aspect,
36 DisplayConnection_Handle from Aspect,
38 NameOfColor from Quantity,
39 Parameter from Quantity,
43 WindowQuality from Xw,
48 WindowDefinitionError from Aspect,
49 WindowError from Aspect
53 Create ( theDisplayConnection : DisplayConnection_Handle from Aspect )
54 returns mutable Window from Xw
55 raises WindowDefinitionError from Aspect;
58 Create ( theDisplayConnection : DisplayConnection_Handle from Aspect ;
59 aPart1, aPart2 : Integer from Standard ;
60 BackColor : NameOfColor from Quantity =
61 Quantity_NOC_MATRAGRAY )
62 returns mutable Window from Xw
64 ---Purpose: Creates a Window from an X Window defined by his ID
65 -- This Xid equals (aPart1 << 16) + aPart2.
66 -- A child of this Window is created when the WindowQuality
67 -- isn't the same than the parent Window
68 -- Trigger: Raises WindowDefinitionError if the connection failed
69 -- or if the Position out of the Screen Space
70 raises WindowDefinitionError from Aspect ;
72 Create ( theDisplayConnection : DisplayConnection_Handle from Aspect ;
73 aWindow : Handle from Aspect;
74 BackColor : NameOfColor from Quantity =
75 Quantity_NOC_MATRAGRAY )
76 returns mutable Window from Xw
78 ---Purpose: Creates a Window from an X Window defined by his Xid
79 -- A child of this Window is created when the WindowQuality
80 -- isn't the same than the parent Window
81 -- Trigger: Raises WindowDefinitionError if the connection failed
82 -- or if the Position out of the Screen Space
83 raises WindowDefinitionError from Aspect ;
85 Create ( theDisplayConnection : DisplayConnection_Handle from Aspect ;
86 theTitle : CString from Standard ;
87 thePxLeft : Integer from Standard ;
88 thePxTop : Integer from Standard ;
89 thePxWidth : Integer from Standard ;
90 thePxHeight : Integer from Standard ;
91 theBackColor : NameOfColor from Quantity = Quantity_NOC_MATRAGRAY ;
92 theParent : Handle from Aspect = 0 )
93 returns mutable Window from Xw
95 ---Purpose: Creates a Window defined by his position and size
96 -- in pixels from the Parent Window.
97 -- Trigger: Raises WindowDefinitionError if the connection failed
98 -- or if the Position out of the Screen Space
99 raises WindowDefinitionError from Aspect ;
101 ---------------------------------------------------
102 -- Category: Methods to modify the class definition
103 ---------------------------------------------------
105 Map ( me ) is virtual;
107 ---Purpose: Opens the window <me>.
108 ---Category: Methods to modify the class definition
110 Unmap ( me ) is virtual;
112 ---Purpose: Closes the window <me>.
113 ---Category: Methods to modify the class definition
116 returns TypeOfResize from Aspect
118 ---Purpose: Applies the resizing to the window <me>.
119 ---Category: Methods to modify the class definition
120 raises WindowError from Aspect is virtual;
122 DoMapping ( me ) returns Boolean from Standard
123 raises WindowError from Aspect is virtual;
125 ---Purpose: Apply the mapping change to the window <me>
126 -- and returns TRUE if the window is mapped at screen.
127 ---Category: Methods to modify the class definition
129 Destroy ( me : mutable )
131 ---Purpose: Destroies the Window
133 -- Category: Methods to modify the class definition
134 -- Trigger: Raises if Window is not defined properly
135 raises WindowError from Aspect is virtual;
137 SetCursor ( me ; anId : Integer from Standard ;
138 aColor : NameOfColor from Quantity
139 = Quantity_NOC_YELLOW ) is virtual ;
141 ---Purpose: Changes the current window cursor by anId cursor
142 -- in the specified color.
143 -- NOTE than anId must be one of /usr/include/X11/cursorfont.h
144 -- or 0 for Deactivate the cursor
145 ---Category: Methods to modify the class definition
147 ----------------------------
148 -- Category: Inquire methods
149 ----------------------------
152 returns Boolean from Standard is virtual;
154 ---Purpose: Returns True if the window <me> is opened
155 -- and False if the window is closed.
156 ---Category: Inquire methods
159 returns Ratio from Quantity is virtual;
161 ---Purpose: Returns The Window RATIO equal to the physical
162 -- WIDTH/HEIGHT dimensions
163 ---Category: Inquire methods
166 X1, Y1, X2, Y2 : out Integer from Standard ) is virtual;
168 ---Purpose: Returns The Window POSITION in PIXEL
169 ---Category: Inquire methods
172 Width, Height : out Integer from Standard ) is virtual;
174 ---Purpose: Returns The Window SIZE in PIXEL
175 ---Category: Inquire methods
178 returns Handle from Aspect is static;
180 ---Purpose: Returns the X window ID of the created window <me>.
181 ---Category: Inquire methods
183 XWindow ( me ; aPart1, aPart2 : out Integer from Standard ) is static;
185 ---Purpose: Returns the X window ID of the created window <me>.
186 -- This Xid equals (aPart1 << 16) + aPart2.
189 returns Handle from Aspect is static;
191 ---Purpose: Returns the X window ID parent of the created window <me>.
192 ---Category: Inquire methods
194 XParentWindow ( me ; aPart1, aPart2 : out Integer from Standard ) is static;
196 ---Purpose: Returns the X window ID parent of the created window <me>.
197 -- This Xid equals (aPart1 << 16) + aPart2.
200 returns Handle from Aspect is static;
202 ---Purpose: Returns the X pixmap ID of the created window <me>.
203 -- If BackingStore () is permitted.
204 ---Category: Inquire methods
206 PointerPosition ( me ; X, Y : out Integer from Standard )
207 returns Boolean from Standard is virtual;
209 ---Purpose: Returns the Pointer position relatively to the Window <me>
210 -- and FALSE if the pointer is outside of the window
211 ---Category: Inquire methods
214 returns TypeOfVisual from Xw is static;
216 ---Purpose: Returns the X window Visual class of the created window <me>
217 ---Category: Inquire methods
219 BackgroundPixel ( me ; aPixel : out Integer from Standard )
220 returns Boolean from Standard is static;
222 ---Purpose: Returns FALSE when the returned background pixel
223 -- value <aPixel> is not defined
225 ExtendedWindow ( me )
226 returns Address from Standard
227 is static protected ;
229 ---Purpose: Returns the ExtendedWindow address of the created window.
230 ---Category: Inquire methods
232 SetWindow ( me: mutable ; aWindow : Handle from Aspect ;
233 BackColor : NameOfColor from Quantity )
235 ---Trigger: Raises if Window is not defined properly
236 raises WindowError from Aspect
239 SetWindow ( me: mutable ; Title : CString from Standard ;
240 Xc, Yc, Width, Height: Parameter from Quantity ;
241 BackColor : NameOfColor from Quantity ;
242 Parent : Handle from Aspect )
244 ---Trigger: Raises if Window is not defined properly
245 raises WindowError from Aspect
248 PrintError(myclass) is protected;
249 ---Purpose: Print last error or raise depending of the error gravity.
251 Init( me: mutable ) is private;
252 ---Purpose: Initialise the fileds of class
256 MyXWindow : Handle from Aspect is protected ;
257 MyXParentWindow : Handle from Aspect is protected ;
258 MyVisualClass : TypeOfVisual from Xw is protected ;
259 MyExtendedDisplay : Address from Standard is protected ;
260 MyExtendedWindow : Address from Standard is protected ;
261 myDisplayConnection : DisplayConnection_Handle from Aspect is protected;