|
|
1.1 root 1: .NH 2
2: Status and Mode Window Operations
3: .FD
4: .IN "Definitions" "XQueryWindow"
5: .IN "XQueryWindow"
6: Status XQueryWindow (w, info)
7: Window w;
8: WindowInfo *info; /* RETURN */
9: .FN
10: \fIXQueryWindow\fP gets various facts about a window.
11: It fills in the client-passed
12: .IN "WindowInfo"
13: .IN "File" "<X/Xlib.h>"
14: \fIWindowInfo\fP, which is defined in \fI<X/Xlib.h>\fP as
15: .sp
16: .DS
17: .TA .5i 2.5i
18: .ta .5i 2.5i
19: typedef struct _WindowInfo {
20: short width, height; /* Width and height. */
21: short x, y; /* X and y coordinates. */
22: short bdrwidth; /* Border width. */
23: short mapped; /* IsUnmapped, IsMapped or IsInvisible.*/
24: short type; /* IsTransparent, IsOpaque or IsIcon. */
25: Window assoc_wind; /* Associated icon or opaque Window. */
26: } WindowInfo;
27: .DE
28: .IN "Data Structures" "WindowInfo"
29: .IN "Definitions" "WindowInfo"
30: .LP
31: The \fImapped\fP field is set to \fIIsUnmapped\fP if the window is unmapped,
32: \fIIsMapped\fP if the
33: window is mapped and displayed (i.e. all of its ancestors are also
34: mapped), and \fIIsInvisible\fP if it is mapped but some ancestor is not mapped.
35: .PP
36: If the window is a normal opaque window,
37: the \fItype\fP will be \fIIsOpaque\fP.
38: \fIAssoc_wind\fP will contain the window's Icon window.
39: .IN "Icon"
40: .IN "XSetIconWindow"
41: This is normally set using the \fIXSetIconWindow\fP request.
42: If the window is an icon window,
43: the type will be \fIIsIcon\fP and \fIassoc_wind\fP
44: will contain the Icon's corresponding
45: regular window.
46: .PP
47: The procedure returns 0 if it fails, non-zero if it succeeds.
48: The procedure may fail if the window has been destroyed.
49: .FD
50: .IN "Definitions" "XQueryTree"
51: .IN "XQueryTree"
52: Status XQueryTree (w, parent, nchildren, children)
53: Window w;
54: Window *parent; /* RETURN */
55: int *nchildren; /* RETURN */
56: Window **children; /* RETURN */
57: .FN
58: .IN "Child Window"
59: .IN "Parent Window"
60: \fIXQueryTree\fP returns a list of children of the specified window, its parent,
61: and the number of children of this window.
62: It returns a pointer to a list of the children windows.
63: The list must
64: be deallocated when no longer needed.
65: The children are listed in current stacking order, from bottom-most (first)
66: to top-most (last).
67: .PP
68: The procedure returns 0 if it fails, non-zero if it succeeds.
69: .FD
70: .IN "Definitions" "XChangeBackground"
71: .IN "XChangeBackground"
72: .IN "Window" "Background"
73: XChangeBackground(w, tile)
74: Window w;
75: Pixmap tile;
76: .FN
77: Change the background \fItile\fP of a window.
78: If no background Pixmap is specified,
79: the background pixmap of the window's parent is used.
80: On the root window, the default background will be restored.
81: .PP
82: .IN "Resource ID's" "Freeing"
83: .IN "Freeing" "Resources"
84: The background Pixmap can immediately be freed if no further explicit
85: references to it are to be made.
86: .PP
87: This can only be performed on an opaque window.
88: An error will result if you try to change the background of a transparent
89: window.
90: .PP
91: NOTE: This does not change the current contents of the window, and you
92: may wish to clear and repaint the screen after this function since it
93: will not repaint the background you just set.
94: .FD
95: .IN "Definitions" "XChangeBorder"
96: .IN "XChangeBorder"
97: XChangeBorder(w, tile)
98: Window w;
99: Pixmap tile;
100: .FN
101: Changes and repaints the border \fItile\fP of a window.
102: .LP
103: .IN "Resource ID's" "Freeing"
104: .IN "Freeing" "Resources"
105: The border Pixmap can be freed immediately if no further explicit
106: references to it are to be made.
107: .PP
108: This can only be performed on an opaque window that has a border.
109: It will cause an error to perform this on a transparent window or
110: an opaque window that has no border.
111: .FD
112: .IN "Definitions" "XTileAbsolute"
113: .IN "Definitions" "XTileRelative"
114: .IN "XTileAbsolute"
115: .IN "XTileRelative"
116: XTileAbsolute(w)
117:
118: XTileRelative(w)
119: Window w;
120: .FN
121: .IN "Tile Mode"
122: Sets the tile mode of the window.
123: In ``absolute'' mode (the normal case for opaque windows),
124: tiles are laid out with the upper left corder of the window as an effective
125: origin.
126: In ``relative'' mode
127: (the default for transparent windows), tiles are laid out with the upper
128: left corner of the closest parent window with an absolute tile mode
129: as an effective origin.
130: The tile mode affects painting of the background for exposures
131: .IN "XClear"
132: and for \fIXClear\fP,
133: .IN "XTileFill"
134: .IN "XDrawFilled"
135: as well as the \fIXTileFill\fP and \fIXDrawFilled\fP requests.
136: .PP
137: NOTE: This does not change the current contents of the window, and you
138: may wish to clear and repaint the screen after this function.
139: .FD
140: .IN "Definitions" "XClipDrawThrough"
141: .IN "Definitions" "XClipClipped"
142: .IN "XClipDrawThrough"
143: .IN "XClipClipped"
144: XClipDrawThrough (w)
145:
146: XClipClipped (w)
147: Window w;
148: .FN
149: .IN "Clip Mode"
150: These functions set
151: the `clip mode' of a window, which determines what
152: happens when you draw on a part of the window which is
153: obscured by a child window.
154: .PP
155: If the clip mode is \fIClipped\fP, output into areas covered by
156: children is suppressed.
157: All windows start out this way when created by \fIXCreateWindow\fP.
158: .PP
159: If the clip mode is \fIDrawThrough\fP, output will be drawn on the screen as if
160: the child window wasn't there.
161: \fIDrawThrough\fP is useful for drawing window outlines when
162: moving or resizing windows.
163: Note that any such requests must be atomic and return
164: the screen to its original state in a single X request.
165: The root window's clip-mode is initially of \fIDrawThrough\fP.
166: .IN "XGrabServer"
167: .IN "Window" "Managers"
168: .IN "Grabbing" "Server"
169: .PP
170: Another approach when writing code (usually window manager type programs) that
171: does not result in flickering lines is possible.
172: You can grab control of the server using the \fIXGrabServer\fP call.
173: This means that for the duration of the `grab' you can display
174: static graphics on the screen so long as you put everything back before
175: releasing the server, since no other client can perform output while
176: the server is grabbed.
177: .FD
178: .IN "Definitions" "XStoreName"
179: .IN "XStoreName"
180: .IN "Window" "Name"
181: XStoreName (w, name)
182: Window w;
183: char *name; /* null-terminated string */
184: .FN
185: \fIXStoreName\fP assigns a name to a window.
186: The name should be a
187: null-terminated string.
188: This name will be returned by
189: any subsequent call to
190: .IN "XFetchName"
191: \fIXFetchName\fP.
192: Windows are typically named for the convenience of window managers.
193: This allows a window manager to display a text representation of a window
194: when its icon is being displayed.
195: .FD
196: .IN "Definitions" "XFetchName"
197: .IN "XFetchName"
198: Status XFetchName (w, name)
199: Window w;
200: char **name; /* RETURN */
201: .FN
202: \fIXFetchName\fP sets \fIname\fP to a pointer to the name of the window
203: which will be null-terminated.
204: If no name was ever set, it
205: sets \fIname\fP to NULL. The client must free
206: the name string when finished with it.
207: .PP
208: \fIXFetchName\fP returns 0 if it fails, non-zero otherwise. (Note: if
209: the window has never had a name set, this is not considered a
210: failure and \fIXFetchName\fP will return a non-zero status.)
211: .FD
212: .IN "Definitions" "XSetResizeHint"
213: .IN "XSetResizeHint"
214: XSetResizeHint (w, width0, height0, widthinc, heightinc)
215: Window w;
216: int width0, height0, widthinc, heightinc;
217: .FN
218: .IN "Window" "Resize Hint"
219: \fIXSetResizeHint\fP is used to give a hint to the window system
220: that can be used by a window manager program to
221: define the desired shape of a window.
222: The inside height of the
223: window should be the base height (\fIheight0\fP) plus some multiple of the
224: height increment (\fIheightinc\fP), and the inside width of the window should
225: be the base width (\fIwidth0\fP) plus some multiple of the width increment
226: (\fIwidthinc\fP).
227: These parameters are hints for the window manager, but there is
228: no guarantee that they will be honored.
229: .PP
230: By default, a window's resize hint is (0, 0, 1, 1).
231: .PP
232: The base height and width must be non-negative, and the height and width
233: increments must be positive.
234: .PP
235: This is used by window managers to avoid resizing windows to sizes that
236: may not be convenient for the clients,
237: but CLIENTS must not presume that the window is the correct size.
238: .FD
239: .IN "Definitions" "XGetResizeHint"
240: .IN "XGetResizeHint"
241: .IN "Window" "Resize Hint"
242: XGetResizeHint (w, width0, height0, widthinc, heightinc)
243: Window w;
244: int *width0, *height0; /* RETURN */
245: int *widthinc, *heightinc; /* RETURN */
246: .FN
247: \fIXGetResizeHint\fP asks for the window's size parameters and assigns them to
248: the client's variables.
249: .FD
250: .IN "Definitions" "XSetIconWindow"
251: .IN "XSetIconWindow"
252: .IN "Window" "Icon Window"
253: .IN "Icons"
254: .IN "Definitions" "XClearIconWindow"
255: .IN "XClearIconWindow"
256: XSetIconWindow(w, iw)
257: Window w;
258: Window iw; /* icon window */
259:
260: XClearIconWindow(w)
261: .FN
262: \fIXSetIconWindow\fP sets and \fIXClearIconWindow\fP
263: clears the icon window for a window.
264: The icon window must be a sibling of the specified window,
265: both windows must be opaque, and neither can already be an icon window.
266: When created, windows do not have icon windows defined.
267: .PP
268: .IN "ExposeWindow Event"
269: The icon window facility is provided because many window manager programs
270: allow the user to `turn a window into an icon.'
271: A client should call \fIXSetIconWindow\fP if it wants to control the
272: contents of the window's icon.
273: If the client has not called \fIXSetIconWindow\fP,
274: the window manager should create its own icon window for the window.
275: If a window is destroyed and has a mapped icon window, that icon
276: window is umapped and receives and UnmapWindow event.
277: If a window is destoryed and is a mapped icon window, its corresponding
278: `regular' window is mapped.
279: .FD
280: Status XQueryMouse (w, x, y, subw)
281: Window w;
282: int *x, *y; /* RETURN */
283: Window *subw; /* RETURN */
284: .FN
285: .IN "Definitions" "XQueryMouse"
286: .IN "XQueryMouse"
287: .IN "Mouse" "Position"
288: \fIXQueryMouse\fP determines the current mouse coordinates.
289: The coordinates
290: returned are relative to the top left inside corner of the window, even
291: if the mouse is outside the window (they can be negative).
292: If the mouse is also in a child
293: window, then \fIsubw\fP is set to that child, otherwise \fIsubw\fP is set to 0.
294: .FD
295: .IN "Definitions" "XQueryMouseButtons"
296: .IN "XQueryMouseButtons"
297: .IN "Mouse" "Position and Buttons"
298: Status XQueryMouseButtons (w, x, y, subw, state)
299: Window w;
300: int *x, *y; /* RETURN */
301: Window *subw; /* RETURN */
302: short *state; /* RETURN */
303: .FN
304: .IN "XQueryMouse"
305: Returns the same information as \fIXQueryMouse\fP,
306: with the addition of the state of the mouse buttons (which buttons
307: on the mouse are depressed).
308: .FD
309: .IN "Definitions" "XUpdateMouse"
310: .IN "XUpdateMouse"
311: .IN "Mouse" "Get Position"
312: Status XUpdateMouse (w, x, y, subw)
313: Window w;
314: int *x, *y; /* RETURN */
315: Window *subw; /* RETURN */
316: .FN
317: \fIXUpdateMouse\fP is like \fIXQueryMouse\fP, but also reads pending events and
318: eliminates any MouseMoved events at the head of the queue.
319: A good way to
320: track the mouse is to use a MouseMoved event as a "hint", by calling
321: this routine to get up to date coordinates.
322: .FD
323: .IN "Definitions" "XWarpMouse"
324: .IN "XWarpMouse"
325: .IN "Mouse" "Moving the Mouse Cursor"
326: XWarpMouse (w, x, y)
327: Window w;
328: int x, y;
329: .FN
330: \fIXWarpMouse\fP moves the mouse to the specified position in the specified
331: window.
332: The \fIx\fP and \fIy\fP coordinates are relative to the inside top left
333: corner of the window.
334: .FD
335: .IN "Definitions" "XCondWarpMouse"
336: .IN "XCondWarpMouse"
337: .IN "Mouse" "Moving the Mouse Cursor"
338: XCondWarpMouse (dw, dx, dy, sw, sx, sy, swidth, sheight)
339: Window dw, sw;
340: int dx, dy, sx, sy;
341: int swidth, sheight;
342: .FN
343: Moves the mouse to the destination position relative to the origin
344: of the destination window (\fIdw\fP),
345: but only if the mouse is currently in a visible region of the
346: specified region of the source window.
347: .PP
348: If the source height is zero,
349: the current height (\fIsheight\fP)
350: of the source window minus the source y (sy) coordinate.
351: If the source width (\fIswidth\fP) is zero,
352: the current width of the source window minus the source left (\fIsx\fP)
353: coordinate is used.
354: .FD
355: .IN "Definitions" "XInterpretLocator"
356: .IN "XInterpretLocator"
357: .IN "Window" "Conversion to Window Coordinates"
358: Status XInterpretLocator (w, x, y, subw, loc)
359: Window w;
360: int *x, *y; /* RETURN */
361: Window *subw; /* RETURN */
362: Locator loc;
363: .FN
364: \fIXInterpretLocator\fP converts absolute coordinates to coordinates which are
365: relative to the top left inner corner of a window.
366: These
367: window-relative coordinates are assigned to the variables \fIx\fP and \fIy\fP.
368: Normally, the Locator will be obtained from an
369: input event rather than constructed from a separate \fIx\fP and \fIy\fP coordinate.
370: It is seldom useful to deal with absolute coordinates, but if you must
371: convert absolute coordinates to a locator,
372: a locator is constructed from a coordinate pair by (x<<16) | y.
373: If the absolute coordinates also fall within a child window, the routine
374: sets \fIsubw\fP to that child window, otherwise it sets \fIsubw\fP to 0.
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.