| | |
- Accessible
- DeviceEventListener(PortableServer.Servant)
-
- KeystrokeListener
- Event
- EventListener(PortableServer.Servant)
-
- EventListener
- Registry
class Accessible |
| |
Wraps AT-SPI Accessible objects and caches properties such as
name, description, and parent.
It also adds some properties to the AT-SPI Accessible including
the Application to which the object belongs.
For efficiency purposes, this class also maintains a cache of all
Accessible objects obtained so far, and will return an element
from that cache instead of creating a duplicate object. |
| |
Methods defined here:
- __del__(self)
- Unrefs the AT-SPI Accessible associated with this object.
- __getattr__(self, attr)
- Created virtual attributes for the Accessible object to make
the syntax a bit nicer (e.g., acc.name rather than acc.name()).
This method is also called if and only if the given attribute
does not exist in the object. Thus, we're effectively lazily
building a cache to the remote object attributes here.
Arguments:
- attr: a string indicating the attribute name to retrieve
Returns the value of the given attribute.
- __init__(self, acc)
- Obtains, and creates if necessary, a Python Accessible from
an AT-SPI Accessibility_Accessible. Applications should not
call this method, but should instead call makeAccessible.
Arguments:
- acc: the AT-SPI Accessibility_Accessible to back this object
Returns the associated Python Accessible.
- accessibleNameToString(self)
- Returns the accessible's name in single quotes or
the string None if the accessible does not have a name.
- child(self, index)
- Returns the specified child of this object.
Arguments:
- index: an integer specifying which child to obtain
Returns the child at the given index or raise an exception if the
index is out of bounds or the child is invalid.
- getRelationString(self)
- Returns a space-delimited string composed of the given object's
Accessible relations attribute. This is for debug purposes.
- getStateString(self)
- Returns a space-delimited string composed of the given object's
Accessible state attribute. This is for debug purposes.
- toString(self, indent='', includeApp=True)
- Returns a string, suitable for printing, that describes the
given accessible.
Arguments:
- indent: A string to prefix the output with
- includeApp: If True, include information about the app
for this accessible.
Static methods defined here:
- deleteAccessible(acc)
- Delete an Accessible from the cache if it exists.
Arguments:
- acc: the AT-SPI Accessibility_Accessible
- init(registry)
- Registers various event listeners with the Registry to keep
the Accessible cache up to date.
Arguments:
- registry: an instance of Registry
- makeAccessible(acc)
- Make an Accessible. This is used instead of a simple calls to
Accessible's constructor because the object may already be in the
cache.
Arguments:
- acc: the AT-SPI Accessibility_Accessible
Returns a Python Accessible.
- shutdown(registry)
- Unregisters the event listeners that were registered in the
init method.
Arguments:
- registry: an instance of Registry
|
class Event |
| |
Converts the source of an event to an Accessible object. We
need this since the event object we get from the atspi is
read-only. So, we create this dummy event object to contain a copy
of all the event members with the source converted to an
Accessible. It is perfectly OK for event handlers to annotate this
object with their own attributes. |
| |
Methods defined here:
- __init__(self, e=None)
|
class EventListener(EventListener) |
| |
Registers a callback directly with the AT-SPI Registry for the
given event type. Most users of this module will not use this
class directly, but will instead use the registerEventListener method
of the Registry. |
| |
- Method resolution order:
- EventListener
- EventListener
- PortableServer.Servant
- __builtin__.object
Methods defined here:
- __del__(self)
- __init__(self, registry, callback, eventType)
- deregister(self)
- notifyEvent(self, event)
- queryInterface(self, repo_id)
- ref(self)
- register(self)
- unref(self)
Data descriptors inherited from EventListener:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes inherited from EventListener:
- __interface_info__ = <PyCObject object at 0x40617578>
Data and other attributes inherited from PortableServer.Servant:
- __new__ = <built-in method __new__ of type object at 0x407619a0>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class KeystrokeListener(DeviceEventListener) |
| |
Registers a callback directly with the AT-SPI Registry for the
given keystroke. Most users of this module will not use this
class directly, but will instead use the registerKeystrokeListeners
method of the Registry. |
| |
- Method resolution order:
- KeystrokeListener
- DeviceEventListener
- PortableServer.Servant
- __builtin__.object
Methods defined here:
- __del__(self)
- __init__(self, registry, callback, keyset, mask, type, synchronous, preemptive, isGlobal)
- deregister(self)
- notifyEvent(self, event)
- Called by the at-spi registry when a key is pressed or released.
Arguments:
- event: an at-spi DeviceEvent
Returns True if the event has been consumed.
- queryInterface(self, repo_id)
- ref(self)
- register(self)
- unref(self)
Static methods defined here:
- keyEventToString(event)
Data descriptors inherited from DeviceEventListener:
- __dict__
- dictionary for instance variables (if defined)
- __weakref__
- list of weak references to the object (if defined)
Data and other attributes inherited from DeviceEventListener:
- __interface_info__ = <PyCObject object at 0x406176f8>
Data and other attributes inherited from PortableServer.Servant:
- __new__ = <built-in method __new__ of type object at 0x407619a0>
- T.__new__(S, ...) -> a new object with type S, a subtype of T
|
class Registry |
| |
Delegates to the actual AT-SPI Regisitry. |
| |
Methods defined here:
- __init__(self)
- deregisterEventListener(self, callback, eventType)
- Unregisters the given eventType and callback with the Registry.
Arguments:
- callback: function to call with an AT-SPI event instance
- eventType: string representing the type of event
- registerEventListener(self, callback, eventType)
- Registers the given eventType and callback with the Registry.
Arguments:
- callback: function to call with an AT-SPI event instance
- eventType: string representing the type of event
- registerKeystrokeListeners(self, callback)
- Registers a single callback for all possible keystrokes.
- start(self)
- Starts event notification with the AT-SPI Registry. This method
only returns after 'stop' has been called.
- stop(self)
- Unregisters any event or keystroke listeners registered with
the AT-SPI Registry and then stops event notification with the
AT-SPI Registry.
| |