89
edits
Line 183: | Line 183: | ||
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 == |
edits