;
; event.sh
;
; Event handling routines
;
;  1994-1998 Straylight
;

;----- Licensing note -------------------------------------------------------
;
; This file is part of Straylight's Sapphire library.
;
; Sapphire is free software; you can redistribute it and/or modify
; it under the terms of the GNU General Public License as published by
; the Free Software Foundation; either version 2, or (at your option)
; any later version.
;
; Sapphire is distributed in the hope that it will be useful,
; but WITHOUT ANY WARRANTY; without even the implied warranty of
; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
; GNU General Public License for more details.
;
; You should have received a copy of the GNU General Public License
; along with Sapphire.  If not, write to the Free Software Foundation,
; 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

;----- Overview -------------------------------------------------------------
;
; Functions provided:
;
;  event_preFilter
;  event_fakeHandler
;  event_postFilter
;  event_poll
;  event_last
;  event_init

		[	:LNOT::DEF:event__dfn
		GBLL	event__dfn

; --- event_preFilter ---
;
; On entry:	R0 == pointer to routine to call
;		R1 == R12 value to call routine
;
; On exit:	May return an error
;
; Use:		Adds a routine to the pre-filter list. Later added
;		routines are called first.

		IMPORT	event_preFilter

; --- event_fakeHandler ---
;
; On entry:	R0 == pointer to routine to call
;		R1 == R12 value to call routine
;
; On exit:	May return an error
;
; Use:		Adds a routine to the fake handler list. Later added
;		routines are called first.

		IMPORT	event_fakeHandler

; --- event_postFilter ---
;
; On entry:	R0 == pointer to routine to call
;		R1 == R12 value to call routine
;
; On exit:	May return an error
;
; Use:		Adds a routine to the post-poll list. Later added
;		routines are called first.

		IMPORT	event_postFilter

; --- event_poll ---
;
; On entry:	R0 == event mask and flags
;		R1 == pointer to block to use
;		R2 == earliest time to return with NULL event
;		R3 == optional pointer to poll word
;
; On exit:	R0 == reason code
;		CS if the event was claimed, CC otherwise
;
; Use:		This call perform a Wimp_Poll, and dispatches events to
;		interested parties.

		IMPORT	event_poll

; --- event_last ---
;
; On entry:	--
;
; On exit:	R0 == last event code received from Wimp_Poll
;		R1 == pointer to accompanying event data
;
; Use:		Allows you to read the full event information.  The event
;		is the same one currently being or most recently dispatched
;		to the postfilter list, i.e. fake events are also returned
;		by this call.  If no event has yet been received, the return
;		values are undefined.

		IMPORT	event_last

; --- event_init ---
;
; On entry:	--
;
; On exit:	--
;
; Use:		Initialises the event system.

		IMPORT	event_init

		]

;----- That's all, folks ----------------------------------------------------

		END
