3 Screen, allocscreen, publicscreen, freescreen, allocwindow, bottomwindow, bottomnwindows, topwindow, topnwindows, originwindow \- window management
18 Display *display; /* display holding data */
19 int id; /* id of system-held Screen */
20 Image *image; /* unused; for reference only */
21 Image *fill; /* color to paint behind windows */
27 Screen* allocscreen(Image *image, Image *fill, int public)
30 Screen* publicscreen(Display *d, int id, ulong chan)
33 int freescreen(Screen *s)
36 Image* allocwindow(Screen *s, Rectangle r, int ref, ulong col)
39 void bottomwindow(Image *w)
42 void bottomnwindows(Image **wp, int nw)
45 void topwindow(Image *w)
48 void topnwindows(Image **wp, int nw)
51 int originwindow(Image *w, Point log, Point scr)
65 Windows are represented as
67 and may be treated as regular images for all drawing operations.
68 The routines discussed here permit the creation, deletion, and shuffling
69 of windows, facilities that do not apply to regular images.
71 To create windows, it is first necessary to allocate a
73 data structure to gather them together.
76 turns an arbitrary image into something that may have windows upon it.
81 upon which to place the windows (typically
85 image to paint the background behind all the windows on the image,
86 and a flag specifying whether the result should be publicly visible.
87 If it is public, an arbitrary other program connected to the same
88 display may acquire a pointer to the same screen by calling
96 as well as the expected channel descriptor, as a safety check.
97 It will usually require some out-of-band coordination for programs to share a screen profitably.
101 although it may not actually disappear from view until all the windows upon it have also been deallocated.
108 initialize the appearance of the
111 Windows are created by
113 which takes a pointer to the
115 upon which to create the window, a rectangle
117 defining its geometry, an integer pixel value
119 to color the window initially, and a refresh method
121 The refresh methods are
123 which provides backing store and is the method used by
127 which provides no refresh and is designed for temporary uses
128 such as sweeping a display rectangle, for windows that are
129 completely covered by other windows, and for windows that
130 are already protected by backing store; and
132 which causes messages to be delivered to the owner of the window
133 when it needs to be repainted.
135 is not fully implemented.
141 pointer that may be treated like any other image.
142 In particular, it is freed by calling
146 The following functions, however, apply only to windows, not regular images.
151 to the bottom of the stack of windows on its
153 perhaps obscuring it.
157 to the top, making it fully visible on its
161 may itself be within a window that is not fully visible;
163 will not affect the stacking of this parent window.)
167 are analogous, but push or pull a group of
169 windows listed in the array
175 Each window is created as an
180 corresponds to the rectangle given to
182 when it was created. Thus, a newly created window
188 and has internal coordinates
190 Both these may be changed by a call to
196 define the upper left corner of the logical coordinate system
200 Their usage is shown in the Examples section.
203 creates its client windows with backing store,
205 The graphics initialization routine,
211 upon this, and then allocates upon that another window indented
212 to protect the border. That window is created
214 since the backing store created by
216 protects its contents. That window is the one known in the
217 library by the global name
219 (a historic but confusing choice).
221 To move a window to the upper left corner of the display,
223 originwindow(w, w->r.min, Pt(0, 0));
225 To leave a window where it is on the screen but change its internal
226 coordinate system so (0,\ 0) is the upper left corner of the window,
228 originwindow(w, Pt(0, 0), w->r.min);
232 is translated to the origin and there will be no way to discover the
233 actual screen position of the window unless it is recorded separately.