nvda
e3f8a4fd - Add generic framework to enable extensibility at specific points in the code by way of actions, filters and deciders. (issue #3393, PR #7484)

Commit
8 years ago
Add generic framework to enable extensibility at specific points in the code by way of actions, filters and deciders. (issue #3393, PR #7484) This allows interested parties to register to be notified when some action occurs, to modify a specific kind of data or to participate in deciding whether something should be done. There are three types of extension points: 1. An Action might be used to notify interested parties that the configuration profile has been switched. 2. A Filter might be used to allow interested parties to modify spoken messages before they are passed to the synthesizer. 3. A Decider might be used to allow interested parties to prevent execution of input gestures under specific circumstances. Handlers for extension points are always called in the order they were registered so that the order is determinate, which should make behaviour more predictable and easier to reproduce. Handlers can be called with keyword arguments. If a handler doesn't support a particular keyword argument, it will still be called with the keyword arguments that it does support. This means that additional keyword arguments can be added to actions and filters in future without breaking existing handlers. Add a config.configProfileSwitched action and have synthDriverHandler, braille, etc. register for it instead of explicitly calling each handler from the config module.
Author
Parents
Loading