3 memdraw, memlalloc, memldelete, memlexpose, memlfree, memlhide, memline, memlnorefresh, memload, memunload, memlorigin, memlsetrefresh, memltofront, memltofrontn, memltorear, memltorearn \- windows of memory-resident images
12 .B #include <memdraw.h>
14 .B #include <memlayer.h>
17 typedef struct Memscreen Memscreen;
18 typedef struct Memlayer Memlayer;
19 typedef void (*Refreshfn)(Memimage*, Rectangle, void*);
20 .ta 4n +\w'\fLRefreshfn 'u +\w'\fL*frontmost; 'u
24 Memimage *frontmost; /* frontmost layer on screen */
25 Memimage *rearmost; /* rearmost layer on screen */
26 Memimage *image; /* upon which all layers are drawn */
27 Memimage *fill; /* if non-zero, picture to use when repainting */
32 Rectangle screenr; /* true position of layer on screen */
33 Point delta; /* add delta to go from image coords to screen */
34 Memscreen *screen; /* screen this layer belongs to */
35 Memimage *front; /* window in front of this one */
36 Memimage *rear; /* window behind this one*/
37 int clear; /* layer is fully visible */
38 Memimage *save; /* save area for obscured parts */
39 Refreshfn refreshfn; /* fn to refresh obscured parts if save==nil */
40 void *refreshptr; /* argument to refreshfn */
43 .ta \w'\fLMemimage* 'u
46 Memimage* memlalloc(Memscreen *s, Rectangle r, Refreshfn fn, void *arg, ulong col)
48 .B void memlnorefresh(Memimage *i, Rectangle r, void *arg)
51 int memlsetrefresh(Memimage *i, Refreshfn fn, void *arg)
54 int memldelete(Memimage *i)
57 int memlfree(Memimage *i)
60 int memlexpose(Memimage *i, Rectangle r)
63 int memlhide(Memimage *i, Rectangle r)
66 void memltofront(Memimage *i)
69 void memltofrontn(Memimage**ia, int n)
72 void memltorear(Memimage *i)
75 void memltorearn(Memimage **ia , int n)
78 int memlorigin(Memimage *i, Point log, Point phys)
81 void memdraw(Image *dst, Rectangle r,
84 Image *src, Point sp, Image *mask, Point mp, Drawop op)
87 int memload(Memimage *i, Rectangle r,
90 uchar *buf, int n, int iscompressed)
93 int memunload(Memimage *i, Rectangle r,
99 These functions build upon the
101 interface to maintain overlapping graphical windows on in-memory images.
102 They are used by the kernel to implement the windows interface presented by
106 and probably have little use outside of the kernel.
108 The basic function is to extend the definition of a
112 to include overlapping windows defined by the
115 The first fields of the
117 structure are identical to those in
119 permitting a function that expects a
124 Both structures have a
126 field, which is nil in a
128 and points to `backing store' in a
130 The layer routines accept
138 routine is called; otherwise the layer routines recursively
139 subdivide the geometry, reducing the operation into a smaller
140 component that ultimately can be performed on a
142 either the display on which the window appears, or the backing store.
145 are associated with a
147 that holds the data structures to maintain the windows and connects
148 them to the associated
152 color is used to paint the background when a window is deleted.
153 There is no function to establish a
155 to create one, allocate the memory, zero
161 to a valid fill color or image, and set
167 on which the windows will be displayed.
181 the new window will be initialized by painting it that color.
185 and associated argument
187 will be called by routines in the library to restore portions of the window
188 uncovered due to another window being deleted or this window being pulled to the front of the stack.
189 The function, when called,
190 receives a pointer to the image (window) being refreshed, the rectangle that has been uncovered,
193 recorded when the window was created.
194 A couple of predefined functions provide built-in management methods:
196 does no backup at all, useful for making efficient temporary windows;
199 function specifies that the backing store
200 .RB ( Memlayer.save )
201 will be used to keep the obscured data.
202 Other functions may be provided by the client.
204 allows one to change the function associated with the window.
209 restoring the underlying display.
211 frees the data structures without unlinking the window from the associated
213 or doing any graphics.
218 within the window, using the backing store or appropriate refresh method.
220 goes the other way, backing up
222 so that that portion of the screen may be modified without losing the data in this window.
227 to the front of the stack of windows, making it fully visible.
233 to the front as a group, leaving their internal order unaffected.
237 push the windows to the rear.
240 changes the coordinate systems associated with the window
246 represent the upper left corner
248 of the window's internal coordinate system and its physical location on the screen.
251 changes the interpretation of coordinates within the window; for example, setting it to
252 (0,\ 0) makes the upper left corner of the window appear to be the origin of the coordinate
253 system, regardless of its position on the screen.
256 changes the physical location of the window on the screen.
257 When a window is created, its logical and physical coordinates are the same, so
259 memlorigin(i, i->r.min, i->r.min)
266 are implemented in the layer library but provide the main entry points for drawing on
267 memory-resident windows.
268 They have the signatures of
283 are similarly layer-savvy versions of
291 specifies whether the
295 are in compressed image format
299 .B /usr/local/plan9/src/libmemlayer