What I've seen so far, there can only be one plugin per .dll
file, is that correct? The Browser calls NP_GetEntryPoints
, NP_Initialize
and NP_Shutdown
only "once" per dll, right?
What I'm aiming for is to create multiple plugins in one dynamic library. Is that possible, and if, how?
What I've seen so far, there can only be one plugin per .dll file, is that correct?
No, you can have multiple plugins implemented in one DLL.
The Browser calls NP_GetEntryPoints, NP_Initialize and NP_Shutdown only "once" per dll, right?
Only once per process and loading (keep in mind that it will be unloaded while when no instance is alive anymore).
What I'm aiming for is to create multiple plugins in one dynamic library. Is that possible, and if, how?
It's possible. You just register the different mimetypes for the same dynamic library (e.g. on Windows several mimetype entries in the registry pointing to the same DLL).
NPP_New()
gets a NPMIMEType
as it's first parameter, which let's you identify which "plugin" was requested.
Also, NP_GetMIMEDescription()
needs to be adjusted (used on Linux and Mac OS).
On Windows you should have the list of mimetypes, seperated by |
, in the version info (entry MIMEType
).