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) }; 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, 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 [ sequenceNo: SequenceNo ¬ 0, --set by request (...no locking...). 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 specific: REF ¬ NIL, --NIL is ok for all commands. 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]; 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]; 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]; 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]; 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]; 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]; 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; explanation: ROPE ¬ NIL, errorKind: ErrorKind ¬ nil, serverGenerated: BOOL ¬ FALSE, 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 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 ~ []; disableEvents: SetOfEvent ~ [reservedforDisableEvents: TRUE]; 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 [ 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, 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 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, 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, buttonGrabOwner: REF ¬ NIL, buttonGrabTimeStamp: TimeStamp ¬ [0], 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. Q.Xl.mesa Copyright Ó 1988, 1989, 1990, 1991, 1992 by Xerox Corporation. All rights reserved. Created by Christian Jacobi, April 13, 1988 12:24:42 pm PDT Christian Jacobi, April 21, 1992 12:38 pm PDT Interfacing X Window system version 11. Conceptual access to complete X protocol for Cedar clients. Adding mainly type safety, memory ownership and multi-programming capabilities. This definition module is well documented where it differs from the standard X protocol; however it does not repeat the X protocol documentations. Errors Raised if X server sends an error reply instead of a normal reply, and, for local reasons. May be raised dispatched if connection is dead or died while request. When raised, locks on connection are already released. Actually an ERROR, not a SIGNAL: proceeding is not allowed except where noted Raised asynchronously for certain requests. If an error is < otherServer it is the orginal value generated by the X server. If an error is > otherServer its value is made up local. otherServer: The error is generated by the X server but the value conflicts with possible local values. Look at originalCodeByte for the X error value.. clientError: Arguments are bogus. sizeError: Arguments do not fit the size limitations of the X protocol or connection. otherLocal: catchall for more. connectionWedged: never shappen... requestFromDeadConnection: connection was dead before or while request is handled. Basic types Describes connection with X11, [display* in XLib] Unless a conection is closed it will never be garbage collected. position is upper left corner outside of border origin is upper left corner inside size is inside exclusive border All measured in pixels. Warning: Actual font on server is freed when font on host is garbage collected; keeping id does not prevent garbage collection. returns time interval from "from" to "to" assuming neither time is currentTime This interface uses INT for most kinds of spacial data, while the X protocl actually uses 16 bit signed values for positions and 16 bit unsigned values for sizes. This interface is robust in the sense that if values outside the legal range are used, no wedge will occur. But, no promises are made whether values are sensefully clipped or just wrapped around. Layed out such that it can be moved to the X server as whole block. Connection access The numbering of screens comes from the server. The first first screen is used for many system properties. The default screen is the one encoded in the server name used for opening the connection; the server does not know which screen is default for a particular connection. The first screens root window The default screens root window Returns best guess whether connection is alive [and non NIL] Returns the last time stamp reported from server Put local property [NO access to the X server] Get local property [NO access to the X server] Initializing utility for local properties. Atomically executes init exactly when the connection has no key property, then puts the return value as key property. Put local property [NO access to the X server] Get local property [NO access to the X server] Put local property [NO access to the X server] Get local property [NO access to the X server] Put local property [NO access to the X server] Get local property [NO access to the X server] Query procedure issuing request; presence on server does not imply existence of a Cedar interface. Clients might more efficiently check availability of particular extensions using its interface directly. Server response; presence on server does not imply existence of a Cedar interface. Connection set up Returns valid connection or raises connectionNotCreated [retries if resumed] server: Name of server including display number. synchronized: Used in requests with NIL details. Ignored if server=NIL. applicationKey: Key for default value of server and synchronized fields in case of server=NIL. errorMatch: Special match used for asynchronous errors. Defaulted fields are filled in to call debugger. finalMatch: Special match used for notification when reference counts transition to zero for all objects. If reference counts are still zero on return, connection will be closed. Note that a freshly created connection starts with a refcount of 1 on the NIL object. (finalMatch.handles is ignored). debugHelp: For eventual identification of connection in debugger --defined only if X server reached Prevents automatic close of Connection Might re-enable automatic close of Connection Does not raise any error (but of course might cause others to do so) All requests already issued will enter the wire. If ~delayed then right now. Does not raise any inline errors. Waits until X server acknowledges having processed the requests Describes optional more detailed parametrization for execution of requests. Fields are copied: clients may change fields before replies are returned. Details may be shared by multiple threads if sequenceNo is ignored. Errors notified on a per request basis are not forwarded to any per connection error notifier. --output specifications: set by impl and read by client --input specifications: set by client and read by impl --command specific options --client only fields Grabs and event handling All other connections to this server are delayed; Not reentrant. Heavy weight. May time out if after some seconds no mouse key is down. Time-out is considered a client error and must be avoided. This and the other grabs do not protect from events already "on the way"; this and the other grabs without a return result do not take effect until the server actually handles the request; if a grab is made to execute certain uninteruptedness this does not matter, but, should a client depend on knowledge that the server actually has seen the request [absolute time], issuing a RoundTrip request is suggested. Defaulting details causes a flush Defaulting details causes a flush Add event handlers for windows not found Atoms and properties Atoms X atoms returns standard atom; it is an error to use non standard names An InternAtom query with create=true X atoms. For all hosts of this server ! X atoms. For all hosts of this server ! X atoms Properties X properties; all requests go all the way to the X server X properties data: one of NIL, ROPE, REF TEXT, REF Card16Sequence, REF Card32Sequence start: index of first unit used for actual request num: number of units used for actual request; limited by length of data details: fine tuning of request Assumes data to be handed to ChangeProperty; returns number of units and unit size in bytes. data must be one of the types allowed by ChangeProperty. This does not involve the X server. X properties supposedFormat: speed up some cases [if supposedFormat#0 and supposedFormat#format then discard value] X properties X properties This brain damaged X request is supported only for the benefit of ICCCM ThreadQueues and event distribution Think a (TQ) ThreadQueue to be a thread, a queue, and, a lock. The thread ececutes all queued procedures with the lock hold. Procedures on different TQ's are executed asynchronously. Creates a ThreadQueue. TQ's are cheap and use process resources only when needed. createData might be useful to identify tq in the debugger. order and reverse serve to define a locking order: Clients must get the lock with smaller order before getting lock with larger order. For locks with same order, get the locks in the same order as the create times, unless reverse indicates the opposite. Enqueues proc on ThreadQueue. Enqueued procedures on TQ are executed in order of enqueueing. Can not cause wedges, but no guarantee for liveness of TQ can be given either. data typically registered together with proc. proc must not be nested. Certain types of event might cause enqueued procs to be removed from queue. Executes proc with lock of TQ hold. Might have to wait until lock is free. Order of execution of different calls or with queued procs is undefined. Lock is PROCESS reentrant. Might wedge or raise Wedged instead. Not all wedges can be detected. Watch the order in which locks are acquired! Procedure trusts in caller using correct locking order. Executes proc with locks of both TQ`s hold in the right order. Caller MUST NOT hold lock of either TQ (otherwise it is too hard to make predictable statements about wedging). Might have to wait until lock is free. Order of execution of different calls or with queued procs is undefined. Might wedge or raise an ERROR instead. Not all wedges can be detected. Watch the order of locks acquired otherwise! Returns whether caller currently holds TQ's lock. Returns whether it is ok to get first's lock before getting second's lock. Returns value used for order. (Some application want a predefined classes for locking order, so they need this procedure to check it.) The basic type used to decide what handler should be called to handle particular events. Describes: if event described by "handles" occures, it should be queued on "tq" "data" is passed throu to event handler procedure Window access Window related types Window set up Type describes attributes to be applied; it is not used for querying attributes. Restriction on event-mask attribute: certain events, necessary for internal consistency can not be excluded from beeing generated merges attributes; if value in both inputs is defined, the value in "win" will win, except eventMask which is OR'ed Creates a window... matchList: events to be matched and called. pos: upper left corner (outside of border) size: inner size excluding border Caller should enable events [in attributes.eventMask] he wants to handle with matchList. Those events can not be disabled with ChangeWindowAttributes. Warning: Events enabled with CreateWindow or MatchList's can not be disabled. Be carefull with this procedure, as there is no arbitration what application enables what event. Add an event handlers for events on window. match: events to be matched and called. generate: Events the server ought to generate. This is not an original X-feature, but it may generate (ChangeWindowAttributes) requests to the server. Defaulting a values means: don't change current value Window queries Type returned on querying attributes of a window; not used for setting attributes. Finds screen of window; might produce requests to X server or might be cached. Not an original X request. Finds screen and depth; might produce requests to X server or might be cached. Not an original X request. Cursors and pixmaps Fonts Get font; might do server request or return cached font. Details are only useful in case of a server request. Resource won't be freed up until connection closes down Avoids calling the server if font information is cached Avoids calling the server if font information is cached Gets up to maxNames font names from the server. data is passed through to each. If each returns quit=TRUE it will not be called anymore with more fonts. This saves doing procedure calls, but the server did already send all the font names. Enumerates fonts which match pattern, including some information. each is a callback to return results. If each returns quit=TRUE it will not be called anymore with more fonts. This saves doing procedure calls, but it does NOT prevent the X server from sending information for the remaining fonts. data is passed through to each. count is the actual number of font infos returned by the server Procedure to return result of ListFontsWithInfo request. The per character metrics (info.charInfos) is not available. Pointer cached --nominal mapping: map[i]=i --index 0 unused Actively grabs control of the pointer. May time out if after some seconds no mouse key is down. Time-out is considered a client error and must be avoided. See remarks on "GrabServer" request about timing. Defaulting details causes a flush Establishes a passive grab. Grab "ownership" convention. This is a Cedar convention and not defined by the standard X protocol. Since in Cedar usage connections often are shared between independent applications the original X ownerEvents or OwnerGrabButton mask can not reasonably select what windows should be notified on events. This convention allows to actively establish an ownership of (button) grabs, so events can be ignored if they were ment for an other application. The (button) grab ownership must be established if a grab is made which does not guarantee exclusive events; e.g when ownerEvents is true or OwnerGrabButton is set. The grab ownership can at any time be taken away by an other application. The (button) grab ownership must be checked before acting on events. An application has no way to know whether this precaution is necessary or not, because in Cedar this depends on independent other applications. Cedar convention; not standard X protocol Returns "owner" of grab or NIL if none; events owned by other clients might be ignored. Cedar convention; not standard X protocol. Establishes (button) grab "ownership". Overwrites any grab ownership established before timeStamp. Fails if grab ownership has already been established at or later then timeStamp or if timeStamp lays in future. Clients grabbing with ownerEvents true OwnerGrabButton set must establish a grab owner. Cedar convention; not standard X protocol. Removes grab ownership if it was established at timestamp or before. Noop if grab ownership was established after timeStamp. Keyboard Keyboard mapping and state A machine [and time] dependent identification of a key. The X protocol restricts values to [8..255] however Xl does not. An identification which refers (roughly) to the engravings found on the keycaps of keyboards key engravings. To make sure a mapping is used which is not to old, clients could get the mapping change notification in the same thread as the key/pointer events [mapping change notification happens on 0 window]. If QueryKeymap is used, no protection against using a mapping which is more recent than a key/pointer event can be given. [Even if a new mapping would be requested immediately [monitored] after each mapping change notification, X would not prevent another connection from changing the mapping and racing ahead before the first map request finishes] Cached; cache access is fast enough to be used for every keystroke. The original X request allows to request partial ranges, but for Cedar this seems not necessary and would hinder caching. Use an extras interface if exact protocol behaviour is required. In addition to the protocol, this mapping is also augmented with entries for buttons. (The button entries are are to be applied after the button map is applied; this ensures buttons do not conflict with KeyCodes.) Use the KeyMapping interface for inpecting the mapping. Cached Grabbing keyboard See remarks on "GrabServer" request about timing Avoid synchrounous pointerMode [wedge protection not yet implemented] Defaulting details causes a flush NOT a standard X request; ungrabs keyboard even if grabbed by different Cedar 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] Heavy weight, success highly probable if keyboard was grabbed by a connection from same Cedar world, but not guaranteed. Installs passive grab on keyboard Other devices Selections ICCCM Convention: do not use currentTime for time [although X protocol allows] ICCCM Convention: Use GetSelectionOwner to verify success ICCCM Convention: do not use currentTime for time [although X protocol allows] ICCCM Convention: do not use [0] for property [although X protocol allows] Shortcut for send-event with empty set for event-mask. Input focus window one of regular window, nullWindow or focusPointerRoot ICCCM Convention: do not use currentTime for timeStamp [although X protocol allows] window one of regular window, nullWindow or focusPointerRoot Graphics Graphics context This type matches the X graphical context insofar as it has the same expressiveness. However, it is cached on the client side and actually moved to the server only when needed. Sharing graphics context among different connections is a bad idea. Access to GContext is NOT monitored (since it wont be shared anyway). Delayed until gc is actually used. If gc is exported or any chance exist that it is used over a different connections [shame on you], it should be flushed explicitely once after creation. This prevents the actual creation of the resource on the server side from using two connection locks. The gc can be used with any destination drawable having the same root and depth as the specified drawable; for a defaulted drawable the information is taken from first usage [discouraged]. Note that the defaults for foreground and background are counter intuitive [X Protocol]. All SetGCfoo procs are delayed until gc is actually used Graphics context and drawing requests ok: number of rectangles does not excede maximum request length if not ok some rectangles are ignored A simplified PolyFillRectangle request A simplified PolyLine request "bit-blit" of area. X PutImage request; generalized to have arbitrary offx, offy. The area is clipped in the destination drawable, but must fit completely in the source bitmap. This might generate multiple X requests to draw individual pieces of the area. dest: dest for area (inside drawable) offx, offy: source of area (in bitmap coordinates) size: size of area moved base: base of bitmap; assume: [slow: down, fast: right] scanLineBytes: bytes per scanline in bitmap (on X client; NOT X server) RESTRICTIONS: Assumes depth=bitsPerPixel. Assumes bitmapFormat := IF bitsPerPixel=1 THEN bitmap ELSE zPixmap Fancy request; read the X Protocol before using Text drawing requests Conveniance procedure [like ImageRope] ImageText8 request Draws character and background ImageText8 request Draws rope and background ImageText16 request Draws string16 and background PolyText8 request. Calls deliver to return textitems or font changes. data is handed to deliver. Simpler PolyText8 request Draws character without background Simpler PolyText8 request [1 item] Draws rope without background Simple PolyText16 request [1 item] Draws string16 without background I'm to lazy to provide PolyText16, but there would be no problem if somebody needs it. Color Event handling keyPress..mappingNotify are core events of the standard X protocol. All other events are NOT part of the standard X protocol or changed somehow. local is used for requests not initiated through X. finalEvent is a notification that the connection died or was closed. tipEvent is reserved for implementation of tip tables. replyEvent is reserved. extension is used instead of ENDCASE branch of variant records for extensions to X. errorNotify need not be the original error reply of X. conveniant procedure to make a mask debugging aid Type of procedure which handles events. clientData: is client data of match. Do not change priority. Process is reused! The EventFilter type describes the event types some procedure is ready to accept. Used to describe the set of core events a procedure wants to accept. Distinguish the set of events to handle from the set of events generated by X server. Create a simple event filter (filtering basic events only; explicitely no extensions) Create a complex event filter The connection making the event; no ownership claim. Defined in case of event coming from the server. --Errors can not be matched the standard way --if serverGenerated the X protocol explains what went wrong --if not serverGenerated this is added functionality by Xl --byte for keycodes 0-7 is omitted Debugging aid This set of event type is used to describe what events an X server generates. Distinguish generating an events from matching and consuming it! --Small difference to X protocol --When sent to the server: -- Converted to not specifying any events. --When received from server: -- No events are enabled. --Small difference to X protocol: --When sent to the server: -- Converted to no events before sending to the server --Never returned by server. Event access functions Returns: event was generated by other X-client [not by X-server] Sending events Ignores originalCodeByte, dispatchDrawable, connection, and, sequence number in eventBody Short cut for frequent case of SendEvent Abreviations Private Types -- --buffer for requests -- --various handles protocol relative -- --various handles for impls -- --network access -- --grab convention stuff -- --more Ê@9–(cedarcode) style•NewlineDelimiter ˜codešœ™Kšœ ÏeœI™TKšœ;™;K™-K™—šÏk œ˜ Kšžœžœžœ˜Kšœ žœ ˜Kšœžœžœ˜Kšœžœ ˜!Kšœžœ˜$Kšœ žœ˜"Kšœžœ+˜>Kšœ žœ˜!Kšœ žœ_˜mKšœ žœ˜/K˜—šÏnœžœž ˜Kšžœ(˜/—šž˜K˜—™'K™;K™OK™’K™Kšžœžœžœ˜—headšœ™šŸœžœ˜'KšœZ™ZKšœE™EKšœ9™9Kšœ žœžœ1™PKšœ.™.K˜—šœ žœžœž œ˜%KšœÓ˜ÓKšœ˜Kšœh˜hKšœ˜KšœO™OKšœ8™8Kšœœ™œKšœ$™$KšœU™UKšœ!™!Kšœ%™%KšœU™U——šœ ™ šœ žœžœ˜&Kšœ1™1K™@K˜—šžœžœžœ˜Kšœžœ˜K˜—šœ žœžœžœ˜!Kšœ"˜"K˜—šœ žœžœžœ˜Kšœžœ˜K˜—šœ žœžœžœ˜)Kšœ"˜"š Ÿ œžœžœžœžœ˜6Kšžœ˜K˜—K˜—šœžœžœ˜+K™/K™"K™K™Kšœ$˜$š Ÿœžœ žœžœžœ˜2Kšžœ˜K˜—K˜—šœžœžœ ˜Kšœžœ˜šŸœžœ žœžœ˜$Kšœ™—K˜—šœžœžœ žœ˜%Kšœ˜š Ÿœžœ žœžœžœ˜2Kšžœ ˜K˜—K˜—šœ žœžœ ˜*Kšœ5˜5š Ÿœžœžœžœžœ˜=KšÏc)™)Kš $™$Kšžœ'˜-Kšœ˜—K˜—šœžœžœžœ˜"š Ÿœžœ žœžœžœ˜/Kšžœ˜ K˜—K˜—šœžœžœžœ˜Kšœ˜š Ÿœžœžœžœžœ˜7Kšžœ ˜K˜K˜——šœžœžœ˜+Kšœ$˜$š Ÿœžœ žœžœžœ˜2Kšžœ˜K˜—K˜—Kšœžœžœ˜K˜Kšœ žœžœžœ˜,šœžœžœ˜Kšžœžœžœ˜'Kšœ˜K˜—Kšœžœžœžœ ˜&šœ žœžœ˜K˜ Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœ˜Kšœžœ˜Kšœžœ˜Kšœ˜Kšœžœž œ˜=Kšœ žœ˜Kšœ žœ˜Kšœ žœ˜Kšœ ˜)Kšœžœ ˜#Kšœœžœ ˜1Kšœ˜Kšœ˜K˜—šœžœžœ˜Kšœžœ !˜.Kšœžœ ˜)Kšœ žœ  ˜Kšœ˜K˜—š œžœžœžœžœžœ˜DK˜—Kš œžœžœžœžœ ˜2Kšœ žœžœžœ˜0šœžœžœ˜Kšœžœ .˜EKšœ ˜+Kšœžœ ˜1Kšœžœ˜ Kšœžœ˜Kšœ žœžœžœ ˜$Kšœ˜K˜—šœ žœžœž œ]˜‚K˜—Kšœ žœžœžœ˜.šœžœžœ˜Kšœ˜Kšœ˜Kšœžœ˜Kšœžœ˜Kšœ žœ˜Kšœ žœ˜Kšœ žœ˜Kšœ œž˜šœ˜K˜——K˜Kšœžœžœžœ˜!šœžœžœžœ˜)InotešœžœÓ™ê—J™Kšœ žœžœžœ˜šœ žœžœ˜Kšœ! '˜HKšœ! ˜@Kšœ žœ  ˜*Kšœ˜—Kšœ, ˜;K˜šœžœ˜1KšœC™CK˜—Kšœ žœžœ˜0šœžœžœ˜(Kšžœžœžœ˜.Kšœ˜—K˜Kšœ žœžœ  ˜?—™šœžœžœž œ˜6K˜—Kšœ žœžœžœ˜7šœžœžœ˜*Kšœžœ˜Kšœžœ˜Kšœžœ˜Kšœžœ˜Kšœžœ˜Kšœžœ˜Kšœžœ ˜&Kšœžœ ˜-Kšœžœ˜Kšœžœž œ˜7Kšœžœž œ%˜LKšœžœ &˜FKšœžœ  ˜*Kšœ˜Kšœ˜Kšœžœ˜ Kšœ žœžœžœ˜!Kšœ˜Kšœ˜—K˜šŸœžœžœ žœ˜7Kšžœ ˜K˜K˜—šŸ œžœžœžœ˜CKšžœ˜K˜K˜—šŸœžœžœžœ˜JKšžœ˜K˜K˜—š Ÿ œžœžœžœžœ˜:Kšžœ"˜(K˜K˜—šŸ œžœžœ žœ˜=Kšœk™kKšžœ˜K˜K˜—šŸ œžœžœ žœ˜?Kšœ§™§Kšžœ)˜/K˜K˜—š Ÿ œžœžœžœ žœ˜CKšžœ˜K˜K˜—šŸ œžœžœ ˜4Kšœ™K™—šŸ œžœžœ ˜6Kšœ™K˜—š Ÿ œžœžœžœžœ˜:Kšžœ ˜K˜K˜—š Ÿœžœžœžœžœ˜?Kšžœ˜K˜K˜—š Ÿœžœžœžœžœ˜MKšžœ˜K˜K˜—š Ÿœžœžœžœžœ˜5Kšœ8žœ™=Kšžœžœžœ ˜K˜K˜—šŸœžœžœžœ˜=Kšœ1™1Kšžœ˜K˜K˜—K˜š Ÿœžœžœžœžœ˜BKšœžœ™.K˜—š Ÿœžœžœžœžœ˜EKšœžœ™.K™—š Ÿœžœžœžœžœ˜fKšœ*™*Kšœw™wKš œžœžœžœžœžœ˜RK˜—š Ÿ œžœžœžœžœ˜?Kšœžœ™.K˜—š Ÿ œžœžœžœžœ˜BKšœžœ™.K™—š Ÿœžœžœžœžœ˜EKšœžœ™.K˜—š Ÿœžœžœžœžœ˜HKšœžœ™.K™—š Ÿœžœžœžœžœ˜CKšœžœ™.K˜—š Ÿœžœžœžœžœ˜FKšœžœ™.K™—K˜K˜šŸœžœžœžœ˜MKšœÌ™ÌKš œžœžœžœ'žœ˜dK˜—š Ÿœžœžœžœžœžœ˜žœ˜ošœžœžœžœ˜JK˜———™šŸ œžœUžœžœžœžœ$žœžœ˜ÞK˜—šŸœžœJžœ žœžœžœžœžœ$žœžœ˜‚K˜—šŸ œžœ-žœžœžœžœ$žœ˜žK˜—šŸ œžœ4žœ˜IK˜—š Ÿ œžœGžœžœžœ ˜ˆK˜—KšŸ œžœ4žœ˜I—™Kš Ÿœžœžœžœžœžœ˜)š Ÿ œžœžœžœžœ˜-K˜—š Ÿœžœžœžœžœ˜XK™9Kšœ7™7K˜—šŸœžœ˜%K™7K˜—š Ÿ œžœžœžœžœžœ˜9K˜—Kš œžœžœžœžœžœ˜Dšœ žœžœžœ˜#Kšœ žœ˜Kšœžœ˜Kšœ žœ˜Kšœžœ˜Kšœ žœ˜Kšœ ž˜K˜K˜—Kš œžœžœžœžœžœ˜Dšœ žœžœ˜K˜ Kšœž˜ K˜K˜—šœžœžœž œ˜CK˜—š Ÿ œžœ!žœžœžœ˜SKšœ7™7šœ žœžœ˜Kšœ žœžœ ˜$Kšœ˜Kšœžœ˜Kšœžœ˜Kšœ žœ˜Kšœ˜Kšœ žœ˜Kšœ žœ˜Kšœžœ˜Kšœ žœ˜Kšœ žœ˜Kšœ žœžœ˜*Kšœ žœžœ˜)K˜—K˜—KšŸœžœ$žœžœ˜YšŸœžœ.žœ˜_Kšœ7™7šœžœžœ˜Kšœ˜Kšœ žœ˜Kšœ žœ˜Kšœžœ˜Kšœžœ˜Kšœžœ˜Kšœ žœ˜Kšœž˜Kšœ˜—K˜—š Ÿ œžœ*žœ žœ žœžœ˜dKšœ1™1KšœÀ™ÀKšœ žœžœžœžœžœžœžœ˜KK˜—šŸœžœ.žœ žœžœžœžœ žœ˜€KšœA™AKšœé™éKšœ™Kšœ?™?K™šœžœžœ žœžœžœžœžœžœ˜kKšœ8™8Kšœ<™<—K˜—K˜—šœ™šŸœžœžœžœ"˜XK™Kšœžœžœžœ˜;š œžœžœžœžœžœžœ˜CKš ™Kš  œ™—K˜—šŸ œžœ.žœÈžœ˜©K™&K™tKšœ1™1K˜—šŸ œžœ:žœ˜RK™!K˜—šŸœžœužœ˜˜K˜—š Ÿ œžœsžœ žœžœ‰žœ˜»K™K˜—š Ÿ œžœKžœ žœžœ˜ŽK˜—šŸ œžœ.žœ˜Wšœžœžœ˜K˜ Kšœ ˜K˜ K˜ Kšœ˜Kšœ ž˜K˜—K˜—šŸ œžœ¬žœ˜ÂK˜—šŸœžœ9žœžœ ˜gKšœ žœžœ˜5Kš œ žœžœžœžœžœ ˜Kšœžœžœžœ ˜0Kš œ žœžœžœžœ *˜KKš œžœžœ žœžœ  ˜0—šœ J˜YKšœžœžœ˜"Kšœžœžœ˜—šœ  '˜4Kšœžœžœ ˜'Kš œ žœžœžœžœžœ ˜1Kšœ ˜#Kšœ% E˜jKšœ žœžœ˜—šœ 4˜CKšœ˜Kšœžœžœ˜Kšœ žœžœ˜—Kšž˜—K˜K˜—šŸ œžœžœžœ˜1Kšœ ™ K˜K˜—šœ žœ˜+KšœM™MKšœA™AK˜—šœžœ ˜%K˜šœ$˜$Kšœ!™!Kšœ™Kš œ¢œ™*Kš œ™Kšœ™K™—šœ7žœ˜>Kšœ!™!Kšœ™Kšœ¢ œ™6Kšœ™—K˜K˜—šŸ œžœ*žœžœ˜\Kšžœ%˜+Kšœ˜K˜—KšŸ œžœžœ˜7KšŸ œžœžœ˜@KšŸ œžœžœ˜8šŸœžœžœžœ˜7Kšœžœžœ˜(—K˜Lšœ™š Ÿœžœžœžœžœ˜>Kšœ@™@Kšžœ˜$Kšœ˜—Kš Ÿœžœžœžœžœ˜KKš Ÿœžœžœžœžœ˜KL™K˜šŸ œžœ1žœAžœ˜ŠKšœY™YK˜—šŸœžœ1žœžœPžœžœžœžœžœ˜ÞKšœ(™(K˜—Lšœ ™ Kšœ žœžœžœ˜/Kšœžœžœžœ˜7Kšœžœžœžœ˜5Kšœžœžœžœ˜9Kšœžœžœžœ˜;Kšœžœžœžœ˜?Kšœžœžœžœ˜=Kšœžœžœžœ˜;Kšœžœžœžœ˜;Kšœžœžœžœ˜3Kšœžœžœžœ˜5Kšœžœžœžœ˜=Kšœ žœžœžœ˜1Kšœžœžœžœ˜EKšœžœžœžœ˜9Kšœžœžœžœ˜EKšœžœžœžœ˜=Kšœžœžœžœ˜?Kšœžœžœžœ˜;Kšœžœžœžœ˜7Kšœžœžœžœ˜9Kšœžœžœžœ˜AKšœžœžœžœ˜CKšœžœžœžœ˜EKšœžœžœžœ˜?Kšœžœžœžœ˜?Kšœžœžœžœ˜CKšœžœžœžœ˜EKšœžœžœžœ˜AKšœžœžœžœ˜AKšœžœžœžœ˜EKšœžœžœžœ˜CKšœžœžœžœ˜AKšœžœžœžœ˜?Kšœžœžœžœ˜?Kšœ žœžœžœ˜4Kšœ žœžœžœ˜0Kšœžœžœžœ˜;K˜—šœ ™ š œžœžœž œžœ˜0K™Kšœ™Kšœ žœ ˜*Kšœ žœ %˜9Kšœ žœ ˜$Kšœžœžœžœžœžœžœžœžœ˜7Kšœ žœžœžœ /˜NKšœ žœžœ ˜;Kšœ žœžœ ˜:Kšœ žœžœ ˜9Kšœ žœžœ ˜7Kšœ ˜ Kšœ žœžœ !˜8Kšœžœžœ˜K™Kšœ#™#Kšœžœ˜Kšœžœžœžœ˜3Kšœžœžœ˜Kšœžœ˜Kšœžœ˜Kšœ'˜'Kšœžœ˜ Kšœ žœ 7˜MK™Kšœ™Kšœžœžœ˜#Kšœ žœžœ˜$Kšœžœžœ˜*Kšœžœžœ˜*Kšœ žœžœ˜Kšœ žœœžœ˜(Kšœžœœžœ˜/K™Kšœ™Kšœžœžœžœ˜Kšœžœžœžœ˜Kš œ žœžœžœžœžœ ˜UKš œžœžœžœžœžœžœ˜AKšœžœžœ˜Kšœ žœžœ˜K™Kšœ™Kšœžœžœ˜Kšœ%˜%Kšœ™Kšœ™Kšœžœ˜Kšœžœžœ˜Kšœ žœžœ ˜4Kšœ žœžœ œ˜%Kšœ˜K˜—Kšœžœžœ˜ Kšœžœžœ˜Kšœžœžœ˜Kšœž œ˜Kšœ žœžœ˜Kšœžœžœ˜Kšœ žœžœ˜Kšœ žœžœ˜K˜šœžœžœžœ˜'Kšœžœžœ˜#Kš œžœžœžœžœž˜)Kšœ˜K˜—K˜—Kšžœ˜K˜K˜—…—±ÜCC