Netscape DevEdge

Skip to: [content] [navigation]

TOC PREV NEXT

plug-ins!


NPP_HandleEvent


Delivers a platform-specific window event to the instance.

For Windowed Plug-ins: Currently used only on Mac OS.

For Windowless Plug-ins: Windows and Mac OS.

Syntax

#include <npapi.h>
 
int16 NPP_HandleEvent(NPP instance, void* event);
 

Parameters

The function has the following parameters:

instance
 
Pointer to the current plug-in instance.
event
 

Platform-specific value representing the event handled by the function. Values:

MS Windows: Pointer to NPEvent structure

Mac OS: Pointer to a standard Mac OS EventRecord

For a list of possible events for MS Windows and Mac OS, see NPEvent.


Returns

If the plug-in handles the event, the function should return true.

If the plug-in ignores the event, the function returns false.

Description

The browser calls NPP_HandleEvent to tell the plug-in when events take place in the plug-in's window or drawable area. The plug-in either handles or ignores the event, depending on the value given in the event parameter of this function. For a list of event types the application is responsible for delivering to the plug-in, see the NPEvent structure.

MS Windows

The browser gives each windowed plug-in its own native window, often a child window of the browser window, to draw into. The plug-in has complete control over drawing and event handling within that window. §

Mac OS

The browser does not give a windowed plug-in a native window, because the Mac OS platform does not support child windows. Instead, the windowed plug-in draws into the graphics port associated with the the browser window, at the offset that the browser specifies. For this reason, NPP_HandleEvent is only way the plug-in can receive events from its host application on Mac OS. When NPP_HandleEvent is called, the current port is set up so that its origin matches the top-left corner of the plug-in. A plug-in does not need to set up the current port for mouse coordinate translation. §

See Also

NPEvent
 


Netscape Communications
http://developer.netscape.com
TOC PREV NEXT
A+R