NPAPI:Models

From MozillaWiki
Revision as of 18:24, 22 April 2010 by Josh (talk | contribs) (Created page with '= Status = Accepted. = Problem Summary = In order to allow revised event and drawing APIs, NPAPI now includes the concept of event and drawing models. Plugins can negotiate wi…')
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Status

Accepted.

Problem Summary

In order to allow revised event and drawing APIs, NPAPI now includes the concept of event and drawing models. Plugins can negotiate with browsers to select an event and a drawing model per instance, during NPP_New.

Specification

NPAPI Event and Drawing Models

  • Last modified: April 22, 2010
  • Authors: Anders Carlsson (Apple), Josh Aas (Mozilla Corporation)
  • Contributors:

Browsers should include support for variables that allow the plugin to query for event and drawing model support. Variables should be named based on the following examples:

  • Cocoa event model: NPNVsupportsCocoaBool
  • Core Graphics drawing model: NPNVsupportsCoreGraphicsBool

There will be platform-specific default event and drawing models, which may not have a named designation for legacy reasons. When there is no designation, plugins can assume support for the default model exists. Major current defaults are:

  • Windows (all versions)
    • Windowed plugins
      • Event model: Native HWND event handling, model undesignated
      • Drawing model: Draw to HWND, model undesignated
    • Windowless Plugins
      • Event model: Legacy Win32-based event handling, model undesignated
      • Drawing model: Legacy Win32-based drawing, model undesignated
  • Linux
    • Windowed plugins
      • Event model: Native X event handling, model undesignated
      • Drawing model: Native X drawing, model undesignated
    • Windowless Plugins
      • Event model: Legacy X event handling, model undesignated
      • Drawing model: Legacy X drawing, model undesignated
  • Mac OS X
    • 32-bit
      • Event model: Carbon, NPNVsupportsCarbonBool
      • Drawing model: Quickdraw, NPNVsupportsQuickDrawBool
    • 64-bit
      • Event model: Cocoa, NPNVsupportsCocoaBool
      • Drawing model: Core Graphics, NPNVsupportsCoreGraphicsBool