This document describes the Npp plugin "Hello" which is a simple
yet fully functional Npp Plugin that has been written entirely in Ada.

The document and example have been updated to work with 64-bit Notepad++ v7.7.1

The purpose of this exercise is to illustrate that Npp plugins do not need
be written in cryptic languages such as C and all its derivatives but can
also be written in other programming languages.

The example we have written was compiled and linked using the AdaCore
GPL 2019 Ada complier version 8.3.1 using Gprbuild with the supplied
Gnat Project file Hello.gpr

When the plugin Hello.dll is placed in the NPP plugins directory
and NPP started, an extra button is added to the toolbar.

This button shows a green right pointing triangle resembling the standard
play button on music and video players.

At startup a dock-able window called "Messages" is opened at the bottom of
the NPP main window.

In the plugins pulldown a new menu item has been added: Ada Plugin, which
has two sub-items "Promote" and "About"

Selecting either of these causes text to be written into the message window.

Clicking the new toolbar button is equivalent to selecting promote from the
Ada Plugin plugins pulldown.

As this is supposed to be an example of how to write a plugin in Ada we have
chosen to use the latest revision of the language - Ada 2012. However it
should be relatively simple to compile this using earlier versions:
by, for example, changing aspects into pragmas.

We have not tested our plugin using compilers from other vendors however
we do not see any reason why it should not work as we have not knowingly used
any compiler specific features, moreover we have supplied all the required
Windows definitions because these are normally obtained from vendor specific
definition files.

The DLL expects to obtain the button bitmap from its binary image.
Therefore the bitmap needs to be linked as part of the DLL build process.

We used GNAT Winres compiler using the supplied .rc file and Promote.bmp bitmap
to produce the object file resources.o

D:\NppHelloAdaDemo\Npp\Hello> c:\gnat\2019\bin\windres -i Hello.rc --output-format=coff -o Objects\resources.o

Ahlan Marriott & Urs Maurer
White Elephant GmbH
Beckengässchen 1
8200 Schaffhausen 
Switzerland
E: software@white-elephant.ch
