NPAPI:CocoaEventModel: Difference between revisions

Jump to navigation Jump to search
Line 13: Line 13:
== Event model negotiation ==
== Event model negotiation ==


When the plug-in starts, it negotiates the event model with the browser.
For documentation on negotiating event models, see [[NPAPI:Models]]. The event model variables for Cocoa are:


A plug-in may call NPN_GetValue() with the following NPNVariables to query the browser for its supported event models:
* NPEventModelCocoa
 
* NPNVsupportsCocoaBool
#ifndef NP_NO_CARBON
    , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon event model */
#endif
    , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
 
Once the plug-in finds a supported event model, it calls NPN_SetValue to tell the browser which event model it has. We're adding a new NPNVariable for this:
 
NPPVpluginEventModel = 1001,
 
The value of the NPPVpluginEventModel is an NPEventModel, a new enumeration we're adding:
 
typedef enum {
#ifndef NP_NO_CARBON
    NPEventModelCarbon = 0,
#endif
    NPEventModelCocoa = 1,
} NPEventModel;


== The Carbon event model ==
== The Carbon event model ==
Confirmed users, Bureaucrats and Sysops emeriti
1,680

edits

Navigation menu