<> <> <> <> <<>> DIRECTORY IO USING [STREAM], PropList USING [List], Rope USING [ROPE], KeyMappingTypes USING [Mapping], KeyStateTypes USING [KeyboardState], KeyTypes USING [KeyCode, KeySym], RelativeTimes USING [InlinePeriod, nullTimeStamp, TimeStamp], XlEndian USING [PackedRectangle], XlKeyBut USING [KeyBut, SetOfKeyButMask, SetOfKeyMask, ORSetOfKeyButMask, IncludeKeyButInSet, IsKeyButInSet], XlSetOfEvent USING [ORSetOfEvents, SetOfEvent]; Xl: CEDAR DEFINITIONS IMPORTS RelativeTimes, XlKeyBut, XlSetOfEvent ~ BEGIN <> <> <> <> <<>> ROPE: TYPE ~ Rope.ROPE; <> XError: SIGNAL [err: ErrorNotifyEvent]; <> <> <> <> <> ErrorKind: TYPE ~ MACHINE DEPENDENT { nil(0), request(1), value(2), window(3), pixmap(4), atom(5), cursor(6), font(7), match(8), drawable(9), access(10), alloc(11), colormap(12), gContext(13), idChoice(14), name(15), length(16), implementation(17), otherServer(240), clientError(251), sizeError(252), otherLocal(253), connectionWedged(254), requestFromDeadConnection(255) }; <> < otherServer its value is made up local.>> <> <> <> <> <> <> <> Connection: TYPE ~ REF ConnectionRep; <> <> ID: TYPE ~ CARD32; nullID: ID ~ 0; Drawable: TYPE ~ RECORD [id: ID]; nullDrawable: Drawable ~ [nullID]; Fontable: TYPE ~ REF ANY; nullFontable: Fontable ~ NIL; ColorMap: TYPE ~ RECORD [colorMapID: ID]; nullColorMap: ColorMap ~ [nullID]; ColorMapId: PROC [m: ColorMap] RETURNS [ID] ~ INLINE { RETURN[m.colorMapID] }; Window: TYPE ~ RECORD [drawable: Drawable]; <> <> <> <> nullWindow: Window ~ [nullDrawable]; WindowId: PROC [w: Window] RETURNS [ID] ~ INLINE { RETURN[w.drawable.id] }; Font: TYPE ~ REF FontRep; nullFont: Font ~ NIL; FontId: PROC [f: Font] RETURNS [ID]; <> Visual: TYPE ~ RECORD [visualID: ID]; nullVisual: Visual ~ [nullID]; VisualId: PROC [v: Visual] RETURNS [ID] ~ INLINE { RETURN[v.visualID] }; TimeStamp: TYPE ~ RelativeTimes.TimeStamp; currentTime: TimeStamp ~ RelativeTimes.nullTimeStamp; Period: PROC [from, to: TimeStamp] RETURNS [INT32] ~ INLINE { <> <> RETURN [RelativeTimes.InlinePeriod[from, to]] }; XAtom: TYPE ~ RECORD [a: CARD32]; AtomId: PROC [a: XAtom] RETURNS [ID] ~ INLINE { RETURN[a.a] }; Cursor: TYPE ~ RECORD [id: ID]; nullCursor: Cursor ~ [0]; CursorId: PROC [cursor: Cursor] RETURNS [ID] ~ INLINE { RETURN[cursor.id] }; Pixmap: TYPE ~ RECORD [drawable: Drawable]; nullPixmap: Pixmap ~ [nullDrawable]; PixmapId: PROC [p: Pixmap] RETURNS [ID] ~ INLINE { RETURN[p.drawable.id] }; Pixel: TYPE ~ CARD32; Screens: TYPE ~ REF READONLY ScreenSequence; ScreenSequence: TYPE ~ RECORD [ SEQUENCE numberOfScreens: NAT OF Screen ]; Screen: TYPE ~ REF READONLY ScreenRec; ScreenRec: TYPE ~ RECORD [ root: Window, defaultColorMap: ColorMap, whitePixel: Pixel, blackPixel: Pixel, currentInputMasks: SetOfEvent, sizeInPixels: Size, sizeInMillimeters: Size, minInstalledMaps: CARD16, maxInstalledMaps: CARD16, rootVisual: Visual, backingStores: MACHINE DEPENDENT {never, whenMapped, always}, saveUnders: BYTE, rootDepth: BYTE, nDepths: BYTE, connection: Connection, --not standard X screenNumber: INT, --not standard X properties: PropList.List ¬ NIL, --not standard X screenDepthL: ScreenDepthL ]; Format: TYPE ~ RECORD [ depth: BYTE, --only one Format per depth value bitsPerPixel: BYTE, --1, 4, 8, 16, 24, 32 scanlinePad: BYTE --8, 16, 32 ]; ScreenDepthTuples: TYPE ~ RECORD [SEQUENCE num: NAT OF ScreenDepth]; ScreenDepthL: TYPE ~ LIST OF READONLY ScreenDepth; ScreenDepth: TYPE ~ REF READONLY ScreenDepthRec; ScreenDepthRec: TYPE ~ RECORD [ screenDepthIndex: NAT, --not standard X; useful to make pixmap caches screen: Screen, --not standard X; but handy properties: PropList.List ¬ NIL, --not standard X depth: BYTE, nVisualTypes: CARD16, visuals: LIST OF READONLY VisualType ]; VisualClass: TYPE ~ MACHINE DEPENDENT {staticGray(0), grayScale(1), staticColor(2), pseudoColor(3), trueColor(4), directColor(5)}; VisualType: TYPE ~ REF READONLY VisualTypeRec; VisualTypeRec: TYPE ~ RECORD [ visual: Visual, class: VisualClass, bitsPerRgbValue: BYTE, colorMapEntries: CARD16, redMask: CARD32, greenMask: CARD32, blueMask: CARD32, properties: PropList.List ¬ NIL ]; Point: TYPE ~ RECORD [x, y: INT]; Size: TYPE ~ RECORD [width, height: INT]; <> <<>> dontUse: INT ~ FIRST[INT]; Geometry: TYPE ~ RECORD [ pos: Point ¬ [dontUse, dontUse], --upper left corner (outside of border) size: Size ¬ [dontUse, dontUse], --inner size (excluding border) borderWidth: INT ¬ dontUse --all in pixels ]; nullGeometry: Geometry ~ [[0,0], [0,0], 0]; --saves code... PackedRectangle: TYPE ~ XlEndian.PackedRectangle; <> PackedRects: TYPE ~ REF PackedRectangleSequence; PackedRectangleSequence: TYPE ~ RECORD [ SEQUENCE numberOfRects: NAT OF PackedRectangle ]; SequenceNo: TYPE ~ CARD32 ¬ 0; --only low 16 bits are used by X <> Endian: TYPE ~ MACHINE DEPENDENT {lsbFirst, msbFirst}; InfoRef: TYPE ~ REF READONLY ConnectionResponseInfoRec; ConnectionResponseInfoRec: TYPE ~ RECORD [ protocolMajorVersion: CARD16, protocolMinorVersion: CARD16, releaseNumber: CARD32, resourceIdBase: CARD32, resourceIdMask: CARD32, motionBufferSize: CARD32, maxRequestLength: INT, -- reduced by 8 maxRequestLengthBytes: INT, -- reduced by 32 numberOfFORMATs: BYTE, imageByteOrder: MACHINE DEPENDENT {lsbFirst, msbFirst}, bitmapFormatBitOrder: MACHINE DEPENDENT {leastSignificant, mostSignificant}, bitmapFormatScanlineUnit: BYTE, --8, 16, 32 <=bitmapFormatScanlinePad bitmapFormatScanlinePad: BYTE, --8, 16, 32 minKeycode: KeyCode, maxKeycode: KeyCode, vendor: ROPE, formats: LIST OF READONLY Format, screens: Screens ]; Info: PROC [c: Connection] RETURNS [InfoRef] ~ INLINE { RETURN [c.info]; }; Properties: PROC [c: Connection] RETURNS [PropList.List] ~ INLINE { RETURN [c.properties]; }; ServiceProperties: PROC [c: Connection] RETURNS [PropList.List] ~ INLINE { RETURN [c.serviceProperties]; }; ScreenCount: PROC [c: Connection] RETURNS [NAT] ~ INLINE { RETURN [c.info.screens.numberOfScreens]; }; FirstScreen: PROC [c: Connection] RETURNS [Screen] ~ INLINE { <> RETURN [c.info.screens[0]]; }; DefaultScreen: PROC [c: Connection] RETURNS [Screen] ~ INLINE { <> RETURN [c.info.screens[c.defaultScreenNumber]]; }; NthScreen: PROC [c: Connection, i: NAT] RETURNS [Screen] ~ INLINE { RETURN [c.info.screens[i]]; }; FirstRoot: PROC [c: Connection] RETURNS [w: Window]; <> <<>> DefaultRoot: PROC [c: Connection] RETURNS [w: Window]; <> ServerName: PROC [c: Connection] RETURNS [ROPE] ~ INLINE { RETURN [c.name]; }; ScreenDepthCount: PROC [c: Connection] RETURNS [NAT] ~ INLINE { RETURN [c.screenDepthS.num]; }; NthScreenDepth: PROC [c: Connection, n: NAT] RETURNS [ScreenDepth] ~ INLINE { RETURN [c.screenDepthS[n]]; }; Alive: PROC [c: Connection] RETURNS [BOOL] ~ INLINE { <> RETURN [c#NIL AND c.alive]; }; LastTime: PROC [c: Connection] RETURNS [TimeStamp] ~ INLINE { <> RETURN [c.lastTimeStamp]; }; PutConnectionProp: PROC [c: Connection, key: REF, val: REF ¬ NIL]; <> GetConnectionProp: PROC [c: Connection, key: REF] RETURNS [val: REF]; <> <<>> GetConnectionPropAndInit: PROC [c: Connection, key: REF, init: InitializeProcType] RETURNS [val: REF]; <> <> InitializeProcType: TYPE ~ PROC [c: Connection, key: REF] RETURNS [val: REF ¬ $x]; PutScreenProp: PROC [screen: Screen, key: REF, val: REF ¬ NIL]; <> GetScreenProp: PROC [screen: Screen, key: REF] RETURNS [val: REF]; <> <<>> PutScreenDepthProp: PROC [sd: ScreenDepth, key: REF, val: REF ¬ NIL]; <> GetScreenDepthProp: PROC [sd: ScreenDepth, key: REF] RETURNS [val: REF]; <> <<>> PutVisualTypeProp: PROC [vt: VisualType, key: REF, val: REF ¬ NIL]; <> GetVisualTypeProp: PROC [vt: VisualType, key: REF] RETURNS [val: REF]; <> <<>> QueryExtension: PROC [c: Connection, name: ROPE] RETURNS [QueryExtensionRec]; <> QueryExtensionRec: TYPE ~ RECORD [presentOnServer: BOOL, majorOpcode, firstEvent, firstError: BYTE]; ListExtensions: PROC [c: Connection] RETURNS [LIST OF ROPE]; <> <> CreateConnection: PROC [server: ROPE ¬ NIL, synchronized: BOOL ¬ FALSE, applicationKey: ATOM ¬ NIL, errorMatch: Match ¬ NIL, finalMatch: Match ¬ NIL, debugHelp: REF ¬ NIL] RETURNS [c: Connection ¬ NIL]; <> <> <> <> <> <> <> connectionNotCreated: SIGNAL [why: REF ConnectionRejectInfo]; ConnectionRejectInfo: TYPE ~ RECORD [ failedBeforeReachingXServer: BOOL, reason: ROPE, <<--defined only if X server reached>> protocolMajorVersion, protocolMinorVersion: CARD16 ]; IncRefCount: PROC [c: Connection, object: REF ¬ NIL]; <> <<>> DecRefCount: PROC [c: Connection, object: REF ¬ NIL]; <> CloseConnection: PROC [c: Connection]; <> Flush: PROC [c: Connection, delayed: BOOL ¬ FALSE]; <> <> RoundTrip: PROC [c: Connection, details: Details ¬ NIL]; <> <<>> WhenFlush: TYPE ~ {default, dont, soon, now}; LocalErrorReporting: TYPE ~ {ignore, inline, likeRemote}; Details: TYPE ~ REF DetailsRec; <> <> <
> <> <<>> DetailsRec: TYPE ~ RECORD [ <<--output specifications: set by impl and read by client>> sequenceNo: SequenceNo ¬ 0, --set by request (...no locking...). <<--input specifications: set by client and read by impl>> synchronous: BOOL ¬ FALSE, --makes request synchronous (overwrites other fields) localErrors: LocalErrorReporting ¬ ignore, --Locally recognized X errors, dead connections, but not programming errors errorMatch: Match ¬ NIL, --called on XError (ignores EventCodes) overMatch: Match ¬ NIL, --called on known absence of errors flush: WhenFlush ¬ default, --default flushes at least soon if a match is given <<--command specific options>> specific: REF ¬ NIL, --NIL is ok for all commands. <<--client only fields>> props: <> REF ¬ NIL, --for eventual implementation of property lists clientData: REF ¬ NIL --ignored by Xl and its impl ]; <<>> <> GrabServer: PROC [c: Connection, details: Details ¬ NIL]; <> <> <> UngrabServer: PROC [c: Connection, details: Details ¬ NIL]; <> AllowEventsMode: TYPE ~ MACHINE DEPENDENT {asyncPointer, syncPointer, replayPointer, asyncKeyboard, syncKeyboard, replayKeyboard}; AllowEvents: PROC [c: Connection, mode: AllowEventsMode, time: TimeStamp, details: Details ¬ NIL]; <> Synchronicity: TYPE ~ MACHINE DEPENDENT {synchronous, asynchronous}; GrabStatus: TYPE ~ MACHINE DEPENDENT {success, alreadyGrabbed, invalidTime, notViewable, frozen}; AddDispatchJunk: PROC [c: Connection, match: Match]; <> <<>> <> <> StandardAtom: PROC [name: ROPE] RETURNS [atom: XAtom]; <> <> MakeAtom: PROC [c: Connection, name: ROPE] RETURNS [atom: XAtom]; <> <> InternAtom: PROC [c: Connection, name: ROPE, create: BOOL ¬ TRUE] RETURNS [atom: XAtom, exist: BOOL]; <> GetAtomName: PROC [c: Connection, atom: XAtom] RETURNS [name: ROPE]; <> <> <> ChangePropertyMode: TYPE ~ MACHINE DEPENDENT {replace, prepend, append}; Card16Sequence: TYPE ~ RECORD[SEQUENCE leng: NAT OF CARD16]; Card32Sequence: TYPE ~ RECORD[SEQUENCE leng: NAT OF CARD32]; ChangeProperty: PROC [c: Connection, w: Window, property: XAtom, type: XAtom, mode: ChangePropertyMode ¬ replace, data: REF, start: INT ¬ 0, num: INT ¬ LAST[INT], details: Details ¬ NIL]; <> <> <> <> <> XPropInfo: PROC [data: REF] RETURNS [numberOfUnits, unitSize: INT]; <> <<>> GetProperty: PROC [c: Connection, w: Window, property: XAtom, supposedType: XAtom ¬ [0], delete: BOOL ¬ FALSE, longOff: INT ¬ 0, longLength: INT ¬ LAST[INT], supposedFormat: BYTE ¬ 0] RETURNS [PropertyReturnRec]; <> <> <<[if supposedFormat#0 and supposedFormat#format then discard value]>> PropertyReturnRec: TYPE ~ RECORD [ type: XAtom, format: BYTE, --one of 0, 8, 16, 32 value: REF, --one of NIL, ROPE, REF Card16Sequence, REF Card32Sequence bytesAfter: CARD32 --ignore or see X documentation... ]; DeleteProperty: PROC [c: Connection, w: Window, property: XAtom, details: Details ¬ NIL]; <> ListProperties: PROC [c: Connection, w: Window] RETURNS [list: LIST OF XAtom ¬ NIL, num: INT]; <> <<>> RotateProperties: PROC [c: Connection, w: Window, delta: INT, properties: LIST OF XAtom, details: Details ¬ NIL]; <> <> TQ: TYPE ~ REF TQRep; <> <> IsTQ: PROC [x: REF ANY] RETURNS [BOOL]; NarrowTQ: PROC [x: REF ANY] RETURNS [TQ]; PutTQProp: PROC [tq: TQ, key: REF, val: REF ¬ NIL]; GetTQProp: PROC [tq: TQ, key: REF] RETURNS [val: REF]; CreateTQ: PUBLIC PROC [createData: REF ¬ NIL, order: INT ¬ 0, reverse: BOOL ¬ FALSE] RETURNS [tq: TQ]; <> <> <> Enqueue: PROC [tq: TQ, proc: EventProcType, data: REF ¬ NIL, event: Event ¬ NIL]; <> <> <<>> CallWithLock: PROC [tq: TQ, proc: PROC]; <> <> <> <> <<>> CallWithLocks: PROC [proc: PROC, tq1, tq2: TQ]; <> <> <> <<>> OwnsLock: PROC [tq: TQ] RETURNS [BOOL]; <> <<>> GetLockOrder: PROC [first, second: TQ] RETURNS [LockOrder]; <> LockOrder: TYPE ~ {ok, reversed, dead}; GetLockOrderNum: PROC [tq: TQ] RETURNS [INT]; <> Match: TYPE ~ REF MatchRep; <> MatchList: TYPE ~ LIST OF Match; MatchRep: TYPE ~ RECORD [proc: EventProcType, handles: EventFilter, tq: TQ ¬ NIL, data: REF ¬ NIL]; <> <<"data" is passed throu to event handler procedure >> <> <> WindowClass: TYPE ~ MACHINE DEPENDENT {copyFromParent, inputOutput, inputOnly}; BackingStore: TYPE ~ MACHINE DEPENDENT {notUseful, whenMapped, always, illegal}; MapState: TYPE ~ MACHINE DEPENDENT {unmapped, unviewable, viewable}; BitGravity: TYPE ~ MACHINE DEPENDENT {forget(0), northWest(1), north(2), northEast(3), west(4), center(5), east(6), southWest(7), south(8), southEast(9), static(10), illegal(11) }; WinGravity: TYPE ~ MACHINE DEPENDENT {unmap(0), northWest(1), north(2), northEast(3), west(4), center(5), east(6), southWest(7), south(8), southEast(9), static(10), illegal(11) }; BitmapFormat: TYPE ~ MACHINE DEPENDENT {bitmap, xyPixmap, zPixmap}; PixmapFormat: TYPE ~ BitmapFormat[xyPixmap..zPixmap]; StackModeExtra: TYPE ~ MACHINE DEPENDENT {above, below, topIf, bottomIf, opposite, dontChange}; StackMode: TYPE ~ StackModeExtra[above..opposite]; <> illegalDrawable: Drawable ~ [LAST[CARD32]]; illegalPixmap: Pixmap ~ [illegalDrawable]; illegalPixel: Pixel ~ LAST[CARD32]; illegalColorMap: ColorMap ~ [LAST[CARD32]]; illegalCursor: Cursor ~ [LAST[CARD32]]; undefinedBackingPlanes: CARD32 ~ LAST[CARD32]; BOOL3: TYPE ~ MACHINE DEPENDENT {false, true, illegal}; IllegalPixmap: PROC [p: Pixmap] RETURNS [BOOL] ~ INLINE {RETURN [p=illegalPixmap]}; IllegalColorMap: PROC [cm: ColorMap] RETURNS [BOOL] ~ INLINE {RETURN [cm=illegalColorMap]}; IllegalCursor: PROC [c: Cursor] RETURNS [BOOL] ~ INLINE {RETURN [c=illegalCursor]}; Attributes: TYPE ~ RECORD [ <> <> backgroundPixmap: Pixmap ¬ illegalPixmap, backgroundPixel: Pixel ¬ illegalPixel, borderPixmap: Pixmap ¬ illegalPixmap, borderPixel: Pixel ¬ illegalPixel, bitGravity: BitGravity ¬ illegal, winGravity: WinGravity ¬ illegal, backingStore: BackingStore ¬ illegal, backingPlanes: CARD32 ¬ undefinedBackingPlanes, backingPixel: Pixel ¬ illegalPixel, overrideRedirect: BOOL3 ¬ illegal, saveUnder: BOOL3 ¬ illegal, eventMask: SetOfEvent ¬ unspecifiedEvents, doNotPropagateMask: SetOfEvent ¬ unspecifiedEvents, colorMap: ColorMap ¬ illegalColorMap, cursor: Cursor ¬ illegalCursor ]; MergeAttributes: PROC [win, loose: Attributes] RETURNS [Attributes]; <> <> CreateWindow: PROC [c: Connection, matchList: MatchList, parent: Window ¬ nullWindow, geometry: Geometry ¬ [], class: WindowClass ¬ copyFromParent, visual: Visual ¬ nullVisual, depth: INTEGER ¬ -1, attributes: Attributes ¬ [], details: Details ¬ NIL] RETURNS [Window]; <> <> <> <> <> ChangeWindowAttributes: PROC [c: Connection, window: Window, attributes: Attributes, details: Details ¬ NIL]; <> <> <> AddDispatch: PROC [c: Connection, window: Window, match: Match, generate: SetOfEvent ¬ unspecifiedEvents, details: Details ¬ NIL]; <> <> <> <> <<>> DestroyWindow: PROC [c: Connection, window: Window, details: Details ¬ NIL]; DestroySubWindows: PROC [c: Connection, window: Window, details: Details ¬ NIL]; MapWindow: PROC [c: Connection, window: Window, details: Details ¬ NIL]; MapSubWindows: PROC [c: Connection, window: Window, details: Details ¬ NIL]; UnmapWindow: PROC [c: Connection, window: Window, details: Details ¬ NIL]; UnmapSubWindows: PROC [c: Connection, window: Window, details: Details ¬ NIL]; ConfigureWindow: PROC [c: Connection, window: Window, geometry: Geometry ¬ [], sibling: Window ¬ nullWindow, stackMode: StackModeExtra ¬ dontChange, details: Details ¬ NIL]; <> ReparentWindow: PROC [c: Connection, window: Window, newParent: Window, pos: Point, details: Details ¬ NIL]; CirculateWindow: PROC [c: Connection, window: Window, direction: CirculateDirection, details: Details ¬ NIL]; CirculateDirection: TYPE ~ MACHINE DEPENDENT {raiseLowest, lowerHighest}; <<>> <> QueryTree: PROC [c: Connection, window: Window] RETURNS [treeInfo: REF TreeInfoRec]; TreeInfoRec: TYPE ~ RECORD [ root: Window, parent: Window, children: SEQUENCE leng: NAT OF Window ]; GetGeometry: PROC [c: Connection, drawable: Drawable] RETURNS [GeometryRec]; GeometryRec: TYPE ~ RECORD [ root: Window, depth: BYTE, geometry: Geometry ¬ nullGeometry ]; GetWindowAttributes: PROC [c: Connection, window: Window] RETURNS [rat: RepliedAttributes]; RepliedAttributes: TYPE ~ RECORD [ <> backingStore: BackingStore, visual: Visual, class: WindowClass[inputOutput..inputOnly], bitGravity: BitGravity, winGravity: WinGravity, backingPlanes: CARD32, backingPixel: Pixel, saveUnder: BOOL, isInstalled: BOOL, mapState: MapState, overrideRedirect: BOOL, colorMap: ColorMap, -- ¬ nullColorMap allEventMask: SetOfEvent, yourEventMask: SetOfEvent, doNotPropagateMask: SetOfEvent ]; QueryScreen: PROC [c: Connection, drawable: Drawable] RETURNS [Screen]; <> <> QueryScreenDepth: PROC [c: Connection, drawable: Drawable] RETURNS [depth: ScreenDepth]; <> <> TranslateCoordinates: PROC [c: Connection, srcWindow, dstWindow: Window, srcPos: Point] RETURNS [TranslateRec]; TranslateRec: TYPE ~ RECORD [sameScreen: BOOL, child: Window, pos: Point]; <> CreateCursor: PROC [c: Connection, source: Pixmap, mask: Pixmap ¬ nullPixmap, hotP: Point, foreground: REF READONLY RGBRec ¬ black, background: REF READONLY RGBRec ¬ white, details: Details ¬ NIL] RETURNS [cursor: Cursor]; CreateGlyphCursor: PROC [c: Connection, sourceFont: Font, maskFont: Font ¬ nullFont, sourceChar: CARD16, maskChar: CARD16 ¬ 0, foreground: REF READONLY RGBRec ¬ black, background: REF READONLY RGBRec ¬ white, details: Details ¬ NIL] RETURNS [cursor: Cursor]; ReColorCursor: PROC [c: Connection, cursor: Cursor, foreground: REF READONLY RGBRec ¬ black, background: REF READONLY RGBRec ¬ white, details: Details ¬ NIL]; FreeCursor: PROC [c: Connection, cursor: Cursor, details: Details ¬ NIL]; CreatePixmap: PROC [c: Connection, drawable: Drawable ¬ nullDrawable, size: Size, depth: BYTE, details: Details ¬ NIL] RETURNS [Pixmap]; FreePixmap: PROC [c: Connection, pixmap: Pixmap, details: Details ¬ NIL]; <> IsFont: PROC [x: REF ANY] RETURNS [BOOL]; NarrowFont: PROC [x: REF ANY] RETURNS [Font]; OpenFont: PROC [c: Connection, name: ROPE, details: Details ¬ NIL] RETURNS [font: Font]; <> <
> PreventGcOnServer: PROC [font: Font]; <> GetFontPath: PROC [c: Connection] RETURNS [LIST OF ROPE]; CharInfoSequence: TYPE ~ RECORD [SEQUENCE size: NAT OF CharInfoRec]; CharInfoRec: TYPE ~ PACKED RECORD [ leftBearing: INT16, rightBearing: INT16, charWidth: INT16, ascent: INT16, descent: INT16, attributes: CARD16 ]; FontPropSequence: TYPE ~ RECORD [SEQUENCE size: NAT OF FontPropRec]; FontPropRec: TYPE ~ RECORD [ name: XAtom, value: CARD32 ]; DrawDirection: TYPE ~ MACHINE DEPENDENT {leftToRight, rightToLeft}; QueryFont: PROC [c: Connection, font: Fontable] RETURNS [REF READONLY FontInfoRec]; <> FontInfoRec: TYPE ~ RECORD [ minBounds: REF READONLY CharInfoRec, maxBounds: CharInfoRec, minCharOrByte2: CARD, maxCharOrByte2: CARD, defaultChar: CARD16, drawDirection: DrawDirection, minByte1: INT, maxByte1: INT, allCharsExist: BOOL, fontAscent: INT, fontDescent: INT, properties: REF READONLY FontPropSequence, charInfos: REF READONLY CharInfoSequence ]; QueryTextExtents: PROC [c: Connection, font: Fontable, r: ROPE] RETURNS [TextExtentsRec]; QueryTextExtents16: PROC [c: Connection, font: Fontable, s: String16] RETURNS [TextExtentsRec]; <> TextExtentsRec: TYPE ~ RECORD [ drawDirection: DrawDirection, fontAscent: INT, fontDescent: INT, overallAscent: INT, overallDescent: INT, overallWidth: INT, overallLeft: INT, overallRight: INT ]; ListFonts: PROC [c: Connection, each: NameProc, pattern: ROPE, maxNames: NAT ¬ 40, data: REF ¬ NIL]; <> <> NameProc: TYPE ~ PROC [name: ROPE, data: REF] RETURNS [quit: BOOL ¬ FALSE]; ListFontsWithInfo: PROC [c: Connection, each: FontInfoProc, pattern: ROPE, maxNames: NAT, data: REF ¬ NIL] RETURNS [count: INT]; <> <> <> <> <<>> FontInfoProc: TYPE ~ PROC [name: Rope.ROPE, info: REF FontInfoRec, data: REF] RETURNS [quit: BOOL ¬ FALSE]; <> <> <> GetPointerMapping: PUBLIC PROC [c: Connection] RETURNS [pointerMapping: PointerMapping]; <> PointerMapping: TYPE ~ REF READONLY PointerMappingSequence; PointerMappingSequence: TYPE ~ RECORD [SEQUENCE leng: NAT OF BYTE]; <<--nominal mapping: map[i]=i>> <<--index 0 unused>> GrabPointer: PROC [c: Connection, window: Window, ownerEvents: BOOL, eventMask: SetOfPointerEvent, pointerMode: Synchronicity ¬ asynchronous, keyboardMode: Synchronicity ¬ asynchronous, confine: Window ¬ nullWindow, cursor: Cursor ¬ nullCursor, timeStamp: TimeStamp] RETURNS [status: GrabStatus]; <> <> <> UngrabPointer: PROC [c: Connection, timeStamp: TimeStamp, details: Details ¬ NIL]; <> ChangeActivePointerGrab: PROC [c: Connection, eventMask: SetOfPointerEvent, cursor: Cursor ¬ nullCursor, timeStamp: TimeStamp, details: Details ¬ NIL]; GrabButton: PROC [c: Connection, grabWindow: Window, confineWindow: Window ¬ nullWindow, modifiers: SetOfKeyButMask ¬ [anyModfier: TRUE], button: BYTE ¬ 0, ownerEvents: BOOL, eventMask: SetOfPointerEvent, pointerMode: Synchronicity, keyboardMode: Synchronicity, cursor: Cursor ¬ nullCursor, details: Details ¬ NIL]; <> UngrabButton: PROC [c: Connection, window: Window, modifiers: SetOfKeyButMask ¬ [anyModfier: TRUE], button: BYTE ¬ 0, details: Details ¬ NIL]; QueryPointer: PROC [c: Connection, window: Window ¬ nullWindow] RETURNS [PointerReply]; PointerReply: TYPE ~ RECORD [ root: Window, child: Window, --or nullWindow rootP: Point, pos: Point, mask: SetOfKeyButMask, sameScreen: BOOL ]; WarpPointer: PROC [c: Connection, dstWindow: Window ¬ nullWindow, dstPos: Point ¬ [0, 0], srcWindow: Window ¬ nullWindow, srcPos: Point ¬ [0, 0], srcSize: Size ¬ [0, 0], details: Details ¬ NIL]; GetMotionEvents: PROC [c: Connection, window: Window, start, stop: TimeStamp] RETURNS [REF TimeCoords]; TimeCoord: TYPE ~ RECORD [time: TimeStamp, p: Point]; TimeCoords: TYPE ~ RECORD [SEQUENCE size: NAT OF TimeCoord]; QueryBestSize: PROC [c: Connection, class: BestSizeClass, drawable: Drawable, size: Size] RETURNS [Size]; BestSizeClass: TYPE ~ MACHINE DEPENDENT {cursor, tile, stipple}; <> <> <> <> ButtonGrabOwner: PROC [c: Connection] RETURNS [REF] ~ INLINE {RETURN [c.buttonGrabOwner]}; <> <> <<>> SetButtonGrabOwner: PROC [c: Connection, timeStamp: TimeStamp, value: REF] RETURNS [success: SetGrabOwnerSuccess]; <> <> <> <> <> SetGrabOwnerSuccess: TYPE ~ {failedFutureTime, failedLaterTime, failedEqualTime, succeeded}; ClearButtonGrabOwner: PROC [c: Connection, timeStamp: TimeStamp]; <> <> <> <> <> KeyBut: TYPE ~ XlKeyBut.KeyBut; SetOfKeyButMask: TYPE ~ XlKeyBut.SetOfKeyButMask; SetOfKeyMask: TYPE ~ XlKeyBut.SetOfKeyMask; ORSetOfKeyButMask: PROC [s1, s2: SetOfKeyButMask] RETURNS [SetOfKeyButMask] ~ INLINE { RETURN [XlKeyBut.ORSetOfKeyButMask[s1, s2]]; }; IncludeKeyButInSet: PROC [keyBut: KeyBut, mask: SetOfKeyButMask ¬ []] RETURNS [SetOfKeyButMask] ~ INLINE { RETURN [XlKeyBut.IncludeKeyButInSet[keyBut, mask]] }; IsKeyButInSet: PROC [keyBut: KeyBut, mask: SetOfKeyButMask] RETURNS [BOOL] ~ INLINE { RETURN [XlKeyBut.IsKeyButInSet[keyBut, mask]] }; KeyCode: TYPE ~ KeyTypes.KeyCode; <> <> <<>> KeySym: TYPE ~ KeyTypes.KeySym; <> noSym: KeySym ~ [0]; <<>> KeyboardMapping: TYPE ~ KeyMappingTypes.Mapping; <> <> GetKeyboardMapping: PROC [c: Connection] RETURNS [KeyboardMapping]; <> <> <> GetModifierMapping: PROC [c: Connection] RETURNS [modifierMapping: ModifierMapping]; <> Modifier: TYPE ~ KeyBut[shift..mod5]; ModifierMappingSequence: TYPE ~ RECORD [SEQUENCE num: NAT OF ARRAY Modifier OF KeyCode]; ModifierMapping: TYPE ~ REF READONLY ModifierMappingSequence; KeyboardState: TYPE ~ KeyStateTypes.KeyboardState; QueryKeymap: PROC [c: Connection, reUse: REF KeyboardState ¬ NIL] RETURNS [REF KeyboardState]; <> GrabKeyboard: PROC [c: Connection, grabWindow: Window, ownerEvents: BOOL, pointerMode: Synchronicity, keyboardMode: Synchronicity, time: TimeStamp] RETURNS [status: GrabStatus]; <> <> <<>> UngrabKeyboard: PROC [c: Connection, time: TimeStamp, details: Details ¬ NIL]; <> ForcedUngrabKeyboard: PROC [c: Connection]; <> <<[UngrabKeyboard, faking the identity of the Connection which actually did the grab]>> <<...If that connection is not wedged and allows doing it... [time's out if doesn't come through]>> <> GrabKey: PROC [c: Connection, grabWindow: Window, modifiers: SetOfKeyButMask ¬ [anyModfier: TRUE], key: KeyCode ¬ anyKey, ownerEvents: BOOL, pointerMode: Synchronicity, keyboardMode: Synchronicity, details: Details ¬ NIL]; <> anyKey: KeyCode ~ keycode0; UngrabKey: PROC [c: Connection, window: Window, modifiers: SetOfKeyButMask ¬ [anyModfier: TRUE], key: KeyCode ¬ anyKey, details: Details ¬ NIL]; <> Bell: PROC [c: Connection, percent: INT ¬ 0, details: Details ¬ NIL]; <> SetSelectionOwner: PROC [c: Connection, owner: Window ¬ nullWindow, selection: XAtom, time: TimeStamp, details: Details ¬ NIL]; <> <> GetSelectionOwner: PROC [c: Connection, selection: XAtom] RETURNS [owner: Window ¬ nullWindow]; ConvertSelection: PROC [c: Connection, requestor: Window, selection: XAtom, target: XAtom, property: XAtom, time: TimeStamp, details: Details ¬ NIL]; <> <> SendSelectionNotifyEvent: PROC [c: Connection, destination: Window, selection: XAtom, target: XAtom, property: XAtom ¬ [0], timeStamp: TimeStamp, details: Details ¬ NIL]; <> <> FocusReversion: TYPE ~ MACHINE DEPENDENT {none, pointerRoot, parent}; focusPointerRoot: Window ~ [[1]]; SetInputFocus: PROC [c: Connection, window: Window ¬ nullWindow, revertTo: FocusReversion ¬ parent, timeStamp: TimeStamp, details: Details ¬ NIL]; <> <> GetInputFocus: PUBLIC PROC [c: Connection] RETURNS [window: Window ¬ nullWindow, revertTo: FocusReversion]; <> <> <> GContext: TYPE ~ REF GContextRep; <> <> <> <<>> IsGContext: PROC [x: REF ANY] RETURNS [BOOL]; NarrowGContext: PROC [x: REF ANY] RETURNS [GContext]; GCFunction: TYPE ~ MACHINE DEPENDENT {clear, and, andReverse, copy, andInverted, noop, xor, or, nor, equiv, invert, orReverse, copyInverted, orInverted, nand, set}; GCLineStyle: TYPE ~ MACHINE DEPENDENT {solid, onOffDash, doubleDash}; GCCapStyle: TYPE ~ MACHINE DEPENDENT {notLast, butt, round, projecting}; GCJoinStyle: TYPE ~ MACHINE DEPENDENT {miter, round, bevel}; GCFillStyle: TYPE ~ MACHINE DEPENDENT {solid, tiled, stippled, opaqueStippled}; GCFillRule: TYPE ~ MACHINE DEPENDENT {evenOdd, winding}; GCArcMode: TYPE ~ MACHINE DEPENDENT {chord, pieSlice}; GCSubWindowMode: TYPE ~ MACHINE DEPENDENT {clipByChildren, includeInferiors}; MakeGContext: PROC [c: Connection, drawable: Drawable ¬ nullDrawable] RETURNS [gc: GContext]; <> <> <> <> <<>> <> SetGCFunction: PROC [gc: GContext, function: GCFunction]; SetGCPlaneMask: PROC [gc: GContext, planeMask: CARD32]; SetGCForeground: PROC [gc: GContext, foreground: CARD32]; SetGCBackground: PROC [gc: GContext, background: CARD32]; SetGCGrounds: PROC [gc: GContext, foreground, background: CARD32]; SetGCLineWidth: PROC [gc: GContext, width: INT]; SetGCLineStyle: PROC [gc: GContext, lineStyle: GCLineStyle]; SetGCCapStyle: PROC [gc: GContext, capStyle: GCCapStyle]; SetGCJoinStyle: PROC [gc: GContext, joinStyle: GCJoinStyle]; SetGCFillStyle: PROC [gc: GContext, fillStyle: GCFillStyle]; SetGCFillRule: PROC [gc: GContext, fillRule: GCFillRule]; SetGCArcMode: PROC [gc: GContext, arcMode: GCArcMode]; SetGCTile: PROC [gc: GContext, tile: Pixmap]; SetGCStipple: PROC [gc: GContext, stipple: Pixmap]; SetGCStippleOrigin: PROC [gc: GContext, origin: Point]; SetGCFont: PROC [gc: GContext, font: Font]; SetGCSubWindowMode: PROC [gc: GContext, subwindowMode: GCSubWindowMode]; SetGCGraphicsExposures: PROC [gc: GContext, graphicsExposures: BOOL]; SetGCClipMaskOrigin: PROC [gc: GContext, origin: Point]; SetGCClipMask: PROC [gc: GContext, clipMask: Pixmap ¬ nullPixmap --no clip--]; SetGCDashOffset: PROC [gc: GContext, offset: CARD16];--not the SetDashes protocol request SetGCDashes: PROC [gc: GContext, dashes: BYTE];--not the SetDashes protocol request <> SetDashes: PROC [c: Connection, gc: GContext, dashOffset: CARD16, dashes: LIST OF BYTE, details: Details ¬ NIL]; SetClipRectangles: PROC [c: Connection, gc: GContext, clipOrigin: Point ¬ [0, 0], rects: PackedRects, ordering: Ordering ¬ unSorted, start: NAT ¬ 0, number: NAT ¬ LAST[NAT], details: Details ¬ NIL] RETURNS [ok: BOOL]; <> << if not ok some rectangles are ignored >> Ordering: TYPE ~ MACHINE DEPENDENT {unSorted, ySorted, yxSorted, yxBanded}; <<>> ClearArea: PROC [c: Connection, window: Window, pos: Point, size: Size, exposures: BOOL ¬ FALSE, details: Details ¬ NIL]; CopyArea: PROC [c: Connection, src, dst: Drawable, srcP, dstP: Point, size: Size, gc: GContext, details: Details ¬ NIL]; CopyPlane: PROC [c: Connection, src, dst: Drawable, srcP, dstP: Point, size: Size, gc: GContext, bitPlane: CARD, details: Details ¬ NIL]; FillRectangle: PROC [c: Connection, drawable: Drawable, gc: GContext, pos: Point, size: Size, details: Details ¬ NIL]; <> PolyFillRectangle: PROC [c: Connection, drawable: Drawable, gc: GContext, rects: PackedRects, start: NAT ¬ 0, number: NAT ¬ LAST[NAT], details: Details ¬ NIL]; DrawLine: PROC [c: Connection, drawable: Drawable, p1, p2: Point, gc: GContext, details: Details ¬ NIL]; <> PutImage: PROC [c: Connection, drawable: Drawable, gc: GContext, size: Size, dest: Point, base: LONG POINTER, offx: INT, offy: INT, scanLineBytes: INT, bitsPerPixel: NAT ¬ 1, details: Details ¬ NIL]; <<"bit-blit" of area. X PutImage request; generalized to have arbitrary offx, offy.>> <> <> <> <> <> <> <> <> <> <> <<>> GetImage: PROC [c: Connection, drawable: Drawable, pos: Point, size: Size, format: PixmapFormat, planeMask: CARD32 ¬ LAST[CARD32]] RETURNS [GetImageReplyRec]; <> <<>> GetImageReplyRef: TYPE ~ REF GetImageReplyRec; GetImageReplyRec: TYPE ~ RECORD [ depth: BYTE, visual: Visual, base: LONG POINTER, --may point into middle of object byteCount: INT, --of this piece; check "next" to see for more pieces anchor: REF, --keep on to prevent garbage collection next: GetImageReplyRef ¬ NIL --continuation in case of too many bytes ]; <> String16: TYPE ~ RECORD [s: ROPE]; RopeToString16: PROC [r: ROPE] RETURNS [String16]; ImageChar: PROC [c: Connection, drawable: Drawable, pos: Point, gc: GContext, ch: CHAR, details: Details ¬ NIL]; <> <> <> ImageRope: PROC [c: Connection, drawable: Drawable, pos: Point, gc: GContext, r: ROPE, details: Details ¬ NIL]; <> <> ImageString16: PROC [c: Connection, drawable: Drawable, pos: Point, gc: GContext, s: String16, details: Details ¬ NIL]; <> <> PolyText8: PROC [c: Connection, drawable: Drawable, pos: Point, gc: GContext, deliver: Text8DeliverProc, data: REF ¬ NIL, details: Details ¬ NIL]; <> Text8DeliverProc: TYPE ~ PROC [data: REF] RETURNS [newFont: Font ¬ NIL, delta: INT ¬ 0, text: Rope.ROPE, startPos: INT ¬ 0, length: INT ¬ LAST[INT], more: BOOL ¬ FALSE]; DrawChar: PROC [c: Connection, drawable: Drawable, pos: Point, gc: GContext, ch: CHAR, delta: INT ¬ 0, details: Details ¬ NIL]; <> <> DrawRope: PROC [c: Connection, drawable: Drawable, pos: Point, gc: GContext, r: ROPE, delta: INT ¬ 0, details: Details ¬ NIL]; <> <> DrawString16: PROC [c: Connection, drawable: Drawable, pos: Point, gc: GContext, s: String16, delta: INT ¬ 0, details: Details ¬ NIL]; <> <> <> <> RGBVal: TYPE ~ CARD16; RGBRec: TYPE ~ RECORD [ red, green, blue: RGBVal ]; white: READONLY REF READONLY RGBRec; black: READONLY REF READONLY RGBRec; CreateColorMap: PROC [c: Connection, visual: Visual, window: Window, allocAll: BOOL ¬ FALSE, details: Details ¬ NIL] RETURNS [ColorMap]; FreeColorMap: PROC [c: Connection, colorMap: ColorMap, details: Details ¬ NIL]; CopyColorMapAndFree: PROC [c: Connection, free: ColorMap, details: Details ¬ NIL] RETURNS [ColorMap]; InstallColorMap: PROC [c: Connection, colorMap: ColorMap, details: Details ¬ NIL]; UnInstallColorMap: PROC [c: Connection, colorMap: ColorMap, details: Details ¬ NIL]; ListInstalledColorMaps: PROC [c: Connection, window: Window] RETURNS [REF READONLY ColorMaps]; ColorMaps: TYPE ~ RECORD [SEQUENCE count: NAT OF ColorMap]; AllocColor: PROC [c: Connection, colorMap: ColorMap, color: RGBRec] RETURNS [pixel: Pixel, usedColor: RGBRec]; AllocNamedColor: PROC [c: Connection, colorMap: ColorMap, name: ROPE] RETURNS [pixel: Pixel, exactColor, usedColor: RGBRec]; AllocColorCells: PROC [c: Connection, colorMap: ColorMap, colors, planes: CARD16, contiguos: BOOL¬FALSE] RETURNS [pixels: REF Card32Sequence, masks: REF Card32Sequence]; AllocColorPlanes: PROC [c: Connection, colorMap: ColorMap, colors, reds, greens, blues: CARD16, contiguos: BOOL¬FALSE] RETURNS [pixels: REF Card32Sequence, redMask, greenMask, blueMask: CARD32]; FreeColors: PROC [c: Connection, colorMap: ColorMap, pixels: LIST OF CARD32, planeMask: CARD32, details: Details ¬ NIL]; StoreColors: PROC [c: Connection, colorMap: ColorMap, items: LIST OF ColorItem, details: Details ¬ NIL]; ColorItem: TYPE ~ RECORD [pixel: Pixel, doRed, doGreen, doBlue: BOOL ¬ TRUE, rgb: RGBRec]; StoreNamedColor: PROC [c: Connection, colorMap: ColorMap, pixel: Pixel, name: ROPE, doRed, doGreen, doBlue: BOOL, details: Details ¬ NIL]; QueryColors: PROC [c: Connection, colorMap: ColorMap, pixels: LIST OF CARD32] RETURNS [LIST OF RGBRec]; LookupColor: PROC [c: Connection, colorMap: ColorMap, name: ROPE] RETURNS [exact, used: RGBRec]; <> EventCode: TYPE ~ MACHINE DEPENDENT { local(0), errorNotify(1), keyPress(2), keyRelease(3), buttonPress(4), buttonRelease(5), motionNotify(6), enterNotify(7), leaveNotify(8), focusIn(9), focusOut(10), keymapNotify(11), expose(12), graphicsExposure(13), noExposure(14), visibilityNotify(15), createNotify(16), destroyNotify(17), unmapNotify(18), mapNotify(19), mapRequest(20), reparentNotify(21), configureNotify(22), configureRequest(23), gravityNotify(24), resizeRequest(25), circulateNotify(26), circulateRequest(27), propertyNotify(28), selectionClear(29), selectionRequest(30), selectionNotify(31), colorMapNotify(32), clientMessage(33), mappingNotify(34), extension, finalEvent, tipEvent, replyEvent }; <> <> <> <> <> <> <> <> <<>> SetEventCodes: PROC [list: LIST OF EventCode] RETURNS [EventCodes]; <> <<>> EventCodeRope: PROC [code: EventCode] RETURNS [r: ROPE]; <> EventProcType: TYPE ~ PROC [event: Event, clientData: REF, tq: TQ]; <> <> <> EventFilter: TYPE ~ REF EventFilterRec; <> EventCodes: TYPE ~ PACKED ARRAY EventCode[EventCode.FIRST..EventCode.LAST] OF BOOL ¬ ALL[FALSE]; <> <> CreateEventFilter: PROC [c1, c2, c3, c4: EventCode ¬ extension] RETURNS [filter: EventFilter]; <> <<>> FullCreateEventFilter: PROC [eventCodes: LIST OF EventCode ¬ NIL, activate: EventCodes ¬ ALL[FALSE], extensions: LIST OF REF ANY ¬ NIL] RETURNS [filter: EventFilter]; <> PropertyNotifyState: TYPE ~ MACHINE DEPENDENT {newValue, deleted}; MappingNotifyKind: TYPE ~ MACHINE DEPENDENT {modifier, keyboard, pointer}; FocusDetail: TYPE ~ MACHINE DEPENDENT {ancestor, virtual, inferior, nonlinear, nonlinearVirtual, Pointer, PointerRoot, None}; EnterLeaveDetail: TYPE ~ FocusDetail[ancestor..nonlinearVirtual]; GrabMode: TYPE ~ MACHINE DEPENDENT {normal, grab, ungrab, whileGrabbed}; Visibility: TYPE ~ MACHINE DEPENDENT {unobscured, partiallyObscured, fullyObscured}; Place: TYPE ~ MACHINE DEPENDENT {top, bottom}; NormalHint: TYPE ~ MACHINE DEPENDENT {normal(0), hint(1)}; Event: TYPE ~ REF READONLY EventRep; EventRep: TYPE ~ RECORD [ originalCodeByte: BYTE ¬ ORD[EventCode[local]], dispatchDrawable: Drawable ¬ nullDrawable, connection: Connection ¬ NIL, <> <> props: <> REF ¬ NIL, details: SELECT type: EventCode FROM local => [who, key, data: REF], --event was not passed through an X server errorNotify => [ --this need not be the original X error event; <<--Errors can not be matched the standard way>> explanation: ROPE ¬ NIL, errorKind: ErrorKind ¬ nil, serverGenerated: BOOL ¬ FALSE, <<--if serverGenerated the X protocol explains what went wrong>> <<--if not serverGenerated this is added functionality by Xl>> seq: SequenceNo, --sequence, connection and other field not always initialized originalError: BYTE ¬ 0, majorOpCode: BYTE ¬ 0, minorOpCode: CARD16 ¬ 0, badValue: CARD32 ¬ 0, replyText, internal: REF ¬ NIL], keyPress, keyRelease => [ keyCode: KeyCode, seq: SequenceNo, timeStamp: TimeStamp, root: Window, eventWindow: Window, child: Window, -- ¬ nullWindow, rootP: Point, pos: Point, state: SetOfKeyButMask, --immediately before event sameScreen: BOOL], buttonPress, buttonRelease => [ button: BYTE, seq: SequenceNo, timeStamp: TimeStamp, root: Window, eventWindow: Window, child: Window, -- ¬ nullWindow, rootP: Point, pos: Point, state: SetOfKeyButMask, --immediately before event sameScreen: BOOL], motionNotify => [ detail: NormalHint, seq: SequenceNo, timeStamp: TimeStamp, root: Window, eventWindow: Window, child: Window, rootP: Point, pos: Point, state: SetOfKeyButMask, sameScreen: BOOL], enterNotify, leaveNotify => [ detail: EnterLeaveDetail, seq: SequenceNo, timeStamp: TimeStamp, root: Window, eventWindow: Window, child: Window, rootP: Point, eventP: Point, state: SetOfKeyButMask, mode: GrabMode[normal..ungrab], sameScreen: BOOL, focus: BOOL], focusIn, focusOut => [ detail: FocusDetail, seq: SequenceNo, eventWindow: Window, mode: GrabMode], keymapNotify => [ --immediately follws enterNotify and focusIn events <<--byte for keycodes 0-7 is omitted>> keys: PACKED ARRAY [1..31] OF BYTE, previousEvent: Event ¬ NIL --using this "backward" link instead a more "natural" forward link eliminates the need for waiting. ], expose => [ seq: SequenceNo, window: Window, pos: Point, size: Size, count: CARD16], graphicsExposure => [ seq: SequenceNo, drawable: Drawable, pos: Point, size: Size, minorOpcode: CARD16, count: CARD16, majorOpcode: BYTE], noExposure => [ seq: SequenceNo, drawable: Drawable, minorOpcode: CARD16, majorOpcode: BYTE], visibilityNotify => [ seq: SequenceNo, window: Window, state: Visibility], createNotify => [ seq: SequenceNo, parent: Window, window: Window, geometry: Geometry ¬ nullGeometry, overrideRedirect: BOOL], destroyNotify => [ seq: SequenceNo, eventWindow: Window, window: Window], unmapNotify => [ seq: SequenceNo, eventWindow: Window, window: Window, fromConfigure: BOOL], mapNotify => [ seq: SequenceNo, eventWindow: Window, window: Window, overrideRedirect: BOOL], mapRequest => [ seq: SequenceNo, parent: Window, window: Window], reparentNotify => [ seq: SequenceNo, eventWindow: Window, window: Window, parent: Window, pos: Point, overrideRedirect: BOOL], configureNotify => [ seq: SequenceNo, eventWindow: Window, window: Window, aboveSibling: Window, geometry: Geometry ¬ nullGeometry, overrideRedirect: BYTE], configureRequest => [ stackMode: StackMode, seq: SequenceNo, parent: Window, window: Window, sibling: Window, -- ¬ nullWindow geometry: Geometry ¬ nullGeometry, valueMask: CARD16], --bitmask or packed array of bool? gravityNotify => [ seq: SequenceNo, eventWindow: Window, window: Window, pos: Point], resizeRequest => [ seq: SequenceNo, window: Window, size: Size], circulateNotify => [ seq: SequenceNo, eventWindow: Window, window: Window, place: Place], circulateRequest => [ seq: SequenceNo, parent: Window, window: Window, place: Place], propertyNotify => [ seq: SequenceNo, window: Window, atom: XAtom, timeStamp: TimeStamp, state: PropertyNotifyState], selectionClear => [ seq: SequenceNo, timeStamp: TimeStamp, owner: Window, selection: XAtom], selectionRequest => [ seq: SequenceNo, timeStamp: TimeStamp, --0 for currenttime owner: Window, requestor: Window, selection: XAtom, target: XAtom, property: XAtom], -- 0 for none selectionNotify => [ seq: SequenceNo, timeStamp: TimeStamp, --0 for currenttime requestor: Window, selection: XAtom, target: XAtom, property: XAtom], -- 0 for none colorMapNotify => [ seq: SequenceNo, window: Window, colorMap: ColorMap, --nullColorMap for none new: BOOL, installed: BOOL], clientMessage => [ --the X client message event; goes through server format: BYTE, seq: SequenceNo, window: Window, typeAtom: XAtom, data: SELECT OVERLAID * FROM --byte order problems => only one variant correct b => [b: PACKED ARRAY [0..20) OF BYTE], h => [h: PACKED ARRAY [0..10) OF CARD16], w => [w: PACKED ARRAY [0..5) OF CARD32], ENDCASE], mappingNotify => [ seq: SequenceNo, request: MappingNotifyKind, firstKeycode: BYTE, count: BYTE], extension => [--extension of X protocol extension: ATOM ¬ NIL, --denotes name of extension [if known] match: PRIVATE REF ¬ NIL, --event matching help decoded: REF READONLY ANY ¬ NIL, --event data in readable format [if known] bytes: PACKED ARRAY [0..32) OF BYTE], --raw bits finalEvent => [--locally generated when connection dies, closes, or, refcounts go to zero refCountTransition: BOOL ¬ FALSE, reason: REF ¬ NIL], tipEvent => [--local, not passed through an X server who: REF ¬ NIL, --reserved for "widget" results: LIST OF REF ANY ¬ NIL, --please readonly eventSource: Event, --If available timeStamp: TimeStamp ¬ currentTime, --some relevant timestamp from server; not necessarily of last action reserved: REF ¬ NIL], replyEvent => [--reserved, don't try to set up a match for replies seq: SequenceNo, reply: REF ¬ NIL, reserved: REF ¬ NIL], ENDCASE ]; EventRope: PROC [event: Event] RETURNS [r: ROPE]; <> SetOfEvent: TYPE ~ XlSetOfEvent.SetOfEvent; <> <> SetOfPointerEvent: TYPE ~ SetOfEvent; unspecifiedEvents: SetOfEvent ~ []; <<--Small difference to X protocol >> <<--When sent to the server:>> <<-- Converted to not specifying any events.>> <<--When received from server: >> <<-- No events are enabled.>> <<>> disableEvents: SetOfEvent ~ [reservedforDisableEvents: TRUE]; <<--Small difference to X protocol:>> <<--When sent to the server: >> <<-- Converted to no events before sending to the server>> <<--Never returned by server. >> ORSetOfEvents: PROC [s1, s2: SetOfEvent ¬ unspecifiedEvents] RETURNS [SetOfEvent] = INLINE { RETURN [XlSetOfEvent.ORSetOfEvents[s1, s2]] }; LegalEvents: PROC [e: SetOfEvent] RETURNS [SetOfEvent]; PointerEvents: PROC [e: SetOfEvent] RETURNS [SetOfPointerEvent]; DeviceEvents: PROC [e: SetOfEvent] RETURNS [SetOfEvent]; UnspecifiedEvents: PROC [e: SetOfEvent] RETURNS [BOOL] ~ INLINE {RETURN [e=unspecifiedEvents]}; <> ClientRequested: PROC [event: Event] RETURNS [BOOL] ~ INLINE { <> RETURN [event.originalCodeByte>127]; }; GetExtensionCard16: PROC [ev: ExtensionEvent, index: NAT] RETURNS [CARD16]; GetExtensionCard32: PROC [ev: ExtensionEvent, index: NAT] RETURNS [CARD32]; <> SendEvent: PROC [c: Connection, destination: Window, propagate: BOOL, eventMask: SetOfEvent, eventBody: EventRep, details: Details ¬ NIL]; <> SendClientMessage32: PROC [c: Connection, destination: Window, propagate: BOOL ¬ FALSE, eventMask: SetOfEvent ¬ unspecifiedEvents, window: Window, type: XAtom, data: ARRAY[0..5) OF CARD32 ¬ ALL[0], details: Details ¬ NIL]; <> <> LocalEvent: TYPE ~ REF READONLY EventRep.local; ExtensionEvent: TYPE ~ REF READONLY EventRep.extension; KeyPressEvent: TYPE ~ REF READONLY EventRep.keyPress; KeyReleaseEvent: TYPE ~ REF READONLY EventRep.keyRelease; ButtonPressEvent: TYPE ~ REF READONLY EventRep.buttonPress; ButtonReleaseEvent: TYPE ~ REF READONLY EventRep.buttonRelease; MotionNotifyEvent: TYPE ~ REF READONLY EventRep.motionNotify; EnterNotifyEvent: TYPE ~ REF READONLY EventRep.enterNotify; LeaveNotifyEvent: TYPE ~ REF READONLY EventRep.leaveNotify; FocusInEvent: TYPE ~ REF READONLY EventRep.focusIn; FocusOutEvent: TYPE ~ REF READONLY EventRep.focusOut; KeymapNotifyEvent: TYPE ~ REF READONLY EventRep.keymapNotify; ExposeEvent: TYPE ~ REF READONLY EventRep.expose; GraphicsExposureEvent: TYPE ~ REF READONLY EventRep.graphicsExposure; NoExposureEvent: TYPE ~ REF READONLY EventRep.noExposure; VisibilityNotifyEvent: TYPE ~ REF READONLY EventRep.visibilityNotify; CreateNotifyEvent: TYPE ~ REF READONLY EventRep.createNotify; DestroyNotifyEvent: TYPE ~ REF READONLY EventRep.destroyNotify; UnmapNotifyEvent: TYPE ~ REF READONLY EventRep.unmapNotify; MapNotifyEvent: TYPE ~ REF READONLY EventRep.mapNotify; MapRequestEvent: TYPE ~ REF READONLY EventRep.mapRequest; ReparentNotifyEvent: TYPE ~ REF READONLY EventRep.reparentNotify; ConfigureNotifyEvent: TYPE ~ REF READONLY EventRep.configureNotify; ConfigureRequestEvent: TYPE ~ REF READONLY EventRep.configureRequest; GravityNotifyEvent: TYPE ~ REF READONLY EventRep.gravityNotify; ResizeRequestEvent: TYPE ~ REF READONLY EventRep.resizeRequest; CirculateNotifyEvent: TYPE ~ REF READONLY EventRep.circulateNotify; CirculateRequestEvent: TYPE ~ REF READONLY EventRep.circulateRequest; PropertyNotifyEvent: TYPE ~ REF READONLY EventRep.propertyNotify; SelectionClearEvent: TYPE ~ REF READONLY EventRep.selectionClear; SelectionRequestEvent: TYPE ~ REF READONLY EventRep.selectionRequest; SelectionNotifyEvent: TYPE ~ REF READONLY EventRep.selectionNotify; ColorMapNotifyEvent: TYPE ~ REF READONLY EventRep.colorMapNotify; ClientMessageEvent: TYPE ~ REF READONLY EventRep.clientMessage; MappingNotifyEvent: TYPE ~ REF READONLY EventRep.mappingNotify; FinalEvent: TYPE ~ REF READONLY EventRep.finalEvent; TipEvent: TYPE ~ REF READONLY EventRep.tipEvent; ErrorNotifyEvent: TYPE ~ REF READONLY EventRep.errorNotify; <> ConnectionRep: PRIVATE TYPE ~ MONITORED RECORD [ <<-->> <<--buffer for requests>> bufNext: CARD ¬ 0, --internal next pointer bufReady: CARD ¬ 0, --number of bytes ready to be flushed bufLimit: CARD ¬ 0, --size of buffer buf: LONG POINTER TO PACKED ARRAY [0..0) OF BYTE ¬ NIL, bufPrivate: PRIVATE REF ¬ NIL, --real ref in case buf needs header information bufExpected: PRIVATE CARD ¬ 0, --for self check on bufReady bufSkipped: PRIVATE CARD ¬ 0, --for self check on bufReady lastOpCode: PRIVATE CARD ¬ 0, --for debugging XlImpl only bufDebug: PRIVATE CARD ¬ 0, --for debugging XlImpl only sequenceNumber: SequenceNo ¬ 0, bufProblem: REF ¬ NIL, --#NIL means an io error happened alive: BOOL ¬ FALSE, <<-->> <<--various handles protocol relative>> info: InfoRef ¬ NIL, screenDepthS: REF READONLY ScreenDepthTuples ¬ NIL, name: ROPE ¬ NIL, displayNumber: INT ¬ 0, defaultScreenNumber: INT ¬ 0, lastTimeStamp: TimeStamp ¬ currentTime, screenDepthTuplesCount: NAT ¬ 0, synchCount: CARD ¬ 0, -- 0 asynchronous >0 synchronous error event reporting <<-->> <<--various handles for impls>> cPriv: REF ConnectionPrivate ¬ NIL, replyStuff: REF ReplyStuffRep ¬ NIL, resourceStuff: REF ResourceStuffRep ¬ NIL, dispatchStuff: REF DispatchStuffRep ¬ NIL, service: REF ServiceRep ¬ NIL, properties: PRIVATE PropList.List ¬ NIL, serviceProperties: PRIVATE PropList.List ¬ NIL, <<-->> <<--network access>> xmit: IO.STREAM ¬ NIL, recv: IO.STREAM ¬ NIL, sendSoon: PROC [out: IO.STREAM, when: CARD ¬ 0] ¬ NIL, --like NetworkStream.SendSoon. errorFromStreamProc: PROC [self: IO.STREAM] RETURNS [ROPE] ¬ NIL, needFlushing: BOOL ¬ FALSE, isFlushing: BOOL ¬ FALSE, <<-->> <<--grab convention stuff>> buttonGrabOwner: REF ¬ NIL, buttonGrabTimeStamp: TimeStamp ¬ [0], <<-->> <<--more>> errorMatch: Match ¬ NIL, applicationKey: ATOM ¬ NIL, lastError: REF READONLY ANY ¬ NIL, --for debugging debugHelp: REF ¬ NIL --for debugging ]; ConnectionPrivate: PRIVATE TYPE; ReplyStuffRep: PRIVATE TYPE; ResourceStuffRep: PRIVATE TYPE; DispatchStuffRep: PRIVATE TYPE; ServiceRep: PRIVATE TYPE; TQRep: PRIVATE TYPE; GContextRep: PRIVATE TYPE; FontRep: PRIVATE TYPE; EventFilterRec: PRIVATE TYPE ~ RECORD [ activate: EventCodes ¬ ALL[FALSE], activateExtensions: LIST OF REF ANY ¬ NIL ]; END.