You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -297,10 +297,10 @@ As with other examples in this guide, remember to delete the created app module
297
297
298
298
++ App modules for hosted apps ++
299
299
Some executables host various apps inside.
300
-
These include javaw.exe for running various java programs and wwahost.exe for some apps in Windows 8 and later.
300
+
These include javaw.exe for running various Java programs and wwahost.exe for some apps in Windows 8 and later.
301
301
302
302
If an app runs inside a host executable, the name of the app module must be the name as defined by the host executable, which can be found through AppModule.appName property.
303
-
For example, an app module for a java app named "test" hosted inside javaw.exe must be named test.py.
303
+
For example, an app module for a Java app named "test" hosted inside javaw.exe must be named test.py.
304
304
For apps hosted inside wwahost, not only must the app module name be the name of the loaded app, but the app module must subclass the app module class found in wwahost.
305
305
306
306
++ Example 2: an app module for an app hosted by wwahost.exe ++
@@ -418,7 +418,7 @@ For example, a list's first child would be the first list item.
418
418
-
419
419
420
420
There are also a few simplified navigation properties such as simpleParent, simpleNext, simpleFirstChild and simpleLastChild.
421
-
These are like their respective navigation properties described above, but NVDA filters out unuseful objects.
421
+
These are like their respective navigation properties described above, but NVDA filters out useless objects.
422
422
These properties are used when NVDA's simple review mode is turned on, which is the default.
423
423
These simple properties may be easier to use, but the real navigation properties more closely reflect the underlying Operating System structure.
424
424
Also, these may change in future versions of NVDA as improvements are made to simple review, so they should generally be avoided when programmatically locating specific objects.
@@ -741,7 +741,7 @@ class AppModule(appModuleHandler.AppModule):
741
741
--- end ---
742
742
```
743
743
744
-
++ Parsing additional command line arguments in your plugin ++
744
+
++ Parsing additional command line arguments in your plugin ++[PluginCLIArgs]
745
745
By default NVDA accepts limited set of command line arguments and shows an error for an unknown ones.
746
746
However if you want to use any additional arguments, this is possible by adding a handler to the extension point ``addonHandler.isCLIParamKnown``.
747
747
Note that since command line arguments are processed just after NVDA starts, your add-on needs to process them in the global plugin, since app modules or other drivers may not be loaded at this stage.
To make it easy for users to share and install plugins and drivers, they can be packaged in to a single NVDA add-on package which the user can then install into a copy of NVDA via the Add-ons Manager found under Tools in the NVDA menu.
763
763
Add-on packages are only supported in NVDA 2012.2 and later.
764
-
An add-on package is simply a standard zip archive with the file extension of nvda-addon which contains a manifest file, optional install/uninstall code and one or more directories containing plugins and/or drivers.
764
+
An add-on package is simply a standard zip archive with the file extension of "``nvda-addon``" which contains a manifest file, optional install/uninstall code and one or more directories containing plugins and/or drivers.
765
765
766
766
++ Non-ASCII File Names in Zip Archives ++
767
767
If your add-on includes files which contain non-ASCII (non-English) characters, you should create the zip archive such that it uses UTF-8 file names.
@@ -804,7 +804,7 @@ All string values must be enclosed in quotes as shown in the example below.
804
804
805
805
The lastTestedNVDAVersion field in particular is used to ensure that users can be confident about installing an add-on.
806
806
It allows the add-on author to make an assurance that the add-on will not cause instability, or break the users system.
807
-
When this is not provided, or is less than the current version of NVDA (ignoring minor point updates EG 2018.3.1) then the user will be warned not to install the add-on.
807
+
When this is not provided, or is less than the current version of NVDA (ignoring minor point updates e.g. 2018.3.1) then the user will be warned not to install the add-on.
808
808
809
809
+++ An Example Manifest File +++
810
810
```
@@ -947,3 +947,103 @@ There are some special functions:
947
947
- snap(): Takes a snapshot of the current state of NVDA and saves it in the [snapshot variables #PythonConsoleSnapshotVariables].
948
948
- rmSnap(): Removes all snapshot variables.
949
949
-
950
+
951
+
+ Extension Points +[ExtensionPoints]
952
+
NVDA's ``extensionPoints`` module, allows code in different parts of NVDA, or in add-ons, to perform tasks such as:
953
+
- Be notified when an action occurs or a state is changed.
954
+
- Receive, as part of being notified, variables related to the action or changed state.
955
+
- Cancel or alter an action NVDA was going to take, based upon certain conditions.
956
+
- Modify data that NVDA is using (such as changing speech sequences or braille, before they are spoken or brailled).
957
+
- Delay something NVDA is doing, while intervening operations are performed.
958
+
-
959
+
960
+
There are five kinds of extension point:
961
+
962
+
|| Type | Purpose |
963
+
| ``Action`` | Allows some code to find out what other code is doing. For example, an add-on can be notified before or after a config profile changes. |
964
+
| ``Filter`` | Edits data. A filter registered in the speech module, might allow changing speech strings before they are spoken. |
965
+
| ``Decider`` | Runs each registered handler until one of them returns ``False``. If one does, it can be used to prevent the invoking code from running. |
966
+
| ``AccumulatingDecider`` | Like ``Decider``, but always runs all of its registered handlers, and only decides if one of them failed at the end. The default decision is ``True`` by default, but can be set to ``False``. |
967
+
| ``Chain`` | Allows registering handlers that return iterables (mainly generators). Calling ``iter`` on the ``Chain`` returns a generator that iterates over all the handlers. |
968
+
969
+
The sections below provide the list of currently defined extension points in NVDA, along with brief descriptions for them.
970
+
Please see code documentation in the associated files, or the code itself, for further explanation.
971
+
The section titles below represent the package or module in which the listed extension points are defined.
972
+
973
+
For examples of how to define and use new extension points, please see the code documentation of the ``extensionPoints`` module.
974
+
975
+
++ braille ++[brailleExtPts]
976
+
|| Type | Extension Point | Description |
977
+
| ``Filter`` | ``filter_displaySize`` | Allows components or add-ons to change the display size used for braille output. |
| Decider | decide_enabled | Allows deciding whether the braille handler should be forcefully disabled. |
982
+
983
+
++ appModuleHandler ++[appModuleHandlerExtPts]
984
+
|| Type | Extension Point | Description |
985
+
| Action | post_appSwitch | Triggered when the foreground application changes |
986
+
987
+
++ addonHandler ++[addonHandlerExtPts]
988
+
|| Type | Extension Point | Description |
989
+
| Accumulating Decider | isCLIParamKnown | Allows adding NVDA commandline parameters which apply to plugins. See [this section of the Dev Guide #PluginCLIArgs] for more information. |
990
+
991
+
++ brailleViewer ++[brailleViewerExtPts]
992
+
|| Type | Extension Point | Description |
993
+
| Action | postBrailleViewerToolToggledAction | Triggered every time the Braille Viewer is created / shown or hidden / destroyed. |
994
+
995
+
++ config ++[configExtPts]
996
+
|| Type | Extension Point | Description |
997
+
| Action | post_configProfileSwitch | Notifies after the configuration profile has been switched. |
998
+
| Action | pre_configSave | Notifies before NVDA's configuration is saved to disk. |
999
+
| Action | post_configSave | Notifies after NVDA's configuration has been saved to disk. |
1000
+
| Action | pre_configReset | Notifies before configuration is reloaded from disk or factory defaults are applied. |
1001
+
| Action | post_configReset | Notifies after configuration has been reloaded from disk or factory defaults were applied. |
1002
+
1003
+
++ core ++[coreExtPts]
1004
+
|| Type | Extension Point | Description |
1005
+
| ``Action`` | ``postNvdaStartup`` | Notifies after NVDA has finished starting up. |
1006
+
1007
+
++ inputCore ++[inputCoreExtPts]
1008
+
|| Type | Extension Point | Description |
1009
+
| Decider | decide_executeGesture | Notifies when a gesture is about to be executed, allowing other code to decide if it should be. |
1010
+
1011
+
++ nvwave ++[nvwaveExtPts]
1012
+
|| Type | Extension Point | Description |
1013
+
| Decider | decide_playWaveFile | Notifies when a wave file is about to be played, allowing other code to decide if it should be. |
| Action | pre_handleWindowMessage | Notifies when NVDA receives a window message, allowing components to perform an action when certain system events occur. |
1032
+
1033
+
++ bdDetect ++[bdDetectExtPts]
1034
+
|| Type | Extension Point | Description |
1035
+
| Chain | scanForDevices | Can be iterated to scan for braille devices. |
0 commit comments