DIRECTORY Basics; XlKeyBut: CEDAR DEFINITIONS IMPORTS Basics = BEGIN KeyBut: TYPE = MACHINE DEPENDENT {shift, lock, control, mod1, mod2, mod3, mod4, mod5, button1, button2, button3, button4, button5}; SetOfKeyButMask: TYPE = WORD32 MACHINE DEPENDENT RECORD [ unused0: CARD16 ¬ 0, anyModfier: BOOL ¬ FALSE, --used for grabs only unused2: BOOL ¬ FALSE, unused3: BOOL ¬ FALSE, button5: BOOL ¬ FALSE, button4: BOOL ¬ FALSE, button3: BOOL ¬ FALSE, button2: BOOL ¬ FALSE, button1: BOOL ¬ FALSE, mod5: BOOL ¬ FALSE, mod4: BOOL ¬ FALSE, mod3: BOOL ¬ FALSE, mod2: BOOL ¬ FALSE, mod1: BOOL ¬ FALSE, control: BOOL ¬ FALSE, lock: BOOL ¬ FALSE, shift: BOOL ¬ FALSE ]; SetOfKeyMask: TYPE = SetOfKeyButMask; ORSetOfKeyButMask: PROC [s1, s2: SetOfKeyButMask] RETURNS [SetOfKeyButMask] = INLINE { RETURN [LOOPHOLE[Basics.BITOR[LOOPHOLE[s1], LOOPHOLE[s2]]]] }; IncludeKeyButInSet: PROC [keyBut: KeyBut, mask: SetOfKeyButMask ¬ []] RETURNS [SetOfKeyButMask] = INLINE { RETURN [LOOPHOLE[Basics.BITOR[ LOOPHOLE[mask], 2 ** LOOPHOLE[keyBut, [0..32)] ]]] }; IsKeyButInSet: PROC [keyBut: KeyBut, mask: SetOfKeyButMask] RETURNS [BOOL] = INLINE { RETURN [0 # Basics.BITAND[ LOOPHOLE[mask], 2 ** LOOPHOLE[keyBut, [0..32)] ]] }; END. 4XlKeyBut.mesa Copyright Σ 1991 by Xerox Corporation. All rights reserved. Christian Jacobi, February 6, 1991 11:18:58 am PST Christian Jacobi, September 12, 1991 11:24 am PDT Templates for working with KeyBut and SetOfKeyButMask. Factored out of Xl, as the memory layout and the inlines are machine dependent. This is a version which should work for both, big endian and little endian machines, but not for PrincOps. --This type is layed out so that its lower 16 bits match the layout in the protocol --never reported by server --fields for SetOfKeyButMask --fields for SetOfKeyMask and SetOfKeyButMask Inlined to enable constant folding Do not use an array as X and mimosa might index from opposite ends Inlined to enable constant folding Do not use an array as X and mimosa might index from opposite ends Κ•NewlineDelimiter –(cedarcode) style˜codešœ ™ Kšœ Οeœ2™=K™2K™1K™šœ6™6K™OK™k—K™—KšΟk œ˜K˜šΟnœžœž ˜Kšžœ ˜—šž˜K˜—šœžœžœž œc˜ƒK˜—š œžœžœžœž œžœ˜9KšœT™TKšœ™Kšœ žœ˜Kšœ žœžœΟc˜/Kšœ žœžœ˜Kšœ žœžœ˜Kšœ™Kšœ žœžœ˜Kšœ žœžœ˜Kšœ žœžœ˜Kšœ žœžœ˜Kšœ žœžœ˜Kšœ-™-Kšœžœžœ˜Kšœžœžœ˜Kšœžœžœ˜Kšœžœžœ˜Kšœžœžœ˜Kšœ žœžœ˜Kšœžœžœ˜Kšœžœž˜Kšœ˜—K˜Kšœžœ˜%K˜šŸœžœžœžœ˜VKš žœžœžœžœžœ˜;K˜K˜—šŸœžœ.žœžœ˜jKš "™"Kš B™Bšžœžœžœ˜Kšžœ˜Kšœžœ˜Kšœ˜—Kšœ˜—K˜š Ÿ œžœ)žœžœžœ˜UKš "™"Kš B™Bšžœ žœ˜Kšžœ˜Kšœžœ˜Kšœ˜—Kšœ˜—K˜Kšžœ˜K˜—…—Ζ ϋ