int error = WaitEvents(lua_State *L, ULONG flags, struct hwTagList *t);
WaitEvents()
has to return an error code or 0 for success.
The following flags may be passed in the second parameter:
HWWEFLAGS_MODAL:
WaitEvents()
has been called from a modal loop that Hollywood
is currently running. A modal loop is a temporary event loop set up by functions that
block the script execution until certain events happen, e.g. WaitLeftMouse()
or InKeyStr()
.
If HWWEFLAGS_MODAL
is not set, then you can be sure that Hollywood is currently running the
script's main loop. This means that your WaitEvents()
implementation has been called as a
result of the script calling Hollywood's WaitEvent()
function.
The third parameter is a tag list that can contain the following tags:
HWWETAG_AMIGASIGNALS:
WaitEvents()
implementation must take
it into account. The pData
item of this tag is set to a ULONG
pointer that contains
a combination of signal bits that your WaitEvents()
implementation has to take into
account. Thus, on Amiga systems all WaitEvents()
implementations must be based on
exec.library/Wait()
. You may choose to wait on additional signals but you also
must take the signals that you get from Hollywood into account. Furthermore, you must
write the signals that have broken your WaitEvents()
implementation back to the ULONG
pointer before you return from this function. This is because Hollywood needs to know
which signals have triggered so that it can take appropriate action.
Please note that this function must wait for events on all displays that have currently
been opened by OpenDisplay(). Additionally, it could also happen
that no display is open at all and your WaitEvents()
function is called. Be prepared to
deal with these cases.
Also note that your WaitEvents()
implementation must be capable of being woken up
by ForceEventLoopIteration() when this is called from
worker threads. See ForceEventLoopIteration for details.
lua_State