Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions devDocs/developerGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ However, they do differ in some ways.

Custom appModules and globalPlugins can be packaged into NVDA add-ons.
This allows easy distribution, and provides a safe way for the user to install and uninstall the custom code.
Please refer to the Add-ons section later on in this document.
Please refer to the [Add-ons section #Addons] later on in this document.

In order to test the code while developing, you can place it in a special 'scratchpad' directory in your NVDA user configuration directory.
You will also need to configure NVDA to enable loading of custom code from the Developer Scratchpad Directory, by enabling this in the Advanced category of NVDA's Settings dialog.
Expand All @@ -194,7 +194,7 @@ For example, an App Module for notepad would be called notepad.py, as notepad's
For apps hosted inside host executables, see the section on app modules for hosted apps.

App Module files must be placed in the appModules subdirectory of an add-on, or of the scratchpad directory of the NVDA user configuration directory.

App Modules must define a class called AppModule, which inherits from appModuleHandler.AppModule.
This class can then define event and script methods, gesture bindings and other code.
This will all be covered in depth later.
Expand Down Expand Up @@ -283,7 +283,7 @@ As wwahost app module provides necessary infrastructure for apps hosted inside,
++ Basics of a Global Plugin ++
Global Plugin files have a .py extension, and should have a short unique name which identifies what they do.

Global plugin files must be placed in the globalPlugins subdirectory of an add-on, or of the scratchpad directory of the NVDA user configuration directory.
Global plugin files must be placed in the globalPlugins subdirectory of an add-on, or of the scratchpad directory of the NVDA user configuration directory.

Global Plugins must define a class called GlobalPlugin, which inherits from globalPluginHandler.GlobalPlugin.
This class can then define event and script methods, gesture bindings and other code.
Expand Down Expand Up @@ -692,17 +692,17 @@ class AppModule(appModuleHandler.AppModule):
--- end ---
```

+ Packaging Code as NVDA Add-ons +
+ Packaging Code as NVDA Add-ons +[Addons]
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.
Add-on packages are only supported in NVDA 2012.2 and later.
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.
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.

++ Non-ASCII File Names in Zip Archives ++
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.
This means that these files can be extracted properly on all systems, regardless of the system's configured language.
Unfortunately, many zip archivers do not support this, including Windows Explorer.
Generally, it has to be explicitly enabled even in archivers that do support it.
[http://www.7-zip.org/ 7-Zip] supports this, though it must be enabled by specifying the "cu=on" method parameter.
[7-Zip http://www.7-zip.org/] supports this, though it must be enabled by specifying the "cu=on" method parameter.

++ Manifest Files ++
Each add-on package must contain a manifest file named manifest.ini.
Expand Down Expand Up @@ -764,9 +764,9 @@ The following plugins and drivers can be included in an add-on:
-

++ Optional install / Uninstall code ++
If you need to execute code as your add-on is being installed or uninstalled from NVDA (e.g. to validate license information or to copy files to a custom location), you can provide a Python file called installTasks.py in the archive which contains special functions that NVDA will call while installing or uninstalling your add-on.
This file should avoid loading any modules that are not absolutely necessary, especially Python C extensions or dlls from your own add-on, as this could cause later removal of the add-on to fail.
However, if this does happen, the add-on directory will be renamed and then deleted after the next restart of NVDA.
If you need to execute code as your add-on is being installed or uninstalled from NVDA (e.g. to validate license information or to copy files to a custom location), you can provide a Python file called installTasks.py in the archive which contains special functions that NVDA will call while installing or uninstalling your add-on.
This file should avoid loading any modules that are not absolutely necessary, especially Python C extensions or dlls from your own add-on, as this could cause later removal of the add-on to fail.
However, if this does happen, the add-on directory will be renamed and then deleted after the next restart of NVDA.
Finally, it should not depend on the existence or state of other add-ons, as they may not be installed, have already been removed or not yet be initialized.

+++ the onInstall function +++
Expand All @@ -792,7 +792,7 @@ All other fields will be ignored.
+++ Locale-specific Messages +++
Each language directory can also contain gettext information, which is the system used to translate the rest of NVDA's user interface and reported messages.
As with the rest of NVDA, an nvda.mo compiled gettext database file should be placed in the LC_MESSAGES directory within this directory.
to allow plugins in your add-on to access gettext message information via calls to _(), you must initialize translations at the top of each Python module by calling addonHandler.initTranslation().
to allow plugins in your add-on to access gettext message information via calls to _(), you must initialize translations at the top of each Python module by calling addonHandler.initTranslation().
For more information about gettext and NVDA translation in general, please read
https://github.com/nvaccess/nvda/wiki/Translating

Expand Down