mozilla

Revision 90529 of NPP

  • Revision slug: NPP
  • Revision title: NPP
  • Revision id: 90529
  • Created:
  • Creator: Sheppy
  • Is current revision? No
  • Comment Copyedit.

Revision Content

{{ Np-plugin-api() }}

Summary

Represents a single instance of a plug-in.

Syntax

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

typedef NPP_t*  NPP;

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.

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.

See Also

NPP_New, NPP_Destroy

Revision Source

<p>
{{ Np-plugin-api() }}
</p>
<h3 name="Summary">Summary</h3>
<p>Represents a single instance of a plug-in.
</p>
<h3 name="Syntax">Syntax</h3>
<pre>typedef struct _NPP
{
    void* pdata; /* plug-in private data */
    void* ndata; /* Mozilla private data */
} NPP_t;

typedef NPP_t*  NPP;
</pre> <h3 name="Fields">Fields</h3>
<p>The data structure has the following fields:
</p>
<dl><dt>pdata
</dt><dd>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.
</dd></dl>
<dl><dt>ndata
</dt><dd>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.
</dd></dl>
<h3 name="Description">Description</h3>
<p>Gecko creates an <code>NPP</code> structure for each plug-in instance and passes a pointer to it to <code><a href="en/NPP_New">NPP_New</a></code>. This pointer -- which is an opaque instance handle of a plug-in -- identifies the instance on which API calls should operate. <code>NPP</code> contains private instance data for both the plug-in and the browser.
</p><p>The <code><a href="en/NPP_Destroy">NPP_Destroy</a></code> function informs the plug-in when the <code>NPP</code> instance is about to be deleted; after this call returns, the NPP pointer is no longer valid.
</p>
<h3 name="See_Also">See Also</h3>
<p><a href="en/NPP_New">NPP_New</a>, <a href="en/NPP_Destroy">NPP_Destroy</a>
</p>
Revert to this revision