Package AccessEngine :: Module AEEventManager' :: Class _AEEventManager
[hide private]
[frames] | no frames]

Class _AEEventManager

source code

object --+
         |
        _AEEventManager

Watches for raw events in order to report them to observers and maintains a queue of AEEvent that are executed on a set interval.

Instance Methods [hide private]
 
__init__(self)
Initializes the parent class.
source code
 
init(self)
Instantiates all AEMonitor UIEs registered with AERegistrar to be loaded at startup.
source code
 
startAccessibility(self, async=True, gil=True)
Enter the main loop to start recieving and dispatching events.
source code
 
stopAccessibility(self)
Quits the main loop.
source code
 
close(self)
Throws away all events in the ae_queue and stops the event loop.
source code
 
addMonitors(self, *monitors)
Adds one or more AEMonitors to the list of monitors to be notified about events.
source code
AEMonitor.MonitorCollection
getMonitors(self)
Gets all loaded AEMonitors.
source code
 
showEvent(self, event)
Informs AEMonitors added via addMonitors of a raw event.
source code
True
_executeEvent(self, event)
Executes the provided AEEvent.
source code
 
flushEvents(self)
Flushes the event queue by destroying it and recreating it.
source code
 
postEvents(self, *events)
Add AEEvents to the queue.
source code
boolean
onPumpRawEvents(self)
Pumps all pyatspi.event.Events in the pyatspi.Registry.queue.
source code
boolean
onPumpAEEvents(self)
Pumps all AEEvents in the ae_queue.
source code

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __str__

Instance Variables [hide private]
type of Accessibility.Registry acc_reg
Reference to the Accessibility.Registry
Queue.Queue ae_queue
FIFO queue of AEEvent to be executed
AEEvent last_event
the last executed event
AEMonitor.MonitorCollection monitors
collection of AEMonitors to be notified about events.
Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self)
(Constructor)

source code 

Initializes the parent class.

Creates an event queue. Asks the AEMain to schedule interval callbacks to the onPumpRawEvents and onPumpAEEvents methods.
Overrides: object.__init__

init(self)

source code 

Instantiates all AEMonitor UIEs registered with AERegistrar to be loaded at startup.

Called by AEMain at startup.

startAccessibility(self, async=True, gil=True)

source code 
Enter the main loop to start recieving and dispatching events.
Parameters:
  • async (boolean) - Should event dispatch be asynchronous (decoupled) from event recieving from the AT-SPI registry?
  • gil (boolean) - Add an idle callback which releses the Python GIL for a few milliseconds to allow other threads to run? Necessary if other threads will be used in this process.

addMonitors(self, *monitors)

source code 
Adds one or more AEMonitors to the list of monitors to be notified about events.
Parameters:
  • monitors (tuple of AEMonitors) - AEMonitors to notify

getMonitors(self)

source code 
Gets all loaded AEMonitors.
Returns: AEMonitor.MonitorCollection
Collection of all loaded AEMonitors

showEvent(self, event)

source code 
Informs AEMonitors added via addMonitors of a raw event.
Parameters:
  • event (pyatspi.event.Event) - Raw accessibility event

_executeEvent(self, event)

source code 

Executes the provided AEEvent.

Catches and logs all exceptions to prevent bad events from getting re-queued for later execution.
Parameters:
  • event (AEEvent) - Event to execute
Returns: True
Did the event execute properly or does it need to be re-queued for later execution?

postEvents(self, *events)

source code 

Add AEEvents to the queue.

Events can be added by any part of the system. Events marked with immediate priority are executed now instead of being added to the queue. Immediate execution is necessary for some kinds of events.
Parameters:
  • events (tuple of AEEvents) - Events to queue for dispatch

onPumpRawEvents(self)

source code 

Pumps all pyatspi.event.Events in the pyatspi.Registry.queue.

Calls the pyatspi.Regitry._dispatchEvent method to forward the event to all registered clients. Catches and logs all exceptions to prevent them from propogating to the main loop that called this method.

This method is called on a set interval by the main event loop in AEMain.run. It is registered for callbacks in the constructor of this class.
Returns: boolean
True to continue receiving notifications

onPumpAEEvents(self)

source code 

Pumps all AEEvents in the ae_queue.

Executes each event pumped. Re-queues events for later execution that return False from their execute methods.

This method is called on a set interval by the main event loop in AEMain.run. It is registered for callbacks in the constructor of this class.
Returns: boolean
True to continue receiving notifications