This file contains the documentation to the interface of the Sather X
library.  If you have questions, mail to
<schnetter@student.uni-tuebingen.de>.  This text was last updated on
1994/11/22.



This file contains only theses attributes and routines that are for
the public.  Do not use any other attributes or routines.



------------------------------------------------------------



class X_GENERAL is

X_GENERAL::Free (ptr: EXT_OB)



class X_DISPLAY is

display ::= #X_DISPLAY
display.Void: BOOL

display.Open
display.Open (name: STR)

display.Close

display.Flush
display.Pending: INT
display.QLength: INT

display.NextEvent (handler: $X_EVENT_HANDLER)
display.CheckMaskEvent (handler: $X_EVENT_HANDLER, mask: ARRAY{INT})

display.DefaultScreen: X_SCREEN_NUMBER
display.RootWindow: X_WINDOW
display.BitmapPad: INT



class X_SCREEN_NUMBER is

X_SCREEN_NUMBER::DefaultScreen (display: X_DISPLAY): X_SCREEN_NUMBER

screen_number ::= #X_SCREEN_NUMBER
screen_number.Void: BOOL

screen_number.DefaultVisual: X_VISUAL
screen_number.DefaultColormap: X_COLORMAP
screen_number.DefaultGC: X_GC

screen_number.BlackPixel: INT
screen_number.WhitePixel: INT
screen_number.DefaultDepth: INT



class $X_DRAWABLE is

drawable.Void: BOOL

drawable.DrawPoint (gc: X_GC, x, y: INT)
drawable.DrawPoint (gc: X_GC, p: X_POINT)

drawable.DrawLine (gc: X_GC, x1, y1, x2, y2: INT)
drawable.DrawLine (gc: X_GC, p1, p2: X_POINT)

drawable.CopyArea (drawable: $X_DRAWABLE, gc: X_GC, src_x, src_y: INT,
	width, height: INT, dest_x, dest_y: INT)
drawable.CopyArea (drawable: $X_DRAWABLE, gc: X_GC, src: X_POINT,
	offset: X_OFFSET, dest: X_POINT)
drawable.CopyArea (drawable: $X_DRAWABLE, gc: X_GC, src: X_RECTANGLE,
	dest: X_POINT)
drawable.CopyArea (drawable: $X_DRAWABLE, gc: X_GC, src: X_POINT,
	dest: X_RECTANGLE)

drawable.FillRectangle (gc: X_GC, x1, y1, width, height: INT)
drawable.FillRectangle (gc: X_GC, p: X_POINT, offset: X_OFFSET)
drawable.FillRectangle (gc: X_GC, r: X_RECTANGLE)



class X_WINDOW < $X_DRAWABLE is

window ::= #X_WINDOW

window.Create (disp: X_DISPLAY, parent: X_WINDOW,
	x, y: INT, width, height: INT, border_width: INT,
	border, background: INT)
window.Create (disp: X_DISPLAY, parent: X_WINDOW,
	p: X_POINT, offset: X_OFFSET, border_width: INT,
	border, background: INT)

window.Destroy

window.SelectInput (maks: ARRAY{INT})

window.Map
window.Unmap

window.StoreName (name: STR)
window.FetchName: STR

window.DefaultRootWindow: X_WINDOW



class X_PIXMAP < $X_DRAWABLE is

pixmap ::= #X_PIXMAP

pixmap.Create (disp: X_DISPLAY, drawable: $X_DRAWABLE,
	width, height: INT, depth: INT)
pixmap.Create (disp: X_DISPLAY, drawable: $X_DRAWABLE,
	offset: X_OFFSET, depth: INT)

pixmap.Destroy



class X_VISUAL is

visual ::= #X_VISUAL
visual.Void: BOOL



class X_IMAGE is

image ::= #X_IMAGE
image.Void: BOOL

image.Create (display: X_DISPLAY, visual: X_VISUAL, depth: INT, format: INT,
	offset: INT, width, height: INT, bitmap_pad: INT)
image.Create (display: X_DISPLAY, visual: X_VISUAL, depth: INT, format: INT,
	offset: INT, size: X_OFFSET, bitmap_pad: INT)

image.Destroy

image.PutPixel (x, y: INT, pixel: INT)

image.Put (drawable: $X_DRAWABLE, gc: X_GC, src_x, src_y: INT,
	dest_x, dest_y: INT, width, height: INT)



class X_GC is

gc ::= #X_GC
gc.Void: BOOL

gc.foreground (color: INT)
gc.background (color: INT)
gc.fill_style (style: INT)   -- see X_GC_DEFS



class X_COLORMAP is

colormap ::= #X_COLORMAP;
colormap.Void: BOOL;

colormap.AllocColor (color: X_COLOR): BOOL
colormap.FreeColors (colors: ARRAY{INT})



class $X_EVENT_HANDLER is

CheckMaskEvent (display: X_DISPLAY, mask: ARRAY{INT}): BOOL
CheckMaskEvent (mask: ARRAY{INT}): BOOL

NextEvent (display: X_DISPLAY)
NextEvent

ExposeEvent (event: X_EXPOSE_EVENT)
KeyPressEvent (event: X_KEY_EVENT)



class X_EVENT_HANDLER < $X_EVENT_HANDLER is

-- inherit this class for basic event handler routine definitions



------------------------------------------------------------



class $X_EVENT is

attr Type: INT;			-- event type
attr serial: INT;		-- event serial number
attr send_event: BOOL;		-- was sent by another application
attr display: X_DISPLAY;	-- display the event occured on
attr window: X_WINDOW;		-- window the event occured in



class X_EXPOSE_EVENT < $X_EVENT is

attr r: X_RECTANGLE;		-- rectangle that was exposed
attr count: INT;		-- if non-zero, at least this many more



class X_KEY_EVENT < $X_EVENT is

attr root: X_WINDOW;		-- root window that the event occured on
attr subwindow: X_WINDOW;	-- child window
attr time: INT;			-- milliseconds
attr p: X_POINT;		-- pointer x, y coordinates in event window
attr p_root: X_POINT;		-- coordinates relative to root
attr state: INT;		-- key or button mask
attr keycode: INT;		-- detail
attr same_screen: BOOL;		-- same screen flag



class X_POINT is

attr x, y: INT

point ::= #X_POINT
point ::= #X_POINT (x, y: INT)
point ::= #X_POINT (offset: X_OFFSET)

point.plus (offset: X_OFFSET): SAME
point.minus (offset: X_OFFSET): SAME
point.minus (p: SAME): X_OFFSET



class X_SEGMENT is

attr x1, y1, x2, y2: INT

segment ::= #X_SEGMENT
segment ::= #X_SEGMENT (x1, y1, x2, y2: INT)



class X_OFFSET is

attr width, height: INT

offset ::= #X_OFFSET
offset ::= #X_OFFSET (width, height: INT)
offset ::= #X_OFFSET (p: X_POINT)

offset.plus (offset: X_OFFSET): SAME
offset.minus (offset: X_OFFSET): SAME
offset.negate: SAME



class X_RECTANGLE is

attr x, y, width, height: INT

rectangle ::= #X_RECTANGLE
rectangle ::= #X_RECTANGLE (x, y, width, height: INT)
rectangle ::= #X_RECTANGLE (p1, p2: X_POINT)
rectangle ::= #X_RECTANGLE (p: X_POINT, offset: X_OFFSET)
rectangle ::= #X_RECTANGLE (offset: X_OFFSET)

rectangle.p: X_POINT
rectangle.offset: X_OFFSET



class X_COLOR is

attr pixel: INT
attr red, green, blue: FLT
attr flags: INT

color ::= #X_COLOR
color ::= #X_COLOR(red, green, blue: FLT)



------------------------------------------------------------



class X_GC_DEFS is

const FillSolid, FillTiled, FillStippled, FillOpaqueStippled: INT



class X_EVENT_DEFS is

const NoEvent, KeyPress, KeyRelease, ButtonPress, ButtonRelease,
	EnterWindow, LeaveWindow, PointerMotion, PointerMotionHint,
	Button1Motion, Button2Motion, Button3Motion, Button4Motion,
	Button5Motion, ButtonMotion, KeymapState, Exposure,
	VisibilityChange, StructureNotife, ResizeRedirect,
	SubstructureNotify, SubstructureREdirect, FocusChange,
	PropertyChange, ColormapChange, OwnerGrabButton: INT



------------------------------------------------------------
