| Trees | Indices | Help |
|---|
|
|
object --+
|
UIElement.UIE --+
|
AEOutput
Defines the base class for all output devices. All output devices used by LSR should derive from this class and should implement the methods defined here. All methods defined here raise NotImplementedError to ensure that derived classes create appropriate implementions.
|
|||
| AEOutput.Style class |
STYLE Style class to use when constructing style objects for this device. |
||
|
|||
|
|||
| list of string |
|
||
|
|||
|
|||
|
|||
| AEState |
|
||
| AEOutput.Style |
|
||
| list of AEOutput.Style |
|
||
|
|||
|
|||
|
|||
| AEOutput |
|
||
| object |
|
||
| boolean |
|
||
|
Inherited from Inherited from |
|||
|
|||
| boolean |
USE_THREAD = NoneShould this device use a separate thread to queue output? Devices that block while doing output (e.g. |
||
| string |
COMMAND_CHARS = ''String of characters that are treated as commands on the device implementing this interface. |
||
|
|||
| dictionary |
styles Mapping from arbitrary, immutable keys to style objects |
||
|
|||
|
Inherited from |
|||
|
|||
Initializes the styles dictionary and default style object.
|
Gets a list of strings representing the capabilities of this device. Typical output capabilities include "audio" and "braille" though others are certainly possible. The DeviceManager will only load a device if another device doesn't already provide all of its capabilities.
|
Called after the init method by the DeviceManager to ensure that the device is functioning before time is spent unserializing its style data. Calls the init method on the default style object and provides it with a reference to this initialized device. Then tries to load the persisted setting values from disk. If that fails, the DeviceManager will try to call createDistinctStyles instead.
Note: This method should not be overriden by a subclass. See postInit if you need to run code after the styles are created or restored from disk. |
Persists styles to disk. Called after the close method by the DeviceManager to ensure the device is properly shutdown before serializing its data.
Note: This method should not be overriden by a subclass. |
Stores the style object under the given key. The style object should be one previously generated by this device (e.g. using createDistinctStyles) but it is not an enforced requirement. Always makes the style clean before storing it. |
Gets the style object stored under the given key. If the key is unknown, returns an empty flyweight backed by the default style and stores the new style in styles. |
Gets the default style of the device.
|
Creates a default set of distinct styles for this device. The device should instantiate AEOutput.Style objects having properties that reflect the capabilities of this device, leaving any unsupported fields set to the value of None. A total number of num_groups + num_layers style objects should be returned. The properties of the style object should be set so as to distinguish content presented using the style. For instance, audio devices may distinguish styles in the following recommended manner:
For Braille and magnification devices, don't implement this method unless you have some creative way of making the device respond differently to the semantic tags defined in AEConstants. The total number of requested styles (num_groups * num_layers) must be returned. If the device cannot honor the request for the number of distinct styles it is asked to generate, it may duplicate styles it has already created using AEState.Base.AEState.copy to fulfill the quota. The device is not expected to create distinct styles across invocations of this method. This method should only be called once by DeviceManager to create a default set of styles for the device if the manager cannot load previously persisted settings from disk. If this method is not implemented, calls to getStyle during normal operation of the DeviceManager will end up making copies based on the default style.
|
Called after the instance is created to initialize the device. May be called to re-initialize the device after a call to close.
|
Called after the init method and after either loadStyles or createDistinctStyles. Override this method to perform additional initilization after the setting values are available.
|
Closes an initialized output device.
|
Gets the object that the DeviceManager will use to communicate with this device. The returned object may either be a proxy (e.g. a thread) or this device itself.
|
Sends arbitrary data to a device. The device must recognize the name in order to decide what to do with the value data. If given, the style object is used to decide how the data should be presented if it is content to be rendered. This is a generic method which receives all content and commands to be rendered and executed on a device. Standard name identifiers should be used whenever possible. For instance, AEConstants.Output.CMD_STOP and AEConstants.Output.CMD_TALK. However, device specific names and values are certainly possible.
|
Indicates whether the device is active (e.g. giving output, has buffered content to output, is otherwise busy) or not.
|
|
|||
USE_THREADShould this device use a separate thread to queue output? Devices that block while doing output (e.g. serial Braille device) should use a thread to keep the main thread unlocked and responsive. Defaults to None so a subclass must override it with an explicit boolean value.
|
COMMAND_CHARSString of characters that are treated as commands on the device implementing this interface. These characters are replaced with blanks in any string sent to the device.
|
| Trees | Indices | Help |
|---|
| Generated by Epydoc 3.0beta1 on Mon Jun 4 15:33:17 2007 | http://epydoc.sourceforge.net |