mozilla

Revision 325771 of NPP

  • Revision slug: NPP
  • Revision title: NPP
  • Revision id: 325771
  • Created:
  • Creator: ethertank
  • Is current revision? No
  • Comment

Revision Content

{{Np-plugin-api}}

Summary

Represents a single instance of a plug-in. You specify one of these to any NPAPI function that needs to know which plug-in to work with.

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

Revision Source

<div>{{Np-plugin-api}}</div>


<h2 id="Summary" name="Summary">Summary</h2>

<p>Represents a single instance of a plug-in. You specify one of these to any NPAPI function that needs to know which plug-in to work with.</p>

<h2 id="Syntax" name="Syntax">Syntax</h2>
<pre class="syntaxbox">typedef struct _NPP
{
    void* pdata; /* plug-in private data */
    void* ndata; /* Mozilla private data */
} NPP_t;

typedef NPP_t*  NPP;</pre>

<h3 id="Fields" name="Fields">Fields</h3>
<p>The data structure has the following fields:</p>
<dl>
  <dt>
    <code>pdata</code></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>
  <dt>
    <code>ndata</code></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>


<h2 id="Description" name="Description">Description</h2>

<p>Gecko creates an <code>NPP</code> structure for each plug-in instance and passes a pointer to it to <code><a href="/en-US/docs/NPP_New" title="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-US/docs/NPP_Destroy" title="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 <code>NPP</code> pointer is no longer valid.</p>


<h2 id="See_also" name="See_also">See also</h2>
<ul>
  <li><a href="/en-US/docs/NPP_New" title="NPP_New">NPP_New()</a></li>
  <li><a href="/en-US/docs/NPP_Destroy" title="NPP_Destroy">NPP_Destroy()</a></li>
</ul>


<!-- languages( { "fr": "fr/NPP" } ) -->
Revert to this revision