DIRECTORY Xl; XlPerDepth: CEDAR DEFINITIONS ~ BEGIN Handle: TYPE = REF HandleRep; HandleRep: PRIVATE TYPE = RECORD [ last: REF READONLY PrivateRec ¬ NIL, initData: REF, init: InitProc, implData: REF ]; PrivateRec: PRIVATE TYPE = RECORD [ sd: Xl.ScreenDepth, sdData: REF ]; InlineGetData: PROC [h: Handle, sd: Xl.ScreenDepth] RETURNS [<> REF] = INLINE { pr: REF READONLY PrivateRec ¬ h.last; IF pr.sd=sd THEN RETURN [pr.sdData]; RETURN [GetData[h, sd]] }; GetData: PROC [h: Handle, sd: Xl.ScreenDepth] RETURNS [<> REF]; InitProc: TYPE = PROC [sd: Xl.ScreenDepth, initData: REF] RETURNS [<> REF]; InstallHandle: PROC [init: InitProc, initData: REF ¬ NIL] RETURNS [Handle]; END.  XlPerDepth.mesa Copyright Σ 1992 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, October 7, 1992 8:39:37 pm PDT Christian Jacobi, October 7, 1992 10:11 pm PDT A little X window utility to manage per screen depth data efficiently. This is useful for widgets which want to share certain information to reduce resource allocations, as well as for cases where real per screen depth data is needed. A handle represents the application or package. Returns (and creates if necessary) the per depth data of an application. Raises all errors raised by InitProc. Returns (and creates if necessary) the per depth data of an application Raises all errors raised by InitProc. Called once per ScreenDepth to create data. All errors are propagated to caller of GetData. Use this to set-up usage. Data is lost when connection dies (For garbage collection reasons). Implementation may then return data for NIL ScreenDepth. Restriction: handle is used as property key on ScreenDepth; clients should not interfere. ΚΑ•NewlineDelimiter ™code™Kšœ Οeœ1™