Visit Mozilla.org

NPP

From MDC

« Gecko Plugin API Reference « Plug-in Side Plug-in API

Contents

[edit] Summary

Represents a single instance of a plug-in.

[edit] Syntax

typedef struct _NPP
{
    void* pdata; /* plug-in private data */
    void* ndata; /* Mozilla private data */
} NPP_t;

typedef NPP_t*  NPP;

[edit] Fields

The data structure has the following fields:

pdata
A value, whose definition is up to the plug-in, that the plug-in can use to store a pointer to an internal data structure associated with the instance; this field isn't modified by the browser.
ndata
A private value, owned by the browser, which is used to store data associated with the instance; this value should not be modified by the plug-in.

[edit] Description

Gecko creates an NPP structure for each plug-in instance and passes a pointer to it to NPP_New. This pointer -- which is an opaque instance handle of a plug-in -- identifies the instance on which API calls should operate. NPP contains private instance data for both the plug-in and the browser.

The NPP_Destroy function informs the plug-in when the NPP instance is about to be deleted; after this call returns, the NPP pointer is no longer valid.

[edit] See Also

NPP_New, NPP_Destroy