NPAPI:Pepper: Difference between revisions

Jump to navigation Jump to search
no edit summary
No edit summary
Line 13: Line 13:


A somewhat related issue is how to extend NPAPI to provide platform independent access to new hardware or software features such as webcams, microphones, etc.  While certainly important, this is deferred to future discussions.
A somewhat related issue is how to extend NPAPI to provide platform independent access to new hardware or software features such as webcams, microphones, etc.  While certainly important, this is deferred to future discussions.
=== Requesting the "Pepper" Platform ===
A plugin may call NPN_GetValue() with the following NPNVariable to query the browser whether it supports the Pepper platform:
<pre>
/* TRUE if the browser supports the Pepper platform */
NPNVsupportsPepperBool = xxxx
</pre>
Once the plugin finds a supported drawing model, it calls NPN_SetValue() to tell the browser which drawing model it will use. We're using the NPNVariable used for Mac drawing model for this:
<pre>
NPNVpluginUsePepperPlatform = xxxx /* TRUE if we should use the Pepper platform */
</pre>


== Out of process plugins ==
== Out of process plugins ==
Line 58: Line 73:


This proposal is clearer at this moment regarding 2D graphics. We expect we may need to pass some state (2d vs. 3d, hardware vs. raster, etc.) in through other calls and/or with some extensions to the data structures we propose below.
This proposal is clearer at this moment regarding 2D graphics. We expect we may need to pass some state (2d vs. 3d, hardware vs. raster, etc.) in through other calls and/or with some extensions to the data structures we propose below.
=== Negotiating the drawing model ===
A plugin may call NPN_GetValue() with the following NPNVariable to query the browser whether it supports the Pepper drawing model:
<pre>
/* TRUE if the browser supports the PepperGraphics drawing model */
NPNVsupportsPepperGraphicsBool = xxxx
</pre>
Once the plugin finds a supported drawing model, it calls NPN_SetValue() to tell the browser which drawing model it will use. We're using the NPNVariable used for Mac drawing model for this:
<pre>
NPNVpluginDrawingModel = 1000 /* The NPDrawingModel specified by the plugin */
</pre>
We will extend the NPDrawingModel enumeration proposed for Mac with another model:
<pre>
typedef enum {
    ...
    NPDrawingModelPepperGraphics = yyy,
} NPDrawingModel;
</pre>


=== An Example ===
=== An Example ===
Line 183: Line 175:


Plugins should receive all their events from NPP_HandleEvent.  We believe that standardizing the event types and payloads based on, for example, DOM events, would be sufficient to provide browser and OS independent events.  If not, the goal can be accomplished by possibly extending the set of event types or data on the event structures to convey more information.
Plugins should receive all their events from NPP_HandleEvent.  We believe that standardizing the event types and payloads based on, for example, DOM events, would be sufficient to provide browser and OS independent events.  If not, the goal can be accomplished by possibly extending the set of event types or data on the event structures to convey more information.
=== Negotiating the event model ===
When the plug-in starts, it negotiates the event model with the browser.
A plug-in may call NPN_GetValue() with the following NPNVariable to query the browser whether it supports the Pepper event model:
<pre>
NPNVsupportsPepperEventBool = zzzz /* TRUE if the browser supports the Pepper event model */
</pre>
Once the plug-in finds a supported event model, it calls NPN_SetValue to tell the browser which event model it has. We're using the NPNVariable introduced for Mac for this:
<pre>
NPPVpluginEventModel = 1001,
</pre>
And we add another value to the NPEventModel enumeration added for the Mac:
<pre>
typedef enum {
    ...
    NPEventModelPepper = tttt,
} NPEventModel;
</pre>


== Plugin Registration ==
== Plugin Registration ==
89

edits

Navigation menu