DIRECTORY Cursors, Icons, Menus, TIPUser, ViewerClasses; MJSContainers: CEDAR DEFINITIONS = BEGIN Viewer: TYPE = ViewerClasses.Viewer; ViewerRec: TYPE = ViewerClasses.ViewerRec; MJSContainer: TYPE = Viewer; MJSContainerClass: TYPE = REF MJSContainerClassRep; MJSContainerClassRep: TYPE = RECORD [ notify: ViewerClasses.NotifyProc _ NIL, paint: ViewerClasses.PaintProc _ NIL, modify: ViewerClasses.ModifyProc _ NIL, destroy: ViewerClasses.DestroyProc _ NIL, copy: ViewerClasses.CopyProc _ NIL, set: ViewerClasses.SetProc _ NIL, get: ViewerClasses.GetProc _ NIL, init: ViewerClasses.InitProc _ NIL, save: ViewerClasses.SaveProc _ NIL, caption: ViewerClasses.CaptionProc _ NIL, adjust: ViewerClasses.AdjustProc _ NIL, childAdjust: ChildAdjustProc _ NIL, menu: Menus.Menu _ NIL, tipTable: TIPUser.TIPTable _ NIL, icon: Icons.IconFlavor _ document, cursor: Cursors.CursorType _ textPointer, dontAdjustIconic: BOOL _ TRUE ]; ChildAdjustProc: TYPE = PROC [parent, child: Viewer] RETURNS [viewerToPaint: Viewer _ NIL, paintColumn: BOOL _ FALSE]; RegisterClass: PROC [viewerFlavor: ATOM, class: MJSContainerClass]; GetClass: PROC [viewerFlavor: ATOM] RETURNS [class: MJSContainerClass]; Create: PROC [viewerFlavor: ATOM, info: ViewerRec _ [], paint: BOOL _ TRUE] RETURNS [container: MJSContainer]; ChildYBound: PROC [container: MJSContainer, child: Viewer]; ChildXBound: PROC [container: MJSContainer, child: Viewer]; FlushChildX, FlushChildY: PROC [child: Viewer] RETURNS [changed: BOOL]; NoteSize: PROC [container: MJSContainer, mayPaint: BOOL] RETURNS [change: BOOL]; NoteChildSize: PROC [child: Viewer] RETURNS [viewerToPaint: Viewer, paintColumn: BOOL]; ScrollOffset: PROC [container: MJSContainer] RETURNS [offTop: INTEGER] ; HScrollOffset: PROC [container: MJSContainers.MJSContainer] RETURNS [offLeft: INTEGER] ; GetClientData: PROC [container: MJSContainer] RETURNS [clientData: REF ANY]; IsMJSContainer: PROC [viewer: Viewer] RETURNS [BOOL]; END. ˆMJSContainers.mesa Copyright c 1986, 1987 by Xerox Corporation. All rights reserved. Cloned from Containers.mesa, Edited by McGregor on October 21, 1982 4:10 pm Last Edited by: Maxwell, December 17, 1982 10:07 am Last Edited by: Mike Spreitzer, January 9, 1987 9:10:34 pm PST Last tweaked by Mike Spreitzer on March 16, 1988 4:20:59 pm PST Containers are just viewers that are convenient to hold other viewers. MJSContainers differ from standard ones (date of divergance: July 11, 1983) in that: MJSContainer is a subClass of Viewer. Clients may make their own subClass of MJSContainer (there is a standard subClass, VanillaMJSContainer, which may also be used), and thus MJSContainers have client data! An MJSContainer may have a ChildAdjustProc. If this is TRUE, none of the procedures that react to viewer sizes & positions operate while the container is iconic (or a descendant of an iconic viewer). Hint that a child viewer's size may have changed; can err in either direction. Can move anything around, but don't paint; return values indicate what needs painting. This must be called before you try to instantiate any of that class. Module start code does: RegisterClass[$VanillaMJSContainer, NEW [MJSContainerClassRep _ []]]; Returns NIL if no such class. Creates a new, empty MJSContainer. Pass client data in info.data (it won't stay there). Constrain (child.wy + child.wh = container.ch) after next time container is painted. Constrain (child.wx + child.ww = container.cw) after next time container is painted. Stretch child to indicated edge (without painting). Answer indicates work was needed to be done. Works for any kind of parent (and thus is not subject to the dontAdjustIconic prohibition of MJSContainers). Considers notifying client of size change. Does not propogate information `upward'. Reports whether anything (client or bounded children) changed. Paints if mayPaint AND change. Do NOT call NoteSize from within a ViewerClasses.PaintProc! Don't worry about calling this as a companion of Viewers calls --- Viewers takes care of that via the AdjustProc. Propogates size information up the viewers hierarchy, and reports lowest ancestor the painting of which covers changes. Do NOT call from within a PaintProc or AdjustProc! Viewers doesn't call this for you; you have to do it yourself. Returns the amount of the container scrolled off the top. Returns the amount of the container scrolled off the left. Κy– "cedar" style˜šΟc™Icodešœ Οmœ7™BJšK™KJšœ3™3J™>K™?—J˜šΟk œ/˜8K˜—KšΠbx œŸœŸ œ˜"K˜KšŸ˜K˜KšœŸœ˜$Kšœ Ÿœ˜*KšœŸœ ˜K˜KšœF™FšœT™TK™ΟK™+—K˜KšœŸœŸœ˜3šœŸœŸœ˜%Kšœ#Ÿœ˜'Jšœ!Ÿœ˜%Jšœ#Ÿœ˜'Jšœ%Ÿœ˜)JšœŸœ˜#JšœŸœ˜!JšœŸœ˜!JšœŸœ˜#JšœŸœ˜#Jšœ%Ÿœ˜)Kšœ#Ÿœ˜'KšœŸœ˜#JšœŸœ˜JšœŸœ˜!Jšœ"˜"Jšœ)˜)šœŸœŸ˜J™›—Jšœ˜—J˜K˜š œŸœŸœŸœŸœŸœŸœ˜vKšœ¦™¦—K˜šΟn œŸœŸœ˜CJ™Dšœ™Jšœ$Ÿœ™E——J˜š‘œŸœŸœŸœ˜GJ™—J˜š ‘œŸœŸœŸœŸœŸœ˜nKšW™W—K˜š‘ œŸœ*˜;KšT™TK˜—š‘ œŸœ*˜;KšT™T—K˜š ‘ œ‘ œŸœŸœ Ÿœ˜GKšœΞ™Ξ—K˜š ‘œŸœ%ŸœŸœ Ÿœ˜PK™*K™(K™>Kšœ™Kšœ;™;K™qK™—K˜š‘ œŸœŸœ&Ÿœ˜WK™wK™2K™>—K˜š‘ œŸœŸœ Ÿœ˜HJš9™9—J˜š‘ œŸœ)Ÿœ Ÿœ˜XJš:™:—K˜Kš ‘ œŸœŸœŸœŸœ˜LKš‘œŸœŸœŸœ˜5K˜KšŸœ˜K˜K˜—…—΄΅