XlShape.mesa
Copyright Ó 1991, 1992 by Xerox Corporation. All rights reserved.
Created by Christian Jacobi, October 3, 1991 11:59 pm PDT
Christian Jacobi, March 27, 1992 10:24 am PST
X11 nonrectangular window shape extension
DIRECTORY Xl;
XlShape: CEDAR DEFINITIONS ~ BEGIN
All requests and types are set up to exactly match the protocol, unless specified differently. Comments are restricted to differences in semantics or naming to the protocol. Names are chosen like in the protocol, except that the prefix "shape" is ommited.
Atom or name for this extension is $SHAPE
Kind: TYPE ~ MACHINE DEPENDENT {bounding, clip};
Op: TYPE ~ MACHINE DEPENDENT {set, union, intersect, subtract, invert};
Requests
QueryVersion: PROC [c: Xl.Connection] RETURNS [available: BOOL, majorVersion, minorVersion: INT];
ShapeQueryVersion request with difference to protocol: available: is true when the extension is available and the version number allows usage of the reminder of this interface. This procedure may be used independently whether a connection supports the shape extension or not.
Rectangles: PROC [c: Xl.Connection, dest: Xl.Window, destKind: Kind ¬ bounding, op: Op, off: Xl.Point ¬ [0, 0], rectangles: REF ANY, ordering: Xl.Ordering ¬ unSorted, start: INT ¬ 0, number: INT ¬ LAST[INT], details: Xl.Details ¬ NIL];
rectangles typically Xl.PackedRects. See documentation for additional types allowed.
start, number: limits which rectangles are to be considered
Mask: PROC [c: Xl.Connection, dest: Xl.Window, destKind: Kind ¬ bounding, op: Op, off: Xl.Point ¬ [0, 0], source: Xl.Pixmap ¬ Xl.nullPixmap, details: Xl.Details ¬ NIL];
source: Xl.nullPixmap to revert to default region
Combine: PROC [c: Xl.Connection, dest: Xl.Window, destKind: Kind ¬ bounding, op: Op, off: Xl.Point ¬ [0, 0], source: Xl.Window, sourceKind: Kind ¬ bounding, details: Xl.Details ¬ NIL];
Offset: PROC [c: Xl.Connection, dest: Xl.Window, destKind: Kind ¬ bounding, off: Xl.Point, details: Xl.Details ¬ NIL];
QueryExtents: PROC [c: Xl.Connection, dest: Xl.Window] RETURNS [ExtentsRec];
ExtentsRec: TYPE = RECORD [
boundingShaped: BOOL,
clipShaped: BOOL,
boundingShape: Xl.Point,
widthBounding: Xl.Size,
clipShape: Xl.Point,
widthClipShape: Xl.Size
];
SelectInput: PROC [c: Xl.Connection, window: Xl.Window, enable: BOOL ¬ TRUE, details: Xl.Details ¬ NIL];
InputSelected: PROC [c: Xl.Connection, window: Xl.Window] RETURNS [enabled: BOOL];
GetRectangles: PROC [c: Xl.Connection, window: Xl.Window, kind: Kind ¬ bounding] RETURNS [rectangles: Xl.PackedRects, ordering: Xl.Ordering];
Events
notifyKey: READONLY REF ANY;
Key to enable marchin of ShapeNotify events
Example usage: Xl.FullCreateEventFilter[extensions: LIST[XlShape.notifyKey]]
NotifyEvent: TYPE ~ REF READONLY NotifyRep;
NotifyRep: TYPE ~ RECORD [
This is what the "decoded" field of an Xl.EventRep.extension points to
window: Xl.Window,
kind: Kind,
shaped: BOOL,
pos: Xl.Point,
size: Xl.Size,
time: Xl.TimeStamp
];
END.