I'm running into a problem associating an invoked method in a plugin I'm writing with the appropriate plugin instance. The documentation at http://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Scripting_plugins doesn't give enough information to be truly useful on this.
In a nutshell, I'm trying to understand just which scriptable object the plugin is expected to return in response to a call to NPP_GetValue with the variable argument equal to NPPpluginScriptableNPObject. I'm guessing that there should be an NPObject instance for each instance of the plugin, but how is the invoke() method in the NPClass supposed to find the plugin instance (NPP) from the scriptable NPObject it's given as an argument? I suppose I could implement a lookup table to do that, but I have the feeling there's something obvious I'm missing.
I'm storing a pointer to an instance of a C++ class (the instance implements the functionality of the plugin) in the pdata member of the NPP, in NPP_New().