Showing changes from revision #6 to #7:
Added | Removed | Changed
Within each Multi-tasking application there must be a polling loop. It is the polling loop’s duty to respond to events. An event can either be user generated by either the user or from the Operating System itself.
An application calls its own polling routine to identify discover if there are any events pending for it. The output event from is this returned routine in varies register R0, and other data, depending on the events. event, are returned in the message block whose address is returned in R1.
The output takes the form of a block of information that contains an event number and specific information relating to the event.
The application can utilize the polling routine to execute some code ‘in the background’. For example, a clock application may update the clock display if no more pressing events are pending.
A pseudo pseudocode code version of Polling routine may look like:
SYS"Wimp_Initialise" finished = FALSE DIM blk 255 REPEAT SYS"Wimp_Poll",0,blk TO event CASE event OF WHEN 0:... Null_Reason_Code WHEN 1:... Redraw_Window_Request ... etc. ENDCASE UNTIL finished SYS"Wimp_CloseDown" End Application
It is also possible to specify which that event codes will not be responded to by your application is not interested in advance. certain events. This stops the Window Manager from passing control needlessly to your application if when it these is events simply occur. going to ignore them. This method is calledMasking.
The Masking upside of masking is that it improves the efficiency of the application, system, and ensures a more responsive experience for the user.
Note: Some events cannot be masked, as it is vital that an application responds respond to them. An example of this is theOpen_Window_Request.
The Null Events Event is simply returned a by fancy the name wimp to (unless specify masked) that if no events have been occurred detected since the last time poll. it was polled.
If your application does not need to respond to null events (i.e. responding to no events) then you should mask it out to improve efficiency.
If you do need to respond to null events you should use Wimp_PollIdle rather than Wimp_Poll, unless the user is directly involved (e.g. when dragging an object) and responsiveness is important.