DIRECTORY Xl, X11SelectionPrivate; X11SelectionPrivateImpl: CEDAR MONITOR IMPORTS Xl EXPORTS X11SelectionPrivate ~ BEGIN OPEN X11SelectionPrivate; myPropertyKey: REF ATOM ~ NEW[ATOM ¬ $selections]; cache1, cache2: ConnectionData ¬ NEW[ConnectionDataRec]; --Use two caches, typically owner and requestor use different connections InitConnection: Xl.InitializeProcType = { cd: ConnectionData ¬ NEW[ConnectionDataRec ¬ [connection: c]]; cd.hiddenParent ¬ Xl.CreateWindow[c: c, matchList: NIL, parent: Xl.DefaultRoot[c], class: inputOnly]; cd.atomPairXAtom ¬ Xl.MakeAtom[c, "ATOM_PAIR"]; cd.targetsXAtom ¬ Xl.MakeAtom[c, "TARGETS"]; cd.incrXAtom ¬ Xl.MakeAtom[c, "INCR"]; cd.timeStampXAtom ¬ Xl.MakeAtom[c, "TIMESTAMP"]; cd.multipleXAtom ¬ Xl.MakeAtom[c, "MULTIPLE"]; RETURN [cd] }; GetConnectionData: PUBLIC PROC [c: Xl.Connection] RETURNS [cd: ConnectionData] = { cd ¬ cache1; IF cd.connection=c THEN RETURN [cd]; cd ¬ cache2; IF cd.connection=c THEN RETURN [cd]; cd ¬ NARROW[Xl.GetConnectionPropAndInit[c, myPropertyKey, InitConnection]]; cache2 ¬ cache1; cache1 ¬ cd; RETURN [cd]; }; END. $X11SelectionPrivateImpl.mesa Copyright Σ 1991 by Xerox Corporation. All rights reserved. Christian Jacobi, January 30, 1991 1:11:03 pm PST Christian Jacobi, March 22, 1991 11:50 am PST --Initializes the per connection data --Return cached (or eventually created) per connection data Κ™•NewlineDelimiter –(cedarcode) style˜codešœ™Kšœ Οeœ1™Kšœ3žœ/˜eKšœ/˜/Kšœ,˜,Kšœ&˜&Kšœ0˜0Kšœ.˜.Kšžœ˜ K˜—K˜šŸœž œžœ˜RK™;Kšœ ˜ Kšžœžœžœ˜$Kšœ ˜ Kšžœžœžœ˜$Kšœžœ@˜KKšœ˜Kšœ ˜ Kšžœ˜ K˜—K˜Kšžœ˜K˜—…—J