sqInt ioProcessEvents(void)


Parms: NONE
return: NONE, fake return of zero
From: Interpreter
Why:
Process operating system UI events and do housekeeping

Responsibility:
Historically this was called by ioPeekKeystroke, ioGetKeystroke, ioMousePoint, ioGetButtonState, an ioGetNextEvent to process UI events in the pure polling pre event driven VM of the 90's. It is also called by the checkForInterrupt logic every 200ms or so.
On some platforms this routine is used to exit() the VM based on a quit now flag.

MacIntosh
os-9/OSXCarbon
Morphic invokes ioGetNextEvent every 1/60 of a second so we use this logic to call aioPoll to service Socket states and also to service pending screen flushes. We also check the quit now flag and may exit()

Cocoa:
See iPhone, but subclassed to also invoke NSApp sendEvent: after running the run loop.

iPhone
Clone of macintosh, but includes logic to run the runloop

Note in summer of 2010 we changed the VM logic so that you could choose between running the VM as a sub process or off the main run loop. The problem with running as a sub process is that UIKit and Cocoa NSView interaction plus much of any Objective-C bridge work requires you to run on the main Thread. Although you can queue requests to run on the main thread, this fails with deadlock issues when you add UIKit or Cocoa Delegate callbacks to Squeak Proxy objects. So now the VM runs off the Main Thread and uses the runLoop call to service pending UI events.

Unix
Calls XNextEvent, and aioPoll

Windows
Some flavours of windows require checking for WM_PAINT, deal with squeak being a plugin window, confirm if browser is still alive (if plugin)

BUGS
How often this is called is debatable...
There are no comments on this page.
Valid XHTML :: Valid CSS: :: Powered by WikkaWiki