NPAPI:CocoaEventModel: Difference between revisions

(New page: == This Document == This proposal was submitted by Anders Carlsson of Apple Computer, Inc. and posted to the plugin-futures (@mozilla.org) mailing list. It has been edited and formatted h...)
 
Line 13: Line 13:
A plug-in may call NPN_GetValue() with the following NPNVariables to query the browser for its supported event models:
A plug-in may call NPN_GetValue() with the following NPNVariables to query the browser for its supported event models:


#ifndef NP_NO_CARBON
#ifndef NP_NO_CARBON
    , NPNVsupportsCarbonBool = 2003 /* TRUE if the browser supports the Carbon event model */
    , NPNVsupportsCarbonBool = 2003 /* TRUE if the browser supports the Carbon event model */
#endif
#endif
    , NPNVsupportsCocoaBool = 2004 /* TRUE if the browser supports the Cocoa event model */
    , NPNVsupportsCocoaBool = 2004 /* 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:
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,
NPPVpluginEventModel = 1001,


The value of the NPPVpluginEventModel is an NPEventModel, a new enumeration we're adding:
The value of the NPPVpluginEventModel is an NPEventModel, a new enumeration we're adding:


typedef enum {
typedef enum {
#ifndef NP_NO_CARBON
#ifndef NP_NO_CARBON
    NPEventModelCarbon = 0,
    NPEventModelCarbon = 0,
#endif
#endif
    NPEventModelCocoa = 1,
    NPEventModelCocoa = 1,
} NPEventModel;
} NPEventModel;


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

edits