Bug 751598: Sync to npapi-sdk r20. r=bas a=akeybl
authorJosh Aas <joshmoz@gmail.com>
Mon, 14 May 2012 01:52:22 -0400
changeset 95736 56d137349efc6cd0d53bcd88233aff9a98a510fe
parent 95735 35f963416ff0c70975cadc04942aceb757c58780
child 95737 90ff5aa6dfe5c8700dfd4b219aac965efedbe0a5
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbas, akeybl
bugs751598
milestone14.0a2
Bug 751598: Sync to npapi-sdk r20. r=bas a=akeybl
dom/plugins/base/npapi.h
dom/plugins/base/npfunctions.h
--- a/dom/plugins/base/npapi.h
+++ b/dom/plugins/base/npapi.h
@@ -233,17 +233,17 @@ typedef enum {
  * be 0xAARRGGBB. The Alpha channel will be stored in the most significant
  * bits. */
 typedef enum {
   /* 32-bit per pixel 8-bit per channel - premultiplied alpha */
   NPImageFormatBGRA32     = 0x1,
   /* 32-bit per pixel 8-bit per channel - 1 unused channel */
   NPImageFormatBGRX32     = 0x2 
 } NPImageFormat;
- 
+
 typedef struct _NPAsyncSurface
 {
   uint32_t version;
   NPSize size;
   NPImageFormat format;
   union {
     struct {
       uint32_t stride;
@@ -296,35 +296,38 @@ typedef struct
 {
   int32_t type;
   FILE* fp;
 } NPPrintCallbackStruct;
 
 #endif /* XP_UNIX */
 
 typedef enum {
+#if defined(XP_MACOSX)
 #ifndef NP_NO_QUICKDRAW
   NPDrawingModelQuickDraw = 0,
 #endif
-#if defined(XP_MACOSX)
   NPDrawingModelCoreGraphics = 1,
   NPDrawingModelOpenGL = 2,
   NPDrawingModelCoreAnimation = 3,
   NPDrawingModelInvalidatingCoreAnimation = 4,
 #endif
+#if defined(XP_WIN)
   NPDrawingModelSyncWin = 5,
+#endif
+#if defined(MOZ_X11)
   NPDrawingModelSyncX = 6,
+#endif
   NPDrawingModelAsyncBitmapSurface = 7
 #if defined(XP_WIN)
-  , NPDrawingModelAsyncWindowsDXGISurface = 8,
-  NPDrawingModelAsyncWindowsDX9ExSurface = 9
+  , NPDrawingModelAsyncWindowsDXGISurface = 8
 #endif
 } NPDrawingModel;
 
-#if defined(XP_MACOSX)
+#ifdef XP_MACOSX
 typedef enum {
 #ifndef NP_NO_CARBON
   NPEventModelCarbon = 0,
 #endif
   NPEventModelCocoa = 1
 } NPEventModel;
 #endif
 
@@ -399,28 +402,28 @@ typedef enum {
   /* Browsers can retrieve a native ATK accessibility plug ID via this variable. */
   NPPVpluginNativeAccessibleAtkPlugId = 19,
 
   /* Checks to see if the plug-in would like the browser to load the "src" attribute. */
   NPPVpluginCancelSrcStream = 20,
 
   NPPVsupportsAdvancedKeyHandling = 21,
 
-  NPPVpluginUsesDOMForCursorBool = 22
+  NPPVpluginUsesDOMForCursorBool = 22,
 
   /* Used for negotiating drawing models */
-  , NPPVpluginDrawingModel = 1000
+  NPPVpluginDrawingModel = 1000
 #if defined(XP_MACOSX)
   /* Used for negotiating event models */
   , NPPVpluginEventModel = 1001
   /* In the NPDrawingModelCoreAnimation drawing model, the browser asks the plug-in for a Core Animation layer. */
   , NPPVpluginCoreAnimationLayer = 1003
 #endif
 
-#if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
+#if defined(MOZ_PLATFORM_MAEMO) && ((MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6))
   , NPPVpluginWindowlessLocalBool = 2002
 #endif
 } NPPVariable;
 
 /*
  * List of variable names for which NPN_GetValue should be implemented.
  */
 typedef enum {
@@ -444,47 +447,44 @@ typedef enum {
   NPNVPluginElementNPObject = 16,
 
   NPNVSupportsWindowless = 17,
 
   NPNVprivateModeBool = 18,
 
   NPNVsupportsAdvancedKeyHandling = 21,
 
-  NPNVdocumentOrigin = 22
+  NPNVdocumentOrigin = 22,
 
-  /* Used for negotiating drawing models */
-  , NPNVpluginDrawingModel = 1000
+  NPNVpluginDrawingModel = 1000 /* Get the current drawing model (NPDrawingModel) */
 #if defined(XP_MACOSX)
+  , NPNVcontentsScaleFactor = 1001
 #ifndef NP_NO_QUICKDRAW
   , NPNVsupportsQuickDrawBool = 2000
 #endif
   , NPNVsupportsCoreGraphicsBool = 2001
   , NPNVsupportsOpenGLBool = 2002
   , NPNVsupportsCoreAnimationBool = 2003
   , NPNVsupportsInvalidatingCoreAnimationBool = 2004
 #endif
-  , NPNVsupportsSyncDrawingBool = 2005
-  , NPNVsupportsAsyncBitmapSurfaceBool = 2006
+  , NPNVsupportsAsyncBitmapSurfaceBool = 2007
 #if defined(XP_WIN)
-  , NPNVsupportsAsyncWindowsDXGISurfaceBool = 2007
-  , NPNVsupportsAsyncWindowsDX9ExSurfaceBool = 2008
+  , NPNVsupportsAsyncWindowsDXGISurfaceBool = 2008
 #endif
-
 #if defined(XP_MACOSX)
 #ifndef NP_NO_CARBON
   , NPNVsupportsCarbonBool = 3000 /* TRUE if the browser supports the Carbon event model */
 #endif
   , NPNVsupportsCocoaBool = 3001 /* TRUE if the browser supports the Cocoa event model */
   , NPNVsupportsUpdatedCocoaTextInputBool = 3002 /* TRUE if the browser supports the updated
                                                     Cocoa text input specification. */
   , NPNVsupportsCompositingCoreAnimationPluginsBool = 74656 /* TRUE if the browser supports
                                                                CA model compositing */
 #endif
-#if (MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6)
+#if defined(MOZ_PLATFORM_MAEMO) && ((MOZ_PLATFORM_MAEMO == 5) || (MOZ_PLATFORM_MAEMO == 6))
   , NPNVSupportsWindowlessLocal = 2002
 #endif
 } NPNVariable;
 
 typedef enum {
   NPNURLVCookie = 501,
   NPNURLVProxy
 } NPNURLVariable;
--- a/dom/plugins/base/npfunctions.h
+++ b/dom/plugins/base/npfunctions.h
@@ -280,24 +280,24 @@ typedef struct _NPPluginData {   /* Alte
   char *pMimeTypes;
   char *pFileExtents;
   char *pFileOpenTemplate;
   char *pProductName;
   char *pProductDescription;
   unsigned long dwProductVersionMS;
   unsigned long dwProductVersionLS;
 } NPPluginData;
-typedef NPError     (*NP_GetPluginDataFunc)(NPPluginData*);
+typedef NPError     (OSCALL *NP_GetPluginDataFunc)(NPPluginData*);
 NPError OSCALL      NP_GetPluginData(NPPluginData * pPluginData);
 #endif
-typedef NPError     (*NP_GetEntryPointsFunc)(NPPluginFuncs*);
+typedef NPError     (OSCALL *NP_GetEntryPointsFunc)(NPPluginFuncs*);
 NPError OSCALL      NP_GetEntryPoints(NPPluginFuncs* pFuncs);
-typedef NPError     (*NP_InitializeFunc)(NPNetscapeFuncs*);
+typedef NPError     (OSCALL *NP_InitializeFunc)(NPNetscapeFuncs*);
 NPError OSCALL      NP_Initialize(NPNetscapeFuncs* bFuncs);
-typedef NPError     (*NP_ShutdownFunc)(void);
+typedef NPError     (OSCALL *NP_ShutdownFunc)(void);
 NPError OSCALL      NP_Shutdown(void);
 typedef const char* (*NP_GetMIMEDescriptionFunc)(void);
 const char*         NP_GetMIMEDescription(void);
 #ifdef __cplusplus
 }
 #endif
 #endif