NPAPI:CocoaEventModel: Difference between revisions

Jump to navigation Jump to search
Line 51: Line 51:
In the Cocoa event model, NPP_HandleEvent now passes a new struct, NPCocoaEvent, which is shown below:
In the Cocoa event model, NPP_HandleEvent now passes a new struct, NPCocoaEvent, which is shown below:


typedef struct _NPCocoaEvent {
typedef struct _NPCocoaEvent {
    NPCocoaEventType type;
    NPCocoaEventType type;
    union {
    union {
        struct {
        struct {
            uint32 modifierFlags;
            uint32 modifierFlags;
            double pluginX;
            double pluginX;
            double pluginY;             
            double pluginY;             
            int32 buttonNumber;
            int32 buttonNumber;
            int32 clickCount;
            int32 clickCount;
            double deltaX;
            double deltaX;
            double deltaY;
            double deltaY;
            double deltaZ;
            double deltaZ;
        } mouse;
        } mouse;
        struct {
        struct {
            uint32 modifierFlags;
            uint32 modifierFlags;
            NPNSString *characters;
            NPNSString *characters;
            NPNSString *charactersIgnoringModifiers;
            NPNSString *charactersIgnoringModifiers;
            NPBool isARepeat;
            NPBool isARepeat;
             uint16 keyCode;
             uint16 keyCode;
        } key;
        } key;
        struct {
        struct {
    double x, y, width, height;
    double x, y, width, height;
        } draw;
        } draw;
        struct {
        struct {
            NPBool hasFocus;
            NPBool hasFocus;
        } focus;         
        } focus;         
    } event;
    } event;
} NPCocoaEvent;
} NPCocoaEvent;


NPCocoaEventType is one of the following:
NPCocoaEventType is one of the following:
Confirmed users, Bureaucrats and Sysops emeriti
1,680

edits

Navigation menu