The Wayback Machine - https://web.archive.org/web/20120508051526/https://wiki.mozilla.org/NPAPI:ExtendedXEventModel

Personal tools

NPAPI:ExtendedXEventModel

From MozillaWiki

Jump to: navigation, search

Contents

Status

Under consideration.

Contributors

Overview

The default X event model simply sends a native X event as the argument to NPP_HandleEvent. The extended X event model sends a struct with an event type and an event pointer to allow for events that are not native X events.

NPEventModelX

As NPEventModelExtendedX will be the first alternative to the default X event model, we'll designate the original model:

NPEventModelExtendedX

For documentation on negotiating drawing models, see NPAPI:Models. The event model variables for extended X events are:

Event Structure

 typedef enum {
   NPXEventTypeXEvent = 0, /* event is native X event */
   NPXEventTypeDrawImage = 1 /* used with NPDrawingModelDrawImage */
   /* this can be extended */
 } NPXEventType;
 
 typedef struct _NPExtendedXEvent
 {
   NPXEventType type;
   void *event;
 } NPExtendedXEvent;

The events that the browser actually sends will depend on the associated drawing model. For example, if a plugin were to select NPEventModelExtendedX and not NPDrawingModelDrawImage, then the plugin would simply receive the same events as in NPEventModelX but wrapped in the NPEventModelExtendedX structure and of type NPXEventTypeXEvent.

HTTPS · web.archive.org
← Home