Charles.Forsyth20060303-partialeea662d19 years agoHistory
137 lines · 3.1 KB · Text
RawDownload
.TH DRAW-SCREEN 2.SH NAMEScreen \-windows and subwindows on a display.SH SYNOPSIS.EXinclude	"draw.m";draw := load Draw Draw->PATH; Screen: adt{  id:        int;  image:     ref Image;  fill:      ref Image;  display:   ref Display;   allocate:  fn(image, fill: ref Image, public: int): ref Screen;  newwindow: fn(screen: self ref Screen, r: Rect,                backing:int, rgba: int): ref Image;  top:       fn(screen: self ref Screen, wins: array of ref Image);};.EE.SH DESCRIPTIONA.B Screenis the data structure representing a set of windows visible on a particular.B Imagesuch as the display or a parent window..TP 10.B idWhen a.B Screenobject is allocated (see.B allocatebelow), the system assigns it a unique integer,.BR id .It may be declared ``public'' and accessible toarbitrary processes and machines with access to the screen's.BR Display .The.B idvalue may be used as an argument to.BR Display.publicscreen ;see.IR draw-display (2)..TP.B fillWhen windows are deleted from a screen, the system uses the.B fillimage to repaint the screen's base image..TP.B imageThe image upon which the windows appear..TP.B displayThe display upon which the screen resides..TP.BI allocate( image\fP,\fP\ fill\fP,\fP\ public ).B Allocatemakes a new.B Screenobject.The.I imageargument provides the base image on which the windows will be made.The.I fillargument provides the.B Screen.fillimage..B Allocatedoes not affect the contents of.IR image ;it may be necessary after allocation to paint the base image with.BR fill ..IPUsing a non-zero.I publicargument allocates a public screen; zero requests a private screen.Public screens may be attached by any processon any machine with access to the.B Displayupon which the screen is allocated, enabling remote processes tocreate windows on the screen.Knowing only the.B idfield of the original.BR Screen ,the remote process can call the.B Display.publicscreenfunction to acquire a handle to the screen.The.B imageand.B fillfields of a.B Screenobtained this way are.BR nil ,but they are not needed for ordinary window management..TP.IB screen .newwindow( r\fP,\fP\ backing\fP,\fP\ rgba )Allocates a windowon the display at the specified rectangle with the backgroundcolour.IR rgba ,expressed in 32-bit RGBA format; the return value is an.B Imagethat may be used like any other.The.I backingparameter can be.BR Draw->Refbackup ,which provides backing store to store obscured parts of the window when necessary,and is used by the window manager and its clients; or.BR Draw->Refnone ,wihch provides no refresh, and is used for windows that are transient, or are already protected by backingstore..TP.IB screen .top( wins ).B Toporganizes a group of windows on a screen.Given.IR wins ,an array of window images, it places the.I wins[0]element at the top,.I wins[1]behind that, and so on,with the last element of.I winsin front of the all the windows on the screen not in.IR wins .Images in the array must be on the specified.I screen.RB ( nilelements are ignored).